Commit deab7892 by 李伟康

修改商品详情

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