小程序产品页面优化,及添加忽略文件
This commit is contained in:
@@ -151,10 +151,6 @@ Page({
|
||||
this.loadGoodsList(true);
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadGoodsList(true);
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
const { goodsList, total } = this.data;
|
||||
if (goodsList.length === total) {
|
||||
@@ -166,14 +162,6 @@ Page({
|
||||
this.loadGoodsList(false);
|
||||
},
|
||||
|
||||
handleAddCart() {
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '点击加购',
|
||||
});
|
||||
},
|
||||
|
||||
tagClickHandle() {
|
||||
Toast({
|
||||
context: this,
|
||||
|
||||
@@ -1,16 +1,35 @@
|
||||
<view class="goods-list-container">
|
||||
<view class="search" style="margin-bottom: 5rpx;">
|
||||
<t-search t-class-input-container="t-class__input-container" t-class-input="t-search__input" t-class-left="t-search__left-icon" value="{{keywords}}" left-icon="{{null}}" placeholder="请输入关键词搜索" bind:blur="onChangeInput" bind:change="onChangeInput" bind:submit="onChangeSearch">
|
||||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
||||
</t-search>
|
||||
</view>
|
||||
<view class="home-page-tabs">
|
||||
<t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{0}}" space-evenly="{{false}}" bind:change="tabChangeHandle">
|
||||
<t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.text}}" value="{{item.key}}" />
|
||||
</t-tabs>
|
||||
<view class="list-header">
|
||||
<view class="search">
|
||||
<t-search
|
||||
t-class-input-container="t-class__input-container"
|
||||
t-class-input="t-search__input"
|
||||
t-class-left="t-search__left-icon"
|
||||
value="{{keywords}}"
|
||||
left-icon="{{null}}"
|
||||
placeholder="请输入关键词搜索"
|
||||
bind:blur="onChangeInput"
|
||||
bind:change="onChangeInput"
|
||||
bind:submit="onChangeSearch"
|
||||
>
|
||||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
||||
</t-search>
|
||||
</view>
|
||||
<view class="home-page-tabs">
|
||||
<t-tabs
|
||||
t-class="t-tabs"
|
||||
t-class-active="tabs-external__active"
|
||||
t-class-item="tabs-external__item"
|
||||
defaultValue="{{0}}"
|
||||
space-evenly="{{false}}"
|
||||
bind:change="tabChangeHandle"
|
||||
>
|
||||
<t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.text}}" value="{{item.key}}" />
|
||||
</t-tabs>
|
||||
</view>
|
||||
</view>
|
||||
<view class="category-goods-list" wx:if="{{goodsList.length}}">
|
||||
<goods-list wr-class="wr-goods-list" goodsList="{{goodsList}}" bind:click="gotoGoodsDetail" bind:addcart="gotoGoodsDetail" />
|
||||
<goods-list wr-class="wr-goods-list" goodsList="{{goodsList}}" bind:click="gotoGoodsDetail" />
|
||||
</view>
|
||||
<view class="empty-wrap" wx:if="{{goodsList.length === 0 && hasLoaded}}">
|
||||
<t-empty t-class="empty-tips" size="240rpx" description="暂无相关产品" />
|
||||
@@ -18,4 +37,4 @@
|
||||
<load-more wx:if="{{goodsList.length > 0}}" status="{{loadMoreStatus}}" no-more-text="没有更多了" />
|
||||
<view class="safe-bottom" />
|
||||
</view>
|
||||
<t-toast id="t-toast" />
|
||||
<t-toast id="t-toast" />
|
||||
|
||||
@@ -4,9 +4,20 @@ page {
|
||||
|
||||
.goods-list-container {
|
||||
display: block;
|
||||
min-height: 100vh;
|
||||
background-color: var(--bg-page);
|
||||
}
|
||||
|
||||
.goods-list-container .t-search {
|
||||
/* 顶部搜索 + 分类:吸顶固定,滚动时不遮挡内容 */
|
||||
.goods-list-container .list-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
background-color: var(--bg-card);
|
||||
box-shadow: 0 4rpx 16rpx rgba(29, 33, 41, 0.03);
|
||||
}
|
||||
|
||||
.goods-list-container .search {
|
||||
padding: 16rpx 24rpx 8rpx;
|
||||
background-color: var(--bg-card);
|
||||
}
|
||||
@@ -28,26 +39,26 @@ page {
|
||||
}
|
||||
|
||||
.goods-list-container .home-page-tabs {
|
||||
padding: 0 8rpx;
|
||||
background: var(--bg-card);
|
||||
border-radius: 0;
|
||||
padding: 0 8rpx;
|
||||
}
|
||||
|
||||
.goods-list-container .tabs-external__active {
|
||||
color: var(--text-primary) !important;
|
||||
color: var(--brand) !important;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.goods-list-container .tabs-external__track {
|
||||
background-color: var(--brand) !important;
|
||||
height: 6rpx !important;
|
||||
border-radius: var(--radius-round) !important;
|
||||
width: 48rpx !important;
|
||||
height: 6rpx !important;
|
||||
background-color: var(--brand) !important;
|
||||
border-radius: var(--radius-round) !important;
|
||||
}
|
||||
|
||||
.goods-list-container .t-tabs.t-tabs--top .t-tabs__scroll {
|
||||
border-bottom: 1rpx solid var(--border-level-1);
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.goods-list-container .t-tabs.t-tabs--top .t-tabs__item {
|
||||
@@ -55,14 +66,8 @@ page {
|
||||
}
|
||||
|
||||
.goods-list-container .category-goods-list {
|
||||
padding: 24rpx 24rpx 0;
|
||||
background-color: var(--bg-page);
|
||||
overflow-y: scroll;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.goods-list-container .wr-goods-list {
|
||||
background: var(--bg-page) !important;
|
||||
}
|
||||
|
||||
.goods-list-container .t-image__mask {
|
||||
@@ -70,62 +75,17 @@ page {
|
||||
}
|
||||
|
||||
.goods-list-container .empty-wrap {
|
||||
margin-top: 184rpx;
|
||||
margin-bottom: 120rpx;
|
||||
height: 300rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 640rpx;
|
||||
}
|
||||
|
||||
.goods-list-container .empty-wrap .empty-tips .empty-content .content-text {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.goods-list-container .price-container {
|
||||
padding: 32rpx;
|
||||
height: 100vh;
|
||||
max-width: 632rpx;
|
||||
background-color: var(--bg-card);
|
||||
border-radius: 30rpx 0 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.goods-list-container .price-between {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.goods-list-container .price-ipts-wrap {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
margin-top: 24rpx;
|
||||
|
||||
--td-input-bg-color: var(--bg-grey);
|
||||
--td-input-vertical-padding: 4rpx;
|
||||
--td-input-border-color: transparent;
|
||||
}
|
||||
|
||||
.goods-list-container .price-ipts-wrap .price-divided {
|
||||
width: 16rpx;
|
||||
margin: 0 24rpx;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.goods-list-container .price-ipts-wrap .t-input__wrap {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.goods-list-container .price-ipts-wrap .t-input__content,
|
||||
.goods-list-container .price-ipts-wrap .t-input__placeholder {
|
||||
font-size: 24rpx !important;
|
||||
}
|
||||
|
||||
.goods-list-container .price-ipts-wrap .price-ipt {
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.safe-bottom {
|
||||
min-height: 150rpx;
|
||||
width: 100%;
|
||||
min-height: 150rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user