全局开启一个半小时刷新token,去除每个页面调用isLogin检测token失效刷新token

master
chen 2022-04-13 15:00:35 +08:00
parent ab6f2c3c85
commit e52fd0b685
85 changed files with 201 additions and 328 deletions

13
App.vue
View File

@ -14,21 +14,24 @@
// //
toolAll.tools.currentContext(); toolAll.tools.currentContext();
toolAll.tools.isVedio(); toolAll.tools.isVedio();
}, },
onShow: function() { onShow: function() {
if(uni.getStorageSync('token')!='') { if(uni.getStorageSync('token')) {
toolAll.tools.networkStatus();// toolAll.tools.networkStatus();//
toolAll.tools.isLogin();//token toolAll.tools.refreshToken();//token
toolAll.tools.refreshToken();
} }
toolAll.tools.checkQuan(); // toolAll.tools.checkQuan(); //
}, },
onHide: function() { onHide: function() {
toolAll.tools.closeTimer();// toolAll.tools.closeTimer();//
if(uni.getStorageSync('token')) {
toolAll.tools.refreshToken();//token
}
uni.removeStorageSync('isQuan'); uni.removeStorageSync('isQuan');
uni.removeStorageSync('quanImg'); // uni.removeStorageSync('quanImg'); //
uni.removeStorageSync('quanId'); // id uni.removeStorageSync('quanId'); // id
uni.removeStorageSync('isVedio'); // uni.removeStorageSync('isVedio'); //
uni.removeStorageSync('urlparams');
}, },
methods:{ methods:{
autoUpdate: function() { autoUpdate: function() {

View File

@ -128,18 +128,18 @@
}, },
data() { data() {
return { return {
vision:false,
isShowT:false, isShowT:false,
pu_content:'是否需要取消收藏?', pu_content:'是否需要取消收藏?',
current:'-1', current:'-1',
jieDuan:false, isVedio:false
isVedio:uni.getStorageSync('isVedio')
}; };
}, },
mounted() {
this.$requst.get('index/base-config').then(res=>{
res.data.v==0 ? this.isVedio = false : this.isVedio = true;
})
},
methods:{ methods:{
cancleEv(e){
if(e==0) this.vision = false
},
goDetail(index){// goDetail(index){//
if(this.$toolAll.tools.judgeAuth()){ if(this.$toolAll.tools.judgeAuth()){
uni.navigateTo({ uni.navigateTo({

View File

@ -60,9 +60,14 @@
bcurrent:0, bcurrent:0,
isShowVideo:false, isShowVideo:false,
autoplay:false, autoplay:false,
isVedio:uni.getStorageSync('isVedio') isVedio:false
}; };
}, },
mounted() {
this.$requst.get('index/base-config').then(res=>{
res.data.v==0 ? this.isVedio = false : this.isVedio = true;
})
},
methods:{ methods:{
chooseImg(index){ chooseImg(index){
// console.log('banner',index); // console.log('banner',index);

View File

@ -8,6 +8,7 @@ let hostapi = '';
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){ if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
// (开发版,体验版)域名 // (开发版,体验版)域名
hostapi = 'https://hengmei.scdxtc.cn/api/'; hostapi = 'https://hengmei.scdxtc.cn/api/';
// hostapi = 'https://hm.hmzfyy.cn/api/';
} else { } else {
// 正式版-域名 // 正式版-域名
hostapi = 'https://hm.hmzfyy.cn/api/'; hostapi = 'https://hm.hmzfyy.cn/api/';
@ -103,38 +104,65 @@ const request = (method, url, options, ifLogin) => {
if (res.data.code == 0) { if (res.data.code == 0) {
resolve(res.data) resolve(res.data)
} else { } else {
flag = false; if(res.data.code==6001) {
uni.login({ flag = false;
provider: 'weixin', uni.login({
success: (res)=> { provider: 'weixin',
var params = {code:res.code} success: (res)=> {
uni.request({ var params = {code:res.code}
url: `${uni.getStorageSync('hostapi')}user/login`, uni.request({
method: 'post', url: `${uni.getStorageSync('hostapi')}user/login`,
data: params, method: 'post',
success: res => { data: params,
if(res.data.data.token!=''){ success: res => {
uni.setStorageSync('token',res.data.data.token); // 缓存token if(res.data.data.token!=''){
uni.setStorageSync('openid',res.data.data.openid)//缓存openid uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式) uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号 uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权 uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.reLaunch({ // 重新进入当前页面 uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
url:uni.getStorageSync('paramsUrl') uni.reLaunch({ // 重新进入当前页面
}) url:uni.getStorageSync('paramsUrl')
})
}
} }
} })
}) },
}, });
}); } else {
checkError(res)
}
// uni.showToast({ // uni.showToast({
// title:res.data.msg, // title:res.data.msg,
// icon:'none' // icon:'none'
// }) // })
checkError(res)
} }
} else if(res.statusCode==500) { } else if(res.statusCode==500) {
// goLogin(); flag = false;
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {code:res.code}
uni.request({
url: `${uni.getStorageSync('hostapi')}user/login`,
method: 'post',
data: params,
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
uni.reLaunch({ // 重新进入当前页面
url:uni.getStorageSync('paramsUrl')
})
}
}
})
},
});
} else { } else {
checkError(res) checkError(res)
} }

View File

@ -351,24 +351,18 @@ const tools = {
} }
// #endif // #endif
}, },
isLogin(){//是否已经登录 timeToken:null,
var date = new Date(); // 开启一个半小时刷新token
var timestamp = date.getTime();//精确到毫秒 refreshToken(){
// 如果过期时间 减 10分钟 小于当前时间刷新token console.log('开启了一个半小时刷新token');
if((uni.getStorageSync('expire')*1000 - 6565575) < timestamp && uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0) { clearInterval(this.timeToken);
// 调用登录事件
this.loginEv();
this.timeToken = setInterval(()=>{
console.log('进入了一个半小时刷新token');
// 调用登录事件 // 调用登录事件
this.loginEv(); this.loginEv();
} },600000*9)
console.log('进入了检测是否登录过期事件');
},
timeToken:null,
// 开启每十分钟刷新token
refreshToken(){
clearInterval(this.timeToken);
this.timeToken = setInterval(()=>{
console.log('进入了每十分钟刷新token');
this.isLogin();
},600000)
}, },
// 登录事件 // 登录事件
loginEv(){ loginEv(){

View File

@ -228,7 +228,6 @@
this.checkSwi() this.checkSwi()
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
this.isAutoPlay = true; this.isAutoPlay = true;
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkBZ()// this.checkBZ()//
@ -544,7 +543,8 @@
let group_cover = []; let group_cover = [];
if(item.activity_group_cover.length!=0) { if(item.activity_group_cover.length!=0) {
item.activity_group_cover.forEach(item=>{ item.activity_group_cover.forEach(item=>{
group_cover.push(this.$http + item) // group_cover.push(this.$http + item)
group_cover.push(item)
}) })
} }
let obj = { let obj = {

View File

@ -141,7 +141,6 @@
}, },
onShow() { onShow() {
uni.removeStorageSync('uinfo')// uni.removeStorageSync('uinfo')//
this.$toolAll.tools.isLogin()
this.checkInfo() this.checkInfo()
uni.removeStorageSync('shareAll')// uni.removeStorageSync('shareAll')//
this.$requst.post('index/mini-program-setting').then(res=>{ this.$requst.post('index/mini-program-setting').then(res=>{

View File

@ -247,7 +247,6 @@
}, },
onShow() { onShow() {
uni.removeStorageSync('uinfo')// uni.removeStorageSync('uinfo')//
this.$toolAll.tools.isLogin();
uni.removeStorageSync('shareAll')// uni.removeStorageSync('shareAll')//
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkInfo(); this.checkInfo();

View File

@ -176,7 +176,6 @@
onShow() { onShow() {
// //
this.checkNet(); this.checkNet();
this.$toolAll.tools.isLogin();
// tools.js // tools.js
this.$toolAll.tools.plantPoint(6); this.$toolAll.tools.plantPoint(6);
this.checkKT();// this.checkKT();//

View File

@ -238,7 +238,6 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
if(uni.getStorageSync('phone')!=0 && uni.getStorageSync('is_active')!=0) { if(uni.getStorageSync('phone')!=0 && uni.getStorageSync('is_active')!=0) {
this.cartNumEv();// this.cartNumEv();//
} }

View File

@ -86,7 +86,6 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList(); this.checkList();
} }

View File

@ -82,9 +82,6 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
const query = wx.createSelectorQuery() const query = wx.createSelectorQuery()
query.select('#daoh').boundingClientRect((rect) => { query.select('#daoh').boundingClientRect((rect) => {

View File

@ -234,10 +234,18 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShareAppMessage(res) {
var shareObj = {
     title: this.orderList[0].title, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${this.orderList[0].id}&category_id=0&is_activity=${this.orderList[0].is_activity}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: this.orderList[0].imgSrc//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
//   return false;
},
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin();
this.checkChoose();// this.checkChoose();//
uni.removeStorageSync('orderInfo'); uni.removeStorageSync('orderInfo');
}, },

View File

@ -90,7 +90,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin();
}, },
onLoad(options) { onLoad(options) {
this.checkInfo(); this.checkInfo();

View File

@ -83,7 +83,6 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin()
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.$toolAll.tools.showToast('加载中...','loading') this.$toolAll.tools.showToast('加载中...','loading')
this.checkPoint()// this.checkPoint()//

View File

@ -77,9 +77,6 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList(); this.checkList();

View File

@ -115,9 +115,6 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
// //

View File

@ -67,7 +67,6 @@
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin()
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDiaryEv(); this.checkDiaryEv();
} }

View File

@ -121,7 +121,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin()
}, },
onLoad(options) { onLoad(options) {
this.isWhere = options.isWhere; this.isWhere = options.isWhere;

View File

@ -47,15 +47,29 @@
</view> </view>
</view> --> </view> -->
<view class="fon28 col3"> <view class="fon28 col3">
<view class="mar-sx20 disje"><span v-if="item.isShop==0"><span v-if="item.is_only!=1">{{item.total}}</span><span v-if="item.is_only==1">{{item.total}}</span> <span v-if="item.coin!=0">+{{item.coin}}</span></span><span v-else>{{item.total}}</span></view> <view class="mar-sx20 disjbac">
<view class="disjbac"> <view>
<view v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="posir disjcac flexs" style="color: #010101;font-size: 24rpx;"> <!-- <view v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="posir disjcac flexs" style="color: #010101;font-size: 24rpx;"> -->
<image src="../../static/public/weix.png" mode="" class="flexs" style="width: 50rpx;height: 50rpx;"></image> <view v-if="item.is_only==0 && item.group.surplus > 0" class="posir disjcac flexs" style="color: #010101;font-size: 24rpx;">
分享给朋友 <image src="../../static/public/weix.png" mode="" class="flexs" style="width: 50rpx;height: 50rpx;"></image>
<button open-type="share" :data-id="index" class="posia-op">分享给朋友</button> 分享给朋友
<button open-type="share"
:data-title="item.childrenList[0].title"
:data-is_activity="item.childrenList[0].is_activity"
:data-imgsrc="item.childrenList[0].imgSrc"
:data-id="item.childrenList[0].spu_activity_id || item.childrenList[0].sku_id"
class="posia-op">分享给朋友</button>
</view>
</view> </view>
<view>
<span v-if="item.isShop==0"><span v-if="item.is_only!=1">{{item.total}}</span><span v-if="item.is_only==1">{{item.total}}</span> <span v-if="item.coin!=0">+{{item.coin}}</span></span><span v-else>{{item.total}}</span>
</view>
</view>
<view class="disjbac">
<view class="width100 disje"> <view class="width100 disje">
<view @tap="comeing(item.orderNum)" v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="order-btn mar-y20"></view> <view v-if="item.group.surplus > 0">
<view @tap="comeing(item.orderNum)" v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="order-btn mar-y20"></view>
</view>
<view @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5 && item.virtual_check==0 && item.orderStatus!=5" class="order-cancle"></view> <view @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5 && item.virtual_check==0 && item.orderStatus!=5" class="order-cancle"></view>
<view @tap="payMentEv(index)" v-if="item.orderStatus == 1" class="order-btn"></view> <view @tap="payMentEv(index)" v-if="item.orderStatus == 1" class="order-btn"></view>
<!-- <view class="order-btn" v-if="item.is_only==1"></view> --> <!-- <view class="order-btn" v-if="item.is_only==1"></view> -->
@ -165,7 +179,13 @@
} }
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
  return false; var shareObj = {
     title: res.target.dataset.title, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${res.target.dataset.id}&category_id=0&is_activity=${res.target.dataset.is_activity}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: res.target.dataset.imgsrc//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
//   return false;
}, },
onReachBottom() { onReachBottom() {
if(this.total!=this.orderList.length){ if(this.total!=this.orderList.length){
@ -182,7 +202,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin();
this.checkZT(this.activeIndex); this.checkZT(this.activeIndex);
this.checkList(this.activeIndex); this.checkList(this.activeIndex);
}, },
@ -292,8 +311,9 @@
check_type:items.check_type, check_type:items.check_type,
is_virtual:items.is_virtual, is_virtual:items.is_virtual,
activity_type:items.activity_type, activity_type:items.activity_type,
is_activity:items.is_activity,
spu_id:items.spu_id, spu_id:items.spu_id,
spu_activity_id:items.spu_activity_id spu_activity_id:items.spu_activity_id,
} }
nchildren.push(objs); nchildren.push(objs);
}) })
@ -313,7 +333,8 @@
is_group_make:item.is_group_make, is_group_make:item.is_group_make,
group_make_end_at:item.group_make_end_at, group_make_end_at:item.group_make_end_at,
group_id:item.group_id, group_id:item.group_id,
status_text:item.status_text// status_text:item.group.surplus > 0 ? '待拼成' : item.status_text,//
group:item.group//
} }
this.zanArr.push(obj); this.zanArr.push(obj);
}) })

