|
|
|
@ -198,30 +198,82 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
uni.getStorage({ |
|
|
|
|
key: 'user', |
|
|
|
|
success: (res) => { |
|
|
|
|
app.globalData.userInfo = res.data; |
|
|
|
|
if (app.globalData.userInfo.phone) { |
|
|
|
|
this.userInfo = 2; |
|
|
|
|
} else { |
|
|
|
|
// 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) => { |
|
|
|
|
app.globalData.userInfo = res.data; |
|
|
|
|
if (app.globalData.userInfo.phone) { |
|
|
|
|
this.userInfo = 2; |
|
|
|
|
} else { |
|
|
|
|
this.userInfo = 1; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail() { |
|
|
|
|
this.userInfo = 1; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail() { |
|
|
|
|
this.userInfo = 1; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},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,15 +460,31 @@ |
|
|
|
|
//商品跳转 |
|
|
|
|
toGoods(e) { |
|
|
|
|
if (app.globalData.userInfo) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../order/confirmation?type=2&id=' + e |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
if(this.couponsDetails.highDiscountAgentCode.status != 1){ |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../../order/confirmation?type=2&id=' + e |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '未领取优惠券', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '请点击领取后再使用', |
|
|
|
|
title: '请登录后再使用', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/login/register' |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//跳转列表 |
|
|
|
@ -569,7 +637,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.headbgimg { |
|
|
|
|
position: absolute; |
|
|
|
|
position: absolute !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.contents { |
|
|
|
|