添加了修改头像的功能
This commit is contained in:
@ -47,7 +47,7 @@ Page({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.setData({ showRole });
|
this.setData({ showRole });
|
||||||
if (options.role === 'manger') this.setData({isShowArr: [true, true, true]})
|
if (options.role === 'manager') this.setData({isShowArr: [true, true, true]})
|
||||||
else if (options.role === 'supervisor') this.setData({isShowArr: [false, true, true]})
|
else if (options.role === 'supervisor') this.setData({isShowArr: [false, true, true]})
|
||||||
else if (options.role === 'staff') this.setData({isShowArr: [false, false, true]})
|
else if (options.role === 'staff') this.setData({isShowArr: [false, false, true]})
|
||||||
const trueCount = this.data.isShowArr.filter(v => v === true).length;
|
const trueCount = this.data.isShowArr.filter(v => v === true).length;
|
||||||
|
@ -157,6 +157,16 @@ Page({
|
|||||||
wx.showToast({ title: '姓名只能为中英文', icon: 'none' });
|
wx.showToast({ title: '姓名只能为中英文', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验身份证号
|
||||||
|
const idCardReg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
|
||||||
|
if (!idCardReg.test(idcard)) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '身份证号格式不正确',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
// 提交表单数据到后端
|
// 提交表单数据到后端
|
||||||
wx.request({
|
wx.request({
|
||||||
@ -175,7 +185,7 @@ Page({
|
|||||||
success: res => {
|
success: res => {
|
||||||
console.log('后端返回的申请---->', res);
|
console.log('后端返回的申请---->', res);
|
||||||
if (res.data.code === 1) {
|
if (res.data.code === 1) {
|
||||||
wx.showToast({ title: '验证通过,提交成功', icon: 'success' });
|
wx.showToast({ title: '提交成功', icon: 'success' });
|
||||||
|
|
||||||
// 清空表单内容
|
// 清空表单内容
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -189,7 +199,7 @@ Page({
|
|||||||
credential: '' // 清空凭证
|
credential: '' // 清空凭证
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
wx.showToast({ title: '系统错误', icon: 'error' });
|
wx.showToast({ title: res.data.message, icon: 'none' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
bindinput="onInput"
|
bindinput="onInput"
|
||||||
data-field="code"
|
data-field="code"
|
||||||
value="{{code}}"
|
value="{{code}}"
|
||||||
|
maxlength="6"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-16"
|
class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-16"
|
||||||
|
@ -9,9 +9,11 @@
|
|||||||
padding: 67.5rpx 49.69rpx 84.38rpx 51.56rpx;
|
padding: 67.5rpx 49.69rpx 84.38rpx 51.56rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-y: auto;
|
|
||||||
overflow-x: hidden;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: auto;
|
||||||
|
height: calc(100vh - 1rpx);
|
||||||
}
|
}
|
||||||
.image {
|
.image {
|
||||||
width: 232.5rpx;
|
width: 232.5rpx;
|
||||||
@ -84,7 +86,7 @@
|
|||||||
background-color: #ffffff00;
|
background-color: #ffffff00;
|
||||||
}
|
}
|
||||||
.section_3 {
|
.section_3 {
|
||||||
padding: 19.69rpx 16.88rpx;
|
padding: 30.69rpx 16.88rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-radius: 9.38rpx;
|
border-radius: 9.38rpx;
|
||||||
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
||||||
@ -169,7 +171,7 @@
|
|||||||
padding: 13.13rpx 16.26rpx 15rpx 16.26rpx;
|
padding: 13.13rpx 16.26rpx 15rpx 16.26rpx;
|
||||||
}
|
}
|
||||||
.input_2 {
|
.input_2 {
|
||||||
padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx;
|
padding: 0 16.88rpx;
|
||||||
}
|
}
|
||||||
.input_3 {
|
.input_3 {
|
||||||
padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx;
|
padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx;
|
||||||
|
@ -20,15 +20,67 @@ Page({
|
|||||||
userRole: "",
|
userRole: "",
|
||||||
title: '查看绩效',
|
title: '查看绩效',
|
||||||
id: 0,
|
id: 0,
|
||||||
|
globalImgUrl
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转课程订单页面
|
// 跳转课程订单页面
|
||||||
courseOrder() {
|
courseOrder() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/pages/course/courseOrderList/courseOrderList',
|
url: '/pages/course/courseOrderList/courseOrderList',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
updateAvatar(e) {
|
||||||
|
const { avatarUrl } = e.detail
|
||||||
|
this.uploadAvatar(avatarUrl)
|
||||||
|
},
|
||||||
|
uploadAvatar(filePath) {
|
||||||
|
wx.showLoading({ title: '上传中...' });
|
||||||
|
wx.uploadFile({
|
||||||
|
url: baseUrl + '/file/upload',
|
||||||
|
filePath,
|
||||||
|
name: 'file',
|
||||||
|
formData: {
|
||||||
|
biz: 'default'
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
wx.hideLoading();
|
||||||
|
let result = JSON.parse(res.data);
|
||||||
|
console.log(result)
|
||||||
|
if (result.code === 1) {
|
||||||
|
this.setData({userAvatar: result.data})
|
||||||
|
this.updateUserInfo(result.data)
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: result.message || '上传失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
wx.hideLoading();
|
||||||
|
console.error('uploadFile fail', err);
|
||||||
|
wx.showToast({ title: '网络错误,上传失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
updateUserInfo(view) {
|
||||||
|
const token = wx.getStorageSync('token')
|
||||||
|
wx.request({
|
||||||
|
url: baseUrl + '/userInfo/modify/avatar',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
Authorization: token
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
templateString: view
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
console.log(res.data)
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
wx.showToast({ title: '用户头像更新失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 跳转结算记录页面
|
// 跳转结算记录页面
|
||||||
gotoSettlementRecord() {
|
gotoSettlementRecord() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
@ -142,7 +194,6 @@ Page({
|
|||||||
let result = res.data.data
|
let result = res.data.data
|
||||||
this.setData({
|
this.setData({
|
||||||
nickName: result.nickName,
|
nickName: result.nickName,
|
||||||
// TODO 头像未连接
|
|
||||||
userAvatar: result.userAvatar,
|
userAvatar: result.userAvatar,
|
||||||
phoneNumber: result.phoneNumber,
|
phoneNumber: result.phoneNumber,
|
||||||
userAccount: result.userAccount,
|
userAccount: result.userAccount,
|
||||||
@ -214,10 +265,10 @@ Page({
|
|||||||
|
|
||||||
// 跳转主管排名
|
// 跳转主管排名
|
||||||
gotoSupervisorRank(e) {
|
gotoSupervisorRank(e) {
|
||||||
console.log(e);
|
console.log(e)
|
||||||
const {userRole} = this.data
|
const {userRole} = this.data
|
||||||
console.log('========fds===>', userRole)
|
console.log('===========>', userRole)
|
||||||
if (userRole === 'staff' || userRole === 'user') {
|
if (userRole === 'staff') {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '无权限',
|
title: '无权限',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
@ -225,7 +276,7 @@ Page({
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=${userRole}`,
|
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=manager`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -242,7 +293,7 @@ Page({
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=${userRole}`,
|
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=staff`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -212,13 +212,16 @@
|
|||||||
<view class="flex-col page">
|
<view class="flex-col page">
|
||||||
<view class="flex-row justify-between section">
|
<view class="flex-row justify-between section">
|
||||||
<view class="flex-row items-center self-center">
|
<view class="flex-row items-center self-center">
|
||||||
|
<button open-type="chooseAvatar" bind:chooseavatar="updateAvatar">
|
||||||
<image
|
<image
|
||||||
class="image"
|
class="image"
|
||||||
src="./images/logo.png"
|
src="{{globalImgUrl + userAvatar}}"
|
||||||
|
mode="aspectFill"
|
||||||
/>
|
/>
|
||||||
|
</button>
|
||||||
<view class="flex-col ml-6">
|
<view class="flex-col ml-6">
|
||||||
<text class="self-start font text">{{ nickName }}</text>
|
<text class="self-start font text">{{ nickName }}</text>
|
||||||
<view class="flex-row items-center self-stretch group_2 mt-9" bind:tap="gotoCall">
|
<view class="flex-row items-center self-stretch group_2 mt-9" bindtap="gotoCall">
|
||||||
<image
|
<image
|
||||||
class="image_3"
|
class="image_3"
|
||||||
src="./images/dianhua.png"
|
src="./images/dianhua.png"
|
||||||
@ -248,21 +251,21 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="flex-col mt-22" >
|
<view class="flex-col mt-22" >
|
||||||
<view class="flex-row items-start equal-division section_3" wx:if="{{ userRole != 'user' }}">
|
<view class="flex-row items-start equal-division section_3" wx:if="{{ userRole != 'user' }}">
|
||||||
<view class="flex-col items-center equal-division-item_1 group_3" bind:tap="checkPerformance">
|
<view class="flex-col items-center equal-division-item_1 group_3" bindtap="checkPerformance">
|
||||||
<image
|
<image
|
||||||
class="image_5"
|
class="image_5"
|
||||||
src="./images/zhijinxiangqing.png"
|
src="./images/zhijinxiangqing.png"
|
||||||
/>
|
/>
|
||||||
<text class="font text_5 mt-6">{{title}}</text>
|
<text class="font text_5 mt-6">{{title}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col items-center equal-division-item_2 equal-division-item" bind:tap="gotoSupervisorRank" data-userRole="{{ 'manager' }}">
|
<view class="flex-col items-center equal-division-item_2 equal-division-item" bindtap="gotoSupervisorRank" data-userRole="{{ 'manager' }}">
|
||||||
<image
|
<image
|
||||||
class="image_5"
|
class="image_5"
|
||||||
src="./images/tixianzhanghu.png"
|
src="./images/tixianzhanghu.png"
|
||||||
/>
|
/>
|
||||||
<text class="font text_6 mt-6">主管排名</text>
|
<text class="font text_6 mt-6">主管排名</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col items-center equal-division-item_3 group_5" bind:tap="gotoStaffRank" data-userRole="{{ 'supervisor' }}">
|
<view class="flex-col items-center equal-division-item_3 group_5" bindtap="gotoStaffRank" data-userRole="{{ 'supervisor' }}">
|
||||||
<image
|
<image
|
||||||
class="image_5"
|
class="image_5"
|
||||||
src="./images/tixianjilu.png"
|
src="./images/tixianjilu.png"
|
||||||
@ -272,7 +275,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="flex-col list">
|
<view class="flex-col list">
|
||||||
<view class="flex-row justify-between items-center section_4" wx:if="{{isShowOrder}}">
|
<view class="flex-row justify-between items-center section_4" wx:if="{{isShowOrder}}">
|
||||||
<view class="flex-row items-center" bind:tap="courseOrder">
|
<view class="flex-row items-center" bindtap="courseOrder">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_6"
|
class="shrink-0 image_6"
|
||||||
src="./images/zhanghaoshezhi.png"
|
src="./images/zhanghaoshezhi.png"
|
||||||
@ -284,7 +287,7 @@
|
|||||||
src="./images/xiajiantou.png"
|
src="./images/xiajiantou.png"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row justify-between items-center section_4 mt-11" bind:tap="gotoDashboard" wx:if="{{ userRole !== 'user' }}">
|
<view class="flex-row justify-between items-center section_4 mt-11" bindtap="gotoDashboard" wx:if="{{ userRole !== 'user' }}">
|
||||||
<view class="flex-row items-center">
|
<view class="flex-row items-center">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_6"
|
class="shrink-0 image_6"
|
||||||
@ -297,7 +300,7 @@
|
|||||||
src="./images/xiajiantou.png"
|
src="./images/xiajiantou.png"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row justify-between items-center section_4 mt-11" bind:tap="zhshezhi">
|
<view class="flex-row justify-between items-center section_4 mt-11" bindtap="zhshezhi">
|
||||||
<view class="flex-row items-center">
|
<view class="flex-row items-center">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_6"
|
class="shrink-0 image_6"
|
||||||
|
@ -19,13 +19,25 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.section {
|
.section {
|
||||||
padding: 15rpx 13.13rpx 26.25rpx;
|
padding: 15rpx 13.13rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-radius: 8.33rpx;
|
border-radius: 8.33rpx;
|
||||||
}
|
}
|
||||||
.image {
|
.image {
|
||||||
width: 161.25rpx;
|
padding: 10rpx;
|
||||||
height: 161.25rpx;
|
width: 151.25rpx;
|
||||||
|
height: 151.25rpx;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
/* 去掉默认最小宽度 */
|
||||||
|
min-width: 0 !important;
|
||||||
|
/* 确保宽度随内容自适应 */
|
||||||
|
width: auto !important;
|
||||||
|
/* 下面是其他重置,保证“隐形” */
|
||||||
|
background: transparent !important;
|
||||||
|
border: none !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
.font {
|
.font {
|
||||||
font-size: 26.25rpx;
|
font-size: 26.25rpx;
|
||||||
@ -67,7 +79,7 @@
|
|||||||
}
|
}
|
||||||
.group {
|
.group {
|
||||||
margin-top: 33.75rpx;
|
margin-top: 33.75rpx;
|
||||||
width: 163.72rpx;
|
width: 133.72rpx;
|
||||||
}
|
}
|
||||||
.image_2 {
|
.image_2 {
|
||||||
margin-left: 17.48rpx;
|
margin-left: 17.48rpx;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export const local='http://localhost:9091';
|
export const local='http://localhost:9091';
|
||||||
|
export const caozhe = 'http://160.202.242.36:9093'
|
||||||
export const dev = 'http://160.202.242.36:9091';
|
export const dev = 'http://160.202.242.36:9091';
|
||||||
export const test = 'http://160.202.242.36:9092';
|
export const test = 'http://160.202.242.36:9092';
|
||||||
export const localTest = 'http://localhost:9092';
|
export const localTest = 'http://localhost:9092';
|
||||||
|
Reference in New Issue
Block a user