Browse Source

分配角色权限

master
unknown 1 year ago
parent
commit
5cf9d9fd99
  1. 53
      components/UserTab/UserTab.vue
  2. 28
      components/timeScreen/timeScreen.vue
  3. 5
      components/user-info/user-info.vue
  4. 66
      pages/tabbar/examSimulation/comp/simulation.vue
  5. 10
      pages/tabbar/examSimulation/index.vue
  6. 17
      pages/tabbar/mine/index.vue
  7. 14
      pages/tabbar/statistics/index.vue
  8. 4
      pages/tabbar/student/index.vue
  9. 10
      pages/userCenter/login/login.vue

53
components/UserTab/UserTab.vue

@ -29,79 +29,82 @@
if (uni.getStorageSync('identity') == '1') {
if (uni.getStorageSync('identity') == '实操教练') {
//
_this.list = [{
"pagePath": "/pages/tabbar/statistics/index",
"text": "首页",
"iconPath": "../../static/images/tabbar/tj.png",
"selectedIconPath": "../../static/images/tabbar/tjActive.png"
"iconPath": require("../../static/images/tabbar/tj.png"),
"selectedIconPath": require("../../static/images/tabbar/tjActive.png")
},
{
"pagePath": "/pages/tabbar/examSimulation/index",
"text": "考场模拟",
"iconPath": "../../static/images/tabbar/kc.png",
"selectedIconPath": "../../static/images/tabbar/kcActive.png"
"iconPath": require("../../static/images/tabbar/kc.png"),
"selectedIconPath": require("../../static/images/tabbar/kcActive.png")
},
{
"pagePath": "/pages/tabbar/operateTrain/index",
"text": "实操训练",
"iconPath": "../../static/images/tabbar/sc.png",
"selectedIconPath": "../../static/images/tabbar/scActive.png"
"iconPath": require("../../static/images/tabbar/sc.png"),
"selectedIconPath": require("../../static/images/tabbar/scActive.png")
},
{
"pagePath": "/pages/tabbar/student/index",
"text": "学员",
"iconPath": "../../static/images/tabbar/xy.png",
"selectedIconPath": "../../static/images/tabbar/xyActive.png"
"iconPath": require("../../static/images/tabbar/xy.png"),
"selectedIconPath": require("../../static/images/tabbar/xyActive.png")
},
{
"pagePath": "/pages/tabbar/mine/index",
"text": "我的",
"iconPath": "../../static/images/tabbar/wd.png",
"selectedIconPath": "../../static/images/tabbar/wdActive.png"
"iconPath": require("../../static/images/tabbar/wd.png"),
"selectedIconPath": require("../../static/images/tabbar/wdActive.png")
}
]
} else if(uni.getStorageSync('identity') == '2') {
} else if(uni.getStorageSync('identity') == '校长') {
//
_this.list = [{
"pagePath": "/pages/tabbar/statistics/index",
"text": "统计",
"iconPath": "../../static/images/tabbar/tj.png",
"selectedIconPath": "../../static/images/tabbar/tjActive.png"
"iconPath": require("../../static/images/tabbar/tj.png"),
"selectedIconPath": require("../../static/images/tabbar/tjActive.png")
},
{
"pagePath": "/pages/tabbar/student/index",
"text": "学员",
"iconPath": "../../static/images/tabbar/xy.png",
"selectedIconPath": "../../static/images/tabbar/xyActive.png"
"iconPath": require("../../static/images/tabbar/xy.png"),
"selectedIconPath": require("../../static/images/tabbar/xyActive.png")
},
{
"pagePath": "/pages/tabbar/mine/index",
"text": "我的",
"iconPath": "../../static/images/tabbar/wd.png",
"selectedIconPath": "../../static/images/tabbar/wdActive.png"
"iconPath": require("../../static/images/tabbar/wd.png"),
"selectedIconPath": require("../../static/images/tabbar/wdActive.png")
}
]
}else {
}else if(uni.getStorageSync('identity') == '考场模拟教练'){
_this.list = [{
"pagePath": "/pages/tabbar/statistics/index",
"text": "统计",
"iconPath": "../../static/images/tabbar/tj.png",
"selectedIconPath": "../../static/images/tabbar/tjActive.png"
"iconPath": require("../../static/images/tabbar/tj.png"),
"selectedIconPath": require("../../static/images/tabbar/tjActive.png")
},
{
"pagePath": "/pages/tabbar/examSimulation/index",
"text": "预约记录",
"iconPath": "../../static/images/tabbar/kc.png",
"selectedIconPath": "../../static/images/tabbar/kcActive.png"
"iconPath": require("../../static/images/tabbar/kc.png"),
"selectedIconPath": require("../../static/images/tabbar/kcActive.png")
},
{
"pagePath": "/pages/tabbar/mine/index",
"text": "我的",
"iconPath": "../../static/images/tabbar/wd.png",
"selectedIconPath": "../../static/images/tabbar/wdActive.png"
"iconPath": require("../../static/images/tabbar/wd.png"),
"selectedIconPath": require("../../static/images/tabbar/wdActive.png")
}]
}else {
//
}
},
methods: {

28
components/timeScreen/timeScreen.vue

@ -42,10 +42,16 @@
currentPopTab: 1,
showDatePicker: false,
value1: '',
currentBtnDate: ''
currentBtnDate: '',
date1: '',
date2: '',
date3: '',
}
},
methods: {
changePopTab(num) {
this.currentPopTab = num
},
// 1
showDatePickerFn(num) {
this.showDate = false
@ -60,7 +66,27 @@
date = uni.$u.date(val.value, 'yyyy-mm')
}
this['date'+this.currentBtnDate] = date
this.$emit('confirmDatePicker')
},
// 3
selectDateClick() {
let obj = {
date1: this.date1,
date2: this.date2,
date3: this.date3,
}
if(this.currentPopTab==2) {
if(!this.date2) return this.$u.toast('请选择开始时间')
if(!this.date3) return this.$u.toast('请选择结束时间')
if(new Date(this.date2)*1>new Date(this.date3)*1) return this.$u.toast('开始时间不能大于结束时间')
delete obj.date1
}else {
if(!this.date1) return this.$u.toast('请选择时间')
delete obj.date2
delete obj.date3
}
this.$emit('selectDateClick', obj)
}
}
}
</script>

