|
@@ -1,104 +1,107 @@
|
1
|
|
-<template>
|
2
|
|
- <view class="page">
|
3
|
|
- <cu-custom :isBack="true" title="评价"></cu-custom>
|
4
|
|
- <view class="teacher flex bg-white padding">
|
5
|
|
- <image mode="scaleToFill" :src="teacher_avatar" class="avatar lg"></image>
|
6
|
|
- <view class="flex-sub margin-left">
|
7
|
|
- <view class="teacher-title">{{teacher.username||''}}老师授课</view>
|
8
|
|
- <view class="teacher-item">所属机构:{{teacher.agency_name||''}}</view>
|
9
|
|
- <view class="teacher-exp flex">
|
10
|
|
- <view class="exp-item">{{teacher.honor||''}}</view>
|
11
|
|
- <view class="exp-item">{{teacher.introduce||''}}</view>
|
12
|
|
- </view>
|
13
|
|
- </view>
|
14
|
|
- </view>
|
15
|
|
- <view class="comment bg-white margin-top padding-lr padding-tb-lg">
|
16
|
|
- <view>请评价(已对班主任匿名,请放心评价)</view>
|
17
|
|
- <view class="flex text-center margin-top" style="padding-left:80rpx;">
|
18
|
|
- <view class="flex-sub">
|
19
|
|
- <img src="/static/imgs/class/satisfaction.png" mode="widthFix" style="width:70px;">
|
20
|
|
- <view>满意</view>
|
21
|
|
- </view>
|
22
|
|
- <view class="flex-sub">
|
23
|
|
- <img src="/static/imgs/class/unsatisfaction.png" mode="widthFix" style="width:70px;">
|
24
|
|
- <view>一般</view>
|
25
|
|
- </view>
|
26
|
|
- </view>
|
27
|
|
- <view class="flex margin-top-sm">
|
28
|
|
- <view style="width:80rpx;line-height:32px;">课程</view>
|
29
|
|
- <view class="flex-sub text-center">
|
30
|
|
- <button class="cu-btn" :class="params.agency_statisfaction===2?'bg-cyan':'line-cyan'" @tap="evaluate('agency_statisfaction',2)">满意</button>
|
31
|
|
- </view>
|
32
|
|
- <view class="flex-sub text-center">
|
33
|
|
- <button class="cu-btn" :class="params.agency_statisfaction===1?'bg-cyan':'line-cyan'" @tap="evaluate('agency_statisfaction',1)">一般</button>
|
34
|
|
- </view>
|
35
|
|
- </view>
|
36
|
|
- <view class="flex margin-top-sm">
|
37
|
|
- <view style="width:80rpx;line-height:32px;">老师</view>
|
38
|
|
- <view class="flex-sub text-center" @tap="params.statisfaction=2">
|
39
|
|
- <button class="cu-btn" :class="params.statisfaction===2?'bg-cyan':'line-cyan'" @tap="evaluate('statisfaction',2)">满意</button>
|
40
|
|
- </view>
|
41
|
|
- <view class="flex-sub text-center" @tap="params.statisfaction=1">
|
42
|
|
- <button class="cu-btn" :class="params.statisfaction===1?'bg-cyan':'line-cyan'" @tap="evaluate('statisfaction',1)">一般</button>
|
43
|
|
- </view>
|
44
|
|
- </view>
|
45
|
|
- <view class="margin-top-lg">
|
46
|
|
- <button class="cu-btn bg-cyan lg" style="width:100%;" @tap="comment">提交评价</button>
|
47
|
|
- </view>
|
48
|
|
- </view>
|
49
|
|
- </view>
|
50
|
|
-</template>
|
51
|
|
-
|
52
|
|
-<script>
|
53
|
|
-import { _commentDetail, _tocomment } from '@/api/course'
|
54
|
|
-export default {
|
55
|
|
- data() {
|
56
|
|
- return {
|
57
|
|
- teacher: {},
|
58
|
|
- satisfaction: {},
|
59
|
|
- params: {
|
60
|
|
- agency_statisfaction: 2,
|
61
|
|
- statisfaction: 2,
|
62
|
|
- plan_id: '',
|
63
|
|
- teacher_id: ''
|
64
|
|
- },
|
65
|
|
- teacher_avatar: '/static/imgs/class/logo0.png'
|
66
|
|
- }
|
67
|
|
- },
|
68
|
|
- onLoad(options) {
|
69
|
|
- const id = decodeURIComponent(options.plan_id)
|
70
|
|
- if (!id) uni.navigateBack()
|
71
|
|
- this.params.plan_id = id
|
72
|
|
- this.init()
|
73
|
|
- },
|
74
|
|
- methods: {
|
75
|
|
- init() {
|
76
|
|
- _commentDetail({ plan_id: this.params.plan_id }).then(res => {
|
77
|
|
- this.teacher = res.teacher_data
|
78
|
|
- this.satisfaction = res.satisfaction_data
|
79
|
|
- })
|
80
|
|
- },
|
81
|
|
- evaluate(type, value) { // 评价
|
82
|
|
- this.params[type] = value
|
83
|
|
- },
|
84
|
|
- comment() {
|
85
|
|
- _tocomment(this.params).then(res => {
|
86
|
|
- uni.showToast({ title: res.msg, icon: 'success' })
|
87
|
|
- uni.navigateBack()
|
88
|
|
- })
|
89
|
|
- }
|
90
|
|
- }
|
91
|
|
-}
|
92
|
|
-</script>
|
93
|
|
-
|
94
|
|
-<style lang="scss" scoped>
|
95
|
|
-@import '~@/common/css/mixin.scss';
|
96
|
|
-.page{
|
97
|
|
- height:100vh;
|
98
|
|
-}
|
99
|
|
-.teacher{
|
100
|
|
- &-title{
|
101
|
|
- @include title(4px,18px);
|
102
|
|
- }
|
103
|
|
-}
|
104
|
|
-</style>
|
|
1
|
+<template>
|
|
2
|
+ <view class="page">
|
|
3
|
+ <cu-custom :isBack="true" title="评价"></cu-custom>
|
|
4
|
+ <view class="teacher flex bg-white padding">
|
|
5
|
+ <image mode="scaleToFill" :src="teacher_avatar" class="avatar lg"></image>
|
|
6
|
+ <view class="flex-sub margin-left">
|
|
7
|
+ <view class="teacher-title">{{teacher.username||''}}老师授课</view>
|
|
8
|
+ <view class="teacher-item">所属机构:{{teacher.agency_name||''}}</view>
|
|
9
|
+ <view class="teacher-exp flex">
|
|
10
|
+ <view class="exp-item">{{teacher.honor||''}}</view>
|
|
11
|
+ <view class="exp-item">{{teacher.introduce||''}}</view>
|
|
12
|
+ </view>
|
|
13
|
+ </view>
|
|
14
|
+ </view>
|
|
15
|
+ <view class="comment bg-white margin-top padding-lr padding-tb-lg">
|
|
16
|
+ <view>请评价(已对班主任匿名,请放心评价)</view>
|
|
17
|
+ <view class="flex text-center margin-top" style="padding-left:80rpx;">
|
|
18
|
+ <view class="flex-sub">
|
|
19
|
+ <img src="/static/imgs/class/satisfaction.png" mode="widthFix" style="width:70px;">
|
|
20
|
+ <view>满意</view>
|
|
21
|
+ </view>
|
|
22
|
+ <view class="flex-sub">
|
|
23
|
+ <img src="/static/imgs/class/unsatisfaction.png" mode="widthFix" style="width:70px;">
|
|
24
|
+ <view>一般</view>
|
|
25
|
+ </view>
|
|
26
|
+ </view>
|
|
27
|
+ <view class="flex margin-top-sm">
|
|
28
|
+ <view style="width:80rpx;line-height:32px;">课程</view>
|
|
29
|
+ <view class="flex-sub text-center">
|
|
30
|
+ <button class="cu-btn" :class="params.agency_statisfaction===2?'bg-cyan':'line-cyan'" @tap="evaluate('agency_statisfaction',2)">满意</button>
|
|
31
|
+ </view>
|
|
32
|
+ <view class="flex-sub text-center">
|
|
33
|
+ <button class="cu-btn" :class="params.agency_statisfaction===1?'bg-cyan':'line-cyan'" @tap="evaluate('agency_statisfaction',1)">一般</button>
|
|
34
|
+ </view>
|
|
35
|
+ </view>
|
|
36
|
+ <view class="flex margin-top-sm">
|
|
37
|
+ <view style="width:80rpx;line-height:32px;">老师</view>
|
|
38
|
+ <view class="flex-sub text-center" @tap="params.statisfaction=2">
|
|
39
|
+ <button class="cu-btn" :class="params.statisfaction===2?'bg-cyan':'line-cyan'" @tap="evaluate('statisfaction',2)">满意</button>
|
|
40
|
+ </view>
|
|
41
|
+ <view class="flex-sub text-center" @tap="params.statisfaction=1">
|
|
42
|
+ <button class="cu-btn" :class="params.statisfaction===1?'bg-cyan':'line-cyan'" @tap="evaluate('statisfaction',1)">一般</button>
|
|
43
|
+ </view>
|
|
44
|
+ </view>
|
|
45
|
+ <view class="margin-top-lg">
|
|
46
|
+ <button class="cu-btn bg-cyan lg" style="width:100%;" @tap="comment">提交评价</button>
|
|
47
|
+ </view>
|
|
48
|
+ </view>
|
|
49
|
+ </view>
|
|
50
|
+</template>
|
|
51
|
+
|
|
52
|
+<script>
|
|
53
|
+import { _commentDetail, _tocomment } from '@/api/course'
|
|
54
|
+export default {
|
|
55
|
+ data() {
|
|
56
|
+ return {
|
|
57
|
+ teacher: {},
|
|
58
|
+ satisfaction: {},
|
|
59
|
+ params: {
|
|
60
|
+ agency_statisfaction: 2,
|
|
61
|
+ statisfaction: 2,
|
|
62
|
+ plan_id: '',
|
|
63
|
+ teacher_id: ''
|
|
64
|
+ },
|
|
65
|
+ teacher_avatar: '/static/imgs/class/logo0.png'
|
|
66
|
+ }
|
|
67
|
+ },
|
|
68
|
+ onLoad(options) {
|
|
69
|
+ const id = decodeURIComponent(options.plan_id)
|
|
70
|
+ if (!id) uni.navigateBack()
|
|
71
|
+ this.params.plan_id = id
|
|
72
|
+ this.init()
|
|
73
|
+ },
|
|
74
|
+ methods: {
|
|
75
|
+ init() {
|
|
76
|
+ _commentDetail({ plan_id: this.params.plan_id }).then(res => {
|
|
77
|
+ this.teacher = res.teacher_data
|
|
78
|
+ this.params.teacher_id = this.teacher ? this.teacher.teacher_id : 'undefined'
|
|
79
|
+ this.satisfaction = res.satisfaction_data
|
|
80
|
+ })
|
|
81
|
+ },
|
|
82
|
+ evaluate(type, value) { // 评价
|
|
83
|
+ this.params[type] = value
|
|
84
|
+ },
|
|
85
|
+ comment() {
|
|
86
|
+ _tocomment(this.params).then(res => {
|
|
87
|
+ uni.showToast({ title: res.msg, icon: 'success' })
|
|
88
|
+ setTimeout(() => {
|
|
89
|
+ uni.navigateBack()
|
|
90
|
+ }, 800)
|
|
91
|
+ })
|
|
92
|
+ }
|
|
93
|
+ }
|
|
94
|
+}
|
|
95
|
+</script>
|
|
96
|
+
|
|
97
|
+<style lang="scss" scoped>
|
|
98
|
+@import '~@/common/css/mixin.scss';
|
|
99
|
+.page{
|
|
100
|
+ height:100vh;
|
|
101
|
+}
|
|
102
|
+.teacher{
|
|
103
|
+ &-title{
|
|
104
|
+ @include title(4px,18px);
|
|
105
|
+ }
|
|
106
|
+}
|
|
107
|
+</style>
|