|
|
@@ -106,6 +106,11 @@ Page({
|
|
|
moreHandler() {
|
|
|
this.experience();
|
|
|
},
|
|
|
+ selectCity(e) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: "/pages/home/location/index",
|
|
|
+ });
|
|
|
+ },
|
|
|
experience(e) {
|
|
|
// console.log(e, 11111111);
|
|
|
if (
|
|
|
@@ -113,13 +118,13 @@ Page({
|
|
|
e.currentTarget.dataset.index == 3
|
|
|
) {
|
|
|
// if (wx.getStorageSync("USER")) {
|
|
|
- const obj = this.data.goodsClassfiyList.find(v => v.name == '联名福利') || '';
|
|
|
- // console.log(obj);
|
|
|
- wx.setStorageSync('classfiyId', obj ? obj.id : '')
|
|
|
- wx.navigateTo({
|
|
|
- url: e.currentTarget.dataset.index == 4 ?
|
|
|
- "/invitationCode/index" : `/pages/quality/index/index`,
|
|
|
- });
|
|
|
+ const obj = this.data.goodsClassfiyList.find(v => v.name == '联名福利') || '';
|
|
|
+ // console.log(obj);
|
|
|
+ wx.setStorageSync('classfiyId', obj ? obj.id : '')
|
|
|
+ wx.navigateTo({
|
|
|
+ url: e.currentTarget.dataset.index == 4 ?
|
|
|
+ "/invitationCode/index" : `/pages/quality/index/index`,
|
|
|
+ });
|
|
|
// } else {
|
|
|
// wx.navigateTo({
|
|
|
// url: "/pages/login",
|
|
|
@@ -186,7 +191,7 @@ Page({
|
|
|
// 最新兼职
|
|
|
newJob() {
|
|
|
let nowCity = wx.getStorageSync("CHOOSECITY");
|
|
|
- // console.log(nowCity);
|
|
|
+ console.log(nowCity);
|
|
|
let that = this;
|
|
|
app._post_form(
|
|
|
"home/label",
|
|
|
@@ -372,20 +377,45 @@ Page({
|
|
|
// })
|
|
|
},
|
|
|
onLoad: function (options) {
|
|
|
- this.loadCity();
|
|
|
+ console.log("options", options);
|
|
|
+ if (!options.cityId) {
|
|
|
+ this.loadCity();
|
|
|
+ }
|
|
|
this.height();
|
|
|
if (wx.getStorageSync("USER")) {
|
|
|
this.PushVipInfo();
|
|
|
}
|
|
|
+
|
|
|
let _this = this;
|
|
|
_this.data.option = options;
|
|
|
setTimeout(function () {
|
|
|
_this.loadDictionary();
|
|
|
}, 100);
|
|
|
_this.addScore();
|
|
|
- _this.getLocal();
|
|
|
+ if (options.cityId) {
|
|
|
+ let cityData = {
|
|
|
+ cityName: options.cityName,
|
|
|
+ cityId: options.cityId
|
|
|
+ };
|
|
|
+ wx.setStorageSync("CHOOSECITY", cityData);
|
|
|
+ this.setData({
|
|
|
+ currentCity: cityData,
|
|
|
+ }, () => {
|
|
|
+ console.log("currentCity", this.data.currentCity)
|
|
|
+ //设置城市选择数据
|
|
|
+ this.loadList(true)
|
|
|
+ _this.hotActive();
|
|
|
+ _this.newJob();
|
|
|
+ _this.schoolPer();
|
|
|
+ _this.getExpert();
|
|
|
+ _this.getShop();
|
|
|
+ _this.getGoodsClassfiy();
|
|
|
+ _this.getShopList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _this.getLocal();
|
|
|
+ }
|
|
|
_this.getAgree()
|
|
|
-
|
|
|
},
|
|
|
toPrivacy() {
|
|
|
wx.openPrivacyContract({
|
|
|
@@ -564,7 +594,7 @@ Page({
|
|
|
},
|
|
|
loadCity: function () {
|
|
|
let _this = this;
|
|
|
- app._post_form("region/list", "", null, function (res) {
|
|
|
+ app._post_form("serviceCityList", "", null, function (res) {
|
|
|
if (res.data.length) {
|
|
|
//设置城市选择的数据
|
|
|
let cityData = {
|
|
|
@@ -585,29 +615,14 @@ Page({
|
|
|
let cityName = res.data[i].name;
|
|
|
if (nowCity.cityName === cityName) {
|
|
|
cityData.cityName = res.data[i].name;
|
|
|
- cityData.cityId = res.data[i].id;
|
|
|
+ cityData.cityId = res.data[i].cityId;
|
|
|
cityListIndex.push(i);
|
|
|
-
|
|
|
- // for (let m = 0; m < res.data[i].childRegionList.length; m++) {
|
|
|
- // let areaName = res.data[i].childRegionList[m].name;
|
|
|
- // if (nowCity.areaName === areaName) {
|
|
|
- // cityData.areaName = res.data[i].childRegionList[m].name;
|
|
|
- // cityData.areaId = res.data[i].childRegionList[m].id;
|
|
|
-
|
|
|
- // cityListPickerData.push(res.data[i].childRegionList);
|
|
|
- // cityListIndex.push(m);
|
|
|
- // break a;
|
|
|
- // }
|
|
|
- // }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
cityData.cityName = res.data[0].name;
|
|
|
- cityData.cityId = res.data[0].id;
|
|
|
- cityData.areaName = res.data[0].childRegionList[0].name;
|
|
|
- cityData.areaId = res.data[0].childRegionList[0].id;
|
|
|
- cityListPickerData = [res.data, res.data[0].childRegionList];
|
|
|
+ cityData.cityId = res.data[0].cityId;
|
|
|
cityListIndex = [0, 0];
|
|
|
}
|
|
|
//设置城市选择数据
|
|
|
@@ -732,7 +747,7 @@ Page({
|
|
|
}
|
|
|
const obj = res.list.find(v => v.name == '联名福利') || '';
|
|
|
// console.log(obj);
|
|
|
- if(!obj) return
|
|
|
+ if (!obj) return
|
|
|
this.getGoodsList1(obj.id);
|
|
|
}
|
|
|
});
|