Explorar o código

Revert "no message"

This reverts commit 0e87b1db94f683f46f152968ed54627150a9cdb3.
yanjie %!s(int64=4) %!d(string=hai) anos
pai
achega
3ec5cafe42

+ 5 - 5
components/page-component/app-join-member/app-join-member.vue

xqd xqd
@@ -1,9 +1,9 @@
 <template>
 	<view class="app-goods-join-member">
 		<app-jump-button url="/pages/member/index/index" open_type="navigate">
-			<view class="member dir-left cross-center" style="background-color: #FFD1D5;padding: 0;">
-				<view class="box-grow-0" style="font-weight: bold;color: #ff547b;margin-left: 24rpx;">加入会员,享会员价</view>
-				<view class="box-grow-1 price" style="font-size: 26rpx;margin-left: 15rpx;" :class="getTheme + '-m-text ' + getTheme">
+			<view class="member dir-left cross-center">
+				<view class="box-grow-0">加入会员,享会员价</view>
+				<view class="box-grow-1 price" :class="getTheme + '-m-text ' + getTheme">
 					<app-price
 						type="text-price-all"
 					   	:max="memberMaxPrice"
@@ -11,9 +11,9 @@
 					   	:default-price="price"
 					></app-price>
 				</view>
-				<view class="dir-left cross-center box-grow-0" style="height: 100%;background-color: #FB3B62;color: #fff;border-radius: 16rpx;padding-left: 15rpx;padding-right: 15rpx;">
+				<view class="dir-left cross-center box-grow-0">
 					<view>了解更多</view>
-					<image src="../../../static/image/icon/arrow-right-white.png" class="right"></image>
+					<image src="../../../static/image/icon/arrow-right.png" class="right"></image>
 				</view>
 			</view>
 		</app-jump-button>

+ 577 - 596
components/page-component/goods/u-attr.vue

xqd
@@ -1,604 +1,585 @@
 <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="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 style="background: linear-gradient(to right, #A494F6, #BC8AE7, #E674B2);color: #fff;" v-if="is_show_left && (goods.type === 'goods' || is_must_left)" class="box-grow-1 borderwithe" :class="cartClass" @click="leftSubmit">
-						<slot name="left_slot"></slot>
-						<template v-if="!$slots.left_slot">{{leftText}}</template>
-					</view>
-					<view style="background: linear-gradient(to right, #E674B2, #FE3666);color: #fff;" 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>
+    <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="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 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";
+    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
-			},
-			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
-			}
-		},
-		methods: {
-			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) {
-				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;
-					f.attr_list.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);
+    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
+            },
+            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
+            }
+        },
+        methods: {
+            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) {
+                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;
+                    f.attr_list.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);
 
-					if (sign === 0) {
-						this.$emit('check', f, 1);
-					}
-				});
-			},
-			storeAttr: function(attr_id, group_id, num_0) {
-				if (num_0 === true) return;
-				let newGroup = this.newGroup;
-				let copyAttr = this.copyAttr;
-				let select = [];
-				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 = [];
-				this.selectCheck(copyAttr, attrNum_0, select);
-				this.$nextTick(() => {
-					if (this.number > this.stock) this.number = this.stock;
-				});
-				this.identifier(newGroup, attrNum_0, select);
-				if (select.length !== newGroup.length) {
-					this.$emit('check', null, 1);
-				}
-			},
-			firstSelect: function() {
-				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.newGroup = copyGroup;
-			},
-			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 attrs = [];
-				if (!this.checked) {
-					uni.showToast({
-						title: '请先选规格',
-						icon: 'none'
-					});
-					return false;
-				}
-				this.checked.attr_list.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,
-					goods_list: [{
-						id: this.goods.id,
-						attrs,
-						num: this.number,
-						cat_id: 0,
-						goods_attr_id: this.checked.id
-					}]
-				}
-				if (this.rightFunc === true) {
-					this.$emit('rightFunc', goods);
-				} else {
-					this.shop(goods);
-				}
-				this.close();
-			},
-			shop: function(goods) {
-				uni.navigateTo({
-					url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}`
-				});
-			},
-			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.$utils.throttle(this.firstSelect, 800);
-				},
-				immediate: true
-			},
-			number: {
-				handler(newVal) {
-					this.$emit('check', this.checked, newVal);
-				}
-			},
-			again: {
-				handler() {
-					this.firstSelect();
-				}
-			}
-		}
-	}
+                    if (sign === 0) {
+                        this.$emit('check', f, 1);
+                    }
+                });
+            },
+            storeAttr: function(attr_id, group_id, num_0) {
+                if (num_0 === true) return;
+                let newGroup = this.newGroup;
+                let copyAttr = this.copyAttr;
+                let select = [];
+                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 = [];
+                this.selectCheck(copyAttr, attrNum_0, select);
+                this.$nextTick(() => {
+                    if (this.number > this.stock) this.number = this.stock;
+                });
+                this.identifier(newGroup, attrNum_0, select);
+                if (select.length !== newGroup.length) {
+                    this.$emit('check', null, 1);
+                }
+            },
+            firstSelect: function() {
+                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.newGroup = copyGroup;
+            },
+            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 attrs = [];
+                if (!this.checked) {
+                    uni.showToast({
+                        title: '请先选规格',
+                        icon: 'none'
+                    });
+                    return false;
+                }
+                this.checked.attr_list.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,
+                    goods_list: [
+                        {
+                            id: this.goods.id,
+                            attrs,
+                            num: this.number,
+                            cat_id: 0,
+                            goods_attr_id: this.checked.id
+                        }
+                    ]
+                }
+                if (this.rightFunc === true) {
+                    this.$emit('rightFunc', goods);
+                } else {
+                    this.shop(goods);
+                }
+                this.close();
+            },
+            shop: function(goods) {
+                uni.navigateTo({
+                    url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}`
+                });
+            },
+            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.$utils.throttle(this.firstSelect, 800);
+                },
+                immediate: true
+            },
+            number: {
+                handler(newVal) {
+                    this.$emit('check', this.checked, newVal);
+                }
+            },
+            again: {
+                handler() {
+                    this.firstSelect();
+                }
+            }
+        }
+    }
 </script>
 
-<style scoped>
-	.u-model {
-		width: 750upx;
-	}
-	.borderwithe{
-		position: relative;
-	}
-	.borderwithe::after{
-		content: "";
-		position: absolute;
-		right: 0;
-		height: 60%;
-		background: #ffffff;
-		width: 1px;
-		top: 50%;
-		transform: translateY(-50%);
-	}
-	.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;
-	}
-</style>
+<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;
+    }
+</style>

+ 746 - 700
plugins/pt/goods/goods.vue

xqd
@@ -1,718 +1,764 @@
 <template>
