visitDetail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div class="visitDetail">
  3. <van-cell
  4. class="visit-item"
  5. center
  6. >
  7. <template #icon>
  8. <img class="user-logo" v-if="userInfo.avatar" :src="userInfo.avatar" alt="" />
  9. <img
  10. v-else
  11. class="user-logo"
  12. src="../../assets/images/icon_student.png"
  13. alt=""
  14. />
  15. </template>
  16. <template #title>
  17. <div class="title">
  18. <p class="name">{{ userInfo.username }}</p>
  19. <p class="time">
  20. {{ userInfo.classDate }}
  21. <span class="tips"><i class="icon_dot"></i>教学内容未达标</span>
  22. </p>
  23. </div>
  24. </template>
  25. <template #right-icon>
  26. <a :href="'tel:' + userInfo.phone"><van-icon :name="icon_phone" size="18" /></a>
  27. </template>
  28. </van-cell>
  29. <Item v-if="dataInfo.courseScheduleId" :dataInfo="dataInfo" />
  30. <van-cell-group class="section">
  31. <p class="work title">
  32. <van-icon :name="icon_content" size="22" style="padding-right: .06rem;" />
  33. 教学内容
  34. </p>
  35. <van-field
  36. rows="1"
  37. type="textarea"
  38. disabled
  39. v-model="memo"
  40. placeholder="请输入本课程教学内容"
  41. />
  42. </van-cell-group>
  43. <div class="button-group">
  44. <van-button type="primary" round size="large" @click="submitReview">
  45. 添加回访
  46. </van-button>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import Item from "../afterClassEvaluate/modal/item.vue";
  52. import { getReviewInfo } from '../afterClassEvaluate/api';
  53. export default {
  54. name: "visitDetail",
  55. components: { Item },
  56. data() {
  57. const query = this.$route.query || {};
  58. return {
  59. userInfo: query || {},
  60. icon_content: require('@/views/afterClassEvaluate/images/icon_content.png'),
  61. icon_phone: require('@/views/afterClassEvaluate/images/icon_phone.png'),
  62. memo: null,
  63. dataInfo: {}
  64. }
  65. },
  66. computed: {
  67. isReview() {
  68. return this.$route.query.reviewId;
  69. }
  70. },
  71. async mounted() {
  72. let params = {}
  73. if(this.isReview) {
  74. const res = await getReviewInfo({ id: this.userInfo.reviewId });
  75. const result = res.data
  76. console.log(result, 'result')
  77. let info = result.teacherClassHeadInfo;
  78. params = {
  79. classStartTime: info.classDate + ' ' + info.startClassTime + ':00',
  80. classEndTime: info.endClassTime + ':00',
  81. courseType: info.courseScheduleType,
  82. courseName: info.classGroupName,
  83. teachMode: info.teachMode,
  84. schoolName: null,
  85. courseScheduleId: result.courseScheduleReview.courseScheduleId
  86. }
  87. this.memo = result.courseScheduleReview.memo || '该课程未设置教学内容'
  88. }
  89. this.dataInfo = params
  90. console.log(this.dataInfo)
  91. },
  92. methods: {
  93. submitReview() {
  94. let { userId, ...query } = this.$route.query
  95. this.$router.push({
  96. path: "/addVisit",
  97. query: {
  98. beforeId: this.userInfo.userId,
  99. ...query
  100. }
  101. });
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="less" scoped>
  107. .visitDetail {
  108. min-height: 100vh;
  109. background: #f3f4f8;
  110. overflow: hidden;
  111. }
  112. .visit-item {
  113. margin: 0.1rem 0.12rem;
  114. border-radius: 0.1rem;
  115. padding: 0.18rem 0.12rem;
  116. width: auto;
  117. .user-logo {
  118. width: 0.42rem;
  119. height: 0.42rem;
  120. border-radius: 50%;
  121. }
  122. .title {
  123. display: flex;
  124. flex-direction: column;
  125. justify-content: space-between;
  126. padding-left: 0.1rem;
  127. color: #666666;
  128. font-size: 0.13rem;
  129. .name {
  130. font-size: 0.16rem;
  131. color: #1a1a1a;
  132. }
  133. .time {
  134. display: flex;
  135. align-items: center;
  136. }
  137. .tips {
  138. font-size: 0.12rem;
  139. color: #ff5a5f;
  140. background: #fff3f3;
  141. border-radius: 3px;
  142. margin-left: 0.05rem;
  143. padding: 0 0.05rem 0 0.03rem;
  144. line-height: 0.18rem;
  145. display: inline-block;
  146. display: flex;
  147. align-items: center;
  148. .icon_dot {
  149. display: inline-block;
  150. margin-right: 0.03rem;
  151. width: 0.1rem;
  152. height: 0.1rem;
  153. background: url("../afterClassEvaluate/images/dot.png") no-repeat center;
  154. background-size: contain;
  155. }
  156. }
  157. }
  158. }
  159. .section {
  160. margin: 0.1rem 0.12rem 0;
  161. border-radius: .1rem;
  162. overflow: hidden;
  163. .work {
  164. display: flex;
  165. align-items: center;
  166. font-size:16px;
  167. color: #333;
  168. }
  169. .title {
  170. padding: 12px 16px 0;
  171. }
  172. .student-icon {
  173. width: 32px;
  174. height: 32px;
  175. border-radius: 50%;
  176. }
  177. .titleStyle {
  178. font-size: 16px;
  179. color: #666666;
  180. span {
  181. color: #1A1A1A;
  182. padding: 0 .1rem;
  183. }
  184. }
  185. }
  186. .button-group {
  187. padding: 0.2rem .16rem 0.15rem;
  188. background: #f3f4f8;
  189. border: 0.01rem solid #f3f4f8;
  190. .van-button--primary {
  191. font-size: 0.18rem;
  192. height: 0.48rem;
  193. line-height: 0.48rem;
  194. }
  195. }
  196. </style>