trade:优化门店的 list 列表,新增是否自提的配置项

This commit is contained in:
YunaiV 2023-10-02 21:18:31 +08:00
parent a9bbbc7b0a
commit ab95d87c68
3 changed files with 28 additions and 34 deletions

View File

@ -64,6 +64,9 @@
商城商品满多少金额即可包邮单位
</el-text>
</el-form-item>
<el-form-item label="启用门店自提" prop="deliveryPickUpEnabled">
<el-switch v-model="formData.deliveryPickUpEnabled" style="user-select: none" />
</el-form-item>
</el-tab-pane>
<!-- 分销 -->
<el-tab-pane label="分销">
@ -206,7 +209,6 @@
<script setup lang="ts">
import * as ConfigApi from '@/api/mall/trade/config'
import { BrokerageBindModeEnum, BrokerageEnabledConditionEnum } from '@/utils/constants'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
defineOptions({ name: 'TradeConfig' })
@ -221,6 +223,7 @@ const formData = ref({
afterSaleReturnReasons: [],
deliveryExpressFreeEnabled: false,
deliveryExpressFreePrice: 0,
deliveryPickUpEnabled: false,
brokerageEnabled: false,
brokerageEnabledCondition: undefined,
brokerageBindMode: undefined,

View File

@ -51,7 +51,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="门店所在地区" prop="areaId">
<el-cascader v-model="formData.areaId" :options="areaList" :props="areaTreeProps" />
<el-cascader v-model="formData.areaId" :options="areaList" :props="defaultProps" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -99,7 +99,7 @@
</el-col>
</el-row>
<el-form-item label="获取经纬度">
<el-button type="primary" @click="mapDialogVisible.value = true">获取</el-button>
<el-button type="primary" @click="mapDialogVisible = true">获取</el-button>
</el-form-item>
</el-form>
<template #footer>
@ -121,8 +121,9 @@
import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { CommonStatusEnum } from '@/utils/constants'
import { defaultProps } from '@/utils/tree'
import { getAreaTree } from '@/api/system/area'
import * as ConfigApi from '@/api/infra/config'
import * as ConfigApi from '@/api/mall/trade/config'
const { t } = useI18n() //
const message = useMessage() //
@ -161,12 +162,6 @@ const formRules = reactive({
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
const areaTreeProps = {
children: 'children',
label: 'name',
value: 'id',
emitPath: false
}
const areaList = ref() //
const tencentLbsUrl = ref('') // url
@ -244,16 +239,8 @@ const selectAddress = function (loc: any): void {
mapDialogVisible.value = false
}
/** 初始化数据 */
const initData = async () => {
formLoading.value = true
try {
const data = await getAreaTree()
areaList.value = data
} finally {
formLoading.value = false
}
// TODO @jason initTencentLbsMap
/** 初始化腾讯地图 */
const initTencentLbsMap = async () => {
window.selectAddress = selectAddress
window.addEventListener(
'message',
@ -267,17 +254,16 @@ const initData = async () => {
},
false
)
const data = await ConfigApi.getConfigKey('tencent.lbs.key')
let key = ''
if (data && data.length > 0) {
key = data
}
const data = await ConfigApi.getTradeConfig()
const key = data.tencentLbsKey
tencentLbsUrl.value = `https://apis.map.qq.com/tools/locpicker?type=1&key=${key}&referer=myapp`
}
/** 初始化 **/
onMounted(() => {
initData()
onMounted(async () => {
areaList.value = await getAreaTree()
//
await initTencentLbsMap()
})
</script>
<style lang="scss">

View File

@ -65,16 +65,21 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" prop="id" />
<el-table-column label="门店 logo" prop="logo">
<el-table-column label="编号" min-width="80" prop="id" />
<el-table-column label="门店 logo" min-width="100" prop="logo">
<template #default="scope">
<img v-if="scope.row.logo" :src="scope.row.logo" alt="门店 logo" class="h-100px" />
<img v-if="scope.row.logo" :src="scope.row.logo" alt="门店 logo" class="h-50px" />
</template>
</el-table-column>
<el-table-column label="门店名称" prop="name" />
<el-table-column label="门店手机" prop="phone" />
<el-table-column align="center" label="门店详细地址" prop="detailAddress" />
<el-table-column align="center" label="开启状态" prop="status">
<el-table-column label="门店名称" min-width="150" prop="name" />
<el-table-column label="门店手机" min-width="100" prop="phone" />
<el-table-column label="地址" min-width="100" prop="detailAddress" />
<el-table-column label="营业时间" min-width="180">
<template #default="scope">
{{ scope.row.openingTime }} ~ {{ scope.row.closingTime }}
</template>
</el-table-column>
<el-table-column align="center" label="开启状态" min-width="100" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template>