Commit a1d5f3ce by 李伟康

feat(api): 更新API接口和环境配置

- 修改getEmployeeList方法的API端点路径
- 添加findPayInfo查询门店支付配置功能
- 将环境配置中的uat替换为test标识
- 更新相关域名映射和密钥配置
- 移除sign方法中的调试日志输出
- 优化系统API中的环境判断逻辑
- 添加BackPress退出弹框组件
- 添加Employee员工选择组件
- 添加FinishStep完成步骤组件
- 更新MessageBox样式和属性
- 扩展ToolBox组件功能和样式调整
- 添加informationEntry信息录入页面组件
- 优化CarBrands组件的数据获取方式
- 调整Reception组件中的客户信息处理逻辑
1 parent 57bf66e7
......@@ -6,7 +6,7 @@ import http from "@/api/request/http.uts";
/** 获取交付人员列表 */
export function getEmployeeList(data: UTSJSONObject): Promise<any> {
return http.post({
'method': 'dj.api.smartcarlife.employee.getByMerchantId',
'method': 'dj.api.smartcarlife.employee.getByMerchantId.new',
'projectName': 'boutique',
'sceneList': [0],
...data
......@@ -34,3 +34,14 @@ export function getCarBrandsListApi(data: UTSJSONObject): Promise<any> {
...data
} as UTSJSONObject, false, 'scrm')
}
/**
* 查询门店支付配置
*/
export function findPayInfo(data: UTSJSONObject): Promise<any> {
return http.post({
method: 'dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId',
projectName: 'boutique',
...data
} as UTSJSONObject)
}
\ No newline at end of file
/**
* 环境配置(从 gl_tape 迁移)
* 0: ip 本地 1: dev 开发 2: uat 测试 3: prod 生产 4: beta 预发布
* 0: ip 本地 1: dev 开发 2: test 测试 3: prod 生产 4: beta 预发布
*/
const TARGET_OPTIONS = ["ip", "dev", "uat", "prod", "beta"];
const TARGET_OPTIONS = ["ip", "dev", "test", "prod", "beta"];
const TARGET_INDEX = 2;
// 为兼容 UTS 的限制,这里不再使用复杂的类型约束,统一用 UTSJSONObject
......@@ -18,7 +18,7 @@ const secretKeyMap: UTSJSONObject = {
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b"
}
},
uat: {
test: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b"
......@@ -41,7 +41,7 @@ const secretKeyMap: UTSJSONObject = {
const domainMap: UTSJSONObject = {
ip: "http://192.168.1.122:8292",
dev: "https://scrm.dev.glsx.com.cn",
uat: "https://scrm.test.glsx.com.cn",
test: "https://scrm.test.glsx.com.cn",
beta: "https://scrm.beta.glsx.com.cn",
prod: "https://scrm.glsx.com.cn"
};
......@@ -50,7 +50,7 @@ const evaluationDomainMap: UTSJSONObject = {
ip: "http://192.168.1.221:5003",
dev: "http://gsc.dev.glsx.com.cn",
beta: "https://gsc.beta.glsx.com.cn",
uat: "http://gsc.test.glsx.com.cn",
test: "http://gsc.test.glsx.com.cn",
prod: "https://gsc.glsx.com.cn",
pet: "https://cdptest.glsx.com.cn"
};
......@@ -59,7 +59,7 @@ const djDomainMap: UTSJSONObject = {
ip: "http://192.168.1.122:8292",
dev: "http://dj.dev.glsx.com.cn",
beta: "https://dj.beta.glsx.com.cn",
uat: "https://dj.test.glsx.com.cn",
test: "https://dj.test.glsx.com.cn",
prod: "https://dj.glsx.com.cn",
pet: "https://cdptest.glsx.com.cn"
};
......@@ -68,7 +68,7 @@ const merchantDomainMap: UTSJSONObject = {
ip: "http://rop-merchant.dev.glsx.com.cn",
dev: "http://rop-merchant.dev.glsx.com.cn",
beta: "https://rop-merchant.beta.glsx.com.cn",
uat: "https://rop-merchant.test.glsx.com.cn",
test: "https://rop-merchant.test.glsx.com.cn",
prod: "https://commodity.glsx.com.cn",
pet: ""
};
......@@ -76,7 +76,7 @@ const merchantDomainMap: UTSJSONObject = {
const djSecretKeyMap: UTSJSONObject = {
ip: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
dev: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
uat: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
test: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
beta: { appKey: "48e5e13229b82c1b4e6e8c96151f0637", secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b" },
prod: { appKey: "d7ffc3346fc9a45bccaaa35300d59022", secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353" },
pet: { appKey: "d7ffc3346fc9a45bccaaa35300d59022", secret: "4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353" }
......@@ -97,7 +97,7 @@ const signSecretKeyMap: UTSJSONObject = {
pdfUrl:
"https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/testdev/8981c8ca-8b30-436e-bb17-82fb6a53a3c4%E4%BA%8C%E6%89%8B%E8%BD%A6%E8%BD%AC%E8%AE%A9%E5%8D%8F%E8%AE%AE.pdf"
},
uat: {
test: {
appKey: "App_PromoteBusiness",
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
carBasrUrl: "http://qcdidicb.glsx.com.cn/router",
......
......@@ -23,7 +23,6 @@ export function sign(params: UTSJSONObject, secret: string, noSignAttr: string[]
} as StringifyOptions;
const objStr = qsStringify(params, options);
console.log(objStr, "===");
// 2. split('&') 拆开
const objVal = objStr.split("&");
......
......@@ -6,7 +6,7 @@ import http from '@/api/request/http.uts'
import { env } from '@/api/env.uts'
import { storage } from '@/utils/storage.uts'
const ENV_STR = env == 'production' ? 'prod' : env == 'develop' ? 'develop' : 'uat'
const ENV_STR = env == 'production' ? 'prod' : env == 'develop' ? 'develop' : 'test'
const CONFIG_MODULE = 'app-tape'
const BOUTIQUE_CONFIG_MODULE = 'boutique-pad-config'
const CONFIG_BASE = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config'
......@@ -138,7 +138,6 @@ export async function getSoureData(
if (params.brandId && params.subBrandId) {
storageName += `_${params.brandId}_${params.subBrandId}`
}
const insurance = materialInfoList.find(e => e.componentName == 'insurance')
const hasEquity = toolList.find(e => e.id == insurance?.id)
......
<!-- 退出弹框 -->
<template>
<MessageBox :popupW="704" ref="finishRef" :content="finishContene" :isFooter="false">
<view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
<template v-else>
完成接待
<text>(推荐)</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
仍要退出
<text>(不推荐)</text>
</view>
</view>
</MessageBox>
</template>
<script setup lang="uts">
import MessageBox from './MessageBox.uvue'
const props = defineProps({
finishDoneText: String,
finishContene: {
type: String,
default: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}
})
function open(): void {
finishRef.value.open()
}
function hide(): void {
finishRef.value.close()
}
const finishRef = ref<any>(null)
const emit = defineEmits(['openStep', 'backHome'])
defineExpose({
open,
hide
})
</script>
<style lang="scss">
.footer {
border-top: 2rpx solid #eff0f2;
font-weight: 600;
font-size: 32rpx;
margin-top: 48rpx;
.footer-btn {
justify-content: center;
margin: 16rpx auto 0;
flex-direction: row;
align-items: center;
}
.confirm {
width: 608rpx;
height: 80rpx;
background: #2c66f7;
border-radius: 40rpx;
color: #fff;
}
.cancel {
width: 608rpx;
height: 80rpx;
background: #ffffff00;
border-radius: 40rpx;
color: #2c66f7;
}
text {
font-size: 24rpx;
}
}
</style>
\ No newline at end of file
......@@ -120,7 +120,7 @@ const carModel = computed<string | undefined>(() => {
})
const carBrandList = computed<Array<CarBrandItem>>(() => {
return state.user.carBrands || []
return storage.get("carBrandList") || []
})
const carBrand = computed<string | undefined>(() => {
......@@ -140,7 +140,8 @@ watch(() => watchStatus.value, (newval) => {
}, { immediate: true })
function autoSelect(): void {
const { boutiqueDefaultCarBrandId: boutiqueDefaultCarBrandIdVal, defaultCarId: defaultCarIdVal } = props
const boutiqueDefaultCarBrandIdVal = boutiqueDefaultCarBrandId.value
const defaultCarIdVal = defaultCarId.value
let carIndex = 0
if (boutiqueDefaultCarBrandIdVal) {
......@@ -259,14 +260,17 @@ function selectCar(e: CarBrandItem, auto: boolean = false, carId?: string): void
}
function handleSelect(item: CarBrandItem): void {
const customerInfo = { ...state.user.customerInfo } as CustomerInfo
const selectItemVal = selectItem.value
Object.assign(customerInfo, {
carBrand: selectItemVal.carChildsBrandName,
carBrandId: selectItemVal.carChildsBrandId,
oneCarBrand: selectItemVal.carBrand,
oneCarBrandId: selectItemVal.carBrandId
})
const customerInfo: CustomerInfo = {
...state.user.customerInfo,
carBrand: selectItemVal.carChildsBrandName,
carBrandId: selectItemVal.carChildsBrandId,
oneCarBrand: selectItemVal.carBrand,
oneCarBrandId: selectItemVal.carBrandId,
carModel:item.name,
carModelId:item.id
}
if (props.linkage) {
dispatch('setCustomerInfo', customerInfo)
......
<template>
<MessageBox
ref="employeeBoxVisible"
position="bottom"
:isFooter="false"
:title="`请选择${title}`"
:maxHeight="1000"
@close="handleClose"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: salesUuid == item.uuid }"
@click="handleSelect(item)"
v-for="(item, index) in employeeList"
:key="index"
>
{{ item.staffName }}
</view>
</view>
</MessageBox>
</template>
<script setup lang="uts">
import { ref, computed, watch } from 'vue'
import MessageBox from './MessageBox.uvue'
import { state, dispatch } from '@/store/index.uts'
import { storage } from '@/utils/storage.uts'
import { getEmployeeList as getEmployeeListApi } from '@/api/common-api.uts'
interface EmployeeItem {
staffName: string
uuid: string
[key: string]: any
}
interface Props {
title?: string
salesPropsUuid?: string
}
const props = withDefaults(defineProps<Props>(), {
title: '销售',
salesPropsUuid: ''
})
const emit = defineEmits(['close', 'select'])
const employeeBoxVisible = ref<any>(null)
const watchStatus = computed(() => {
return state.user.historyStatus
})
const salesUuid = computed(() => {
return state.user.customerInfo.salesUuid || props.salesPropsUuid
})
const employeeList = computed(() => {
return state.user.employeeList
})
watch(() => watchStatus.value, (newval: number) => {
close()
}, { immediate: true })
function handleClose(): void {
emit('close')
}
function open(): void {
employeeBoxVisible.value?.open()
const userInfo = storage.get('userInfo')
const userInfoObj = userInfo as any
const shopMerchantId = userInfoObj?.shopMerchantId
// 获取销售人员列表
getEmployeeListApi({
merchantId: shopMerchantId
}).then((res: EmployeeItem[]) => {
dispatch('setEmployeeList', res)
storage.set('employeeList', res || [])
}).catch((error: any) => {
console.error('获取员工列表失败:', error)
})
}
function handleSelect(item: EmployeeItem): void {
close()
emit('select', item)
}
function close(): void {
employeeBoxVisible.value?.close()
}
defineExpose({
open,
close
})
</script>
<style scoped lang="scss">
.select-box {
margin: 40rpx 0;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 44rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #333;
font-size: 32rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
......@@ -9,7 +9,7 @@
@close="onClose"
>
<view
class="tips-wrapper"
:class="['tips-wrapper',{'radius': position === 'center'}]"
:style="{ width: popupW + 'rpx', minHeight: popupH + 'rpx', maxHeight: maxHeight + 'rpx' }"
>
<view class="tips-content">
......@@ -171,6 +171,7 @@ defineExpose({
height: 120rpx;
justify-content: center;
z-index: 2;
align-items: center;
}
.tips-title {
......@@ -206,7 +207,7 @@ defineExpose({
justify-content: center;
height: 100rpx;
border-top: 1px solid #e8e8e8;
flex-direction: row;
.close {
color: #6c6c70;
}
......@@ -225,4 +226,8 @@ defineExpose({
font-weight: 500;
}
}
.radius{
border-radius: 20rpx;
}
</style>
\ No newline at end of file
......@@ -85,6 +85,10 @@
const emit = defineEmits(['choose',
'finish',
'toPay'])
defineExpose({
hide
})
</script>
<style lang="scss">
......@@ -172,7 +176,7 @@
.list-body {
display:flex;
flex-direction:column;
max-height: 60%;
max-height: 700rpx;
overflow-y: auto;
}
.item {
......@@ -196,7 +200,7 @@
}
.showList {
display: flex;
max-height: 1048rpx;
max-height: 1156rpx;
opacity: 1;
transform: translateY(0) scale(1);
padding-bottom: 16rpx;
......
......@@ -161,6 +161,7 @@
watch(() => watchCustomerInfo.value, (newval) => {
if (newval) {
customerInfo.value = newval as CustomerInfo
console.log( customerInfo.value,'==========')
}
}, { immediate: true })
......@@ -181,17 +182,17 @@
function onSelect(item: any, popkey: string): void {
carBrandListVisibleRef.value.$callMethod('close')
if (popkey == 'employeeBoxVisible') {
customerInfo.value.salesUuid = item.uuid
customerInfo.value.staffName = item.staffName
} else {
customerInfo.value.carModel = item.name
customerInfo.value.carModelId = item.id
}
// const customerInfo = dispatch('getCustomerInfo')
// if (popkey == 'employeeBoxVisible') {
// customerInfo.value.salesUuid = item.uuid
// customerInfo.value.staffName = item.staffName
// } else {
// customerInfo.value.carModel = item.name
// customerInfo.value.carModelId = item.id
// }
resetFocusIndex()
store.dispatch('setCustomerInfo', customerInfo.value)
// store.dispatch('setCustomerInfo', customerInfo.value)
}
function showPopup(e: string, index: number): void {
......@@ -266,7 +267,6 @@
width:100%;
position: relative;
height: 100%;
padding: 24rpx;
box-sizing:border-box;
}
......
<template>
<view
class="information-entry"
v-if="showPayPage"
>
<view class="nav-bar">
<view
class="back"
@click="handleBack"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
<view class="title">信息录入</view>
</view>
<view class="information-tips">建议同步采集凭证,若接待工作繁忙可在提单环节再进行补充。</view>
<view class="information-box">
<view
class="information-item"
v-for="(item, index) in infoList"
:key="item.id"
>
<view
class="upload-img"
v-if="item.imgUrl"
>
<image
class="img"
:src="item.imgUrl"
mode="aspectFill"
@click="preview(index)"
/>
<view
class="upload-close"
@click="close(index)"
><glsx-image
src="detail/icon-close.png"
mode="scaleToFill"
/></view>
</view>
<view
v-else
class="icon"
@tap="choose(index)"
>
<view class="icon-upload sprite-icon icon-icon-upload"></view>
</view>
<view class="information-title">{{ item.title }} </view>
</view>
</view>
<view
class="information-done"
@click="handleFinish"
>完成接待</view>
</view>
</template>
<script setup lang="uts">
import { ref, watch, computed } from 'vue'
import { state, dispatch } from '@/store/index.uts'
interface InfoListItem {
id: number
title: string
imgUrl?: string
}
const INFO_LIST: InfoListItem[] = [
{
id: 1,
title: "客户付款凭证",
},
{
id: 2,
title: "客户购车发票",
},
{
id: 3,
title: "客户延保合同",
},
]
interface Props {
showPayPage?: boolean
}
const props = withDefaults(defineProps<Props>(), {
showPayPage: false
})
const emit = defineEmits(['update:showPayPage', 'finish'])
const infoList = ref<InfoListItem[]>(JSON.parse(JSON.stringify(INFO_LIST)))
const previewImg = ref<string>('')
const isPreview = ref<boolean>(false)
const watchBooksList = computed(() => {
return state.audio.booksList
})
watch(() => watchBooksList.value, (newValue: InfoListItem[]) => {
if (newValue && newValue.length) {
infoList.value = newValue
} else {
infoList.value = JSON.parse(JSON.stringify(INFO_LIST))
}
}, { immediate: true })
function handleBack(): void {
emit('update:showPayPage', false)
}
function handleFinish(): void {
emit('finish')
}
// 上传图片
async function choose(index: number): Promise<void> {
try {
// const result = await uni.requestPermission({
// permission: 'android.permission.CAMERA'
// })
// if (result !== 1) {
// uni.showToast({
// title: "为了访问您的相机和图库,请打开相机权限",
// icon: "none"
// })
// return
// }
uni.chooseImage({
count: 1,
success: async (res) => {
try {
// let url = await uploadFile(res.tempFilePaths[0])
// uni.$logger.local.info(`上传付款凭证:${res.tempFilePaths[0]}`)
// this.$set(
// this.infoList[index],
// "imgUrl",
// url
// );
infoList.value[index].imgUrl = url
// setBooks(utils.deepClone(infoList.value))
} catch (error) {
console.error(`上传付款凭证失败:${error}`)
}
},
fail: (err) => {
console.error(`选择图片失败:${err}`)
}
})
} catch (error) {
console.error(`请求权限失败:${error}`)
}
}
// 删除图片
function close(index: number): void {
infoList.value[index].imgUrl = ''
dispatch('setBooks', JSON.parse(JSON.stringify(infoList.value)))
}
// 预览图片
function preview(index: number): void {
isPreview.value = true
previewImg.value = infoList.value[index].imgUrl || ''
uni.previewImage({
urls: [infoList.value[index].imgUrl || ''],
longPressActions: {
success: function (data) {
console.log(
"选中了第" +
(data.tapIndex + 1) +
"个按钮,第" +
(data.index + 1) +
"张图片"
)
},
fail: function (err) {
console.log(err.errMsg)
}
}
})
}
</script>
<style scoped lang="scss">
.information-entry {
position: fixed;
background-color: #fff;
width: 100vw;
height: 100vh;
z-index: 998;
box-sizing: border-box;
padding-top: 144rpx;
left: 0;
top: 0;
.nav-bar {
position: fixed;
width: 100%;
height: 96rpx;
left: 0;
top: 48rpx;
z-index: 9;
.back {
width: 96rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: 32rpx;
color: #1a1a1a;
}
}
.information-tips {
background: rgba(44, 102, 247, 0.1);
color: #2c66f7;
padding: 32rpx 0 24rpx 80rpx;
font-size: 28rpx;
}
.information-box {
display: flex;
padding: 40rpx 80rpx;
flex-direction:row;
.information-item {
display: flex;
flex-direction: column;
width: 264rpx;
margin-right: 48rpx;
.icon {
background-color: #f4f5f7;
border: 2rpx solid #eff0f2;
border-radius: 16rpx;
.icon-upload {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 128rpx;
height: 128rpx;
}
}
.icon,
.upload-img {
position: relative;
width: 264rpx;
height: 264rpx;
}
.upload-img {
.img {
border-radius: 16rpx;
width: 100%;
height: 100%;
}
.upload-close {
position: absolute;
right: 0;
top: 0;
width: 40rpx;
height: 40rpx;
}
}
.information-title {
margin-top: 24rpx;
font-weight: 500;
font-size: 28rpx;
color: #222222;
letter-spacing: 0;
line-height: 48rpx;
text-align: center;
}
}
}
}
.information-done {
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translateX(-50%);
width: calc(100% - 240rpx);
height: 80rpx;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
text-align: center;
line-height: 80rpx;
background-color: #2c66f7;
border-radius: 40rpx;
}
.preview-img {
height: 1300rpx;
}
</style>
<template>
<CustomPopup
:visible="visible"
ref="popup"
position="bottom"
>
<view class="popup-wrapper">
<view class="popup-box">
<view class="payment-title">{{title}}
<view
class="close flex"
@click="close"
>
<uni-icons
type="closeempty"
:size="18"
color="#1A1A1A"
></uni-icons>
</view>
</view>
<view class="popup-content">
<view class="tab-list">
<view
:class="['tab-item', { active: payActive === item.type }, { single :currentPaymentType().length == 1}]"
v-for="item in currentPaymentType()"
:key="item.type"
@click="handleSwitchTab(item)"
>{{ item.name }}</view>
</view>
<view class="payment-content">
<template v-if="payInfo && payInfo.paymentType">
<view
v-show="payActive === 1"
class="qr-code-content"
>
<image
class="qr-code-img"
:src="payInfo.storePaymentQrcodeUrl"
mode="scaleToFill"
/>
<!-- <image
class="qr-code-img"
src="https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png"
mode="scaleToFill"
/> -->
<view class="qr-code-info">扫码付款,支持多渠道付款</view>
</view>
</template>
<template v-if="accountInfo && accountInfo.paymentType">
<view
v-show="payActive === 2"
class="corporate-content"
>
<image
class="bank-logo"
:src="accountInfo.bankUrl"
mode="scaleToFill"
/>
<view class="bank-info">
<view
class="bank-item"
v-for="item in accountList"
:key="item.field"
>
<text class="bank-label">{{ item.label }}:</text>
<view class="bank-value">{{ accountInfo[item.field] }}</view>
</view>
</view>
</view>
</template>
</view>
</view>
<view
class="payment-done"
@click="done()"
>已支付,去上传付款凭证</view>
</view>
</view>
</CustomPopup>
</template>
<script setup lang="uts">
import { ref, watch } from 'vue'
import CustomPopup from '@/components/CustomPopup.uvue'
import { state } from "@/store/index.uts"
interface PaymentTypeItem {
name: string
type: number
title: string
paymentType?: number
storePaymentQrcodeUrl?: string
bankUrl?: string
companyName?: string
basicAccount?: string
subBranchAccount?: string
generalAccount?: string
paymentAccount?: string
}
interface AccountListItem {
label: string
field: string
}
interface Props {
paymentType?: PaymentTypeItem[]
}
const props = defineProps<Props>()
const ACCOUT_LIST: AccountListItem[] = [
{
label: "公司名称",
field: "companyName",
},
{
label: "基本账户",
field: "basicAccount",
},
{
label: "支行账号",
field: "subBranchAccount",
},
{
label: "一般账户",
field: "generalAccount",
},
{
label: "支付账户",
field: "paymentAccount",
},
]
const payActive = ref<number>(1)
const accountList = ref<AccountListItem[]>(ACCOUT_LIST)
const title = ref<string>('')
const accountInfo = ref<Record<string, any>>({})
const payInfo = ref<Record<string, any>>({})
const popup = ref<any>(null)
const visible = ref<boolean>(false)
// 使用传入的 paymentType 或从 store 获取
const currentPaymentType = (): PaymentTypeItem[] => {
return props.paymentType || state.user.paymentType
}
watch(() => currentPaymentType(), (newval: PaymentTypeItem[]) => {
if (newval && newval.length) {
payInfo.value = newval.find(i => i.paymentType == 1) || {}
accountInfo.value = newval.find(i => i.paymentType == 2) || {}
handleSwitchTab(newval[0], false)
}
}, { immediate: true })
// 切换 tab
function handleSwitchTab(item: PaymentTypeItem, isClick: boolean = true): void {
payActive.value = item.type
title.value = item.title
if (isClick) {
// uni.$logger.local.info(`付款方式:${item.title}`)
}
}
// 显示弹窗
function show(): void {
console.log(123)
visible.value = true
// if(this.title) uni.$logger.local.info(`付款方式:${this.title}`)
}
function close(): void {
visible.value = false
}
// 已支付
function done(): void {
emit('jumpPay')
close()
}
const emit = defineEmits(['jumpPay'])
// 暴露方法给父组件
defineExpose({
show,
close
})
</script>
<style scoped lang="scss">
.popup-box {
position: relative;
// margin-top: 286rpx;
background-color: #f8f9f9;
height: 1160rpx;
padding-bottom: 30rpx;
.payment-title {
position: relative;
width: 100%;
height: 96rpx;
padding: 24rpx 0 26rpx;
text-align: center;
border-bottom: 2rpx solid #e8e8e8;
.close {
position: absolute;
right: 0;
top: 0;
width: 96rpx;
height: 96rpx;
justify-content: center;
}
}
}
.popup-content {
.tab-list {
display: flex;
justify-content: center;
margin-top: 40rpx;
flex-direction:row;
.tab-item {
width: 320rpx;
padding: 24rpx 0;
text-align: center;
background-color: #fff;
color: #666;
font-size:28rpx;
&.active {
background-color: #2c66f7;
color: #fff;
}
&:first-child {
border-radius: 200rpx 0 0 200rpx;
}
&:last-child {
border-radius: 0 48rpx 48rpx 0;
}
}
.single {
border-radius: 48rpx !important;
}
}
.payment-content {
width: 100%;
display: flex;
justify-content: center;
margin-top: 40rpx;
flex-direction: row;
.qr-code-content {
width: 538rpx;
background-color: #fff;
border-radius: 24rpx;
text-align: center;
padding: 59rpx 0 67rpx;
display:flex;
flex-direction:column;
align-items: center;
justify-content: center;
.qr-code-img {
width: 420rpx;
height: 420rpx;
}
.qr-code-info {
margin-top: 40rpx;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
}
}
.corporate-content {
width: 1080rpx;
background-color: #fff;
border-radius: 24rpx;
.bank-logo {
width: 100%;
height: 136rpx;
}
.bank-info {
font-weight: 500;
font-size: 32rpx;
padding: 27rpx 80rpx 39rpx;
.bank-item {
display: flex;
align-items: center;
margin-bottom: 16rpx;
flex-direction: row;
&:last-child {
margin-bottom: 0;
}
.bank-label {
color: #6c6c70;
}
.bank-value {
box-sizing: border-box;
background-color: #f8f9f9;
border-radius: 8rpx;
width: 740rpx;
height: 80rpx;
line-height: 80rpx;
padding-left: 24rpx;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
letter-spacing: 0;
}
}
}
}
}
}
.payment-done {
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translateX(-50%);
width: calc(100% - 240rpx);
height: 80rpx;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
text-align: center;
line-height: 80rpx;
background-color: #2c66f7;
border-radius: 40rpx;
}
</style>
......@@ -114,7 +114,7 @@
@finish="open"
:id="id"
@toPay="toPay"
:showPayBtn="watchPayInfo"
:showPayBtn="paymentTypeList.length"
/>
<view
class="pen-box"
......@@ -125,21 +125,24 @@
</view>
</template>
</template>
<!-- <pay-pop
ref="pay"
@jumpPay="showPayPage = true"
>
</pay-pop>
<pay-pop
ref="payRef"
:paymentType="paymentTypeList"
@jumpPay="showPayPage = true"
>
</pay-pop>
<informationEntry
v-model:showPayPage="showPayPage"
@finish="open"
/>
<finish-step
ref="stepRef"
@submit="done"
:titleTips="finishTips"
/>
<informationEntry
:showPayPage.sync="showPayPage"
@finish="open"
/> -->
</view>
<BackPress ref="backpressRef" @openStep="openStep" @backHome="backHome" />
</template>
<script setup lang="uts">
......@@ -151,13 +154,16 @@
import MediaComponent from './components/MediaComponent.uvue'
import History from './components/History.uvue'
import ThreeGuarantees from './components/ThreeGuarantees.uvue'
// import payPop from './components/payPop.vue'
// import FinishStep from '@/components/FinishStep.vue'
// import informationEntry from './components/informationEntry.vue'
import payPop from './components/payPop.uvue'
import FinishStep from '@/components/FinishStep.uvue'
import informationEntry from './components/informationEntry.uvue'
import insurance from './components/Insurance/index.uvue'
import BackPress from '@/components/BackPress.uvue'
// import { receptionTrackMixin } from '@/mixin/index.js'
import { ref, getCurrentInstance, ComponentPublicInstance } from 'vue'
import { state , store} from "@/store/index.uts"
import { state , dispatch} from "@/store/index.uts"
import { getSoureData } from '@/api/system-api.uts'
import { findPayInfo as findPayInfoApi } from '@/api/common-api.uts'
const backZindex = ref<number>(9)
const drawStatus = ref<boolean>(false)
......@@ -177,6 +183,7 @@
const type = ref<string>('')
const media = ref<Array>([])
const toolList = ref<Array>([])
const paymentTypeList = ref<Array<any>>([])
// 用于存储动态 ref 的对象
const mediaRefs = ref<Record<string, any>>({})
......@@ -186,6 +193,26 @@
mediaRefs.value[`media${id}`] = component
}
}
onBackPress((event: {from: string}) => {
console.log('返回键触发', event.from)
if (event.from === 'backbutton') {
// 如果是预览模式,直接返回
if (type.value === 'preview') {
uni.navigateBack()
} else {
// 非预览模式,执行自定义返回逻辑
back()
}
// 返回 true 阻止默认的返回行为
return true
}
// 其他情况允许正常返回
return false
})
const channelType = computed(() => {
const { channelType } = storage.get('userInfo')
return channelType
......@@ -213,9 +240,6 @@
return !isPreview.value && drawStatus.value
})
const watchPayInfo = computed(() => {
return state.user.paymentType.length ? true : false
})
const title = computed(() => {
let name = media.value.find(e => e.id == id.value)?.detailTitle || ''
......@@ -237,6 +261,11 @@
const viewKey = computed(() => {
return state.user.viewKey
})
watch(() => viewKey.value, (newval) => {
if(id.value) setPageData()
}, { immediate: true })
watch(() => watchStatus.value, (newval) => {
useCarConfig.value = false
......@@ -256,7 +285,7 @@
screenWidth.value = systemInfo.screenWidth
})
onLoad((options: OnLoadOptions) => {
store.dispatch('setCustomerInfo', {})
dispatch('setCustomerInfo', {})
const storageKey = `source_${sceneType.value}_${shopMerchantId.value}`
const data = uni.getStorageSync(storageKey)
id.value = options.id
......@@ -264,11 +293,16 @@
toolList.value = data.toolList
media.value = data.moduleList
setPageData()
findPayInfo()
})
function open() {
stepRef.value?.open()
}
function openStep(): void{
backpressRef.value.hide()
open()
}
function handleFull(val: boolean) {
backZindex.value = val ? 0 : 9
......@@ -315,22 +349,29 @@
}
})
}
function clearHistory():void{
dispatch('clearCustomerInfo')
dispatch('clearHistory')
dispatch('clearReceptionTrack')
}
function back (): void{
if(showPayPage.value) return showPayPage.value = false
if(type.value !== 'preview') return
else uni.navigateBack()
if(!isPreview.value) return backpressRef.value.open()
backHome()
}
function done(e: any) {
showPayPage.value = false
toolRef.value?.hide()
stepRef.value?.close()
toolRef.value.hide()
stepRef.value.close()
// receptionTrackLeave()
emit('done', e)
}
function toPay() {
function backHome():void{
clearHistory()
uni.navigateBack()
}
function toPay(): void {
payRef.value?.show()
}
......@@ -398,9 +439,11 @@
let storageName = `source_${sceneType.value}_${shopMerchantId.value}_${carBrandId}_${carChildsBrandId}`
let data = uni.getStorageSync(storageName)
try {
console.log('try',currentCarInfo.value)
let requestData = await getSoureData(shopMerchantId.value, sceneType.value, params)
if (requestData) setViewInfo(requestData)
} catch (error) {
console.log(error)
if (data) setViewInfo(data)
}
}
......@@ -426,15 +469,48 @@
}
currentMediaId.value = data.id
}
// 查询门店支付配置
async function findPayInfo(): Promise<void> {
const userInfo = storage.get('userInfo')
const userInfoObj = userInfo as UTSJSONObject
const shopMerchantId = userInfoObj['shopMerchantId'] as string | number
const data = await findPayInfoApi({
merchantId: shopMerchantId
})
let paymentType: Array<any> = []
data.find((item: any) => {
if (item.paymentType == 1) {
paymentType.push({
name: '扫码支付',
type: 1,
title: '付款二维码',
...item
})
}
if (item.paymentType == 2) {
paymentType.push({
name: '对公账户',
type: 2,
title: '付款方式',
...item
})
}
})
paymentTypeList.value = paymentType
}
// const { receptionTrackLeave } = receptionTrackMixin.methods
const emit = defineEmits(['update:id',
'back',
'done'])
const toolRef = ref(null)
const payRef = ref(null)
const stepRef = ref(null)
const toolRef = ref<any>(null)
const payRef = ref<any>(null)
const stepRef = ref<any>(null)
const backpressRef = ref<any>(null)
</script>
<style lang="scss">
......
......@@ -40,10 +40,10 @@
import { ref, ComponentPublicInstance } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { storage } from '@/utils/storage.uts'
import { store } from "@/store/index.uts";
import { state , dispatch } from "@/store/index.uts";
import HomeFrame from '@/components/HomeFrame/index.uvue'
import { getMerchantCarBrandList, getEmployeeList , getCarBrandsListApi } from '@/api/common-api.uts'
import { getSoureData } from '@/api/system-api.uts'
import { getMockData, getSoureData } from '@/api/system-api.uts'
const homeRef = ref(null)
const detailRef = ref(null)
......@@ -59,8 +59,8 @@
mediaId.value = dataId
loadComplete.value = true
store.state.user = {
...store.state.user,
state.user = {
...state.user,
...data
}
}
......@@ -97,13 +97,20 @@
brandIdList.push(e.id)
})
getSoure(brandIdList, subBrandIdList)
store.dispatch('setCarBrandsList', carBrandList)
dispatch('setCarBrandsList', carBrandList)
storage.set('carBrandList', carBrandList)
if (carBrandList.length) {
let index = 0
getCarBrandsList(carBrandList, index)
}
})
/**获取销售人员 */
getEmployeeList({
merchantId: shopMerchantId
}).then(res => {
dispatch('setEmployeeList', res || [])
storage.set('employeeList', res || [])
})
}
async function getSoure(brandIdList: string[], subBrandIdList: string[]): Promise<void> {
......@@ -133,7 +140,19 @@
}
}
onLoad((options: OnLoadOptions) => {
onLoad((options: OnLoadOptions) => {
getMockData(true).then(mockdata =>{
console.log(mockdata,'===')
const userInfo = storage.get('userInfo')
const mockDataObj = mockdata as UTSJSONObject
const {channelType} = userInfo as UTSJSONObject
if (channelType == 1 && mockDataObj.boutiqueDefaultCarBrandId) {
state.user.boutiqueDefaultCarBrandId = mockDataObj.boutiqueDefaultCarBrandId //默认车辆品牌
if (mockDataObj.defaultCarId) {
state.user.defaultCarId = mockDataObj.defaultCarId //默认车系
}
}
})
get_Vehicle_Sales_Data()
uni.hideLoading()
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!