oil-station/gasStation-uni/pagesHome/PointsRedemption/index.vue

232 lines
4.6 KiB
Vue
Raw Normal View History

2024-09-18 17:24:51 +08:00
<template>
<view class="centenr">
<view class="Candywrapper">
<view class="top-box" @click="goIntegral">
2024-09-19 11:18:34 +08:00
2024-09-18 17:24:51 +08:00
<view class="">积分余额</view>
2024-09-21 15:55:14 +08:00
<view class="d-s">{{cardBalance.points || 0}}<u-icon name="arrow-right"></u-icon> </view>
2024-09-18 17:24:51 +08:00
</view>
2024-09-25 15:31:59 +08:00
<view class="f-box" v-for="(item,index) in integralGiftList" :key="index" @click="goDetails(item)">
<view class="f-top">{{item.storeName}}可用</view>
2024-09-18 17:24:51 +08:00
<view class="f-bs">
2024-09-25 15:31:59 +08:00
<image v-if="item.coverImage" :src="baseUrl+item.coverImage" mode="aspectFit" style="width: 60px; height: 60px; "></image>
<image v-else src="../../static/logo.png" style="width: 60px; height: 60px; "></image>
2024-09-18 17:24:51 +08:00
<view class="r-box">
<view class="">
2024-09-25 15:31:59 +08:00
<view class="m_">{{item.giftName}}</view>
2024-09-18 17:24:51 +08:00
<view class="p_">300ml瓶装</view>
<view class="q_">兑换券</view>
</view>
<view class="">
<view class="an_">100积分</view>
<u-line-progress :percentage="50" :showText="false" height="6"
2024-09-20 17:38:29 +08:00
activeColor="#FA6400"></u-line-progress>
2024-09-18 17:24:51 +08:00
<view class="hui_">券已领70%</view>
</view>
</view>
</view>
</view>
2024-09-25 15:31:59 +08:00
<u-empty v-if="integralGiftList.length == 0" style="margin: 5px auto;" mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
2024-09-18 17:24:51 +08:00
</view>
</view>
</template>
<script>
2024-09-25 15:31:59 +08:00
import config from '@/config'
2024-09-21 15:55:14 +08:00
import request from '../../utils/request'
2024-09-18 17:24:51 +08:00
export default {
data() {
return {
2024-09-25 15:31:59 +08:00
baseUrl: config.baseUrl,
2024-09-21 15:55:14 +08:00
query: {
chainStoreId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
pageSize: 10
},
cardBalance: {},
2024-09-25 15:31:59 +08:00
queryParam: {
storeId: uni.getStorageSync('storeId'),
status: '启用',
categoryId: '',
giftName: '',
deliveryMethod: '',
page: 1,
pageSize: 30
},
integralGiftList:[],
total:0
}
},
onPullDownRefresh() {
//下拉刷新
this.queryParam = {
storeId: uni.getStorageSync('storeId'),
status: '启用',
categoryId: '',
giftName: '',
deliveryMethod: '',
page: 1,
pageSize: 30
}
this.getIntegralGiftList()
uni.stopPullDownRefresh()
},
onReachBottom() {
// 触底加载
if (this.queryParam.page >= this.total) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.queryParam.page++
this.getIntegralGiftList()
2024-09-18 17:24:51 +08:00
}
},
2024-09-21 15:55:14 +08:00
onShow() {
this.query.chainStoreId = uni.getStorageSync('chainStoreId');
this.getUserBalance()
2024-09-25 15:31:59 +08:00
this.getIntegralGiftList()
2024-09-21 15:55:14 +08:00
},
2024-09-18 17:24:51 +08:00
methods: {
2024-09-25 15:31:59 +08:00
// 获取积分商城列表
getIntegralGiftList() {
request({
url: 'business/integral/integralGift/queryByPageByStoreId',
method: 'get',
params: this.queryParam
}).then((res) => {
if (res.code == 200) {
this.integralGiftList = res.data.records
this.total = res.data.total
console.log(res,100);
}
})
},
2024-09-21 15:55:14 +08:00
// 获取余额信息
getUserBalance() {
request({
url: '/business/userManager/user/getUserBalanceApplet',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.cardBalance = res.data
}
})
},
2024-09-18 17:24:51 +08:00
goIntegral() {
uni.navigateTo({
url: '/pagesMy/integral/integral'
})
},
2024-09-25 15:31:59 +08:00
goDetails(data) {
2024-09-18 17:24:51 +08:00
uni.navigateTo({
url: '/pagesHome/PointsRedemption/details'
})
}
}
}
</script>
<style scoped lang="scss">
.centenr {
width: 100%;
height: 100vh;
background: #F9F9F9;
}
.Candywrapper {
background: #F9F9F9;
box-sizing: border-box;
padding: 10px;
}
.top-box {
width: 100%;
box-sizing: border-box;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
}
.d-s {
display: flex;
align-items: center;
}
.f-box {
width: 100%;
box-sizing: border-box;
padding: 10px;
background: #fff;
margin: 10px auto;
border-radius: 4px;
}
.f-top {
box-sizing: border-box;
padding: 5px 0px;
border-bottom: 1px dashed #eee;
margin-bottom: 15px;
}
.f-bs {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.r-box {
width: 80%;
display: flex;
align-items: center;
justify-content: space-between;
}
.m_ {
font-size: 16px;
color: #333333;
font-weight: bold;
margin-bottom: 5px;
}
.p_ {
font-size: 12px;
color: #666666;
}
.q_ {
font-size: 12px;
color: #E02020;
}
.an_ {
width: 80px;
height: 25px;
2024-09-20 17:38:29 +08:00
background: #FA6400;
2024-09-18 17:24:51 +08:00
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
margin-bottom: 5px;
}
.hui_ {
font-size: 10px;
color: #666666;
}
2024-09-21 15:55:14 +08:00
</style>