mobileclient/v1_5_0_C/myOrder.html

126 lines
4.8 KiB
HTML

<!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>
<script type="text/javascript" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322">
</script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api1_4_0.js"></script>
<link rel="stylesheet" href="./myOrder.css" />
<link rel="stylesheet" href="./tabbar.css">
<link rel="stylesheet" href="./payPop.css">
<script src="./tabbar.js"></script>
<script src="./payPop.js"></script>
</head>
<body>
<div id="app">
<img class="backPresTy" @click="backHandler"
src=" https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
<div class="content">
<div class="content-item" v-for="item in orderList" :key="item.order_number">
<div class="top">
<p class="time">{{item.create_time}}</p>
<p class="status" :style="{color:statusColor(item.status).color}">{{statusColor(item.status).text}}
</p>
</div>
<div class="middle">
<img :src="item.show_url" alt="" v-if="item.type===1">
<img :src="item.show_url" alt="" v-else>
<div class="right">
<div class="title_originalPrice">
<p class="title">{{item.product_name}}</p>
<p class="originalPrice">¥{{item.official_price}}</p>
</div>
<p class="id">订单编号:{{item.order_number}}</p>
</div>
</div>
<div class="bottom">
<p class="money">实付金额:¥<span>{{item.pay_amount}}</span></p>
<p class="button" @click="show=true" v-show="item.status===6">立即支付</p>
<p class="button" @click="goExchange(item)" v-show="item.status===0">去兑换</p>
</div>
</div>
</div>
<tab-component :current="2"></tab-component>
<!-- 支付弹窗 -->
<pay-pop :show.sync="show" :active="active" @payFunction="payFunction" />
</div>
<script>
new Vue({
el: "#app",
data () {
return {
active: 1, /* 选择支付方式 */
show: false, /* 支付弹窗状态 */
limit: 50,
page: 1,
orderList: []
}
},
components: {
tabComponent,
payPop
},
created () {
const key = sessionStorage.getItem('key')
req.axiosGet(`/key/order/${key}`, { page: this.page, limit: this.limit }).then(({ data, code }) => {
if (code === 200) this.orderList = data
})
},
methods: {
/* 根据不同状态展示 订单样式和表现 */
statusColor (status) {
let colorValue = {}
switch (status) {
case 3:
colorValue.color = '#FD553D'
colorValue.text = '充值失败(已退款)'
break;
case 2:
colorValue.color = '#44D27D'
colorValue.text = '充值成功'
break;
case 6:
colorValue.color = '#F28542'
colorValue.text = '待支付'
break;
case 3:
colorValue.color = '#4193EE'
colorValue.text = '已支付'
break;
}
return colorValue
},
/* 返回 */
backHandler () {
window.location.replace('./couponCollection.html');
},
/* 去支付 */
payFunction ({ type, isSupport }) {
this.active = type
this.show = false
alert(isSupport ? '不持支' : '支持')
},
/* 去兑换 */
goExchange (item) {
console.log(item);
}
}
})
</script>
</body>
</html>