onlineBooking.vue 13 KB

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