View File

@ -122,7 +122,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin()
}, },
onUnload() { onUnload() {
uni.removeStorageSync('firstInfo') uni.removeStorageSync('firstInfo')

View File

@ -103,7 +103,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin();
}, },
onLoad(options) { onLoad(options) {
this.checkInfo(); this.checkInfo();

View File

@ -80,7 +80,6 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.cartNumEv(); this.cartNumEv();
} }

View File

@ -118,9 +118,6 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad() { onLoad() {
this.category = this.xialone[0] this.category = this.xialone[0]
this.categoryT = this.xialTwo[0] this.categoryT = this.xialTwo[0]

View File

@ -89,7 +89,6 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
uni.removeStorageSync('orderList'); uni.removeStorageSync('orderList');
uni.removeStorageSync('payType'); uni.removeStorageSync('payType');
}, },

View File

@ -79,9 +79,6 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad() { onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkTime(); this.checkTime();

View File

@ -105,9 +105,6 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkCate(); this.checkCate();

View File

@ -99,7 +99,6 @@
}, },
onShow() { onShow() {
this.isAutoPlay = true; this.isAutoPlay = true;
this.$toolAll.tools.isLogin();
}, },
onUnload() { onUnload() {
this.isAutoPlay = false; this.isAutoPlay = false;

View File

@ -107,9 +107,6 @@
  };   };
  return shareObj;   return shareObj;
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) { onLoad(options) {
this.detailId = options.id this.detailId = options.id
this.category_id = options.category_id this.category_id = options.category_id

View File

@ -27,9 +27,6 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad() { onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkImg() this.checkImg()

View File

@ -79,9 +79,6 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList() this.checkList()

View File

@ -161,9 +161,6 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad() { onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkKF()// this.checkKF()//

View File

@ -91,9 +91,6 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) { onLoad(options) {
this.checkDor(); this.checkDor();
}, },

View File

@ -87,7 +87,6 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkConList(this.category_id) this.checkConList(this.category_id)
} }

View File

@ -71,7 +71,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin();
}, },
onLoad(options) { onLoad(options) {
// //

View File

@ -186,7 +186,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin()
this.checkConList(this.category_id); this.checkConList(this.category_id);
this.shopCollection(); this.shopCollection();
}, },
@ -233,7 +232,8 @@
let group_cover = []; let group_cover = [];
if(item.activity_group_cover.length!=0) { if(item.activity_group_cover.length!=0) {
item.activity_group_cover.forEach(item=>{ item.activity_group_cover.forEach(item=>{
group_cover.push(this.$http + item) // group_cover.push(this.$http + item)
group_cover.push(item)
}) })
} }
let obj = { let obj = {

View File

@ -84,7 +84,6 @@
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin()
}, },
onLoad(options) { onLoad(options) {
this.checkShare()// this.checkShare()//

View File

@ -77,7 +77,12 @@
<view class="posir"> <view class="posir">
<image src="/static/public/weix.png" mode=""></image> <image src="/static/public/weix.png" mode=""></image>
<view class="fon28 col3">分享</view> <view class="fon28 col3">分享</view>
<button open-type="share" class="posia-op"></button> <button open-type="share"
:data-title="orderInfo.skus[0].spu_name"
:data-is_activity="orderInfo.skus[0].is_activity"
:data-imgsrc="orderInfo.skus[0].spu_cover"
:data-id="orderInfo.skus[0].spu_activity_id || orderInfo.skus[0].sku_id"
class="posia-op"></button>
</view> </view>
<view @tap="comeing(orderInfo.coding)" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 " class="orderInfo-btn"></view> <view @tap="comeing(orderInfo.coding)" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 " class="orderInfo-btn"></view>
<!-- 待付款 --> <!-- 待付款 -->
@ -147,13 +152,21 @@
return this.$store.state.statusHeight return this.$store.state.statusHeight
} }
}, },
onShareAppMessage(res) {
var shareObj = {
     title: res.target.dataset.title, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${res.target.dataset.id}&category_id=0&is_activity=${res.target.dataset.is_activity}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: res.target.dataset.imgsrc//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
//   return false;
},
onUnload() { onUnload() {
this.closeEv(); this.closeEv();
}, },
onShow() { onShow() {
// //
this.$toolAll.tools.disableShareEv(); this.$toolAll.tools.disableShareEv();
this.$toolAll.tools.isLogin();
}, },
onLoad(options) { onLoad(options) {
this.checkInfo(options.id); this.checkInfo(options.id);

View File

@ -66,7 +66,6 @@
}, },
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.$toolAll.tools.isLogin() ;
// //
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')// if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//
else this.imgList = [] else this.imgList = []

View File

@ -203,7 +203,6 @@
return shareObj; return shareObj;
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
this.isAutoPlay = true; this.isAutoPlay = true;
}, },
onHide() { onHide() {

View File

@ -98,9 +98,6 @@
this.searchEv() this.searchEv()
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
methods: { methods: {
// //
inputEv(e) { inputEv(e) {

View File

@ -118,7 +118,6 @@
} }
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin()
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){ if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv() if(this.searchVal!=undefined && this.searchVal!='') this.searchEv()
} }

View File

@ -87,9 +87,6 @@
  };   };
  return shareObj;   return shareObj;
}, },
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) { onLoad(options) {
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0 uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
}, },

