石广澎
2024-09-03 53d549839c8568f6e45fe14ae1e8c4bebe159ead
feat(支付):
1、改为hash路由
2、页面显示错误原因
1 文件已重命名
5个文件已修改
45 ■■■■■ 已修改文件
common/config.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pay/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pay/scanpay.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/config.js
@@ -17,15 +17,14 @@
}
// 正式
const prod = {
    webURL: 'https://sfzf.cpbtsoft.cn',
    // baseURL: 'https://jyy.hepost.com:20773/prod-api',
    baseURL: 'https://sfzf.cpbtsoft.cn/pay-api/prod-api',
    webURL: 'https://uif.hepost.com',
    baseURL: 'https://jyy.hepost.com:20773/prod-api',
    wx_appid: 'wx4c146dba764dcb05',
    ali_appid: '2021004149689887'
}
module.exports = {
    config: process.env.NODE_ENV === 'development' ? dev : prod,
    config: process.env.NODE_ENV === 'development' ? dev : test,
    ACCESSTOKEN: "Authorization",
    /* 是否打印请求日志 */
    DEBUG: false
main.js
@@ -11,8 +11,6 @@
App.mpType = 'app'
uni.$u.props.text.color = '#333333'
// import store from '@/store/index.js'
// Vue.prototype.$store = store
Vue.config.ignoredElements.push('wx-open-launch-weapp')
manifest.json
@@ -73,8 +73,8 @@
    "h5" : {
        "title" : "佰惠付",
        "router" : {
            "base" : "/",
            "mode" : "history"
            "base" : "./",
            "mode" : "hash"
        },
        "devServer" : {
            "proxy" : {
pages.json
@@ -4,6 +4,17 @@
    },
    "pages": [
        {
            "path": "pay/index",
            "style": {
                "navigationBarTitleText": "佰惠付",
                "enablePullDownRefresh": false
                // #ifdef H5
                ,
                "navigationStyle": "custom"
                // #endif
            }
        },
        {
            "path": "pay/scanpay",
            "style": {
                "navigationBarTitleText": "向商家付款",
@@ -24,19 +35,6 @@
                "navigationStyle": "custom"
                // #endif
            }
        },
        {
            "path": "pay/login",
            "style": {
                "navigationBarTitleText": "佰惠付",
                "enablePullDownRefresh": false
                // #ifdef H5
                ,
                "navigationStyle": "custom"
                // #endif
            }
        }
    ],
    "globalStyle": {
pay/index.vue
File was renamed from pay/login.vue
@@ -19,7 +19,7 @@
      this.opt = opt
        },
    onShow() {
      let redirect_uri = `${config.webURL}/pay/scanpay?cid=${this.opt.cid||''}&shopId=${this.opt.shopId||''}&activityQrcodeId=${this.opt.activityQrcodeId||''}&smoney=${this.opt.smoney||''}`
      let redirect_uri = `${config.webURL}/#/pay/scanpay?cid=${this.opt.cid||''}&shopId=${this.opt.shopId||''}&activityQrcodeId=${this.opt.activityQrcodeId||''}&smoney=${this.opt.smoney||''}`
      if(this.platform==2&&uni.getStorageSync('OPENID')){
        window.location.href = redirect_uri
        return
pay/scanpay.vue
@@ -312,7 +312,7 @@
    /*授权unionid*/
    toRegister() {
      if (this.payWay == 2) {
        const redirect_uri = encodeURIComponent(`${config.webURL}/pay/scanpay?cid=${this.cid || ''}&shopId=${this.shopId || ''}&activityQrcodeId=${this.activityQrcodeId || ''}&smoney=${this.smoney || ''}`)
        const redirect_uri = encodeURIComponent(`${config.webURL}/#/pay/scanpay?cid=${this.cid || ''}&shopId=${this.shopId || ''}&activityQrcodeId=${this.activityQrcodeId || ''}&smoney=${this.smoney || ''}`)
        uni.clearStorageSync()
        window.location.href =
            `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.wx_appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`
@@ -359,10 +359,10 @@
          res.logoImage = config.baseURL + res.logoImage
        }
        this.shopInfo = res
      }).catch(() => {
      }).catch((err) => {
        clearTimeout(timer)
        this.shopInfo.scanFlag = 0
        this.tips = '当前用户过多,请稍后重试~_~'
        this.tips = err.description||'当前用户过多,请稍后重试~_~'
        this.loading = false
      })