|
@@ -8,6 +8,7 @@
|
|
|
<text class="searchBox_btn">搜索</text>
|
|
<text class="searchBox_btn">搜索</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="" style="height: 13rpx;background-color: rgba(230, 230, 230, 0.4);"></view>
|
|
|
<view class="goodsBox">
|
|
<view class="goodsBox">
|
|
|
<scroll-view scroll-y="true" class="goodsBox_lScroll">
|
|
<scroll-view scroll-y="true" class="goodsBox_lScroll">
|
|
|
<view class="goodsBox_l">
|
|
<view class="goodsBox_l">
|
|
@@ -28,7 +29,7 @@
|
|
|
<view class="item_r_title">{{v.title}}</view>
|
|
<view class="item_r_title">{{v.title}}</view>
|
|
|
<view class="item_r_price">
|
|
<view class="item_r_price">
|
|
|
<text v-if="v.productPaymentMode==1" style="font-size:28rpx;">{{v.minPoints}}积分</text>
|
|
<text v-if="v.productPaymentMode==1" style="font-size:28rpx;">{{v.minPoints}}积分</text>
|
|
|
- <rich-text v-else :nodes="mUtil.priceBigSmall(v.salePrice||v.minSalePrice)"></rich-text>
|
|
|
|
|
|
|
+ <rich-text v-else :nodes="$mUtil.priceBigSmall(v.salePrice||v.minSalePrice)"></rich-text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -42,23 +43,20 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { productCategoryList, productList } from '@/api/shop.js'
|
|
|
|
|
|
|
+import { merchantCategoryTree_Api, shopProductPage_Api } from '@/api/shop.js'
|
|
|
import { ref, getCurrentInstance } from 'vue'
|
|
import { ref, getCurrentInstance } from 'vue'
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
import { onShow, onLoad } from '@dcloudio/uni-app'
|
|
import { onShow, onLoad } from '@dcloudio/uni-app'
|
|
|
-const mUtil = proxy.$mUtil;
|
|
|
|
|
const status = ref('nomore');//loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
|
const status = ref('nomore');//loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
|
|
const tabTop = ref(0);
|
|
const tabTop = ref(0);
|
|
|
const firstList = ref([]);
|
|
const firstList = ref([]);
|
|
|
const secondList = ref([]);
|
|
const secondList = ref([]);
|
|
|
-const businessId = ref(null);
|
|
|
|
|
const activeFirst = ref({});
|
|
const activeFirst = ref({});
|
|
|
const activeSecond = ref({});
|
|
const activeSecond = ref({});
|
|
|
const list = ref([]);
|
|
const list = ref([]);
|
|
|
const params = ref({
|
|
const params = ref({
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
- businessId: undefined,
|
|
|
|
|
productCategoryId: undefined
|
|
productCategoryId: undefined
|
|
|
})
|
|
})
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
@@ -67,7 +65,6 @@ onLoad((options) => {
|
|
|
tabTop.value = res.statusBarHeight + 44;
|
|
tabTop.value = res.statusBarHeight + 44;
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
- params.value.businessId = uni.getStorageSync('businessId');
|
|
|
|
|
getTypeList()
|
|
getTypeList()
|
|
|
})
|
|
})
|
|
|
const goBack = () => {
|
|
const goBack = () => {
|
|
@@ -76,15 +73,15 @@ const goBack = () => {
|
|
|
const clickFirst = (item) => {
|
|
const clickFirst = (item) => {
|
|
|
activeFirst.value = item;
|
|
activeFirst.value = item;
|
|
|
// getTypeList(item.categoryId);
|
|
// getTypeList(item.categoryId);
|
|
|
- secondList.value = item.children
|
|
|
|
|
|
|
+ secondList.value = item.childrenList || [];
|
|
|
activeSecond.value = {};
|
|
activeSecond.value = {};
|
|
|
- params.value.productCategoryId = item.categoryId;
|
|
|
|
|
|
|
+ params.value.merchantCategoryId = item.categoryId;
|
|
|
params.value.pageNum = 1;
|
|
params.value.pageNum = 1;
|
|
|
getList();
|
|
getList();
|
|
|
}
|
|
}
|
|
|
const clickSecond = (item) => {
|
|
const clickSecond = (item) => {
|
|
|
activeSecond.value = item;
|
|
activeSecond.value = item;
|
|
|
- params.value.productCategoryId = item.categoryId;
|
|
|
|
|
|
|
+ params.value.merchantCategoryId = item.categoryId;
|
|
|
getList();
|
|
getList();
|
|
|
}
|
|
}
|
|
|
const goDetails = (item) => {
|
|
const goDetails = (item) => {
|
|
@@ -101,15 +98,13 @@ const loadMore = () => {
|
|
|
const getTypeList = (parentId) => {
|
|
const getTypeList = (parentId) => {
|
|
|
if (!parentId) parentId = 0;
|
|
if (!parentId) parentId = 0;
|
|
|
let param = {
|
|
let param = {
|
|
|
- businessId: params.value.businessId,
|
|
|
|
|
parentId: parentId
|
|
parentId: parentId
|
|
|
}
|
|
}
|
|
|
- productCategoryList(param).then(res => {
|
|
|
|
|
|
|
+ merchantCategoryTree_Api(param).then(res => {
|
|
|
// 把一级list根据parentId处理成tree结构
|
|
// 把一级list根据parentId处理成tree结构
|
|
|
- res.data = mUtil.buildTree(res.data, 'categoryId', 'parentId', 'children')
|
|
|
|
|
firstList.value = res.data;
|
|
firstList.value = res.data;
|
|
|
- params.value.productCategoryId = res.data[0].categoryId;
|
|
|
|
|
- secondList.value = res.data[0].children
|
|
|
|
|
|
|
+ params.value.merchantCategoryId = res.data[0].categoryId;
|
|
|
|
|
+ secondList.value = res.data[0].childrenList || [];
|
|
|
activeFirst.value = res.data[0];
|
|
activeFirst.value = res.data[0];
|
|
|
params.value.pageNum = 1;
|
|
params.value.pageNum = 1;
|
|
|
getList();
|
|
getList();
|
|
@@ -118,7 +113,7 @@ const getTypeList = (parentId) => {
|
|
|
// 获取商品列表
|
|
// 获取商品列表
|
|
|
const getList = () => {
|
|
const getList = () => {
|
|
|
status.value = 'loading';
|
|
status.value = 'loading';
|
|
|
- productList(params.value).then(res => {
|
|
|
|
|
|
|
+ shopProductPage_Api(params.value).then(res => {
|
|
|
if (params.value.pageNum == 1) {
|
|
if (params.value.pageNum == 1) {
|
|
|
list.value = res.rows
|
|
list.value = res.rows
|
|
|
} else {
|
|
} else {
|