feat: 优先专区上轮播图

This commit is contained in:
2025-10-28 15:05:59 +08:00
parent 7f42cb7859
commit 335d0e937c
2 changed files with 48 additions and 5 deletions
+3 -3
View File
@@ -15,6 +15,7 @@
circular
></up-swiper>
</view>
<view class="mid-panel">
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
<view style="margin:0 12rpx">信任桥兑换</view>
@@ -33,7 +34,6 @@ import TopSafe from '@/components/common/top-safe.nvue'
import MyBtn from '@/components/common/my-btn.vue'
import FenItem from '@/components/shop/fen-item.vue'
import { searchList } from '@/api/product.js';
import func from '@/utils/func.js';
import { getCarouselImage } from '@/api/common.js';
export default {
@@ -107,8 +107,8 @@ export default {
flex-direction: row;
align-items: center;
justify-content: center;
height:156rpx;
min-height:156rpx;
height:120rpx;
min-height:120rpx;
}
.swiper-view{
width:100%;
+45 -2
View File
@@ -8,8 +8,23 @@
</template>
<!-- #endif -->
</Header>
<view class="swiper-view">
<up-swiper
:list="swiperList"
style="width:100%"
circular
></up-swiper>
</view>
<view class="mid-panel">
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
<view style="margin:0 12rpx">信任桥优选</view>
<up-image src="/static/common/jingxuan_right.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
</view>
<view class="setting-view">
<YouItem @ok="onJumpShop" style="margin-top:24rpx" :obj="item" v-for="(item,index) in dataList" :key="index"></YouItem>
<YouItem @ok="onJumpShop" style="margin-bottom:24rpx" :obj="item" v-for="(item,index) in dataList" :key="index"></YouItem>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
@@ -21,19 +36,22 @@ import TopSafe from '@/components/common/top-safe.nvue'
import MyBtn from '@/components/common/my-btn.vue'
import YouItem from '@/components/shop/you-item.vue'
import { searchList } from '@/api/product.js';
import { getCarouselImage } from '@/api/common.js';
export default {
components: { Header, TopSafe,MyBtn,YouItem },
data() {
return {
dataList:[
]
],
swiperList: ['https://cdn.uviewui.com/uview/swiper/swiper1.png'],
};
},
onShow() {
},
onLoad() {
this.init();
this.getCarouselImage();
},
methods: {
init() {
@@ -49,6 +67,16 @@ export default {
if(resp && resp.bizcode === 100){
this.dataList = resp.data || [];
}
},
async getCarouselImage(){
const params={
pageUi:4,
}
const resp = await getCarouselImage(params);
if(resp && resp.bizcode === 100){
const data = resp.data || [];
this.swiperList = data.length !== 0 ? data.map(obj=>obj.carouselImage) : [];
}
},
onJumpShop(id){
uni.navigateTo({
@@ -76,6 +104,21 @@ export default {
position: relative;
}
.mid-panel{
width:100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height:120rpx;
min-height:120rpx;
}
.swiper-view{
width:100%;
height:268rpx;
min-height:268rpx;
display: flex;
}
.setting-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));