shop.vue 30.1 KB
Newer Older
M
maguohua 已提交
1
 <template>
M
maguohua 已提交
2 3
    <div class="shop_container">
        <header class="shop_detail_header" v-if="!showLoading" ref="shopheader">
M
maguohua 已提交
4 5
            <img :src="getImgPath(shopDetailData.image_path)" class="header_cover_img">
            <section class="description_header">
M
maguohua 已提交
6
                <section class="description_top" @click="showActivitiesFun">
M
maguohua 已提交
7 8 9 10 11 12
                    <section class="description_left">
                        <img :src="getImgPath(shopDetailData.image_path)">
                    </section>
                    <section class="description_right">
                        <h4 class="description_title ellipsis">{{shopDetailData.name}}</h4>
                        <p class="description_text">商家配送/{{shopDetailData.order_lead_time}}分钟送达/配送费¥{{shopDetailData.float_delivery_fee}}</p>
M
maguohua 已提交
13
                        <p class="description_promotion ellipsis">公告:{{promotionInfo}}</p>
M
maguohua 已提交
14
                    </section>
M
maguohua 已提交
15 16 17
                    <svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" version="1.1" class="description_arrow" >
                        <path d="M0 0 L8 7 L0 14"  stroke="#fff" stroke-width="1" fill="none"/>
                    </svg>
M
maguohua 已提交
18
                </section>
M
maguohua 已提交
19
                <footer class="description_footer" v-if="shopDetailData.activities.length" @click="showActivitiesFun">
M
maguohua 已提交
20 21 22 23 24 25
                    <p class="ellipsis">
                        <span class="tip_icon" :style="{backgroundColor: '#' + shopDetailData.activities[0].icon_color, borderColor: '#' + shopDetailData.activities[0].icon_color}">{{shopDetailData.activities[0].icon_name}}</span>
                        <span>{{shopDetailData.activities[0].description}}(APP专享)</span>
                    </p>
                    <p>{{shopDetailData.activities.length}}个活动</p>
                </footer>
M
maguohua 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
                <transition name="fadeactivities">
                    <section class="activities_details" v-if="showActivities">
                        <h2 class="activities_shoptitle">{{shopDetailData.name}}</h2>
                        <h3 class="activities_ratingstar">
                            <rating-star :rating='shopDetailData.rating'></rating-star>
                        </h3>
                        <section class="activities_list">
                            <header class="activities_title_style"><span>优惠信息</span></header>
                            <ul>
                                <li v-for="item in shopDetailData.activities" :key="item.id">
                                    <span class="activities_icon" :style="{backgroundColor: '#' + item.icon_color, borderColor: '#' + item.icon_color}">{{item.icon_name}}</span>
                                    <span>{{item.description}}(APP专享)</span>
                                </li>
                            </ul>
                        </section>
                        <section class="activities_shopinfo">
                            <header class="activities_title_style"><span>商家公告</span></header>
M
maguohua 已提交
43
                            <p>{{promotionInfo}}</p>
M
maguohua 已提交
44 45 46 47 48 49 50 51
                        </section>
                        <svg width="60" height="60" class="close_activities" @click.stop="showActivitiesFun">
                            <circle cx="30" cy="30" r="25" stroke="#555" stroke-width="1" fill="none"/>
                            <line x1="22" y1="38" x2="38" y2="22" style="stroke:#999;stroke-width:2"/>
                            <line x1="22" y1="22" x2="38" y2="38" style="stroke:#999;stroke-width:2"/>
                        </svg>
                    </section>
                </transition>  
M
maguohua 已提交
52 53
            </section>
        </header>
M
maguohua 已提交
54 55 56 57 58
        <section class="menu_container" v-if="!showLoading">
            <ul class="menu_left">
                <li v-for="(item,index) in menuList" :key="index" class="menu_left_li" :class="{activity_menu: index == menuIndex}" @click="chooseMenu(index)">
                    <img :src="getImgPath(item.icon_url)" v-if="item.icon_url">
                    <span>{{item.name}}</span>
M
maguohua 已提交
59
                    <span class="category_num" v-if="categoryNum[index]">{{categoryNum[index]}}</span>
