全局开启一个半小时刷新token,去除每个页面调用isLogin检测token失效刷新token
parent
ab6f2c3c85
commit
e52fd0b685
9
App.vue
9
App.vue
|
@ -16,19 +16,22 @@
|
|||
toolAll.tools.isVedio();
|
||||
},
|
||||
onShow: function() {
|
||||
if(uni.getStorageSync('token')!='') {
|
||||
if(uni.getStorageSync('token')) {
|
||||
toolAll.tools.networkStatus();//检查当前网络状态
|
||||
toolAll.tools.isLogin();//刷新token
|
||||
toolAll.tools.refreshToken();
|
||||
toolAll.tools.refreshToken();//每十分钟刷新token
|
||||
}
|
||||
toolAll.tools.checkQuan(); // 查询首页活动券
|
||||
},
|
||||
onHide: function() {
|
||||
toolAll.tools.closeTimer();//清空埋点倒计时
|
||||
if(uni.getStorageSync('token')) {
|
||||
toolAll.tools.refreshToken();//刷新token
|
||||
}
|
||||
uni.removeStorageSync('isQuan');
|
||||
uni.removeStorageSync('quanImg'); // 清空优惠券图片缓存
|
||||
uni.removeStorageSync('quanId'); // 清空优惠券id缓存
|
||||
uni.removeStorageSync('isVedio'); // 清空是否是视频缓存
|
||||
uni.removeStorageSync('urlparams');
|
||||
},
|
||||
methods:{
|
||||
autoUpdate: function() {
|
||||
|
|
|
@ -128,18 +128,18 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
vision:false,
|
||||
isShowT:false,
|
||||
pu_content:'是否需要取消收藏?',
|
||||
current:'-1',
|
||||
jieDuan: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:{
|
||||
cancleEv(e){
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
goDetail(index){//查看详情
|
||||
if(this.$toolAll.tools.judgeAuth()){
|
||||
uni.navigateTo({
|
||||
|
|
|
@ -60,9 +60,14 @@
|
|||
bcurrent:0,
|
||||
isShowVideo: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:{
|
||||
chooseImg(index){
|
||||
// console.log('当前banner图',index);
|
||||
|
|
|
@ -8,6 +8,7 @@ let hostapi = '';
|
|||
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
|
||||
// (开发版,体验版)域名
|
||||
hostapi = 'https://hengmei.scdxtc.cn/api/';
|
||||
// hostapi = 'https://hm.hmzfyy.cn/api/';
|
||||
} else {
|
||||
// 正式版-域名
|
||||
hostapi = 'https://hm.hmzfyy.cn/api/';
|
||||
|
@ -103,38 +104,65 @@ const request = (method, url, options, ifLogin) => {
|
|||
if (res.data.code == 0) {
|
||||
resolve(res.data)
|
||||
} else {
|
||||
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')
|
||||
})
|
||||
if(res.data.code==6001) {
|
||||
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 {
|
||||
checkError(res)
|
||||
}
|
||||
// uni.showToast({
|
||||
// title:res.data.msg,
|
||||
// icon:'none'
|
||||
// })
|
||||
checkError(res)
|
||||
|
||||
}
|
||||
} 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 {
|
||||
checkError(res)
|
||||
}
|
||||
|
|
|
@ -351,24 +351,18 @@ const tools = {
|
|||
}
|
||||
// #endif
|
||||
},
|
||||
isLogin(){//是否已经登录
|
||||
var date = new Date();
|
||||
var timestamp = date.getTime();//精确到毫秒
|
||||
// 如果过期时间 减 10分钟 小于当前时间,刷新token
|
||||
if((uni.getStorageSync('expire')*1000 - 6565575) < timestamp && uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0) {
|
||||
timeToken:null,
|
||||
// 开启一个半小时刷新token
|
||||
refreshToken(){
|
||||
console.log('开启了一个半小时刷新token');
|
||||
clearInterval(this.timeToken);
|
||||
// 调用登录事件
|
||||
this.loginEv();
|
||||
this.timeToken = setInterval(()=>{
|
||||
console.log('进入了一个半小时刷新token');
|
||||
// 调用登录事件
|
||||
this.loginEv();
|
||||
}
|
||||
console.log('进入了检测是否登录过期事件');
|
||||
},
|
||||
timeToken:null,
|
||||
// 开启每十分钟刷新token
|
||||
refreshToken(){
|
||||
clearInterval(this.timeToken);
|
||||
this.timeToken = setInterval(()=>{
|
||||
console.log('进入了每十分钟刷新token');
|
||||
this.isLogin();
|
||||
},600000)
|
||||
},600000*9)
|
||||
},
|
||||
// 登录事件
|
||||
loginEv(){
|
||||
|
|
|
@ -228,7 +228,6 @@
|
|||
this.checkSwi()
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.isAutoPlay = true;
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkBZ()//调用病种列表事件
|
||||
|
@ -544,7 +543,8 @@
|
|||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
// group_cover.push(this.$http + item)
|
||||
group_cover.push(item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
|
|
|
@ -141,7 +141,6 @@
|
|||
},
|
||||
onShow() {
|
||||
uni.removeStorageSync('uinfo')//清空用户缓存信息
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.checkInfo()
|
||||
uni.removeStorageSync('shareAll')//清空分享中心里的统计信息
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
|
|
|
@ -247,7 +247,6 @@
|
|||
},
|
||||
onShow() {
|
||||
uni.removeStorageSync('uinfo')//清空用户缓存信息
|
||||
this.$toolAll.tools.isLogin();
|
||||
uni.removeStorageSync('shareAll')//清空分享中心里的统计信息
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkInfo();
|
||||
|
|
|
@ -176,7 +176,6 @@
|
|||
onShow() {
|
||||
// 调用网络检测事件
|
||||
this.checkNet();
|
||||
this.$toolAll.tools.isLogin();
|
||||
// 调用tools.js中的种植埋点事件
|
||||
this.$toolAll.tools.plantPoint(6);
|
||||
this.checkKT();//恒美课堂列表
|
||||
|
|
|
@ -238,7 +238,6 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('phone')!=0 && uni.getStorageSync('is_active')!=0) {
|
||||
this.cartNumEv();//查询购物车数量
|
||||
}
|
||||
|
|
|
@ -86,7 +86,6 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList();
|
||||
}
|
||||
|
|
|
@ -82,9 +82,6 @@
|
|||
return this.$store.state.statusHeight
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('#daoh').boundingClientRect((rect) => {
|
||||
|
|
|
@ -234,10 +234,18 @@
|
|||
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//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
// return false;
|
||||
},
|
||||
onShow() {
|
||||
// 禁止分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkChoose();//检测地址
|
||||
uni.removeStorageSync('orderInfo');
|
||||
},
|
||||
|
|
|
@ -90,7 +90,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkInfo();
|
||||
|
|
|
@ -83,7 +83,6 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.$toolAll.tools.showToast('加载中...','loading')
|
||||
this.checkPoint()//调用自主预约列表事件
|
||||
|
|
|
@ -77,9 +77,6 @@
|
|||
return this.$store.state.statusHeight
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList();
|
||||
|
|
|
@ -115,9 +115,6 @@
|
|||
return this.$store.state.statusHeight
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
// 查询要编辑日记的信息
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkDiaryEv();
|
||||
}
|
||||
|
|
|
@ -121,7 +121,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad(options) {
|
||||
this.isWhere = options.isWhere;
|
||||
|
|
|
@ -47,15 +47,29 @@
|
|||
</view>
|
||||
</view> -->
|
||||
<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="disjbac">
|
||||
<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>
|
||||
分享给朋友
|
||||
<button open-type="share" :data-id="index" class="posia-op">分享给朋友</button>
|
||||
<view class="mar-sx20 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.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-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>
|
||||
<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 @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="payMentEv(index)" v-if="item.orderStatus == 1" class="order-btn">付款</view>
|
||||
<!-- <view class="order-btn" v-if="item.is_only==1">单人拼团</view> -->
|
||||
|
@ -165,7 +179,13 @@
|
|||
}
|
||||
},
|
||||
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//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
// return false;
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.orderList.length){
|
||||
|
@ -182,7 +202,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkZT(this.activeIndex);
|
||||
this.checkList(this.activeIndex);
|
||||
},
|
||||
|
@ -292,8 +311,9 @@
|
|||
check_type:items.check_type,
|
||||
is_virtual:items.is_virtual,
|
||||
activity_type:items.activity_type,
|
||||
is_activity:items.is_activity,
|
||||
spu_id:items.spu_id,
|
||||
spu_activity_id:items.spu_activity_id
|
||||
spu_activity_id:items.spu_activity_id,
|
||||
}
|
||||
nchildren.push(objs);
|
||||
})
|
||||
|
@ -313,7 +333,8 @@
|
|||
is_group_make:item.is_group_make,
|
||||
group_make_end_at:item.group_make_end_at,
|
||||
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);
|
||||
})
|
||||
|
|
|
@ -122,7 +122,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onUnload() {
|
||||
uni.removeStorageSync('firstInfo')
|
||||
|
|
|
@ -103,7 +103,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkInfo();
|
||||
|
|
|
@ -80,7 +80,6 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.cartNumEv();
|
||||
}
|
||||
|
|
|
@ -118,9 +118,6 @@
|
|||
return this.$store.state.statusHeight
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad() {
|
||||
this.category = this.xialone[0]
|
||||
this.categoryT = this.xialTwo[0]
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
uni.removeStorageSync('orderList');
|
||||
uni.removeStorageSync('payType');
|
||||
},
|
||||
|
|
|
@ -79,9 +79,6 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkTime();
|
||||
|
|
|
@ -105,9 +105,6 @@
|
|||
return this.$store.state.statusHeight
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkCate();
|
||||
|
|
|
@ -99,7 +99,6 @@
|
|||
},
|
||||
onShow() {
|
||||
this.isAutoPlay = true;
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
|
|
|
@ -107,9 +107,6 @@
|
|||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
this.detailId = options.id
|
||||
this.category_id = options.category_id
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
return this.$store.state.statusHeight
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkImg()
|
||||
|
|
|
@ -79,9 +79,6 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkList()
|
||||
|
|
|
@ -161,9 +161,6 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkKF()//查询客服列表
|
||||
|
|
|
@ -91,9 +91,6 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkDor();
|
||||
},
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.checkConList(this.category_id)
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
// 从其他方式进入当前页面,点击返回回到我的页面
|
||||
|
|
|
@ -186,7 +186,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.checkConList(this.category_id);
|
||||
this.shopCollection();
|
||||
},
|
||||
|
@ -233,7 +232,8 @@
|
|||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
// group_cover.push(this.$http + item)
|
||||
group_cover.push(item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkShare()//查询一二级分享总人数
|
||||
|
|
|
@ -77,7 +77,12 @@
|
|||
<view class="posir">
|
||||
<image src="/static/public/weix.png" mode=""></image>
|
||||
<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 @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
|
||||
}
|
||||
},
|
||||
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//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
// return false;
|
||||
},
|
||||
onUnload() {
|
||||
this.closeEv();
|
||||
},
|
||||
onShow() {
|
||||
// 禁用小程序分享
|
||||
this.$toolAll.tools.disableShareEv();
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkInfo(options.id);
|
||||
|
|
|
@ -66,7 +66,6 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
this.$toolAll.tools.isLogin() ;
|
||||
//如果还没有生成海报
|
||||
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//弹框关闭
|
||||
else this.imgList = []
|
||||
|
|
|
@ -203,7 +203,6 @@
|
|||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onHide() {
|
||||
|
|
|
@ -98,9 +98,6 @@
|
|||
this.searchEv()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
methods: {
|
||||
// 搜索框改变事件
|
||||
inputEv(e) {
|
||||
|
|
|
@ -118,7 +118,6 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv()
|
||||
}
|
||||
|
|
|
@ -87,9 +87,6 @@
|
|||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
|
||||
},
|
||||
|
|
|
@ -384,7 +384,6 @@
|
|||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
uni.removeStorageSync('chooseAddress');
|
||||
uni.removeStorageSync('payType');
|
||||
this.isAutoPlay = true;
|
||||
|
@ -401,21 +400,23 @@
|
|||
onLoad(options) {
|
||||
this.isactivity = options.is_activity;
|
||||
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) {
|
||||
this.category_id = options.category_id
|
||||
this.invite_code = options.invite_code
|
||||
}
|
||||
if(options.share_id!=undefined) this.share_id = options.share_id
|
||||
if(options.isIntegral=="true"){this.isScore = 3;}
|
||||
// 如果链接是拼团链接,则调起发起拼团人的商品
|
||||
if(options.shareCate==1) {
|
||||
// options.checkGrounpI商品id
|
||||
// options.share_id:拼团人id
|
||||
this.sharePin(options.checkGrounpId,options.share_id);
|
||||
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
|
||||
// 调用查询购物车数量
|
||||
this.cartNumEv();
|
||||
// 调用查询商品详情事件
|
||||
this.checkDetail(options.id,options.is_activity);
|
||||
// 如果链接是拼团链接,则调起发起拼团人的商品
|
||||
if(options.shareCate==1) {
|
||||
// options.checkGrounpI商品id
|
||||
// options.share_id:拼团人id
|
||||
this.sharePin(options.checkGrounpId,options.share_id);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -499,8 +500,8 @@
|
|||
this.$requst.post('order/shopping-cart-count',{type:ntype}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.cartNum = res.data.count;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
|
||||
}
|
||||
})
|
||||
},
|
||||
checkPTList(id){//查询正在拼团的人数
|
||||
uni.request({
|
||||
|
@ -557,7 +558,7 @@
|
|||
this.ispt = index;
|
||||
if(index==2){nprice = this.skuDetail.original_price/100;}
|
||||
let params = {
|
||||
id:this.detailObj.spu_id,
|
||||
id:this.detailObj.activity_id || this.detailObj.spu_id,
|
||||
imgSrc:this.$http + this.detailObj.cover,
|
||||
coding:this.skuDetail.coding,
|
||||
price:nprice,
|
||||
|
@ -571,7 +572,7 @@
|
|||
category_id:this.category_id,//病种ID
|
||||
cateNum:this.isNei,
|
||||
checkGrounpId:this.detailObj.id,//查询拼团列表ID
|
||||
|
||||
is_activity:this.detailObj.is_activity
|
||||
}
|
||||
let newList = [params];
|
||||
uni.setStorageSync('orderList',newList);
|
||||
|
@ -673,7 +674,6 @@
|
|||
})
|
||||
},
|
||||
checkDetail(newId,is_activity){
|
||||
console.log(newId,is_activity,'参数');
|
||||
uni.request({
|
||||
url:`${uni.getStorageSync('hostapi')}spu/detail`,
|
||||
data:{id:newId,is_activity:is_activity},
|
||||
|
@ -790,8 +790,6 @@
|
|||
this.checkPTList(this.detailObj.id);//查询商品正在拼团列表
|
||||
}
|
||||
this.checkShopList();
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -826,7 +824,8 @@
|
|||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
// group_cover.push(this.$http + item)
|
||||
group_cover.push(item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
|
|
|
@ -223,7 +223,6 @@
|
|||
}).exec()
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('token')!=''){
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.checkShopList();
|
||||
this.cartNumEv();//查询购物车数量
|
||||
|
@ -274,7 +273,8 @@
|
|||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
// group_cover.push(this.$http + item)
|
||||
group_cover.push(item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
|
|
|
@ -72,9 +72,6 @@
|
|||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('token')!='') {
|
||||
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
Loading…
Reference in New Issue