diff --git a/libs/spread.js b/libs/spread.js index 197ffd6..d926270 100644 --- a/libs/spread.js +++ b/libs/spread.js @@ -1,13 +1,25 @@ - -import { spread } from '@/api/user.js' +import {spread} from '@/api/user.js' import Cache from '@/utils/cache' -const shareScence = function(spid,islogin) { - if(spid)Cache.set("spread", spid || 0); - if(spid && islogin){ - spread(spid).then(res=>{ - }) - } +const shareScence = function (spid, islogin, isTips = false) { + if (spid) Cache.set("spread", spid || 0); + if (spid && islogin) { + // 判断:是否已经提示 + spread(spid).then(res => { + console.log("绑定关系 回调", res) + }).catch(err => { + console.log('错误', err) + console.log('是否提示',isTips) + if(isTips){ + uni.showModal({ + title: '提示', + content: err, + confirmText: '关闭', + showCancel: false + }); + } + }); + } } export default shareScence diff --git a/pages/index/index.vue b/pages/index/index.vue index 16c9743..f787e75 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -53,7 +53,7 @@ - + @@ -125,7 +125,7 @@ 更多 - + @@ -159,7 +159,7 @@ {{ loadTitle }} - + @@ -522,7 +522,7 @@ export default { query.exec(res =>{ that.isScrolled = res[0].top <= -60 }) - }) + }) }, onHide() { uni.setStorageSync('isIntegral',false) @@ -545,7 +545,7 @@ export default { uni.reLaunch({ url: "/pages/index/index" }); - + }, 50) // #endif }, @@ -560,7 +560,7 @@ export default { }, 1500); }) } - }, + }, pageLoad(options){ let that = this; if (options.spid) { @@ -593,7 +593,7 @@ export default { } } // #endif - shareScence(that.currSpid, that.isLogin); + shareScence(that.currSpid, that.isLogin, true); this.isLogin && silenceBindingSpread(); this.reloadData(); Promise.all([ @@ -677,7 +677,7 @@ export default { let that = this; let parmas = { id: id, - did: that.diyId, + did: that.diyId, version: '221' } that.styleConfig = [] @@ -690,7 +690,7 @@ export default { let data = res.data.data; uni.setNavigationBarTitle({ title: data.title - }); + }); if (data.is_bg_color) { that.bgColor = data.color_picker } @@ -973,7 +973,7 @@ export default { }); }, getCateData(){ - getCateData().then(res => { + getCateData().then(res => { res.data.unshift({ cate_name: '首页' }); @@ -1130,7 +1130,7 @@ page { padding: 0 20rpx; } .colum0{ - white-space: nowrap; + white-space: nowrap; display: flex; } .ysize { @@ -1674,7 +1674,7 @@ page { } .pictrue { position: relative; - + .border-picture { position: absolute; top: 0;