|
|
|
@ -198,6 +198,32 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
// uni.getStorage({ |
|
|
|
|
// key: 'user', |
|
|
|
|
// success: (res) => { |
|
|
|
|
// app.globalData.userInfo = res.data; |
|
|
|
|
// if (app.globalData.userInfo.phone) { |
|
|
|
|
// this.userInfo = 2; |
|
|
|
|
// } else { |
|
|
|
|
// this.userInfo = 1; |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
// fail() { |
|
|
|
|
// this.userInfo = 1; |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
/* let res = uni.getStorageSync("user"); |
|
|
|
|
app.globalData.userInfo = res; |
|
|
|
|
console.log(app.globalData.userInfo,"=========app.globalData.userInfo=========") |
|
|
|
|
if (app.globalData.userInfo.phone) { |
|
|
|
|
this.userInfo = 2; |
|
|
|
|
} else { |
|
|
|
|
this.userInfo = 1; |
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
uni.getStorage({ |
|
|
|
|
key: 'user', |
|
|
|
|
success: (res) => { |
|
|
|
@ -214,14 +240,40 @@ |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},0) |
|
|
|
|
|
|
|
|
|
// let res = uni.getStorageSync("user"); |
|
|
|
|
// app.globalData.userInfo = res; |
|
|
|
|
// console.log(app.globalData.userInfo,"=========app.globalData.userInfo=========") |
|
|
|
|
// if (app.globalData.userInfo.phone) { |
|
|
|
|
// this.userInfo = 2; |
|
|
|
|
// } else { |
|
|
|
|
// this.userInfo = 1; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getDiscountByQrCode(); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
var arr1 = window.location.href; |
|
|
|
|
var arr2 = arr1.split('='); |
|
|
|
|
if (!app.globalData.openId) { |
|
|
|
|
this.getH5AccessToken(arr2[1]); |
|
|
|
|
} |
|
|
|
|
this.getDiscountByQrCode(); |
|
|
|
|
// var arr1 = window.location.href; |
|
|
|
|
// var arr2 = arr1.split('='); |
|
|
|
|
// if (!app.globalData.openId) { |
|
|
|
|
// this.getH5AccessToken(arr2[1]); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// 如果没登录 |
|
|
|
|
// if(!app.globalData.userInfo&&!app.globalData.token){ |
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
// url: '/pages/login/register' |
|
|
|
|
// }) |
|
|
|
|
// return |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
@ -408,16 +460,32 @@ |
|
|
|
|
//商品跳转 |
|
|
|
|
toGoods(e) { |
|
|
|
|
if (app.globalData.userInfo) { |
|
|
|
|
|
|
|
|
|
if(this.couponsDetails.highDiscountAgentCode.status != 1){ |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../order/confirmation?type=2&id=' + e |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '请点击领取后再使用', |
|
|
|
|
title: '未领取优惠券', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '请登录后再使用', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/login/register' |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//跳转列表 |
|
|
|
|
jumpCounlist() { |
|
|
|
@ -569,7 +637,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.headbgimg { |
|
|
|
|
position: absolute; |
|
|
|
|
position: absolute !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.contents { |
|
|
|
|