接口对接
This commit is contained in:
parent
d429c2739d
commit
74b719b427
|
|
@ -13,7 +13,7 @@
|
||||||
<view class="cu-bar search bg-white">
|
<view class="cu-bar search bg-white">
|
||||||
<view class="search-form round">
|
<view class="search-form round">
|
||||||
<text class="cuIcon-search"></text>
|
<text class="cuIcon-search"></text>
|
||||||
<input @confirm="searchGoods" :adjust-position="true" type="text" placeholder="输入搜索内容"
|
<input @confirm="searchGoods" v-model="searchInfo.inputGoodsName" :adjust-position="true" type="text" placeholder="输入搜索内容"
|
||||||
confirm-type="search"></input>
|
confirm-type="search"></input>
|
||||||
</view>
|
</view>
|
||||||
<!-- 区域筛选picker -->
|
<!-- 区域筛选picker -->
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
<!-- 热门细类 -->
|
<!-- 热门细类 -->
|
||||||
<view class="cu-list grid no-border hot-sub-category" :class="['col-5']">
|
<view class="cu-list grid no-border hot-sub-category" :class="['col-5']">
|
||||||
<view class="cu-item" v-for="(item,index) in subCategories" :key="index" v-if="index < 5"
|
<view class="cu-item" v-for="(item,index) in subCategories" :key="index" v-if="index < 5"
|
||||||
@click="searchGoods(item)">
|
@click="chooseCategory(item)">
|
||||||
<view class="hot-sub-category-icon" :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
|
<view class="hot-sub-category-icon" :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
|
||||||
<view class="cu-tag badge" v-if="item.badge!=0">
|
<view class="cu-tag badge" v-if="item.badge!=0">
|
||||||
<block v-if="item.badge!=1">{{item.badge}}</block>
|
<block v-if="item.badge!=1">{{item.badge}}</block>
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
<!-- 细类 -->
|
<!-- 细类 -->
|
||||||
<view class="cu-list grid no-border" :class="['col-5']" v-if="subCategories.length > 5">
|
<view class="cu-list grid no-border" :class="['col-5']" v-if="subCategories.length > 5">
|
||||||
<view class="cu-item" v-for="(item,index) in subCategories" :key="index"
|
<view class="cu-item" v-for="(item,index) in subCategories" :key="index"
|
||||||
v-if="index < subCategories.length && index > 4" @click="searchGoods(item)">
|
v-if="index < subCategories.length && index > 4" @click="chooseCategory(item)">
|
||||||
<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
|
<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
|
||||||
<view class="cu-tag badge" v-if="item.badge!=0">
|
<view class="cu-tag badge" v-if="item.badge!=0">
|
||||||
<block v-if="item.badge!=1">{{item.badge}}</block>
|
<block v-if="item.badge!=1">{{item.badge}}</block>
|
||||||
|
|
@ -193,6 +193,8 @@
|
||||||
this.areaList.push(regionList);
|
this.areaList.push(regionList);
|
||||||
this.areaList.push(subRegionList);
|
this.areaList.push(subRegionList);
|
||||||
this.areaList.push(subSubRegionList);
|
this.areaList.push(subSubRegionList);
|
||||||
|
// 默认选中第一个,因此将第一个区域默认加入查询条件中
|
||||||
|
this.searchInfo.area = [regionList[0], subRegionList[0], subSubRegionList[0]];
|
||||||
},
|
},
|
||||||
regionChange(e) {
|
regionChange(e) {
|
||||||
this.areaMultiIndex = e.detail.value;
|
this.areaMultiIndex = e.detail.value;
|
||||||
|
|
@ -241,9 +243,19 @@
|
||||||
let allSubCategories = await this.$api.data('subCategories');
|
let allSubCategories = await this.$api.data('subCategories');
|
||||||
this.subCategories = allSubCategories.slice(0, (4 - categoryId) * 5);
|
this.subCategories = allSubCategories.slice(0, (4 - categoryId) * 5);
|
||||||
},
|
},
|
||||||
searchGoods(item) {
|
chooseCategory(item) {
|
||||||
console.log("搜索条件信息: " + item)
|
this.searchInfo.category = item;
|
||||||
console.log("商品搜索中...");
|
this.searchGoods();
|
||||||
|
},
|
||||||
|
searchGoods() {
|
||||||
|
let params = {
|
||||||
|
category: this.searchInfo.category,
|
||||||
|
area: this.searchInfo.area,
|
||||||
|
inputGoodsName: this.searchInfo.inputGoodsName
|
||||||
|
};
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||||
|
})
|
||||||
},
|
},
|
||||||
showDetails(productItem) {
|
showDetails(productItem) {
|
||||||
let params = {
|
let params = {
|
||||||
|
|
|
||||||
|
|
@ -248,19 +248,18 @@
|
||||||
curUserInfo: {},
|
curUserInfo: {},
|
||||||
myInfo: {},
|
myInfo: {},
|
||||||
servOrderTabList: [{
|
servOrderTabList: [{
|
||||||
type: 'ordersWait2Pay',
|
|
||||||
name: '待付款'
|
name: '待付款'
|
||||||
}, {
|
}, {
|
||||||
type: 'ordersWait2Serv',
|
type: 1,
|
||||||
name: '待服务'
|
name: '待排期'
|
||||||
}, {
|
}, {
|
||||||
type: 'ordersServing',
|
type: 2,
|
||||||
|
name: '待上门'
|
||||||
|
}, {
|
||||||
|
type: 3,
|
||||||
name: '服务中'
|
name: '服务中'
|
||||||
}, {
|
}, {
|
||||||
type: 'ordersAfterServ',
|
type: 4,
|
||||||
name: '售后中'
|
|
||||||
}, {
|
|
||||||
type: 'ordersFinish',
|
|
||||||
name: '已完成'
|
name: '已完成'
|
||||||
}],
|
}],
|
||||||
servOrderType: 0,
|
servOrderType: 0,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="bg-white padding-bottom">
|
||||||
|
<!-- 图片 -->
|
||||||
|
<view class="flex justify-start">
|
||||||
|
<view class="cu-avatar" :style="'background-image:url(' + product.goodsLogoUrl + '); min-width:150rpx; min-height:150rpx;'"></view>
|
||||||
|
<view class="margin-left-sm flex-column-between" style="width: 100%">
|
||||||
|
<view class="text-black text-lg">{{product.goodsName}}</view>
|
||||||
|
<view class="flex flex-wrap">
|
||||||
|
<view class="basis-xl">{{product.standardName}}</view>
|
||||||
|
<view class="basis-xs text-right">×{{product.num}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "product-picked",
|
||||||
|
props: {
|
||||||
|
product: {
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<view class="cu-bar solid-bottom">
|
<view class="cu-bar solid-bottom">
|
||||||
<view class="action bar-first-action">
|
<view class="action bar-first-action">
|
||||||
<text class="cuIcon-shopfill text-main-color"></text>
|
<text class="cuIcon-shopfill text-main-color"></text>
|
||||||
{{shopOrder.worker.name}}
|
{{shopOrder.workerName}}
|
||||||
<view>
|
<view>
|
||||||
<view class="cuIcon-right"></view>
|
<view class="cuIcon-right"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -31,19 +31,18 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-lr">
|
<view class="padding-lr">
|
||||||
<view class="margin-top-sm">
|
<view class="margin-top-sm">
|
||||||
<product-picked :product="shopOrder.orderGoods" :pickedList="shopOrder.orderGoods.pickedList">
|
<product-picked :product="shopOrder"></product-picked>
|
||||||
</product-picked>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-end align-end padding-bottom-sm">
|
<view class="flex justify-end align-end padding-bottom-sm">
|
||||||
<view class="margin-right-sm"><text>总价</text><text class="text-price text-red">{{shopOrder.financialMaster.totalMoney}}</text>
|
<view class="margin-right-sm"><text>总价</text><text class="text-price text-red">{{shopOrder.totalMoney}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-right-sm"><text>优惠</text><text class="text-price text-red">{{shopOrder.financialMaster.discountMoney}}</text>
|
<view class="margin-right-sm"><text>优惠</text><text class="text-price text-red">{{shopOrder.discountMoney}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-lg"><text>需付款</text><text
|
<view class="text-lg"><text>需付款</text><text
|
||||||
class="text-price text-red text-lg text-bold">{{shopOrder.financialMaster.payMoney}}</text></view>
|
class="text-price text-red text-lg text-bold">{{shopOrder.payMoney}}</text></view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="orderType === 0" class="padding-tb-sm flex justify-end oper-bar">
|
<view v-if="orderType === 0">
|
||||||
<!-- <view class="padding-tb-sm flex justify-end oper-bar">
|
<!-- <view class="padding-tb-sm flex justify-end oper-bar" v-if="">
|
||||||
|
|
||||||
</view> -->
|
</view> -->
|
||||||
<button v-if="shopOrder.subProcessStatus <= 4 && shopOrder.mainProcess !== 'ordersWait2Serv'"
|
<button v-if="shopOrder.subProcessStatus <= 4 && shopOrder.mainProcess !== 'ordersWait2Serv'"
|
||||||
|
|
@ -115,7 +114,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import productPicked from '@/components/goods-card/product-picked.vue';
|
import productPicked from '@/pages/my/components/product-picked.vue';
|
||||||
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -145,12 +144,12 @@
|
||||||
}
|
}
|
||||||
if (Array.isArray(tabInfo.tabHeaderList) && tabInfo.tabHeaderList.length > 0) {
|
if (Array.isArray(tabInfo.tabHeaderList) && tabInfo.tabHeaderList.length > 0) {
|
||||||
this.tabHeaderList = tabInfo.tabHeaderList;
|
this.tabHeaderList = tabInfo.tabHeaderList;
|
||||||
this.loadData(this.tabHeaderList[this.tabCur].type);
|
this.loadData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadData(mainProcess) {
|
loadData() {
|
||||||
for(let i = 0; i < this.tabHeaderList.length; i++) {
|
for(let i = 0; i < this.tabHeaderList.length; i++) {
|
||||||
this.pageParams.push({
|
this.pageParams.push({
|
||||||
pageNum: 0
|
pageNum: 0
|
||||||
|
|
@ -159,9 +158,7 @@
|
||||||
// 真实对接口的时候使用
|
// 真实对接口的时候使用
|
||||||
// this.myOrders = await this.$api.data(this.orderType, mainProcess);
|
// this.myOrders = await this.$api.data(this.orderType, mainProcess);
|
||||||
// this.myOrders = await this.$api.data(mainProcess);
|
// this.myOrders = await this.$api.data(mainProcess);
|
||||||
this.loadOrderPage({
|
this.loadOrderPage();
|
||||||
orderType: this.orderType
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
reloadOrderPage(params = {}) {
|
reloadOrderPage(params = {}) {
|
||||||
this.pageParams = [];
|
this.pageParams = [];
|
||||||
|
|
@ -174,11 +171,16 @@
|
||||||
this.$refs.loadStatusBar.showLoadMore();
|
this.$refs.loadStatusBar.showLoadMore();
|
||||||
this.loadOrderPage(params);
|
this.loadOrderPage(params);
|
||||||
},
|
},
|
||||||
async loadOrderPage(params) {
|
async loadOrderPage(params = {}) {
|
||||||
params.pageNum = this.pageParams[this.tabCur].pageNum;
|
params.pageNum = this.pageParams[this.tabCur].pageNum;
|
||||||
params.pageSize = this.$globalData.initPageSize;
|
params.pageSize = this.$globalData.initPageSize;
|
||||||
this.$refs.loadStatusBar.showLoading();
|
this.$refs.loadStatusBar.showLoading();
|
||||||
try {
|
try {
|
||||||
|
params.orderType = this.orderType;
|
||||||
|
params.orderStatus = this.tabHeaderList[this.tabCur].type;
|
||||||
|
if (this.tabCur === 0) {
|
||||||
|
params.payStatus = 0;
|
||||||
|
}
|
||||||
let res = await this.$request.qryOrderPage(params);
|
let res = await this.$request.qryOrderPage(params);
|
||||||
let rowsLength = res.rows.length;
|
let rowsLength = res.rows.length;
|
||||||
if (rowsLength > 0) {
|
if (rowsLength > 0) {
|
||||||
|
|
@ -197,10 +199,8 @@
|
||||||
},
|
},
|
||||||
tabSelect(e) {
|
tabSelect(e) {
|
||||||
this.tabCur = e.currentTarget.dataset.id;
|
this.tabCur = e.currentTarget.dataset.id;
|
||||||
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
|
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
|
||||||
this.reloadOrderPage({
|
this.reloadOrderPage();
|
||||||
orderType: this.tabHeaderList[this.tabCur].type
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
updateAgreeStatus(status, index) {
|
updateAgreeStatus(status, index) {
|
||||||
this.myOrders[index].agreedServTime.customerAgreeStatus = status;
|
this.myOrders[index].agreedServTime.customerAgreeStatus = status;
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import productPicked from '@/components/goods-card/product-picked.vue';
|
import productPicked from '@/components/goods-card/product-picked.vue';
|
||||||
import urgentMsg from '@/pages/my/modal/urgent-msg.vue';
|
import urgentMsg from '@/pages/my/components/modal/urgent-msg.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<view class="cu-bar search bg-white">
|
<view class="cu-bar search bg-white">
|
||||||
<view class="search-form round">
|
<view class="search-form round">
|
||||||
<text class="cuIcon-search"></text>
|
<text class="cuIcon-search"></text>
|
||||||
<input @confirm="searchGoods" :adjust-position="true" type="text" placeholder="输入搜索内容"
|
<input @confirm="searchGoods" v-model="inputGoodsName" :adjust-position="true" type="text" placeholder="输入搜索内容"
|
||||||
confirm-type="search"></input>
|
confirm-type="search"></input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -19,22 +19,22 @@
|
||||||
<view class="cu-item" v-for="(item,index) in taskConditions" v-if="item.type !== 1" :key="index"
|
<view class="cu-item" v-for="(item,index) in taskConditions" v-if="item.type !== 1" :key="index"
|
||||||
@tap="tabSelect" :data-id="index">
|
@tap="tabSelect" :data-id="index">
|
||||||
<!-- 区域筛选picker -->
|
<!-- 区域筛选picker -->
|
||||||
<picker v-if="item.code === 'area'" :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange"
|
<picker v-if="item.code === 'areaId'" :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange"
|
||||||
:value="areaMultiIndex" :range-key="'areaName'" :range="areaList">
|
:value="areaMultiIndex" :range-key="'areaName'" :range="areaList">
|
||||||
<view class="flex justify-start">
|
<view class="flex justify-start">
|
||||||
<view class="text-cut search-nav-item-text">
|
<view class="text-cut search-nav-item-text">
|
||||||
{{taskConditions[0].value && taskConditions[0].value.length ? taskConditions[0].value[2].areaName : item.title}}
|
{{chosenArea && chosenArea.length ? chosenArea[2].areaName : item.title}}
|
||||||
</view>
|
</view>
|
||||||
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
<!-- 品类筛选picker -->
|
<!-- 品类筛选picker -->
|
||||||
<picker v-else-if="item.code === 'category'" :mode="'multiSelector'" @change="categoryChange"
|
<picker v-else-if="item.code === 'deptGoodsCategoryId'" :mode="'multiSelector'" @change="categoryChange"
|
||||||
@columnchange="categoryColChange" :value="categoryMultiIndex" :range-key="'goodsCategoryName'"
|
@columnchange="categoryColChange" :value="categoryMultiIndex" :range-key="'goodsCategoryName'"
|
||||||
:range="categoryList">
|
:range="categoryList">
|
||||||
<view class="flex justify-start">
|
<view class="flex justify-start">
|
||||||
<view class="text-cut search-nav-item-text">
|
<view class="text-cut search-nav-item-text">
|
||||||
{{taskConditions[1].value && taskConditions[1].value.length ? taskConditions[1].value[2].goodsCategoryName : item.title}}
|
{{chosenCategory && chosenCategory.length ? chosenCategory[2].goodsCategoryName : item.title}}
|
||||||
</view>
|
</view>
|
||||||
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" v-else>
|
<view class="cu-item" v-else>
|
||||||
<button class="cu-btn bg-grey round shadow-blur">{{item.title}}</button>
|
<button class="cu-btn bg-grey round shadow-blur" @click="barBtnClick(index)">{{item.title}}</button>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -83,53 +83,107 @@
|
||||||
pageNum: this.$globalData.initPageNum,
|
pageNum: this.$globalData.initPageNum,
|
||||||
pageSize: this.$globalData.initPageSize,
|
pageSize: this.$globalData.initPageSize,
|
||||||
stickyTop: this.CustomBar,
|
stickyTop: this.CustomBar,
|
||||||
// type: 0=升降序,1=功能按钮;order: 0=升序,1=降序;
|
// type: 0=升降序,1=功能按钮,2=选择器;order: 0=升序,1=降序;
|
||||||
tabCur: 0,
|
tabCur: 0,
|
||||||
scrollLeft: 0,
|
scrollLeft: 0,
|
||||||
taskConditions: [{
|
taskConditions: [{
|
||||||
code: 'area',
|
code: 'areaId',
|
||||||
title: '区域'
|
title: '区域',
|
||||||
|
type: 2
|
||||||
}, {
|
}, {
|
||||||
code: 'category',
|
code: 'deptGoodsCategoryId',
|
||||||
title: '品类'
|
title: '品类',
|
||||||
}, {
|
type: 2
|
||||||
code: 'distance',
|
},
|
||||||
title: '距离',
|
// {
|
||||||
type: 0,
|
// code: 'distance',
|
||||||
value: 0,
|
// title: '距离',
|
||||||
}, {
|
// type: 0,
|
||||||
code: 'time',
|
// value: 0,
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
code: 'createTimeSort',
|
||||||
title: '时间',
|
title: '时间',
|
||||||
type: 0,
|
type: 0,
|
||||||
value: 0,
|
value: 0,
|
||||||
}, {
|
}, {
|
||||||
code: 'reset',
|
code: 'reset',
|
||||||
type: 1,
|
type: 1,
|
||||||
title: '重置'
|
title: '重置',
|
||||||
|
action: 'resetConditions'
|
||||||
}],
|
}],
|
||||||
|
originTaskConditions: [{
|
||||||
|
code: 'areaId',
|
||||||
|
title: '区域',
|
||||||
|
type: 2
|
||||||
|
}, {
|
||||||
|
code: 'deptGoodsCategoryId',
|
||||||
|
title: '品类',
|
||||||
|
type: 2
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// code: 'distance',
|
||||||
|
// title: '距离',
|
||||||
|
// type: 0,
|
||||||
|
// value: 0,
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
code: 'createTimeSort',
|
||||||
|
title: '时间',
|
||||||
|
type: 0,
|
||||||
|
value: 0,
|
||||||
|
}, {
|
||||||
|
code: 'reset',
|
||||||
|
type: 1,
|
||||||
|
title: '重置',
|
||||||
|
action: 'resetConditions'
|
||||||
|
}],
|
||||||
|
inputGoodsName: null,
|
||||||
areaList: [],
|
areaList: [],
|
||||||
areaMultiIndex: [0, 0, 0],
|
areaMultiIndex: [0, 0, 0],
|
||||||
|
chosenArea: [],
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
categoryMultiIndex: [0, 0, 0]
|
categoryMultiIndex: [0, 0, 0],
|
||||||
|
chosenCategory: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let params = JSON.parse(decodeURIComponent(options.params));
|
let params = JSON.parse(decodeURIComponent(options.params));
|
||||||
if (typeof params.pageNum === 'number' && typeof params.pageSize === 'number') {
|
// if (typeof params.pageNum === 'number' && typeof params.pageSize === 'number') {
|
||||||
this.pageNum = params.pageNum;
|
// this.pageNum = params.pageNum;
|
||||||
this.pageSize = params.pageSize;
|
// this.pageSize = params.pageSize;
|
||||||
|
// }
|
||||||
|
if (params.category) {
|
||||||
|
this.chosenCategory[2] = params.category;
|
||||||
|
this.taskConditions[1].value = this.chosenCategory[2].goodsCategoryId;
|
||||||
}
|
}
|
||||||
this.loadData(params);
|
if (params.area) {
|
||||||
|
this.chosenArea = params.area;
|
||||||
|
this.taskConditions[0].value = this.chosenArea[2].areaId;
|
||||||
|
}
|
||||||
|
if (params.inputGoodsName) {
|
||||||
|
this.inputGoodsName = params.inputGoodsName;
|
||||||
|
}
|
||||||
|
this.loadData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadData(params) {
|
loadData() {
|
||||||
this.loadCategoryList();
|
this.loadCategoryList();
|
||||||
this.loadRegionList();
|
this.loadRegionList();
|
||||||
this.loadProductData(params);
|
this.loadProductData();
|
||||||
},
|
},
|
||||||
async loadProductData(params) {
|
async loadProductData(params = {}) {
|
||||||
params.pageNum = this.pageNum;
|
params.pageNum = this.pageNum;
|
||||||
params.pageSize = this.pageSize;
|
params.pageSize = this.pageSize;
|
||||||
|
params.goodsName = this.inputGoodsName;
|
||||||
|
this.taskConditions.forEach((condition) => {
|
||||||
|
if (condition.type === 2) {
|
||||||
|
params[condition.code] = condition.value;
|
||||||
|
} else if (condition.type === 0) {
|
||||||
|
params.params = params.params ? params.params : {};
|
||||||
|
params.params[condition.code] = condition.value === 1 ? 'desc' : 'asc';
|
||||||
|
}
|
||||||
|
})
|
||||||
this.loadMoreStatus = 'loading bg-main-color light';
|
this.loadMoreStatus = 'loading bg-main-color light';
|
||||||
this.hasMoreData = false;
|
this.hasMoreData = false;
|
||||||
try {
|
try {
|
||||||
|
|
@ -139,17 +193,27 @@
|
||||||
this.loadMoreStatus = 'erro bg-red'
|
this.loadMoreStatus = 'erro bg-red'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
reloadProductPage() {
|
||||||
|
this.pageNum = 0;
|
||||||
|
this.pageSize = this.$globalData.initPageSize;
|
||||||
|
this.loadProductData();
|
||||||
|
},
|
||||||
async loadProductPage(params) {
|
async loadProductPage(params) {
|
||||||
// let shopInfo = await this.$api.data('shopInfo');
|
// let shopInfo = await this.$api.data('shopInfo');
|
||||||
// this.productList = shopInfo.productList;
|
// this.productList = shopInfo.productList;
|
||||||
let res = await this.$request.qryProductPage(params);
|
let res = await this.$request.qryProductPage(params);
|
||||||
let rowsLength = res[1].data.rows.length;
|
let rowsLength = res[1].data.rows.length;
|
||||||
if (rowsLength == 0) {
|
if (rowsLength == 0) {
|
||||||
|
this.productList = [];
|
||||||
return;
|
return;
|
||||||
} else if (rowsLength === this.pageSize) {
|
} else if (rowsLength === this.pageSize) {
|
||||||
this.hasMoreData = true;
|
this.hasMoreData = true;
|
||||||
}
|
}
|
||||||
|
if (this.pageNum === 0) {
|
||||||
|
this.productList = res[1].data.rows;
|
||||||
|
} else {
|
||||||
this.productList = this.productList.concat(res[1].data.rows);
|
this.productList = this.productList.concat(res[1].data.rows);
|
||||||
|
}
|
||||||
this.pageNum++;
|
this.pageNum++;
|
||||||
},
|
},
|
||||||
async loadCategoryList(idArr) {
|
async loadCategoryList(idArr) {
|
||||||
|
|
@ -190,8 +254,21 @@
|
||||||
this.areaList.push(subRegionList);
|
this.areaList.push(subRegionList);
|
||||||
this.areaList.push(subSubRegionList);
|
this.areaList.push(subSubRegionList);
|
||||||
},
|
},
|
||||||
searchGoods(e) {
|
searchGoods() {
|
||||||
console.log("搜索" + e.detail.value)
|
this.reloadProductPage();
|
||||||
|
},
|
||||||
|
resetConditions() {
|
||||||
|
this.inputGoodsName = null;
|
||||||
|
for(let i = 0; i < this.originTaskConditions.length; i++) {
|
||||||
|
this.taskConditions[i].value = this.originTaskConditions[i].value;
|
||||||
|
}
|
||||||
|
this.chosenArea = [];
|
||||||
|
this.chosenCategory = [];
|
||||||
|
// this.$forceUpdate();
|
||||||
|
this.reloadProductPage();
|
||||||
|
},
|
||||||
|
barBtnClick(index) {
|
||||||
|
this[this.taskConditions[index].action]();
|
||||||
},
|
},
|
||||||
tabSelect(e) {
|
tabSelect(e) {
|
||||||
this.tabCur = e.currentTarget.dataset.id;
|
this.tabCur = e.currentTarget.dataset.id;
|
||||||
|
|
@ -202,6 +279,7 @@
|
||||||
// 升降序类型的条件切换升降序
|
// 升降序类型的条件切换升降序
|
||||||
let orderVal = this.taskConditions[this.tabCur].value;
|
let orderVal = this.taskConditions[this.tabCur].value;
|
||||||
this.taskConditions[this.tabCur].value = orderVal === 0 ? 1 : 0;
|
this.taskConditions[this.tabCur].value = orderVal === 0 ? 1 : 0;
|
||||||
|
this.searchGoods();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showDetails(productItem) {
|
showDetails(productItem) {
|
||||||
|
|
@ -218,7 +296,9 @@
|
||||||
for (let i = 0; i < this.areaList.length; i++) {
|
for (let i = 0; i < this.areaList.length; i++) {
|
||||||
chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]);
|
chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]);
|
||||||
}
|
}
|
||||||
this.taskConditions[this.tabCur].value = chosenArea;
|
this.chosenArea = chosenArea;
|
||||||
|
this.taskConditions[this.tabCur].value = chosenArea[chosenArea.length - 1].areaId;
|
||||||
|
this.searchGoods();
|
||||||
},
|
},
|
||||||
async regionColChange(e) {
|
async regionColChange(e) {
|
||||||
let colObj = e.detail;
|
let colObj = e.detail;
|
||||||
|
|
@ -251,7 +331,9 @@
|
||||||
for (let i = 0; i < this.categoryList.length; i++) {
|
for (let i = 0; i < this.categoryList.length; i++) {
|
||||||
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
||||||
}
|
}
|
||||||
this.taskConditions[this.tabCur].value = chosenCategory;
|
this.chosenCategory = chosenCategory;
|
||||||
|
this.taskConditions[this.tabCur].value = chosenCategory[chosenCategory.length - 1].goodsCategoryId;
|
||||||
|
this.searchGoods();
|
||||||
},
|
},
|
||||||
async categoryColChange(e) {
|
async categoryColChange(e) {
|
||||||
let colObj = e.detail;
|
let colObj = e.detail;
|
||||||
|
|
@ -296,5 +378,6 @@
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
|
width: 180rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@
|
||||||
},
|
},
|
||||||
chooseSubType(item) {
|
chooseSubType(item) {
|
||||||
let params = {
|
let params = {
|
||||||
goodsCategoryId: item.goodsCategoryId
|
category: item
|
||||||
}
|
};
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue