shop.vue 64.6 KB
Newer Older
M
maguohua 已提交
1
 <template>
M
maguohua 已提交
2 3 4 5 6
    <div>
        <section v-if="!showLoading" class="shop_container">
            <header class="shop_detail_header" ref="shopheader" :style="{zIndex: showActivities? '14':'10'}">
                <img :src="getImgPath(shopDetailData.image_path)" class="header_cover_img">
                <section class="description_header">
M
updata  
maguohua 已提交
7
                    <router-link to="/shop/shopDetail" class="description_top">
M
maguohua 已提交
8 9
                        <section class="description_left">
                            <img :src="getImgPath(shopDetailData.image_path)">
M
maguohua 已提交
10
                        </section>
M
maguohua 已提交
11 12 13 14
                        <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>
                            <p class="description_promotion ellipsis">公告:{{promotionInfo}}</p>
M
maguohua 已提交
15
                        </section>
M
maguohua 已提交
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"/>
M
maguohua 已提交
18
                        </svg>
M
updata  
maguohua 已提交
19
                    </router-link>
M
maguohua 已提交
20 21 22 23
                    <footer class="description_footer" v-if="shopDetailData.activities.length" @click="showActivitiesFun">
                        <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>
M
maguohua 已提交
24
                        </p>
M
maguohua 已提交
25
                        <p>{{shopDetailData.activities.length}}个活动</p>
M
updata  
maguohua 已提交
26 27 28
                        <svg class="footer_arrow">
                            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#arrow-left"></use>
                        </svg>
M
maguohua 已提交
29
                    </footer>
M
udate  
maguohua 已提交
30
                    
M
maguohua 已提交
31 32
                </section>
            </header>
M
udate  
maguohua 已提交
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
            <transition name="fade">
                <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>
                        <p>{{promotionInfo}}</p>
                    </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 已提交
59 60 61
            <section class="change_show_type" ref="chooseType">
                <div>
                    <span :class='{activity_show: changeShowType =="food"}' @click="changeShowType='food'">商品</span>
M
maguohua 已提交
62
                </div>
M
maguohua 已提交
63 64
                <div>
                    <span :class='{activity_show: changeShowType =="rating"}' @click="changeShowType='rating'">评价</span>   
M
maguohua 已提交
65
                </div>
M
maguohua 已提交
66
            </section>
M
maguohua 已提交
67 68 69
            <transition name="fade-choose">
                <section v-show="changeShowType =='food'" class="food_container">
                    <section class="menu_container">
M
update  
maguohua 已提交
70
                        <section class="menu_left" id="wrapper_menu">
M
update  
maguohua 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
                            <ul>
                                <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>
                                    <span class="category_num" v-if="categoryNum[index]&&item.type==1">{{categoryNum[index]}}</span>
                                </li>
                            </ul>
                        </section>
                        <section class="menu_right" ref="menuFoodList">
                            <ul>
                                <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>
M
maguohua 已提交
86
                                        </section>
M
update  
maguohua 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
                                        <span class="menu_detail_header_right" @click="showTitleDetail(index)"></span>
                                        <p class="description_tip" v-if="index == TitleDetailIndex">
                                            <span>{{item.name}}</span>
                                            {{item.description}}
                                        </p>
                                    </header>
                                    <section v-for="(foods,foodindex) in item.foods" :key="foodindex" class="menu_detail_list">
                                        <router-link  :to="{path: 'shop/foodDetail', query:{image_path:foods.image_path, description: foods.description, month_sales: foods.month_sales, name: foods.name, rating: foods.rating, rating_count: foods.rating_count, satisfy_rate: foods.satisfy_rate, foods, shopId}}" 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">
                                                        <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 == '新'}">
                                                        <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
update  
maguohua 已提交
124
                                            <buy-cart :shopId='shopId' :foods='foods' @moveInCart="listenInCart" @showChooseList="showChooseList" @showReduceTip="showReduceTip" @showMoveDot="showMoveDotFun"></buy-cart>
M
update  
maguohua 已提交
125 126 127 128 129
                                        </footer>
                                    </section>
                                </li>
                            </ul>
                        </section>
M
maguohua 已提交
130 131 132 133 134 135 136 137 138 139
                    </section>
                    <section class="buy_cart_container">
                        <section @click="toggleCartList" class="cart_icon_num">
                            <div class="cart_icon_container" :class="{cart_icon_activity: totalPrice > 0, move_in_cart:receiveInCart}" ref="cartContainer">
                                <span v-if="totalNum" class="cart_list_length">
                                    {{totalNum}}
                                </span>
                                <svg class="cart_icon">
                                    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cart-icon"></use>
                                </svg>
M
maguohua 已提交
140
                            </div>
M
maguohua 已提交
141 142 143
                            <div class="cart_num">
                                <div>¥ {{totalPrice}}</div>
                                <div>配送费¥{{deliveryFee}}</div>
M
maguohua 已提交
144
                            </div>
M
maguohua 已提交
145 146 147
                        </section>
                        <section class="gotopay" :class="{gotopay_acitvity: minimumOrderAmount < 0}">
                            <span class="gotopay_button_style" v-if="minimumOrderAmount > 0">还差¥{{minimumOrderAmount}}起送</span>
M
maguohua 已提交
148
                            <router-link :to="{path:'/confirmOrder', query:{geohash, shopId}}" class="gotopay_button_style" v-else >去结算</router-link>
M
maguohua 已提交
149 150 151 152 153 154 155 156 157 158 159 160 161
                        </section>
                    </section>
                    <transition name="toggle-cart">
                        <section class="cart_food_list" v-show="showCartList&&cartFoodList.length">
                            <header>
                                <h4>购物车</h4>
                                <div @click="clearCart">
                                    <svg>
                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cart-remove"></use>
                                    </svg>
                                    <span class="clear_cart">清空</span>
                                </div>
                            </header>
M
update  
maguohua 已提交
162
                            <section class="cart_food_details" id="cartFood">
M
maguohua 已提交
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
                                <ul>
                                    <li v-for="(item, index) in cartFoodList" :key="index" class="cart_food_li">
                                        <div class="cart_list_num">
                                            <p class="ellipsis">{{item.name}}</p>
                                            <p class="ellipsis">{{item.specs}}</p>
                                        </div>
                                        <div class="cart_list_price">
                                            <span>¥</span>
                                            <span>{{item.price}}</span>
                                        </div>
                                        <section class="cart_list_control">
                                            <svg @click="removeOutCart(item.category_id, item.item_id, item.food_id, item.name, item.price, item.specs)">
                                                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cart-minus"></use>
                                            </svg>
                                            <span class="cart_num">{{item.num}}</span>
                                            <svg class="cart_add" @click="addToCart(item.category_id, item.item_id, item.food_id, item.name, item.price, item.specs)">
                                                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cart-add"></use>
                                            </svg>
                                        </section>
                                    </li>
                                </ul>
M
maguohua 已提交
184
                            </section>
M
maguohua 已提交
185 186 187 188 189
                        </section>
                    </transition>
                    <transition name="fade">
                        <div class="screen_cover" v-show="showCartList&&cartFoodList.length" @click="toggleCartList"></div>
                    </transition>
M
maguohua 已提交
190
                </section>
M
maguohua 已提交
191 192
            </transition>
            <transition name="fade-choose">
M
udpate  
maguohua 已提交
193 194 195 196 197 198 199 200 201
                <section class="rating_container" id="ratingContainer" v-show="changeShowType =='rating'">
                    <section v-load-more="loaderMoreRating" type="2">
                        <section>
                            
                            <header class="rating_header">
                                <section class="rating_header_left">
                                    <p>{{shopDetailData.rating}}</p>
                                    <p>综合评价</p>
                                    <p>高于周边商家{{(ratingScoresData.compare_rating*100).toFixed(1)}}%</p>
M
maguohua 已提交
202
                                </section>
M
udpate  
maguohua 已提交
203 204 205 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
                                <section class="rating_header_right">
                                    <p>
                                        <span>服务态度</span>
                                        <rating-star :rating='ratingScoresData.service_score'></rating-star>
                                        <span class="rating_num">{{ratingScoresData.service_score.toFixed(1)}}</span>
                                    </p>
                                    <p>
                                        <span>菜品评价</span>
                                        <rating-star :rating='ratingScoresData.food_score'></rating-star>
                                        <span class="rating_num">{{ratingScoresData.food_score.toFixed(1)}}</span>
                                    </p>
                                    <p>
                                        <span>送达时间</span>
                                        <span class="delivery_time">{{shopDetailData.order_lead_time}}分钟</span>   
                                    </p>
                                </section>
                            </header>
                            <ul class="tag_list_ul">
                                <li v-for="(item, index) in ratingTagsList" :key="index" :class="{unsatisfied: item.unsatisfied, tagActivity: ratingTageIndex == index}" @click="changeTgeIndex(index, item.name)">{{item.name}}({{item.count}})</li>
                            </ul>
                            <ul class="rating_list_ul">
                                <li v-for="(item, index) in ratingList" :key="index" class="rating_list_li">
                                    <img :src="getImgPath(item.avatar)" class="user_avatar">
                                    <section class="rating_list_details">
                                        <header>
                                            <section class="username_star">
                                                <p class="username">{{item.username}}</p>
                                                <p class="star_desc">
                                                    <rating-star :rating='item.rating_star'></rating-star>
                                                    <span class="time_spent_desc">{{item.time_spent_desc}}</span>
                                                </p>
                                            </section>
                                            <time class="rated_at">{{item.rated_at}}</time>
                                        </header>
                                        <ul class="food_img_ul">
                                            <li v-for="(item, index) in item.item_ratings" :key="index">
                                                <img :src="getImgPath(item.image_hash)" v-if="item.image_hash">
                                            </li>
                                        </ul>
                                        <ul class="food_name_ul">
                                            <li v-for="(item, index) in item.item_ratings" :key="index" class="ellipsis">
                                                {{item.food_name}}
                                            </li>
                                        </ul>
                                    </section>
                                </li>
                            </ul>            
                        </section>
M
maguohua 已提交
251 252 253 254
                    </section>
                </section>
            </transition>
        </section>
M
update  
maguohua 已提交
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
        <section>
            <transition name="fade">
                <div class="specs_cover" @click="showChooseList" v-if="showSpecs"></div>
            </transition>
            <transition name="fadeBounce">
                <div class="specs_list" v-if="showSpecs">
                    <header class="specs_list_header">
                        <h4 class="ellipsis">{{choosedFoods.name}}</h4>
                        <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" version="1.1"class="specs_cancel" @click="showChooseList">
                            <line x1="0" y1="0" x2="16" y2="16"  stroke="#666" stroke-width="1.2"/>
                            <line x1="0" y1="16" x2="16" y2="0"  stroke="#666" stroke-width="1.2"/>
                        </svg>
                    </header>
                    <section class="specs_details">
                        <h5 class="specs_details_title">{{choosedFoods.specifications[0].name}}</h5>
                        <ul>
                            <li v-for="(item, itemIndex) in choosedFoods.specifications[0].values" :class="{specs_activity: itemIndex == specsIndex}" @click="chooseSpecs(itemIndex)">
                                {{item}}
                            </li>
                        </ul>
                    </section>
                    <footer class="specs_footer">
                        <div class="specs_price">
                            <span>¥ </span>
                            <span>{{choosedFoods.specfoods[specsIndex].price}}</span>
                        </div>
                        <div class="specs_addto_cart" @click="addSpecs(choosedFoods.category_id, choosedFoods.item_id, choosedFoods.specfoods[specsIndex].food_id, choosedFoods.specfoods[specsIndex].name, choosedFoods.specfoods[specsIndex].price, choosedFoods.specifications[0].values[specsIndex], choosedFoods.specfoods[specsIndex].packing_fee, choosedFoods.specfoods[specsIndex].sku_id, choosedFoods.specfoods[specsIndex].stock)">加入购物车</div>
                    </footer>
                </div>
            </transition>
        </section>
        <transition name="fade">
            <p class="show_delete_tip" v-if="showDeleteTip">多规格商品只能去购物车删除哦</p>
        </transition>