-	<app-layout>
-		<uni-nav-bar fixed="true" :background-color="titleBg" @click-left="back" left-icon="back"></uni-nav-bar>
-		<view v-if="!loading" class="u-goods-detail"></view>
-		<template v-else>
-			<app-goods-banner :isCart="false" :picList="detail.pic_url" :share="detail.share" sign="pintuan" :goods_id="goods_id"
-			 :video-url="detail.video_url"></app-goods-banner>
-			<app-pt-time :theme="getTheme" :end_time="detail.pintuanGoods.end_time" :start_time="start_time" :time_str="time_str"
-			 :item="detail"></app-pt-time>
-			<bd-info :theme="themeObject" :name="detail.name" :is-negotiable="detail.is_negotiable" :subtitle="detail.subtitle"
-			 :level-show="detail.level_show" :price="detail.price" :original-price="detail.original_price" :price-max="detail.price_max"
-			 :price-min="detail.price_min" :price-member-max="detail.price_member_max" :price-member-min="detail.price_member_min"
-			 :discount='discount' :is-vip-card-user="is_vip_card_user" :sales="detail.sales" :unit="detail.unit" :is-sales="detail.is_sales"
-			 :is-vip="isVip" :flash-sale="flash_sale" :goods-id="detail.id" :extra-quick-share="detail.extra_quick_share"
-			 :app-share-pic="detail.app_share_pic" :app-share-title="detail.app_share_title" :poster-config="poster_config"
-			 :poster-generate="poster_generate" :has-poster-nav="true" v-bind:goods="detail" :share-url="share_url" :isShowPrice="false">
-				<view class="app-bottom dir-left-wrap cross-center">
-					<text class="app-price-symbol app-original-price" :class="getTheme+ '-m-text ' + getTheme" v-if="detail.level_show === 1">{{detail.groups.original_price}}</text>
-					<text class="app-pt-info" :class="getTheme+ '-m-text ' + getTheme + ' ' + getTheme+ '-m-back-o'" v-for="(item, index) in detail.groups"
-					 :key="index">{{item.groups.people_num}}人拼团</text>
-					<text class="app-pt-info" :class="getTheme+ '-m-text ' + getTheme + ' ' + getTheme+ '-m-back-o'">拼团立省¥{{groupSparePrice}}</text>
-				</view>
-			</bd-info>
-			<bd-coupon @change="setCoupon" :theme="themeObject" :coupons="detail.goods_coupon_center"></bd-coupon>
-			<bd-xbc :coAttr="is_open" :attr-list="selectAttr.attr_list" :type="detail.type" :guarantee-title="detail.guarantee_title"
-			 :guarantee-pic="detail.guarantee_pic" :param_content="detail.param_content" :param_name="detail.param_name"
-			 :services="detail.services" :attr-groups="detail.attr_groups" @openAttr="shop(true)"></bd-xbc>
-			<!--商品信息-->
-			<bd-hc :integral="detail.goods_marketing_award.integral" :coupon="detail.goods_marketing_award.coupon" :card="detail.goods_marketing_award.card"
-			 :balance="detail.goods_marketing_award.balance" :theme="themeObject"></bd-hc>
-			<bd-kb :limit="detail.goods_marketing.limit" :express="detail.express" :shipping="detail.goods_marketing.shipping"
-			 :pickup="detail.goods_marketing.pickup"></bd-kb>
-			<app-participant :theme="getTheme" :pintuan_list="pintuan_list"></app-participant>
-			<bd-comments :goods-id="detail.id"></bd-comments>
-			<bd-detail :detail="detail.detail"></bd-detail>
-			<!-- <app-related-suggestion-product :theme="getTheme" sign="pintuan" :list="list"></app-related-suggestion-product> -->
-			<!--相关推荐-->
-			<app-goods-recommend :sureCart="true" :theme="getTheme" :goods-list="list"></app-goods-recommend>
-			<!--空格区域-->
-			<view class="safe-area-inset-bottom u-bottom">
-				<view class="u-bottom-height" :class="pintuan_list.length > 0 && 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 && !show">
-					<app-goods-full-reduce :theme="getTheme" :full_reduce="full_reduce">
-					</app-goods-full-reduce>
-				</view>
-				<view class="join dir-left-nowrap cross-center main-between" v-if="pintuan_list.length > 0 && !show">
-					<view class="dir-left-nowrap cross-center">
-						<image class="avatar" :src="pintuan_list[0].avatar"></image>
-						<view class="text">剩余
-							<text style="color: #ff4544;">{{pintuan_list_time}}</text>
-							,还差{{pintuan_list[0].surplus_people}}人</view>
-					</view>
-					<view :class="getTheme+ '-m-back btn ' + getTheme" @click="goJoin(pintuan_list[0].id)">参与拼团</view>
-				</view>
-				<app-button-button :level_show="detail.level_show" :member_price_min="detail.groups[0].member_price_min" :groups="detail.groups"
-				 :pintuan_groups="item.pintuan_groups" :price="price" :price_member_min="detail.price_member_min" :is_alone_buy="detail.pintuanGoods.is_alone_buy"
-				 :selectGroupAttrId="selectGroupAttrId" :selectAttr="selectAttr" :pt="pt" :item="detail" @click="shop" :start_time="start_time"
-				 :theme="getTheme"></app-button-button>
-			</view>
-			<u-attr :goods="detail" :checked="selectAttr" :themeObject="themeObject" @check="attrTap" v-model="show"
-			 :is_show_left="false" :is_show_right="false" ref="attr" :again="again">
-				<view v-if="pt === true" slot="extra">
-					<app-pt-attr :groups="detail.groups" :selectGroupAttrId="selectGroupAttrId" @click="setGroupAttrID" :theme="getTheme"></app-pt-attr>
-				</view>
-				<template slot="right">
-					<view class="u-pt-bottom dir-left-nowrap">
-						<view v-if="detail.pintuanGoods.is_alone_buy" style="background: linear-gradient(to right, #A494F6, #BC8AE7, #E674B2);color: #fff;"
-						 class="dir-top-nowrap cross-center main-center box-grow-1 borderwithe" @click="leftFunc(number)" :class="getTheme === 'b' || getTheme === 'f' ? getTheme + '-s-back ' + getTheme + ' ' + 'text' : getTheme === 'a' ? 'app-single-button' : getTheme + '-s-back ' + getTheme + ' ' + getTheme + '-m-text'">
-							<text class="price">
-								{{singlePrice}}
-							</text>
-							<text class="app-text">单独购买</text>
-						</view>
-						<view @click="rightFunc" style="background: linear-gradient(to right, #E674B2, #FE3666);color: #fff;" class="dir-top-nowrap cross-center main-center box-grow-1"
-						 :class="getTheme === 'a' ? 'app-pt-button' : getTheme+ '-m-back ' + getTheme">
-							<text class="price">{{groupPrice}}</text>
-							<text class="app-text">{{detail.groups[set_group_num].groups.people_num}}人拼团</text>
-						</view>
-					</view>
-				</template>
-			</u-attr>
-			<!--快捷导航-->
-			<app-quick-navigation></app-quick-navigation>
-		</template>
-		<app-close v-if="showClose" :modal="false" @update="getMall"></app-close>
-	</app-layout>
+    <app-layout>
+        <uni-nav-bar fixed="true" :background-color="titleBg"  @click-left="back"
+                     left-icon="back" ></uni-nav-bar>
+        <view v-if="!loading" class="u-goods-detail"></view>
+        <template v-else>
+            <app-goods-banner
+                :isCart="false"
+                :picList="detail.pic_url"
+                :share="detail.share"
+                sign="pintuan"
+                :goods_id="goods_id"
+                :video-url="detail.video_url"
+            ></app-goods-banner>
+            <app-pt-time
+                :theme="getTheme"
+                :end_time="detail.pintuanGoods.end_time"
+                :start_time="start_time"
+                :time_str="time_str"
+                :item="detail"
+            ></app-pt-time>
+            <bd-info
+                :theme="themeObject"
+                :name="detail.name"
+                :is-negotiable="detail.is_negotiable"
+                :subtitle="detail.subtitle"
+                :level-show="detail.level_show"
+                :price="detail.price"
+                :original-price="detail.original_price"
+                :price-max="detail.price_max"
+                :price-min="detail.price_min"
+                :price-member-max="detail.price_member_max"
+                :price-member-min="detail.price_member_min"
+                :discount='discount'
+                :is-vip-card-user="is_vip_card_user"
+                :sales="detail.sales"
+                :unit="detail.unit"
+                :is-sales="detail.is_sales"
+                :is-vip="isVip"
+                :flash-sale="flash_sale"
+                :goods-id="detail.id"
+                :extra-quick-share="detail.extra_quick_share"
+                :app-share-pic="detail.app_share_pic"
+                :app-share-title="detail.app_share_title"
+                :poster-config="poster_config"
+                :poster-generate="poster_generate"
+                :has-poster-nav="true"
+                v-bind:goods="detail"
+                :share-url="share_url"
+                :isShowPrice="false"
+            >
+                <view class="app-bottom dir-left-wrap cross-center">
+                    <text class="app-price-symbol app-original-price" :class="getTheme+ '-m-text ' + getTheme" v-if="detail.level_show === 1">{{detail.groups.original_price}}</text>
+                    <text class="app-pt-info" :class="getTheme+ '-m-text ' + getTheme + ' ' + getTheme+ '-m-back-o'" v-for="(item, index) in detail.groups" :key="index">{{item.groups.people_num}}人拼团</text>
+                    <text class="app-pt-info" :class="getTheme+ '-m-text ' + getTheme + ' ' + getTheme+ '-m-back-o'">拼团立省¥{{groupSparePrice}}</text>
+                </view>
+            </bd-info>
+            <bd-coupon @change="setCoupon" :theme="themeObject" :coupons="detail.goods_coupon_center"></bd-coupon>
+            <bd-xbc
+                :coAttr="is_open"
+                :attr-list="selectAttr.attr_list"
+                :type="detail.type"
+                :guarantee-title="detail.guarantee_title"
+                :guarantee-pic="detail.guarantee_pic"
+                :param_content="detail.param_content"
+                :param_name="detail.param_name"
+                :services="detail.services"
+                :attr-groups="detail.attr_groups"
+                @openAttr="shop(true)"
+            ></bd-xbc>
+            <!--商品信息-->
+            <bd-hc
+                :integral="detail.goods_marketing_award.integral"
+                :coupon="detail.goods_marketing_award.coupon"
+                :card="detail.goods_marketing_award.card"
+                :balance="detail.goods_marketing_award.balance"
+                :theme="themeObject"
+            ></bd-hc>
+            <bd-kb
+                :limit="detail.goods_marketing.limit"
+                :express="detail.express"
+                :shipping="detail.goods_marketing.shipping"
+                :pickup="detail.goods_marketing.pickup"
+            ></bd-kb>
+            <app-participant :theme="getTheme" :pintuan_list="pintuan_list"></app-participant>
+            <bd-comments :goods-id="detail.id"></bd-comments>
+            <bd-detail :detail="detail.detail"></bd-detail>
+           <!-- <app-related-suggestion-product :theme="getTheme" sign="pintuan" :list="list"></app-related-suggestion-product> -->
+            <!--相关推荐-->
+            <app-goods-recommend :sureCart="true" :theme="getTheme" :goods-list="list"></app-goods-recommend>
+            <!--空格区域-->
+            <view class="safe-area-inset-bottom u-bottom">
+                <view class="u-bottom-height" :class="pintuan_list.length > 0 && 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 && !show">
+                    <app-goods-full-reduce
+                        :theme="getTheme"
+                        :full_reduce="full_reduce"
+                    >
+                    </app-goods-full-reduce>
+                </view>
+                <view class="join dir-left-nowrap cross-center main-between" v-if="pintuan_list.length > 0 && !show">
+                    <view class="dir-left-nowrap cross-center">
+                        <image class="avatar" :src="pintuan_list[0].avatar"></image>
+                        <view class="text">剩余
+                            <text style="color: #ff4544;">{{pintuan_list_time}}</text>
+                            ,还差{{pintuan_list[0].surplus_people}}人</view>
+                    </view>
+                    <view :class="getTheme+ '-m-back btn ' + getTheme" @click="goJoin(pintuan_list[0].id)">参与拼团</view>
+                </view>
+                <app-button-button
+                    :level_show="detail.level_show"
+                    :member_price_min="detail.groups[0].member_price_min"
+                    :groups="detail.groups"
+                    :pintuan_groups="item.pintuan_groups"
+                    :price="price"
+                    :price_member_min="detail.price_member_min"
+                    :is_alone_buy="detail.pintuanGoods.is_alone_buy"
+                    :selectGroupAttrId="selectGroupAttrId"
+                    :selectAttr="selectAttr"
+                    :pt="pt"
+                    :item="detail"
+                    @click="shop"
+                    :start_time="start_time"
+                    :theme="getTheme"
+                ></app-button-button>
+            </view>
+            <u-attr
+
+                :goods="detail"
+                :checked="selectAttr"
+                :themeObject="themeObject"
+                @check="attrTap"
+                v-model="show"
+                :is_show_left="false"
+                :is_show_right="false"
+                ref="attr"
+                :again="again"
+            >
+                <view v-if="pt === true" slot="extra">
+                    <app-pt-attr :groups="detail.groups" :selectGroupAttrId="selectGroupAttrId" @click="setGroupAttrID" :theme="getTheme"></app-pt-attr>
+                </view>
+                <template slot="right">
+                    <view class="u-pt-bottom dir-left-nowrap">
+                        <view v-if="detail.pintuanGoods.is_alone_buy" class="dir-top-nowrap cross-center main-center box-grow-1" @click="leftFunc(number)" :class="getTheme === 'b' || getTheme === 'f' ? getTheme + '-s-back ' + getTheme + ' ' + 'text' : getTheme === 'a' ? 'app-single-button' : getTheme + '-s-back ' + getTheme + ' ' + getTheme + '-m-text'" >
+                            <text class="price">
+                                {{singlePrice}}
+                            </text>
+                            <text class="app-text">单独购买</text>
+                        </view>
+                        <view @click="rightFunc" class="dir-top-nowrap cross-center main-center box-grow-1" style="color: #ffffff;" :class="getTheme === 'a' ? 'app-pt-button' : getTheme+ '-m-back ' + getTheme" >
+                            <text class="price">{{groupPrice}}</text>
+                            <text class="app-text">{{detail.groups[set_group_num].groups.people_num}}人拼团</text>
+                        </view>
+                    </view>
+                </template>
+            </u-attr>
+            <!--快捷导航-->
+            <app-quick-navigation></app-quick-navigation>
+        </template>
+        <app-close v-if="showClose" :modal="false" @update="getMall"></app-close>
+    </app-layout>
 </template>
 <script>
