hwq 3 anni fa
parent
commit
0df3d89720

+ 8 - 0
api/product.js

@@ -8,6 +8,14 @@ export function lala(data) {
 		data
 	});
 }
+//兑换商品详情
+export function duihuanDetail(data,id) {
+	return request({
+		url: '/api/exchange/detail/' + id,
+		method: 'get',
+		data
+	})
+}
 // 获取商品分类
 export function getCategoryList(data) {
 	return request({

+ 8 - 0
api/user.js

@@ -74,6 +74,14 @@ export function loadIndexs(data) {
 		data
 	});
 }
+// 获取首页信息
+export function dhList(data) {
+	return request({
+		url: '/api/exchange/list',
+		method: 'get',
+		data
+	});
+}
 //获取版本
 export function version(data) {
 	return request({

+ 7 - 1
pages.json

@@ -391,7 +391,7 @@
 			}
 		},
 		{
-			"path": "pages/product/ping",	// 普通商品
+			"path": "pages/product/ping",
 			"style": {
 				"navigationBarTitleText": "拼团11人区"
 			}
@@ -402,6 +402,12 @@
 				"navigationBarTitleText": "商品详情"
 			}
 		},
+		{
+			"path": "pages/product/productDuhuan",	// 兑换商品
+			"style": {
+				"navigationBarTitleText": "商品详情"
+			}
+		},
 		{
 			"path": "pages/product/list",
 			"style": {

+ 14 - 3
pages/collection/wx.vue

@@ -7,8 +7,9 @@
 			</view>
 			<view class="erweima">
 				<text>微信收款码</text>
-				<view class="img">
-					<image src="../../static/user/erweima.png" mode=""></image>
+				<view class="img" @click="upload()">
+					<image src="../../static/user/erweima.png" mode="" v-if="image == ''"></image>
+					<image :src="image" mode="" v-else></image>
 				</view>
 			</view>
 		</view>
@@ -19,11 +20,21 @@
 </template>
 
 <script>
+	import { uploads } from '@/api/user.js'
 	export default {
 		data() {
 			return {
-				
+				image:''
 			};
+		},
+		methods: {
+			upload(){
+				uploads({
+					filename: ''
+				}).then(data => {
+					this.image = data[0].url;
+				})
+			}
 		}
 	}
 </script>

+ 207 - 25
pages/index/index.vue

@@ -43,16 +43,45 @@
 				</view>
 			</view>
 		</view>
+		<!-- 拼团积分商品 -->
+		<view class="recommend-box" v-if="ptjfList.length > 0">
+			<view class="f-header">
+				<view class="f-left-icon">拼团积分兑换专区</view>
+				<view class="tit-box"><text class="tit">超级好物 立即抢购</text></view>
+				<view @click="navTo('/pages/recommend/recommend')"><text class="iconfont iconenter">更多</text></view>
+			</view>
+			<view class="guess-section">
+				<view v-for="(item, index) in ptjfList" :key="index" class="guess-item" @click="navToDetailPage(item)">
+					<view class="image-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
+					<view class="info-wrapper">
+						<text class="title">{{ item.title }}</text>
+						<view class="price-box">
+							<view class="price-left">
+								<view class="price">
+									{{ item.money * 1 }}
+									<text class="price-tip">{{ item.money_type}}</text>
+								</view>
+							</view>
+							<view class="price-right">
+								<!-- <view class="people">{{item.sales}}人购买</view> -->
+								<view class="buyNow">马上购</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 <script>
 import { getTime } from '@/utils/rocessor.js';
-import { loadIndexs } from '@/api/user.js';
-import { saveUrl,interceptor } from '@/utils/loginUtils.js';
-import { mapState,mapMutations } from 'vuex';
+import { loadIndexs, dhList } from '@/api/user.js';
+import { saveUrl, interceptor } from '@/utils/loginUtils.js';
+import { mapState, mapMutations } from 'vuex';
+
 export default {
 	computed: {
-		...mapState('user',['userInfo', 'baseURL', 'hasLogin', 'urlFile'])
+		...mapState('user', ['userInfo', 'baseURL', 'hasLogin', 'urlFile'])
 	},
 	data() {
 		return {
@@ -61,57 +90,58 @@ export default {
 				{
 					name: '自动拼团',
 					pic: '../../static/icon/index1.png',
-					url:'/pages/index/appointment'
+					url: '/pages/index/appointment'
 				},
 				{
 					name: '11人团专区',
 					pic: '../../static/icon/index2.png',
-					url:'/pages/product/ping'
+					url: '/pages/product/ping'
 				},
 				{
 					name: '拼团合伙人',
 					pic: '../../static/icon/index3.png',
-					url:'/pages/index/node'
+					url: '/pages/index/node'
 				},
 				{
 					name: '素材分享',
 					pic: '../../static/icon/index4.png',
-					url:''
+					url: ''
 				},
 				{
 					name: '邀请有礼',
 					pic: '../../static/icon/index5.png',
-					url:'/pages/user/shareQrCode'
+					url: '/pages/user/shareQrCode'
 				},
 				{
 					name: '拼购福利',
 					pic: '../../static/icon/index6.png',
-					url:'/pages/user/fulilist'
+					url: '/pages/user/fulilist'
 				},
 				{
 					name: '互助专区',
 					pic: '../../static/icon/index7.png',
-					url:'/pages/assets/logroll'
+					url: '/pages/assets/logroll'
 				},
 				{
 					name: '签到领钱',
 					pic: '../../static/icon/index8.png',
-					url:'/pages/index/sign'
+					url: '/pages/index/sign'
 				},
 				{
 					name: '服务器兑换',
 					pic: '../../static/icon/index9.png',
-					url:'/pages/market/market'
+					url: '/pages/market/market'
 				},
 				{
 					name: '话费充值',
 					pic: '../../static/icon/index10.png',
-					url:'/pages/money/phone'
+					url: '/pages/money/phone'
 				}
 			],
 			swiperLength: 0,
 			swiperCurrent: 0,
-			commodityList: []
+			commodityList: [],//普通商品列表
+			ptjfList:[],//拼团积分列表
 		};
 	},
 	//页面加载即刻发生
@@ -127,12 +157,36 @@ export default {
 				obj.swiperLength = data.banner.length;
 				obj.commodityList = data.likeInfo;
 			});
+			dhList({ page: 1, limit: 10, money_type: 'USDC' }).then(({ data }) => {
+				obj.ptjfList = data
+				console.log(obj.ptjfList,'1111')
+			});
 		},
 		//轮播图切换修改背景色
 		swiperChange(e) {
 			const index = e.detail.current;
 			this.swiperCurrent = index;
 		},
+		navToDetailPage(item){
+			if (!this.hasLogin) {
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						if (e.confirm) {
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+				return;
+			}
+			uni.navigateTo({
+				url: '/pages/product/productDuhuan?id=' + item.id
+			});
+		},
 		navToDetailPages(e) {
 			if (!this.hasLogin) {
 				uni.showModal({
@@ -153,7 +207,7 @@ export default {
 				url: '/pages/product/product?id=' + e.id
 			});
 		},
-		nav(url){
+		nav(url) {
 			if (!this.hasLogin) {
 				uni.showModal({
 					title: '登录',
@@ -171,10 +225,10 @@ export default {
 			}
 			uni.navigateTo({
 				url,
-				fail (error) {
-				    uni.switchTab({
-				       url
-				    });
+				fail(error) {
+					uni.switchTab({
+						url
+					});
 				}
 			});
 		}
@@ -193,7 +247,7 @@ export default {
 }
 .top {
 	width: 100%;
-	height: 368rpx ;
+	height: 368rpx;
 	position: relative;
 	.top-bg {
 		position: absolute;
@@ -298,7 +352,7 @@ export default {
 				left: 0;
 				width: 344rpx;
 				height: 96rpx;
-				.fanli-bg{
+				.fanli-bg {
 					position: absolute;
 					bottom: 0;
 					left: 0;
@@ -308,7 +362,7 @@ export default {
 				.fanli-font {
 					position: relative;
 					z-index: 10;
-					color: #FFFFFF;
+					color: #ffffff;
 					height: 96rpx;
 					align-items: flex-end;
 					padding: 36rpx 10rpx 10rpx;
@@ -317,13 +371,13 @@ export default {
 						font-size: 20rpx;
 						font-family: PingFang SC;
 						font-weight: 500;
-						color: #FFFFFF;
+						color: #ffffff;
 					}
 					.font-right {
 						font-size: 62rpx;
 						font-family: Microsoft YaHei;
 						font-weight: bold;
-						color: #FFFFFF;
+						color: #ffffff;
 						text {
 							font-size: 26rpx;
 						}
@@ -366,4 +420,132 @@ export default {
 		}
 	}
 }
+.recommend-box {
+	background: linear-gradient(180deg, #ffffff, #f8f8f8);
+	width: 100%;
+	padding: 0 32rpx;
+}
+.f-header {
+	display: flex;
+	align-items: center;
+	height: 92rpx;
+	padding: 6rpx 30rpx 8rpx;
+	border-radius: 12rpx 12rpx 0 0;
+	color: #ffffff;
+	background: #2E58FF;
+	.tit-box {
+		@extend %font-title-box;
+		font-size: 20rpx;
+		color: #ffffff;
+		margin-left: 20rpx;
+	}
+	.iconenter {
+		font-size: $font-lg + 2rpx;
+		color: #ffffff;
+	}
+
+	.f-left-icon {
+		font-size: 34rpx;
+		border-right: 1rpx solid #ffffff;
+		padding-right: 18rpx;
+	}
+
+	.iconfont {
+		font-size: 26rpx;
+	}
+}
+
+.guess-section {
+	width: 100%;
+	display: flex;
+	flex-direction: column;
+	background-color: #ffffff;
+	border-radius: 0 0 12rpx 12rpx;
+	.guess-item {
+		display: flex;
+		width: 100%;
+		padding: 24rpx;
+		border-bottom: 1rpx solid #f0f0f0;
+		&:nth-last-child(1) {
+			border-bottom: none;
+		}
+	}
+
+	.image-wrapper {
+		width: 168rpx;
+		height: 168rpx;
+		border-radius: 3px;
+		image {
+			width: 168rpx;
+			height: 168rpx;
+			opacity: 1;
+		}
+	}
+	.info-wrapper {
+		width: 100%;
+		display: flex;
+		flex-direction: column;
+		margin-left: 20rpx;
+	}
+	.title {
+		font-size: 32rpx;
+		color: $font-color-dark;
+		word-break: break-all;
+		display: -webkit-box;
+		-webkit-line-clamp: 1;
+		-webkit-box-orient: vertical;
+		overflow: hidden;
+	}
+	.price-box {
+		margin-top: 10rpx;
+		display: flex;
+		justify-content: space-between;
+		.price-left {
+			display: flex;
+			flex-direction: column;
+			.price {
+				margin-top: 60rpx;
+				line-height: 30rpx;
+				color: #ff0000;
+				font-size: 40rpx;
+				font-weight: 700;
+				.price-tip {
+					font-size: 28rpx;
+				}
+			}
+			.ot_price {
+				margin-top: 8rpx;
+				line-height: 24rpx;
+				font-size: 28rpx;
+				margin-left: 4rpx;
+				text-decoration: line-through;
+				color: #aaaaaa;
+				.price-tip {
+					font-size: 22rpx;
+				}
+			}
+		}
+		.price-right {
+			display: flex;
+			flex-direction: column;
+			.people {
+				margin-top: 32rpx;
+				font-weight: 700;
+				color: #999999;
+				font-size: 22rpx;
+				text-align: right;
+				margin-right: 4rpx;
+			}
+			.buyNow {
+				margin-top: 68rpx;
+				background: linear-gradient(180deg, #fd4646, #ff3535);
+				border-radius: 26rpx;
+				padding: 6rpx 18rpx;
+				font-size: 26rpx;
+				font-weight: 400;
+				color: #ffffff;
+			}
+		}
+	}
+}
 </style>

+ 4 - 3
pages/money/pay.vue

@@ -23,8 +23,8 @@
 			<view class="type-item" @click="changePayType(3)">
 				<text class="icon iconfont iconyue"></text>
 				<view class="con">
-					<text class="tit">余额支付</text>
-					<text>可用余额 ¥{{ now_money }}</text>
+					<text class="tit">货款支付</text>
+					<text>可用货款 ¥{{ userInfo.now_money*1 }}</text>
 				</view>
 				<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 3"></radio></label>
 			</view>
@@ -62,8 +62,9 @@ export default {
 	},
 	computed: {
 		// #ifdef H5
-		...mapState(['weichatObj'])
+		...mapState(['weichatObj']),
 		// #endif
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
 	},
 	onLoad(options) {
 		if (options.type == 1) {

+ 27 - 21
pages/order/createOrder.vue

@@ -24,23 +24,19 @@
 		
 
 		<view class="goods-section" v-for="(ls, ind) in shopList" :key="ind">
-			<!-- <view class="g-header b-b">
-				<image class="logo" :src="ls.productInfo.image"></image>
-				<text class="name">{{ ls.name }}</text>
-			</view> -->
-			<!-- 商品列表 -->
+			
 			<view class="g-item">
 				<image :src="ls.productInfo.image"></image>
 				<view class="right">
 					<text class="title clamp">{{ ls.productInfo.store_name }}</text>
 					<text class="spec">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.suk : '默认' }}</text>
-					<view class="price-box">
-						<text class="price">¥{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
+					<view class="price-box" v-if="goodsType != 0">
+						<text class="price">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.money * 1 + ls.productInfo.attrInfo.money_type  : ls.productInfo.money * 1 + ls.productInfo.money_type }}</text>
+						<text class="number">{{ 'x ' + ls.cart_num + (ls.productInfo.unit_name || '') }}</text>
+					</view>
+					<view class="price-box" v-else>
+						<text class="price">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price * 1 : ls.productInfo.price * 1 }}</text>
 						<text class="number">{{ 'x ' + ls.cart_num + (ls.productInfo.unit_name || '') }}</text>
-						<!-- <view><text class="price">¥{{lss.price}}</text></view> -->
-						<!-- <view class="number">
-							<uni-number-box class="step" :value="lss.number" :index="indx" @eventChange="numberChange"></uni-number-box>
-						</view> -->
 					</view>
 				</view>
 			</view>
@@ -63,11 +59,7 @@
 			</view>
 		</view>
 		<!-- 金额明细 -->
-		<view class="yt-list">
-			<!-- <view class="yt-list-cell b-b">
-				<text class="cell-tit clamp">优惠金额</text>
-				<text class="cell-tip red">-¥35</text>
-			</view> -->
+		<view class="yt-list" v-if="goodsType == 0">
 			<view class="yt-list-cell b-b">
 				<text class="cell-tit clamp">积分抵扣{{ '(当前积分:' + integralAll + ')' }}</text>
 				<view class="cell-tip"><radio @click="checkedPoints = !checkedPoints" color=" #5dbc7c" :checked="checkedPoints" /></view>
@@ -81,7 +73,7 @@
 				<input class="desc" type="text" v-model="desc" placeholder="请填写备注信息" placeholder-class="placeholder" />
 			</view>
 		</view>
-		<view class="yt-list">
+		<view class="yt-list" v-if="goodsType == 0">
 			<view class="yt-list-cell b-b">
 				<text class="cell-tit clamp">商品金额</text>
 				<text class="cell-tip">¥{{ payAllMoney }}</text>
@@ -100,7 +92,7 @@
 		<view class="footer">
 			<view class="price-content">
 				<text>实付款</text>
-				<text class="price-tip">¥</text>
+				<text class="price-tip" v-if="goodsType == 0">¥</text>
 				<text class="price">{{ payPrice }}</text>
 			</view>
 			<text class="submit" :class="{ submitNo: !payType }" @click="payType ? submit() : ''">提交订单</text>
@@ -177,10 +169,14 @@ export default {
 			integralMoney: 0, //积分抵扣金额
 			integralShow: false, //是否显示积分抵扣金额
 			payType: true, //是否可支付
-			pinkid: '' //保存拼团商品id
+			pinkid: '', //保存拼团商品id
+			goodsType:'',
 		};
 	},
 	onLoad(option) {
+		if (option.goodsType){
+			this.goodsType = option.goodsType
+		}
 		// 判断是否为拼团商品
 		if (option.type == 'pink') {
 			this.pinkid = option.pinkId;
@@ -248,11 +244,21 @@ export default {
 				addressId: this.addressData.id //地址编号
 			})
 				.then(({ data }) => {
+					const obj = this
 					console.log(data,'111');
 					this.payType = true;
 					this.integralShow = true;
 					// 获取支付金额
-					this.payPrice = +data.result.pay_price;
+					if(this.goodsType == 0){
+						this.payPrice = +data.result.pay_price;
+					}else {
+						const arr = Object.keys(data.result.exchangeMoney);
+						arr.forEach(e => {
+							if(e == obj.goodsType){
+								obj.payPrice = data.result.exchangeMoney[e] * 1 + e
+							}
+						});
+					}
 					this.integralMoney = data.result.deduction_price;
 				})
 				.catch(e => {
@@ -302,7 +308,7 @@ export default {
 				// 计算金额
 				this.payMoneyNub();
 				// 加载优惠券
-				obj.couponsOrder(data.priceGroup.totalPrice);
+				// obj.couponsOrder(data.priceGroup.totalPrice);
 			});
 		},
 		// 购买数量变化

+ 2 - 2
pages/product/pingDetails.vue

@@ -20,8 +20,8 @@
 			<view class="name clamp">{{ list.data.name }}</view>
 			<view class="info">
 				<view class="info-item">门票:{{ list.data.ticket * 1 }}{{ list.data.ticket_money_type }}</view>
-				<view class="info-item">销量:56件</view>
-				<view class="info-item">浙江省台州市</view>
+				<!-- <view class="info-item">销量:56件</view> -->
+				<!-- <view class="info-item">浙江省台州市</view> -->
 			</view>
 		</view>
 		<view class="tip-box">

+ 15 - 0
pages/product/product.vue

@@ -358,6 +358,21 @@ export default {
 				obj.actionImage = goods.image_base; //保存默认选中商品价格
 				obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
 				obj.shopId = data.mer_id; //保存商店id
+				// 保存默认选中的对象
+				obj.specSelected = []; //初始化默认选择对象
+				for (let i = 0; i < obj.specList.length; i++) {
+					// 设置默认数据
+					let attrValue = obj.specList[i].attr_value[0];
+					attrValue.check = true;
+					obj.specSelected.push(attrValue.attr);
+				
+				}
+				
+				//保存默认选中的对象字符串名称
+				let str = obj.specSelected.join(',');
+				// 设置默认值
+				obj.actionImage = obj.productValue[str].image;
+				obj.uniqueId = obj.productValue[str].unique;
 				// #ifdef H5
 				// obj.shareDate();
 				// #endif

+ 988 - 0
pages/product/productDuhuan.vue

@@ -0,0 +1,988 @@
+<template>
+	<view class="container">
+		<view class="carousel">
+			<swiper indicator-dots :circular="true" duration="400">
+				<swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
+					<view class="image-wrapper"><image :src="item" class="loaded" mode="aspectFill"></image></view>
+				</swiper-item>
+			</swiper>
+		</view>
+
+		<view class="introduce-section">
+			<text class="title">{{ goodsObjact.title }}</text>
+			<view class="price-box" v-if="goodsType == 0">
+				<text class="price">{{ goodsObjact.money * 1 }}</text>
+				<text class="price-tip">{{ goodsObjact.money_type }}</text>
+			</view>
+		</view>
+		<view class="c-list">
+			<view class="c-row b-b" @click="toggleSpec">
+				<text class="tit">购买数量</text>
+				<view class="con">
+					<text class="selected-text">{{ goodsNumber }}</text>
+				</view>
+				<text class="iconfont iconenter"></text>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">限购数量</text>
+				<view class="con">
+					<text class="selected-text">{{ goodsObjact.num + goodsObjact.unit_name }}</text>
+				</view>
+			</view>
+		</view>
+		<view class="detail-desc">
+			<view class="d-header"><text>图文详情</text></view>
+			<rich-text class="detail-centent" :nodes="goodsObjact.description"></rich-text>
+			<view :class="{ contentBottomHeight: goodsType == 1 || goodsType == 2, goodsBottom: goodsType == 0 }"></view>
+		</view>
+		<!-- 底部操作菜单 -->
+		<view class="page-bottom" v-if="goodsType == 0">
+			<view class="action-btn-group"><button type="primary" class=" action-btn no-border  add-cart-btn" @click="toggleSpec(1)">立即兑换</button></view>
+		</view>
+		<!-- 规格-模态层弹窗 -->
+		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
+			<!-- 遮罩层 -->
+			<view class="mask"></view>
+			<view class="layer attr-content" @click.stop="stopPrevent">
+				<view class="a-t">
+					<image :src="actionImage"></image>
+					<view class="right">
+						<view class="good-name clamp">{{ goodsObjact.store_name }}</view>
+						<text class="price">{{ actionPrice * 1 + actionType }}</text>
+					</view>
+				</view>
+				<view v-for="(item, index) in specList" :key="index" class="attr-list">
+					<text>{{ item.attr_name }}</text>
+					<view class="item-list">
+						<text
+							v-for="(childItem, childIndex) in item.attr_value"
+							:key="childIndex"
+							class="tit"
+							:class="{ selected: childItem.check }"
+							@click="selectSpec(childItem, item, index)"
+						>
+							{{ childItem.attr }}
+						</text>
+					</view>
+				</view>
+				<view class="attr-list">
+					<text>购买数量</text>
+					<view class="item-list">
+						<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
+					</view>
+				</view>
+				<button class="btn" @click.stop="buy">完成</button>
+			</view>
+		</view>
+		<view :class="{ seckillBottom: goodsType == 1, goodsBottom: goodsType == 0 }"></view>
+		<!-- 分享 -->
+		<!-- <share ref="share" :contentHeight="580" :shareList="shareList"></share> -->
+	</view>
+</template>
+
+<script>
+// import share from '@/components/share';
+import uniNumberBox from '@/components/uni-number-box.vue';
+import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
+import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods, duihuanDetail } from '@/api/product.js';
+// #ifdef H5
+import { weixindata } from '@/utils/wxAuthorized';
+import { mapState } from 'vuex';
+// #endif
+export default {
+	components: {
+		uniNumberBox,
+		uniCountdown
+	},
+	filters: {
+		address(val) {
+			let str = '';
+			if (val) {
+				str = val[0] + ' ' + val[1];
+			}
+			return str;
+		}
+	},
+	data() {
+		return {
+			details: '',
+			reply: '', //评论
+			type: 1, //默认支付方式add为
+			goodsNumber: 1, //购买数量
+			goodsid: '', //商品id
+			specClass: 'none', //显示隐藏弹窗
+			shareList: [], //分享列表
+			goodsObjact: {}, //保存商品数据
+			//图片循环
+			imgList: [],
+			specList: [],
+			// 对比对象
+			productValue: [],
+			actionPrice: 0, //默认选中商品价格
+			actionType: '', //默认选中商品价格单位
+			actionImage: '', //默认选中图片
+			uniqueId: '', //选中的商品分类
+			specSelected: [], //选中的分类
+			specSelectedName: '', //选中分类名称
+			goodsNumberMax: 0, //最大可购买数量
+			shopId: '', //商店id
+			//商店信息
+			shopInfo: {
+				logo: '',
+				title: ''
+			}, //商店信息
+			goodsType: 0, //商品类型1秒杀商品0为普通商品2为拼团商品
+			// 秒杀数据保存
+			seckillObj: {
+				stopTime: 0, //结束时间
+				stop: false, //是否结束
+				stopTimeH: 0, //小时
+				stopTimeM: 0, //分钟
+				stopTimeS: 0 //秒钟
+			},
+			// 拼团数据保存
+			pink: {
+				id: '', //拼团编号
+				uid: '', //用户编号
+				people: '', //拼团人数
+				price: '', //拼团价格
+				stop_time: '', //拼团结束时间
+				nickname: '', //团长昵称
+				avatar: '', //团长头像
+				count: '', //拼团剩余人数
+				h: '', //时
+				i: '', //分
+				s: '' //秒
+			}
+		};
+	},
+	async onLoad(options) {
+		let obj = this;
+		//保存商品id
+		this.goodsid = options.id;
+		// 判断有无人邀请
+		if (options.spread) {
+			// 存储邀请人
+			uni.setStorageSync('spread', options.spread);
+		}
+		// 判断是否为秒杀商品
+		if (options.type == 1) {
+			// 保存商品类型
+			this.goodsType = 1;
+			// 保存结束时间
+			this.seckillObj.stopTime = options.stoptime;
+			// 获取当前时间毫秒数
+			let stoptime = options.stoptime * 1000;
+			// 获取当前时间
+			let acitonTime = new Date();
+			// 判断当前时间是否大于结束时间
+			if (acitonTime.getTime() > stoptime) {
+				// 当前秒杀时间已经结束
+				this.seckillObj.stop = true;
+			} else {
+				// 计算倒计时
+				this.timeComputed(stoptime, this.seckillObj);
+			}
+			this.seckillGoods();
+			return;
+		}
+		if (options.type == 2) {
+			// 保存当前拼团商品类型
+			this.goodsType = 2;
+			// 家在数据
+			this.groupGoods();
+			return;
+		}
+		if (this.goodsType == 0) {
+			// 加载普通商品详情
+			this.goodsDetail();
+		}
+	},
+	computed: {
+		// #ifdef H5
+		...mapState(['weichatObj', 'baseURL', 'urlFile']),
+		...mapState('user', ['userInfo'])
+		// #endif
+	},
+	methods: {
+		navTo(url) {
+			uni.navigateTo({
+				url
+			});
+		},
+		// 转换字符串为数字
+		moneyNum: function(value) {
+			return +value;
+		},
+		navToProductGoods() {
+			uni.redirectTo({
+				url: '/pages/product/product?id=' + this.goodsObjact.product_id
+			});
+		},
+		// 获取商品信息
+		goodsDetail() {
+			let obj = this;
+			duihuanDetail({}, this.goodsid).then(function({ data }) {
+				console.log(data, '详情');
+				obj.details = data;
+				let goods = data.storeInfo;
+				obj.goodsObjact = goods;
+				obj.reply = data.reply; //保存评论列表
+				obj.imgList = goods.slider_image; //保存轮播图
+				obj.specList = data.productAttr; //保存分类列表
+				obj.productValue = data.productValue; //保存分类查询数据
+				obj.actionPrice = goods.money; //保存默认选中商品价格
+				obj.actionType = goods.money_type; //保存默认选中商品价格
+				obj.actionImage = goods.image_base; //保存默认选中商品价格
+				obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
+				obj.shopId = data.mer_id; //保存商店id
+				// 保存默认选中的对象
+				obj.specSelected = []; //初始化默认选择对象
+				for (let i = 0; i < obj.specList.length; i++) {
+					// 设置默认数据
+					let attrValue = obj.specList[i].attr_value[0];
+					attrValue.check = true;
+					obj.specSelected.push(attrValue.attr);
+				
+				}
+				
+				//保存默认选中的对象字符串名称
+				let str = obj.specSelected.join(',');
+				// 设置默认值
+				obj.actionImage = obj.productValue[str].image;
+				obj.uniqueId = obj.productValue[str].unique;
+				// #ifdef H5
+				// obj.shareDate();
+				// #endif
+			});
+		},
+		// #ifdef H5
+		// 加载微信html5页面分享方法
+		// shareDate() {
+		// 	let obj = this;
+		// 	// 保存分享人id链接
+		// 	let url = window.location.href + '&spread=' + this.userInfo.uid;
+		// 	// 判断是否微信浏览器
+		// 	let bool = uni.getStorageSync('weichatBrowser') || '';
+		// 	if (bool) {
+		// 		// 过滤微信强制添加的链接地址
+		// 		url = url.replace(/[\?,&]from=singlemessage/g, '');
+		// 		let data = {
+		// 			link: url, // 分享链接
+		// 			imgUrl: obj.goodsObjact.image, // 分享图标
+		// 			desc: obj.goodsObjact.store_info,
+		// 			title: obj.goodsObjact.store_name,
+		// 			success: function(e) {
+		// 				console.log(e);
+		// 			}
+		// 		};
+		// 		weixindata(data);
+		// 	}
+		// },
+		// #endif
+		// 购买数量变化
+		numberChange(e) {
+			this.goodsNumber = e.number;
+		},
+		//规格弹窗开关
+		toggleSpec(str) {
+			if (this.specClass === 'show') {
+				this.specClass = 'hide';
+				setTimeout(() => {
+					this.specClass = 'none';
+				}, 250);
+			} else if (this.specClass === 'none') {
+				this.specClass = 'show';
+			}
+		},
+		//选择规格
+		selectSpec(item, arr, ind) {
+			arr.attr_value.forEach(function(e) {
+				e.check = false;
+			});
+			item.check = true;
+			this.specSelected[ind] = item.attr;
+			let str = this.specSelected.join(',');
+			this.specSelectedName = this.specSelected.join(' ');
+			if (this.productValue[str]) {
+				let data = this.productValue[str];
+				this.actionPrice = data.money;
+				this.actionType = data.money_type;
+				this.goodsNumberMax = data.stock;
+				this.actionImage = data.image;
+				this.uniqueId = data.unique;
+			}
+		},
+		//分享
+		share() {
+			this.$refs.share.toggleMask();
+		},
+		//收藏
+		toFavorite(item) {
+			let obj = this;
+			item.userCollect = !item.userCollect;
+			if (!item.userCollect) {
+				collectDel({ id: obj.goodsid, category: 'product' }).then(function(e) {
+					uni.showToast({
+						title: '成功取消收藏',
+						type: 'top',
+						duration: 1500
+					});
+				});
+			} else {
+				collectAdd({ id: obj.goodsid, category: 'product' }).then(function(e) {
+					uni.showToast({
+						title: '成功加入收藏',
+						type: 'top',
+						duration: 1500
+					});
+				});
+			}
+		},
+		// 立即购买
+		buy() {
+			let obj = this;
+			let data = {
+				productId: obj.goodsObjact.product_id, //商品id
+				exchangeId: obj.goodsid, //兑换编号
+				cartNum: obj.goodsNumber, //商品数量
+				uniqueId: obj.uniqueId, //商品标签
+				new: '1', //商品是否新增加到购物车1为不加入0为加入
+				mer_id: obj.shopId
+				// type: 0,//0为余额支付  1为消费券支付 2为积分支付
+			};
+			cartAdd(data)
+				.then(function({ data }) {
+					if (obj.type == 1) {
+						// 跳转到支付页
+						uni.navigateTo({
+							url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.actionType
+						});
+					}
+					if (obj.type == 2) {
+						uni.showToast({
+							title: '成功加入购物车',
+							type: 'top',
+							duration: 2000
+						});
+						obj.toggleSpec();
+					}
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		stopPrevent() {}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: $page-color-base;
+}
+//秒杀底部高度
+.seckillBottom {
+	height: 110rpx;
+}
+// 文章页底部高度撑开
+.contentBottomHeight {
+	height: 110rpx;
+}
+//默认商品底部高度
+.goodsBottom {
+	height: 160rpx;
+}
+.iconenter {
+	font-size: $font-base + 2rpx;
+	color: #888;
+}
+.carousel {
+	/* #ifdef APP-PLUS */
+	padding-top: var(--status-bar-height);
+	/* #endif */
+	height: 722rpx;
+	position: relative;
+	swiper {
+		height: 100%;
+	}
+	.image-wrapper {
+		width: 100%;
+		height: 100%;
+	}
+	.swiper-item {
+		display: flex;
+		justify-content: center;
+		align-content: center;
+		// height: 750rpx;
+		height: 710rpx;
+		overflow: hidden;
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+}
+// 秒杀
+.seckill-box-title {
+	background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%) !important;
+	.price,
+	.price-tip,
+	.timeStop,
+	.m-price {
+		color: #ffffff !important;
+	}
+	.price-tip {
+		font-size: $font-base;
+	}
+	.price {
+		font-size: 45rpx !important;
+		font-weight: bold;
+	}
+	.timeStop {
+	}
+}
+// 底部拼团、秒杀支付按钮
+.goods-pay-box {
+	position: fixed;
+	left: 0;
+	bottom: 0;
+	z-index: 95;
+	width: 750rpx;
+	height: 100rpx;
+	line-height: 1;
+	color: #ffffff;
+	text-align: center;
+	font-size: $font-lg;
+	.bgLine {
+		background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%);
+	}
+	// 拼团支付按钮
+	.goods-pay {
+		display: flex;
+		align-content: center;
+		flex-wrap: wrap;
+		justify-content: center;
+		.goods-buttom,
+		.goods-buttom-money {
+			width: 100%;
+		}
+		.goods-buttom-money {
+			font-size: $font-base;
+		}
+	}
+	.goods-pay-stop,
+	.goods-pay {
+		padding: 15rpx 0;
+		height: 100%;
+		width: 100%;
+	}
+	.goods-pay-stop {
+		background: $color-gray;
+		line-height: 70rpx;
+	}
+}
+/* 标题简介 */
+.introduce-section {
+	background: #fff;
+	padding: 20rpx 30rpx;
+	.title {
+		font-size: 32rpx;
+		color: $font-color-dark;
+		height: 50rpx;
+		line-height: 50rpx;
+	}
+	.price-box {
+		display: flex;
+		align-items: baseline;
+		height: 64rpx;
+		padding: 10rpx 0;
+		font-size: 26rpx;
+		color: $uni-color-primary;
+	}
+	.price {
+		font-size: $font-lg + 2rpx;
+	}
+	.m-price {
+		margin: 0 12rpx;
+		color: $font-color-light;
+		text-decoration: line-through;
+	}
+	.coupon-tip {
+		align-items: center;
+		padding: 4rpx 10rpx;
+		background: $uni-color-primary;
+		font-size: $font-sm;
+		color: #fff;
+		border-radius: 6rpx;
+		line-height: 1;
+		transform: translateY(-4rpx);
+	}
+	.bot-row {
+		display: flex;
+		align-items: center;
+		height: 50rpx;
+		font-size: $font-sm;
+		color: $font-color-light;
+		text {
+			flex: 1;
+		}
+	}
+}
+/* 分享 */
+.share-section {
+	display: flex;
+	align-items: center;
+	color: $font-color-base;
+	background: linear-gradient(left, #fdf5f6, #fbebf6);
+	padding: 12rpx 30rpx;
+	.share-icon {
+		display: flex;
+		align-items: center;
+		width: 70rpx;
+		height: 30rpx;
+		line-height: 1;
+		border: 1px solid $uni-color-primary;
+		border-radius: 4rpx;
+		position: relative;
+		overflow: hidden;
+		font-size: 22rpx;
+		color: $uni-color-primary;
+		&:after {
+			content: '';
+			width: 50rpx;
+			height: 50rpx;
+			border-radius: 50%;
+			left: -20rpx;
+			top: -12rpx;
+			position: absolute;
+			background: $uni-color-primary;
+		}
+	}
+	.iconfavorfill {
+		position: relative;
+		z-index: 1;
+		font-size: 24rpx;
+		margin-left: 2rpx;
+		margin-right: 10rpx;
+		color: #fff;
+		line-height: 1;
+	}
+	.tit {
+		font-size: $font-base;
+		margin-left: 10rpx;
+	}
+	.iconprompt {
+		padding: 10rpx;
+		font-size: 30rpx;
+		line-height: 1;
+	}
+	.share-btn {
+		flex: 1;
+		text-align: right;
+		font-size: $font-sm;
+		color: $uni-color-primary;
+	}
+	.iconenter {
+		font-size: $font-sm;
+		margin-left: 4rpx;
+		color: $uni-color-primary;
+	}
+}
+
+.c-list {
+	margin-top: 20rpx;
+	font-size: $font-sm + 2rpx;
+	color: $font-color-base;
+	background: #fff;
+	.c-row {
+		display: flex;
+		align-items: center;
+		padding: 20rpx 30rpx;
+		position: relative;
+	}
+	.tit {
+		width: 140rpx;
+	}
+	.con {
+		flex: 1;
+		color: $font-color-dark;
+		.selected-text {
+			margin-right: 10rpx;
+		}
+	}
+	.bz-list {
+		height: 40rpx;
+		font-size: $font-sm + 2rpx;
+		color: $font-color-dark;
+		text {
+			display: inline-block;
+			margin-right: 30rpx;
+		}
+	}
+	.con-list {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		color: $font-color-dark;
+		line-height: 40rpx;
+	}
+	.red {
+		color: $uni-color-primary;
+	}
+}
+
+/* 评价 */
+.eva-section {
+	display: flex;
+	flex-direction: column;
+	padding: 20rpx 30rpx;
+	background: #fff;
+	margin-top: 16rpx;
+	.e-header {
+		display: flex;
+		align-items: center;
+		height: 70rpx;
+		font-size: $font-sm + 2rpx;
+		color: $font-color-light;
+		.tit {
+			font-size: $font-base + 2rpx;
+			color: $font-color-dark;
+			margin-right: 4rpx;
+		}
+		.tip {
+			flex: 1;
+			text-align: right;
+		}
+		.iconenter {
+			margin-left: 10rpx;
+		}
+	}
+}
+.eva-box {
+	display: flex;
+	padding: 20rpx 0;
+	.portrait {
+		flex-shrink: 0;
+		width: 80rpx;
+		height: 80rpx;
+		border-radius: 100px;
+	}
+	.right {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		font-size: $font-base;
+		color: $font-color-base;
+		padding-left: 26rpx;
+		.con {
+			font-size: $font-base;
+			color: $font-color-dark;
+			padding: 20rpx 0;
+		}
+		.bot {
+			display: flex;
+			justify-content: space-between;
+			font-size: $font-sm;
+			color: $font-color-light;
+		}
+	}
+}
+
+.eva-boxs {
+	width: 100%;
+	overflow: hidden;
+	padding: 10px 28rpx;
+	background: #f4f4f4;
+	border-radius: 12rpx;
+	font-size: $font-sm + 2rpx;
+	color: #333;
+	.portrait {
+		flex-shrink: 0;
+		width: 80rpx;
+		height: 80rpx;
+		border-radius: 100px;
+	}
+	.right {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		font-size: $font-base;
+		color: $font-color-base;
+		.con {
+			font-size: $font-base;
+			color: $font-color-dark;
+		}
+		.bot {
+			display: flex;
+			justify-content: space-between;
+			font-size: $font-sm;
+			color: $font-color-light;
+		}
+	}
+}
+/*  详情 */
+.detail-desc {
+	background: #fff;
+	margin-top: 16rpx;
+	/deep/ img {
+		max-width: 100% !important;
+		display: inline !important;
+	}
+	/deep/ div {
+		max-width: 100% !important;
+	}
+	.d-header {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 80rpx;
+		font-size: $font-base + 2rpx;
+		color: $font-color-dark;
+		position: relative;
+
+		text {
+			padding: 0 20rpx;
+			background: #fff;
+			position: relative;
+			z-index: 1;
+		}
+		&:after {
+			position: absolute;
+			left: 50%;
+			top: 50%;
+			transform: translateX(-50%);
+			width: 300rpx;
+			height: 0;
+			content: '';
+			border-bottom: 1px solid #ccc;
+		}
+	}
+}
+
+/* 规格选择弹窗 */
+.attr-content {
+	padding: 10rpx 30rpx;
+	.a-t {
+		display: flex;
+		image {
+			width: 120rpx;
+			height: 120rpx;
+			flex-shrink: 0;
+			border-radius: 8rpx;
+		}
+		.right {
+			display: flex;
+			flex-direction: column;
+			padding-left: 24rpx;
+			font-size: $font-sm + 2rpx;
+			color: $font-color-base;
+			line-height: 42rpx;
+			.good-name {
+				padding-top: 20rpx;
+				max-width: 320rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #1d2023;
+				line-height: 42rpx;
+				margin-bottom: 15rpx;
+			}
+			.price {
+				font-size: 60rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #ff6f0f;
+				// font-size: $font-lg;
+				// color: $uni-color-primary;
+				// margin-bottom: 10rpx;
+			}
+			.selected-text {
+				margin-right: 10rpx;
+			}
+		}
+	}
+	.attr-list {
+		display: flex;
+		flex-direction: column;
+		font-size: $font-base + 2rpx;
+		color: $font-color-base;
+		padding-top: 30rpx;
+		padding-left: 10rpx;
+	}
+	.item-list {
+		padding: 20rpx 0 0;
+		display: flex;
+		flex-wrap: wrap;
+		text {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			background: #eee;
+			margin-right: 20rpx;
+			margin-bottom: 20rpx;
+			border-radius: 100rpx;
+			min-width: 60rpx;
+			height: 60rpx;
+			padding: 0 20rpx;
+			font-size: $font-base;
+			color: $font-color-dark;
+		}
+		.selected {
+			background: #fbebee;
+			color: $uni-color-primary;
+		}
+	}
+}
+
+/*  弹出层 */
+.popup {
+	position: fixed;
+	left: 0;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	z-index: 99;
+
+	&.show {
+		display: block;
+		.mask {
+			animation: showPopup 0.2s linear both;
+		}
+		.layer {
+			animation: showLayer 0.2s linear both;
+		}
+	}
+	&.hide {
+		.mask {
+			animation: hidePopup 0.2s linear both;
+		}
+		.layer {
+			animation: hideLayer 0.2s linear both;
+		}
+	}
+	&.none {
+		display: none;
+	}
+	.mask {
+		position: fixed;
+		top: 0;
+		width: 100%;
+		height: 100%;
+		z-index: 1;
+		background-color: rgba(0, 0, 0, 0.4);
+	}
+	.layer {
+		position: fixed;
+		z-index: 99;
+		bottom: 0;
+		width: 100%;
+		min-height: 30vh;
+		border-radius: 10rpx 10rpx 0 0;
+		background-color: #fff;
+		.btn {
+			height: 66rpx;
+			line-height: 66rpx;
+			border-radius: 100rpx;
+			// background: $uni-color-primary;
+			background: $base-color;
+			font-size: $font-base + 2rpx;
+			color: #fff;
+			margin: 30rpx auto 20rpx;
+		}
+	}
+	@keyframes showPopup {
+		0% {
+			opacity: 0;
+		}
+		100% {
+			opacity: 1;
+		}
+	}
+	@keyframes hidePopup {
+		0% {
+			opacity: 1;
+		}
+		100% {
+			opacity: 0;
+		}
+	}
+	@keyframes showLayer {
+		0% {
+			transform: translateY(120%);
+		}
+		100% {
+			transform: translateY(0%);
+		}
+	}
+	@keyframes hideLayer {
+		0% {
+			transform: translateY(0);
+		}
+		100% {
+			transform: translateY(120%);
+		}
+	}
+}
+
+/* 底部操作菜单 */
+.page-bottom {
+	position: fixed;
+	left: 0rpx;
+	bottom: 0rpx;
+	z-index: 95;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	width: 750rpx;
+	height: 98rpx;
+	background: rgba(255, 255, 255, 0.9);
+	box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
+	.action-btn-group {
+		width: 100%;
+		display: flex;
+		height: 98rpx;
+		overflow: hidden;
+		position: relative;
+		.action-btn {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 100%;
+			height: 100%;
+			font-size: $font-base + 10rpx;
+			padding: 0;
+			border-radius: 0;
+			// background: transparent;
+			background: #ffb238;
+			&.buy-now-btn {
+				background-color: #ffb238;
+			}
+			&.add-cart-btn {
+				background: linear-gradient(0deg, #2e58ff, #32c6ff);
+			}
+		}
+	}
+}
+// 商店头
+.shop-box {
+	background-color: #ffffff;
+	margin-top: 20rpx;
+	margin-bottom: 10rpx;
+	padding: 20rpx;
+	.shop-img {
+		border-radius: 300rpx;
+		height: 80rpx;
+		width: 80rpx;
+		margin-right: 20rpx;
+	}
+	.shop-button {
+		border-radius: 100rpx;
+		padding: 10rpx 20rpx;
+		color: $color-red;
+		border: 1px solid $color-red;
+		font-size: $font-lg;
+		line-height: 1;
+	}
+}
+</style>