Browse Source

接口

master
李双庆 10 months ago
parent
commit
28e8dbf967
  1. 8
      api/apiRoute.js
  2. 37
      pages/coach/my/index.vue
  3. 77
      pages/coach/my/info.vue
  4. 166
      pages/coach/my/update_pass.vue

8
api/apiRoute.js

@ -147,7 +147,13 @@ export default {
//获取我的页面统计个数
getStatisticsInfo(data = {}) {
let url = '/class/Statistics/info'
return http.get(url, data).then(res => {
return res;
})
},
//添加作业 //添加作业
jlPublishJob(data = {}) { jlPublishJob(data = {}) {
let url = '/class/jlPublishJob/add' let url = '/class/jlPublishJob/add'

37
pages/coach/my/index.vue

@ -30,24 +30,24 @@
<view class="course_box"> <view class="course_box">
<view class="top"> <view class="top">
<view class="item"> <view class="item">
<view class="num">{{memberInfo.zsks}}</view> <view class="num">{{statisticsInfo.courseNum}}</view>
<view class="intro">总授课数/</view> <view class="intro">总授课数/</view>
</view> </view>
<view class="item"> <view class="item">
<view class="num">{{memberInfo.zsbj}}</view> <view class="num">{{statisticsInfo.classNum}}</view>
<view class="intro">总授班级/</view> <view class="intro">总授班级/</view>
</view> </view>
<view class="item"> <view class="item">
<view class="num">{{memberInfo.zfzxy}}</view> <view class="num">{{statisticsInfo.studentNum}}</view>
<view class="intro">总负责学员/ <view class="intro">总负责学员/
</view> </view>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
月授课数 月授课数
<text>12</text> <text>{{statisticsInfo.courseMonthNum}}</text>
月负责学员 月负责学员
<text>188</text> <text>{{statisticsInfo.studentMonthNum}}</text>
</view> </view>
</view> </view>
@ -66,12 +66,12 @@
<view>xxx场馆</view> <view>xxx场馆</view>
</view> </view>
<view class="item" @click="openViewDueSoon()"> <!-- <view class="item" @click="openViewDueSoon()"> -->
<view class="item">
<view>即将到期</view> <view>即将到期</view>
<view></view> <view></view>
</view> </view>
<!-- <view class="item" @click="openViewSchoolingStatistics()"> -->
<view class="item"> <view class="item">
<view>授课统计</view> <view>授课统计</view>
<view></view> <view></view>
@ -83,8 +83,8 @@
<view></view> <view></view>
</view> </view>
<!-- <view class="item" @click="openViewSchoolingStatistics()"> --> <!-- <view class="item"> -->
<view class="item"> <view class="item" @click="openViewSchoolingStatistics()">
<view>我的消息</view> <view>我的消息</view>
<view></view> <view></view>
</view> </view>
@ -125,6 +125,7 @@ export default {
data() { data() {
return { return {
memberInfo:{}, memberInfo:{},
statisticsInfo: []
} }
}, },
onLoad() { onLoad() {
@ -135,6 +136,7 @@ export default {
methods: { methods: {
async init(){ async init(){
this.getMemberInfo() this.getMemberInfo()
this.getStatistics()
}, },
//() //()
@ -149,6 +151,19 @@ export default {
} }
this.memberInfo = res.data this.memberInfo = res.data
}, },
//
async getStatistics() {
let res = await apiRoute.getStatisticsInfo({})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.statisticsInfo = res.data
},
// //
openViewArrivalStatistics(){ openViewArrivalStatistics(){
@ -164,10 +179,10 @@ export default {
}) })
}, },
// //
openViewSchoolingStatistics(){ openViewSchoolingStatistics(){
this.$navigateTo({ this.$navigateTo({
url: '/pages/coach/my/schooling_statistics' url: '/pages/common/my_message'
}) })
}, },

77
pages/coach/my/info.vue

@ -8,7 +8,7 @@
<image <image
@click="changeAvatar()" @click="changeAvatar()"
class="pic" class="pic"
:src="$util.img(formData.header)" :src="$util.img(formData.head_img)"
></image> ></image>
<view class="btn" @click="changeAvatar()">修改头像</view> <view class="btn" @click="changeAvatar()">修改头像</view>
@ -39,7 +39,8 @@
部门 <text class="required"></text> 部门 <text class="required"></text>
</view> </view>
<view class="input"> <view class="input">
<input disabled placeholder="暂无" /> <!-- <input disabled :placeholder="formData.department_name_str" />-->
<view class="dept disabled">{{formData.department_name_str || '暂无'}}</view>
</view> </view>
</view> </view>
@ -59,14 +60,14 @@
性别 <text class="required">*</text> 性别 <text class="required">*</text>
</view> </view>
<view class="input"> <view class="input">
<input placeholder="请选择性别" v-model="formData.gender" @click="picker_show_sex=true"/> <input placeholder="请选择性别" v-model="formData.gender_str" @click="picker_show_sex=true"/>
<fui-picker <fui-picker
layer="1" layer="1"
:linkage="true" :linkage="true"
:options="options_sex_arr" :options="options_sex_arr"
:show="picker_show_sex" :show="picker_show_sex"
@change="changePickerSex" @change="changePickerSex"
@cancel="picker_sex_show=false" @cancel="picker_show_sex=false"
></fui-picker> ></fui-picker>
</view> </view>
</view> </view>
@ -122,6 +123,7 @@
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js';
import marketApi from '@/api/market.js'; import marketApi from '@/api/market.js';
import { import {
Api_url Api_url
@ -136,11 +138,12 @@ export default {
data() { data() {
return { return {
formData:{ formData:{
header:'',// head_img:'',//
name:'',// name:'',//
username:'',// username:'',//
address:'',// address:'',//
gender:'',//|, gender:'',//|1,2
gender_str:'',
birthday:'',// birthday:'',//
email:'',// email:'',//
phone:'',// phone:'',//
@ -150,7 +153,7 @@ export default {
userInfo: {}, userInfo: {},
//APi //APi
uploadUrl: `${Api_url}/file/image`, uploadUrl: `${Api_url}/uploadImage`,
// //
picker_show_sex: false, picker_show_sex: false,
@ -197,7 +200,7 @@ export default {
// //
async getUserInfo(){ async getUserInfo(){
let res = await marketApi.member({}) let res = await apiRoute.getPersonnelInfo({})
if (res.code != 1){ if (res.code != 1){
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -206,21 +209,28 @@ export default {
return return
} }
let gender_str = ''
if(res.data.gender == 1){
gender_str = '男'
}else if(res.data.gender == 2){
gender_str = '女'
}
// //
this.formData = { this.formData = {
header: res.data.headimg,// head_img: res.data.head_img,//
name: res.data.name,// name: res.data.name,//
username: res.data.username,// username: res.data.phone,//
address: res.data.address,// address: res.data.address,//
gender: res.data.gender,//|, gender: res.data.gender,//|1,2
gender_str:gender_str,
birthday: res.data.birthday,// birthday: res.data.birthday,//
email: res.data.email,// email: res.data.email || '',//
phone: res.data.phone,// phone: res.data.phone,//
wx: res.data.wx || '',// wx: res.data.wx || '',//
member_level_name: res.data.member_level_name || '',// member_level_name: res.data.member_level_name || '',//
department_name_str:res.data.department_name_str || '暂无',//
} }
console.log(123,this.formData);
}, },
// //
@ -250,7 +260,7 @@ export default {
console.log('上传成功2', res) console.log('上传成功2', res)
if (res.code == 1) { if (res.code == 1) {
this.upload_type = 2 this.upload_type = 2
this.formData.header = res.data.path this.formData.head_img = res.data.url
// this.editHeadimg = res.data.path // this.editHeadimg = res.data.path
// this.uploadHeadimg = res.data.url // this.uploadHeadimg = res.data.url
} else { } else {
@ -262,24 +272,12 @@ export default {
}, },
}); });
}, },
//Api
async editPic(pic) {
let res = await salesmanApi.editPic({pic: pic})
if (res.code >= 0) {
this.$util.showToast({
title: '修改成功'
})
} else {
this.$util.showToast({
title: res.message
})
}
},
// //
changePickerSex(e) { changePickerSex(e) {
console.log('监听选择', e) console.log('监听选择', e)
this.formData.gender = e.text this.formData.gender = e.value
this.formData.gender_str = e.text
this.picker_show_sex = false this.picker_show_sex = false
}, },
@ -334,7 +332,7 @@ export default {
async submit() { async submit() {
let data = {...this.formData} let data = {...this.formData}
if(!data.header){ if(!data.head_img){
uni.showToast({ uni.showToast({
title: '请上传头像', title: '请上传头像',
icon: 'none' icon: 'none'
@ -383,7 +381,7 @@ export default {
} }
let res = await marketApi.memberEdit(data) let res = await apiRoute.editPersonnelInfo(data)
if(res.code != 1){ if(res.code != 1){
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -395,8 +393,10 @@ export default {
title: res.msg, title: res.msg,
icon: 'success' icon: 'success'
}) })
//1s
this.getUserInfo() setTimeout(() => {
this.getUserInfo()
}, 1000)
}, },
@ -456,6 +456,7 @@ export default {
.btn{} .btn{}
.title{ .title{
min-width: 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 26rpx; font-size: 26rpx;
@ -466,9 +467,19 @@ export default {
} }
} }
.input{ .input{
display: flex;
justify-content: flex-end;
input{ input{
text-align: right; text-align: right;
} }
.dept{
width: 50%;
}
.disabled{
color: #808080;
//
cursor: not-allowed;
}
} }
} }
} }

166
pages/coach/my/update_pass.vue

@ -2,7 +2,7 @@
<template> <template>
<view> <view>
<view class="title"> <view class="title">
<view :class="{'green-text': tset_style === 1}">1.验证手机号</view> <view :class="{'green-text': tset_style === 1}">1.验证旧密</view>
<view :class="{'green-text': tset_style === 2}">2.设置新密码</view> <view :class="{'green-text': tset_style === 2}">2.设置新密码</view>
</view> </view>
<view :style="{'background-color':'#fff','width':'100%','height':'100vh' }"> <view :style="{'background-color':'#fff','width':'100%','height':'100vh' }">
@ -12,24 +12,36 @@
为保障您的账号安全修改密码前请填写原密码 为保障您的账号安全修改密码前请填写原密码
</view> </view>
<view style="width: 95%;margin:30rpx auto;"> <view style="width: 95%;margin:30rpx auto;">
<fui-input borderTop placeholder="请输入原登录密码" v-model="user" @input="input" <fui-input borderTop placeholder="请输入原登录密码" v-model="old_password"
backgroundColor="#f2f2f2"></fui-input> backgroundColor="#f2f2f2"></fui-input>
</view> </view>
</view> </view>
<view v-if="tset_style == 2"> <view v-if="tset_style == 2">
<view style="width: 95%;margin:30rpx auto;"> <view style="width: 95%;margin:30rpx auto;">
<fui-input borderTop placeholder="请设置6-20位新的登录密码" v-model="user" @input="input" <fui-input borderTop placeholder="请设置6-20位新的登录密码" v-model="formData.new_password" @input="input"
backgroundColor="#f2f2f2"></fui-input> backgroundColor="#f2f2f2"></fui-input>
</view> </view>
<view style="width: 95%;margin: auto;"> <view style="width: 95%;margin: auto;">
<fui-input borderTop :padding="['20rpx','32rpx']" v-model="code" placeholder="请再次输入新的登录密码" @input="input" <fui-input borderTop :padding="['20rpx','32rpx']" v-model="formData.new_password_2" placeholder="请再次输入新的登录密码" @input="input"
backgroundColor="#f2f2f2"> backgroundColor="#f2f2f2">
</fui-input> </fui-input>
</view> </view>
</view> </view>
<view style="width: 95%;margin:60rpx auto;"> <view style="width: 95%;margin:60rpx auto;">
<fui-button background="#00be8c" radius="5rpx" @click="nextStep" v-if="tset_style == 1">下一步</fui-button> <view class="btn_box">
<fui-button background="#00be8c" radius="5rpx" @click="submit" v-if="tset_style == 2">提交</fui-button> <fui-button
background="#465cff"
radius="5rpx"
@click="nextStep(1)"
v-if="tset_style != 1">上一步
</fui-button>
<fui-button background="#00be8c" radius="5rpx" @click="nextStep(2)" v-if="tset_style == 1">下一步</fui-button>
<fui-button background="#00be8c" radius="5rpx" @click="submit" v-if="tset_style == 2">提交</fui-button>
</view>
<view style="width: 95%;margin:60rpx auto;"> <view style="width: 95%;margin:60rpx auto;">
<fui-button background="#fff" radius="5rpx" @click="forgot" color="#999999" v-if="tset_style == 1">忘记原密码</fui-button> <fui-button background="#fff" radius="5rpx" @click="forgot" color="#999999" v-if="tset_style == 1">忘记原密码</fui-button>
</view> </view>
@ -39,36 +51,140 @@
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js';
export default { export default {
data() { data() {
return { return {
code: '', code: '',
user: '', user: '',
tset_style: 1, tset_style: 1,//tab|1=,2=
}
}, old_password:'',//
onLoad() {
formData:{
phone:'',//
new_password:'',//
new_password_2:'',//
key_value:'',//key_value
},
}
}, },
onLoad() {},
onShow() {
this.init()//
},
methods: { methods: {
sendCode() { //
// async init(){
setTimeout(() => { await this.getUserInfo()
// },
//... //
//success async getUserInfo() {
this.$refs.fui_cdv && this.$refs.fui_cdv.success() let res = await apiRoute.getPersonnelInfo({})
}, 800) if (res.code != 1) {
}, uni.showToast({
nextStep(){ title: res.msg,
this.tset_style = 2 icon: 'none'
})
return
}
this.formData.phone = res.data.phone//
},
///
async nextStep(tset_style){
//tset_style|1=,2=
if(tset_style == 2){
if(!this.old_password){
uni.showToast({
title: '请输入原登录密码',
icon: 'none'
})
return
}
//
let params = {
old_password: this.old_password
}
//
let res = await apiRoute.common_personnelCheckOldPwd(params)
if(!res.code){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.formData.key_value = res.data.key_value
}
this.tset_style = Number(tset_style)
}, },
//
forgot() { forgot() {
this.$navigateTo({ this.$navigateTo({
url: '/pages/student/login/forgot' url: '/pages/student/login/forgot'
}) })
}, },
}
//
async submit() {
//
if (!this.formData.new_password) {
uni.showToast({
title: '请输入新密码',
icon: 'none'
})
return
}
if (this.formData.new_password.length < 6 || this.formData.new_password.length > 20) {
uni.showToast({
title: '新密码长度为6-20位',
icon: 'none'
})
return
}
if (!this.formData.new_password) {
uni.showToast({
title: '请输入新密码',
icon: 'none'
})
return
}
//
if (this.formData.new_password != this.formData.new_password_2) {
uni.showToast({
title: '两次密码不一致',
icon: 'none'
})
return
}
let res = await apiRoute.common_personnelEdidPassword(this.formData)
if(!res.code){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
uni.showToast({
title: res.msg,
icon: 'success'
})
//1s
setTimeout(() => {
//-
//
uni.redirectTo({
url: `/pages/coach/my/index`
})
}, 1000)
},
}
} }
</script> </script>
@ -104,4 +220,10 @@
color: #999999; color: #999999;
padding-left: 30rpx; padding-left: 30rpx;
} }
.btn_box{
display: flex;
flex-direction: column;
gap: 40rpx;
}
</style> </style>
Loading…
Cancel
Save