-	import {
-		mapGetters,
-		mapState
-	} from 'vuex';
-	import appGoodsBanner from '../../../components/page-component/goods/app-goods-banner.vue';
-	import appPtTime from '../components/app-pt-time.vue';
-	import appMerchantGuarantee from '../components/app-merchant-guarantee.vue';
-	import appButtomButton from '../components/app-buttom-button.vue';
-	import appPtAttr from '../components/app-pt-attr.vue';
-	import appParticipant from '../components/app-participant.vue';
-	import appRelatedSuggestionProduct from '../../../components/page-component/app-related-suggestion-product/app-related-suggestion-product.vue';
-	import appQuickNavigation from "../../../components/page-component/app-quick-navigation/app-quick-navigation.vue";
-	import appGoodsFullReduce from "../../../components/page-component/goods/app-goods-full-reduce";
-	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';
-	import appGoodsRecommend from "../../../components/page-component/app-goods-recommend/app-goods-recommend";
-	import uniNavBar from '@/components/page-component/uni-plugins/uni-nav-bar.vue';
-	import routeJump from '../../../core/routeJump.js';
+    import { mapGetters, mapState } from 'vuex';
+    import appGoodsBanner from '../../../components/page-component/goods/app-goods-banner.vue';
+    import appPtTime from '../components/app-pt-time.vue';
+    import appMerchantGuarantee from '../components/app-merchant-guarantee.vue';
+    import appButtomButton from '../components/app-buttom-button.vue';
+    import appPtAttr from '../components/app-pt-attr.vue';
+    import appParticipant from '../components/app-participant.vue';
+    import appRelatedSuggestionProduct from '../../../components/page-component/app-related-suggestion-product/app-related-suggestion-product.vue';
+    import appQuickNavigation from "../../../components/page-component/app-quick-navigation/app-quick-navigation.vue";
+    import appGoodsFullReduce from "../../../components/page-component/goods/app-goods-full-reduce";
+    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';
+    import appGoodsRecommend from "../../../components/page-component/app-goods-recommend/app-goods-recommend";
+    import uniNavBar from '@/components/page-component/uni-plugins/uni-nav-bar.vue';
+    import routeJump from '../../../core/routeJump.js';
 
