evaluate.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="evaluate">
  3. <view class="top">
  4. <image :src="coachMess.head_portrait" mode="" class="avatar"></image>
  5. <view class="name">
  6. {{coachMess.name}}--{{coachMess.courseName}}
  7. </view>
  8. </view>
  9. <view class="content">
  10. <view class="ques">
  11. 小朋友上完是否学会了?
  12. </view>
  13. <view class="tab">
  14. <view :class="currentTab==0 ? 'active' : 'left'" @click="changTab(0)">
  15. 未学会
  16. </view>
  17. <view :class="currentTab==1 ? 'active' : 'right'" @click="changTab(1)">
  18. 已学会
  19. </view>
  20. </view>
  21. <view class="ques">
  22. 你的好评是给教练最好的鼓励
  23. </view>
  24. <view class="start">
  25. <u-rate :count="count" v-model="value" active-color="#FF6615" inactive-color="#b2b2b2" size="64" gutter="28"></u-rate>
  26. </view>
  27. <view class="body">
  28. <u-input v-model="body" :type="type" :height="height" :auto-height="autoHeight" placeholder="写下您对教练的评价吧~"/>
  29. </view>
  30. </view>
  31. <view class="submit">
  32. <view class="bt" @click="submit">
  33. 提交评价
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. count: 5,
  43. value: 0,
  44. src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
  45. body: '',
  46. type: 'textarea',
  47. height:300,
  48. autoHeight: true,
  49. currentTab:0,
  50. courseChildId:'',
  51. subscribeId:'',
  52. coachMess:''
  53. }
  54. },
  55. onLoad(options) {
  56. console.log(options.data)
  57. let data=JSON.parse(options.data)
  58. this.coachMess=data
  59. this.courseChildId=data.course_child_id
  60. },
  61. methods:{
  62. //切换学习状态
  63. changTab(e){
  64. this.currentTab=e
  65. },
  66. submit(){
  67. let data={
  68. course_child_id:this.courseChildId,
  69. point:this.value,
  70. body:this.body,
  71. is_complete:this.currentTab,
  72. }
  73. this.$u.post('/course/evaluate',data).then(res=>{
  74. console.log(res,'ppppp')
  75. if(res.code==200){
  76. uni.switchTab({
  77. url:'../index/index'
  78. })
  79. }
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. page {
  87. background-color: #FFFFFF;
  88. }
  89. .evaluate {
  90. padding-bottom: 55px;
  91. .top {
  92. text-align: center;
  93. height: 180px;
  94. background: linear-gradient(267deg, #FF3B21 0%, #FF8F09 100%);
  95. opacity: 1;
  96. .avatar {
  97. margin-top: 23px;
  98. height: 78px;
  99. width: 78px;
  100. display: inline-block;
  101. border-radius: 50%;
  102. }
  103. .name {
  104. margin-top: 14px;
  105. font-size: 19px;
  106. font-family: PingFang SC;
  107. font-weight: bold;
  108. line-height: 26px;
  109. color: #FFFFFF;
  110. opacity: 1;
  111. }
  112. }
  113. .content {
  114. margin-top: -12px;
  115. padding: 12px;
  116. border-radius: 8px 8px 0px 0px;
  117. background-color: #FFFFFF;
  118. .ques {
  119. font-size: 15px;
  120. font-family: PingFang SC;
  121. font-weight: bold;
  122. line-height: 21px;
  123. text-align: center;
  124. color: #333333;
  125. opacity: 1;
  126. }
  127. .tab {
  128. width: 218px;
  129. height: 42px;
  130. background: #FFEEE5;
  131. opacity: 1;
  132. border-radius: 21px;
  133. margin: 0 auto;
  134. margin-top: 12px;
  135. margin-bottom: 20px;
  136. display: flex;
  137. .left,
  138. .right {
  139. flex: 1;
  140. height: 42px;
  141. line-height: 42px;
  142. text-align: center;
  143. font-size: 15px;
  144. font-family: PingFang SC;
  145. font-weight: 400;
  146. color: #FF4600;
  147. opacity: 1;
  148. }
  149. .active {
  150. flex: 1;
  151. height: 42px;
  152. line-height: 42px;
  153. text-align: center;
  154. background: linear-gradient(267deg, #FF3B21 0%, #FF8F09 100%);
  155. border-radius: 21px;
  156. color: #FFFFFF;
  157. }
  158. }
  159. .start {
  160. margin-top: 12px;
  161. text-align: center;
  162. }
  163. .body{
  164. margin-top: 20px;
  165. .u-input__textarea{
  166. background-color:#F5F5F5!important;
  167. padding: 12px;
  168. }
  169. }
  170. }
  171. .submit{
  172. height: 50px;
  173. box-shadow: 0px -2px 12px rgba(0, 0, 0, 0.1);
  174. position: fixed;
  175. bottom: 0px;
  176. left: 0;
  177. width: 100%;
  178. .bt{
  179. height: 44px;
  180. margin: 3px 12px 0;
  181. background: linear-gradient(266deg, #FF3B21 0%, #FF8F09 100%);
  182. border-radius: 22px;
  183. font-size: 16px;
  184. font-family: PingFang SC;
  185. font-weight: bold;
  186. text-align: center;
  187. line-height: 45px;
  188. color: #FFFFFF;
  189. opacity: 1;
  190. }
  191. }
  192. }
  193. </style>