View File

@ -384,7 +384,6 @@
  return shareObj;   return shareObj;
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
uni.removeStorageSync('chooseAddress'); uni.removeStorageSync('chooseAddress');
uni.removeStorageSync('payType'); uni.removeStorageSync('payType');
this.isAutoPlay = true; this.isAutoPlay = true;
@ -401,21 +400,23 @@
onLoad(options) { onLoad(options) {
this.isactivity = options.is_activity; this.isactivity = options.is_activity;
this.orderId = options.id; this.orderId = options.id;
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDetail(options.id,options.is_activity);
this.cartNumEv();
}
if(options.category_id!=undefined) { if(options.category_id!=undefined) {
this.category_id = options.category_id this.category_id = options.category_id
this.invite_code = options.invite_code this.invite_code = options.invite_code
} }
if(options.share_id!=undefined) this.share_id = options.share_id if(options.share_id!=undefined) this.share_id = options.share_id
if(options.isIntegral=="true"){this.isScore = 3;} if(options.isIntegral=="true"){this.isScore = 3;}
// if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
if(options.shareCate==1) { //
// options.checkGrounpIid this.cartNumEv();
// options.share_id:id //
this.sharePin(options.checkGrounpId,options.share_id); this.checkDetail(options.id,options.is_activity);
//
if(options.shareCate==1) {
// options.checkGrounpIid
// options.share_id:id
this.sharePin(options.checkGrounpId,options.share_id);
}
} }
}, },
methods: { methods: {
@ -499,8 +500,8 @@
this.$requst.post('order/shopping-cart-count',{type:ntype}).then(res=>{ this.$requst.post('order/shopping-cart-count',{type:ntype}).then(res=>{
if(res.code==0){ if(res.code==0){
this.cartNum = res.data.count; this.cartNum = res.data.count;
} else this.$toolAll.tools.showToast(res.msg); }
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);}) })
}, },
checkPTList(id){// checkPTList(id){//
uni.request({ uni.request({
@ -557,7 +558,7 @@
this.ispt = index; this.ispt = index;
if(index==2){nprice = this.skuDetail.original_price/100;} if(index==2){nprice = this.skuDetail.original_price/100;}
let params = { let params = {
id:this.detailObj.spu_id, id:this.detailObj.activity_id || this.detailObj.spu_id,
imgSrc:this.$http + this.detailObj.cover, imgSrc:this.$http + this.detailObj.cover,
coding:this.skuDetail.coding, coding:this.skuDetail.coding,
price:nprice, price:nprice,
@ -571,7 +572,7 @@
category_id:this.category_id,//ID category_id:this.category_id,//ID
cateNum:this.isNei, cateNum:this.isNei,
checkGrounpId:this.detailObj.id,//ID checkGrounpId:this.detailObj.id,//ID
is_activity:this.detailObj.is_activity
} }
let newList = [params]; let newList = [params];
uni.setStorageSync('orderList',newList); uni.setStorageSync('orderList',newList);
@ -673,7 +674,6 @@
}) })
}, },
checkDetail(newId,is_activity){ checkDetail(newId,is_activity){
console.log(newId,is_activity,'参数');
uni.request({ uni.request({
url:`${uni.getStorageSync('hostapi')}spu/detail`, url:`${uni.getStorageSync('hostapi')}spu/detail`,
data:{id:newId,is_activity:is_activity}, data:{id:newId,is_activity:is_activity},
@ -790,8 +790,6 @@
this.checkPTList(this.detailObj.id);// this.checkPTList(this.detailObj.id);//
} }
this.checkShopList(); this.checkShopList();
} else {
this.$toolAll.tools.showToast(res.data.msg);
} }
} }
}) })
@ -826,7 +824,8 @@
let group_cover = []; let group_cover = [];
if(item.activity_group_cover.length!=0) { if(item.activity_group_cover.length!=0) {
item.activity_group_cover.forEach(item=>{ item.activity_group_cover.forEach(item=>{
group_cover.push(this.$http + item) // group_cover.push(this.$http + item)
group_cover.push(item)
}) })
} }
let obj = { let obj = {

View File

@ -223,7 +223,6 @@
}).exec() }).exec()
}, },
onShow() { onShow() {
this.$toolAll.tools.isLogin();
if(uni.getStorageSync('token')!=''){ if(uni.getStorageSync('token')!=''){
if(this.searchVal!=undefined && this.searchVal!='') this.checkShopList(); if(this.searchVal!=undefined && this.searchVal!='') this.checkShopList();
this.cartNumEv();// this.cartNumEv();//
@ -274,7 +273,8 @@
let group_cover = []; let group_cover = [];
if(item.activity_group_cover.length!=0) { if(item.activity_group_cover.length!=0) {
item.activity_group_cover.forEach(item=>{ item.activity_group_cover.forEach(item=>{
group_cover.push(this.$http + item) // group_cover.push(this.$http + item)
group_cover.push(item)
}) })
} }
let obj = { let obj = {

View File

@ -72,9 +72,6 @@
this.isZanw = false this.isZanw = false
} }
}, },
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad(options) { onLoad(options) {
if(uni.getStorageSync('token')!='') { if(uni.getStorageSync('token')!='') {
this.checkList(); this.checkList();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long