Merge branch 'develop' into dongjian
@@ -2,7 +2,7 @@
|
||||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"playground" : "custom",
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,114 +1,146 @@
|
||||
<template>
|
||||
<view class="choiceness_warp">
|
||||
<view class="choiceness_title">
|
||||
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
|
||||
<view class="choiceness_title_msg">为您精选</view>
|
||||
<up-image src="/static/common/jingxuan_right.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
|
||||
</view>
|
||||
<view class="choiceness_product">
|
||||
<view v-for="item in productList" :key="item.id" class="choiceness_product_item" @click="jumpInfo(item)">
|
||||
<up-image :src="item.url" width="100%" height="140" bgColor="#f1f6ff00"></up-image>
|
||||
<view class="product_item_name">{{ item.title }}</view>
|
||||
<view class="product_item_price">
|
||||
<view class="price_">
|
||||
<text>¥</text>
|
||||
<text style="color:36rpx;">{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="price_sell">已售{{ item.sales }}件</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="choiceness_warp">
|
||||
<view class="choiceness_title">
|
||||
<up-image
|
||||
src="/static/common/jingxuan_left.png"
|
||||
width="24"
|
||||
height="8"
|
||||
bgColor="#f1f6ff00"
|
||||
></up-image>
|
||||
<view class="choiceness_title_msg">为您精选</view>
|
||||
<up-image
|
||||
src="/static/common/jingxuan_right.png"
|
||||
width="24"
|
||||
height="8"
|
||||
bgColor="#f1f6ff00"
|
||||
></up-image>
|
||||
</view>
|
||||
<view
|
||||
class="choiceness_product"
|
||||
:class="platformType ? '' : 'iosplatformType'"
|
||||
>
|
||||
<view
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
class="choiceness_product_item"
|
||||
@click="jumpInfo(item)"
|
||||
>
|
||||
<up-image
|
||||
:src="item.url"
|
||||
width="100%"
|
||||
height="140"
|
||||
bgColor="#f1f6ff00"
|
||||
></up-image>
|
||||
<view class="product_item_name">{{ item.title }}</view>
|
||||
<view class="product_item_price">
|
||||
<view class="price_">
|
||||
<text>¥</text>
|
||||
<text style="color: 36rpx">{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="price_sell">已售{{ item.sales }}件</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchList } from '@/api/product.js';
|
||||
import { searchList } from "@/api/product.js";
|
||||
|
||||
export default {
|
||||
name: "choiceness",
|
||||
data() {
|
||||
return {
|
||||
productList: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getSearchList();
|
||||
},
|
||||
methods: {
|
||||
//
|
||||
jumpInfo(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/other_package/productInfo/productInfo?id=' + item.id,
|
||||
})
|
||||
},
|
||||
async getSearchList() {
|
||||
const params = {
|
||||
isRecomm: true,
|
||||
page: 1,
|
||||
pageSize: 66,
|
||||
}
|
||||
const resp = await searchList(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
this.productList = resp.data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: "choiceness",
|
||||
data() {
|
||||
return {
|
||||
productList: [],
|
||||
platformType: true,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
/*#ifdef APP-PLUS*/
|
||||
const appUpdate = uni.getStorageSync("platform");
|
||||
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
|
||||
/*#endif*/
|
||||
this.getSearchList();
|
||||
},
|
||||
methods: {
|
||||
//
|
||||
jumpInfo(item) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/other_package/productInfo/productInfo?id=" + item.id,
|
||||
});
|
||||
},
|
||||
async getSearchList() {
|
||||
const params = {
|
||||
isRecomm: true,
|
||||
page: 1,
|
||||
pageSize: 66,
|
||||
};
|
||||
const resp = await searchList(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
this.productList = resp.data;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.choiceness_warp {
|
||||
margin-top: 50rpx;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.choiceness_title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.choiceness_title_msg {
|
||||
margin: 0 18rpx;
|
||||
}
|
||||
.choiceness_title_msg {
|
||||
margin: 0 18rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.choiceness_product {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
|
||||
&.iosplatformType {
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
|
||||
.choiceness_product_item {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx #EEEEEE;
|
||||
border-radius: 24rpx;
|
||||
width: 43%;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.choiceness_product_item {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx #eeeeee;
|
||||
border-radius: 24rpx;
|
||||
width: 43%;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.product_item_name {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.product_item_name {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.product_item_price {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
.product_item_price {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.price_ {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: $app-bt-bj;
|
||||
}
|
||||
.price_ {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: $app-bt-bj;
|
||||
}
|
||||
|
||||
.price_sell {
|
||||
font-weight: 400;
|
||||
font-size: 18rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.price_sell {
|
||||
font-weight: 400;
|
||||
font-size: 18rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,99 +1,124 @@
|
||||
<template>
|
||||
<view class="custom-tab-bar">
|
||||
<view v-for="(item, index) in tabs" :key="index" class="tab-item" @click="switchTab(index)">
|
||||
<image :src="tabIndex === index ? item.selectedIconPath : item.iconPath" class="tab-icon"></image>
|
||||
<text :class="tabIndex === index ? 'tab-text tab-text-sel' : 'tab-text'">{{ item.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="custom-tab-bar" :class="platformType ? '' : 'iosplatformType'">
|
||||
<view
|
||||
v-for="(item, index) in tabs"
|
||||
:key="index"
|
||||
class="tab-item"
|
||||
@click="switchTab(index)"
|
||||
>
|
||||
<image
|
||||
:src="tabIndex === index ? item.selectedIconPath : item.iconPath"
|
||||
class="tab-icon"
|
||||
></image>
|
||||
<text
|
||||
:class="tabIndex === index ? 'tab-text tab-text-sel' : 'tab-text'"
|
||||
>{{ item.text }}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "custom-tab-bar",
|
||||
props: {
|
||||
tabIndex: { //当前选中的tab项
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabs: [
|
||||
{
|
||||
"pagePath": "/pages/home/home",
|
||||
"text": "首页",
|
||||
"iconPath": "/static/column/home.png",
|
||||
"selectedIconPath": "/static/column/home_sel.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/sort/sort",
|
||||
"text": "分类",
|
||||
"iconPath": "/static/column/sort.png",
|
||||
"selectedIconPath": "/static/column/sort_sel.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/supply_chain/supply_chain",
|
||||
"text": "平价专区",
|
||||
"iconPath": "/static/column/supply_chain.png",
|
||||
"selectedIconPath": "/static/column/supply_chain_sel.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "/pages/shopping_cart/shopping_cart",
|
||||
"text": "购物车",
|
||||
"iconPath": "/static/column/shopping.png",
|
||||
"selectedIconPath": "/static/column/shopping_sel.png"
|
||||
}, {
|
||||
"pagePath": "/pages/mine/mine",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/column/mine.png",
|
||||
"selectedIconPath": "/static/column/mine_sel.png"
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
switchTab(index) {
|
||||
const pagePath = this.tabs[index].pagePath;
|
||||
uni.switchTab({ url: pagePath });
|
||||
}
|
||||
}
|
||||
}
|
||||
name: "custom-tab-bar",
|
||||
props: {
|
||||
tabIndex: {
|
||||
//当前选中的tab项
|
||||
type: Number,
|
||||
default: 0,
|
||||
platformType: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabs: [
|
||||
{
|
||||
pagePath: "/pages/home/home",
|
||||
text: "首页",
|
||||
iconPath: "/static/column/home.png",
|
||||
selectedIconPath: "/static/column/home_sel.png",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/sort/sort",
|
||||
text: "分类",
|
||||
iconPath: "/static/column/sort.png",
|
||||
selectedIconPath: "/static/column/sort_sel.png",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/supply_chain/supply_chain",
|
||||
text: "平价",
|
||||
iconPath: "/static/column/supply_chain.png",
|
||||
selectedIconPath: "/static/column/supply_chain_sel.png",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/shopping_cart/shopping_cart",
|
||||
text: "购物车",
|
||||
iconPath: "/static/column/shopping.png",
|
||||
selectedIconPath: "/static/column/shopping_sel.png",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/mine/mine",
|
||||
text: "我的",
|
||||
iconPath: "/static/column/mine.png",
|
||||
selectedIconPath: "/static/column/mine_sel.png",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
/*#ifdef APP-PLUS*/
|
||||
const appUpdate = uni.getStorageSync("platform");
|
||||
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
|
||||
/*#endif*/
|
||||
},
|
||||
methods: {
|
||||
switchTab(index) {
|
||||
const pagePath = this.tabs[index].pagePath;
|
||||
uni.switchTab({ url: pagePath });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.custom-tab-bar {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
//height: 140rpx;
|
||||
/* 根据需要调整 */
|
||||
background-color: #fff;
|
||||
/* 背景颜色 */
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: calc(100rpx + env(safe-area-inset-bottom));
|
||||
/* 根据需要调整 */
|
||||
background-color: #fff;
|
||||
/* 背景颜色 */
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom));
|
||||
&.iosplatformType {
|
||||
height: 100rpx;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
margin-top: 5rpx;
|
||||
width: 44rpx;
|
||||
/* 图标大小 */
|
||||
height: 44rpx;
|
||||
/* 图标大小 */
|
||||
margin-top: 5rpx;
|
||||
width: 44rpx;
|
||||
/* 图标大小 */
|
||||
height: 44rpx;
|
||||
/* 图标大小 */
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 24rpx
|
||||
/* 文字大小 */
|
||||
font-size: 24rpx;
|
||||
/* 文字大小 */
|
||||
}
|
||||
|
||||
.tab-text-sel {
|
||||
color: $app-bt-bj;
|
||||
color: $app-bt-bj;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/supply_chain/supply_chain",
|
||||
"text": "平价商品",
|
||||
"text": "平价",
|
||||
"iconPath": "/static/column/supply_chain.png",
|
||||
"selectedIconPath": "/static/column/supply_chain_sel.png"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="home_warp">
|
||||
<view class="home_warp" :class="platformType ? '' :'iosplatformType'">
|
||||
<!-- 带背景的头部 -->
|
||||
<view class="home_header_warp"></view>
|
||||
<view class="home_content_z_warp">
|
||||
@@ -496,6 +496,9 @@ export default {
|
||||
height: calc(100vh - env(safe-area-inset-bottom)); // 是底部的导航栏高度
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
&.iosplatformType{
|
||||
height:100vh;
|
||||
}
|
||||
}
|
||||
|
||||
.home_header_warp {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<view style="margin-left: 20rpx;">{{ item.phone }}</view>
|
||||
</view>
|
||||
<view class="address_item_address">
|
||||
{{ item.countryName }} {{ item.provinceName }} {{ item.cityName }} {{ item.areaName }} {{ item.address }}
|
||||
{{ item.countryName }} {{ item.provinceName }} {{ item.cityName }} {{ item.areaName }} {{ item.address }}{{ item.townshipName }}
|
||||
</view>
|
||||
<view class="address_operate">
|
||||
<up-checkbox :customStyle="{}" label="已默认" name="agree" usedAlone :checked="item.isDefault" shape="circle"
|
||||
|
||||
@@ -121,6 +121,9 @@ export default {
|
||||
if (data.areaName) {
|
||||
regionStr.push(data.areaName);
|
||||
}
|
||||
if (data.townshipName) {
|
||||
regionStr.push(data.townshipName);
|
||||
}
|
||||
|
||||
this.form.regionStr = regionStr;// 所属地区
|
||||
}
|
||||
|
||||
@@ -1,354 +1,416 @@
|
||||
<template>
|
||||
<view class="sort_warp">
|
||||
<view class="sort_header">
|
||||
<!-- 分类切换 -->
|
||||
<view class="sort_category_header">
|
||||
<view :class="selCategory === 1 ? 'category_item category_item_sel' : 'category_item'"
|
||||
@click="checkCategory(1)">
|
||||
<view>分类</view>
|
||||
<view v-if="selCategory === 1" class="category_item_sel_but"></view>
|
||||
</view>
|
||||
<!-- <view :class="selCategory === 2 ? 'category_item category_item_sel':'category_item'" @click="checkCategory(2)">
|
||||
<view class="sort_warp" :class="platformType ? '' : 'iosplatformType'">
|
||||
<view class="sort_header">
|
||||
<!-- 分类切换 -->
|
||||
<view class="sort_category_header">
|
||||
<view
|
||||
:class="
|
||||
selCategory === 1
|
||||
? 'category_item category_item_sel'
|
||||
: 'category_item'
|
||||
"
|
||||
@click="checkCategory(1)"
|
||||
>
|
||||
<view>分类</view>
|
||||
<view v-if="selCategory === 1" class="category_item_sel_but"></view>
|
||||
</view>
|
||||
<!-- <view :class="selCategory === 2 ? 'category_item category_item_sel':'category_item'" @click="checkCategory(2)">
|
||||
<view>品牌</view>
|
||||
<view v-if="selCategory === 2" class="category_item_sel_but"></view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 搜索 -->
|
||||
<view style="width: 200rpx;" @click="jumpSearch">
|
||||
<up-search shape="square" bgColor="#EEEEEEFF" color="#666666FF" :showAction="false"
|
||||
placeholder="搜索"></up-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-menu-wrap">
|
||||
<!-- 左侧类别 -->
|
||||
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop">
|
||||
<view v-for="(item, index) in tabbarList" :key="index" class="u-tab-item"
|
||||
:class="[current == index ? 'u-tab-item-active' : '']" :data-current="index"
|
||||
@tap.stop="swichMenu(item, index)">
|
||||
<text class="u-line-1">{{ item.name }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 商品类别数据 -->
|
||||
<scroll-view scroll-y class="right-box">
|
||||
<!-- banner图 -->
|
||||
<view style="padding: 0rpx 20rpx;">
|
||||
<up-swiper :list="bannerList" height="80px"></up-swiper>
|
||||
</view>
|
||||
<view class="page-view">
|
||||
<!-- 这里还有一层循环 -->
|
||||
<up-loading-page :loading="tabbarContentLoading"></up-loading-page>
|
||||
<view class="class-item" v-for="(item, index) in tabbarContentList" :key="index">
|
||||
<view class="item-title">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="item-container" v-if="item.foods && item.foods.length !== 0">
|
||||
<view class="thumb-box" v-for="(item1, index1) in item.foods" :key="index1" @click="jumpInfo(item1)">
|
||||
<image class="item-menu-image" :src="item1.icon ? item1.icon : '/static/common/def_img.jpg'" mode="">
|
||||
</image>
|
||||
<view class="item-menu-name">{{ item1.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="not_order_warp">
|
||||
<view class="not_order_warp_img"><up-image
|
||||
src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/not_shopping.png" width="100" height="100"
|
||||
bgColor="#f1f6ff00"></up-image></view>
|
||||
<view class="not_order_msg_warp">暂无分类,快去添加吧~</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- #ifndef H5 -->
|
||||
<CustomTabBar :tabIndex="1" />
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜索 -->
|
||||
<view style="width: 200rpx" @click="jumpSearch">
|
||||
<up-search
|
||||
shape="square"
|
||||
bgColor="#EEEEEEFF"
|
||||
color="#666666FF"
|
||||
:showAction="false"
|
||||
placeholder="搜索"
|
||||
></up-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-menu-wrap">
|
||||
<!-- 左侧类别 -->
|
||||
<scroll-view
|
||||
scroll-y
|
||||
scroll-with-animation
|
||||
class="u-tab-view menu-scroll-view"
|
||||
:scroll-top="scrollTop"
|
||||
>
|
||||
<view
|
||||
v-for="(item, index) in tabbarList"
|
||||
:key="index"
|
||||
class="u-tab-item"
|
||||
:class="[current == index ? 'u-tab-item-active' : '']"
|
||||
:data-current="index"
|
||||
@tap.stop="swichMenu(item, index)"
|
||||
>
|
||||
<text class="u-line-1">{{ item.name }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 商品类别数据 -->
|
||||
<scroll-view scroll-y class="right-box">
|
||||
<!-- banner图 -->
|
||||
<view style="padding: 0rpx 20rpx">
|
||||
<up-swiper :list="bannerList" height="80px"></up-swiper>
|
||||
</view>
|
||||
<view class="page-view">
|
||||
<!-- 这里还有一层循环 -->
|
||||
<up-loading-page :loading="tabbarContentLoading"></up-loading-page>
|
||||
<view
|
||||
class="class-item"
|
||||
v-for="(item, index) in tabbarContentList"
|
||||
:key="index"
|
||||
>
|
||||
<view class="item-title">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="item-container"
|
||||
v-if="item.foods && item.foods.length !== 0"
|
||||
>
|
||||
<view
|
||||
class="thumb-box"
|
||||
v-for="(item1, index1) in item.foods"
|
||||
:key="index1"
|
||||
@click="jumpInfo(item1)"
|
||||
>
|
||||
<image
|
||||
class="item-menu-image"
|
||||
:src="item1.icon ? item1.icon : '/static/common/def_img.jpg'"
|
||||
mode=""
|
||||
>
|
||||
</image>
|
||||
<view class="item-menu-name">{{ item1.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="not_order_warp">
|
||||
<view class="not_order_warp_img"
|
||||
><up-image
|
||||
src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/not_shopping.png"
|
||||
width="100"
|
||||
height="100"
|
||||
bgColor="#f1f6ff00"
|
||||
></up-image
|
||||
></view>
|
||||
<view class="not_order_msg_warp">暂无分类,快去添加吧~</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- #ifndef H5 -->
|
||||
<CustomTabBar :tabIndex="1" />
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCascadeCategory, getCarouselImage } from '@/api/common.js';
|
||||
import CustomTabBar from '@/components/custom-tab-bar.vue';
|
||||
import { APP_PAGE_TYPE } from '@/utils/enumUtils.js'
|
||||
import { getCascadeCategory, getCarouselImage } from "@/api/common.js";
|
||||
import CustomTabBar from "@/components/custom-tab-bar.vue";
|
||||
import { APP_PAGE_TYPE } from "@/utils/enumUtils.js";
|
||||
|
||||
export default {
|
||||
components: { CustomTabBar },
|
||||
data() {
|
||||
return {
|
||||
selCategory: 1,
|
||||
scrollTop: 0, //tab标题的滚动条位置
|
||||
current: null, // 预设当前项的值
|
||||
menuHeight: 0, // 左边菜单的高度
|
||||
menuItemHeight: 0, // 左边菜单item的高度
|
||||
bannerList: [],
|
||||
tabbarList: [],// 左侧的主分类
|
||||
tabbarContentList: [],// 右侧内容的分类
|
||||
tabbarContentLoading: false,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
/*#ifdef APP-PLUS*/
|
||||
uni.hideTabBar({
|
||||
animation: false
|
||||
})
|
||||
/*#endif*/
|
||||
const then = this;
|
||||
this.getSort(0).then(resp => {
|
||||
if (resp && resp.length !== 0) {
|
||||
this.tabbarList = resp;
|
||||
const sortId = uni.getStorageSync('sortId');
|
||||
// 如果有默认的参数就默认选中参数
|
||||
if (sortId && sortId !== 0) {
|
||||
let fData = {};
|
||||
let currentIndex = 0;
|
||||
resp.map((item, index) => {
|
||||
if (item.id === sortId) {
|
||||
fData = item;
|
||||
currentIndex = index;
|
||||
return;
|
||||
}
|
||||
})
|
||||
this.swichMenu(fData, currentIndex);
|
||||
} else {
|
||||
const fData = resp[0];
|
||||
// 否则就选中第一个
|
||||
this.swichMenu(fData, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.getCarouselImage();
|
||||
},
|
||||
methods: {
|
||||
checkCategory(val) {
|
||||
this.selCategory = val;
|
||||
},
|
||||
// 查询轮播图
|
||||
async getCarouselImage() {
|
||||
const params = {
|
||||
pageUi: APP_PAGE_TYPE.SORT,
|
||||
}
|
||||
const resp = await getCarouselImage(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
const data = resp.data || [];
|
||||
this.bannerList = data.length !== 0 ? data.map(obj => obj.carouselImage) : [];
|
||||
}
|
||||
},
|
||||
jumpSearch(item) {
|
||||
components: { CustomTabBar },
|
||||
data() {
|
||||
return {
|
||||
selCategory: 1,
|
||||
scrollTop: 0, //tab标题的滚动条位置
|
||||
current: null, // 预设当前项的值
|
||||
menuHeight: 0, // 左边菜单的高度
|
||||
menuItemHeight: 0, // 左边菜单item的高度
|
||||
bannerList: [],
|
||||
tabbarList: [], // 左侧的主分类
|
||||
tabbarContentList: [], // 右侧内容的分类
|
||||
tabbarContentLoading: false,
|
||||
platformType: true,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
/*#ifdef APP-PLUS*/
|
||||
uni.hideTabBar({
|
||||
animation: false,
|
||||
});
|
||||
const appUpdate = uni.getStorageSync("platform");
|
||||
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
|
||||
/*#endif*/
|
||||
const then = this;
|
||||
this.getSort(0).then((resp) => {
|
||||
if (resp && resp.length !== 0) {
|
||||
this.tabbarList = resp;
|
||||
const sortId = uni.getStorageSync("sortId");
|
||||
// 如果有默认的参数就默认选中参数
|
||||
if (sortId && sortId !== 0) {
|
||||
let fData = {};
|
||||
let currentIndex = 0;
|
||||
resp.map((item, index) => {
|
||||
if (item.id === sortId) {
|
||||
fData = item;
|
||||
currentIndex = index;
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.swichMenu(fData, currentIndex);
|
||||
} else {
|
||||
const fData = resp[0];
|
||||
// 否则就选中第一个
|
||||
this.swichMenu(fData, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.getCarouselImage();
|
||||
},
|
||||
methods: {
|
||||
checkCategory(val) {
|
||||
this.selCategory = val;
|
||||
},
|
||||
// 查询轮播图
|
||||
async getCarouselImage() {
|
||||
const params = {
|
||||
pageUi: APP_PAGE_TYPE.SORT,
|
||||
};
|
||||
const resp = await getCarouselImage(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
const data = resp.data || [];
|
||||
this.bannerList =
|
||||
data.length !== 0 ? data.map((obj) => obj.carouselImage) : [];
|
||||
}
|
||||
},
|
||||
jumpSearch(item) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/rwa_package/dongjian/search",
|
||||
});
|
||||
},
|
||||
jumpInfo(item) {
|
||||
console.log(item, "item");
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/other_package/productInfo/productInfo?id=${item.id}`,
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: `/pages/rwa_package/shop/sort-shop?id=${item.id}&name=${item.name}`,
|
||||
});
|
||||
},
|
||||
// 查询分类
|
||||
async getSort(pId) {
|
||||
const params = {
|
||||
parentId: pId,
|
||||
};
|
||||
const resp = await getCascadeCategory(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
return resp.data;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
getImg() {
|
||||
return Math.floor(Math.random() * 35);
|
||||
},
|
||||
// 点击左边的栏目切换
|
||||
async swichMenu(item, index) {
|
||||
if (index == this.current) return;
|
||||
this.tabbarContentLoading = true;
|
||||
const firstData = await this.getSort(item.id);
|
||||
for (let fItem of firstData) {
|
||||
const twoData = await this.getSort(fItem.id);
|
||||
fItem.foods = twoData;
|
||||
}
|
||||
this.tabbarContentList = firstData;
|
||||
this.current = index;
|
||||
// 如果为0,意味着尚未初始化
|
||||
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
|
||||
await this.getElRect("menu-scroll-view", "menuHeight");
|
||||
await this.getElRect("u-tab-item", "menuItemHeight");
|
||||
}
|
||||
// 将菜单菜单活动item垂直居中
|
||||
this.scrollTop =
|
||||
index * this.menuItemHeight +
|
||||
this.menuItemHeight / 2 -
|
||||
this.menuHeight / 2;
|
||||
this.tabbarContentLoading = false;
|
||||
},
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/rwa_package/dongjian/search',
|
||||
})
|
||||
|
||||
},
|
||||
jumpInfo(item) {
|
||||
console.log(item,'item');
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/other_package/productInfo/productInfo?id=${item.id}`,
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url:`/pages/rwa_package/shop/sort-shop?id=${item.id}&name=${item.name}`
|
||||
})
|
||||
},
|
||||
// 查询分类
|
||||
async getSort(pId) {
|
||||
const params = {
|
||||
parentId: pId,
|
||||
}
|
||||
const resp = await getCascadeCategory(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
return resp.data;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
getImg() {
|
||||
return Math.floor(Math.random() * 35);
|
||||
},
|
||||
// 点击左边的栏目切换
|
||||
async swichMenu(item, index) {
|
||||
if (index == this.current) return;
|
||||
this.tabbarContentLoading = true;
|
||||
const firstData = await this.getSort(item.id);
|
||||
for (let fItem of firstData) {
|
||||
const twoData = await this.getSort(fItem.id);
|
||||
fItem.foods = twoData;
|
||||
}
|
||||
this.tabbarContentList = firstData;
|
||||
this.current = index;
|
||||
// 如果为0,意味着尚未初始化
|
||||
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
|
||||
await this.getElRect('menu-scroll-view', 'menuHeight');
|
||||
await this.getElRect('u-tab-item', 'menuItemHeight');
|
||||
}
|
||||
// 将菜单菜单活动item垂直居中
|
||||
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
|
||||
this.tabbarContentLoading = false;
|
||||
},
|
||||
|
||||
// 获取一个目标元素的高度
|
||||
getElRect(elClass, dataVal) {
|
||||
new Promise((resolve, reject) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.' + elClass).fields({ size: true }, res => {
|
||||
// 如果节点尚未生成,res值为null,循环调用执行
|
||||
if (!res) {
|
||||
setTimeout(() => {
|
||||
this.getElRect(elClass);
|
||||
}, 10);
|
||||
return;
|
||||
}
|
||||
this[dataVal] = res.height;
|
||||
}).exec();
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
// 获取一个目标元素的高度
|
||||
getElRect(elClass, dataVal) {
|
||||
new Promise((resolve, reject) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query
|
||||
.select("." + elClass)
|
||||
.fields({ size: true }, (res) => {
|
||||
// 如果节点尚未生成,res值为null,循环调用执行
|
||||
if (!res) {
|
||||
setTimeout(() => {
|
||||
this.getElRect(elClass);
|
||||
}, 10);
|
||||
return;
|
||||
}
|
||||
this[dataVal] = res.height;
|
||||
})
|
||||
.exec();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sort_warp {
|
||||
padding: 130rpx 0rpx 0rpx;
|
||||
height: calc(100vh - 270rpx); // 130 上边的导航栏,140下边的导航栏
|
||||
padding: 130rpx 0rpx 0rpx;
|
||||
height: calc(100vh - 270rpx); // 130 上边的导航栏,140下边的导航栏
|
||||
&.iosplatformType {
|
||||
.u-menu-wrap {
|
||||
height: calc(100vh - 216rpx) !important;
|
||||
}
|
||||
.right-box {
|
||||
padding-bottom: 100rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sort_header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.sort_category_header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.sort_category_header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.category_item {
|
||||
width: 140rpx;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.category_item {
|
||||
width: 140rpx;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.category_item_sel {
|
||||
font-size: 44rpx;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
.category_item_sel {
|
||||
font-size: 44rpx;
|
||||
color: #1a1a1a;
|
||||
}
|
||||
|
||||
.category_item_sel_but {
|
||||
height: 8rpx;
|
||||
width: 50rpx;
|
||||
background: $app-bt-bj;
|
||||
margin-top: 4rpx;
|
||||
margin-left: 12%;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.category_item_sel_but {
|
||||
height: 8rpx;
|
||||
width: 50rpx;
|
||||
background: $app-bt-bj;
|
||||
margin-top: 4rpx;
|
||||
margin-left: 12%;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.sort_content {}
|
||||
.sort_content {
|
||||
}
|
||||
|
||||
.u-menu-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
margin-top: 20rpx;
|
||||
height: calc(100vh - 216rpx - env(safe-area-inset-bottom));
|
||||
flex: 1;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
margin-top: 20rpx;
|
||||
height: calc(100vh - 216rpx - env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.u-search-inner {
|
||||
background-color: rgb(234, 234, 234);
|
||||
border-radius: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10rpx 16rpx;
|
||||
background-color: rgb(234, 234, 234);
|
||||
border-radius: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10rpx 16rpx;
|
||||
}
|
||||
|
||||
.u-search-text {
|
||||
font-size: 26rpx;
|
||||
color: $u-tips-color;
|
||||
margin-left: 10rpx;
|
||||
font-size: 26rpx;
|
||||
color: $u-tips-color;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.u-tab-view {
|
||||
width: 200rpx;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
width: 200rpx;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
.u-tab-item {
|
||||
height: 110rpx;
|
||||
// background: #f6f6f6;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
height: 110rpx;
|
||||
// background: #f6f6f6;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.u-tab-item-active {
|
||||
position: relative;
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.u-tab-item-active::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-left: 4px solid $app-bt-bj;
|
||||
height: 32rpx;
|
||||
left: 0;
|
||||
top: 39rpx;
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-left: 4px solid $app-bt-bj;
|
||||
height: 32rpx;
|
||||
left: 0;
|
||||
top: 39rpx;
|
||||
}
|
||||
|
||||
.u-tab-view {
|
||||
height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.right-box {
|
||||
background-color: rgb(250, 250, 250);
|
||||
padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
|
||||
background-color: rgb(250, 250, 250);
|
||||
}
|
||||
|
||||
.page-view {
|
||||
padding: 16rpx;
|
||||
padding: 16rpx;
|
||||
}
|
||||
|
||||
.class-item {
|
||||
margin-bottom: 30rpx;
|
||||
background-color: #fff;
|
||||
padding: 16rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 30rpx;
|
||||
background-color: #fff;
|
||||
padding: 16rpx;
|
||||
border-radius: 8rpx;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-size: 26rpx;
|
||||
color: $u-main-color;
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: $u-main-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.item-menu-name {
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: $u-main-color;
|
||||
margin-top: 10rpx;
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: $u-main-color;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.item-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.thumb-box {
|
||||
width: 33.333333%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
margin-top: 20rpx;
|
||||
width: 33.333333%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.item-menu-image {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.3 KiB |