From 0f2fdf16f47bd2d1d8fee86449c3a5095ccc8c23 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 21 十月 2022 18:32:04 +0800
Subject: [PATCH] 首发版本 2022.10.21

---
 pages/m_user/mine/mine.js |  130 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 129 insertions(+), 1 deletions(-)

diff --git a/pages/m_user/mine/mine.js b/pages/m_user/mine/mine.js
index a5515b2..02065b2 100644
--- a/pages/m_user/mine/mine.js
+++ b/pages/m_user/mine/mine.js
@@ -1,4 +1,6 @@
 // pages/mine/mine.js
+import userservice from '../../../service/userservice'
+
 const app = getApp()
 
 Page({
@@ -7,7 +9,9 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-
+    version: app.globalData.version,
+    //璁よ瘉鐘舵�侊紝[浼佷笟, 鍦烘櫙, 涓汉]
+    authStatus:[]
   },
 
   /**
@@ -17,11 +21,135 @@
     this.setData({
       userRealName: app.globalData.userInfo.realname
     })
+    this.getBaseInfo()
+  },
+
+  onShow() {
+    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',
+          })
+        }
+      }
+    })
+  },
+
+  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)
   },
 
   logout() {
     wx.reLaunch({
       url: '/pages/m_user/userlogin/userlogin',
     })
+  },
+
+  goto(e) {
+    var url = ""
+    var index = e.currentTarget.dataset.index
+    switch (index) {
+      case "1":
+        //宸ヤ綔鎻愰啋
+        url = "/pages/m_notice/notice/notice"
+        break;
+      case "2":
+        //鎶�鏈敮鎸�
+        url = "/pages/m_user/p_support/p_support"
+        break;
+      case "3":
+        //鎴戠殑鏀惰棌
+        url = ""
+        break;
+      case "4":
+        //鎴戣鍜ㄨ
+        url = "/pages/m_consult/consultonline/consultonline"
+        break;
+      case "5":
+        //鐜繚鏃ョ▼
+        url = "/pages/m_service/p_schedule/p_schedule"
+        break;
+      case "6":
+        //鍏充簬
+        url = "/pages/m_user/p_about/p_about"
+        break;
+      case "7":
+        //鎿嶄綔鎸囧紩
+        url = "/pages/m_user/p_instructions/p_instructions"
+        break;
+    }
+    if (url != "") {
+      wx.navigateTo({
+        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
+    switch (index) {
+      //浼佷笟璁よ瘉
+      case "0":
+        url = "/pages/m_user/companyauthentication/companyauthentication"
+        break;
+      //鍦烘櫙璁よ瘉
+      case "1":
+        url = "/pages/m_user/sceneauthentication/sceneauthentication"
+        break;
+      //涓汉璁よ瘉
+      case "2":
+        url = "/pages/m_user/personalauthentication/personalauthentication"
+        break;
+    }
+    if (url != "") {
+      wx.navigateTo({
+        url: url,
+        success: (res) => {
+          res.eventChannel.emit('acceptDataFromOpenerPage', {
+            authStatus: this.data.authStatus[parseInt(index)]
+          })
+        },
+      })
+    } else {
+      wx.showToast({
+        title: '鍔熻兘鏁鏈熷緟',
+        duration: 1000,
+        icon: 'none',
+        mask: true,
+      })
+    }
   }
 })
\ No newline at end of file

--
Gitblit v1.9.3