关于微信小程序跳转PC端H5页面

1.需要配置业务域名
2.没有配置业务域名,连接本地调试的:


image.png

目前没能在真机上调试
3.form.wxml页面

<view>
  <web-view src="{{src}}"></web-view>
</view>
// src为跳转路径
// 

form.js

const app = getApp() //获取应用实例
Page({
  data: {
    src: ''
  },
  onLoad: function (options) {
    // console.log(app.globalData.projectData.id)
    // console.log(options.followInfo)
    let followInfoId = options.followInfoId
    // console.log(followInfo)
    let time = options.time
    this.setData({
      src: `http://XXX?isHide=1&id=${followInfoId}&followUpTime=${time}
      &token=${app.globalData.token}&wxSystemId=${app.globalData.projectData.id}`
    })
    // console.log(this.data.src)
  }
})

4.PC端处理

// 由小程序跳转来的,配置请求头
if (GET_URL_RATMS('wxSystemId')) {
    config.headers['deviceTag'] = 'app'
}
···
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。