Browse Source

add icon img

master
刘嘉炜 4 years ago
parent
commit
cf2f9f384a
  1. 11
      src/js/api.js
  2. 2
      src/js/server.js
  3. 6
      src/pages.json
  4. 40
      src/pages/approve/list/list.vue
  5. 225
      src/pages/approve/record/record.vue
  6. 6
      src/pages/course/list/list.vue
  7. 100
      src/pages/feedback/feedback.vue
  8. 33
      src/pages/index/index.vue
  9. 3
      src/pages/message_list/message_list.vue
  10. 14
      src/pages/mine_trainee/mine_trainee.vue
  11. BIN
      src/static/images/arrow_c874.png
  12. BIN
      src/static/images/close_c00.png
  13. BIN
      src/static/images/close_cf9.png
  14. BIN
      src/static/images/phone_c33.png
  15. BIN
      src/static/images/search_cf9.png
  16. BIN
      src/static/images/sex_0.png
  17. BIN
      src/static/images/sex_1.png

11
src/js/api.js

@ -1,14 +1,23 @@
export const ORIGIN = `https://test.ouxuanzhineng.cn`; // 测试
// export const ORIGIN = `https://test.ouxuanzhineng.cn`; // 测试
export const ORIGIN = `http://kahing.local:9090`; // 本地测试
// export const ORIGIN = `https://coach.ouxuanzhineng.cn`; // 正式
export const API = {
coachLogin: `${ORIGIN}/stadium/coach/login`, // 小程序-账号登录
getCoachCourseTimes: `${ORIGIN}/stadium/coach/getCoachCourseTimes`, // 小程序-账号登录
saveFeedback: `${ORIGIN}/stadium/coach/saveFeedback`, // 小程序-保存教练反馈
coach_feedback: `${ORIGIN}/upload/file/coach_feedback`, // 上传文件
}
API['course'] = {
courseList: `${ORIGIN}/stadium/coach/courseList`, // 小程序-课程列表
getClassList: `${ORIGIN}/stadium/coach/getClassList`, // 小程序-班级列表
getCourseStudentList: `${ORIGIN}/stadium/coach/getCourseStudentList`, // 小程序-学员列表
getCourseStudentList: `${ORIGIN}/stadium/coach/getCourseStudentList`, // 小程序-学员列表
SaveStudentComment: `${ORIGIN}/stadium/coach/SaveStudentComment`, // 小程序-学员点评保存
courseList: `${ORIGIN}/stadium/coach/courseList`, // 小程序-课程列表
}

2
src/js/server.js

@ -12,7 +12,7 @@ export class Server {
if(_loginInfo || true){
data = Object.assign({
coach_token: _loginInfo.coach_token || '0c30100d-5ba8-11eb-9029-5254005df464',
coach_token: _loginInfo.coach_token || '7a04dc20-62c0-11eb-8979-00e04c0166b9',
brand_id: _loginInfo.brand_id || '63',
}, data);
}

6
src/pages.json

@ -114,6 +114,12 @@
}
},
{
"path": "pages/approve/record/record",
"style": {
"navigationBarTitleText": "我的审批"
}
},
{
"path": "pages/shift/application/application",
"style": {
"navigationBarTitleText": "换班"

40
src/pages/approve/list/list.vue

@ -1,16 +1,28 @@
<template>
<view class="approve-list">
<view class="l-tabs">
<view v-for="i in 3" :key="i">
<view class="t-txt active">
<view @click="tabChange(0)">
<view :class="['t-txt', tabIdx==0?'active':'']">
<text>预约审批</text>
<view class="t-label">99</view>
</view>
</view>
<view @click="tabChange(1)">
<view :class="['t-txt', tabIdx==1?'active':'']">
<text>请假审批</text>
<view class="t-label">99</view>
</view>
</view>
<view @click="tabChange(2)">
<view :class="['t-txt', tabIdx==2?'active':'']">
<text>换班审批</text>
<view class="t-label">99</view>
</view>
</view>
</view>
<view class="l-bar">
<view>审核人数:3</view>
<view>审批记录</view>
<view @click="toRecord">审批记录</view>
</view>
<view class="l-null" v-if="false">
<image></image>
@ -42,7 +54,7 @@
<view class="l-unfold">
<view>
<text>展开</text>
<image></image>
<image mode="aspectFit" src="/static/images/arrow_c874.png"></image>
</view>
</view>
</view>
@ -54,16 +66,29 @@
<text>全选</text>
</view>
<view class="bb-btns">
<view>不同意</view>
<view>同意</view>
<view hover-class="hover-active">不同意</view>
<view hover-class="hover-active">同意</view>
</view>
</view>
</view>
</template>
<script>
import util from '../../../utils/util';
export default {
data(){
return {
tabIdx: 0
}
},
methods: {
tabChange(i){
this.tabIdx = i;
},
toRecord(){
util.routeTo(`/pages/approve/record/record`,'nT');
}
}
}
</script>
@ -238,7 +263,6 @@ export default {
margin-left: 10upx;
width: 24upx;
height: 24upx;
background-color: skyblue;
}
}
}

225
src/pages/approve/record/record.vue

@ -0,0 +1,225 @@
<template>
<view class="approve-record">
<view class="l-tabs">
<view @click="tabChange(0)">
<view :class="['t-txt', tabIdx==0?'active':'']">
<text>预约审批</text>
<view class="t-label">99</view>
</view>
</view>
<view @click="tabChange(1)">
<view :class="['t-txt', tabIdx==1?'active':'']">
<text>请假审批</text>
<view class="t-label">99</view>
</view>
</view>
<view @click="tabChange(2)">
<view :class="['t-txt', tabIdx==2?'active':'']">
<text>换班审批</text>
<view class="t-label">99</view>
</view>
</view>
</view>
<view class="r-list">
<view class="l-item">
<view class="l-content">
<view class="c-user">
<image></image>
<view>胡可课</view>
</view>
<view class="c-content">
<view class="c-name">羽毛球课程(羽毛球课)</view>
<view class="c-times">
<view v-for="i in 10" :key="i">2020-08-22 10:30</view>
</view>
</view>
<view class="c-status">
<view class="s-icon" v-if="false"></view>
<view class="s-txt s-active" v-else>通过</view>
</view>
</view>
<view class="l-reason">
<view>原因:</view>
<view>作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内</view>
</view>
<view class="l-unfold">
<view>
<text>展开</text>
<image mode="aspectFit" src="/static/images/arrow_c874.png"></image>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import util from '../../../utils/util';
export default {
data(){
return {
tabIdx: 0
}
},
methods: {
tabChange(i){
this.tabIdx = i;
},
}
}
</script>
<style lang="scss">
@import "~style/public.scss";
.l-tabs{
margin-bottom: 28upx;
background-color: #fff;
@include centerFlex(center);
>view{
flex-grow: 0;
width: 33.33%;
display: flex;
justify-content: center;
.t-txt{
position: relative;
height: 96upx;
line-height: 96upx;
font-size: 28upx;
color: #333;
.t-label{
position: absolute;
right: -34upx;
top: 18upx;
width: 32upx;
height: 32upx;
border-radius: 50%;
line-height: 32upx;
text-align: center;
font-size: 20upx;
font-weight: 400;
color: #fff;
background-color: #FF4444;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&.active{
font-weight: 600;
color: $themeColor;
&::after{
content: '';
position: absolute;
display: block;
left: 0;
bottom: 0;
width: 100%;
height: 8upx;
background-color: $themeColor;
border-radius: 4upx;
}
}
}
}
}
.r-list{
padding: 0 24upx;
.l-item{
padding: 24upx;
background-color: #fff;
.l-content{
display: flex;
justify-content: space-between;
.c-user{
flex-shrink: 0;
margin-right: 30upx;
>image{
margin: 0 auto 8upx;
display: block;
width: 100upx;
height: 100upx;
border-radius: 50%;
background-color: skyblue;
}
>view{
max-width: 120upx;
line-height: 40upx;
text-align: center;
font-size: 28upx;
color: #9a9a9d;
@include textHide(1);
}
}
.c-content{
flex-grow: 1;
padding-top: 26upx;
.c-name,.c-times>view{
font-size: 28upx;
line-height: 52upx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.c-status{
flex-shrink: 0;
padding-top: 60upx;
.s-icon{
width: 36upx;
height: 36upx;
border: 2upx solid #9a9a9d;
border-radius: 50%;
>image{
width: 100%;
height: 100%;
}
}
.s-txt{
font-size: 28upx;
line-height: 40upx;
color: $themeColor;
&.s-active{
color: #FF4444;
}
}
}
}
.l-reason{
padding-top: 14upx;
border-top: 2upx solid #D8D8D8;
display: flex;
>view{
&:first-child{
flex-shrink: 0;
margin-right: 20upx;
line-height: 40upx;
font-size: 28upx;
color: #333;
}
&+view{
flex-grow: 1;
line-height: 40upx;
font-size: 28upx;
color: #9a9a9d;
}
}
}
.l-unfold{
padding: 10upx 0 0;
@include centerFlex(flex-end);
>view{
font-size: 28upx;
line-height: 46upx;
color: $themeColor;
>image{
margin-left: 10upx;
width: 24upx;
height: 24upx;
}
}
}
}
}
</style>

6
src/pages/course/list/list.vue

@ -25,7 +25,7 @@
<view class="cl-ex-item" v-if="curTabIdx == 1">
<view class="ei-tit">
<view>{{e.name || '-'}}</view>
<view>预约中</view>
<view>{{e.experience_class_status || '-'}}</view>
</view>
<view class="ei-line"><text>预约人数:</text>{{e.experience_person_number || 0}}</view>
<view class="ei-btns">
@ -100,6 +100,7 @@ export default {
methods: {
tabChange: util.debounce(function(i){
this.curTabIdx = i;
this.courseList = [];
this.getCourseList({
is_experience_class: i
})
@ -121,7 +122,7 @@ export default {
util.hideLoad();
let _list = res.list || [];
if(_list.length<=0)return util.showNone('没有更多!');
this.courseList = _list;
console.warn(res);
})
.catch(util.hideLoad)
@ -212,6 +213,7 @@ export default {
}
}
.cl-ex-item{
margin-bottom: 24upx;
padding: 44upx 24upx 34upx;
border-radius: 10upx;
background-color: #fff;

100
src/pages/feedback/feedback.vue

@ -1,28 +1,101 @@
<template>
<view class="feedback-container">
<view class="fc-textarea">
<textarea placeholder="请输入您的反馈、建议或者发现的问题"></textarea>
<textarea placeholder="请输入您的反馈、建议或者发现的问题" v-model="iptTxt"></textarea>
</view>
<view class="fc-tit"><text>上传照片</text>(最多上传3张只支持.jpgpng 格式</view>
<view class="fc-imgs">
<view class="fi-item" v-for="i in 5" :key="i">
<image class="fi-img"></image>
<image class="fi-close"></image>
<view class="fi-item" v-for="(e,i) in imageList" :key="i">
<image class="fi-img" mode="aspectFit" :src="e" @click="previewImage(e)"></image>
<image class="fi-close" mode="aspectFit" src="/static/images/close_c00.png" @click="clearImage(i)"></image>
</view>
<view class="fi-item fi-add">
<view class="fi-item fi-add" @click="imgSelect">
<view></view>
<view>上传照片</view>
</view>
</view>
<view class="fc-fixed-bar">
<view hover-class="hover-active">保存</view>
<view hover-class="hover-active" @click="submitBtn">保存</view>
</view>
</view>
</template>
<script>
import { API } from '../../js/api';
import { servers } from '../../js/server';
import util from '../../utils/util';
export default {
data(){
return {
iptTxt: '',
imageList: [],
}
},
methods: {
//
clearImage(index){
let _imgs = [...this.imageList];
_imgs.splice(index,1);
this.imageList = _imgs;
},
//
previewImage(src) {
uni.previewImage({
current: src,
urls: this.imageList
})
},
submitBtn: util.debounce(function(){
let { iptTxt, imageList } = this;
if(iptTxt == '')return util.showNone('请输入');
servers.post({
url: API.saveFeedback,
data: {
feedback_info: iptTxt,
imgs: imageList,
},
isDefaultGet: false,
})
.then(e=>{
if(e.data.code == 0){
console.warn(e);
util.showNone(e.data.message || '操作成功!');
setTimeout(util.routeTo, 1200);
}else{
util.showNone(e.data.message || '操作失败!');
}
})
}, 300, 300),
//
imgSelect() {
uni.chooseImage({
count: 1,
sizeType: [ 'compressed ' ],
success: res => {
util.showLoad();
servers.uploadFile({
url: API.coach_feedback,
filePath: res.tempFilePaths[0],
})
.then(e=>{
util.hideLoad();
let _res = util.jsonPar(e.data);
if(_res.code == 0){
this.imageList = [_res.data.url, ...this.imageList]
}else{
console.error('上传图片失败--->',_res);
util.showNone(_res.message || '上传图片失败,请重试!')
}
})
.catch(err=>{
console.error('上传图片失败--->',err);
util.showNone('上传图片失败,稍后重试!')
})
},
})
},
}
}
</script>
@ -72,18 +145,18 @@ export default {
display: inline-block;
width: 200upx;
height: 200upx;
background-color: skyblue;
border-radius: 10upx;
overflow: hidden;
&.fi-add{
padding-top: 36upx;
border: 2upx solid #D8D8D8;
>view{
&:first-child{
position: relative;
margin: 0 auto 30upx;
width: 60upx;
height: 60upx;
&::before{
&::before,&::after{
content: '';
position: absolute;
left: 50%;
@ -95,15 +168,8 @@ export default {
}
&::after{
content: '';
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
height: 60upx;
width: 4upx;
background-color: #d8d8d8;
}
}
&+view{
@ -116,7 +182,6 @@ export default {
.fi-img{
width: 100%;
height: 100%;
background-color: slateblue;
}
.fi-close{
position: absolute;
@ -124,7 +189,6 @@ export default {
top: 6upx;
width: 40upx;
height: 40upx;
background-color: red;
}
}
}

33
src/pages/index/index.vue

@ -7,7 +7,7 @@
<image></image>
</view> -->
<view class="ih-tip">本月课时</view>
<view class="ih-num">0</view>
<view class="ih-num">{{ course_times || 0 }}</view>
</view>
<view class="ic-notice" @click="toNotice">
<view class="in-left">
@ -37,6 +37,8 @@
</template>
<script>
import authorize_modal from '../../components/authorize_modal/authorize_modal';
import { API } from '../../js/api';
import { servers } from '../../js/server';
import util from '../../utils/util';
const tabInfoArr = [
{
@ -52,7 +54,7 @@ import util from '../../utils/util';
{
id: '3',
name: '我的学员',
path: '',
path: '/pages/mine_trainee/mine_trainee',
},
{
id: '4',
@ -62,13 +64,14 @@ import util from '../../utils/util';
{
id: '5',
name: '审批',
path: '',
},
{
id: '6',
name: '点名',
path: '',
path: '/pages/approve/list/list',
},
// 20210130 PM: ,
// {
// id: '6',
// name: '',
// path: '',
// },
{
id: '7',
name: '换班申请',
@ -83,12 +86,24 @@ import util from '../../utils/util';
data(){
return {
tabInfoArr,
course_times: 0, //
}
},
onLoad(){
this.getCoachCourseTimes();
},
methods: {
getCoachCourseTimes(){
servers.get({
url: API.getCoachCourseTimes,
data: {},
failMsg: '加载失败!'
})
.then(res=>{
console.warn(res)
this.course_times = res.course_times
})
},
tabClick(e){
if(e.path === '')return util.showNone('开发中');
util.routeTo(e.path, 'nT');

3
src/pages/message_list/message_list.vue

@ -9,7 +9,7 @@
</view>
<view class="mi-desc">
<view>喜欢喜欢需和许 i 会修 hi 休闲鞋被选行啊学休闲鞋被选行啊学休闲鞋被选行啊学</view>
<image></image>
<image mode="aspectFit" src="/static/images/arrow_cb2.png"></image>
</view>
</view>
</view>
@ -91,7 +91,6 @@ export default {
flex-shrink: 0;
width: 32upx;
height: 32upx;
background-color: skyblue;
}
}
}

14
src/pages/mine_trainee/mine_trainee.vue

@ -2,22 +2,22 @@
<view class="mine-trainee">
<view class="t-header">
<view class="h-frame">
<image></image>
<image mode="aspectFit" src="/static/images/search_cf9.png"></image>
<input placeholder="请输入姓名/手机号" />
<image></image>
<image mode="aspectFit" src="/static/images/close_cf9.png"></image>
</view>
<view class="h-txt">搜索</view>
</view>
<view class="t-list">
<view class="l-item" v-for="i in 10" :key="i">
<view class="i-user">
<image class="u-avatar"></image>
<image class="u-avatar" mode="aspectFit" src="/static/images/logo.png"></image>
<view>#Adjoin</view>
<image class="u-icon"></image>
<image class="u-icon" mode="aspectFit" src="/static/images/sex_0.png"></image>
</view>
<view class="i-phone">
<view>00000000000</view>
<image></image>
<image mode="aspectFit" src="/static/images/phone_c33.png"></image>
</view>
</view>
</view>
@ -51,7 +51,6 @@ export default {
margin: 0 20upx;
width: 36upx;
height: 36upx;
background-color: skyblue;
}
>input{
flex-grow: 1;
@ -80,11 +79,11 @@ export default {
@include centerFlex(flex-start);
>image{
flex-shrink: 0;
background-color: skyblue;
}
.u-avatar{
width: 116upx;
height: 116upx;
border-radius: 50%;
}
>view{
margin-left: 10upx;
@ -115,7 +114,6 @@ export default {
margin-left: 16upx;
width: 36upx;
height: 36upx;
background-color: skyblue;
}
}
}

BIN
src/static/images/arrow_c874.png

After

Width: 24  |  Height: 24  |  Size: 239 B

BIN
src/static/images/close_c00.png

After

Width: 40  |  Height: 40  |  Size: 353 B

BIN
src/static/images/close_cf9.png

After

Width: 36  |  Height: 36  |  Size: 339 B

BIN
src/static/images/phone_c33.png

After

Width: 36  |  Height: 36  |  Size: 499 B

BIN
src/static/images/search_cf9.png

After

Width: 32  |  Height: 32  |  Size: 449 B

BIN
src/static/images/sex_0.png

After

Width: 36  |  Height: 36  |  Size: 544 B

BIN
src/static/images/sex_1.png

After

Width: 36  |  Height: 38  |  Size: 534 B

Loading…
Cancel
Save