Browse Source

add api

master
刘嘉炜 4 years ago
parent
commit
fb596b2f84
  1. 1
      src/js/api.js
  2. 6
      src/js/server.js
  3. 2
      src/pages/course/roll_call/roll_call.vue
  4. 2
      src/pages/course/task/task.vue
  5. 3
      src/pages/course/task_finish/task_finish.vue
  6. 31
      src/pages/course/task_info/task_info.vue
  7. 109
      src/pages/time/select/select.vue

1
src/js/api.js

@ -1,4 +1,5 @@
export const ORIGIN = `https://test.ouxuanzhineng.cn`; // 测试
// export const ORIGIN = `http://testmanager.ouxuanzhineng.cn`; // 测试
// export const ORIGIN = `http://kahing.local:9090`; // 本地测试
// export const ORIGIN = `https://coach.ouxuanzhineng.cn`; // 正式

6
src/js/server.js

@ -1,6 +1,6 @@
import util from '../utils/util';
// import { app as vm } from '../main';
const islog = false;
const islog = true;
export class Server {
request(url,data,method,header,isDefaultGet,failMsg){
@ -16,8 +16,8 @@ export class Server {
}
if(_loginInfo){
data = Object.assign({
coach_token: _loginInfo.coach_token || '7a04dc20-62c0-11eb-8979-00e04c0166b9',
brand_id: _loginInfo.brand_id || '63',
coach_token: _loginInfo.coach_token,
brand_id: _loginInfo.brand_id,
}, data);
}

2
src/pages/course/roll_call/roll_call.vue

@ -1,6 +1,6 @@
<template>
<view class="roll-call">
<picker>
<picker disabled>
<view class="top-bar"><text>{{optionsQuery.course_name || '-'}}</text></view>
</picker>
<view class="rc-time">

2
src/pages/course/task/task.vue

@ -1,6 +1,6 @@
<template>
<view class="course-task fixed-bot-padding">
<picker>
<picker disabled>
<view class="top-bar"><text>{{optionsQuery.course_name || '-'}}</text></view>
</picker>
<view class="ct-list">

3
src/pages/course/task_finish/task_finish.vue

@ -87,7 +87,8 @@ export default {
let _query = {
...optionsQuery,
homework_record_id: e.record.id,
user_name: e.order.name
user_name: e.order.name,
user_avatar: e.user.avatar_url
}
util.routeTo(`/pages/course/task_info/task_info?query=${util.jsonStr(_query)}`, 'nT');
},

31
src/pages/course/task_info/task_info.vue

@ -1,30 +1,31 @@
<template>
<view class="task-info">
<block v-if="false">
<block v-if="taskInfo.course_kind == '私教课'">
<view class="i-header">
<picker>
<view class="top-bar"><text>12</text></view>
<picker disabled>
<view class="top-bar"><text>{{optionsQuery.course_name || '-'}}</text></view>
</picker>
<picker class="select-picker" disabled>
<view>
<input disabled value="小小李木子" />
<image></image>
<input disabled :value="taskInfo.homework_record.created_at.substr(0,10)" />
<!-- <image></image> -->
</view>
</picker>
</view>
<view class="i-user">
<image></image>
<image mode="aspectFit" :src="optionsQuery.user_avatar"></image>
<view>
<text>学员姓名:</text>小李张净水器净
<text>学员姓名:</text>{{ optionsQuery.user_name || '-'}}
</view>
</view>
</block>
<view class="ti-section">
<block>
<block v-if="taskInfo.course_kind == '成班课'">
<view class="s-name">
<view>羽毛球课包学会(带体验课)</view>
<view>一班</view>
<view>{{optionsQuery.course_name || '-'}}</view>
<view>{{optionsQuery.class_name || ''}}</view>
</view>
<view class="s-user">
<view>学员名称:</view>
@ -39,15 +40,15 @@
<view class="s-detail">
<view>完成情况</view>
<view>{{ taskInfo.completion || '-' }}</view>
<view>{{ taskInfo.homework_record.completion || '-' }}</view>
</view>
<view class="s-addr">
<view>视频链接</view>
<view>{{ taskInfo.video_url || '-' }}</view>
<view>{{ taskInfo.homework_record.video_url || '-' }}</view>
<view @click="copyUrl">复制</view>
</view>
<view class="s-imgs">
<image v-for="(e,i) in taskInfo.images" :key="i" mode="aspectFit" :src="e"></image>
<image v-for="(e,i) in taskInfo.homework_record.images" :key="i" mode="aspectFit" :src="e"></image>
</view>
</view>
</view>
@ -74,7 +75,7 @@ export default {
copyUrl(){
let { taskInfo } = this;
uni.setClipboardData({
data: taskInfo.video_url,
data: taskInfo.homework_record.video_url,
})
},
getTaskInfo( homework_record_id ){
@ -86,7 +87,7 @@ export default {
failMsg: '加载失败!'
})
.then(res=>{
this.taskInfo = res;
this.taskInfo = res || {};
})
}
}

109
src/pages/time/select/select.vue

@ -30,17 +30,17 @@
</view>
<view class="ta-time">
<view>
<view>10:00</view>
<view v-for="j in 20" :key="j">10:00</view>
</view>
<scroll-view scroll-x @scroll="timeScroll" :scroll-left="timeAreaScrollX">
<view class="t-list" v-for="i in 7" :key="i">
<view class="l-item"></view>
<view class="l-item" v-for="j in 20" :key="j"></view>
</view>
</scroll-view>
</view>
</view>
<view class="s-tip-fixed" v-if="true">
<view class="s-tip-fixed" v-if="false">
<view class="tf-tip">可直接点击上方白色/灰色区域切换状态</view>
<view class="tf-status">
<view>
@ -58,8 +58,28 @@
</view>
<view class="tf-btn" hover-class="hover-active" @click="toConfig">快速预约时间</view>
</view>
<view class="s-select-fixed">
<view class="s-select-fixed" v-if="false">
<view class="ssf-item">
<view>课程次数:</view>
<view>
<picker>
<view>
<input />
<image mode="aspectFit" src="/static/images/triangle_c33.png"></image>
</view>
</picker>
</view>
</view>
<view class="ssf-item">
<view>课程次数:</view>
<view>
<input />
</view>
</view>
<view class="ssf-btns">
<view class="b-btn">取消</view>
<view class="b-btn">确定</view>
</view>
</view>
</view>
</template>
@ -136,6 +156,11 @@ export default {
<style lang="scss">
@import "~style/public.scss";
.time-select{
padding-bottom: 394upx;
padding-bottom: calc( 394upx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 394upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
}
.s-time-bar{
height: 94upx;
background-color: #fff;
@ -324,4 +349,78 @@ export default {
}
}
.s-select-fixed{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #fff;
padding: 20upx 24upx 10upx;
padding-bottom: calc( 10upx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 10upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.ssf-item{
padding: 16upx 0;
@include centerFlex(space-between);
>view{
&:first-child{
flex-grow: 0;
flex-shrink: 0;
margin-right: 20upx;
line-height: 40upx;
font-size: 28upx;
color: #9a9a9d;
}
&+view{
padding: 0 18upx;
flex-grow: 1;
border-radius: 10upx;
border: 2upx solid #D8D8D8;
background-color: #f2f2f7;
picker{
view{
@include centerFlex(space-between);
>image{
flex-shrink: 0;
margin-left: 20upx;
width: 28upx;
height: 28upx;
}
>input{
height: 68upx;
font-size: 28upx;
color: #333;
}
}
}
>input{
height: 68upx;
font-size: 28upx;
color: #333;
}
}
}
}
.ssf-btns{
margin-top: 10upx;
@include centerFlex(flex-end);
.b-btn{
width: 268upx;
height: 88upx;
line-height: 84upx;
text-align: center;
border: 2upx solid $themeColor;
border-radius: 42upx;
font-size: 32upx;
font-weight: 500;
color: $themeColor;
&:last-child{
margin-left: 26upx;
background-color: $themeColor;
color: #fff;
}
}
}
}
</style>
Loading…
Cancel
Save