|
@@ -6,40 +6,139 @@
|
|
|
充值订单
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div class="list">
|
|
|
+ <div class="list" :style="{height:cHeigth}">
|
|
|
<el-tabs class="haoyou" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="待支付">
|
|
|
+ <el-tab-pane label="待支付" >
|
|
|
<ul class="list-group list-group-flush" v-if="!cueShow" style="line-heigt:1.5rem">
|
|
|
<li class="list-group-item m-2 mb-0" v-for="(item, idx) in list" :key="idx" >
|
|
|
<div class="section">
|
|
|
<p class="d-flex align-items-center">
|
|
|
<span class="leftColor">订单编号</span>
|
|
|
- <span class="ml-auto rightColor"></span>
|
|
|
+ <span class="ml-auto rightColor">{{item.refill_order_sn}}</span>
|
|
|
</p>
|
|
|
<p class="d-flex align-items-center">
|
|
|
<span class="leftColor">下单时间</span>
|
|
|
- <span class="ml-auto rightColor"></span>
|
|
|
+ <span class="ml-auto rightColor">{{item.order_time}}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class="section">
|
|
|
<p class="d-flex align-items-center">
|
|
|
<span class="leftColor">办理进度</span>
|
|
|
- <span class="ml-auto" style="color:#fb2e2e"></span>
|
|
|
+ <span class="ml-auto" style="color:#fb2e2e">{{item.pay_status_text}}</span>
|
|
|
</p>
|
|
|
<p class="d-flex align-items-center">
|
|
|
<span class="leftColor">实付金额</span>
|
|
|
- <span class="ml-auto leftColor">¥</span>
|
|
|
+ <span class="ml-auto leftColor">¥{{item.order_price}}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class="footer align-items-center" style="justify-content: space-between;">
|
|
|
<button class="btn btn-info" style="background: #4FDCA2;border:1px solid #4FDCA2" @click="open">联系我们</button>
|
|
|
- <button class="btn btn-info" style="background: #fff;color:#666666;border:1px solid rgb(102, 102, 102,.5)" @click="cancel">取消订单</button>
|
|
|
- <a class="btn btn-info" style="background: #fff;color:#666666;border:1px solid rgb(102, 102, 102,.5)">订单详情</a>
|
|
|
- <button style="background: #F78F7E;border:1px solid #F78F7E" class="btn btn-info" @click="gopay">去付款</button>
|
|
|
+ <button class="btn btn-info" style="background: #fff;color:#666666;border:1px solid rgb(102, 102, 102,.5)" :data-id="item.id" :data-key="idx" @click="cancel">取消订单</button>
|
|
|
+ <a class="btn btn-info" style="background: #fff;color:#666666;border:1px solid rgb(102, 102, 102,.5)" :data-key="idx" :data-type="item['order_type']" @click="goDetail">订单详情</a>
|
|
|
+ <button style="background: #F78F7E;border:1px solid #F78F7E" class="btn btn-info" :data-key="idx" :data-type="item['order_type']" @click="gopay">去付款</button>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <div class="cuewords">
|
|
|
+ <div class="cuewords" v-if="cueShow">
|
|
|
+ <p>您暂时还没有订单</p>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="充值中" name="recharging">
|
|
|
+ <ul class="list-group list-group-flush" v-if="!cueShow2" style="line-heigt:1.5rem">
|
|
|
+ <li class="list-group-item m-2 mb-0" v-for="(item, idx) in list" :key="idx" >
|
|
|
+ <div class="section">
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">订单编号</span>
|
|
|
+ <span class="ml-auto rightColor">{{item.refill_order_sn}}</span>
|
|
|
+ </p>
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">下单时间</span>
|
|
|
+ <span class="ml-auto rightColor">{{item.order_time}}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="section">
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">办理进度</span>
|
|
|
+ <span class="ml-auto" style="color:#fb2e2e">{{item.pay_status_text}}</span>
|
|
|
+ </p>
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">实付金额</span>
|
|
|
+ <span class="ml-auto leftColor">¥{{item.order_price}}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="footer align-items-center" style="justify-content: flex-end;">
|
|
|
+ <button class="btn btn-info btnLeft" style="background: #4FDCA2;border:1px solid #4FDCA2" @click="open">联系我们</button>
|
|
|
+ <a class="btn btn-info" style="background: #fff;color:#666666;border:1px solid rgb(102, 102, 102,.5)" :data-key="idx" :data-type="item['order_type']" @click="goDetail">订单详情</a>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <div class="cuewords" v-if="cueShow2">
|
|
|
+ <p>您暂时还没有订单</p>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="充值成功" name="success">
|
|
|
+ <ul class="list-group list-group-flush" v-if="!cueShow3" style="line-heigt:1.5rem">
|
|
|
+ <li class="list-group-item m-2 mb-0" v-for="(item, idx) in list" :key="idx" >
|
|
|
+ <div class="section">
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">订单编号</span>
|
|
|
+ <span class="ml-auto rightColor">{{item.refill_order_sn}}</span>
|
|
|
+ </p>
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">下单时间</span>
|
|
|
+ <span class="ml-auto rightColor">{{item.order_time}}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="section">
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">办理进度</span>
|
|
|
+ <span class="ml-auto" style="color:#fb2e2e">{{item.pay_status_text}}</span>
|
|
|
+ </p>
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">实付金额</span>
|
|
|
+ <span class="ml-auto leftColor">¥{{item.order_price}}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="footer align-items-center" style="justify-content: flex-end;">
|
|
|
+ <button class="btn btn-info btnLeft" style="background: #4FDCA2;border:1px solid #4FDCA2" @click="open">联系我们</button>
|
|
|
+ <a class="btn btn-info" style="background: #fff;color:#666666;border:1px solid rgb(102, 102, 102,.5)" :data-key="idx" :data-type="item['order_type']" @click="goDetail">订单详情</a>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <div class="cuewords" v-if="cueShow3">
|
|
|
+ <p>您暂时还没有订单</p>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="充值失败" name="failed">
|
|
|
+ <ul class="list-group list-group-flush" v-if="!cueShow4" style="line-heigt:1.5rem">
|
|
|
+ <li class="list-group-item m-2 mb-0" v-for="(item, idx) in list" :key="idx" >
|
|
|
+ <div class="section">
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">订单编号</span>
|
|
|
+ <span class="ml-auto rightColor">{{item.refill_order_sn}}</span>
|
|
|
+ </p>
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">下单时间</span>
|
|
|
+ <span class="ml-auto rightColor">{{item.order_time}}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="section">
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">办理进度</span>
|
|
|
+ <span class="ml-auto" style="color:#fb2e2e">{{item.pay_status_text}}</span>
|
|
|
+ </p>
|
|
|
+ <p class="d-flex align-items-center">
|
|
|
+ <span class="leftColor">实付金额</span>
|
|
|
+ <span class="ml-auto leftColor">¥{{item.order_price}}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="footer align-items-center" style="justify-content: flex-end;">
|
|
|
+ <button class="btn btn-info btnLeft" style="background: #4FDCA2;border:1px solid #4FDCA2" @click="open">联系我们</button>
|
|
|
+ <a class="btn btn-info" style="background: #fff;color:#666666;border:1px solid rgb(102, 102, 102,.5)" :data-key="idx" :data-type="item['order_type']" @click="goDetail">订单详情</a>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <div class="cuewords" v-if="cueShow4">
|
|
|
<p>您暂时还没有订单</p>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
@@ -55,20 +154,32 @@
|
|
|
|
|
|
<script>
|
|
|
import Http from "../../extend/Http";
|
|
|
+import {MessageBox, Message} from 'element-ui';
|
|
|
export default {
|
|
|
name: 'rechargeList',
|
|
|
data() {
|
|
|
return {
|
|
|
list: [],
|
|
|
status: 0,
|
|
|
+ activeName: '',
|
|
|
cueShow: false,
|
|
|
cueShow2: false,
|
|
|
cueShow3: false,
|
|
|
+ cueShow4: false,
|
|
|
moreShow: false,
|
|
|
hasMore: true,
|
|
|
page: 1
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ cHeigth() {
|
|
|
+ if (this.list.length > 9) {
|
|
|
+ return 'auto'
|
|
|
+ } else {
|
|
|
+ return '100%'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getRechargeLists()
|
|
|
},
|
|
@@ -80,18 +191,117 @@ export default {
|
|
|
});
|
|
|
console.log('充值订单', res);
|
|
|
if(res.data.length == 0){
|
|
|
- this.cueShow = true
|
|
|
- this.cueShow2 = true
|
|
|
- this.cueShow3 = true
|
|
|
this.moreShow = false
|
|
|
+ this.data.cueShow = true
|
|
|
+ this.data.cueShow2 = true
|
|
|
+ this.data.cueShow3 = true
|
|
|
+ this.data.cueShow4 = true
|
|
|
}else{
|
|
|
this.list = res.data
|
|
|
this.hasMore = res.data.length >9 ;
|
|
|
this.moreShow = true
|
|
|
}
|
|
|
},
|
|
|
- handleClick(tab,event){
|
|
|
+ async handleClick(tab,event){
|
|
|
if(tab.label == '待支付'){
|
|
|
+ this.list = []
|
|
|
+ this.page = 1
|
|
|
+ this.status = 0
|
|
|
+ let res = await Http.getInstance().getRechargeLists({
|
|
|
+ page: this.page,
|
|
|
+ order_state: this.status
|
|
|
+ });
|
|
|
+ this.list = res.data
|
|
|
+ if(res.data.length == 0){
|
|
|
+ this.moreShow = false
|
|
|
+ this.cueShow = true
|
|
|
+ this.cueShow2 = true
|
|
|
+ this.cueShow3 = true
|
|
|
+ this.cueShow4 = true
|
|
|
+ }else{
|
|
|
+ this.list = res.data
|
|
|
+ this.hasMore = res.data.length >9 ;
|
|
|
+ this.moreShow = true
|
|
|
+ this.cueShow = false
|
|
|
+ this.cueShow2 = true
|
|
|
+ this.cueShow3 = true
|
|
|
+ this.cueShow4 = true
|
|
|
+ }
|
|
|
+ } else if (tab.label == '充值中') {
|
|
|
+ this.list = []
|
|
|
+ this.page = 1
|
|
|
+ this.status = 1
|
|
|
+ let res = await Http.getInstance().getRechargeLists({
|
|
|
+ page: this.page,
|
|
|
+ order_state: this.status
|
|
|
+ });
|
|
|
+ // console.log('充值中', res);
|
|
|
+ this.list = res.data
|
|
|
+ if(res.data.length == 0){
|
|
|
+ this.moreShow = false
|
|
|
+ this.cueShow = true
|
|
|
+ this.cueShow2 = true
|
|
|
+ this.cueShow3 = true
|
|
|
+ this.cueShow4 = true
|
|
|
+ }else{
|
|
|
+ this.list = res.data
|
|
|
+ this.hasMore = res.data.length >9 ;
|
|
|
+ this.moreShow = true
|
|
|
+ this.cueShow = true
|
|
|
+ this.cueShow2 = false
|
|
|
+ this.cueShow3 = true
|
|
|
+ this.cueShow4 = true
|
|
|
+ }
|
|
|
+ } else if (tab.label == '充值成功') {
|
|
|
+ this.list = []
|
|
|
+ this.page = 1
|
|
|
+ this.status = 2
|
|
|
+ let res = await Http.getInstance().getRechargeLists({
|
|
|
+ page: this.page,
|
|
|
+ order_state: this.status
|
|
|
+ });
|
|
|
+ // console.log('充值成功', res);
|
|
|
+ this.list = res.data
|
|
|
+ if(res.data.length == 0){
|
|
|
+ this.moreShow = false
|
|
|
+ this.cueShow = true
|
|
|
+ this.cueShow2 = true
|
|
|
+ this.cueShow3 = true
|
|
|
+ this.cueShow4 = true
|
|
|
+ }else{
|
|
|
+ this.list = res.data
|
|
|
+ this.hasMore = res.data.length >9 ;
|
|
|
+ this.moreShow = true
|
|
|
+ this.cueShow = true
|
|
|
+ this.cueShow2 = true
|
|
|
+ this.cueShow3 = false
|
|
|
+ this.cueShow4 = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.list = []
|
|
|
+ this.page = 1
|
|
|
+ this.status = 3
|
|
|
+ let res = await Http.getInstance().getRechargeLists({
|
|
|
+ page: this.page,
|
|
|
+ order_state: this.status
|
|
|
+ });
|
|
|
+ // console.log('充值失败', res);
|
|
|
+ this.list = res.data
|
|
|
+ if(res.data.length == 0){
|
|
|
+ this.moreShow = false
|
|
|
+ this.cueShow = true
|
|
|
+ this.cueShow2 = true
|
|
|
+ this.cueShow3 = true
|
|
|
+ this.cueShow4 = true
|
|
|
+ }else{
|
|
|
+ this.list = res.data
|
|
|
+ this.hasMore = res.data.length >9 ;
|
|
|
+ this.moreShow = true
|
|
|
+ this.cueShow = true
|
|
|
+ this.cueShow2 = true
|
|
|
+ this.cueShow3 = true
|
|
|
+ this.cueShow4 = false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
open() {
|
|
@@ -113,7 +323,43 @@ export default {
|
|
|
this.page++;
|
|
|
},
|
|
|
// 取消订单
|
|
|
- cancel() {},
|
|
|
+ cancel(event) {
|
|
|
+ // console.log('event', event);
|
|
|
+ MessageBox.alert( '你确定要取消订单吗?', '温馨提示', {
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ }).then(async() =>{
|
|
|
+ let data = this.list[event.target.getAttribute("data-key")];
|
|
|
+ // console.log(data)
|
|
|
+ let res = await Http.getInstance().RechargecancelOrder({
|
|
|
+ order_id: data.id
|
|
|
+ });
|
|
|
+ if(res && res.code == 1){
|
|
|
+ Message({
|
|
|
+ message: '订单已取消', duration: 2000, type: "success"
|
|
|
+ });
|
|
|
+ this.getRechargeLists()
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 订单详情
|
|
|
+ goDetail(event) {
|
|
|
+ let data = this.list[event.target.getAttribute("data-key")];
|
|
|
+ console.log('data', data);
|
|
|
+ this.$router.push({
|
|
|
+ name: "rdetail", params: {
|
|
|
+ id: data["id"],
|
|
|
+ card_no: data['card_no'],
|
|
|
+ pay_status_text: data["pay_status_text"],
|
|
|
+ pay_status_text: data["pay_status_text"],
|
|
|
+ order_time: data["order_time"],
|
|
|
+ refill_order_sn: data["refill_order_sn"],
|
|
|
+ order_price: data['order_price']
|
|
|
+ }
|
|
|
+ });
|
|
|
+ localStorage.setItem('rechageId', JSON.stringify(data["id"]))
|
|
|
+ },
|
|
|
// 付款
|
|
|
gopay() {}
|
|
|
}
|
|
@@ -144,7 +390,7 @@ export default {
|
|
|
}
|
|
|
.list {
|
|
|
width: 100%;
|
|
|
- height: 100%;
|
|
|
+ // height: auto;
|
|
|
position: absolute;
|
|
|
background-color: #EDF0F5;
|
|
|
}
|
|
@@ -267,4 +513,11 @@ export default {
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
+.btn-light:hover {
|
|
|
+ background-color: #f8f9fa;
|
|
|
+ border-color: #f8f9fa;
|
|
|
+}
|
|
|
+.more {
|
|
|
+ height: 47px;
|
|
|
+}
|
|
|
</style>
|