feat:改造地址和首页

This commit is contained in:
2025-09-25 22:26:03 +08:00
parent ba8158093a
commit 9e17a4597e
20 changed files with 1959 additions and 1567 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"version" : "1.0",
"configurations" : [
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
}
]
+49 -17
View File
@@ -1,18 +1,41 @@
<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>
<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>
<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="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>
<text style="color: 36rpx">{{ item.price }}</text>
</view>
<view class="price_sell">已售{{ item.sales }}件</view>
</view>
@@ -22,38 +45,43 @@
</template>
<script>
import { searchList } from '@/api/product.js';
import { searchList } from "@/api/product.js";
export default {
name: "choiceness",
data() {
return {
productList: []
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,
})
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
}
}
}
this.productList = resp.data;
}
},
},
};
</script>
<style lang="scss" scoped>
@@ -75,10 +103,14 @@ export default {
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;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx #eeeeee;
border-radius: 24rpx;
width: 43%;
margin-bottom: 20rpx;
+60 -35
View File
@@ -1,8 +1,19 @@
<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 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>
@@ -11,53 +22,62 @@
export default {
name: "custom-tab-bar",
props: {
tabIndex: { //当前选中的tab项
tabIndex: {
//当前选中的tab项
type: Number,
default: 0
}
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/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/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/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"
}
]
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>
@@ -66,12 +86,17 @@ export default {
display: flex;
justify-content: space-around;
align-items: center;
//height: 140rpx;
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 {
@@ -89,7 +114,7 @@ export default {
}
.tab-text {
font-size: 24rpx
font-size: 24rpx;
/* 文字大小 */
}
+1 -1
View File
@@ -532,7 +532,7 @@
},
{
"pagePath": "pages/supply_chain/supply_chain",
"text": "平价商品",
"text": "平价",
"iconPath": "/static/column/supply_chain.png",
"selectedIconPath": "/static/column/supply_chain_sel.png"
},
+4 -1
View File
@@ -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 {
+264 -114
View File
@@ -1,12 +1,27 @@
<template>
<view class="mine_warp">
<view class="mine_warp" :class="platformType ? '' : 'iosplatformType'">
<view class="mine_header">
<view class="mine_login_data" v-if="currentUserData && Object.keys(currentUserData).length !== 0">
<view
class="mine_login_data"
v-if="currentUserData && Object.keys(currentUserData).length !== 0"
>
<view class="mine_data">
<up-image :src="currentUserData.avatarUrl ? currentUserData.avatarUrl : '/static/mine/avatar.png'" shape="circle" width="54" height="54" bgColor="#f1f6ff00"></up-image>
<up-image
:src="
currentUserData.avatarUrl
? currentUserData.avatarUrl
: '/static/mine/avatar.png'
"
shape="circle"
width="54"
height="54"
bgColor="#f1f6ff00"
></up-image>
<view class="mine_info">
<view class="mine_info_name">
<text style="margin-right: 20rpx">{{ currentUserData.nickname || '信任桥用户' }}</text>
<text style="margin-right: 20rpx">{{
currentUserData.nickname || "信任桥用户"
}}</text>
<view class="level">
<up-image
src="/static/mine/rz.png"
@@ -35,23 +50,47 @@
</view> -->
</view>
<view class="mine_info_id">
<text style="margin-right: 20rpx">邀请码:{{ currentUserData.inviteCode }}</text>
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" @click="copyData(currentUserData.inviteCode)"></up-image>
<text style="margin-right: 20rpx"
>邀请码:{{ currentUserData.inviteCode }}</text
>
<up-image
src="/static/common/copy.png"
width="14"
height="14"
bgColor="#f1f6ff00"
@click="copyData(currentUserData.inviteCode)"
></up-image>
</view>
</view>
</view>
<view @click="jumpSetting">
<up-image src="/static/mine/icon_arrow_black_off.png" width="22" height="22" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/mine/icon_arrow_black_off.png"
width="22"
height="22"
bgColor="#f1f6ff00"
></up-image>
</view>
</view>
<view class="mine_no_login_data" v-else>
<view class="mine_data">
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/avater_not.png" shape="circle" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<up-image
src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/avater_not.png"
shape="circle"
width="80"
height="80"
bgColor="#f1f6ff00"
></up-image>
<view class="mine_info_not_login">未登录</view>
</view>
<view @click="jumpLogin" class="login_warp">
<text style="margin-right: 10rpx">立即登录</text>
<up-image src="/static/common/right_y_st.png" width="18" height="18" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/common/right_y_st.png"
width="18"
height="18"
bgColor="#f1f6ff00"
></up-image>
</view>
</view>
</view>
@@ -61,22 +100,56 @@
<view class="mine_order_title">
<view>我的订单</view>
<view class="mine_order_title_all" @click="jumpOrder({})">
<view style="margin-right: 10rpx; font-size: 28rpx; font-weight: normal">全部</view>
<up-image style="margin-top: 10rpx" src="/static/common/right.png" width="15" height="15" bgColor="#f1f6ff00"></up-image>
<view
style="margin-right: 10rpx; font-size: 28rpx; font-weight: normal"
>全部</view
>
<up-image
style="margin-top: 10rpx"
src="/static/common/right.png"
width="15"
height="15"
bgColor="#f1f6ff00"
></up-image>
</view>
</view>
<view class="mine_order_list">
<view class="mine_fontsize_comm_warp order_list_item" v-for="item in orderTemplList" :key="item.id" @click="jumpOrder(item)">
<up-image :src="item.url" width="28" height="28" bgColor="#f1f6ff00"></up-image>
<view
class="mine_fontsize_comm_warp order_list_item"
v-for="item in orderTemplList"
:key="item.id"
@click="jumpOrder(item)"
>
<up-image
:src="item.url"
width="28"
height="28"
bgColor="#f1f6ff00"
></up-image>
<view>{{ item.title }}</view>
<up-badge :absolute="true" :offset="[0, 8]" max="99" :value="statisticsObj[item.note]"></up-badge>
<up-badge
:absolute="true"
:offset="[0, 8]"
max="99"
:value="statisticsObj[item.note]"
></up-badge>
</view>
</view>
</view>
<!-- 应用 -->
<view class="mine_content_comm_warp mine_top_comm_warp apply_list">
<view class="apply_item mine_fontsize_comm_warp" v-for="item in applyList" :key="item.id" @click="jumpTool(item)">
<up-image :src="item.url" width="36" height="36" bgColor="#f1f6ff00"></up-image>
<view
class="apply_item mine_fontsize_comm_warp"
v-for="item in applyList"
:key="item.id"
@click="jumpTool(item)"
>
<up-image
:src="item.url"
width="36"
height="36"
bgColor="#f1f6ff00"
></up-image>
<view>{{ item.title }}</view>
</view>
</view>
@@ -86,7 +159,12 @@
<view class="settled_list">
<view class="enter_item" @click="jumpEnter('merchant')">
<view class="enter_item_cell">
<up-image src="/static/mine/enter_sj.png" width="36" height="36" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/mine/enter_sj.png"
width="36"
height="36"
bgColor="#f1f6ff00"
></up-image>
<view class="enter_item_text">
<view class="enter_title">商家入驻</view>
<view class="enter_remark">获取更多客户与订单机会</view>
@@ -95,14 +173,24 @@
<view class="enter_apply">
<text class="enter_apply_title">申请</text>
<view style="margin-top: 10rpx">
<up-image src="/static/common/right.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/common/right.png"
width="14"
height="14"
bgColor="#f1f6ff00"
></up-image>
</view>
</view>
</view>
<view class="enter_item" @click="jumpEnter('brand')">
<view class="enter_item_cell">
<up-image src="/static/mine/enter_pp.png" width="36" height="36" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/mine/enter_pp.png"
width="36"
height="36"
bgColor="#f1f6ff00"
></up-image>
<view class="enter_item_text">
<view class="enter_title">企业/品牌入驻</view>
<view class="enter_remark">助您打造专属品牌馆</view>
@@ -112,7 +200,12 @@
<view class="enter_apply">
<text class="enter_apply_title">申请</text>
<view style="margin-top: 10rpx">
<up-image src="/static/common/right.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/common/right.png"
width="14"
height="14"
bgColor="#f1f6ff00"
></up-image>
</view>
</view>
</view>
@@ -123,8 +216,18 @@
<view class="mine_content_comm_warp mine_top_comm_warp mine_tool_warp">
<view class="mine_tool_title">服务工具</view>
<view class="tool_list">
<view class="tool_item" v-for="item in toolList" :key="item.id" @click="jumpTool(item)">
<up-image :src="item.url" width="28" height="28" bgColor="#f1f6ff00"></up-image>
<view
class="tool_item"
v-for="item in toolList"
:key="item.id"
@click="jumpTool(item)"
>
<up-image
:src="item.url"
width="28"
height="28"
bgColor="#f1f6ff00"
></up-image>
<text class="mine_fontsize_comm_warp">{{ item.title }}</text>
</view>
</view>
@@ -137,7 +240,12 @@
<up-modal :show="brandShow" :showConfirmButton="false">
<view class="slot-content">
<view class="close_warp" @click="brandShow = false">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/common/close.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
</view>
<view class="content_">
<view class="content_1">企业入驻</view>
@@ -145,7 +253,11 @@
<view class="content_3">{{ CUSTOMER_SERVICE_PHONE_NUMBER }}</view>
</view>
<view class="but_">
<view class="but_copy" @click="copyMobile(CUSTOMER_SERVICE_PHONE_NUMBER)">复制号码</view>
<view
class="but_copy"
@click="copyMobile(CUSTOMER_SERVICE_PHONE_NUMBER)"
>复制号码</view
>
<view class="but_close" @click="brandShow = false">取消</view>
</view>
</view>
@@ -154,14 +266,23 @@
<up-modal :show="serviceShow" :showConfirmButton="false">
<view class="slot-content">
<view class="close_warp" @click="serviceShow = false">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/common/close.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
</view>
<view class="content_">
<view class="content_1">联系客服</view>
<view class="content_3">{{ CUSTOMER_SERVICE_PHONE_NUMBER }}</view>
</view>
<view class="but_">
<view class="but_copy" @click="copyMobile(CUSTOMER_SERVICE_PHONE_NUMBER)">复制号码</view>
<view
class="but_copy"
@click="copyMobile(CUSTOMER_SERVICE_PHONE_NUMBER)"
>复制号码</view
>
<view class="but_close" @click="serviceShow = false">取消</view>
</view>
</view>
@@ -170,7 +291,12 @@
<up-modal :show="openShow" :showConfirmButton="false">
<view class="slot-content">
<view class="close_warp" @click="openShow = false">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<up-image
src="/static/common/close.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
</view>
<view class="content_">
<view class="content_1">温馨提示</view>
@@ -185,19 +311,19 @@
</template>
<script>
import { getStorageFun, USER_DATA, clear } from '@/utils/auth.js';
import { ORDER_TYPE, MINE_ORDER_TYPE } from '@/utils/enumUtils.js';
import { copyData } from '@/utils/index.js';
import CustomTabBar from '@/components/custom-tab-bar.vue';
import { getStatistics } from '@/api/order.js';
import { getUserInfo } from '@/api/auth.js';
import { CUSTOMER_SERVICE_PHONE_NUMBER } from '@/utils/config.js';
import { getStorageFun, USER_DATA, clear } from "@/utils/auth.js";
import { ORDER_TYPE, MINE_ORDER_TYPE } from "@/utils/enumUtils.js";
import { copyData } from "@/utils/index.js";
import CustomTabBar from "@/components/custom-tab-bar.vue";
import { getStatistics } from "@/api/order.js";
import { getUserInfo } from "@/api/auth.js";
import { CUSTOMER_SERVICE_PHONE_NUMBER } from "@/utils/config.js";
export default {
computed: {
CUSTOMER_SERVICE_PHONE_NUMBER() {
return CUSTOMER_SERVICE_PHONE_NUMBER;
}
},
},
components: { CustomTabBar },
data() {
@@ -207,65 +333,75 @@ export default {
orderTemplList: [
{
id: ORDER_TYPE.UNPAID,
title: '待支付',
url: '/static/mine/order_unpaid.png',
path: '/pages/mine_package/mine_order/mine_order?type=' + MINE_ORDER_TYPE.UNPAID,
note: 'unPayNum'
title: "待支付",
url: "/static/mine/order_unpaid.png",
path:
"/pages/mine_package/mine_order/mine_order?type=" +
MINE_ORDER_TYPE.UNPAID,
note: "unPayNum",
},
{
id: ORDER_TYPE.UNSHIPPED,
title: '待发货',
url: '/static/mine/order_unshipped.png',
path: '/pages/mine_package/mine_order/mine_order?type=' + MINE_ORDER_TYPE.UNSHIPPED,
note: 'unSentNum'
title: "待发货",
url: "/static/mine/order_unshipped.png",
path:
"/pages/mine_package/mine_order/mine_order?type=" +
MINE_ORDER_TYPE.UNSHIPPED,
note: "unSentNum",
},
{
id: ORDER_TYPE.NOT_RECEIVE,
title: '待收货',
url: '/static/mine/order_notReceive.png',
path: '/pages/mine_package/mine_order/mine_order?type=' + MINE_ORDER_TYPE.NOT_RECEIVE,
note: 'unTakeNum'
title: "待收货",
url: "/static/mine/order_notReceive.png",
path:
"/pages/mine_package/mine_order/mine_order?type=" +
MINE_ORDER_TYPE.NOT_RECEIVE,
note: "unTakeNum",
},
{
id: ORDER_TYPE.SUCCEED,
title: '已完成',
url: '/static/mine/order_afterSale.png',
path: '/pages/mine_package/mine_order/mine_order?type=' + MINE_ORDER_TYPE.SUCCEED,
note: 'unCommentNum'
title: "已完成",
url: "/static/mine/order_afterSale.png",
path:
"/pages/mine_package/mine_order/mine_order?type=" +
MINE_ORDER_TYPE.SUCCEED,
note: "unCommentNum",
},
{
id: ORDER_TYPE.AFTER_SALE,
title: '售后',
url: '/static/mine/order_afterSale.png',
path: '/pages/mine_package/mine_order/mine_order?type=' + MINE_ORDER_TYPE.AFTER_SALE,
note: 'unCommentNum'
}
title: "售后",
url: "/static/mine/order_afterSale.png",
path:
"/pages/mine_package/mine_order/mine_order?type=" +
MINE_ORDER_TYPE.AFTER_SALE,
note: "unCommentNum",
},
],
applyList: [
{
id: 1,
title: '钱包',
url: '/static/mine/apply_purse.png',
path: '/pages/mine_package/mine_purse/mine_purse'
title: "钱包",
url: "/static/mine/apply_purse.png",
path: "/pages/mine_package/mine_purse/mine_purse",
},
{
id: 2,
title: '抽奖',
url: '/static/mine/apply_prize.png',
path: '/pages/other_package/nine-grid/nine-grid'
title: "抽奖",
url: "/static/mine/apply_prize.png",
path: "/pages/other_package/nine-grid/nine-grid",
},
{
id: 4,
title: '我的推广',
url: '/static/mine/tool_team.png',
path: '/pages/mine_package/mine_my_team/mine_my_team'
title: "我的推广",
url: "/static/mine/tool_team.png",
path: "/pages/mine_package/mine_my_team/mine_my_team",
},
{
id: 5,
title: '加速次数',
url: '/static/mine/tool_js.png',
path: '/pages/rwa_package/dongjian/jia'
}
title: "加速次数",
url: "/static/mine/tool_js.png",
path: "/pages/rwa_package/dongjian/jia",
},
// {
// id: 3,
// title: "交易",
@@ -284,26 +420,26 @@ export default {
toolList: [
{
id: 5,
title: '地址管理',
url: '/static/mine/tool_dz.png',
path: '/pages/mine_package/mine_address/mine_address'
title: "地址管理",
url: "/static/mine/tool_dz.png",
path: "/pages/mine_package/mine_address/mine_address",
},
{
id: 9,
title: '实名认证',
url: '/static/mine/tool_sm.png'
title: "实名认证",
url: "/static/mine/tool_sm.png",
},
{
id: 10,
title: '银行卡管理',
url: '/static/mine/tool_card.png',
path: '/pages/mine_package/mine_bank_card/mine_bank_card'
title: "银行卡管理",
url: "/static/mine/tool_card.png",
path: "/pages/mine_package/mine_bank_card/mine_bank_card",
},
{
id: 3,
title: '邀请好友',
url: '/static/mine/tool_invite.png',
path: '/pages/other_package/invite_friends/invite_friends'
title: "邀请好友",
url: "/static/mine/tool_invite.png",
path: "/pages/other_package/invite_friends/invite_friends",
},
// {
// id:2,
@@ -319,8 +455,8 @@ export default {
// },
{
id: 7,
title: '联系客服',
url: '/static/mine/xlkf.png'
title: "联系客服",
url: "/static/mine/xlkf.png",
},
// {
// id:4,
@@ -330,22 +466,22 @@ export default {
// },
{
id: 8,
title: '商学院资讯',
url: '/static/mine/tool_sxy.png',
path: '/pages/login_package/news/news'
title: "商学院资讯",
url: "/static/mine/tool_sxy.png",
path: "/pages/login_package/news/news",
},
{
id: 12,
title: '财务',
url: '/static/mine/tool_cw.png',
path: '/pages/rwa_package/dongjian/finance'
title: "财务",
url: "/static/mine/tool_cw.png",
path: "/pages/rwa_package/dongjian/finance",
},
{
id: 11,
title: '股东行权',
url: '/static/mine/tool_gdxq.png',
path: '/pages/rwa_package/rwa/rwa'
}
title: "股东行权",
url: "/static/mine/tool_gdxq.png",
path: "/pages/rwa_package/rwa/rwa",
},
// {
// id:1,
// title:"IM聊天",
@@ -357,18 +493,21 @@ export default {
unPayNum: 0, //待支付数量
unSentNum: 0, //待发货数量
unTakeNum: 0, //待收货数量
unCommentNum: 0 //待评价数量
unCommentNum: 0, //待评价数量
}, // 角标统计
serviceShow: false, // 我的客服弹框
openShow: false // 暂未开放
openShow: false, // 暂未开放
platformType: true,
};
},
onShow() {
this.userData = getStorageFun(USER_DATA);
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
animation: false,
});
const appUpdate = uni.getStorageSync("platform");
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
/*#endif*/
this.getStatistics();
@@ -393,50 +532,51 @@ export default {
// 客服
if (item.id === 7) {
uni.navigateTo({
url:'/pages/rwa_package/setting/kefu?type=5257'
})
url: "/pages/rwa_package/setting/kefu?type=5257",
});
} else if (item.id === 9) {
// 实名认证
const currentUserData = this.currentUserData;
console.log('currentUserData', this.currentUserData);
let path = '/pages/mine_package/mine_authentication/mine_authentication';
console.log("currentUserData", this.currentUserData);
let path =
"/pages/mine_package/mine_authentication/mine_authentication";
// if (currentUserData && Object.keys(currentUserData).length !== 0 && currentUserData.certStatus && currentUserData.certStatus !== 0) {
// path = "/pages/mine_package/mine_authentication_ok/mine_authentication_ok"
// }
uni.navigateTo({
url: path
url: path,
});
} else if (item.path) {
uni.navigateTo({
url: item.path
url: item.path,
});
} else {
this.openShow = true;
}
},
jumpOrder(item) {
let path = '/pages/mine_package/mine_order/mine_order';
let path = "/pages/mine_package/mine_order/mine_order";
if (item && Object.keys(item).length !== 0) {
path = item.path;
}
uni.navigateTo({
url: path
url: path,
});
},
jumpLogin() {
uni.navigateTo({
url: '/pages/login_package/login/login'
url: "/pages/login_package/login/login",
});
},
// 跳转到入驻页面
jumpEnter(type) {
// 商家入驻
if (type === 'merchant') {
if (type === "merchant") {
// uni.navigateTo({
// url: '/pages/rwa_package/merchant_settlement/merchant_settlement.vue',
// })
this.openShow = true;
} else if (type === 'brand') {
} else if (type === "brand") {
// 企业/品牌入驻
// uni.navigateTo({
// url: '/pages/brand_settlement/brand_settlement',
@@ -456,46 +596,56 @@ export default {
if (result && result.bizcode === 100 && result.data) {
this.statisticsObj = {
...result.data,
unCommentNum: 0 //待评价数量
unCommentNum: 0, //待评价数量
};
} else {
this.statisticsObj = {
unPayNum: 0, //待支付数量
unSentNum: 0, //待发货数量
unTakeNum: 0, //待收货数量
unCommentNum: 0 //待评价数量
unCommentNum: 0, //待评价数量
};
}
},
jumpSetting() {
uni.navigateTo({
url: '/pages/rwa_package/setting/setting'
url: "/pages/rwa_package/setting/setting",
});
}
},
},
beforeDestroy() {
this.statisticsObj = {
unPayNum: 0, //待支付数量
unSentNum: 0, //待发货数量
unTakeNum: 0, //待收货数量
unCommentNum: 0 //待评价数量
unCommentNum: 0, //待评价数量
}; // 角标统计
}
},
};
</script>
<style lang="scss">
.mine_warp {
height: calc(100vh - env(safe-area-inset-bottom));
overflow: auto;
position: relative;
background-color: $app-bj;
&.iosplatformType {
height: 100vh;
.mine_content_warp {
padding-bottom: 100rpx !important;
}
}
}
.mine_header {
// height: 300rpx;
background: linear-gradient(180deg, #f2ebff 0%, rgba(245, 245, 247, 0) 100%, #ffffff 100%);
background: linear-gradient(
180deg,
#f2ebff 0%,
rgba(245, 245, 247, 0) 100%,
#ffffff 100%
);
/* 将图片居中显示 */
padding: 90rpx 40rpx 0;
@@ -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;// 所属地区
}
+211 -94
View File
@@ -1,62 +1,141 @@
<template>
<view>
<view :style="{ 'height': isDataNull ? 'calc(100vh - 134rpx)' : 'calc(100vh - 410rpx)' }"
class="shopping_cart_warp">
<view
:calss="[
isDataNull ? 'isDataNull-calss' : 'isDataNull-active',
platformType ? '' : 'iosplatformType',
]"
class="shopping_cart_warp"
>
<view class="shopping_cart_header">
<view class="cart">购物车({{ shoppingTotal }})</view>
<view class="enit_but" @click="isEdit = true" v-if="!isEdit" v-show="!isDataNull">编辑</view>
<view class="enit_but" @click="isEdit = false" v-else v-show="isDataNull">取消</view>
<view
class="enit_but"
@click="isEdit = true"
v-if="!isEdit"
v-show="!isDataNull"
>编辑</view
>
<view
class="enit_but"
@click="isEdit = false"
v-else
v-show="isDataNull"
>取消</view
>
</view>
<!-- 购物车列表 -->
<up-loading-page :loading="listLoading"></up-loading-page>
<view class="shopping_cart_content">
<view v-if="!isDataNull" class="shopping_cart_content_item" v-for="(item, index) in shoppingList"
:key="item.id">
<view
v-if="!isDataNull"
class="shopping_cart_content_item"
v-for="(item, index) in shoppingList"
:key="item.id"
>
<!-- 店铺头部 -->
<up-checkbox :customStyle="{ marginBottom: '8px' }" name="isCheck" usedAlone v-model:checked="item.isCheck"
shape="circle" activeColor="#7934F6" size="19" iconSize="18"
@change="(event) => shoppingChange(event, index)">
<up-checkbox
:customStyle="{ marginBottom: '8px' }"
name="isCheck"
usedAlone
v-model:checked="item.isCheck"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
@change="(event) => shoppingChange(event, index)"
>
<template #label>
<view class="content_item_header">
<up-image :src="item.shopLogo ? item.shopLogo : '/static/shopping/store.png'" width="22" height="22"
bgColor="#f1f6ff00" shape="circle"></up-image>
<view class="order_product_title">{{ item.shopName }}{{ item.id }}</view>
<up-image
:src="
item.shopLogo ? item.shopLogo : '/static/shopping/store.png'
"
width="22"
height="22"
bgColor="#f1f6ff00"
shape="circle"
></up-image>
<view class="order_product_title"
>{{ item.shopName }}{{ item.id }}</view
>
</view>
</template>
</up-checkbox>
<view>
<view class="content_item_info" v-for="(pItem, pIndex) in item.product" :key="pItem.id">
<view
class="content_item_info"
v-for="(pItem, pIndex) in item.product"
:key="pItem.id"
>
<!-- 单个商品 -->
<up-checkbox :customStyle="{ marginBottom: '8px' }" name="isCheck" usedAlone
v-model:checked="pItem.isCheck" shape="circle" activeColor="#7934F6" size="19" iconSize="18"
<up-checkbox
:customStyle="{ marginBottom: '8px' }"
name="isCheck"
usedAlone
v-model:checked="pItem.isCheck"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
:disabled="!isEdit && [1, 2].includes(pItem.goodsStatus)"
@change="(event) => productChange(event, index, pIndex)">
@change="(event) => productChange(event, index, pIndex)"
>
</up-checkbox>
<view class="info_item">
<up-image :src="pItem.mainGraph" width="100" height="100" bgColor="#f1f6ff00"
@click="jumpInfo(pItem)"></up-image>
<up-image
:src="pItem.mainGraph"
width="100"
height="100"
bgColor="#f1f6ff00"
@click="jumpInfo(pItem)"
></up-image>
<view class="content_info">
<view class="shopping_content_info_title" @click="jumpInfo(pItem)">{{ pItem.name }}</view>
<view
class="shopping_content_info_title"
@click="jumpInfo(pItem)"
>{{ pItem.name }}</view
>
<view class="content_info_description">
{{ pItem.goodsSpece }}
</view>
<view class="shopping_info_amount">
<view>
<view style="color: #7934F6;">
<text style="font-size: 22rpx;">¥</text>
<text style="font-size: 32rpx;">{{ pItem.unitPrice }}</text>
<view style="color: #7934f6">
<text style="font-size: 22rpx">¥</text>
<text style="font-size: 32rpx">{{
pItem.unitPrice
}}</text>
</view>
<view class="shopping_info_amount_original">¥{{ pItem.unitPrice }}</view>
<view class="shopping_info_amount_original"
>¥{{ pItem.unitPrice }}</view
>
</view>
<view>
<view class="shopping_info_quantity">
<view class="quantity_but" @click="quantityFun('minus', index, pIndex, pItem.id)">-</view>
<view
class="quantity_but"
@click="quantityFun('minus', index, pIndex, pItem.id)"
>-</view
>
<view class="quantity_value">{{ pItem.buyNum }}</view>
<view class="quantity_but" @click="quantityFun('add', index, pIndex, pItem.id)">+</view>
<view
class="quantity_but"
@click="quantityFun('add', index, pIndex, pItem.id)"
>+</view
>
</view>
<view v-if="[1].includes(pItem.goodsStatus)" class="insufficient_stock">库存不足</view>
<view v-if="[2].includes(pItem.goodsStatus)" class="insufficient_stock">商品已下架</view>
<view
v-if="[1].includes(pItem.goodsStatus)"
class="insufficient_stock"
>库存不足</view
>
<view
v-if="[2].includes(pItem.goodsStatus)"
class="insufficient_stock"
>商品已下架</view
>
</view>
</view>
</view>
@@ -65,8 +144,12 @@
</view>
</view>
<view v-else class="not_order_warp">
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/not_shopping.png" width="80" height="80"
bgColor="#f1f6ff00"></up-image>
<up-image
src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/not_shopping.png"
width="80"
height="80"
bgColor="#f1f6ff00"
></up-image>
<view class="not_order_msg_warp">购物车是空的</view>
</view>
<choiceness />
@@ -76,15 +159,27 @@
<view class="shopping_cart_but">
<!-- 全选 -->
<view class="shopping_cart_but_total">
<up-checkbox name="isAll" usedAlone v-model:checked="isAll" shape="circle" activeColor="#7934F6" size="19"
iconSize="18" @change="isAllChange">
<up-checkbox
name="isAll"
usedAlone
v-model:checked="isAll"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
@change="isAllChange"
>
<template #label>
<text style="font-size: 26rpx;color: #444444;">全选</text>
<text style="font-size: 26rpx; color: #444444">全选</text>
</template>
</up-checkbox>
<text style="margin-left: 20rpx;font-size: 24rpx;color: #444444;" v-if="!isEdit">合计:</text>
<text style="font-size: 24rpx;" v-if="!isEdit">¥</text>
<text style="font-size: 32rpx;" v-if="!isEdit">{{ total }}</text>
<text
style="margin-left: 20rpx; font-size: 24rpx; color: #444444"
v-if="!isEdit"
>合计:</text
>
<text style="font-size: 24rpx" v-if="!isEdit">¥</text>
<text style="font-size: 32rpx" v-if="!isEdit">{{ total }}</text>
</view>
<view v-if="isEdit" class="delete_but_css" @click="deleteShopping">
删除({{ count }})
@@ -101,15 +196,13 @@
<!-- #ifndef H5 -->
<CustomTabBar :tabIndex="3" />
<!-- #endif -->
</view>
</template>
<script>
import choiceness from '@/components/choiceness/choiceness.vue';
import { getCartList, updateGoodsNum, removeGoods } from '@/api/cart.js';
import CustomTabBar from '@/components/custom-tab-bar.vue';
import choiceness from "@/components/choiceness/choiceness.vue";
import { getCartList, updateGoodsNum, removeGoods } from "@/api/cart.js";
import CustomTabBar from "@/components/custom-tab-bar.vue";
export default {
components: { choiceness, CustomTabBar },
@@ -124,19 +217,21 @@ export default {
total: 0, // 总合计的金额
count: 0, // 总条数
listLoading: false,
}
platformType: true,
};
},
onShow() {
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
animation: false,
});
const appUpdate = uni.getStorageSync("platform");
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
/*#endif*/
this.getCartList();
},
onLoad() {
},
onLoad() {},
methods: {
/**
* 查询购物车列表
@@ -146,7 +241,7 @@ export default {
let result = [];
const resp = await getCartList();
if (resp && resp.bizcode === 100) {
const data = resp.data || []
const data = resp.data || [];
if (data && data.length !== 0) {
// 处理了后的数据
result = this.transformedArray(data);
@@ -165,8 +260,11 @@ export default {
if (!originalArray || originalArray.length === 0) {
return newOriginalArray;
}
originalArray.map(curr => {
const existingShop = newOriginalArray.find(shop => shop.shopId === curr.shopId && shop.shopName === curr.shopName);
originalArray.map((curr) => {
const existingShop = newOriginalArray.find(
(shop) =>
shop.shopId === curr.shopId && shop.shopName === curr.shopName
);
if (existingShop) {
// 如果商店已存在,则向 productObj 数组中添加新产品对象
existingShop.product.push({
@@ -189,7 +287,8 @@ export default {
shopName: curr.shopName,
name: curr.name,
shopLogo: curr.shopLogo,
product: [{
product: [
{
id: curr.id,
goodsId: curr.goodsId, // 商品ID
name: curr.name, // 商品名称
@@ -200,10 +299,11 @@ export default {
specsId: curr.specsId, // 规格Id
isCheck: false, // 用作于全选
goodsStatus: curr.goodsStatus, //商品状态:0-可下单,1-库存不够,2-商品已下架
}]
},
],
});
}
})
});
return newOriginalArray;
},
/**
@@ -224,7 +324,7 @@ export default {
if (type === "minus") {
if (currentQuantity === 1) {
this.$refs.uToastRef.show({
type: 'warring',
type: "warring",
message: "宝贝数量不能在减少啦~",
});
return;
@@ -242,7 +342,7 @@ export default {
const params = {
id,
goodsNum: currentQuantity,
}
};
const result = await updateGoodsNum(params);
if (result && result.bizcode === 100) {
this.shoppingList[index].product[pIndex].buyNum = currentQuantity;
@@ -259,14 +359,16 @@ export default {
const deleteId = this.getCheckList();
if (!deleteId || deleteId.length === 0) {
this.$refs.uToastRef.show({
type: 'warring',
type: "warring",
message: "请先选择需要结算的商品",
});
return;
}
uni.navigateTo({
url: "/pages/order_package/order_submit/order_submit?ids=" + deleteId.join(","),
})
url:
"/pages/order_package/order_submit/order_submit?ids=" +
deleteId.join(","),
});
this.isAll = false;
},
/**
@@ -275,13 +377,14 @@ export default {
deleteShopping() {
const then = this;
uni.showModal({
title: '提示',
content: '您确定要删除选中的(' + this.getCheckList().length + '件)商品吗?',
title: "提示",
content:
"您确定要删除选中的(" + this.getCheckList().length + "件)商品吗?",
success: function (res) {
if (res.confirm) {
then.deleteShoppingFun();
}
}
},
});
},
// 删除选中的
@@ -289,43 +392,42 @@ export default {
const deleteId = this.getCheckList();
if (!deleteId || deleteId.length === 0) {
this.$refs.uToastRef.show({
type: 'warring',
type: "warring",
message: "请先选择需要删除的商品",
});
return;
}
const params = {
ids: deleteId.join(","),
}
};
const result = await removeGoods(params);
if (result && result.bizcode === 100) {
this.isEdit = false;
this.$refs.uToastRef.show({
type: 'success',
type: "success",
message: "删除成功",
});
this.getCartList();
} else {
this.$refs.uToastRef.show({
type: 'error',
type: "error",
message: "删除失败",
});
}
},
// 获取选中的数据
getCheckList() {
const shoppingList = this.shoppingList;
const deleteId = [];
shoppingList.map(item => {
shoppingList.map((item) => {
if (item.product && item.product.length !== 0) {
item.product.map(pItem => {
item.product.map((pItem) => {
if (pItem.isCheck) {
deleteId.push(pItem.id);
}
})
});
}
})
});
return deleteId;
},
@@ -340,12 +442,12 @@ export default {
}
if (item.product && item.product.length !== 0) {
if (isAll) {
item.product.forEach(o => o.isCheck = true);
item.product.forEach((o) => (o.isCheck = true));
} else {
item.product.forEach(o => o.isCheck = false);
item.product.forEach((o) => (o.isCheck = false));
}
}
})
});
this.shoppingList = currentShoppingList;
if (isAll) {
this.checkIsAll();
@@ -361,8 +463,8 @@ export default {
*/
jumpInfo(item) {
uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id=' + item.goodsId,
})
url: "/pages/other_package/productInfo/productInfo?id=" + item.goodsId,
});
},
// 单个产品的单选按钮选中与取消选中
@@ -376,9 +478,9 @@ export default {
shoppingChange(isAll, index) {
const data = this.shoppingList[index];
if (isAll) {
data.product.forEach(o => o.isCheck = true);
data.product.forEach((o) => (o.isCheck = true));
} else {
data.product.forEach(o => o.isCheck = false);
data.product.forEach((o) => (o.isCheck = false));
}
this.shoppingList[index] = data;
setTimeout(() => {
@@ -390,29 +492,28 @@ export default {
* 检查是否全选
*/
checkIsAll() {
let total = 0;
let count = 0;
const shoppingList = this.shoppingList;
if (shoppingList && shoppingList.length !== 0) {
let sumFlag = false;
shoppingList.map(item => {
shoppingList.map((item) => {
let flag = true;
item.product.map(oItem => {
item.product.map((oItem) => {
if (oItem.isCheck) {
total = total + oItem.buyNum * oItem.unitPrice;
count = count + oItem.buyNum;
} else {
flag = false;
}
})
});
if (flag) {
item.isCheck = true;
sumFlag = true;
} else {
item.isCheck = false;
}
})
});
this.shoppingList = shoppingList;
this.isAll = sumFlag;
// 删除不需要显示价格
@@ -422,18 +523,32 @@ export default {
this.count = count;
}
},
}
}
},
};
</script>
<style lang="scss" scoped>
.shopping_cart_warp {
// height: calc(100vh - 256rpx);
background-color: $app-bj;
padding: 104rpx 30rpx 30rpx;
overflow: hidden;
&.isDataNull-calss {
height: calc(100vh - 100rpx - env(safe-area-inset-bottom));
}
&.isDataNull-active {
height: calc(100vh - 100rpx - env(safe-area-inset-bottom) - 100rpx);
}
&.iosplatformType {
height: calc(100vh - 100rpx - 50rpx) !important;
.shopping_cart_content {
height: calc(100vh - 104rpx - 30rpx - 30rpx - 100rpx - 10rpx) !important;
}
.shopping_cart_but{
bottom: 90rpx !important;
}
}
}
.shopping_cart_header {
@@ -454,11 +569,14 @@ export default {
.shopping_cart_content {
margin-top: 30rpx;
height: calc(100vh - 456rpx);
height: calc(
100vh - 104rpx - 30rpx - 30rpx - 100rpx - env(safe-area-inset-bottom) -
10rpx
);
overflow-y: auto;
.shopping_cart_content_item {
background-color: #FFFFFF;
background-color: #ffffff;
border-radius: 30rpx;
padding: 30rpx;
margin-bottom: 20rpx;
@@ -502,13 +620,12 @@ export default {
.insufficient_stock {
text-align: center;
color: #9E9E9E;
color: #9e9e9e;
font-size: 22rpx;
margin-top: 4rpx;
}
}
.content_item_info {
display: flex;
}
@@ -516,15 +633,15 @@ export default {
.shopping_cart_but {
position: fixed;
bottom: 140rpx;
bottom: calc(90rpx + env(safe-area-inset-bottom));
left: 0;
width: calc(100% - 40rpx);
background: #FFFFFF;
box-shadow: 0rpx -1rpx 0rpx 0rpx #EEEEEE;
background: #ffffff;
box-shadow: 0rpx -1rpx 0rpx 0rpx #eeeeee;
height: 84rpx;
display: flex;
justify-content: space-between;
padding: 20rpx;
padding: 20rpx 20rpx 15rpx;
align-items: center;
.shopping_cart_but_total {
+108 -46
View File
@@ -1,10 +1,16 @@
<template>
<view class="sort_warp">
<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
: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>
@@ -14,44 +20,80 @@
</view> -->
</view>
<!-- 搜索 -->
<view style="width: 200rpx;" @click="jumpSearch">
<up-search shape="square" bgColor="#EEEEEEFF" color="#666666FF" :showAction="false"
placeholder="搜索"></up-search>
<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)">
<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;">
<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="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="">
<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_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>
@@ -61,14 +103,13 @@
<!-- #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 },
@@ -83,19 +124,22 @@ export default {
tabbarList: [], // 左侧的主分类
tabbarContentList: [], // 右侧内容的分类
tabbarContentLoading: false,
}
platformType: true,
};
},
onShow() {
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
animation: false,
});
const appUpdate = uni.getStorageSync("platform");
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
/*#endif*/
const then = this;
this.getSort(0).then(resp => {
this.getSort(0).then((resp) => {
if (resp && resp.length !== 0) {
this.tabbarList = resp;
const sortId = uni.getStorageSync('sortId');
const sortId = uni.getStorageSync("sortId");
// 如果有默认的参数就默认选中参数
if (sortId && sortId !== 0) {
let fData = {};
@@ -106,7 +150,7 @@ export default {
currentIndex = index;
return;
}
})
});
this.swichMenu(fData, currentIndex);
} else {
const fData = resp[0];
@@ -125,34 +169,33 @@ export default {
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) : [];
this.bannerList =
data.length !== 0 ? data.map((obj) => obj.carouselImage) : [];
}
},
jumpSearch(item) {
uni.navigateTo({
url: '/pages/rwa_package/dongjian/search',
})
url: "/pages/rwa_package/dongjian/search",
});
},
jumpInfo(item) {
console.log(item,'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}`
})
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;
@@ -175,11 +218,14 @@ export default {
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');
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.scrollTop =
index * this.menuItemHeight +
this.menuItemHeight / 2 -
this.menuHeight / 2;
this.tabbarContentLoading = false;
},
@@ -187,7 +233,9 @@ export default {
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this);
query.select('.' + elClass).fields({ size: true }, res => {
query
.select("." + elClass)
.fields({ size: true }, (res) => {
// 如果节点尚未生成,res值为null,循环调用执行
if (!res) {
setTimeout(() => {
@@ -196,17 +244,26 @@ export default {
return;
}
this[dataVal] = res.height;
}).exec();
})
.exec();
});
},
},
}
};
</script>
<style lang="scss" scoped>
.sort_warp {
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 {
@@ -228,7 +285,7 @@ export default {
.category_item_sel {
font-size: 44rpx;
color: #1A1A1A;
color: #1a1a1a;
}
.category_item_sel_but {
@@ -241,7 +298,8 @@ export default {
}
}
.sort_content {}
.sort_content {
}
.u-menu-wrap {
flex: 1;
@@ -306,6 +364,7 @@ export default {
}
.right-box {
padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
background-color: rgb(250, 250, 250);
}
@@ -318,6 +377,9 @@ export default {
background-color: #fff;
padding: 16rpx;
border-radius: 8rpx;
&:last-child {
margin-bottom: 0;
}
}
.item-title {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB