|
27 | 27 | <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#arrow-left"></use>
|
28 | 28 | </svg>
|
29 | 29 | </footer>
|
30 |
| - |
| 30 | + |
31 | 31 | </section>
|
32 | 32 | </header>
|
33 | 33 | <transition name="fade">
|
|
55 | 55 | <line x1="22" y1="22" x2="38" y2="38" style="stroke:#999;stroke-width:2"/>
|
56 | 56 | </svg>
|
57 | 57 | </section>
|
58 |
| - </transition> |
| 58 | + </transition> |
59 | 59 | <section class="change_show_type" ref="chooseType">
|
60 | 60 | <div>
|
61 | 61 | <span :class='{activity_show: changeShowType =="food"}' @click="changeShowType='food'">商品</span>
|
62 | 62 | </div>
|
63 | 63 | <div>
|
64 |
| - <span :class='{activity_show: changeShowType =="rating"}' @click="changeShowType='rating'">评价</span> |
| 64 | + <span :class='{activity_show: changeShowType =="rating"}' @click="changeShowType='rating'">评价</span> |
65 | 65 | </div>
|
66 | 66 | </section>
|
67 | 67 | <transition name="fade-choose">
|
68 | 68 | <section v-show="changeShowType =='food'" class="food_container">
|
69 | 69 | <section class="menu_container">
|
70 |
| - <section class="menu_left" id="wrapper_menu"> |
| 70 | + <section class="menu_left" id="wrapper_menu" ref="wrapperMenu"> |
71 | 71 | <ul>
|
72 | 72 | <li v-for="(item,index) in menuList" :key="index" class="menu_left_li" :class="{activity_menu: index == menuIndex}" @click="chooseMenu(index)">
|
73 | 73 | <img :src="getImgPath(item.icon_url)" v-if="item.icon_url">
|
|
103 | 103 | <p :style="{color: attribute.icon_name == '新'? '#fff' : '#' + attribute.icon_color}">{{attribute.icon_name == '新'? '新品':attribute.icon_name}}</p>
|
104 | 104 | </li>
|
105 | 105 | </ul>
|
106 |
| - |
| 106 | + |
107 | 107 | </h3>
|
108 | 108 | <p class="food_description_content">{{foods.description}}</p>
|
109 | 109 | <p class="food_description_sale_rating">
|
|
195 | 195 | <section class="rating_container" id="ratingContainer" v-show="changeShowType =='rating'">
|
196 | 196 | <section v-load-more="loaderMoreRating" type="2">
|
197 | 197 | <section>
|
198 |
| - |
| 198 | + |
199 | 199 | <header class="rating_header">
|
200 | 200 | <section class="rating_header_left">
|
201 | 201 | <p>{{shopDetailData.rating}}</p>
|
|
215 | 215 | </p>
|
216 | 216 | <p>
|
217 | 217 | <span>送达时间</span>
|
218 |
| - <span class="delivery_time">{{shopDetailData.order_lead_time}}分钟</span> |
| 218 | + <span class="delivery_time">{{shopDetailData.order_lead_time}}分钟</span> |
219 | 219 | </p>
|
220 | 220 | </section>
|
221 | 221 | </header>
|
|
248 | 248 | </ul>
|
249 | 249 | </section>
|
250 | 250 | </li>
|
251 |
| - </ul> |
| 251 | + </ul> |
252 | 252 | </section>
|
253 | 253 | </section>
|
254 | 254 | </section>
|
|
288 | 288 | <transition name="fade">
|
289 | 289 | <p class="show_delete_tip" v-if="showDeleteTip">多规格商品只能去购物车删除哦</p>
|
290 | 290 | </transition>
|
291 |
| - <transition |
| 291 | + <transition |
292 | 292 | appear
|
293 | 293 | @after-appear = 'afterEnter'
|
294 | 294 | @before-appear="beforeEnter"
|
|
375 | 375 | ...mapState([
|
376 | 376 | 'latitude','longitude','cartList'
|
377 | 377 | ]),
|
378 |
| - promotionInfo: function (){ |
| 378 | + promotionInfo: function (){ |
379 | 379 | return this.shopDetailData.promotion_info || '欢迎光临,用餐高峰期请提前下单,谢谢。'
|
380 | 380 | },
|
381 | 381 | //配送费
|
382 |
| - deliveryFee: function () { |
| 382 | + deliveryFee: function () { |
383 | 383 | if (this.shopDetailData) {
|
384 | 384 | return this.shopDetailData.float_delivery_fee;
|
385 | 385 | }else{
|
386 | 386 | return null;
|
387 | 387 | }
|
388 | 388 | },
|
389 | 389 | //还差多少元起送,为负数时显示去结算按钮
|
390 |
| - minimumOrderAmount: function () { |
| 390 | + minimumOrderAmount: function () { |
391 | 391 | if (this.shopDetailData) {
|
392 | 392 | return this.shopDetailData.float_minimum_order_amount - this.totalPrice;
|
393 | 393 | }else{
|
|
448 | 448 | listenScroll(element){
|
449 | 449 | let oldScrollTop;
|
450 | 450 | let requestFram;
|
451 |
| - this.foodScroll = new BScroll(element, { |
| 451 | + this.foodScroll = new BScroll(element, { |
452 | 452 | probeType: 3,
|
453 | 453 | deceleration: 0.001,
|
454 | 454 | bounce: false,
|
455 | 455 | swipeTime: 2000,
|
456 | 456 | click: true,
|
457 |
| - }); |
458 |
| - |
| 457 | + }); |
| 458 | +
|
459 | 459 | this.wrapperMenu = new BScroll('#wrapper_menu', {
|
460 | 460 | click: true,
|
461 | 461 | });
|
462 | 462 |
|
463 | 463 | this.foodScroll.on('scroll', (pos) => {
|
464 |
| - this.shopListTop.forEach((item, index) => { |
| 464 | + this.shopListTop.forEach((item, index) => { |
465 | 465 | if (this.menuIndexChange && Math.abs(Math.round(pos.y)) >= item) {
|
466 | 466 | this.menuIndex = index;
|
467 | 467 | }
|
468 | 468 | })
|
| 469 | + let wrapMenuHeight = this.$refs.wrapperMenu.clientHeight; |
| 470 | + let menuList=this.$refs.wrapperMenu.querySelectorAll('.activity_menu'); |
| 471 | + let el = menuList[0]; |
| 472 | + this.wrapperMenu.scrollToElement(el, 800); |
469 | 473 | })
|
470 | 474 | },
|
471 | 475 | //控制活动详情页的显示隐藏
|
|
503 | 507 | initCategoryNum(){
|
504 | 508 | let newArr = [];
|
505 | 509 | let cartFoodNum = 0;
|
506 |
| - this.totalPrice = 0; |
| 510 | + this.totalPrice = 0; |
507 | 511 | this.cartFoodList = [];
|
508 | 512 | this.menuList.forEach((item, index) => {
|
509 | 513 | if (this.shopCart&&this.shopCart[item.foods[0].category_id]) {
|
|
728 | 732 | left: 0;
|
729 | 733 | height: 100%;
|
730 | 734 | }
|
731 |
| - |
| 735 | +
|
732 | 736 | .shop_detail_header{
|
733 | 737 | overflow: hidden;
|
734 | 738 | position: relative;
|
|
868 | 872 | @include cl;
|
869 | 873 | }
|
870 | 874 | }
|
871 |
| - |
| 875 | +
|
872 | 876 | .food_container{
|
873 | 877 | display: flex;
|
874 | 878 | flex: 1;
|
|
878 | 882 | display: flex;
|
879 | 883 | flex: 1;
|
880 | 884 | overflow-y: hidden;
|
| 885 | + position: relative; |
881 | 886 | .menu_left{
|
882 | 887 | background-color: #f8f8f8;
|
883 | 888 | width: 3.8rem;
|
|
979 | 984 | padding: .6rem .4rem;
|
980 | 985 | border-bottom: 1px solid #f8f8f8;
|
981 | 986 | position: relative;
|
982 |
| - overflow: hidden; |
| 987 | + overflow: hidden; |
983 | 988 | .menu_detail_link{
|
984 | 989 | display:flex;
|
985 | 990 | .menu_food_img{
|
|
1139 | 1144 | margin-bottom: .1rem;
|
1140 | 1145 | }
|
1141 | 1146 | div:nth-of-type(2){
|
1142 |
| - font-size: .4rem; |
| 1147 | + font-size: .4rem; |
1143 | 1148 | }
|
1144 | 1149 | }
|
1145 | 1150 | }
|
|
1509 | 1514 | position: fixed;
|
1510 | 1515 | bottom: 30px;
|
1511 | 1516 | left: 30px;
|
1512 |
| - |
| 1517 | +
|
1513 | 1518 | svg{
|
1514 | 1519 | @include wh(.9rem, .9rem);
|
1515 | 1520 | fill: #3190e8;
|
|
0 commit comments