|
@@ -5,54 +5,52 @@
|
|
|
<input type="text" v-model="searchInfo.name" @blur="toInput" placeholder="搜索商品">
|
|
|
</view>
|
|
|
<view class="two">
|
|
|
- <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
|
|
|
<view class="list-scroll-view">
|
|
|
<view class="two_1">
|
|
|
- <view :class="['list',condActive==index?'activeList':'']" v-for="(item,index) in condList"
|
|
|
- :key="index" @tap="toCond(index,item)">
|
|
|
+ <view :class="['list',condActive==index?'activeList':'']" v-for="(item,index) in condList" :key="index" @tap="toCond(index,item)">
|
|
|
<view class="name">
|
|
|
{{item.name}}
|
|
|
</view>
|
|
|
<view class="icon">
|
|
|
<view class="icon_1">
|
|
|
- <text :class="['iconfont',item.shangActive]"
|
|
|
- v-if="condActive==index&&shang=='1'"></text>
|
|
|
+ <text :class="['iconfont',item.shangActive]" v-if="condActive==index&&shang=='1'"></text>
|
|
|
<text :class="['iconfont',item.shang]" v-else></text>
|
|
|
</view>
|
|
|
<view class="icon_1">
|
|
|
- <text :class="['iconfont', item.xiaActive]"
|
|
|
- v-if="condActive==index&&xia=='-1'"></text>
|
|
|
+ <text :class="['iconfont', item.xiaActive]" v-if="condActive==index&&xia=='-1'"></text>
|
|
|
<text :class="['iconfont', item.xia]" v-else></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="screenList" v-if="pid">
|
|
|
- <picker @change="screenChange" name="screen" :value="screen" :range="screenList"
|
|
|
- range-key="label">
|
|
|
+ <picker @change="screenChange" name="screen" :value="screen" :range="screenList" range-key="label">
|
|
|
<view class="uni-input">{{screen_name||'筛选'}}</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="two_2">
|
|
|
- <view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(item)">
|
|
|
- <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''" mode="">
|
|
|
- </image>
|
|
|
- <view class="sale" v-if="item.is_sale==true">
|
|
|
- <text>已售尽</text>
|
|
|
- </view>
|
|
|
- <view class="name">
|
|
|
- {{item.name}}
|
|
|
- </view>
|
|
|
- <view class="other">
|
|
|
- <view class="money">
|
|
|
- <text>¥</text>
|
|
|
- <text>{{item.sell_money}}</text>
|
|
|
+ <view class="pubu">
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(item)">
|
|
|
+ <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''" mode="">
|
|
|
+ </image>
|
|
|
+ <view class="sale" v-if="item.is_sale==true">
|
|
|
+ <text>已售尽</text>
|
|
|
</view>
|
|
|
- <view class="other_1">
|
|
|
- {{item.view_num||0}}人浏览
|
|
|
+ <view class="name">
|
|
|
+ {{item.name}}
|
|
|
</view>
|
|
|
- <view class="btn" v-if="item.is_sale==false">
|
|
|
- <text class="iconfont icon-gouwuche"></text>
|
|
|
+ <view class="other">
|
|
|
+ <view class="money">
|
|
|
+ <text>¥</text>
|
|
|
+ <text>{{item.sell_money}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="other_1">
|
|
|
+ {{item.view_num||0}}人浏览
|
|
|
+ </view>
|
|
|
+ <view class="btn" v-if="item.is_sale==false">
|
|
|
+ <text class="iconfont icon-gouwuche"></text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -60,6 +58,9 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
+ <view class="is_bottom" v-if="is_bottom">
|
|
|
+ <text>数据到底了!!</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</mobile-frame>
|
|
|
</template>
|
|
@@ -109,7 +110,10 @@
|
|
|
// 筛选
|
|
|
screenList: [],
|
|
|
screen: '',
|
|
|
- screen_name: ''
|
|
|
+ screen_name: '',
|
|
|
+ // 数据是否触底
|
|
|
+ is_bottom: false,
|
|
|
+ scrollTop: 0,
|
|
|
};
|
|
|
},
|
|
|
onLoad: async function(e) {
|
|
@@ -181,11 +185,17 @@
|
|
|
that.$set(that, `skip`, skip)
|
|
|
that.search();
|
|
|
uni.hideLoading();
|
|
|
- } else uni.showToast({
|
|
|
- title: '没有更多数据了'
|
|
|
- });
|
|
|
|
|
|
+ } else that.$set(that, `is_bottom`, true)
|
|
|
},
|
|
|
+ toScroll(e) {
|
|
|
+ const that = this;
|
|
|
+ let up = that.scrollTop;
|
|
|
+ that.$set(that, `scrollTop`, e.detail.scrollTop);
|
|
|
+ let num = Math.sign(up - e.detail.scrollTop);
|
|
|
+ if (num == 1) that.$set(that, `is_bottom`, false);
|
|
|
+ },
|
|
|
+
|
|
|
// 输入框
|
|
|
toInput(e) {
|
|
|
const that = this;
|
|
@@ -312,85 +322,83 @@
|
|
|
|
|
|
.two_2 {
|
|
|
display: flex;
|
|
|
- flex-direction: row;
|
|
|
- flex-wrap: wrap;
|
|
|
- padding: 2vw 2vw 0 2vw;
|
|
|
+ flex-direction: column;
|
|
|
+ padding: 2vw;
|
|
|
background-color: var(--f1Color);
|
|
|
|
|
|
- .list {
|
|
|
- position: relative;
|
|
|
- width: 43vw;
|
|
|
- margin: 0 2vw 2vw 0;
|
|
|
- padding: 2vw;
|
|
|
- border-radius: 9px;
|
|
|
- background-color: var(--fffColor);
|
|
|
+ .pubu {
|
|
|
+ column-count: 2;
|
|
|
+ column-gap: 2vw;
|
|
|
|
|
|
- .image {
|
|
|
+ .list {
|
|
|
+ position: relative;
|
|
|
+ background-color: var(--fffColor);
|
|
|
+ padding: 2vw;
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
+ break-inside: avoid;
|
|
|
+ border-radius: 9px;
|
|
|
|
|
|
- width: 100%;
|
|
|
- height: 40vw;
|
|
|
- }
|
|
|
+ .image {
|
|
|
|
|
|
- .sale {
|
|
|
- position: absolute;
|
|
|
- top: 18vw;
|
|
|
- text-align: center;
|
|
|
- width: 43vw;
|
|
|
-
|
|
|
- text {
|
|
|
- background-color: #0000005f;
|
|
|
- border-radius: 90px;
|
|
|
- display: inline-block;
|
|
|
- width: 15vw;
|
|
|
- height: 15vw;
|
|
|
- color: var(--fffColor);
|
|
|
+ width: 100%;
|
|
|
+ height: 40vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sale {
|
|
|
+ position: absolute;
|
|
|
+ top: 18vw;
|
|
|
text-align: center;
|
|
|
- line-height: 15vw;
|
|
|
+ width: 43vw;
|
|
|
+
|
|
|
+ text {
|
|
|
+ background-color: #0000005f;
|
|
|
+ border-radius: 90px;
|
|
|
+ display: inline-block;
|
|
|
+ width: 15vw;
|
|
|
+ height: 15vw;
|
|
|
+ color: var(--fffColor);
|
|
|
+ text-align: center;
|
|
|
+ line-height: 15vw;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .name {
|
|
|
- font-size: var(--font16Size);
|
|
|
- margin: 0 0 1vw 0;
|
|
|
- }
|
|
|
+ .name {
|
|
|
+ font-size: var(--font16Size);
|
|
|
+ margin: 0 0 1vw 0;
|
|
|
+ }
|
|
|
|
|
|
- .other {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- justify-content: space-between;
|
|
|
+ .other {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
|
|
|
- .money {
|
|
|
- font-size: var(--font14Size);
|
|
|
+ .money {
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
|
|
- text:nth-child(1) {
|
|
|
- font-size: var(--font12Size);
|
|
|
+ text:nth-child(1) {
|
|
|
+ font-size: var(--font12Size);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .other_1 {
|
|
|
- font-size: var(--font12Size);
|
|
|
- color: var(--f85Color);
|
|
|
+ .other_1 {
|
|
|
+ font-size: var(--font12Size);
|
|
|
+ color: var(--f85Color);
|
|
|
|
|
|
- text {
|
|
|
- font-weight: bold;
|
|
|
- padding: 0 2vw;
|
|
|
- color: var(--ff0Color);
|
|
|
+ text {
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 0 2vw;
|
|
|
+ color: var(--ff0Color);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .btn {
|
|
|
- button {
|
|
|
- font-size: var(--font20Size);
|
|
|
+ .btn {
|
|
|
+ button {
|
|
|
+ font-size: var(--font20Size);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .list:nth-child(2n) {
|
|
|
- margin: 0 0 2vw 0;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -407,4 +415,13 @@
|
|
|
flex-direction: column;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .is_bottom {
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ text {
|
|
|
+ padding: 1vw 0;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|