Browse Source

2023-11-17

cmy 1 năm trước cách đây
mục cha
commit
36dc776ed1

+ 34 - 1
api/user.js

@@ -78,7 +78,40 @@ export function registerVerify(data) {
 		noAuth: true
 	});
 }
-
+/**
+ * 绑定银行卡发送验证码
+ * @param data object 用户手机号
+ */
+export function bindCardVerify(data) {
+	return request.post("user/agree/sms", data, {
+		noAuth: true
+	});
+}
+/**
+ * 银行卡签约
+ * @param data object 用户手机号
+ */
+export function saveCardBind(data) {
+	return request.post("user/agree/save", data, {
+		noAuth: true
+	});
+}
+/**
+ * 银行卡解约
+ */
+export function bankCancel(data) {
+	return request.post("user/agree/cancel", data, {
+		noAuth: true
+	});
+}
+/**
+ * 签约状态
+ */
+export function getCardBindStatus(data) {
+	return request.get("user/agree/status", data, {
+		noAuth: true
+	});
+}
 /**
  * h5用户手机号注册
  * @param data object 用户手机号 验证码 密码

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "御康堂",
     "appid" : "__UNI__A07DF11",
     "description" : "御康堂",
-    "versionName" : "5.1.7",
-    "versionCode" : 517,
+    "versionName" : "5.1.8",
+    "versionCode" : 518,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 15 - 2
pages.json

@@ -346,6 +346,19 @@
 						}
 					}
 				},
+				{
+					"path": "user_bind/index",
+					"style": {
+						"navigationBarTitleText": "绑定汇聚支付",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
 				{
 					"path": "privacy/index",
 					"style": {
@@ -526,7 +539,7 @@
 							"scrollIndicator": "none"
 						}
 					}
-				}, 
+				},
 				{
 					"path": "binding_phone/index",
 					"style": {
@@ -1698,4 +1711,4 @@
 		}]
 	},
 	"embeddedAppIdList": ["wxef277996acc166c3"] //通联支付appid
-}
+}

+ 37 - 1
pages/goods/cashier/index.vue

@@ -92,6 +92,13 @@
 						value: 'friend',
 						title: this.$t(`找微信好友支付`),
 						payStatus: 1,
+					},
+					{
+						"name": this.$t(`汇聚支付`),
+						"icon": "icon-yuezhifu1",
+						value: 'huijupay',
+						title: this.$t(`使用汇聚支付`),
+						payStatus: 1,
 					}
 				],
 				orderId: 0,
@@ -303,7 +310,21 @@
 						friendPay = '/pages/users/payment_on_behalf/index?order_id=' + this.orderId +
 						'&spread=' +
 						this
-						.$store.state.app.uid
+						.$store.state.app.uid;
+						if (paytype == 'huijupay' && that.orderId) {
+							uni.hideLoading();
+							uni.reLaunch({
+								url: goPages
+							})
+							return ;
+						}
+					if (paytype == 'huijupay' && that.orderId) {
+						uni.hideLoading();
+						uni.reLaunch({
+							url:goPages
+						})
+						return
+					}
 					switch (status) {
 						case 'ORDER_EXIST':
 						case 'EXTEND_ORDER':
@@ -592,6 +613,21 @@
 
 				}).catch(err => {
 					uni.hideLoading();
+					if (paytype == 'huijupay') {
+						if(err=='无签约记录'){
+							uni.showModal({
+								title: '错误',
+								content: '您未签约是否立即签约',
+								success: res => {
+									if(res.confirm){
+										uni.reLaunch({
+											url:'/pages/users/user_bind/index'
+										})
+									}
+								},
+							});
+						}
+					}
 					return that.$util.Tips({
 						title: err
 					}, () => {

+ 1 - 1
pages/user/index.vue

@@ -111,7 +111,7 @@
 							</view>
 							<!-- <view class="num-item" v-else -->
 							<view class="num-item"
-								@click="goMenuPage('/pages/users/user_spread_money/index')">
+								@click="goMenuPage('/pages/users/user_spread_money/index?type=2')">
 								<text class="num">{{userInfo.brokerage_price || 0}}</text>
 								<view class="txt">{{$t('佣金')}}</view>
 							</view>

BIN
pages/users/static/bankcard.png


BIN
pages/users/static/idcard.png


BIN
pages/users/static/name.png


+ 281 - 0
pages/users/user_bind/index.vue

@@ -0,0 +1,281 @@
+<template>
+	<view class="login-wrapper" :style="colorStyle">
+		<view class="whiteBg">
+			<view class="list">
+				<view class="item">
+					<view class="acea-row row-middle">
+						<image src="../static/bankcard.png" style="width: 34rpx;" mode="widthFix"></image>
+						<input type="text" :placeholder="$t(`输入银行卡号`)" v-model="bank_code" />
+					</view>
+				</view>
+				<view class="item">
+					<view class="acea-row row-middle">
+						<image src="../static/name.png" style="width: 34rpx;" mode="widthFix"></image>
+						<input type="text" :placeholder="$t(`姓名`)" v-model="payer_name"  />
+					</view>
+				</view>
+				<view class="item">
+					<view class="acea-row row-middle">
+						<image src="../static/bankcard.png" style="width: 34rpx; " mode="widthFix"></image>
+						<input type="text" :placeholder="$t(`身份证号`)" v-model="id_card" />
+					</view>
+				</view>
+				<view class="item">
+					<view class="acea-row row-middle">
+						<image src="../static/phone_1.png" style="width: 24rpx; " mode="widthFix"></image>
+						<input type="text" :placeholder="$t(`输入手机号码`)" v-model="account" :maxlength="11" />
+					</view>
+				</view>
+				<view class="item">
+					<view class="acea-row row-middle">
+						<image src="../static/code_2.png" style="width: 28rpx;" mode="widthFix"></image>
+						<input type="text" :placeholder="$t(`填写验证码`)" :maxlength="6" class="codeIput"
+							v-model="captcha" />
+						<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
+							{{ text }}
+						</button>
+					</view>
+				</view>
+			</view>
+			<view class="logon" v-if="!bindCard" @click="loginMobile">{{$t(`绑定`)}}</view>
+			<view class="logon" v-else @click="cancelBind">{{$t(`取消签约`)}}</view>
+			<!-- TODO -->
+		</view>
+		<Verify @success="success" :captchaType="captchaType" :imgSize="{ width: '330px', height: '155px' }"
+			ref="verify"></Verify>
+	</view>
+</template>
+<script>
+	import sendVerifyCode from "@/mixins/SendVerifyCode";
+	import {
+		saveCardBind,
+		bindCardVerify,
+		getCodeApi,
+		getUserInfo,
+		getCardBindStatus,
+		bankCancel
+	} from "@/api/user";
+	import colors from '@/mixins/color.js';
+	import Verify from '../components/verify/index.vue';
+	export default {
+		name: "Login",
+		components: {
+			Verify
+		},
+		mixins: [sendVerifyCode,colors],
+		data: function() {
+			return {
+				bank_code: "",
+				id_card: "",
+				payer_name: "",
+				account: "",
+				password: "",
+				captcha: "",
+				type: "login",
+				// 用户信息
+				userInfo:{},
+				bindCard:false,
+			};
+		},
+		onLoad() {
+			this.getCardBindStatus();
+			this.getUserInfo();
+		},
+		mounted: function() {
+			
+		},
+		methods: {
+			// 解约
+			cancelBind(){
+				bankCancel().then(res => {
+					that.$util.Tips({
+						title: "签约已取消"
+					});
+					this.bindCard=false
+				});
+			},
+			/**
+			 * 获取个人用户信息
+			 */
+			getUserInfo: function() {
+				let that = this;
+				getUserInfo().then(res => {
+					that.userInfo = res.data;
+					that.bank_code=that.userInfo.bank_code;
+					that.id_card=that.userInfo.bank_id;
+					that.payer_name=that.userInfo.bank_name;
+					that.account=that.userInfo.bank_mobile;
+				});
+			},
+			success(data) {
+				this.$refs.verify.hide()
+				this.getCode(data);
+			},
+			code() {
+				let that = this
+				if (!that.account) return that.$util.Tips({
+					title: that.$t(`请填写手机号码`)
+				});
+				if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
+					title: that.$t(`请输入正确的手机号码`)
+				});
+				this.$refs.verify.show()
+			},
+			async loginMobile() {
+				let that = this;
+				if (!that.account) return that.$util.Tips({
+					title: that.$t(`请填写手机号码`)
+				});
+				if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
+					title: that.$t(`请输入正确的手机号码`)
+				});
+				if (!that.captcha) return that.$util.Tips({
+					title: that.$t(`请填写验证码`)
+				});
+				if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
+					title: that.$t(`请输入正确的验证码`)
+				});
+				if (!that.payer_name) return that.$util.Tips({
+					title: that.$t(`请填写姓名`)
+				});
+				if (!that.bank_code) return that.$util.Tips({
+					title: that.$t(`请填写银行卡号`)
+				});
+				if (!that.id_card) return that.$util.Tips({
+					title: that.$t(`请填写身份证号`)
+				});
+				saveCardBind({
+						code: that.captcha,
+					})
+					.then(res => {
+						let data = res.data;
+						that.getCardBindStatus();
+					})
+					.catch(res => {
+						that.$util.Tips({
+							title: res
+						});
+					});
+
+			},
+			// 获取签约状态
+			getCardBindStatus(){
+				let that = this;
+				getCardBindStatus().then((e)=>{
+					console.log(e);
+					if(e.data.status=='02'){
+						that.$util.Tips({
+							title: "已签约"
+						});
+						that.bindCard = true;
+					}
+				}).catch((e)=>{
+					console.log(e);
+				})
+			},
+			async getCode(data) {
+				let that = this;
+				if (!that.account) return that.$util.Tips({
+					title: that.$t(`请填写手机号码`)
+				});
+				if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
+					title: that.$t(`请输入正确的手机号码`)
+				});
+				if (!that.payer_name) return that.$util.Tips({
+					title: that.$t(`请填写姓名`)
+				});
+				if (!that.bank_code) return that.$util.Tips({
+					title: that.$t(`请填写银行卡号`)
+				});
+				if (!that.id_card) return that.$util.Tips({
+					title: that.$t(`请填写身份证号`)
+				});
+				await bindCardVerify({
+						mobile: that.account,
+						payer_name: that.payer_name,
+						bank_code: that.bank_code,
+						id_card: that.id_card,
+					})
+					.then(res => {
+						this.sendCode()
+						that.$util.Tips({
+							title: '验证码已发送'
+						});
+					})
+					.catch(res => {
+						that.$util.Tips({
+							title: res
+						});
+					});
+			},
+		}
+	};
+</script>
+<style>
+	page {
+		background: #fff;
+	}
+</style>
+<style lang="scss">
+	.code img {
+		width: 100%;
+		height: 100%;
+	}
+
+	.acea-row.row-middle {
+		input {
+			margin-left: 20rpx;
+			display: block;
+		}
+	}
+
+	.login-wrapper {
+		padding: 30rpx;
+
+		.whiteBg {
+
+			.list {
+				border-radius: 16rpx;
+				overflow: hidden;
+
+				.item {
+					border-bottom: 1px solid #F0F0F0;
+					background: #fff;
+
+					.row-middle {
+						position: relative;
+						padding: 16rpx 45rpx;
+
+						input {
+							flex: 1;
+							font-size: 28rpx;
+							height: 80rpx;
+						}
+
+						.code {
+							position: absolute;
+							right: 30rpx;
+							top: 50%;
+							color: var(--view-theme);
+							font-size: 26rpx;
+							transform: translateY(-50%);
+						}
+					}
+				}
+			}
+
+			.logon {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 100%;
+				height: 86rpx;
+				margin-top: 80rpx;
+				background-color: var(--view-theme);
+				border-radius: 120rpx;
+				color: #FFFFFF;
+				font-size: 30rpx;
+			}
+		}
+	}
+</style>