Merge branch 'develop' into dongjian

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