M
update  
maguohua 已提交
289 290 291 292 293 294 295 296 297 298 299 300
        <transition 
        appear
        @after-appear = 'afterEnter'
        @before-appear="beforeEnter"
        v-for="(item,index) in showMoveDot"
        >
            <span class="move_dot" v-if="item">
                <svg class="move_liner">
                    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cart-add"></use>
                </svg>
            </span>
        </transition>
M
maguohua 已提交
301
       <loading v-show="showLoading || loadRatings"></loading>
M
maguohua 已提交
302 303 304
       <transition name="router-slid">
            <router-view></router-view>
        </transition>
M
maguohua 已提交
305
    </div>
M
updata  
maguohua 已提交
306 307 308
</template>

<script>
M
maguohua 已提交
309
    import {mapState, mapMutations} from 'vuex'
M
update  
maguohua 已提交
310 311 312 313 314
    import {msiteAdress, shopDetails, foodMenu, getRatingList, ratingScores, ratingTags} from 'src/service/getData'
    import loading from 'src/components/common/loading'
    import buyCart from 'src/components/common/buyCart'
    import ratingStar from 'src/components/common/ratingStar'
    import {loadMore, getImgPath} from 'src/components/common/mixin'
M
udpate  
maguohua 已提交
315
    import BScroll from 'better-scroll'
M
maguohua 已提交
316

