orderDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. <template>
  2. <view>
  3. <view class="bg">
  4. <view>
  5. <swiper :style="{height: imageHeight + 'upx'}" autoplay="1500" :indicator-dots="false" :circular='true'
  6. indicator-active-color="#ffffff" indicator-color="#cccccc">
  7. <swiper-item v-for="(item,index) in order.lifePhoto" :key='index'
  8. :style="{height: imageHeight + 'upx'}" @click="saveImgs(order.lifePhoto,index)">
  9. <image class="swiper-image" mode="aspectFill" :src="item" :style="{height: imageHeight + 'upx'}">
  10. </image>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <!-- <view class="wrap">
  15. <u-swiper :list="order.lifePhoto" height="500" border-radius="30"></u-swiper>
  16. </view> -->
  17. <view class="info-box" >
  18. <view v-if="isFollow" class="like-box" @click="follow">
  19. <image class="icon" src="../../static/images/index/like.png" mode=""></image>
  20. <view class="label">
  21. 已收藏
  22. </view>
  23. </view>
  24. <view v-else class="like-box unlike-box" @click="follow">
  25. <image class="icon" src="../../static/images/index/unlike.png" mode=""></image>
  26. <view class="label">
  27. 点击收藏
  28. </view>
  29. </view>
  30. <view class="flex padding-tb-sm align-center">
  31. <view class="margin-right-xs text-bold" style="letter-spacing: 3rpx; font-size: 35rpx;">
  32. {{order.artificerName}}
  33. </view>
  34. <view class=" margin-right-xs text-26"
  35. style="color: #FF6E98;background: #FFECF2;border-radius:15rpx;border-radius: 32rpx;width: 152rpx;height: 48rpx;text-align: center;line-height: 48rpx;">
  36. 健康理疗师
  37. </view>
  38. </view>
  39. <view class="padding-bottom-sm flex justify-between">
  40. <view class="flex align-center">
  41. <view v-if="order.ordersScore" class="margin-right-sm">
  42. <!-- <image src="../../static/images/start.png" style="width: 24upx;height: 22upx;">
  43. </image>
  44. <text class="margin-left-xs">{{order.ordersScore}}</text> -->
  45. <text style="color: #FCAD3D;">{{order.ordersScore}}</text>
  46. <u-rate activeColor="#FCAD3D" size="20rpx" :count="5" v-model="order.ordersScore"></u-rate>
  47. </view>
  48. <view class="flex align-center" style="color: #AAA;">已服务: <view style="color: #FF6E98;">{{order.ordersCount}}单</view> </view>
  49. </view>
  50. </view>
  51. <view class="flex align-center padding-bottom">
  52. <image src="../../static/images/address.png" style="width: 40rpx;height: 40rpx;"></image>
  53. <view style="color: #222222;margin-left: 5rpx;">距离:{{order.distance}}</view>
  54. </view>
  55. <view class="padding-bottom" style="color: #AAAAAA;font-size: 22rpx;">
  56. {{order.content}}
  57. </view>
  58. <!-- <view class="padding-bottom flex justify-between">
  59. <view class=" margin-right-xs text-26"
  60. style="color: #2FB57A;background-color: #EDFAF7;border: 1rpx solid #05C25C;border-radius:15rpx;padding: 10rpx;">
  61. 健康理疗师
  62. </view>
  63. </view> -->
  64. <view class="flex align-center padding-tb-sm padding-lr"
  65. style="background: #EDFAF7;border-radius: 24rpx;">
  66. <view class="rir">
  67. <!-- 安心购 -->
  68. <image
  69. src="/static/image/text_axg.png"
  70. style="width: 87rpx;height:29rpx;"></image>
  71. </view>
  72. <view class="flex align-center" style="margin-right: 30upx;">
  73. <image src="../../static/images/index/renz1.png" style="width: 32upx;height: 28upx;"></image>
  74. <text class="margin-left-xs">实名认证</text>
  75. </view>
  76. <view class="flex align-center" style="margin-right: 30upx;">
  77. <image src="../../static/images/index/renz2.png" style="width:28upx;height: 33upx;"></image>
  78. <text class="margin-left-xs">资质认证</text>
  79. </view>
  80. <view class="flex align-center">
  81. <image src="../../static/images/index/renz3.png" style="width: 28upx;height: 32upx;"></image>
  82. <text class="margin-left-xs">平台担保</text>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- <view class="bg padding-lr padding-tb-sm margin-bottom-sm" style="margin-top: 20rpx;">
  88. <view class="text-bold" style="font-size: 35rpx;letter-spacing: 3rpx;">自我介绍</view>
  89. <view class="margin-top" style="color: #666666;font-size: 28rpx;">
  90. {{order.content}}
  91. </view>
  92. </view> -->
  93. <view class="padding bg" style="padding-bottom: 90px;">
  94. <u-tabs :list="tabs" :current="tabIndex" @change="tabChange" activeColor="#FF6E98" gutter="60">
  95. </u-tabs>
  96. <view style="border: 2upx solid #F5F5F2;position: relative;top: -8upx;"></view>
  97. <view v-if="fwIndex == 0&&XCXIsSelect !='否'" class="tab ">
  98. <view class="flex padding-tb" v-for="(item,index) in artificerlist" :key="index"
  99. @click="goNav(item.massageTypeId)">
  100. <image :src="item.massageImg" style="width: 210upx;height: 170upx;border-radius:10rpx"></image>
  101. <view class="margin-left-sm" style="width: 66%;">
  102. <view class="flex align-center justify-between" >
  103. <view class="text-bold text-lg">{{item.title}}</view>
  104. <view style="color: #AAA;">已售{{item.sales}}</view>
  105. </view>
  106. <view class=" text-df margin-tb-sm" style="color: #AAA;">
  107. <view>时长:{{item.duration}}分钟</view>
  108. </view>
  109. <view class="flex align-center justify-between">
  110. <view class="text-green text-df" style="color: #FF6E98;">
  111. ¥<text class="text-green text-xl text-bold"
  112. style="color: #FF6E98;">{{item.price}}</text>
  113. <text v-if="hyCheck != '否'">/</text><text v-if="hyCheck != '否'"
  114. class="text-sm">会员价:¥{{item.memberPrice}}</text>
  115. </view>
  116. <view class="btn">
  117. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  118. 下单</view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <view class=" padding u-skeleton-fillet" v-if="fwIndex == 1">
  124. <view v-if="commentList.length<=0" class="margin-top-sm"> 暂无评价</view>
  125. <view class="margin-bottom-sm padding-tb-sm" style="border-bottom: 1upx solid #f0f0f0;"
  126. v-for="(item, index) in commentList" :key='index' v-else>
  127. <view class="flex justify-between">
  128. <u-avatar src="/static/logo.png" size="48"></u-avatar>
  129. <view class="flex-sub margin-left-sm" style="line-height: 46upx;">匿名</view>
  130. <view class="flex">
  131. <u-icon v-for="ite in item.score" :key='ite' color="#FFAA01" name="star-fill"></u-icon>
  132. </view>
  133. </view>
  134. <view class="margin-top-sm text-lg">{{item.content}}</view>
  135. </view>
  136. </view>
  137. <view v-if="fwIndex == 2">
  138. <view class="flex justify-around flex-wrap" style="width: 100%;">
  139. <view class="flex flex-wrap" style="width: 100%;">
  140. <view style="width: 220rpx;height: 160rpx;margin-right: 10rpx;margin-top: 10rpx;"
  141. v-for="(item,index) in order.certificate" :key="index">
  142. <image :src="item" mode="aspectFit" style="width: 100%;height: 100%;"
  143. @click="saveImg(order.certificate,index)">
  144. </image>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. <!-- <view class="margin-top-sm bg radius u-skeleton-fillet" style="margin-bottom: 130rpx;">
  151. <view class="text-center padding text-bold" style="font-size: 35rpx;letter-spacing: 3rpx;">服务详情</view>
  152. <view v-for="(item,index) in order.lifePhoto" :key="index" style="width: 100%;"
  153. @click="saveImg(order.lifePhoto,index)">
  154. <image :src="item" style="width: 750upx;height: 963upx;" mode="widthFix"></image>
  155. </view>
  156. </view> -->
  157. <!-- <view class="u-skeleton-fillet text-lg cu-bar foot bg padding-lr" v-if="myId != order.userId">
  158. <view class="text-center"
  159. style="width: 665upx;line-height: 78upx;background: #2FB57A;border-radius:39upx;margin: 0 auto;"
  160. @click="follow">
  161. <image src="../../static/images/index/shoucang.png"
  162. style="width: 30upx;height: 28upx;position: relative;top: 4upx;"></image>
  163. <text style="color: #FFFFFF;margin-left: 10upx;" v-if="!isFollow">收藏</text>
  164. <text style="color: #FFFFFF;margin-left: 10upx;" v-else>已收藏</text>
  165. </view>
  166. </view> -->
  167. <!-- <u-picker v-model="show" mode="time" :params="params" @confirm="statusChange"></u-picker> -->
  168. <u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>
  169. </view>
  170. </template>
  171. <script>
  172. export default {
  173. data() {
  174. return {
  175. tripWay: 1,
  176. game: [],
  177. loading: true, // 是否显示骨架屏组件
  178. customStyle: {
  179. width: '400upx',
  180. color: '#FFFFFF',
  181. background: "#005DFF",
  182. border: 0
  183. },
  184. artificerId: '',
  185. orderDet: {},
  186. page: 1,
  187. limit: 10,
  188. order: {},
  189. commentList: [],
  190. isFollow: false,
  191. myId: '',
  192. isVip: false,
  193. AUDIO: uni.createInnerAudioContext(),
  194. isPlay: false,
  195. show: false,
  196. params: {
  197. year: false,
  198. month: true,
  199. day: true,
  200. hour: true,
  201. minute: true,
  202. second: true,
  203. timestamp: true
  204. },
  205. startTime: '',
  206. mobile: '',
  207. name: '',
  208. cityaddress: '',
  209. detailaddress: '',
  210. latitude: '',
  211. longitude: '',
  212. province: '',
  213. city: '',
  214. district: '',
  215. age: '',
  216. tabs: [{
  217. name: '项目',
  218. status: 0
  219. }, {
  220. name: '评价',
  221. status: 1
  222. }, {
  223. name: '资质证书',
  224. status: 2
  225. }],
  226. tabIndex: 0, // tab下标
  227. fwIndex: 0,
  228. artificerlist: [],
  229. latitude: '',
  230. longitude: '',
  231. imgArr: [],
  232. status: "",
  233. XCXIsSelect: '否',
  234. hyCheck: '否',
  235. imageHeight: '750'
  236. }
  237. },
  238. onLoad(option) {
  239. this.hyCheck = this.$queue.getData('hyCheck');
  240. uni.showLoading({
  241. title: '加载中...',
  242. });
  243. this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
  244. this.artificerId = option.artificerId
  245. this.myId = uni.getStorageSync('userId')
  246. this.isVip = uni.getStorageSync('isVIP')
  247. this.latitude = uni.getStorageSync('latitude')
  248. this.longitude = uni.getStorageSync('longitude')
  249. this.getDet()
  250. this.getordertherapist()
  251. this.getOrderComment()
  252. },
  253. onShow() {
  254. // this.imageHeight = this.$queue.getData('imageHeight');
  255. },
  256. onReady() {
  257. this.AUDIO.onEnded(function(res) {
  258. this.isPlay = false;
  259. });
  260. },
  261. methods: {
  262. // 切换菜单
  263. tabChange(index) {
  264. this.tabIndex = index
  265. this.fwIndex = index
  266. },
  267. //换算年龄
  268. getAge(e) {
  269. console.log('出生日期:' + e)
  270. this.birthDate = e
  271. //创建系统日期
  272. var today = new Date();
  273. //把出生日期转换成日期
  274. this.birthDate = new Date(this.birthDate);
  275. //分别获取到年份后相减
  276. this.age = today.getFullYear() - this.birthDate.getFullYear();
  277. // console.log(this.age+'当前年龄')
  278. },
  279. // 详情
  280. getDet() {
  281. // uni.showLoading({
  282. // title: '加载中...',
  283. // icon: 'none'
  284. // });
  285. this.$Request.get("/app/artificer/selectArtificerById", {
  286. artificerId: this.artificerId,
  287. latitude: this.latitude,
  288. longitude: this.longitude,
  289. userId: this.myId
  290. }).then(res => {
  291. uni.hideLoading();
  292. this.loading = false;
  293. if (res.code == 0) {
  294. this.order = res.data
  295. this.status = res.data.status
  296. this.tripWay = res.data.tripWay
  297. if (this.order.lifePhoto) {
  298. this.order.lifePhoto = this.order.lifePhoto.split(',')
  299. }
  300. this.order.certificate = this.order.certificate.split(',')
  301. if (this.order.distance > 1000) {
  302. this.order.distance = (this.order.distance / 1000).toFixed(1) + 'km'
  303. } else {
  304. this.order.distance = (this.order.distance).toFixed(1) + 'm'
  305. }
  306. if (res.data.collectCount == 1) {
  307. this.isFollow = true
  308. } else {
  309. this.isFollow = false
  310. }
  311. } else {
  312. this.loading = false;
  313. uni.hideLoading();
  314. }
  315. uni.hideLoading();
  316. });
  317. },
  318. //服务技师
  319. getordertherapist() {
  320. this.$Request.get("/app/artificer/selectArtificerMassageList", {
  321. artificerId: this.artificerId,
  322. status: 0,
  323. }).then(res => {
  324. if (res.code == 0) {
  325. this.artificerlist = res.data
  326. // this.commentList = [...this.commentList, ...res.data.list]
  327. }
  328. });
  329. },
  330. // 评价
  331. getOrderComment() {
  332. this.$Request.get("/app/takingComment/selectOrderTakingComment", {
  333. artificerId: this.artificerId,
  334. page: this.page,
  335. limit: this.limit
  336. }).then(res => {
  337. if (res.code == 0) {
  338. this.commentList = [...this.commentList, ...res.data.list]
  339. }
  340. });
  341. },
  342. playVoice() {
  343. console.log(this.isPlay)
  344. this.AUDIO.src = this.order.voiceIntroduce;
  345. if (this.isPlay) {
  346. this.AUDIO.stop();
  347. } else {
  348. this.AUDIO.play();
  349. }
  350. this.isPlay = !this.isPlay;
  351. },
  352. goNav(massageTypeId) {
  353. if (this.status == 2) {
  354. uni.showToast({
  355. title: '技师已下线',
  356. icon: 'none'
  357. })
  358. } else {
  359. uni.navigateTo({
  360. url: "/pages/index/order/orderDet?massageTypeId=" + massageTypeId + '&artificerId=' + this
  361. .artificerId + '&tripWay=' + this.tripWay
  362. })
  363. }
  364. },
  365. goMsg() {
  366. let data = {
  367. userId: this.myId,
  368. focusedUserId: this.order.userId
  369. }
  370. this.$Request.postJson('/app/chat/insertChatConversation ', data).then(res => {
  371. if (res.code == 0) {
  372. let id = this.order.userId == res.data.userId ? res.data.focusedUserId : this.order.userId
  373. uni.navigateTo({
  374. url: '/pages/msg/im?chatConversationId=' + res.data.chatConversationId +
  375. '&byUserId=' + id
  376. })
  377. }
  378. })
  379. },
  380. // 收藏
  381. follow() {
  382. let oldIsFollow = this.isFollow;
  383. let that = this
  384. let data = {
  385. artificerId: that.artificerId,
  386. userId: that.myId,
  387. classify: '1'
  388. }
  389. that.$Request.postJson("/app/artificer/insertCollect", data).then(res => {
  390. if (res.code == 0) {
  391. if (oldIsFollow) {
  392. uni.showToast({
  393. title: '取消成功',
  394. icon: 'none'
  395. })
  396. } else {
  397. uni.showToast({
  398. title: '收藏成功',
  399. icon: 'none'
  400. })
  401. }
  402. } else {
  403. uni.showToast({
  404. title: res.msg,
  405. icon: 'none'
  406. })
  407. }
  408. setTimeout(function() {
  409. that.getDet()
  410. }, 500)
  411. });
  412. },
  413. saveImg(imgs, index) {
  414. // console.log(imgs)
  415. let that = this;
  416. let imgArr = imgs
  417. // imgArr.push(imgs);
  418. // //预览图片
  419. uni.previewImage({
  420. urls: imgArr,
  421. current: imgArr[index]
  422. });
  423. },
  424. saveImgs(imgs, index) {
  425. console.log(imgs, index)
  426. // let that = this
  427. let imgArr = imgs
  428. // this.imgArr.push(imgs);
  429. // console.log(this.imgArr)
  430. // //预览图片
  431. uni.previewImage({
  432. urls: imgArr,
  433. current: imgArr[index]
  434. });
  435. },
  436. }
  437. }
  438. </script>
  439. <style lang="scss">
  440. page {
  441. background-color: #F7F7F7;
  442. }
  443. .bgs {
  444. background-color: #FFFFFF;
  445. }
  446. .bg {
  447. background-color: #FFFFFF;
  448. }
  449. .swiper-image {
  450. width: 100%;
  451. border-radius: 24upx;
  452. }
  453. .info-box{
  454. position: relative;
  455. z-index: 9;
  456. border-radius: 32rpx 32rpx 0rpx 0rpx;
  457. margin-top: -120rpx;
  458. background: #fff;
  459. padding: 0 32rpx 28rpx;
  460. position: relative;
  461. margin-bottom: 20rpx;
  462. .like-box{
  463. position: absolute;
  464. top: 28rpx;
  465. right: 32rpx;
  466. width: 120rpx;
  467. height: 80rpx;
  468. background: linear-gradient( 90deg, #FFFFFF 0%, #FFD1DF 100%);
  469. border-radius: 32rpx 32rpx 32rpx 32rpx;
  470. border: 1rpx solid #FF6E98;
  471. display: flex;
  472. flex-direction: column;
  473. align-items: center;
  474. justify-content: center;
  475. .icon{
  476. width: 30rpx;
  477. height: 30rpx;
  478. }
  479. .label{
  480. color: #FF6E98;
  481. font-size: 22rpx;
  482. }
  483. }
  484. .like-box.unlike-box {
  485. background: linear-gradient( 90deg, #FFFFFF 0%, #CCCCCC 100%);
  486. border-radius: 32rpx 32rpx 32rpx 32rpx;
  487. border: 1rpx solid #AAAAAA;
  488. .label{
  489. color: #AAAAAA;
  490. font-size: 22rpx;
  491. }
  492. }
  493. }
  494. .wrap {
  495. padding: 20upx 23upx;
  496. }
  497. .line_s {
  498. display: inline-flex;
  499. width: 14rpx;
  500. height: 14rpx;
  501. background: #1AD566;
  502. border-radius: 50%;
  503. margin-right: 10rpx;
  504. }
  505. .line_x {
  506. display: inline-flex;
  507. width: 14rpx;
  508. height: 14rpx;
  509. background: #000000;
  510. border-radius: 50%;
  511. margin-right: 10rpx;
  512. }
  513. .tab>view {
  514. border-bottom: 2upx solid #F5F5F2;
  515. }
  516. .tab>view:last-of-type {
  517. border: none;
  518. }
  519. .rir {
  520. font-size: 30upx;
  521. font-family: DFZongYi-Bd-80-Win-GB;
  522. font-weight: 800;
  523. color: #30B47A;
  524. margin-right: 30rpx;
  525. }
  526. .btn {
  527. width: 160rpx;
  528. height: 64rpx;
  529. background: linear-gradient( 313deg, #FFE6EE 0%, #FFBACA 100%);
  530. border-radius: 36rpx;
  531. font-weight: bold;
  532. font-size: 28rpx;
  533. color: #222222;
  534. text-align: center;
  535. line-height: 64rpx;
  536. position: relative;
  537. }
  538. .swiper {
  539. height: fit-content;
  540. }
  541. </style>