Explorar o código

support register channel

joe %!s(int64=3) %!d(string=hai) anos
pai
achega
78710fc0e6

+ 1 - 0
view/xcx/app.js

@@ -108,6 +108,7 @@ App({
         isFixed: false,
         unread: 0, // 未读消息条数
         show_benefit: false, // 是否显示赔付比例
+        channel: 0,
     },
 
     /**

+ 1 - 0
view/xcx/components/authorize/authorize.js

@@ -145,6 +145,7 @@ Component({
             let that = this;
             userInfo.spread_spid = app.globalData.spid; //获取推广人ID
             userInfo.spread_code = app.globalData.code; //获取推广人分享二维码ID
+            userInfo.ch = app.globalData.channel // 注册渠道
             // 发送到后台
             login(userInfo).then(res => {
                 app.globalData.token = res.data.token;

+ 4 - 0
view/xcx/pages/index/index.js

@@ -131,6 +131,10 @@ Page({
         // a === 'share'
         // id 商品ID
         // spid spread_id
+        // ch 渠道
+        if (options.ch) {
+            app.globalData.channel = options.ch
+        }
         if (options.a && options.a == 'share' && options.id && options.spid) {
             wx.navigateTo({
                 url: '/pages/goods_details/index?id=' + options.id + '&spid=' + options.spid,