first commit
This commit is contained in:
118
pages/wallet/account/form.vue
Normal file
118
pages/wallet/account/form.vue
Normal file
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<view class="xkl-com-bg">
|
||||
<view style="height: 20rpx;"></view>
|
||||
<view style="background-color: #ffffff;padding: 30rpx;">
|
||||
<u--form labelPosition="top" :model="form" :rules="rules" ref="uForm" labelWidth="200rpx">
|
||||
<u-form-item label="真实姓名" prop="realname" borderBottom>
|
||||
<u-input v-model="form.realname" placeholder="请输入" border="none" />
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证号" prop="idcard" borderBottom>
|
||||
<u-input v-model="form.idcard" placeholder="请输入" border="none" />
|
||||
</u-form-item>
|
||||
<u-form-item label="银行卡号" prop="num" borderBottom>
|
||||
<u-input v-model="form.num" placeholder="请输入" border="none" />
|
||||
</u-form-item>
|
||||
<u-form-item label="预留手机号" prop="mobile" borderBottom>
|
||||
<u-input v-model="form.mobile" placeholder="请输入" border="none" />
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<view style="height: 50rpx;"></view>
|
||||
<view>
|
||||
<view style="font-size: 28rpx;color: coral;">请仔细核对信息,填写错误会导致提现失败。</view>
|
||||
</view>
|
||||
<view style="height: 50rpx;"></view>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
<view style="height: 50rpx;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let self;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
idcard: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
realname: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
num: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
mobile: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
form: {
|
||||
id: '',
|
||||
type: 3,
|
||||
role: 1,
|
||||
subname: '',
|
||||
realname: '',
|
||||
idcard: '',
|
||||
num: '',
|
||||
mobile: '',
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad(option) {
|
||||
self = this;
|
||||
if (option && option.item) {
|
||||
self.form = JSON.parse(decodeURIComponent(option.item));
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onReady() {
|
||||
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
||||
self.$refs.uForm.setRules(self.rules)
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.uForm.validate().then(res => {
|
||||
if (self.form.id) {
|
||||
self.$http.post('/shop/v10/account/update', self.form).then(({
|
||||
data,
|
||||
success
|
||||
}) => {
|
||||
if (success) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
self.$http.post('/shop/v10/account/create', self.form).then(({
|
||||
data,
|
||||
success
|
||||
}) => {
|
||||
if (success) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch(errors => {
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
133
pages/wallet/account/index.vue
Normal file
133
pages/wallet/account/index.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<view class="xkl-com-bg">
|
||||
<view style="height: 20rpx;"></view>
|
||||
<navigator url="/pages/wallet/account/form">
|
||||
<u-button type="primary">添加银行卡</u-button>
|
||||
</navigator>
|
||||
<!-- <view style="height: 20rpx;"></view> -->
|
||||
<!-- <navigator url="/pages/wallet/account/org">
|
||||
<u-button type="warning">添加企业</u-button>
|
||||
</navigator> -->
|
||||
<view style="height: 20rpx;"></view>
|
||||
<view>
|
||||
<view v-if="!items.length" style="padding: 30rpx;background-color: #ffffff;border-radius: 10rpx;">
|
||||
<u-empty mode="data"></u-empty>
|
||||
</view>
|
||||
<view v-else @click="check(item)" v-for="(item,index) in items" :key="index"
|
||||
:class="item.id == current ? 'xkl_cur' : 'xkl_no'"
|
||||
style="background-color: #ffffff;border-radius: 12rpx; padding: 20rpx;margin-bottom: 20rpx;">
|
||||
<view class="u-flex u-flex-between">
|
||||
<view>
|
||||
<view style="font-size: 28rpx;">
|
||||
<view class="u-flex u-flex-y-center">
|
||||
<view>
|
||||
<u-tag :text="config.role[item.role]" size="mini" type="success" plain
|
||||
plainFill></u-tag>
|
||||
</view>
|
||||
<view style="width: 20rpx;"></view>
|
||||
<view style="font-size: 26rpx;">{{item.realname}}</view>
|
||||
<view style="width: 20rpx;"></view>
|
||||
<view style="font-size: 26rpx;">{{item.mobile}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 20rpx;"></view>
|
||||
<view style="color: #232323;">
|
||||
<view style="font-size: 28rpx;">{{item.subname}}</view>
|
||||
<view style="font-size: 28rpx;">{{item.num}}</view>
|
||||
<view style="height: 10rpx;"></view>
|
||||
<view style="font-size: 28rpx;">{{item.idcard}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<u-tag v-if="item.role == 1" text="编辑"
|
||||
@click="tonav(`/pages/wallet/account/form?item=${encodeURIComponent(JSON.stringify(item))}`)">
|
||||
|
||||
</u-tag>
|
||||
<u-tag v-if="item.role == 2" text="编辑"
|
||||
@click="tonav(`/pages/wallet/account/org?item=${encodeURIComponent(JSON.stringify(item))}`)">
|
||||
|
||||
</u-tag>
|
||||
<view style="height: 30rpx;"></view>
|
||||
<u-tag text="删除" @click="delshowcli(item)" type="error"></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-modal :show="delshow" @confirm="getAccountDel()" @close="delshow = false" showCancelButton
|
||||
closeOnClickOverlay @cancel="delshow = false" content='确认删除?'></u-modal>
|
||||
<view style="height: 100rpx;"></view>
|
||||
<u-button v-if="show" @click="toback">返回上一页</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let self;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
delshow: false,
|
||||
items: [],
|
||||
current: '',
|
||||
config: null,
|
||||
show: 0,
|
||||
form: {
|
||||
id: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
self = this;
|
||||
if (option && option.show) {
|
||||
self.show = 1;
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
self.getAccountItems();
|
||||
},
|
||||
methods: {
|
||||
tonav(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
delshowcli(item) {
|
||||
self.delshow = true;
|
||||
self.form.id = item.id;
|
||||
},
|
||||
toback() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
check(item) {
|
||||
self.current = item.id;
|
||||
},
|
||||
getAccountDel() {
|
||||
self.$http.get('/shop/v10/account/delete', self.form).then(({
|
||||
data,
|
||||
success
|
||||
}) => {
|
||||
self.delshow = false;
|
||||
self.getAccountItems();
|
||||
})
|
||||
},
|
||||
getAccountItems() {
|
||||
self.$http.get('/shop/v10/account/items').then(({
|
||||
data,
|
||||
success
|
||||
}) => {
|
||||
self.items = data.items;
|
||||
self.config = data.config;
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.xkl_cur {
|
||||
border: 1px solid #71d5a1;
|
||||
}
|
||||
|
||||
.xkl_no {
|
||||
border: 1px solid #ffffff;
|
||||
}
|
||||
</style>
|
||||
99
pages/wallet/account/org.vue
Normal file
99
pages/wallet/account/org.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<view class="xkl-com-bg">
|
||||
<view style="height: 20rpx;"></view>
|
||||
<view style="background-color: #ffffff;padding: 30rpx;">
|
||||
<u--form labelPosition="top" :model="form" :rules="rules" ref="uForm" labelWidth="200rpx">
|
||||
<u-form-item label="公司名称" prop="realname" borderBottom>
|
||||
<u-input v-model="form.realname" placeholder="请输入" border="none" />
|
||||
</u-form-item>
|
||||
<u-form-item label="开户行" prop="subname" borderBottom>
|
||||
<u-input v-model="form.subname" placeholder="请输入" border="none" />
|
||||
</u-form-item>
|
||||
<u-form-item label="银行账号" prop="num" borderBottom>
|
||||
<u-input v-model="form.num" placeholder="请输入" border="none" />
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<view style="height: 50rpx;"></view>
|
||||
<view>
|
||||
<view style="font-size: 28rpx;color: coral;">请仔细核对信息,填写错误会导致提现失败。</view>
|
||||
</view>
|
||||
<view style="height: 50rpx;"></view>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
<view style="height: 50rpx;"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let self;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
subname: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
realname: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
num: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
form: {
|
||||
id: '',
|
||||
role: 2,
|
||||
subname: '',
|
||||
realname: '',
|
||||
idcard: '',
|
||||
num: '',
|
||||
mobile: '',
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad(option) {
|
||||
self = this;
|
||||
if (option && option.item) {
|
||||
self.form = JSON.parse(decodeURIComponent(option.item));
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onReady() {
|
||||
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
||||
self.$refs.uForm.setRules(self.rules)
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.uForm.validate().then(res => {
|
||||
self.$http.post('/shop/v10/account/org', self.form).then(({
|
||||
data,
|
||||
success
|
||||
}) => {
|
||||
if (success) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
})
|
||||
}).catch(errors => {
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user