cmy 1 anno fa
parent
commit
5c74b46d2d

+ 9 - 0
api/newapi.js

@@ -13,3 +13,12 @@ export function speed() {
 export function getTypeListIn(data,type) {
 	return request.get(`other/list/${type}`,data);
 }
+// 实名认证提交
+export function setCheck(data) {
+	return request.post(`check/check`,data);
+}
+// 实名认证信息
+export function getCheckMy(data) {
+	return request.get(`check/my`,data);
+}
+

+ 4 - 1
components/orderGoods/index.vue

@@ -37,6 +37,7 @@
 						<view class='money font-color pic' v-if="item.productInfo.attrInfo">
 							<text :class="{gray:!item.is_valid}">
 								{{$t(`¥`)}}{{item.productInfo.attrInfo.price}}
+								<text :class="{gray:!item.is_valid}" v-if="item.productInfo.attrInfo.pay_integral*1>0">+{{item.productInfo.attrInfo.pay_integral}}积分</text>
 							</text>
 							<view class="refund" v-if="item.refund_num && statusType !=-2">{{item.refund_num}}{{$t(`件退款中`)}}
 							</view>
@@ -44,7 +45,9 @@
 							<text class="valid" v-if="!item.productInfo.store_mention && shipping_type === 1">{{$t(`不支持自提`)}}</text>
 						</view>
 						<view class='money font-color pic' v-else>
-							<text :class="{gray:!item.is_valid}">{{$t(`¥`)}}{{item.productInfo.price}}</text>
+							<text :class="{gray:!item.is_valid}">{{$t(`¥`)}}{{item.productInfo.price}}
+								<text :class="{gray:!item.is_valid}" v-if="item.productInfo.pay_integral*1>0">+{{item.productInfo.pay_integral}}积分</text>
+							</text>
 							<text class="valid" v-if="!item.is_valid && shipping_type === 0">{{$t(`仅支持到店`)}}</text>
 							<text class="valid" v-if="!item.productInfo.store_mention && shipping_type === 1">{{$t(`仅支持配送`)}}</text>
 						</view>

+ 7 - 0
pages/goods/order_confirm/index.vue

@@ -212,6 +212,13 @@
 						{{$t(`¥`)}}{{(parseFloat(priceGroup.storePostage)+parseFloat(priceGroup.storePostageDiscount)).toFixed(2)}}
 					</view>
 				</view>
+				<view class='item acea-row row-between-wrapper'
+					v-if="priceGroup.payIntegral > 0 ">
+					<view>{{$t(`消费积分`)}}:</view>
+					<view class='money'>
+						{{parseFloat(priceGroup.payIntegral)}}
+					</view>
+				</view>
 				<view class='item acea-row row-between-wrapper'
 					v-if="priceGroup.levelPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId && !discountId">
 					<view>{{$t(`用户等级优惠`)}}:</view>

+ 2 - 2
pages/users/login/index.vue

@@ -56,11 +56,11 @@
 				<!-- <view v-if="current==1" @click="current = 0">{{$t(`账号登录`)}}</view> -->
 			</view>
 			<!-- TODO -->
-			<view class="choose">
+			<!-- <view class="choose">
 				<view class="reg"  @click="forget">忘记密码</view>
 				<view class="xian">|</view>
 				<view class="zhuce" @click="zhuce">注册账号</view>
-			</view>
+			</view> -->
 			<!-- #endif -->
 			<!-- #ifdef APP-PLUS -->
 			<view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">

+ 108 - 15
pages/users/real_name/index.vue

@@ -14,38 +14,124 @@
 		<view class="yanzheng">
 			<view class="top">
 				<view class="tex">真实姓名</view>
-				<input class="inp" type="text" placeholder="请输入真实姓名" v-model="text" required />
+				<input class="inp" type="text" placeholder="请输入真实姓名" v-model="name" required />
 			</view>
 			<view class="top">
-				<view class="tex">真实姓名</view>
-				<input class="inp" type="text" placeholder="请输入真实姓名" v-model="text" required />
+				<view class="tex">身份证号</view>
+				<input class="inp" type="text" placeholder="请输入身份证号" v-model="num" required />
 			</view>
 		</view>
 		<view class="sc">
 			<view class="poto">上传人脸正面照片</view>
-			<image class="pto" src="../../users/static/pto.png" mode="scaleToFill"></image>
+			<image class="pto" @click="uploadpic" :src="image||`../../users/static/pto.png`" mode="widthFix"></image>
 		</view>
-		
+
 		<view class="btn">
-			<button class="bt">立即认证</button>
+			<button class="bt" :class="{loding:uploding}" @click="uploding?'':setCheck()">立即认证</button>
 		</view>
+		<canvas canvas-id="canvas" v-if="canvasStatus"
+			:style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
 	</view>
 </template>
 
 <script>
-	
+	import {
+		setCheck,
+		getCheckMy
+	} from "@/api/newapi";
 	export default {
 		data() {
 			return {
-				text: ''
+				name: '',
+				num: '',
+				image: '',
+				canvasWidth: "",
+				canvasHeight: "",
+				canvasStatus: false,
+				uploding:false,//是否不允许提交
 			};
 		},
-		onLoad() {},
+		onLoad() {
+			getCheckMy().then(
+			(res) => {
+				console.log(res)
+				if(res.data){
+					if(res.data.info){
+						if(res.data.info.status==0){
+							this.uploding = true;
+							
+							uni.showModal({
+								title: '提示',
+								content: '正在审核中',
+								showCancel: false,
+							});
+						}
+						if(res.data.info.status==1){
+							this.uploding = true;
+							this.name = res.data.info.real_name;
+							this.num = res.data.info.id_card;
+							this.image =  res.data.info.image;
+							uni.showModal({
+								title: '提示',
+								content: '审核已通过',
+								showCancel: false,
+							});
+						}
+						if(res.data.info.status==-1){
+							this.uploding = true;
+							uni.showModal({
+								title: '提示',
+								content: '审核未通过,原因:'+res.data.info.fail_msg,
+								showCancel: false,
+							});
+						}
+					}
+				}
+			}
+			)
+		},
 		onShow() {
-			
+
 		},
 		methods: {
-			
+			setCheck() {
+				uni.showLoading({
+					title: '提交中。。。',
+					mask: true
+				});
+
+				setCheck({
+					real_name: this.name,
+					id_card: this.num,
+					image: this.image
+				}).then((res) => {
+					uni.showToast({
+						title:res.msg,
+						duration:2000
+					})
+				}).catch((err) => {
+					uni.showToast({
+						title: err,
+						icon: 'none'
+					});
+				})
+			},
+			/**
+			 * 上传文件
+			 * 
+			 */
+			uploadpic: function() {
+				let that = this;
+				this.canvasStatus = true
+				that.$util.uploadImageChange('upload/image', function(res) {
+					that.image = res.data.url;
+				}, (res) => {
+					this.canvasStatus = false
+				}, (res) => {
+					this.canvasWidth = res.w
+					this.canvasHeight = res.h
+				});
+			},
 		}
 	};
 </script>
@@ -129,20 +215,24 @@
 		margin: -100rpx auto 0;
 		position: relative;
 		z-index: 2;
+
 		.top {
 			display: flex;
 			justify-content: start;
 			padding-top: 40rpx;
+
 			.tex {
 				size: 50rpx;
 				padding-left: 25rpx;
 				padding-top: 5rpx;
 			}
+
 			.inp {
 				padding-left: 25rpx;
 			}
 		}
 	}
