lhl 1 year ago
parent
commit
52c3ff53fa

+ 8 - 0
api/login.js

@@ -62,3 +62,11 @@ export function bangding(data) {
 		data
 	});
 }
+
+export function getAppInfo(data) {
+	return request({
+		url: '/api/version',
+		method: 'get',
+		data
+	});
+}

+ 36 - 0
api/zero.js

@@ -85,4 +85,40 @@ export function passLst(data) {
 		method: 'get',
 		data
 	});
+}
+
+//买单
+export function buyGs(data) {
+	return request({
+		url: '/api/pass/buy_order',
+		method: 'post',
+		data
+	});
+}
+
+//取消挂售
+export function qxGs(data) {
+	return request({
+		url: '/api/pass/cancel',
+		method: 'post',
+		data
+	});
+}
+
+//上传凭证
+export function upEvaluation(data) {
+	return request({
+		url: '/api/pass/up_evaluation',
+		method: 'post',
+		data
+	});
+}
+
+//审核
+export function auth(data) {
+	return request({
+		url: '/api/pass/auth',
+		method: 'post',
+		data
+	});
 }

+ 4 - 3
manifest.json

@@ -2,8 +2,8 @@
     "name" : "精联惠选",
     "appid" : "__UNI__991D0D9",
     "description" : "精联惠选",
