|
@@ -0,0 +1,106 @@
|
|
|
+<template>
|
|
|
+ <div class="uc_orders_container">
|
|
|
+ <div v-if="orders && orders.length > 0" id="order_list_container">
|
|
|
+ <van-card v-for="(order,index) in orders" :key="index">
|
|
|
+ <!-- 抬头部分-->
|
|
|
+ <div slot="title" class="flex justify-between">
|
|
|
+ <div>
|
|
|
+ <text class="text-gray">订单号 </text>
|
|
|
+ <text class>{{ order.sn }}</text>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <text class="text-gray">{{ order.create_time }}</text>
|
|
|
+ <view class="text-right">
|
|
|
+ <text>交易成功</text>
|
|
|
+ </view>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 图标部分-->
|
|
|
+ <div slot="thumb"
|
|
|
+ class="thumb_container"
|
|
|
+ >
|
|
|
+ <img src="https://img.shuimuai.com/web/icon_dingdan.png" class="order_icon" alt="">
|
|
|
+ </div>
|
|
|
+ <!-- 消费产品-->
|
|
|
+ <div slot="desc">
|
|
|
+ <div>
|
|
|
+ <text class="text-gray">消费产品 </text>
|
|
|
+ <text>{{ order.goods_name }} x 1</text>
|
|
|
+ </div>
|
|
|
+ <div class="padding-tb-lg flex justify-between align-center">
|
|
|
+ <div>
|
|
|
+ <text class="text-gray">付款方式 </text>
|
|
|
+ <text class="text-bold">微信支付</text>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <text class="text-gray">实付款 </text>
|
|
|
+ <text class="text-gray text-xxl">{{ order.price }}</text>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 联系客服的按钮-->
|
|
|
+ <div slot="price">
|
|
|
+ <!-- <van-button type="default" open-type="contact">联系客服</van-button>-->
|
|
|
+ <button class="cu-btn" open-type="contact">联系客服</button>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </van-card>
|
|
|
+ </div>
|
|
|
+ <van-empty description="暂无数据" v-else />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {orderList} from "@/requests/orders";
|
|
|
+import {formatTime} from "@/utils/index";
|
|
|
+
|
|
|
+let $this;
|
|
|
+export default {
|
|
|
+ name: "uc_orders_container",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ orders: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //获取订单列表
|
|
|
+ get_order_list() {
|
|
|
+ orderList().then((res) => {
|
|
|
+ let $data = res.data
|
|
|
+ $this.orders = $data.data
|
|
|
+ $this.orders.forEach(($val, $index) => {
|
|
|
+ $this.orders[$index]['create_time'] = formatTime($val['create_time'] * 1000)
|
|
|
+ })
|
|
|
+ console.log($this.orders)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ,
|
|
|
+ mounted() {
|
|
|
+ this.get_order_list()
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ $this = this;
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.van-card__thumb {
|
|
|
+ width: 50px !important;
|
|
|
+}
|
|
|
+
|
|
|
+.order_icon {
|
|
|
+ width: 37px;
|
|
|
+ height: 37px;
|
|
|
+}
|
|
|
+
|
|
|
+.thumb_container {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|