chengjunhui vor 1 Monat
Ursprung
Commit
65783b013c
3 geänderte Dateien mit 45 neuen und 47 gelöschten Zeilen
  1. 6 23
      pages/home/index/index.js
  2. 37 22
      pages/my/myStudy/myStudy.js
  3. 2 2
      pages/my/myStudy/myStudy.wxml

+ 6 - 23
pages/home/index/index.js

@@ -619,6 +619,12 @@ Page({
               cityListIndex.push(i);
             }
           }
+
+          if (cityListIndex.length == 0) {
+            cityData.cityName = res.data[0].name;
+            cityData.cityId = res.data[0].cityId;
+            cityListIndex.push(0);
+          }
         }
         else {
           cityData.cityName = res.data[0].name;
@@ -997,27 +1003,4 @@ Page({
       });
     }
   },
-
-  showRewardedVideoAd: function (e) {
-    this.selectComponent('.uni-rewarded-video-ad').show();
-  },
-  onadload: function (e) {
-    console.log('广告加载成功:', e)
-  },
-  onadclose: function (e) {
-    const detail = e.detail
-    // 用户点击了【关闭广告】按钮
-    if (detail && detail.isEnded) {
-      // 正常播放结束
-      console.log("onClose-正常播放结束:" + detail.isEnded);
-    } else {
-      // 播放中途退出
-      console.log("onClose-播放中途退出:" + detail.isEnded);
-    }
-  },
-  onaderror: function (e) {
-    // 广告加载失败
-    console.log('广告加载失败:', e.detail)
-  }
-
 });

+ 37 - 22
pages/my/myStudy/myStudy.js

