|
@@ -11,17 +11,19 @@
|
|
|
<span @click="searchList">搜索</span>
|
|
<span @click="searchList">搜索</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="type">
|
|
<view class="type">
|
|
|
- <text style="margin-right: 10px;" :style="showCategoryPopup?'color: #449AFF;':''" @click="showCategoryPopup = !showCategoryPopup">{{ selectedCategory ||
|
|
|
|
|
- '全部类型' }}<i :class="showCategoryPopup?'typeI':''"></i></text>
|
|
|
|
|
|
|
+ <text style="margin-right: 10px;" :style="showCategoryPopup ? 'color: #449AFF;' : ''"
|
|
|
|
|
+ @click="showCategoryPopup = !showCategoryPopup">{{ selectedCategory ||
|
|
|
|
|
+ '全部类型' }}<i :class="showCategoryPopup ? 'typeI' : ''"></i></text>
|
|
|
<!-- <u-select style="position: absolute;top:0" mode="single-column" :list="industryoptions"
|
|
<!-- <u-select style="position: absolute;top:0" mode="single-column" :list="industryoptions"
|
|
|
v-model="industryShow" label-name="lable" value-name="value"
|
|
v-model="industryShow" label-name="lable" value-name="value"
|
|
|
@confirm="industryopConfirm($event)"></u-select> -->
|
|
@confirm="industryopConfirm($event)"></u-select> -->
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 弹出层 -->
|
|
|
|
|
- <view :class="['dropdown-content', { 'show': showCategoryPopup }]" @tap="searchPopup">
|
|
|
|
|
|
|
+ <!-- 弹出层 -->
|
|
|
|
|
+ <view :class="['dropdown-content', { 'show': showCategoryPopup }]" @tap="searchPopup">
|
|
|
<view class="dropdown-content2">
|
|
<view class="dropdown-content2">
|
|
|
- <view :class="['dropdown-content1', 'flex', 'justify-between', '', { 'scolcentent': showCategoryPopup }]"
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ :class="['dropdown-content1', 'flex', 'justify-between', '', { 'scolcentent': showCategoryPopup }]"
|
|
|
@tap.stop.prevent>
|
|
@tap.stop.prevent>
|
|
|
<scroll-view scroll-y class="colcentent">
|
|
<scroll-view scroll-y class="colcentent">
|
|
|
<view class="category-content">
|
|
<view class="category-content">
|
|
@@ -53,10 +55,10 @@
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
<view class="operateBtn flex ">
|
|
<view class="operateBtn flex ">
|
|
|
- <view class="cancel " @click.stop="showCategoryPopup=false">
|
|
|
|
|
|
|
+ <view class="cancel " @click.stop="showCategoryPopup = false">
|
|
|
取消
|
|
取消
|
|
|
</view>
|
|
</view>
|
|
|
<view class="confirm " @click.stop="querysearch">
|
|
<view class="confirm " @click.stop="querysearch">
|
|
@@ -64,7 +66,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
<view class="top"></view>
|
|
<view class="top"></view>
|
|
|
<view class="content">
|
|
<view class="content">
|
|
@@ -106,14 +108,14 @@
|
|
|
:disabled="this.selectedIds.length == 0">确定</button>
|
|
:disabled="this.selectedIds.length == 0">确定</button>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import { USER_INFO } from "@/common/util/constants"
|
|
import { USER_INFO } from "@/common/util/constants"
|
|
|
import {
|
|
import {
|
|
|
- mapState
|
|
|
|
|
- } from 'vuex'
|
|
|
|
|
|
|
+ mapState
|
|
|
|
|
+} from 'vuex'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
@@ -134,15 +136,15 @@ export default {
|
|
|
selectedCategory: '全部类型',
|
|
selectedCategory: '全部类型',
|
|
|
industryShow: false,
|
|
industryShow: false,
|
|
|
rowDetail: {},
|
|
rowDetail: {},
|
|
|
- categoryId:''
|
|
|
|
|
|
|
+ categoryId: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.getList()
|
|
this.getList()
|
|
|
this.$http.get('/sys/category/getChildListBatch?parentIds=1889836358116098050').then(res => {
|
|
this.$http.get('/sys/category/getChildListBatch?parentIds=1889836358116098050').then(res => {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
- this.firstLevel=res.data.result.records
|
|
|
|
|
|
|
+ this.firstLevel = res.data.result.records
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
this.$tip.error(res.data.message);
|
|
this.$tip.error(res.data.message);
|
|
@@ -157,17 +159,17 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- async getSearch(id,type){
|
|
|
|
|
- let res=await this.$http.get('/sys/category/childList?pid=' + id)
|
|
|
|
|
- if(res.data.success){
|
|
|
|
|
- this[type+'Level']=res.data.result
|
|
|
|
|
|
|
+ async getSearch(id, type) {
|
|
|
|
|
+ let res = await this.$http.get('/sys/category/childList?pid=' + id)
|
|
|
|
|
+ if (res.data.success) {
|
|
|
|
|
+ this[type + 'Level'] = res.data.result
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
searchPopup() {
|
|
searchPopup() {
|
|
|
this.showCategoryPopup = !this.showCategoryPopup;
|
|
this.showCategoryPopup = !this.showCategoryPopup;
|
|
|
},
|
|
},
|
|
|
getList() {
|
|
getList() {
|
|
|
- this.$http.post('/merchant/localVoucherInfo/getProductList', { merchantId: uni.getStorageSync(USER_INFO).merchantId, productName: this.productName,categoryId:this.categoryId }).then(res => {
|
|
|
|
|
|
|
+ this.$http.post('/merchant/localVoucherInfo/getProductList', { merchantId: uni.getStorageSync(USER_INFO).merchantId, productName: this.productName, categoryId: this.categoryId }).then(res => {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
this.productList = res.data.result
|
|
this.productList = res.data.result
|
|
|
}
|
|
}
|
|
@@ -183,7 +185,7 @@ export default {
|
|
|
this.selectedThird = null
|
|
this.selectedThird = null
|
|
|
this.selectedCategory = item.name
|
|
this.selectedCategory = item.name
|
|
|
// 根据选择加载二级分类
|
|
// 根据选择加载二级分类
|
|
|
- this.getSearch(item.id,'second')
|
|
|
|
|
|
|
+ this.getSearch(item.id, 'second')
|
|
|
this.thirdLevel = []
|
|
this.thirdLevel = []
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -192,7 +194,7 @@ export default {
|
|
|
this.selectedThird = null
|
|
this.selectedThird = null
|
|
|
this.selectedCategory = item.name
|
|
this.selectedCategory = item.name
|
|
|
// 根据选择加载三级分类
|
|
// 根据选择加载三级分类
|
|
|
- this.getSearch(item.id,'third')
|
|
|
|
|
|
|
+ this.getSearch(item.id, 'third')
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -200,18 +202,39 @@ export default {
|
|
|
this.selectedThird = item.id
|
|
this.selectedThird = item.id
|
|
|
this.selectedCategory = item.name
|
|
this.selectedCategory = item.name
|
|
|
},
|
|
},
|
|
|
- querysearch(){
|
|
|
|
|
|
|
+ querysearch() {
|
|
|
this.showCategoryPopup = false
|
|
this.showCategoryPopup = false
|
|
|
- this.categoryId=this.selectedThird?this.selectedThird:this.selectedSecond?this.selectedSecond:this.selectedFirst
|
|
|
|
|
|
|
+ this.categoryId = this.selectedThird ? this.selectedThird : this.selectedSecond ? this.selectedSecond : this.selectedFirst
|
|
|
this.getList()
|
|
this.getList()
|
|
|
},
|
|
},
|
|
|
groupChange(e) {
|
|
groupChange(e) {
|
|
|
if (e == 1) {
|
|
if (e == 1) {
|
|
|
this.selectedIds = !this.selectAll ? this.productList.map(item => item.productId) : []
|
|
this.selectedIds = !this.selectAll ? this.productList.map(item => item.productId) : []
|
|
|
this.selectAll = !this.selectAll
|
|
this.selectAll = !this.selectAll
|
|
|
|
|
+ this.invertAll = false
|
|
|
}
|
|
}
|
|
|
if (e == 2) {
|
|
if (e == 2) {
|
|
|
|
|
+ // 反选功能
|
|
|
this.invertAll = !this.invertAll
|
|
this.invertAll = !this.invertAll
|
|
|
|
|
+ this.selectAll = false
|
|
|
|
|
+ // 获取所有商品ID
|
|
|
|
|
+ const allProductIds = this.productList.map(item => item.productId)
|
|
|
|
|
+
|
|
|
|
|
+ // 创建新的选中数组
|
|
|
|
|
+ let newSelectedIds = []
|
|
|
|
|
+
|
|
|
|
|
+ // 遍历所有商品ID
|
|
|
|
|
+ allProductIds.forEach(productId => {
|
|
|
|
|
+ // 如果当前ID不在已选中列表中,则添加到新列表
|
|
|
|
|
+ // 如果当前ID在已选中列表中,则不添加(即取消选中)
|
|
|
|
|
+ if (!this.selectedIds.includes(productId)) {
|
|
|
|
|
+ newSelectedIds.push(productId)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ // 更新选中列表
|
|
|
|
|
+ this.selectedIds = newSelectedIds
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
searchList() {
|
|
searchList() {
|
|
@@ -237,12 +260,14 @@ export default {
|
|
|
delta: 1
|
|
delta: 1
|
|
|
});
|
|
});
|
|
|
if (this.selectedIds.length > 0) {
|
|
if (this.selectedIds.length > 0) {
|
|
|
- this.$store.state.shopSelectedIds=this.selectedIds
|
|
|
|
|
|
|
+ this.$store.state.shopSelectedIds = this.selectedIds
|
|
|
// uni.setStorageSync('allowanceSelected', this.selectedIds)
|
|
// uni.setStorageSync('allowanceSelected', this.selectedIds)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 单选按钮变化处理
|
|
// 单选按钮变化处理
|
|
|
handleRadioChange(id) {
|
|
handleRadioChange(id) {
|
|
|
|
|
+ this. selectAll =false;
|
|
|
|
|
+ this. invertAll = false
|
|
|
// 判断是否已存在
|
|
// 判断是否已存在
|
|
|
const index = this.selectedIds.indexOf(id)
|
|
const index = this.selectedIds.indexOf(id)
|
|
|
if (index > -1) {
|
|
if (index > -1) {
|
|
@@ -308,7 +333,7 @@ export default {
|
|
|
border-bottom: 1px solid #EEEEEE;
|
|
border-bottom: 1px solid #EEEEEE;
|
|
|
background: #fff;
|
|
background: #fff;
|
|
|
padding: 16rpx 24rpx;
|
|
padding: 16rpx 24rpx;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.type {
|
|
.type {
|
|
|
background: #FFFFFF;
|
|
background: #FFFFFF;
|
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
@@ -327,7 +352,8 @@ export default {
|
|
|
border-right: 4px solid transparent;
|
|
border-right: 4px solid transparent;
|
|
|
border-left: 4px solid transparent;
|
|
border-left: 4px solid transparent;
|
|
|
}
|
|
}
|
|
|
- .typeI{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .typeI {
|
|
|
border-color: #449AFF;
|
|
border-color: #449AFF;
|
|
|
border-top: 4px solid transparent;
|
|
border-top: 4px solid transparent;
|
|
|
border-right: 4px solid transparent;
|
|
border-right: 4px solid transparent;
|
|
@@ -455,16 +481,18 @@ export default {
|
|
|
color: #999;
|
|
color: #999;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.operateBtn {
|
|
.operateBtn {
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
|
|
+
|
|
|
.cancel {
|
|
.cancel {
|
|
|
width: 50%;
|
|
width: 50%;
|
|
|
height: 70rpx;
|
|
height: 70rpx;
|
|
|
color: #449AFF;
|
|
color: #449AFF;
|
|
|
line-height: 70rpx;
|
|
line-height: 70rpx;
|
|
|
- background: rgba(68,154,255,0.05);
|
|
|
|
|
|
|
+ background: rgba(68, 154, 255, 0.05);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.confirm {
|
|
.confirm {
|
|
@@ -472,8 +500,8 @@ export default {
|
|
|
height: 70rpx;
|
|
height: 70rpx;
|
|
|
line-height: 70rpx;
|
|
line-height: 70rpx;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
- background: #449AFF ;
|
|
|
|
|
- border-radius: 0px 0px 20rpx 0px ;
|
|
|
|
|
|
|
+ background: #449AFF;
|
|
|
|
|
+ border-radius: 0px 0px 20rpx 0px;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -498,9 +526,10 @@ export default {
|
|
|
padding: 20rpx 20rpx;
|
|
padding: 20rpx 20rpx;
|
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
|
color: #333;
|
|
color: #333;
|
|
|
|
|
+
|
|
|
// border-bottom: 1px solid #f5f5f5;
|
|
// border-bottom: 1px solid #f5f5f5;
|
|
|
&.active {
|
|
&.active {
|
|
|
- background: rgba(68,154,255,0.1);
|
|
|
|
|
|
|
+ background: rgba(68, 154, 255, 0.1);
|
|
|
color: #2983EC;
|
|
color: #2983EC;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -532,6 +561,7 @@ export default {
|
|
|
transition: height 0.4s ease;
|
|
transition: height 0.4s ease;
|
|
|
// border-radius: 0px 0px 20rpx 20rpx;
|
|
// border-radius: 0px 0px 20rpx 20rpx;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.dropdown-content2 {
|
|
.dropdown-content2 {
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
// height: 0px;
|
|
// height: 0px;
|
|
@@ -541,6 +571,7 @@ export default {
|
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.scolcentent {
|
|
.scolcentent {
|
|
|
height: 486rpx;
|
|
height: 486rpx;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|