M
maguohua 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
                </li>
            </ul>
            <ul class="menu_right" ref="menuFoodList">
                <li v-for="(item,index) in menuList" :key="index">
                    <header class="menu_detail_header">
                        <section class="menu_detail_header_left">
                            <strong class="menu_item_title">{{item.name}}</strong>
                            <span class="menu_item_description">{{item.description}}</span>
                        </section>
                        <span class="menu_detail_header_right" @click="showTitleDetail(index)"></span>
                        <transition name="fade_title">
                            <p class="description_tip" v-show="index == TitleDetailIndex">
                                <span>{{item.name}}</span>
                                {{item.description}}
                            </p>
                        </transition>
                    </header>
M
maguohua 已提交
77
                    <section v-for="(foods,foodindex) in item.foods" :key="foodindex" class="menu_detail_list">
M
maguohua 已提交
78 79 80 81 82 83 84 85
                        <router-link to="/shop/rating" tag="div" class="menu_detail_link">
                            <section class="menu_food_img">
                                <img :src="getImgPath(foods.image_path)">
                            </section>
                            <section class="menu_food_description">
                                <h3 class="food_description_head">
                                    <strong class="description_foodname">{{foods.name}}</strong>
                                    <ul v-if="foods.attributes.length" class="attributes_ul">
M
maguohua 已提交
86
                                        <li v-for="(attribute, foodindex) in foods.attributes" :key="foodindex" :style="{color: '#' + attribute.icon_color,borderColor:'#' +attribute.icon_color}" :class="{attribute_new: attribute.icon_name == '新'}">
M
maguohua 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
                                        <p :style="{color: attribute.icon_name == '新'? '#fff' : '#' + attribute.icon_color}">{{attribute.icon_name == ''? '新品':attribute.icon_name}}</p>
                                        </li>
                                    </ul>
                                    
                                </h3>
                                <p class="food_description_content">{{foods.description}}</p>
                                <p class="food_description_sale_rating">
                                    <span>月售{{foods.month_sales}}</span>
                                    <span>好评率{{foods.satisfy_rate}}%</span>
                                </p>
                                <p v-if="foods.activity" class="food_activity">
                                <span :style="{color: '#' + foods.activity.image_text_color,borderColor:'#' +foods.activity.icon_color}">{{foods.activity.image_text}}</span>
                                </p>
                            </section>
                        </router-link>
                        <footer class="menu_detail_footer">
                            <section class="food_price">
                                <span>¥</span>
                                <span>{{foods.specfoods[0].price}}</span>
                                <span v-if="foods.specifications.length"></span>
                            </section>
M
maguohua 已提交
108
                            <buy-cart :foods='foods' :shopCart='shopCart' :index="index" @add="addToCart" @reduce="removeOutCart"></buy-cart>
M
maguohua 已提交
109 110 111 112 113
                        </footer>
                    </section>
                </li>
            </ul>
        </section>
M
maguohua 已提交
114
        <section class="buy_cart_container">
M
maguohua 已提交
115 116 117 118 119 120 121 122 123 124
            <section>
                <div class="cart_icon_container">
                    <svg class="cart_icon">
                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cart-icon"></use>
                    </svg>
                </div>
                <div class="cart_num">
                    <div>¥ 0</div>
                    <div>配送费¥{{deliveryFee}}</div>
                </div>
M
maguohua 已提交
125 126 127 128 129
            </section>
            <section class="gotopay">
                <span>还差¥{{minimumOrderAmount}}起送</span>
            </section>
        </section>
M
maguohua 已提交
130
       <loading v-if="showLoading"></loading>
M
maguohua 已提交
131 132 133
       <transition name="router-slid">
            <router-view></router-view>
        </transition>
M
maguohua 已提交
134
    </div>
M
updata  
maguohua 已提交
135 136 137
</template>

<script>
M
maguohua 已提交
138 139
    import {mapState, mapMutations} from 'vuex'
    import {imgBaseUrl} from '../../config/env'
M
maguohua 已提交
140
    import {msiteAdress, shopDetails, foodMenu} from '../../service/getData'
M
maguohua 已提交
141
    import loading from '../../components/common/loading'
M
maguohua 已提交
142
    import buyCart from '../../components/common/buyCart'
M
maguohua 已提交
143
    import ratingStar from '../../components/common/ratingStar'
M
maguohua 已提交
144
    import {getImgPath} from '../../components/common/mixin'
M
maguohua 已提交
145 146
    import {animate} from '../../config/mUtils'

