Browse Source

2021-8-18

cmy 4 years ago
parent
commit
5d062cae37

+ 10 - 0
api/set.js

@@ -45,10 +45,20 @@ export function applelogin(data) {
 }
 // #endif
 
+// 实名认证
 export function realName(data) {
 	return request({
 		url: '/api/realName',
 		method: 'post',
 		data
 	});
+}
+
+//交易密码设置
+export function transaction(data) {
+	return request({
+		url: '/api/transaction',
+		method: 'post',
+		data
+	});
 }

+ 28 - 1
api/user.js

@@ -26,7 +26,14 @@ export function spreadBanner(data) {
 		data
 	});
 }
-
+// 获取门店列表
+export function shopList(data) {
+	return request({
+		url: '/api/store_list',
+		method: 'get',
+		data
+	});
+}
 // 获取地址列表
 export function getAddressList(data) {
 	return request({
@@ -109,4 +116,24 @@ export function spread_people(data) {
 	});
 }
 
+//积分转账
+export function transfer(data) {
+	return request({
+		url: '/api/transfer',
+		method: 'post',
+		data
+	});
+}
+
+// 扫码核销
+export function orderVerific(data) {
+	return request({
+		url: '/api/order/order_verific',
+		method: 'post',
+		data
+	});
+}
+
+
+
 

+ 12 - 0
pages.json

@@ -153,6 +153,12 @@
 				"navigationBarTitleText": "设置"
 			}
 		},
+		{
+			"path": "pages/set/shopList",
+			"style": {
+				"navigationBarTitleText": "门店列表"
+			}
+		},
 		{
 			"path": "pages/set/address",
 			"style": {
@@ -226,6 +232,12 @@
 				}
 			}
 		},
