12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <template>
- <view>
- <view class="main">
- <view class="message _error" v-if="!item.phone">
- <text class="icon"></text>
- <text>需要完善结算信息才能接包。</text>
- </view>
- <view class="form_group">
- <view class="lable re">手机号</view>
- <input type="text" v-model="item.phone" placeholder="请输入手机号" />
- </view>
- <view class="form_group">
- <view class="lable re">支付宝</view>
- <input type="text" v-model="item.alipay" placeholder="请输入支付宝账号" />
- </view>
- <view class="form_group">
- <view class="lable re">开户行</view>
- <input type="text" v-model="item.bankName" placeholder="请输入开户行" />
- </view>
- <view class="form_group">
- <view class="lable re">银行卡号</view>
- <input type="text" v-model="item.bankAccount" placeholder="请输入银行卡号" />
- </view>
- <button class="btn" @click="save()">确定</button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- item: {}
- };
- },
- onLoad() {
- this.getData();
- },
- methods: {
- getData() {
- this.http.request({
- url: '/app/user/info',
- data: this.item,
- success: (res) => {
- this.item = res.data.data;
- }
- });
- },
- save() {
- let rule = [
- { name: 'phone', checkType: 'phone', errorMsg: '请请输入手机号' },
- { name: 'alipay', checkType: 'notnull', errorMsg: '请输入支付宝账号' },
- { name: 'phone', checkType: 'phone', errorMsg: '请请输入手机号' },
- { name: 'alipay', checkType: 'notnull', errorMsg: '请输入支付宝账号' }
- ];
- if (!this.verify.check(this.item, rule)) {
- uni.showModal({ content: this.verify.error, showCancel: false });
- return false;
- }
- this.http.request({
- url: '/app/user/edit',
- data: this.item,
- method: 'POST',
- success: (res) => {
- uni.showModal({
- title: '提示',
- content: '编辑成功。',
- showCancel: false,
- success: (res) => {
- uni.setStorageSync('bankName', 'bankName');
- uni.navigateBack();
- }
- });
- }
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .btn {
- margin-top: 30px;
- }
- </style>
|