M
maguohua 已提交
147 148 149 150 151 152 153
    export default {
        data(){
            return{
                geohash: '', //geohash位置信息
                shopId: null, //商店id值
                showLoading: true, //显示加载动画
                shopDetailData: null, //商铺详情
M
maguohua 已提交
154
                showActivities: false, //是否显示活动详情
M
maguohua 已提交
155 156
                menuList: [], //食品列表
                menuIndex: 0, //已选菜单索引值,默认为0
M
maguohua 已提交
157
                menuIndexChange: true,//解决选中index时,scroll监听事件重复判断设置index的bug
M
maguohua 已提交
158 159
                shopListTop: [], //商品列表的高度集合
                TitleDetailIndex: null, //点击展示列表头部详情
M
maguohua 已提交
160
                categoryNum: [], //商品类型右上角已加入购物车的数量
M
maguohua 已提交
161 162 163 164 165
            }
        },
        created(){
            this.geohash = this.$route.query.geohash;
            this.shopId = this.$route.query.id;
M
maguohua 已提交
166
            this.INIT_BUYCART();
M
maguohua 已提交
167
        },
M
maguohua 已提交
168 169
        mounted(){
            this.initData();
M
maguohua 已提交
170 171 172
        },
        mixins: [getImgPath],
        components: {
M
maguohua 已提交
173 174
            loading,
            ratingStar,
M
maguohua 已提交
175
            buyCart,
M
maguohua 已提交
176 177 178
        },
        computed: {
            ...mapState([
M
maguohua 已提交
179 180
                'latitude','longitude','cartList'
            ]),
M
maguohua 已提交
181 182 183
            promotionInfo: function (){
                return this.shopDetailData.promotion_info || '欢迎光临,用餐高峰期请提前下单,谢谢。'
            },
M
maguohua 已提交
184 185 186 187 188 189 190 191 192 193 194 195 196 197
            deliveryFee: function () {
                if (this.shopDetailData) {
                    return this.shopDetailData.float_delivery_fee;
                }else{
                    return null;
                }
            },
            minimumOrderAmount: function () {
                if (this.shopDetailData) {
                    return this.shopDetailData.float_minimum_order_amount;
                }else{
                    return null;
                }
            },
M
maguohua 已提交
198 199 200
            shopCart: function (){
                return this.cartList[this.shopId];
            }
M
maguohua 已提交
201 202 203
        },
        methods: {
            ...mapMutations([
M
maguohua 已提交
204
                'RECORD_ADDRESS','ADD_CART','REDUCE_CART','INIT_BUYCART'
M
maguohua 已提交
205
            ]),
M
maguohua 已提交
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
            //初始化时获取基本数据
            async initData(){
                if (!this.latitude) {
                    //获取位置信息
                    let res = await msiteAdress(this.geohash);
                    // 记录当前经度纬度进入vuex
                    this.RECORD_ADDRESS(res);
                }
                this.shopDetailData = await shopDetails(this.shopId, this.latitude, this.longitude);
                this.menuList = await foodMenu(this.shopId);
                this.showLoading = false;
            },
            getFoodListHeight(){
                const baseHeight = this.$refs.shopheader.clientHeight;
                const listContainer = this.$refs.menuFoodList;
                const listArr = Array.from(listContainer.children);
                listArr.forEach((item, index) => {
                    this.shopListTop[index] = item.offsetTop - baseHeight;
                });
                this.listenScroll(listContainer)
            },
            listenScroll(element){
                let oldScrollTop;
                let requestFram;
                element.addEventListener('scroll',() => {
                   currenIndex();
                }, false)
                //运动过程中保持坚挺 scrollTop 的值
                element.addEventListener('touchmove',() => {
                   currenIndex();
                })
                //运动结束时判断是否有惯性运动
                element.addEventListener('touchend',() => {
                    oldScrollTop = element.scrollTop;
                    bounceMove();
                })
                
                const bounceMove = () => {
                    requestFram = requestAnimationFrame(() => {
                        if (element.scrollTop != oldScrollTop) {
                            oldScrollTop = element.scrollTop;
                            currenIndex();
                            bounceMove();
                        }else{
                            cancelAnimationFrame(requestFram);
                            currenIndex();
                        }
                    })
                }

                const currenIndex = () => {
                    this.shopListTop.forEach((item, index) => {
                        if (this.menuIndexChange && element.scrollTop  >= item && element.scrollTop < this.shopListTop[index + 1]) {
                            this.menuIndex = index;
                        }
                    })
                }
            },
M
maguohua 已提交
264 265
            showActivitiesFun(){
                this.showActivities = !this.showActivities;
M
maguohua 已提交
266 267 268 269 270 271 272 273 274 275 276 277 278 279
            },
            chooseMenu(index){
                this.menuIndex = index;
                this.menuIndexChange = false;
                animate(this.$refs.menuFoodList, {scrollTop: this.shopListTop[index]}, () => {
                    this.menuIndexChange = true;
                });
            },
            showTitleDetail(index){
                if (this.TitleDetailIndex == index) {
                    this.TitleDetailIndex = null;
                }else{
                    this.TitleDetailIndex = index;
                }
M
maguohua 已提交
280
            },
M
maguohua 已提交
281 282
            addToCart(category_id, item_id, food_id, index, name, price, specs){
                this.ADD_CART({shopid: this.shopId, category_id, item_id, food_id, name, price, specs});
M
maguohua 已提交
283 284 285
                let num = this.categoryNum[index];
                num ++;
                this.categoryNum.splice(index, 1, num);
M
maguohua 已提交
286
            },
M
maguohua 已提交
287 288
            removeOutCart(category_id, item_id, food_id, index, name, price, specs){
                this.REDUCE_CART({shopid: this.shopId, category_id, item_id, food_id, name, price, specs});
M
maguohua 已提交
289 290 291 292 293 294 295 296 297 298 299
                let num = this.categoryNum[index];
                num --;
                this.categoryNum.splice(index, 1, num);
            },
            initCategoryNum(){
                let newArr = [];
                this.menuList.forEach((item, index) => {
                    if (this.shopCart&&this.shopCart[item.foods[0].category_id]) {
                        let num = 0;
                        Object.values(this.shopCart[item.foods[0].category_id]).forEach(item => {
                            Object.values(item).forEach(insetitem => {
M
maguohua 已提交
300
                                num += insetitem.num;
M
maguohua 已提交
301 302 303 304 305 306 307 308
                            })
                        })
                        newArr[index] = num;
                    }else{
                        newArr[index] = 0;
                    }
                })
                this.categoryNum = newArr.concat([]);
M
maguohua 已提交
309 310 311 312 313 314 315
            }
        },
        watch: {
            showLoading: function (value){
                if (!value) {
                    this.$nextTick(() => {
                        this.getFoodListHeight();
M
maguohua 已提交
316
                        this.initCategoryNum();
M
maguohua 已提交
317 318
                    })
                }
M
maguohua 已提交
319
            }
M
maguohua 已提交
320 321
        }
    }
