Commit 13a2e95b by 胡悦

提交

1 parent 7cbf2a87
...@@ -39,6 +39,14 @@ module.exports = { ...@@ -39,6 +39,14 @@ module.exports = {
...data, ...data,
}); });
}, },
// 历史订单列表
getQuotationList (data) {
return http.post({
method: "dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page",
projectName: "boutique",
...data,
});
},
/**客户邀约记录 */ /**客户邀约记录 */
customerInviteRecordPage (data) { customerInviteRecordPage (data) {
return http.post({ return http.post({
......
<template> <template>
<view class="layout"> <view class="layout">
<view class="title">{{ title }}</view> <view class="title">{{ title }}</view>
<template v-if="historyList.length > 0"> <template v-if="list.length > 0">
<scroll-view class="record-box" scroll-y @scrolltolower="pageonReachBottom"> <scroll-view class="record-box" scroll-y @scrolltolower="pageonReachBottom">
<view class="card-list"> <view class="card-list">
<view class="card-item" v-for="item in historyList" :key="item.id"> <view class="card-item" v-for="item in list" :key="item.id">
<template> <template>
<image <image
v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl" v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl"
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
<view class="gradient-overlay"></view> <view class="gradient-overlay"></view>
</template> </template>
<view> <view>
<view class="name">{{ nameHide(item.customerName) }}</view> <!-- <view class="name">{{ nameHide(item.customerName) }}</view> -->
<view class="name">{{ item.id }}</view>
<view class="goods-name">{{ item.goodsName }}</view> <view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info"> <view class="card-info">
<view class="label">车架号</view> <view class="label">车架号</view>
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="end-text" v-if="historyList.length > 0 && isEnd">我是一个有底线的人</view> <view class="end-text" v-if="list.length > 0 && isEnd">我是一个有底线的人</view>
</scroll-view> </scroll-view>
</template> </template>
<template v-else> <template v-else>
...@@ -55,8 +56,10 @@ ...@@ -55,8 +56,10 @@
<script> <script>
import utils from '@/utils/utils'; import utils from '@/utils/utils';
import Record from "@/mixin/record";
export default { export default {
name: 'History', name: 'History',
mixins:[Record],
props: { props: {
title: String, title: String,
madiaId: Number, madiaId: Number,
...@@ -64,9 +67,7 @@ export default { ...@@ -64,9 +67,7 @@ export default {
}, },
data() { data() {
return { return {
historyList: [],
isEnd: false, isEnd: false,
pageNum: 1,
shopMerchantId: '', shopMerchantId: '',
goodsName: null goodsName: null
} }
...@@ -79,7 +80,7 @@ export default { ...@@ -79,7 +80,7 @@ export default {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.pageNum = 1 this.pageNum = 1
this.historyList = [] this.list = uni.$storage.get(`${this.shopMerchantId}-historyList`)
} }
}, },
watchCarModel: { watchCarModel: {
...@@ -87,7 +88,7 @@ export default { ...@@ -87,7 +88,7 @@ export default {
handler(newval) { handler(newval) {
console.log(newval) console.log(newval)
if (this.madiaId == 4) { if (this.madiaId == 4) {
this.historyList = uni.$storage.get("historyList") // this.list = uni.$storage.get("historyList")
let index = { let index = {
'问界M5': 'M5', '问界M5': 'M5',
'问界M7': 'M7', '问界M7': 'M7',
...@@ -116,34 +117,24 @@ export default { ...@@ -116,34 +117,24 @@ export default {
this.shopMerchantId = shopMerchantId this.shopMerchantId = shopMerchantId
this.getQuotationList(true); this.getQuotationList(true);
}, },
async getQuotationList (isSwitch = false, next = false) { async getQuotationList () {
const { goodsName, shopMerchantId, pageNum } = this const { goodsName, shopMerchantId, pageNum, pageSize } = this
if (next) ++this.pageNum this.getList('getQuotationList',{
const data = await uni.$api.commonApi.getQuotationList({ merchantIds: shopMerchantId,
pageNum, pageNum,
pageSize: 18, pageSize,
merchantId: shopMerchantId, goodsName,
orderStatus: 3, orderStatus: 3,
goodsName
}) })
console.log(data.list, '=====') if (pageNum == 1) uni.setStorageSync(`${shopMerchantId}-historyList`, thisuni.onGetWifiList())
if (isSwitch) {
this.historyList = data.list
uni.$storage.set("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
}
}
}, },
pageonReachBottom() { pageonReachBottom() {
console.log('xiala ') let { pageNum, total, isEnd, pageSize } = this
this.getQuotationList(false, true) if (!isEnd) isEnd = false
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getQuotationList()
} else this.isEnd = true
}, },
// 脱敏 // 脱敏
nameHide(name) { nameHide(name) {
......
...@@ -19,6 +19,7 @@ export const STORAGE_OBJECTkEY = { ...@@ -19,6 +19,7 @@ export const STORAGE_OBJECTkEY = {
employeeList: "employeeList", employeeList: "employeeList",
recordList: "recordList", recordList: "recordList",
recordSuccessList: "recordSuccessList", recordSuccessList: "recordSuccessList",
historyList: "historyList"
}; };
// export const IMG_VERSION = async () => { // export const IMG_VERSION = async () => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!