Commit ed89e10b by 李伟康

修复BUG

1 parent a1e0cead
// packageMall/pages/detail/detail.js // packageMall/pages/detail/detail.js
import { import {
commentTime,
centsToyuan, centsToyuan,
iosTimeFormat iosTimeFormat
} from '~/utils/format' } from '~/utils/format'
...@@ -236,7 +235,7 @@ Page({ ...@@ -236,7 +235,7 @@ Page({
}, },
async join(e) { async join(e) {
const loginStatus = await wx.p.router.intercept() const loginStatus = await wx.p.router.intercept()
if(loginStatus) return if (loginStatus) return
let params = e && e.detail let params = e && e.detail
if (!params) { if (!params) {
params = { params = {
...@@ -389,11 +388,6 @@ Page({ ...@@ -389,11 +388,6 @@ Page({
}) })
if (isActivity) this.countDown([data.startTime, data.endTime]) if (isActivity) this.countDown([data.startTime, data.endTime])
if (!wx.$authStatus) this.getUserAddressDefault()
else
this.setData({
addressFlag: true
})
wx.hideLoading() wx.hideLoading()
} else { } else {
wx.hideLoading() wx.hideLoading()
...@@ -464,8 +458,12 @@ Page({ ...@@ -464,8 +458,12 @@ Page({
} }
}) })
}, },
getUserAddressDefault() { async getUserAddressDefault() {
wx.p.api.mineApi.getUserAddressDefault().then(({ const res = await wx.p.router.intercept(false)
if (res) this.setData({
addressFlag: true
})
else wx.p.api.mineApi.getUserAddressDefault().then(({
code, code,
data data
}) => { }) => {
...@@ -496,6 +494,7 @@ Page({ ...@@ -496,6 +494,7 @@ Page({
*/ */
onShow: function () { onShow: function () {
this.getUserAddressList() this.getUserAddressList()
this.getUserAddressDefault()
}, },
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!