增接分类管理

This commit is contained in:
qijq 2025-07-15 22:55:19 +08:00
parent d8c90bd3a1
commit 3e41a5450f
19 changed files with 2714 additions and 65 deletions

View File

@ -14,14 +14,15 @@ import config from "../config/config";
* status: 1, 1-进行中2-超时的订单3-退款的订单
* }
* @returns { }
* @see https://mall.gpxscs.cn/mobile/shop/userOrder/mch/order/list
* @see https://mall.gpxscs.cn/admin/shop/shop-order-base/mch/order/list
*/
export function GetOrderList(params) {
return http({
url: "/shop/userOrder/mch/order/list",
url: "/shop/shop-order-base/mch/order/list",
method: "post",
data: params,
baseURL: config.adminApi,
});
}

View File

@ -0,0 +1,52 @@
import http from "../../utils/http";
import config from "../../config/config";
/**
*
* @author Seven
* @data 2025-7-11
* @returns { }
* @see https://mall.gpxscs.cn/api/admin/shop/shop-base-product-category/list
*/
export function GetCommodityClassify() {
return http({
url: "/shop/shop-base-product-category/list",
method: "get",
baseURL: config.adminApi,
});
}
/**
*
* @author Seven
* @data 2025-7-13
* @returns { }
* @see https://mall.gpxscs.cn/api/admin/shop/shop-base-product-category/edit
*/
export function UpdateCommodityClassify(params) {
return http({
url: "/shop/shop-base-product-category/edit",
method: "post",
params,
baseURL: config.adminApi,
});
}
/**
*
* @author Seven
* @data 2025-7-13
* @returns { category_id }
* @see https://mall.gpxscs.cn/api/admin/shop/shop-base-product-category/delete
*/
export function DelectCommodityClassify(params) {
return http({
url: "/shop/shop-base-product-category/delete",
method: "post",
params,
baseURL: config.adminApi,
});
}

View File

@ -70,3 +70,21 @@ export function DelectCommodity(params) {
baseURL: config.adminApi,
});
}
/**
*
* @author Seven
* @data 2025-7-6
* @param { product_id }
* @returns { }
* @see https://mall.gpxscs.cn/api/admin/shop/shop-product-item/items?product_id=23591&source_lang=zh_CN
*/
export function GetCommoditSpecification(params) {
return http({
url: "/shop/shop-product-item/items",
method: "post",
params,
baseURL: config.adminApi,
});
}

View File

@ -0,0 +1,23 @@
import http from "../../utils/http";
import config from "../../config/config";
/**
*
* @author Seven
* @data 2025-7-12
* @params {
* pageNum
* pageSize
* }
* @returns { }
* @see https://mall.gpxscs.cn/api/admin/shop/shop-base-product-type/list
*/
export function GetTypeManageList(params) {
return http({
url: "/shop/shop-base-product-type/list",
method: "get",
params,
baseURL: config.adminApi,
});
}

View File

