Browse Source

Merge branch 'feature/asyncOrder' of http://git.aseanbusiness.cn/qzyReal/market-app-ui into feature/asyncOrder

qzyReal 1 năm trước cách đây
mục cha
commit
7854897cef
5 tập tin đã thay đổi với 80 bổ sung2 xóa
  1. 7 0
      common/graceChecker.js
  2. 9 0
      pages.json
  3. 1 1
      pages/index/index.vue
  4. 57 0
      pages/personal/bankInfo.vue
  5. 6 1
      pages/personal/personal.vue

+ 7 - 0
common/graceChecker.js

@@ -91,6 +91,13 @@ module.exports = {
 						return false;
 					}
 					break;
+				case 'bank':
+					var reg = /^[1-9]\d{9,29}$/;
+					if (!reg.test(data[rule[i].name])) {
+						this.error = rule[i].errorMsg;
+						return false;
+					}
+					break;
 				case 'phoneno':
 					var reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
 					if (data[rule[i].name]) {

+ 9 - 0
pages.json

@@ -525,6 +525,15 @@
             }
 
         }
+        ,{
+            "path" : "pages/personal/bankInfo",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "银行卡信息",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"tabBar": {
 		"color": "#7A7E83",

+ 1 - 1
pages/index/index.vue

@@ -164,7 +164,7 @@ export default {
 		getNewsList() {
 			this.http.request({
 				url: '/level-one-server/app/TbPortNews/getNewestList',
-				data: { limit: 5 },
+				data: { limit: 3 },
 				success: res => {
 					this.newsList = res.data.data;
 				}

+ 57 - 0
pages/personal/bankInfo.vue

@@ -0,0 +1,57 @@
+<template>
+	<view class="cmain">
+		<view class="form_group">
+			<view class="lable re">开户行</view>
+			<input type="text" placeholder="请输入开户行" v-model="item.bankName" />
+		</view>
+		<view class="form_group">
+			<view class="lable re">银行账号</view>
+			<input type="text" placeholder="请输入银行账号" v-model="item.bankAccount" />
+		</view>
+		</br></br></br>
+		<button class="btn" @click="save()">提交</button>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				item: {bankName:'',bankAccount:''},
+			}
+		},
+		onLoad() {
+			this.http.request({
+				url: '/sp-admin/app/AppUser/getBankInfo',
+				success: res => {
+					console.log("res",res)
+					this.item.bankName = res.data.data.bankName;
+					this.item.bankAccount = res.data.data.bankAccount;
+				}
+			})
+		},
+		methods: {
+			save() {
+				let rule = [
+					{ name: 'bankAccount', checkType: 'bank', errorMsg: '银行账号格式不正确' }
+				];
+				if (!this.verify.check(this.item, rule)) {
+					uni.showModal({ content: this.verify.error, showCancel: false });
+					return false;
+				}
+				this.http.request({
+					url: '/sp-admin/app/AppUser/saveBankInfo',
+					data: { bankName:this.item.bankName, bankAccount:this.item.bankAccount },
+					success: res => {
+						uni.showToast({title:"提交成功"})
+						uni.switchTab({ url: '/pages/personal/personal' });
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 6 - 1
pages/personal/personal.vue

@@ -157,6 +157,11 @@
 				</view>
 			</view>
 			<view class="cmd">
+				<view class="s_item" @click="go('/pages/personal/bankInfo')">
+					<text class="icon ic">&#xe662;</text>
+					<text class="title">银行卡</text>
+					<text class="icon arrow">&#xe8f2;</text>
+				</view>
 				<view class="s_item" @click="go('/pages/login/userAgreement?id=1')">
 					<text class="icon ic">&#xe662;</text>
 					<text class="title">用户协议</text>
@@ -257,7 +262,7 @@ export default {
 							url: '/sp-admin/app/AppUser/logout',
 							data: param,
 							success: res => {
-							
+
 							}
 						});
 					}