From 6ceeddde3522c33ced86c4a63a2e9d96e5c2e383 Mon Sep 17 00:00:00 2001
From: chen <2659004835@qq.com>
Date: Fri, 1 Apr 2022 10:57:34 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BE=AE=E4=BF=A1=E6=8E=88?=
=?UTF-8?q?=E6=9D=83=E7=99=BB=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 2 +-
commons/base.css | 2 ++
components/foot-tabs/foot-tab-one.vue | 9 ++-------
jsFile/tools.js | 22 +++++++++++----------
manifest.json | 2 +-
pages/feedback/feedback.vue | 3 ++-
pages/tabbar/my/my.vue | 21 ++++++++++++++------
pages/tabbar/pagehome/pagehome.vue | 5 +++--
pages/workOrder/workorderTwo.vue | 6 +++---
pagesB/plan-fault-product-detail/detail.vue | 3 ++-
pagesB/plan-fault/plan-fault.vue | 3 ++-
11 files changed, 45 insertions(+), 33 deletions(-)
diff --git a/App.vue b/App.vue
index 2eab217..ffadcf2 100644
--- a/App.vue
+++ b/App.vue
@@ -15,7 +15,7 @@
// #endif
// #ifdef MP-WEIXIN
// uni.setStorageSync('hostapi','http://maintain.7and5.cn');
- getApp().globalData.hostapi = 'http://maintain.7and5.cn';
+ this.globalData.hostapi = 'http://maintain.7and5.cn';
// #endif
// #ifdef H5
// uni.setStorageSync('hostapi','/web');
diff --git a/commons/base.css b/commons/base.css
index 3a239f6..5af313f 100644
--- a/commons/base.css
+++ b/commons/base.css
@@ -214,6 +214,8 @@ button:after{content: none!important;}
.radius35{border-radius: 35rpx;}
.radius40{border-radius: 40rpx;}
.radius45{border-radius: 45rpx;}
+.radius_50{border-radius: 50%;}
+.radius_100{border-radius: 100%;}
/* 上下左右---外边距 */
.mar10{margin: 10rpx;}
diff --git a/components/foot-tabs/foot-tab-one.vue b/components/foot-tabs/foot-tab-one.vue
index ea2ab75..070776f 100644
--- a/components/foot-tabs/foot-tab-one.vue
+++ b/components/foot-tabs/foot-tab-one.vue
@@ -115,7 +115,7 @@
if(index==0){
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
} else {
- // if(!this.$toolAll.tools.judgeAuth()) {
+ if(this.$toolAll.tools.judgeAuth()) {
// 已授权
switch (index){
case 1:
@@ -144,12 +144,7 @@
uni.reLaunch({url:'/pages/tabbar/my/my'})
break;
}
- // } else {
- // // 未授权
- // uni.navigateTo({
- // url:'/pages/login/login'
- // })
- // }
+ }
}
},
scanCode() {
diff --git a/jsFile/tools.js b/jsFile/tools.js
index af51ea1..5d3f3e7 100644
--- a/jsFile/tools.js
+++ b/jsFile/tools.js
@@ -1,3 +1,4 @@
+const app = getApp();
const tools = {
timer:'',
timerNot:'',
@@ -498,7 +499,7 @@ const tools = {
if (res.code) {
var params = {code:res.code}
uni.request({
- url: `${getApp().globalData.hostapi}/api/user/login`,
+ url: `${app.globalData.hostapi}/api/user/login`,
method: 'post',
data: params,
header: {
@@ -523,16 +524,17 @@ const tools = {
}
},
// 判断是否授权,没授权,前往登录页面授权
+ authTimer:null,
judgeAuth(){
- let auth = true;
- switch (uni.getStorageSync('phone_active')*1){
- case 0: // 未注册
- uni.navigateTo({url:'/pages/login/login'});
- auth = false
- break;
- case 1: // 已注册
- auth = true
- break;
+ let auth = false;
+ clearTimeout(this.authTimer);
+ if(!uni.getStorageSync('token')) {
+ this.showToast('请登录');
+ this.authTimer = setTimeout(()=>{
+ uni.navigateTo({url:'/pages/login/login'});
+ },2000)
+ } else {
+ auth = true;
}
return auth;
},
diff --git a/manifest.json b/manifest.json
index 9ec7720..a0ee592 100644
--- a/manifest.json
+++ b/manifest.json
@@ -87,7 +87,7 @@
/* 快应用特有相关 */
"mp-weixin" : {
/* 小程序特有相关 */
- "appid" : "wx705dfb975654e53a",
+ "appid" : "wx372ffc194d87c693",
"setting" : {
"urlCheck" : true,
"es6" : true
diff --git a/pages/feedback/feedback.vue b/pages/feedback/feedback.vue
index 554d1b1..d2cfa19 100644
--- a/pages/feedback/feedback.vue
+++ b/pages/feedback/feedback.vue
@@ -50,6 +50,7 @@
import statusNav from '../../components/status-nav.vue';
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
+ const app = getApp();
export default {
components: {
footTabOne,
@@ -141,7 +142,7 @@
const tempFilePaths = chooseImageRes.tempFilePaths;
this.imgSrc = chooseImageRes.tempFilePaths[0]
uni.uploadFile({
- url: getApp().globalData.hostapi+'/universal/api.upload/upload', //仅为示例,非真实的接口地址
+ url: app.globalData.hostapi+'/universal/api.upload/upload', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'image',
header:{
diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue
index 59fc994..55ece36 100644
--- a/pages/tabbar/my/my.vue
+++ b/pages/tabbar/my/my.vue
@@ -27,17 +27,16 @@
style="background: url(../../../static/public/icon-my-head.png) no-repeat;height: 400rpx;background-size: 100% 100%;">
-
-
-
+
+
+
{{tel(userInfo.username)}}
+
未实名认证
+
@@ -181,6 +180,16 @@
this.$toolAll.tools.disableShareEv();
},
methods: {
+ // 更换头像
+ replaceImg(){
+ uni.chooseImage({
+ count: 1,
+ sourceType:['album','camera'],
+ success: (res) => {
+ this.userInfo.avatar = res.tempFilePaths[0];
+ }
+ })
+ },
// 退出登录
logOutEv() {
this.$requst.post('/universal/api.login/signout').then(res => {
diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue
index 35bc2c9..0c283a9 100644
--- a/pages/tabbar/pagehome/pagehome.vue
+++ b/pages/tabbar/pagehome/pagehome.vue
@@ -231,6 +231,7 @@
import lwNotice from '@/components/lw-notice/lw-notice.vue';
import footTabOne from '@/components/foot-tabs/foot-tab-one.vue';
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
+ const app = getApp();
export default {
components:{
pitera,
@@ -368,7 +369,7 @@
let obj = {
id:item.id,
title:item.name,
- imgsrc: getApp().globalData.hostapi + '/' + item.cover_img,
+ imgsrc: app.globalData.hostapi + '/' + item.cover_img,
}
this.solutionList.push(obj);
})
@@ -398,7 +399,7 @@
let obj = {
id:item.id,
title:item.title,
- imgsrc: getApp().globalData.hostapi + '/' + item.cover_img,
+ imgsrc: app.globalData.hostapi + '/' + item.cover_img,
content:item.summary,
views:item.reading
}
diff --git a/pages/workOrder/workorderTwo.vue b/pages/workOrder/workorderTwo.vue
index 86e94ad..9206a38 100644
--- a/pages/workOrder/workorderTwo.vue
+++ b/pages/workOrder/workorderTwo.vue
@@ -218,9 +218,9 @@
},
goWorkorderTwo(){
console.log(this.targetObj);
- // uni.navigateTo({
- // url: "/pages/workOrder/workOrderThree"
- // })
+ uni.navigateTo({
+ url: "/pages/workOrder/workOrderThree"
+ })
},
addMountingsList() {
uni.navigateTo({
diff --git a/pagesB/plan-fault-product-detail/detail.vue b/pagesB/plan-fault-product-detail/detail.vue
index 28aac6c..55abdbd 100644
--- a/pagesB/plan-fault-product-detail/detail.vue
+++ b/pagesB/plan-fault-product-detail/detail.vue
@@ -21,6 +21,7 @@