|
357 | 357 | created(){
|
358 | 358 | this.geohash = this.$route.query.geohash;
|
359 | 359 | this.shopId = this.$route.query.id;
|
360 |
| - //初始化购物车,获取存储在localStorage中的购物车商品信息 |
361 | 360 | this.INIT_BUYCART();
|
362 | 361 | },
|
363 | 362 | mounted(){
|
364 |
| - //初始化数据 |
365 | 363 | this.initData();
|
366 | 364 | this.windowHeight = window.innerHeight;
|
367 | 365 | },
|
|
375 | 373 | ...mapState([
|
376 | 374 | 'latitude','longitude','cartList'
|
377 | 375 | ]),
|
378 |
| - //商铺公告 |
379 | 376 | promotionInfo: function (){
|
380 | 377 | return this.shopDetailData.promotion_info || '欢迎光临,用餐高峰期请提前下单,谢谢。'
|
381 | 378 | },
|
382 |
| - //配送费 |
383 | 379 | deliveryFee: function () {
|
384 | 380 | if (this.shopDetailData) {
|
385 | 381 | return this.shopDetailData.float_delivery_fee;
|
|
458 | 454 | click: true,
|
459 | 455 | });
|
460 | 456 |
|
461 |
| - //判断scrollTop的值,则满足条件,改变对应列表标题样式 |
462 | 457 | this.foodScroll.on('scroll', (pos) => {
|
463 | 458 | this.shopListTop.forEach((item, index) => {
|
464 | 459 | if (this.menuIndexChange && Math.abs(Math.round(pos.y)) >= item) {
|
|
481 | 476 | this.menuIndexChange = true;
|
482 | 477 | })
|
483 | 478 | },
|
484 |
| - //控制显示列表标题详情提示 |
485 | 479 | showTitleDetail(index){
|
486 | 480 | if (this.TitleDetailIndex == index) {
|
487 | 481 | this.TitleDetailIndex = null;
|
|
606 | 600 | this.ADD_CART({shopid: this.shopId, category_id, item_id, food_id, name, price, specs, packing_fee, sku_id, stock});
|
607 | 601 | this.showChooseList();
|
608 | 602 | },
|
609 |
| - //点击多规格商品的减按钮,弹出提示 |
610 | 603 | showReduceTip(){
|
611 | 604 | this.showDeleteTip = true;
|
612 | 605 | clearTimeout(this.timer);
|
|
630 | 623 | el.children[0].style.transform = `translate3d(0,0,0)`;
|
631 | 624 | el.style.transition = 'transform .55s cubic-bezier(0.3, -0.25, 0.7, -0.15)';
|
632 | 625 | el.children[0].style.transition = 'transform .55s linear';
|
633 |
| - //圆点到达目标点后移出 |
634 | 626 | this.showMoveDot = this.showMoveDot.map(item => false);
|
635 | 627 | el.children[0].style.opacity = 1;
|
636 |
| - //监听运动结束,通知父级进行后续操作 |
637 | 628 | el.children[0].addEventListener('transitionend', () => {
|
638 | 629 | this.listenInCart();
|
639 | 630 | })
|
|
0 commit comments