onlineBooking.vue 14 KB

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