+
 	.sc {
 		width: 660rpx;
 		height: 400rpx;
@@ -151,20 +241,21 @@
 		margin-left: 45rpx;
 		box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
 		border-radius: 20rpx;
-		
+
 		.poto {
 			padding-top: 30rpx;
 			margin-left: 25rpx;
 			size: 50rpx;
 		}
+
 		.pto {
 			width: 312rpx;
-			height: 202rpx;
+			min-height: 202rpx;
 			margin-left: 175rpx;
 			margin-top: 60rpx;
 		}
 	}
-	
+
 	.bt {
 		width: 650rpx;
 		background: linear-gradient(90deg, #ff8f3b, #ff3107);
@@ -174,6 +265,8 @@
 		color: #fff;
 		height: 80rpx !important;
 		line-height: 80rpx !important;
+		&.loding{
+			background: #e3e3e3;
+		}
 	}
-	
 </style>

+ 15 - 1
utils/request.js

@@ -65,8 +65,22 @@ function baseRequest(url, method, data, {
 						showCancel: false,
 						confirmText: i18n.t(`我知道了`)
 					});
-				} else
+				}else if(res.data.code == "980001"){
+					uni.showModal({
+						title: i18n.t(`提示`),
+						content: res.data.msg,
+						confirmText: i18n.t(`立即认证`),
+						success(re) {
+							if(re.confirm){
+								uni.navigateTo({
+									url: '/pages/users/real_name/index'
+								});
+							}
+						}
+					});
+				} else{
 					reject(res.data.msg || i18n.t(`系统错误`));
+				}
 			},
 			fail: (msg) => {
 				let data = {