+		{
+			"path": "pages/user/withdmoenys",
+			"style": {
+				"navigationBarTitleText": "积分转账"
+			}
+		},
 		{
 			"path": "pages/user/extension",
 			"style": {

+ 12 - 2
pages/money/pay.vue

@@ -57,7 +57,8 @@ export default {
 			// #ifdef H5
 			froms: '', //保存h5中数据来源对象
 			// #endif
-			pinkid: '' //保存拼团商品id
+			pinkid: '' ,//保存拼团商品id
+			shipping_type:0//提货方式类型
 		};
 	},
 	computed: {
@@ -73,12 +74,18 @@ export default {
 		} else {
 			this.orderKey = options.key;
 			let prepage = this.$api.prePage();
+			this.shipping_type = +options.addresstype+1;
+			uni.showLoading({
+				title: '数据载入...',
+				mask: true
+			});
 			computedOrderkey({
 				orderkey: this.orderKey,
 				couponId: prepage.couponChecked.id, //优惠券编号
 				addressId: prepage.addressData.id, //地址编号
 				useIntegral: prepage.checkedPoints ? 1 : 0
 			}).then(({ data }) => {
+				uni.hideLoading()
 				// 获取支付金额
 				this.money = data.result.pay_price;
 			});
@@ -239,8 +246,11 @@ export default {
 				// #ifdef APP-PLUS
 				from: 'app', //来源
 				// #endif
-				shipping_type: 1 //提货方式 1 快递 2自提
+				shipping_type: obj.shipping_type //提货方式 1 快递 2自提
 			};
+			if(obj.shipping_type==2){
+				data.store_id = prepage.shopAddress.id
+			}
 			// 判断是否拼团商品
 			if (obj.pinkid) {
 				data.pinkId = obj.pinkid;

+ 50 - 29
pages/order/createOrder.vue

@@ -23,10 +23,9 @@
 					<text>添加收货地址</text>
 				</view>
 			</view>
-
 			<image class="a-bg" :src="addressImg"></image>
 		</navigator>
-		<navigator v-if="tabCurrentIndex == 1" url="/pages/address/shopList" class="address-section">
+		<navigator v-if="tabCurrentIndex == 1" url="/pages/set/shopList" class="address-section">
 			<view class="order-content" v-if="shopAddress.name">
 				<text class="iconfont iconlocation"></text>
 				<view class="cen">
@@ -39,12 +38,11 @@
 				<text class="iconfont iconenter"></text>
 			</view>
 			<view class="order-content" v-if="!shopAddress.name">
-				<text class="addAddress">
+				<view class="addAddress">
 					<text class="iconfont iconaddition"></text>
 					<text>添加收货地址</text>
-				</text>
+				</view>
 			</view>
-
 			<image class="a-bg" :src="addressImg"></image>
 		</navigator>
 
@@ -60,7 +58,8 @@
 					<text class="title clamp">{{ ls.productInfo.store_name }}</text>
 					<text class="spec">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.suk : '默认' }}</text>
 					<view class="price-box">
-						<image src="../../static/icon/iconU1.png" class="imgJf" mode="widthFix"></image><text class="price"> {{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
+						<image src="../../static/icon/iconU1.png" class="imgJf" mode="widthFix"></image>
+						<text class="price">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
 						<text class="number">{{ 'x ' + ls.cart_num + (ls.productInfo.unit_name || '') }}</text>
 						<!-- <view><text class="price">¥{{lss.price}}</text></view> -->
 						<!-- <view class="number">
@@ -70,9 +69,18 @@
 				</view>
 			</view>
 		</view>
-
+		<view class="yt-list" v-if="tabCurrentIndex == 1">
+			<view class="yt-list-cell b-b">
+				<text class="cell-tit clamp">姓名</text>
+				<input class="desc" type="text" v-model="addressData.real_name" placeholder="请填写提货人姓名" placeholder-class="placeholder" />
+			</view>
+			<view class="yt-list-cell b-b">
+				<text class="cell-tit clamp">手机号</text>
+				<input class="desc" type="text" v-model="addressData.phone" placeholder="请填写手机号码" placeholder-class="placeholder" />
+			</view>
+		</view>
 		<!-- 优惠明细 -->
-		<view class="yt-list">
+		<!-- <view class="yt-list">
 			<view class="yt-list-cell b-b" @click="couponListshow ? toggleMask('show') : ''">
 				<view class="cell-icon">券</view>
 				<text class="cell-tit clamp">优惠券</text>
@@ -86,7 +94,7 @@
 				<text class="cell-tit clamp">商家促销</text>
 				<text class="cell-tip disabled">满{{ moneyAll.storeFreePostage }}包邮</text>
 			</view>
-		</view>
+		</view> -->
 		<!-- 金额明细 -->
 		<view class="yt-list">
 			<!-- <view class="yt-list-cell b-b">
@@ -156,8 +164,8 @@
 </template>
 
 <script>
-import { confirm,computedOrderkey,couponsOrder } from '@/api/order.js';
-import { userinfo } from '@/api/user.js';
+import { confirm, computedOrderkey, couponsOrder } from '@/api/order.js';
+import { getUserInfo } from '@/api/user.js';
 import { cartAdd } from '@/api/product.js';
 export default {
 	data() {
@@ -184,7 +192,10 @@ export default {
 			couponListshow: false, //是有可以显示优惠券列表
 			couponChecked: {}, //选中的优惠券
 			// 收货地址
-			addressData: {},
+			addressData: {
+				real_name:'',
+				phone:''
+			},
 			// 店铺地址
 			shopAddress: {
 				name: '',
@@ -270,7 +281,7 @@ export default {
 		},
 		// 加载用户基础信息
 		userinfo() {
-			userinfo({}).then(({ data }) => {
+			getUserInfo({}).then(({ data }) => {
 				this.integralAll = data.integral;
 			});
 		},
@@ -283,7 +294,7 @@ export default {
 				addressId: this.addressData.id //地址编号
 			})
 				.then(({ data }) => {
-					console.log(data,'111');
+					console.log(data, '111');
 					this.payType = true;
 					this.integralShow = true;
 					// 获取支付金额
@@ -306,14 +317,14 @@ export default {
 			this.payMoneyNub();
 		},
 		// 加载优惠券列表
-		couponsOrder(money) {
-			couponsOrder({}, money).then(e => {
-				if (e.data.length > 0) {
-					this.couponListshow = true;
-				}
-				this.couponList = e.data;
-			});
-		},
+		// couponsOrder(money) {
+		// 	couponsOrder({}, money).then(e => {
+		// 		if (e.data.length > 0) {
+		// 			this.couponListshow = true;
+		// 		}
+		// 		this.couponList = e.data;
+		// 	});
+		// },
 		//顶部tab点击
 		tabClick(index) {
 			this.tabCurrentIndex = index;
@@ -329,7 +340,7 @@ export default {
 		},
 		loadData() {
 			let obj = this;
-			confirm({ cartId: obj.cartId+'' }).then(({ data }) => {
+			confirm({ cartId: obj.cartId + '' }).then(({ data }) => {
 				obj.addressData = data.addressInfo || {};
 				obj.shopList = data.cartInfo; //商品列表
 				obj.moneyAll = data.priceGroup; //金额数据
@@ -337,7 +348,7 @@ export default {
 				// 计算金额
 				this.payMoneyNub();
 				// 加载优惠券
-				obj.couponsOrder(data.priceGroup.totalPrice);
+				// obj.couponsOrder(data.priceGroup.totalPrice);
 			});
 		},
 		// 购买数量变化
@@ -354,13 +365,23 @@ export default {
 				this.$api.msg('积分商品只可单件购买');
 				return false;
 			}
-			if (!this.addressData.real_name) {
+			if(this.tabCurrentIndex == 1){
+				if (!this.addressData.real_name) {
+					this.$api.msg('请填写姓名');
+					return false;
+				}
+				if (!this.addressData.phone) {
+					this.$api.msg('请填写手机号');
+					return false;
+				}
+			}
+			if (!this.addressData.real_name && this.tabCurrentIndex == 0) {
 				this.$api.msg('请选择收货地址');
 				return false;
 			}
-			let url =  '/pages/money/pay?key='+ this.orderKey
-			if(this.pinkid){
-				url += '&pinkid='+this.pinkid
+			let url = '/pages/money/pay?key=' + this.orderKey + '&addresstype=' + this.tabCurrentIndex;
+			if (this.pinkid) {
+				url += '&pinkid=' + this.pinkid;
 			}
 			uni.navigateTo({
 				url
@@ -535,7 +556,7 @@ page {
 			font-size: 32rpx;
 			color: $font-color-dark;
 			padding-top: 10rpx;
-			.imgJf{
+			.imgJf {
 				width: 23rpx;
 			}
 			.price {

File diff suppressed because it is too large
+ 37 - 36
pages/order/orderDetail.vue


+ 1 - 1
pages/product/product.vue

@@ -28,7 +28,7 @@
 					<view class="right">
 						<text class="name">{{ goodsObjact.store_name }}</text>
 						<text class="price">积分{{ actionPrice * goodsNumber }}</text>
-						<text class="stock">库存:{{ goodsStore }}件</text>
+						<!-- <text class="stock">库存:{{ goodsStore }}件</text> -->
 						<view class="selected" v-if="specList != ''">
 							已选:
 							<text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>

+ 1 - 1
pages/public/login.vue

@@ -213,7 +213,7 @@ export default {
 								showCancel: false,
 								success: res => {
 									uni.navigateTo({
-										url: '/pages/user/approve',
+										url: '/pages/set/approve',
 									});
 								},
 							});

+ 1 - 1
pages/set/approve.vue

@@ -9,7 +9,7 @@
 			<view class="title">上传人脸正面照片</view>
 			<view class="imgUp" @click.stop="upImg"><image class="img" :src="form.img || '../../static/img/upImgbg.png'" mode="scaleToFill"></image></view>
 		</view>
-		<button class="add-btn" @click="pushData('add')">新增地址</button>
+		<button class="add-btn" @click="pushData('add')">提交</button>
 	</view>
 </template>
 

+ 48 - 45
pages/set/password.vue

@@ -1,17 +1,21 @@
 <template>
 	<view class="container">
-		<view class="row b-b">
-			<text class="tit">手机号</text>
-			<input class="input" v-model="account" type="text" placeholder="请填写手机号" placeholder-class="placeholder" />
+		<view class="row b-b" v-if="userInfo.transaction">
+			<text class="tit">原密码</text>
+			<input class="input" v-model="oldPassword" type="text" placeholder="请填写原密码" placeholder-class="placeholder" />
 		</view>
-		<view class="row b-b">
+		<!-- <view class="row b-b">
 			<text class="tit">验证码</text>
 			<input class="input" v-model="captcha" type="text" placeholder="请填写验证码" placeholder-class="placeholder" />
 			<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
-		</view>
+		</view> -->
 		<view class="row b-b">
 			<text class="tit">新密码</text>
-			<input class="input" v-model="password" type="password" placeholder="请填写新密码" placeholder-class="placeholder" />
+			<input class="input" v-model="password" type="password" placeholder="请填写6位新密码" placeholder-class="placeholder" />
+		</view>
+		<view class="row b-b">
+			<text class="tit">再次输入</text>
+			<input class="input" v-model="yzpassword" type="password" placeholder="请重新填写6位新密码" placeholder-class="placeholder" />
 		</view>
 		<button class="add-btn" :class="{'bg-gray':loding}" @click="loding?'':confirm()">提交</button>
 	</view>
@@ -20,20 +24,22 @@
 <script>
 import { verify } from '@/api/login.js';
 import { mapState } from 'vuex';
-import { registerReset } from '@/api/set.js';
+import { transaction } from '@/api/set.js';
 export default {
 	data() {
 		return {
 			time: '', //保存倒计时对象
 			countDown: 0, //倒计时
-			account: '', //手机号
-			captcha: '', //验证码
+			// account: '', //手机号
+			// captcha: '', //验证码
+			oldPassword:'',//老密码
 			password: '' ,//新密码
+			yzpassword:'',//重复输入
 			loding:false,//是否载入中
 		};
 	},
 	computed: {
-		...mapState(['userInfo'])
+		...mapState('user',['userInfo'])
 	},
 	onLoad() {
 		if(this.userInfo.phone == null){
@@ -52,46 +58,43 @@ export default {
 		}
 	},
 	methods: {
-		//发送验证码
-		verification() {
-			let obj = this;
-			if (this.account == '') {
-				this.$api.msg('请输入电话号码');
-				return;
-			}
-			if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.account)) {
-				this.$api.msg('请输入正确的手机号');
-				return;
+		confirm(e) {
+			const reg = /^[0-9]{6}$/;
+			if(!reg.test(+this.yzpassword)){
+				uni.showModal({
+					title: '错误',
+					content: '请输入6位数字支付密码',
+					showCancel: false,
+				});
+				return false
 			}
-			// 判断是否在倒计时
-			if (obj.countDown > 0) {
-				return false;
-			} else {
-				obj.countDown = 60;
-				obj.time = setInterval(() => {
-					obj.countDown--;
-				}, 1000);
-				//调用验证码接口
-				verify({
-					phone: obj.account,
-					type: ''
-				})
-					.then(({ data }) => {})
-					.catch(err => {
-						console.log(err);
-					});
+			if(this.yzpassword!=this.password){
+				uni.showModal({
+					title: '错误',
+					content: '密码不一致请重新输入',
+					showCancel: false,
+				});
+				return  false
 			}
-		},
-		confirm(e) {
 			this.loding = true;
-			registerReset({
-				account: this.account,
-				captcha: this.captcha,
-				password: this.password,
+			transaction({
+				pass: +this.password,
+				oldpass: +this.oldPassword,
 			})
 				.then(({ data }) => {
 					this.loding = false;
-					this.$api.msg('修改成功');
+					uni.showModal({
+						title: '提示',
+						content: '修改成功',
+						showCancel: false,
+						confirmText: '返回个人中心',
+						success: res => {
+							uni.switchTab({
+								url:'/pages/user/user'
+							})
+						}
+					});
+					
 				})
 				.catch(err => {
 					this.loding = false;
@@ -142,7 +145,7 @@ page {
 	margin: 60rpx auto;
 	font-size: $font-lg;
 	color: #fff;
-	background-color: $base-color;
+	background: $bg-green-gradual;
 	border-radius: 10rpx;
 	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
 }

+ 3 - 2
pages/set/set.vue

@@ -5,6 +5,7 @@
 			<!-- <uni-list-item title="修改密码" @click="navTo('/pages/set/password')" ></uni-list-item> -->
 		    <!-- <uni-list-item title="实名认证" @click="navTo('/pages/set/approve')" ></uni-list-item> -->
 		    <uni-list-item title="收货地址" @click="navTo('/pages/set/address')" ></uni-list-item>
+		    <uni-list-item title="交易密码" @click="navTo('/pages/set/password')" ></uni-list-item>
 		</uni-list>
 		<!-- <uni-list class="margin-t-20">
 		    <uni-list-item title="消息推送" :switch-checked='true' :show-switch="true" :show-arrow="false" switch-color='#5dbc7c'  @switchChange='switchChange'> 
@@ -19,9 +20,9 @@
 				</template>
 			</uni-list-item>
 		</uni-list> -->
-		<!-- <view class="list-cell log-out-btn" @click="toLogout">
+		<view class="list-cell log-out-btn" @click="toLogout">
 			<text class="cell-tit">退出登录</text>
-		</view> -->
+		</view>
 	</view>
 </template>
 

+ 186 - 0
pages/set/shopList.vue

@@ -0,0 +1,186 @@
+<template>
+	<view class="content b-t">
+		<view class="list" v-for="(item, index) in addressList" :key="index" @click="checkAddress(item)">
+			<view class="wrapper">
+				<view class="address-box">
+					<text class="name">{{ item.name }}</text>
+					<text class="mobile">{{ item.phone }}</text>
+				</view>
+				<view class="u-box">
+					<view class="address">{{ item.address }}</view>
+					<view class="address">{{ item.detailed_address }}</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import { shopList } from '@/api/user.js';
+export default {
+	data() {
+		return {
+			source: 0,
+			addressList: [], //显示的地址数据
+			value: '', //保存查询值
+			addressListAll: [] //保存地址数据
+		};
+	},
+	// #ifdef APP-PLUS || H5
+	onNavigationBarButtonTap(e) {
+		if (e.text === '搜索') {
+			this.searchAddressList();
+		}
+	},
+	// 监听原生标题栏搜索输入框输入内容变化事件
+	onNavigationBarSearchInputChanged(e) {
+		this.value = e.text;
+	},
+	// 监听原生标题栏搜索输入框搜索事件,用户点击软键盘上的“搜索”按钮时触发
+	onNavigationBarSearchInputConfirmed() {
+		this.searchAddressList();
+	},
+	// #endif
+	onLoad(option) {
+		console.log(this.addressListAll);
+		this.shopList();
+	},
+	methods: {
+		// 获取地址列表
+		shopList(){
+			uni.showLoading({
+				title: '加载中',
+				mask: true
+			});
+			shopList({}).then((e) => {
+				uni.hideLoading()
+				this.addressListAll = this.addressList= e.data.list;
+			}).catch((e) => {
+				console.log(e);
+			});
+		},
+		// 地址查询功能
+		searchAddressList() {
+			let obj = this;
+			obj.addressList = obj.addressListAll.filter(e => {
+				// 判断客户是否有输入值并且能查询到
+				if (e.name.indexOf(obj.value) >= 0 && obj.value) {
+					return true;
+				} else if (obj.value.length == 0) {
+					return true;
+				}
+			});
+			console.log(obj.addressList);
+		},
+		//选择地址
+		checkAddress(item) {
+			// 设置商品页面地址
+			this.$api.prePage().shopAddress = item;
+			uni.navigateBack();
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	padding-bottom: 120rpx;
+	padding-top: 20rpx;
+}
+.content {
+	position: relative;
+}
+.list {
+	align-items: center;
+	padding: 20rpx 30rpx;
+	background: #fff;
+	margin: 20rpx;
+	margin-top: 0;
+	.buttom {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding-top: 10rpx;
+		.checkbox {
+			font-size: 44rpx;
+			line-height: 1;
+			padding: 4rpx;
+			color: $font-color-disabled;
+			background: #fff;
+			border-radius: 50px;
+		}
+		.checkbox.checked {
+			color: $base-color;
+		}
+		.default-buttom {
+			display: flex;
+			align-items: center;
+		}
+		.operation {
+			display: flex;
+			align-items: center;
+			.blank {
+				width: 30rpx;
+			}
+		}
+		.text {
+			padding-left: 10rpx;
+			font-size: 24rpx;
+			color: #666666;
+		}
+	}
+}
+.wrapper {
+	display: flex;
+	flex-direction: column;
+	flex: 1;
+	// border-bottom: 1px solid #f0f0f0;
+	// padding-bottom: 20rpx;
+}
+.address-box {
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	.address {
+		font-size: $font-base + 2rpx;
+		color: $font-color-dark;
+	}
+	.mobile {
+		font-size: $font-base;
+		color: rgba(51, 51, 51, 1);
+	}
+}
+.u-box {
+	font-size: $font-base;
+	color: $font-color-light;
+	margin-top: 16rpx;
+	.name {
+		margin-right: 30rpx;
+	}
+}
+.icon-bianji {
+	display: flex;
+	align-items: center;
+	height: 80rpx;
+	font-size: 40rpx;
+	color: $font-color-light;
+	padding-left: 30rpx;
+}
+
+.add-btn {
+	position: fixed;
+	left: 30rpx;
+	right: 30rpx;
+	bottom: 16rpx;
+	z-index: 95;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 690rpx;
+	height: 80rpx;
+	font-size: $font-lg;
+	color: #fff;
+	background-color: $base-color;
+	border-radius: 10rpx;
+}
+</style>

+ 45 - 66
pages/user/user.vue

@@ -13,10 +13,10 @@
 			</view>
 			<view class="rightBox">
 				<view class="rz" v-if="userInfo.is_real">
-					已认证
+					已认证 
 				</view>
 				<view class="card" v-if="userInfo.card_no">
-					{{userInfo.card_no}}
+					NO.{{userInfo.card_no}}
 				</view>
 				<view class="zc" v-if="userInfo.spread_store">
 					{{userInfo.spread_store}}
@@ -68,10 +68,11 @@
 			<view class="history-section icon">
 				<uni-list>
 					<uni-list-item title="我的积分" @click="navTo('/pages/money/wallet')" thumb="/static/icon/v1.png"></uni-list-item>
-					<uni-list-item title="积分转账" @click="navTo('/pages/user/coupon')" thumb="/static/icon/v2.png"></uni-list-item>
+					<uni-list-item title="积分转账" @click="navTo('/pages/user/withdmoenys')" thumb="/static/icon/v2.png"></uni-list-item>
 					<uni-list-item title="我的推广" @click="navTo('/pages/user/extension')" thumb="/static/icon/v3.png"></uni-list-item>
 					<uni-list-item title="邀请海报" @click="navTo('/pages/user/shareQrCode')" thumb="/static/icon/v4.png"></uni-list-item>
 					<uni-list-item title="收货地址" @click="navTo('/pages/set/address')" thumb="/static/icon/v5.png"></uni-list-item>
+					<uni-list-item title="核销" @click="openQr" thumb="/static/icon/v5.png"></uni-list-item>
 					<uni-list-item title="设置" @click="navTo('/pages/set/set')" thumb="/static/icon/v6.png"></uni-list-item>
 				</uni-list>
 			</view>
@@ -82,7 +83,7 @@
 import { mapState, mapMutations } from 'vuex';
 import uniList from '@/components/uni-list/uni-list.vue';
 import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
-import { orderData, getUserInfo } from '@/api/user.js';
+import { orderData, getUserInfo,orderVerific } from '@/api/user.js';
 import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 let startY = 0,
 	moveY = 0,
@@ -130,26 +131,6 @@ export default {
 			)
 			.exec();
 	},
-	// #ifndef MP
-	// onNavigationBarButtonTap(e) {
-	// 	const index = e.index;
-	// 	if (index === 0) {
-	// 		this.navTo('/pages/set/set');
-	// 	} else if (index === 1) {
-	// 		// #ifdef APP-PLUS
-	// 		const pages = getCurrentPages();
-	// 		const page = pages[pages.length - 1];
-	// 		const currentWebview = page.$getAppWebview();
-	// 		currentWebview.hideTitleNViewButtonRedDot({
-	// 			index
-	// 		});
-	// 		// #endif
-	// 		uni.navigateTo({
-	// 			url: '/pages/user/notice'
-	// 		});
-	// 	}
-	// },
-	// #endif
 	computed: {
 		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
 	},
@@ -207,49 +188,46 @@ export default {
 				});
 			}
 		},
-
-		/**
-		 *  会员卡下拉和回弹
-		 *  1.关闭bounce避免ios端下拉冲突
-		 *  2.由于touchmove事件的缺陷(以前做小程序就遇到,比如20跳到40,h5反而好很多),下拉的时候会有掉帧的感觉
-		 *    transition设置0.1秒延迟,让css来过渡这段空窗期
-		 *  3.回弹效果可修改曲线值来调整效果,推荐一个好用的bezier生成工具 http://cubic-bezier.com/
-		 */
-		coverTouchstart(e) {
-			// console.log(e);
-			if (pageAtTop === false) {
-				return;
-			}
-
-			this.coverTransition = 'transform .1s linear';
-			startY = e.touches[0].clientY;
-		},
-		coverTouchmove(e) {
-			// console.log(e);
-			moveY = e.touches[0].clientY;
-			let moveDistance = moveY - startY;
-			let maxDowm = this.userMaxDowm;
-			let Dowm = this.userDowm;
-			if (moveDistance < 0) {
-				this.moving = false;
-				return;
-			}
-			this.moving = true;
-			if (moveDistance >= Dowm && moveDistance < maxDowm) {
-				moveDistance = Dowm;
-			}
-
-			if (moveDistance > 0 && moveDistance <= Dowm) {
-				this.coverTransform = `translateY(${moveDistance}px)`;
-			}
+		// 核销
+		openQr() {
+			let obj = this;
+			// #ifndef H5
+			uni.scanCode({
+				success(e) {
+					obj.orderVerific(e.result);
+				}
+			});
+			// #endif
+			// #ifdef H5
+			this.weichatObj.scanQRCode({
+				needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
+				scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
+				success: function(res) {
+					obj.orderVerific(res.resultStr); // 当needResult 为 1 时,扫码返回的结果
+				}
+			});
+			// #endif
 		},
-		coverTouchend() {
-			if (this.moving === false) {
-				return;
-			}
-			this.moving = false;
-			this.coverTransition = 'transform 0.3s cubic-bezier(.21,1.93,.53,.64)';
-			this.coverTransform = 'translateY(0px)';
+		// 核销请求
+		orderVerific(data) {
+			orderVerific({
+				verify_code: data
+			})
+				.then(e => {
+					uni.showModal({
+						title: '核销',
+						content: '已核销成功',
+						showCancel: false
+					});
+				})
+				.catch(e => {
+					uni.showModal({
+						title: '错误',
+						content: JSON.stringify(e),
+						showCancel: false
+					});
+					console.log(e);
+				});
 		}
 	}
 };
@@ -316,6 +294,7 @@ page {
 	.rightBox{
 		color: white;
 		position: absolute;
+		text-align: right;
 		bottom: 0;
 		right: 0;
 		padding-right: 20rpx;

+ 245 - 0
pages/user/withdmoenys.vue

@@ -0,0 +1,245 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<view class="flex">
+				<view class="buttom">
+					<view class="icon">{{ userInfo.now_money | getMoneyStyle }}</view>
+					<text class="text">可用积分</text>
+				</view>
+			</view>
+		</view>
+		<view class="row-box">
+			<view class="title">转账金额</view>
+			<view class="row">
+				<text class="tit">¥</text>
+				<input class="input" type="number" v-model="withdrawal" placeholder='转入金额' placeholder-class="placeholder" />
+				<view class="buttom" @click="withdrawal = userInfo.now_money">全部转账</view>
+			</view>
+		</view>
+		<u-form ref="uForm" class="item">
+			<u-form-item label-width='150' label="会员卡号"><u-input type="text" v-model="card" /></u-form-item>
+			<u-form-item label-width='150' label="支付密码"><u-input type="password" v-model="password" /></u-form-item>
+		</u-form>
+		<button class="add-btn up" :class="{'action':loding}" @click="!loding?confirm():''">转入</button>
+	</view>
+</template>
+
+<script>
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import { getUserInfo,transfer } from '@/api/user.js';
+import { mapMutations,mapState } from 'vuex';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	data() {
+		return {
+			money: '0.00', //可提现金额
+			withdrawal: '', //提现金额
+			password:'',//支付密码
+			card:'',//转账卡号
+			// #ifdef H5
+			weichatBsrowser: false,
+			// #endif
+			loding:false,
+		};
+	},
+	onLoad(options) {
+		// #ifdef H5
+		this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
+		// #endif
+		this.dataUp();
+	},
+	computed: {
+		...mapState('user', ['userInfo']) 
+	},
+	methods: {
+		...mapMutations('user', ['setUserInfo', 'login']),
+		// 更新数据
+		dataUp(){
+			let obj = this;
+			getUserInfo({}).then((e) => {
+				obj.login();
+				// 保存返回用户数据
+				obj.setUserInfo(e.data);
+			}).catch((e) => {
+				console.log(e);
+			})
+		},
+		// 切换选中对象
+		tabRadio(e) {
+			this.type = e.detail.value;
+		},
+		// 提交
+		confirm() {
+			let obj = this;
+			obj.loding = true;
+			let data = {
+				card_no:obj.card, //卡号
+				pass: obj.password, //交易密码
+				merber: obj.withdrawal //金额
+			}
+			transfer(data)
+				.then(e => {
+					// 允许按钮点击
+					obj.loding = false;
+					// 初始化提现金额
+					obj.withdrawal = ''
+					uni.showToast({
+						title: '提交成功',
+						duration: 2000,
+						position: 'top'
+					});
+					obj.dataUp();
+				})
+				.catch(e => {
+					obj.loding = false;
+					console.log();
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	height: 100%;
+}
+.content-money {
+	padding: 30rpx 0;
+	background: #ffffff;
+}
+
+.item{
+	padding: 0 $page-row-spacing;
+	background-color: #FFFFFF;
+}
+.flex {
+	background-color: #ffffff;
+	text-align: center;
+	margin: 0 30rpx;
+	border-radius: $border-radius-sm;
+	justify-content: center;
+	.buttom {
+		font-size: $font-lg;
+		width: 50%;
+	}
+	.interval {
+		width: 2px;
+		height: 60rpx;
+		background-color: #eeeeee;
+	}
+	.icon {
+		background-size: 100%;
+		font-size: 42rpx;
+		color: $font-color-dark;
+		font-weight: bold;
+		background-repeat: no-repeat;
+		background-position: center;
+	}
+	.text {
+		color: $font-color-light;
+	}
+}
+
+.row-box {
+	margin-top: 30rpx;
+	padding: 20rpx 30rpx;
+	background: #fff;
+	.title {
+		font-size: $font-base + 2rpx;
+		color: $font-color-dark;
+	}
+	.row {
+		display: flex;
+		align-items: center;
+		position: relative;
+		height: 80rpx;
+		.tit {
+			flex-shrink: 0;
+			width: 40rpx;
+			font-size: 30rpx;
+			color: $font-color-dark;
+		}
+		.input {
+			flex: 1;
+			font-size: 30rpx;
+			color: $font-color-dark;
+		}
+		.iconlocation {
+			font-size: 36rpx;
+			color: $font-color-light;
+		}
+
+		.buttom {
+			color: $base-color;
+			font-size: $font-base;
+		}
+	}
+}
+.add-btn {
+	&.modified {
+		color: $base-color;
+	}
+	&.up {
+		background: $bg-green-gradual;
+		color: #fff;
+	}
+	&.action{
+		background-color: $color-gray;
+	}
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 690rpx;
+	height: 80rpx;
+	margin: 0 auto;
+	margin-top: 30rpx;
+	font-size: $font-lg;
+	border-radius: 10rpx;
+	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
+}
+
+.list {
+	padding-left: 30rpx;
+	margin-top: 30rpx;
+	background-color: #ffffff;
+	.box {
+		display: flex;
+		align-items: center;
+		width: 100%;
+		height: 120rpx;
+		border-bottom: 1px solid $border-color-light;
+		.icon {
+			font-size: 48rpx;
+			padding-right: 20rpx;
+			.icon-img {
+				height: 50rpx;
+				width: 50rpx;
+			}
+		}
+		.iconweixin1 {
+			color: #18bf16;
+		}
+		.iconzhifubao {
+			color: #08aaec;
+		}
+		.title-box {
+			flex-grow: 1;
+			text-align: left;
+			.title {
+				font-size: $font-base + 2rpx;
+				color: $font-color-base;
+			}
+			.node {
+				font-size: $font-sm;
+				color: $font-color-light;
+			}
+		}
+	}
+}
+/deep/ .uni-radio-input {
+	width: 45rpx;
+	height: 45rpx;
+}
+</style>

BIN
static/img/upImgbg.png


Some files were not shown because too many files changed in this diff