瀏覽代碼

修改实名支付

hejie 3 年之前
父節點
當前提交
1e210ed696
共有 3 個文件被更改,包括 172 次插入192 次删除
  1. 33 45
      src/pages/autonym-pay/index.vue
  2. 132 132
      src/pages/autonym-submit/index.vue
  3. 7 15
      src/pages/my/index.vue

+ 33 - 45
src/pages/autonym-pay/index.vue

@@ -3,7 +3,7 @@
 		<!-- 实名费用 -->
 		<view class="auto_cost flex_r flex_ac flex_jb mar_t20">
 			<view class="auto_name">实名费用</view>
-			<view class="price"><text>¥</text>4</view>
+			<view class="price"><text>¥</text>{{price}}</view>
 		</view>
 		<!-- 实名费用-end -->
 
@@ -41,61 +41,49 @@
 		data() {
 			return {
 				price: '',
-				isSelect: false
+				isSelect: false,
+				payDetail:undefined,
+				
 			};
 		},
-		onLoad: function() {
+		onLoad: function(e) {
 			// this.loadData()
+			console.log(e.payDetail,"aaaaaaaaaaaa")
+			this.payDetail = JSON.parse(decodeURIComponent(e.payDetail));
+			// console.log(this.payDetail,"支付信息" )
+			this.price = e.amount
 		},
 		methods: {
-			loadData: function() {
-				let that = this;
-				const info = reqApi.identifyPrice()
-				if (info) {
-					info.then(res => {
-						if (res.data.status == 200) {
-							that.price = res.data.price
-						}
-					})
-				}
-			},
-			autoOrderPay: function() {
+			autoOrderPay() {
 				if (!this.isSelect) {
 					appEv.errTips('请选择支付方式')
 					return false
 				}
-				// #ifdef  H5
-				let type = "H5";
-				// #endif
-				// #ifdef  APP
-				let type = "app";
-				// #endif
-				// #ifdef  MP-WEIXIN
-				let type = "jsapi";
-				// #endif
-				let data = {
-					trade_type: type
-				};
-				post("/user/authPay", data).then(res => {
-					if (res.code === 0) {
-						console.log("走了这里", res.data.data);
-						let data = res.data.data
-						// #ifdef  MP-WEIXIN
-						// #endif
-						toPayOpre.toPay(data, (rea) => {
-							if (!rea) {
-								// 支付成功
-								uni.redirectTo({
-									url: '/pages/autonym-submit/index'
-								})
-							} else {
-								// 支付失败
-								appEv.errTips('支付已取消')
-							}
+				// // #ifdef  H5
+				// let type = "H5";
+				// // #endif
+				// // #ifdef  APP
+				// let type = "app";
+				// // #endif
+				// // #ifdef  MP-WEIXIN
+				// let type = "jsapi";
+				// // #endif
+				// let data = {
+				// 	trade_type: type
+				// };
+				toPayOpre.toPay(this.payDetail, (rea) => {
+					if (!rea) {
+						// 支付成功
+						appEv.errTips('实名认证中,请稍等')
+						uni.switchTab({
+						  url: "/pages/my/index",
 						});
+				
+					} else {
+						// 支付失败
+						appEv.errTips('支付已取消')
 					}
-				})
-				return
+				});
 				// let that = this;
 				// let data = {
 				// 	price:this.price * 100

+ 132 - 132
src/pages/autonym-submit/index.vue

@@ -1,143 +1,143 @@
 <template>
-  <view class="container">
-    <!-- 提示信息 -->
-    <view class="hint flex_r flex_ac">请填写本人真实信息</view>
-    <!-- 提示信息-end -->
+	<view class="container">
+		<!-- 提示信息 -->
+		<view class="hint flex_r flex_ac">请填写本人真实信息</view>
+		<!-- 提示信息-end -->
 
-    <!-- 提交内容 -->
-    <view class="con">
-      <view class="list flex_r flex_ac">
-        <view class="list_name">真实姓名:</view>
-        <input class="list_input flex_grow" type="text" v-model="name" placeholder="请输入您的真实姓名" />
-      </view>
-      <view class="list flex_r flex_ac">
-        <view class="list_name">身份证号:</view>
-        <input class="list_input flex_grow" type="text" v-model="code" placeholder="请输入您的身份证号" />
-      </view>
-      <view class="btn flex_r flex_ac flex_jc" @tap="submit">提交审核</view>
-    </view>
-    <!-- 提交内容-end -->
-  </view>
+		<!-- 提交内容 -->
+		<view class="con">
+			<view class="list flex_r flex_ac">
+				<view class="list_name">真实姓名:</view>
+				<input class="list_input flex_grow" type="text" v-model="name" placeholder="请输入您的真实姓名" />
+			</view>
+			<view class="list flex_r flex_ac">
+				<view class="list_name">身份证号:</view>
+				<input class="list_input flex_grow" type="text" v-model="code" placeholder="请输入您的身份证号" />
+			</view>
+			<view class="btn flex_r flex_ac flex_jc" @tap="submit">提交审核</view>
+		</view>
+		<!-- 提交内容-end -->
+	</view>
 </template>
 
 <script>
-let page = 1;
-let app = getApp();
-// let reqApi = new ReqApi();
-var appEv = app.$vm.$options;
-// import { ReqApi } from "@/utils/reqTools.js";
-import { post } from "@/request/api.js";
-import { ToPayOpre } from "@/utils/reqTools.js";
-let toPayOpre = new ToPayOpre();
-export default {
-  data() {
-    return {
-      name: "",
-      code: ""
-    };
-  },
-  onLoad: function() {},
-  methods: {
-    submit() {
-      // #ifdef  H5
-      let type = "H5";
-      // #endif
-      // #ifdef  APP
-      let type = "app";
-      // #endif
-      // #ifdef  MP-WEIXIN
-      let type = "jsapi";
-      // #endif
-      let data = {
-        name: this.name,
-        card: this.code,
-        trade_type: type
-      };
-      post("/user/authentication", data).then(res => {
-        if (res.code === 0) {
-          let data = res.data;
-		  toPayOpre.topay(data).then(res => {
-			  if(!res){
-				  console.log("实名认证成功")
-			  }else{
-				  appEv.errTips('支付已取消')
-			  }
-		  })
-        }
-      });
-      //   let that = this;
-      //   let data = {
-      //     name: this.name,
-      //     idNumber: this.code,
-      //   };
-      //   const info = reqApi.identifyTwo(data);
-      //   if (info) {
-      //     info.then((res) => {
-      //       if (res.data.status == 200) {
-      //         uni.redirectTo({
-      //           url: "/pages/aytonym-status/index?status=1",
-      //         });
-      //       } else {
-      //         uni.redirectTo({
-      //           url: "/pages/aytonym-status/index?status=0&msg=" + res.data.msg,
-      //         });
-      //       }
-      //     });
-      //   }
-    }
-  }
-};
+	let page = 1;
+	let app = getApp();
+	// let reqApi = new ReqApi();
+	var appEv = app.$vm.$options;
+	// import { ReqApi } from "@/utils/reqTools.js";
+	import {
+		post
+	} from "@/request/api.js";
+	import {
+		ToPayOpre
+	} from "@/utils/reqTools.js";
+	let toPayOpre = new ToPayOpre();
+	export default {
+		data() {
+			return {
+				name: "",
+				code: ""
+			};
+		},
+		onLoad() {
+			this.loadData()
+		},
+		methods: {
+			submit() {
+				// #ifdef  H5
+				let type = "H5";
+				// #endif
+				// #ifdef  APP
+				let type = "app";
+				// #endif
+				// #ifdef  MP-WEIXIN
+				let type = "jsapi";
+				// #endif
+				let data = {
+					name: this.name,
+					card: this.code,
+					trade_type: type,
+					amount:this.amount
+				};
+				post("/user/authentication", data).then(res => {
+					if (res.code === 0) {
+						uni.redirectTo({
+							url: "/pages/autonym-pay/index?amount=" + this.amount + '&payDetail=' + encodeURIComponent(JSON.stringify(res.data.data)),
+						});
+
+					} else {
+						appEv.errTips(res.msg)
+					}
+
+				});
+			},
+			loadData(){
+				post('/user/isPayAuth').then(res => {
+					if(res.code === 0){
+						this.amount = res.data.amount
+					}
+				})
+			}
+		}
+	};
 </script>
 
 <style lang="scss" scoped>
-// 页面配置
-// 页面配置-end
+	// 页面配置
+	// 页面配置-end
+
+	// 提示信息
+	.hint {
+		width: 100%;
+		height: 74rpx;
+		font-size: 24rpx;
+		color: #e75b25;
+		padding: 0 30rpx;
+		background: #f4f4f4;
+	}
+
+	// 提示信息-end
+
+	// 提交内容
+	.con {
+		width: 1005;
+		overflow: hidden;
+		padding: 30rpx;
+		box-sizing: border-box;
+	}
+
+	.list {
+		width: 100%;
+		height: 100rpx;
+		border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+	}
+
+	.list_name {
+		font-size: 28rpx;
+		color: #333333;
+		font-weight: "SourceHanSansCN-Medium";
+		width: 130rpx;
+	}
+
+	.list_input {
+		width: calc(100% - 140rpx);
+		margin-left: 10rpx;
+		height: 100%;
+		font-size: 28rpx;
+		color: #333;
+	}
 
-// 提示信息
-.hint {
-  width: 100%;
-  height: 74rpx;
-  font-size: 24rpx;
-  color: #e75b25;
-  padding: 0 30rpx;
-  background: #f4f4f4;
-}
-// 提示信息-end
+	.btn {
+		width: 395rpx;
+		height: 95rpx;
+		border-radius: 10rpx;
+		background: #17bb87;
+		color: #fff;
+		font-size: 34rpx;
+		font-family: "SourceHanSansCN-Medium";
+		margin: 100rpx auto 0;
+	}
 
-// 提交内容
-.con {
-  width: 1005;
-  overflow: hidden;
-  padding: 30rpx;
-  box-sizing: border-box;
-}
-.list {
-  width: 100%;
-  height: 100rpx;
-  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
-}
-.list_name {
-  font-size: 28rpx;
-  color: #333333;
-  font-weight: "SourceHanSansCN-Medium";
-  width: 130rpx;
-}
-.list_input {
-  width: calc(100% - 140rpx);
-  margin-left: 10rpx;
-  height: 100%;
-  font-size: 28rpx;
-  color: #333;
-}
-.btn {
-  width: 395rpx;
-  height: 95rpx;
-  border-radius: 10rpx;
-  background: #17bb87;
-  color: #fff;
-  font-size: 34rpx;
-  font-family: "SourceHanSansCN-Medium";
-  margin: 100rpx auto 0;
-}
-// 提交内容-end
+	// 提交内容-end
 </style>

+ 7 - 15
src/pages/my/index.vue

@@ -484,20 +484,6 @@ export default {
         });
     },
 
-    // 获取用户信息
-    loadData() {
-      u_post("ShuZiTeaYW/my/index", {
-        userId: this.user_id,
-      }).then((res) => {
-        if (res.status == 200) {
-          this.userInfo = res.userInfo;
-          this.userInfoAccount = res.userInfoAccount;
-          this.customerServiceWeiXin = res.customerServiceWeiXin;
-          this.isShiMing = res.userInfo.identifyFlag == 0 ? false : true;
-          // this.BannerImg = res.list;
-        }
-      });
-    },
     //授权并登录
     onAuthSuccess: function () {
       var that = this;
@@ -509,8 +495,14 @@ export default {
     },
     // 跳转到实名页面
     goToAutonym() {
+		// post('/user/isPayAuth').then(res => {
+		// 	if(res.code === 0){
+		// 		if(res.data.)
+		// 	}
+		// })
+		// return
       uni.navigateTo({
-        url: "/pages/autonym-pay/index",
+        url: "/pages/autonym-submit/index",
       });
     },
     // 关闭实名信息