You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
huazhiyu/pages/OrderDetails/OrderDetails.vue

125 lines
3.4 KiB

1 year ago
<template>
<view class="page">
<!-- 订单状态 -->
<view class="order-status">
<view class="status">
<text class="iconfont icon-zhuyi"></text>
1 year ago
<text>{{orderDetails.status==0?'待支付':orderDetails.status==1?'待确认':orderDetails.status==2?'待委托':orderDetails.status==3?'已投诉':orderDetails.status==4?'待发货':orderDetails.status==5?'待收货':orderDetails.status==-1?'已取消':''}}</text>
1 year ago
</view>
1 year ago
1 year ago
</view>
1 year ago
1 year ago
<!-- 订单商品 -->
<view class="order-goods">
<view class="goods-list">
1 year ago
<view class="list" v-for="(item,index) in orderInfo" :key="index">
1 year ago
<view class="thumb">
1 year ago
<image :src="item.goods_image" mode=""></image>
1 year ago
</view>
<view class="item">
<view class="title">
1 year ago
<text class="one-omit">{{item.goods_name}}</text>
1 year ago
</view>
<view class="num-size">
1 year ago
<text>数量{{item.num}}</text>
1 year ago
</view>
<view class="price">
1 year ago
<text>{{item.goods_price}}</text>
1 year ago
</view>
1 year ago
1 year ago
</view>
</view>
</view>
1 year ago
1 year ago
</view>
<!-- 订单信息 -->
<view class="order-info">
<view class="info-list">
<view class="list">
<view class="title">订单编号:</view>
<view class="content">
1 year ago
<text>{{orderDetails.order_sn}}</text>
1 year ago
</view>
</view>
<view class="list">
<view class="title">下单时间:</view>
<view class="content">
1 year ago
<text>{{getTime(orderDetails.createtime)}}</text>
1 year ago
</view>
</view>
1 year ago
1 year ago
</view>
</view>
<!-- 订单明细 -->
<view class="order-details">
<view class="details-list">
<view class="list">
<view class="title">
<text>商品总额</text>
</view>
<view class="price">
1 year ago
<text>{{orderDetails.order_amount}}</text>
1 year ago
</view>
</view>
1 year ago
1 year ago
</view>
</view>
1 year ago
<view class="btnContainer">
<view class="btnItem" @click="gopay">
去支付
</view>
</view>
1 year ago
</view>
</template>
<script>
1 year ago
import {orderDetail} from '@/common/api.js'
1 year ago
export default {
data() {
return {
1 year ago
orderInfo:[],
warehouse:[],
orderDetails:{}
1 year ago
};
},
methods:{
1 year ago
gopay(){
uni.navigateTo({
url:"/pages/warehouse/pay?num="+this.orderDetails.order_amount+'&id='+this.orderDetails.id
})
},
1 year ago
getOrderDetails(){
orderDetail({id:this.id,custom: { auth: true }}).then(res=>{
1 year ago
1 year ago
this.orderDetails = Object.assign({},this.orderDetails,res.data);
this.orderInfo = res.data.order_goods
this.warehouse = res.data.warehouse
1 year ago
})
1 year ago
},
getTime(time){
// 时间戳
let timestamp = time
// 此处时间戳以毫秒为单位
let date = new Date(parseInt(timestamp) * 1000);
let Year = date.getFullYear();
let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
let Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
let Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
let Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
let GMT = Year + '-' + Moth + '-' + Day + ' '+ Hour +':'+ Minute + ':' + Sechond;
return GMT
// console.log(GMT) // 2022-09-07 15:56:07
1 year ago
}
1 year ago
},
onLoad(option) {
this.id = option.id;
this.getOrderDetails()
1 year ago
}
}
</script>
<style scoped lang="scss">
@import 'OrderDetails.scss';
</style>