uu
This commit is contained in:
parent
49d342dc64
commit
6ef733ac9e
@ -6,7 +6,8 @@ export default {
|
|||||||
uploadFile: '/common/ossUpload',
|
uploadFile: '/common/ossUpload',
|
||||||
loginByApp: `/loginByApp`, // 登录
|
loginByApp: `/loginByApp`, // 登录
|
||||||
getInfoByApp: `/getInfoByApp`,// 获取用户基本信息
|
getInfoByApp: `/getInfoByApp`,// 获取用户基本信息
|
||||||
getStaffQRCodePng: `/emis/emisStaff/getStaffQRCodePng`,// 获取用户基本信息
|
updatePwdByApp: `/updatePwdByApp`,// 修改密码
|
||||||
|
getStaffQRCodePng: `/emis/emisStaff/getStaffQRCodePng`,// 获取用户二维码
|
||||||
getEmisCountry: `/emis/emisCountry/listSimple`, // 获取国家列表
|
getEmisCountry: `/emis/emisCountry/listSimple`, // 获取国家列表
|
||||||
getEmisRegion: `/emis/emisRegion/listSimple`,// 获取省市区列表
|
getEmisRegion: `/emis/emisRegion/listSimple`,// 获取省市区列表
|
||||||
getDicDataJson: `/common/getDicDataJson`, // 获取枚举字段
|
getDicDataJson: `/common/getDicDataJson`, // 获取枚举字段
|
||||||
|
|||||||
@ -8,3 +8,6 @@ export const loginByApp = (data = {})=> {
|
|||||||
export const getInfoByApp = (data = {})=> {
|
export const getInfoByApp = (data = {})=> {
|
||||||
return coreRequest(url.getInfoByApp, data, {}, 'GET')
|
return coreRequest(url.getInfoByApp, data, {}, 'GET')
|
||||||
}
|
}
|
||||||
|
export const updatePwdByApp = (data = {})=> {
|
||||||
|
return coreRequest(url.updatePwdByApp, data, {}, 'GET')
|
||||||
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ const dateRangeList = [
|
|||||||
const pageEventNames = {
|
const pageEventNames = {
|
||||||
globalClick: "globalClick", // 全局页面 click事件
|
globalClick: "globalClick", // 全局页面 click事件
|
||||||
chooseAddress: "chooseAddress", // 地址选择
|
chooseAddress: "chooseAddress", // 地址选择
|
||||||
|
addressSaveSuccess: "addressSaveSuccess", // 地址保存成功
|
||||||
}
|
}
|
||||||
|
|
||||||
const addressNameCodeMap = [
|
const addressNameCodeMap = [
|
||||||
|
|||||||
1910
common/libs/jsencrypt.min.js
vendored
1910
common/libs/jsencrypt.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
import JSEncrypt from '@/utils/jsencrypt.min'
|
import JSEncrypt from '@/common/libs/jsencrypt.min'
|
||||||
|
|
||||||
// 密钥对生成 http://web.chacuo.net/netrsakeypair
|
// 密钥对生成 http://web.chacuo.net/netrsakeypair
|
||||||
|
|
||||||
@ -16,14 +16,14 @@ const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYour
|
|||||||
|
|
||||||
// 加密
|
// 加密
|
||||||
export function encrypt(txt) {
|
export function encrypt(txt) {
|
||||||
const encryptor = new JSEncrypt()
|
const encryptor = JSEncrypt()
|
||||||
encryptor.setPublicKey(publicKey) // 设置公钥
|
encryptor.setPublicKey(publicKey) // 设置公钥
|
||||||
return encryptor.encrypt(txt) // 对数据进行加密
|
return encryptor.encrypt(txt) // 对数据进行加密
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解密
|
// 解密
|
||||||
export function decrypt(txt) {
|
export function decrypt(txt) {
|
||||||
const encryptor = new JSEncrypt()
|
const encryptor = JSEncrypt()
|
||||||
encryptor.setPrivateKey(privateKey) // 设置私钥
|
encryptor.setPrivateKey(privateKey) // 设置私钥
|
||||||
return encryptor.decrypt(txt) // 对数据进行解密
|
return encryptor.decrypt(txt) // 对数据进行解密
|
||||||
}
|
}
|
||||||
|
|||||||
25
common/validate.js
Normal file
25
common/validate.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { showToast } from "./untool"
|
||||||
|
const checkParams = (param, validConfig)=> {
|
||||||
|
return new Promise((resolve)=> {
|
||||||
|
let errMsg = ''
|
||||||
|
Object.keys(validConfig).map(key=> {
|
||||||
|
const itemConf = validConfig[key]
|
||||||
|
if(!errMsg && itemConf.required && !param[key]) {
|
||||||
|
errMsg = itemConf.requiredMsg || `${itemConf.label}不能为空`
|
||||||
|
}
|
||||||
|
let customerValidMsg = itemConf?.validMsgFun?.({ val: param })
|
||||||
|
if(!errMsg && customerValidMsg) {
|
||||||
|
errMsg = customerValidMsg
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(errMsg) {
|
||||||
|
showToast(errMsg)
|
||||||
|
} else {
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
checkParams
|
||||||
|
}
|
||||||
@ -85,6 +85,7 @@
|
|||||||
import { getAddressModels } from "./model"
|
import { getAddressModels } from "./model"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { addressNameCodeMap } from "@/common/enum"
|
import { addressNameCodeMap } from "@/common/enum"
|
||||||
|
import { pageEventNames } from "@/common/enum"
|
||||||
import { getAddressDetail, setAddresModalParam } from "@/common/util"
|
import { getAddressDetail, setAddresModalParam } from "@/common/util"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -96,7 +97,9 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryOption: {
|
queryOption: {
|
||||||
id: undefined
|
id: undefined,
|
||||||
|
addressType: undefined, // 1寄件 2收件
|
||||||
|
listQuery: {}
|
||||||
},
|
},
|
||||||
addressModal: {
|
addressModal: {
|
||||||
show: false,
|
show: false,
|
||||||
@ -163,11 +166,15 @@
|
|||||||
let curServiceHand = apiService.addAddress
|
let curServiceHand = apiService.addAddress
|
||||||
if(this.queryOption.id) {
|
if(this.queryOption.id) {
|
||||||
curServiceHand = apiService.editAddress
|
curServiceHand = apiService.editAddress
|
||||||
|
} else {
|
||||||
|
params.addressType = this.queryOption.addressType
|
||||||
}
|
}
|
||||||
params.blDefaultFlag = Number(!!(params.blDefaultFlag && params.blDefaultFlag.length > 0));
|
params.blDefaultFlag = Number(!!(params.blDefaultFlag && params.blDefaultFlag.length > 0));
|
||||||
|
|
||||||
await curServiceHand({ ...params, _loading: true })
|
await curServiceHand({ ...params, _loading: true })
|
||||||
this.showToast("操作成功")
|
this.showToast("操作成功")
|
||||||
|
uni.$emit(pageEventNames.addressSaveSuccess, {
|
||||||
|
data: params
|
||||||
|
})
|
||||||
this.goBack()
|
this.goBack()
|
||||||
},
|
},
|
||||||
handleDialogClick(curModal) {
|
handleDialogClick(curModal) {
|
||||||
|
|||||||
@ -129,12 +129,15 @@
|
|||||||
this.initData();
|
this.initData();
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
|
uni.$off(pageEventNames.addressSaveSuccess, this.addressSaveSuccessEventBack)
|
||||||
|
},
|
||||||
|
onShow(){
|
||||||
|
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAddressDetail,
|
getAddressDetail,
|
||||||
initData(){
|
initData(){
|
||||||
|
uni.$on(pageEventNames.addressSaveSuccess, this.addressSaveSuccessEventBack)
|
||||||
},
|
},
|
||||||
getListFun: apiService.getCustomerUserAddressList,
|
getListFun: apiService.getCustomerUserAddressList,
|
||||||
|
|
||||||
@ -149,9 +152,12 @@
|
|||||||
break
|
break
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
addressSaveSuccessEventBack({ data }){
|
||||||
|
|
||||||
},
|
},
|
||||||
handleEditItem(item={}) {
|
handleEditItem(item={}) {
|
||||||
this.goto(`address/edit?id=${item.id || ''}`)
|
this.goto(`address/edit?id=${item.id || ''}&addressType=${this.searchParam.addressType}`)
|
||||||
},
|
},
|
||||||
async handleDelItem(item) {
|
async handleDelItem(item) {
|
||||||
await this.confirmModal('确认要删除吗?')
|
await this.confirmModal('确认要删除吗?')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user