Commit 7d443748 by 李伟康

commit 支付凭证页面修改为组件

1 parent 098d35a5
...@@ -50,18 +50,16 @@ const imgToBase64 = (list, urlKey) => { ...@@ -50,18 +50,16 @@ const imgToBase64 = (list, urlKey) => {
let arr = [], let arr = [],
newList = JSON.parse(JSON.stringify(list)) newList = JSON.parse(JSON.stringify(list))
list.map((e, index) => { list.map((e, index) => {
if(!(urlKey ? e[urlKey] : e).startsWith('https')) return resolve(list) if (!e[urlKey]) return resolve(list)
if (!e[urlKey].startsWith('https')) return resolve(list)
uni.request({ uni.request({
url: urlKey ? e[urlKey] : e, url: urlKey ? e[urlKey] : e,
method: 'GET', method: 'GET',
responseType: 'arraybuffer', responseType: 'arraybuffer',
success: (res) => { success: (res) => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}` const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
if (urlKey) {
newList[index][urlKey] = base64 newList[index][urlKey] = base64
newList[index][`original_${urlKey}`] = e[urlKey] newList[index][`original_${urlKey}`] = e[urlKey]
}
else newList[index] = base64
arr.push(e) arr.push(e)
if (arr.length === list.length) resolve(newList) if (arr.length === list.length) resolve(newList)
}, },
......
...@@ -22,13 +22,7 @@ ...@@ -22,13 +22,7 @@
"disableSwipeBack": true "disableSwipeBack": true
} }
}, },
{
"path": "pages/equity/informationEntry",
"style": {
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/equity/detail/detail", "path": "pages/equity/detail/detail",
"style": { "style": {
......
<template>
<view class="layout">
<view class="bg">
<!-- <image src="../../../assets/images/media/bg-6.webp" /> -->
</view>
<view class="content">
<view class="title">{{ title || "历史成交记录" }}</view>
<template v-if="list.length && shopMerchantId">
<Tabs :list="list" @tabclick="tabclick" ref="tabs" />
</template>
<view class="card-list">
<template v-if="historyList.length > 0">
<view class="card-item" v-for="item in historyList" :key="item.id">
<view class="name"
>{{ nameHide(item.customerName) }}
<view
v-if="item.ownerGender"
:class="[
'sex-avatar sprite-icon',
`icon-${sexType[item.ownerGender]}`,
]"
></view>
</view>
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info">
<view>车架号</view>
<view>{{ item.carVin || "-" }}</view>
</view>
<view class="card-info">
<view>工单号</view>
<view>{{ item.payId }}</view>
</view>
<view class="card-info">
<view>订单时间</view>
<view>{{ format(item.createdTime) }}</view>
</view>
<view class="card-info">
<view>交易流水号</view>
<view>{{ item.transactionNo }}</view>
</view>
<view class="card-info">
<view>支付方式</view>
<view
:class="[
'pay-type sprite-icon',
`icon-${payType[item.payType]}`,
]"
></view>
</view>
<view class="card-info">
<view>实收金额</view>
<view class="price">¥{{ accDiv(item.equityPrice) }}</view>
</view>
</view>
</template>
<template v-else>
<view class="no-data">
<glsx-image
class="no-data-img"
src="media/no-data.png"
mode="scaleToFill"
/>
<view class="no-data-text">暂无数据</view>
</view>
</template>
<!-- <uni-grid :column="3" :show-border="false" :square="false">
<uni-grid-item v-for="item in historyList" :key="item.id"> -->
<!-- </uni-grid-item>
</uni-grid> -->
</view>
<view class="end-text" v-if="historyList.length > 0 && isEnd"
>我是一个有底线的人</view
>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import utils from '@/utils/utils';
import Tabs from './Tabs.vue';
export default {
name: 'Media_6',
props: {
show: Boolean,
title: String
},
components: { Tabs },
data () {
return {
list: [
{
tabName: '问界 M5',
value: 'M5'
},
{
tabName: '问界 M7',
value: 'M7'
},
{
tabName: '问界 M9',
value: 'M9'
}
],
historyList: [],
payType: {
1: 'icon-weixin',
2: 'icon-shop'
},
sexType: {
'男': 'icon-male',
'女': 'icon-female'
},
goodsName: 'M5',
shopMerchantId: '',
currentPage: 1,
isEnd: false
}
},
watch: {
show (n) {
if (n) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.$refs?.tabs?.tabClick(0)
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
},
mounted () {
if (this.show) this.init()
// const { shopMerchantId } = uni.$storage.get("userInfo");
// this.shopMerchantId = shopMerchantId
// this.getQuotationList();
},
methods: {
format (dateTimeStr) {
return utils.convertDateTimeFormat(dateTimeStr, '/')
},
accDiv (val) {
return utils.accDiv(val, 100)
},
init () {
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
this.getQuotationList();
},
async getQuotationList (isSwitch = false, next = false) {
const { goodsName, shopMerchantId, currentPage } = this
if (next) this.currentPage++
const data = await uni.$api.commonApi.getQuotationList({
currentPage,
pageSize: 18,
merchantId: shopMerchantId,
orderStatus: 3,
goodsName
})
if (isSwitch) {
this.historyList = data.list
this.isEnd = false
} else {
if (data.list.length > 0) {
this.historyList = this.historyList.concat(data.list)
this.isEnd = false
} else {
if (this.historyList.length > 9) this.isEnd = true
}
}
},
tabclick (index) {
this.goodsName = this.list[index].value
this.currentPage = 1
this.getQuotationList(true)
},
// 脱敏
nameHide (name) {
return name.substring(0, 1) + '**';
// if (name.length == 2) {
// name = name.substring(0, 1) + '*'; // 截取name 字符串截取第一个字符,
// return name; // 张三显示为张*
// } else if (name.length == 3) {
// name = name.substring(0, 1) + '*' + name.substring(2, 3); // 截取第一个和第三个字符
// return name; // 李思思显示为李*思
// } else if (name.length > 3) {
// name = name.substring(0, 1) + '*' + '*' + name.substring(3, name.length); // 截取第一个和大于第4个字符
// return name; // 王五哈哈显示为王**哈
// }
}
}
}
</script>
<style scoped lang="scss">
.layout {
padding-top: 192rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 240rpx;
image {
width: 100%;
height: 100%;
}
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-size: 40rpx;
line-height: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
.card-list {
position: relative;
margin: 0 72rpx;
display: grid;
grid-template-columns: repeat(3, 664rpx);
grid-template-rows: 0fr;
justify-content: center;
grid-gap: 32rpx;
min-height: calc(100vh - 416rpx);
.card-item {
margin: 16rpx auto;
padding: 24rpx 40rpx;
width: 664rpx;
// height: 440rpx;
background: #ffffff;
border: 2rpx solid #dce0e6;
border-radius: 16rpx;
height: 448rpx;
.name {
display: flex;
align-items: center;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
margin-bottom: 16rpx;
.sex-avatar {
width: 32rpx;
height: 32rpx;
margin-left: 8rpx;
}
}
.goods-name {
margin-bottom: 16rpx;
font-weight: 500;
font-size: 32rpx;
color: #2c66f7;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.card-info {
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999999;
line-height: 32rpx;
margin-bottom: 16rpx;
.pay-type {
width: 32rpx;
height: 32rpx;
}
.price {
font-weight: 600;
font-size: 36rpx;
color: #14cc68;
}
}
}
}
}
}
.end-text {
color: #999;
text-align: center;
margin: 50rpx 0;
}
.no-data {
position: absolute;
left: 50%;
top: 30%;
transform: translate(-50%, -50%);
&-img {
width: 640rpx;
height: 272rpx;
}
&-text {
font-size: 32rpx;
color: #999999;
text-align: center;
margin-top: 24rpx;
}
}
</style>
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
'问界M7': 1, '问界M7': 1,
'问界M9': 2 '问界M9': 2
}[this.customerInfo.carModel] }[this.customerInfo.carModel]
return this.carTypeList[name || 0] return this.carTypeList[name || 0].url
} }
}, },
methods: { methods: {
......
...@@ -6,7 +6,20 @@ ...@@ -6,7 +6,20 @@
* @LastEditTime: 2024-04-18 11:24:22 * @LastEditTime: 2024-04-18 11:24:22
--> -->
<template> <template>
<view class="information-entry"> <view class="information-entry" v-if="showPayPage">
<view class="nav-bar">
<view
class="back"
@click="$emit('update:showPayPage', false)"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
<view class="title">信息录入</view>
</view>
<view class="information-tips">建议同步采集凭证,若接待工作繁忙可在提单环节再进行补充。</view> <view class="information-tips">建议同步采集凭证,若接待工作繁忙可在提单环节再进行补充。</view>
<view class="information-box"> <view class="information-box">
<view <view
...@@ -50,24 +63,11 @@ ...@@ -50,24 +63,11 @@
</view> </view>
<view <view
class="information-done" class="information-done"
@click="done()" @click="$emit('finish')"
>完成接待</view> >完成接待</view>
<!-- <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0"> <!-- <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0">
<image class="preview-img" :src="previewImg" mode="aspectFit" /> <image class="preview-img" :src="previewImg" mode="aspectFit" />
</uni-popup> --> </uni-popup> -->
<MessageBox
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
<finish-step
ref="stepRef"
@submit="submit"
/>
<update-box />
</view> </view>
</template> </template>
<script> <script>
...@@ -88,12 +88,11 @@ const INFO_LIST = [ ...@@ -88,12 +88,11 @@ const INFO_LIST = [
title: "客户延保合同", title: "客户延保合同",
}, },
]; ];
import myClick from "@/mixin/click";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import FinishStep from "@/components/FinishStep.vue";
export default { export default {
components: { FinishStep }, props: {
mixins: [myClick], showPayPage: Boolean
},
data () { data () {
return { return {
infoList: JSON.parse(JSON.stringify(INFO_LIST)), infoList: JSON.parse(JSON.stringify(INFO_LIST)),
...@@ -101,18 +100,12 @@ export default { ...@@ -101,18 +100,12 @@ export default {
isPreview: false, isPreview: false,
}; };
}, },
onLoad (options) {
const text = options.text;
uni.setNavigationBarTitle({
title: text,
});
},
watch: { watch: {
watchBooksList: { watchBooksList: {
immediate: true, immediate: true,
handler (newValue) { handler (newValue) {
console.log(newValue,'===') console.log(newValue, '===')
if(newValue.length) this.infoList = newValue if (newValue.length) this.infoList = newValue
else this.infoList = JSON.parse(JSON.stringify(INFO_LIST)) else this.infoList = JSON.parse(JSON.stringify(INFO_LIST))
}, },
} }
...@@ -122,14 +115,6 @@ export default { ...@@ -122,14 +115,6 @@ export default {
return this.$store.state.audio.booksList return this.$store.state.audio.booksList
} }
}, },
onBackPress () {
// this.infoList = this.infoList.map((item) => {
// if (item.imgUrl) {
// delete item.imgUrl;
// }
// return item;
// });
},
methods: { methods: {
...mapMutations("audio", ["setBooks"]), ...mapMutations("audio", ["setBooks"]),
// 上传图 // 上传图
...@@ -168,20 +153,6 @@ export default { ...@@ -168,20 +153,6 @@ export default {
this.infoList[index].imgUrl = '' this.infoList[index].imgUrl = ''
this.setBooks(utils.deepClone(this.infoList)) this.setBooks(utils.deepClone(this.infoList))
}, },
// 完成接待按钮
done () {
this.$refs.stepRef.open();
},
submit () {
this.$refs.stepRef.close();
this.stopAudio();
// this.infoList = INFO_LIST.map((item) => delete item.imgUrl);
setTimeout(() => {
uni.reLaunch({
url: "/pages/equity/index",
});
}, 1500);
},
// 预览图片 // 预览图片
preview (index) { preview (index) {
this.isPreview = true; this.isPreview = true;
...@@ -214,6 +185,33 @@ export default { ...@@ -214,6 +185,33 @@ export default {
position: relative; position: relative;
background-color: #fff; background-color: #fff;
height: 100vh; height: 100vh;
z-index: 998;
box-sizing: border-box;
padding-top: 72px;
.nav-bar {
position: fixed;
width: 100%;
height: 96rpx;
left: 0;
top: 48rpx;
z-index: 9;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
}
}
.information-tips { .information-tips {
background: rgba(44, 102, 247, 0.1); background: rgba(44, 102, 247, 0.1);
color: #2c66f7; color: #2c66f7;
......
...@@ -163,9 +163,10 @@ export default { ...@@ -163,9 +163,10 @@ export default {
// delta: 1, // delta: 1,
// }); // });
// this.stopAudio(); // this.stopAudio();
uni.navigateTo({ // uni.navigateTo({
url: `/pages/equity/informationEntry`, // url: `/pages/equity/informationEntry`,
}); // });
this.$emit('jumpPay')
this.close(); this.close();
}, },
}, },
......
...@@ -60,35 +60,42 @@ ...@@ -60,35 +60,42 @@
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view> <view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view> </view>
</template> </template>
<pay-pop ref="pay"></pay-pop> <pay-pop
ref="pay"
@jumpPay="showPayPage = true"
></pay-pop>
<finish-step <finish-step
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
/> />
<informationEntry
:showPayPage.sync="showPayPage"
@finish="open"
/>
</view> </view>
</template> </template>
<script> <script>
import ToolBox from "@/components/ToolBox.vue"; import ToolBox from "@/components/ToolBox.vue";
import Reception from "./components/Reception.vue"; import Reception from "./components/Reception.vue";
import MediaComponent from "./components/MediaComponent.vue"; import MediaComponent from "./components/MediaComponent.vue";
import Media_6 from "./components/Media_6.vue";
import History from "./components/History.vue"; import History from "./components/History.vue";
import ThreeGuarantees from "./components/ThreeGuarantees.vue"; import ThreeGuarantees from "./components/ThreeGuarantees.vue";
import Guarantee from './components/Guarantee.vue'; import Guarantee from './components/Guarantee.vue';
import payPop from "./components/payPop.vue"; import payPop from "./components/payPop.vue";
import FinishStep from '@/components/FinishStep.vue'; import FinishStep from '@/components/FinishStep.vue';
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import informationEntry from './components/informationEntry.vue'
export default { export default {
components: { components: {
ToolBox, ToolBox,
Reception, Reception,
MediaComponent, MediaComponent,
Media_6,
payPop, payPop,
FinishStep, FinishStep,
Guarantee, Guarantee,
History, History,
ThreeGuarantees ThreeGuarantees,
informationEntry
}, },
props: { props: {
id: [String, Number], id: [String, Number],
...@@ -105,7 +112,8 @@ export default { ...@@ -105,7 +112,8 @@ export default {
startX: null, startX: null,
startY: null, startY: null,
screenWidth: null, screenWidth: null,
scaleValueObject: {} scaleValueObject: {},
showPayPage: false
}; };
}, },
computed: { computed: {
...@@ -155,6 +163,7 @@ export default { ...@@ -155,6 +163,7 @@ export default {
this.$emit('back') this.$emit('back')
}, },
done (e) { done (e) {
this.showPayPage = false
this.$refs.toolRef.hide() this.$refs.toolRef.hide()
this.$refs.stepRef.close() this.$refs.stepRef.close()
this.$emit('done', e) this.$emit('done', e)
...@@ -183,7 +192,7 @@ export default { ...@@ -183,7 +192,7 @@ export default {
isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3, isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3,
index = toolList.findIndex(item => item.id == id) index = toolList.findIndex(item => item.id == id)
if (Math.abs(this.startY - touch.pageY) > 100) return if (Math.abs(this.startY - touch.pageY) > 100) return
if(!scaleValueObject[id]) scaleValueObject[id] = 1 if (!scaleValueObject[id]) scaleValueObject[id] = 1
if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1) { if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1) {
const nextId = this.getNextId(index, toolList, startX, halfScreenWidth) const nextId = this.getNextId(index, toolList, startX, halfScreenWidth)
this.$emit('update:id', nextId) this.$emit('update:id', nextId)
...@@ -199,8 +208,8 @@ export default { ...@@ -199,8 +208,8 @@ export default {
return index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id; return index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id;
} }
}, },
scale(e){ scale (e) {
let {id} = this let { id } = this
this.scaleValueObject[id] = e this.scaleValueObject[id] = e
} }
}, },
......
...@@ -85,6 +85,7 @@ export default { ...@@ -85,6 +85,7 @@ export default {
const mock_data = uni.$storage.get('mock_data') || {} const mock_data = uni.$storage.get('mock_data') || {}
this.moduleList = mock_data.moduleList || [] this.moduleList = mock_data.moduleList || []
this.toolList = mock_data.toolList || [] this.toolList = mock_data.toolList || []
this.get_Vehicle_Sales_Data()
}, },
onShow () { onShow () {
const userInfo = uni.$storage.get("userInfo") const userInfo = uni.$storage.get("userInfo")
...@@ -107,12 +108,24 @@ export default { ...@@ -107,12 +108,24 @@ export default {
init () { init () {
this.getSoure(); this.getSoure();
this.findPayInfo(); this.findPayInfo();
},
/**获取车型&销售数据 */
get_Vehicle_Sales_Data () {
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
storageCarBrandList = uni.$storage.get('carBrandList'), storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'), storageEmployeeList = uni.$storage.get('employeeList'),
{ shopMerchantId } = userInfo { shopMerchantId } = userInfo
if (storageCarBrandList) this.$store.dispatch("setCarBrandsList", storageCarBrandList); if (storageCarBrandList) this.$store.dispatch("setCarBrandsList", storageCarBrandList);
if (storageEmployeeList) this.$store.dispatch("setEmployeeList", storageEmployeeList); if (storageEmployeeList) this.$store.dispatch("setEmployeeList", storageEmployeeList);
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
})
.then((res) => {
this.$store.dispatch("setEmployeeList", res || []);
uni.$storage.set('employeeList', res || [])
});
/**获取品牌车型 */ /**获取品牌车型 */
uni.$api.commonApi uni.$api.commonApi
.getMerchantCarBrandList([shopMerchantId]) .getMerchantCarBrandList([shopMerchantId])
...@@ -139,24 +152,14 @@ export default { ...@@ -139,24 +152,14 @@ export default {
} }
}) })
} }
})
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
}) })
.then((res) => {
this.$store.dispatch("setEmployeeList", res || []);
uni.$storage.set('employeeList', res || [])
});
}, },
// 查询素材 // 查询素材
async getSoure () { async getSoure () {
const { moduleList, toolList } = await uni.$api.systemApi.getMockData(true); const { moduleList, toolList } = await uni.$api.systemApi.getMockData(true);
await moduleList.map(async e => { await moduleList.map(async e => {
if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl') if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl')
if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList) if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList, 'url')
}) })
this.moduleList = moduleList this.moduleList = moduleList
this.toolList = toolList this.toolList = toolList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!