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": "",
"enablePullDownRefresh": true
}
},
{
"path": "pages/editUserInfo/editUserInfo",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},
{
"path": "pages/modifyPassword/modifyPassword",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
}
],
"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

@ -3,15 +3,23 @@
<view class="content">
<view style="width: 100%; height: 44px;"></view>
<view class="top-ail">
<!-- <view class="dix">-->
<!-- <view class="touxiang">-->
<!-- <image :src="baseUrl +user.avatar" mode=""></image>-->
<!-- </view>-->
<!-- <view class="">-->
<!-- <view class="t-title">{{user.realName}}</view>-->
<!-- <view class="t-tel">{{user.phonenumber}}</view>-->
<!-- </view>-->
<!-- </view>-->
<view class="dix">
<view style="display: flex">
<view class="touxiang">
<image :src="baseUrl +user.avatar" mode=""></image>
</view>
<view class="">
<view class="t-title">{{ user.nickname }}</view>
<view class="t-tel">{{ user.mobile }}</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>
<!-- 三项 -->
<!-- 店铺商铺 -->
@ -79,7 +87,8 @@
</view>
</view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出吗!" @confirm="dialogConfirm"
<uni-popup-dialog cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出吗!"
@confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup>
@ -95,6 +104,7 @@
import config from '@/config'
import request from '../../utils/request';
import tabBar from '../../components/staffTabBer/tabBar.vue'
export default {
data() {
return {
@ -106,13 +116,13 @@
}
},
onLoad() {
this.baseUrl = this.$baseUrl
this.baseUrl = this.$baseImageUrl + '/'
},
onShow() {
this.user = uni.getStorageSync('staffinfo')
console.log(this.user);
this.partnerId = uni.getStorageSync('partnerId')
// this.getindexmy()
this.getindexmy()
},
components: {
tabBar,
@ -121,24 +131,39 @@
dialogToggle() {
this.$refs.alertDialog.open()
},
modifyPassword() {
//
uni.navigateTo({
url: '/pages/modifyPassword/modifyPassword' //
});
},
dialogConfirm() {
this.tui()
this.$refs.alertDialog.close()
},
//
editUserInfo() {
//
uni.navigateTo({
url: `/pages/editUserInfo/editUserInfo`
});
},
dialogClose() {
this.$refs.alertDialog.close()
console.log('点击关闭')
},
async getindexmy() {
let res = await request({
url:'/partnerOwn/partner/accountInfo?partnerId='+this.partnerId,
method: 'get',
})
this.myindex = res.data
console.log('调用')
// let res = await request({
// url:'/partnerOwn/partner/accountInfo?partnerId='+this.partnerId,
// method: 'get',
// })
// this.myindex = res.data
let ress = await request({
url:'/partnerOwn/partner/shopInfo',
url: '/system/user/profile/get',
method: 'get',
})
console.log('个人信息', ress.data)
this.user = ress.data
},
tui() {
@ -173,6 +198,7 @@
height: calc(100vh);
background: linear-gradient(225deg, #EFF5FF 0%, rgba(255, 255, 255, 0) 100%);
}
.c-top {
width: 100%;
// height: 283px;
@ -180,15 +206,19 @@
// background: url("http://www.nuoyunr.com/lananRsc/shopBg.png") center no-repeat;
// background-size:100% 100%;
}
.top-ail {
width: 100%;
box-sizing: border-box;
padding: 20px;
}
.dix {
display: flex;
align-items: center;
justify-content: space-between; /* 保持头像和信息左对齐,按钮右对齐 */
}
.touxiang {
width: 50px;
height: 50px;
@ -196,23 +226,27 @@
overflow: hidden;
background-color: whitesmoke;
margin-left: 10px;
image {
width: 100%;
height: 100%;
}
}
.t-title {
font-size: 18px;
font-weight: bold;
color: #333333;
margin-left: 15px;
}
.t-tel {
font-size: 14px;
font-weight: 400;
color: #999999;
margin-left: 15px;
}
.sanxiang {
width: 100%;
box-sizing: border-box;
@ -224,6 +258,7 @@
align-items: center;
margin-top: 30px;
}
.lan-box {
width: 100%;
box-sizing: border-box;
@ -232,36 +267,43 @@
border-radius: 8px;
margin: 10px auto;
}
.s-box {
width: 33%;
border-right: 1px solid #EEEEEE;
text-align: center;
}
.simg {
width: 26px;
height: 26px;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
.zc-text {
font-size: 13px;
font-weight: 400;
color: #333333;
margin: 5px auto;
}
.lan-num {
font-size: 26px;
font-weight: 600;
color: #0D2E8D;
}
.hei-title {
font-size: 16px;
font-weight: 600;
color: #333333;
}
.cont-box {
margin-top: 10px;
width: 100%;
@ -269,27 +311,32 @@
justify-content: space-between;
align-items: center;
}
.c-left {
width: 50%;
box-sizing: border-box;
}
.l-left {
width: 50%;
box-sizing: border-box;
border-right: 1px solid #EEEEEE;
padding-right: 5px;
}
.c-bt {
font-size: 14px;
font-weight: 400;
color: #666666;
margin-bottom: 2px;
}
.c-lan {
font-size: 25px;
font-weight: 600;
color: #0D2E8D;
}
.c-right {
width: 122px;
height: 35px;
@ -300,25 +347,30 @@
align-items: center;
color: #0D2E8D;
}
.l-icon {
width: 15px;
height: 15px;
image {
width: 100%;
height: 100%;
}
}
.lan-text {
font-size: 14px;
font-weight: 400;
color: #0D2E8D;
margin: 0px 2px;
}
.c-hei {
font-size: 20px;
font-weight: 600;
color: #333333;
}
.dian-box {
background-color: white;
border-radius: 8px;
@ -330,6 +382,7 @@
justify-content: space-between;
margin-bottom: 10px;
}
.ian-box {
background-color: white;
border-radius: 8px;
@ -340,6 +393,7 @@
// margin-bottom: 10px;
margin-top: 10px;
}
.dian-top {
width: 100%;
display: flex;
@ -347,20 +401,24 @@
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;
@ -371,4 +429,19 @@
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>

View File

@ -39,6 +39,7 @@
<view class="top-left">
<view class="dhei">{{ item.goodsName }}</view>
<text class="xhui">接待员{{ item.workerName }}</text>
<text class="xhui" style="margin-left: 50rpx;">检测项目{{ item.projectName }}</text>
</view>
<view @click="callUser(item.buyPhone)" class="top-right">
<image src="../../static/detection/teel.png" mode=""></image>
@ -68,6 +69,7 @@
<view class="bottom-di">
<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 === '1'" @click="cancelAnOrder(item)" size="10">取消接单</u-button>
<u-button class="button" @click="godetails(item)" size="10">查看详情</u-button>
</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() {
uni.navigateTo({
url: '/pages/index/Neworder'