diff --git a/app.js b/app.js index b549e98..89c41a4 100644 --- a/app.js +++ b/app.js @@ -60,8 +60,16 @@ App({ * 记录推荐人id */ saveRefereeId(refereeId) { - if (!wx.getStorageSync('referee_id')) - wx.setStorageSync('referee_id', refereeId); + let App = this; + refereeId = parseInt(refereeId); + if (refereeId <= 0 || refereeId == App.getUserId()) { + return false; + } + if (wx.getStorageSync('referee_id')) { + return false; + } + wx.setStorageSync('referee_id', refereeId); + return true; }, /** @@ -75,8 +83,26 @@ App({ * 当小程序启动,或从后台进入前台显示,会触发 onShow */ onShow(options) { - // 获取小程序基础信息 - // this.getWxappBase(); + let App = this; + try { + const livePlayer = requirePlugin('live-player-plugin'); + if (options.scene == 1007 || options.scene == 1008 || options.scene == 1044) { + livePlayer.getShareParams() + .then(res => { + // 直播页面的自定义参数 + let customParams = res.custom_params; + console.log('get custom params', customParams); + // 记录推荐人ID + if (customParams.hasOwnProperty('referee_id')) { + App.saveRefereeId(customParams['referee_id']); + } + }).catch(err => { + console.log('get share params', err) + }); + } + } catch (error) { + + } }, /** @@ -113,7 +139,7 @@ App({ mask: true, duration: 1500, success() { - callback && (setTimeout(function() { + callback && (setTimeout(() => { callback(); }, 1500)); } @@ -129,7 +155,7 @@ App({ content: msg, showCancel: false, success(res) { - // callback && (setTimeout(function() { + // callback && (setTimeout(() => { // callback(); // }, 1500)); callback && callback(); @@ -151,7 +177,7 @@ App({ // check_login = true; // 构造get请求 - let request = function() { + let request = () => { data.token = wx.getStorageSync('token'); wx.request({ url: _this.api_root + url, @@ -170,7 +196,7 @@ App({ wx.hideNavigationBarLoading(); _this.doLogin(2); } else if (res.data.code === 0) { - _this.showError(res.data.msg, function() { + _this.showError(res.data.msg, () => { fail && fail(res); }); return false; @@ -179,7 +205,7 @@ App({ } }, fail(res) { - _this.showError(res.errMsg, function() { + _this.showError(res.errMsg, () => { fail && fail(res); }); }, @@ -225,7 +251,7 @@ App({ _this.doLogin(1); return false; } else if (res.data.code === 0) { - _this.showError(res.data.msg, function() { + _this.showError(res.data.msg, () => { fail && fail(res); }); return false; @@ -234,7 +260,7 @@ App({ }, fail(res) { // console.log(res); - _this.showError(res.errMsg, function() { + _this.showError(res.errMsg, () => { fail && fail(res); }); }, @@ -262,11 +288,11 @@ App({ return false; } const updateManager = wx.getUpdateManager(); - updateManager.onCheckForUpdate(function(res) { + updateManager.onCheckForUpdate(res => { // 请求完新版本信息的回调 // console.log(res.hasUpdate) }); - updateManager.onUpdateReady(function() { + updateManager.onUpdateReady(() => { wx.showModal({ title: '更新提示', content: '新版本已经准备好,即将重启应用', @@ -279,7 +305,7 @@ App({ } }); }); - updateManager.onUpdateFailed(function() { + updateManager.onUpdateFailed(() => { // 新的版本下载失败 wx.showModal({ title: '更新提示', diff --git a/app.wxss b/app.wxss index feef6ea..2facc38 100644 --- a/app.wxss +++ b/app.wxss @@ -24,7 +24,7 @@ page { .no-more { text-align: center; color: #737373; - padding: 10px 0; + padding: 20rpx 0; } .yoshop-notcont { diff --git a/pages/dealer/withdraw/apply/apply.js b/pages/dealer/withdraw/apply/apply.js index 57d9b1a..905a897 100644 --- a/pages/dealer/withdraw/apply/apply.js +++ b/pages/dealer/withdraw/apply/apply.js @@ -133,16 +133,19 @@ Page({ dealerSubmsg = _this.data.submsgSetting.dealer; dealerSubmsg.withdraw_01.template_id != '' && tmplIds.push(dealerSubmsg.withdraw_01.template_id); dealerSubmsg.withdraw_02.template_id != '' && tmplIds.push(dealerSubmsg.withdraw_02.template_id); - if (tmplIds.length > 0) { - wx.requestSubscribeMessage({ - tmplIds, - success(res) {}, - fail(res) {}, - complete(res) { - callback && callback(); - }, - }); + + if (tmplIds.length == 0) { + callback && callback(); + return; } + wx.requestSubscribeMessage({ + tmplIds, + success(res) {}, + fail(res) {}, + complete(res) { + callback && callback(); + }, + }); }, /** diff --git a/pages/live/index.js b/pages/live/index.js index 6731be7..fad1426 100644 --- a/pages/live/index.js +++ b/pages/live/index.js @@ -197,7 +197,8 @@ Page({ onTargetLiveRoomIndex(e) { let roomId = e.currentTarget.dataset.id; let customParams = { - path: 'pages/index/index' + path: 'pages/index/index', + referee_id: App.getUserId(), // 分销推荐人 }; wx.navigateTo({ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}&custom_params=${encodeURIComponent(JSON.stringify(customParams))}` diff --git a/pages/order/refund/index.js b/pages/order/refund/index.js index ce9c78f..66cc7a3 100644 --- a/pages/order/refund/index.js +++ b/pages/order/refund/index.js @@ -156,16 +156,19 @@ Page({ _onRequestSubscribeMessage(callback) { let _this = this; let tmplItem = _this.data.submsgSetting.order.refund.template_id; - if (tmplItem.length > 0) { - wx.requestSubscribeMessage({ - tmplIds: [tmplItem], - success(res) {}, - fail(res) {}, - complete(res) { - callback && callback(); - }, - }); + + if (tmplItem.length == 0) { + callback && callback(); + return; } + wx.requestSubscribeMessage({ + tmplIds: [tmplItem], + success(res) {}, + fail(res) {}, + complete(res) { + callback && callback(); + }, + }); }, }) \ No newline at end of file diff --git a/pages/sharing/active/index.js b/pages/sharing/active/index.js index c983189..c0ca5f4 100644 --- a/pages/sharing/active/index.js +++ b/pages/sharing/active/index.js @@ -55,16 +55,19 @@ Page({ _onRequestSubscribeMessage(callback) { let _this = this; let tmplItem = _this.data.setting.order_submsg.active_status; - if (tmplItem.length > 0) { - wx.requestSubscribeMessage({ - tmplIds: [tmplItem], - success(res) {}, - fail(res) {}, - complete(res) { - callback && callback(); - }, - }); + + if (tmplItem.length == 0) { + callback && callback(); + return; } + wx.requestSubscribeMessage({ + tmplIds: [tmplItem], + success(res) {}, + fail(res) {}, + complete(res) { + callback && callback(); + }, + }); }, /** diff --git a/pages/sharing/order/refund/index.js b/pages/sharing/order/refund/index.js index f63feeb..95bd69b 100644 --- a/pages/sharing/order/refund/index.js +++ b/pages/sharing/order/refund/index.js @@ -156,16 +156,19 @@ Page({ _onRequestSubscribeMessage(callback) { let _this = this; let tmplItem = _this.data.submsgSetting.order.refund.template_id; - if (tmplItem.length > 0) { - wx.requestSubscribeMessage({ - tmplIds: [tmplItem], - success(res) {}, - fail(res) {}, - complete(res) { - callback && callback(); - }, - }); + + if (tmplItem.length == 0) { + callback && callback(); + return; } + wx.requestSubscribeMessage({ + tmplIds: [tmplItem], + success(res) {}, + fail(res) {}, + complete(res) { + callback && callback(); + }, + }); }, }) \ No newline at end of file diff --git a/pages/sharp/goods/index.js b/pages/sharp/goods/index.js index 0f8a358..44c73a9 100644 --- a/pages/sharp/goods/index.js +++ b/pages/sharp/goods/index.js @@ -512,7 +512,7 @@ Page({ sharp_goods_id: _this.data.sharp_goods_id, }); return { - title: _this.data.detail.goods_name, + title: _this.data.goods.goods_name, path: `/pages/sharp/goods/index?${params}` }; }, diff --git a/version.json b/version.json index 53f36d4..073a062 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "1.1.41" + "version": "1.1.42" } diff --git a/wxParse/wxParse.wxss b/wxParse/wxParse.wxss index 29714e2..86d87b5 100644 --- a/wxParse/wxParse.wxss +++ b/wxParse/wxParse.wxss @@ -6,7 +6,7 @@ line-height: 1.8; } -view { +.view { word-break: break-all; /* overflow: auto; */ } @@ -146,7 +146,7 @@ view { .wxParse-video-video { width: 100%; - height: 100%; + /* height: 100%; */ } .wxParse-img {