Commit b58b4a3b by 胡悦

提交

1 parent a9f46d15
......@@ -9,6 +9,7 @@ export default {
nothing: false,
pageSize: 18,
total: 0,
isEnd: false
};
},
mounted () { },
......@@ -26,6 +27,7 @@ export default {
} catch (error) {
uni.hideLoading()
this.flag = true;
this.isEnd = true
}
},
},
......
......@@ -5,6 +5,7 @@
<scroll-view
class="record-box"
scroll-y
:scroll-top="scrollTop"
@scrolltolower="pageonReachBottom"
>
<view class="card-list">
......@@ -27,8 +28,8 @@
<view class="gradient-overlay"></view>
</template>
<view>
<!-- <view class="name">{{ nameHide(item.customerName) }}</view> -->
<view class="name">{{ item.id }}</view>
<view class="name">{{ nameHide(item.customerName) }}</view>
<!-- <view class="name">{{ item.id }}</view> -->
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info">
<view class="label">车架号</view>
......@@ -86,18 +87,24 @@ export default {
return {
isEnd: false,
shopMerchantId: '',
goodsName: null
goodsName: null,
scrollTop: 0
}
},
watch: {
show (n) {
show(n) {
if (n) this.init()
else this.scrollTop = 0
},
watchStatus: {
immediate: true,
handler (newval) {
handler(newval) {
this.pageNum = 1
this.list = uni.getStorageSync(`${this.shopMerchantId}-historyList`)
this.scrollTop = 1000
setTimeout(() => {
this.scrollTop = 0
}, 100);
}
},
watchCarModel: {
......@@ -109,8 +116,7 @@ export default {
let index = {
'问界M5': 'M5',
'问界M7': 'M7',
'问界M9': 'M9',
'奥迪RS 3': '测试'
'问界M9': 'M9'
}[newval]
return this.goodsName = index || null
}
......@@ -133,6 +139,10 @@ export default {
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
if (this.pageNum == 1) this.getQuotationList();
if (this.list.length == 0) {
this.list = uni.getStorageSync(`${this.shopMerchantId}-historyList`)
this.isEnd = true
}
},
async getQuotationList () {
const { goodsName, shopMerchantId, pageNum, pageSize } = this
......@@ -143,9 +153,22 @@ export default {
goodsName,
orderStatus: 3,
})
if (pageNum == 1) uni.setStorageSync(`${shopMerchantId}-historyList`, this.list)
if (pageNum == 1) {
uni.setStorageSync(`${shopMerchantId}-historyList`, this.list)
if (goodsName && this.list.length == 0) {
await this.getList('getQuotationList', {
merchantIds: shopMerchantId,
pageNum,
pageSize,
goodsName: null,
orderStatus: 3,
})
}
}
// if (pageNum == 1) uni.setStorageSync(`${shopMerchantId}-historyList`, this.list)
},
pageonReachBottom () {
pageonReachBottom() {
this.isEnd = false
let { pageNum, total, isEnd, pageSize } = this
if (!isEnd) isEnd = false
if (Math.ceil(total / pageSize) > pageNum) {
......@@ -206,6 +229,7 @@ export default {
box-shadow: inset 0 0 16rpx 0 #ffffff;
z-index: 11;
padding: 32rpx;
width: 708rpx;
.name {
font-weight: 500;
font-size: 32rpx;
......@@ -217,6 +241,10 @@ export default {
font-weight: 500;
font-size: 32rpx;
color: #2c66f7;
width: 644rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.card-info {
display: flex;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!