Commit 68ecf35c authored by haiyoucuv's avatar haiyoucuv

init

parent 8133ff29
...@@ -31,7 +31,7 @@ ComponentWithStore({ ...@@ -31,7 +31,7 @@ ComponentWithStore({
canIUseGetUserProfile: wx.canIUse('getUserProfile'), canIUseGetUserProfile: wx.canIUse('getUserProfile'),
canIUseNicknameComp: wx.canIUse('input.type.nickname'), canIUseNicknameComp: wx.canIUse('input.type.nickname'),
}, },
async created() { async ready() {
this.updateHomeInfo(); this.updateHomeInfo();
}, },
methods: { methods: {
...@@ -56,7 +56,9 @@ ComponentWithStore({ ...@@ -56,7 +56,9 @@ ComponentWithStore({
}, },
async updateHomeInfo() { async updateHomeInfo() {
await store.updateHomeInfo(); const {channel, city} = this.options || {};
await store.updateHomeInfo({channel, city});
const {mobile, first} = store.homeInfo; const {mobile, first} = store.homeInfo;
if (!mobile) { if (!mobile) {
...@@ -65,8 +67,8 @@ ComponentWithStore({ ...@@ -65,8 +67,8 @@ ComponentWithStore({
}); });
} else { } else {
this.setData({ this.setData({
showGetPanel: first, showGetPanel: channel && first,
showAlGetPanel: !first, showAlGetPanel: channel && !first,
showPhoneBtn: false, showPhoneBtn: false,
}); });
} }
......
...@@ -15,14 +15,19 @@ class Store { ...@@ -15,14 +15,19 @@ class Store {
activities: [] activities: []
} }
async updateHomeInfo() { async updateHomeInfo(params: {
longitude?: number,
latitude?: number,
channel?: string,
city?: string,
}) {
// wx.showLoading({ // wx.showLoading({
// title: '加载中', // title: '加载中',
// mask: true, // mask: true,
// }); // });
const {success, data} = await request({ const {success, data} = await request({
url: API_PATH.index, url: API_PATH.index,
data: params,
}); });
if (!success) return; if (!success) return;
......
...@@ -6,5 +6,18 @@ ...@@ -6,5 +6,18 @@
"preloadBackgroundData": false, "preloadBackgroundData": false,
"urlCheck": 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