2312970463@qq.com 4 years ago
parent
commit
e90da8ab8a

+ 10 - 4
pages/order/evaluate.vue

@@ -128,7 +128,11 @@ export default {
 			for (let i = 0; i < obj.imgList.length; i++) {
 			for (let i = 0; i < obj.imgList.length; i++) {
 				obj.cloudimgList.push(obj.imgList[i].url);
 				obj.cloudimgList.push(obj.imgList[i].url);
 			}
 			}
-			let arr = obj.cloudimgList.join(',');
+			let arr = obj.cloudimgList.join(',');
+			uni.showLoading({
+				title: '提交中...',
+				mask: true
+			})
 			order_comment({
 			order_comment({
 				pics: arr,
 				pics: arr,
 				comment: obj.text,
 				comment: obj.text,
@@ -137,12 +141,14 @@ export default {
 				unique: obj.unique,
 				unique: obj.unique,
 				
 				
 			})
 			})
-				.then(e => {
+				.then(e => {
+					uni.hideLoading()
 					uni.navigateTo({
 					uni.navigateTo({
 						url: '/pages/order/order?state=4'
 						url: '/pages/order/order?state=4'
 					});
 					});
 				})
 				})
-				.catch(e => {
+				.catch(e => {
+					uni.hideLoading()
 					uni.navigateTo({
 					uni.navigateTo({
 						url: '/pages/order/order?state=4'
 						url: '/pages/order/order?state=4'
 					});
 					});
@@ -286,7 +292,7 @@ page {
 	height: 96rpx;
 	height: 96rpx;
 	line-height: 96rpx;
 	line-height: 96rpx;
 	text-align: center;
 	text-align: center;
-	background-color: #1BCC26 !important;
+	background-color: #fd4040 !important;
 	opacity: 1;
 	opacity: 1;
 	border-radius: 32rpx;
 	border-radius: 32rpx;
 	border-width: 8rpx;
 	border-width: 8rpx;

+ 1 - 1
pages/order/order.vue

@@ -58,7 +58,7 @@
 							<button v-if="item._status._title == '未支付'" @click.stop="orderPay(item)" class="action-btn recom">付款</button>
 							<button v-if="item._status._title == '未支付'" @click.stop="orderPay(item)" class="action-btn recom">付款</button>
 							<button v-if="item._status._title == '待评价'" class="action-btn">评价</button>
 							<button v-if="item._status._title == '待评价'" class="action-btn">评价</button>
 							<button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)" class="action-btn">确认收货</button>
 							<button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)" class="action-btn">确认收货</button>
-							<button v-if="item._status._title == '未发货'" class="action-btn" @click.stop="orderRefund(item)">申请退款</button>
+							<!-- <button v-if="item._status._title == '未发货'" class="action-btn" @click.stop="orderRefund(item)">申请退款</button> -->
 						</view>
 						</view>
 					</view>
 					</view>
 
 

+ 5 - 5
pages/order/orderDetail.vue

@@ -4,7 +4,7 @@
 			<text class="order-status" @click="item.delivery_type == 'express'?towuliu(item):''">{{ item._status ? item._status._msg : '' }}</text>
 			<text class="order-status" @click="item.delivery_type == 'express'?towuliu(item):''">{{ item._status ? item._status._msg : '' }}</text>
 		</view>
 		</view>
 		<!-- 快递信息 -->
 		<!-- 快递信息 -->
-		<view class="express-box" @click="expressCheck(item)" v-if="item.delivery_id != null ">
+		<view class="express-box" v-if="item.delivery_id != null ">
 			<view v-if='item.delivery_id != null' style="width: 100%;padding: 10rpx 20rpx;background: #FFFFFF;">
 			<view v-if='item.delivery_id != null' style="width: 100%;padding: 10rpx 20rpx;background: #FFFFFF;">
 				<view class="express-frame">
 				<view class="express-frame">
 					<view>
 					<view>
@@ -17,7 +17,7 @@
 							{{ item.delivery_id }}
 							{{ item.delivery_id }}
 						</view>
 						</view>
 					</view>
 					</view>
-					<text class="iconfont iconenter" style="color: #CCCCCC;"></text>
+					<!-- <text class="iconfont iconenter" style="color: #CCCCCC;"></text> -->
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -56,17 +56,17 @@
 			<view class="input">¥{{ payAllMoney }}</view>
 			<view class="input">¥{{ payAllMoney }}</view>
 		</view>
 		</view>
 		<view class="row b-b flex" v-if="vipMoney > 0">
 		<view class="row b-b flex" v-if="vipMoney > 0">
-			<text class="tit">vip优惠</text>
+			<text class="tit">会员优惠</text>
 			<view class="input">-¥{{ vipMoney }}</view>
 			<view class="input">-¥{{ vipMoney }}</view>
 		</view>
 		</view>
 		<view class="row b-b flex">
 		<view class="row b-b flex">
 			<text class="tit">邮费</text>
 			<text class="tit">邮费</text>
 			<view class="input">{{ item.pay_postage > 0 ? '¥' + item.pay_postage : '免邮费' }}</view>
 			<view class="input">{{ item.pay_postage > 0 ? '¥' + item.pay_postage : '免邮费' }}</view>
 		</view>
 		</view>
-		<view class="row b-b flex" v-if="item.coupon_id > 0">
+		<!-- <view class="row b-b flex" v-if="item.coupon_id > 0">
 			<text class="tit">优惠券</text>
 			<text class="tit">优惠券</text>
 			<view class="input">-¥{{ item.coupon_price }}</view>
 			<view class="input">-¥{{ item.coupon_price }}</view>
-		</view>
+		</view> -->
 		<view class="row b-b flex" v-if="item.use_integral > 0">
 		<view class="row b-b flex" v-if="item.use_integral > 0">
 			<text class="tit">积分抵扣</text>
 			<text class="tit">积分抵扣</text>
 			<view class="input">-¥{{ item.use_integral }}</view>
 			<view class="input">-¥{{ item.use_integral }}</view>

+ 6 - 1
pages/product/common/productContent.vue

@@ -2,7 +2,7 @@
 	<view class="introduce-section">
 	<view class="introduce-section">
 		
 		
 		<!-- 分享 -->
 		<!-- 分享 -->
-		<button open-type="share" class="shareDate" style="border: none;">
+		<button open-type="share" class="shareDate" style="border: none;" @click="open">
 			<image class="share-img" src="../../../static/icon/share.png"></image>
 			<image class="share-img" src="../../../static/icon/share.png"></image>
 		</button>
 		</button>
 		<!-- 价格信息 -->
 		<!-- 价格信息 -->
@@ -43,6 +43,11 @@ export default {
 	},
 	},
 	data() {
 	data() {
 		return {};
 		return {};
+	},
+	methods: {
+		open() {
+			this.$emit('callf')
+		}
 	}
 	}
 };
 };
 </script>
 </script>

+ 63 - 31
pages/product/product.vue

@@ -3,8 +3,8 @@
 		<!-- 轮播图 -->
 		<!-- 轮播图 -->
 		<top-swiper :imgList="imgList"></top-swiper>
 		<top-swiper :imgList="imgList"></top-swiper>
 		<!-- 标题 -->
 		<!-- 标题 -->
-		<product-content :goodsObjact="goodsObjact"></product-content>
-		
+		<product-content :goodsObjact="goodsObjact" @callf="callf"></product-content>
+
 		<!-- 拼货时间及优惠 -->
 		<!-- 拼货时间及优惠 -->
 		<!-- <discounts @clickCoupon="Getcoupon" :Info="goodsObjact.store_info" :showCoupon="true"></discounts> -->
 		<!-- <discounts @clickCoupon="Getcoupon" :Info="goodsObjact.store_info" :showCoupon="true"></discounts> -->
 		<!-- 猜你喜欢 -->
 		<!-- 猜你喜欢 -->
@@ -28,7 +28,10 @@
 					<image :src="actionImage"></image>
 					<image :src="actionImage"></image>
 					<view class="right">
 					<view class="right">
 						<text class="name clamp">{{ goodsObjact.store_name }}</text>
 						<text class="name clamp">{{ goodsObjact.store_name }}</text>
-						<view class="price"><text>¥</text>{{ actionPrice * goodsNumber }}</view>
+						<view class="price">
+							<text>¥</text>
+							{{ actionPrice * goodsNumber }}
+						</view>
 						<image src="../../static/icon/del.png" mode="" class="right-img" @click="close()"></image>
 						<image src="../../static/icon/del.png" mode="" class="right-img" @click="close()"></image>
 						<!-- <text class="stock">库存:{{ goodsStore }}件</text> -->
 						<!-- <text class="stock">库存:{{ goodsStore }}件</text> -->
 						<!-- <view class="selected" v-if="specList != ''">
 						<!-- <view class="selected" v-if="specList != ''">
@@ -52,10 +55,10 @@
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="attr-list" v-if="showDrop">
 				<view class="attr-list" v-if="showDrop">
-					<text>选择是否上门安装</text>
+					<!-- <text>选择是否上门安装</text> -->
 					<view class="item-list">
 					<view class="item-list">
-						<text :class="{ selected: is_drop}" @click="dropClick(1)">是</text>
-						<text :class="{ selected: !is_drop}" @click="dropClick(0)">否</text>
+						<text class="selected">上门安装</text>
+						<!-- <text :class="{ selected: !is_drop }" @click="dropClick(0)">否</text> -->
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="mun-box">
 				<view class="mun-box">
@@ -64,16 +67,16 @@
 						<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
 						<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
 					</view>
 					</view>
 				</view>
 				</view>
-				
 				<button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
 				<button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
 				<button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
 				<button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
 			</view>
 			</view>
 		</view>
 		</view>
+		<view class="mask" v-if="show"><image @click="onTap" src="../../static/img/shareimg.png"></image></view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
+import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
 import { goodsDetail, cartAdd, seckillGoods } from '@/api/product.js';
 import { goodsDetail, cartAdd, seckillGoods } from '@/api/product.js';
 import { mapState } from 'vuex';
 import { mapState } from 'vuex';
 import store from '@/store/index.js';
 import store from '@/store/index.js';
@@ -98,7 +101,7 @@ import guessLike from './common/guessLike.vue';
 // 评价
 // 评价
 import estimate from './common/estimate.vue';
 import estimate from './common/estimate.vue';
 //增减数量
 //增减数量
-import uniNumberBox from '@/components/uni-number-box.vue'
+import uniNumberBox from '@/components/uni-number-box.vue';
 export default {
 export default {
 	components: {
 	components: {
 		guessLike,
 		guessLike,
@@ -113,6 +116,7 @@ export default {
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {
+			show: false,
 			showAdd: true,
 			showAdd: true,
 			isShare: false,
 			isShare: false,
 			goodsStore: 0, //选中库存
 			goodsStore: 0, //选中库存
@@ -164,8 +168,8 @@ export default {
 				s: '' //秒
 				s: '' //秒
 			},
 			},
 			userInfo: '',
 			userInfo: '',
-			is_drop: false ,//是否上门安装
-			showDrop: false,//商品是否具有安装属性
+			is_drop: false, //是否上门安装
+			showDrop: false //商品是否具有安装属性
 		};
 		};
 	},
 	},
 	filters: {
 	filters: {
@@ -236,19 +240,19 @@ export default {
 	methods: {
 	methods: {
 		//选择是否上门安装
 		//选择是否上门安装
 		dropClick(val) {
 		dropClick(val) {
-			if(val == 1) {
-				this.is_drop = true
-			}else {
-				this.is_drop = false
+			if (val == 1) {
+				this.is_drop = true;
+			} else {
+				this.is_drop = false;
 			}
 			}
 		},
 		},
 		//选择数量
 		//选择数量
 		numberChange(e) {
 		numberChange(e) {
-			console.log(e)
-			this.goodsNumber = e.number
+			console.log(e);
+			this.goodsNumber = e.number;
 		},
 		},
 		close() {
 		close() {
-			this.specClass = 'none'
+			this.specClass = 'none';
 		},
 		},
 		//选择规格
 		//选择规格
 		selectSpec(item, arr, ind) {
 		selectSpec(item, arr, ind) {
@@ -345,13 +349,14 @@ export default {
 			if (obj.goodsType == 0) {
 			if (obj.goodsType == 0) {
 				goodsDetail({}, this.goodsid).then(function({ data }) {
 				goodsDetail({}, this.goodsid).then(function({ data }) {
 					obj.list = data;
 					obj.list = data;
-					console.log(obj.list,'普通商品数据')
+					console.log(obj.list, '普通商品数据');
 					obj.good_list = data.good_list; //保存猜你喜欢列表
 					obj.good_list = data.good_list; //保存猜你喜欢列表
 					obj.reply = data.reply; //保存评论列表
 					obj.reply = data.reply; //保存评论列表
 					let goods = data.storeInfo;
 					let goods = data.storeInfo;
-					if(goods.is_drop == 1) {
-						obj.showAdd = false
-						obj.showDrop = true
+					if (goods.is_drop == 1) {
+						obj.showAdd = false;
+						obj.showDrop = true;
+						obj.is_drop = true
 					}
 					}
 					obj.goodsObjact = goods;
 					obj.goodsObjact = goods;
 					if (obj.goodsObjact.description != null) {
 					if (obj.goodsObjact.description != null) {
@@ -390,14 +395,14 @@ export default {
 			}
 			}
 			// 获取秒杀商品信息
 			// 获取秒杀商品信息
 			if (obj.goodsType == 1) {
 			if (obj.goodsType == 1) {
-				obj.showAdd = false
+				obj.showAdd = false;
 				seckillGoods({}, this.goodsid).then(function({ data }) {
 				seckillGoods({}, this.goodsid).then(function({ data }) {
 					obj.list = data;
 					obj.list = data;
 					console.log(obj.list, '秒杀商品数据++++++++++');
 					console.log(obj.list, '秒杀商品数据++++++++++');
 					obj.reply = data.reply; //保存评论列表
 					obj.reply = data.reply; //保存评论列表
 					let goods = data.storeInfo;
 					let goods = data.storeInfo;
-					if(goods.is_drop == 1) {
-						obj.showDrop = true
+					if (goods.is_drop == 1) {
+						obj.showDrop = true;
 					}
 					}
 					obj.goodsNumberMax = goods.num;
 					obj.goodsNumberMax = goods.num;
 					console.log(obj.seckillObj, '数据');
 					console.log(obj.seckillObj, '数据');
@@ -450,7 +455,7 @@ export default {
 				new: 1,
 				new: 1,
 				productId: obj.goodsid, //商品编号
 				productId: obj.goodsid, //商品编号
 				uniqueId: obj.uniqueId,
 				uniqueId: obj.uniqueId,
-				is_drop: obj.is_drop ? 1: 0,
+				is_drop: obj.is_drop ? 1 : 0
 			};
 			};
 
 
 			if (obj.type == 2) {
 			if (obj.type == 2) {
@@ -461,8 +466,8 @@ export default {
 					let da = e.data;
 					let da = e.data;
 					if (obj.type == 1) {
 					if (obj.type == 1) {
 						// 跳转到支付页
 						// 跳转到支付页
-						let a =  obj.is_drop ? 1: 0
-						console.log(a)
+						let a = obj.is_drop ? 1 : 0;
+						console.log(a);
 						uni.navigateTo({
 						uni.navigateTo({
 							url: '/pages/order/createOrder?id=' + da.cartId + '&isdrop=' + a
 							url: '/pages/order/createOrder?id=' + da.cartId + '&isdrop=' + a
 						});
 						});
@@ -483,7 +488,20 @@ export default {
 				});
 				});
 		},
 		},
 		// 阻止触发上级事件
 		// 阻止触发上级事件
-		stopPrevent() {}
+		stopPrevent() {},
+		callf() {
+			console.log('dianj');
+			this.show = true;
+		},
+		onTap() {
+			console.log(this.callf);
+
+			if (!this.callf) return;
+			this.closess();
+		},
+		closess() {
+			this.show = false;
+		}
 	}
 	}
 };
 };
 </script>
 </script>
@@ -632,7 +650,7 @@ export default {
 				font-size: 60rpx;
 				font-size: 60rpx;
 				font-family: PingFang SC;
 				font-family: PingFang SC;
 				font-weight: bold;
 				font-weight: bold;
-				color: #EF041F;
+				color: #ef041f;
 				text {
 				text {
 					font-size: 30rpx;
 					font-size: 30rpx;
 				}
 				}
@@ -650,7 +668,7 @@ export default {
 				font-size: 30rpx;
 				font-size: 30rpx;
 				font-family: PingFang SC;
 				font-family: PingFang SC;
 				font-weight: bold;
 				font-weight: bold;
-				color: #1D2023;
+				color: #1d2023;
 			}
 			}
 
 
 			.selected-text {
 			.selected-text {
@@ -786,4 +804,18 @@ page {
 		}
 		}
 	}
 	}
 }
 }
+.mask {
+	position: fixed;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 100%;
+	z-index: 999;
+	background-color: rgba(0, 0, 0, 0.4);
+	image {
+		width: 100%;
+		height: 100%;
+		opacity: 0.8;
+	}
+}
 </style>
 </style>

+ 2 - 1
pages/public/login.vue

@@ -195,7 +195,8 @@ export default {
 			})
 			})
 				.then(function(e) {
 				.then(function(e) {
 					uni.setStorageSync('token', e.data.token);
 					uni.setStorageSync('token', e.data.token);
-					obj.$store.commit('hasLogin', true);
+					// obj.$store.commit('hasLogin', true);
+					obj.login()
 					getUserInfo({}).then(e => {
 					getUserInfo({}).then(e => {
 						obj.login();
 						obj.login();
 						// 保存返回用户数据
 						// 保存返回用户数据

+ 1 - 1
pages/public/register.vue

@@ -17,7 +17,7 @@
 				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
 				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
 				<view class="login_name"><input class="uni-input" type="password" v-model="repassword" focus placeholder="请重复输入密码" /></view>
 				<view class="login_name"><input class="uni-input" type="password" v-model="repassword" focus placeholder="请重复输入密码" /></view>
 			</view>
 			</view>
-			<view class="login_input flex" style="display: none;">
+			<view class="login_input flex" >
 				<view class="login_img"><image src="/static/icon/img07.png"></image></view>
 				<view class="login_img"><image src="/static/icon/img07.png"></image></view>
 				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入邀请码" /></view>
 				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入邀请码" /></view>
 			</view>
 			</view>

+ 9 - 3
pages/set/addressManage.vue

@@ -15,7 +15,7 @@
 				<view v-else class="font-color-gray">请选择省市区</view>
 				<view v-else class="font-color-gray">请选择省市区</view>
 			</picker>
 			</picker>
 		</view>
 		</view>
-		<view class="row b-b">
+		<view class="row b-b" v-if="showl">
 			<text class="tit">村镇</text>
 			<text class="tit">村镇</text>
 			<picker mode="multiSelector" :range="cityJs" range-key="name" :value="addressIndexCity" @columnchange="onCityChange" @change="changeCity">
 			<picker mode="multiSelector" :range="cityJs" range-key="name" :value="addressIndexCity" @columnchange="onCityChange" @change="changeCity">
 				<view v-if="addressDetailCity">{{ addressDetailCity }}</view>
 				<view v-if="addressDetailCity">{{ addressDetailCity }}</view>
@@ -55,7 +55,8 @@ export default {
 		uniPopup
 		uniPopup
 	},
 	},
 	data() {
 	data() {
-		return {
+		return {
+			showl: false,//设置是否隐藏村镇选择
 			addressIndex: [0, 0, 0], //当前选中的省市区
 			addressIndex: [0, 0, 0], //当前选中的省市区
 			addressIndexCity: [0, 0], //当前选中的村镇
 			addressIndexCity: [0, 0], //当前选中的村镇
 			addressDetail: '', //省市区名称
 			addressDetail: '', //省市区名称
@@ -178,7 +179,12 @@ export default {
 			getAddressCity({}, id)
 			getAddressCity({}, id)
 				.then(e => {
 				.then(e => {
 					uni.hideLoading();
 					uni.hideLoading();
-					this.setCity(e.data);
+					this.setCity(e.data);
+					if(e.data.length > 0) {
+						this.showl = true
+					}else {
+						this.showl = false
+					}
 					if (!this.loadCityp) {
 					if (!this.loadCityp) {
 						this.loadCityp = true;
 						this.loadCityp = true;
 						this.changeCity();
 						this.changeCity();

+ 165 - 170
pages/store/storeDetail.vue

@@ -4,206 +4,201 @@
 			<view class="top">
 			<view class="top">
 				<image :src="store.image" mode="" class="store-img"></image>
 				<image :src="store.image" mode="" class="store-img"></image>
 				<view class="right">
 				<view class="right">
-					<view class="store-name clamp">
-						{{store.name}}
-					</view>
-					<view class="store-content clamp2">
-						{{store.introduction}}
-					</view>
+					<view class="store-name clamp">{{ store.name }}</view>
+					<view class="store-content clamp2">{{ store.introduction }}</view>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="jg"></view>
 			<view class="jg"></view>
 			<view class="store-info">
 			<view class="store-info">
-				<view class="title">
-					门店地址/营业时间
-				</view>
+				<view class="title">门店地址/营业时间</view>
 				<view class="info-box">
 				<view class="info-box">
 					<view class="item">
 					<view class="item">
 						<image src="../../static/icon/adress.png" mode="" class="item-img"></image>
 						<image src="../../static/icon/adress.png" mode="" class="item-img"></image>
-						<view class="item-msg">
-							{{store.detailed_address}}
-						</view>
+						<view class="item-msg">{{ store.detailed_address }}</view>
 					</view>
 					</view>
 					<view class="item">
 					<view class="item">
 						<image src="../../static/icon/daytime.png" mode="" class="item-img"></image>
 						<image src="../../static/icon/daytime.png" mode="" class="item-img"></image>
-						<view class="item-msg">
-							营业时间{{store.day_time}}
-						</view>
+						<view class="item-msg">营业时间{{ store.day_time }}</view>
 					</view>
 					</view>
 					<view class="item">
 					<view class="item">
 						<image src="../../static/icon/phone.png" mode="" class="item-img"></image>
 						<image src="../../static/icon/phone.png" mode="" class="item-img"></image>
-						<view class="item-msg">
-							{{store.phone}}
-						</view>
+						<view class="item-msg">{{ store.phone }}</view>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			
 		</template>
 		</template>
 		<empty v-if="!store && loaded"></empty>
 		<empty v-if="!store && loaded"></empty>
-		<view class="edit-btn" @click="eidt()" v-if="store && loaded">
-			编辑信息
-		</view>
-	</view>
-</template>
-
+		<view class="edit-btn" @click="eidt()" v-if="store && loaded">编辑信息</view>
+		<view class="edit-btn" @click="add()" v-if="!store && loaded">添加门店</view>
+	</view>
+</template>
+
 <script>
 <script>
-	import empty from '@/components/empty';
-	import { getStoreInfo } from '@/api/index.js';
-	import { orderData, getUserInfo, getMyStore } from '@/api/user.js';
-	export default {
-		components: {
-			empty
+import empty from '@/components/empty';
+import { getStoreInfo } from '@/api/index.js';
+import { orderData, getUserInfo, getMyStore } from '@/api/user.js';
+export default {
+	components: {
+		empty
+	},
+	data() {
+		return {
+			canEdit: false,
+			store: '',
+			loaded: false
+		};
+	},
+	onLoad(opt) {
+		if (opt.id) {
+			this.store_id = opt.id;
+			this.getStoreInfo();
+		} else {
+			this.getMyStore();
+		}
+	},
+	methods: {
+		navTo(url) {
+			uni.navigateTo({
+				url: url
+			});
 		},
 		},
-		data() {
-			return {
-				canEdit: false,
-				store: '',
-				loaded: false
-			}
+		getStoreInfo() {
+			uni.showLoading({
+				title: '加载中...',
+				mask: true
+			});
+			getStoreInfo({
+				id: this.store_id
+			})
+				.then(({ data }) => {
+					uni.hideLoading();
+					this.store = data;
+				})
+				.catch(err => {
+					console.log(err);
+				});
 		},
 		},
-		onLoad(opt) {
-			if(opt.id) {
-				this.store_id = opt.id
-				this.getStoreInfo()
-			}else {
-				this.getMyStore()
-				
-			}
-			
+		getMyStore() {
+			getMyStore().then(({ data }) => {
+				if (data.length == 0) {
+					this.loaded = true;
+				} else {
+					this.store = data[0];
+					this.loaded = true;
+				}
+			});
 		},
 		},
-		methods: {
-			navTo(url) {
-				uni.navigateTo({
-					url: url
-				})
-			},
-			getStoreInfo() {
-				uni.showLoading({
-					title: '加载中...',
-					mask: true
-				})
-				getStoreInfo({
-					id: this.store_id
-				}).then(({data}) => {
-					uni.hideLoading()
-					this.store = data
-				}).catch( err => {
-					console.log(err)
-				})
-			},
-			getMyStore() {
-				getMyStore().then( ({data}) => {
-					if(data.length==0) {
-						this.loaded = true
-					}else {
-						this.store = data[0]
-						this.loaded = true
-					}
-				})
-			},
-			eidt() {
-				let str = JSON.stringify(this.store)
-				console.log(str)
-				uni.navigateTo({
-					url: '/pages/store/storeMessage?type=edit&item='+str
-				})
-			}	
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	page {
-		height: 100%;
-		background-color: #fff;
-	}
-	.top {
-		height: 198rpx;
-		display: flex;
-		padding: 30rpx 25rpx 36rpx;
-		.store-img {
-			width: 132rpx;
-			height: 132rpx;
-			
-			flex-shrink: 0;
-		}
-		.right {
-			padding-left: 20rpx;
-			.store-name {
-				padding: 5rpx 0;
-				font-size: 36rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #333333;
-			}
-			.store-title {
-				font-size: 20rpx;
-				font-family: PingFang SC;
-				font-weight: 400;
-				color: #999999;
-				line-height: 25rpx;
-			}
+		eidt() {
+			let str = JSON.stringify(this.store);
+			console.log(str);
+			uni.navigateTo({
+				url: '/pages/store/storeMessage?type=edit&item=' + str
+			});
+		},
+		add() {
+			uni.navigateTo({
+				url: '/pages/store/storeMessage?type=add'
+			});
+		},
+		//添加或修改成功之后回调
+		refreshList() {
+			// 重新加载地址
+			this.getMyStore();
 		}
 		}
-		
 	}
 	}
-	.jg {
-		height: 20rpx;
-		background-color: #f8f6f6;
+};
+</script>
+
+<style lang="scss" scoped>
+page {
+	height: 100%;
+	background-color: #fff;
+}
+.top {
+	height: 198rpx;
+	display: flex;
+	padding: 30rpx 25rpx 36rpx;
+	.store-img {
+		width: 132rpx;
+		height: 132rpx;
+
+		flex-shrink: 0;
 	}
 	}
-	.store-info {
-		padding: 28rpx 30rpx 0;
-		height: 100%;
-		.title {
-			font-size: 32rpx;
+	.right {
+		padding-left: 20rpx;
+		.store-name {
+			padding: 5rpx 0;
+			font-size: 36rpx;
 			font-family: PingFang SC;
 			font-family: PingFang SC;
-			font-weight: 500;
+			font-weight: bold;
 			color: #333333;
 			color: #333333;
-			line-height: 55rpx;
 		}
 		}
-		.info-box {
-			margin-top: 30rpx;
-			width: 690rpx;
-			min-height: 301rpx;
-			border: 2px solid #DDDDDD;
-			border-radius: 10rpx;
-			padding: 40rpx 40rpx 0rpx;
-			.item {
-				display: flex;
-				padding-bottom: 40rpx;
-				image {
-					margin-top: 6rpx;
-					margin-right: 20rpx;
-					height: 28rpx;
-					width: 28rpx;
-					
-					flex-shrink: 0;
-				}
-				.item-msg {
-					font-size: 29rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #333333;
-					line-height: 40rpx;
-				}
-			}
+		.store-title {
+			font-size: 20rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #999999;
+			line-height: 25rpx;
 		}
 		}
 	}
 	}
-	.edit-btn {
-		position: fixed;
-		bottom: 34rpx;
-		left: 0;
-		right: 0;
-		margin: 0 auto;
-		width: 674rpx;
-		// height: 88rpx;
-		background: #FF4C4C;
-		border-radius: 44rpx;
-		text-align: center;
-		line-height: 88rpx;
-		font-size: 36rpx;
+}
+.jg {
+	height: 20rpx;
+	background-color: #f8f6f6;
+}
+.store-info {
+	padding: 28rpx 30rpx 0;
+	height: 100%;
+	.title {
+		font-size: 32rpx;
 		font-family: PingFang SC;
 		font-family: PingFang SC;
 		font-weight: 500;
 		font-weight: 500;
-		color: #FFFFFF;
-	}
+		color: #333333;
+		line-height: 55rpx;
+	}
+	.info-box {
+		margin-top: 30rpx;
+		width: 690rpx;
+		min-height: 301rpx;
+		border: 2px solid #dddddd;
+		border-radius: 10rpx;
+		padding: 40rpx 40rpx 0rpx;
+		.item {
+			display: flex;
+			padding-bottom: 40rpx;
+			image {
+				margin-top: 6rpx;
+				margin-right: 20rpx;
+				height: 28rpx;
+				width: 28rpx;
+
+				flex-shrink: 0;
+			}
+			.item-msg {
+				font-size: 29rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #333333;
+				line-height: 40rpx;
+			}
+		}
+	}
+}
+.edit-btn {
+	position: fixed;
+	bottom: 34rpx;
+	left: 0;
+	right: 0;
+	margin: 0 auto;
+	width: 674rpx;
+	// height: 88rpx;
+	background: #ff4c4c;
+	border-radius: 44rpx;
+	text-align: center;
+	line-height: 88rpx;
+	font-size: 36rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #ffffff;
+}
 </style>
 </style>

+ 309 - 196
pages/store/storeMessage.vue

@@ -1,211 +1,324 @@
-<template>
-	<view class="content">
-		<view class="item">
-			<view class="item-tit">
-				店铺名称
-			</view>
-			<input type="text" v-model="store.name"/>
-		</view>
-		<view class="item">
-			<view class="item-tit">
-				商家电话
-			</view>
-			<input type="number" v-model="store.phone"/>
-		</view>
-		<view class="item">
-			<view class="item-tit">
-				商家地址
-			</view>
-			<input type="text" v-model="store.detailed_address"/>
-		</view>
-		<view class="item">
-			<view class="item-tit">
-				营业时间
-			</view>
-			<input type="text" v-model="store.day_time"/>
-		</view>
-		<view class="item">
-			<view class="item-tit">
-				商户简介
-			</view>
-			<textarea v-model="store.introduction" placeholder="" />
-		</view>
-		<view class="item">
-			<view class="item-tit">
-				门户头像
-			</view>
-			<view class="up-wrapper">
-				<image :src="store.image" mode="" v-if="store.image" @click.stop="upImg"></image>
-				<image src="../../static/img/add.png" mode="" v-else  @click.stop="upImg"></image>
-			</view>
-		</view>
-		<view class="sub" @click="sub">
-			确认修改
+<template>
+	<view class="content">
+		<view class="item">
+			<view class="item-tit">店铺名称</view>
+			<input type="text" v-model="store.name" placeholder="请输入店铺名称" />
+		</view>
+		<view class="item">
+			<view class="item-tit">商家电话</view>
+			<input type="number" v-model="store.phone" placeholder="请输入商家电话" />
+		</view>
+		<view class="item" @click="getLocation">
+			<view class="item-tit">经纬度</view>
+			<input type="text" v-model="store.latlng" placeholder="请选择经纬度" />
 		</view>
 		</view>
+		<view class="item" >
+			<view class="item-tit">详细地址</view>
+			<input type="text" v-model="store.detailed_address" placeholder="请输入详细地址" />
+		</view>
+		<view class="item">
+			<view class="item-tit">营业时间</view>
+			<picker mode="time" :value="bgtime"  @change="bindBgtimeChange" class="picker">
+				<view class="uni-input">{{ bgtime }}</view>
+			</picker>
+			<view class="line">至</view>
+			<picker mode="time" :value="edtime"  @change="bindEdtimeChange" class="picker prcker-t">
+				<view class="uni-input">{{ edtime }}</view>
+			</picker>
+		</view>
+		<view class="item">
+			<view class="item-tit">商户简介</view>
+			<textarea v-model="store.introduction" placeholder="请输入商家简介" />
+		</view>
+		<view class="item">
+			<view class="item-tit">门户头像</view>
+			<view class="up-wrapper">
+				<image :src="store.image" mode="" v-if="store.image" @click.stop="upImg"></image>
+				<image src="../../static/img/add.png" mode="" v-else @click.stop="upImg"></image>
+			</view>
+		</view>
+		<view class="sub" @click="sub" v-if="type == 'edit'">确认修改</view>
+		<view class="sub" @click="add" v-if="type == 'add'">提交</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
-<script>
-	
-	import {
-			upload,editStore
-		} from '@/api/user.js';
-	export default {
-		data() {
-			return {
-				store: {},
-				// name: '鑫旺零售台州店',
-				// phone: '12345678911',
-				// address: '台州市市府大道110号',
-				// info: '店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介铺简介店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介',
-				// workTime: '8:30-12:00,13:30-17:00',
-				// logo: ''
-			}
-		},
-		onLoad(opt) {
-			this.store = JSON.parse(opt.item)
-			console.log(this.store,'this.store++++++++++++')
+<script>
+import { upload, editStore } from '@/api/user.js';
+export default {
+	data() {
+		return {
+			store: {
+				name: '',
+				phone: '',
+				id: '',
+				introduction: '',
+				image: '',
+				id: '',
+				detailed_address: '',
+				day_time: '',
+				latlng: '20,150'
+			},
+			bgtime: '',
+			edtime: '',
+			detailed_address: '',
+			type: 'edit',
+		};
+	},
+	onLoad(opt) {
+		if(opt.type == 'edit') {
+			this.store = JSON.parse(opt.item);
+			console.log(this.store, 'this.store++++++++++++');
+			let time = this.store.day_time.split(' - ');
+			this.bgtime = time[0].substring(0, 5);
+			this.edtime = time[1].substring(0, 5);
+		}
+		if(opt.type == 'add') {
+			this.type = 'add'
+			this.bgtime = '00:00'
+			this.edtime = '00:00'
+		}
+		
+	},
+	methods: {
+		// 选择当前位置
+		getLocation() {
+			console.log('选择当前位置');
+			let obj = this;
+			uni.chooseLocation({
+				success: function(res) {
+					obj.addressData.area = res.name;
+					console.log('位置名称:' + res.name);
+					console.log('详细地址:' + res.address);
+					console.log('纬度:' + res.latitude);
+					console.log('经度:' + res.longitude);
+					// obj.addressData.latitude = res.latitude;
+					// obj.addressData.longitude = res.longitude;
+					obj.latlng = res.latitude + ',' + res.longitude
+				}
+			});
+		},
+		bindBgtimeChange(e) {
+			console.log(e);
+			this.bgtime = e.detail.value;
+		},
+		bindEdtimeChange(e) {
+			console.log(e);
+			this.edtime = e.detail.value;
+		},
+		indicatorStyle() {},
+		// 修改logo
+		upImg() {
+			let obj = this;
+			upload({
+				filename: ''
+			}).then(res => {
+				console.log(res[0].url);
+				obj.store.image = res[0].url;
+			});
+		},
+		//提交
+		sub() {
+			let obj = this;
+			let store = obj.store;
+			if (store.name == '') {
+				obj.$api.msg('请输入店铺名称');
+				return;
+			}
+			if (store.phone == '') {
+				obj.$api.msg('请输入店铺电话');
+				return;
+			}
+			if (store.image == '') {
+				obj.$api.msg('请选择店铺头像');
+				return;
+			}
+			if (store.day_time == '') {
+				obj.$api.msg('请输入营业时间');
+				return;
+			}
+			if (store.introduction == '') {
+				obj.$api.msg('请输入店铺简介');
+				return;
+			}
+			if (store.detailed_address == '') {
+				obj.$api.msg('请输入店铺地址');
+				return;
+			}
+			uni.showLoading({
+				title: '提交中...',
+				mask: true
+			});
+			let day_time = obj.bgtime + ':00 - ' + obj.edtime + ':00';
+			editStore({
+				id: store.id,
+				name: store.name,
+				introduction: store.introduction,
+				image: store.image,
+				phone: store.phone,
+				day_time: day_time,
+				latlng: store.latitude + ',' + store.longitude,
+				// is_show: 0
+			})
+				.then(res => {
+					uni.hideLoading();
+					uni.showToast({
+						title: '提交成功',
+						duration: 2000
+					});
+					obj.$api.prePage().refreshList();
+					setTimeout(function() {
+						uni.navigateBack();
+					}, 800);
+				})
+				.catch(err => {
+					uni.hideLoading();
+					console.log(err);
+				});
 		},
 		},
-		methods:{
-			// 修改logo
-			upImg() {
-				let obj = this
-				upload({
-					filename: ''
-				}).then(res => {
-					console.log(res[0].url)
-					obj.store.image= res[0].url
-				});
-			},
-			//提交
-			sub() {
-				let obj = this
-				let store = obj.store
-				if(store.name == '') {
-					obj.$api.msg('请输入店铺名称')
-					return 
-				}
-				if(store.phone == '') {
-					obj.$api.msg('请输入店铺电话')
-					return 
-				}
-				if(store.image == '') {
-					obj.$api.msg('请选择店铺头像')
-					return 
-				}
-				if(store.day_time == '') {
-					obj.$api.msg('请输入营业时间')
-					return 
-				}
-				if(store.introduction == '') {
-					obj.$api.msg('请输入店铺简介')
-					return 
-				}
-				if(store.detailed_address == '') {
-					obj.$api.msg('请输入店铺地址')
-					return 
-				}
-				uni.showLoading({
-					title: '提交中...',
-					mask: true
-				})
-				editStore({
-					name: store.name,
-					introduction: store.introduction,
-					image: store.image,
-					phone: store.phone,
-					day_time: store.day_time
-				}).then( res => {
-					uni.hideLoading()
+		add() {
+			let obj = this;
+			let store = obj.store;
+			if (store.name == '') {
+				obj.$api.msg('请输入店铺名称');
+				return;
+			}
+			if (store.phone == '') {
+				obj.$api.msg('请输入店铺电话');
+				return;
+			}
+			if (store.image == '') {
+				obj.$api.msg('请选择店铺头像');
+				return;
+			}
+			// if (store.day_time == '') {
+			// 	obj.$api.msg('请输入营业时间');
+			// 	return;
+			// }
+			if (store.introduction == '') {
+				obj.$api.msg('请输入店铺简介');
+				return;
+			}
+			if (store.detailed_address == '') {
+				obj.$api.msg('请输入店铺地址');
+				return;
+			}
+			let day_time = obj.bgtime + ':00 - ' + obj.edtime + ':00';
+			editStore({
+				id: 0,
+				name: store.name,
+				introduction: store.introduction,
+				image: store.image,
+				phone: store.phone,
+				day_time: day_time,
+				latlng: store.latlng,
+				detailed_address: store.detailed_address,
+				is_show: 0
+			})
+				.then(res => {
+					uni.hideLoading();
 					uni.showToast({
 					uni.showToast({
 						title: '提交成功',
 						title: '提交成功',
 						duration: 2000
 						duration: 2000
 					});
 					});
-					setTimeout(()=> {
-						uni.navigateBack({})
-					},2000)
-				}).catch( err => {
-					uni.hideLoading()
-					console.log(err)
+					// obj.$api.prePage().refreshList();
+					setTimeout(function() {
+						uni.navigateBack();
+					}, 800);
 				})
 				})
-			}
-			
-		}
+				.catch(err => {
+					uni.hideLoading();
+					console.log(err);
+				});
+		}
 	}
 	}
+};
 </script>
 </script>
 
 
-<style lang="scss" scoped>
-	page {
-		height: 100%;
-		background-color: #f8f6f6;
-	}
-	.item {
-		background-color: #fff !important;
-		min-height: 100rpx;
-		display: flex;
-		width: 750px;
-		border: 1px  #F4F4F4 solid;
-		.item-tit {
-			height: 100rpx;
-			line-height: 100rpx;
-			padding-left: 30rpx;
-			width: 200rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #666666;
-			flex-shrink: 0;
-		}
-		input {
-			width: 550rpx;
-			height: 100rpx;
-			line-height: 100rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #333333;
-		}
-		textarea {
-			width: 550rpx;
-			height: 257rpx;
-			padding-top: 45rpx;
-			padding-right: 30rpx;
-			line-height: 50rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #333333;
-		}
-		.up-wrapper {
-			height: 352rpx;
-			width: 550rpx;
-			position: relative;
-			image {
-				position: absolute;
-				height: 160rpx;
-				width: 160rpx;
-				top: 0;
-				bottom: 0;
-				left: 94rpx;
-				margin: auto;
-			}
-		}
-	}
-	.sub {
-		width: 674rpx;
-		height: 88rpx;
-		background: #FF4C4C;
-		border-radius: 44rpx;
-		line-height: 88rpx;
-		text-align: center;
-		font-size: 36rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #FFFFFF;
-		position: absolute;
-		bottom: 35rpx;
-		left: 0;
-		right: 0;
-		margin: auto;
+<style lang="scss" scoped>
+page {
+	height: 100%;
+	background-color: #f8f6f6;
+}
+.item {
+	background-color: #fff !important;
+	min-height: 100rpx;
+	display: flex;
+	width: 750px;
+	border: 1px #f4f4f4 solid;
+	.line {
+		display: inline-block;
+		line-height: 100rpx;
+	}
+	.item-tit {
+		height: 100rpx;
+		line-height: 100rpx;
+		padding-left: 30rpx;
+		width: 200rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #666666;
+		flex-shrink: 0;
+	}
+	input {
+		width: 550rpx;
+		height: 100rpx;
+		line-height: 100rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #333333;
+	}
+	textarea {
+		width: 550rpx;
+		height: 257rpx;
+		padding-top: 25rpx;
+		padding-right: 30rpx;
+		line-height: 50rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #333333;
+	}
+	.up-wrapper {
+		height: 352rpx;
+		width: 550rpx;
+		position: relative;
+		image {
+			position: absolute;
+			height: 160rpx;
+			width: 160rpx;
+			top: 0;
+			bottom: 0;
+			left: 94rpx;
+			margin: auto;
+		}
 	}
 	}
+}
+.sub {
+	width: 674rpx;
+	height: 88rpx;
+	background: #ff4c4c;
+	border-radius: 44rpx;
+	line-height: 88rpx;
+	text-align: center;
+	font-size: 36rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #ffffff;
+	position: absolute;
+	bottom: 35rpx;
+	left: 0;
+	right: 0;
+	margin: auto;
+}
+.picker {
+	display: inline-block;
+	padding-right: 40rpx;
+	height: 100rpx;
+	line-height: 100rpx;
+}
+.prcker-t {
+	padding-left: 40rpx;
+}
 </style>
 </style>

+ 299 - 275
pages/user/award.vue

@@ -1,208 +1,227 @@
-<template>
-	<view class="content">
-		<view class="content-money">
+<template>
+	<view class="content">
+		<view class="content-money">
 			<view class="money-box">
 			<view class="money-box">
-				<image src="../../static/img/qbbg.png" mode=""></image>
-				<view class="money"><text>¥</text>{{ money | getMoneyStyle }}</view>	
-			</view>
-		</view>
-		<view class="navbar">
-			<view v-for="(item,index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index}" @click="tabClick(index)">{{ item.text }}</view>
-		</view>
-		<swiper :current="tabCurrentIndex" :style="{'height':maxheight+'px'}" class="swiper-box" duration="300" @change="changeTab">
-			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
-				<scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
-					<!-- 空白页 -->
-					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
-					<!-- 订单列表 -->
-					<view class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index">
-						<view class="title-box">
-							<view class="title">
-								<text>{{ item.title }}</text>
-							</view>
-							<view class="time">
-								<text>{{ item.add_time }}</text>
-							</view>
-						</view>
-						<view class="money">
-							<text>{{ (item.pm == 0 ? '-' : '+') + item.number }}</text>
-						</view>
-					</view>
-					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
-				</scroll-view>
-			</swiper-item>
+				<image src="../../static/img/qbbg.png" mode=""></image>
+				<view class="money">
+					<text>¥</text>
+					{{ money | getMoneyStyle }}
+				</view>
+			</view>
+		</view>
+		<view class="navbar">
+			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
+		</view>
+		<swiper :current="tabCurrentIndex" :style="{ height: maxheight + 'px' }" class="swiper-box" duration="300" @change="changeTab">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
+					<!-- 空白页 -->
+					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+					<!-- 订单列表 -->
+					<view class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index" @click="showItem(item)">
+						<view class="title-box">
+							<view class="title">
+								<text>{{ item.title }}</text>
+							</view>
+							<view class="time">
+								<text>{{ item.add_time }}</text>
+							</view>
+						</view>
+						<view class="money">
+							<text>{{ (item.pm == 0 ? '-' : '+') + item.number }}</text>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
 		</swiper>
 		</swiper>
-		<view class="moneyTx" @click="navto('./withdrawal')">提现</view>
-	</view>
-</template>
-
-<script>
-import { spreadCommission, userBalance } from '@/api/wallet.js';
-import { mapState, mapMutations } from 'vuex';
-import { getMoneyStyle } from '@/utils/rocessor.js';
-import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-import empty from '@/components/empty';
-export default {
-	filters: {
-		getMoneyStyle
-	},
-	components: {
-		empty,
-		uniLoadMore
-	},
-	onReady() {
-		//初始化获取页面宽度
-		uni.createSelectorQuery().select('.content')
-			.fields(
-			{
-				size:true
-			},
-			data => {
-				console.log(data);
-				console.log(Math.floor((data.width /750) * 300));
-				//保存头部高度
-				this.maxheight =data.height - Math.floor((data.width / 750) * 570);
-				console.log(this.maxheight);
-				}
-			)
-			.exec();
-	},
-	data() {
-		return {
-			// 头部图高度
-			maxheight:'',
-			tabCurrentIndex: 0,
-			navList: [
-				{
-					state: 0,
-					text: '收入',
-					loadingType: 'more',
-					orderList: [],
-					page: 1, //当前页面
-					limit: 10 //每次信息条数
-				},
-				{
-					state: 1,
-					text: '支出',
-					loadingType: 'more',
-					orderList: [],
-					page: 1, //当前页面
-					limit: 10 //每次信息条数
-				},
-			],
-			money: ''
-		};
-	},
-	onLoad(options) {},
-	onShow() {
-		this.loadData();
-		//获取用户余额
-		userBalance({}).then(({ data }) => {
-			this.money = data.commissionCount;
-		});
-	},
-	methods: {
-		navto(e) {
-			uni.navigateTo({
-				url: e
-			});
-		},
-		async loadData(source) {
-			//这里时将订单挂载到tab列表下
-			let index = this.tabCurrentIndex;
-			let navItem = this.navList[index];
-			let state = navItem.state+3;
-			if (source === 'tabChange' && navItem.loaded === true) {
-				//tab切换只有第一次需要加载数据
-				return;
-			}
-			if (navItem.loadingType === 'loading') {
-				//防止重复加载
-				return;
-			}
-			//修改当前对象状态为加载中
-			navItem.loadingType = 'loading';
-			
-			spreadCommission(
-				{
-					page: navItem.page,
-					limit: navItem.limit
-				},
-				state
-			)
-				.then(({ data }) => {
-					if(data.length > 0) {
-						navItem.orderList = navItem.orderList.concat(data[0].list);
-						console.log(navItem.orderList);
-						navItem.page++;
-					}
-					//判断是否还有数据, 有改为more, 没有改为noMore
-					if (navItem.limit == data.length) {
-						navItem.loadingType = 'more';
-						return;
-					} else {
-						navItem.loadingType = 'noMore';
-					}
-					uni.hideLoading();
-					this.$set(navItem, 'loaded', true);
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		},
-		//swiper 切换
-		changeTab(e) {
-			this.tabCurrentIndex = e.target.current;
-			this.loadData('tabChange');
-		},
-		//顶部tab点击
-		tabClick(index) {
-			this.tabCurrentIndex = index;
-		}
-	}
-}
-</script>
-
-<style lang="scss">
-page {
-	background: #ffffff;
-	height: 100%;
-}
-.content-money {
-	padding-bottom: 30rpx;
-	background: $page-color-base;
-	.buttom-box {
-		background-color: #ffffff;
-		text-align: center;
-		margin: 0 30rpx;
-		padding: 20rpx 0;
-		border-radius: $border-radius-sm;
-		margin-top: -60rpx;
-		.buttom {
-			font-size: $font-lg;
-			flex-grow: 1;
-		}
-		.interval {
-			width: 2px;
-			height: 60rpx;
-			background-color: #eeeeee;
-		}
-		.icon {
-			height: 50rpx;
-			width: 48rpx;
-			margin: 0 auto;
-			.icon-img {
-				width: 100%;
-				height: 100%;
-			}
-		}
-	}
-}
+		<view class="moneyTx" ><view class="btn" @click="navto('./withdrawal')">提现</view></view>
+	</view>
+</template>
+
+<script>
+import { getSpreadCount } from '@/api/user.js';
+import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { mapState, mapMutations } from 'vuex';
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	components: {
+		empty,
+		uniLoadMore
+	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	onReady() {
+		//初始化获取页面宽度
+		uni.createSelectorQuery()
+			.select('.content')
+			.fields(
+				{
+					size: true
+				},
+				data => {
+					console.log(data);
+					console.log(Math.floor((data.width / 750) * 300));
+					//保存头部高度
+					this.maxheight = data.height - Math.floor((data.width / 750) * 570);
+					console.log(this.maxheight);
+				}
+			)
+			.exec();
+	},
+	data() {
+		return {
+			// 头部图高度
+			maxheight: '',
+			tabCurrentIndex: 0,
+			navList: [
+				{
+					state: 0,
+					text: '收入',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页面
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 1,
+					text: '支出',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页面
+					limit: 10 //每次信息条数
+				}
+			],
+			money: ''
+		};
+	},
+	onLoad(options) {},
+	onShow() {
+		this.loadData();
+		//获取用户余额
+		getSpreadCount({}, 3).then(({ data }) => {
+			console.log(data);
+			this.money = data.count;
+		});
+		// userBalance({}).then(({ data }) => {
+		// 	this.money = data.orderStatusSum;
+		// });
+	},
+	methods: {
+		navto(e) {
+			uni.navigateTo({
+				url: e
+			});
+		},
+		async loadData(source) {
+			//这里时将订单挂载到tab列表下
+			let index = this.tabCurrentIndex;
+			let navItem = this.navList[index];
+			let state = navItem.state + 3;
+			if (source === 'tabChange' && navItem.loaded === true) {
+				//tab切换只有第一次需要加载数据
+				return;
+			}
+			if (navItem.loadingType === 'loading') {
+				//防止重复加载
+				return;
+			}
+			//修改当前对象状态为加载中
+			navItem.loadingType = 'loading';
+
+			spreadCommission(
+				{
+					page: navItem.page,
+					limit: navItem.limit
+				},
+				state
+			)
+				.then(({ data }) => {
+					if (data.length > 0) {
+						navItem.orderList = navItem.orderList.concat(data[0].list);
+						console.log(navItem.orderList);
+						navItem.page++;
+					}
+					//判断是否还有数据, 有改为more, 没有改为noMore
+					if (navItem.limit == data.length) {
+						navItem.loadingType = 'more';
+						return;
+					} else {
+						navItem.loadingType = 'noMore';
+					}
+					uni.hideLoading();
+					this.$set(navItem, 'loaded', true);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		//swiper 切换
+		changeTab(e) {
+			this.tabCurrentIndex = e.target.current;
+			this.loadData('tabChange');
+		},
+		//顶部tab点击
+		tabClick(index) {
+			this.tabCurrentIndex = index;
+		},
+		showItem(item) {
+			uni.showModal({
+				title: '佣金明细',
+				content: item.mark,
+				showCancel: false
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: #ffffff;
+	height: 100%;
+}
+.content-money {
+	padding-bottom: 30rpx;
+	background: $page-color-base;
+	.buttom-box {
+		background-color: #ffffff;
+		text-align: center;
+		margin: 0 30rpx;
+		padding: 20rpx 0;
+		border-radius: $border-radius-sm;
+		margin-top: -60rpx;
+		.buttom {
+			font-size: $font-lg;
+			flex-grow: 1;
+		}
+		.interval {
+			width: 2px;
+			height: 60rpx;
+			background-color: #eeeeee;
+		}
+		.icon {
+			height: 50rpx;
+			width: 48rpx;
+			margin: 0 auto;
+			.icon-img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+}
 .money-box {
 .money-box {
 	// background-color: $base-color;
 	// background-color: $base-color;
 	// padding-top: var(--status-bar-height);
 	// padding-top: var(--status-bar-height);
 	height: 400rpx;
 	height: 400rpx;
-	color: #FF4C4C;
+	color: #ff4c4c;
 	text-align: center;
 	text-align: center;
 	position: relative;
 	position: relative;
 	image {
 	image {
@@ -223,96 +242,101 @@ page {
 		// margin: auto 0;
 		// margin: auto 0;
 		font-size: 56rpx;
 		font-size: 56rpx;
 		font-weight: bold;
 		font-weight: bold;
-		color: #FF4C4C;
+		color: #ff4c4c;
 		position: relative;
 		position: relative;
 		.money-icon {
 		.money-icon {
 			font-size: 38rpx;
 			font-size: 38rpx;
 			font-weight: bold;
 			font-weight: bold;
-			color: #FF4C4C;
+			color: #ff4c4c;
+		}
+	}
+}
+
+.navbar {
+	display: flex;
+	height: 40px;
+	padding: 0 5px;
+	background: #fff;
+	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
+	position: relative;
+	z-index: 10;
+	.nav-item {
+		flex: 1;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		font-size: 15px;
+		color: $font-color-dark;
+		position: relative;
+		&.current {
+			color: $base-color;
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid $base-color;
+			}
 		}
 		}
 	}
 	}
 }
 }
-
-
-.navbar {
-	display: flex;
-	height: 40px;
-	padding: 0 5px;
-	background: #fff;
-	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
-	position: relative;
-	z-index: 10;
-	.nav-item {
-		flex: 1;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		height: 100%;
-		font-size: 15px;
-		color: $font-color-dark;
-		position: relative;
-		&.current {
-			color: $base-color;
-			&:after {
-				content: '';
-				position: absolute;
-				left: 50%;
-				bottom: 0;
-				transform: translateX(-50%);
-				width: 44px;
-				height: 0;
-				border-bottom: 2px solid $base-color;
-			}
-		}
-	}
-}
-//列表
-
-.swiper-box {
-	padding-top: 10rpx;
-	.order-item {
-		padding: 20rpx 30rpx;
-		line-height: 1.5;
-		.title-box {
-			.title {
-				font-size: $font-lg;
-				color: $font-color-base;
-			}
-			.time {
-				font-size: $font-base;
-				color: $font-color-light;
-			}
-		}
-		.money {
-			color: #fd5b23;
-			font-size: $font-lg;
-		}
-	}
-}
-.list-scroll-content {
-	height: 100%;
-}
-.content {
-	height: 100%;
-	.empty-content {
-		background-color: #ffffff;
-	}
+//列表
+
+.swiper-box {
+	padding-top: 10rpx;
+	.order-item {
+		padding: 20rpx 30rpx;
+		line-height: 1.5;
+		.title-box {
+			.title {
+				font-size: $font-lg;
+				color: $font-color-base;
+			}
+			.time {
+				font-size: $font-base;
+				color: $font-color-light;
+			}
+		}
+		.money {
+			color: #fd5b23;
+			font-size: $font-lg;
+		}
+	}
+}
+.list-scroll-content {
+	height: 100%;
+}
+.content {
+	height: 100%;
+	.empty-content {
+		background-color: #ffffff;
+	}
 }
 }
 .moneyTx {
 .moneyTx {
-	width: 674rpx;
+	width: 750rpx;
 	height: 88rpx;
 	height: 88rpx;
-	line-height: 88rpx;
-	background: #FF4C4C;
-	border-radius: 44rpx;
-	font-size: 36rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #FFFFFF;
+	background-color: #fff;
+	.btn {
+		margin: 0 auto;
+		width: 674rpx;
+		height: 88rpx;
+		line-height: 88rpx;
+		background: #ff4c4c;
+		border-radius: 44rpx;
+		font-size: 36rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #ffffff;
+	}
 	position: fixed;
 	position: fixed;
 	bottom: 51rpx;
 	bottom: 51rpx;
 	right: 0;
 	right: 0;
 	left: 0;
 	left: 0;
 	text-align: center;
 	text-align: center;
 	margin: 0 auto;
 	margin: 0 auto;
-}
+}
 </style>
 </style>

+ 1 - 1
pages/user/extension.vue

@@ -75,7 +75,7 @@
 									<image src="../../static/img/lv04.png" mode="" v-if="item.level == 4"></image>
 									<image src="../../static/img/lv04.png" mode="" v-if="item.level == 4"></image>
  								</view>
  								</view>
  								<view class="time">
  								<view class="time">
- 									<text>{{ item.spread_time }}</text>
+ 									<text>{{ item.time }}</text>
  								</view>
  								</view>
  							</view>
  							</view>
  						</view>
  						</view>

+ 24 - 19
pages/user/minMember.vue

@@ -7,36 +7,28 @@
 			</view>
 			</view>
 		</view>
 		</view>
 		<scroll-view scroll-y="true" :style="{'height': height}" class="list"  @scrolltolower="loadData()">
 		<scroll-view scroll-y="true" :style="{'height': height}" class="list"  @scrolltolower="loadData()">
-			 <empty v-if="list.length == 0" ></empty>
-			<view class="apply-item flex" v-for="item in list">
+			 <empty v-if="loaded && list.length == 0" ></empty>
+			<view class="apply-item flex" v-for="(item,index) in list" :key="index">
 				<view class="item-left flex">
 				<view class="item-left flex">
-					<image src="" mode="" class="item-img"></image>
+					<image :src="item.avatar"> mode="" class="item-img"></image>
 					<view class="item-info flex">
 					<view class="item-info flex">
 						<view class="name flex">
 						<view class="name flex">
 							<view class="">
 							<view class="">
-								假猪套
+								{{ item.nickname }}
 							</view>
 							</view>
-							<image src="../../static/img/lv02.png" mode=""></image>
-							<image src="../../static/img/lv03.png" mode=""></image>
-							<image src="../../static/img/lv04.png" mode=""></image>
+							<image src="../../static/img/lv02.png" mode="" v-if="item.level == 2"></image>
+							<image src="../../static/img/lv03.png" mode="" v-if="item.level == 3"></image>
+							<image src="../../static/img/lv04.png" mode="" v-if="item.level == 4"></image>
 						</view>
 						</view>
 						<view class="phone">
 						<view class="phone">
-							13245678911
+							{{ item.spread_time }}
 						</view>
 						</view>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<uni-load-more :status="loadingType"></uni-load-more>
+			<uni-load-more :status="loadingType" v-if="!loaded"></uni-load-more>
 			<view class="btn-jg"></view>
 			<view class="btn-jg"></view>
 		</scroll-view>
 		</scroll-view>
-		<!-- <view class="btn-jg"></view> -->
-		<!-- <view class="btn-wrapper">
-			<navigator url="./applyList">
-				<view class="btm-btn">
-					申请列表
-				</view>
-			</navigator>
-		</view> -->
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -87,11 +79,24 @@
 				if(obj.loadingType == 'noMore') {
 				if(obj.loadingType == 'noMore') {
 					return 
 					return 
 				}
 				}
+				obj.loadingType = 'loading'
 				getMyTvillage({
 				getMyTvillage({
 					page: obj.page,
 					page: obj.page,
 					limit: obj.limit
 					limit: obj.limit
-				}).then(res => {
-					console.log(res)
+				}).then(({data}) => {
+					obj.allMun = data.count
+					obj.list = obj.list.concat(data.data)
+					obj.page++
+					if(obj.limit == data.data.length){
+						obj.loadingType = 'more'
+						return
+					}else {
+						obj.loadingType = 'noMore'
+					}
+					obj.$set(obj,'loaded',true)
+				}).catch( err => {
+					console.log(err)
+					obj.loaded = true
 				})
 				})
 			}
 			}
 		}
 		}

+ 253 - 281
pages/user/shareQrCode.vue

@@ -1,282 +1,254 @@
-<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="share-bottom flex" :class="{ 'action-share-bottom': !loading }" @click="loading ? showImg() : ''">
-			<text>{{ loading ? '点击生成图片' : '长按二维码下载' }}</text>
-		</view>
-	</view>
-</template>
-
-<script>
-// import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
-import { spreadBanner } from '@/api/user.js';
-export default {
-	// 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: ''//画布宽度
-		};
-	},
-	onLoad() {
-		this.loadCodeList()
-	},
-	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: {
-		loadCodeList() {
-			// 加载二维码信息
-			spreadBanner({
-				// #ifdef H5
-				type: 2,
-				// #endif
-				// #ifdef MP
-				type: 1
-				// #endif
-			}).then(e => {
-				// #ifdef MP
-				// 保存二维码图片
-				uni.downloadFile({
-					url: e.data[0].wap_posterQr,
-					success(res) {
-						if (res.errMsg == 'downloadFile:ok') {
-							obj.src = res.tempFilePath;
-							// 生成画布
-							obj.loadImg(obj.src);
-							uni.hideLoading();
-						}
-						console.log(res);
-					},
-					fail(e) {
-						console.log(e);
-					}
-				})
-				// #endif
-				// #ifdef H5
-					// 保存二维码图片
-					this.src =  e.data[0].wap_posterQr;
-					// 生成画布
-					this.loadImg(e.data[0].wap_posterQr);
-				// #endif
-				
-			}).catch((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;
-						// 保存图片base64
-						obj.ctxSrc = res.tempFilePath;
-					},
-					fail(e) {
-						console.log(e);
-					}
-				});
-			}, 50);
-		},
-		// 开始渲染画布
-		loadImg(src) {
-			const obj = this;
-			const cavWidth=523;//画布宽度
-			const cavHeight=700;//画布高度
-			const ratio = obj.ratio;//获取页面比例
-			const ctxBg = '/static/img/img14.jpg'; //画布背景
-			let context = uni.createCanvasContext('qrShareBox');
-			const codeSize = obj.size * ratio; //计算二维码大小
-			const codeX = ((cavWidth - obj.size) * ratio) / 2; //二维码所在x轴位置
-			const codeY = cavHeight * ratio; //二维码所在y轴位置
-			const codeBoxColor = '#FFFFFF'; //包裹框颜色
-			const codeBoxWidht = 0; //包裹边框宽度
-			const codeBoxSize = (codeBoxWidht / 2) * ratio; //计算二维码白色包裹框大小
-			const codeBoxX = codeX - codeBoxSize; //包裹框初始X轴
-			const codeBoxY = codeY - codeBoxSize; //包裹框初始Y轴
-			const codeBoxEnd = codeSize + codeBoxWidht * ratio; //计算包裹框大小
-			const fontTop = codeY + codeBoxEnd + (codeBoxWidht + 20) * this.ratio; //文字距离上边距高度
-			const fontSize = 24 * ratio; //文字大小
-			const fontText = ''; //文字内容
-			const fontLeft = (codeSize - fontSize * fontText.length) / 2 + codeX; //文字左侧距离
-			// 插入背景图片
-			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 * 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>
-
-<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: 700rpx;
-	// height: 1245rpx;
-	width: 532rpx;
-	height: 945rpx;
-	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;
-	}
-}
+<template>
+	<view class="andr-shQ-padL30 andr-shQ-padR30 andr-shQ-Flex andr-shQ-FlexDirC">
+		<view class="andr-shQ-w100B andr-shQ-Flex andr-shQ-JusCC">
+			<swiper class="imgw750h375 matop"  :indicator-dots="false" :current="current" @change="currentChange" >
+				<swiper-item v-for="(item, index) in rwmListArr" :key="index"><image :src="item.wap_poster" mode="aspectFit" class="imgw750h375" /></swiper-item>
+			</swiper>
+		</view>
+		<!-- #ifdef H5 -->
+		<view class="baocun">长按二维码保存图片</view>
+		<!-- #endif -->
+		<!-- #ifdef MP-WEIXIN -->
+		<view class="baocun" @click="seav">保存图片并转发</view>
+		<!-- <button open-type="share" class="baocun btn" v-if="scLoading == 2">分享到微信</button> -->
+		<!-- #endif -->
+	</view>
+</template>
+<script>
+import { mapState } from 'vuex';
+import { spreadBanner } from '@/api/user.js';
+import { interceptor, saveUrl } from '@/utils/loginUtils';
+// #ifdef H5
+import { weixindata } from '@/utils/wxAuthorized';
+// #endif
+export default {
+	data() {
+		return {
+			rwmListArr: [],
+			current: 0,
+			imgSrc: ''
+		};
+	},
+	onLoad(option) {
+		uni.showLoading({
+			title: '邀请图生成中',
+			mask: true
+		});
+		// 判断是否强制登录
+		this.loadCodeList();
+		// #ifdef MP-WEIXIN
+		uni.authorize({
+			scope: 'scope.writePhotosAlbum',
+			complete() {}
+		});
+		// #endif
+	},
+	onShow() {
+		if (this.loginInterceptor && !this.hasLogin) {
+			saveUrl();
+			// 登录拦截
+			interceptor();
+		}
+	},
+    //下拉刷新
+    onPullDownRefresh() {
+    	let obj = this;
+    	//监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
+    	setTimeout(function() {
+    		obj.loadCodeList();
+    		uni.stopPullDownRefresh(); //停止下拉刷新动画
+    	}, 1000);
+    },
+	computed: {
+		...mapState(['weichatObj', 'baseURL', 'urlFile']),
+	},
+	methods: {
+		loadCodeList() {
+			let self = this;
+			// 加载二维码信息
+			// let andrUid = uni.getStorageSync('andrUid')||'';
+			spreadBanner({
+				// #ifdef H5
+				type: 2,
+				// #endif
+				// #ifdef MP
+				type: 1,
+				// #endif
+			}).then(e => {
+				if (e.status == 200) {
+					console.log(e.data)
+					self.rwmListArr = e.data;
+					// #ifdef H5
+					self.imgSrc = self.rwmListArr[0].wap_poster;
+					// #endif
+					// #ifdef MP-WEIXIN
+					self.imgSrc = self.rwmListArr[0].poster;
+					// #endif
+				}
+				uni.hideLoading();
+			});
+		},
+		currentChange(e) {
+			this.current = e.detail.current;
+		},
+		// onShareAppMessage(options){
+		// 	console.log(options,'options')
+		// 	let userInfo = uni.getStorageSync('userInfo');
+		// 	console.log(userInfo)
+		//   let obj = this;
+		//   // 设置菜单中的转发按钮触发转发事件时的转发内容
+		//   let shareObj = {
+		//     title: "邀请好友领券",        // 默认是小程序的名称(可以写slogan等)
+		//     path: '/pages/index/index?spread='+userInfo.uid,        // 默认是当前页面,必须是以‘/’开头的完整路径
+		//     imageUrl: obj.imgSrc,
+		//     success: function(res){
+		//       // 转发成功之后的回调
+		//       if(res.errMsg == 'shareAppMessage:ok'){
+		//       }
+		//     },
+		//     fail: function(){
+		//       // 转发失败之后的回调
+		//       if(res.errMsg == 'shareAppMessage:fail cancel'){
+		//         // 用户取消转发
+		//       }else if(res.errMsg == 'shareAppMessage:fail'){
+		//         // 转发失败,其中 detail message 为详细失败信息
+		//       }
+		//     }
+		//   };
+		//   // 来自页面内的按钮的转发
+		//   if( options.from == 'button' ){
+		//     // 此处可以修改 shareObj 中的内容
+		//     shareObj.path = '/pages/index/index?spread='+userInfo.uid;
+		//         console.log(shareObj.path,'shareObj.path')
+		//   }
+		//   // 返回shareObj
+		//   return shareObj;
+		// },
+		// scClick() {
+		// 	let self = this;
+		// 	// #ifdef H5
+		// 	self.imgSrc = self.rwmListArr[self.current].wap_poster;
+		// 	// #endif
+		// 	// #ifdef MP-WEIXIN
+		// 	self.imgSrc = self.rwmListArr[self.current].poster;
+		// 	// #endif
+		// },
+		// #ifdef MP-WEIXIN
+		seav() {
+			uni.getImageInfo({
+				src: this.imgSrc,
+				complete: function (result) {
+					let path = result.path;
+					uni.getSetting({
+						success(res) {
+							console.log(res)
+							if (!res.authSetting['scope.writePhotosAlbum']) {
+								uni.authorize({
+									scope:'scope.writePhotosAlbum',
+									success(res) {
+										uni.saveImageToPhotosAlbum({
+											filePath:path,
+											complete(result) {
+											}
+										});
+									},
+									complete(result) {
+									    uni.showToast({
+									         title: '请先授权保存图片',
+									         duration: 2000,
+											 icon:'none'
+									    });
+										obj.seav();
+									}
+								})
+							}else{
+								uni.saveImageToPhotosAlbum({
+									filePath:path,
+									complete(result) {
+									     uni.showToast({
+									         title: '保存图片成功!',
+									         duration: 2000,
+											 icon:'none'
+									     });
+									}
+								});
+							}
+						}
+					});
+				}
+			});
+		}
+		// #endif
+	}
+};
+</script>
+
+<style lang="scss">
+.imgw750h375 {
+	width: 700rpx;
+	height: 958rpx;
+}
+.matop{
+	margin-top: 40rpx;
+}
+.andr-shQ-padL30 {
+	padding-left: 30rpx;
+}
+.andr-shQ-padR30 {
+	padding-right: 30rpx;
+}
+.andr-shQ-Flex {
+	display: flex;
+}
+.andr-shQ-FlexDirC {
+	flex-direction: column;
+}
+.andr-shQ-w100B {
+	width: 100%;
+}
+.andr-shQ-JusCC {
+	justify-content: center;
+}
+.andr-shQ-marginT30 {
+	margin-top: 30rpx;
+}
+.andr-shQ-bgc06B163 {
+	background-color: $base-color;
+}
+.andr-shQ-cFFF {
+	color: #ffffff;
+}
+.andr-shQ-bdR50 {
+	border-radius: 50rpx;
+}
+.andr-shQ-h86 {
+	height: 86rpx;
+}
+.andr-shQ-AIC {
+	align-items: center;
+}
+.baocun {
+	color: #ffffff;
+	background: $base-color;
+	text-align: center;
+	width: 80%;
+	margin: 50rpx auto;
+	font-size: 28rpx;
+	padding: 25rpx 0rpx;
+	border-radius: 50rpx;
+}
+.btn{
+	padding: 0rpx 0rpx !important;
+	margin: 0rpx auto;
+	margin-bottom: 100rpx;
+}
+/* #ifdef H5 */
+.cbnagan {
+	width: 80%;
+	background: $base-color;
+	margin: 50rpx auto;
+	font-size: 28rpx;
+	text-align: center;
+}
+/* #endif */
 </style>
 </style>

+ 1 - 1
pages/user/user.vue

@@ -132,7 +132,7 @@
 				</view>
 				</view>
 				<view class="history-section icon">
 				<view class="history-section icon">
 					<uni-list>
 					<uni-list>
-						<uni-list-item title="我的实体店" @click="navTo('/pages/store/storeDetail')" thumb="/static/icon/img13.png" v-if="userInfo.level > 2"></uni-list-item>
+						<uni-list-item title="我的实体店" @click="navTo('/pages/store/storeDetail')" thumb="/static/icon/img13.png" v-if="userInfo.level == 3"></uni-list-item>
 						<uni-list-item title="我的推广" @click="navTo('/pages/user/extension')" thumb="/static/icon/img11.png" v-if="userInfo.level != 2"></uni-list-item>
 						<uni-list-item title="我的推广" @click="navTo('/pages/user/extension')" thumb="/static/icon/img11.png" v-if="userInfo.level != 2"></uni-list-item>
 						<uni-list-item title="收货地址" @click="navTo('/pages/set/address')" thumb="/static/icon/img12.png"></uni-list-item>
 						<uni-list-item title="收货地址" @click="navTo('/pages/set/address')" thumb="/static/icon/img12.png"></uni-list-item>
 						<uni-list-item title="联系客服" @click="showPopup" thumb="/static/icon/img02.png"></uni-list-item>
 						<uni-list-item title="联系客服" @click="showPopup" thumb="/static/icon/img02.png"></uni-list-item>