Browse Source

更新样式

lex-xin 3 years ago
parent
commit
a21f7c76ae

BIN
src/assets/images/common/icon_check.png


BIN
src/assets/images/common/icon_default.png


BIN
src/assets/images/common/icon_search.png


BIN
src/assets/images/common/icon_timer.png


BIN
src/assets/images/icon_student.png


BIN
src/assets/images/icon_students.png


+ 51 - 24
src/components/Search.vue

@@ -1,7 +1,10 @@
 <template>
-    <div>
-        <van-search :placeholder="placeholder" @search="onSearch" show-action v-model="searchValue">
-        <div slot="action" @click="onSearch">搜索</div>
+    <div class="search">
+        <slot name="left"></slot>
+        <van-search :placeholder="placeholder" :left-icon="leftIcon" @search="onSearch" show-action v-model="searchValue">
+            <template slot="action" >
+                <span @click="onSearch" class="search_btn">搜索</span>
+            </template>
         </van-search>
     </div>
 </template>
@@ -15,6 +18,7 @@ export default {
     },
     data() {
         return {
+            leftIcon: require('@/assets/images/common/icon_search.png'),
             searchValue: ""
         };
     },
@@ -27,28 +31,51 @@ export default {
 </script>
 <style lang="less" scoped>
 @import url("../assets/commonLess/variable.less");
-.squrt {
-    width: 0.14rem;
-    height: 0.12rem;
-    margin-left: 0.1rem;
-}
-.van-search {
-    background-color: #f3f4f8 !important;
-    padding: 0.13rem 0.16rem;
-    /deep/.van-cell {
-        display: flex;
-        justify-content: center;
-        align-items: center;
+.search {
+    overflow: hidden;
+    background-color: #fff !important;
+    display: flex;
+    align-items: center;
+    padding: 0 12px;
+    /deep/.van-search {
+        flex: 1;
+        background-color: #fff !important;
+        margin: 15px 0;
+        padding: 0;
+        border-radius: 20px;
+        overflow: hidden;
+        /deep/.van-cell {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+        }
+
+        /deep/.van-field__control {
+            font-size: 16px;
+        }
     }
-    /deep/.van-field__control {
-        font-size: .16rem;
+    /deep/.van-cell__value {
+        height: 24px !important;
+    }
+    /deep/.van-search__action {
+        color: @tFontColor;
+        background-color: #f5f5f5;
+
+    }
+    /deep/.van-search__content {
+        background-color: #f5f5f5;
+    }
+    /deep/.van-field__left-icon {
+        margin-top: 3px;
+        height: 21px;
+    }
+    .search_btn {
+        background: #01C1B5;
+        font-size: 14px;
+        color: #fff;
+        padding: 4px 9px;
+        border-radius: 15px;
     }
 }
-/deep/.van-search__action {
-    color: @tFontColor;
-}
-.van-search__content {
-    border-radius: 0.22rem;
-    background-color: #fff;
-}
+
 </style>

+ 3 - 2
src/main.js

@@ -9,7 +9,8 @@ import { Button, Icon, Tag, Swipe, SwipeItem, Popup, Picker,
     Collapse, CollapseItem, Tab, Tabs, Row, Col, Cell, CellGroup,
     Circle, Field, DatetimePicker, Image, Loading,
     ActionSheet, RadioGroup, Radio, Checkbox, CheckboxGroup,
-    CountDown, Panel, Dialog, Sticky, Rate, Switch, ImagePreview, NoticeBar, NavBar, Divider} from 'vant'
+    CountDown, Panel, Dialog, Sticky, Rate, Switch, ImagePreview, NoticeBar, NavBar, Divider,
+    Grid, GridItem,} from 'vant'
 Vue.use(Button).use(Icon).use(Tag).use(Swipe).use(SwipeItem)
    .use(Popup).use(Picker).use(DropdownMenu).use(DropdownItem).use(Search)
    .use(PullRefresh).use(Toast).use(List).use(Collapse).use(CollapseItem)
@@ -17,7 +18,7 @@ Vue.use(Button).use(Icon).use(Tag).use(Swipe).use(SwipeItem)
    .use(Circle).use(Field).use(DatetimePicker).use(Image).use(Loading)
    .use(ActionSheet).use(RadioGroup).use(Radio).use(Checkbox).use(CheckboxGroup)
    .use(CountDown).use(Panel).use(Dialog).use(Sticky).use(Rate).use(Switch).use(ImagePreview).use(NoticeBar)
-   .use(NavBar).use(Divider)
+   .use(NavBar).use(Divider).use(Grid).use(GridItem)
 
 Vue.config.productionTip = false
 

+ 16 - 0
src/router/teacherRouter.js

@@ -274,6 +274,22 @@ let teacherRouter = [
         descrition: '系统通知列表',
         weight: 3 // 页面权重
     }
+  }, {
+    path: '/trainStatistics',
+    name: 'trainStatistics',
+    component: () => import(/* webpackChunkName:'trainStatistics'*/'@/views/trainStatistics/index.vue'),
+    meta: {
+        descrition: '训练统计',
+        weight: 3 // 页面权重
+    }
+  }, {
+    path: '/trainDetail',
+    name: 'trainDetail',
+    component: () => import(/* webpackChunkName:'trainDetail'*/'@/views/trainStatistics/trainDetail.vue'),
+    meta: {
+        descrition: '评测详情',
+        weight: 3 // 页面权重
+    }
   }
 ];
 

+ 18 - 0
src/views/trainStatistics/api.js

@@ -0,0 +1,18 @@
+import request from '@/helpers/request'
+// 训练统计
+export const countStudentTrain = (data) => {
+    return request({
+        url: '/cloudStudy/countStudentTrain',
+        method: 'get',
+        params: data
+    })
+}
+
+// 评测详情
+export const queryMusicCompareRecord = (data) => {
+    return request({
+        url: '/cloudStudy/queryMusicCompareRecord',
+        method: 'get',
+        params: data
+    })
+}

+ 338 - 0
src/views/trainStatistics/index.vue

@@ -0,0 +1,338 @@
+<template>
+    <div class="visitList">
+        <van-sticky>
+            <m-header v-if="headerStatus" :isFixed="false" />
+            <search @onSearch="search" placeholder="学生姓名或手机号">
+                <template #left>
+                    <van-dropdown-menu style="padding-right: .1rem" :close-on-click-outside="false" active-color="#01C1B5">
+                        <van-dropdown-item title="训练时间" ref="item" class="visitTime">
+                            <van-cell title="开始时间" is-link @click="onChangeDate('showStart')" :value="formatStartTime"></van-cell>
+                            <van-cell title="结束时间" is-link @click="onChangeDate('showEnd')" :value="formatEndTime"></van-cell>
+                            <div class="btnWrap">
+                                <div class="cancelBtn" @click="cancelBtn">重置</div>
+                                <div class="okBtn" @click="okBtn">确定</div>
+                            </div>
+                        </van-dropdown-item>
+                    </van-dropdown-menu>
+                </template>
+            </search>
+        </van-sticky>
+
+        <van-list
+            v-model="loading"
+            v-if="dataShow"
+            :finished="finished"
+            finished-text="- 没有更多了 -"
+            :immediate-check="false"
+            style="padding-top: .12rem;"
+            @load="getList"
+        >
+            <van-cell-group class="data-content" v-for="(item, index) in list" :key="index" @click="onHref(item)">
+                <van-cell style="padding: 16px 12px; 12px" :center="true">
+                    <template #title>
+                        <div class="teacher_info">
+                            <img class="logo" v-if="item.avatar" :src="item.avatar" alt="" />
+                            <img class="logo" v-else src="../../assets/images/icon_student.png" alt="" />
+                            <p style="color: #1a1a1a; font-size: .14rem;">{{ item.username }}</p>
+                        </div>
+                    </template>
+                    <p style="font-size: 14px; color: #808080;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.musicGroupName }}</p>
+                </van-cell>
+                <van-cell is-link :clickable="false" center style="padding: 12px 12px 16px">
+                    <template #title>
+                        <van-grid :border="false" column-num="4" :clickable="true">
+                            <van-grid-item text="训练时长">
+                                <template #icon>{{ item.totalPlayTime }}分钟</template>
+                            </van-grid-item>
+                            <van-grid-item text="训练天数">
+                                <template #icon><span style="color: #01C1B5">{{ item.trainDay }}天</span></template>
+                            </van-grid-item>
+                            <van-grid-item text="训练次数">
+                                <template #icon><span style="color: #01C1B5">{{ item.trainDay }}次</span></template>
+                            </van-grid-item>
+                            <van-grid-item text="评测次数">
+                                <template #icon><span style="color: #FF802C">{{ item.recordNum }}次</span></template>
+                            </van-grid-item>
+                        </van-grid>
+                    </template>
+                </van-cell>
+            </van-cell-group>
+        </van-list>
+        <m-empty v-else msg="暂无训练统计" />
+
+        <van-popup v-model="dataForm.status" position="bottom" :style="{ height: '40%' }">
+            <van-datetime-picker
+                v-model="dataForm.currentDate"
+                :min-date="dataForm.minDate"
+                :max-date="dataForm.maxDate"
+                :formatter="formatter"
+                @cancel="dataForm.status = false"
+                type="date"
+                @confirm="chioseDate"
+            />
+        </van-popup>
+    </div>
+</template>
+<script>
+import MHeader from "@/components/MHeader";
+import MEmpty from '@/components/MEmpty';
+import Search from '@/components/Search';
+import dayjs from "dayjs";
+import { browser } from "@/common/common";
+import { countStudentTrain } from './api.js'
+export default {
+    components: { MHeader, MEmpty, Search },
+    data() {
+        return {
+            headerStatus: true,
+            dataForm: {
+                // 时间下拉框
+                type: null,
+                status: false,
+                minDate: new Date(2000, 0, 1),
+                maxDate: new Date(2025, 10, 1),
+                currentDate: new Date(),
+            },
+            purposeStatus: true,
+            startDate: null,
+            endDate: null,
+            showStart: false,
+            showEnd: false,
+            formatEndTime: null,
+            formatStartTime: null,
+            list: [],
+            loading: false,
+            finished: false,
+            params: {
+                search: null,
+                page: 1,
+                rows: 20,
+            },
+            dataShow: true,
+        };
+    },
+    mounted() {
+        let params = this.$route.query;
+        if (params.Authorization) {
+            localStorage.setItem("Authorization", decodeURI(params.Authorization));
+            localStorage.setItem("userInfo", decodeURI(params.Authorization));
+        }
+        if (browser().android || browser().iPhone) {
+            this.headerStatus = false;
+        }
+        document.title = '训练统计'
+        this.getList()
+    },
+    methods: {
+        search(val) {
+            this.params.search = val
+            this.onResetList()
+        },
+        onResetList() {
+            this.list = [];
+            this.params.page = 1;
+            this.dataShow = true;
+            this.loading = true;
+            this.finished = false;
+            this.getList()
+        },
+        onHref(item) {
+            this.$router.push({
+                path: '/trainDetail',
+                query: {
+                    userId: item.userId,
+                    username: item.username
+                }
+            })
+        },
+        cancelBtn() {
+            this.formatStartTime = null;
+            this.formatEndTime = null;
+            this.onResetList()
+            this.$refs.item.toggle();
+        },
+        okBtn() {
+            if(this.formatStartTime && this.formatEndTime) {
+                this.onResetList()
+            }
+            this.$refs.item.toggle();
+        },
+        onChangeDate(type) {
+            let dataForm = this.dataForm
+            if(type == 'showEnd') {
+                if(this.formatStartTime) {
+                dataForm.minDate = new Date(dayjs(this.formatStartTime))
+                }
+                setTimeout(() => {
+                dataForm.currentDate = this.formatEndTime ? new Date(dayjs(this.formatEndTime)) : new Date()
+                }, 500)
+            } else if(type == 'showStart') {
+                dataForm.minDate = new Date(2000, 0, 1)
+                setTimeout(() => {
+                dataForm.currentDate = this.formatStartTime ? new Date(dayjs(this.formatStartTime)) : new Date()
+                }, 500)
+            }
+            dataForm.status = true
+            dataForm.type = type
+        },
+        chioseDate(value) {
+            let dataForm = this.dataForm
+            if(dataForm.type == 'showStart') {
+                this.formatStartTime = dayjs(value).format('YYYY/MM/DD')
+                if(this.formatEndTime && dayjs(value).unix() > dayjs(this.formatEndTime).unix()) {
+                this.formatEndTime = null
+                }
+            } else if(dataForm.type == 'showEnd') {
+                this.formatEndTime = dayjs(value).format('YYYY/MM/DD')
+            }
+            dataForm.status = false
+        },
+        // onTypeChange() {
+        //   this.onResetList()
+        // },
+        onPurposeChange() {
+            this.onResetList()
+        },
+        async getList() {
+            let params = this.params;
+            if(this.formatStartTime && this.formatEndTime) {
+                params.startTime = this.formatStartTime
+                params.endTime = this.formatEndTime
+            } else {
+                params.startTime = null
+                params.endTime = null
+            }
+            try {
+                let res = await countStudentTrain(params)
+                let result = res.data;
+                this.loading = false;
+                params.page = result.pageNo;
+                this.list = this.list.concat(result.rows);
+                if (params.page >= result.totalPage) {
+                    this.finished = true;
+                }
+                this.params.page++;
+                // 判断是否有数据
+                if (this.list.length <= 0) {
+                    this.dataShow = false;
+                }
+            } catch {
+                //
+                this.finished = true;
+                this.dataShow = false;
+            }
+        },
+        formatter(type, val) {
+        if (type === "year") {
+            return `${val}年`;
+        } else if (type === "month") {
+            return `${val}月`;
+        } else if (type == "day") {
+            return `${val}日`;
+        }
+        return val;
+        },
+    },
+};
+</script>
+<style lang="less" scoped>
+@import url("../../assets/commonLess/variable.less");
+
+.visitList {
+    min-height: 100vh;
+    .visitTime {
+        .van-cell__right-icon{
+        line-height: .36rem;
+        }
+    }
+    /deep/.van-dropdown-menu__bar {
+        box-shadow: none;
+    }
+}
+.data-content {
+    margin: .15rem .15rem 0;
+    border-radius: .1rem;
+    overflow: hidden;
+    &:first-child {
+        margin-top: 0;
+    }
+    .van-row-item {
+        display: flex;
+        align-items: center;
+    }
+    /deep/.van-grid-item__content {
+        padding: .03rem
+    }
+    /deep/.van-grid-item__content {
+        background-color: transparent;
+    }
+    /deep/.van-grid-item__icon-wrapper {
+        font-size: .15rem;
+        color: #000;
+    }
+    /deep/.van-grid-item__text {
+        font-size: .14rem;
+        color: #808080;
+    }
+    .teacher_info {
+        display: flex;
+        align-items: center;
+        img {
+            margin-right: .1rem;
+            width: .4rem;
+            height: .4rem;
+            border-radius: 50%;
+        }
+    }
+}
+// .cellGroup {
+//   display: flex;
+//   align-items: center;
+//   line-height: .61rem;
+//   .logo {
+//     width: 0.35rem;
+//     height: 0.35rem;
+//     // margin-right: 0.12rem;
+//     border-radius: 100%;
+//   }
+//   .type {
+//       line-height: 1.2;
+//   }
+// }
+// /deep/.van-cell__title {
+//   font-size: 0.14rem;
+//   color: @mFontColor;
+//   flex: 1 auto;
+// }
+.btnWrap {
+  display: flex;
+  flex-direction: row;
+  .cancelBtn {
+    height: 48px;
+    line-height: 48px;
+    background: #eeeff3;
+    color: @mColor;
+    text-align: center;
+    width: 100%;
+  }
+  .okBtn {
+    width: 100%;
+    height: 48px;
+    line-height: 48px;
+    background: @mColor;
+    color: #fff;
+    text-align: center;
+  }
+}
+// .van-cell{
+//     color: #1A1A1A;
+//     line-height: .36rem!important;
+//     font-size: .16rem;
+// }
+// /deep/.van-col--9 {
+//     display: flex;
+// }
+// /deep/.van-col--5 {
+//     text-align: center;
+// }
+</style>

+ 286 - 0
src/views/trainStatistics/trainDetail.vue

@@ -0,0 +1,286 @@
+<template>
+<div class="trainDetail">
+    <van-sticky>
+        <m-header v-if="headerStatus" :isFixed="false" />
+        <van-row class="dataSearch" type="flex">
+            <van-col span="9" offset="1">
+                <van-cell @click="onChangeDate('showStart')" :value="searchList.startTime"></van-cell>
+            </van-col>
+            <van-col span="1" class="flexCenter">-</van-col>
+            <van-col span="9">
+                <van-cell @click="onChangeDate('showEnd')" :value="searchList.endTime"></van-cell>
+            </van-col>
+            <van-col span="4" class="flexCenter">
+                <span class="btn-search" @click="onSearch">搜索</span>
+            </van-col>
+        </van-row>
+    </van-sticky>
+    <van-popup v-model="dataForm.status" position="bottom" round :style="{ height: '40%' }">
+        <van-datetime-picker
+            v-model="dataForm.currentDate"
+            :min-date="dataForm.minDate"
+            :max-date="dataForm.maxDate"
+            :formatter="formatter"
+            @cancel="dataForm.status = false"
+            type="date"
+            @confirm="chioseDate"
+        />
+    </van-popup>
+    <div class="specialList">
+        <van-list v-model="loading"  v-if="show" key="trainDetail"
+            :finished="finished"
+            finished-text="- 没有更多内容 -"
+            :immediate-check="false"
+            @load="getList()">
+            <van-cell-group class="data-content" v-for="(item, index) in dataList" :key="index" @click="onDetail(item)">
+                <van-cell style="padding: 16px 12px; 12px" :center="true">
+                    <template #title>
+                        <span style="font-size: .17rem; color:#333333; font-weight: 500; padding-right: .05rem;padding-bottom: .05rem;">{{ item.sysMusicScoreName }}</span>
+                    </template>
+                    <p style="font-size: 14px; color: #808080;">{{ item.createTime }}</p>
+                </van-cell>
+                <van-cell :clickable="false" center style="padding: 12px 12px 16px">
+                    <template #title>
+                        <van-grid :border="false" column-num="4" :clickable="true">
+                            <van-grid-item text="综合得分" class="van-hairline--right">
+                                <template #icon>{{ item.score }}分</template>
+                            </van-grid-item>
+                            <van-grid-item text="音准" class="van-hairline--right">
+                                <template #icon><span style="color: #01C1B5">{{ item.intonation }}分</span></template>
+                            </van-grid-item>
+                            <van-grid-item text="节奏" class="van-hairline--right">
+                                <template #icon><span style="color: #FF802C">{{ item.cadence }}分</span></template>
+                            </van-grid-item>
+                            <van-grid-item text="完成度">
+                                <template #icon><span style="color: #FF802C">{{ item.integrity }}分</span></template>
+                            </van-grid-item>
+                        </van-grid>
+                    </template>
+                </van-cell>
+            </van-cell-group>
+        </van-list>
+        <m-empty v-else key="trainDetail" msg="暂无训练详情" />
+
+        <div class="button-group">
+            <van-button type="primary" size="large" @click="addVisited">添加回访</van-button>
+            <div class="placeholder-btn"></div>
+        </div>
+    </div>
+</div>
+</template>
+<script>
+import MHeader from "@/components/MHeader";
+import MEmpty from '@/components/MEmpty';
+import dayjs from "dayjs";
+import { browser } from "@/common/common";
+import { queryMusicCompareRecord } from './api.js'
+export default {
+    components: { MHeader, MEmpty },
+    data() {
+        const query = this.$route.query
+        return {
+            headerStatus: true,
+            show: true,
+            username: query.username,
+            searchList: {
+                startTime: dayjs().format('YYYY-MM-DD'),
+                endTime: dayjs().format('YYYY-MM-DD'),
+                userId: query.userId,
+                page: 1,
+                rows: 20
+            },
+            dataForm: {
+                // 时间下拉框
+                type: null,
+                status: false,
+                minDate: new Date(2000, 0, 1),
+                maxDate: new Date(2030, 11, 31),
+                currentDate: new Date(),
+            },
+            dataList: [],
+            loading: false,
+            finished: false,
+        }
+    },
+    mounted() {
+        if (browser().android || browser().iPhone) {
+            this.headerStatus = false;
+        }
+        document.title = '评测详情'
+        this.getList()
+    },
+    methods: {
+        addVisited() {
+            this.$router.push({
+                path: '/addVisit',
+                query: {
+                    userId: this.searchList.userId,
+                    username: this.username,
+                    type: 'train',
+                    name: '新增回访记录'
+                }
+            })
+        },
+        async getList() {
+            try {
+                let res = await queryMusicCompareRecord(this.searchList)
+                let result = res.data
+                this.loading = false
+                // 重点这句,判断是不是重复请求了
+                if (this.dataList.length > 0 && result.pageNo == 1) {
+                    return;
+                }
+                let rows = result.rows || []
+                this.dataList.push(...rows)
+                if(this.searchList.page >= result.totalPage) {
+                    this.finished = true
+                }
+                this.searchList.page++
+                if(this.dataList.length <= 0) {
+                    this.show = false
+                }
+            } catch {
+                this.show = false
+                this.finished = true
+            }
+        },
+        onSearch() {
+            this.dataList = [] // 重置数据
+            this.show = true
+            this.loading = true
+            this.finished = false
+            this.searchList.page = 1
+            this.getList()
+        },
+        onChangeDate(type) {
+            let dataForm = this.dataForm
+            if(type == 'showEnd') {
+                // if(this.endTime) {
+                    dataForm.minDate = new Date(dayjs(this.searchList.startTime))
+                    dataForm.maxDate = new Date(2030, 11, 31)
+                // }
+                setTimeout(() => {
+                    dataForm.currentDate = this.searchList.endTime ? new Date(dayjs(this.searchList.endTime)) : new Date()
+                }, 500)
+            } else if(type == 'showStart') {
+                dataForm.minDate = new Date(2000, 0, 1)
+                dataForm.maxDate = new Date(dayjs(this.searchList.endTime))
+                setTimeout(() => {
+                    dataForm.currentDate = this.searchList.startTime ? new Date(dayjs(this.searchList.startTime)) : new Date()
+                }, 500)
+            }
+            dataForm.status = true
+            dataForm.type = type
+        },
+        chioseDate(value) {
+            let dataForm = this.dataForm
+            if(dataForm.type == 'showStart') {
+                this.searchList.startTime = dayjs(value).format('YYYY-MM-DD')
+            } else if(dataForm.type == 'showEnd') {
+                this.searchList.endTime = dayjs(value).format('YYYY-MM-DD')
+            }
+            dataForm.status = false
+        },
+        formatter(type, val) {
+            if (type === "year") {
+                return `${val}年`;
+            } else if (type === "month") {
+                return `${val}月`;
+            } else if (type == "day") {
+                return `${val}日`;
+            }
+            return val;
+        },
+    }
+}
+</script>
+
+<style lang="less" scoped>
+.trainDetail {
+    background: #f5f5f5;
+    min-height: 100vh;
+}
+.data-content {
+    margin: .15rem .15rem 0;
+    border-radius: .1rem;
+    overflow: hidden;
+    &:first-child {
+        margin-top: 0;
+    }
+    .van-row-item {
+        display: flex;
+        align-items: center;
+    }
+    /deep/.van-grid-item__content {
+        padding: .03rem
+    }
+    /deep/.van-grid-item__content {
+        background-color: transparent;
+    }
+    /deep/.van-grid-item__icon-wrapper {
+        font-size: .15rem;
+        color: #000;
+    }
+    /deep/.van-grid-item__text {
+        font-size: .14rem;
+        color: #808080;
+    }
+    .teacher_info {
+        display: flex;
+        align-items: center;
+        img {
+            margin-right: .1rem;
+            width: .4rem;
+            height: .4rem;
+            border-radius: 50%;
+        }
+    }
+}
+.specialList {
+    padding-top: .1rem;
+    margin-bottom: 50px;
+    // padding-bottom: calc(env(safe-area-inset-bottom) / 2);
+}
+.dataSearch {
+    padding: .12rem;
+    background-color: #fff;
+    /deep/.van-cell {
+        background: #F5F5F5;
+        padding: .05rem .16rem;
+        border-radius: 1rem;
+        overflow: hidden;
+        height: .34rem;
+    }
+    /deep/.van-cell__value--alone {
+        text-align: center;
+    }
+    .flexCenter {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+    }
+    .btn-search {
+        background: #01C1B5;
+        font-size: 14px;
+        color: #fff;
+        padding: 4px 9px;
+        border-radius: 15px;
+    }
+}
+.button-group {
+    overflow: hidden;
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    z-index: 9;
+    .van-button--primary {
+        background: #01C1B5;
+        border: 1px solid #01C1B5;
+        font-size: .16rem;
+        float: right;
+        // padding-bottom: calc(env(safe-area-inset-bottom) / 2);
+        height: auto;
+        line-height: 48px;
+    }
+}
+</style>

+ 27 - 11
src/views/visitManager/addVisit.vue

@@ -17,7 +17,7 @@
         v-model="studentName"
         readonly
         input-align="right"
-        :is-link="id ? false : true"
+        :is-link="id || userId ? false : true"
         placeholder="请选择"
       />
       <van-field
@@ -26,7 +26,7 @@
         v-model="form.type"
         readonly
         input-align="right"
-        :is-link="id ? false : true"
+        :is-link="id || userId ? false : true"
         placeholder="请选择"
       />
       <van-field
@@ -35,7 +35,7 @@
         v-model="form.purpose"
         readonly
         input-align="right"
-        :is-link="id ? false : true"
+        :is-link="id || userId ? false : true"
         placeholder="请选择"
       />
     </van-cell-group>
@@ -206,9 +206,11 @@ export default {
   },
   data() {
     const query = this.$route.query;
+    // 如果有userId的时候说明是从评测详情进来的
     return {
       id: query.id,
       name: query.name,
+      userId: query.userId,
       dataForm: {
         // 时间下拉框
         status: false,
@@ -221,22 +223,22 @@ export default {
         headerStatus: true, // 头部是否展示
         studentStatus: false, // 上课学生状态
       },
-      typeList: [{ name: "课程推荐" }, { name: "常规回访" }, { name: "其它" }],
+      typeList: [{ name: "课程推荐" }, { name: "常规回访" }, { name: "云教练" }, { name: "其它" }],
       visit: {
         status: false,
         type: null,
         data: [],
       },
-      studentName: null,
+      studentName: query.username || null,
       teacherName: null,
       form: {
         teacherId: null,
-        studentId: null,
-        type: null,
-        purpose: null,
+        studentId: query.userId || null,
+        type: query.userId ? '云教练' : null,
+        purpose:  query.userId ? '体验回访' : null,
         overview: "",
         feedback: "",
-        visitTime: null,
+        visitTime: query.userId || query.id ? dayjs().format("YYYY年MM月DD日") : null,
         visiterType: "TEACHER",
       },
       loading: false,
@@ -336,7 +338,19 @@ export default {
       setLoading(false);
       if (result.code == 200) {
         this.$toast("添加成功");
-        this.$router.push("visitList");
+        setTimeout(() => {
+          if(this.userId) {
+            this.$router.replace({
+              path: '/trainDetail',
+              query: {
+                username: this.studentName,
+                userId: this.userId
+              }
+            });
+          } else {
+            this.$router.replace("visitList");
+          }
+        }, 800);
       } else {
         this.$toast(result.msg);
         this.clickStatus = false;
@@ -350,7 +364,7 @@ export default {
       this.statusList.studentStatus = true;
     },
     onChange(type) {
-      if (this.id) {
+      if (this.id || this.userId) {
         return;
       }
       let visit = this.visit;
@@ -364,6 +378,8 @@ export default {
           visit.data = [{ name: "新课推荐" }, { name: "续费提醒" }];
         } else if (form.type == "常规回访") {
           visit.data = [{ name: "课后及作业回访" }, { name: "练习及乐团表现" }];
+        } else if(form.type == '云教练') {
+          visit.data = [{ name: "体验回访" }]
         } else {
           this.$toast("请选择回访类型");
           return;

+ 3 - 3
vue.config.js

@@ -1,7 +1,7 @@
-// let targetUrl = 'http://mteatest.dayaedu.com'
+let targetUrl = 'https://mteatest.dayaedu.com'
 // let targetUrl = 'http://192.168.3.139:8000' // 箭河
 // let targetUrl = 'https://online.dayaedu.com'
-let targetUrl = 'http://dev.dayaedu.com/'
+// let targetUrl = 'http://dev.dayaedu.com/'
 // let targetUrl = 'http://192.168.3.196'
 module.exports = {
   chainWebpack: config => {
@@ -39,7 +39,7 @@ module.exports = {
     open: process.platform === 'darwin',
     host: '0.0.0.0',
     port: 9999,
-    https: false,
+    https: true,
     hotOnly: false,
     // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/cli-service.md#配置代理
     proxy: {