@@ -157,12 +157,12 @@ Page({
         "studentstatus/update",
         "",
         {
-          city: this.data.allData.region,
+          city: this.data.allData.region + '',
           college: this.data.college,
           faculty: this.data.facultyName,
           identityNumber: this.data.identityNumber,
           proofOfQualifications: this.data.userphoto,
-          province: this.data.allData.province,
+          province: this.data.allData.province + '',
           realName: this.data.userName,
           sex: this.data.sexCode,
           specialized: this.data.professionalTitle,
@@ -183,12 +183,12 @@ Page({
         "studentstatus/save",
         "",
         {
-          city: this.data.allData.region,
+          city: this.data.allData.region + '',
           college: this.data.college,
           faculty: this.data.facultyName,
           identityNumber: this.data.identityNumber,
           proofOfQualifications: this.data.userphoto,
-          province: this.data.allData.province,
+          province: this.data.allData.province + '',
           realName: this.data.userName,
           sex: this.data.sexCode,
           specialized: this.data.professionalTitle,
@@ -298,6 +298,9 @@ Page({
   _success () {
     console.log("查看");
     this.popup2.hidePopup();
+    this.setData({
+      load: true,
+    })
     this.getInfo();
   },
 
@@ -412,19 +415,19 @@ Page({
     let _this = this;
     let proId = "";
     let prov = "";
-    // let prov = this.data.allData.province;
-    App._post_form("areainfo/province", "", null, function (res) {
+    // let prov = this.data.allData.province; areainfo/province 
+    App._post_form("region/provinceList", "", null, function (res) {
       if (res.code === 0) {
-        let provice = res.list;
+        let provice = res.data;
         _this.data.multiArray[0] = provice;
         CityArray0 = provice;
-        console.log("数组:", _this.data.u.province);
+        // console.log("数组:", _this.data.u.province);
         if (_this.data.u.region) {
           prov = _this.data.u.province;
           // debugger
           if (CityArray0.length) {
             for (let i = 0; i < CityArray0.length; i++) {
-              if (CityArray0[i].areaid == prov) {
+              if (CityArray0[i].id == prov) {
                 // _this.data.multiIndex[0] = i;
                 _this.setData({
                   ["multiIndex[0]"]: i,
@@ -434,12 +437,14 @@ Page({
             }
           }
         }
+        // console.log("prov", prov);
+        // console.log("load", _this.data.load);
         if (prov && _this.data.load === true) {
           proId = prov;
         } else {
           //根据默认省,获取默认市
           if (_this.data.multiArray[0].length) {
-            proId = _this.data.multiArray[0][0].areaid;
+            proId = _this.data.multiArray[0][0].id;
           }
         }
         _this.loadCity(proId);
@@ -448,18 +453,20 @@ Page({
   },
 
   //获取市级
-  loadCity (cid) {
+  loadCity(cid) {
+    console.log("cid", cid);
     let _this = this;
-    App._post_form("areainfo/city/" + cid, "", null, function (res) {
+    // areainfo / city /
+    App._post_form("region/childList", "", { id: cid }, function (res) {
       if (res.code === 0) {
-        let city = res.list;
+        let city = res.data;
         _this.data.multiArray[1] = city;
         CityArray1 = city;
         if (_this.data.u.region) {
           let region = _this.data.u.region;
           if (CityArray1.length) {
             for (let i = 0; i < CityArray1.length; i++) {
-              if (CityArray1[i].areaid === region) {
+              if (CityArray1[i].id === region) {
                 _this.data.multiIndex[1] = i;
                 break;
               }
@@ -470,7 +477,7 @@ Page({
             cityId = region;
           } else {
             if (_this.data.multiArray[1].length) {
-              cityId = _this.data.multiArray[1][0].areaid;
+              cityId = _this.data.multiArray[1][0].id;
             }
           }
           // _this.loadSchool(cityId)
@@ -562,14 +569,19 @@ Page({
   },
   // 地区change
   areaChange (e) {
-    this.data.load = false;
+    // this.data.load = false;
+    this.setData({
+      load: false,
+    })
     let _this = this;
     _this.data.multiIndex[0] = e.detail.value[0];
     _this.data.multiIndex[1] = e.detail.value[1];
     _this.setData({
       multiIndex: _this.data.multiIndex,
-      ["allData.province"]: CityArray0[_this.data.multiIndex[0]].areaid,
-      ["allData.region"]: CityArray1[_this.data.multiIndex[1]].areaid,
+      ["allData.province"]: CityArray0[_this.data.multiIndex[0]].id,
+      ["allData.region"]: CityArray1[_this.data.multiIndex[1]].id,
+      college: '',
+      sname: '',
     });
     // _this.loadSchool(_this.data.allData.region)
     _this.getSchool(_this.data.allData.region);
@@ -579,10 +591,13 @@ Page({
   },
   //绑定选择器滑动事件 地区
   MultiPickerAreaChange: function (e) {
-    this.data.load = false;
+    // this.data.load = false;
+    this.setData({
+      load: false,
+    });
     let _this = this;
     if (e.detail.column === 0) {
-      let pid = CityArray0[e.detail.value].areaid;
+      let pid = CityArray0[e.detail.value].id;
       _this.data.multiIndex[0] = e.detail.value;
       _this.loadCity(pid);
       _this.setData({
@@ -597,8 +612,8 @@ Page({
       // 	index1: e.detail.value
       // })
     }
-    console.log(1111111111111);
-    console.log(e);
+    // console.log(1111111111111);
+    // console.log(e);
   },
   schoolName () {
     if (this.data.disabled) {

+ 2 - 2
pages/my/myStudy/myStudy.wxml

@@ -19,9 +19,9 @@
               </picker> -->
               <picker disabled="{{disabled}}" mode="multiSelector" bindchange="areaChange"
                 bindcolumnchange="MultiPickerAreaChange" value="{{multiIndex}}" range="{{multiArray}}"
-                range-key="areaname">
+                range-key="name">
                 <view wx:if="{{allData.province}}" class="picker">
-                  {{multiArray[0][multiIndex[0]].areaname}} {{multiArray[1][multiIndex[1]].areaname}}
+                  {{multiArray[0][multiIndex[0]].name}} {{multiArray[1][multiIndex[1]].name}}
                   <text class="iconfont icon-xiayibu font35 right-icon"></text>
                 </view>
                 <view wx:else class="picker">