|
@@ -27,14 +27,18 @@ Page({
|
|
|
},
|
|
|
|
|
|
|
|
|
- onLoad: async function () {
|
|
|
+ onLoad: async function (options) {
|
|
|
+ console.log(options)
|
|
|
const self = this
|
|
|
+
|
|
|
const tokenData = await commonApi.getToken();
|
|
|
|
|
|
if (tokenData.token && !requestApi.HEAD.token) {
|
|
|
+ console.log('设置token')
|
|
|
wx.setStorageSync('token', tokenData.token)
|
|
|
requestApi.HEAD.token = tokenData.token
|
|
|
}
|
|
|
+ if (!options.storeId){
|
|
|
wx.getSetting({
|
|
|
success: (res) => {
|
|
|
let authSetting = res.authSetting
|
|
@@ -64,16 +68,31 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ }else {
|
|
|
+ const rs = await storeApi.getStoreByI(options.storeId)
|
|
|
+ self.setData({
|
|
|
+ storeInfo: rs.info
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
// this.getProductHeight()
|
|
|
},
|
|
|
- onShow: async function () {
|
|
|
+ onShow: async function (op) {
|
|
|
+ console.log(op)
|
|
|
const self = this
|
|
|
const tokenData = await commonApi.getToken();
|
|
|
if (tokenData.token && !requestApi.HEAD.token) {
|
|
|
wx.setStorageSync('token', tokenData.token)
|
|
|
requestApi.HEAD.token = tokenData.token
|
|
|
}
|
|
|
+ if (self.data.chooseStoreId){
|
|
|
+ const rs = await storeApi.getStoreById(self.data.chooseStoreId)
|
|
|
+ self.setData({
|
|
|
+ storeInfo: rs.info,
|
|
|
+ chooseStoreId:0
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
var tabs = await this.getProductList(true);
|
|
|
this.setData({
|
|
|
tabs
|
|
@@ -261,10 +280,10 @@ Page({
|
|
|
let shopName = self.data.storeInfo.storeName;
|
|
|
const isAuth = await app.isAuth()
|
|
|
if (!isAuth) {
|
|
|
- wx.redirectTo({
|
|
|
- url: '/pages/prompt/prompt?page=' + this.route + `&shopId=${shopId}&productId=${productId}`,
|
|
|
- })
|
|
|
- return
|
|
|
+ // wx.redirectTo({
|
|
|
+ // url: '/pages/prompt/prompt?page=' + this.route + `&shopId=${shopId}&productId=${productId}&address=${address}&shopName=${shopName}`,
|
|
|
+ // })
|
|
|
+ // return
|
|
|
}
|
|
|
wx.navigateTo({
|
|
|
url: '../appointment/appointment?' + 'shopId=' + shopId + '&productId=' + productId + '&address=' + address+"&shopName="+shopName,
|