From 328cafc9cd11c63ff18f40c30101ac49a34f2edc Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Sun, 28 Apr 2024 17:50:39 +0800 Subject: [PATCH] uu --- common/api/common.js | 23 ++++++++++++++++++- common/api/url.js | 10 +++++++- common/manageServer.js | 8 ++++--- common/request.js | 2 +- .../buns-address-sheet/buns-address-sheet.vue | 19 +++++++++------ pages/address/list.vue | 20 ++++++++++++---- 6 files changed, 65 insertions(+), 17 deletions(-) diff --git a/common/api/common.js b/common/api/common.js index bd98cd6..e8c8fdd 100644 --- a/common/api/common.js +++ b/common/api/common.js @@ -18,8 +18,29 @@ export const getTransLineList = (data = {})=> { return coreRequest(url.getTransLineList, data, {}, 'GET') } - export const getTransProductList = (data = {})=> { return coreRequest(url.getTransProductList, data, {}, 'GET') } +export const setDefaultAddressById = (data = {})=> { + return coreRequest(url.setDefaultAddressById, data, {}, 'GET') +} + +export const deleteAddressById = (data = {})=> { + return coreRequest(url.deleteAddressById, data, {}, 'GET') +} + +export const addAddress = (data = {})=> { + return coreRequest(url.addAddress, data, {}, 'GET') +} + +export const editAddress = (data = {})=> { + return coreRequest(url.editAddress, data, {}, 'GET') +} + +export const getAddressById = (data = {})=> { + return coreRequest(url.getAddressById, data, {}, 'GET') +} + + + diff --git a/common/api/url.js b/common/api/url.js index 95fb479..4bfafdd 100644 --- a/common/api/url.js +++ b/common/api/url.js @@ -5,15 +5,23 @@ export default { uploadFile: '/common/ossUpload', loginByApp: `/loginByApp`, // 登录 getInfoByApp: `/getInfoByApp`,// 获取用户基本信息 + getEmisCountry: `/emis/emisCountry/list`, // 获取国家列表 getEmisRegion: `/emis/emisRegion/list`,// 获取省市区列表 getDicDataJson: `/common/getDicDataJson`, // 获取枚举字段 + + getCustomerUserAddressList: `/emis/emisCustomerAddress/listSimple`, // 获取客户地址列表 + setDefaultAddressById: `/emis/emisCustomerAddress/setDefaultAddressById`, // 设置默认地址 + deleteAddressById: `/emis/emisCustomerAddress/deleteAddressById`, // 删除地址 + addAddress: `/emis/emisCustomerAddress/addAddress`, // 新增地址 + editAddress: `/emis/emisCustomerAddress/editAddress`, // 编辑地址 + getAddressById: `/emis/emisCustomerAddress/getAddressById`, // 查看地址 + getTransLineList: `/emis/emisTransLine/listSimple`, // 获取路线列表 getTransProductList: `/emis/emisTransProduct/listSimple`, // 获取产品列表 createOrderNo: `/emis/common/realMatchWaybill`, // 创建运单号 submitOrder: `/emis/emisWaybill/realSubmitOrder`, // 提交订单 getCustomerUserList: `/emis/emisCustomerUser/listSimple`, // 获取网点客户列表 - getCustomerUserAddressList: `/emis/emisCustomerAddress/listSimple`, // 获取客户地址列表 getPickStaffList: `/emis/emisStaff/getStaffList`, // 获取操作、收派 员用户列表 getGoodsList: `/emis/emisGoods/listSimple`, // 获取货物列表 getMonthpayAccountList: `/emis/emisMonthpayAccount/listSimple`, // 月结账号列表 diff --git a/common/manageServer.js b/common/manageServer.js index 313c85e..0de04e0 100644 --- a/common/manageServer.js +++ b/common/manageServer.js @@ -1,9 +1,11 @@ import { goto } from "./untool"; -import { showToast } from "./untool" +import { showToast, showLoading, hideLoading } from "./untool" // 请求接口 function dealRequest(def, url, param) { - + if(param && param._loading) { + showLoading() + } const promise = new Promise(function(resolve, reject) { def.then(function(response) { let { @@ -40,7 +42,7 @@ function dealRequest(def, url, param) { // 统一提示 errmsg promise.then(function(res) {}, function(res) { - uni.hideLoading() + hideLoading() }) return promise; } diff --git a/common/request.js b/common/request.js index d808435..3518558 100644 --- a/common/request.js +++ b/common/request.js @@ -34,7 +34,7 @@ let coreRequest = function(url, params = {}, options = {}, methodType) { ...BaseParam, ...params, } - return dealRequest(coreRequestBase(url, reqParams, options, methodType)).then(res => { + return dealRequest(coreRequestBase(url, reqParams, options, methodType), url, reqParams).then(res => { // 解析unicode // emoUnicode(res, 2) return res diff --git a/components/buns-address-sheet/buns-address-sheet.vue b/components/buns-address-sheet/buns-address-sheet.vue index 3db84ca..0458e23 100644 --- a/components/buns-address-sheet/buns-address-sheet.vue +++ b/components/buns-address-sheet/buns-address-sheet.vue @@ -22,7 +22,7 @@ {{item.letters}} {{sItem.name}} @@ -131,13 +131,15 @@ parentId = undefined } const res = await apiService.getEmisRegion({ - parentId, - countryId + regionType: this.curTabIndex + 1, // 必填 + parentCode: parentId, + countryCode: countryId, }) const list = res.rows || [] list.map(t => { t.name = t.regionName t.nameEn = t.regionNameEn + t.code = t.code || t.regionCode }) if (list.length > 0) { this.curList = list @@ -149,12 +151,15 @@ if (index == 0) { this.curList = this.curCountryList } else { - this.getListData() + let parentId = this.submitVals.regIds[index] + this.getListData({ + parentId + }) } }, async addEmptyItem(item) { const list = await this.getListData({ - parentId: item.id + parentId: item.code }) if (list.length > 0) { this.curTabIndex = this.curTabIndex + 1 @@ -164,10 +169,10 @@ }, async selectItemRegion(item = {}) { // 选择数据变化,需清除下所有层级选中数据 - if (item.id != this.submitVals[this.curTabIndex]) { + if (item.code != this.submitVals.regIds[this.curTabIndex]) { this.submitVals.regIds.length = this.curTabIndex this.submitVals.regNames.length = this.curTabIndex - this.submitVals.regIds.push(item.id) + this.submitVals.regIds.push(item.code) this.submitVals.regNames.push(item.name) } // 选中后切换下一层级视图 diff --git a/pages/address/list.vue b/pages/address/list.vue index 1fb16fd..9694ce0 100644 --- a/pages/address/list.vue +++ b/pages/address/list.vue @@ -3,7 +3,9 @@