-	export default {
-		name: 'goods',
-		data() {
-			return {
-				showClose: false,
-				is_open: 0,
-				goods_id: 0,
-				detail: {
-					goods_activity: {
-						full_reduce: {}
-					},
-					groups: []
-				},
-				full_reduce: null,
-				loading: false,
-				// 分享
-				share_url: '',
-				// 倒计时
-				time_str: {
-					day: '00',
-					hou: '00',
-					min: '00',
-					sec: '00'
-				},
-				down_time: 0,
-				// 超级会员功能
-				discount: null,
-				isVip: false,
-				goods: {},
-				item: {
-					name: '',
-					pintuan_groups: [],
-				},
-				selectAttr: null,
-				show: false,
-				pt: false,
-				selectGroupAttrId: 0,
-				pintuan_list: [],
-				list: [],
-				cartShow: false,
-				price: '',
-				time: null,
-				is_vip_card_user: 0,
-				url: this.$api.pt.detail,
-				poster_config: this.$api.pt.poster_config,
-				poster_generate: this.$api.pt.poster_generate,
-				aloneAttr: null,
-				start_time: false,
-				pintuan_list_time: '',
-				pt_time: null,
-				number: 1,
-				group_price: '',
-				again: 0,
-				// 限时抢购
-				flash_sale: null,
-				titleBg: 'rgba(255,255,255,0)',
-				name: ''
-			}
-		},
-		onPageScroll: function(e) {
-			this.titleBg = 'rgba(255,255,255,' + e.scrollTop / 300 + ')';
-		},
-		computed: {
-			...mapState('gConfig', {
-				iphone: (data) => {
-					return data.iphone;
-				},
-				iphoneHeight: (state) => {
-					return state.iphoneHeight;
-				},
-			}),
-			...mapState({
-				mall: state => state.mallConfig.mall
-			}),
-			...mapGetters('mallConfig', {
-				getTheme: 'getTheme',
-			}),
-			themeObject: function() {
-				return {
-					back: this.getTheme + '-m-back ' + this.getTheme,
-					theme: this.getTheme,
-					color: this.getTheme + '-m-text ' + this.getTheme,
-					sBack: this.getTheme + '-s-back ' + this.getTheme,
-					backP: this.getTheme + '-m-back-p ' + this.getTheme,
-				}
-			},
-			set_group_num() {
-				for (let i = 0; i < this.detail.groups.length; i++) {
-					if (this.detail.groups[i].groups.id == this.selectGroupAttrId) {
-						return i;
-					}
-				}
-			},
-			groupPrice: function() {
-				if (!this.$validation.isEmpty(this.selectAttr)) {
-					if (this.pt) {
-						if (this.detail.level_show === 1) {
-							if (this.selectAttr.price_member === 0) {
-								return '免费';
-							} else {
-								return `¥${this.selectAttr.price_member}`;
-							}
-						} else {
-							if (Number(this.selectAttr.price) === 0) {
-								return '免费';
-							} else {
-								return `¥${this.selectAttr.price}`;
-							}
-						}
-					} else {
-						let attr = this.detail.groups[this.set_group_num].attr;
-						for (let i = 0; i < attr.length; i++) {
-							if (attr[i].sign_id === this.selectAttr.sign_id) {
-								if (this.detail.level_show === 1) {
-									if (attr[i].price_member === 0) {
-										return '免费';
-									} else {
-										return `¥${attr[i].price_member}`;
-									}
-								} else {
-									if (Number(attr[i].price) === 0) {
-										return '免费';
-									} else {
-										return `¥${attr[i].price}`;
-									}
-								}
-							}
-						}
-					}
-				}
-			},
-			singlePrice: function() {
-				if (!this.$validation.isEmpty(this.selectAttr)) {
-					for (let i = 0; i < this.aloneAttr.length; i++) {
-						if (this.aloneAttr[i].sign_id === this.selectAttr.sign_id) {
-							if (this.detail.level_show === 1) {
-								if (Number(this.aloneAttr[i].price_member) === 0) {
-									return '免费';
-								} else {
-									return `¥${this.aloneAttr[i].price_member}`;
-								}
-							} else {
-								if (Number(this.aloneAttr[i].price) === 0) {
-									return '免费';
-								} else {
-									return `¥${this.aloneAttr[i].price}`;
-								}
-							}
-						}
-					}
-				}
-			},
-			groupSparePrice: function() {
-				if (this.detail.groups.length > 0) {
-					return (this.detail.original_price - this.detail.groups[0].price_min).toFixed(2);
-				} else {
-					return this.detail.original_price;
-				}
-			}
-		},
-		onShow() {
-			this.showClose = false;
-			setTimeout(() => {
-				this.showClose = true;
-			})
-		},
-		onLoad(options) {
-			this.goods_id = options.goods_id;
-			this.requestDetail();
-			this.newRecommend();
-			// #ifdef MP-WEIXIN
-			wx.showShareMenu({
-				menus: ['shareAppMessage', 'shareTimeline']
-			})
-			// #endif
-		},
-		onShareAppMessage() {
-			return this.$shareAppMessage({
-				path: '/plugins/pt/goods/goods',
-				title: this.detail.app_share_title ? this.detail.app_share_title : this.detail.name,
-				imageUrl: this.detail.app_share_pic ? this.detail.app_share_pic : '',
-				params: {
-					goods_id: this.goods_id
-				}
-			});
-		},
-		// #ifdef MP-WEIXIN
-		onShareTimeline() {
-			// 分享朋友圈beta
-			return this.$shareTimeline({
-				title: this.detail.app_share_title ? this.detail.app_share_title : this.detail.name,
-				query: {
-					goods_id: this.goods_id
-				} // 此处填写页面的参数
-			});
-		},
-		// #endif
-		methods: {
-			getMall(e) {
-				this.is_open = e.is_open;
-			},
-			goJoin(id) {
-				uni.navigateTo({
-					url: `/plugins/pt/detail/detail?id=${id}`
-				})
-			},
-			// 获取商品详情
-			async requestDetail() {
-				const e = await this.$request({
-					url: this.$api.pt.detail,
-					method: 'get',
-					data: {
-						id: this.goods_id,
-					}
-				});
-				if (e.code === 0) {
-					this.loading = true;
-					let detail = e.data.detail;
-					this.detail = detail;
-					this.price = detail.price;
-					// 规格初始化
-					this.aloneAttr = JSON.parse(JSON.stringify(detail.attr));
-					let groups = detail.groups;
-					if (groups.length > 0) {
-						this.detail.attr = groups[0].attr;
-						this.selectGroupAttrId = groups[0].groups.id;
-					}
-					if (detail.goods_activity) {
-						this.full_reduce = detail.goods_activity.full_reduce;
-					}
-					this.name = detail.name;
-					this.flash_sale = detail.plugin_extra.flash_sale;
-					this.share_url = `${this.$api.pt.poster}&goods_id=${this.detail.id}`;
-					this.poster_config = `${this.poster_config}&goods_id=${this.detail.id}`;
-					this.poster_generate = `${this.poster_generate}&goods_id=${this.detail.id}`;
-					this.pintuan_list = e.data.pintuan_list;
-					if (this.pintuan_list.length > 0) {
-						let timelog = new Date(this.pintuan_list[0].surplus_date_time.replace(/-/g, '/'));
-						this.pt_time = setInterval(() => {
-							let time = timelog.getTime() - new Date().getTime();
-							if (time < 0) {
-								clearInterval(this.pt_time);
-							}
-							let day = parseInt((time / 1000 / 60 / 60 / 24) % 30);
-							let hou = parseInt((time / 1000 / 60 / 60) % 24);
-							let min = parseInt((time / 1000 / 60) % 60);
-							let sec = parseInt((time / 1000) % 60);
-							if (day > 0) {
-								this.pintuan_list_time = day + "天" + hou + ":" + (min < 10 ? "0" + min : min) + ":" + (sec < 10 ? "0" + sec :
-									sec);
-							} else {
-								this.pintuan_list_time = hou + ":" + (min < 10 ? "0" + min : min) + ":" + (sec < 10 ? "0" + sec : sec);
-							}
-						}, 1000);
-					}
-					if (detail.vip_card_appoint.discount) {
-						this.isVip = true;
-						this.discount = detail.vip_card_appoint.discount;
-					}
-					this.is_vip_card_user = detail.vip_card_appoint.is_vip_card_user;
-					this.goods = {
-						attr: detail.attr,
-						cover_pic: detail.cover_pic,
-						level_show: detail.level_show,
-						price: detail.price,
-						mch_id: detail.mch_id
-					};
-					if (detail.pintuanGoods.end_time !== '0000-00-00 00:00:00') {
-						this.countdown(detail.pintuanGoods.end_time);
-					}
+    export default {
+        name: 'goods',
+        data() {
+            return {
+                showClose: false,
+                is_open: 0,
+                goods_id: 0,
+                detail: {
+                    goods_activity: {
+                        full_reduce: {}
+                    },
+                    groups: []
+                },
+                full_reduce: null,
+                loading: false,
+                // 分享
+                share_url: '',
+                // 倒计时
+                time_str: {
+                    day: '00',
+                    hou: '00',
+                    min: '00',
+                    sec: '00'
+                },
+                down_time: 0,
+                // 超级会员功能
+                discount: null,
+                isVip: false,
+                goods: {},
+                item: {
+                    name: '',
+                    pintuan_groups: [],
+                },
+                selectAttr: null,
+                show: false,
+                pt: false,
+                selectGroupAttrId: 0,
+                pintuan_list: [],
+                list: [],
+                cartShow: false,
+                price: '',
+                time: null,
+                is_vip_card_user: 0,
+                url: this.$api.pt.detail,
+                poster_config: this.$api.pt.poster_config,
+                poster_generate: this.$api.pt.poster_generate,
+                aloneAttr: null,
+                start_time: false,
+                pintuan_list_time: '',
+                pt_time: null,
+                number: 1,
+                group_price: '',
+                again: 0,
+                // 限时抢购
+                flash_sale: null,
+                titleBg:'rgba(255,255,255,0)',
+                name:''
+            }
+        },
+        onPageScroll:function(e){
+            this.titleBg = 'rgba(255,255,255,'+e.scrollTop / 300+')';
+        },
+        computed: {
+            ...mapState('gConfig', {
+                iphone: (data) => {
+                    return data.iphone;
+                },
+                iphoneHeight: (state) => {
+                    return state.iphoneHeight;
+                },
+            }),
+            ...mapState({
+                mall: state => state.mallConfig.mall
+            }),
+            ...mapGetters('mallConfig', {
+                getTheme: 'getTheme',
+            }),
+            themeObject:function() {
+                return {
+                    back: this.getTheme + '-m-back ' + this.getTheme,
+                    theme: this.getTheme,
+                    color: this.getTheme + '-m-text ' + this.getTheme,
+                    sBack: this.getTheme + '-s-back ' + this.getTheme,
+                    backP: this.getTheme + '-m-back-p ' + this.getTheme,
+                }
+            },
+            set_group_num() {
+                for (let i = 0; i < this.detail.groups.length; i++) {
+                    if (this.detail.groups[i].groups.id == this.selectGroupAttrId) {
+                        return i;
+                    }
+                }
+            },
+            groupPrice: function() {
+                if (!this.$validation.isEmpty(this.selectAttr)) {
+                    if (this.pt) {
+                        if (this.detail.level_show === 1) {
+                            if (this.selectAttr.price_member === 0) {
+                                return '免费';
+                            } else {
+                                return `¥${this.selectAttr.price_member}`;
+                            }
+                        } else {
+                            if (Number(this.selectAttr.price) ===  0) {
+                                return '免费';
+                            } else {
+                                return `¥${this.selectAttr.price}`;
+                            }
+                        }
+                    } else {
+                        let attr = this.detail.groups[this.set_group_num].attr;
+                        for (let i = 0; i < attr.length; i++) {
+                            if (attr[i].sign_id === this.selectAttr.sign_id) {
+                                if (this.detail.level_show === 1) {
+                                    if (attr[i].price_member === 0) {
+                                        return '免费';
+                                    } else {
+                                        return `¥${attr[i].price_member}`;
+                                    }
+                                } else {
+                                    if (Number(attr[i].price) ===  0) {
+                                        return '免费';
+                                    } else {
+                                        return `¥${attr[i].price}`;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            },
+            singlePrice: function() {
+                if (!this.$validation.isEmpty(this.selectAttr)) {
+                    for (let i = 0; i < this.aloneAttr.length; i++) {
+                        if (this.aloneAttr[i].sign_id === this.selectAttr.sign_id) {
+                            if (this.detail.level_show === 1) {
+                                if (Number(this.aloneAttr[i].price_member) === 0) {
+                                    return '免费';
+                                } else {
+                                    return `¥${this.aloneAttr[i].price_member}`;
+                                }
+                            } else {
+                                if (Number(this.aloneAttr[i].price) === 0) {
+                                    return '免费';
+                                } else {
+                                    return `¥${this.aloneAttr[i].price}`;
+                                }
+                            }
+                        }
+                    }
+                }
+            },
+            groupSparePrice: function() {
+                if (this.detail.groups.length > 0) {
+                    return (this.detail.original_price - this.detail.groups[0].price_min).toFixed(2);
+                } else {
+                    return this.detail.original_price;
+                }
+            }
+        },
+        onShow() {
+            this.showClose = false;
+            setTimeout(()=>{
+                this.showClose = true;
+            })
+        },
+        onLoad(options) {
+            this.goods_id = options.goods_id;
+            this.requestDetail();
+            this.newRecommend();
+            // #ifdef MP-WEIXIN
+            wx.showShareMenu({
+                menus: ['shareAppMessage', 'shareTimeline']
+            })
+            // #endif
+        },
+        onShareAppMessage() {
+            return this.$shareAppMessage({
+                path: '/plugins/pt/goods/goods',
+                title: this.detail.app_share_title ? this.detail.app_share_title : this.detail.name,
+                imageUrl: this.detail.app_share_pic ? this.detail.app_share_pic : '',
+                params: {
+                    goods_id: this.goods_id
+                }
+            });
+        },
+        // #ifdef MP-WEIXIN
+        onShareTimeline() {
+            // 分享朋友圈beta
+            return this.$shareTimeline({
+                title: this.detail.app_share_title ? this.detail.app_share_title : this.detail.name,
+                query: {
+                    goods_id: this.goods_id
+                } // 此处填写页面的参数
+            });
+        },
+        // #endif
+        methods: {
+            getMall(e) {
+                this.is_open = e.is_open;
+            },
+            goJoin(id) {
+                uni.navigateTo({
+                    url: `/plugins/pt/detail/detail?id=${id}`
+                })
+            },
+            // 获取商品详情
+            async requestDetail() {
+                const e = await this.$request({
+                    url: this.$api.pt.detail,
+                    method: 'get',
+                    data: {
+                        id: this.goods_id,
+                    }
+                });
+                if (e.code === 0) {
+                    this.loading = true;
+                    let detail = e.data.detail;
+                    this.detail = detail;
+                    this.price = detail.price;
+                    // 规格初始化
+                    this.aloneAttr = JSON.parse(JSON.stringify(detail.attr));
+                    let groups = detail.groups;
+                    if (groups.length > 0) {
+                        this.detail.attr = groups[0].attr;
+                        this.selectGroupAttrId = groups[0].groups.id;
+                    }
+                    if (detail.goods_activity) {
+                        this.full_reduce = detail.goods_activity.full_reduce;
+                    }
+                    this.name = detail.name;
+                    this.flash_sale = detail.plugin_extra.flash_sale;
+                    this.share_url = `${this.$api.pt.poster}&goods_id=${this.detail.id}`;
+                    this.poster_config = `${this.poster_config}&goods_id=${this.detail.id}`;
+                    this.poster_generate = `${this.poster_generate}&goods_id=${this.detail.id}`;
+                    this.pintuan_list = e.data.pintuan_list;
+                    if (this.pintuan_list.length > 0) {
+                        let timelog = new Date(this.pintuan_list[0].surplus_date_time.replace(/-/g, '/'));
+                        this.pt_time = setInterval(() =>{
+                            let time = timelog.getTime() - new Date().getTime();
+                            if (time < 0) {
+                                clearInterval(this.pt_time);
+                            }
+                            let day = parseInt((time/1000/60/60/24)%30);
+                            let hou = parseInt((time/1000/60/60)%24);
+                            let min = parseInt((time/1000/60)%60);
+                            let sec = parseInt((time/1000)%60);
+                            if (day > 0) {
+                                this.pintuan_list_time = day+"天"+hou+":"+(min<10?"0"+min:min) + ":"+(sec<10?"0"+sec:sec);
+                            } else {
+                                this.pintuan_list_time = hou+":"+(min<10?"0"+min:min) + ":"+(sec<10?"0"+sec:sec);
+                            }
+                        },1000);
+                    }
+                    if (detail.vip_card_appoint.discount) {
+                        this.isVip = true;
+                        this.discount = detail.vip_card_appoint.discount;
+                    }
+                    this.is_vip_card_user = detail.vip_card_appoint.is_vip_card_user;
+                    this.goods = {
+                        attr: detail.attr,
+                        cover_pic: detail.cover_pic,
+                        level_show: detail.level_show,
+                        price: detail.price,
+                        mch_id: detail.mch_id
+                    };
+                    if (detail.pintuanGoods.end_time !== '0000-00-00 00:00:00') {
+                        this.countdown(detail.pintuanGoods.end_time);
+                    }
 
-					if (detail.pintuanGoods.start_time) {
-						let time = new Date(detail.pintuanGoods.start_time.replace(/-/g, '/'));
-						let nowTime = new Date();
-						let equation = time.getTime() - nowTime.getTime();
-						if (equation > 0) {
-							this.start_time = false;
-							this.countdown(detail.pintuanGoods.start_time);
-						} else {
-							this.start_time = true;
-						}
-					}
-				} else {
-					uni.showToast({
-						title: e.msg,
-						icon: 'none'
-					})
-				}
-			},
-			countdown(t) {
-				let time = new Date(t.replace(/-/g, '/'));
-				let nowTime = new Date();
-				let equation = time.getTime() - nowTime.getTime();
-				let day = parseInt((equation / 3600000 / 24));
-				let hour = parseInt((equation / 1000 / 60 / 60) % 24);
-				let minute = parseInt((equation / 1000 / 60) % 60);
-				let second = parseInt((equation / 1000) % 60);
-				this.time_str = {
-					day: day < 10 ? `0${day}` : day,
-					hou: hour < 10 ? `0${hour}` : hour,
-					min: minute < 10 ? `0${minute}` : minute,
-					sec: second < 10 ? `0${second}` : second
-				}
-				this.down_time = setTimeout(() => {
-					this.countdown(t);
-				}, 1000);
-			},
+                    if (detail.pintuanGoods.start_time) {
+                        let time = new Date(detail.pintuanGoods.start_time.replace(/-/g, '/'));
+                        let nowTime = new Date();
+                        let equation = time.getTime() - nowTime.getTime();
+                        if (equation > 0) {
+                            this.start_time = false;
+                            this.countdown(detail.pintuanGoods.start_time);
+                        } else {
+                            this.start_time = true;
+                        }
+                    }
+                } else {
+                    uni.showToast({
+                        title: e.msg,
+                        icon: 'none'
+                    })
+                }
+            },
+            countdown(t) {
+                let time = new Date(t.replace(/-/g, '/'));
+                let nowTime = new Date();
+                let equation = time.getTime() - nowTime.getTime();
+                let day = parseInt((equation / 3600000 / 24));
+                let hour = parseInt((equation / 1000 / 60 / 60) % 24);
+                let minute = parseInt((equation / 1000 / 60) % 60);
+                let second = parseInt((equation / 1000) % 60);
+                this.time_str = {
+                    day: day < 10 ? `0${day}` : day,
+                    hou: hour < 10 ? `0${hour}` : hour,
+                    min: minute < 10 ? `0${minute}` : minute,
+                    sec: second < 10 ? `0${second}` : second
+                }
+                this.down_time = setTimeout(() => {
+                    this.countdown(t);
+                }, 1000);
+            },
 
-			async newRecommend() {
-				const e = await this.$request({
-					url: this.$api.goods.new_recommend
-				});
-				if (e.code === 0) {
-					this.list = e.data.list;
-				}
-			},
-			setCoupon(index) {
-				this.$set(this.detail.goods_coupon_center[index], 'is_receive', 1);
-			},
-			attrTap(data, number) {
-				for (let i = 0; i < this.aloneAttr.length; i++) {
-					if (this.aloneAttr[i].sign_id === data.sign_id) {
-						this.price = this.aloneAttr[i].price;
-					}
-				}
-				this.number = number;
-				this.selectAttr = data;
-			},
-			shop(data) {
-				if (data === true) {
-					this.$set(this, 'pt', true);
-					this.detail.groups.forEach((item) => {
-						if (this.selectGroupAttrId === item.groups.id) {
-							this.$set(this.detail, 'attr', item.attr);
-							this.$set(this.detail, 'id', item.groups.goods_id);
-						}
-					});
-				} else {
-					this.$set(this, 'pt', false);
-					this.$set(this.detail, 'attr', this.aloneAttr);
-					this.$set(this.detail, 'id', this.goods_id);
-				}
-				this.show = true;
-			},
-			setGroupAttrID(item) {
-				this.selectGroupAttrId = item.groups.id;
-				this.$set(this.detail, 'attr', item.attr);
-				this.$set(this.detail, 'id', item.groups.goods_id);
-				this.$nextTick(() => {
-					this.again = Math.random();
-				});
-			},
-			defaultRequest() {
-				this.$set(this, 'pt', true);
-				this.detail.attr = this.detail.groups[0].attr;
-				this.selectGroupAttrId = this.detail.groups[0].groups.id;
-				this.detail.id = this.detail.groups[0].groups.goods_id;
-			},
-			rightFunc() {
-				if (this.pt === false && this.show === true) {
-					this.pt = true;
-					this.$set(this, 'pt', true);
-					setTimeout(() => {
-						this.show = true;
-					}, 500);
-					this.detail.groups.forEach((item) => {
-						if (this.selectGroupAttrId === item.groups.id) {
-							this.$set(this.detail, 'attr', item.attr);
-							this.$set(this.detail, 'id', item.groups.goods_id);
-						}
-					});
-					this.$nextTick(() => {
-						this.again = Math.random();
-					});
-				} else {
-					let attrs = [];
-					this.selectAttr.attr_list.forEach(item => {
-						attrs.push({
-							attr_id: item.attr_id,
-							attr_group_id: item.attr_group_id
-						});
-					});
-					let newData = {
-						pintuan_order_id: 0,
-						pintuan_group_id: this.selectGroupAttrId,
-						mch_id: this.detail.mch_id ? this.detail.mch_id : 0,
-						goods_list: [{
-							id: this.detail.id,
-							attrs,
-							num: this.number,
-							cat_id: 0,
-							goods_attr_id: this.selectAttr.id
-						}]
-					}
-					uni.navigateTo({
-						url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([newData])}&preview_url=${encodeURIComponent(this.$api.pt.order_preview)}&submit_url=${encodeURIComponent(this.$api.pt.order_submit)}`
-					});
-				}
+            async newRecommend() {
+                const e = await this.$request({
+                    url: this.$api.goods.new_recommend
+                });
+                if (e.code === 0) {
+                    this.list = e.data.list;
+                }
+            },
+            setCoupon(index) {
+                this.$set(this.detail.goods_coupon_center[index], 'is_receive', 1);
+            },
+            attrTap(data, number) {
+                for (let i = 0; i < this.aloneAttr.length; i++) {
+                    if (this.aloneAttr[i].sign_id === data.sign_id) {
+                        this.price = this.aloneAttr[i].price;
+                    }
+                }
+                this.number = number;
+                this.selectAttr = data;
+            },
+            shop(data) {
+                if (data === true) {
+                    this.$set(this, 'pt', true);
+                    this.detail.groups.forEach((item) => {
+                        if (this.selectGroupAttrId === item.groups.id) {
+                            this.$set(this.detail, 'attr', item.attr);
+                            this.$set(this.detail, 'id', item.groups.goods_id);
+                        }
+                    });
+                } else {
+                    this.$set(this, 'pt', false);
+                    this.$set(this.detail, 'attr', this.aloneAttr);
+                    this.$set(this.detail, 'id', this.goods_id);
+                }
+                this.show = true;
+            },
+            setGroupAttrID(item) {
+                this.selectGroupAttrId = item.groups.id;
+                this.$set(this.detail, 'attr', item.attr);
+                this.$set(this.detail, 'id', item.groups.goods_id);
+                this.$nextTick(() => {
+                    this.again = Math.random();
+                });
+            },
+            defaultRequest() {
+                this.$set(this, 'pt', true);
+                this.detail.attr = this.detail.groups[0].attr;
+                this.selectGroupAttrId = this.detail.groups[0].groups.id;
+                this.detail.id = this.detail.groups[0].groups.goods_id;
+            },
+            rightFunc() {
+                if (this.pt === false && this.show === true) {
+                    this.pt = true;
+                    this.$set(this, 'pt', true);
+                    setTimeout(() => {
+                        this.show = true;
+                    }, 500);
+                    this.detail.groups.forEach((item) => {
+                       if (this.selectGroupAttrId === item.groups.id) {
+                           this.$set(this.detail, 'attr', item.attr);
+                           this.$set(this.detail, 'id', item.groups.goods_id);
+                       }
+                    });
+                    this.$nextTick(() => {
+                        this.again = Math.random();
+                    });
+                } else {
+                    let attrs = [];
+                    this.selectAttr.attr_list.forEach(item => {
+                        attrs.push({
+                            attr_id: item.attr_id,
+                            attr_group_id: item.attr_group_id
+                        });
+                    });
+                    let newData = {
+                        pintuan_order_id: 0,
+                        pintuan_group_id: this.selectGroupAttrId,
+                        mch_id: this.detail.mch_id ? this.detail.mch_id : 0,
+                        goods_list: [
+                            {
+                                id: this.detail.id,
+                                attrs,
+                                num: this.number,
+                                cat_id: 0,
+                                goods_attr_id: this.selectAttr.id
+                            }
+                        ]
+                    }
+                    uni.navigateTo({
+                        url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([newData])}&preview_url=${encodeURIComponent(this.$api.pt.order_preview)}&submit_url=${encodeURIComponent(this.$api.pt.order_submit)}`
+                    });
+                }
 
-			},
-			leftFunc(number) {
-				if (this.pt === true && this.show === true) {
-					this.$set(this, 'pt', false);
-					setTimeout(() => {
-						this.show = true;
-					}, 500);
-					this.$set(this.detail, 'attr', this.aloneAttr);
-					this.$set(this.detail, 'id', this.goods_id);
-					this.$nextTick(() => {
-						this.$refs.attr.firstSelect();
-					});
-				} else {
-					let goods = this.detail;
-					let select_attr = this.selectAttr;
-					let attr = [];
-					for (let i in select_attr.attr_list) {
-						attr.push({
-							attr_id: select_attr.attr_list[i].attr_id,
-							attr_group_id: select_attr.attr_list[i].attr_group_id
-						});
-					}
-					let mch_list = [{
-						mch_id: goods.mch_id ? goods.mch_id : 0,
-						pintuan_order_id: 0,
-						pintuan_group_id: 0,
-						goods_list: [{
-							id: goods.id,
-							attr: attr,
-							num: number,
-							cat_id: 0,
-							goods_attr_id: select_attr.id
-						}]
-					}];
-					uni.navigateTo({
-						url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify(mch_list)}&preview_url=${encodeURIComponent(this.$api.pt.order_preview)}&submit_url=${encodeURIComponent(this.$api.pt.order_submit)}`
-					});
-				}
-			},
-			back() {
-				routeJump({
-					open_type: 'back',
-				})
-			}
-		},
+            },
+            leftFunc(number) {
+                if (this.pt === true && this.show === true) {
+                    this.$set(this, 'pt', false);
+                    setTimeout(() => {
+                        this.show = true;
+                    }, 500);
+                    this.$set(this.detail, 'attr', this.aloneAttr);
+                    this.$set(this.detail, 'id', this.goods_id);
+                    this.$nextTick(() => {
+                        this.$refs.attr.firstSelect();
+                    });
+                } else {
+                    let goods = this.detail;
+                    let select_attr = this.selectAttr;
+                    let attr = [];
+                    for (let i in select_attr.attr_list) {
+                        attr.push({
+                            attr_id: select_attr.attr_list[i].attr_id,
+                            attr_group_id: select_attr.attr_list[i].attr_group_id
+                        });
+                    }
+                    let mch_list = [{
+                        mch_id: goods.mch_id ? goods.mch_id : 0,
+                        pintuan_order_id: 0,
+                        pintuan_group_id: 0,
+                        goods_list: [{
+                            id: goods.id,
+                            attr: attr,
+                            num: number,
+                            cat_id: 0,
+                            goods_attr_id: select_attr.id
+                        }]
+                    }];
+                    uni.navigateTo({
+                        url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify(mch_list)}&preview_url=${encodeURIComponent(this.$api.pt.order_preview)}&submit_url=${encodeURIComponent(this.$api.pt.order_submit)}`
+                    });
+                }
+            },
+            back(){
+                routeJump({
+                    open_type: 'back',
+                })
+            }
+        },
 
-		components: {
-			bdInfo,
-			bdCoupon,
-			bdXbc,
-			bdKb,
-			bdHc,
-			bdDetail,
-			bdComments,
-			'app-goods-banner': appGoodsBanner,
-			'app-goods-recommend': appGoodsRecommend,
-			'app-pt-time': appPtTime,
-			'app-merchant-guarantee': appMerchantGuarantee,
-			'app-button-button': appButtomButton,
-			'app-pt-attr': appPtAttr,
-			'app-participant': appParticipant,
-			'app-related-suggestion-product': appRelatedSuggestionProduct,
-			'app-quick-navigation': appQuickNavigation,
-			uAttr,
-			appGoodsFullReduce,
-			appClose,
-			uniNavBar
-		},
-		onHide() {
-			clearTimeout(this.down_time);
-		},
-		onUnload() {
-			clearTimeout(this.down_time);
-		}
-	}
+        components: {
+            bdInfo,
+            bdCoupon,
+            bdXbc,
+            bdKb,
+            bdHc,
+            bdDetail,
+            bdComments,
+            'app-goods-banner': appGoodsBanner,
+            'app-goods-recommend': appGoodsRecommend,
+            'app-pt-time': appPtTime,
+            'app-merchant-guarantee': appMerchantGuarantee,
+            'app-button-button': appButtomButton,
+            'app-pt-attr': appPtAttr,
+            'app-participant': appParticipant,
+            'app-related-suggestion-product': appRelatedSuggestionProduct,
+            'app-quick-navigation': appQuickNavigation,
+            uAttr,
+            appGoodsFullReduce,
+            appClose,
+            uniNavBar
+        },
+        onHide() {
+            clearTimeout(this.down_time);
+        },
+        onUnload() {
+            clearTimeout(this.down_time);
+        }
+    }
 </script>
 <style lang="scss" scoped>
-	.vip-card {
-		padding: 0 #{20rpx} #{20rpx};
-		background-color: #fff;
-	}
-
-	.join-member {
-		background-color: #ffffff;
-		padding: 0 #{24rpx};
-		box-sizing: border-box;
-	}
-
-	.borderwithe {
-		position: relative;
-	}
-
-	.borderwithe ::after {
-		content: "";
-		position: absolute;
-		right: 0;
-		height: 60%;
-		background: #ffffff;
-		width: 1px;
-		top: 50%;
-		transform: translateY(-50%);
-	}
-
-	.app-buttons {
-		position: fixed;
-		z-index: 1602;
-	}
-
-	.join {
-		width: 750upx;
-		height: 88upx;
-		background-color: #fff7b8;
-		padding: 0 24upx;
-
-		.avatar {
-			width: 64upx;
-			height: 64upx;
-			border-radius: 32upx;
-		}
-
-		.btn {
-			width: 160upx;
-			height: 64upx;
-			border-radius: 40upx;
-			font-size: 26upx;
-			color: #ffffff;
-			line-height: 64upx;
-			text-align: center;
-		}
-
-		.text {
-			font-size: 26upx;
-			margin-left: 24upx;
-			line-height: 1;
-			color: #353535;
-		}
-	}
-
-	.u-bottom-fixed {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		width: 100%;
-		z-index: 1500;
-		background-color: #ffffff;
-	}
-
-	.u-bottom-height-0 {
-		height: 190upx;
-	}
-
-	.u-bottom-height-1 {
-		height: 280upx;
-	}
-
-	.goods-margin {
-		margin-top: 20upx;
-	}
-
-	.u-pt-bottom {
-		width: 750rpx;
-		height: 110rpx;
-	}
-
-	.app-bottom {
-		margin-top: #{18rpx};
+    .vip-card {
+        padding: 0 #{20rpx} #{20rpx};
+        background-color: #fff;
+    }
+    .join-member {
+        background-color: #ffffff;
+        padding: 0 #{24rpx};
+        box-sizing: border-box;
+    }
 
-		>text {
-			margin-bottom: 5upx;
-		}
+    .app-buttons {
+        position: fixed;
+        z-index: 1602;
+    }
 
-		.app-original-price {
-			font-size: #{23rpx};
-			margin-right: #{10rpx};
-		}
+    .join {
+        width: 750upx;
+        height: 88upx;
+        background-color: #fff7b8;
+        padding: 0 24upx;
+        .avatar {
+            width: 64upx;
+            height: 64upx;
+            border-radius: 32upx;
+        }
+        .btn {
+            width: 160upx;
+            height: 64upx;
+            border-radius: 40upx;
+            font-size: 26upx;
+            color: #ffffff;
+            line-height: 64upx;
+            text-align: center;
+        }
+        .text {
+            font-size: 26upx;
+            margin-left: 24upx;
+            line-height: 1;
+            color: #353535;
+        }
+    }
 
-		.app-pt-info {
-			display: inline-block;
-			height: #{30rpx};
-			line-height: #{30rpx};
-			padding: 0 #{8rpx};
-			margin-left: #{5rpx};
-			font-size: #{20rpx};
-		}
-	}
+    .u-bottom-fixed {
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        width: 100%;
+        z-index: 1500;
+        background-color: #ffffff;
+    }
+    .u-bottom-height-0 {
+        height: 190upx;
+    }
+    .u-bottom-height-1 {
+        height: 280upx;
+    }
+    .goods-margin {
+        margin-top: 20upx;
+    }
+    .u-pt-bottom {
+        width: 750rpx;
+        height: 110rpx;
+    }
 
-	.app-pt-button {
-		background: linear-gradient(140deg, #ff9460, #ff5c5c);
+    .app-bottom {
+        margin-top: #{18rpx};
+        >text {
+            margin-bottom: 5upx;
+        }
+        .app-original-price {
+            font-size: #{23rpx};
+            margin-right: #{10rpx};
+        }
+        .app-pt-info {
+            display: inline-block;
+            height: #{30rpx};
+            line-height: #{30rpx};
+            padding: 0 #{8rpx};
+            margin-left: #{5rpx};
+            font-size: #{20rpx};
+        }
+    }
 
-		text {
-			color: white;
-		}
-	}
+    .app-pt-button {
+        background: linear-gradient(140deg, #ff9460, #ff5c5c);
+        text {
+            color: white;
+        }
+    }
 
-	.app-single-button {
-		background-color: #feeeee;
+    .app-single-button {
+        background-color: #feeeee;
 
-		text {
-			color: #ff5c5c;
-		}
-	}
+        text {
+            color: #ff5c5c;
+        }
+    }
 </style>