fanfan 11 months ago
commit 65f487ba89
  1. 20
      pages/activity/newsshop.vue
  2. 9
      pages/category/index.vue
  3. 2
      pages/index/index.vue

@ -2,7 +2,10 @@
<view class="newsshop" :style="{backgroundImage:'url('+shopItem.index_icon+')'}"> <view class="newsshop" :style="{backgroundImage:'url('+shopItem.index_icon+')'}">
<view class="newsshop-navbar"> <view class="newsshop-navbar">
<u-navbar :title="shopItem.title" back-icon-color="#fff" :border-bottom="false" title-color="#fff" <u-navbar :title="shopItem.title" back-icon-color="#fff" :border-bottom="false" title-color="#fff"
:background="background"></u-navbar> :background="{
background: 'url('+shopItem.index_icon+') center top no-repeat',
backgroundSize: '100% auto',
}"></u-navbar>
</view> </view>
<view class="newsshop-hd"> <view class="newsshop-hd">
</view> </view>
@ -31,7 +34,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty text="暂无活动数据显示哦~" v-else mode="list"></u-empty> <u-empty text="暂无活动数据显示哦~" v-if="isShow" mode="list"></u-empty>
</view> </view>
</template> </template>
@ -44,6 +47,10 @@
shopItem: '', shopItem: '',
shopList: [], shopList: [],
type: 2, type: 2,
isShow: false,
background: {
},
} }
}, },
onLoad(op) { onLoad(op) {
@ -97,6 +104,7 @@
} else { } else {
this.shopList = [] this.shopList = []
} }
this.isShow = this.shopList.length == 0?true:false
}) })
.finally() .finally()
}, },
@ -105,9 +113,9 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .u-navbar-fixed { // ::v-deep .u-navbar-fixed {
background: none !important; // background: none !important;
} // }
::v-deep .u-empty { ::v-deep .u-empty {
padding: 150rpx 0; padding: 150rpx 0;
} }
@ -116,7 +124,7 @@
overflow: hidden; overflow: hidden;
min-height: 100vh; min-height: 100vh;
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat;
&-hd { &-hd {
height: 380rpx; height: 380rpx;
} }

@ -85,17 +85,16 @@
if (index == this.current) return; if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop; this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() { this.$nextTick(function() {
// this.current = index; this.current = index;
this.scrollRightTop = this.arr[index]; this.scrollRightTop = this.arr[index];
this.leftMenuStatus(index); this.leftMenuStatus(index);
}) })
}, },
getGoodsTypeList() { getGoodsTypeList() {
const that = this; const that = this;
console.log(cstegory.list(), '接口地址')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
cstegory.list({ cstegory.list({
is_hot: 0 // is_hot: 0
}) })
.then(res => { .then(res => {
// //
@ -147,9 +146,9 @@
await this.getElRect('menu-scroll-view', 'menuHeight'); await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight'); await this.getElRect('u-tab-item', 'menuItemHeight');
} }
this.current = index;
// item // item
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2; this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
this.current = index-1;
}, },
// item // item
@ -166,7 +165,7 @@
} }
rects.forEach((rect) => { rects.forEach((rect) => {
// rects[0].top() // rects[0].top()
this.arr.push(rect.top - rects[0].top + 5); this.arr.push(rect.top - rects[0].top);
resolve(); resolve();
}) })
}).exec() }).exec()

@ -660,7 +660,7 @@
}, },
getTypeList() { getTypeList() {
GoodsApi.typeList({ GoodsApi.typeList({
is_in_store: this.current == 0 ? 0 : 1 // is_in_store: this.current == 0 ? 0 : 1
}).then(res => { }).then(res => {
if (res.status == 200) { if (res.status == 200) {
this.tabList = res.data.list; this.tabList = res.data.list;

Loading…
Cancel
Save