a3197878436@163.com 1 year ago
parent 28a36bb26c
commit 3cdd46dd80

@ -0,0 +1,146 @@
<script setup>
</script>
<template>
<view class="order">
<!-- 背景图片 -->
<view class="background">
<image src="../../static/background/background.jfif"></image>
</view>
<!-- 订单列表 -->
<view class="order_item" v-for="(item,index) in orderList" :key="item.supplier_order_id" @click="navToOrderDetail(item.supplier_order_id)">
<view class="shop"> <!-- 商铺名称 -->
<image src="../../static/order-icon/shop.png"></image>
<view class="shop_name">{{item.super_user_name}}</view>
</view>
<view class="order_info"> <!-- 商铺信息 -->
<view>联系电话{{item.super_phone}}</view>
<view>联系地址{{item.super_address}}</view>
<view>订单时间{{item.supplier_order_createdate | formatDate}}</view>
<view v-if="orderList[index].supplier_goods_price">{{item.supplier_goods_price}}</view>
<view v-if="orderList[index].supplier_goods_amount">{{item.supplier_goods_amount}}</view>
</view>
<view class="line"></view> <!-- 分割线 -->
</view>
</view>
</template>```
```javascript
<script>
export default {
data() {
return {
//
orderList: [],
}
},
methods: {
//
async getOrder() {
const res = await this.$myRequest({
url: '/order/getOrderBySupplierId',
method: 'POST',
data: JSON.stringify({
supplier_id: uni.getStorageSync('supplier_id')
})
})
this.orderList = res.data.data
//
for(let i=0;i<this.orderList.length;i++) {
//
let res2 = await this.$myRequest({
url: '/order/getSingleOrderBySupplierGoodsId',
method: 'POST',
data: JSON.stringify({
supplier_order_id: this.orderList[i].supplier_order_id
})
})
//
let orderDetail = res2.data.data
let order_all_price = 0
let order_all_amount = 0
for(let j=0;j<orderDetail.length;j++) {
order_all_price = order_all_price + orderDetail[j].supplier_goods_price * orderDetail[j].supplier_goods_amount
order_all_amount = order_all_amount + orderDetail[j].supplier_goods_amount
}
this.orderList[i].supplier_goods_price = order_all_price
this.orderList[i].supplier_goods_amount = order_all_amount
}
},
//
navToOrderDetail(supplier_order_id) {
uni.navigateTo({
url: '/pages/order/order-detail?supplier_order_id='+supplier_order_id
})
},
//
onPullDownRefresh() {
setTimeout(()=>{
this.getOrder(()=>{
uni.stopPullDownRefresh()
})
}, 500)
}
},
//
onLoad() {
//
this.getOrder()
}
}
</script>
<style lang="scss">
.order {
.background { //
image {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: -1;
}
}
.order_item {
background-color: white;
.shop { //
display: flex;
padding: 10rpx 30rpx 0 30rpx;
image { //
padding: 5rpx 15rpx 0 0;
width: 60rpx;
height: 60rpx;
}
.shop_name { //
font-size: 45rpx;
line-height: 70rpx;
}
}
.order_info { //
color: #555555;
padding: 0 30rpx 10rpx 30rpx;
font-size: 35rpx;
line-height: 60rpx;
}
.line { // 线
width: 750rpx;
height: 8rpx;
background: #eee;
}
}
}
</style>
Loading…
Cancel
Save