lhl 3 éve
szülő
commit
effd2f248e

+ 38 - 4
pages/index/index.vue

@@ -9,7 +9,7 @@
 			<!-- 搜素栏 -->
 			<view class="search flex">
 				<image src="../../static/icon/address.png" class="address"></image>
-				<view class="shop-name clamp" @click.stop="canChange == 1?nav('/pages/shoping/list'):''">{{ storeInfo.name }}</view>
+				<view class="shop-name clamp" @click.stop="canChange == 0?nav('/pages/shoping/list'):''">{{ storeInfo.name }}</view>
 				<view class="input-box flex" @click.stop="clickSearch">
 					<view class=" input-content flex">
 						<view class="iconfont iconsearch"></view>
@@ -137,7 +137,7 @@ import { userinfo } from '@/api/user.js';
 import { mapState, mapMutations } from 'vuex';
 import { getProducts } from '@/api/product.js';
 // #ifdef H5
-import { weixindata } from '@/utils/wxAuthorized';
+import { weixindata,shareLoad } from '@/utils/wxAuthorized';
 // #endif
 export default {
 	components: {
@@ -168,7 +168,7 @@ export default {
 		};
 	},
 	computed: {
-		...mapState(['loginInterceptor', 'storeInfo','canChange']),
+		...mapState(['loginInterceptor', 'storeInfo','canChange','baseURL']),
 		...mapState('user', ['hasLogin', 'userInfo'])
 	},
 	onLoad(option) {
@@ -217,11 +217,21 @@ export default {
 		if (this.loginInterceptor && !this.hasLogin) {
 			// 登录拦截
 			userinfo()
-				.then(e => {})
+				.then(e => {
+					// #ifdef H5
+					this.IndexShare()
+					// #endif
+				})
 				.catch(e => {
 					console.log(e);
 				});
 		}
+		if(this.hasLogin) {
+			// #ifdef H5
+			this.IndexShare()
+			// #endif
+			
+		}
 		this.loadData();
 	},
 	// #ifndef MP
@@ -252,6 +262,30 @@ export default {
 	// #endif
 	methods: {
 		...mapMutations(['setLat', 'setLon', 'setStoreInfo','setCanChange']),
+		// #ifdef H5
+		IndexShare() {
+			let obj = this;
+			let pages = getCurrentPages();
+			// 获取当前页面
+			let page = pages[pages.length - 1];
+			let path = '/#/pages/index/index' + '?';
+			// 保存传值
+			for (let i in page.options) {
+				path += i + '=' + page.options[i] + '&';
+			}
+			console.log(obj.Path)
+			// 保存邀请人
+			path += 'spread=' + this.userInfo.uid;
+			let data = {
+				link: this.baseURL + path,
+				title: this.userInfo.nickname + '邀请您进入满园春',
+				desc:'欢迎加入满园春',
+				imgUrl: this.baseURL + '/static/img/logo.png'
+			};
+			console.log(data,'分享数据');
+			shareLoad(data);
+		},
+		// #endif
 		//获取定位信息
 		getaddress() {
 			console.log('dizhi+++++++++++');

+ 3 - 2
pages/myteam/myteam.vue

@@ -93,7 +93,7 @@ export default {
 					limit: 10 //每次信息条数
 				}
 			],
-			all: '0'
+			all: 0
 		};
 	},
 	onLoad(options) {},
@@ -151,7 +151,8 @@ export default {
 						navItem.orderList = navItem.orderList.concat(data.list);
 						console.log(navItem.orderList);
 						navItem.page++;
-					}
+					}
+					obj.all = data.total*1 + data.totalLevel*1
 					if (navItem.limit == data.list.length) {
 						//判断是否还有数据, 有改为 more, 没有改为noMore
 						navItem.loadingType = 'more';

+ 6 - 0
pages/order/createOrder.vue

@@ -442,6 +442,12 @@ export default {
 				}
 				obj.addressData.real_name = obj.pickUpInfo.real_name;
 				obj.addressData.phone = obj.pickUpInfo.phone;
+			}
+			if(obj.tabCurrentIndex === 0) {
+				if(!obj.addressData.real_name) {
+					obj.$api.msg('请选择收货地址');
+					return false;
+				}
 			}
 			let url = '/pages/money/pay?key=' + obj.orderKey + '&goodsType=' + obj.goodsType;
 			if(obj.is_consumer == 1) {

+ 1293 - 1119
pages/prefecture/detail.vue

@@ -1,1132 +1,1306 @@
-<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">
+<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">
 			<view class="price-box" v-if="goodsType == 0">
-				<image src="../../static/icon/xfq.png" mode=""></image>
+				<image src="../../static/icon/xfq.png" mode=""></image>
 				<text class="price">{{ goodsObjact.price }}</text><text class="jftit"> 消费券</text>
-				<text class="old-price">¥{{goodsObjact.ot_price}}</text>
-			</view>
-			<text class="title" v-if="goodsType == 0">{{ goodsObjact.store_name }}</text>
+				<text class="old-price">¥{{goodsObjact.ot_price}}</text>
+			</view>
+			<text class="title" v-if="goodsType == 0">{{ goodsObjact.store_name }}</text>
 			<view class="bot-row">
-				<text>快递: {{ goodsObjact.postage }}</text>
-				<text style="text-align: center;">销量: {{ goodsObjact.sales }}</text>
-				<text style="text-align: right;">{{ storeObjact.address | address}}</text>
-			</view>
-		</view>
-		<!-- 评价 -->
-		<view class="eva-section" v-if="reply" @click="navTo('/pages/product/reply?id=' + goodsid)">
-			<view class="e-header">
-				<text class="tit">评价</text>
-				<text>({{ details.replyCount }})</text>
-				<text class="tip">好评率 {{ details.replyChance }}%</text>
-				<text class="iconfont iconenter"></text>
-			</view>
-			<view class="eva-box">
-				<image class="portrait" :src="reply.avatar" mode="aspectFill"></image>
-				<view class="right">
-					<text class="name">{{ reply.nickname }}</text>
-					<text class="con">{{ reply.comment }}</text>
-					<view class="con_box">
-						<view class="con_image" v-for="item in reply.pics"><image :src="item"></image></view>
-					</view>
-					<view class="bot">
-						<text class="attr"></text>
-						<text class="time">{{ reply.add_time }}</text>
-					</view>
-				</view>
-			</view>
-			<view class="eva-boxs" v-if="reply.merchant_reply_content">
-				<view class="right">
-					<text class="con">
-						<text style="color: #FD5B23;margin-right: 8rpx;">商家回复 :</text>
-						{{ reply.merchant_reply_content }}
-					</text>
-					<view class="bot">
-						<text class="attr"></text>
-						<text class="time">{{ reply.merchant_reply_time }}</text>
-					</view>
-				</view>
-			</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" v-if="goodsType == 1">
-				<text class="tit">限购数量</text>
-				<view class="con">
-					<text class="selected-text">{{ goodsObjact.num + goodsObjact.unit_name }}</text>
-				</view>
-			</view>
-		</view>
-		<view class="shop-box flex" v-if="goodsType == 0 && shopId > 0">
-			<view class="flex">
-				<image :src="shopInfo.logo" mode=" aspectFit" class="shop-img"></image>
-				<text class="font-size-lg">{{ shopInfo.title }}</text>
-			</view>
-			<navigator :url="'/pages/shoping/index?merid=' + shopId"><view class="shop-button">进店逛逛</view></navigator>
-		</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>
+				<text>快递: {{ goodsObjact.postage }}</text>
+				<text style="text-align: center;">销量: {{ goodsObjact.sales }}</text>
+				<text style="text-align: right;">{{ storeObjact.address | address}}</text>
+			</view>
+		</view>
+		<!-- 评价 -->
+		<view class="eva-section" v-if="reply" @click="navTo('/pages/product/reply?id=' + goodsid)">
+			<view class="e-header">
+				<text class="tit">评价</text>
+				<text>({{ details.replyCount }})</text>
+				<text class="tip">好评率 {{ details.replyChance }}%</text>
+				<text class="iconfont iconenter"></text>
+			</view>
+			<view class="eva-box">
+				<image class="portrait" :src="reply.avatar" mode="aspectFill"></image>
+				<view class="right">
+					<text class="name">{{ reply.nickname }}</text>
+					<text class="con">{{ reply.comment }}</text>
+					<view class="con_box">
+						<view class="con_image" v-for="item in reply.pics">
+							<image :src="item"></image>
+						</view>
+					</view>
+					<view class="bot">
+						<text class="attr"></text>
+						<text class="time">{{ reply.add_time }}</text>
+					</view>
+				</view>
+			</view>
+			<view class="eva-boxs" v-if="reply.merchant_reply_content">
+				<view class="right">
+					<text class="con">
+						<text style="color: #FD5B23;margin-right: 8rpx;">商家回复 :</text>
+						{{ reply.merchant_reply_content }}
+					</text>
+					<view class="bot">
+						<text class="attr"></text>
+						<text class="time">{{ reply.merchant_reply_time }}</text>
+					</view>
+				</view>
+			</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" v-if="goodsType == 1">
+				<text class="tit">限购数量</text>
+				<view class="con">
+					<text class="selected-text">{{ goodsObjact.num + goodsObjact.unit_name }}</text>
+				</view>
+			</view>
+		</view>
+		<view class="shop-box flex" v-if="goodsType == 0 && shopId > 0">
+			<view class="flex">
+				<image :src="shopInfo.logo" mode=" aspectFit" class="shop-img"></image>
+				<text class="font-size-lg">{{ shopInfo.title }}</text>
+			</view>
+			<navigator :url="'/pages/shoping/index?merid=' + shopId">
+				<view class="shop-button">进店逛逛</view>
+			</navigator>
+		</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"><image src="../../static/icon/xfq.png"></image>{{ actionPrice }}</text>
-						<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
-						<!-- <view class="selected" v-if="goodsType == 0">
-							已选:
-							<text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
-						</view> -->
-					</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 } from '@/api/product.js';
-import { getShoping } from '@/api/shoping.js'; 
-// #ifdef H5
-import { weixindata } from '@/utils/wxAuthorized';
-import { mapState } from 'vuex';
-// #endif
-export default {
-	components: {
-		share,
-		uniNumberBox,
-		uniCountdown
-	},
-	filters: {
-		address(val) {
-			let str = ''
-			if(val) {
-				str = val[0] + ' ' + val[1]
+						<view class="good-name clamp">{{goodsObjact.store_name}}</view>
+						<text class="price">
+							<image src="../../static/icon/xfq.png"></image>{{ actionPrice }}
+						</text>
+						<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
+						<!-- <view class="selected" v-if="goodsType == 0">
+							已选:
+							<text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
+						</view> -->
+					</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
+	} from '@/api/product.js';
+	import {
+		getShoping
+	} from '@/api/shoping.js';
+
+	// import { weixindata } from '@/utils/wxAuthorized';
+	import {
+		mapState
+	} from 'vuex';
+
+
+	// #ifdef H5
+	import {
+		weixindata,
+		weixinlocation,
+		shareLoad
+	} from '@/utils/wxAuthorized';
+	// #endif
+	export default {
+		components: {
+			share,
+			uniNumberBox,
+			uniCountdown
+		},
+		filters: {
+			address(val) {
+				let str = ''
+				if (val) {
+					str = val[0] + ' ' + val[1]
+				}
+				return str
 			}
-			return str
-		}
-	},
-	data() {
-		return {
-			details: '',
-			reply: '', //评论
-			type: 1, //默认支付方式add为
-			goodsNumber: 1, //购买数量
-			goodsid: '', //商品id
-			specClass: 'none', //显示隐藏弹窗
-			shareList: [], //分享列表
-			goodsObjact: {}, //保存商品数据
-			storeObjact: {},//保存店铺数据
-			//图片循环
-			imgList: [],
-			specList: [],
-			// 对比对象
-			productValue: [],
-			actionPrice: 0, //默认选中商品价格
-			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: '' //秒
+		},
+		data() {
+			return {
+				details: '',
+				reply: '', //评论
+				type: 1, //默认支付方式add为
+				goodsNumber: 1, //购买数量
+				goodsid: '', //商品id
+				specClass: 'none', //显示隐藏弹窗
+				shareList: [], //分享列表
+				goodsObjact: {}, //保存商品数据
+				storeObjact: {}, //保存店铺数据
+				//图片循环
+				imgList: [],
+				specList: [],
+				// 对比对象
+				productValue: [],
+				actionPrice: 0, //默认选中商品价格
+				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: '' //秒
+				},
+				detype: '1', // 1为积分商品  2为兑换券商品 
+			};
+		},
+		async onLoad(options) {
+			let obj = this;
+			if (options.detype) {
+				obj.detype = options.detype
+			}
+			//保存商品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: {
+			// 分享
+			// #ifdef H5
+			IndexShare() {
+				let obj = this
+				// console.log('dddddddffffffffffffff')
+				// 设置菜单中的转发按钮触发转发事件时的转发内容
+				let pages = getCurrentPages(); //获取加载的页面
+				let currentPage = pages[pages.length - 1]; //获取当前页面的对象
+				let url = '/#/' + currentPage.route; //当前页面url
+				let item = currentPage.options; //如果要获取url中所带的参数可以查看options
+				let shareObj = {
+					title: obj.goodsObjact.store_name, // 默认是小程序的名称(可以写slogan等)
+					link: obj.baseURL + url + '?id=' + item.id + '&spread=' + obj.userInfo
+					.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
+					desc: obj.goodsObjact.store_name + '   价格:' + obj.goodsObjact.price,
+					imgUrl: obj.goodsObjact.image,
+					success: function(res) {
+						// 转发成功之后的回调
+						if (res.errMsg == 'shareAppMessage:ok') {}
+					},
+					fail: function() {
+						// 转发失败之后的回调
+						if (res.errMsg == 'shareAppMessage:fail cancel') {
+							// 用户取消转发
+						} else if (res.errMsg == 'shareAppMessage:fail') {
+							// 转发失败,其中 detail message 为详细失败信息
+						}
+					}
+				};
+				console.log(shareObj, '8888888888888888888');
+				shareLoad(shareObj);
+			},
+			// #endif
+			navTo(url) {
+				uni.navigateTo({
+					url
+				});
+			},
+			//获取商店信息
+			getShoping() {
+				let obj = this;
+				getShoping({
+						mer_id: this.shopId
+					})
+					.then(function({
+						data
+					}) {
+						console.log(data);
+						obj.shopInfo = data;
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			// 转换字符串为数字
+			moneyNum: function(value) {
+				return +value;
+			},
+			navToProductGoods() {
+				uni.redirectTo({
+					url: '/pages/product/product?id=' + this.goodsObjact.product_id
+				});
+			},
+			// 获取商品信息
+			goodsDetail() {
+				let obj = this;
+				goodsDetail({}, this.goodsid).then(function({
+					data
+				}) {
+					obj.details = data;
+					let goods = data.storeInfo;
+					let store_info = data.system_store // 保存店铺信息
+					console.log(store_info)
+					obj.storeObjact = store_info
+					obj.goodsObjact = goods;
+					obj.reply = data.reply; //保存评论列表
+					obj.imgList = goods.slider_image; //保存轮播图
+					obj.specList = data.productAttr; //保存分类列表
+					obj.productValue = data.productValue; //保存分类查询数据
+					obj.actionPrice = goods.price; //保存默认选中商品价格
+					obj.actionImage = goods.image_base; //保存默认选中商品价格
+					obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
+					obj.shopId = data.mer_id; //保存商店id
+					if (obj.shopId > 0) {
+						obj.getShoping();
+					}
+					// #ifdef H5
+					obj.shareDate();
+					obj.IndexShare()
+					// #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';
+				}
+				// 保存当前购买类型
+				this.type = str;
+			},
+			//选择规格
+			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.price;
+					this.goodsNumberMax = data.stock;
+					this.actionImage = data.image;
+					this.uniqueId = data.unique;
+				}
+			},
+			//分享
+			share() {
+				this.$refs.share.toggleMask();
 			},
-			detype: '1',// 1为积分商品  2为兑换券商品 
-		};
-	},
-	async onLoad(options) {
-		let obj = this;
-		if(options.detype) {
-			obj.detype = options.detype
-		}
-		//保存商品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
-			});
-		},
-		//获取商店信息
-		getShoping() {
-			let obj = this;
-			getShoping({
-				mer_id: this.shopId
-			})
-				.then(function({ data }) {
-					console.log(data);
-					obj.shopInfo = data;
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		},
-		// 转换字符串为数字
-		moneyNum: function(value) {
-			return +value;
-		},
-		navToProductGoods() {
-			uni.redirectTo({
-				url: '/pages/product/product?id=' + this.goodsObjact.product_id
-			});
-		},
-		// 获取商品信息
-		goodsDetail() {
-			let obj = this;
-			goodsDetail({}, this.goodsid).then(function({ data }) {
-				obj.details = data;
-				let goods = data.storeInfo;
-				let store_info = data.system_store// 保存店铺信息
-				console.log(store_info)
-				obj.storeObjact = store_info
-				obj.goodsObjact = goods;
-				obj.reply = data.reply; //保存评论列表
-				obj.imgList = goods.slider_image; //保存轮播图
-				obj.specList = data.productAttr; //保存分类列表
-				obj.productValue = data.productValue; //保存分类查询数据
-				obj.actionPrice = goods.price; //保存默认选中商品价格
-				obj.actionImage = goods.image_base; //保存默认选中商品价格
-				obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
-				obj.shopId = data.mer_id; //保存商店id
-				if (obj.shopId > 0) {
-					obj.getShoping();
-				}
-				// #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';
-			}
-			// 保存当前购买类型
-			this.type = str;
-		},
-		//选择规格
-		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.price;
-				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 = {
-				cartNum: obj.goodsNumber, //商品数量
-				uniqueId: obj.uniqueId, //商品标签
-				new: '1', //商品是否新增加到购物车1为不加入0为加入
-				mer_id: obj.shopId,
-				is_consumer: 1,
-			};
-			if (obj.type == 2) {
-				data.new = 0;
-			}
-			if (obj.goodsType == 0) {
-				data.productId = obj.goodsid; //商品编号
-			}
-			// 判断是否为秒杀商品
-			if (obj.goodsType == 1) {
-				data.secKillId = obj.goodsid; //秒杀商品编号
-				data.productId = obj.goodsObjact.product_id; //商品编号
-				// 判断是否秒杀已经结束
-				if (obj.seckillObj.stop) {
-					uni.showModal({
-						title: '提示',
-						content: '当前活动已经结束',
-						showCancel: false
-					});
-					return;
-				}
-			}
-			// 判断是否为拼团商品
-			if (obj.goodsType == 2) {
-				data.combinationId = obj.goodsid; //拼团编号
-				data.productId = obj.goodsObjact.product_id; //商品编号
-			}
-			cartAdd(data)
-				.then(function({ data }) {
-					if (obj.type == 1) {
-						// 跳转到支付页
-						uni.navigateTo({
-							url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType + '&consumer=1'
-						});
-					}
-					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;
-		image {
-			width: 32rpx;
-			height: 32rpx;
-			margin-right: 8rpx;
+			//收藏
+			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 = {
+					cartNum: obj.goodsNumber, //商品数量
+					uniqueId: obj.uniqueId, //商品标签
+					new: '1', //商品是否新增加到购物车1为不加入0为加入
+					mer_id: obj.shopId,
+					is_consumer: 1,
+				};
+				if (obj.type == 2) {
+					data.new = 0;
+				}
+				if (obj.goodsType == 0) {
+					data.productId = obj.goodsid; //商品编号
+				}
+				// 判断是否为秒杀商品
+				if (obj.goodsType == 1) {
+					data.secKillId = obj.goodsid; //秒杀商品编号
+					data.productId = obj.goodsObjact.product_id; //商品编号
+					// 判断是否秒杀已经结束
+					if (obj.seckillObj.stop) {
+						uni.showModal({
+							title: '提示',
+							content: '当前活动已经结束',
+							showCancel: false
+						});
+						return;
+					}
+				}
+				// 判断是否为拼团商品
+				if (obj.goodsType == 2) {
+					data.combinationId = obj.goodsid; //拼团编号
+					data.productId = obj.goodsObjact.product_id; //商品编号
+				}
+				cartAdd(data)
+					.then(function({
+						data
+					}) {
+						if (obj.type == 1) {
+							// 跳转到支付页
+							uni.navigateTo({
+								url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj
+									.goodsType + '&consumer=1'
+							});
+						}
+						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%;
 		}
-		.jftit {
-			padding-left: 4rpx;
-			font-size: 23rpx;
+
+		.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;
+
+			image {
+				width: 32rpx;
+				height: 32rpx;
+				margin-right: 8rpx;
+			}
+
+			.jftit {
+				padding-left: 4rpx;
+				font-size: 23rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #FF6F0F;
+			}
+
+			.old-price {
+				padding-left: 8rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				text-decoration: line-through;
+				color: #999999;
+			}
+		}
+
+		.price {
+			font-size: 45rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
 			color: #FF6F0F;
-		}	
-		.old-price {
-			padding-left: 8rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
+			// font-size: $font-lg + 2rpx;
+		}
+
+		.m-price {
+			margin: 0 12rpx;
+			color: $font-color-light;
 			text-decoration: line-through;
-			color: #999999;
-		}
-	}
-	.price {
-		font-size: 45rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #FF6F0F;
-		// 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: 170rpx;
-			height: 170rpx;
-			flex-shrink: 0;
-			margin-top: -40rpx;
-			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;
+		}
+
+		.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: 170rpx;
+				height: 170rpx;
+				flex-shrink: 0;
+				margin-top: -40rpx;
+				border-radius: 8rpx;
+			}
+
+			.right {
+				display: flex;
+				flex-direction: column;
+				padding-left: 24rpx;
+				font-size: $font-sm + 2rpx;
+				color: $font-color-base;
 				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;
-				image {
-					width: 48rpx;
-					height: 48rpx;
-					margin-right: 8rpx;
-				}
-			}
-			.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);
-	// border-radius: 16rpx;
-	.p-b-btn {
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-		font-size: $font-sm;
-		color: $font-color-base;
-		width: 100rpx;
-		height: 98rpx;
-		.iconfont {
-			font-size: 40rpx;
-			line-height: 48rpx;
-			color: $font-color-light;
-		}
-		&.active,
-		&.active .iconfont {
-			color: $uni-color-primary;
-		}
-		.icon-fenxiang2 {
-			font-size: 42rpx;
-			transform: translateY(-2rpx);
-		}
-		.iconlikefill {
-			font-size: 46rpx;
-		}
-	}
-	.action-btn-group {
-		display: flex;
-		height: 98rpx;
-		overflow: hidden;
-		position: relative;
-		.action-btn {
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			width: 750rpx;
-			height: 100%;
-			font-size: $font-base;
-			padding: 0;
-			border-radius: 0;
-			// background: transparent;
-			background: #31332D;
-			&.buy-now-btn {
-				background-color: #303e49;
-			}
-			&.add-cart-btn {
-				background-color: $base-color;
-			}
-		}
-	}
-}
-// 商店头
-.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;
-	}
-}
+
+				.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;
+					image {
+						width: 48rpx;
+						height: 48rpx;
+						margin-right: 8rpx;
+					}
+				}
+
+				.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);
+
+		// border-radius: 16rpx;
+		.p-b-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+			font-size: $font-sm;
+			color: $font-color-base;
+			width: 100rpx;
+			height: 98rpx;
+
+			.iconfont {
+				font-size: 40rpx;
+				line-height: 48rpx;
+				color: $font-color-light;
+			}
+
+			&.active,
+			&.active .iconfont {
+				color: $uni-color-primary;
+			}
+
+			.icon-fenxiang2 {
+				font-size: 42rpx;
+				transform: translateY(-2rpx);
+			}
+
+			.iconlikefill {
+				font-size: 46rpx;
+			}
+		}
+
+		.action-btn-group {
+			display: flex;
+			height: 98rpx;
+			overflow: hidden;
+			position: relative;
+
+			.action-btn {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 750rpx;
+				height: 100%;
+				font-size: $font-base;
+				padding: 0;
+				border-radius: 0;
+				// background: transparent;
+				background: #31332D;
+
+				&.buy-now-btn {
+					background-color: #303e49;
+				}
+
+				&.add-cart-btn {
+					background-color: $base-color;
+				}
+			}
+		}
+	}
+
+	// 商店头
+	.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>
-

