细节修改

version/0412
fanfan 9 months ago
parent d4b9930b47
commit d3426c9283
  1. 6
      pages/activity/charts.vue
  2. 21
      pages/category/index.vue

@ -59,9 +59,9 @@
<image src="/static/ranking/rank_left.png"></image>更多榜单<image src="/static/ranking/rank_right.png">
</image>
</view>
<view class="rank_content">
<view class="rank_content" v-if="rankList.length>0">
<view class="rank_box" v-for="(item,index) in rankList"
:style="{ backgroundImage: 'url(' + item.image + ')', }">
:style="{ backgroundImage: 'url(' + (item.image!=null?item.image.external_url:'') + ')', }">
<view class="rank_name">
{{item.name}}
</view>
@ -125,7 +125,7 @@
message,
data
} = await GoodsApi.typeList({
is_in_store: 0
is_in_store: ''
});
if (status == 200) {
this.rankList = data.list

@ -13,7 +13,8 @@
<text class="u-line-1">{{item.name}}</text>
</view>
</scroll-view>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box">
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box"
@scroll="rightScroll">
<view class="page-view">
<view class="class-item">
<view class="item-box" v-for="(item1, index1) in tabbarList.children" :key="index1">
@ -45,6 +46,7 @@
tabbar: [],
tabbarList: [],
scrollRightTop: 0,
oldScrollTop: 0,
}
},
onLoad() {
@ -70,8 +72,12 @@
async swichMenu(index) {
this.tabbarList = []
this.current = index;
this.scrollRightTop = this.oldScrollTop;
this.tabbarList = this.tabbar[index];
this.getMenuItemTop()
this.$nextTick(function() {
this.getMenuItemTop()
})
},
getGoodsTypeList() {
const that = this;
@ -80,20 +86,26 @@
// is_hot: 0
})
.then(res => {
//
console.log(res, '分类数据')
that.tabbar = res.data.list;
that.tabbarList = res.data.list[0]
})
.catch(reject)
})
},
//
async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop;
},
// item
getMenuItemTop() {
let that = this
new Promise(resolve => {
let selectorQuery = uni.createSelectorQuery();
selectorQuery.selectAll('.class-item').boundingClientRect((rects) => {
rects.forEach((rect) => {
console.log(rects[0].top)
this.scrollRightTop = rects[0].top
that.scrollRightTop = rect.top - rects[0].top
resolve();
})
}).exec()
@ -179,6 +191,7 @@
}
.page-view {
padding: 0 16rpx 16rpx;
overflow: hidden;
}

Loading…
Cancel
Save