2025-12-16 09:13:48 +08:00
|
|
|
<template>
|
|
|
|
|
<view class="content">
|
|
|
|
|
<TopSafe></TopSafe>
|
2026-06-25 19:44:48 +08:00
|
|
|
<Header :isBack="false" height="88rpx">
|
2026-06-14 22:23:14 +08:00
|
|
|
<template v-slot:left>
|
2026-06-25 19:44:48 +08:00
|
|
|
<view class="header-left-content">
|
|
|
|
|
<u-icon size="36rpx" name="arrow-left" color="#000" @click="goback"></u-icon>
|
2026-07-22 17:18:13 +08:00
|
|
|
<up-image src="https://static.tbmall.xin/static/mine-purse/vcoin.png" width="18" height="18"
|
2026-06-25 19:44:48 +08:00
|
|
|
bgColor="#f1f6ff00" class="purse_amount"></up-image>
|
|
|
|
|
<text class="header-text">数字积分兑换专区: {{ balanceData.curAmount || 0 }}</text>
|
|
|
|
|
</view>
|
2026-06-14 22:23:14 +08:00
|
|
|
</template>
|
2025-12-16 09:13:48 +08:00
|
|
|
</Header>
|
2026-06-25 19:44:48 +08:00
|
|
|
|
2026-07-23 18:22:22 +08:00
|
|
|
<scroll-view scroll-x class="swiper-view">
|
2026-06-14 22:23:14 +08:00
|
|
|
<view :class="['swiper-item', { 'active': currentItem === item.key }]" v-for="(item, index) in swiperList"
|
|
|
|
|
:key="index" @click="onClickItem(item)">
|
|
|
|
|
<view class="swiper-item-content">{{ item.label }}</view>
|
|
|
|
|
</view>
|
2026-07-23 18:22:22 +08:00
|
|
|
</scroll-view>
|
2025-12-16 09:13:48 +08:00
|
|
|
|
2026-06-14 22:23:14 +08:00
|
|
|
<view class="name-box">
|
|
|
|
|
<mescroll-uni ref="mescrollRef" @down="downCallback" @up="upCallback" :up="upOption" :down="downOption"
|
|
|
|
|
@init="mescrollInit" :fixed="false">
|
|
|
|
|
|
|
|
|
|
<!-- 原来单个 v-for 替换成两列 -->
|
|
|
|
|
<view class="mescrollUniView">
|
|
|
|
|
<view class="fall-col">
|
2026-07-24 22:06:19 +08:00
|
|
|
<ParityProductItem v-for="(item, i) in leftList" :key="item.id" :obj="item" @ok="onJumpShop"
|
|
|
|
|
class="parity-product-item" />
|
2026-06-14 22:23:14 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="fall-col">
|
2026-07-24 22:06:19 +08:00
|
|
|
<ParityProductItem v-for="(item, i) in rightList" :key="item.id" :obj="item" @ok="onJumpShop"
|
|
|
|
|
class="parity-product-item" />
|
2026-06-14 22:23:14 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</mescroll-uni>
|
2025-12-16 09:13:48 +08:00
|
|
|
</view>
|
2026-06-14 22:23:14 +08:00
|
|
|
|
2025-12-16 09:13:48 +08:00
|
|
|
<up-toast ref="uToastRef"></up-toast>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import Header from '@/components/common/header.vue';
|
|
|
|
|
import TopSafe from '@/components/common/top-safe.nvue'
|
|
|
|
|
import MyBtn from '@/components/common/my-btn.vue'
|
|
|
|
|
import { searchList } from '@/api/product.js';
|
2026-06-14 22:23:14 +08:00
|
|
|
import { getAcctBalance } from "@/api/finance.js";
|
|
|
|
|
|
|
|
|
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
|
|
|
|
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue";
|
2026-07-24 22:06:19 +08:00
|
|
|
import ParityProductItem from "@/components/shop/parity-product-item.vue";
|
2025-12-16 09:13:48 +08:00
|
|
|
|
|
|
|
|
export default {
|
2026-06-14 22:23:14 +08:00
|
|
|
mixins: [MescrollMixin],
|
2026-07-24 22:06:19 +08:00
|
|
|
components: { Header, TopSafe, MyBtn, ParityProductItem, MescrollUni, },
|
2025-12-16 09:13:48 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
2026-06-14 22:23:14 +08:00
|
|
|
dataList: [],
|
|
|
|
|
swiperList: [
|
|
|
|
|
{ key: 0, label: '全部', minDeduction: 0, maxDeduction: 999999 },
|
|
|
|
|
{ key: 1, label: '<300积分', minDeduction: 0, maxDeduction: 299.99 },
|
|
|
|
|
{ key: 2, label: '300-500积分', minDeduction: 300, maxDeduction: 499.99 },
|
|
|
|
|
{ key: 3, label: '500-1000积分', minDeduction: 500, maxDeduction: 999.99 },
|
|
|
|
|
{ key: 4, label: '>1000积分', minDeduction: 1000, maxDeduction: 999999 },
|
|
|
|
|
],
|
|
|
|
|
currentItem: 0,
|
|
|
|
|
downOption: {
|
|
|
|
|
auto: false,
|
|
|
|
|
textColor: "#333",
|
|
|
|
|
bgColor: "rgba(0,0,0,0)",
|
|
|
|
|
},
|
|
|
|
|
upOption: {
|
|
|
|
|
auto: false,
|
|
|
|
|
page: {
|
|
|
|
|
size: 10,
|
|
|
|
|
},
|
|
|
|
|
noMoreSize: 10,
|
|
|
|
|
empty: {
|
|
|
|
|
tip: `空空如也`,
|
|
|
|
|
},
|
|
|
|
|
textColor: "#333",
|
|
|
|
|
bgColor: "rgba(0,0,0,0)",
|
|
|
|
|
},
|
|
|
|
|
leftList: [],
|
|
|
|
|
rightList: [],
|
|
|
|
|
mescroll: null,
|
|
|
|
|
balanceData: {},
|
2025-12-16 09:13:48 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.init();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
init() {
|
|
|
|
|
this.getSearchList();
|
2026-06-14 22:23:14 +08:00
|
|
|
this.getAcctBalance();
|
2025-12-16 09:13:48 +08:00
|
|
|
},
|
2026-06-14 22:23:14 +08:00
|
|
|
async getAcctBalance() {
|
|
|
|
|
const resp = await getAcctBalance();
|
|
|
|
|
let data = [];
|
|
|
|
|
if (resp && resp.bizcode === 100) {
|
|
|
|
|
data = resp.data || [];
|
2025-12-16 09:13:48 +08:00
|
|
|
}
|
2026-06-14 22:23:14 +08:00
|
|
|
this.balanceData = data.filter(item => item.categoty === 'vcoin')[0] || {};
|
2025-12-16 09:13:48 +08:00
|
|
|
},
|
2026-06-14 22:23:14 +08:00
|
|
|
|
|
|
|
|
onClickItem(item) {
|
|
|
|
|
this.currentItem = item.key;
|
|
|
|
|
this.getSearchList(item);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mescrollInit(mescroll) {
|
|
|
|
|
this.mescroll = mescroll;
|
|
|
|
|
},
|
|
|
|
|
upCallback(page) {
|
|
|
|
|
let currentSwiperItem = this.swiperList.find(item => item.key === this.currentItem) || {};
|
|
|
|
|
|
|
|
|
|
let params = {
|
|
|
|
|
type: -1,
|
|
|
|
|
page: page.num,
|
|
|
|
|
pageSize: page.size,
|
|
|
|
|
minDeduction: currentSwiperItem.minDeduction || 0,
|
|
|
|
|
maxDeduction: currentSwiperItem.maxDeduction || 999999,
|
|
|
|
|
};
|
|
|
|
|
searchList(params).then((res) => {
|
|
|
|
|
let curPageLen = res.data.length;
|
|
|
|
|
if (page.num === 1) this.dataList = [];
|
|
|
|
|
this.dataList = this.dataList.concat(res.data);
|
|
|
|
|
|
|
|
|
|
this.waterfall();
|
|
|
|
|
this.mescroll.endBySize(curPageLen, res.total);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
downCallback() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.mescroll && this.mescroll.resetUpScroll();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getSearchList(item = {}) {
|
2025-12-16 09:13:48 +08:00
|
|
|
const params = {
|
2026-06-14 22:23:14 +08:00
|
|
|
type: -1,
|
|
|
|
|
page: 1,
|
|
|
|
|
pageSize: 99,
|
|
|
|
|
minDeduction: item.minDeduction || 0,
|
|
|
|
|
maxDeduction: item.maxDeduction || 999999,
|
2025-12-16 09:13:48 +08:00
|
|
|
}
|
|
|
|
|
const resp = await searchList(params);
|
2026-06-14 22:23:14 +08:00
|
|
|
if (resp && resp.bizcode === 100) {
|
2025-12-16 09:13:48 +08:00
|
|
|
this.dataList = resp.data || [];
|
2026-06-14 22:23:14 +08:00
|
|
|
this.waterfall();
|
2025-12-16 09:13:48 +08:00
|
|
|
}
|
|
|
|
|
},
|
2026-06-14 22:23:14 +08:00
|
|
|
|
|
|
|
|
waterfall() {
|
|
|
|
|
this.leftList = this.dataList
|
|
|
|
|
.map((item, index) => {
|
|
|
|
|
if (index % 2 == 0) return item;
|
|
|
|
|
return null;
|
|
|
|
|
})
|
|
|
|
|
.filter(Boolean);
|
|
|
|
|
this.rightList = this.dataList
|
|
|
|
|
.map((item, index) => {
|
|
|
|
|
if (index % 2 != 0) return item;
|
|
|
|
|
return null;
|
|
|
|
|
})
|
|
|
|
|
.filter(Boolean);
|
|
|
|
|
console.log(this.leftList, this.rightList);
|
|
|
|
|
},
|
|
|
|
|
onJumpShop(id) {
|
2025-12-16 09:13:48 +08:00
|
|
|
uni.navigateTo({
|
2026-06-14 22:23:14 +08:00
|
|
|
url: '/pages/other_package/productInfo/productInfo?id=' + id + '&isPar=true&curAmount=' + this.balanceData.curAmount || 0,
|
2025-12-16 09:13:48 +08:00
|
|
|
})
|
|
|
|
|
},
|
2026-06-14 22:23:14 +08:00
|
|
|
onShare() {
|
2025-12-16 09:13:48 +08:00
|
|
|
uni.navigateTo({
|
2026-06-14 22:23:14 +08:00
|
|
|
url: '/pages/other_package/invite_friends/invite_friends',
|
2025-12-16 09:13:48 +08:00
|
|
|
})
|
2026-06-14 22:23:14 +08:00
|
|
|
},
|
|
|
|
|
goback() {
|
|
|
|
|
uni.navigateBack()
|
2025-12-16 09:13:48 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2026-06-25 19:44:48 +08:00
|
|
|
.header-left-content {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
2026-07-23 18:22:22 +08:00
|
|
|
|
2026-06-25 19:44:48 +08:00
|
|
|
.header-text {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333;
|
2026-07-22 17:18:13 +08:00
|
|
|
margin-left: 18rpx;
|
2026-06-25 19:44:48 +08:00
|
|
|
}
|
2026-07-23 18:22:22 +08:00
|
|
|
|
|
|
|
|
.purse_amount {
|
2026-06-25 19:44:48 +08:00
|
|
|
width: 36rpx;
|
|
|
|
|
height: 36rpx;
|
|
|
|
|
display: flex;
|
2026-07-22 17:18:13 +08:00
|
|
|
margin-top: 8rpx;
|
2026-06-25 19:44:48 +08:00
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-07-22 17:18:13 +08:00
|
|
|
vertical-align: middle;
|
2026-06-25 19:44:48 +08:00
|
|
|
}
|
2026-07-23 18:22:22 +08:00
|
|
|
|
2026-06-14 22:23:14 +08:00
|
|
|
.bottom-btn {
|
2025-12-16 09:13:48 +08:00
|
|
|
width: 100%;
|
2026-06-14 22:23:14 +08:00
|
|
|
margin-bottom: 92rpx;
|
2025-12-16 09:13:48 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 0 32rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
position: relative;
|
2026-06-14 22:23:14 +08:00
|
|
|
|
2025-12-16 09:13:48 +08:00
|
|
|
}
|
2026-06-14 22:23:14 +08:00
|
|
|
|
|
|
|
|
.swiper-view {
|
|
|
|
|
width: 100%;
|
2026-07-23 18:22:22 +08:00
|
|
|
height: 80rpx;
|
2026-06-14 22:23:14 +08:00
|
|
|
background: #FFFFFF;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
padding: 0 16rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
.swiper-item {
|
|
|
|
|
padding: 0 16rpx;
|
|
|
|
|
height: 100%;
|
|
|
|
|
color: #666;
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
box-sizing: border-box;
|
2026-06-25 19:44:48 +08:00
|
|
|
font-size: 28rpx;
|
2026-07-23 18:22:22 +08:00
|
|
|
border-bottom: 4rpx solid transparent;
|
2026-06-25 19:44:48 +08:00
|
|
|
|
|
|
|
|
.swiper-item-content {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
line-height: 40rpx;
|
|
|
|
|
}
|
2026-06-14 22:23:14 +08:00
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
|
color: #7A35F6;
|
2026-07-23 18:22:22 +08:00
|
|
|
font-weight: bold;
|
|
|
|
|
border-bottom-color: #7A35F6;
|
2026-06-14 22:23:14 +08:00
|
|
|
}
|
|
|
|
|
}
|
2025-12-16 09:13:48 +08:00
|
|
|
}
|
2026-06-14 22:23:14 +08:00
|
|
|
|
|
|
|
|
.name-box {
|
2025-12-16 09:13:48 +08:00
|
|
|
width: 100%;
|
2026-06-25 19:44:48 +08:00
|
|
|
// flex: 1;
|
|
|
|
|
height: calc(100% - 88rpx - 70rpx - var(--status-bar-height));
|
2025-12-16 09:13:48 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
2026-07-06 09:05:36 +08:00
|
|
|
overflow-y: auto;
|
2026-07-23 18:22:22 +08:00
|
|
|
margin-top: 20rpx;
|
2026-06-14 22:23:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mescrollUniView {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 24rpx;
|
|
|
|
|
|
|
|
|
|
.fall-col {
|
|
|
|
|
width: 332rpx;
|
|
|
|
|
height: 100%;
|
2026-07-23 18:22:22 +08:00
|
|
|
display: grid;
|
|
|
|
|
grid-gap: 12rpx;
|
2025-12-16 09:13:48 +08:00
|
|
|
}
|
|
|
|
|
}
|
2026-07-22 17:18:13 +08:00
|
|
|
</style>
|