|
@@ -5,9 +5,16 @@
|
|
|
<u-search placeholder="请输入商品名称" inputAlign="center" bgColor="#fff" shape="square" v-model="search.cname"
|
|
|
@search="searchButton" @custom="searchButton" :animation="true"></u-search>
|
|
|
</view>
|
|
|
- <view style="margin: -15rpx auto 10rpx auto;display: flex;padding: 0 20rpx;z-index: 999;" v-if="show == true">
|
|
|
- <u-tag :text="search.brandNmae" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable
|
|
|
+ <view style="margin: -15rpx auto 10rpx auto;display: flex;padding: 0 20rpx;z-index: 999;" >
|
|
|
+ <u-tag :text="search.brandNmae" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="show == true"
|
|
|
:show="show" @close="close" @click="close"></u-tag>
|
|
|
+
|
|
|
+ <u-tag text="原厂" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="originalFactory"
|
|
|
+ :show="originalFactory" @close="yuanchangclose('originalFactory')" @click="yuanchangclose('originalFactory')"></u-tag>
|
|
|
+ <u-tag text="自修补" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="selfRecovery"
|
|
|
+ :show="selfRecovery" @close="yuanchangclose('selfRecovery')" @click="yuanchangclose('selfRecovery')"></u-tag>
|
|
|
+ <u-tag text="防爆" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable v-if="explosionProof"
|
|
|
+ :show="explosionProof" @close="yuanchangclose('explosionProof')" @click="yuanchangclose('explosionProof')"></u-tag>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view :style="{marginTop:show == true?'164rpx':'108rpx'}">
|
|
@@ -30,7 +37,25 @@
|
|
|
</view>
|
|
|
</u-grid-item>
|
|
|
</u-grid>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+ <view style="margin-top: 10rpx;display: flex;justify-content: space-around;">
|
|
|
+ <view style="display: flex;align-items: center;" @click="dianjiqiehuan('originalFactory')">
|
|
|
+ <view style="margin-right: 10rpx;" :style="originalFactory?'color:#4070fc':''">原厂</view>
|
|
|
+ <!-- <u-switch v-model="originalFactory"></u-switch> -->
|
|
|
+ </view>
|
|
|
+ <view style="display: flex;align-items: center;" @click="dianjiqiehuan('selfRecovery')">
|
|
|
+ <view style="margin-right: 10rpx;" :style="selfRecovery?'color:#4070fc':''">自修补</view>
|
|
|
+ <!-- <u-switch v-model="selfRecovery"></u-switch> -->
|
|
|
+ </view>
|
|
|
+ <view style="display: flex;align-items: center;" @click="dianjiqiehuan('explosionProof')">
|
|
|
+ <view style="margin-right: 10rpx;" :style="explosionProof?'color:#4070fc':''">防爆</view>
|
|
|
+ <!-- <u-switch v-model="explosionProof"></u-switch> -->
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
<view style="padding: 20rpx 20rpx;">
|
|
|
<u-divider text="爆品推荐"></u-divider>
|
|
|
</view>
|
|
@@ -113,7 +138,13 @@
|
|
|
'https://td.echepei.com/file/applets/temporary/images/swiper2.jpg',
|
|
|
'https://td.echepei.com/file/applets/temporary/images/swiper3.jpg'
|
|
|
],
|
|
|
- brandList: []
|
|
|
+ brandList: [],
|
|
|
+ // 原厂
|
|
|
+ originalFactory:0,
|
|
|
+ // 自修补
|
|
|
+ selfRecovery:0,
|
|
|
+ // 防爆
|
|
|
+ explosionProof:0
|
|
|
}
|
|
|
},
|
|
|
onReachBottom() {
|
|
@@ -154,15 +185,36 @@
|
|
|
uni.$u.route('/pages/views/personalInformation/index');
|
|
|
})
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ // 点击筛选条件
|
|
|
+ dianjiqiehuan(name){
|
|
|
+ if (this[name] == 0) {
|
|
|
+ this[name] = 1
|
|
|
+ }else {
|
|
|
+ this[name] = 0
|
|
|
+ }
|
|
|
+ this.click()
|
|
|
+ },
|
|
|
+ // 获取列表数据
|
|
|
onSearch() {
|
|
|
uni.showLoading({
|
|
|
title: '加载中',
|
|
|
mask: true
|
|
|
- });
|
|
|
+ });
|
|
|
+ let obj = {}
|
|
|
+ if(this.originalFactory){
|
|
|
+ obj.originalFactory = 1
|
|
|
+ }
|
|
|
+ if (this.selfRecovery){
|
|
|
+ obj.selfRecovery = 1
|
|
|
+ }
|
|
|
+ if (this.explosionProof) {
|
|
|
+ obj.explosionProof = 1
|
|
|
+ }
|
|
|
appList({
|
|
|
size: this.page.size,
|
|
|
- current: this.page.current,
|
|
|
+ current: this.page.current,
|
|
|
+ ...obj,
|
|
|
...this.search
|
|
|
}).then(res => {
|
|
|
this.dataList = this.dataList.concat(res.data.records)
|
|
@@ -179,20 +231,35 @@
|
|
|
this.show = false
|
|
|
this.search.brandId = ''
|
|
|
this.search.brandName = ''
|
|
|
- },
|
|
|
- click(name) {
|
|
|
+ },
|
|
|
+ // 原厂点击差号
|
|
|
+ yuanchangclose(type){
|
|
|
+ if (type == 'originalFactory') {
|
|
|
+ this.originalFactory = false
|
|
|
+ }else if (type == 'selfRecovery') {
|
|
|
+ this.selfRecovery = false
|
|
|
+ }else {
|
|
|
+ this.explosionProof = false
|
|
|
+ }
|
|
|
+ this.click()
|
|
|
+ },
|
|
|
+
|
|
|
+ click(name) {
|
|
|
+ console.log(name,239);
|
|
|
this.page = {
|
|
|
total: 0,
|
|
|
size: 10,
|
|
|
- current: 1
|
|
|
+ current: 1,
|
|
|
+ }
|
|
|
+ this.dataList = []
|
|
|
+ if (name) {
|
|
|
+ this.search = {
|
|
|
+ ...this.search,
|
|
|
+ brandId: this.brandList[name].id,
|
|
|
+ brandNmae: this.brandList[name].cname,
|
|
|
+ }
|
|
|
+ this.show = true
|
|
|
}
|
|
|
- this.dataList = []
|
|
|
- this.search = {
|
|
|
- ...this.search,
|
|
|
- brandId: this.brandList[name].id,
|
|
|
- brandNmae: this.brandList[name].cname,
|
|
|
- }
|
|
|
- this.show = true
|
|
|
this.onSearch()
|
|
|
},
|
|
|
searchButton(value) {
|