Browse Source

订单

devlop
buffeyu 4 years ago
parent
commit
5875201aa9
1 changed files with 41 additions and 44 deletions
  1. 85
      pages/trade/orderList.vue

85
pages/trade/orderList.vue

@ -2,21 +2,23 @@
<view class="order-list">
<uni-segmented-control :current="controlCurrent" :values="controlItems" @clickItem="onClickItem" styleType="text" activeColor="#007AFF"></uni-segmented-control>
<scroll-list style="touch-action: none" ref="orderRef" :option="orderOption" @load="orderUp" @refresh="orderDown">
<view v-for="(items, index) in orderData" :key="index">
<view v-for="(item, index) in list" :key="index">
<view class="list-border list-title-line">
<text class="list-title">广州民族印刷有限公司</text>
<text class="list-title-Subtitle">{{controlItems[items.orderStatus-1] }}</text>
<text class="list-title">{{item.customerEnterpriseName}}</text>
<text class="list-title-Subtitle">{{controlItems[item.orderStatus-1] }}</text>
</view>
<view class="list-border list-info-line" v-for="(item, index) in items.orderItemList" :key="index">
<view class="list-info " :class="index===items.orderItemList.length?'list-border':''">
<view class="list-border list-info-line" v-for="(subItem, subIndex) in item.supplierOrderList[0].orderItmes" :key="subIndex">
<view class="list-info">
<view class="">
<!-- <image class="list-image" :src="item.productImg" mode=""></image> -->
<image class="list-image" src="../../static/logo.png" mode="">
<image class="list-image" :src="subItem.productImg" mode="">
</view>
<view class="list-info-contant">
<view class="list-info-title">{{ item.brandName }}{{ item.categoryName }}</view>
<view class="list-info-title">{{ subItem.productName }}
</view>
<view class="list-info-text">
{{ item.categoryName }}/{{ item.brandName }}/{{ item.gramWeight }}g/{{ item.length }}*{{ item.width }}/{{ item.pieceQuantity }}
{{ subItem.categoryName }}/{{ subItem.brandName }}/{{ item.gramWeight }}g/{{ subItem.length }}*{{ subItem.width }}/{{ subItem.pieceQuantity }}
</view>
</view>
</view>
@ -24,10 +26,10 @@
<view class="list-border list-bottom-contant">
<view>
<text class="list-bottom-contant-text">交货时间</text>
<text class="list-bottom-contant-subtext">{{ items.deliveryDay }}</text>
<text class="list-bottom-contant-subtext">{{ item.deliveryDay }}</text>
</view>
<view>
<text class="list-title-Subtitle">¥{{ items.totalOfferPrice }}</text>
<text class="list-title-Subtitle">¥{{ item.totalOfferPrice }}</text>
</view>
</view>
<uGap></uGap>
@ -39,7 +41,8 @@
<script>
import uGap from '@/components/u-gap/u-gap.vue'
import scrollList from '@/components/scroll-list/scroll-list.vue'
import { gettradingHallList } from '@/apis/trade'
// import { gettradingHallList } from '@/apis/trade'
import { getBasePaperDeals } from '@/apis/clientDetailApi.js'
export default {
// props: {
// queryOrderData: {
@ -67,46 +70,40 @@ export default {
background: '#F7F8FA',
fontSize: '40rpx'
},
orderParams: {
cooperationState: 0,
latitude: 23.12616,
longitude: 113.38466,
km: 5
}
}
},
watch: {
// queryOrderData(value) {
// console.log('value', value)
// },
orderParams: {
handler(val) {
this.getTradingQurty()
params: {
asc: '',
desc: '',
// customerEnterpriseId: this.$store.state.supplierInfo.id || null, // IDid
// mallSupplierId: this.$store.state.supplierInfo.supplierId || null, // id
customerEnterpriseId: '651107734133018624',
mallSupplierId: '670334117090562048', // id
status: '0', // 0 /30106,/30107,/30207,/30104
enterpriseIds: [] //ID
},
deep: true
}
},
onLoad(option) {
if (option) {
option.latitude && (this.params.latitude = option.latitude)
option.longitude && (this.params.longitude = option.longitude)
option.km && (this.params.km = option.km)
pagination: {
pageNum: 0, //
pageSize: 10
},
list: []
}
this.getTradingQurty()
},
onLoad(option) {},
methods: {
//
getTradingQurty() {
getList() {
return new Promise((resolve, reject) => {
gettradingHallList({ ...this.orderPagination })
getBasePaperDeals({ ...this.params, ...this.pagination })
.then(res => {
console.log('订单列表', res)
if (res) {
if (this.orderPagination.pageNum == 1) {
this.orderData = res.records
if (this.pagination.pageNum == 1) {
this.list = res.records
} else {
this.orderData = this.orderData.concat(res.records)
this.list = this.list.concat(res.records)
}
resolve({ list: this.orderData, total: res.total })
// this.list = []
// this.list = [...this.list, ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
resolve({ list: this.list, total: res.total })
}
})
.catch(err => {
@ -117,9 +114,9 @@ export default {
//
orderUp(page) {
this.orderPagination.pageNum++
this.getTradingQurty()
this.getList()
.then(({ list, total }) => {
this.$refs.orderRef.loadSuccess({ list, total })
this.$refs.orderRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.orderRef.loadFail()
@ -128,7 +125,7 @@ export default {
//
orderDown() {
this.orderPagination.pageNum = 1
this.getTradingQurty()
this.getList()
.then(({ list, total }) => {
this.$refs.orderRef.refreshSuccess({ list, total })
})

Loading…
Cancel
Save