M
maguohua 已提交
317 318 319 320 321 322
    export default {
        data(){
            return{
                geohash: '', //geohash位置信息
                shopId: null, //商店id值
                showLoading: true, //显示加载动画
M
maguohua 已提交
323
                changeShowType: 'food',//切换显示商品或者评价
M
maguohua 已提交
324
                shopDetailData: null, //商铺详情
M
maguohua 已提交
325
                showActivities: false, //是否显示活动详情
M
maguohua 已提交
326 327
                menuList: [], //食品列表
                menuIndex: 0, //已选菜单索引值,默认为0
M
maguohua 已提交
328
                menuIndexChange: true,//解决选中index时,scroll监听事件重复判断设置index的bug
M
maguohua 已提交
329 330
                shopListTop: [], //商品列表的高度集合
                TitleDetailIndex: null, //点击展示列表头部详情
M
maguohua 已提交
331
                categoryNum: [], //商品类型右上角已加入购物车的数量
M
maguohua 已提交
332 333 334
                totalPrice: 0, //总共价格
                cartFoodList: [], //购物车商品列表
                showCartList: false,//显示购物车列表
M
maguohua 已提交
335
                receiveInCart: false, //购物车组件下落的圆点是否到达目标位置
M
maguohua 已提交
336 337 338 339 340 341 342 343
                ratingList: null, //评价列表
                ratingOffset: 0, //评价获取数据offset值
                ratingScoresData: null, //评价总体分数
                ratingTagsList: null, //评价分类列表
                ratingTageIndex: 0, //评价分类索引
                preventRepeatRequest: false,// 防止多次触发数据请求
                ratingTagName: '',//评论的类型
                loadRatings: false, //加载更多评论是显示加载组件
M
update  
maguohua 已提交
344
                foodScroll: null,  //食品列表scroll
M
update  
maguohua 已提交
345 346
                showSpecs: false,//控制显示食品规格
                specsIndex: 0, //当前选中的规格索引值
M
update  
maguohua 已提交
347
                choosedFoods: null, //当前选中视频数据
M
update  
maguohua 已提交
348
                showDeleteTip: false, //多规格商品点击减按钮,弹出提示框
M
update  
maguohua 已提交
349 350 351 352 353
                showMoveDot: [], //控制下落的小圆点显示隐藏
                windowHeight: null, //屏幕的高度
                elLeft: 0, //当前点击加按钮在网页中的绝对top值
                elBottom: 0, //当前点击加按钮在网页中的绝对left值
                ratingScroll: null, //评论页Scroll
M
update  
maguohua 已提交
354
                wrapperMenu: null,
M
maguohua 已提交
355 356 357 358 359
            }
        },
        created(){
            this.geohash = this.$route.query.geohash;
            this.shopId = this.$route.query.id;
M
maguohua 已提交
360
            //初始化购物车,获取存储在localStorage中的购物车商品信息
M
maguohua 已提交
361
            this.INIT_BUYCART();
M
maguohua 已提交
362
        },
M
maguohua 已提交
363
        mounted(){
M
maguohua 已提交
364
            //初始化数据
M
maguohua 已提交
365
            this.initData();
M
update  
maguohua 已提交
366
            this.windowHeight = window.innerHeight;
M
maguohua 已提交
367
        },
M
maguohua 已提交
368
        mixins: [loadMore, getImgPath],
M
maguohua 已提交
369
        components: {
M
maguohua 已提交
370 371
            loading,
            ratingStar,
M
maguohua 已提交
372
            buyCart,
M
maguohua 已提交
373 374 375
        },
        computed: {
            ...mapState([
M
maguohua 已提交
376 377
                'latitude','longitude','cartList'
            ]),
M
maguohua 已提交
378 379
            //商铺公告
            promotionInfo: function (){ 
M
maguohua 已提交
380 381
                return this.shopDetailData.promotion_info || '欢迎光临,用餐高峰期请提前下单,谢谢。'
            },
M
maguohua 已提交
382 383
            //配送费
            deliveryFee: function () { 
M
maguohua 已提交
384 385 386 387 388 389
                if (this.shopDetailData) {
                    return this.shopDetailData.float_delivery_fee;
                }else{
                    return null;
                }
            },
M
maguohua 已提交
390 391
            //还差多少元起送,为负数时显示去结算按钮
            minimumOrderAmount: function () { 
M
maguohua 已提交
392
                if (this.shopDetailData) {
M
maguohua 已提交
393
                    return this.shopDetailData.float_minimum_order_amount - this.totalPrice;
M
maguohua 已提交
394 395 396 397
                }else{
                    return null;
                }
            },
M
update  
maguohua 已提交
398
            //当前商店购物信息
M
maguohua 已提交
399
            shopCart: function (){
M
update  
maguohua 已提交
400
                return {...this.cartList[this.shopId]};
M
maguohua 已提交
401 402 403 404 405 406 407 408
            },
            //购物车中总共商品的数量
            totalNum: function (){
                let num = 0;
                this.cartFoodList.forEach(item => {
                    num += item.num
                })
                return num
M
maguohua 已提交
409
            },
M
maguohua 已提交
410 411 412
        },
        methods: {
            ...mapMutations([
M
updata  
maguohua 已提交
413
                'RECORD_ADDRESS','ADD_CART','REDUCE_CART','INIT_BUYCART','CLEAR_CART','RECORD_SHOPDETAIL'
M
maguohua 已提交
414
            ]),
M
maguohua 已提交
415 416 417 418 419 420 421 422
            //初始化时获取基本数据
            async initData(){
                if (!this.latitude) {
                    //获取位置信息
                    let res = await msiteAdress(this.geohash);
                    // 记录当前经度纬度进入vuex
                    this.RECORD_ADDRESS(res);
                }
M
maguohua 已提交
423
                //获取商铺信息
M
maguohua 已提交
424
                this.shopDetailData = await shopDetails(this.shopId, this.latitude, this.longitude);
M
maguohua 已提交
425
                //获取商铺食品列表
M
maguohua 已提交
426
                this.menuList = await foodMenu(this.shopId);
M
maguohua 已提交
427 428 429
                this.ratingList = await getRatingList(this.ratingOffset);
                this.ratingScoresData = await ratingScores(this.shopId);
                this.ratingTagsList = await ratingTags(this.shopId);
M
updata  
maguohua 已提交
430
                this.RECORD_SHOPDETAIL(this.shopDetailData)
M
maguohua 已提交
431
                //隐藏加载动画
M
update  
maguohua 已提交
432
                this.hideLoading();
M
maguohua 已提交
433
            },
M
maguohua 已提交
434
            //获取食品列表的高度,存入shopListTop
M
maguohua 已提交
435 436
            getFoodListHeight(){
                const baseHeight = this.$refs.shopheader.clientHeight;
M
maguohua 已提交
437
                const chooseTypeHeight = this.$refs.chooseType.clientHeight;
M
maguohua 已提交
438
                const listContainer = this.$refs.menuFoodList;
M
update  
maguohua 已提交
439
                const listArr = Array.from(listContainer.children[0].children);
M
maguohua 已提交
440
                listArr.forEach((item, index) => {
M
maguohua 已提交
441
                    this.shopListTop[index] = item.offsetTop - baseHeight - chooseTypeHeight;
M
maguohua 已提交
442 443 444
                });
                this.listenScroll(listContainer)
            },
M
maguohua 已提交
445
            //当滑动食品列表时,监听其scrollTop值来设置对应的食品列表标题的样式
M
maguohua 已提交
446
            listenScroll(element){
M
udpate  
maguohua 已提交
447 448 449 450
                let oldScrollTop;
                let requestFram;
                this.foodScroll = new BScroll(element, {  
                    probeType: 3,
M
update  
maguohua 已提交
451
                    deceleration: 0.001,
M
update  
maguohua 已提交
452 453 454
                    bounce: false,
                    swipeTime: 2000,
                    click: true,
M
update  
maguohua 已提交
455
                }); 
M
udpate  
maguohua 已提交
456
           
M
update  
maguohua 已提交
457
                this.wrapperMenu = new BScroll('#wrapper_menu', {
M
update  
maguohua 已提交
458 459
                    click: true,
                });
M
udpate  
maguohua 已提交
460

M
maguohua 已提交
461
                //判断scrollTop的值,则满足条件,改变对应列表标题样式
M
udpate  
maguohua 已提交
462
                this.foodScroll.on('scroll', (pos) => {
M
maguohua 已提交
463
                    this.shopListTop.forEach((item, index) => {
M
udpate  
maguohua 已提交
464
                        if (this.menuIndexChange && Math.abs(Math.round(pos.y)) >= item) {
M
maguohua 已提交
465 466 467
                            this.menuIndex = index;
                        }
                    })
M
udpate  
maguohua 已提交
468
                })
M
maguohua 已提交
469
            },
M
maguohua 已提交
470
            //控制活动详情页的显示隐藏
M
maguohua 已提交
471 472
            showActivitiesFun(){
                this.showActivities = !this.showActivities;
M
maguohua 已提交
473
            },
M
maguohua 已提交
474
            //点击左侧食品列表标题,相应列表移动到最顶层
M
maguohua 已提交
475 476
            chooseMenu(index){
                this.menuIndex = index;
M
maguohua 已提交
477
                //menuIndexChange解决运动时listenScroll依然监听的bug
M
maguohua 已提交
478
                this.menuIndexChange = false;
M
udpate  
maguohua 已提交
479 480
                this.foodScroll.scrollTo(0, -this.shopListTop[index], 400);
                this.foodScroll.on('scrollEnd', () => {
M
maguohua 已提交
481
                    this.menuIndexChange = true;
M
udpate  
maguohua 已提交
482
                })
M
maguohua 已提交
483
            },
M
maguohua 已提交
484
            //控制显示列表标题详情提示
M
maguohua 已提交
485 486 487 488 489 490
            showTitleDetail(index){
                if (this.TitleDetailIndex == index) {
                    this.TitleDetailIndex = null;
                }else{
                    this.TitleDetailIndex = index;
                }
M
maguohua 已提交
491
            },
M
maguohua 已提交
492
            //加入购物车,所需7个参数,商铺id,食品分类id,食品id,食品规格id,食品名字,食品价格,食品规格
M
maguohua 已提交
493
            addToCart(category_id, item_id, food_id, name, price, specs){
M
maguohua 已提交
494
                this.ADD_CART({shopid: this.shopId, category_id, item_id, food_id, name, price, specs});
M
maguohua 已提交
495
            },
M
maguohua 已提交
496
            //移出购物车,所需7个参数,商铺id,食品分类id,食品id,食品规格id,食品名字,食品价格,食品规格
M
maguohua 已提交
497
            removeOutCart(category_id, item_id, food_id, name, price, specs){
M
maguohua 已提交
498
                this.REDUCE_CART({shopid: this.shopId, category_id, item_id, food_id, name, price, specs});
M
maguohua 已提交
499
            },
M
maguohua 已提交
500 501 502
            /**
             * 初始化和shopCart变化时,重新获取购物车改变过的数据,赋值 categoryNum,totalPrice,cartFoodList,整个数据流是自上而下的形式,所有的购物车数据都交给vuex统一管理,包括购物车组件中自身的商品数量,使整个数据流更加清晰
             */
M
maguohua 已提交
503 504
            initCategoryNum(){
                let newArr = [];
M
maguohua 已提交
505
                let cartFoodNum = 0;
M
maguohua 已提交
506
                this.totalPrice = 0; 
M
maguohua 已提交
507
                this.cartFoodList = [];
M
maguohua 已提交
508 509 510
                this.menuList.forEach((item, index) => {
                    if (this.shopCart&&this.shopCart[item.foods[0].category_id]) {
                        let num = 0;
M
maguohua 已提交
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
                        Object.keys(this.shopCart[item.foods[0].category_id]).forEach(itemid => {
                            Object.keys(this.shopCart[item.foods[0].category_id][itemid]).forEach(foodid => {
                                let foodItem = this.shopCart[item.foods[0].category_id][itemid][foodid];
                                num += foodItem.num;
                                if (item.type == 1) {
                                    this.totalPrice += foodItem.num*foodItem.price;
                                    if (foodItem.num > 0) {
                                        this.cartFoodList[cartFoodNum] = {};
                                        this.cartFoodList[cartFoodNum].category_id = item.foods[0].category_id;
                                        this.cartFoodList[cartFoodNum].item_id = itemid;
                                        this.cartFoodList[cartFoodNum].food_id = foodid;
                                        this.cartFoodList[cartFoodNum].num = foodItem.num;
                                        this.cartFoodList[cartFoodNum].price = foodItem.price;
                                        this.cartFoodList[cartFoodNum].name = foodItem.name;
                                        this.cartFoodList[cartFoodNum].specs = foodItem.specs;
                                        cartFoodNum ++;
                                    }
                                }
M
maguohua 已提交
529 530 531 532 533 534 535
                            })
                        })
                        newArr[index] = num;
                    }else{
                        newArr[index] = 0;
                    }
                })
M
maguohua 已提交
536
                this.totalPrice = this.totalPrice.toFixed(2);
M
update  
maguohua 已提交
537
                this.categoryNum = [...newArr];
M
maguohua 已提交
538 539 540 541 542 543 544
            },
            toggleCartList(){
                this.showCartList = !this.showCartList;
            },
            clearCart(){
                this.toggleCartList();
                this.CLEAR_CART(this.shopId);
M
maguohua 已提交
545 546 547 548 549 550 551
            },
            listenInCart(){
                if (!this.receiveInCart) {
                    this.receiveInCart = true;
                    this.$refs.cartContainer.addEventListener('animationend', () => {
                        this.receiveInCart = false;
                    })
M
update  
maguohua 已提交
552 553 554
                    this.$refs.cartContainer.addEventListener('webkitAnimationEnd', () => {
                        this.receiveInCart = false;
                    })
M
maguohua 已提交
555
                }
M
maguohua 已提交
556 557 558 559 560
            },
            async changeTgeIndex(index, name){
                this.ratingTageIndex = index;
                this.ratingOffset = 0;
                this.ratingTagName = name;
M
update  
maguohua 已提交
561 562
                let res = await getRatingList(this.ratingOffset, name);
                this.ratingList = [...res];
M
update  
maguohua 已提交
563 564 565
                this.$nextTick(() => {
                    this.ratingScroll.refresh();
                })
M
maguohua 已提交
566 567 568 569 570 571 572 573 574
            },
            async loaderMoreRating(){
                if (this.preventRepeatRequest) {
                    return
                }
                this.loadRatings = true;
                this.preventRepeatRequest = true;
                this.ratingOffset += 10;
                let ratingDate = await getRatingList(this.ratingOffset, this.ratingTagName);
M
update  
maguohua 已提交
575
                this.ratingList = [...this.ratingList,...ratingDate];
M
maguohua 已提交
576 577 578 579 580
                this.loadRatings = false;
                if (ratingDate.length >= 10) {
                    this.preventRepeatRequest = false;
                }
            },
M
update  
maguohua 已提交
581 582 583 584 585 586
            hideLoading(){
                if (process.env.NODE_ENV !== 'development') {
                    clearTimeout(this.timer);
                    this.timer = setTimeout(() => {
                        clearTimeout(this.timer);
                        this.showLoading = false;
M
update  
maguohua 已提交
587
                    }, 600)
M
update  
maguohua 已提交
588 589 590 591
                }else{
                    this.showLoading = false;
                }
            },
M
update  
maguohua 已提交
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
            //显示规格列表
            showChooseList(foods){
                if (foods) {
                    this.choosedFoods = foods;
                }
                this.showSpecs = !this.showSpecs;
                this.specsIndex = 0;
            },
            //记录当前所选规格的索引值
            chooseSpecs(index){
                this.specsIndex = index;
            },
            //多规格商品加入购物车
            addSpecs(category_id, item_id, food_id, name, price, specs, packing_fee, sku_id, stock){
                this.ADD_CART({shopid: this.shopId, category_id, item_id, food_id, name, price, specs, packing_fee, sku_id, stock});
                this.showChooseList();
            },
            //点击多规格商品的减按钮,弹出提示
            showReduceTip(){
                this.showDeleteTip = true;
                clearTimeout(this.timer);
                this.timer = setTimeout(() => {
                    clearTimeout(this.timer);
                    this.showDeleteTip = false;
                }, 3000);
            },
M
update  
maguohua 已提交
618 619 620 621 622 623 624
            showMoveDotFun(showMoveDot, elLeft, elBottom){
                this.showMoveDot = [...this.showMoveDot, ...showMoveDot];
                this.elLeft = elLeft;
                this.elBottom = elBottom;
            },
            beforeEnter(el){
                el.style.transform = `translate3d(0,${37 + this.elBottom - this.windowHeight}px,0)`;
M
update  
maguohua 已提交
625 626
                el.children[0].style.transform = `translate3d(${this.elLeft - 30}px,0,0)`;
                el.children[0].style.opacity = 0;
M
update  
maguohua 已提交
627 628 629 630
            },
            afterEnter(el){
                el.style.transform = `translate3d(0,0,0)`;
                el.children[0].style.transform = `translate3d(0,0,0)`;
M
update  
maguohua 已提交
631 632
                el.style.transition = 'transform .55s cubic-bezier(0.3, -0.25, 0.7, -0.15)';
                el.children[0].style.transition = 'transform .55s linear';
M
update  
maguohua 已提交
633 634
                //圆点到达目标点后移出
                this.showMoveDot = this.showMoveDot.map(item => false);
M
update  
maguohua 已提交
635
                el.children[0].style.opacity = 1;
M
update  
maguohua 已提交
636 637 638 639
                //监听运动结束,通知父级进行后续操作
                el.children[0].addEventListener('transitionend', () => {
                    this.listenInCart();
                })
M
update  
maguohua 已提交
640 641 642
                el.children[0].addEventListener('webkitAnimationEnd', () => {
                    this.listenInCart();
                })
M
update  
maguohua 已提交
643
            },
M
maguohua 已提交
644 645
        },
        watch: {
M
maguohua 已提交
646
            //showLoading变化时说明组件已经获取初始化数据,在下一帧nextTick进行后续操作
M
maguohua 已提交
647 648 649 650
            showLoading: function (value){
                if (!value) {
                    this.$nextTick(() => {
                        this.getFoodListHeight();
M
maguohua 已提交
651
                        this.initCategoryNum();
M
maguohua 已提交
652 653
                    })
                }
M
maguohua 已提交
654 655 656 657 658
            },
            shopCart: function (value){
                this.initCategoryNum();
            },
            cartFoodList: function (value){
M
maguohua 已提交
659
                if(!value.length){
M
maguohua 已提交
660 661
                    this.showCartList = false;
                }
M
udpate  
maguohua 已提交
662 663 664 665
            },
            changeShowType: function (value){
                if (value === 'rating') {
                    this.$nextTick(() => {
M
update  
maguohua 已提交
666 667 668 669 670 671 672 673 674 675 676 677 678 679
                        this.ratingScroll = new BScroll('#ratingContainer', {
                            probeType: 3,
                            deceleration: 0.003,
                            bounce: false,
                            swipeTime: 2000,
                            click: true,
                        });
                        this.ratingScroll.on('scroll', (pos) => {
                            if (Math.abs(Math.round(pos.y)) >=  Math.abs(Math.round(this.ratingScroll.maxScrollY))) {
                                this.loaderMoreRating();
                                this.ratingScroll.refresh();
                            }
                            
                        })
M
udpate  
maguohua 已提交
680 681
                    })
                }
M
maguohua 已提交
682
            }
M
maguohua 已提交
683 684
        }
    }
