index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <template>
  2. <zzx-navbar :scrollable="true" :back="true" title="详情"></zzx-navbar>
  3. <view class="detail-header" v-if="detailObj">
  4. <image class="header-bg":src="detailObj.backgroundImg" mode="aspectFill"></image>
  5. <view class="back-icon" :style="{ paddingTop: (statusBarHeight + 10) + 'px' }" @click="RouterUtils.back()">
  6. <zzx-icon name="back"></zzx-icon>
  7. </view>
  8. <view :style="{ height: (statusBarHeight + 100) + 'px' }"></view>
  9. </view>
  10. <view class="content" v-if="detailObj">
  11. <view class="i-info-card">
  12. <view class="i-userinfo">
  13. <view class="user-header">
  14. <image class="header-img" :src="detailObj.avatar" mode=""></image>
  15. <image class="header-badge" src="/src/static/badge.png" mode=""></image>
  16. </view>
  17. <view style="width: 220rpx;"></view>
  18. <view class="user-name">
  19. <view class="name-box">
  20. <view class="name">{{ detailObj.realname }}</view>
  21. <view class="type">{{ detailObj.trainingProgramsName }}</view>
  22. </view>
  23. <view class="sign" @click="to_certifying">
  24. <text class="textHidden">{{ detailObj.headDisplay }}</text>
  25. <zzx-icon name="ashRight" size="12"></zzx-icon>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="i-sign">
  30. {{ detailObj.teachingPhilosophy }}
  31. </view>
  32. <view class="i-skill">
  33. {{ detailObj.excelMsg }}
  34. </view>
  35. <view class="i-data-card">
  36. <view class="item-data">
  37. <view class="text">好评率</view>
  38. <view class="num">{{ appraiseList.applauseRate||'--' }}%</view>
  39. </view>
  40. <view class="item-data">
  41. <view class="text">订单数</view>
  42. <view class="num">{{ detailObj.orderNumber }}</view>
  43. </view>
  44. <view class="item-data">
  45. <view class="text">授课人数</view>
  46. <view class="num">{{ detailObj.classesNumber || '0' }}</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="i-course-list">
  51. <view class="i-title">课程</view>
  52. <view class="i-course-card">
  53. <view class="card-tips">
  54. <view class="tips-icon">!</view>
  55. <view class="tips-text">全平台每种类型的运动课程只可免费试听一次</view>
  56. </view>
  57. <view class="card-list" v-for="item in detailObj.courseInfoVOList" :key="item.id">
  58. <image class="card-img" :src="item.cover" mode=""></image>
  59. <view class="i-list">
  60. <view class="list-name">
  61. <view class="name textHidden">{{ item.name }}</view>
  62. <view class="num">年售{{ item.annualSalesNum }}</view>
  63. </view>
  64. <view class="address">上课地点:{{ item.address }} | {{ item.km }}km</view>
  65. <view class="list-price">
  66. <view class="left-price" v-if="item.sellingPrice">¥{{ item.sellingPrice.toFixed(2) }}</view>
  67. <view class="right-price" v-if="item.originalPrice">¥{{ item.originalPrice.toFixed(2) }}</view>
  68. </view>
  69. <view class="sale-data">已售{{ item.saleNum }} {{ item.goodRate }}%好评</view>
  70. <view class="course-num">
  71. <view class="number">{{ item.coursesNum }}课时 {{ item.startTime }}-{{ item.endTime }}</view>
  72. <view class="i-btn"
  73. @click="RouterUtils.to_page(`/pages/index/courseDetail/index?id=${item.id}&type=3`)">抢购
  74. </view>
  75. </view>
  76. <view style="height: 24rpx;"></view>
  77. </view>
  78. </view>
  79. <view class="not-data" v-if="detailObj.courseInfoVOList?.length < 1">暂无课程数据</view>
  80. </view>
  81. </view>
  82. <view class="appraise-card">
  83. <view class="appraise-title">
  84. <view class="title">评价</view>
  85. <view class="comments">
  86. <view class="a-star">
  87. <zzx-icon name="star" size="10"></zzx-icon>
  88. <text>{{ appraiseList.averageScore }}</text>
  89. </view>
  90. <view class="a-text">| {{ appraiseList.scoreNum }}人评论</view>
  91. </view>
  92. </view>
  93. <view class="appraise-info" v-for="item in appraiseList.records" :key="item.id">
  94. <view class="a-user-info">
  95. <view class="info">
  96. <image :src="item.avatar" mode=""></image>
  97. <view class="name">{{ item.username }}</view>
  98. </view>
  99. <view class="time">{{ DateUtils.formatDateToMMDD(item.createTime) }}</view>
  100. </view>
  101. <view class="a-score">
  102. <text>{{ item.score.toFixed(1) }}</text>
  103. <uni-rate :readonly="true" size="16" :value="item.score" />
  104. </view>
  105. <view class="a-content">
  106. {{ item.evaluateContent }}
  107. </view>
  108. <scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false">
  109. <view class="scroll-view-item_H uni-bg-red" v-for="(img, idx) in item.images.split(',')" :key="idx">
  110. <image @click="_previewImage(item.images.split(','), img)" :src="img" mode=""></image>
  111. </view>
  112. </scroll-view>
  113. </view>
  114. <view class="not-data" v-if="!appraiseList.records?.length">暂无评价数据</view>
  115. </view>
  116. </view>
  117. </template>
  118. <script lang="ts" setup>
  119. import { ref, onMounted } from 'vue';
  120. import { onLoad, onReachBottom } from '@dcloudio/uni-app';
  121. import { http } from '@/utils/http'
  122. import { useCacheStore } from '@/stores/cache'
  123. import { RouterUtils, _previewImage,DateUtils } from '@/utils/util';
  124. import zzxNavbar from '@/components/zzx-navbar/zzx-navbar.vue';
  125. const cache = useCacheStore()
  126. const statusBarHeight = ref(0);
  127. onLoad((option) => {
  128. detailId.value = option.id
  129. appraiseFormData.value.instructorId = option.id
  130. })
  131. onReachBottom(() => {
  132. appraiseFormData.value.pageNo++
  133. getFindByOrderPage()
  134. })
  135. onMounted(() => {
  136. get_navheight()
  137. get_findByCoachId()
  138. getFindByOrderPage()
  139. })
  140. const get_navheight = () => {
  141. const systemInfo = uni.getSystemInfoSync();
  142. statusBarHeight.value = systemInfo.statusBarHeight || 0;
  143. }
  144. const to_certifying = () => {
  145. uni.navigateTo({
  146. url: `/pages/index/certifyingDetail/index?id=${detailId.value}`
  147. })
  148. }
  149. const detailId = ref()
  150. const detailObj = ref()
  151. const get_findByCoachId = () => {
  152. http.get('/coachC/findByCoachId', { data: { id: detailId.value, longitude: cache.get('LON'), latitude: cache.get('LAT') }, loading: true }).then((res) => {
  153. detailObj.value = res.result
  154. })
  155. }
  156. // 获取评价
  157. const appraiseFormData = ref({
  158. instructorId: null,
  159. pageNo: 1,
  160. pageSize: 10
  161. })
  162. const appraiseList = ref([])
  163. const getFindByOrderPage = () => {
  164. http.get('/my/evaluate/findByOrderPage', { data: appraiseFormData.value, loading: true }).then((res) => {
  165. if(appraiseFormData.value.pageNo == 1){
  166. appraiseList.value = res.result
  167. }else{
  168. appraiseList.value = [...appraiseList.value,...res.result]
  169. }
  170. })
  171. }
  172. </script>
  173. <style lang="less" scoped>
  174. .detail-header {
  175. position: relative;
  176. .header-bg {
  177. position: absolute;
  178. width: 100%;
  179. z-index: -100;
  180. max-height: 432rpx;
  181. }
  182. .back-icon {
  183. position: absolute;
  184. left: 20rpx;
  185. z-index: 9999;
  186. }
  187. }
  188. .i-info-card {
  189. padding: 20rpx;
  190. background: #FFFFFF;
  191. border-radius: 32rpx;
  192. .i-userinfo {
  193. display: flex;
  194. align-items: center;
  195. .user-header {
  196. position: relative;
  197. .header-img {
  198. position: absolute;
  199. top: -110rpx;
  200. width: 160rpx;
  201. height: 160rpx;
  202. border-radius: 50%;
  203. }
  204. .header-badge {
  205. position: absolute;
  206. left: 120rpx;
  207. width: 36rpx;
  208. height: 36rpx;
  209. }
  210. }
  211. .user-name {
  212. .name-box {
  213. display: flex;
  214. align-items: center;
  215. gap: 20rpx;
  216. .name {
  217. font-weight: bold;
  218. font-size: 32rpx;
  219. color: #222222;
  220. }
  221. .type {
  222. font-size: 28rpx;
  223. color: #AAAAAA;
  224. }
  225. }
  226. .sign {
  227. margin-top: 20rpx;
  228. width: 430rpx;
  229. display: flex;
  230. align-items: center;
  231. gap: 10rpx;
  232. font-size: 24rpx;
  233. color: #AAAAAA;
  234. }
  235. }
  236. }
  237. .i-sign {
  238. margin-top: 24rpx;
  239. font-weight: bold;
  240. font-size: 28rpx;
  241. color: #222222;
  242. }
  243. .i-skill {
  244. margin-top: 24rpx;
  245. font-size: 24rpx;
  246. color: #222222;
  247. }
  248. .i-data-card {
  249. padding: 20rpx;
  250. display: flex;
  251. align-items: center;
  252. justify-content: space-around;
  253. background: #F9F9F9;
  254. border-radius: 32rpx;
  255. margin-top: 20rpx;
  256. .item-data {
  257. .text {
  258. font-size: 24rpx;
  259. color: #AAAAAA;
  260. }
  261. .num {
  262. margin-top: 16rpx;
  263. font-weight: bold;
  264. font-size: 32rpx;
  265. color: #222222;
  266. }
  267. }
  268. }
  269. }
  270. .i-course-list {
  271. margin-top: 20rpx;
  272. .i-title {
  273. font-weight: 800;
  274. font-size: 32rpx;
  275. color: #222222;
  276. }
  277. .i-course-card {
  278. background: #FFFFFF;
  279. border-radius: 32rpx;
  280. padding: 20rpx;
  281. margin-top: 20rpx;
  282. .card-tips {
  283. display: flex;
  284. align-items: center;
  285. gap: 12rpx;
  286. font-size: 24rpx;
  287. color: #AAAAAA;
  288. .tips-icon {
  289. width: 24rpx;
  290. height: 24rpx;
  291. border-radius: 50%;
  292. background: #FFA347;
  293. font-size: 18rpx;
  294. color: #fff;
  295. text-align: center;
  296. line-height: 24rpx;
  297. }
  298. }
  299. .card-list {
  300. margin-top: 20rpx;
  301. display: flex;
  302. align-items: center;
  303. gap: 20rpx;
  304. .card-img {
  305. width: 200rpx;
  306. height: 200rpx;
  307. border-radius: 32rpx;
  308. }
  309. .i-list {
  310. border-bottom: 1rpx solid #F0F0F0;
  311. .list-name {
  312. display: flex;
  313. align-items: center;
  314. justify-content: space-between;
  315. .name {
  316. width: 360rpx;
  317. font-weight: 800;
  318. font-size: 32rpx;
  319. color: #222222;
  320. }
  321. .num {
  322. font-size: 22rpx;
  323. color: #AAAAAA;
  324. }
  325. }
  326. .address {
  327. width: 440rpx;
  328. margin-top: 10rpx;
  329. font-size: 22rpx;
  330. color: #AAAAAA;
  331. }
  332. .list-price {
  333. display: flex;
  334. align-items: center;
  335. gap: 20rpx;
  336. margin-top: 10rpx;
  337. .left-price {
  338. font-weight: bold;
  339. font-size: 28rpx;
  340. color: #FB5B5B;
  341. }
  342. .right-price {
  343. font-size: 22rpx;
  344. color: #AAAAAA;
  345. text-decoration: line-through;
  346. }
  347. }
  348. .list-data {
  349. margin-top: 10rpx;
  350. font-size: 24rpx;
  351. color: #AAAAAA;
  352. }
  353. .course-num {
  354. display: flex;
  355. align-items: center;
  356. justify-content: space-between;
  357. }
  358. .course-num {
  359. display: flex;
  360. align-items: center;
  361. justify-content: space-between;
  362. }
  363. .sale-data {
  364. margin-top: 10rpx;
  365. font-size: 24rpx;
  366. color: #AAAAAA;
  367. }
  368. .course-num {
  369. display: flex;
  370. align-items: center;
  371. justify-content: space-between;
  372. margin-top: 10rpx;
  373. .number {
  374. font-size: 24rpx;
  375. color: #AAAAAA;
  376. }
  377. .i-btn {
  378. width: 152rpx;
  379. height: 48rpx;
  380. background: #C8FF0C;
  381. border-radius: 8rpx;
  382. font-weight: bold;
  383. font-size: 28rpx;
  384. color: #222222;
  385. text-align: center;
  386. line-height: 48rpx;
  387. }
  388. }
  389. }
  390. }
  391. }
  392. }
  393. .appraise-card {
  394. padding: 20rpx;
  395. background: #FFFFFF;
  396. border-radius: 32rpx;
  397. margin-top: 20rpx;
  398. .appraise-title {
  399. display: flex;
  400. align-items: center;
  401. justify-content: space-between;
  402. .title {
  403. font-weight: 800;
  404. font-size: 32rpx;
  405. color: #222222;
  406. }
  407. .comments {
  408. display: flex;
  409. align-items: center;
  410. gap: 16rpx;
  411. .a-star {
  412. font-size: 24rpx;
  413. color: #FDD143;
  414. }
  415. .a-text {
  416. font-size: 24rpx;
  417. color: #AAAAAA;
  418. }
  419. }
  420. }
  421. .appraise-info {
  422. margin-top: 20rpx;
  423. .a-user-info {
  424. display: flex;
  425. align-items: center;
  426. justify-content: space-between;
  427. .info {
  428. display: flex;
  429. align-items: center;
  430. gap: 20rpx;
  431. &>image {
  432. width: 60rpx;
  433. height: 60rpx;
  434. border-radius: 50%;
  435. }
  436. .name {
  437. font-weight: bold;
  438. font-size: 24rpx;
  439. color: #222222;
  440. }
  441. }
  442. .time {
  443. font-size: 24rpx;
  444. color: #AAAAAA;
  445. }
  446. }
  447. .a-score {
  448. font-size: 24rpx;
  449. color: #AAAAAA;
  450. display: flex;
  451. align-items: center;
  452. gap: 20rpx;
  453. margin-top: 20rpx;
  454. }
  455. .a-content {
  456. margin-top: 20rpx;
  457. font-size: 28rpx;
  458. color: #222222;
  459. }
  460. .scroll-view_H {
  461. white-space: nowrap;
  462. width: 100%;
  463. height: 220rpx;
  464. margin-top: 20rpx;
  465. border-bottom: 1rpx solid #F0F0F0;
  466. .scroll-view-item_H {
  467. display: inline-block;
  468. text-align: center;
  469. margin-right: 14rpx;
  470. &>image {
  471. width: 202rpx;
  472. height: 200rpx;
  473. background: #D8D8D8;
  474. border-radius: 32rpx;
  475. }
  476. }
  477. }
  478. }
  479. }
  480. </style>