lhl 4 years ago
parent
commit
94a1e3bd0a

+ 2 - 1
manifest.json

@@ -164,7 +164,8 @@
                     // "secure": false,
                     "pathRewrite" : {}
                 }
-            }
+            },
+            "https" : false
         },
         "optimization" : {
             "treeShaking" : {

+ 4 - 4
pages.json

@@ -607,10 +607,10 @@
 		, {
 			"path": "pages/merchant/commodity",
 			"style": {
-				"navigationBarTitleText": "商品管理",
-				"app-plus": {
-					"titleNView": false
-				}
+				"navigationBarTitleText": "商品管理"
+				// ,"app-plus": {
+				// 	"titleNView": false
+				// }
 			}
 
 		}, {

+ 15 - 3
pages/address/addressManage.vue

@@ -101,8 +101,12 @@ export default {
 		if (option.type === 'edit') {
 			title = '编辑收货地址';
 			let data = JSON.parse(option.data);
-			console.log(data);
-
+			console.log(data);
+			let arr = data.detail.split(',')
+			let len = arr.length - 1
+			this.addressLocation.name = arr[0]
+			this.addressLocation.latitude = data.latitude
+			this.addressLocation.longitude = data.longitude
 			this.addressData = {
 				name: data.real_name,
 				mobile: data.phone,
@@ -111,7 +115,7 @@ export default {
 					city: data.city,
 					district: data.district
 				},
-				area: data.detail,
+				area: data.detail.split(',')[len],
 				default: data.is_default == 1,
 				id: data.id
 			};
@@ -226,6 +230,14 @@ export default {
 			if(data.area.length<4){
 				this.$api.msg('请填写具体信息精确到门牌号');
 				return;
+			}
+			if(obj.addressLocation.longitude == '') {
+				this.$api.msg('请选择正确的定位地址');
+				return;
+			}
+			if(obj.addressLocation.latitude == '') {
+				this.$api.msg('请选择正确的定位地址');
+				return;
 			}
 			//this.$api.prePage()获取上一页实例,可直接调用上页所有数据和方法,在App.vue定义
 			addressEdit({

+ 6 - 3
pages/merchant/commodity.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content">
-		<view class="status_bar"><!-- 这里是状态栏 --></view>
+		<!-- <view class="status_bar"></view>
 		<view class="content-money">
 			<view class="money-box">
 				<view class="goback-box" @click="toBack">
@@ -8,7 +8,7 @@
 					</view>
 				<view class="header">商品管理</view>
 			</view>
-		</view>
+		</view> -->
 		<view class="commodity-box">
 			<view class="commodity" v-for="item in orderList">
 				<view class="commodity-detail">
@@ -39,12 +39,15 @@ export default {
 			loadingType: 'more',
 			orderList: [],
 			page: 1, //当前页面
-			limit: 10 //每次信息条数
+			limit: 20 //每次信息条数
 		};
 	},
 	onLoad() {
 		this.loadData();
 	},
+	onReachBottom() {
+		this.loadData();
+	},
 	methods: {
 		loadData() {
 			let obj = this;

+ 38 - 35
pages/merchant/order.vue

@@ -1,12 +1,12 @@
 <template>
 	<view class="center">
-		<view class="input-box flex">
+		<!-- <view class="input-box flex">
 			<view class=" input-content flex">
 				<view class="iconfont iconsearch"></view>
 				<view class="input"><input type="text" disabled placeholder="输入关键字" /></view>
 			</view>
-		</view>
-		<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData" :style="{ height: maxheight + 'px' }">
+		</view> -->
+		<!-- <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData" :style="{ height: maxheight + 'px'}"> -->
 			<view class="main" v-for="(item, index) in list" :key="index" @click="goToOrderDetail(item)">
 				<view class="top flex">
 					<view class="userinfo clamp">订单编号ID:{{ item.order_id }}</view>
@@ -27,7 +27,7 @@
 				<view class="item-btm">共{{ item.total_num }}件商品 合计:¥{{ item.total_price }}</view>
 			</view>
 			<uni-load-more :status="loadType"></uni-load-more>
-		</scroll-view>
+		<!-- </scroll-view> -->
 	</view>
 </template>
 
@@ -40,34 +40,34 @@ export default {
 		empty,
 		uniLoadMore
 	},
-	onReady() {
-		let obj = this;
-		// 初始化获取页面高度
-		uni.createSelectorQuery()
-			.select('.center')
-			.fields(
-				{
-					size: true
-				},
-				data => {
-					// 初始化获取头部高度
-					uni.createSelectorQuery()
-						.select('.input-box')
-						.fields(
-							{
-								size: true
-							},
-							es => {
-								console.log(data,es)
-								// 保存头部高度
-								obj.maxheight = data.height - es.height;
-							}
-						)
-						.exec();
-				}
-			)
-			.exec();
-	},
+	// onReady() {
+	// 	let obj = this;
+	// 	// 初始化获取页面高度
+	// 	uni.createSelectorQuery()
+	// 		.select('.center')
+	// 		.fields(
+	// 			{
+	// 				size: true
+	// 			},
+	// 			data => {
+	// 				// 初始化获取头部高度
+	// 				uni.createSelectorQuery()
+	// 					.select('.input-box')
+	// 					.fields(
+	// 						{
+	// 							size: true
+	// 						},
+	// 						es => {
+	// 							console.log(data,es)
+	// 							// 保存头部高度
+	// 							obj.maxheight = data.height - es.height;
+	// 						}
+	// 					)
+	// 					.exec();
+	// 			}
+	// 		)
+	// 		.exec();
+	// },
 	data() {
 		return {
 			page: 1,
@@ -76,6 +76,9 @@ export default {
 			list: [],
 			maxheight:''
 		};
+	},
+	onReachBottom() {
+		this.loadData();
 	},
 	onPullDownRefresh() {
 		this.loadData();
@@ -86,17 +89,17 @@ export default {
 	methods: {
 		loadData() {
 			const obj = this;
-			if (obj.loadType == 'loading' || obj.loadType == 'nomore') {
+			if (obj.loadType == 'loading' || obj.loadType == 'noMore') {
 				return;
 			}
 			obj.loadType = 'loading';
 			merchantList({ page: obj.page, limit: obj.limit }).then(({ data }) => {
 				obj.list = obj.list.concat(data.data);
-				obj.page ++
+				obj.page++
 				if (data.data.length == obj.limit) {
 					obj.loadType = 'more';
 				} else {
-					obj.loadType = 'nomore';
+					obj.loadType = 'noMore';
 				}
 			});
 		},

+ 7 - 1
pages/merchant/storeData.vue

@@ -76,6 +76,7 @@ export default {
 			page: 1,
 			limit: 10,
 			now_date:year + '-' + month + '-01'+ ' - ' + year + '-' + month + '-' + date,
+			real_name: ''
 		};
 	},
 	components: {
@@ -114,6 +115,11 @@ export default {
 		},
 		search() {
 			console.log('search');
+			this.real_name = this.keyword
+			this.dataList = []
+			this.page = 1
+			this.loadingType = 'more'
+			this.loadData()
 		},
 		loadData() {
 			let obj = this;
@@ -123,7 +129,7 @@ export default {
 			}
 			obj.loadingType = 'loading'
 			console.log(obj.now_date)
-			merchantList({ page: obj.page, limit: obj.limit,data:obj.now_date }).then(({ data }) => {
+			merchantList({ page: obj.page, limit: obj.limit,data:obj.now_date,real_name: obj.real_name }).then(({ data }) => {
 				console.log(data)
 				obj.num = data.count;
 				obj.dataList = obj.dataList.concat(data.data);

+ 2 - 2
pages/money/pay.vue

@@ -18,11 +18,11 @@
 					</view>
 					<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 1"></radio></label>
 				</view>
-				<view class="type-item b-b" @click="changePayType(2)">
+				<!-- <view class="type-item b-b" @click="changePayType(2)">
 					<text class="icon iconfont iconzhifubao"></text>
 					<view class="con"><text class="tit">支付宝支付</text></view>
 					<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 2"></radio></label>
-				</view>
+				</view> -->
 				<view class="type-item" @click="changePayType(3)" v-show="goodsType === 0">
 					<text class="icon iconfont iconyue"></text>
 					<view class="con">

+ 4 - 4
pages/public/register.vue

@@ -83,10 +83,10 @@ export default {
 				obj.$api.msg('两次密码不正确');
 				return;
 			}
-			if (obj.invitation == '') {
-				obj.$api.msg('请输入邀请码');
-				return;
-			}
+			// if (obj.invitation == '') {
+			// 	obj.$api.msg('请输入邀请码');
+			// 	return;
+			// }
 			if (obj.code == '') {
 				obj.$api.msg('请输入验证码');
 				return;

+ 6 - 6
pages/received/index.vue

@@ -82,28 +82,28 @@
 						<view class="type">选择支付方式</view>
 						<view class="image" @click="close"><image src="../../static/img/x.png" mode="aspectFill"></image></view>
 					</view>
-					<view class="paybox-main flex">
+					<view class="paybox-main flex" @click="changePayType(0)">
 						<view class="zftype flex">
 							<image src="../../static/img/yue.png" mode="aspectFill"></image>
 							<view class="zf">余额支付</view>
 						</view>
-						<label class="radio" @click="changePayType(0)">
+						<label class="radio" >
 							<radio style="transform:scale(0.7)" class="rad" value="" :checked="payType == 0" color="#5dbc7c"></radio>
 						</label>
 					</view>
-					<view class="paybox-main flex">
+					<view class="paybox-main flex" @click="changePayType(2)">
 						<view class="zftype flex">
 							<image src="../../static/icon/jf.png" mode="aspectFill"></image>
 							<view class="zf">积分支付</view>
 						</view>
-						<label class="radio1" @click="changePayType(2)"><radio style="transform:scale(0.7)" value="" :checked="payType == 2" color="#5dbc7c"></radio></label>
+						<label class="radio1" ><radio style="transform:scale(0.7)" value="" :checked="payType == 2" color="#5dbc7c"></radio></label>
 					</view>
-					<view class="paybox-main flex">
+					<view class="paybox-main flex" @click="changePayType(1)">
 						<view class="zftype flex">
 							<image src="../../static/icon/xfq.png" mode="aspectFill"></image>
 							<view class="zf">消费券支付</view>
 						</view>
-						<label class="radio1" @click="changePayType(1)"><radio style="transform:scale(0.7)" value="" :checked="payType == 1" color="#5dbc7c"></radio></label>
+						<label class="radio1" ><radio style="transform:scale(0.7)" value="" :checked="payType == 1" color="#5dbc7c"></radio></label>
 					</view>
 					<view class="paybtn" @click="qrchange">
 						确定切换

+ 90 - 22
pages/user/user.vue

@@ -12,11 +12,12 @@
 					<view class="portrait-box"><image class="portrait" :src="userInfo.avatar || '/static/error/missing-face.png'"></image></view>
 					<view class="info-box">
 						<view class="username">{{ userInfo.nickname || '游客' }}</view>
-						<view class="font-size-sm" v-if="userInfo.uid">{{ userInfo.uid }}</view>
+						<view class="font-size-sm" v-if="userInfo.uid">邀请码:{{ userInfo.uid }}<text v-if="userInfo.level == 1" style="color: #5dbc7c;margin-left: 10rpx;">会员</text><text v-if="userInfo.level == 2" style="color: #dab176;margin-left: 10rpx;">副店长</text><text v-if="userInfo.level == 3" style="color: #dab176;margin-left: 10rpx;">店长</text></view>
+						<view class="font-size-sm" style="color: #5dbc7c;" v-if="userInfo.level == 1 && userInfo.service == 0">{{'会员股权:' + userInfo.vip.stock_rights + '  消费股权:' + userInfo.vip.consume_rights}}</view>
 					</view>
 				</view>
 				<view class="config">
-					<text class="setting " @click="navTo('/pages/userinfo/userinfo')"><image src="../../static/user/set.png" mode=""></image></text>
+					<view class="setting " @click="navTo('/pages/userinfo/userinfo')"><image src="../../static/user/set.png" mode=""></image></view>
 					设置
 				</view>
 			</view>
@@ -24,27 +25,18 @@
 		</view>
 		<view class="item-box">
 			<image class="arc" src="/static/img/arc.png"></image>
-			<view class="mendian">
-				<view class="mendian-lift" v-if="userInfo.level != 0">
+			<view class="mendian" v-if="userInfo.level == 1 && userInfo.service == 0">
+				<view class="mendian-lift">
 					<view class="img"><image src="../../static/img/mendian01.png" mode=""></image></view>
 					<text class="null-mendian">{{ userInfo.store_name}}</text>
 				</view>
-				<view class="mendian-lift" v-else>
-					<view class="img"><image src="../../static/img/mendian02.png" mode=""></image></view>
-					<text class="null-mendian">无绑定门店</text>
-				</view>
-				<view class="mendian-lift" v-if="userInfo.level != 0">
-					<!-- <text class="duihuan">{{userInfo.vip.}}</text> -->
-					<view>会员码:<image src="../../static/icon/hyewm.png" mode="" class="hym"></image></view>
-				</view>
-				<view class="mendian-right"  @click="go()" v-else>
-					<text class="duihuan">兑换会员卡</text>
-					<text class="iconfont iconenter"></text>
+				<view class="mendian-lift" @click="openhym">
+					NO:{{userInfo.vip.card_no}}<image src="../../static/icon/hym.png" mode="" class="hym" >
 				</view>
 			</view>
 			<view class="my-order">
 				<view class="box-title flex borde-b">
-					<view class="title" @click="go"><text>我的订单</text></view>
+					<view class="title"><text>我的订单</text></view>
 					<view class="link" @click="navTo('/pages/order/order?state=5')" hover-class="common-hover"><text class="iconfont iconenter"></text></view>
 				</view>
 				<view class="order-section">
@@ -83,7 +75,7 @@
 			</view>
 		</view>
 		<!-- <view class="cover-container"> -->
-		<view class="vip" @click="navTo('/pages/wallet/openMember')" v-if="userInfo.level < 3"><image src="../../static/user/upgrade.png" mode=""></image></view>
+		<view class="vip" @click="navTo('/pages/wallet/openMember')" v-if="userInfo.level == 0"><image src="../../static/user/upgrade.png" mode=""></image></view>
 
 		<!-- 订单 -->
 
@@ -93,10 +85,10 @@
 					<view class=" icon position-relative"><image class="icon-img" src="../../static/user/balance.png" mode="aspectFit"></image></view>
 					<text>我的余额</text>
 				</view>
-				<view class="order-item" @click="navTo('/pages/award/award')" hover-class="common-hover" :hover-stay-time="50">
+				<!-- <view class="order-item" @click="navTo('/pages/award/award')" hover-class="common-hover" :hover-stay-time="50">
 					<view class=" icon position-relative"><image class="icon-img" src="../../static/user/commission.png" mode="aspectFit"></image></view>
 					<text>我的佣金</text>
-				</view>
+				</view> -->
 				<view class="order-item" @click="navTo('/pages/coupon/consumer')" hover-class="common-hover" :hover-stay-time="50">
 					<view class=" icon position-relative"><image class="icon-img" src="../../static/user/coupon.png" mode="aspectFit"></image></view>
 					<text>我的消费券</text>
@@ -107,6 +99,8 @@
 				<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"></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>
 					<uni-list-item title="商家入口" @click="navTo('/pages/merchant/merchant')" thumb="/static/user/shopping.png" v-if="userInfo.service == 1"></uni-list-item>
@@ -114,6 +108,22 @@
 			</view>
 		</view>
 		<!-- </scroll-view> -->
+		<uni-popup ref="hympop" type="center">
+			<view class="hym-wrap">
+				<view class="hym-tit">
+					我的会员码
+				</view>
+				<view class="hym-val">
+					<tki-qrcode :key="hym" cid="tki-qrcode-canvas" ref="qrcode"
+						:val="hym" :size="300" unit="upx" background="#ffffff"
+						foreground="#333333" pdground="#333333" icon="" :iconSize="0" :lv="3" :onval="true"
+						:loadMake="true" :usingComponents="true" />
+				</view>
+				<view class="hym-num">
+					会员编号:{{hym}}
+				</view>
+			</view>
+		</uni-popup>
 		<uni-popup ref="popup" type="center">
 			<view class="popup-box">
 				<view class="img">
@@ -150,6 +160,7 @@ import uniList from '@/components/uni-list/uni-list.vue';
 import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
 import { orderData, orderVerific } from '@/api/user.js';
 import { getUserInfo } from '@/api/login.js';
+import tkiQrcodes from '@/components/tki-qrcode/tki-qrcode.vue';
 let startY = 0,
 	moveY = 0,
 	pageAtTop = true;
@@ -157,10 +168,12 @@ export default {
 	components: {
 		uniList,
 		uniListItem,
-		uniPopup
+		uniPopup,
+		tkiQrcodes
 	},
 	data() {
 		return {
+			hym: '',//会员编号
 			coverTransform: 'translateY(0px)',
 			coverTransition: '0s',
 			moving: false,
@@ -178,7 +191,28 @@ export default {
 			pwd: '',
 			storeInfo: {
 				name: ''
-			}
+			},
+			qrsize: 80, // 二维码大小
+			cid: 'tki-qrcode-canvas', //canvasId,页面存在多个二维码组件时需设置不同的ID
+			size: 500, //生成的二维码大小
+			unit: 'upx', //大小单位尺寸
+			// show: true,//默认使用组件中的image标签显示二维码
+			val: '', //要生成的内容
+			background: '#ffffff', //二维码背景色
+			foreground: '#333333', //二维码前景色
+			pdground: '#333333', //二维码角标色
+			icon: '', //二维码图标URL(必须是本地图片,网络图需要先下载至本地)
+			iconSize: 40, //二维码图标大小
+			lv: 3, //容错级别
+			onval: true, //监听val值变化自动重新生成二维码
+			loadMake: false, //组件初始化完成后自动生成二维码,val需要有值
+			usingComponents: false, //是否使用了自定义组件模式(主要是为了修复非自定义组件模式时 v-if 无法生成二维码的问题)
+			showLoading: true, //是否显示loading
+			loadingText: '二维码生成中', //loading文字
+			src: '', // 二维码生成后的图片地址或base64
+			ratio: 1, //页面比例用于计算
+			ctxSrc: '', //要显示的图片
+			loading: true, //是否载入图片中
 		};
 	},
 	onShow() {
@@ -214,6 +248,12 @@ export default {
 	},
 	methods: {
 		...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+		// 打开会员码
+		openhym() {
+			this.hym = this.userInfo.vip.card_no
+			this.$refs.hympop.open()
+			
+		},
 		// 加载初始数据
 		loadBaseData() {
 			let obj = this;
@@ -620,6 +660,7 @@ export default {
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
+		margin-bottom: 20rpx;
 		.mendian-lift {
 			display: flex;
 			.null-mendian {
@@ -629,6 +670,7 @@ export default {
 			.hym {
 				width: 40rpx;
 				height: 40rpx;
+				margin-left: 10rpx;
 			}
 			.img {
 				margin: 0 10rpx 0;
@@ -652,8 +694,12 @@ export default {
 		}
 	}
 	.my-order {
-		padding: 0 20rpx;
+		width: 680rpx;
+		margin: auto;
+		// margin-top: 10rpx;
+		// padding: 0 20rpx;
 		border-radius: 20rpx;
+		box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
 	}
 	.box-title {
 		line-height: 1;
@@ -858,4 +904,26 @@ export default {
 		}
 	}
 }
+.hym-wrap {
+	width: 500rpx;
+	height: 500rpx;
+	background-color: #fff;
+	text-align: center;
+	border-radius: 20rpx;
+	.hym-tit {
+		color: $base-color;
+		padding: 20rpx 0;
+		font-size: 48rpx;
+	}
+	.hym-val {
+		width: 300rpx;
+		height: 300rpx;
+		margin: auto;
+	}
+	.hym-num {
+		font-size: 28rpx;
+		font-weight: bold;
+		padding-top: 20rpx;
+	}
+}
 </style>

+ 46 - 45
pages/wallet/openMember.vue

@@ -8,16 +8,16 @@
 			</view>
 			<view class="card">
 				<view class="opennow">
-					立即开通
+					{{userInfo.level > 0 ? '已开通':'立即开通'}}
 				</view>
 				<view class="card-top flex">
 					<view class="avtur"><image :src="userInfo.avatar || '/static/error/missing-face.png'" mode=""></image></view>
 					<view class="main">
 						<view class="name">{{ userInfo.nickname }}</view>
-						<view class="tip" v-if="userInfo.pay_valid_time == null">尚未开通会员</view>
+						<view class="tip" v-if="userInfo.level == 0 ">尚未开通会员</view>
 						<view class="tip" v-else>
-							<text v-if="type">离会员到期仅剩{{ day }}天</text>
-							<text else>会员已过期</text>
+							<!-- <text v-if="type">离会员到期仅剩{{ day }}天</text> -->
+							<text >已开通会员</text>
 						</view>
 					</view>
 				</view>
@@ -77,7 +77,7 @@
 					<text>《会员服务协议》</text>
 				</text>
 			</view>
-			<view class="price-right" @click="submit">马上开通</view>
+			<view class="price-right" @click="userInfo.level > 0 ? '':submit()">马上开通</view>
 		</view>
 		<uni-popup ref="popupPay" type="bottom">
 			<view class="popup-box">
@@ -87,29 +87,29 @@
 						<view class="image" @click="close"><image src="https://zhibo.liuniu946.com/img/x.png" mode="aspectFill"></image></view>
 					</view>
 					<!-- #ifndef APP-PLUS -->
-					<view class="paybox-main flex">
+					<view class="paybox-main flex"  @click="changePayType(1)">
 						<view class="zftype flex">
 							<image src="https://zhibo.liuniu946.com/img/weixin.png" mode="aspectFill"></image>
 							<view class="zf">微信支付</view>
 						</view>
-						<label class="radio1" @click="changePayType(1)"><radio style="transform:scale(0.7)" value="" :checked="payType == 1" color="#52C696"></radio></label>
+						<label class="radio1"><radio style="transform:scale(0.7)" value="" :checked="payType == 1" color="#52C696"></radio></label>
 					</view>
 					<!-- #endif -->
 					<!-- #ifdef APP-PLUS -->
-					<view class="paybox-main flex">
+					<view class="paybox-main flex" @click="changePayType(3)">
 						<view class="zftype flex">
 							<view class="icon iconfont iconzhifubao"></view>
 							<view class="zf">支付宝支付</view>
 						</view>
-						<label class="radio1" @click="changePayType(3)"><radio style="transform:scale(0.7)" value="" :checked="payType == 3" color="#52C696"></radio></label>
+						<label class="radio1" ><radio style="transform:scale(0.7)" value="" :checked="payType == 3" color="#52C696"></radio></label>
 					</view>
 					<!-- #endif -->
-					<view class="paybox-main flex">
+					<view class="paybox-main flex" @click="changePayType(2)">
 						<view class="zftype flex">
 							<image src="https://zhibo.liuniu946.com/img/yue.png" mode="aspectFill"></image>
 							<view class="zf">余额支付</view>
 						</view>
-						<label class="radio" @click="changePayType(2)">
+						<label class="radio" >
 							<radio style="transform:scale(0.7)" class="rad" value="" :checked="payType == 2" color="#52C696"></radio>
 						</label>
 					</view>
@@ -134,9 +134,9 @@ import { mapState, mapMutations } from 'vuex';
 import { becomeVip, getVip, setUserRed, claseauto } from '@/api/user.js';
 import { getUserInfo } from '@/api/user.js';
 import { timeComputed } from '@/utils/rocessor.js';
-// // #ifdef H5
-// import weixinObj from '@/plugin/jweixin-module/index.js';
-// // #endif
+// #ifdef H5
+import weixinObj from '@/plugin/jweixin-module/index.js';
+// #endif
 
 export default {
 	computed: {
@@ -145,7 +145,8 @@ export default {
 	},
 	onLoad(option) {
 		this.state = option.state;
-		this.getVip();
+		this.getVip();
+		console.log(this.userInfo)
 		this.checkedAuto = +this.userInfo.red_packet == 0 ? false : true;
 		if (this.userInfo.pay_valid_time != null) {
 			let TimeObj = timeComputed(this.userInfo.pay_valid_time * 1000);
@@ -430,21 +431,21 @@ export default {
 							paySign: da.paySign,
 							success: function(res) {
 								console.log(res);
-								obj.getUserInfoB();
-								// getUserInfo({})
-								// 	.then(({ data }) => {
-								// 		obj.setUserInfo(data);
-								// 		if (obj.state == 1) {
-								// 			uni.navigateTo({
-								// 				url: '/pages/vip/success'
-								// 			});
-								// 		} else {
-								// 			uni.navigateBack();
-								// 		}
-								// 	})
-								// 	.catch(e => {
-								// 		console.log(e);
-								// 	});
+								// obj.getUserInfoB();
+								getUserInfo({})
+									.then(({ data }) => {
+										obj.setUserInfo(data);
+										uni.showToast({
+											title:'开通成功',
+											duration:2000
+										});
+										setTimeout(function() {
+											uni.navigateBack();
+										}, 1500);
+									})
+									.catch(e => {
+										console.log(e);
+									});
 							},
 							fail: e => {
 								console.log(e);
@@ -456,7 +457,7 @@ export default {
 						// #endif
 						// #ifdef H5
 						if (obj.payName == 'weixin') {
-							weichatObj.chooseWXPay(data);
+							weixinObj.chooseWXPay(data);
 						}
 						// #endif
 					}
@@ -469,20 +470,20 @@ export default {
 					if (data.status == 'SUCCESS') {
 						obj.$refs.popupPay.close();
 						obj.getUserInfoB();
-						// getUserInfo({})
-						// 	.then(({ data }) => {
-						// 		obj.setUserInfo(data);
-						// 		if (obj.state == 1) {
-						// 			uni.navigateTo({
-						// 				url: '/pages/vip/success'
-						// 			});
-						// 		} else {
-						// 			uni.navigateBack();
-						// 		}
-						// 	})
-						// 	.catch(e => {
-						// 		console.log(e);
-						// 	});
+						getUserInfo({})
+							.then(({ data }) => {
+								obj.setUserInfo(data);
+								uni.showToast({
+									title:'开通成功',
+									duration:2000
+								});
+								setTimeout(function() {
+									uni.navigateBack();
+								}, 1500);
+							})
+							.catch(e => {
+								console.log(e);
+							});
 					}
 					// #endif
 				});

BIN
static/icon/czhy.png


BIN
static/icon/hym.png