Browse Source

增加理论教练

master
unknown 3 weeks ago
parent
commit
14040242b2
  1. 2
      config/api.js
  2. 9
      pages.json
  3. 7
      pages/login/login.vue
  4. 50
      pages/tabbar/student/comp/subject1Student.vue
  5. 11
      pages/tabbar/student/index.vue
  6. 7
      pages/userCenter/personaInfo/personaInfo.vue
  7. 102
      pages/userCenter/personaInfo/setLatLng.vue
  8. 44
      pages/userCenter/scanCode/scanCodeSubjiect1.vue
  9. BIN
      static/images/index/down.png
  10. 1
      store/modules/user.js

2
config/api.js

@ -24,6 +24,8 @@ export const studentClassHour = (data) => http.post('business/coach/student_clas
export const getDaySettlement = (data) => http.post('business/coach/getDaySettlement', data)
// 获得过去半年结算统计
export const getMonthSettlement = (data) => http.post('business/coach/getMonthSettlement', data)
// 更新驾校经纬度
export const setLngLat = (data) => http.post('business/coach/geo_update', data)

9
pages.json

@ -232,6 +232,15 @@
}
},
{
"path": "personaInfo/setLatLng",
"style": {
"navigationBarTitleText": "设置定位信息",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"backgroundTextStyle": "dark"
}
},
{
"path": "settled/settled",
"style": {
"navigationBarTitleText": "待结算记录",

7
pages/login/login.vue

@ -122,17 +122,12 @@
const {data: res} = await coachSmsLogin(obj)
this.$store.commit('update_vuex_loginInfo',res)
await this.$store.dispatch('getUserInfo')
res.userType = 2
if(res.userType==2) this.$store.commit('upDateIdentity', '理论教练')
uni.switchTab({
url: '/pages/tabbar/student/index'
})
return
if(res.userType==5) {
this.showRole = true
}else {
if(res.userType==3) this.$store.commit('upDateIdentity', '实操教练')
if(res.userType==4) this.$store.commit('upDateIdentity', '校长')
if(res.userType==6) this.$store.commit('upDateIdentity', '理论教练')
uni.switchTab({
url: '/pages/tabbar/student/index'
})

50
pages/tabbar/student/comp/subject1Student.vue

@ -1,27 +1,45 @@
<template>
<view class="subject1">
<view class="name">张小雨 <text>18267103167</text></view>
<view class="row">
<view class="timeItem">
<view class="flex ">
<view class="time">120</view>
<view class="uni">分钟</view>
<view class="" v-for="(item,index) in list" :key="index">
<view class="name">{{ item.studentName }} <text>{{ phoneShow(item.studentMobile)}}</text></view>
<view class="row">
<view class="timeItem">
<view class="flex ">
<view class="time">{{ item.totalTime }}</view>
<view class="uni">分钟</view>
</view>
<view class="lab">已完成学时</view>
</view>
<view class="lab">已完成学时</view>
</view>
<view class="timeItem">
<view class="flex ">
<view class="time ">120</view>
<view class="uni">分钟</view>
<view class="timeItem">
<view class="flex ">
<view class="time ">{{item.validTime}}</view>
<view class="uni">分钟</view>
</view>
<view class="lab">应完成学时</view>
</view>
<view class="lab">应完成学时</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: []
}
},
methods: {
phoneShow(phoneNumber) {
if (phoneNumber.length === 11) {
return phoneNumber.replace(phoneNumber.substr(3, 4), "****");
} else {
return phoneNumber;
}
}
}
}
</script>
<style lang="scss" scoped>
@ -32,17 +50,21 @@
padding: 30rpx;
}
.name {
font-size: 30rpx;
font-weight: 600;
color: #333;
margin-bottom: 24rpx;
text {
margin-left: 20rpx;
}
}
.row {
display: flex;
&:first-child {
border: none;
}

11
pages/tabbar/student/index.vue

@ -36,7 +36,7 @@
</view>
<!-- <topUserInfo v-if="identity=='实操教练'"/> -->
<!-- 非科目一学员 -->
<subject1Student v-if="identity=='理论教练'"/>
<subject1Student v-if="identity=='理论教练'" :list="list"/>
<view class="" v-else>
<view class="card ">
@ -149,7 +149,7 @@
]
],
params: {
"pageNo": 1, "pageSize": 10, status: 1, name: ''
"pageNo": 1, "pageSize": 20, status: 1, name: ''
},
total: 20,
list: [],
@ -164,6 +164,11 @@
this.studentOwnerFn()
}
},
onReachBottom() {
if(this.total>this.list.length) {
this.studentRecordPageFn()
}
},
onLoad() {
this.params.schoolId = this.vuex_schoolId
let nowTime = new Date()*1
@ -183,7 +188,6 @@
},
onPullDownRefresh() {
if(this.identity!='理论教练') {
this.studentRecordPageFn()
this.studentOwnerFn()
}
this.listInit()
@ -264,6 +268,7 @@
if(this.identity=='理论教练') {
apiList = studentClassHour
obj.coachId = this.vuex_userInfo.coachId
if(this.params.name) obj.queryParam = this.params.name
}
const {data: res} = await apiList(obj)
this.params.pageNo ++

7
pages/userCenter/personaInfo/personaInfo.vue

@ -40,6 +40,13 @@
<view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
</view>
</view>
<!-- v-if="identity=='校长'" -->
<view class="card">
<view class="row" @click="$goPage('/pages/userCenter/personaInfo/setLatLng')" >
<view class="lab">更新驾校经纬度</view>
<view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
</view>
</view>
<view class="btnBox">
<view class="logout" @click="loginOut">退出登录</view>

102
pages/userCenter/personaInfo/setLatLng.vue

@ -0,0 +1,102 @@
<template>
<view class="pageBgImg">
<topNavbar title="设置驾校经纬度信息"></topNavbar>
<view class="pad">
<view class="adrsCon">
<view class="adr" v-if="vuex_cityInfo.city" @click="getLatLngFn">{{vuex_cityInfo.city}} <text v-if="vuex_cityInfo.name"> / {{vuex_cityInfo.name}}</text></view>
<view class="adr" v-else @click="getLatLngFn" style="display: flex;align-items: center;">
<text>获取定位信息</text>
<image src="@/static/images/index/down.png" mode="" style="width: 18rpx;height: 18rpx;margin-left: 6rpx;"></image>
</view>
<view class="adrsIcon">
<image src="@/static/images/index/down.png" mode=""></image>
</view>
</view>
<view class="card">
温馨提示确保你所在位置是您的驾校更新当前位置会影响科目一学员打卡与学员距离您驾校的位置距离计算
<view class="btnBg" @click="oneBtnClick">更新位置</view>
</view>
</view>
</view>
</template>
<script>
import { setLngLat } from '@/config/api.js'
export default {
data() {
return {
}
},
onLoad() {
// this.$store.dispatch('getCity')
},
methods: {
async getLatLngFn() {
try{
uni.showLoading({
title: '正在更新位置...'
})
await this.$store.dispatch('getCity')
this.refresh()
}catch(e){
uni.hideLoading()
}
},
async oneBtnClick() {
let _this = this
await this.$store.dispatch('getCity')
if(!this.vuex_cityInfo.lng) return this.$u.toast('没有获取到您的定位信息')
uni.showModal({
title: `确定要更新您的驾校经纬为 ${this.vuex_cityInfo.name?this.vuex_cityInfo.name:'当前位置'} 吗?`,
success() {
_this.setLngLatFn()
}
})
},
async setLngLatFn() {
const res = await setLngLat({longitude: this.vuex_cityInfo.lng, latitude: this.vuex_cityInfo.lat})
console.log(res)
}
}
}
</script>
<style lang="scss" scoped>
.adrsCon {
display: flex;
align-items: center;
// width: 180rpx;
height: 88rpx;
.adrsIcon {
width: 17rpx;
height: 17rpx;
margin-top: 4rpx;
}
.adr {
padding-right: 14rpx;
font-size: 28rpx;
color: #fff;
}
}
.qcode {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 0;
height: 500rpx;
}
.card {
padding: 28rpx;
margin-bottom: 24rpx;
color: #999;
}
.btnBg {
margin: 50rpx 0 20rpx 0;
}
</style>

44
pages/userCenter/scanCode/scanCodeSubjiect1.vue

@ -2,6 +2,16 @@
<view class="pageBgImg">
<topNavbar title="个人二维码"></topNavbar>
<view class="pad">
<view class="adrsCon">
<view class="adr" v-if="vuex_cityInfo.city" @click="getLatLngFn">{{vuex_cityInfo.city}} <text v-if="vuex_cityInfo.name"> / {{vuex_cityInfo.name}}</text></view>
<view class="adr" v-else @click="getLatLngFn" style="display: flex;align-items: center;">
<text>获取定位信息</text>
<image src="@/static/images/index/down.png" mode="" style="width: 18rpx;height: 18rpx;margin-left: 6rpx;"></image>
</view>
<view class="adrsIcon">
<image src="@/static/images/index/down.png" mode=""></image>
</view>
</view>
<view class="tabs">
<view class="tab" v-for="(item,index) in tabArr" :key="index" :class="{active: currentType==item.id}"
@click="changeTab(item)">{{ item.text }}</view>
@ -60,7 +70,17 @@
// this.refresh = null
},
methods: {
async getLatLngFn() {
try{
uni.showLoading({
title: '正在更新位置...'
})
await this.$store.dispatch('getCity')
this.refresh()
}catch(e){
uni.hideLoading()
}
},
changeTab(item) {
if(item.id==this.currentType) return
this.currentType = item.id
@ -85,6 +105,28 @@
</script>
<style lang="scss" scoped>
.adrsCon {
display: flex;
align-items: center;
// width: 180rpx;
height: 88rpx;
.adrsIcon {
width: 17rpx;
height: 17rpx;
margin-top: 4rpx;
}
.adr {
padding-right: 14rpx;
font-size: 28rpx;
color: #fff;
}
}
.pageBgImg {
&::before {
height: 424rpx;
}
}
.qcode {
width: 100%;
display: flex;

BIN
static/images/index/down.png

After

Width: 17  |  Height: 17  |  Size: 369 B

1
store/modules/user.js

@ -156,6 +156,7 @@ const user = {
// cityCode: result.code||result.cityCode,
province: result.province,
district: result.district,
name: result.name,
}
commit('update_vuex_cityInfo', obj)
resolve(obj)

Loading…
Cancel
Save