2022-09-21 17:30:39 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<meta name="viewport"
|
|
|
|
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover" />
|
|
|
|
<title>我的订单</title>
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=1367936144322" type="text/javascript"
|
|
|
|
charset="utf-8"></script>
|
2022-09-27 16:46:22 +08:00
|
|
|
<script type="text/javascript" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322">
|
|
|
|
</script>
|
2022-09-29 14:09:48 +08:00
|
|
|
<!-- <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api1_4_0.js"></script> -->
|
|
|
|
<script src="./api1_4_0.js"></script>
|
2022-09-21 17:30:39 +08:00
|
|
|
<link rel="stylesheet" href="./myOrder.css" />
|
2022-09-21 18:35:54 +08:00
|
|
|
<link rel="stylesheet" href="./tabbar.css">
|
2022-09-22 11:40:16 +08:00
|
|
|
<link rel="stylesheet" href="./payPop.css">
|
2022-09-27 16:46:22 +08:00
|
|
|
<script src="./tabbar.js"></script>
|
|
|
|
<script src="./payPop.js"></script>
|
2022-09-21 17:30:39 +08:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div id="app">
|
|
|
|
<img class="backPresTy" @click="backHandler"
|
|
|
|
src=" https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
|
2022-09-22 11:40:16 +08:00
|
|
|
<div class="content">
|
2022-09-27 16:46:22 +08:00
|
|
|
<div class="content-item" v-for="item in orderList" :key="item.order_number">
|
2022-09-22 11:40:16 +08:00
|
|
|
<div class="top">
|
2022-09-28 16:35:26 +08:00
|
|
|
<p class="time">{{item.update_time}}</p>
|
2022-09-22 11:40:16 +08:00
|
|
|
<p class="status" :style="{color:statusColor(item.status).color}">{{statusColor(item.status).text}}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="middle">
|
2022-09-27 16:46:22 +08:00
|
|
|
<img :src="item.show_url" alt="" v-if="item.type===1">
|
2022-09-29 14:09:48 +08:00
|
|
|
<img :src="`http://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/${item.pay_type===1?'zfbreduce':'wxreduce'}.png`"
|
|
|
|
alt="" v-else>
|
2022-09-22 11:40:16 +08:00
|
|
|
<div class="right">
|
|
|
|
<div class="title_originalPrice">
|
2022-09-27 16:46:22 +08:00
|
|
|
<p class="title">{{item.product_name}}</p>
|
|
|
|
<p class="originalPrice">¥{{item.official_price}}</p>
|
2022-09-22 11:40:16 +08:00
|
|
|
</div>
|
2022-09-27 16:46:22 +08:00
|
|
|
<p class="id">订单编号:{{item.order_number}}</p>
|
2022-09-21 17:30:39 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-22 11:40:16 +08:00
|
|
|
<div class="bottom">
|
2022-09-27 16:46:22 +08:00
|
|
|
<p class="money">实付金额:¥<span>{{item.pay_amount}}</span></p>
|
2022-09-29 14:09:48 +08:00
|
|
|
<p class="button" @click="immediatelyPay(item)" v-show="item.status===6">立即支付</p>
|
2022-09-28 17:32:26 +08:00
|
|
|
<p class="button" @click="goExchange(item)" v-show="item.status===4">去兑换</p>
|
2022-09-22 11:40:16 +08:00
|
|
|
</div>
|
2022-09-21 17:30:39 +08:00
|
|
|
</div>
|
2022-09-28 14:28:03 +08:00
|
|
|
<!-- 空状态 -->
|
|
|
|
<div class="empty" v-if="!orderList.length">
|
2022-09-28 15:16:51 +08:00
|
|
|
<img src="./img/order-empty.png" alt="">
|
2022-09-28 14:28:03 +08:00
|
|
|
<p>暂无订单</p>
|
|
|
|
</div>
|
2022-09-21 17:30:39 +08:00
|
|
|
</div>
|
2022-09-21 18:35:54 +08:00
|
|
|
<tab-component :current="2"></tab-component>
|
2022-09-22 11:40:16 +08:00
|
|
|
|
|
|
|
<!-- 支付弹窗 -->
|
2022-09-29 14:09:48 +08:00
|
|
|
<pay-pop :show.sync="show" :active="active" @payFunction="payFunction" :money="activeOrder.pay_amount" />
|
2022-09-21 17:30:39 +08:00
|
|
|
</div>
|
2022-09-29 14:09:48 +08:00
|
|
|
|
2022-09-21 17:30:39 +08:00
|
|
|
<script>
|
|
|
|
new Vue({
|
|
|
|
el: "#app",
|
|
|
|
data () {
|
|
|
|
return {
|
2022-09-22 14:08:22 +08:00
|
|
|
active: 1, /* 选择支付方式 */
|
|
|
|
show: false, /* 支付弹窗状态 */
|
2022-09-27 16:46:22 +08:00
|
|
|
limit: 50,
|
|
|
|
page: 1,
|
2022-09-29 14:09:48 +08:00
|
|
|
orderList: [],
|
|
|
|
activeOrder: {}
|
2022-09-21 17:30:39 +08:00
|
|
|
}
|
|
|
|
},
|
2022-09-21 18:35:54 +08:00
|
|
|
|
|
|
|
components: {
|
2022-09-22 11:40:16 +08:00
|
|
|
tabComponent,
|
|
|
|
payPop
|
2022-09-21 18:35:54 +08:00
|
|
|
},
|
|
|
|
|
2022-09-27 16:46:22 +08:00
|
|
|
created () {
|
2022-09-28 15:11:12 +08:00
|
|
|
this.getOrderList()
|
2022-09-27 16:46:22 +08:00
|
|
|
},
|
|
|
|
|
2022-09-21 17:30:39 +08:00
|
|
|
methods: {
|
2022-09-22 14:08:22 +08:00
|
|
|
/* 根据不同状态展示 订单样式和表现 */
|
2022-09-21 17:30:39 +08:00
|
|
|
statusColor (status) {
|
2022-09-22 11:40:16 +08:00
|
|
|
let colorValue = {}
|
2022-09-21 17:30:39 +08:00
|
|
|
switch (status) {
|
2022-09-28 17:32:26 +08:00
|
|
|
/* 兑换码状态 */
|
2022-09-27 16:46:22 +08:00
|
|
|
case 3:
|
2022-09-21 17:30:39 +08:00
|
|
|
colorValue.color = '#FD553D'
|
|
|
|
colorValue.text = '充值失败(已退款)'
|
|
|
|
break;
|
2022-09-27 16:46:22 +08:00
|
|
|
case 2:
|
2022-09-21 17:30:39 +08:00
|
|
|
colorValue.color = '#44D27D'
|
|
|
|
colorValue.text = '充值成功'
|
|
|
|
break;
|
2022-09-27 16:46:22 +08:00
|
|
|
case 6:
|
2022-09-21 17:30:39 +08:00
|
|
|
colorValue.color = '#F28542'
|
|
|
|
colorValue.text = '待支付'
|
|
|
|
break;
|
2022-09-28 17:32:26 +08:00
|
|
|
|
|
|
|
/* 立减金状态 */
|
2022-09-28 16:35:26 +08:00
|
|
|
case 4:
|
2022-09-21 17:30:39 +08:00
|
|
|
colorValue.color = '#4193EE'
|
|
|
|
colorValue.text = '已支付'
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return colorValue
|
|
|
|
},
|
|
|
|
|
2022-09-22 14:08:22 +08:00
|
|
|
/* 返回 */
|
2022-09-21 17:30:39 +08:00
|
|
|
backHandler () {
|
|
|
|
window.location.replace('./couponCollection.html');
|
2022-09-22 11:40:16 +08:00
|
|
|
},
|
|
|
|
|
2022-09-29 14:09:48 +08:00
|
|
|
/* 立即支付 */
|
|
|
|
immediatelyPay (item) {
|
|
|
|
this.activeOrder = item;
|
|
|
|
this.show = true
|
|
|
|
},
|
|
|
|
|
2022-09-22 14:08:22 +08:00
|
|
|
/* 去支付 */
|
2022-09-28 11:32:32 +08:00
|
|
|
payFunction ({ payType, isSupport }) {
|
|
|
|
this.active = payType
|
2022-09-22 11:40:16 +08:00
|
|
|
this.show = false
|
2022-09-29 09:59:46 +08:00
|
|
|
/* 判断浏览器 */
|
2022-09-29 14:09:48 +08:00
|
|
|
if (isSupport) {
|
2022-09-29 09:59:46 +08:00
|
|
|
this.popTitle = '温馨提示'
|
|
|
|
this.popText = '请在其他浏览器打开该链接'
|
|
|
|
this.popStatus = 2
|
|
|
|
this.popShow = true
|
|
|
|
return
|
|
|
|
}
|
2022-09-29 14:09:48 +08:00
|
|
|
/* 请求支付 */
|
|
|
|
req.axiosPut(`/key/order/setPayType/${this.activeOrder.order_number}/${payType}`).then(({ data, code }) => {
|
|
|
|
if (code === 200) {
|
|
|
|
console.log(data);
|
|
|
|
}
|
|
|
|
})
|
2022-09-22 14:08:22 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
/* 去兑换 */
|
|
|
|
goExchange (item) {
|
2022-09-28 15:05:37 +08:00
|
|
|
window.location.replace('./couponCollection.html');
|
|
|
|
},
|
|
|
|
|
|
|
|
/* 请求订单数据 */
|
2022-09-28 15:11:12 +08:00
|
|
|
getOrderList () {
|
2022-09-28 15:05:37 +08:00
|
|
|
const key = sessionStorage.getItem('key')
|
|
|
|
req.axiosGet(`/key/order/${key}`, { page: this.page, limit: this.limit }).then(({ data, code }) => {
|
2022-09-28 16:35:26 +08:00
|
|
|
if (code === 200) {
|
2022-09-28 17:32:26 +08:00
|
|
|
data.map(item => {
|
|
|
|
if (item.type === 2 && item.status === 2) item.status = 4
|
|
|
|
if (item.type === 2 && item.status === 1) item.status = 6
|
|
|
|
})
|
|
|
|
this.orderList = data
|
2022-09-28 16:35:26 +08:00
|
|
|
}
|
2022-09-28 15:05:37 +08:00
|
|
|
})
|
2022-09-28 16:35:26 +08:00
|
|
|
},
|
2022-09-21 17:30:39 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|