M
updata  
maguohua 已提交
685 686 687
</script>

<style lang="scss" scoped>
M
update  
maguohua 已提交
688
    @import 'src/style/mixin';
M
maguohua 已提交
689 690 691 692 693 694 695
    @keyframes mymove{
       0%   { transform: scale(1) }
       25%  { transform: scale(.8) }
       50%  { transform: scale(1.1) }
       75%  { transform: scale(.9) }
       100% { transform: scale(1) }
    }
M
update  
maguohua 已提交
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
    @-moz-keyframes mymove{
       0%   { transform: scale(1) }
       25%  { transform: scale(.8) }
       50%  { transform: scale(1.1) }
       75%  { transform: scale(.9) }
       100% { transform: scale(1) }
    }
    @-webkit-keyframes mymove{
       0%   { transform: scale(1) }
       25%  { transform: scale(.8) }
       50%  { transform: scale(1.1) }
       75%  { transform: scale(.9) }
       100% { transform: scale(1) }
    }
    @-o-keyframes mymove{
       0%   { transform: scale(1) }
       25%  { transform: scale(.8) }
       50%  { transform: scale(1.1) }
       75%  { transform: scale(.9) }
       100% { transform: scale(1) }
    }
M
maguohua 已提交
717 718 719 720 721 722 723 724
    .shop_container{
        display: flex;
        flex-direction: column;
        position: absolute;
        right: 0;
        left: 0;
        height: 100%;
    }
