From 48145f787eda81815f653ad21161a60e89b6a303 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 13 十一月 2024 16:41:32 +0800
Subject: [PATCH] 2024.11.13
---
pages/mUser/mine/mine.js | 180 ++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 104 insertions(+), 76 deletions(-)
diff --git a/pages/mUser/mine/mine.js b/pages/mUser/mine/mine.js
index e51ab94..1976431 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,167 @@
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;
+ case '9':
+ //闂鏁存敼
+ url = '/pages/mExtra/pSupervisionSummary/index';
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 +195,6 @@
// success: (res) => {
// res.eventChannel.emit('acceptDataFromOpenerPage', app.globalData.)
// },
- })
- }
-})
\ No newline at end of file
+ });
+ },
+});
--
Gitblit v1.9.3