From 5006b1e5ef630b084601caa919ea69637d07b1e3 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Tue, 31 Jan 2023 15:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/request.js | 6 +- pages/home/my.vue | 28 +++---- pages/home/personalInfo.vue | 58 +++++++++++--- pages/home/rePassword.vue | 80 +++++++++++++++++++ pages/massif/detail.vue | 2 +- pages/massif/mana/plantPlan.vue | 2 +- pages/massif/mana/recovery.vue | 2 +- router/home.js | 9 +++ store/index.js | 17 +++- uni.scss | 2 +- .../d-form/components/d-form/d-form.vue | 2 +- 11 files changed, 173 insertions(+), 35 deletions(-) create mode 100644 pages/home/rePassword.vue diff --git a/common/request.js b/common/request.js index 1e9fce5..6914b0d 100644 --- a/common/request.js +++ b/common/request.js @@ -42,7 +42,7 @@ const request=async function(url,param={}){ if(param.file||param.filePath){ var res=await uni.uploadFile({ - url:`${param.host||host()}${('/'+url).replace(/\/{2}/,'/').replace(/\?.+/,"")}?${pathData}`, + url:`${param.host||host(undefined,param.suffix)}${('/'+url).replace(/\/{2}/,'/').replace(/\?.+/,"")}?${pathData}`, file:param.file||{}, filePath:param.filePath||"", name:"file", @@ -69,9 +69,7 @@ const request=async function(url,param={}){ if(res){ if(res.data.code==401){ - uni.reLaunch({ - url:"/pages/home/login", - }) + store.commit('outLogin') return{statu:false, msg:"登录超时!"} } else if(res.data.code==200)return { statu:true, data:res.data.result } diff --git a/pages/home/my.vue b/pages/home/my.vue index 2b62f98..c63fdaa 100644 --- a/pages/home/my.vue +++ b/pages/home/my.vue @@ -16,10 +16,7 @@ margin:0; display: flex; flex-direction: column; - .headImg{ - width:140rpx; - height:140rpx; - border-radius: 50%; + .u-transition{ margin:-120rpx auto 10rpx auto; } .name{ @@ -40,7 +37,7 @@ text{ &:first-child{ color:#10C176; - font-size:30rpx; + font-size:36rpx; margin-right:32rpx; } &:nth-child(3){ @@ -55,33 +52,36 @@ - + + + {{$store.getters.userInfo.realname}} {{$store.getters.userInfo.phone}} 个人信息 - - 修改密码 - - - 采购记录 + + 修改密码 - - 领用记录 + + 采购记录 + 领用记录 + + 退出 \ No newline at end of file diff --git a/pages/home/rePassword.vue b/pages/home/rePassword.vue new file mode 100644 index 0000000..d6747f7 --- /dev/null +++ b/pages/home/rePassword.vue @@ -0,0 +1,80 @@ + + + \ No newline at end of file diff --git a/pages/massif/detail.vue b/pages/massif/detail.vue index 583be8a..5e2394a 100644 --- a/pages/massif/detail.vue +++ b/pages/massif/detail.vue @@ -96,7 +96,7 @@ import request,{host} from '@/common/request' data(){ return{ detail:{}, - imgUrl:host(undefined,"/plant_manage/sys/common/static"), + imgUrl:host("imgUrl"), } }, onLoad(options){ diff --git a/pages/massif/mana/plantPlan.vue b/pages/massif/mana/plantPlan.vue index 5462c6a..2b1916b 100644 --- a/pages/massif/mana/plantPlan.vue +++ b/pages/massif/mana/plantPlan.vue @@ -154,7 +154,7 @@ export default { }, total:0, list:[], - host:host(undefined,"/plant_manage/sys/common/static"), + host:host("imgUrl"), } }, created(){ diff --git a/pages/massif/mana/recovery.vue b/pages/massif/mana/recovery.vue index ffd7347..104792c 100644 --- a/pages/massif/mana/recovery.vue +++ b/pages/massif/mana/recovery.vue @@ -114,7 +114,7 @@ export default { return{ show:false, dateType:"startTime", - host:host(undefined,"/plant_manage/sys/common/static"), + host:host("imgUrl"), searchVal:{ pageNo:1, pageSize:5, diff --git a/router/home.js b/router/home.js index b50b6c5..0d57663 100644 --- a/router/home.js +++ b/router/home.js @@ -46,4 +46,13 @@ module.exports=[ } } }, + { + path:"pages/home/rePassword", + style:{ + navigationBarTitleText:"修改密码", + "app-plus":{ + titleNView:false + } + } + }, ] \ No newline at end of file diff --git a/store/index.js b/store/index.js index 9d90b43..4b31437 100644 --- a/store/index.js +++ b/store/index.js @@ -13,9 +13,22 @@ export default new Vuex.Store({ }, mutations:{ setUserInfo(state, val){ - state.userInfo=val.userInfo + state.userInfo={ + ...val.userInfo, + companyName:val.departs[0].departName + } state.token=val.token - } + }, + outLogin(state){ + state.userInfo={} + state.token='' + uni.reLaunch({ + url:"/pages/home/login", + }) + }, + setHeadImg(state,val){ + state.userInfo.avatar=val + }, }, actions:{ diff --git a/uni.scss b/uni.scss index 51a38c4..ce0cda6 100644 --- a/uni.scss +++ b/uni.scss @@ -77,7 +77,7 @@ $uni-font-size-paragraph:15px; @import '@/common/main.css'; @import 'uview-ui/theme.scss'; -@import url('https://at.alicdn.com/t/c/font_3852037_bwfjvlm958.css'); +@import url('https://at.alicdn.com/t/c/font_3852037_owoae3ai5lc.css'); [class*=plant-]{ font-family: "plantMana" !important; font-size: 16px; diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index d907541..0fcc526 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -318,7 +318,7 @@ import {dataType} from 'black-knight/lib/config/tools' if(this.type=='dateRange' && this.dateType=='end' && this.value[0])return new Date(this.value[0]).getTime(); }, imgs(){ - if(this.type=='upImg')return this.value.map((v,index)=>({url:`${host(undefined,"/plant_manage/sys/common/static")}/${v}`,status:"success",index,type:'saved'})).concat(this.imgList.map((v,index)=>Object.assign(v,{index,type:'unsaved'}))) + if(this.type=='upImg')return this.value.map((v,index)=>({url:`${host('imgUrl')}/${v}`,status:"success",index,type:'saved'})).concat(this.imgList.map((v,index)=>Object.assign(v,{index,type:'unsaved'}))) return [] }, pickerContent(){//下拉选择 表单显示数据