This commit is contained in:
许允枞 2024-11-14 17:48:47 +08:00
parent c26b1854bb
commit 387fa2db59
5 changed files with 728 additions and 359 deletions

View File

@ -350,6 +350,20 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
},
{
"path": "pages/editUserInfo/editUserInfo",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},
{
"path": "pages/modifyPassword/modifyPassword",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
} }
], ],
"globalStyle": { "globalStyle": {

View File

@ -0,0 +1,156 @@
<template>
<view class="container">
<u-upload
:fileList="fileList"
@afterRead="afterRead"
@delete="deletePic"
multiple
:maxCount="1"
></u-upload>
<view class="form-item">
<text>昵称</text>
<input v-model="nickname" placeholder="请输入昵称" />
</view>
<view class="form-item">
<text>手机号码</text>
<input v-model="mobile" placeholder="请输入手机号码" />
</view>
<button @click="saveChanges">保存</button>
</view>
</template>
<script>
import {getTenantId, getToken} from "@/utils/auth";
import request from "@/utils/request";
import {baseImageUrl} from "@/config";
export default {
data() {
return {
nickname: '',
mobile: '',
fileList: [],
};
},
onLoad(options) {
//
this.id = options.id;
this.getMy()
},
methods: {
saveChanges() {
request({
url: '/system/user/profile/update',
method: 'put',
data: {
nickname: this.nickname,
mobile: this.mobile,
}
})
// API
console.log('保存信息', this.nickname, this.mobile);
//
setTimeout(() => {
uni.navigateBack();
}, 500);
},
async getMy() {
let res = await request({
url: '/system/user/profile/get',
method: 'get',
})
this.nickname = res.data.nickname
this.mobile = res.data.mobile
this.avatar = res.data.avatar
this.fileList.push({
url: baseImageUrl + '/' +this.avatar,
status: 'success'
})
},
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
console.log('event', event)
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
console.log('lists', lists)
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.$baseUrl + '/system/user/profile/update-avatar',
filePath: url,
name: 'avatarFile',
header: {
'Tenant-Id': getTenantId(),
'Authorization': 'Bearer ' + getToken()
},
formData: {
user: 'test'
},
success: (res) => {
try {
let img = JSON.parse(res.data);
this.imagePath = img.data.url
} catch (e) {
//TODO handle the exception
}
setTimeout(() => {
resolve(res.data.data)
}, 1000)
}
});
})
},
}
};
</script>
<style scoped>
.container {
padding: 20px;
}
.form-item {
margin-bottom: 15px;
}
input {
width: 95%;
padding: 10px;
margin-top: 5px;
border: 1px solid #ddd;
border-radius: 4px;
}
button {
margin-top: 20px;
background-color: #007aff;
color: white;
padding: 10px;
border-radius: 5px;
width: 100%;
}
</style>

View File

@ -0,0 +1,106 @@
<template>
<view class="modify-password-page">
<view class="form-item">
<text>旧密码</text>
<input type="password" placeholder="请输入旧密码" v-model="oldPassword"/>
</view>
<view class="form-item">
<text>新密码</text>
<input type="password" placeholder="请输入新密码" v-model="newPassword"/>
</view>
<view class="form-item">
<text>确认新密码</text>
<input type="password" placeholder="再次输入新密码" v-model="confirmPassword"/>
</view>
<button @click="submitPassword">提交</button>
</view>
</template>
<script>
import request from "@/utils/request";
export default {
data() {
return {
oldPassword: '',
newPassword: '',
confirmPassword: ''
};
},
methods: {
submitPassword() {
if (!this.oldPassword || !this.newPassword || !this.confirmPassword) {
uni.showToast({
title: '请填写完整信息',
icon: 'none'
});
return;
}
if (this.newPassword !== this.confirmPassword) {
uni.showToast({
title: '两次密码输入不一致',
icon: 'none'
});
return;
}
//
request({
url: '/system/user/profile/update-password', // API
method: 'PUT',
data: {
oldPassword: this.oldPassword,
newPassword: this.newPassword
},
}).then(res => {
if (res.data) {
uni.showToast({
title: '密码修改成功',
icon: 'success'
});
setTimeout(() => {
uni.navigateBack();
}, 1000);
} else {
uni.showToast({
title: '修改失败,请重试',
icon: 'none'
});
}
});
}
}
};
</script>
<style scoped>
.modify-password-page {
padding: 20px;
}
.form-item {
margin-bottom: 15px;
}
.form-item text {
display: block;
margin-bottom: 5px;
font-size: 16px;
}
input {
width: 95%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
width: 100%;
padding: 10px;
background-color: #007aff;
color: #fff;
font-size: 16px;
text-align: center;
border-radius: 4px;
}
</style>

