Переглянути джерело

余额支付前先检查是否有支付密码

gcz 2 роки тому
батько
коміт
ac49e1bc96
2 змінених файлів з 33 додано та 2 видалено
  1. 5 1
      center/setPaypass.vue
  2. 28 1
      shopping/pay.vue

+ 5 - 1
center/setPaypass.vue

@@ -190,7 +190,11 @@
 		}
 	}
 </script>
-
+<style>
+page{
+	padding-top: 100rpx;
+}
+</style>
 <style lang="scss" scoped>
 .page-wrap{
 	text-align: center;

+ 28 - 1
shopping/pay.vue

@@ -79,6 +79,7 @@
 				},
 				checkPassShow:false,
 				paypass:'',
+				noPaypass:true,
 				
 			}
 		},
@@ -120,11 +121,37 @@
 			},
 			payRoute(){
 				if(this.params.paymentMode==2){
-					this.checkPassShow = true
+					this.checkExistPayPassword();
 				}else{
 					this.gotoPay();
 				}
 			},
+			checkExistPayPassword(){
+				this.$u.api.getExistPayPassword().then(res=>{
+					// console.log('res',res.data);
+					if(res.data==0){
+						this.noPaypass = true;
+						uni.showModal({
+							title: '还未设置支付密码',
+							content: '请先设置支付密码!',
+							success: res => {
+								if (res.confirm) {
+									uni.$u.route('/center/setPaypass', {
+										from: 'pay',
+										backUrl:'/shopping/order'
+									});
+								}
+							}
+						})
+					}else{
+						this.noPaypass = false;
+						this.checkPassShow = true
+					}
+					console.log('this.noPaypass',this.noPaypass);
+				}).catch(err=>{
+					console.log('checkPaypass',err);
+				})
+			},
 			checkPayPassword(){
 				this.$u.api.checkPayPassword({payPassword:this.paypass}).then(res=>{
 					// console.log('res',res.data);