+ 41 - 6
pages/product/product.vue

@@ -207,10 +207,11 @@ import uniNumberBox from '@/components/uni-number-box.vue';
 import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
 import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
 import { getShoping } from '@/api/shoping.js';
-// #ifdef H5
-import { weixindata } from '@/utils/wxAuthorized';
-import { mapState } from 'vuex';
-// #endif
+// import { weixindata } from '@/utils/wxAuthorized';
+import { mapState } from 'vuex';
+	// #ifdef H5
+	import { weixindata, weixinlocation,shareLoad } from '@/utils/wxAuthorized';
+	// #endif
 export default {
 	components: {
 		share,
@@ -327,7 +328,40 @@ export default {
 		...mapState('user', ['userInfo'])
 		// #endif
 	},
-	methods: {
+	methods: {
+		// 分享
+		// #ifdef H5
+		IndexShare() {
+			let obj = this
+			// console.log('dddddddffffffffffffff')
+			// 设置菜单中的转发按钮触发转发事件时的转发内容
+			let pages = getCurrentPages(); //获取加载的页面
+			let currentPage = pages[pages.length - 1]; //获取当前页面的对象
+			let url = '/#/' + currentPage.route; //当前页面url
+			let item = currentPage.options; //如果要获取url中所带的参数可以查看options
+			let shareObj = {
+				title: obj.goodsObjact.store_name, // 默认是小程序的名称(可以写slogan等)
+				link: obj.baseURL + url + '?id=' + item.id + '&spread=' + obj.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
+				desc: obj.goodsObjact.store_name + '   价格:' + obj.goodsObjact.price,
+				imgUrl: obj.goodsObjact.image,
+				success: function(res) {
+					// 转发成功之后的回调
+					if (res.errMsg == 'shareAppMessage:ok') {
+					}
+				},
+				fail: function() {
+					// 转发失败之后的回调
+					if (res.errMsg == 'shareAppMessage:fail cancel') {
+						// 用户取消转发
+					} else if (res.errMsg == 'shareAppMessage:fail') {
+						// 转发失败,其中 detail message 为详细失败信息
+					}
+				}
+			};
+			console.log(shareObj, '8888888888888888888');
+			shareLoad(shareObj);
+		},
+		// #endif
 		navTo(url) {
 			uni.navigateTo({
 				url
@@ -441,7 +475,8 @@ export default {
 					obj.getShoping();
 				}
 				// #ifdef H5
-				obj.shareDate();
+				obj.shareDate();
+				obj.IndexShare()
 				// #endif
 			});
 		},

+ 159 - 473
pages/shareQrCode/index.vue

@@ -1,481 +1,167 @@
-<<<<<<< HEAD
-<template>
-	<view class="content">
-		<!-- <view class="qrimg">
-			<tki-qrcode
-				:cid="cid"
-				ref="qrcode"
-				:val="val"
-				:size="size"
-				:unit="unit"
-				:background="background"
-				:foreground="foreground"
-				:pdground="pdground"
-				:icon="icon"
-				:iconSize="iconSize"
-				:lv="lv"
-				:onval="onval"
-				:loadMake="loadMake"
-				:usingComponents="usingComponents"
-				@result="qrR"
-			/>
-		</view> -->
-		<!-- #ifndef MP-ALIPAY -->
-		<!-- <canvas :class="{ qrimg: !loading }" @longtap="alertCanv" id="qrShareBox" canvas-id="qrShareBox" class="tki-qrcode-canvas" /> -->
-		<!-- #endif -->
-		<!-- #ifdef MP-ALIPAY -->
-		<!-- <canvas :class="{ qrimg: !loading }" @longtap="alertCanv" id="qrShareBox" class="tki-qrcode-canvas" /> -->
-		<!-- #endif -->
-		<!-- <view :style="{ display: loading ? 'none' : 'block' }" class="tki-qrcode-canvas"><image :src="ctxSrc" mode="scaleToFill" class="tki-qrcode-canvas"></image></view> -->
-		<!-- <view class="tki-qrcode-canvas"> -->
-		<image :src="ctxSrc" mode="widthFix" class="tki-qrcode-canvas"></image>
-		<!-- </view> -->
-		<!-- <view class="share-bottom flex" :class="{ 'action-share-bottom': !loading }" @click="loading ? showImg() : ''">
-			<text>{{ loading ? '点击生成图片' : '长按二维码下载' }}</text>
-		</view> -->
-		<!-- <view class="share-bottom flex">
-			<text>长按二维码下载</text>
-		</view> -->
+<template>
+	<view class="content">
+		<image src="../../static/img/sharebase.png" mode="" class="sharebg" ></image>
+		<view class="code-warpper">
+			<view class="code-content">
+				<tki-qrcode
+					:cid="cid"
+					ref="qrcode"
+					:val="val"
+					:size="size"
+					:unit="unit"
+					:background="background"
+					:foreground="foreground"
+					:pdground="pdground"
+					:iconSize="iconSize"
+					:lv="lv"
+					:onval="onval"
+					:loadMake="loadMake"
+					:usingComponents="usingComponents"
+					@result="qrR"
+				/>
+			</view>
+			<view class="code">
+				邀请码:{{userInfo.uid}}
+			</view>
+		</view>
+		<view class="btm">
+			<!-- 向商家出示二维码 -->
+		</view>
 	</view>
 </template>
 
-<script>
-import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
-import { spreadBanner } from '@/api/shareQrCode.js';
-import { getUserInfo } from '@/api/login.js';
-import { weixindata, shareData, loadShareData } from '@/utils/wxAuthorized.js';
-import { mapState } from 'vuex';
-import { share } from '@/api/wx';
-export default {
-	computed: {
-		...mapState(['baseURL', 'urlFile']),
-		...mapState('user', ['userInfo'])
-	},
-	// components: { tkiQrcode },
-	data() {
-		return {
-			cid: 'tki-qrcode-canvas', //canvasId,页面存在多个二维码组件时需设置不同的ID
-			size: 180, //生成的二维码大小
-			unit: 'upx', //大小单位尺寸
-			// show: true,//默认使用组件中的image标签显示二维码
-			val: '', //要生成的内容
-			background: '#ffffff', //二维码背景色
-			foreground: '#333333', //二维码前景色
-			pdground: '#333333', //二维码角标色
-			icon: '', //二维码图标URL(必须是本地图片,网络图需要先下载至本地)
-			iconSize: 40, //二维码图标大小
-			lv: 3, //容错级别
-			onval: false, //监听val值变化自动重新生成二维码
-			loadMake: false, //组件初始化完成后自动生成二维码,val需要有值
-			usingComponents: false, //是否使用了自定义组件模式(主要是为了修复非自定义组件模式时 v-if 无法生成二维码的问题)
-			showLoading: false, //是否显示loading
-			loadingText: '二维码生成中', //loading文字
-			src: '', // 二维码生成后的图片地址或base64
-			ratio: 1, //页面比例用于计算
-			ctxSrc: '', //要显示的图片
-			loading: true, //是否载入图片中
-			canHeight: '',
-			canWeidth: '',
-			login: false //判断是否登录
-		};
-	},
-	onShow() {
-		let obj = this;
-		if (!obj.login) {
-			// 判断是否已经登录
-			getUserInfo()
-				.then(e => {
-					obj.login = true;
-					uni.showLoading({
-						title: '邀请图生成中',
-						mask: true
-					});
-					obj.loadCodeList();
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		}
-	},
-	// onReady() {
-	// 	let obj = this;
-	// 	let query = uni.createSelectorQuery();
-	// 	// 获取页面比例
-	// 	query
-	// 		.select('.content')
-	// 		.fields(
-	// 			{
-	// 				size: true
-	// 			},
-	// 			e => {
-	// 				// 保存比例
-	// 				this.ratio = e.width / 750;
-	// 			}
-	// 		)
-	// 		.exec();
-	// 	// 获取画布宽高信息
-	// 	query
-	// 		.select('#qrShareBox')
-	// 		.fields(
-	// 			{
-	// 				size: true
-	// 			},
-	// 			e => {
-	// 				obj.canHeight = e.height;
-	// 				obj.canWeidth = e.width;
-	// 			}
-	// 		)
-	// 		.exec({});
-	// },
-	methods: {
-		// 设置分享数据
-		setShare() {
-			let obj = this;
-			// 加载分享数据
-			// #ifdef H5
-			obj.loadSareData().then(e => {
-				weixindata({
-					link: obj.ctxSrc, // 分享链接
-					imgUrl:obj.baseURL+obj.urlFile+'/img/logo.jpg',
-					desc:'欢迎加入满园春',
-					title: '满园春线上商城',
-					success: function() {},
-					fail: function() {}
-				});
-			});
-			// #endif
-		},
-		loadSareData() {
-			if (!shareData) {
-				return loadShareData();
-			} else {
-				return new Promise((resolve, reject) => {
-					resolve(shareData);
-				});
-			}
-		},
-		loadCodeList() {
-			let obj = this;
-			// 加载二维码信息
-			spreadBanner({
-				// // #ifdef MP
-				// type: 1
-				// // #endif
-			})
-				.then(e => {
-					console.log(e);
-					// 保存二维码图片
-					// this.src = e.data.real_url;
-					obj.ctxSrc = e.data[0].wap_poster;
-					// 生成画布
-					// this.loadImg(e.data.real_url);
-					uni.hideLoading();
-					// 加载分享数据
-					// obj.setShare()
-				})
-				.catch(e => {
-					console.log(e)
-					// uni.showModal({
-					// 	title: '生成失败请刷新页面',
-					// 	showCancel: false
-					// });
-					uni.hideLoading();
-				});
-		},
-		// 长按画布事件
-		alertCanv() {
-			uni.showModal({
-				title: '请先点击生成图片',
-				showCancel: false
-			});
-		},
-		// 生成图片
-		showImg() {
-			uni.showLoading({
-				title: '图片生成中',
-				mask: true
-			});
-			let obj = this;
-			//因为和uni.showLoading载入效果冲突需要延迟执行生成图片方法
-			setTimeout(function() {
-				uni.canvasToTempFilePath({
-					x: 0,
-					y: 0,
-					width: obj.canWeidth,
-					height: obj.canHeight,
-					destWidth: obj.canWeidth,
-					destHeight: obj.canHeight,
-					fileType: 'jpg',
-					quality: 1,
-					canvasId: 'qrShareBox',
-					success: res => {
-						uni.hideLoading();
-						uni.showModal({
-							title: '创建成功,长按二维码下载图片',
-							showCancel: false
-						});
-						// 显示生成的图片
-						obj.loading = false;
-						obj.ctxSrc = res.tempFilePath;
-					},
-					fail(e) {
-						console.log(e);
-					}
-				});
-			}, 50);
-		},
-		// 开始渲染画布
-		loadImg(src) {
-			let obj = this;
-			const ctxBg = '/static/img/img14.jpg'; //画布背景
-			let context = uni.createCanvasContext('qrShareBox');
-			const codeSize = this.size * this.ratio; //计算二维码大小
-			const codeX = ((523 - this.size) * this.ratio) / 2; //二维码所在x轴位置
-			const codeY = 700 * this.ratio; //二维码所在y轴位置
-			const codeBoxColor = '#FFFFFF'; //包裹框颜色
-			const codeBoxWidht = 0; //包裹边框宽度
-			const codeBoxSize = (codeBoxWidht / 2) * this.ratio; //计算二维码白色包裹框大小
-			const codeBoxX = codeX - codeBoxSize; //包裹框初始X轴
-			const codeBoxY = codeY - codeBoxSize; //包裹框初始Y轴
-			const codeBoxEnd = codeSize + codeBoxWidht * this.ratio; //计算包裹框大小
-			// const fontLeft = (codeSize - fontSize * fontText.length) / 2 + codeX; //文字左侧距离
-			const fontTop = codeY + codeBoxEnd + (codeBoxWidht + 30) * this.ratio; //文字距离上边距高度
-			const fontLeft = codeX - 50 * this.ratio; //文字左侧距离
-			const fontSize = 14; //文字大小
-			const fontText = '邀请人:' + uni.getStorageSync('userInfo').nickname; //文字内容
-			// 插入背景图片
-			context.drawImage(ctxBg, 0, 0, obj.canWeidth, obj.canHeight);
-			// // 插入文字
-			context.setFontSize(fontSize);
-			context.fillText(fontText, fontLeft, fontTop);
-			// 插入边框
-			context.beginPath();
-			context.setLineJoin('round'); //边框类型
-			context.setLineWidth(codeBoxWidht * this.ratio);
-			context.setStrokeStyle(codeBoxColor); //设置包裹框颜色
-			context.strokeRect(codeBoxX, codeBoxY, codeBoxEnd, codeBoxEnd);
-			context.stroke();
-			// 插入二维码
-			context.drawImage(src, codeX, codeY, codeSize, codeSize);
-			// 开始渲染
-			context.draw();
-		},
-		// 創建二维码
-		creatQrcode() {
-			this.$refs.qrcode._makeCode();
-		},
-		// 保存二维码到图库
-		saveQrcode() {
-			this.$refs.qrcode._saveCode();
-		},
-		// 生成二维码后返回base64
-		qrR(res) {
-			this.src = res;
-		},
-		//清空二维码(清空二维码会触发result回调 返回值为空)
-		clearQrcode(e) {
-			this.$refs.qrcode._clearCode();
-			this.val = '';
-		}
+<script>
+	import { orderDetail } from '@/api/order.js';
+	import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
+	import { mapState, mapMutations } from 'vuex';
+	export default {
+		comments:{
+			tkiQrcode
+		},
+		data() {
+			return {
+				id:'',
+				// code: '10250035810',
+				cid: 'tki-qrcode-canvas', //canvasId,页面存在多个二维码组件时需设置不同的ID
+				size: 300, //生成的二维码大小
+				unit: 'upx', //大小单位尺寸
+				show: true,//默认使用组件中的image标签显示二维码
+				val: '', //要生成的内容
+				background: '#ffffff', //二维码背景色
+				foreground: '#333333', //二维码前景色
+				pdground: '#333333', //二维码角标色
+				icon: '', //二维码图标URL(必须是本地图片,网络图需要先下载至本地)
+				iconSize: 40, //二维码图标大小
+				lv: 3, //容错级别
+				onval: true, //监听val值变化自动重新生成二维码
+				loadMake: true, //组件初始化完成后自动生成二维码,val需要有值
+				usingComponents: false, //是否使用了自定义组件模式(主要是为了修复非自定义组件模式时 v-if 无法生成二维码的问题)
+				showLoading: false, //是否显示loading
+				loadingText: '二维码生成中', //loading文字
+				src: '', // 二维码生成后的图片地址或base64
+				ratio: 1, //页面比例用于计算
+				ctxSrc: '', //要显示的图片
+				loading: true,//是否载入图片中
+				canHeight: '',//画布高度
+				canWeidth: ''//画布宽度
+			}
+		},
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
+			...mapState(['baseURL'])
+		},
+		onShow() {
+			console.log(this.userInfo)
+			// 判断是否已经登录
+			if (this.hasLogin) {
+				// this.loadBaseData();
+				// this.getSpreadCount()
+				console.log(this.userInfo)
+				// console.log(this.userInfo)
+			}
+		},
+		onLoad(opt) {
+			this.val = this.baseURL + '/index/#/pages/index/index??spread=' + this.userInfo.uid
+		},
+		methods: {
+			// 生成二维码后返回base64
+			qrR(res) {
+				this.src = res;
+			},
+		}
 	}
-};
 </script>
 
-<style lang="scss">
-.content {
-	// padding-top: 30rpx;
-}
-// #qrShareBox {
-// 	position: absolute;
-// 	left: -9999rpx;
-// 	top: -9999rpx;
-// }
-
-.qrimg {
-	position: absolute;
-	left: -9999rpx;
-	top: -9999rpx;
-}
-.tki-qrcode-canvas {
-	width: 750rpx;
-	margin: 0 auto;
-}
-.share-bottom {
-	width: 560rpx;
-	height: 80rpx;
-	color: #ffffff;
-	background-color: $base-color;
-	margin: 0 auto;
-	font-size: $font-lg - 2rpx;
-	margin-top: 30rpx;
-	border-radius: 99rpx;
-	justify-content: center;
-	&.action-share-bottom {
-		background-color: $color-gray;
-	}
-}
-</style>
-=======
-<template>
-	<view class="container">
-		<image @longtap="bc_code" class="backImg" :src="backImg"></image>
-		<view class="tki-qrcode">
-			<canvas @longtap="bc_code" canvas-id="qrcode" />
-		</view>
-	</view>
-</template>
-
-<script>
-// import uQRCode from '@/components/Sansnn-uQRCode/uqrcode.js'
-import { getUserInfo,spreadBanner } from '@/api/user.js';
-export default {
-	props: {
-		qrval: {
-			// 要生成的二维码值
-			type: String,
-		}
-	},
-	data() {
-		return {
-			url: '',
-			backImg:'',
-			userInfo:''
-		};
-	},
-	onLoad() {
-		this.spread();
-		this.getInfo();
-	},
-	computed: {
-			cpSize() {
-				if(this.unit == "upx"){
-					return uni.upx2px(this.size)
-				}else{
-					return this.size
-				}
-			}
-	},
-	methods: {
-		spread(){
-			let obj = this;
-			spreadBanner({
-				type:2
-			}).then(({ data }) => {
-				obj.backImg = data[0].wap_poster;
-			});
-		},
-		getInfo(){
-			let obj = this;
-			getUserInfo({}).then(({ data }) => {
-				obj.userInfo = data;
-				// obj.loadData()
-			});
-		},
-		bc_code(){
-			let that = this;
-			console.log('保存二维码',this.backImg)
-			uni.downloadFile({           //获得二维码的临时地址
-				url:this.backImg,
-				success:(res)=>{
-					//console.log('获取url',res)
-					if(res.statusCode == 200){
-						uni.saveImageToPhotosAlbum({
-							filePath:res.tempFilePath,//传入临时地址
-							success() {
-								that.$api.msg('保存成功')//封装的提示
-							},
-							fail() {
-								that.$api.msg('保存失败')
-							}
-						})
-					}
-				}
-			})
-		},
-		//生成二维码
-		  // make() {
-			 //  let obj = this;
-		  //     uQRCode.make({
-		  //       canvasId: 'qrcode',
-		  //       componentInstance: this,
-		  //       text: obj.url,
-		  //       size: 150,
-		  //       margin: 10,
-		  //       backgroundColor: '#ffffff',
-		  //       foregroundColor: '#000000',
-		  //       fileType: 'png',
-		  //       correctLevel: uQRCode.defaults.correctLevel,
-		  //       success: res => {
-		  //         // console.log(res)
-		  //       }
-		  //     })
-		  //   },
-		// 请求载入数据
-		// async loadData() {
-		// 	let obj = this;
-		// 	obj.url = 'http://btex.frp.liuniu946.com/?id='+ obj.userInfo.invite_code;
-		// 	obj.make();
-		// },
-	},
-};
-</script>
-
-<style lang="scss">
-	page{
-		width: 100%;
-		min-height: 100%;
-		.container{
-			width: 100%;
-			height: 100%;	
-		}
-	}
-	.backImg{
-		position: absolute;
-		width: 100%;
-		height: 100%;
-	}
-.portrait{
-	width: 100%;
-	text-align: center;
-	padding-top: 80rpx;
-	padding-bottom: 30rpx;
-	image{
-		width: 250rpx;
-		height: 250rpx;
+<style lang="scss" scoped>
+	.content {
+		position: relative;
+		background-color: #ff341a;
+		height: 100vh;
+		min-height: 100%;
+	}
+	page {
+		height: 100vh;
+		min-height: 100%;
+		background-color: #ff341a;
+	}
+	.user-logo {
+		height: 300rpx;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		image {
+			width: 102rpx;
+			height: 102rpx;
+			border-radius: 50%;
+		}
+		.user-name {
+			padding-top: 25rpx;
+			font-size: 34rpx;
+			font-family: SourceHanSansCN;
+			font-weight: 400;
+			color: #2B2B2B;
+		}
+		
+	}
+	.code-warpper {
+		width: 515rpx;
+		height: 515rpx;
+		margin: 0 auto;
+		// border: 3rpx solid #901B21;
+		padding-top: 46rpx;
+		position: absolute;
+		top:600rpx;
+		left: 0;
+		right: 0;
+		margin: auto;
+		.code-content {
+			width: 300rpx;
+			height: 300rpx;
+			// background-color: red;
+			margin: 0 auto;
+		}
+		.code {
+			padding-top: 31rpx;
+			font-size: 36rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #333333;
+			text-align: center;
+		}
+	}
+	.btm {
+		padding-top: 45rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #333333;
+		text-align: center;
+	}
+	.sharebg {
+		width: 750rpx;
+		height: 1206rpx;
+		position: absolute;
+		top: 0;
 	}
-}
-.text{
-	text-align: center;
-	width: 100%;
-	color: #FFFFFF;
-	font-size:55rpx;
-	letter-spacing:15rpx;
-}
-.uid-name{
-	padding: 50rpx 0rpx;
-	text-align: center;
-	width: 100%;
-	color: #FFFFFF;
-}
-.copy-btn{
-	color: #FFFFFF;
-	background-color: #4BA6ED;
-	border-radius: 50rpx;
-	width: 170rpx;
-	line-height: 70rpx;
-	margin: 0rpx auto;
-	text-align: center;
-}
-.tki-qrcode{
-	position: fixed;
-	bottom: 10%;
-	left: 30%;
-}
-canvas{
-	width:150px;
-	height: 150px;
-	margin: auto;
-	
-}
 </style>
->>>>>>> 4114c25969fb9b7b2c1d4af1f04837ed1c250f54

+ 20 - 13
pages/user/user.vue

@@ -99,7 +99,7 @@
 				<uni-list>
 					<uni-list-item v-if="isShowIllegality" title="我的推广" @click="navTo('/pages/myteam/myteam')" thumb="/static/user/tuiguang.png"></uni-list-item>
 					<uni-list-item title="邀请海报" @click="navTo('/pages/shareQrCode/index')" thumb="/static/user/haibao.png"></uni-list-item>
-					<uni-list-item title="兑换会员卡" @click="go" thumb="/static/icon/czhy.png"></uni-list-item>
+					<uni-list-item title="兑换会员卡" @click="go" thumb="/static/icon/czhy.png" v-if="userInfo.level == 0"></uni-list-item>
 					<!-- <uni-list-item title="兑换会员卡" @click="go" thumb="/static/icon/czhy.png"></uni-list-item> -->
 					<uni-list-item title="我的收藏" @click="navTo('/pages/favorites/favorites')" thumb="/static/user/collect.png"></uni-list-item>
 					<uni-list-item title="收货地址" @click="navTo('/pages/address/address')" thumb="/static/user/address.png"></uni-list-item>
@@ -189,9 +189,9 @@ export default {
 			watchful: true,
 			card: '',
 			pwd: '',
-			storeInfo: {
-				name: ''
-			},
+			// storeInfo: {
+			// 	name: ''
+			// },
 			qrsize: 80, // 二维码大小
 			cid: 'tki-qrcode-canvas', //canvasId,页面存在多个二维码组件时需设置不同的ID
 			size: 500, //生成的二维码大小
@@ -244,7 +244,7 @@ export default {
 		// #ifdef H5
 		...mapState(['weichatObj']),
 		// #endif
-		...mapState(['isShowIllegality'])
+		...mapState(['isShowIllegality','canChange','storeInfo'])
 	},
 	methods: {
 		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
@@ -403,9 +403,14 @@ export default {
 		},
 		// 选择门店
 		chooseStore() {
-			uni.navigateTo({
-				url: '/pages/shoping/list?type=3'
-			});
+			if(this.canChange == 0) {
+				return
+			}else {
+				uni.navigateTo({
+					url: '/pages/shoping/list?type=3'
+				});
+			}
+			
 		},
 		go() {
 			this.$refs.popup.open();
@@ -414,7 +419,7 @@ export default {
 			this.$refs.popup.close();
 			this.card = '';
 			this.pwd = '';
-			this.storeInfo = { name: '' };
+			// this.storeInfo = { name: '' };
 		},
 		comfirm() {
 			verification({
@@ -422,19 +427,20 @@ export default {
 				card_password: this.pwd,
 				type: 0,
 				is_confirm: 1,
-				reg_store_id: this.storeInfo.id
+				// reg_store_id: this.storeInfo.id
 			})
 				.then(e => {
 					console.log(e);
 					this.card = '';
 					this.pwd = '';
-					this.storeInfo = { name: '' };
+					// this.storeInfo = { name: '' };
+					this.loadBaseData()
 				})
 				.catch(e => {
 					console.log(e);
 					this.card = '';
 					this.pwd = '';
-					this.storeInfo = { name: '' };
+					// this.storeInfo = { name: '' };
 				});
 			this.$refs.popup.close();
 		}
@@ -663,6 +669,7 @@ export default {
 		margin-bottom: 20rpx;
 		.mendian-lift {
 			display: flex;
+			line-height: 36rpx;
 			.null-mendian {
 				font-size: 28rpx;
 				font-weight: bold;
@@ -687,7 +694,7 @@ export default {
 		.mendian-right {
 			display: flex;
 			align-items: center;
-
+			// line-height: 60rpx;
 			.duihuan {
 				font-size: 24rpx;
 			}

+ 12 - 7
pages/wallet/openMember.vue

@@ -140,7 +140,7 @@ import weixinObj from '@/plugin/jweixin-module/index.js';
 
 export default {
 	computed: {
-		...mapState(['weichatObj']),
+		...mapState(['weichatObj','storeInfo','canChange']),
 		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
 	},
 	onLoad(option) {
@@ -156,9 +156,9 @@ export default {
 	},
 	data() {
 		return {
-			storeInfo: {
-				name: ''
-			},
+			// storeInfo: {
+			// 	name: ''
+			// },
 			checkedZdLoding: false, //自动拼团是否加载中
 			checkedAutoZd: 1, //开启关闭自动拼团
 			timeEnd: true, //判断会员是否超时
@@ -314,9 +314,14 @@ export default {
 		},
 		// 选择门店
 		chooseStore() {
-			uni.navigateTo({
-				url: '/pages/shoping/list?type=3'
-			})
+			if(this.canChange == 0) {
+				return
+			}else {
+				uni.navigateTo({
+					url: '/pages/shoping/list?type=3'
+				})
+			}
+			
 		},
 		pay() {
 			let obj = this;

+ 14 - 4
pages/wallet/recharge.vue

@@ -72,7 +72,8 @@ import uniPopup from '@/components/uni-popup/uni-popup.vue';
 import { verification } from '@/api/merchant.js';
 import { getMoneyStyle } from '@/utils/rocessor.js';
 import { rechargeWechat } from '@/api/wallet.js';
-import { mapState } from 'vuex';
+import { mapState, mapMutations} from 'vuex';
+import { getUserInfo } from '@/api/login.js';
 export default {
 	components: {
 		uniPopup
@@ -109,7 +110,8 @@ export default {
 		this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
 		// #endif
 	},
-	computed: {
+	computed: {
+		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
 		// #ifdef H5
 		...mapState(['weichatObj'])
 		// #endif
@@ -188,7 +190,8 @@ export default {
 			this.card = '';
 			this.pwd = '';
 		},
-		comfirm() {
+		comfirm() {
+			let obj = this
 			verification({
 				card_number:this.card,
 				card_password:this.pwd,
@@ -197,7 +200,14 @@ export default {
 			}).then(e =>{
 				console.log(e)
 				this.card = '';
-				this.pwd = '';
+				this.pwd = '';
+				getUserInfo()
+					.then(({ data }) => {
+						obj.setUserInfo(data);
+					})
+					.catch(e => {
+						console.log(e);
+					});
 			}).catch(e =>{
 				console.log(e)
 			})

BIN
static/img/sharebase.png


+ 3 - 2
utils/wxAuthorized.js

@@ -131,7 +131,7 @@ export async function weixindata(config) {
 	})
 }
 // 加载分享数据
-function shareLoad(config) {
+export function shareLoad(config) {
 	let mess;
 	if (config) {
 		mess = {
@@ -207,5 +207,6 @@ export default {
 	weixinObj,
 	shareData,
 	appId,
-	setRouter
+	setRouter,
+	shareLoad
 }