-    "versionName" : "1.0.4",
-    "versionCode" : 104,
+    "versionName" : "1.0.9",
+    "versionCode" : 109,
     "transformPx" : false,
     "app-plus" : {
         /* 5+App特有相关 */
@@ -26,6 +26,7 @@
                 /* android打包配置 */
                 "permissions" : [
                     "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -104,7 +105,7 @@
         "title" : "精联惠选",
         "domain" : "",
         "router" : {
-            "base" : "/test/",
+            "base" : "/index/",
             "mode" : "hash"
         },
         "devServer" : {

+ 13 - 7
pages.json

@@ -2,7 +2,7 @@
 	"pages": [{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "7131",
+				"navigationBarTitleText": "精联惠选",
 				"navigationStyle": "custom"
 			}
 		},
@@ -100,6 +100,12 @@
 				"navigationBarTitleText": "共富值"
 			}
 		},
+		{
+			"path": "pages/zero/order",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		},
 		{
 			"path": "pages/public/register",
 			"style": {
@@ -500,12 +506,12 @@
 				"selectedIconPath": "static/tabBar/xc-action.png",
 				"text": "我的薪酬"
 			},
-			{
-				"pagePath": "pages/index/zero",
-				"iconPath": "static/tabBar/ll.png",
-				"selectedIconPath": "static/tabBar/ll-action.png",
-				"text": "零创业"
-			},
+			// {
+			// 	"pagePath": "pages/index/zero",
+			// 	"iconPath": "static/tabBar/ll.png",
+			// 	"selectedIconPath": "static/tabBar/ll-action.png",
+			// 	"text": "零创业"
+			// },
 			{
 				"pagePath": "pages/user/user",
 				"iconPath": "static/tabBar/user.png",

+ 20 - 8
pages/index/index.vue

@@ -31,7 +31,7 @@
 		<!-- 分类 ed -->
 		<view class="jg">
 		</view>
-		<video src="../../static/video/v1.mp4" controls class="gsjs" autoplay muted="muted"></video>
+		<video src="../../static/video/v1.mp4" controls class="gsjs" :muted="muted" ref="inv" id="myVideo"></video>
 		<!-- 商品列表 start -->
 		<!-- <view class="hot-wrap">
 			<view class="hot-top flex">
@@ -112,12 +112,7 @@
 	export default {
 		data() {
 			return {
-				// #ifdef APP-PLUS
 				muted: false,
-				// #endif
-				// #ifdef H5
-				muted: true,
-				// #endif
 				cateList: [
 					{
 						path: '/pages/index/gift',
@@ -125,7 +120,7 @@
 						tit: 'VIP商品'
 					},
 					{
-						path: '/pages/index/gift?type=9',
+						path: '/pages/index/zero',
 						img: '../../static/icon/inx2.png',
 						tit: '零创业'
 					},
@@ -161,7 +156,7 @@
 					}
 				],
 				text: '', //客服微信
-				page: 1,
+				// page: 1,
 				limitt: 20,
 				loadingType: 'more',
 				current: 0,
@@ -235,6 +230,8 @@
 		},
 		onReachBottom() {
 			console.log('到底')
+			
+			
 			// this.getGoodList()
 		},
 		onLoad: function(option) {
@@ -261,6 +258,18 @@
 			this.getGoodList()
 			this.loadData();
 		},
+		onHide() {
+			console.log('滴答滴答滴答滴答滴答滴答的')
+			let video = uni.createVideoContext('myVideo', this);
+			console.log(video,'video')
+			try{
+				video.pause()
+			}catch(e){
+				//TODO handle the exception
+				console.log('err',e)
+			}
+			// this.$refs.inv.pause()
+		},
 		methods: {
 			gogogo(item) {
 				if(!item.path) {
@@ -377,6 +386,9 @@
 				if (item.wap_url.indexOf('http') >= 0) {
 					window.location.href = item.wap_url;
 				}
+				// uni.navigateTo({
+				// 	url: '/pages/zero/order'
+				// })
 				// #endif
 				//测试数据没有写id,用title代替
 				uni.navigateTo({

+ 2 - 1
pages/index/upApp.vue

@@ -42,8 +42,9 @@
                         success: (res1) => {
                             // wgtWaiting.close();
                             if (res1.statusCode === 200) {
-                                plus.runtime.install(res1.tempFilePath, {}, () => {
+                                plus.runtime.install(res1.tempFilePath, {}, (e) => {
                                     plus.runtime.restart();
+									console.log(e)
                                 }, (e) => {
                                     uni.showModal({
                                         content: "update error [" +

+ 27 - 4
pages/index/zero.vue

@@ -93,8 +93,11 @@
 						<view class="num">
 							{{ getTime(orderItem.add_time)}}
 						</view>
-						<view class="order-btn" @click="makeCall(orderItem.phone)">
+						<!-- <view class="order-btn" @click="makeCall(orderItem.phone)">
 							联系卖家
+						</view> -->
+						<view class="order-btn" @click="gobuy(orderItem)">
+							立即购买
 						</view>
 					</view>
 					<uni-load-more :status="item.loadingType"></uni-load-more>
@@ -140,7 +143,7 @@
 		userPool,
 		goft
 	} from '@/api/user.js';
-	import { getCardList,createPass, getGsList,passUser } from '@/api/zero.js'
+	import { getCardList,createPass, getGsList,passUser,buyGs } from '@/api/zero.js'
 	
 	export default {
 		components: {
@@ -178,7 +181,8 @@
 						limit: 10,
 					}
 				],
-				loading: false
+				loading: false,
+				buying: false,
 			}
 		},
 		onLoad() {
@@ -186,7 +190,7 @@
 		},
 		onShow() {
 			this.loadBaseData()
-			this.getGsList()
+			
 		},
 		computed: {
 			...mapState('user', ['userInfo', 'hasLogin'])
@@ -208,6 +212,23 @@
 		},
 		methods: {
 			...mapMutations('user', ['setUserInfo']),
+			gobuy(item) {
+				if(this.buying) {
+					return
+				}
+				this.buying = true
+				buyGs({
+					id: item.id
+				}).then(res => {
+					uni.showToast({
+						title:'购买成功',
+						duration:2000
+					});
+					this.buying = false
+				}).catch( err => {
+					this.buying = false
+				})
+			},
 			passUser() {
 				passUser().then(res => {
 					// console.log(res);
@@ -325,6 +346,7 @@
 						obj.setUserInfo(data);
 						obj.getCardList()
 						obj.passUser()
+						obj.getGsList()
 					})
 					.catch(e => {
 						console.log(e);
@@ -391,6 +413,7 @@
 					page: item.page,
 					limit: item.limit,
 					order: that.order,
+					status: 0
 				}).then(res => {
 					uni.hideLoading()
 					let arr = res.data.result.list

+ 61 - 7
pages/public/login.vue

@@ -3,7 +3,7 @@
 		<view class="container_text">
 			<!-- <image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image> -->
 			<view class="banner-img">
-				
+
 			</view>
 		</view>
 		<view class="loginTitle"><text>登录</text></view>
@@ -25,16 +25,24 @@
 			<view><button type="green" class="uni-button uni-button-green" @click="toLogin">登录</button></view>
 			<view><button type="green" class="uni-button uni-button-green uni-button-green-plain" plain="true"
 					hover-class="none" @click="register">注册</button></view>
-			<navigator url="./forget">
+			<!-- <navigator url="./forget">
 				<view class="forget">忘记密码</view>
-			</navigator>
+			</navigator> -->
+			<view class="flex">
+				<!-- #ifdef H5 -->
+				<view class="forget" style="text-align: left;" @click="goDown">下载APP</view>
+				<!-- #endif -->
+				<view class="forget">
+					<navigator url="./forget">忘记密码</navigator>
+				</view>
+			</view>
 			<!-- <view class="flex other">
 				<view class="fenge"></view>
 				<view class="qita">其他方式登录</view>
 				<view class="fenge"></view>
 			</view> -->
 			<!-- #ifndef APP-PLUS -->
-<!-- 			<view class="weixin" @click="wecahtLogin">
+			<!-- 			<view class="weixin" @click="wecahtLogin">
 				<image src="/static/img/img05.png"></image>
 			</view>
 			<view class="weixin_text" @click="wecahtLogin">微信登录</view> -->
@@ -66,7 +74,8 @@
 		mapMutations
 	} from 'vuex';
 	import {
-		login
+		login,
+		getAppInfo
 	} from '@/api/login.js';
 	import {
 		getUserInfo
@@ -78,7 +87,7 @@
 	} from '@/api/set.js';
 	// loginWx接口需要开发编写,基础项目中可能没有
 	import {
-		loginWx
+		loginWx,
 	} from '@/api/login.js';
 	// #endif
 	// #ifdef H5
@@ -89,6 +98,7 @@
 	export default {
 		data() {
 			return {
+				deviceId: '',
 				username: '',
 				passward: '',
 				// #ifdef APP-PLUS
@@ -113,9 +123,52 @@
 				}
 			})
 			// #endif
+
+			this.getDeviceMac()
 		},
 		methods: {
 			...mapMutations('user', ['setUserInfo', 'login']),
+			goDown() {
+				getAppInfo().then(res => {
+					console.log(res)
+					window.open(res.data.app_down)
+				})
+			},
+			//获取设备的mac地址
+			getDeviceMac() {
+				let obj = this
+				// #ifdef APP-PLUS
+				let oaid = uni.getStorageSync('oaid')
+				console.log('取值', oaid)
+				if (oaid) {
+					obj.deviceId = oaid
+				} else {
+					plus.device.getOAID({
+						success: function(e) {
+							obj.deviceId = e.oaid
+							uni.setStorageSync('oaid', e.oaid)
+							console.log('uuid', e.oaid)
+						},
+						fail: function(e) {
+							console.log('getDeviceInfo failed: ' + JSON.stringify(e));
+						}
+					});
+				}
+
+
+				// #endif
+				// #ifdef H5
+				uni.getSystemInfo({
+					success(e) {
+						obj.deviceId = e.deviceId
+					},
+					fail(err) {
+						console.log(err)
+					}
+				})
+				// #endif
+			},
+
 			// 微信登录
 			wecahtLogin(type) {
 				let obj = this;
@@ -220,7 +273,8 @@
 				}
 				login({
 						account: obj.username,
-						password: obj.passward
+						password: obj.passward,
+						deviceId: obj.deviceId
 					})
 					.then(function(e) {
 						uni.setStorageSync('token', e.data.token);

+ 8 - 6
pages/public/register.vue

@@ -24,13 +24,13 @@
 				<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>
-			<!-- <view class="login_input flex">
+			<view class="login_input flex">
 				<view class="login_img"><image src="/static/icon/img06.png"></image></view>
 				<view class="login_name flex">
 					<input class="uni-input width" v-model="code" focus placeholder="请输入验证码" />
 					<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
 				</view>
-			</view> -->
+			</view>
 			<view><button type="green" @click="register" class="uni-button uni-button-green">注册账号</button></view>
 			<view><button class="uni-button uni-button-green uni-button-green-plain" type="green" plain="true" hover-class="none" @click="login">返回登录</button></view>
 		</view>
@@ -45,14 +45,17 @@ export default {
 			password: '', //密码
 			repassword: '',
 			invitation: '', //邀请码
-			code: '123456', //验证码
+			code: '', //验证码
 			time: '', //保存倒计时对象
 			countDown: 0 ,//倒计时
 		};
 	},
-	onLoad() {
+	onLoad(opt) {
 		// 获取扫码邀请人id
 		this.invitation = uni.getStorageSync('spread')||'';
+		if(opt.spread) {
+		this.invitation = opt.spread	
+		}
 	},
 	watch: {
 		// 监听倒计时
@@ -91,8 +94,7 @@ export default {
 				return;
 			}
 			if (obj.code == '') {
-				// obj.$api.msg('请输入验证码');
-				obj.code = '123456'
+				obj.$api.msg('请输入验证码');
 				return;
 			}
 			register({

+ 6 - 6
pages/set/set.vue

@@ -3,10 +3,10 @@
 		<uni-list>
 		    <uni-list-item title="个人资料" @click="navTo('/pages/set/userinfo')" ></uni-list-item>
 			<uni-list-item title="修改密码" @click="navTo('/pages/set/password')" ></uni-list-item>
-		    <uni-list-item title="实名认证" @click="navTo('/pages/set/phone')" ></uni-list-item>
-		    <uni-list-item title="收货地址" @click="navTo('/pages/set/address')" ></uni-list-item>
+		    <!-- <uni-list-item title="实名认证" @click="navTo('/pages/set/phone')" ></uni-list-item> -->
+		    <!-- <uni-list-item title="收货地址" @click="navTo('/pages/set/address')" ></uni-list-item> -->
 		</uni-list>
-		<uni-list class="margin-t-20">
+		<!-- <uni-list class="margin-t-20">
 		    <uni-list-item title="消息推送" :switch-checked='true' :show-switch="true" :show-arrow="false" switch-color='#5dbc7c'  @switchChange='switchChange'> 
 			</uni-list-item>
 		</uni-list>
@@ -18,7 +18,7 @@
 					当前版本 1.0.3
 				</template>
 			</uni-list-item>
-		</uni-list>
+		</uni-list> -->
 		<view class="list-cell log-out-btn" @click="toLogout">
 			<text class="cell-tit">退出登录</text>
 		</view>
@@ -91,7 +91,7 @@
 		&.log-out-btn{
 			margin-top: 40rpx;
 			.cell-tit{
-				color: $uni-color-primary;
+				color: $base-color;
 				text-align: center;
 				margin-right: 0;
 			}
@@ -104,7 +104,7 @@
 		}
 		.cell-tip{
 			font-size: $font-base;
-			color: $font-color-light;
+			color:$base-color;
 		}
 		switch{
 			transform: translateX(16rpx) scale(.84);

+ 8 - 5
pages/user/shareQrCode.vue

@@ -82,7 +82,7 @@
 					});
 				});
 			} else {
-				this.val = this.baseURL + '/index/#/pages/index/index?spread=' + this.userInfo.uid
+				this.val = this.baseURL + '/index/#/pages/public/register?spread=' + this.userInfo.uid
 			}
 		},
 		methods: {
@@ -173,13 +173,14 @@
 						// 填充背景色,白色
 						ctx.setFillStyle('#fff'); // 默认白色
 						ctx.fillRect(0, 0, this.canvasW, this.canvasH) // fillRect(x,y,宽度,高度)
-
+						
 						// 绘制商品主图,二维码
 						ctx.drawImage(this.goodsImg.path, 0, 0, this.canvasW, this
 							.canvasH) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度)
 							// #ifdef APP-PLUS
 							ctx.drawImage(this.ewmImg.path, (this.canvasW / 2 - this.ewmW / 2),this.canvasH - 85*this.ratio - this.ewmW,
 								this.ewmW, this.ewmW) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度,二维码的宽,高)
+							
 							// #endif
 							// #ifdef H5
 							ctx.drawImage(this.ewmImg.path, (this.canvasW / 2 - this.ewmW / 2),this.canvasH - 170*this.ratio - this.ewmW,
@@ -188,9 +189,11 @@
 						
 
 						// 3、绘制商品标题,多余文字自动换行
-						ctx.setFontSize(16); // setFontSize() 设置字体字号
-						ctx.setFillStyle('#333'); // setFillStyle() 设置字体颜色
-						
+						ctx.setFontSize(24); // setFontSize() 设置字体字号
+						ctx.setFillStyle('#fff'); // setFillStyle() 设置字体颜色
+						ctx.textAlign = "center";
+						// 邀请码
+						ctx.fillText('邀请码:' + this.userInfo.uid,this.canvasW/2,this.canvasH -10)
 						ctx.draw(false, (ret) => { // draw方法 把以上内容画到 canvas 中。
 							console.log(ret)
 							uni.showToast({

+ 8 - 0
pages/user/sz.vue

@@ -161,6 +161,14 @@
 						}else {
 							qdata.pm = 0
 						}
+					}else if(that.type == 11) {
+						status = 11
+						qdata.category = 'freeze_points'
+						if(item.state == 1) {
+							qdata.pm = 1
+						}else {
+							qdata.pm = 0
+						}
 					}
 				}
 				

+ 1 - 1
pages/user/user.vue

@@ -105,7 +105,7 @@
 			</view>
 			<image src="../../static/icon/back.png" mode="" class="right-img"></image>
 		</view>
-		<view class="user-list flex" @click="navTo('/pages/set/userinfo')">
+		<view class="user-list flex" @click="navTo('/pages/set/set')">
 			<image src="../../static/icon/u6.png" mode="" class="left-img"></image>
 			<view class="">
 				设置

+ 7 - 2
pages/user/xzdl.vue

@@ -16,7 +16,7 @@
 				{{item.name}}
 			</view>
 			<view class="" class="tit">
-				去转账
+				去兑换
 			</view>
 			<image src="../../static/img/back.png" mode="" class="go"></image>
 		</view>
@@ -50,6 +50,11 @@
 						name: '佣金兑换复投积分',
 						type: 2,
 						img: '../../static/icon/yzft.png',
+					},
+					{
+						name: '佣金兑换通证',
+						type: 3,
+						img: '../../static/icon/task2.png',
 					}
 				]
 			}
@@ -59,7 +64,7 @@
 				this.type = opt.type
 				if(this.type == 2) {
 					uni.setNavigationBarTitle({
-						title:'互转'
+						title:'兑换'
 					})
 				}
 			}

+ 25 - 7
pages/user/yjzye.vue

@@ -1,9 +1,12 @@
 <template>
 	<view class="content">
+<view class="tit" v-if="type == 3">
+			佣金兑换通证比例1:1,手续费{{pUser.to_pass*100}}%
+		</view>
 		<view class="content-money">
 			<view class="flex">
 				<view class="buttom">
-					<view class="icon" >{{ userInfo.brokerage_price | getMoneyStyle }}</view>
+					<view class="icon">{{ userInfo.brokerage_price | getMoneyStyle }}</view>
 					<text class="text">可转换余额</text>
 				</view>
 			</view>
@@ -13,7 +16,7 @@
 			<view class="row">
 				<input class="input" type="number" v-model="withdrawal" placeholder="转换金额"
 					placeholder-class="placeholder" />
-				<view class="buttom" @click="withdrawal = userInfo.brokerage_price*1" >全部转换</view>
+				<view class="buttom" @click="withdrawal = userInfo.brokerage_price*1">全部转换</view>
 			</view>
 		</view>
 		<button class="add-btn up" :class="{ action: loding }" @click="!loding ? confirm() : ''">转换</button>
@@ -30,6 +33,7 @@
 		yjzye,
 		rechargeWechat
 	} from '@/api/user.js';
+	import { passUser } from '@/api/zero.js'
 	import {
 		mapMutations,
 		mapState
@@ -40,6 +44,7 @@
 		},
 		data() {
 			return {
+				pUser: '',
 				phone: '',
 				money: '0.00', //可提现金额
 				withdrawal: '', //提现金额
@@ -60,9 +65,13 @@
 			this.dataUp();
 			if (options.type) {
 				this.type = options.type;
-				if(this.type == 2) {
+				if (this.type == 2) {
+					uni.setNavigationBarTitle({
+						title: '佣金兑换复投积分'
+					})
+				} else if (options.type == 3) {
 					uni.setNavigationBarTitle({
-						title:'佣金兑换复投积分'
+						title: '佣金兑换通证'
 					})
 				}
 			}
@@ -80,6 +89,9 @@
 						obj.login();
 						// 保存返回用户数据
 						obj.setUserInfo(e.data);
+						passUser().then(re => {
+							this.pUser = re.data
+						})
 					})
 					.catch(e => {
 						console.log(e);
@@ -101,9 +113,9 @@
 					});
 					return;
 				}
-				
+
 				let data = {
-					price: obj.withdrawal ,//金额
+					price: obj.withdrawal, //金额
 					type: obj.type,
 					// #ifdef H5
 					from: 'h5'
@@ -150,6 +162,12 @@
 		height: 100%;
 	}
 
+	.tit {
+		padding: 5rpx;
+		background-color: #f2c3d1;
+		color: #f21f5d;
+	}
+
 	.content-money {
 		padding: 30rpx 0;
 		background: #ffffff;
@@ -353,4 +371,4 @@
 			color: #5771DF;
 		}
 	}
-</style>
+</style>

+ 10 - 10
pages/zero/award.vue

@@ -4,7 +4,7 @@
 			<view class="status_bar"><!-- 这里是状态栏 --></view>
 			<view class="body-title">
 				<view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
-				<view class="header">{{type == 1?'奖励积分池': '商城积分池'}}</view>
+				<view class="header">{{type == 9?'奖励积分池': '商城积分池'}}</view>
 			</view>
 			<view class="content-bg"><image src="../../static/img/tg-bg.png" mode=""></image></view>
 			<view class="money-box">
@@ -136,26 +136,26 @@ export default {
 				// 	page: 1, //当前页数
 				// 	limit: 10 //每次信息条数
 				// },
-				{
-					pm: 0,
-					state: 4,
-					text: '支出',
+				{	
+					pm: 1,
+					state: 3,
+					text: '收入',
 					loadingType: 'more',
 					orderList: [],
 					page: 1, //当前页数
 					limit: 10 ,//每次信息条数
 					loaded: false
 				},
-				{	
-					pm: 1,
-					state: 3,
-					text: '收入',
+				{
+					pm: 0,
+					state: 4,
+					text: '支出',
 					loadingType: 'more',
 					orderList: [],
 					page: 1, //当前页数
 					limit: 10 ,//每次信息条数
 					loaded: false
-				}
+				},
 			],
 			money: ''
 		};

+ 35 - 11
pages/zero/gg.vue

@@ -3,8 +3,8 @@
 		<view class="djs">
 			观看完视频后,可获得奖励
 		</view>
-		<video src="../../static/video/v1.mp4" class="gsjs" autoplay :muted="true" :controls="false"
-			:enable-progress-gesture="false" @play="vPlay" ref="vgg" @ended="vEnd"></video>
+		<video src="../../static/video/v1.mp4" class="gsjs" autoplay :muted="muted" :controls="false"
+			:enable-progress-gesture="false" @play="vPlay" ref="vgg" @ended="vEnd" id="myVideo"></video>
 	</view>
 </template>
 
@@ -15,9 +15,16 @@
 	export default {
 		data() {
 			return {
+				// #ifdef APP-PLUS
+				muted: false,
+				// #endif
+				// #ifdef H5
+				muted: true,
+				// #endif
 				djs: 15,
 				isEnd: false,
-				id:0
+				id: 0,
+				video: ''
 			}
 		},
 		onLoad(opt) {
@@ -30,13 +37,21 @@
 
 		},
 		onReady() {
-
+			this.video = uni.createVideoContext('myVideo', this)
+		},
+		onHide() {
+			try {
+				this.video.pause()
+			} catch (e) {
+				//TODO handle the exception
+				console.log('err', e)
+			}
 		},
 		onBackPress(event) {
 			console.log(event, 'black')
 			let that = this
 			if (!that.isEnd) {
-				that.$refs.vgg.pause()
+				that.video.pause()
 				uni.showModal({
 					title: '温馨提醒',
 					content: '观看完视频后,可获得奖励',
@@ -46,7 +61,7 @@
 						console.log(e)
 						if (e.confirm) {
 							// return 
-							that.$refs.vgg.play()
+							that.video.play()
 
 						} else {
 							uni.redirectTo({
@@ -72,10 +87,10 @@
 					id: this.id
 				}).then(res => {
 					uni.showToast({
-						title:'奖励发放成功',
-						duration:2000
+						title: '奖励发放成功',
+						duration: 2000
 					});
-					setTimeout(()=> {
+					setTimeout(() => {
 						uni.navigateBack({
 							fail() {
 								uni.redirectTo({
@@ -83,8 +98,8 @@
 								})
 							}
 						})
-					},1500)
-					
+					}, 1500)
+
 				})
 			}
 		}
@@ -97,6 +112,15 @@
 		height: 100%;
 	}
 
+	.content {
+		position: absolute;
+		top: 0;
+		left: 0;
+		background-color: #000;
+		width: 100%;
+		height: 100%;
+	}
+
 	.gsjs {
 		width: 750rpx;
 		position: absolute;

+ 41 - 21
pages/zero/gs.vue

@@ -4,30 +4,33 @@
 			<view class="item-name">
 				参考价格
 			</view>
-			<input type="text" class="item-val val-red" disabled v-model="pUser.points_transaction"/>
+			<input type="text" class="item-val val-red" disabled v-model="pUser.points_transaction" />
 		</view>
 		<!-- //挂售价格(元) -->
 		<view class="flex gs-item">
 			<view class="item-name">
 				挂售价格(元)
 			</view>
-			<input type="text" class="item-val" placeholder="请输入您的挂售价(单价)" v-model="total_price"/>
+			<input type="text" class="item-val" placeholder="请输入您的挂售价(单价)" v-model="total_price" />
 		</view>
 		<view class="flex gs-item">
 			<view class="item-name">
 				挂售数量
 			</view>
-			<input type="text" class="item-val" placeholder="请输入挂售数量" v-model="amount"/>
+			<input type="text" class="item-val" placeholder="请输入挂售数量" v-model="amount" />
 		</view>
-		<view class="flex gs-item">
+		<view class="flex gs-item" v-if="type !=1">
 			<view class="item-name">
 				联系方式
 			</view>
-			<input type="text" class="item-val" placeholder="请输入联系方式" v-model="phone"/>
+			<input type="text" class="item-val" placeholder="请输入联系方式" v-model="phone" />
 		</view>
-		<view class="fwf">
+		<view class="fwf" v-if="type != 1">
 			服务费:<text>{{(total_price * amount * pUser.fee_ratio / 100).toFixed(2) || 0}} 阅读积分</text>
 		</view>
+		<view class="fwf" v-else>
+			服务费:<text>{{( amount * 0.05).toFixed(2) || 0}} 余额宝</text>
+		</view>
 		<view class="btn" @click="createGs">
 			确认
 		</view>
@@ -35,27 +38,33 @@
 </template>
 
 <script>
-	import { createGs,passUser } from '@/api/zero.js'
+	import {
+		createGs,
+		passUser
+	} from '@/api/zero.js'
 	export default {
 		data() {
 			return {
+				type: 0,
 				total_price: '',
 				amount: '',
-				 phone: '',
-				 pUser: {}
+				phone: '',
+				pUser: {}
 			}
 		},
-		onLoad() {
-			
+		onLoad(opt) {
+			if (opt.type) {
+				this.type = opt.type
+			}
 		},
 		onShow() {
 			this.passUser()
 		},
 		onReachBottom() {
-			
+
 		},
 		onReady() {
-			
+
 		},
 		methods: {
 			passUser() {
@@ -65,19 +74,26 @@
 			},
 			createGs() {
 				let that = this
+				if(!that.total_price) {
+					return that.$api.msg('请输入挂售单价')
+				}
+				if(!that.amount) {
+					return that.$api.msg('请输入挂售数量')
+				}
+				
 				createGs({
 					total_price: that.total_price * that.amount,
 					amount: that.amount,
 					phone: that.phone,
-					type: 0
+					type: that.type
 				}).then(res => {
 					uni.showToast({
-						title:'挂售成功',
-						duration:2000
+						title: '挂售成功',
+						duration: 2000
 					});
-					setTimeout(()=> {
+					setTimeout(() => {
 						uni.navigateBack()
-					},1500)
+					}, 1500)
 				})
 			}
 		}
@@ -89,7 +105,7 @@
 		height: 135rpx;
 		background-color: #fff;
 		padding: 0 65rpx;
-		
+
 		.item-val {
 			width: 405rpx;
 			height: 87rpx;
@@ -98,12 +114,14 @@
 			text-align: center;
 			font-size: 36rpx;
 			font-weight: bold;
-			
+
 		}
+
 		.val-red {
 			color: #FD3B39;
 		}
 	}
+
 	.fwf {
 		font-size: 30rpx;
 		font-weight: bold;
@@ -112,10 +130,12 @@
 		padding-right: 65rpx;
 		background-color: #fff;
 		padding-bottom: 62rpx;
+
 		text {
 			color: #FD3B39;
 		}
 	}
+
 	.btn {
 		width: 616rpx;
 		height: 88rpx;
@@ -126,6 +146,6 @@
 		color: #FFFFFF;
 		line-height: 88rpx;
 		text-align: center;
-		margin: 60rpx auto ;
+		margin: 60rpx auto;
 	}
 </style>

+ 13 - 1
pages/zero/jfhz.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="item flex">
 			<view class="tit">
-				可兑换{{type == 1 ? '商城积分': '通证积分'}}
+				可兑换{{type == 1 ? '商城积分': (type== 3?'阅读积分':(type == 2? '余额宝': '通证积分'))}}
 			</view>
 			<input type="text" placeholder="" v-model="allNum" disabled/>
 		</view>
@@ -38,6 +38,14 @@
 				uni.setNavigationBarTitle({
 					title: '兑换复投积分'
 				})
+			}else if(this.type == 3) {
+				uni.setNavigationBarTitle({
+					title: '兑换余额宝'
+				})
+			}else if(this.type == 2) {
+				uni.setNavigationBarTitle({
+					title: '兑换阅读积分'
+				})
 			}
 			this.passUser()
 		},
@@ -56,6 +64,10 @@
 					this.loading = false
 					if(this.type == 1) {
 						this.allNum = res.data.integral*1
+					}else if( this.type == 3) {
+						this.allNum = res.data.points*1
+					}else if(this.type == 2){
+						this.allNum = res.data.freeze_points*1
 					}else {
 						this.allNum = res.data.pass ? res.data.pass:0
 					}

+ 524 - 0
pages/zero/order.vue

@@ -0,0 +1,524 @@
+<template>
+	<view class="content">
+		<view class="nav-wrap flex">
+			<view class="item" v-for="(nav,inden) in navList" :class="{'action': navCurrent == inden}"
+				@click="changeNav(inden)">
+				{{nav.tit}}
+			</view>
+		</view>
+		<view class="flex nav-list">
+			<view class="item" v-for="(item,index) in navList[navCurrent].list" :class="{'action': current == index}"
+				@click="changeNavT(index)">
+				{{item.tit}}
+			</view>
+		</view>
+		<swiper disable-touch :style="{'height': maxHeight}" class="scroll-wrap" :current="current">
+			<swiper-item v-for="navItem in navList[navCurrent].list">
+				<scroll-view scroll-y="true" :style="{'height': maxHeight}" @scrolltolower="getList">
+					<view class="order-wrap " v-for="orderItem in navItem.list">
+						<view class="flex m-info">
+							<image src="../../static/icon/gs-av.png" mode="" class="card-img"></image>
+							<text style=" display: inline-block;line-height: 55rpx;">1323456788911</text>
+						</view>
+						<view class="price">
+							¥{{orderItem.total_price}}
+						</view>
+						<view class="num">
+							数量:{{orderItem.amount}}
+						</view>
+						<view class="num">
+							{{ getTime(orderItem.add_time)}}
+						</view>
+						<view class="flex btn-list">
+							<view class="order-btn" v-if="orderItem.status == 0 && navCurrent == 1" @click="qxOrder(orderItem)">
+								取消交易
+							</view>
+							<view class="order-btn" v-if="orderItem.status == 1 && navCurrent == 0" @click="upPz(orderItem)">
+								上传凭证
+								<!-- v-if="orderItem.status == 1 && navCurrent == 0" -->
+							</view>
+							<view class="order-btn" v-if="orderItem.status == 2 && navCurrent == 0" @click="upPz(orderItem)">
+								修改凭证
+							</view>
+							<view class="order-btn" v-if="orderItem.status == 2" @click="lookimg(orderItem)">
+								查看凭证
+							</view>
+							<view class="order-btn" v-if="orderItem.status == 2 && navCurrent == 1" @click="auth(orderItem,-1)">
+								拒绝
+							</view>
+							<view class="order-btn" v-if="orderItem.status == 2 && navCurrent == 1" @click="auth(orderItem,1)">
+								通过
+							</view>
+							<view class="order-btn order-btn-hui" v-if="orderItem.status == 4">
+								已取消
+							</view>
+							<view class="order-btn order-btn-hui" v-if="orderItem.status == -1">
+								未通过
+							</view>
+						</view>
+					</view>
+					<empty v-if="navItem.loaded && navItem.list == 0"></empty>
+					<uni-load-more :status="navItem.loadingType" v-else></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+		<uni-popup ref="popup" type="center">
+			<view class="pz-wrap">
+				<view class="tit">
+					上传凭证
+				</view>
+				<image v-if="!pz" src="../../static/img/add.png" mode="" @click="upimg"></image>
+				<image v-else :src="pz" mode="" @click="upimg"></image>
+				<view class="btn" @click="goUp">
+					上传
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	
+	import empty from '@/components/empty.vue'
+	
+	import {
+		getGsList,
+		qxGs,
+		upEvaluation,
+		auth
+	} from '@/api/zero.js'
+	import { upload } from '@/api/order.js';
+	export default {
+		components: {
+			empty
+		},
+		data() {
+			return {
+				pzing: false,
+				orderId: '',
+				pz: '',
+				maxHeight: '',
+				navCurrent: 0, // 0-》买单 1-》卖单
+				current: 0, //二层次序
+				navList: [{
+						tit: '我的买单',
+						list: [{
+								tit: '全部',
+								status: -2,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							},
+							{
+								tit: '待支付',
+								status: 1,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							},
+							{
+								tit: '待审核',
+								status: 2,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							},
+							{
+								tit: '已完成',
+								status: 3,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							}
+						]
+					},
+					{
+						tit: '我的卖单',
+						list: [{
+								tit: '全部',
+								status: -2,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							},
+							{
+								tit: '挂售中',
+								status: 0,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							},
+							{
+								tit: '待支付',
+								status: 1,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							},
+							{
+								tit: '待审核',
+								status: 2,
+								list: [],
+								loadingType: 'more',
+								page: 1,
+								limit: 10,
+								loaded: false
+							}
+						]
+					}
+				]
+			}
+		},
+		computed: {
+			...mapState('user',['userInfo'])
+		},
+		onLoad() {
+			
+		},
+		onShow() {
+			this.getList()
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+			var that = this;
+			uni.getSystemInfo({
+				success: resu => {
+					const query = uni.createSelectorQuery();
+					query.select('.scroll-wrap').boundingClientRect();
+					query.exec(function(res) {
+						that.maxHeight = resu.windowHeight - res[0].top + 'px';
+					});
+				},
+				fail: res => {}
+			});
+		},
+		methods: {
+			auth(item,type) {
+				let that =this
+				uni.showModal({
+					title: '提示',
+					content: type == 1?'是否确认收款完成?': '是否确认当前提交的凭证没有通过审核',
+					complete(e) {
+						if(e.confirm) {
+							auth({
+								id: item.id,
+								auth: type
+							}).then(res => {
+								uni.showToast({
+									title:'审核成功',
+									duration:2000
+								});
+								that.getList('reload')
+							})
+						}
+					}
+					
+				})
+			},
+			// 取消交易
+			qxOrder(item) {
+				let that = this
+				uni.showModal({
+					title: '提示',
+					content: '是否确认取消挂售?',
+					complete(e) {
+						if(e.confirm) {
+							qxGs({
+								id: item.id
+							}).then(res => {
+								uni.showToast({
+									title:'取消成功',
+									duration:2000
+								});
+								that.getList('reload')
+							})
+						}
+					}
+					
+				})
+			},
+			upPz(item) {
+				if(item.up_files) {
+					this.pz = item.up_files
+				}
+				this.orderId = item.id
+				this.$refs.popup.open()
+			},
+			//上传凭证
+			goUp() {
+				if(this.pzing) {
+					return
+				}
+				if(!this.pz) {
+					return this.$api.msg('请上传凭证')
+				}
+				this.pzing = true
+				upEvaluation({
+					id: this.orderId,
+					up_files: this.pz
+				}).then(res => {
+					uni.showToast({
+						title:'上传成功',
+						duration:2000
+					});
+					this.$refs.popup.close()
+					this.orderId = ''
+					this.getList('reload')
+					this.pzing = false
+				}).catch(err => {
+					this.pzing = false
+				})
+			},
+			upimg() {
+				upload({
+					file: ''
+				})
+					.then(e => {
+						console.log(e,'e')
+					this.pz = e[0].url
+					console.log(this.pz)
+					})
+					.catch(e => {});
+			},
+			lookimg(item) {
+				let arr = item.up_files.split(',')
+				uni.previewImage({
+					current: 0,
+					loop: false,
+					urls: arr,
+					indicator: 'default'
+				});
+			},
+			getTime(time) {
+				const num =13 - (time+'').length;
+				let l = 1;//倍数
+				for (let i = 0; i < num; i++) {
+					l+='0';
+				}
+				// 重新解析为数字
+				l = parseInt(l)
+				const date = new Date(parseInt(time) * l);
+				const year = date.getFullYear();
+				const mon = date.getMonth() + 1;
+				const day = date.getDate();
+				const hours = date.getHours();
+				const minu = date.getMinutes();
+				const sec = date.getSeconds();
+				return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
+			},
+			// 切换nav
+			changeNav(index) {
+				if (index === this.navCurrent) {
+					return
+				}
+				console.log('切换');
+				this.navCurrent = index
+				this.getList('tab')
+			},
+			changeNavT(index) {
+				if (index === this.current) {
+					return
+				}
+				console.log('切换');
+				this.current = index
+				this.getList('tab')
+
+			},
+			getList(type) {
+				let that = this
+				let item = that.navList[that.navCurrent].list[that.current]
+				if(type == 'reload') {
+					item.page = 1
+					item.list = []
+					item.loadingType = 'more'
+					item.loaded = false
+				}
+				if (item.loadingType == 'loading' || item.loadingType == 'noMore') {
+					return
+				}
+				if (type == 'tab' && item.loaded) {
+					return
+				}
+				item.loadingType = 'loading'
+				let qdata = {
+					page: item.page,
+					limit: item.limit,
+					status: item.status,
+					type: 1,
+					order: 'id desc'
+				}
+				if(that.navCurrent == 1) {
+					qdata.uid = that.userInfo.uid
+				}else {
+					qdata.to_uid = that.userInfo.uid
+				}
+				getGsList(qdata).then(res => {
+					let arr = res.data.result.list
+					item.list = item.list.concat(arr)
+					if (item.limit == arr.length) {
+						item.loadingType = 'more'
+						item.page++
+					} else {
+						item.loadingType = 'noMore'
+					}
+					item.loaded = true
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.nav-wrap {
+
+		padding: 28rpx 30rpx 20rpx;
+		background-color: #fff;
+
+		.item {
+			width: 336rpx;
+			height: 81rpx;
+			border-radius: 10rpx;
+			border: 1px solid #EC5A54;
+			color: #EC5A54;
+			line-height: 80rpx;
+			text-align: center;
+		}
+
+		.action {
+			background-color: #EC5A54;
+			color: #fff;
+		}
+
+	}
+
+	.nav-list {
+		justify-content: space-around;
+		background-color: #fff;
+		font-weight: 500;
+		color: #333333;
+
+		.item {
+			padding: 28rpx 20rpx 16rpx;
+
+		}
+
+		.action {
+			color: #EC5A54;
+			border-bottom: 2px solid red;
+		}
+	}
+
+	.scroll-wrap {
+		padding-top: 20rpx;
+	}
+
+	.order-wrap {
+		width: 686rpx;
+		// height: 297rpx;
+		background: #FFFFFF;
+		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
+		border-radius: 20rpx;
+		margin: 0 auto 20rpx;
+		padding: 33rpx 40rpx;
+
+		.m-info {
+			justify-content: flex-start;
+
+			image {
+				width: 55rpx;
+				height: 55rpx;
+				margin-right: 13rpx;
+			}
+
+			text {
+				font-size: 28rpx;
+				font-weight: bold;
+				color: #333333;
+			}
+		}
+
+		.price {
+			font-size: 40rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #FF4C4C;
+			padding: 40rpx 0 30rpx;
+		}
+
+		.num {
+			font-size: 26rpx;
+			font-weight: 500;
+			color: #888785;
+		}
+		.btn-list {
+			border-top: 1px solid #eee;
+			margin-top: 20rpx;
+			padding-top: 20rpx;
+			justify-content: flex-end;
+		}
+		.order-btn {
+			width: 148rpx;
+			height: 62rpx;
+			border: 2px solid #FF5570;
+			border-radius: 30rpx;
+			line-height: 62rpx;
+			text-align: center;
+			font-size: 28rpx;
+			font-weight: bold;
+			color: #FF4C4C;
+			margin-left: 20rpx;
+		}
+		.order-btn-hui {
+			color: #aaa;
+			border: 2px solid #aaa;
+		}
+	}
+	.pz-wrap {
+		width: 550rpx;
+		// height: 500rpx;
+		background-color: #fff;
+		border-radius: 20rpx;
+		text-align: center;
+		font-size: 32rpx;
+		padding:40rpx;
+		image {
+			width: 250rpx;
+			height: 250rpx;
+		}
+		.tit {
+			font-weight: bold;
+			padding: 20rpx 0;
+		}
+		.btn {
+			background-color: $base-color;
+			padding:0 20rpx;
+			height: 65rpx;
+			border-radius: 25rpx;
+			width:250rpx;
+			color: #fff;
+			line-height: 60rpx;
+			margin:20rpx auto 0; 
+		}
+	}
+</style>

+ 2 - 2
pages/zero/ren.vue

@@ -21,7 +21,7 @@
 					观看视频赚阅读积分
 				</view>
 				<view class="">
-					观看可获得阅读积分{{ggInfo.valid_bcount}}{{index}}
+					观看可获得阅读积分
 				</view>
 			</view>
 			<view class="gg-btn" :class="{pass: ggInfo.valid_bcount*1 > index}" @click="ggInfo.valid_bcount*1 > index? '': goLock(index)">
@@ -77,7 +77,7 @@
 						data
 					}) => {
 						obj.setUserInfo(data);
-						obj.getLevelList()
+						// obj.getLevelList()
 					})
 					.catch(e => {
 						console.log(e);

+ 31 - 9
pages/zero/task.vue

@@ -8,8 +8,7 @@
 					<view class="u-name">
 						{{userInfo.phone}}
 					</view>
-					<image class="user-shop-icon" v-if="pUser.zero_level" :src="pUser.zero_level.icon" mode=""
-						></image>
+					<image class="user-shop-icon" v-if="pUser.zero_level" :src="pUser.zero_level.icon" mode=""></image>
 				</view>
 			</view>
 		</view>
@@ -45,8 +44,8 @@
 						余额:{{pUser[key.val]*1 || '0'}}
 					</view>
 				</view>
-				<!-- <view class="btn" v-if="key.hz" @click="navto('/pages/user/yjzz?type=3')">
-					互转/交易
+				<!-- <view class="btn" v-if="key.hz" @click="navto('/pages/zero/jfhz?type=3')">
+					兑换余额宝
 				</view> -->
 				<view class="btn" v-if="key.gs" @click="navto('/pages/zero/gs')">
 					挂售
@@ -57,8 +56,14 @@
 				<view class="btn" v-if="key.agent" @click="navto('/pages/zero/jfhz?type=1')">
 					兑换复投积分
 				</view>
+				<view class="btn" v-if="key.ygs" @click="navto('/pages/zero/gs?type=1')">
+					挂售
+				</view>
+				<view class="btn" v-if="key.ye" @click="navto('/pages/zero/jfhz?type=2')">
+					兑换阅读积分
+				</view>
 				<view class="more" @click="navto('/pages/user/sz?type=' + key.type)">
-					查看明细
+					明细
 				</view>
 				<image src="../../static/icon/back.png" mode="" class="black"></image>
 			</view>
@@ -71,7 +76,9 @@
 		mapState,
 		mapMutations
 	} from 'vuex';
-	import { passUser } from '@/api/zero.js'
+	import {
+		passUser
+	} from '@/api/zero.js'
 	import {
 		getUserInfo,
 		getLevelList
@@ -113,6 +120,18 @@
 						img: '../../static/icon/task3.png',
 						bgc: '#f7ecfc'
 					},
+					// {
+					// 	name: '余额宝',
+					// 	val: 'freeze_points',
+					// 	type: 11,
+					// 	hz: false,
+					// 	dy: false,
+					// 	agent: false,
+					// 	ye: true,
+					// 	ygs: true,
+					// 	img: '../../static/icon/task3.png',
+					// 	bgc: '#f7ecfc'
+					// },
 				]
 			}
 		},
@@ -138,9 +157,9 @@
 			showLevel(val) {
 				let data = this.listList.find(item => item.grade == val)
 				console.log(data);
-				if(data) {
+				if (data) {
 					return data.icon
-				}else {
+				} else {
 					return ''
 				}
 			},
@@ -189,6 +208,7 @@
 		background-image: url('../../static/img/calling.png');
 		background-size: contain;
 		margin: auto;
+
 		.avatar {
 			width: 106rpx;
 			height: 106rpx;
@@ -197,6 +217,7 @@
 			top: 40rpx;
 			left: 48rpx;
 		}
+
 		.u-name {
 			position: absolute;
 			top: 57rpx;
@@ -205,6 +226,7 @@
 			font-weight: bold;
 			color: #773B00;
 		}
+
 		.user-shop-icon {
 			position: absolute;
 			top: 110rpx;
@@ -277,7 +299,7 @@
 				font-size: 26rpx;
 				font-weight: 500;
 				color: #ff5050;
-				margin-right: 24rpx;
+				margin-right: 10rpx;
 			}
 
 			.more {