Commit deab7892 by 李伟康

修改商品详情

1 parent 5e000efa
......@@ -235,7 +235,8 @@ Page({
})
},
async join(e) {
wx.p.router.intercept()
const loginStatu = await wx.p.router.intercept()
if(loginStatu) return
let params = e && e.detail
if (!params) {
params = {
......@@ -263,11 +264,11 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options && options.id) {
this.setData(options)
this.getGoodsDetail(options.id)
if (!options.isActivity) this.getGoodscouponList(options.id)
}
if (options && options.id) {
this.setData(options)
this.getGoodsDetail(options.id)
if (!options.isActivity) this.getGoodscouponList(options.id)
}
// 推荐人+推荐人埋点
if (options.shareStaffUuid) {
let shareStaff = {
......@@ -310,8 +311,8 @@ Page({
// wx.$Track.setTrack(trackobj, 6)
//设置分享
let shareQuery = `id=${data.id}`,
shareTitle = data.goodsName,
shareImage = ''
shareTitle = data.goodsName,
shareImage = ''
data.goodsDetailImageList.map(e => {
if (e.resType == 1) shareImage = e.content
})
......@@ -446,7 +447,9 @@ Page({
})
})
},
getUserAddressList() {
async getUserAddressList() {
const res = await wx.p.router.intercept(false)
if (res) return
wx.p.api.mineApi.getUserAddressList().then(data => {
if (!data.length) {
this.setData({
......
......@@ -9,6 +9,7 @@ Page({
code,
message
}) => {
wx.p.wxApi.showLoading()
if (code == '0') {
// wx.$Track.setTrack({}, 4)
wx.$authStatus = true
......@@ -19,14 +20,18 @@ Page({
prevPage.setData({
userInfo: null,
isMember: false,
vipInfo: null,
orderNumberList: null
})
})
} else {
if (code == '21' || code == '20') {
try {
const res = await wx.p.api.userApi.login()
if(res.code == 0) this.logout()
else throw res.message
if (res.code == 0) {
wx.p.storage.set('sessionId', res.data.sessionId)
this.logout()
} else throw res.message
} catch (error) {
wx.p.wxApi.showToast(error)
}
......
......@@ -22,13 +22,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {
userInfo
} = this.data
if (userInfo) {
this.getOrderNumberList()
this.getMemberCardData()
}
this.getMemberCardData()
},
navbarReady(e) {
let {
......@@ -86,7 +80,9 @@ Page({
},
// 获取门店会员卡信息
getMemberCardData() {
const {merchantId} = wx.p.storage.get('merchant_info')
const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = {
merchantId
}
......@@ -96,7 +92,7 @@ Page({
})
})
},
goInterests(){
goInterests() {
wx.p.router.switchTab('/pages/tab/equity/index')
},
// 开通会员页面
......@@ -114,7 +110,13 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.toCheckMember()
let {
userInfo
} = this.data
if (userInfo && userInfo.phone) {
this.getOrderNumberList()
this.toCheckMember()
}
},
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!