M
maguohua 已提交
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 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767
    
    .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);
M
maguohua 已提交
768
                        width: 11.5rem;
M
maguohua 已提交
769 770 771 772 773 774 775 776 777 778 779
                    }
                }
                .description_arrow{
                    @include ct;
                    right: 0.3rem;
                    z-index: 11;
                }
            }
            .description_footer{
                @include fj;
                margin-top: 0.5rem;
M
updata  
maguohua 已提交
780
                padding-right: 1rem;
M
maguohua 已提交
781 782 783 784 785 786 787 788 789 790 791 792 793
                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{
M
udpate  
maguohua 已提交
794
                    width: 84%;
M
maguohua 已提交
795
                }
M
updata  
maguohua 已提交
796 797 798 799 800
                .footer_arrow{
                    @include wh(.45rem, .45rem);
                    position: absolute;
                    right: .3rem;
                }
M
maguohua 已提交
801
            }
M
udate  
maguohua 已提交
802 803 804
        }
    }
    .activities_details{
M
udpate  
maguohua 已提交
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #262626;
        z-index: 200;
        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;
M
maguohua 已提交
833
                }
M
udpate  
maguohua 已提交
834 835 836
                span{
                    color: #fff;
                    line-height: .6rem;
M
maguohua 已提交
837 838
                }
            }
M
udpate  
maguohua 已提交
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862
        }
        .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;
        }
    }
M
maguohua 已提交
863
            
M
maguohua 已提交
864 865 866 867 868
    .food_container{
        display: flex;
        flex: 1;
        padding-bottom: 2rem;
    }
