优化细节
This commit is contained in:
@@ -1,47 +1,47 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="product-list-page">
|
||||
<!-- 1. 搜索表单 -->
|
||||
<!-- 1. 鎼滅储琛ㄥ崟 -->
|
||||
<view class="search-card">
|
||||
<view class="search-row">
|
||||
<view class="search-item">
|
||||
<text class="label">商品搜索:</text>
|
||||
<input class="mock-input" placeholder="请输入商品名称/关键字/ID" />
|
||||
<text class="label">鍟嗗搧鎼滅储锛?/text>
|
||||
<input class="mock-input" placeholder="璇疯緭鍏ュ晢鍝佸悕绉?鍏抽敭瀛?ID" />
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<text class="label">商品类型:</text>
|
||||
<text class="label">鍟嗗搧绫诲瀷锛?/text>
|
||||
<view class="mock-select">
|
||||
<text>全部</text>
|
||||
<text class="arrow">▼</text>
|
||||
<text>鍏ㄩ儴</text>
|
||||
<text class="arrow">鈻?/text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<text class="label">商品分类:</text>
|
||||
<text class="label">鍟嗗搧鍒嗙被锛?/text>
|
||||
<view class="mock-select">
|
||||
<text>请选择</text>
|
||||
<text class="arrow">▼</text>
|
||||
<text>璇烽€夋嫨</text>
|
||||
<text class="arrow">鈻?/text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-btns">
|
||||
<button class="btn-primary">查询</button>
|
||||
<button class="btn-reset">重置</button>
|
||||
<button class="btn-primary">鏌ヨ</button>
|
||||
<button class="btn-reset">閲嶇疆</button>
|
||||
<view class="expand-control">
|
||||
<text class="expand-txt">展开</text>
|
||||
<text class="expand-arrow">▼</text>
|
||||
<text class="expand-txt">灞曞紑</text>
|
||||
<text class="expand-arrow">鈻?/text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-row mt-12">
|
||||
<view class="search-item">
|
||||
<text class="label">配送方式:</text>
|
||||
<text class="label">閰嶉€佹柟寮忥細</text>
|
||||
<view class="mock-select">
|
||||
<text>全部</text>
|
||||
<text class="arrow">▼</text>
|
||||
<text>鍏ㄩ儴</text>
|
||||
<text class="arrow">鈻?/text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 2. 商品状态 Tabs -->
|
||||
<!-- 2. 鍟嗗搧鐘舵€?Tabs -->
|
||||
<view class="status-tabs-wrap">
|
||||
<view class="status-tabs">
|
||||
<view
|
||||
@@ -56,46 +56,46 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 3. 操作按钮行 -->
|
||||
<!-- 3. 鎿嶄綔鎸夐挳琛?-->
|
||||
<view class="action-bar">
|
||||
<view class="left-actions">
|
||||
<button class="btn-add" @click="goEdit(null)">添加商品</button>
|
||||
<button class="btn-collect">商品采集</button>
|
||||
<button class="btn-add" @click="goEdit(null)">娣诲姞鍟嗗搧</button>
|
||||
<button class="btn-collect">鍟嗗搧閲囬泦</button>
|
||||
<view class="btn-dropdown">
|
||||
<text>批量修改</text>
|
||||
<text class="arrow">▼</text>
|
||||
<text>鎵归噺淇敼</text>
|
||||
<text class="arrow">鈻?/text>
|
||||
</view>
|
||||
<view class="btn-dropdown">
|
||||
<text>商品迁移</text>
|
||||
<text class="arrow">▼</text>
|
||||
<text>鍟嗗搧杩佺Щ</text>
|
||||
<text class="arrow">鈻?/text>
|
||||
</view>
|
||||
<button class="btn-export">数据导出</button>
|
||||
<button class="btn-export">鏁版嵁瀵煎嚭</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 4. 商品列表表格 -->
|
||||
<!-- 4. 鍟嗗搧鍒楄〃琛ㄦ牸 -->
|
||||
<view class="list-card">
|
||||
<view class="table-v5">
|
||||
<view class="th-row">
|
||||
<view class="th col-check"><text>□</text></view>
|
||||
<view class="th col-id"><text>商品ID</text></view>
|
||||
<view class="th col-img"><text>商品图</text></view>
|
||||
<view class="th col-name"><text>商品名称</text></view>
|
||||
<view class="th col-activity"><text>参与活动</text></view>
|
||||
<view class="th col-type"><text>商品类型</text></view>
|
||||
<view class="th col-price"><text>商品售价</text></view>
|
||||
<view class="th col-sales"><text>销量</text></view>
|
||||
<view class="th col-stock"><text>库存</text></view>
|
||||
<view class="th col-sort"><text>排序</text></view>
|
||||
<view class="th col-status"><text>状态</text></view>
|
||||
<view class="th col-op"><text>操作</text></view>
|
||||
<view class="th col-check"><text>鈻?/text></view>
|
||||
<view class="th col-id"><text>鍟嗗搧ID</text></view>
|
||||
<view class="th col-img"><text>鍟嗗搧鍥?/text></view>
|
||||
<view class="th col-name"><text>鍟嗗搧鍚嶇О</text></view>
|
||||
<view class="th col-activity"><text>鍙備笌娲诲姩</text></view>
|
||||
<view class="th col-type"><text>鍟嗗搧绫诲瀷</text></view>
|
||||
<view class="th col-price"><text>鍟嗗搧鍞环</text></view>
|
||||
<view class="th col-sales"><text>閿€閲?/text></view>
|
||||
<view class="th col-stock"><text>搴撳瓨</text></view>
|
||||
<view class="th col-sort"><text>鎺掑簭</text></view>
|
||||
<view class="th col-status"><text>鐘舵€?/text></view>
|
||||
<view class="th col-op"><text>鎿嶄綔</text></view>
|
||||
</view>
|
||||
|
||||
<view v-for="(item, index) in productList" :key="index"
|
||||
class="tr-row"
|
||||
:style="{ zIndex: activeDropdownId === item.id ? 1000 : 1 }"
|
||||
>
|
||||
<view class="td col-check"><text>□</text></view>
|
||||
<view class="td col-check"><text>鈻?/text></view>
|
||||
<view class="td col-id"><text>{{ item.id }}</text></view>
|
||||
<view class="td col-img">
|
||||
<image class="p-img" :src="item.image" mode="aspectFill" />
|
||||
@@ -116,28 +116,28 @@
|
||||
<view class="td col-sort"><text>{{ item.sort }}</text></view>
|
||||
<view class="td col-status">
|
||||
<view class="mock-switch" :class="{ on: item.status === 1 }">
|
||||
<text class="switch-txt">{{ item.status === 1 ? '上架' : '下架' }}</text>
|
||||
<text class="switch-txt">{{ item.status === 1 ? '涓婃灦' : '涓嬫灦' }}</text>
|
||||
<view class="switch-dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="td col-op op-group">
|
||||
<text class="op-link" @click.stop="goEdit(item.id)">编辑</text>
|
||||
<text class="op-link" @click.stop="goEdit(item.id)">缂栬緫</text>
|
||||
<text class="op-divider">|</text>
|
||||
<view class="more-hover-box"
|
||||
@mouseenter="activeDropdownId = item.id"
|
||||
@mouseleave="activeDropdownId = null"
|
||||
>
|
||||
<view class="more-trigger-txt">
|
||||
<text class="more-link-text">更多</text>
|
||||
<text class="more-arrow-icon">∨</text>
|
||||
<text class="more-link-text">鏇村</text>
|
||||
<text class="more-arrow-icon">鈭?/text>
|
||||
</view>
|
||||
<view class="dropdown-list-container" v-show="activeDropdownId === item.id">
|
||||
<view class="dropdown-triangle"></view>
|
||||
<view class="dropdown-menu-body">
|
||||
<text class="menu-item" @click.stop="goReviews(item.id)">查看评论</text>
|
||||
<text class="menu-item" @click.stop="goMemberPrice(item.id)">会员价管理</text>
|
||||
<text class="menu-item" @click.stop="uni.showToast({title:'佣金管理开发中', icon:'none'})">佣金管理</text>
|
||||
<text class="menu-item danger-item" @click.stop="moveToRecycle(item.id)">{{ activeStatus === 'recycle' ? '恢复商品' : '移到回收站' }}</text>
|
||||
<text class="menu-item" @click.stop="goReviews(item.id)">鏌ョ湅璇勮</text>
|
||||
<text class="menu-item" @click.stop="goMemberPrice(item.id)">浼氬憳浠风鐞?/text>
|
||||
<text class="menu-item" @click.stop="uni.showToast({title:'浣i噾绠$悊寮€鍙戜腑', icon:'none'})">浣i噾绠$悊</text>
|
||||
<text class="menu-item danger-item" @click.stop="moveToRecycle(item.id)">{{ activeStatus === 'recycle' ? '鎭㈠鍟嗗搧' : '绉诲埌鍥炴敹绔? }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -145,9 +145,9 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 5. 分页 -->
|
||||
<!-- 5. 鍒嗛〉 -->
|
||||
<view class="pagination-row">
|
||||
<text class="total">共 {{ total }} 条</text>
|
||||
<text class="total">鍏?{{ total }} 鏉?/text>
|
||||
<view class="page-ctrl">
|
||||
<text class="page-btn disabled">{"<"}</text>
|
||||
<text class="page-num active">1</text>
|
||||
@@ -168,20 +168,20 @@ const activeStatus = ref('selling')
|
||||
const activeDropdownId = ref<number | null>(null)
|
||||
|
||||
const statusTabs = ref([
|
||||
{ key: 'selling', label: '出售中的商品', count: 49 },
|
||||
{ key: 'warehouse', label: '仓库中的商品', count: 4 },
|
||||
{ key: 'soldout', label: '已经售罄商品', count: 11 },
|
||||
{ key: 'alarm', label: '警戒库存商品', count: 27 },
|
||||
{ key: 'recycle', label: '回收站的商品', count: 176 },
|
||||
{ key: 'selling', label: '鍑哄敭涓殑鍟嗗搧', count: 49 },
|
||||
{ key: 'warehouse', label: '浠撳簱涓殑鍟嗗搧', count: 4 },
|
||||
{ key: 'soldout', label: '宸茬粡鍞絼鍟嗗搧', count: 11 },
|
||||
{ key: 'alarm', label: '璀︽垝搴撳瓨鍟嗗搧', count: 27 },
|
||||
{ key: 'recycle', label: '鍥炴敹绔欑殑鍟嗗搧', count: 176 },
|
||||
])
|
||||
|
||||
const productList = ref([
|
||||
{
|
||||
id: 963,
|
||||
image: 'https://img1.baidu.com/it/u=254065646,3100346083&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
|
||||
name: 'UR2024夏季新款女装复古纯欲氛围感一字肩短款T恤衫UWG440060',
|
||||
name: 'UR2024澶忓鏂版濂宠澶嶅彜绾姘涘洿鎰熶竴瀛楄偐鐭T鎭よ~UWG440060',
|
||||
activities: ['kj', 'pt'],
|
||||
typeName: '普通商品',
|
||||
typeName: '鏅€氬晢鍝?,
|
||||
price: '0.01',
|
||||
sales: 639,
|
||||
stock: 1602,
|
||||
@@ -191,9 +191,9 @@ const productList = ref([
|
||||
{
|
||||
id: 108,
|
||||
image: 'https://img2.baidu.com/it/u=3033501986,2204481084&fm=253&fmt=auto&app=138&f=JPEG?w=569&h=500',
|
||||
name: 'FOMIX 蛋壳椅 进口头层牛皮橙色单人沙发椅Egg chair设计师师单椅单沙头层牛皮/单椅',
|
||||
name: 'FOMIX 铔嬪3妞?杩涘彛澶村眰鐗涚毊姗欒壊鍗曚汉娌欏彂妞匛gg chair璁捐甯堝笀鍗曟鍗曟矙澶村眰鐗涚毊/鍗曟',
|
||||
activities: ['pt', 'ms'],
|
||||
typeName: '普通商品',
|
||||
typeName: '鏅€氬晢鍝?,
|
||||
price: '7580.00',
|
||||
sales: 14,
|
||||
stock: 16638,
|
||||
@@ -203,9 +203,9 @@ const productList = ref([
|
||||
{
|
||||
id: 48,
|
||||
image: 'https://img0.baidu.com/it/u=1762118431,3101886131&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
|
||||
name: '阿迪达斯官网 adidas BBALL CAP COT 男女训练运动帽子FQ5270 传奇墨水蓝/传奇墨水蓝/白 XL',
|
||||
name: '闃胯开杈炬柉瀹樼綉 adidas BBALL CAP COT 鐢峰コ璁粌杩愬姩甯藉瓙FQ5270 浼犲澧ㄦ按钃?浼犲澧ㄦ按钃?鐧?XL',
|
||||
activities: ['kj', 'pt', 'ms'],
|
||||
typeName: '普通商品',
|
||||
typeName: '鏅€氬晢鍝?,
|
||||
price: '100.00',
|
||||
sales: 841,
|
||||
stock: 2318,
|
||||
@@ -215,9 +215,9 @@ const productList = ref([
|
||||
])
|
||||
|
||||
function getActivityName(tag: string): string {
|
||||
if (tag === 'kj') return '砍价'
|
||||
if (tag === 'pt') return '拼团'
|
||||
if (tag === 'ms') return '秒杀'
|
||||
if (tag === 'kj') return '鐮嶄环'
|
||||
if (tag === 'pt') return '鎷煎洟'
|
||||
if (tag === 'ms') return '绉掓潃'
|
||||
return tag
|
||||
}
|
||||
|
||||
@@ -234,13 +234,13 @@ function goMemberPrice(id: number) {
|
||||
}
|
||||
|
||||
function moveToRecycle(id: number) {
|
||||
const action = activeStatus.value === 'recycle' ? '恢复' : '移到回收站';
|
||||
const action = activeStatus.value === 'recycle' ? '鎭㈠' : '绉诲埌鍥炴敹绔?;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `确认要将该商品${action}吗?`,
|
||||
title: '鎻愮ず',
|
||||
content: `纭瑕佸皢璇ュ晢鍝?{action}鍚楋紵`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showToast({ title: '操作成功', icon: 'success' });
|
||||
uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: 'success' });
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -249,9 +249,9 @@ function moveToRecycle(id: number) {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.product-list-page {
|
||||
padding: 20px;
|
||||
background-color: #f5f7f9;
|
||||
min-height: 100vh;
|
||||
/* padding removed */
|
||||
|
||||
|
||||
}
|
||||
|
||||
.search-card {
|
||||
@@ -457,7 +457,7 @@ function moveToRecycle(id: number) {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
pointer-events: none; /* 让事件透传给 more-hover-box */
|
||||
pointer-events: none; /* 璁╀簨浠堕€忎紶缁?more-hover-box */
|
||||
}
|
||||
|
||||
.more-link-text {
|
||||
@@ -476,7 +476,7 @@ function moveToRecycle(id: number) {
|
||||
top: 35px;
|
||||
right: -10px;
|
||||
width: 120px;
|
||||
padding-top: 8px; /* 增加感应连续性 */
|
||||
padding-top: 8px; /* 澧炲姞鎰熷簲杩炵画鎬?*/
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
@@ -614,3 +614,4 @@ function moveToRecycle(id: number) {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user