This commit is contained in:
aihe 2024-04-28 18:38:36 +08:00
parent a1e6c676f8
commit 15835eaf4d
2 changed files with 29 additions and 12 deletions

View File

@ -41,7 +41,11 @@ function dealRequest(def, url, param) {
})
// 统一提示 errmsg
promise.then(function(res) {}, function(res) {
promise.then(function(res) {
if(param && param._loading) {
hideLoading()
}
}, function(res) {
hideLoading()
})
return promise;

View File

@ -2,7 +2,6 @@
<tpx-layout>
<template v-slot:body>
<view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;">
<view class="blcok-white radius-20">
<u-textarea v-model="submitParam.otherDes" border="none" height="110" placeholder="粘贴或输入地址,点击“智能识别”自动拆分姓名、电话和地址" custom-style="border:0;padding: 0;"></u-textarea>
<u-row justify="end">
@ -82,17 +81,19 @@
<script>
import { getAddressModels } from "./model"
import * as apiService from "@/common/api"
export default {
props: {
// hasLeftWin: {
// type: Boolean
// }
},
computed: {
},
data() {
return {
queryOption: {
id: undefined
},
addressModal: {
show: false,
values: {
@ -111,17 +112,22 @@
// path: 'TODO'
}
},
onLoad() {
onLoad(queryOption) {
this.queryOption = queryOption
this.initData();
},
onUnload() {
},
methods: {
initData() {
// uni.showLoading({
// title: '加载中'
// });
async initData() {
if(this.queryOption.id) {
let res = await apiService.getAddressById({ id: this.queryOption.id, _loading: true })
if(res.data.blDefaultFlag) {
res.data.blDefaultFlag = [true]
}
this.submitParam = res.data
}
},
handleAnsText(){
@ -133,8 +139,15 @@
regNames: [],
}
},
handleSubmit() {
async handleSubmit() {
let params = { ...this.submitParam }
let curServiceHand = apiService.addAddress
if(this.queryOption.id) {
curServiceHand = apiService.editAddress
}
params.blDefaultFlag = !!(params.blDefaultFlag && params.blDefaultFlag.length > 0);
await curServiceHand({ ...params, _loading: true })
this.showToast("操作成功")
},
handleDialogClick(curModal) {
curModal.show = true