M
maguohua 已提交
869 870 871
    .menu_container{
        display: flex;
        flex: 1;
M
udpate  
maguohua 已提交
872
        overflow-y: hidden;
M
maguohua 已提交
873 874
        .menu_left{
            background-color: #f8f8f8;
M
maguohua 已提交
875
            width: 3.8rem;
M
maguohua 已提交
876 877 878 879 880
            .menu_left_li{
                padding: .7rem .3rem;
                border-bottom: 0.025rem solid #ededed;
                box-sizing: border-box;
                border-left: 0.15rem solid #f8f8f8;
M
maguohua 已提交
881
                position: relative;
M
maguohua 已提交
882 883 884 885 886 887
                img{
                    @include wh(.5rem, .6rem);
                }
                span{
                    @include sc(.6rem, #666);
                }
M
maguohua 已提交
888 889 890 891 892 893 894 895 896 897 898 899 900 901
                .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 已提交
902 903 904 905
            }
            .activity_menu{
                border-left: 0.15rem solid #3190e8;
                background-color: #fff;
M
maguohua 已提交
906
                span:nth-of-type(1){
M
maguohua 已提交
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001
                    font-weight: bold;
                }
            }
        }
        .menu_right{
            flex: 4;
            .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);
                }
            }
            .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);
M
maguohua 已提交
1002 1003 1004 1005
                                    p{
                                        white-space: nowrap;
                                        line-height: .4rem;
                                    }
M
maguohua 已提交
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076
                                }
                                .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);
                        }
                    }
                }
            }
        }
    }