View File

@ -1,374 +1,447 @@
<!-- 我的 --> <!-- 我的 -->
<template> <template>
<view class="content"> <view class="content">
<view style="width: 100%; height: 44px;"></view> <view style="width: 100%; height: 44px;"></view>
<view class="top-ail"> <view class="top-ail">
<!-- <view class="dix">--> <view class="dix">
<!-- <view class="touxiang">--> <view style="display: flex">
<!-- <image :src="baseUrl +user.avatar" mode=""></image>--> <view class="touxiang">
<!-- </view>--> <image :src="baseUrl +user.avatar" mode=""></image>
<!-- <view class="">--> </view>
<!-- <view class="t-title">{{user.realName}}</view>--> <view class="">
<!-- <view class="t-tel">{{user.phonenumber}}</view>--> <view class="t-title">{{ user.nickname }}</view>
<!-- </view>--> <view class="t-tel">{{ user.mobile }}</view>
<!-- </view>--> </view>
<!-- 三项 --> </view>
<!-- 店铺商铺 --> <!-- 添加编辑按钮 -->
<view class="edit-button" >
<view style="margin-bottom: 10px" @click="modifyPassword">修改密码</view>
<view style="margin-top: 10px" @click="editUserInfo">编辑信息</view>
</view>
</view>
<!-- 三项 -->
<!-- --> <!-- 店铺商铺 -->
<view class="ian-box">
<view class="on-input" @click="golieb()">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/zhaq.png" mode=""></image>
</view>
<view class="aa">上门取车列表</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
<view class="on-input" @click="goRoyalty()">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/zhaq.png" mode=""></image>
</view>
<view class="aa">提成记录</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
</view>
<view class="ian-box">
<!-- <view class="on-input">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/zhaq.png" mode=""></image>
</view>
<view class="aa">账户与安全</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
<view class="on-input">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/yhk.png" mode=""></image>
</view>
<view class="aa">银行卡管理</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view> -->
<view class="on-input" @click="dialogToggle()"> <!-- -->
<view class="dix"> <view class="ian-box">
<view class="d-icon"> <view class="on-input" @click="golieb()">
<image src="../../static/detection/tc.png" mode=""></image> <view class="dix">
</view> <view class="d-icon">
<view class="aa">退出登录</view> <image src="../../static/detection/zhaq.png" mode=""></image>
</view> </view>
<view class=""> <view class="aa">上门取车列表</view>
<uni-icons type="right" color="#999999" size="16"></uni-icons> </view>
</view> <view class="">
</view> <uni-icons type="right" color="#999999" size="16"></uni-icons>
</view> </view>
</view> </view>
<uni-popup ref="alertDialog" type="dialog"> <view class="on-input" @click="goRoyalty()">
<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出吗!" @confirm="dialogConfirm" <view class="dix">
@close="dialogClose"></uni-popup-dialog> <view class="d-icon">
</uni-popup> <image src="../../static/detection/zhaq.png" mode=""></image>
</view>
<view class="aa">提成记录</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
</view>
<view class="ian-box">
<!-- <view class="on-input">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/zhaq.png" mode=""></image>
</view>
<view class="aa">账户与安全</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
<view class="on-input">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/yhk.png" mode=""></image>
</view>
<view class="aa">银行卡管理</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view> -->
<view class="on-input" @click="dialogToggle()">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/tc.png" mode=""></image>
</view>
<view class="aa">退出登录</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
</view>
</view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出吗!"
@confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup>
<!-- 底部 --> <!-- 底部 -->
<view style="width: 100%; height: 50px;"></view> <view style="width: 100%; height: 50px;"></view>
<tabBar :msg="msg"></tabBar> <tabBar :msg="msg"></tabBar>
</view> </view>
</template> </template>
<script> <script>
import config from '@/config' import config from '@/config'
import request from '../../utils/request'; import request from '../../utils/request';
import tabBar from'../../components/staffTabBer/tabBar.vue' import tabBar from '../../components/staffTabBer/tabBar.vue'
export default {
data() { export default {
return { data() {
msg:'3', return {
user:{}, msg: '3',
baseUrl:'', user: {},
partnerId:'', baseUrl: '',
myindex:{} partnerId: '',
} myindex: {}
}, }
onLoad() { },
this.baseUrl = this.$baseUrl onLoad() {
}, this.baseUrl = this.$baseImageUrl + '/'
onShow() { },
this.user = uni.getStorageSync('staffinfo') onShow() {
console.log(this.user); this.user = uni.getStorageSync('staffinfo')
this.partnerId = uni.getStorageSync('partnerId') console.log(this.user);
// this.getindexmy() this.partnerId = uni.getStorageSync('partnerId')
}, this.getindexmy()
components:{ },
tabBar, components: {
}, tabBar,
methods: { },
dialogToggle() { methods: {
this.$refs.alertDialog.open() dialogToggle() {
}, this.$refs.alertDialog.open()
dialogConfirm(){ },
this.tui() modifyPassword() {
this.$refs.alertDialog.close() //
}, uni.navigateTo({
dialogClose() { url: '/pages/modifyPassword/modifyPassword' //
this.$refs.alertDialog.close() });
console.log('点击关闭') },
}, dialogConfirm() {
async getindexmy(){ this.tui()
let res = await request({ this.$refs.alertDialog.close()
url:'/partnerOwn/partner/accountInfo?partnerId='+this.partnerId, },
method: 'get', //
}) editUserInfo() {
this.myindex = res.data //
let ress = await request({ uni.navigateTo({
url:'/partnerOwn/partner/shopInfo', url: `/pages/editUserInfo/editUserInfo`
method: 'get', });
}) },
this.user = ress.data dialogClose() {
}, this.$refs.alertDialog.close()
tui(){ console.log('点击关闭')
uni.clearStorageSync(); },
uni.reLaunch({ async getindexmy() {
url:'/pages/Login/login' console.log('调用')
}) // let res = await request({
}, // url:'/partnerOwn/partner/accountInfo?partnerId='+this.partnerId,
golieb(){ // method: 'get',
uni.navigateTo({ // })
url:"/pages/staff/golist" // this.myindex = res.data
}) let ress = await request({
}, url: '/system/user/profile/get',
goRoyalty(){ method: 'get',
uni.navigateTo({ })
url:"/pages/staff/goRoyalty" console.log('个人信息', ress.data)
}) this.user = ress.data
}, },
getdianpu(){ tui() {
uni.navigateTo({ uni.clearStorageSync();
url:"/pages/my/shoporder" uni.reLaunch({
}) url: '/pages/Login/login'
} })
} },
} golieb() {
uni.navigateTo({
url: "/pages/staff/golist"
})
},
goRoyalty() {
uni.navigateTo({
url: "/pages/staff/goRoyalty"
})
},
getdianpu() {
uni.navigateTo({
url: "/pages/my/shoporder"
})
}
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.content { .content {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: calc(100vh); height: calc(100vh);
background: linear-gradient(225deg, #EFF5FF 0%, rgba(255,255,255,0) 100%); background: linear-gradient(225deg, #EFF5FF 0%, rgba(255, 255, 255, 0) 100%);
} }
.c-top{
width: 100%; .c-top {
// height: 283px; width: 100%;
// background-color: cornflowerblue; // height: 283px;
// background: url("http://www.nuoyunr.com/lananRsc/shopBg.png") center no-repeat; // background-color: cornflowerblue;
// background-size:100% 100%; // background: url("http://www.nuoyunr.com/lananRsc/shopBg.png") center no-repeat;
} // background-size:100% 100%;
.top-ail{ }
width: 100%;
box-sizing: border-box; .top-ail {
padding: 20px; width: 100%;
} box-sizing: border-box;
.dix{ padding: 20px;
display: flex; }
align-items: center;
} .dix {
.touxiang{ display: flex;
width: 50px; align-items: center;
height: 50px; justify-content: space-between; /* 保持头像和信息左对齐,按钮右对齐 */
border-radius: 50%; }
overflow: hidden;
background-color: whitesmoke; .touxiang {
margin-left: 10px; width: 50px;
image{ height: 50px;
width: 100%; border-radius: 50%;
height: 100%; overflow: hidden;
} background-color: whitesmoke;
} margin-left: 10px;
.t-title{
font-size: 18px; image {
font-weight: bold; width: 100%;
color: #333333; height: 100%;
margin-left: 15px; }
} }
.t-tel{
font-size: 14px; .t-title {
font-weight: 400; font-size: 18px;
color: #999999; font-weight: bold;
margin-left: 15px; color: #333333;
} margin-left: 15px;
.sanxiang{ }
width: 100%;
box-sizing: border-box; .t-tel {
padding: 20px; font-size: 14px;
background-color: white; font-weight: 400;
border-radius: 8px; color: #999999;
display: flex; margin-left: 15px;
justify-content: space-between; }
align-items: center;
margin-top: 30px; .sanxiang {
} width: 100%;
.lan-box{ box-sizing: border-box;
width: 100%; padding: 20px;
box-sizing: border-box; background-color: white;
padding: 15px; border-radius: 8px;
background: linear-gradient(90deg, #EDF4FD 0%, #E1EFFF 100%); display: flex;
border-radius: 8px; justify-content: space-between;
margin: 10px auto; align-items: center;
} margin-top: 30px;
.s-box{ }
width: 33%;
border-right: 1px solid #EEEEEE; .lan-box {
text-align: center; width: 100%;
} box-sizing: border-box;
.simg{ padding: 15px;
width: 26px; background: linear-gradient(90deg, #EDF4FD 0%, #E1EFFF 100%);
height: 26px; border-radius: 8px;
margin: 0 auto; margin: 10px auto;
image{ }
width: 100%;
height: 100%; .s-box {
} width: 33%;
} border-right: 1px solid #EEEEEE;
.zc-text{ text-align: center;
font-size: 13px; }
font-weight: 400;
color: #333333; .simg {
margin: 5px auto; width: 26px;
} height: 26px;
.lan-num{ margin: 0 auto;
font-size: 26px;
font-weight: 600; image {
color: #0D2E8D; width: 100%;
} height: 100%;
.hei-title{ }
font-size: 16px; }
font-weight: 600;
color: #333333; .zc-text {
} font-size: 13px;
.cont-box{ font-weight: 400;
margin-top: 10px; color: #333333;
width: 100%; margin: 5px auto;
display: flex; }
justify-content: space-between;
align-items: center; .lan-num {
} font-size: 26px;
.c-left{ font-weight: 600;
width: 50%; color: #0D2E8D;
box-sizing: border-box; }
}
.l-left{ .hei-title {
width: 50%; font-size: 16px;
box-sizing: border-box; font-weight: 600;
border-right: 1px solid #EEEEEE; color: #333333;
padding-right: 5px; }
}
.c-bt{ .cont-box {
font-size: 14px; margin-top: 10px;
font-weight: 400; width: 100%;
color: #666666; display: flex;
margin-bottom: 2px; justify-content: space-between;
} align-items: center;
.c-lan{ }
font-size: 25px;
font-weight: 600; .c-left {
color: #0D2E8D; width: 50%;
} box-sizing: border-box;
.c-right{ }
width: 122px;
height: 35px; .l-left {
background: #FFFFFF; width: 50%;
border-radius: 50px; box-sizing: border-box;
display: flex; border-right: 1px solid #EEEEEE;
justify-content: center; padding-right: 5px;
align-items: center; }
color: #0D2E8D;
} .c-bt {
.l-icon{ font-size: 14px;
width: 15px; font-weight: 400;
height: 15px; color: #666666;
image{ margin-bottom: 2px;
width: 100%; }
height: 100%;
} .c-lan {
} font-size: 25px;
.lan-text{ font-weight: 600;
font-size: 14px; color: #0D2E8D;
font-weight: 400; }
color: #0D2E8D;
margin: 0px 2px; .c-right {
} width: 122px;
.c-hei{ height: 35px;
font-size: 20px; background: #FFFFFF;
font-weight: 600; border-radius: 50px;
color: #333333; display: flex;
} justify-content: center;
.dian-box{ align-items: center;
background-color: white; color: #0D2E8D;
border-radius: 8px; }
box-sizing: border-box;
width: 100%; .l-icon {
padding: 15px; width: 15px;
display: flex; height: 15px;
align-items: center;
justify-content: space-between; image {
margin-bottom: 10px; width: 100%;
} height: 100%;
.ian-box{ }
background-color: white; }
border-radius: 8px;
box-sizing: border-box; .lan-text {
width: 100%; font-size: 14px;
padding: 15px; font-weight: 400;
padding-bottom: 0px; color: #0D2E8D;
// margin-bottom: 10px; margin: 0px 2px;
margin-top: 10px; }
}
.dian-top{ .c-hei {
width: 100%; font-size: 20px;
display: flex; font-weight: 600;
align-items: center; color: #333333;
justify-content: space-between; }
margin-bottom: 5px;
} .dian-box {
.d-icon{ background-color: white;
width: 16px; border-radius: 8px;
height: 16px; box-sizing: border-box;
image{ width: 100%;
width: 100%; padding: 15px;
height: 100%; display: flex;
} align-items: center;
} justify-content: space-between;
.aa{ margin-bottom: 10px;
font-size: 16px; }
font-weight: 400;
color: #333333; .ian-box {
margin-left: 5px; background-color: white;
} border-radius: 8px;
.on-input{ box-sizing: border-box;
width: 100%; width: 100%;
display: flex; padding: 15px;
justify-content: space-between; padding-bottom: 0px;
align-items: center; // margin-bottom: 10px;
box-sizing: border-box; margin-top: 10px;
// border-bottom: 1px solid #EEEEEE; }
padding-bottom: 10px;
margin-bottom: 10px; .dian-top {
} width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 5px;
}
.d-icon {
width: 16px;
height: 16px;
image {
width: 100%;
height: 100%;
}
}
.aa {
font-size: 16px;
font-weight: 400;
color: #333333;
margin-left: 5px;
}
.on-input {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
// border-bottom: 1px solid #EEEEEE;
padding-bottom: 10px;
margin-bottom: 10px;
}
.edit-button {
font-size: 14px;
color: #007aff;
margin-top: 10px;
cursor: pointer;
align-self: flex-end; /* 使按钮右对齐 */
view:hover {
text-decoration: underline;
}
}
//.edit-button:hover {
// text-decoration: underline;
//}
</style> </style>

View File

@ -39,6 +39,7 @@
<view class="top-left"> <view class="top-left">
<view class="dhei">{{ item.goodsName }}</view> <view class="dhei">{{ item.goodsName }}</view>
<text class="xhui">接待员{{ item.workerName }}</text> <text class="xhui">接待员{{ item.workerName }}</text>
<text class="xhui" style="margin-left: 50rpx;">检测项目{{ item.projectName }}</text>
</view> </view>
<view @click="callUser(item.buyPhone)" class="top-right"> <view @click="callUser(item.buyPhone)" class="top-right">
<image src="../../static/detection/teel.png" mode=""></image> <image src="../../static/detection/teel.png" mode=""></image>
@ -68,6 +69,7 @@
<view class="bottom-di"> <view class="bottom-di">
<view class="button-container"> <view class="button-container">
<u-button class="button" v-if="item.workNodeStatus === '0'" @click="orderTaking(item)" size="10">同意</u-button> <u-button class="button" v-if="item.workNodeStatus === '0'" @click="orderTaking(item)" size="10">同意</u-button>
<u-button class="button" v-if="item.workNodeStatus === '1'" @click="cancelAnOrder(item)" size="10">取消接单</u-button>
<u-button class="button" @click="godetails(item)" size="10">查看详情</u-button> <u-button class="button" @click="godetails(item)" size="10">查看详情</u-button>
</view> </view>
</view> </view>
@ -220,6 +222,24 @@ export default {
} }
}) })
}, },
cancelAnOrder(data){
request({
url:'/system/info/cancelAnOrder',
method:'post',
params:{
inspectionId:data.id,
workNodeId:data.workNodeId
}
}).then(res=>{
if(res.code == 200){
uni.showToast({
title:'取消接单成功',
icon:'none'
})
this.getList()
}
})
},
gogogo() { gogogo() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/Neworder' url: '/pages/index/Neworder'