orderDetail.vue 13 KB

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