From 9b09d13712c0c005891450a3bf4b6d848ec0ff37 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 29 十一月 2023 10:28:24 +0800
Subject: [PATCH] 2023.11.29

---
 pages/mUser/mine/mine.js |  176 +++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 100 insertions(+), 76 deletions(-)

diff --git a/pages/mUser/mine/mine.js b/pages/mUser/mine/mine.js
index e51ab94..28d9a96 100644
--- a/pages/mUser/mine/mine.js
+++ b/pages/mUser/mine/mine.js
@@ -1,19 +1,21 @@
 // pages/mine/mine.js
-import userservice from '../../../service/userservice'
+import userservice from '../../../service/userservice';
+import $f from '../../../service/baserequest';
 
-const app = getApp()
+const app = getApp();
 
 Page({
-
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    icon1: $f.baseIconUrl + 'res/learn_2.png',
+
     version: app.globalData.version,
     //璁よ瘉鐘舵�侊紝[浼佷笟, 鍦烘櫙, 涓汉]
-    authStatus:[],
+    authStatus: [],
     //鍦烘櫙绫诲瀷
-    sceneType: app.globalData.userInfo.extension2
+    sceneType: app.globalData.userInfo.extension2,
   },
 
   /**
@@ -22,141 +24,163 @@
   onLoad: function (options) {
     this.setData({
       userRealName: app.globalData.userInfo.realname,
-      sceneType: app.globalData.userInfo.extension2
-    })
-    this.getBaseInfo()
+      sceneType: app.globalData.userInfo.extension2,
+    });
+    this.getBaseInfo();
   },
 
   onShow() {
-    this.getAuthStatus()
+    this.getAuthStatus();
   },
 
   //鑾峰彇鐢ㄦ埛璁よ瘉鐘舵��
   getAuthStatus() {
-    var that = this
-    userservice.getAuthStatus(app.globalData.accessToken.openId, app.globalData.accessToken.userId, {
-      success(res) {
-        if (res.success) {
-          that.setData({
-            authStatus: res.data
-          })
-        }else{
-          wx.showToast({
-            title: res.message,
-            duration: 2000,
-            icon: 'error',
-          })
-        }
-      }
-    })
+    var that = this;
+    userservice.getAuthStatus(
+      app.globalData.accessToken.openId,
+      app.globalData.accessToken.userId,
+      {
+        success(res) {
+          if (res.success) {
+            that.setData({
+              authStatus: res.data,
+            });
+          } else {
+            wx.showToast({
+              title: res.message,
+              duration: 2000,
+              icon: 'error',
+            });
+          }
+        },
+      },
+    );
   },
 
   getBaseInfo() {
-    var that = this
-    userservice.getBaseInfo(app.globalData.accessToken.userId, {
-      success(data) {
-        if (data.company != null) {
-          that.setData({
-            companyName: data.company.ciName
-          }) 
-        }
-      }
-    }, app.globalData.accessToken.openId)
+    var that = this;
+    userservice.getBaseInfo(
+      app.globalData.accessToken.userId,
+      {
+        success(data) {
+          if (data.company != null) {
+            that.setData({
+              companyName: data.company.ciName,
+            });
+          }
+        },
+      },
+      app.globalData.accessToken.openId,
+    );
   },
 
   logout() {
     wx.reLaunch({
       url: '/pages/mUser/userlogin/userlogin',
-    })
+    });
   },
 
   goto(e) {
-    var url = ""
-    var index = e.currentTarget.dataset.index
+    var url = '';
+    var index = e.currentTarget.dataset.index;
     switch (index) {
-      case "0":
+      case '0':
         //鐩戞祴鏁版嵁
-        url = "/pages/mService/pDevicedata/pDevicedata"
+        url = '/pages/mService/pDevicedata/pDevicedata';
         break;
-      case "1":
+      case '1':
         //閫氱煡绠$悊
-        url = "/pages/mNotice/notice/notice"
+        url = '/pages/mNotice/notice/notice';
         break;
-      case "2":
+      case '2':
         //鎶�鏈敮鎸�
-        url = "/pages/mUser/pSupport/pSupport"
+        url = '/pages/mUser/pSupport/pSupport';
         break;
-      case "3":
+      case '3':
         //鎴戠殑鏀惰棌
-        url = ""
+        url = '';
         break;
-      case "4":
+      case '4':
         //鎴戣鍜ㄨ
-        url = "/pages/mConsult/consultonline/consultonline"
+        url = '/pages/mConsult/consultonline/consultonline';
         break;
-      case "5":
+      case '5':
         //鐜繚鏃ョ▼
-        url = "/pages/mService/pSchedule/pSchedule"
+        url = '/pages/mService/pSchedule/pSchedule';
         break;
-      case "6":
+      case '6':
         //鍏充簬
-        url = "/pages/mUser/pAbout/pAbout"
+        url = '/pages/mUser/pAbout/pAbout';
         break;
-      case "7":
+      case '7':
         //鎿嶄綔鎸囧紩
-        url = "/pages/mUser/pInstructions/pInstructions"
+        url = '/pages/mUser/pInstructions/pInstructions';
+        break;
+      case '8':
+        //瀹堟硶鎵胯
+        url = '/pages/mPromise/promisehome/promise';
         break;
     }
-    if (url != "") {
+    if (url != '') {
       wx.navigateTo({
-        url: url
-      })
+        url: url,
+      });
     } else {
       wx.showToast({
         title: '鍔熻兘鏁鏈熷緟',
         duration: 1000,
         icon: 'none',
         mask: true,
-      })
+      });
     }
   },
 
   //璁よ瘉
   gotoAuthentication(e) {
     //绛夊緟璁よ瘉鐘舵�佸姞杞藉畬姣�
-    if (this.data.authStatus.length == 0) return
-    var url = ""
-    var index = e.currentTarget.dataset.index
+    if (this.data.authStatus.length == 0) return;
+    var url = '';
+    var index = e.currentTarget.dataset.index;
     switch (index) {
       //浼佷笟璁よ瘉
-      case "0":
-        url = "/pages/mUser/companyauthentication/companyauthentication"
+      case '0':
+        url = '/pages/mUser/companyauthentication/companyauthentication';
         break;
       //鍦烘櫙璁よ瘉
-      case "1":
-        url = "/pages/mUser/sceneauthentication/sceneauthentication"
+      case '1':
+        switch (this.data.sceneType) {
+          case '1':
+            url = '/pages/mUser/sceneauthentication/sceneauthentication';
+            break;
+          case '6':
+            url = '/pages/mUser/sceneauthentication/industrial/index';
+            break;
+          default:
+            url = '/pages/mUser/sceneauthentication/sceneauthentication';
+            break;
+        }
         break;
       //涓汉璁よ瘉
-      case "2":
-        url = "/pages/mUser/personalauthentication/personalauthentication"
+      case '2':
+        url = '/pages/mUser/personalauthentication/personalauthentication';
         break;
     }
-    if (url != "") {
+    if (url != '') {
       wx.navigateTo({
         url: url,
-        success: (res) => {
+        success: res => {
           res.eventChannel.emit('acceptDataFromOpenerPage', {
-            authStatus: this.data.authStatus[parseInt(index)]
-          })
+            authStatus: this.data.authStatus[parseInt(index)],
+          });
         },
-      })
+      });
     } else {
       wx.showToast({
         title: '鍔熻兘鏁鏈熷緟',
         duration: 1000,
         icon: 'none',
         mask: true,
-      })
+      });
     }
   },
 
@@ -167,6 +191,6 @@
       // success: (res) => {
       //   res.eventChannel.emit('acceptDataFromOpenerPage', app.globalData.)
       // },
-    })
-  }
-})
\ No newline at end of file
+    });
+  },
+});

--
Gitblit v1.9.3