فهرست منبع

修复碎屏险

宇宙无敌M1处理器的MacBook Pro 4 سال پیش
والد
کامیت
ee8ac71988
2فایلهای تغییر یافته به همراه1321 افزوده شده و 1340 حذف شده
  1. 864 830
      components/page-component/goods/u-attr.vue
  2. 457 510
      plugins/gift/goods/goods.vue

+ 864 - 830
components/page-component/goods/u-attr.vue

xqd
@@ -1,830 +1,864 @@
-<template>
-    <view class="u-attr">
-        <view @click="turnOn">
-            <slot name="btn"></slot>
-        </view>
-        <u-popup v-model="newValue" mode="bottom" border-radius="14" :safeAreaInsetBottom="true" @close="close">
-            <view class="u-model" @touchmove.stop.prevent>
-                <view class="u-top dir-left-nowrap u-border-box">
-                    <view class="u-pic u-border-box" @click="clickImg(imgUrl)">
-                        <image class="u-img" :src="imgUrl"></image>
-                    </view>
-                    <view class="u-info">
-                        <view :class="['cross-center', 'dir-left-nowrap', themeObject.color]">
-                            <view class="dir-left-nowrap">
-                                <slot name="priceBefore"></slot>
-                                <view class="u-price">
-                                    <app-price
-                                        v-if="is_show_price"
-                                        :theme="themeObject.theme"
-                                        :userTheme="themeObject.userTheme"
-                                        :sign="sign"
-                                        :price="sellPrice"
-                                        :default-price="goods.price"
-                                    ></app-price>
-                                </view>
-                            </view>
-                            <app-member-mark
-                                v-if="goods.level_show === 1"
-                                :theme="themeObject"
-                            ></app-member-mark>
-                        </view>
-                        <view class="u-stock">库存:{{stock}}</view>
-                    </view>
-                    <view class="u-close-image" @click="close">
-                        <image class="bd-close-image u-border-box" src="/static/image/icon/icon-close.png" ></image>
-                    </view>
-                </view>
-                <view class="u-center">
-                    <scroll-view class="u-scroll-view" scroll-y="true">
-                        <slot name="extra"></slot>
-                        <view v-if="goods.type === 'goods'" class="u-attr-group u-border-box" v-for="(item, index) in newGroup" :key="index">
-							<view class="u-group-name u-text">{{item.attr_group_name}}</view>
-                            <view class="dir-left-wrap" >
-                                <view :class="['u-group-item', attr.select ? 'u-checked ' + themeObject.back : 'u-unchecked', attr.num_0 ? 'u-attr_num_0' : '']"
-                                      @click="storeAttr(attr.attr_id, item.attr_group_id, attr.num_0)"
-                                      v-for="(attr, key) in item.attr_list" :key="key">
-                                    {{attr.attr_name}}
-                                </view>
-                            </view> 
-                        </view>  
-						<view class="service" v-if="enable_screen&&service_screen&&service_screen.screenList&&service_screen.screenList.length>0">
-							<view class="service_title">全优汇服务</view>
-							<view class="service_item">
-								<image style="width: 26upx;height:26upx;" src="https://t12.9026.com/web/statics/icon1/sp.png"> </image>
-				
-								<view ><view style="float: left;">碎屏险</view><view class="slh">{{screenDescription}}</view>
-								</view>
-		
-								<view style="color: red;" @click="gotoSpDetail">服务说明
-									<image style="width: 26upx;height:26upx;" src="https://t12.9026.com/web/statics/icon1/问号.png"> </image>
-								</view>
-							<!-- 	<view>{{service_screen.screenList.intro}}</view> -->
-							</view>
-							<view class="service_value">
-								<view class="service_block" 
-									v-for="(item,index) of service_screen.screenList" 
-									:class="{service_block_active:index == serviceId}"
-									@click="select_service(index)">
-										{{item.name}} ¥{{item.price}}
-								</view>
-							</view>
-						</view>
-                        <view class="u-number dir-left-nowrap main-between cross-center">
-                            <view class="u-text">数量</view>
-                            <view class="dir-left-nowrap u-input-box">
-                                <view @click.stop="numberSub" :class="[number <=1 ? 'u-reduced-1' : 'u-reduced-0', 'u-number-btn']"></view>
-                                <input @blur="numberBlur" type="number" class="u-input" v-model="number">
-                                <view @click.stop="numberAdd" class="u-number-btn u-added-1"></view>
-                            </view>
-                        </view>
-                    </scroll-view>
-                </view>
-                <view class="u-bottom dir-left-nowrap">
-                    <view
-                        v-if="is_show_left && (goods.type === 'goods' || is_must_left)"
-                        class="box-grow-1"
-                        :class="cartClass"
-                        @click="leftSubmit">
-                        <slot name="left_slot"></slot>
-                        <template v-if="!$slots.left_slot">{{leftText}}</template>
-                    </view>
-                    <view
-                        v-if="is_show_right"
-                        class="box-grow-1"
-                        @click="rightSubmit"
-                        :class="[!$slots.right_slot ? themeObject.back + ' u-btn u-btn-color' : '']"
-                    >
-                        <slot name="right_slot"></slot>
-                        <template v-if="!$slots.right_slot">{{rightText}}</template>
-                    </view>
-                    <template v-if="$slots.right">
-                        <slot name="right"></slot>
-                    </template>
-                </view>
-            </view>
-        </u-popup>
-    </view>
-</template>
-
-<script>
-	    import { mapState } from 'vuex'
-    import uPopup from '../../basic-component/u-popup/u-popup.vue';
-    import appPrice from "../goods/app-price.vue";
-    import appMemberMark from "../app-member-mark/app-member-mark.vue";
-
-    export default {
-        name: "u-attr",
-        props: {
-            value: {
-                type: Boolean
-            },
-            goods: {
-                type: Object
-            },
-            themeObject: {
-                type: Object
-            },
-            checked: {
-                type: Object
-            },
-            is_show_price: {
-                type: Boolean,
-                default: true
-            },
-            is_show_left: {
-                type: Boolean,
-                default: true
-            },
-            is_must_left: {
-                type: Boolean,
-                default: true
-            },
-            is_show_right: {
-                type: Boolean,
-                default: true
-            },
-			enable_screen:{
-				type: Boolean,
-				default: true
-			},
-            leftText: {
-                type: String,
-                default: '加入购物车'
-            },
-            rightText: {
-                type: String,
-                default: '立即购买'
-            },
-            leftFunc: {
-                type: Boolean
-            },
-            rightFunc: {
-                type: Boolean
-            },
-            sign: {
-                type: String
-            },
-            again: {
-                type: Number
-            }
-        },
-        data() {
-            return {
-                newValue: false,
-                picUrl: null,
-                newGroup: [],
-                number: 1,
-				service_screen:null,		//碎屏险
-				service_label:null,			//当前对屏对象
-				serviceId:null,				//碎屏险ID
-				card_id:null,
-				screenDescription:''
-            }
-        },
-        methods: {
-			gotoSpDetail(){
-				uni.navigateTo({
-					url:"/pages/goods/spDetail"
-				})
-			},
-			select_service(index){
-				if( this.serviceId == index){
-					this.serviceId = null
-					this.screenDescription=""
-					this.service_label=null
-					this.card_id=null
-				}else{
-					this.serviceId = index
-					this.screenDescription=this.service_screen.screenList[index]['description']||''
-					this.service_label = this.service_screen.screenList[index]
-					this.card_id = this.service_screen.screenList['card_id']
-					
-				} 
-				this.checked.service_label=this.service_label;
-				this.checked.card_id=this.card_id;
-				this.checked.hasScreen=this.hasCurrentServiceData();
-				this.$emit('check', this.checked,this.number);
-			// 	if(this.serviceId || this.serviceId===0){
-			// 		this.service_screen.screenList.forEach((item,index)=>{
-			
-			// 			this.screenDescription=this.service_screen.screenList[index]['description']||''
-						
-					
-			// 		})
-			// 	}else{
-			// 		this.service_label = null
-			// 	}
-			},
-			getservice(copyGroup, attrNum_0, select){
-				console.log('getservice,164')
-				console.log(copyGroup, attrNum_0, select)
-				console.log(this.goods.attr)
-				console.log(select)
-				let select_val = []
-				this.goods.attr.forEach((item,index)=>{
-					console.log(item)
-					let select_item_list = [] 
-					let select_item_value = ''
-					let attrList=item.attr_list||[];
-					attrList.forEach((value,key)=>{ 
-						select_item_value = value.attr_group_id+'-'+value.attr_id
-						select_item_list.push(select_item_value) 
-					})
-					if(JSON.stringify(select) == JSON.stringify(select_item_list)){ 
-						this.service_screen = item
-					}
-					 
-				})
-				 
-				
-			},
-			getserviceByAttrId(){
-				let that=this;
-				this.goods.attr.forEach((item,index)=>{
-				
-					if(item.id==this.checked.id){
-						that.service_screen = item
-						that.select_service(0);
-						 
-					}
-				
-				})	
-			},
-			hasCurrentServiceData(){
-				let that=this;
-				let result=0;
-				console.log(this.service_screen)
-				if(this.enable_screen&&this.service_screen&&this.service_screen.screenList
-				&&this.service_screen.screenList.length>0){
-					
-						result=1;
-					
-				}
-				else
-					result=0;
-				return result;
-			},
-            close: function() {
-                this.$emit('input', false);
-            },
-            turnOn: function() {
-                this.$emit('input', true);
-            },
-            inArray: function(newVal, arr) {
-                return arr.some(v => {
-                    return newVal === v;
-                });
-            },
-            identifier: function(copyGroup, attrNum_0, select) {
-				console.log('identifier,175')
-                copyGroup.forEach(f => {
-                    f.attr_list.forEach(c => {
-                        let param = `${f.attr_group_id}-${c.attr_id}`;
-                        this.inArray(param, attrNum_0) && !this.inArray(param, select) ? c.num_0 = true : c.num_0 = false;
-                    });
-                });
-            },
-            selectCheck: function(copyAttr, attrNum_0, select) {
-				
-                copyAttr.forEach(f => {
-                    let arr = [];
-                    let sign = 0;
-					let attrList=f.attr_list||[]
-                    attrList.forEach(c => {
-                        let param = `${c.attr_group_id}-${c.attr_id}`;
-                        if (!this.inArray(param, select)) {
-                            sign += 1;
-                            arr.push(param);
-                        }
-                    });
-                    if (f.stock === 0 && sign <= 1) Array.prototype.push.apply(attrNum_0, arr);
-					console.log("eeeeeeeeeeeeeeeee")
-					console.log(f)
-					f.service_label=this.service_label;
-					f.card_id=this.card_id;
-					f.hasScreen=this.hasCurrentServiceData();
-                    if (sign === 0) {
-                        this.$emit('check', f, 1);
-                    }
-                });
-            },
-            storeAttr: function(attr_id, group_id, num_0) {
-				console.log(201) 
-                if (num_0 === true) return;
-                let newGroup = this.newGroup;
-                let copyAttr = this.copyAttr;
-                let select = []; 
-				console.log(newGroup)
-				console.log(attr_id)
-				console.log(group_id)
-                newGroup.forEach((i, index) => { 
-                    let attr_list = i.attr_list;
-                    attr_list.forEach((k) => {
-                        if (i.attr_group_id === group_id) {
-                            if (k.attr_id === attr_id) {
-                                if (k.select === true) {
-                                    k.select = false;
-                                } else {
-                                    k.select = true;
-                                }
-                            } else {
-                                k.select = false;
-                            }
-                            // k.attr_id === attr_id ? k.select = true : k.select = false;
-                        }
-                        if (k.select === true) {
-                            select.push(`${i.attr_group_id}-${k.attr_id}`);
-                            if (index === 0) this.picUrl = k.pic_url;
-                        }
-                    });
-                });
-                let attrNum_0 = [];
-				console.log(230)
-				console.log(copyAttr)
-				console.log(attrNum_0)
-				console.log(select)
-                this.selectCheck(copyAttr, attrNum_0, select); 
-				
-                this.$nextTick(() => {
-                    if (this.number > this.stock) this.number = this.stock;
-                });
-                this.identifier(newGroup, attrNum_0, select);
-				this.getservice(newGroup, attrNum_0, select)
-                if (select.length !== newGroup.length) {
-                    this.$emit('check', null, 1);
-                }
-            },
-            firstSelect: function() {
-				console.log("ddddd")
-				console.log(this.copyAttr)
-					console.log(this.copyGroup)
-                if (!this.copyGroup || !this.copyAttr) return;
-                let copyGroup = this.copyGroup;
-                let copyAttr = this.copyAttr;
-                let groupLength = copyGroup.length;
-                let select = [];
-				
-                copyAttr.forEach(i => {
-                    let attr_list = i.attr_list||[];
-                    attr_list.forEach(j => {
-                        let attr_group_id = j.attr_group_id;
-                        copyGroup.forEach(k => {
-                            if (attr_group_id === k.attr_group_id) {
-                                let groups_attr_list = k.attr_list;
-                                groups_attr_list.forEach(g => {
-                                    if (g.attr_id === j.attr_id) {
-                                        if (i.stock > 0) {
-                                            if (groupLength > 0) {
-                                                g.select = true;
-                                                select.push(`${k.attr_group_id}-${g.attr_id}`);
-                                                if (groupLength === copyGroup.length) {
-                                                    this.picUrl = g.pic_url;
-                                                }
-                                                groupLength--;
-                                            }
-                                        }
-                                    }
-                                });
-                            }
-                        });
-                    });
-                });
-                let attrNum_0 = [];
-				
-                this.selectCheck(copyAttr, attrNum_0, select);
-                this.identifier(copyGroup, attrNum_0, select);
-				this.getservice(copyGroup, attrNum_0, select);	//getservice
-                this.newGroup = copyGroup;
-				console.log(this.newGroup)
-            },
-            numberBlur: function (e) {
-                let value = parseInt(e.detail.value);
-                if (!value) value = 1;
-                if (value > this.stock) {
-                    value = this.stock;
-                    uni.showToast({
-                        title: '库存不足',
-                        icon: 'none'
-                    });
-                }
-                this.number = value;
-            },
-            numberSub:function() {
-                let value = this.number;
-                if (value > 1) {
-                    value--;
-                    this.number = value;
-                }
-            },
-            numberAdd: function() {
-                let value = this.number;
-                value++;
-                if (value > this.stock) {
-                    value = this.stock;
-                    uni.showToast({
-                        title: '库存不足',
-                        icon: 'none'
-                    });
-                }
-                this.number = value;
-            },
-            leftSubmit:function() {
-                if (this.leftFunc === true) {
-                    this.$emit('leftFunc', this.number);
-                } else {
-                    this.cart();
-                }
-                this.close();
-            },
-            rightSubmit:function() { 
-				
-				
-				let _this = this
-                if (!this.checked) {
-                    uni.showToast({
-                        title: '请先选规格',
-                        icon: 'none'
-                    });
-                    return false;
-                }
-				
-		
-				// if (!this.service_label) {
-				// 	uni.showModal({
-				// 		title: '提示',
-				// 		content: '确定不需要碎屏险吗?',
-				// 		success: function (res) {
-				// 			if (res.confirm) {
-				// 				_this.submit()
-				// 			} else if (res.cancel) {
-				// 				return false
-				// 			}
-				// 		}
-				// 	});
-				// }else{
-				// 	this.submit()
-				// } 
-				this.submit()
-            },
-			submit(){
-				if (this.$user.isLogin() && this.$store.state.user.info) {
-				    let  member_level =this.$store.state.user.info.identity.member_level;
-					if(member_level<this.goods.member_level){
-						uni.showModal({
-							title:"提示",
-							content:"需达到"+this.goods.member_name+"会员才可购买",
-							showCancel:true,
-							buttonText: '升级',
-							success:(res)=>{
-								if (res.confirm) {
-								  uni.navigateTo({
-								  	// url:"/pages/member/index/index",
-									url: '/pages/member/upgrade/upgrade?level=' + member_level + '&other=' + this.goods.member_level
-								  })
-								} else if (res.cancel) {
-								  console.log('用户点击取消');
-								}
-				
-							}
-						})
-						return;
-					}
-					
-				}
-				let attrs = [];
-				let _this = this
-				let attrList=_this.checked.attr_list||[];
-				attrList.forEach(item => {
-				    attrs.push({
-				        attr_id: item.attr_id,
-				        attr_group_id: item.attr_group_id
-				    });
-				});
-				let goods = {
-				    mch_id: _this.goods.mch_id ? _this.goods.mch_id : 0,
-					hasScreen:_this.hasCurrentServiceData(),
-				    goods_list: [
-				        {
-				            id: _this.goods.id,
-				            attrs,
-				            num: _this.number,
-				            cat_id: 0,
-							card_id:_this.card_id,
-				            goods_attr_id: _this.checked.id, 
-							service_label: _this.service_label
-				        }
-				    ]
-				}
-				if (_this.rightFunc === true) {
-					console.log(333)
-				    _this.$emit('rightFunc', goods);
-				} else {
-					console.log(336)
-				    _this.shop(goods);
-				}
-				if(_this.service_label['id']||0)
-				_this.close();
-			},
-            shop: function(goods) {
-				console.log(342)
-				console.log(goods)
-				 let hasScreen= this.hasCurrentServiceData();
-                uni.navigateTo({
-                    url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}&hasScreen=${hasScreen}`
-                });
-            },
-            cart: function() {
-                if (!this.checked) {
-                    uni.showToast({
-                        title: '请先选规格',
-                        icon: 'none'
-                    });
-                    return false;
-                }
-                if (this.goods.type === 'ecard') return;
-                this.$request({
-                    url: this.$api.cart.add,
-                    method: 'post',
-                    data: {
-                        goods_id: this.checked.goods_id,
-                        attr: this.checked.id,
-                        num: this.number
-                    }
-                }).then(res => {
-                    if (res.code === 0) {
-                        uni.showToast({
-                            title: res.msg,
-                            icon: 'none'
-                        });
-                        this.$emit('cart', this.checked, this.number);
-                        this.close();
-                    } else {
-                        uni.showToast({
-                            title: res.msg,
-                            icon: "none",
-                            duration: 2500
-                        });
-                    }
-                });
-            },
-            clickImg(src) {
-                uni.previewImage({
-                    current: 0,
-                    urls: [src]
-                });
-            }
-        },
-        components: {
-            uPopup,
-            appPrice,
-            appMemberMark
-        },
-        computed: {
-            imgUrl: function() {
-                if (this.picUrl) {
-                    return this.picUrl;
-                } else if (this.goods) {
-                    return this.goods.cover_pic;
-                } else {
-                    return '';
-                }
-            },
-            stock: function() {
-                if (!this.$validation.isEmpty(this.checked)) {
-                    return this.checked.stock;
-                } else if (!this.$validation.isEmpty(this.goods)) {
-                    return this.goods.goods_num;
-                }
-            },
-            sellPrice: function() {
-                if (!this.$validation.isEmpty(this.checked)) {
-                    return this.goods.level_show === 1 ? this.checked.price_member : this.checked.price;
-                } else if (!this.$validation.isEmpty(this.goods)) {
-                    return this.goods.hasOwnProperty('price_min') ? this.goods.price_min : this.goods.price;
-                }
-            },
-            copyGroup: function() {
-                if (!this.goods) return;
-                let group = this.$utils.deepClone(this.goods.attr_groups);
-                for (let i = 0; i < group.length; i++) {
-                    group[i].attr_list.forEach(item => {
-                        item.select = false;
-                        item.num_0 = false;
-                    });
-                }
-                return group;
-            },
-            copyAttr: function() {
-                if (!this.goods) return;
-                return this.$utils.deepClone(this.goods.attr);
-            },
-            cartClass: function() {
-                if (!this.$slots.left_slot) {
-                    if (this.themeObject.theme === 'a' || this.themeObject.theme === 'b' || this.themeObject.theme === 'f') {
-                        return this.themeObject.sBack + ' u-btn u-btn-color ';
-                    } else {
-                        return this.themeObject.sBack + ' u-btn ' + this.themeObject.color;
-                    }
-                } else {
-                    return '';
-                }
-            }
-        },
-        watch: {
-            value: {
-                handler(newVal) {
-                    this.newValue = newVal;
-                    if (newVal === false) return;
-                    if (this.$validation.isEmpty(this.checked)||this.checked.first) this.$utils.throttle(this.firstSelect, 800);
-                },
-                immediate: true
-            },
-            number: {
-                handler(newVal) {
-					this.checked.service_label=this.service_label;
-					this.checked.card_id=this.card_id;
-					this.checked.hasScreen=this.hasCurrentServiceData();
-                    this.$emit('check', this.checked, newVal);
-                }
-            },
-            again: {
-                handler() {
-                   // this.firstSelect();
-                }
-            }
-        }
-    }
-</script>
-
-<style scoped >
-    .u-model {
-        width: 750upx;
-    }
-    .u-top {
-        margin: 0 24upx;
-        border-bottom: 1upx solid #e2e2e2;
-        height: 140upx;
-    }
-    .u-close-image {
-        width: 54upx;
-        height: 78upx;
-        padding: 24upx 0 24rpx 24rpx;
-        margin-left: 24rpx;
-    }
-    .bd-close-image {
-        width: 30upx;
-        height: 30upx;
-    }
-    .u-pic {
-        width: 200rpx;
-        height: 200rpx;
-        padding: 4upx;
-        border-radius: 8rpx;
-        position: relative;
-        top: -64upx;
-        background-color: #ffffff;
-    }
-    .u-img {
-        width: 192rpx;
-        height: 192rpx;
-        background-color: #ffffff;
-    }
-    .u-info {
-        width: 424upx;
-        height: 136upx;
-        padding: 45upx 0 0 24upx;
-    }
-    .u-scroll-view {
-        width: 100%;
-        max-height: calc(80vh - 154upx);
-    }
-    .u-attr-group {
-        margin:24upx 32upx 0 32upx;
-        border-bottom: 1upx solid #e2e2e2;
-    }
-    .u-number {
-        height: 124upx;
-        margin: 0 32upx;
-    }
-    .u-group-name {
-        margin-bottom: 20upx;
-    }
-    .u-group-item {
-        padding: 15upx 24upx;
-        border-radius: 8upx;
-        margin:0 20upx 20upx 0;
-        font-size: 26upx;
-    }
-    .u-checked {
-        color: #ffffff;
-    }
-    .u-unchecked {
-        background-color: #f2f2f2;
-        color: #353535;
-    }
-    .u-attr_num_0 {
-        background-color: #f7f7f7;
-        color: #cdcdcd;
-    }
-    .u-stock {
-        font-size: 24upx;
-        color: #999999;
-    }
-    .u-price {
-        margin-right: 12upx;
-    }
-    .u-input {
-        width: 88upx;
-        height: 60upx;
-        background-color: #f7f7f7;
-        font-size: 20upx;
-        color: #353535;
-        text-align: center;
-    }
-    .u-input-box {
-        width: 218upx;
-    }
-    .u-number-btn {
-        height: 60upx;
-        width: 60upx;
-        background-repeat: no-repeat;
-        background-size: 100% 100%;
-        background-position: center;
-    }
-    .u-number-btn:first-child {
-        margin-right: 5upx;
-    }
-    .u-number-btn:last-child {
-        margin-left: 5upx;
-    }
-    .u-reduced-1 {
-        background-image: url("../../../static/image/icon/can-be-reduced.png");
-    }
-    .u-reduced-0 {
-        background-image: url("../../../static/image/cart/can-be-reduced.png");
-    }
-    .u-added-1 {
-        background-image: url("../../../static/image/cart/can-be-added.png");
-    }
-    .u-text {
-        font-size: 26upx;
-        color: #666666;
-    }
-    .u-bottom {
-        height: 110upx;
-    }
-    .u-btn {
-        text-align: center;
-        line-height: 110upx;
-    }
-    .u-btn-color {
-        color: #ffffff;
-    }
-	.service_title{  
-		padding-top: 10px;
-		margin:14px 10px 10px; 
-		font-weight: 700;
-		font-size: 13px;
-	}
-	.service_item{
-		margin:14px 10px 0px; 
-		font-size:26rpx;
-		color:#666;
-		display:flex;
-		justify-content: space-between;
-	}
-	.service_value{
-		display:flex;
-		flex-wrap: wrap;
-		padding:0px 10px;
-	}
-	.service_block{
-		min-width:46%;
-		height: 28px;
-		line-height:26px;
-		border: 1px solid #f5f5f5;
-		border-radius: 16px;
-		text-align:center;
-		margin-right: 10px;
-		margin-top: 10px;
-		font-size: 12px;
-		background-color: #f5f5f5;
-		position: relative;
-	}
-	.service_block_active{
-		color:#f21c1c;
-		border:1px solid #f21c1c;
-	}
-	.slh{
-		margin-left: 5upx;
-		 overflow : hidden;
-		  text-overflow: ellipsis;
-		  width: 460upx;
-		 white-space:nowrap;
-		 float:left;
-	/* 	  display: -webkit-box;
-		  -webkit-line-clamp: 1;
-		  -webkit-box-orient: vertical; */
-	}
-</style>
+<template>
+	<view class="u-attr">
+		<view @click="turnOn">
+			<slot name="btn"></slot>
+		</view>
+		<u-popup v-model="newValue" mode="bottom" border-radius="14" :safeAreaInsetBottom="true" @close="close">
+			<view class="u-model" @touchmove.stop.prevent>
+				<view class="u-top dir-left-nowrap u-border-box">
+					<view class="u-pic u-border-box" @click="clickImg(imgUrl)">
+						<image class="u-img" :src="imgUrl"></image>
+					</view>
+					<view class="u-info">
+						<view :class="['cross-center', 'dir-left-nowrap', themeObject.color]">
+							<view class="dir-left-nowrap">
+								<slot name="priceBefore"></slot>
+								<view class="u-price">
+									<app-price v-if="is_show_price" :theme="themeObject.theme"
+										:userTheme="themeObject.userTheme" :sign="sign" :price="sellPrice"
+										:default-price="goods.price"></app-price>
+								</view>
+							</view>
+							<app-member-mark v-if="goods.level_show === 1" :theme="themeObject"></app-member-mark>
+						</view>
+						<view class="u-stock">库存:{{stock}}</view>
+					</view>
+					<view class="u-close-image" @click="close">
+						<image class="bd-close-image u-border-box" src="/static/image/icon/icon-close.png"></image>
+					</view>
+				</view>
+				<view class="u-center">
+					<scroll-view class="u-scroll-view" scroll-y="true">
+						<slot name="extra"></slot>
+						<view v-if="goods.type === 'goods'" class="u-attr-group u-border-box"
+							v-for="(item, index) in newGroup" :key="index">
+							<view class="u-group-name u-text">{{item.attr_group_name}}</view>
+							<view class="dir-left-wrap">
+								<view
+									:class="['u-group-item', attr.select ? 'u-checked ' + themeObject.back : 'u-unchecked', attr.num_0 ? 'u-attr_num_0' : '']"
+									@click="storeAttr(attr.attr_id, item.attr_group_id, attr.num_0)"
+									v-for="(attr, key) in item.attr_list" :key="key">
+									{{attr.attr_name}}
+								</view>
+							</view>
+						</view>
+						<view class="service"
+							v-if="enable_screen&&service_screen&&service_screen.screenList&&service_screen.screenList.length>0&&!is_gift">
+							<view class="service_title">全优汇服务</view>
+							<view class="service_item">
+								<image style="width: 26upx;height:26upx;"
+									src="https://t12.9026.com/web/statics/icon1/sp.png"> </image>
+
+								<view>
+									<view style="float: left;">碎屏险</view>
+									<view class="slh">{{screenDescription}}</view>
+								</view>
+
+								<view style="color: red;" @click="gotoSpDetail">服务说明
+									<image style="width: 26upx;height:26upx;"
+										src="https://t12.9026.com/web/statics/icon1/问号.png"> </image>
+								</view>
+								<!-- 	<view>{{service_screen.screenList.intro}}</view> -->
+							</view>
+							<view class="service_value">
+								<view class="service_block" v-for="(item,index) of service_screen.screenList"
+									:class="{service_block_active:index == serviceId}" @click="select_service(index)">
+									{{item.name}} ¥{{item.price}}
+								</view>
+							</view>
+						</view>
+						<view class="u-number dir-left-nowrap main-between cross-center">
+							<view class="u-text">数量</view>
+							<view class="dir-left-nowrap u-input-box">
+								<view @click.stop="numberSub"
+									:class="[number <=1 ? 'u-reduced-1' : 'u-reduced-0', 'u-number-btn']"></view>
+								<input @blur="numberBlur" type="number" class="u-input" v-model="number">
+								<view @click.stop="numberAdd" class="u-number-btn u-added-1"></view>
+							</view>
+						</view>
+					</scroll-view>
+				</view>
+				<view class="u-bottom dir-left-nowrap">
+					<view v-if="is_show_left && (goods.type === 'goods' || is_must_left)" class="box-grow-1"
+						:class="cartClass" @click="leftSubmit">
+						<slot name="left_slot"></slot>
+						<template v-if="!$slots.left_slot">{{leftText}}</template>
+					</view>
+					<view v-if="is_show_right" class="box-grow-1" @click="rightSubmit"
+						:class="[!$slots.right_slot ? themeObject.back + ' u-btn u-btn-color' : '']">
+						<slot name="right_slot"></slot>
+						<template v-if="!$slots.right_slot">{{rightText}}</template>
+					</view>
+					<template v-if="$slots.right">
+						<slot name="right"></slot>
+					</template>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex'
+	import uPopup from '../../basic-component/u-popup/u-popup.vue';
+	import appPrice from "../goods/app-price.vue";
+	import appMemberMark from "../app-member-mark/app-member-mark.vue";
+
+	export default {
+		name: "u-attr",
+		props: {
+			value: {
+				type: Boolean
+			},
+			goods: {
+				type: Object
+			},
+			themeObject: {
+				type: Object
+			},
+			checked: {
+				type: Object
+			},
+			is_show_price: {
+				type: Boolean,
+				default: true
+			},
+			is_show_left: {
+				type: Boolean,
+				default: true
+			},
+			is_must_left: {
+				type: Boolean,
+				default: true
+			},
+			is_show_right: {
+				type: Boolean,
+				default: true
+			},
+			enable_screen: {
+				type: Boolean,
+				default: true
+			},
+			leftText: {
+				type: String,
+				default: '加入购物车'
+			},
+			rightText: {
+				type: String,
+				default: '立即购买'
+			},
+			leftFunc: {
+				type: Boolean
+			},
+			rightFunc: {
+				type: Boolean
+			},
+			sign: {
+				type: String
+			},
+			again: {
+				type: Number
+			},
+			is_gift: {
+				type: Boolean,
+				default: false
+			}
+		},
+		data() {
+			return {
+				newValue: false,
+				picUrl: null,
+				newGroup: [],
+				number: 1,
+				service_screen: null, //碎屏险
+				service_label: null, //当前对屏对象
+				serviceId: null, //碎屏险ID
+				card_id: null,
+				screenDescription: ''
+			}
+		},
+		methods: {
+			gotoSpDetail() {
+				uni.navigateTo({
+					url: "/pages/goods/spDetail"
+				})
+			},
+			select_service(index) {
+				if (this.serviceId == index) {
+					this.serviceId = null
+					this.screenDescription = ""
+					this.service_label = null
+					this.card_id = null
+				} else {
+					this.serviceId = index
+					this.screenDescription = this.service_screen.screenList[index]['description'] || ''
+					this.service_label = this.service_screen.screenList[index]
+					this.card_id = this.service_screen.screenList['card_id']
+
+				}
+				this.checked.service_label = this.service_label;
+				this.checked.card_id = this.card_id;
+				this.checked.hasScreen = this.hasCurrentServiceData();
+				this.$emit('check', this.checked, this.number);
+				// 	if(this.serviceId || this.serviceId===0){
+				// 		this.service_screen.screenList.forEach((item,index)=>{
+
+				// 			this.screenDescription=this.service_screen.screenList[index]['description']||''
+
+
+				// 		})
+				// 	}else{
+				// 		this.service_label = null
+				// 	}
+			},
+			getservice(copyGroup, attrNum_0, select) {
+				console.log('getservice,164')
+				console.log(copyGroup, attrNum_0, select)
+				console.log(this.goods.attr)
+				console.log(select)
+				let select_val = []
+				this.goods.attr.forEach((item, index) => {
+					console.log(item)
+					let select_item_list = []
+					let select_item_value = ''
+					let attrList = item.attr_list || [];
+					attrList.forEach((value, key) => {
+						select_item_value = value.attr_group_id + '-' + value.attr_id
+						select_item_list.push(select_item_value)
+					})
+					if (JSON.stringify(select) == JSON.stringify(select_item_list)) {
+						this.service_screen = item
+					}
+
+				})
+
+
+			},
+			getserviceByAttrId() {
+				let that = this;
+				this.goods.attr.forEach((item, index) => {
+
+					if (item.id == this.checked.id) {
+						that.service_screen = item
+						that.select_service(0);
+
+					}
+
+				})
+			},
+			hasCurrentServiceData() {
+				let that = this;
+				let result = 0;
+				console.log(this.service_screen)
+				if (this.enable_screen && this.service_screen && this.service_screen.screenList &&
+					this.service_screen.screenList.length > 0) {
+
+					result = 1;
+
+				} else
+					result = 0;
+				return result;
+			},
+			close: function() {
+				this.$emit('input', false);
+			},
+			turnOn: function() {
+				this.$emit('input', true);
+			},
+			inArray: function(newVal, arr) {
+				return arr.some(v => {
+					return newVal === v;
+				});
+			},
+			identifier: function(copyGroup, attrNum_0, select) {
+				console.log('identifier,175')
+				copyGroup.forEach(f => {
+					f.attr_list.forEach(c => {
+						let param = `${f.attr_group_id}-${c.attr_id}`;
+						this.inArray(param, attrNum_0) && !this.inArray(param, select) ? c.num_0 =
+							true : c.num_0 = false;
+					});
+				});
+			},
+			selectCheck: function(copyAttr, attrNum_0, select) {
+
+				copyAttr.forEach(f => {
+					let arr = [];
+					let sign = 0;
+					let attrList = f.attr_list || []
+					attrList.forEach(c => {
+						let param = `${c.attr_group_id}-${c.attr_id}`;
+						if (!this.inArray(param, select)) {
+							sign += 1;
+							arr.push(param);
+						}
+					});
+					if (f.stock === 0 && sign <= 1) Array.prototype.push.apply(attrNum_0, arr);
+					console.log("eeeeeeeeeeeeeeeee")
+					console.log(f)
+					f.service_label = this.service_label;
+					f.card_id = this.card_id;
+					f.hasScreen = this.hasCurrentServiceData();
+					if (sign === 0) {
+						this.$emit('check', f, 1);
+					}
+				});
+			},
+			storeAttr: function(attr_id, group_id, num_0) {
+				console.log(201)
+				if (num_0 === true) return;
+				let newGroup = this.newGroup;
+				let copyAttr = this.copyAttr;
+				let select = [];
+				console.log(newGroup)
+				console.log(attr_id)
+				console.log(group_id)
+				newGroup.forEach((i, index) => {
+					let attr_list = i.attr_list;
+					attr_list.forEach((k) => {
+						if (i.attr_group_id === group_id) {
+							if (k.attr_id === attr_id) {
+								if (k.select === true) {
+									k.select = false;
+								} else {
+									k.select = true;
+								}
+							} else {
+								k.select = false;
+							}
+							// k.attr_id === attr_id ? k.select = true : k.select = false;
+						}
+						if (k.select === true) {
+							select.push(`${i.attr_group_id}-${k.attr_id}`);
+							if (index === 0) this.picUrl = k.pic_url;
+						}
+					});
+				});
+				let attrNum_0 = [];
+				console.log(230)
+				console.log(copyAttr)
+				console.log(attrNum_0)
+				console.log(select)
+				this.selectCheck(copyAttr, attrNum_0, select);
+
+				this.$nextTick(() => {
+					if (this.number > this.stock) this.number = this.stock;
+				});
+				this.identifier(newGroup, attrNum_0, select);
+				this.getservice(newGroup, attrNum_0, select)
+				if (select.length !== newGroup.length) {
+					this.$emit('check', null, 1);
+				}
+			},
+			firstSelect: function() {
+				console.log("ddddd")
+				console.log(this.copyAttr)
+				console.log(this.copyGroup)
+				if (!this.copyGroup || !this.copyAttr) return;
+				let copyGroup = this.copyGroup;
+				let copyAttr = this.copyAttr;
+				let groupLength = copyGroup.length;
+				let select = [];
+
+				copyAttr.forEach(i => {
+					let attr_list = i.attr_list || [];
+					attr_list.forEach(j => {
+						let attr_group_id = j.attr_group_id;
+						copyGroup.forEach(k => {
+							if (attr_group_id === k.attr_group_id) {
+								let groups_attr_list = k.attr_list;
+								groups_attr_list.forEach(g => {
+									if (g.attr_id === j.attr_id) {
+										if (i.stock > 0) {
+											if (groupLength > 0) {
+												g.select = true;
+												select.push(
+													`${k.attr_group_id}-${g.attr_id}`
+													);
+												if (groupLength === copyGroup.length) {
+													this.picUrl = g.pic_url;
+												}
+												groupLength--;
+											}
+										}
+									}
+								});
+							}
+						});
+					});
+				});
+				let attrNum_0 = [];
+
+				this.selectCheck(copyAttr, attrNum_0, select);
+				this.identifier(copyGroup, attrNum_0, select);
+				this.getservice(copyGroup, attrNum_0, select); //getservice
+				this.newGroup = copyGroup;
+				console.log(this.newGroup)
+			},
+			numberBlur: function(e) {
+				let value = parseInt(e.detail.value);
+				if (!value) value = 1;
+				if (value > this.stock) {
+					value = this.stock;
+					uni.showToast({
+						title: '库存不足',
+						icon: 'none'
+					});
+				}
+				this.number = value;
+			},
+			numberSub: function() {
+				let value = this.number;
+				if (value > 1) {
+					value--;
+					this.number = value;
+				}
+			},
+			numberAdd: function() {
+				let value = this.number;
+				value++;
+				if (value > this.stock) {
+					value = this.stock;
+					uni.showToast({
+						title: '库存不足',
+						icon: 'none'
+					});
+				}
+				this.number = value;
+			},
+			leftSubmit: function() {
+				if (this.leftFunc === true) {
+					this.$emit('leftFunc', this.number);
+				} else {
+					this.cart();
+				}
+				this.close();
+			},
+			rightSubmit: function() {
+
+
+				let _this = this
+				if (!this.checked) {
+					uni.showToast({
+						title: '请先选规格',
+						icon: 'none'
+					});
+					return false;
+				}
+
+
+				// if (!this.service_label) {
+				// 	uni.showModal({
+				// 		title: '提示',
+				// 		content: '确定不需要碎屏险吗?',
+				// 		success: function (res) {
+				// 			if (res.confirm) {
+				// 				_this.submit()
+				// 			} else if (res.cancel) {
+				// 				return false
+				// 			}
+				// 		}
+				// 	});
+				// }else{
+				// 	this.submit()
+				// } 
+				this.submit()
+			},
+			submit() {
+				if (this.$user.isLogin() && this.$store.state.user.info) {
+					let member_level = this.$store.state.user.info.identity.member_level;
+					if (member_level < this.goods.member_level) {
+						uni.showModal({
+							title: "提示",
+							content: "需达到" + this.goods.member_name + "会员才可购买",
+							showCancel: true,
+							buttonText: '升级',
+							success: (res) => {
+								if (res.confirm) {
+									uni.navigateTo({
+										// url:"/pages/member/index/index",
+										url: '/pages/member/upgrade/upgrade?level=' + member_level +
+											'&other=' + this.goods.member_level
+									})
+								} else if (res.cancel) {
+									console.log('用户点击取消');
+								}
+
+							}
+						})
+						return;
+					}
+
+				}
+				let attrs = [];
+				let _this = this
+				let attrList = _this.checked.attr_list || [];
+				attrList.forEach(item => {
+					attrs.push({
+						attr_id: item.attr_id,
+						attr_group_id: item.attr_group_id
+					});
+				});
+				let goods = {
+					mch_id: _this.goods.mch_id ? _this.goods.mch_id : 0,
+					hasScreen: _this.hasCurrentServiceData(),
+					goods_list: [{
+						id: _this.goods.id,
+						attrs,
+						num: _this.number,
+						cat_id: 0,
+						card_id: _this.card_id,
+						goods_attr_id: _this.checked.id,
+						service_label: _this.service_label
+					}]
+				}
+				if (_this.rightFunc === true) {
+					console.log(333)
+					_this.$emit('rightFunc', goods);
+				} else {
+					console.log(336)
+					_this.shop(goods);
+				}
+				if (_this.service_label['id'] || 0)
+					_this.close();
+			},
+			shop: function(goods) {
+				console.log(342)
+				console.log(goods)
+				let hasScreen = this.hasCurrentServiceData();
+				uni.navigateTo({
+					url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}&hasScreen=${hasScreen}`
+				});
+			},
+			cart: function() {
+				if (!this.checked) {
+					uni.showToast({
+						title: '请先选规格',
+						icon: 'none'
+					});
+					return false;
+				}
+				if (this.goods.type === 'ecard') return;
+				this.$request({
+					url: this.$api.cart.add,
+					method: 'post',
+					data: {
+						goods_id: this.checked.goods_id,
+						attr: this.checked.id,
+						num: this.number
+					}
+				}).then(res => {
+					if (res.code === 0) {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						});
+						this.$emit('cart', this.checked, this.number);
+						this.close();
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: "none",
+							duration: 2500
+						});
+					}
+				});
+			},
+			clickImg(src) {
+				uni.previewImage({
+					current: 0,
+					urls: [src]
+				});
+			}
+		},
+		components: {
+			uPopup,
+			appPrice,
+			appMemberMark
+		},
+		computed: {
+			imgUrl: function() {
+				if (this.picUrl) {
+					return this.picUrl;
+				} else if (this.goods) {
+					return this.goods.cover_pic;
+				} else {
+					return '';
+				}
+			},
+			stock: function() {
+				if (!this.$validation.isEmpty(this.checked)) {
+					return this.checked.stock;
+				} else if (!this.$validation.isEmpty(this.goods)) {
+					return this.goods.goods_num;
+				}
+			},
+			sellPrice: function() {
+				if (!this.$validation.isEmpty(this.checked)) {
+					return this.goods.level_show === 1 ? this.checked.price_member : this.checked.price;
+				} else if (!this.$validation.isEmpty(this.goods)) {
+					return this.goods.hasOwnProperty('price_min') ? this.goods.price_min : this.goods.price;
+				}
+			},
+			copyGroup: function() {
+				if (!this.goods) return;
+				let group = this.$utils.deepClone(this.goods.attr_groups);
+				for (let i = 0; i < group.length; i++) {
+					group[i].attr_list.forEach(item => {
+						item.select = false;
+						item.num_0 = false;
+					});
+				}
+				return group;
+			},
+			copyAttr: function() {
+				if (!this.goods) return;
+				return this.$utils.deepClone(this.goods.attr);
+			},
+			cartClass: function() {
+				if (!this.$slots.left_slot) {
+					if (this.themeObject.theme === 'a' || this.themeObject.theme === 'b' || this.themeObject.theme ===
+						'f') {
+						return this.themeObject.sBack + ' u-btn u-btn-color ';
+					} else {
+						return this.themeObject.sBack + ' u-btn ' + this.themeObject.color;
+					}
+				} else {
+					return '';
+				}
+			}
+		},
+		watch: {
+			value: {
+				handler(newVal) {
+					this.newValue = newVal;
+					if (newVal === false) return;
+					if (this.$validation.isEmpty(this.checked) || this.checked.first) this.$utils.throttle(this
+						.firstSelect, 800);
+				},
+				immediate: true
+			},
+			number: {
+				handler(newVal) {
+					this.checked.service_label = this.service_label;
+					this.checked.card_id = this.card_id;
+					this.checked.hasScreen = this.hasCurrentServiceData();
+					this.$emit('check', this.checked, newVal);
+				}
+			},
+			again: {
+				handler() {
+					// this.firstSelect();
+				}
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.u-model {
+		width: 750upx;
+	}
+
+	.u-top {
+		margin: 0 24upx;
+		border-bottom: 1upx solid #e2e2e2;
+		height: 140upx;
+	}
+
+	.u-close-image {
+		width: 54upx;
+		height: 78upx;
+		padding: 24upx 0 24rpx 24rpx;
+		margin-left: 24rpx;
+	}
+
+	.bd-close-image {
+		width: 30upx;
+		height: 30upx;
+	}
+
+	.u-pic {
+		width: 200rpx;
+		height: 200rpx;
+		padding: 4upx;
+		border-radius: 8rpx;
+		position: relative;
+		top: -64upx;
+		background-color: #ffffff;
+	}
+
+	.u-img {
+		width: 192rpx;
+		height: 192rpx;
+		background-color: #ffffff;
+	}
+
+	.u-info {
+		width: 424upx;
+		height: 136upx;
+		padding: 45upx 0 0 24upx;
+	}
+
+	.u-scroll-view {
+		width: 100%;
+		max-height: calc(80vh - 154upx);
+	}
+
+	.u-attr-group {
+		margin: 24upx 32upx 0 32upx;
+		border-bottom: 1upx solid #e2e2e2;
+	}
+
+	.u-number {
+		height: 124upx;
+		margin: 0 32upx;
+	}
+
+	.u-group-name {
+		margin-bottom: 20upx;
+	}
+
+	.u-group-item {
+		padding: 15upx 24upx;
+		border-radius: 8upx;
+		margin: 0 20upx 20upx 0;
+		font-size: 26upx;
+	}
+
+	.u-checked {
+		color: #ffffff;
+	}
+
+	.u-unchecked {
+		background-color: #f2f2f2;
+		color: #353535;
+	}
+
+	.u-attr_num_0 {
+		background-color: #f7f7f7;
+		color: #cdcdcd;
+	}
+
+	.u-stock {
+		font-size: 24upx;
+		color: #999999;
+	}
+
+	.u-price {
+		margin-right: 12upx;
+	}
+
+	.u-input {
+		width: 88upx;
+		height: 60upx;
+		background-color: #f7f7f7;
+		font-size: 20upx;
+		color: #353535;
+		text-align: center;
+	}
+
+	.u-input-box {
+		width: 218upx;
+	}
+
+	.u-number-btn {
+		height: 60upx;
+		width: 60upx;
+		background-repeat: no-repeat;
+		background-size: 100% 100%;
+		background-position: center;
+	}
+
+	.u-number-btn:first-child {
+		margin-right: 5upx;
+	}
+
+	.u-number-btn:last-child {
+		margin-left: 5upx;
+	}
+
+	.u-reduced-1 {
+		background-image: url("../../../static/image/icon/can-be-reduced.png");
+	}
+
+	.u-reduced-0 {
+		background-image: url("../../../static/image/cart/can-be-reduced.png");
+	}
+
+	.u-added-1 {
+		background-image: url("../../../static/image/cart/can-be-added.png");
+	}
+
+	.u-text {
+		font-size: 26upx;
+		color: #666666;
+	}
+
+	.u-bottom {
+		height: 110upx;
+	}
+
+	.u-btn {
+		text-align: center;
+		line-height: 110upx;
+	}
+
+	.u-btn-color {
+		color: #ffffff;
+	}
+
+	.service_title {
+		padding-top: 10px;
+		margin: 14px 10px 10px;
+		font-weight: 700;
+		font-size: 13px;
+	}
+
+	.service_item {
+		margin: 14px 10px 0px;
+		font-size: 26rpx;
+		color: #666;
+		display: flex;
+		justify-content: space-between;
+	}
+
+	.service_value {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0px 10px;
+	}
+
+	.service_block {
+		min-width: 46%;
+		height: 28px;
+		line-height: 26px;
+		border: 1px solid #f5f5f5;
+		border-radius: 16px;
+		text-align: center;
+		margin-right: 10px;
+		margin-top: 10px;
+		font-size: 12px;
+		background-color: #f5f5f5;
+		position: relative;
+	}
+
+	.service_block_active {
+		color: #f21c1c;
+		border: 1px solid #f21c1c;
+	}
+
+	.slh {
+		margin-left: 5upx;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		width: 460upx;
+		white-space: nowrap;
+		float: left;
+		/* 	  display: -webkit-box;
+		  -webkit-line-clamp: 1;
+		  -webkit-box-orient: vertical; */
+	}
+</style>

+ 457 - 510
plugins/gift/goods/goods.vue

xqd
@@ -1,511 +1,458 @@
-<template>
-	<app-layout>
-        <view v-if="!goods_detail" class="u-goods-detail"></view>
-		<view class="goods" v-if="goods_detail">
-			<view class="page-width">
-				<app-goods-banner
-					v-bind:picList="goods_detail.pic_url"
-					v-bind:videoUrl="goods_detail.video_url"
-					v-bind:isCart="false"
-                    v-bind:goods_id="goods_id"
-					sign="gift"
-                    v-bind:share="goods_detail.share"
-				></app-goods-banner>
-			</view>
-            <bd-info
-                :theme="themeObject"
-                :name="goods_detail.name"
-                :is-negotiable="goods_detail.is_negotiable"
-                :subtitle="goods_detail.subtitle"
-                :level-show="goods_detail.level_show"
-                :price="goods_detail.price"
-                :original-price="goods_detail.original_price"
-                :price-max="goods_detail.price_max"
-                :price-min="goods_detail.price_min"
-                :price-member-max="goods_detail.price_member_max"
-                :price-member-min="goods_detail.price_member_min"
-                :discount='discount'
-                :is-vip-card-user="is_vip_card_user"
-                :sales="goods_detail.sales"
-                :unit="goods_detail.unit"
-                :is-sales="goods_detail.is_sales"
-                :is-vip="is_vip"
-                :flash-sale="flash_sale"
-                :goods-id="goods_detail.id"
-                :extra-quick-share="goods_detail.extra_quick_share"
-                :has-poster-nav="true"
-                v-bind:goods="goods_detail"
-                :is-show-share="false"
-            >
-                <button slot="share" class="bd-share" open-type="share" >
-                    <image src="/plugins/gift/image/begging-gift.png"></image>
-                </button>
-            </bd-info>
-            <bd-coupon @change="setCoupon" :theme="themeObject" :coupons="goods_detail.goods_coupon_center"></bd-coupon>
-            <bd-xbc
-                :coAttr="is_open"
-                :attr-list="selectAttr.attr_list"
-                :type="goods_detail.type"
-                :guarantee-title="goods_detail.guarantee_title"
-                :guarantee-pic="goods_detail.guarantee_pic"
-                :param_content="goods_detail.param_content"
-                :param_name="goods_detail.param_name"
-                :services="goods_detail.services"
-                :attr-groups="goods_detail.attr_groups"
-                :goods-stock="goods_detail.goods_stock"
-                @openAttr="clickAttr"
-            ></bd-xbc>
-            <bd-hc
-                :integral="goods_detail.goods_marketing_award.integral"
-                :coupon="goods_detail.goods_marketing_award.coupon"
-                :card="goods_detail.goods_marketing_award.card"
-                :balance="goods_detail.goods_marketing_award.balance"
-                :theme="themeObject"
-            ></bd-hc>
-            <bd-kb
-                :limit="goods_detail.goods_marketing.limit"
-                :express="goods_detail.express"
-                :shipping="goods_detail.goods_marketing.shipping"
-                :pickup="goods_detail.goods_marketing.pickup"
-            ></bd-kb>
-            <bd-comments :goods-id="goods_detail.id"></bd-comments>
-            <bd-detail :detail="goods_detail.detail" :after_detail="goods_detail.after_detail" :goodsId="goods_detail.id"></bd-detail>
-			<!-- 相关推荐 -->
-			<view class="app-recommend" v-if="goods_list.length > 0">
-				<app-related-suggestion-product
-					v-bind:list="goods_list"
-                    sign="gift"
-                    :themeObject="themeObject"
-                    :theme="themeObject.userTheme"
-                ></app-related-suggestion-product>
-			</view>
-            <!-- 底部空格 -->
-            <view class="safe-area-inset-bottom">
-                <view class="u-bottom-height" :class="full_reduce ? 'u-bottom-height-1' : 'u-bottom-height-0'"></view>
-            </view>
-			<!-- 底部按钮 -->
-			<view v-if="is_open == 1" class="safe-area-inset-bottom u-bottom-fixed">
-                <view v-if="full_reduce">
-                    <app-goods-full-reduce
-                        :theme="theme"
-                        :full_reduce="full_reduce"
-                        sign="gift"
-                    >
-                    </app-goods-full-reduce>
-                </view>
-                <bottom-button
-                    v-bind:theme="theme"
-                    v-bind:attr_bool="attr_bool"
-                    v-bind:goods_stock="goods_detail.goods_stock"
-                    v-on:attrSwitch="clickAttr"
-                    v-bind:join_disabled="join_disabled"
-                ></bottom-button>
-			</view>
-            <u-attr
-                v-model="attrShow"
-                :themeObject="themeObject"
-                :is_show_left="false"
-                :checked="selectAttr"
-                @check="onAttr"
-                :rightFunc="true"
-                @rightFunc="pay"
-                v-bind:goods="goods_detail"
-                sign="gift"
-                rightText="加入礼包"
-            >
-            </u-attr>
-		</view>
-        <app-close v-if="showClose" :modal="false" @update="getMall"></app-close>
-	</app-layout>
-</template>
-
-<script>
-	import {mapState} from 'vuex';
-    import appGoodsBanner from '../../../components/page-component/goods/app-goods-banner.vue';
-    import appRelatedSuggestionProduct from '../../../components/page-component/app-related-suggestion-product/app-related-suggestion-product.vue';
-	import bottomButton from '../components/goods/bottom-button.vue';
-	import appGoodsFullReduce from '../../../components/page-component/goods/app-goods-full-reduce.vue';
-	import appGoodsCoupon from "../../../components/page-component/goods/app-goods-coupon.vue";
-    import appGoodsMarketing from "../../../components/page-component/goods/app-goods-marketing.vue";
-    import uAttr from '../../../components/page-component/goods/u-attr.vue';
-    import bdInfo from '@/components/page-component/goods/bd-info';
-    import bdCoupon from '@/components/page-component/goods/bd-coupon.vue';
-    import bdXbc from '@/components/page-component/goods/bd-xbc.vue';
-    import bdKb from '@/components/page-component/goods/bd-kb.vue';
-    import bdHc from '@/components/page-component/goods/bd-hc.vue';
-    import bdDetail from '@/components/page-component/goods/bd-detail.vue';
-    import bdComments from '@/components/page-component/goods/bd-comments.vue';
-    import appClose from '@/components/basic-component/app-close/app-close.vue';
-
-    export default {
-        name: 'goods',
-        data() {
-            return {
-                showClose: false,
-                is_open: 0,
-                // 商品ID
-                goods_id: -1,
-	            // 商品
-	            goods_detail: null,
-                full_reduce: null,
-	            // 相关推荐
-                goods_list: [],
-                attr_bool: false,
-	            // 选中规格
-                select_data: {},
-	            // 选中规格字符串
-                select_str: '',
-                number: 1,
-                ask_gift: '',
-                mch_id: -1,
-                loading: false,
-                join_disabled: true,
-                is_share: 0,
-	            is_search: 0,
-                selectAttr: {},
-                attrShow: false,
-                flash_sale: null,
-                is_vip: false,
-                is_vip_card_user: null,
-                discount: null
-            }
-        },
-        onLoad(options) {
-            this.goods_id = options.id;
-            if (options.mch_id) {
-                this.mch_id = options.mch_id;
-            }
-            if (options.is_share == 1) {
-                this.is_share = 1;
-            }
-            if (options.is_search == 1) {
-                this.is_search = 1;
-            }
-            this.$store.dispatch('gift/getConfig', this.$api.gift.config);
-            this.request().then(() => {
-                this.requestList();
-                this.requestConfig();
-            });
-			// #ifdef MP-WEIXIN
-			wx.showShareMenu({
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-        },
-        onShow() {
-            this.showClose = false;
-            setTimeout(()=>{
-                this.showClose = true;
-            })
-        },
-        onShareAppMessage() {
-            return this.$shareAppMessage({
-                path: '/plugins/gift/goods/goods',
-                title: this.ask_gift,
-                imageUrl: this.goods_detail.app_share_pic ? this.goods_detail.app_share_pic : '',
-                // #ifdef MP-ALIPAY
-                bgImgUrl: this.goods_detail.app_share_pic ? this.goods_detail.app_share_pic : '',
-                // #endif
-                params: {
-                    id: this.goods_id,
-	                is_share: 1,
-                }
-            });
-        },
-
-		// #ifdef MP-WEIXIN
-		onShareTimeline() {
-			// 分享朋友圈beta
-			return this.$shareTimeline({
-				title: this.ask_gift,
-				query: {
-					id: this.goods_id,
-					is_share: 1,
-				} // 此处填写页面的参数
-			});
-		},
-		// #endif
-
-        methods: {
-            getMall(e) {
-                this.is_open = e.is_open;
-            },
-            clickAttr() {
-                this.attrShow = true;
-            },
-            onAttr(data) {
-                this.selectAttr = data;
-                let attr_str = ``;
-                for (let i = 0; i < data.attr_list.length; i++) {
-                    attr_str += `${data.attr_list[i].attr_group_name}: ${data.attr_list[i].attr_name} `;
-                }
-                this.select_data = {
-                    name: this.goods_detail.name,
-                    price: data.price,
-                    attr: {
-                        id: data.id,
-                        attr_list: data.attr_list,
-                        stock: data.stock,
-                        goods_id: data.goods_id,
-                    },
-                    attr_str: attr_str,
-                    pic_url: data.pic_url ? data.pic_url : this.goods_detail.cover_pic,
-                }
-            },
-            // 请求商品
-            async request() {
-                this.$utils.showLoading();
-                try {
-                    const res = await this.$request({
-                        url: this.$api.gift.goods,
-                        method: 'get',
-                        data: {
-                            id: this.goods_id
-                        }
-                    });
-	                this.$utils.hideLoading();
-                    if (res.code === 0) {
-                        this.goods_detail = res.data.goods;
-                        this.flash_sale = res.data.goods.plugin_extra.flash_sale;
-                        if (this.goods_detail.goods_activity) {
-                            this.full_reduce = this.goods_detail.goods_activity.full_reduce;
-                        }
-                        if (this.goods_detail.vip_card_appoint.discount) {
-                            this.is_vip = true;
-                            this.discount = this.goods_detail.vip_card_appoint.discount
-                        }
-                        this.is_vip_card_user = this.goods_detail.vip_card_appoint.is_vip_card_user
-                        this.loading = true;
-                        for (let i = 0; i < this.goods_detail.attr_groups.length; i++) {
-                            for (let j = 0; j < this.goods_detail.attr_groups[i].attr_list.length; j++) {
-                                if (j === 0) {
-                                    this.goods_detail.attr_groups[i].attr_list[j].active = true;
-                                } else {
-                                    this.goods_detail.attr_groups[i].attr_list[j].active = false;
-                                }
-                            }
-                        }
-                    } else {
-                        uni.showModal({
-                            title: '提示',
-                            content: res.msg,
-                        });
-                    }
-                } catch (e) {
-                    this.$utils.hideLoading();
-                    throw new Error(e);
-                }
-            },
-            // 请求配置
-            async requestConfig() {
-                this.$utils.showLoading();
-
-                try {
-                    const res = await this.$request({
-                        url: this.$api.gift.config,
-                        method: 'get',
-                    });
-                    this.$utils.hideLoading();
-                    if (res.code === 0) {
-                        this.ask_gift = res.data.ask_gift;
-                        this.$store.commit('gift/setTheme', Number(res.data.theme.id));
-                    } else {
-                        uni.showModal({
-                            title: '提示',
-                            content: res.msg,
-                        });
-                    }
-                } catch (e) {
-                    this.$utils.hideLoading();
-                    throw new Error(e);
-                }
-            },
-	        // 请求相关推荐
-	        async requestList() {
-                this.$utils.showLoading();
-                try {
-                    const res = await this.$request({
-                        url: this.$api.goods.new_recommend,
-                        method: 'get',
-                        data: {
-                            goods_id: this.goods_id,
-                            type: 'goods',
-                        }
-                    });
-                    this.$utils.hideLoading();
-                    if (res.code === 0) {
-	                    this.goods_list = res.data.list;
-                    } else {
-                        uni.showModal({
-                            title: '提示',
-                            content: res.msg,
-                        });
-                    }
-                } catch (e) {
-                    this.$utils.hideLoading();
-                    throw new Error(e);
-                }
-	        },
-	        // 规格开关
-            attrSwitch(data) {
-                this.attr_bool = data;
-            },
-	        pay(data) {
-                this.number = data.goods_list[0].num;
-                if (this.$storage.getStorageSync('GIFT_CART')) {
-                    let again = 0;
-                    let storage = this.$storage.getStorageSync('GIFT_CART');
-                    for (let i = 0; i < storage.length; i++) {
-                        if (storage[i].attr.id === this.select_data.attr.id) {
-                            storage[i].number += this.number;
-                        } else {
-                            again += 1;
-                        }
-                    }
-                    if (again === storage.length) {
-                        let data = this.select_data;
-                        data.number = this.number;
-                        storage.push(data);
-                    }
-                    this.$storage.setStorageSync('GIFT_CART', storage);
-                } else {
-                    let data = this.select_data;
-                    data.number = this.number;
-                    this.$storage.setStorageSync('GIFT_CART', [data]);
-                }
-                if (this.is_share === 1) {
-                    uni.navigateTo({
-                        url: `/plugins/gift/index/index`
-                    })
-                } else if(this.is_search === 1) {
-                    uni.navigateBack({
-                        delta: 3
-                    });
-                } else {
-                    uni.navigateBack({
-                        delta: 2
-                    });
-                }
-	        },
-			setCoupon(index) {
-				this.$set(this.goods_detail.goods_coupon_center[index], 'is_receive', 1);
-			}
-        },
-        computed: {
-            ...mapState('gift',{
-                theme: state => state.theme
-            }),
-            ...mapState('mallConfig', {
-                mall: state => state.mall
-            }),
-            themeObject:function() {
-                return {
-                    back: this.theme + '-background',
-                    userTheme: this.theme,
-                    color: this.theme + '-color',
-                    backO: this.theme + '-background-o',
-                    backP: this.theme + '-background-p'
-                }
-            }
-        },
-        components: {
-            'app-goods-banner': appGoodsBanner,
-            'app-related-suggestion-product': appRelatedSuggestionProduct,
-	        'bottom-button': bottomButton,
-			appGoodsFullReduce,
-			appGoodsCoupon,
-            appGoodsMarketing,
-            uAttr,
-            bdInfo,
-            bdCoupon,
-            bdXbc,
-            bdKb,
-            bdHc,
-            bdDetail,
-            bdComments,
-            appClose
-        },
-    }
-</script>
-
-<style lang="scss">
-	//@import '../css/gift';
-
-	/* 商品页面 */
-	.goods {
-		position: absolute;
-		width: 100%;
-		height: 100%;
-		background-color: #f7f7f7;
-
-        .goods-subtitle {
-            padding: 0 #{24rpx};
-            font-size: 24rpx;
-            background-color: #ffffff;
-            color: #999999;
-        }
-		/*加入会员*/
-		.join-member {
-			background-color: #ffffff;
-			padding: #{0 24upx};
-		}
-
-		/*详情 评价*/
-		.detailed-evaluation {
-
-		}
-
-		/*超级会员卡*/
-		.vip-card {
-			padding: #{0 24upx 24upx 24upx};
-			background-color: #ffffff;
-		}
-
-		/*商品服务*/
-		.commodity-service {
-			margin: #{20upx 0};
-		}
-
-		/*规格选择*/
-		.show-attr {
-			margin-bottom: #{20upx};
-		}
-		/*空格*/
-		.empty {}
-
-        .u-bottom-height-0 {
-            height: 110upx;
-        }
-        .u-bottom-height-1 {
-            height: 190upx;
-        }
-
-        .u-bottom-fixed {
-            position: fixed;
-            bottom: 0;
-            left: 0;
-            width: 100%;
-            z-index: 1602;
-            background-color: #ffffff;
-        }
-	}
-
-    .u-coupon {
-        margin-top: 20upx;
-    }
-
-    /*求礼物*/
-    .bd-share {
-        width: 96upx;
-        height: 96upx;
-        border: none;
-        padding: 0;
-        background-color: transparent;
-        border-radius: 0;
-        margin: 0;
-        image {
-            width: 100%;
-            height: 100%;
-        }
-    }
+<template>
+	<app-layout>
+		<view v-if="!goods_detail" class="u-goods-detail"></view>
+		<view class="goods" v-if="goods_detail">
+			<view class="page-width">
+				<app-goods-banner v-bind:picList="goods_detail.pic_url" v-bind:videoUrl="goods_detail.video_url"
+					v-bind:isCart="false" v-bind:goods_id="goods_id" sign="gift" v-bind:share="goods_detail.share">
+				</app-goods-banner>
+			</view>
+			<bd-info :theme="themeObject" :name="goods_detail.name" :is-negotiable="goods_detail.is_negotiable"
+				:subtitle="goods_detail.subtitle" :level-show="goods_detail.level_show" :price="goods_detail.price"
+				:original-price="goods_detail.original_price" :price-max="goods_detail.price_max"
+				:price-min="goods_detail.price_min" :price-member-max="goods_detail.price_member_max"
+				:price-member-min="goods_detail.price_member_min" :discount='discount'
+				:is-vip-card-user="is_vip_card_user" :sales="goods_detail.sales" :unit="goods_detail.unit"
+				:is-sales="goods_detail.is_sales" :is-vip="is_vip" :flash-sale="flash_sale" :goods-id="goods_detail.id"
+				:extra-quick-share="goods_detail.extra_quick_share" :has-poster-nav="true" v-bind:goods="goods_detail"
+				:is-show-share="false">
+				<button slot="share" class="bd-share" open-type="share">
+					<image src="/plugins/gift/image/begging-gift.png"></image>
+				</button>
+			</bd-info>
+			<bd-coupon @change="setCoupon" :theme="themeObject" :coupons="goods_detail.goods_coupon_center"></bd-coupon>
+			<bd-xbc :coAttr="is_open" :attr-list="selectAttr.attr_list" :type="goods_detail.type"
+				:guarantee-title="goods_detail.guarantee_title" :guarantee-pic="goods_detail.guarantee_pic"
+				:param_content="goods_detail.param_content" :param_name="goods_detail.param_name"
+				:services="goods_detail.services" :attr-groups="goods_detail.attr_groups"
+				:goods-stock="goods_detail.goods_stock" @openAttr="clickAttr"></bd-xbc>
+			<bd-hc :integral="goods_detail.goods_marketing_award.integral"
+				:coupon="goods_detail.goods_marketing_award.coupon" :card="goods_detail.goods_marketing_award.card"
+				:balance="goods_detail.goods_marketing_award.balance" :theme="themeObject"></bd-hc>
+			<bd-kb :limit="goods_detail.goods_marketing.limit" :express="goods_detail.express"
+				:shipping="goods_detail.goods_marketing.shipping" :pickup="goods_detail.goods_marketing.pickup"></bd-kb>
+			<bd-comments :goods-id="goods_detail.id"></bd-comments>
+			<bd-detail :detail="goods_detail.detail" :after_detail="goods_detail.after_detail"
+				:goodsId="goods_detail.id"></bd-detail>
+			<!-- 相关推荐 -->
+			<view class="app-recommend" v-if="goods_list.length > 0">
+				<app-related-suggestion-product v-bind:list="goods_list" sign="gift" :themeObject="themeObject"
+					:theme="themeObject.userTheme"></app-related-suggestion-product>
+			</view>
+			<!-- 底部空格 -->
+			<view class="safe-area-inset-bottom">
+				<view class="u-bottom-height" :class="full_reduce ? 'u-bottom-height-1' : 'u-bottom-height-0'"></view>
+			</view>
+			<!-- 底部按钮 -->
+			<view v-if="is_open == 1" class="safe-area-inset-bottom u-bottom-fixed">
+				<view v-if="full_reduce">
+					<app-goods-full-reduce :theme="theme" :full_reduce="full_reduce" sign="gift">
+					</app-goods-full-reduce>
+				</view>
+				<bottom-button v-bind:theme="theme" v-bind:attr_bool="attr_bool"
+					v-bind:goods_stock="goods_detail.goods_stock" v-on:attrSwitch="clickAttr"
+					v-bind:join_disabled="join_disabled"></bottom-button>
+			</view>
+			<u-attr v-model="attrShow" :themeObject="themeObject" :is_show_left="false" :checked="selectAttr"
+				@check="onAttr" :rightFunc="true" @rightFunc="pay" v-bind:goods="goods_detail" sign="gift"
+				rightText="加入礼包" :is_gift="true">
+			</u-attr>
+		</view>
+		<app-close v-if="showClose" :modal="false" @update="getMall"></app-close>
+	</app-layout>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	import appGoodsBanner from '../../../components/page-component/goods/app-goods-banner.vue';
+	import appRelatedSuggestionProduct from '../../../components/page-component/app-related-suggestion-product/app-related-suggestion-product.vue';
+	import bottomButton from '../components/goods/bottom-button.vue';
+	import appGoodsFullReduce from '../../../components/page-component/goods/app-goods-full-reduce.vue';
+	import appGoodsCoupon from "../../../components/page-component/goods/app-goods-coupon.vue";
+	import appGoodsMarketing from "../../../components/page-component/goods/app-goods-marketing.vue";
+	import uAttr from '../../../components/page-component/goods/u-attr.vue';
+	import bdInfo from '@/components/page-component/goods/bd-info';
+	import bdCoupon from '@/components/page-component/goods/bd-coupon.vue';
+	import bdXbc from '@/components/page-component/goods/bd-xbc.vue';
+	import bdKb from '@/components/page-component/goods/bd-kb.vue';
+	import bdHc from '@/components/page-component/goods/bd-hc.vue';
+	import bdDetail from '@/components/page-component/goods/bd-detail.vue';
+	import bdComments from '@/components/page-component/goods/bd-comments.vue';
+	import appClose from '@/components/basic-component/app-close/app-close.vue';
+
+	export default {
+		name: 'goods',
+		data() {
+			return {
+				showClose: false,
+				is_open: 0,
+				// 商品ID
+				goods_id: -1,
+				// 商品
+				goods_detail: null,
+				full_reduce: null,
+				// 相关推荐
+				goods_list: [],
+				attr_bool: false,
+				// 选中规格
+				select_data: {},
+				// 选中规格字符串
+				select_str: '',
+				number: 1,
+				ask_gift: '',
+				mch_id: -1,
+				loading: false,
+				join_disabled: true,
+				is_share: 0,
+				is_search: 0,
+				selectAttr: {},
+				attrShow: false,
+				flash_sale: null,
+				is_vip: false,
+				is_vip_card_user: null,
+				discount: null
+			}
+		},
+		onLoad(options) {
+			this.goods_id = options.id;
+			if (options.mch_id) {
+				this.mch_id = options.mch_id;
+			}
+			if (options.is_share == 1) {
+				this.is_share = 1;
+			}
+			if (options.is_search == 1) {
+				this.is_search = 1;
+			}
+			this.$store.dispatch('gift/getConfig', this.$api.gift.config);
+			this.request().then(() => {
+				this.requestList();
+				this.requestConfig();
+			});
+			// #ifdef MP-WEIXIN
+			wx.showShareMenu({
+				menus: ['shareAppMessage', 'shareTimeline']
+			})
+			// #endif
+		},
+		onShow() {
+			this.showClose = false;
+			setTimeout(() => {
+				this.showClose = true;
+			})
+		},
+		onShareAppMessage() {
+			return this.$shareAppMessage({
+				path: '/plugins/gift/goods/goods',
+				title: this.ask_gift,
+				imageUrl: this.goods_detail.app_share_pic ? this.goods_detail.app_share_pic : '',
+				// #ifdef MP-ALIPAY
+				bgImgUrl: this.goods_detail.app_share_pic ? this.goods_detail.app_share_pic : '',
+				// #endif
+				params: {
+					id: this.goods_id,
+					is_share: 1,
+				}
+			});
+		},
+
+		// #ifdef MP-WEIXIN
+		onShareTimeline() {
+			// 分享朋友圈beta
+			return this.$shareTimeline({
+				title: this.ask_gift,
+				query: {
+					id: this.goods_id,
+					is_share: 1,
+				} // 此处填写页面的参数
+			});
+		},
+		// #endif
+
+		methods: {
+			getMall(e) {
+				this.is_open = e.is_open;
+			},
+			clickAttr() {
+				this.attrShow = true;
+			},
+			onAttr(data) {
+				this.selectAttr = data;
+				let attr_str = ``;
+				for (let i = 0; i < data.attr_list.length; i++) {
+					attr_str += `${data.attr_list[i].attr_group_name}: ${data.attr_list[i].attr_name} `;
+				}
+				this.select_data = {
+					name: this.goods_detail.name,
+					price: data.price,
+					attr: {
+						id: data.id,
+						attr_list: data.attr_list,
+						stock: data.stock,
+						goods_id: data.goods_id,
+					},
+					attr_str: attr_str,
+					pic_url: data.pic_url ? data.pic_url : this.goods_detail.cover_pic,
+				}
+			},
+			// 请求商品
+			async request() {
+				this.$utils.showLoading();
+				try {
+					const res = await this.$request({
+						url: this.$api.gift.goods,
+						method: 'get',
+						data: {
+							id: this.goods_id
+						}
+					});
+					this.$utils.hideLoading();
+					if (res.code === 0) {
+						this.goods_detail = res.data.goods;
+						this.flash_sale = res.data.goods.plugin_extra.flash_sale;
+						if (this.goods_detail.goods_activity) {
+							this.full_reduce = this.goods_detail.goods_activity.full_reduce;
+						}
+						if (this.goods_detail.vip_card_appoint.discount) {
+							this.is_vip = true;
+							this.discount = this.goods_detail.vip_card_appoint.discount
+						}
+						this.is_vip_card_user = this.goods_detail.vip_card_appoint.is_vip_card_user
+						this.loading = true;
+						for (let i = 0; i < this.goods_detail.attr_groups.length; i++) {
+							for (let j = 0; j < this.goods_detail.attr_groups[i].attr_list.length; j++) {
+								if (j === 0) {
+									this.goods_detail.attr_groups[i].attr_list[j].active = true;
+								} else {
+									this.goods_detail.attr_groups[i].attr_list[j].active = false;
+								}
+							}
+						}
+					} else {
+						uni.showModal({
+							title: '提示',
+							content: res.msg,
+						});
+					}
+				} catch (e) {
+					this.$utils.hideLoading();
+					throw new Error(e);
+				}
+			},
+			// 请求配置
+			async requestConfig() {
+				this.$utils.showLoading();
+
+				try {
+					const res = await this.$request({
+						url: this.$api.gift.config,
+						method: 'get',
+					});
+					this.$utils.hideLoading();
+					if (res.code === 0) {
+						this.ask_gift = res.data.ask_gift;
+						this.$store.commit('gift/setTheme', Number(res.data.theme.id));
+					} else {
+						uni.showModal({
+							title: '提示',
+							content: res.msg,
+						});
+					}
+				} catch (e) {
+					this.$utils.hideLoading();
+					throw new Error(e);
+				}
+			},
+			// 请求相关推荐
+			async requestList() {
+				this.$utils.showLoading();
+				try {
+					const res = await this.$request({
+						url: this.$api.goods.new_recommend,
+						method: 'get',
+						data: {
+							goods_id: this.goods_id,
+							type: 'goods',
+						}
+					});
+					this.$utils.hideLoading();
+					if (res.code === 0) {
+						this.goods_list = res.data.list;
+					} else {
+						uni.showModal({
+							title: '提示',
+							content: res.msg,
+						});
+					}
+				} catch (e) {
+					this.$utils.hideLoading();
+					throw new Error(e);
+				}
+			},
+			// 规格开关
+			attrSwitch(data) {
+				this.attr_bool = data;
+			},
+			pay(data) {
+				this.number = data.goods_list[0].num;
+				if (this.$storage.getStorageSync('GIFT_CART')) {
+					let again = 0;
+					let storage = this.$storage.getStorageSync('GIFT_CART');
+					for (let i = 0; i < storage.length; i++) {
+						if (storage[i].attr.id === this.select_data.attr.id) {
+							storage[i].number += this.number;
+						} else {
+							again += 1;
+						}
+					}
+					if (again === storage.length) {
+						let data = this.select_data;
+						data.number = this.number;
+						storage.push(data);
+					}
+					this.$storage.setStorageSync('GIFT_CART', storage);
+				} else {
+					let data = this.select_data;
+					data.number = this.number;
+					this.$storage.setStorageSync('GIFT_CART', [data]);
+				}
+				if (this.is_share === 1) {
+					uni.navigateTo({
+						url: `/plugins/gift/index/index`
+					})
+				} else if (this.is_search === 1) {
+					uni.navigateBack({
+						delta: 3
+					});
+				} else {
+					uni.navigateBack({
+						delta: 2
+					});
+				}
+			},
+			setCoupon(index) {
+				this.$set(this.goods_detail.goods_coupon_center[index], 'is_receive', 1);
+			}
+		},
+		computed: {
+			...mapState('gift', {
+				theme: state => state.theme
+			}),
+			...mapState('mallConfig', {
+				mall: state => state.mall
+			}),
+			themeObject: function() {
+				return {
+					back: this.theme + '-background',
+					userTheme: this.theme,
+					color: this.theme + '-color',
+					backO: this.theme + '-background-o',
+					backP: this.theme + '-background-p'
+				}
+			}
+		},
+		components: {
+			'app-goods-banner': appGoodsBanner,
+			'app-related-suggestion-product': appRelatedSuggestionProduct,
+			'bottom-button': bottomButton,
+			appGoodsFullReduce,
+			appGoodsCoupon,
+			appGoodsMarketing,
+			uAttr,
+			bdInfo,
+			bdCoupon,
+			bdXbc,
+			bdKb,
+			bdHc,
+			bdDetail,
+			bdComments,
+			appClose
+		},
+	}
+</script>
+
+<style lang="scss">
+	//@import '../css/gift';
+
+	/* 商品页面 */
+	.goods {
+		position: absolute;
+		width: 100%;
+		height: 100%;
+		background-color: #f7f7f7;
+
+		.goods-subtitle {
+			padding: 0 #{24rpx};
+			font-size: 24rpx;
+			background-color: #ffffff;
+			color: #999999;
+		}
+
+		/*加入会员*/
+		.join-member {
+			background-color: #ffffff;
+			padding: #{0 24upx};
+		}
+
+		/*详情 评价*/
+		.detailed-evaluation {}
+
+		/*超级会员卡*/
+		.vip-card {
+			padding: #{0 24upx 24upx 24upx};
+			background-color: #ffffff;
+		}
+
+		/*商品服务*/
+		.commodity-service {
+			margin: #{20upx 0};
+		}
+
+		/*规格选择*/
+		.show-attr {
+			margin-bottom: #{20upx};
+		}
+
+		/*空格*/
+		.empty {}
+
+		.u-bottom-height-0 {
+			height: 110upx;
+		}
+
+		.u-bottom-height-1 {
+			height: 190upx;
+		}
+
+		.u-bottom-fixed {
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			width: 100%;
+			z-index: 1602;
+			background-color: #ffffff;
+		}
+	}
+
+	.u-coupon {
+		margin-top: 20upx;
+	}
+
+	/*求礼物*/
+	.bd-share {
+		width: 96upx;
+		height: 96upx;
+		border: none;
+		padding: 0;
+		background-color: transparent;
+		border-radius: 0;
+		margin: 0;
+
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
 </style>