oil-station/gasStation-uni/pagesHome/myPointsOrder/myPointsOrder.vue

302 lines
5.5 KiB
Vue
Raw Normal View History

2023-11-27 09:24:16 +08:00
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">我的订单</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="tap-box">
<view class="box-tap" :class="{ 'act' :actinput == index }" v-for="(item,index) in taplist" :key="index"
@click="getindex(index)">
<view class="">{{item.title }}</view>
<view class="gang" v-if="actinput == index"></view>
</view>
</view>
2023-12-07 10:22:52 +08:00
<view class="goods-box" v-for="(item,index) in orderList">
2023-12-05 14:30:22 +08:00
<view class="goods-top">
<view class="goods-img">
2023-12-07 10:22:52 +08:00
<image :src="baseUrl+item.coverImage" mode=""></image>
2023-12-05 14:30:22 +08:00
</view>
<view class="nr-tip">
2023-12-07 10:22:52 +08:00
<view class="title-s">{{item.giftName}}</view>
<view class="hui-s">{{item.createTime}}</view>
2023-12-05 14:30:22 +08:00
<view class="right-size">
2023-12-07 10:22:52 +08:00
<view class="jg">{{item.amount?"¥"+item.amount:''}}
{{item.amount && item.integral ? '+':''}}
{{item.integral?item.integral+'积分':''}}
</view>
<view class="">X{{item.exchangeQuantity}}</view>
2023-12-05 14:30:22 +08:00
</view>
</view>
</view>
<view class="goods-bottom" v-if="actinput == 1 ">
2023-12-09 15:23:37 +08:00
<view class="sh-anniu" @click="confirmTheReceipt(item.id)">
2023-12-05 14:30:22 +08:00
<text>确认收货</text>
</view>
</view>
<view class="goods-bottom" v-if="actinput == 2 ">
2023-12-09 15:23:37 +08:00
<view class="sh-anniu" @click="refund()">
2023-12-05 14:30:22 +08:00
<text>点击退款</text>
</view>
</view>
<view class="goods-bottom" v-if="actinput == 3 ">
2023-12-09 15:23:37 +08:00
<view class="sh-anniu" @click="payment()">
2023-12-05 14:30:22 +08:00
<text>去付款</text>
</view>
</view>
</view>
2023-11-27 09:24:16 +08:00
<u-empty v-if="arrList.length == 0" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
</view>
</template>
<script>
2023-12-07 10:22:52 +08:00
import config from '@/config'
import request from '../../utils/request'
2023-11-27 09:24:16 +08:00
export default {
data() {
return {
title: '',
2023-12-07 10:22:52 +08:00
orderList: [],
baseUrl: config.baseUrl,
query: {
orderStatus: '',
chainStoreId: uni.getStorageSync('chainStoreId'),
storeId: uni.getStorageSync('storeId')
},
2023-11-27 09:24:16 +08:00
taplist: [{
title: '全部'
},
{
title: '待收货'
},
{
title: '已完成'
},
{
2023-12-07 10:22:52 +08:00
title: '已退款'
2023-11-27 09:24:16 +08:00
},
{
2023-12-07 10:22:52 +08:00
title: '待支付'
2023-11-27 09:24:16 +08:00
},
2023-12-05 14:30:22 +08:00
2023-12-07 10:22:52 +08:00
2023-11-27 09:24:16 +08:00
],
2023-12-05 14:30:22 +08:00
arrList: ["1"],
2023-11-27 09:24:16 +08:00
actinput: 0,
}
},
components: {
2023-12-07 10:22:52 +08:00
},
onShow() {
this.getIntegralOrderList()
2023-11-27 09:24:16 +08:00
},
methods: {
getindex(index) {
this.actinput = index
2023-12-07 10:22:52 +08:00
if (index != 0) {
this.query.orderStatus = index
2023-12-09 15:23:37 +08:00
// if (index == 1) {
// this.query.orderStatus = '已发货'
// }else {
// this.query.orderStatus = this.taplist[index].title
// }
2023-12-07 10:22:52 +08:00
} else {
this.query.orderStatus = ''
}
this.getIntegralOrderList()
2023-11-27 09:24:16 +08:00
},
2023-12-05 14:30:22 +08:00
2023-11-27 09:24:16 +08:00
goback() {
uni.navigateBack()
2023-12-07 10:22:52 +08:00
},
// 查询我的积分明细
getIntegralOrderList() {
request({
url: 'business/integral/integralOrders/queryByPageUni',
method: 'get',
params: this.query
}).then((res) => {
if (res.code == 200) {
this.orderList = res.data.records
}
})
},
2023-12-09 15:23:37 +08:00
confirmTheReceipt(data) {
let params = {
id: data,
orderStatus: '已完成'
}
request({
url: 'business/integral/integralOrders/editUni',
method: 'put',
data: params
}).then((res) => {
if (res.code == 200) {
this.orderList = res.data.records
this.getIntegralOrderList()
}
})
},
refund(data) {
},
payment(data) {
},
2023-11-27 09:24:16 +08:00
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
2023-12-07 10:22:52 +08:00
height: 100%;
2023-11-27 09:24:16 +08:00
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.tap-box {
width: 100%;
height: 50px;
display: flex;
align-items: center;
background-color: #ffffff;
}
.box-tap {
width: 20%;
text-align: center;
}
.act {
color: #2979ff;
font-weight: bold;
}
.gang {
width: 25px;
height: 5px;
background-color: #2979ff;
border-radius: 8px;
margin: 2px auto;
}
2023-12-05 14:30:22 +08:00
.goods-box {
width: 95%;
border-radius: 8px;
margin: 10px auto;
background: #ffffff;
box-sizing: border-box;
padding: 10px;
}
.goods-top {
display: flex;
justify-content: space-between;
}
.goods-img {
width: 175rpx;
height: 175rpx;
border-radius: 8px;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.nr-tip {
width: 70%;
}
.title-s {
font-size: 18px;
font-weight: bold;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.hui-s {
font-size: 14px;
color: #999999;
margin: 5px auto;
}
.right-size {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: bold;
color: #333;
}
.jg {
font-weight: bold;
color: #FF1800 !important;
}
.goods-bottom {
box-sizing: border-box;
padding: 5px 0px;
border-top: 1px solid #F4F4F4;
display: flex;
align-items: center;
justify-content: flex-end;
margin-top: 15px;
}
.sh-anniu {
box-sizing: border-box;
padding: 5px 10px;
border-radius: 50px;
border: 1px solid #2979ff;
color: #2979ff;
}
2023-11-27 09:24:16 +08:00
</style>