onlineBooking.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. <template>
  2. <view class="box">
  3. <view class="top">
  4. <view class="shopTop">
  5. <swiper class="swiper" circular :autoplay="true" :interval="interval" :duration="duration"
  6. v-if="shopInfo.imgs">
  7. <swiper-item v-for="(item,index) in shopInfo.imgs.split(',')" v-if="item">
  8. <view class="swiper-item">
  9. <img mode="aspectFit" :src="item" alt="">
  10. </view>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <!-- 门店详情 -->
  15. <view class="newshopNames" v-if="shopInfo">
  16. <view class="newshopDstop">
  17. <view class="newshopDname">{{shopInfo.shopName}}</view>
  18. <view v-if="(data.isShowScore == 1) || (data.isShowEvaluate == 1)" class="appraiseBox">
  19. <view v-if="data.isShowScore == 1" class="appraise">{{data.shopInfo.miniV2ShopScore?data.shopInfo.miniV2ShopScore:0}}
  20. <span style='font-size: 26rpx; margin-left: 3rpx;'>分</span>
  21. </view>
  22. <view v-if="data.isShowScore == 1" class="line"></view>
  23. <view @click="goShopAppraiseList()" v-if="data.isShowEvaluate == 1" class="appraiseCount">评价数
  24. {{data.evaluateCount?data.evaluateCount:0}}
  25. </view>
  26. <image v-if="data.isShowEvaluate == 1" class="rightArrow" src="../../static/timg/icon_arrow_right.png" mode=""></image>
  27. </view>
  28. <view class="newshopDtime">
  29. 营业时间: <span>{{shopInfo.startTime}} - {{shopInfo.endTime}}</span>
  30. </view>
  31. <view class="newshopDbqbox" v-if="shopInfo.brands">
  32. <view class="newshopDbqline" v-for="(item,index) in shopInfo.brands.split(',')">{{item}}</view>
  33. </view>
  34. </view>
  35. <view class="newshopDadressBpx">
  36. <view class="newshopDaleft">
  37. <view class="newshopDaleftTop">
  38. <!-- <img src="../../static/timg/icon_coordinate@2x.png" alt="" class="shopaddressIcon"> -->
  39. <!-- <span class="shopDdistance" v-if="Number(shopInfo.distance)>1">距离{{shopInfo.distance}}km</span>
  40. <span class="shopDdistance" v-else-if="Number(shopInfo.distance)">距离{{shopInfo.distance*1000}}m</span>
  41. <span class="shopDdistance" v-else>距离--km</span> -->
  42. </view>
  43. <view class="" style="display: flex;">
  44. <img src="../../static/timg/icon_coordinate@2x.png"
  45. style="margin-top: 24rpx;margin-right: 10rpx;" class="shopaddressIcon">
  46. <view class="newshopDadressName">
  47. {{shopInfo.address?shopInfo.address:'--'}}
  48. </view>
  49. </view>
  50. </view>
  51. <view class="newshopDaright">
  52. <view class="newshopDrline" @click="goLocation()">
  53. <img src="../../static/timg/icon_map@2x.png" alt="" class="newshopDrlineimg">
  54. <view class="newshopDrlineTxt">地图</view>
  55. </view>
  56. <view class="newshopDRsx"></view>
  57. <view class="newshopDrline" @click="phones()">
  58. <img src="../../static/timg/icon_phone@2x.png" alt="" class="newshopDrlineimg">
  59. <view class="newshopDrlineTxt">电话</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 预约详情-->
  66. <view class="yuyue-container">
  67. <view class="yuyueLeft">
  68. <view class="yuyueleftLine" v-for="(item,index) in leftData" @click="listItemWxInfo(item,index)"
  69. :class="{leftActive:leftIndex==index}">{{item.Name}}</view>
  70. </view>
  71. <view class="yuyueRight">
  72. <view class="yuyueRightTitle">{{rightTitle}}</view>
  73. <view v-for="(item,index) in rightData" @click="checkItem(item)"
  74. style="padding-top: 10rpx;padding-left: 24rpx;padding-right: 24rpx;">
  75. <view class="yrTop">
  76. <view class="ItemName">{{item.ItemName}}</view>
  77. <image src="../../static/timg/ickno.png" v-if="selectedItems.findIndex(i=>i.ID===item.ID)==-1"
  78. mode="" class="yrTopImg"></image>
  79. <image src="../../static/timg/icon_checked@2x.png"
  80. v-if="selectedItems.findIndex(i=>i.ID===item.ID)!=-1" mode="" class="yrTopImg"></image>
  81. </view>
  82. <view class="itemSm">
  83. {{item.Comment}}
  84. </view>
  85. <view class="Price">
  86. <view class="yuyue-price"> <span class="qianhaospan">¥</span> {{item.Price||'--'}} </view>
  87. </view>
  88. </view>
  89. <view class="nodataBox" v-if="rightData.length==0">
  90. <image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png"
  91. mode="widthFix" class="nodataImg"></image>
  92. <view class="noTxt">暂无数据</view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="bottom-container newbottom-container">
  97. <view class="newyyBox" @click="yuyueDetail">
  98. <view class="yyBleft">
  99. <img src="../../static/timg/icon_qingdan@2x.png" alt="" class="yyBleftimg">
  100. </view>
  101. <view>
  102. <view class="totalPriceBox"><span>预估总额:</span> <span class="totalPrice"><span
  103. class="qianhaospan">¥</span>{{totalPrice}}</span> </view>
  104. <span class="hejishul">合计数量: {{selectedItems.length}}</span>
  105. </view>
  106. </view>
  107. <view href="javascript:;" :style="{background:'#'+themeColor}" class=" newbottom-container-button"
  108. @click="yuyue">立即预约</view>
  109. </view>
  110. <view class="yydetailBox" v-if="yydetailShow" @click="yydetailShow=false">
  111. <view class="yyDetailTop" @click.stop="">
  112. <view class="yyDetailTopleft">清单</view>
  113. <view class="yyDetailTopRight">
  114. <view class="yydetalqk" @click="yyqingk">清空</view>
  115. <view class="yydetailx" @click="yydetailShow=false">X</view>
  116. </view>
  117. </view>
  118. <view class="yydetailCont" @click.stop="">
  119. <view class="yydetailContLine" v-for="(item,index) in selectedItems">
  120. <view class="yydlineName">{{item.ItemName}}</view>
  121. <view class="yydlineCommnt" v-if="true">{{item.Comment}}</view>
  122. <view class="yydPrice">¥{{item.Price}}</view>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </template>
  128. <script>
  129. export default {
  130. data() {
  131. return {
  132. interval: 3000,
  133. duration: 500,
  134. distance: 0.05,
  135. leftIndex: 0,
  136. yydetailShow: false,
  137. userInfo: '',
  138. bizTagId: '',
  139. leftData: '',
  140. rightData: '',
  141. rightTitle: '',
  142. selectedItems: [],
  143. location: {
  144. lng: '',
  145. lat: '',
  146. },
  147. shopInfo: '',
  148. naShopId: '',
  149. themeColor: '',
  150. data: {},
  151. }
  152. },
  153. onLoad(opt) {
  154. this.userInfo = uni.getStorageSync("userInfo");
  155. this.themeColor = uni.getStorageSync("themeColor");
  156. this.naShopId = opt.naShopId;
  157. if (this.naShopId == null || this.naShopId == 'null') {
  158. this.naShopId = ''
  159. }
  160. console.log(this.naShopId)
  161. var that = this;
  162. that.getInfo()
  163. //this.listBigTags()
  164. },
  165. computed: {
  166. totalPrice() {
  167. return this.selectedItems.reduce((i, k) => {
  168. return Number(i) + Number(k.Price)
  169. }, 0).toFixed(2)
  170. }
  171. },
  172. methods: {
  173. goShopAppraiseList() {
  174. uni.navigateTo({
  175. url: '../user/ShopAppraiseList?shopID=' + this.data.shopInfo.id
  176. // url: 'ShopAppraiseList?shopID=' + this.numList.shopInfo.id
  177. })
  178. },
  179. getInfo() {
  180. uni.showLoading({
  181. title: '加载中'
  182. })
  183. var that = this;
  184. this.$http('openreservation/getInfo', {
  185. lat: this.location.lat ? this.location.lat : '',
  186. lng: this.location.lng ? this.location.lng : '',
  187. shopId: this.naShopId,
  188. }, 'GET').then(res => {
  189. this.shopInfo = res.data.shopInfo;
  190. this.data = res.data;
  191. uni.setStorage({
  192. key: 'yyshopInfo',
  193. data: that.shopInfo,
  194. success: function() {
  195. }
  196. });
  197. this.listBigTags()
  198. })
  199. },
  200. listBigTags() {
  201. uni.showLoading({
  202. title: '加载中'
  203. });
  204. //openreservation/listBigTags
  205. this.$http('openreservation/listItemWxCategory', {
  206. shopId: this.shopInfo.id,
  207. unionId: this.userInfo.unionId
  208. }, 'GET').then(res => {
  209. uni.hideLoading();
  210. this.bizTagId = res.data[0].ID
  211. this.rightTitle = res.data[0].Name
  212. this.leftData = res.data;
  213. this.GetlistItemWxInfo()
  214. })
  215. },
  216. GetlistItemWxInfo() {
  217. //console.log("listItemWxInfo")
  218. uni.showLoading({
  219. title: '加载中'
  220. });
  221. console.log("bizTagId" + this.bizTagId)
  222. this.$http('openreservation/listItemWxInfo', {
  223. shopId: this.shopInfo.id,
  224. bizTagId: this.bizTagId
  225. }, 'GET').then(res => {
  226. //console.log(res)
  227. uni.hideLoading();
  228. // es.data.forEach(mode => {
  229. // mode.ck=false
  230. // })
  231. this.rightData = res.data
  232. console.log(this.rightData)
  233. })
  234. },
  235. checkItem(item) {
  236. let index = this.selectedItems.findIndex(i => i.ID === item.ID)
  237. if (index !== -1) {
  238. this.selectedItems.splice(index, 1)
  239. } else {
  240. this.selectedItems.push(item)
  241. }
  242. },
  243. goLocation() {
  244. var that = this;
  245. if (!that.shopInfo.lat || !that.shopInfo.lng) {
  246. uni.showToast({
  247. title: '该店铺未设置定位',
  248. icon: 'none',
  249. duration: 3000
  250. });
  251. } else {
  252. uni.openLocation({
  253. latitude: Number(that.shopInfo.lat),
  254. longitude: Number(that.shopInfo.lng),
  255. name: that.shopInfo.shopName,
  256. address: that.shopInfo.provinceName + that.shopInfo.cityName + that.shopInfo.areaName +
  257. that.shopInfo.address,
  258. success: function() {
  259. console.log('success');
  260. },
  261. fail(err) {
  262. console.log(err)
  263. }
  264. });
  265. }
  266. },
  267. phones() {
  268. uni.makePhoneCall({
  269. phoneNumber: this.shopInfo.mobilePhone
  270. });
  271. },
  272. listItemWxInfo(item, index) {
  273. console.log(item)
  274. this.leftIndex = index;
  275. this.bizTagId = item.ID
  276. if (item.ID == '') {
  277. this.bizTagId = ''
  278. }
  279. this.rightTitle = item.Name;
  280. this.GetlistItemWxInfo()
  281. },
  282. yuyueDetail() {
  283. this.yydetailShow = true;
  284. },
  285. yyqingk() {
  286. this.selectedItems = []
  287. },
  288. yuyue() {
  289. if (!this.selectedItems.length) {
  290. uni.showToast({
  291. title: '请选择预约项目',
  292. icon: 'none',
  293. duration: 3000
  294. });
  295. } else {
  296. this.$store.commit('mutationsyuyueData', this.selectedItems)
  297. uni.navigateTo({
  298. url: 'confirmYuyue'
  299. })
  300. }
  301. }
  302. }
  303. }
  304. </script>
  305. <style scoped lang="less">
  306. .nodataBox {
  307. text-align: center;
  308. }
  309. .nodataImg {
  310. width: 400rpx;
  311. padding-top: 100rpx;
  312. }
  313. .noTxt {
  314. font-size: 32rpx;
  315. color: #999999;
  316. padding-top: 50rpx;
  317. }
  318. .box {
  319. background: #F4F5F7;
  320. min-height: 100vh;
  321. }
  322. .swiper-item img {
  323. width: 750rpx;
  324. height: 500rpx;
  325. }
  326. .swiper-item {
  327. height: 500rpx;
  328. }
  329. .swiper {
  330. height: 500rpx;
  331. }
  332. .shopTop {
  333. height: 500rpx;
  334. }
  335. .newshopNames {
  336. width: 750rpx;
  337. background: #FFFFFF;
  338. border-radius: 10rpx;
  339. margin-top: -60rpx;
  340. position: relative;
  341. border-radius: 24rpx 24rpx 0px 0px;
  342. padding-bottom: 20rpx;
  343. }
  344. .newshopDname {
  345. color: #333333;
  346. font-size: 30rpx;
  347. padding-left: 20rpx;
  348. padding-top: 23rpx;
  349. font-weight: 500;
  350. }
  351. .newshopDtime {
  352. color: #999999;
  353. font-size: 24rpx;
  354. padding-left: 20rpx;
  355. padding-top: 10rpx;
  356. font-weight: 400;
  357. }
  358. .newshopDstop {
  359. padding-bottom: 21rpx;
  360. border-bottom: 1px solid #EEEEEE;
  361. }
  362. .newshopDetailtop {
  363. margin-bottom: 20rpx;
  364. }
  365. .newshopDbqbox {
  366. display: flex;
  367. flex-wrap: wrap;
  368. padding-left: 20rpx;
  369. }
  370. .newshopDbqline {
  371. line-height: 30rpx;
  372. height: 30rpx;
  373. border-radius: 4rpx;
  374. border: 1px solid #F19D01;
  375. color: #f19D01;
  376. font-size: 24rpx;
  377. padding: 0 8rpx;
  378. margin-right: 16rpx;
  379. margin-top: 10rpx;
  380. }
  381. .newshopDbqbox {
  382. padding-top: 5rpx;
  383. }
  384. .shopaddressIcon {
  385. width: 22rpx;
  386. height: 30rpx;
  387. }
  388. .shopDdistance {
  389. color: #3C3C3C;
  390. font-size: 24rpx;
  391. line-height: 30rpx;
  392. padding-left: 16rpx;
  393. font-weight: 500;
  394. }
  395. .newshopDaleftTop {
  396. display: flex;
  397. }
  398. .newshopDadressBpx {
  399. display: flex;
  400. padding: 20rpx 20rpx;
  401. background: url(http://dmsphoto.66km.com.cn/thFiles/010748B7-5678-46C3-941B-60B3CD4D10CB.png) no-repeat;
  402. background-size: 100% 100%;
  403. margin-left: 24rpx;
  404. }
  405. .newshopDadressName {
  406. color: #999999;
  407. padding-top: 16rpx;
  408. font-size: 24rpx;
  409. line-height: 36rpx;
  410. width: 480rpx;
  411. font-weight: 400;
  412. }
  413. .newshopDrlineimg {
  414. width: 44rpx;
  415. height: 44rpx;
  416. }
  417. .newshopDrlineTxt {
  418. color: #999999;
  419. font-size: 24rpx;
  420. text-align: center;
  421. padding-top: 7rpx;
  422. font-weight: 400;
  423. }
  424. .newright-item .yuyue-item {
  425. padding-top: 20rpx;
  426. }
  427. .newshopDRsx {
  428. width: 2rpx;
  429. height: 71rpx;
  430. background: #EEEEEE;
  431. }
  432. .newshopDaright {
  433. display: flex;
  434. justify-content: space-between;
  435. width: 150rpx;
  436. padding-left: 20rpx;
  437. }
  438. .yrTopImg {
  439. width: 36rpx;
  440. height: 36rpx;
  441. }
  442. .yuyue-container {
  443. display: flex;
  444. padding-bottom: 120rpx;
  445. min-height: 40vh;
  446. }
  447. .yuyueLeft {
  448. background: #F5F5F5;
  449. width: 154rpx;
  450. }
  451. .yuyueRight {
  452. width: 596rpx;
  453. background: #FFFFFF;
  454. }
  455. .yuyueleftLine {
  456. font-size: 26rpx;
  457. padding: 30rpx 24rpx;
  458. color: #3C3C3C;
  459. font-weight: 400;
  460. }
  461. .leftActive {
  462. background: #FFFFFF;
  463. font-weight: 500;
  464. }
  465. .yuyueRightTitle {
  466. color: #999999;
  467. font-size: 26rpx;
  468. background: #F9F9F9;
  469. padding-left: 24rpx;
  470. line-height: 62rpx;
  471. }
  472. .yrTop {
  473. display: flex;
  474. justify-content: space-between;
  475. }
  476. .ItemName {
  477. color: #3C3C3C;
  478. font-size: 28rpx;
  479. width: 480rpx;
  480. }
  481. .itemSm {
  482. color: #999999;
  483. line-height: 33rpx;
  484. font-size: 24rpx;
  485. text-overflow: -o-ellipsis-lastline;
  486. overflow: hidden;
  487. text-overflow: ellipsis;
  488. display: -webkit-box;
  489. -webkit-line-clamp: 2;
  490. line-clamp: 2;
  491. -webkit-box-orient: vertical;
  492. }
  493. .qianhaospan {
  494. font-size: 22rpx;
  495. }
  496. .yuyue-price {
  497. color: #FF3B30;
  498. font-size: 32rpx;
  499. padding-top: 8rpx;
  500. border-bottom: 1px solid #EEEEEE;
  501. padding-bottom: 19rpx;
  502. }
  503. .newbottom-container-button {
  504. width: 203rpx;
  505. height: 74rpx;
  506. background: #D53533;
  507. border-radius: 37rpx;
  508. color: #FEFFFE;
  509. font-size: 30rpx;
  510. line-height: 74rpx;
  511. text-align: center;
  512. }
  513. .newbottom-container {
  514. display: flex;
  515. justify-content: space-between;
  516. padding-left: 32rpx !important;
  517. width: 696rpx !important;
  518. z-index: 66;
  519. padding: 23rpx 32rpx !important;
  520. height: 76rpx !important;
  521. position: fixed;
  522. left: 0;
  523. bottom: 0;
  524. background: #FFFFFF;
  525. box-shadow: 0px -2px 10px 0px rgba(153, 153, 153, 0.1000);
  526. }
  527. .yuyue-main .newright-item {
  528. padding-bottom: 19rpx;
  529. }
  530. .yyBleftimg {
  531. width: 45rpx;
  532. height: 35rpx;
  533. margin-top: 2rpx;
  534. }
  535. .yyBleft {
  536. display: flex;
  537. align-items: center;
  538. padding-right: 33rpx;
  539. }
  540. .newyyBox {
  541. display: flex;
  542. }
  543. .newyyBox .totalPriceBox {
  544. line-height: 45rpx;
  545. color: #666666;
  546. font-size: 24rpx;
  547. font-weight: 500;
  548. }
  549. .newyyBox .totalPrice {
  550. color: #FF0000;
  551. font-size: 32rpx;
  552. }
  553. .hejishul {
  554. color: #999999;
  555. font-size: 24rpx;
  556. font-weight: 400;
  557. }
  558. .yydetailBox {
  559. position: fixed;
  560. bottom: 0;
  561. left: 0;
  562. height: 100vh;
  563. width: 100vw;
  564. background: rgba(0, 0, 0, 0.4);
  565. z-index: 6;
  566. }
  567. .yydetailCont {
  568. width: 100vw;
  569. height: calc(50vh + 2rpx);
  570. overflow-y: scroll;
  571. background: #F0F0F0;
  572. position: absolute;
  573. left: 0;
  574. bottom: 119rpx;
  575. }
  576. .yyDetailTop {
  577. width: 750rpx;
  578. height: 90rpx;
  579. background: #FFFFFF;
  580. border-radius: 24rpx 24rpx 0px 0px;
  581. position: absolute;
  582. left: 0;
  583. bottom: calc(50vh + 120rpx);
  584. display: flex;
  585. justify-content: space-between;
  586. }
  587. .yyDetailTopleft {
  588. color: #3C3C3C;
  589. font-size: 30rpx;
  590. line-height: 90rpx;
  591. padding-left: 24rpx;
  592. font-weight: 500;
  593. }
  594. .yyDetailTopRight {
  595. display: flex;
  596. padding-right: 24rpx;
  597. }
  598. .yydetailx {
  599. line-height: 90rpx;
  600. color: #999999;
  601. font-size: 30rpx;
  602. }
  603. .yydetalqk {
  604. width: 86rpx;
  605. height: 41rpx;
  606. background: #F4F5F7;
  607. border-radius: 21rpx;
  608. text-align: center;
  609. line-height: 41rpx;
  610. color: #666666;
  611. font-size: 24rpx;
  612. margin-top: 25rpx;
  613. margin-right: 38rpx;
  614. }
  615. .yydetailContLine {
  616. width: 702rpx;
  617. background: #FFFFFF;
  618. border-radius: 10rpx;
  619. margin-top: 20rpx;
  620. margin-left: 24rpx;
  621. padding: 24rpx 0px;
  622. }
  623. .yydlineName {
  624. color: #3C3C3C;
  625. font-size: 26rpx;
  626. padding-left: 24rpx;
  627. }
  628. .yydlineCommnt {
  629. color: #999999;
  630. font-size: 26rpx;
  631. padding-left: 22rpx;
  632. line-height: 30rpx;
  633. padding-top: 10rpx;
  634. }
  635. .yydPrice {
  636. padding-left: 22rpx;
  637. padding-top: 10rpx;
  638. color: #FF3B30;
  639. font-size: 32rpx;
  640. }
  641. .appraiseBox {
  642. padding: 5rpx 40rpx 5rpx 20rpx;
  643. margin-top: 10rpx;
  644. height: 62rpx;
  645. background: rgba(255, 0, 0, 0.08);
  646. border-radius: 0 25rpx 70rpx 0;
  647. width: 320rpx;
  648. display: flex;
  649. align-items: center;
  650. }
  651. .appraise {
  652. color: #FF0000;
  653. font-size: 38rpx;
  654. font-weight: bold;
  655. }
  656. .line {
  657. margin: 0 20rpx;
  658. width: 1rpx;
  659. height: 30rpx;
  660. background: #E9E8E8;
  661. }
  662. .appraiseCount {
  663. font-size: 24rpx;
  664. font-weight: 400;
  665. color: #666666;
  666. flex-grow: 1;
  667. }
  668. .rightArrow {
  669. width: 7rpx;
  670. height: 15rpx;
  671. margin-left: 32rpx;
  672. }
  673. </style>