Commit 68ecf35c authored by haiyoucuv's avatar haiyoucuv

init

parent 8133ff29
......@@ -31,7 +31,7 @@ ComponentWithStore({
canIUseGetUserProfile: wx.canIUse('getUserProfile'),
canIUseNicknameComp: wx.canIUse('input.type.nickname'),
},
async created() {
async ready() {
this.updateHomeInfo();
},
methods: {
......@@ -56,7 +56,9 @@ ComponentWithStore({
},
async updateHomeInfo() {
await store.updateHomeInfo();
const {channel, city} = this.options || {};
await store.updateHomeInfo({channel, city});
const {mobile, first} = store.homeInfo;
if (!mobile) {
......@@ -65,8 +67,8 @@ ComponentWithStore({
});
} else {
this.setData({
showGetPanel: first,
showAlGetPanel: !first,
showGetPanel: channel && first,
showAlGetPanel: channel && !first,
showPhoneBtn: false,
});
}
......
......@@ -15,14 +15,19 @@ class Store {
activities: []
}
async updateHomeInfo() {
async updateHomeInfo(params: {
longitude?: number,
latitude?: number,
channel?: string,
city?: string,
}) {
// wx.showLoading({
// title: '加载中',
// mask: true,
// });
const {success, data} = await request({
url: API_PATH.index,
data: params,
});
if (!success) return;
......
......@@ -6,5 +6,18 @@
"preloadBackgroundData": false,
"urlCheck": false
},
"libVersion": "3.4.6"
"libVersion": "3.4.6",
"condition": {
"miniprogram": {
"list": [
{
"name": "店铺id+城市",
"pathName": "pages/index/index",
"query": "channel=1231&city=石家庄",
"launchMode": "default",
"scene": 1011
}
]
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment