onlineBooking.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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">
  26. <view class="newshopDstop">
  27. <view class="newshopDname">连锁一号</view>
  28. <view class="newshopDtime">
  29. 营业时间: <span>08:00 - 17:00</span>
  30. </view>
  31. <view class="newshopDbqbox" >
  32. <view class="newshopDbqline" v-for="(item,index) in 5">大众</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(distance)>1">距离{{distance}}km</span>
  40. <span class="shopDdistance" v-else-if="Number(distance)">距离{{distance*1000}}m</span>
  41. <span class="shopDdistance" v-else>距离--km</span>
  42. </view>
  43. <view class="newshopDadressName">金智源</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-show="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. }
  126. },
  127. onLoad() {
  128. this.userInfo = uni.getStorageSync("userInfo");
  129. this.listBigTags()
  130. },
  131. computed: {
  132. totalPrice () {
  133. return this.selectedItems.reduce((i, k) => {
  134. return Number(i) + Number(k.Price)
  135. }, 0).toFixed(2)
  136. }
  137. },
  138. methods: {
  139. listBigTags(){
  140. uni.showLoading({
  141. title: '加载中'
  142. });
  143. this.$http('openreservation/listBigTags', {
  144. shopId:this.userInfo.shopId,
  145. unionId:this.userInfo.unionId
  146. }, 'GET').then(res => {
  147. uni.hideLoading();
  148. this.bizTagId=res.data[0].ID
  149. this.rightTitle=res.data[0].Name
  150. this.leftData=res.data;
  151. this.GetlistItemWxInfo()
  152. //console.log(this.bizTagId)
  153. })
  154. },
  155. GetlistItemWxInfo(){
  156. //console.log("listItemWxInfo")
  157. uni.showLoading({
  158. title: '加载中'
  159. });
  160. console.log("bizTagId"+this.bizTagId)
  161. this.$http('openreservation/listItemWxInfo', {
  162. shopId:this.userInfo.shopId,
  163. bizTagId:this.bizTagId
  164. }, 'GET').then(res => {
  165. //console.log(res)
  166. uni.hideLoading();
  167. // es.data.forEach(mode => {
  168. // mode.ck=false
  169. // })
  170. this.rightData=res.data
  171. console.log(this.rightData)
  172. })
  173. },
  174. checkItem (item) {
  175. let index = this.selectedItems.findIndex(i => i.ID === item.ID)
  176. if (index !== -1) {
  177. this.selectedItems.splice(index, 1)
  178. } else {
  179. this.selectedItems.push(item)
  180. }
  181. },
  182. goLocation(){
  183. },
  184. phones(){
  185. },
  186. listItemWxInfo(item,index){
  187. console.log(item)
  188. this.leftIndex=index;
  189. this.bizTagId=item.ID
  190. if(item.ID==''){
  191. this.bizTagId=''
  192. }
  193. this.rightTitle=item.Name;
  194. this.GetlistItemWxInfo()
  195. },
  196. yuyueDetail(){
  197. this.yydetailShow=true;
  198. },
  199. yyqingk(){
  200. this.selectedItems = []
  201. },
  202. yuyue(){
  203. if (!this.selectedItems.length) {
  204. uni.showToast({
  205. title: '请选择预约项目',
  206. icon: 'none',
  207. duration: 3000
  208. });
  209. } else {
  210. this.$store.commit('mutationsyuyueData', this.selectedItems)
  211. uni.navigateTo({
  212. url:'confirmYuyue'
  213. })
  214. }
  215. }
  216. }
  217. }
  218. </script>
  219. <style scoped lang="less">
  220. .box{
  221. background: #F4F5F7;
  222. min-height: 100vh;
  223. }
  224. .swiper-item img{
  225. width: 750rpx;
  226. height: 500rpx;
  227. }
  228. .swiper-item{
  229. height: 500rpx;
  230. }
  231. .swiper{
  232. height: 500rpx;
  233. }
  234. .newshopNames{
  235. width: 702rpx;
  236. margin-left: 24rpx;
  237. background: #FFFFFF;
  238. border-radius: 10rpx;
  239. margin-top: -60rpx;
  240. position: relative;
  241. }
  242. .newshopDname{
  243. color: #333333;font-size: 30rpx;
  244. padding-left: 20rpx;
  245. padding-top: 23rpx;
  246. font-weight: 500;
  247. }
  248. .newshopDtime{
  249. color: #999999;
  250. font-size: 24rpx;
  251. padding-left: 20rpx;
  252. padding-top: 10rpx;
  253. font-weight: 400;
  254. }
  255. .newshopDstop{
  256. padding-bottom: 21rpx;
  257. border-bottom: 1px solid #EEEEEE;
  258. }
  259. .newshopDetailtop{
  260. margin-bottom: 20rpx;
  261. }
  262. .newshopDbqbox{
  263. display: flex;
  264. flex-wrap: wrap;
  265. padding-left: 20rpx;
  266. }
  267. .newshopDbqline{
  268. line-height: 30rpx;
  269. height: 30rpx;
  270. border-radius: 4rpx;
  271. border: 1px solid #FF7D30;
  272. color: #FF7D30;
  273. font-size: 22rpx;
  274. padding: 0 8rpx;
  275. margin-right: 16rpx;
  276. margin-top: 10rpx;
  277. }
  278. .newshopDbqbox{
  279. padding-top: 5rpx;
  280. }
  281. .shopaddressIcon{
  282. width: 22rpx;
  283. height: 30rpx;
  284. }
  285. .shopDdistance{
  286. color: #3C3C3C;font-size: 24rpx;line-height: 30rpx;padding-left: 16rpx;
  287. font-weight: 500;
  288. }
  289. .newshopDaleftTop{
  290. display: flex;
  291. }
  292. .newshopDadressBpx{
  293. display: flex;
  294. padding: 30rpx 20rpx;
  295. background: url(http://dmsphoto.66km.com.cn/thFiles/010748B7-5678-46C3-941B-60B3CD4D10CB.png) no-repeat;
  296. background-size: 100% 100%;
  297. }
  298. .newshopDadressName{
  299. color: #999999;padding-top: 16rpx;
  300. font-size: 24rpx;line-height: 24rpx;
  301. width: 480rpx;font-weight: 400;
  302. }
  303. .newshopDrlineimg{
  304. width: 44rpx;
  305. height: 44rpx;
  306. }
  307. .newshopDrlineTxt{
  308. color: #999999;
  309. font-size: 22rpx;
  310. text-align: center;
  311. padding-top: 7rpx;
  312. font-weight: 400;
  313. }
  314. .newright-item .yuyue-item{
  315. padding-top: 20rpx;
  316. }
  317. .newshopDRsx{
  318. width: 2rpx;
  319. height: 71rpx;
  320. background: #EEEEEE;
  321. }
  322. .newshopDaright{
  323. display: flex;
  324. justify-content: space-between;
  325. width: 150rpx;
  326. padding-left: 20rpx;
  327. }
  328. .yrTopImg{
  329. width: 36rpx;
  330. height: 36rpx;
  331. }
  332. .yuyue-container{
  333. display: flex;
  334. margin-top: 20rpx;
  335. padding-bottom: 120rpx;
  336. min-height: 40vh;
  337. }
  338. .yuyueLeft{
  339. background: #F5F5F5;
  340. width: 154rpx;
  341. }
  342. .yuyueRight{
  343. width: 548rpx;
  344. background: #FFFFFF;
  345. padding-left: 24rpx;
  346. padding-right: 24rpx;
  347. }
  348. .yuyueleftLine{
  349. font-size: 26rpx;
  350. padding:30rpx 24rpx;
  351. color: #3C3C3C;
  352. font-weight: 400;
  353. }
  354. .leftActive{
  355. background: #FFFFFF;
  356. font-weight: 500;
  357. }
  358. .yuyueRightTitle{
  359. color: #999999;font-size: 26rpx;
  360. padding: 30rpx 0;
  361. }
  362. .yrTop{
  363. display: flex;
  364. justify-content: space-between;
  365. }
  366. .ItemName{
  367. color: #3C3C3C;
  368. font-size: 28rpx;
  369. width: 480rpx;
  370. }
  371. .itemSm{
  372. color: #999999;
  373. line-height: 33rpx;
  374. font-size: 24rpx;
  375. text-overflow: -o-ellipsis-lastline;
  376. overflow: hidden;
  377. text-overflow: ellipsis;
  378. display: -webkit-box;
  379. -webkit-line-clamp: 2;
  380. line-clamp: 2;
  381. -webkit-box-orient: vertical;
  382. }
  383. .qianhaospan{
  384. font-size: 22rpx;
  385. }
  386. .yuyue-price{
  387. color: #FF3B30;
  388. font-size: 32rpx;
  389. padding-top: 8rpx;
  390. border-bottom: 1px solid #EEEEEE;
  391. padding-bottom: 19rpx;
  392. }
  393. .newbottom-container-button{
  394. width: 203rpx;
  395. height: 74rpx;
  396. background: #D53533;
  397. border-radius: 37rpx;
  398. color: #FEFFFE;
  399. font-size: 30rpx;
  400. line-height: 74rpx;
  401. text-align: center;
  402. }
  403. .newbottom-container{
  404. display: flex;
  405. justify-content: space-between;
  406. padding-left: 32rpx !important;
  407. width: 696rpx !important;
  408. z-index: 66;
  409. padding: 23rpx 32rpx !important;
  410. height: 76rpx !important;
  411. position: fixed;
  412. left: 0;
  413. bottom: 0;
  414. background: #FFFFFF;
  415. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.1000);
  416. }
  417. .yuyue-main .newright-item{
  418. padding-bottom: 19rpx;
  419. }
  420. .yyBleftimg{
  421. width: 45rpx;
  422. height: 35rpx;
  423. margin-top: 2rpx;
  424. }
  425. .yyBleft{
  426. display: flex;
  427. align-items: center;
  428. padding-right: 33rpx;
  429. }
  430. .newyyBox{
  431. display: flex;
  432. }
  433. .newyyBox .totalPriceBox{
  434. line-height: 45rpx;
  435. color: #666666;
  436. font-size: 24rpx;
  437. font-weight: 500;
  438. }
  439. .newyyBox .totalPrice{
  440. color: #F03B3B;
  441. font-size: 32rpx;
  442. }
  443. .hejishul{
  444. color: #999999;
  445. font-size: 24rpx;
  446. font-weight: 400;
  447. }
  448. .yydetailBox{
  449. position: fixed;
  450. bottom: 0;
  451. left: 0;
  452. height: 100vh;
  453. width: 100vw;
  454. background: rgba(0, 0, 0, 0.4);
  455. z-index: 6;
  456. }
  457. .yydetailCont{
  458. width: 100vw;
  459. height: 50vh;
  460. overflow-y: scroll;
  461. background: #F0F0F0;
  462. position: absolute;
  463. left: 0;
  464. bottom: 120rpx;
  465. }
  466. .yyDetailTop{
  467. width: 750rpx;
  468. height: 90rpx;
  469. background: #FFFFFF;
  470. border-radius: 24rpx 24rpx 0px 0px;
  471. position: absolute;
  472. left: 0;
  473. bottom: calc( 50vh + 120rpx);
  474. display: flex;
  475. justify-content: space-between;
  476. }
  477. .yyDetailTopleft{
  478. color: #3C3C3C;
  479. font-size: 30rpx;
  480. line-height: 90rpx;
  481. padding-left: 24rpx;
  482. }
  483. .yyDetailTopRight{
  484. display: flex;
  485. padding-right: 24rpx;
  486. }
  487. .yydetailx{
  488. line-height: 90rpx;
  489. color: #999999;
  490. font-size: 30rpx;
  491. }
  492. .yydetalqk{
  493. width: 86rpx;
  494. height: 41rpx;
  495. background: #EEEEEE;
  496. border-radius: 21rpx;
  497. text-align: center;
  498. line-height: 41rpx;
  499. color: #666666;
  500. font-size: 24rpx;
  501. margin-top: 25rpx;
  502. margin-right: 38rpx;
  503. }
  504. .yydetailContLine{
  505. width: 702rpx;
  506. background: #FFFFFF;
  507. border-radius: 10rpx;
  508. border: 1px solid #DDDDDD;
  509. margin-top: 20rpx;
  510. margin-left: 24rpx;
  511. padding: 24rpx 0px;
  512. }
  513. .yydlineName{
  514. color: #3C3C3C;
  515. font-size: 26rpx;
  516. padding-left: 24rpx;
  517. }
  518. .yydlineCommnt{
  519. color: #999999;
  520. font-size: 26rpx;
  521. padding-left: 22rpx;
  522. line-height: 30rpx;
  523. padding-top: 10rpx;
  524. }
  525. .yydPrice{
  526. padding-left: 22rpx;
  527. padding-top: 10rpx;
  528. color: #FF3B30;
  529. font-size: 32rpx;
  530. }
  531. </style>