@ -573,7 +573,7 @@ export default {
height: 0, //scroll-view
top: 0,
currentTab: 0, //
current: -1, //
current: 0, //
scrollViewId: "id_0",
commodityStatusList: [
{
@ -638,19 +638,7 @@ export default {
showRightPopup: false,
};
},
computed: {
hasCheckboxValue() {
// checkboxList
const check = (items) => {
for (const item of items) {
if (item.checkboxList?.length > 0) return true;
if (item.children?.length > 0 && check(item.children)) return true;
}
return false;
};
return check(this.tabbar);
},
},
computed: {},
onLoad: function (options) {
setTimeout(() => {
uni.getSystemInfo({
@ -727,9 +715,8 @@ export default {
// tabbar
this.tabbar = resetCheckboxLists(res.data);
console.log(this.tabbar);
if (this.tabbar.length > 0) {
if (this.tabbar[0].children.length) {
if (this.tabbar[0].children.length > 0) {
this.current = 0; //
this.currentTab = this.tabbar[0].children[0].id;
this.currCategoryId = this.tabbar[0].children[0].id;
@ -980,7 +967,6 @@ export default {
let index = e.index;
// -1 ==
const oldCategoryId = this.currCategoryId;
this.current = this.current == index ? -1 : e.index;
// current
@ -1318,9 +1304,14 @@ export default {
if (res && res.status == 200) {
uni.$u.toast("操作成功");
this.commodityList = this.commodityList.filter(
(item) => !productIds.includes(item.product_id)
);
await this.updateCommodityStatistics();
this.clearCheckboxLists(this.tabbar);
this.selectCommodityList = [];
}

View File

@ -460,8 +460,8 @@ export default {
this.checkboxAllList = [];
if (this.isNoDownCommodityData) return;
this.loadingDownCommodityData = true;
this.pageNum = this.pageNum + 1;
this.time = setTimeout(() => {
this.pageNum = this.pageNum + 1;
this.getProductList();
}, 500);
},
@ -791,6 +791,12 @@ export default {
}
}
.commodity-type-popup {
.commodity-type-popup-content {
height: 500px;
}
}
.no-data {
.no-data-bg {
margin: 60% auto;

View File

@ -0,0 +1,187 @@
<template>
<view class="tui-collapse" :style="{ backgroundColor: bgColor }">
<view
class="tui-collapse-head"
:style="{ backgroundColor: hdBgColor }"
@tap.stop="handleClick"
>
<view class="tui-header" :class="{ 'tui-opacity': disabled }">
<view
class="tui-collapse-icon tui-icon-arrow"
:class="{ 'tui-icon-active': isOpen }"
:style="{ color: arrowColor }"
v-if="arrow"
></view>
<slot name="title"></slot>
</view>
</view>
<view
v-if="arrow"
class="tui-collapse-body_box"
:style="{ backgroundColor: bdBgColor, height: isOpen ? height : '0rpx' }"
>
<view
class="tui-collapse-body"
:class="{
'tui-collapse-transform': height == 'auto',
'tui-collapse-body_show': isOpen && height == 'auto',
}"
>
<slot name="content"></slot>
</view>
</view>
</view>
</template>
<script>
export default {
name: "tuiCollapse",
emits: ["click"],
props: {
//collapse
bgColor: {
type: String,
default: "transparent",
},
//collapse-head
hdBgColor: {
type: String,
default: "#fff",
},
//collapse-body
bdBgColor: {
type: String,
default: "transparent",
},
//collapse-body open使
height: {
type: String,
default: "auto",
},
//
index: {
type: Number,
default: 0,
},
//index==current
current: {
type: Number,
default: -1,
},
//
disabled: {
type: [Boolean, String],
default: false,
},
//
arrow: {
type: [Boolean, String],
default: true,
},
//
arrowColor: {
type: String,
default: "#333",
},
},
watch: {
current() {
this.updateCurrentChange();
},
},
created() {
this.updateCurrentChange();
},
data() {
return {
isOpen: false,
};
},
methods: {
updateCurrentChange() {
this.isOpen = this.index == this.current;
},
handleClick() {
if (this.disabled) return;
this.$emit("click", {
index: Number(this.index),
});
},
},
};
</script>
<style scoped>
@font-face {
font-family: "tuiCollapse";
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQ4AA0AAAAABlgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEHAAAABoAAAAciRx3B0dERUYAAAP8AAAAHgAAAB4AKQAKT1MvMgAAAaAAAABCAAAAVjxuR/JjbWFwAAAB9AAAAD4AAAFCAA/pq2dhc3AAAAP0AAAACAAAAAj//wADZ2x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HD5jWQh5v91OxCCKXYY/k9hxGQAAAHjaY2BigAAuMMnIgA5YwKJMjExciUVF+eW6KfnleQAZ0wQyAAAAAAH//wACAAEAAAAMAAAAFgAAAAIAAQADAAMAAQAEAAAAAgAAAAB42mNgYGBkAIKrS9Q5QPTNPer/YTQAQ+0HIAAA)
format("woff");
font-weight: normal;
font-style: normal;
}
.tui-collapse-icon {
font-family: "tuiCollapse" !important;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.tui-icon-arrow:before {
content: "\e600";
}
.tui-icon-arrow {
font-size: 20rpx;
transform: rotate(267deg);
transform-origin: center center;
transition: all 0.3s;
position: absolute;
top: 12%;
left: 0;
z-index: 9;
}
.tui-arrow-padding {
padding-right: 62rpx;
box-sizing: border-box;
}
.tui-icon-active {
transform: rotate(360deg);
transform-origin: center center;
}
.tui-header {
position: relative;
z-index: 2;
}
.tui-collapse-body_box {
transition: all 0.25s;
overflow: hidden;
}
.tui-collapse-body {
transition: all 0.25s;
overflow: hidden;
position: relative;
z-index: 1;
}
.tui-collapse-transform {
opacity: 0;
visibility: hidden;
-webkit-transform: translateY(-40%);
transform: translateY(-40%);
}
.tui-collapse-body_show {
opacity: 1;
visibility: visible;
-webkit-transform: translateY(0);
transform: translateY(0);
}
.tui-opacity {
opacity: 0.6;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -142,6 +142,7 @@
</view>
<view class="commodity-btn-content">
<u-button
@click="handerShowPricePopup(item)"
class="commodity-btn-item"
:hairline="true"
:plain="true"
@ -220,6 +221,67 @@
<view class="bottom-item-name">商品新建</view>
</view>
</view>
<u-popup
class="productList-price-popup"
:show="showBottomPopup"
mode="bottom"
:closeable="true"
zIndex="10075"
@close="handerClosePopup"
>
<view
class="productList-price-popup-content"
v-if="currSpecificationList.length > 0"
>
<view class="productList-price-popup-title">价格/库存修改</view>
<view class="select-commodity-price-list">
<scroll-view
scroll-y
class="select-commodity-list-price-scroll-view"
:show-scrollbar="false"
:style="{
maxHeight: currSpecificationList.length >= 2 ? '500px' : 'none',
overflowY: currSpecificationList.length >= 2 ? 'auto' : 'visible',
}"
>
<view
class="commodity-item"
v-for="(item, index) of currSpecificationList"
:key="index"
>
<view class="commodity-info">
<view class="commodity-info-box">
<!-- <view class="commodity-name">
{{ item.product_name }}
</view> -->
<!-- <view class="commodity-price">
<u--input
placeholder="请输入内容"
border="surround"
v-model="value"
@change="change"
></u--input>
</view>
<view class="commodity-inventory">
库存{{ item.itemQuantity }}
</view> -->
</view>
</view>
<!-- <view
class="icon-content"
@click="delectSelectCommodity(item, index)"
>
<u-icon
class="u-icon-jianhao"
custom-prefix="custom-icon-jianhao custom-icon"
size="20"
></u-icon>
</view> -->
</view>
</scroll-view>
</view>
</view>
</u-popup>
</view>
</template>
@ -228,6 +290,7 @@ import {
GetProductCategoryTree,
GetProductList,
UpdateProductPutaway,
GetCommoditSpecification,
} from "@/api/warehouse/productList";
import navBar from "@/components/uni-nav-bar/uni-nav-bar";
import tuiCollapse from "../manage/components/tui-collapse/tui-collapse.vue";
@ -306,6 +369,8 @@ export default {
isRefreshing: false,
time: null,
time2: null,
showBottomPopup: false,
currSpecificationList: [],
};
},
computed: {},
@ -353,6 +418,21 @@ export default {
this.scrollViewId = `id_0`;
}
},
handerClosePopup() {
this.showBottomPopup = false;
},
async handerShowPricePopup(item) {
let params = {
product_id: item.product_id,
};
let res = await GetCommoditSpecification(params);
if (res && res.status == 200) {
this.showBottomPopup = true;
this.currSpecificationList = res.data.items;
}
},
async getProductCategoryTree() {
let res = await GetProductCategoryTree();
if (res && res.status == 200) {
@ -966,6 +1046,107 @@ export default {
}
}
.productList-price-popup {
::v-deep.u-popup__content {
border-top-left-radius: 16rpx;
border-top-right-radius: 16rpx;
}
.productList-price-popup-content {
// width: 100%;
.productList-price-popup-title {
padding: 40rpx;
text-align: center;
font-weight: 500;
}
.select-commodity-price-list {
padding: 20rpx;
.commodity-item {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 40rpx;
padding: 0 40rpx;
.u-icon-jianhao {
::v-deep.u-icon__icon {
color: $base-color !important;
}
}
.commodity-info {
display: flex;
.commodity-img {
position: relative;
margin-right: 20rpx;
width: 60px;
height: 60px;
border: 1px solid #ebebeb;
border-radius: 16rpx;
}
.commodity-img-sold-out {
&::before {
position: absolute;
bottom: 0;
width: 100%;
height: 20px;
line-height: 20px;
content: "已下架";
text-align: center;
background: rgba(0, 0, 0, 0.6);
color: #fff;
z-index: 99;
font-size: 14px;
border-bottom-left-radius: 16rpx;
border-bottom-right-radius: 16rpx;
}
}
.commodity-info-box {
display: flex;
flex-flow: column;
justify-content: space-between;
.commodity-name {
font-weight: bold;
font-size: 34rpx;
word-break: break-all; /* 允许在任意字符间断行 */
overflow-wrap: break-word; /* 优先在单词间断行 */
display: -webkit-box;
-webkit-line-clamp: 2; /* 限制最多2行 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.commodity-inventory {
margin: 6rpx 0;
font-size: 25rpx;
color: #626262;
}
.commodity-price {
font-size: 32rpx;
font-weight: bold;
color: #ea3938;
.currency {
margin-right: 4px;
font-size: 24rpx;
}
}
}
}
}
}
}
}
.commodity-loading {
margin: 70% auto;
display: flex;

View File

@ -2,47 +2,77 @@
<view class="warehouse-container">
<status-bar :backgroundColor="'#fff'" v-if="true"></status-bar>
<view class="shop-name">{{ dashboardInfo.store_info.store_name }}</view>
<view class="warehouse-list">
<view class="warehouse-item" @click="skipu('productList')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/brand-2.png"
:width="44"
:height="44"
></u--image>
<view class="warehouse-content">
<view class="warehouse-list">
<view class="warehouse-item" @click="skipu('productList')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/brand-2.png"
:width="44"
:height="44"
></u--image>
</view>
<view class="warehouse-item-name">商品管理</view>
</view>
<view class="warehouse-item-name">商品管理</view>
</view>
<view class="warehouse-item" @click="skipu('brandList')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/brand-3.png"
:width="44"
:height="44"
></u--image>
<view class="warehouse-item" @click="skipu('productList')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/specification.png"
:width="44"
:height="44"
></u--image>
</view>
<view class="warehouse-item-name">规格管理</view>
</view>
<view class="warehouse-item-name">品牌管理</view>
</view>
<view class="warehouse-item" @click="skipu('photoGallery')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/classify.png"
:width="44"
:height="44"
></u--image>
<view
class="warehouse-item warehouse-item-2"
@click="skipu('brandList')"
>
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/commodity-type.png"
:width="44"
:height="44"
></u--image>
</view>
<view class="warehouse-item-name">类型管理</view>
</view>
<view class="warehouse-item-name">分类管理</view>
</view>
<view class="warehouse-item" @click="skipu('classifyList')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/photo-gallery-1.png"
:width="44"
:height="44"
></u--image>
<view class="warehouse-item" @click="skipu('classifyList')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/classify.png"
:width="44"
:height="44"
></u--image>
</view>
<view class="warehouse-item-name">分类管理</view>
</view>
<view class="warehouse-item-name">商品图库</view>
</view>
<!-- <view class="warehouse-list warehouse-list-2">
<view class="warehouse-item" @click="skipu('brandList')">
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/brand-3.png"
:width="44"
:height="44"
></u--image>
</view>
<view class="warehouse-item-name">品牌管理</view>
</view>
<view
class="warehouse-item warehouse-item-2"
@click="skipu('photoGallery')"
>
<view class="warehouse-item-img">
<u--image
src="../../static/warehouse/photo-gallery-1.png"
:width="44"
:height="44"
></u--image>
</view>
<view class="warehouse-item-name">商品图库</view>
</view>
</view> -->
</view>
<tabbar tabbarName="warehouse"></tabbar>
</view>
@ -105,23 +135,35 @@ export default {
background: #fff;
}
.warehouse-list {
display: flex;
align-items: center;
justify-content: space-between;
.warehouse-content {
margin: 10px;
padding: 20px;
border-radius: 24rpx;
background: #fff;
box-shadow: 0 12rpx 16rpx 0 rgba(0, 0, 0, 0.1);
border-radius: 24rpx;
.warehouse-item {
.warehouse-list {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-between;
.warehouse-item-img {
margin-bottom: 20rpx;
.warehouse-item {
display: flex;
flex-flow: column;
align-items: center;
.warehouse-item-img {
margin-bottom: 20rpx;
}
}
}
.warehouse-list-2 {
margin-top: 40rpx;
justify-content: flex-start;
.warehouse-item-2 {
margin-left: 48rpx;
}
}
}

View File

@ -21,6 +21,10 @@
-moz-osx-font-smoothing: grayscale;
}
.custom-icon-jiahao:before {
content: "\e640";
}
.custom-icon-jianhao:before {
content: "\e664";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB