shoucang.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <view class="">
  3. <view style="padding-top: 1rpx;" v-if="orderList.length">
  4. <view class="flex align-center margin-bottom-sm bg padding-sm radius margin-sm"
  5. v-for="(item,index) in orderList" :key='index' @click="goOrderDetail(item)"
  6. style="box-shadow: 6rpx 10rpx 4px #F5F5F5;position: relative;">
  7. <view style="position: absolute;z-index: 99;top: 0rpx;left: 0;" v-if="item.isGoods == 1">
  8. <image
  9. src="/static/image/text_you.png"
  10. style="width: 42rpx;height: 36rpx;"></image>
  11. </view>
  12. <view style="width:160rpx;height:190upx;border-radius: 50%;display: flex;flex-direction: column;align-items: center;">
  13. <image :src="item.artificerImg?item.artificerImg: '../../static/logo.png'"
  14. @click.stop="saveImgs(item.artificerImg)"
  15. style="width: 160rpx;height: 160rpx;border-radius: 50%;" mode="aspectFill"></image>
  16. <image v-if="item.isHot == 1"
  17. src="/static/image/icon_fire.png"
  18. style="width: 30rpx;height: 36rpx;position: absolute;z-index: 99;top: 40rpx;left: 110rpx;">
  19. </image>
  20. <view class="kyy_view" v-if="item.state == 1">可服务</view>
  21. <view class="kfw_view" v-else-if="item.state == 2">可预约</view>
  22. <view class="byy_view" v-else>休息中</view>
  23. </view>
  24. <view class="margin-left flex flex-direction" style="width: 85%;">
  25. <view class="flex align-center justify-between">
  26. <view class="flex align-center">
  27. <view class="text-bold text-30 margin-right-xs jishi_name">{{item.artificerName}}</view>
  28. <!-- <image
  29. src="/static/image/icon_pao.png"
  30. style="width: 40rpx;height:40rpx;">
  31. </image> -->
  32. <view class="zpmore_view" v-if="item.lifePhoto" @click.stop="saveImgss(item.lifePhoto,0)">更多照片</view>
  33. </view>
  34. <view class="zz_view" v-if="item.status == 1 && item.time">
  35. <view class="zz_label">
  36. 最早可约
  37. </view>
  38. <view class="zz_value">
  39. {{item.time}}
  40. </view>
  41. </view>
  42. </view>
  43. <view class="flex justify-between " style="margin:15rpx 0rpx 20rpx">
  44. <view class="flex align-center">
  45. <view v-if="item.ordersScore" class="flex margin-right-sm">
  46. <text style="color: #FCAD3D;">{{item.ordersScore}}</text>
  47. <!-- <image src="../../static/images/start.png" style="width: 24upx;height: 22upx;"> -->
  48. <!-- </image> -->
  49. <u-rate activeColor="#FCAD3D" size="20rpx" :count="5" v-model="item.ordersScore"></u-rate>
  50. </view>
  51. <!-- <view style="color: #999999;">已服务:{{item.ordersCount}}单</view> -->
  52. </view>
  53. <!-- <view class="flex align-center" v-if="item.tripWay != 3">
  54. <image src="../../static/images/address.png" style="width: 24rpx;height: 29rpx;"></image>
  55. <view style="color: #333333;margin-left: 8rpx;">{{item.distance}}</view>
  56. </view> -->
  57. <view class="flex align-center" style="font-size: 26rpx;color: #f49650;font-weight: bold;" v-if="item.tripWay == 3">
  58. 免出行费
  59. </view>
  60. </view>
  61. <view class="flex align-center" style="color: #AAAAAA;font-size: 24rpx;">
  62. <view class="flex align-center" >已服务:
  63. <view style="color: #FF6E98;margin-left: 8rpx;">
  64. {{item.ordersCount}}单
  65. </view>
  66. </view>
  67. <view class="flex align-center" style="margin-left: 24rpx;" v-if="item.tripWay != 3">
  68. 距您
  69. <view style="color: #FF6E98;margin-left: 8rpx;">{{item.distance}}</view>
  70. </view>
  71. </view>
  72. <view style="width: 100%;display: flex;justify-content: space-between;align-items: center;"
  73. v-if="XCXIsSelect !='否'">
  74. <view class="flex flex-wrap align-center" style="margin-top: 10rpx;">
  75. <image
  76. src="/static/image/icon_shang.png"
  77. style="width: 24rpx;height: 24rpx;"></image>
  78. <view style="margin-left: 10rpx;color: #999;font-size: 24rpx;margin-right: 24rpx;">商家</view>
  79. <image
  80. src="/static/image/icon_ping.png"
  81. style="width: 24rpx;height: 24rpx;"></image>
  82. <view style="margin-left: 10rpx;color: #999;font-size: 24rpx;margin-right: 24rpx;">
  83. {{item.commentCount ? item.commentCount : 0}}
  84. </view>
  85. <image
  86. src="/static/image/icon_cang.png"
  87. style="width: 24rpx;height: 24rpx;"></image>
  88. <view style="margin-left: 10rpx;color: #999;font-size: 24rpx;">
  89. {{item.collectCount ? item.collectCount : 0}}
  90. </view>
  91. </view>
  92. <view class="text-center text-sm" v-if="item.status == 1"
  93. style="background: linear-gradient( 313deg, #FFE6EE 0%, #FFBACA 100%);color: #222222;width: 160rpx;border-radius: 36rpx;line-height: 64rpx;font-weight: bold;position: relative;"
  94. @click.stop="goOrder(item)">
  95. 立即预约
  96. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  97. </view>
  98. <view class="text-center text-sm" v-else
  99. style="background: #d9d9d9;color: #222222;width: 160rpx;border-radius: 36rpx;line-height: 64rpx;font-weight: bold;position: relative;">
  100. 立即预约
  101. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. <empty v-if="orderList.length == 0"></empty>
  108. <!-- <u-skeleton :loading="loading" :animation="true" elColor='#FFFFFF' bgColor='#FFFFFF'></u-skeleton> -->
  109. </view>
  110. </template>
  111. <script>
  112. import empty from '@/components/empty.vue'
  113. export default {
  114. components: {
  115. empty,
  116. },
  117. data() {
  118. return {
  119. loading: true, // 是否显示骨架屏组件
  120. game: [],
  121. orderList: [],
  122. isVip: false,
  123. myId: uni.getStorageSync('userId') ? uni.getStorageSync('userId') : '',
  124. showModal: true,
  125. arr: [],
  126. tab: '',
  127. massageTypeId: '',
  128. page: 1,
  129. limit: 10,
  130. latitude: '',
  131. XCXIsSelect:'否',
  132. longitude: ''
  133. }
  134. },
  135. onLoad(e) {
  136. let that = this
  137. that.XCXIsSelect = this.$queue.getData("XCXIsSelect");
  138. uni.getLocation({
  139. type: 'gcj02',
  140. geocode: true, //设置该参数为true可直接获取经纬度及城市信息
  141. success: function(res) {
  142. console.log(res, '地理位置')
  143. that.latitude = res.latitude
  144. that.longitude = res.longitude
  145. // uni.setStorageSync('latitude', res.latitude)
  146. // uni.setStorageSync('longitude', res.longitude)
  147. that.getData(that.latitude, that.longitude)
  148. },
  149. fail: function() {
  150. console.log('获取地址失败')
  151. }
  152. })
  153. },
  154. onShow() {
  155. if(this.latitude && this.longitude){
  156. this.getData(this.latitude, this.longitude)
  157. }
  158. },
  159. methods: {
  160. saveImgss(imgs, index) {
  161. console.log(imgs, index)
  162. // let that = this
  163. let imgArr = imgs
  164. // this.imgArr.push(imgs);
  165. // console.log(this.imgArr)
  166. // //预览图片
  167. uni.previewImage({
  168. urls: imgArr,
  169. current: imgArr[index]
  170. });
  171. },
  172. saveImgs(imgs) {
  173. let imgArr = [];
  174. imgArr.push(imgs);
  175. // //预览图片
  176. uni.previewImage({
  177. urls: imgArr,
  178. current: 0
  179. });
  180. },
  181. getData(latitude, longitude) {
  182. let data = {
  183. page: this.page,
  184. limit: this.limit,
  185. latitude: latitude,
  186. longitude: longitude,
  187. }
  188. this.$Request.get("/app/artificer/selectCollectList", data).then(res => {
  189. this.loading = false;
  190. if (res.code == 0) {
  191. for (var i = 0; i < res.data.list.length; i++) {
  192. if (res.data.list[i].distance > 1000) {
  193. res.data.list[i].distance = (res.data.list[i].distance / 1000).toFixed(1) +
  194. 'km'
  195. } else {
  196. res.data.list[i].distance = (res.data.list[i].distance).toFixed(1) + 'm'
  197. }
  198. if (res.data.list[i].lifePhoto) {
  199. res.data.list[i].lifePhoto = res.data.list[i].lifePhoto.split(',')
  200. }
  201. }
  202. if (this.page == 1) {
  203. this.orderList = res.data.list
  204. } else {
  205. this.orderList = [...this.orderList, ...res.data.list]
  206. }
  207. }
  208. }).catch(() => {
  209. //联网失败, 结束加载
  210. // this.mescroll.endErr();
  211. });
  212. },
  213. // 跳转订单
  214. goOrder(e) {
  215. let token = this.$queue.getData('token');
  216. if (token) {
  217. uni.navigateTo({
  218. url: "/pages/index/order/orderDet?artificerId=" + e.artificerId + '&massageTypeId=' + this
  219. .massageTypeId
  220. })
  221. } else {
  222. uni.navigateTo({
  223. url: '/pages/public/login'
  224. });
  225. }
  226. },
  227. goOrderDetail(e) {
  228. uni.navigateTo({
  229. url: "/pages/therapist/orderDetail?artificerId=" + e.artificerId + '&massageTypeId=' + this
  230. .massageTypeId
  231. })
  232. }
  233. },
  234. onReachBottom: function() {
  235. this.page = this.page + 1;
  236. this.getData(this.latitude, this.longitude)
  237. },
  238. onPullDownRefresh: function() {
  239. this.page = 1;
  240. this.getData(this.latitude, this.longitude)
  241. setTimeout(d => {
  242. uni.stopPullDownRefresh();
  243. }, 3000);
  244. },
  245. }
  246. </script>
  247. <style lang="scss">
  248. page {
  249. background-color: #F7F7F7;
  250. }
  251. .zz_view {
  252. display: flex;
  253. line-height: 40rpx;
  254. text-align: center;
  255. font-size: 24rpx;
  256. .zz_label{
  257. width: 120rpx;
  258. background: #4B2F20;
  259. border-radius: 32rpx 0 0 32rpx;
  260. color: #FFFFFF;
  261. }
  262. .zz_value{
  263. width: 88rpx;
  264. border-radius: 0 32rpx 32rpx 0;
  265. background: #EECEAC;
  266. color: #4B2F20;
  267. }
  268. }
  269. .zpmore_view {
  270. background: #07BF89;
  271. width: 128rpx;
  272. height: 40rpx;
  273. text-align: center;
  274. border-radius: 32rpx;
  275. line-height: 40rpx;
  276. font-size: 24rpx;
  277. color: #FFFFFF;
  278. margin-left: 10rpx;
  279. }
  280. .byy_view {
  281. background: #ebebeb;
  282. width: 120upx;
  283. text-align: center;
  284. border-radius: 50rpx;
  285. height: 46rpx;
  286. line-height: 46rpx;
  287. font-size: 24rpx;
  288. color: #000000;
  289. // border: 3upx solid #999999;
  290. margin-top: 6rpx;
  291. }
  292. .kfw_view {
  293. background: #ffaa00;
  294. width: 120upx;
  295. text-align: center;
  296. border-radius: 50rpx;
  297. height: 46rpx;
  298. line-height: 46rpx;
  299. font-size: 24rpx;
  300. color: #FFFFFF;
  301. margin-top: 6rpx;
  302. }
  303. .kyy_view {
  304. background: #DCFFEA;
  305. width: 120upx;
  306. text-align: center;
  307. border-radius: 36rpx;
  308. height: 40rpx;
  309. line-height: 40rpx;
  310. font-size: 24rpx;
  311. color: #54CC84;
  312. }
  313. .kyy_view,.kfw_view,.byy_view{
  314. margin-top: -10rpx;
  315. z-index: 9;
  316. }
  317. .bg {
  318. background: #FFFFFF;
  319. }
  320. .ytp_view {
  321. background: #e3e3e3;
  322. width: 400rpx;
  323. border-radius: 10rpx;
  324. font-size: 28rpx;
  325. text-align: center;
  326. height: 80rpx;
  327. line-height: 80rpx;
  328. color: #848484;
  329. margin-top: 40rpx;
  330. }
  331. .tp_view {
  332. background: #ee6c54;
  333. width: 400rpx;
  334. border-radius: 10rpx;
  335. font-size: 28rpx;
  336. text-align: center;
  337. height: 80rpx;
  338. line-height: 80rpx;
  339. color: #FFFFFF;
  340. margin-top: 40rpx;
  341. }
  342. .sticky-tabs {
  343. z-index: 990;
  344. position: sticky;
  345. top: var(--window-top);
  346. // background-color: #fff;
  347. }
  348. /* // 使用mescroll-uni,则top为0 */
  349. .mescroll-uni,
  350. /deep/.mescroll-uni {
  351. .sticky-tabs {
  352. top: 0;
  353. }
  354. }
  355. .demo-tip {
  356. padding: 18upx;
  357. font-size: 24upx;
  358. text-align: center;
  359. }
  360. .line_s {
  361. display: inline-flex;
  362. width: 10rpx;
  363. height: 10rpx;
  364. background: #1AD566;
  365. border-radius: 50%;
  366. margin-right: 10rpx;
  367. }
  368. .line_x {
  369. display: inline-flex;
  370. width: 10rpx;
  371. height: 10rpx;
  372. background: #000000;
  373. border-radius: 50%;
  374. margin-right: 10rpx;
  375. }
  376. .box {
  377. // border: 3rpx solid #005dff;
  378. background: #E8FAE1;
  379. color: #2FB57A;
  380. padding: 5rpx 15rpx;
  381. font-size: 26rpx;
  382. letter-spacing: 2rpx;
  383. border-radius: 8rpx;
  384. // margin-top: 10rpx;
  385. margin-right: 8upx;
  386. }
  387. .actve {
  388. font-size: 30rpx;
  389. font-family: PingFang SC;
  390. font-weight: 800;
  391. color: #20C675;
  392. }
  393. .tabview1 {
  394. padding: 20rpx 20rpx;
  395. // width: 686upx;
  396. // height: 100upx;
  397. background: #FFFFFF;
  398. // margin-top: -50upx;
  399. // z-index: 99;
  400. // display: flex;
  401. // line-height: 100upx;
  402. .tabview {
  403. // width: 686upx;
  404. // // height: 100upx;
  405. background: #F2FFF9;
  406. border-radius: 24rpx 24rpx 0 0;
  407. // margin-top: -50upx;
  408. // z-index: 99;
  409. display: flex;
  410. line-height: 100upx;
  411. .tabItem_sel {
  412. font-size: 30upx;
  413. font-family: PingFang SC;
  414. font-weight: 800;
  415. color: #20C675;
  416. flex: 1;
  417. text-align: center;
  418. }
  419. .tabItem {
  420. font-size: 26upx;
  421. font-family: PingFang SC;
  422. font-weight: 500;
  423. color: #333333;
  424. flex: 1;
  425. text-align: center;
  426. }
  427. }
  428. .tabsx {
  429. width: 686upx;
  430. border-radius: 24rpx;
  431. padding-bottom: 10rpx;
  432. display: flex;
  433. align-items: center;
  434. justify-content: space-between;
  435. padding: 20rpx 30rpx;
  436. font-size: 26rpx;
  437. .active {
  438. color: #20C675;
  439. font-size: 30rpx;
  440. font-weight: bold;
  441. }
  442. }
  443. }
  444. </style>