5
components/user-info/user-info.vue

@ -5,7 +5,7 @@
</view>
<view class="info" @click="$goPage('/pages/userCenter/personaInfo/personaInfo')">
<view class="name_row">
<view class="name">大乔教练</view>
<view class="name">大乔{{identity=='校长'?'校长': '教练'}}</view>
<view class="icon">
<image src="@/static/images/coach/ic_gengduo.png" mode=""></image>
</view>
@ -15,7 +15,8 @@
<image src="@/static/images/index/ic_jiaxiao_cli.png" mode=""></image>
</view>
<view class="schoolName">翔力驾校</view>
<view class="tag">合作教练</view>
<view class="tag" v-if="identity=='校长'">驾校校长</view>
<view class="tag" v-else>合作教练</view>
</view>
</view>
</view>

66
pages/tabbar/examSimulation/comp/examSimulation.vue → pages/tabbar/examSimulation/comp/simulation.vue

@ -1,7 +1,7 @@
<template>
<view class="main">
<view class="blueBg">
<topNavbar title="预约记录"></topNavbar>
<!-- <topNavbar title="预约记录"></topNavbar> -->
<view class="pad">
<view class="searchBox">
<searchRow placeholder="搜索学员姓名、学员手机号、考场名称"></searchRow>
@ -18,7 +18,7 @@
<view class="pad">
<view class="total_row">
<view class="total">12条记录</view>
<view class="screen">
<view class="screen" @click="showDate=true">
<view class="text">筛选</view>
<view class="icon">
<image src="@/static/images/coach/screen.png" mode=""></image>
@ -29,7 +29,23 @@
<appointItem />
</view>
</view>
<UserTab name ='预约记录'></UserTab>
<u-popup :show="showDate" mode="bottom" :round="20">
<view class="popupBox">
<view class="pad">
<view class="car">
<view class="h1">车型</view>
<view class="car_row">
<view class="carItem" @click="screenCarFn(1)" :class="{active: params.car==1}">C1</view>
<view class="carItem" @click="screenCarFn(2)" :class="{active: params.car==2}">C2</view>
</view>
</view>
<view class="h1" style="transform: translateY(30rpx);margin-bottom: 20rpx;">时间</view>
</view>
<timeScreen @selectDateClick="selectDateClick" @confirmDatePicker="confirmDatePicker" />
</view>
</u-popup>
</view>
</template>
@ -43,7 +59,11 @@
{id: 1, text: '全部'},
{id: 2, text: '科目二'},
{id: 3, text: '科目三'},
]
],
showDate: false,
params: {
car: 1,
}
}
},
methods: {
@ -55,21 +75,57 @@
this.currentNav = item.id
},
goPage() {
console.log('------------')
this.$goPage('/pages/recordEntry/examine/examineRecord/detail/detail')
},
confirmDatePicker() {
this.showDate = true
},
//
selectDateClick(val) {
console.log(val)
this.showDate = false
},
screenCarFn(num) {
this.params.car = num
}
}
}
</script>
<style lang="scss" scoped>
.popupBox {
.car {
.h1 {
line-height: 100rpx;
}
.car_row {
display: flex;
.carItem {
width: 130rpx;
height: 60rpx;
background: rgba(25,137,250,0.1);
border-radius: 8rpx;
border: 2rpx solid #1989FA;
text-align: center;
line-height: 60rpx;
color: $themC;
margin-right: 58rpx;
&.active {
background: $themC;
color: #fff;
}
}
}
}
}
.main {
width: 100%;
min-height: 100vh;
background: #f3f3f3;
.blueBg {
background: #1989FA;
padding-bottom: 20rpx;
padding: 140rpx 0 20rpx 0;
}
.total_row {
display: flex;

10
pages/tabbar/examSimulation/index.vue

@ -1,15 +1,17 @@
<template>
<view class="main">
<coachIdentity v-if="identity==1"/>
<examineRecord v-if="identity==3"/>
<!-- 考场模拟 -->
<coachIdentity v-if="identity=='实操教练'"/>
<!-- 预约记录 -->
<simulation v-if="identity=='考场模拟教练'"/>
</view>
</template>
<script>
import coachIdentity from './comp/coach.vue'
import examineRecord from '../../recordEntry/examine/examineRecord/examineRecord'
import simulation from './comp/simulation.vue'
export default {
components: { coachIdentity,examineRecord },
components: { coachIdentity,simulation },
data() {
return {

17
pages/tabbar/mine/index.vue

@ -1,5 +1,6 @@
<template>
<view class="pageBgImg">
<view class="status_bar"></view>
<view class="card">
<view class="qcode" @click="$goPage('/pages/userCenter/scanCode/scanCode')">
<image src="@/static/images/coach/ic_erweima.png" mode=""></image>
@ -26,7 +27,12 @@
export default {
data() {
return {
tabData: [
tabData: []
}
},
onLoad() {
if(this.identity=='实操教练') {
this.tabData = [
{text: '待结算记录', icon: require('../../../static/images/coach/ic_daijiesuan.png'), id: 1, url: '/pages/userCenter/settled/settled'},
{text: '指标充值记录', icon: require('../../../static/images/coach/ic_zhibiao.png'), id: 2, url: '/pages/userCenter/indicatorRecharge/indicatorRecharge'},
{text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
@ -35,17 +41,14 @@
{text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
{text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
]
}
},
onLoad() {
if(this.identity==2) {
}else if(this.identity=='校长') {
this.tabData = [
{text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
{text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
{text: '学员退款', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
{text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
]
}else if(this.identity==3) {
}else if(this.identity=='考场模拟教练') {
this.tabData = [
{text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
{text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
@ -64,7 +67,7 @@
<style lang="scss" scoped>
.pageBgImg {
padding: 140rpx 28rpx 40rpx 28rpx;
padding: 120rpx 28rpx 40rpx 28rpx;
}
.card {

14
pages/tabbar/statistics/index.vue

@ -1,13 +1,14 @@
<template>
<view class="content pageBg">
<view class="userInfo">
<view class="tit">Hi,大乔教练</view>
<view class="tit">Hi,大乔{{identity=='校长'?'校长': '教练'}}</view>
<view class="flex userRow">
<view class="schoolIcon">
<image src="@/static/images/index/ic_jiaxiao.png" mode=""></image>
</view>
<view class="schoolName oneRowText">翔力驾校</view>
<view class="tag">合作教练</view>
<view class="tag" v-if="identity=='校长'">驾校校长</view>
<view class="tag" v-else>合作教练</view>
</view>
</view>
<view class="card priceBox">
@ -38,7 +39,7 @@
</view>
</view>
<view class="h1"> {{identity==1?'结算': '收入'}}统计</view>
<view class="h1"> {{identity=='实操教练'?'结算': '收入'}}统计</view>
<view class="tabs">
<view class="tab" @click="tabClick(1)" :class="{active: currentTab==1}">按日</view>
<view class="tab" @click="tabClick(2)" :class="{active: currentTab==2}">按月</view>
@ -51,7 +52,7 @@
</view>
</view>
<view class="flex-b">
<view class="h1">{{identity==1?'结算': '收入'}}明细</view>
<view class="h1">{{identity=='实操教练'?'结算': '收入'}}明细</view>
<moreRight text="更多"/>
</view>
<view class="record">
@ -60,7 +61,7 @@
</view>
</view>
<view class="moreBtn" @click="$goPage('/pages/indexEntry/settlement/settlement')">查看更多</view>
<UserTab :name ='identity==1?"首页":"统计" '></UserTab>
<UserTab :name ='identity=="实操教练"?"首页":"统计" '></UserTab>
<u-datetime-picker
:show="showDatePicker"
v-model="value1"
@ -111,8 +112,7 @@
width: 100%;
background: url('http://192.168.1.20:81/zhili/image/20230824/30073140957f4349b6579cb0ff00d4b1.png') #F6F6F6 no-repeat;
background-size: 100% 492rpx;
padding: 0 28rpx;
padding-top: 142rpx;
padding: 142rpx 28rpx 140rpx 28rpx;
.userInfo {
.tit {

4
pages/tabbar/student/index.vue

@ -3,7 +3,7 @@
<view class="searchBox">
<searchRow placeholder="搜索学员姓名、学员手机号"></searchRow>
</view>
<view class="card" v-if="identity==1">
<view class="card" v-if="identity=='实操教练'">
<view class="addStudent">
<view class="h2">我的学员</view>
<view class="btnBg" @click="$goPage('/pages/recordEntry/student/addStudent/addStudent')">手动添加</view>
@ -20,7 +20,7 @@
<view class="val">260</view>
<view class="lab">今日新增学员</view>
</view>
<view class="statisticsItem" v-if="identity==2">
<view class="statisticsItem" v-if="identity=='校长'">
<view class="val">260</view>
<view class="lab">今日退学学员</view>
</view>

10
pages/userCenter/login/login.vue

@ -88,13 +88,15 @@
}, 1000);
},
submitFn() {
let val = 1
let val = ''
if(this.FormData.phone=='18267103167') {
val = 1
val = '实操教练'
}else if(this.FormData.phone=='18267103168') {
val = 2
val = '校长'
}else if (this.FormData.phone=='18267103169'){
val = '考场模拟教练'
}else {
val = 3
val = '模拟器老师'
}
this.$store.commit('upDateIdentity', val)
uni.reLaunch({

Loading…
Cancel
Save