M
updata  
maguohua 已提交
322 323 324
</script>

<style lang="scss" scoped>
M
maguohua 已提交
325
    @import '../../style/mixin.scss';
M
maguohua 已提交
326

M
maguohua 已提交
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
    .buy_cart_container{
        position: absolute;
        background-color: #3d3d3f;
        bottom: 0;
        left: 0;
        @include wh(100%, 2rem);
        .cart_icon_container{
            background-color: #3d3d3f;
            position: absolute;
            padding: .4rem;
            border: 0.25rem solid #444;
            border-radius: 50%;
            left: .5rem;
            top: -.7rem;
            .cart_icon{
                @include wh(1.2rem, 1.2rem);
            }
        }
        .cart_num{
            @include ct;
            left: 3.5rem;

            div{
                color: #fff;
            }
            div:nth-of-type(1){
                font-size: .8rem;
                font-weight: bold;
                margin-bottom: .1rem;
            }
            div:nth-of-type(2){
                font-size: .4rem;   
            }
        }
        .gotopay{
            position: absolute;
            right: 0;
            background-color: #535356;
            @include wh(5rem, 100%);
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            span{
                @include sc(.65rem, #fff);
                font-weight: bold;
            }
        }
    }





M
maguohua 已提交
381 382 383 384 385 386 387 388 389 390
    .shop_container{
        display: flex;
        flex-direction: column;
        position: absolute;
        right: 0;
        left: 0;
        height: 100%;
        overflow: hidden;
        padding-bottom: 2rem;
    }
M
maguohua 已提交
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
    
    .shop_detail_header{
        overflow: hidden;
        position: relative;
        .header_cover_img{
            width: 100%;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 9;
            filter: blur(10px);
        }
        .description_header{
            position: relative;
            z-index: 10;
            background-color: rgba(119,103,137,.43);
            padding: 0.4rem 0 0.4rem 0.4rem;
            width: 100%;
            overflow: hidden;
            .description_top{
                display: flex;
                .description_left{
                    margin-right: 0.3rem;
                    img{
                        @include wh(2.9rem, 2.9rem);
                        display: block;
                        border-radius: 0.15rem;
                    }
                }
                .description_right{
                    flex: 1;
                    .description_title{
                        @include sc(.8rem, #fff);
                        font-weight: bold;
                        width: 100%;
                        margin-bottom: 0.3rem;
                    }
                    .description_text{
                        @include sc(.5rem, #fff);
                        margin-bottom: 0.3rem;
                    }
                    .description_promotion{
                        @include sc(.5rem, #fff);
                        width: 12.5rem;
                    }
                }
                .description_arrow{
                    @include ct;
                    right: 0.3rem;
                    z-index: 11;
                }
            }
            .description_footer{
                @include fj;
                margin-top: 0.5rem;
                padding-right: .4rem;
                p{
                    @include sc(.5rem, #fff);
                    span{
                        color: #fff;
                    }
                    .tip_icon{
                        padding: .01rem;
                        border: 0.025rem solid #fff;
                        border-radius: 0.1rem;
                        display: inline-block;
                    }
                }
                .ellipsis{
                    width: 87%;
                }
            }
            .activities_details{
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background-color: #262626;
                z-index: 12;
                padding: 1.25rem;
                .activities_shoptitle{
                    text-align: center;
                    @include sc(.8rem, #fff);
                }
                .activities_ratingstar{
                    display: flex;
                    justify-content: center;
                    transform: scale(2.2);
                    margin-top: .7rem;
                }
                .activities_list{
                    margin-top: 1.5rem;
                    margin-bottom: 1rem;
                    @include sc(.5rem, #fff);
                    li{
                        margin-bottom: .2rem;
                        .activities_icon{
                            padding: .01rem;
                            border: 0.025rem solid #fff;
                            border-radius: 0.1rem;
                        }
                        span{
                            color: #fff;
                            line-height: .6rem;
                        }
                    }
                }
                .activities_shopinfo{
                    p{
                        line-height: .7rem;
                        @include sc(.5rem, #fff);
                    }
                }
                .activities_title_style{
                    text-align: center;
                    margin-bottom: 1rem;
                    span{
                        @include sc(.5rem, #fff);
                        border: 0.025rem solid #555;
                        padding: .2rem .4rem;
                        border-radius: 0.5rem;
                    }

                }
                .close_activities{
                    position: absolute;
                    bottom: 1rem;
                    @include cl;
                }
            }
            
            .fadeactivities-enter-active, .fadeactivities-leave-active {
                transition: opacity .5s;
            }
            .fadeactivities-enter, .fadeactivities-leave-active {
                opacity: 0;
            }
        }
    }

M
maguohua 已提交
532 533 534 535 536 537 538
    .menu_container{
        display: flex;
        flex: 1;
        overflow-y: auto;
        .menu_left{
            background-color: #f8f8f8;
            overflow-y: auto;
M
maguohua 已提交
539
            width: 3.8rem;
M
maguohua 已提交
540 541 542 543 544
            .menu_left_li{
                padding: .7rem .3rem;
                border-bottom: 0.025rem solid #ededed;
                box-sizing: border-box;
                border-left: 0.15rem solid #f8f8f8;
M
maguohua 已提交
545
                position: relative;
M
maguohua 已提交
546 547 548 549 550 551
                img{
                    @include wh(.5rem, .6rem);
                }
                span{
                    @include sc(.6rem, #666);
                }
M
maguohua 已提交
552 553 554 555 556 557 558 559 560 561 562 563 564 565
                .category_num{
                    position: absolute;
                    top: .1rem;
                    right: .1rem;
                    background-color: #ff461d;
                    line-height: .6rem;
                    text-align: center;
                    border-radius: 50%;
                    border: 0.025rem solid #ff461d;
                    min-width: .6rem;
                    height: .6rem;
                    @include sc(.5rem, #fff);
                    font-family: Helvetica Neue,Tahoma,Arial;
                }
M
maguohua 已提交
566 567 568 569
            }
            .activity_menu{
                border-left: 0.15rem solid #3190e8;
                background-color: #fff;
M
maguohua 已提交
570
                span:nth-of-type(1){
M
maguohua 已提交
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749
                    font-weight: bold;
                }
            }
        }
        .menu_right{
            flex: 4;
            overflow-y: auto;
            .menu_detail_header{
                width: 100%;
                padding: .4rem;
                position: relative;
                @include fj;
                align-items: center;
                .menu_detail_header_left{
                    width: 11rem;
                    white-space: nowrap;
                    overflow: hidden;
                    .menu_item_title{
                        @include sc(.7rem, #666);
                        font-weight: bold;
                    }
                    .menu_item_description{
                        @include sc(.5rem, #999);
                        width: 30%;
                        overflow: hidden;
                    }
                }
                .menu_detail_header_right{
                    @include wh(.5rem, 1rem);
                    display: block;
                    @include bis('../../images/icon_point.png');
                    background-size: 100% .4rem;
                    background-position: left center;
                }
                .description_tip{
                    background-color: #39373a;
                    opacity: 0.95;
                    @include sc(.5rem, #fff);
                    position: absolute;
                    top: 1.5rem;
                    z-index: 14;
                    width: 8rem;
                    right: .2rem;
                    padding: .5rem .4rem;
                    border: 1px;
                    border-radius: .2rem;
                    span{
                        color: #fff;
                        line-height: .6rem;
                        font-size: .55rem;
                    }
                }
                .description_tip::after{
                    content: '';
                    position: absolute;
                    @include wh(.4rem, .4rem);
                    background-color: #39373a;
                    top: -.5rem;
                    right: .7rem;
                    transform: rotate(-45deg) translateY(.41rem);
                }
                .fade_title-enter-active, .fade_title-leave-active {
                    transition: opacity .5s
                }
                .fade_title-enter, .fade_title-leave-active {
                    opacity: 0
                }
            }
            .menu_detail_list{
                background-color: #fff;
                padding: .6rem .4rem;
                border-bottom: 1px solid #f8f8f8;
                position: relative;
                overflow: hidden;            
                .menu_detail_link{
                    display:flex;
                    .menu_food_img{
                        margin-right: .4rem;
                        img{
                            @include wh(2rem, 2rem);
                            display: block;
                        }
                    }
                    .menu_food_description{
                        width: 100%;
                        .food_description_head{
                            @include fj;
                            margin-bottom: .2rem;
                            .description_foodname{
                                @include sc(.7rem, #333);
                            }
                            .attributes_ul{
                                display: flex;
                                li{
                                    font-size: .3rem;
                                    height: .6rem;
                                    line-height: .35rem;
                                    padding: .1rem;
                                    border: 1px solid #666;
                                    border-radius: 0.3rem;
                                    margin-right: .1rem;
                                    transform: scale(.8);
                                }
                                .attribute_new{
                                    position: absolute;
                                    top: 0;
                                    left: 0;
                                    background-color: #4cd964;
                                    @include wh(2rem, 2rem);
                                    display: flex;
                                    align-items: flex-end;
                                    transform: rotate(-45deg) translate(-.1rem, -1.5rem);
                                    border: none;
                                    border-radius: 0;
                                    p{
                                        @include sc(.4rem, #fff);
                                        text-align: center;
                                        flex: 1;
                                    }
                                }
                            }
                        }
                        .food_description_content{
                            @include sc(.5rem, #999);
                            line-height: .6rem;
                        }
                        .food_description_sale_rating{
                            line-height: .8rem;
                            span{
                                @include sc(.5rem, #333);
                            }
                        }
                        .food_activity{
                            line-height: .4rem;
                            span{
                                font-size: .3rem;
                                border: 1px solid currentColor;
                                border-radius: 0.3rem;
                                padding: .08rem;
                                display: inline-block;
                                transform: scale(.8);
                                margin-left: -0.35rem;

                            }
                        }
                    }
                }
                .menu_detail_footer{
                    margin-left: 2.4rem;
                    font-size: 0;
                    margin-top: .3rem;
                    @include fj;
                    .food_price{
                        span{
                            font-family: 'Helvetica Neue',Tahoma,Arial;
                        }
                        span:nth-of-type(1){
                            @include sc(.5rem, #f60);
                            margin-right: .05rem;
                        }
                        span:nth-of-type(2){
                            @include sc(.7rem, #f60);
                            font-weight: bold;
                            margin-right: .3rem;
                        }
                        span:nth-of-type(3){
                            @include sc(.5rem, #666);
                        }
                    }
                }
            }
        }
    }
    .router-slid-enter-active, .router-slid-leave-active {
        transition: all .4s;
    }
    .router-slid-enter, .router-slid-leave-active {
        transform: translateX(100%);
    }
M
updata  
maguohua 已提交
750
</style>