onlineBooking.vue 14 KB

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