yurong/.svn/pristine/2c/2c1dfc247bd9694a3a44523be2f...

105 lines
3.6 KiB
Plaintext

<template>
<scroll-view class="br-10" :scroll-y="true" :style="{'height': scrollHeight+'px'}">
<view v-for="(item,index) in goods" :key="index" @tap="orderTap(item.id,item.status)" class="w100 br-20 bgff mb-20 pl-20 pr-20" style="padding-bottom: 0;">
<view class="h-80 rowsb rowsm fs-28" style="border-bottom: 2rpx solid #f1f1f1;">
<view class="f-8 pr-20 one_overflow">{{ item.business.busname }}</view>
<text class="f-2 trt col999" >{{ status[item.status] }}</text>
</view>
<view class="w-670 mt-32 relative" style="overflow: hidden;">
<view class="rows">
<view class="mr-20" v-for="(goods,ind) in item.goods" :key="ind">
<image class="w-166 h-130 br-12" mode="aspectFill" :src="URL + goods.image"></image>
<view class="fs-24 col666 one_overflow">{{ goods.name }}</view>
</view>
</view>
<view v-if="item.goods.length >= 5" class="absolute h100 pt-20 w-40 fs-22 col666 zi-2 tct pl-10 pr-10" style="right: 0;top: 0; background: rgba(255, 255, 255, 0.8); ;">
<text>共{{ item.goods.length }}件</text>
</view>
<view class="pt-20 pb-26 rowsb">
<text class="fs-26 col999">订单时间:{{ item.createtime }}</text>
<text class="fs-24 col888">合计<text class="fs-32 fw-600 col000">¥{{ item.price }}</text></text>
</view>
</view>
<view class="rowsb h-108 rowsm">
<view></view>
<view class="fs-26 tct">
<!-- 待付款 -->
<view v-if="item.status == '1'" class="rowse">
<view @tap.stop="cancelOrder(item.id,index)" class="br-8 ml-20 w-166 h-64 lh-64" style="border: 1rpx solid #D5D5D5; color: #666;">取消订单</view>
<view @tap.stop="orderTap(item.id)" class="br-4 colfff ml-20 w-166 h-64 lh-64" style="background: #91B584;">去付款</view>
</view>
<!-- 待发货 -->
<view v-if="item.status == '2'" class="rowse">
<view @tap.stop="showtt('已催促,商家正在加急出餐~')" class="br-4 colfff ml-20 w-166 h-64 lh-64" style="background: #91B584;">催发货</view>
</view>
<!-- 待收货 -->
<view v-if="item.status == '3'" class="rowse">
<view @tap.stop="commitGoods(item.id)" class="br-4 colfff ml-20 w-166 h-64 lh-64" style="background: #91B584;">确认收货</view>
</view>
<!-- 已完成 -->
<view v-if="item.status == '4'" class="rowse">
<view @tap.stop="orderTap(item.id)" class="br-4 colfff ml-20 w-166 h-64 lh-64" style="background: #91B584;">查看详情</view>
</view>
</view>
</view>
</view>
</scroll-view>
</template>
<script>
const app = getApp().globalData
export default {
name:"orderGoods",
data() {
return {
status: {
1: '待付款',
2: '待配送',
3: '配送中',
4: '已完成'
}
};
},
methods: {
orderTap(id) {//订单点击,前往详情页
this.$tools.goNext(`orderDet?id=${id}`)
},
cancelOrder(id,index) {//取消订单
this.$tools.axiosFromToken('POST','order/del_order_goods',{
token: app.token,
id: id,
}).then(res => {
if (res.code == 1) {
this.$emit('getOrder')
}
})
},
commitGoods(id) {//确认收货
this.axiosFromToken('POST','order/determine',{
id
}).then(res => {
if (res.code == 1) {
this.$tools.showtt('成功确认收货')
this.$emit('getOrder')
} else this.$tools.showtt(res.msg)
})
}
},
props: {
goods: {
type:Array,
},
scrollHeight: {
type: Number
}
}
}
</script>
<style>
.col_22cfa2 {
color: #22cfa2;
}
</style>