M
maguohua 已提交
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
    .buy_cart_container{
        position: absolute;
        background-color: #3d3d3f;
        bottom: 0;
        left: 0;
        z-index: 13;
        display: flex;
        @include wh(100%, 2rem);
        .cart_icon_num{
            flex: 1;
            .cart_icon_container{
M
update  
maguohua 已提交
1088
                display: flex;
M
maguohua 已提交
1089 1090 1091
                background-color: #3d3d3f;
                position: absolute;
                padding: .4rem;
M
update  
maguohua 已提交
1092
                border: 0.18rem solid #444;
M
maguohua 已提交
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180
                border-radius: 50%;
                left: .5rem;
                top: -.7rem;
                .cart_icon{
                    @include wh(1.2rem, 1.2rem);
                }
                .cart_list_length{
                    position: absolute;
                    top: -.25rem;
                    right: -.25rem;
                    background-color: #ff461d;
                    line-height: .7rem;
                    text-align: center;
                    border-radius: 50%;
                    border: 0.025rem solid #ff461d;
                    min-width: .7rem;
                    height: .7rem;
                    @include sc(.5rem, #fff);
                    font-family: Helvetica Neue,Tahoma,Arial;
                }
            }
            .move_in_cart{
                animation: mymove .5s ease-in-out;
            }
            .cart_icon_activity{
                 background-color: #3190e8;
            }
            .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;
            .gotopay_button_style{
                @include sc(.7rem, #fff);
                font-weight: bold;
            }
        }
        .gotopay_acitvity{
            background-color: #4cd964;
        }
    }
    .cart_food_list{
        position: fixed;
        width: 100%;
        padding-bottom: 2rem;
        z-index: 12;
        bottom: 0;
        left: 0;
        background-color: #fff;
        header{
            @include fj;
            align-items: center;
            padding: .3rem .6rem;
            background-color: #eceff1;
            svg{
                @include wh(.6rem,.6rem);
                vertical-align: middle;
            }
            h4{
                @include sc(.7rem, #666);
            }
            .clear_cart{
                @include sc(.6rem, #666);
            }
        }
        .cart_food_details{
            background-color: #fff;
M
update  
maguohua 已提交
1181 1182
            max-height: 20rem;
            overflow-y: auto;
M
maguohua 已提交
1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237
            .cart_food_li{
                @include fj;
                padding: .6rem .5rem;
                .cart_list_num{
                    width: 55%;
                    p:nth-of-type(1){
                        @include sc(.7rem, #666);
                        font-weight: bold;
                    }
                    p:nth-of-type(2){
                        @include sc(.4rem, #666);
                    }
                }
                .cart_list_price{
                    font-size: 0;
                    span:nth-of-type(1){
                        @include sc(.6rem, #f60);
                        font-family: Helvetica Neue,Tahoma;

                    }
                    span:nth-of-type(2){
                        @include sc(.7rem, #f60);
                        font-family: Helvetica Neue,Tahoma;
                        font-weight: bold;
                    }
                }
                .cart_list_control{
                    display: flex;
                    align-items: center;
                    svg{
                        @include wh(.8rem, .8rem);
                        fill: #3190e8;
                    }
                    .specs_reduce_icon{
                        fill: #999;
                    }
                    .cart_num{
                        @include sc(.6rem, #666);
                        min-width: 1rem;
                        text-align: center;
                        font-family: Helvetica Neue,Tahoma;
                    }
                }
            }
        }
    }
    .screen_cover{
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(0,0,0,.3);
        z-index: 11;
    }
M
upata  
maguohua 已提交
1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258
    .change_show_type{
        display: flex;
        background-color: #fff;
        padding: .3rem 0 .6rem;
        border-bottom: 1px solid #ebebeb;
        div{
            flex: 1;
            text-align: center;
            span{
                @include sc(.65rem, #666);
                padding: .2rem .1rem;
                border-bottom: 0.12rem solid #fff;
            }
            .activity_show{
                color: #3190e8;
                border-color: #3190e8;
            }
        }
    }
    .rating_container{
        flex: 1;
M
udpate  
maguohua 已提交
1259
        overflow-y: hidden;
M
upata  
maguohua 已提交
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394
        flex-direction: column;
        p, span, li, time{
            font-family: Helvetica Neue,Tahoma,Arial;
        }
        .rating_header{
            display: flex;
            background-color: #fff;
            padding: .8rem .5rem;
            margin-bottom: 0.5rem;
            .rating_header_left{
                flex: 3;
                text-align: center;
                p:nth-of-type(1){
                    @include sc(1.2rem, #f60);
                }
                p:nth-of-type(2){
                    @include sc(.65rem, #666);
                    margin-bottom: .1rem;
                }
                p:nth-of-type(3){
                    @include sc(.4rem, #999);
                }
            }
            .rating_header_right{
                flex: 4;
                p{
                    font-size: .65rem;
                    line-height: 1rem;
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    span:nth-of-type(1){
                        color: #666;
                        margin-right: .5rem;
                    }
                    .rating_num{
                        width: 3rem;
                        @include sc(.55rem, #f60);
                    }
                    .delivery_time{
                        @include sc(.4rem, #999);
                    }
                }
            }
        }
        .tag_list_ul{
            display: flex;
            flex-wrap: wrap;
            background-color: #fff;
            padding: .5rem;
            li{
                @include sc(.6rem, #6d7885);
                padding: .3rem .3rem;
                background-color: #ebf5ff;
                border-radius: 0.2rem;
                border: 1px;
                margin: 0 .4rem .2rem 0;
            }
            .unsatisfied{
                background-color: #f5f5f5;
                color: #aaa;
            }
            .tagActivity{
                background-color: #3190e8;
                color: #fff;
            }
        }
        .rating_list_ul{
            background-color: #fff;
            padding: 0 .5rem;
            .rating_list_li{
                border-top: 1px solid #f1f1f1;
                display: flex;
                padding: .6rem 0;
                .user_avatar{
                    @include wh(1.5rem, 1.5rem);
                    border: 0.025rem;
                    border-radius: 50%;
                    margin-right: .8rem;
                }
                .rating_list_details{
                    flex: 1;
                    header{
                        display: flex;
                        flex: 1;
                        justify-content: space-between;
                        margin-bottom: .3rem;
                        .username_star{
                            @include sc(.55rem, #666);
                            .username{
                                color: #666;
                                margin-bottom: .2rem;
                            }
                            .star_desc{
                                display: flex;
                                align-items: center;
                                .time_spent_desc{
                                    @include sc(.55rem, #666)
                                    margin-left: .15rem;
                                }
                            }
                        }
                        .rated_at{
                            @include sc(.4rem, #999);
                        }
                    }
                    .food_img_ul{
                        display: flex;
                        flex-wrap: wrap;
                        margin-bottom: .4rem;
                        li{
                            img{
                                @include wh(3rem, 3rem);
                                margin-right: .4rem;
                                display: block;
                            }
                        }
                    }
                    .food_name_ul{
                        display: flex;
                        flex-wrap: wrap;
                        li{
                            @include sc(.55rem, #999);
                            width: 2.2rem;
                            padding: .2rem;
                            border: 0.025rem solid #ebebeb;
                            border-radius: 0.15rem;
                            margin-right: .3rem;
                            margin-bottom: 4px;
                        }
                    }
                }
            }
        }
    }
M
update  
maguohua 已提交
1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493
    .specs_cover{
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,.4);
        z-index: 17;
    }
    .specs_list{
        position: fixed;
        top: 35%;
        left: 15%;
        width: 70%;
        background-color: #fff;
        z-index: 18;
        border: 1px;
        border-radius: 0.2rem;
        .specs_list_header{
            h4{
                @include sc(.7rem, #222);
                font-weight: normal;
                text-align: center;
                padding: .5rem;
            }
            .specs_cancel{
                position: absolute;
                right: .5rem;
                top: .5rem;
            }
        }
        .specs_details{
            padding: .5rem;
            .specs_details_title{
                @include sc(.6rem, #666);
            }
            ul{
                display: flex;
                flex-wrap: wrap;
                padding: .4rem 0;
                li{
                    font-size: .6rem;
                    padding: .3rem .5rem;
                    border: 0.025rem solid #ddd;
                    border-radius: .2rem;
                    margin-right: .5rem;
                }
                .specs_activity{
                    border-color: #3199e8;
                    color: #3199e8;
                }
            }
        }
        .specs_footer{
            @include fj;
            align-items: center;
            background-color: #f9f9f9;
            padding: 0.5rem;
            border: 1px;
            border-bottom-left-radius: .2rem;
            border-bottom-right-radius: .2rem;
            .specs_price{
                span{
                    color: #ff6000;
                }
                span:nth-of-type(1){
                    font-size: .5rem;
                }
                span:nth-of-type(2){
                    font-size: .8rem;
                    font-weight: bold;
                    font-family: Helvetica Neue,Tahoma;
                }
            }
            .specs_addto_cart{
                @include wh(4rem, 1.3rem);
                background-color: #3199e8;
                border: 1px;
                border-radius: 0.15rem;
                @include sc(.6rem, #fff);
                text-align: center;
                line-height: 1.3rem;
            }
        }
    }
    .show_delete_tip{
        position: fixed;
        top: 50%;
        left: 15%;
        width: 70%;
        transform: translateY(-50%);
        background-color: rgba(0,0,0,.8);
        z-index: 18;
        @include sc(.65rem, #fff);
        text-align: center;
        padding: .5rem 0;
        border: 1px;
        border-radius: 0.25rem;
    }
M
update  
maguohua 已提交
1494 1495 1496 1497 1498 1499 1500 1501 1502 1503
    .move_dot{
        position: fixed;
        bottom: 30px;
        left: 30px;
    
        svg{
            @include wh(.8rem, .8rem);
            fill: #3190e8;
        }
    }
M
maguohua 已提交
1504 1505 1506 1507 1508 1509
    .fade-enter-active, .fade-leave-active {
        transition: opacity .5s;
    }
    .fade-enter, .fade-leave-active {
        opacity: 0;
    }
M
maguohua 已提交
1510 1511 1512 1513 1514 1515 1516 1517 1518
    .fade-choose-enter-active, .fade-choose-leave-active {
        transition: opacity .5s;
    }
    .fade-choose-leave, .fade-choose-leave-active {
        display: none;
    }
    .fade-choose-enter, .fade-choose-leave-active {
        opacity: 0;
    }
M
maguohua 已提交
1519 1520 1521 1522 1523 1524
    .router-slid-enter-active, .router-slid-leave-active {
        transition: all .4s;
    }
    .router-slid-enter, .router-slid-leave-active {
        transform: translateX(100%);
    }
M
maguohua 已提交
1525 1526 1527 1528 1529 1530
    .toggle-cart-enter-active, .toggle-cart-leave-active {
        transition: all .3s ease-out;
    }
    .toggle-cart-enter, .toggle-cart-leave-active {
        transform: translateY(100%);
    }
M
update  
maguohua 已提交
1531

M
updata  
maguohua 已提交
1532
</style>