补充页面内容
This commit is contained in:
200
pages/mall/admin/maintain/data/city.uvue
Normal file
200
pages/mall/admin/maintain/data/city.uvue
Normal file
@@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<view class="admin-page">
|
||||
<view class="admin-sections">
|
||||
<!-- 操作栏 -->
|
||||
<view class="action-bar header-actions">
|
||||
<view class="left-btns">
|
||||
<button class="btn primary" @click="addProvince">添加省份</button>
|
||||
<button class="btn ghost ml-12" @click="clearCache">清除缓存</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表格内容 -->
|
||||
<view class="admin-card content-card">
|
||||
<view class="table-container list-table tree-table">
|
||||
<view class="table-header">
|
||||
<view class="col col-id"><text>编号</text></view>
|
||||
<view class="col col-name"><text>地区名称</text></view>
|
||||
<view class="col col-parent"><text>上级名称</text></view>
|
||||
<view class="col col-action"><text>操作</text></view>
|
||||
</view>
|
||||
|
||||
<view class="table-body">
|
||||
<view v-for="item in dataList" :key="item.id" class="table-row">
|
||||
<view class="col col-id"><text>{{ item.id }}</text></view>
|
||||
<view class="col col-name">
|
||||
<text class="expand-icon">˃</text>
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="col col-parent"><text>{{ item.parentName }}</text></view>
|
||||
<view class="col col-action">
|
||||
<text class="action-btn" @click="addItem(item)">添加</text>
|
||||
<text class="action-btn divider">|</text>
|
||||
<text class="action-btn" @click="editItem(item)">编辑</text>
|
||||
<text class="action-btn divider">|</text>
|
||||
<text class="action-btn danger" @click="deleteItem(item)">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
const dataList = ref([
|
||||
{ id: 1, name: '北京市', parentName: '中国' },
|
||||
{ id: 2, name: '天津市', parentName: '中国' },
|
||||
{ id: 3, name: '河北省', parentName: '中国' },
|
||||
{ id: 4, name: '山西省', parentName: '中国' },
|
||||
{ id: 5, name: '内蒙古自治区', parentName: '中国' },
|
||||
{ id: 6, name: '辽宁省', parentName: '中国' },
|
||||
{ id: 7, name: '吉林省', parentName: '中国' },
|
||||
{ id: 8, name: '黑龙江省', parentName: '中国' },
|
||||
{ id: 9, name: '上海市', parentName: '中国' },
|
||||
{ id: 10, name: '江苏省', parentName: '中国' },
|
||||
{ id: 11, name: '浙江省', parentName: '中国' },
|
||||
{ id: 12, name: '安徽省', parentName: '中国' },
|
||||
{ id: 13, name: '福建省', parentName: '中国' },
|
||||
{ id: 14, name: '江西省', parentName: '中国' }
|
||||
])
|
||||
|
||||
function addProvince() {
|
||||
uni.showToast({ title: '添加省份', icon: 'none' })
|
||||
}
|
||||
|
||||
function clearCache() {
|
||||
uni.showLoading({ title: '清理中...' })
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '清理成功' })
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
function addItem(item: any) {
|
||||
uni.showToast({ title: '添加下级: ' + item.name, icon: 'none' })
|
||||
}
|
||||
|
||||
function editItem(item: any) {
|
||||
uni.showToast({ title: '编辑: ' + item.name, icon: 'none' })
|
||||
}
|
||||
|
||||
function deleteItem(item: any) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要删除该区域吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showToast({ title: '删除成功' })
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.admin-page {
|
||||
padding: 20px;
|
||||
background-color: #f5f7f9;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.left-btns {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.ml-12 {
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.admin-card {
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 0; /* 表格一般不带卡片内边距 */
|
||||
margin-bottom: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.btn {
|
||||
height: 32px;
|
||||
padding: 0 15px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn.ghost {
|
||||
background-color: #fff;
|
||||
border: 1px solid #d9d9d9;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #fafafa;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.col {
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.col-id { width: 100px; }
|
||||
.col-name { flex: 2; }
|
||||
.col-parent { flex: 1; }
|
||||
.col-action { width: 200px; justify-content: flex-end; }
|
||||
|
||||
.expand-icon {
|
||||
margin-right: 8px;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
font-size: 14px;
|
||||
color: #1890ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.action-btn.danger {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
|
||||
.action-btn.divider {
|
||||
margin: 0 8px;
|
||||
color: #e8e8e8;
|
||||
cursor: default;
|
||||
}
|
||||
</style>
|
||||
177
pages/mall/admin/maintain/data/clear.uvue
Normal file
177
pages/mall/admin/maintain/data/clear.uvue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<view class="admin-page">
|
||||
<view class="admin-sections">
|
||||
<!-- 页面标题与提示 -->
|
||||
<view class="page-header">
|
||||
<text class="title">清除数据</text>
|
||||
<view class="warning-tip">
|
||||
<text class="warning-icon">⚠</text>
|
||||
<text class="warning-text">清除数据请谨慎,清除就无法恢复哦!</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 卡片网格 -->
|
||||
<view class="card-grid">
|
||||
<view v-for="card in cards" :key="card.id" class="clear-card">
|
||||
<view class="card-content">
|
||||
<text class="card-title">{{ card.title }}</text>
|
||||
<text class="card-desc">{{ card.desc }}</text>
|
||||
</view>
|
||||
<view class="card-footer">
|
||||
<button :class="['btn', card.primary ? 'primary' : 'ghost']" @click="handleAction(card)">
|
||||
{{ card.btnText }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
const cards = ref([
|
||||
{ id: 1, title: '更换域名', desc: '替换所有本地上传的图片域名', btnText: '立即更换', primary: true },
|
||||
{ id: 2, title: '清除用户生成的临时附件', desc: '清除用户生成的临时附件,不会影响商品图', btnText: '立即清理', primary: false },
|
||||
{ id: 3, title: '清除回收站商品', desc: '清除回收站商品,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 4, title: '清除用户数据', desc: '用户相关的所有表都将被清除,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 5, title: '清除商城数据', desc: '清除所有商城数据,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 6, title: '清除商品分类', desc: '会清除所有商品分类,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 7, title: '清除订单数据', desc: '清除用户所有订单数据,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 8, title: '清除客服数据', desc: '清除添加的客服数据,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 9, title: '清除微信数据', desc: '清除微信菜单保存数据,微信关键字无效回复', btnText: '立即清理', primary: false },
|
||||
{ id: 10, title: '清除内容分类', desc: '清除添加的文章和文章分类,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 11, title: '清除所有附件', desc: '清除所有附件用户生成和后台上传,谨慎操作', btnText: '立即清理', primary: false },
|
||||
{ id: 12, title: '清除系统记录', desc: '清除系统记录,谨慎操作', btnText: '立即清理', primary: false }
|
||||
])
|
||||
|
||||
function handleAction(card: any) {
|
||||
uni.showModal({
|
||||
title: '极其危险的操作',
|
||||
content: `您确定要对「${card.title}」执行此操作吗?数据清除后将无法恢复!`,
|
||||
confirmColor: '#ff4d4f',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({ title: '正在处理...' })
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '操作完成' })
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.admin-page {
|
||||
padding: 24px;
|
||||
background-color: #f5f7f9;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
background-color: #fff;
|
||||
padding: 16px 24px;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.warning-tip {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.warning-icon {
|
||||
color: #ff4d4f;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.warning-text {
|
||||
color: #ff4d4f;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.card-grid {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.clear-card {
|
||||
width: calc(25% - 15px); /* 4列布局 */
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 30px 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
border: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.card-desc {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 24px;
|
||||
height: 44px; /* 保持描述文字高度一致 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
height: 32px;
|
||||
padding: 0 20px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn.ghost {
|
||||
background-color: #fff;
|
||||
border: 1px solid #d9d9d9;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1400px) {
|
||||
.clear-card {
|
||||
width: calc(33.33% - 14px);
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1000px) {
|
||||
.clear-card {
|
||||
width: calc(50% - 10px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
227
pages/mall/admin/maintain/data/logistics.uvue
Normal file
227
pages/mall/admin/maintain/data/logistics.uvue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<view class="admin-page">
|
||||
<view class="admin-sections">
|
||||
<!-- 搜索栏 -->
|
||||
<view class="admin-card filter-card">
|
||||
<view class="filter-row">
|
||||
<view class="filter-item">
|
||||
<text class="label">是否显示:</text>
|
||||
<view class="filter-select">
|
||||
<text class="select-text">全部</text>
|
||||
<text class="arrow">▼</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter-item">
|
||||
<text class="label">搜索:</text>
|
||||
<input class="filter-input input-lg" placeholder="请输入物流公司名称或者编码" />
|
||||
</view>
|
||||
<button class="btn primary" @click="onSearch">查询</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作栏 -->
|
||||
<view class="action-bar">
|
||||
<button class="btn primary" @click="syncLogistics">同步物流公司</button>
|
||||
</view>
|
||||
|
||||
<!-- 表格内容 -->
|
||||
<view class="admin-card content-card">
|
||||
<view class="table-container list-table">
|
||||
<view class="table-header">
|
||||
<view class="col col-id"><text>ID</text></view>
|
||||
<view class="col col-name"><text>物流公司名称</text></view>
|
||||
<view class="col col-code"><text>编码</text></view>
|
||||
<view class="col col-sort"><text>排序</text></view>
|
||||
<view class="col col-status"><text>是否显示</text></view>
|
||||
<view class="col col-action"><text>操作</text></view>
|
||||
</view>
|
||||
|
||||
<view class="table-body">
|
||||
<view v-for="item in dataList" :key="item.id" class="table-row">
|
||||
<view class="col col-id"><text>{{ item.id }}</text></view>
|
||||
<view class="col col-name"><text>{{ item.name }}</text></view>
|
||||
<view class="col col-code"><text>{{ item.code }}</text></view>
|
||||
<view class="col col-sort"><text>{{ item.sort }}</text></view>
|
||||
<view class="col col-status">
|
||||
<switch :checked="item.show" color="#1890ff" @change="onStatusChange(item)" />
|
||||
</view>
|
||||
<view class="col col-action">
|
||||
<text class="action-btn" @click="editItem(item)">编辑</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 分页 (模拟) -->
|
||||
<view class="pagination">
|
||||
<!-- 这里可以放分页组件 -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
const dataList = ref([
|
||||
{ id: 2, name: '顺丰速运', code: 'shunfeng', sort: 0, show: true },
|
||||
{ id: 3, name: '圆通速递', code: 'yuantong', sort: 0, show: true },
|
||||
{ id: 4, name: '中通快递', code: 'zhongtong', sort: 0, show: true },
|
||||
{ id: 5, name: '申通快递', code: 'shentong', sort: 0, show: true },
|
||||
{ id: 6, name: '百世快递', code: 'huitongkuaidi', sort: 0, show: true },
|
||||
{ id: 7, name: '京东物流', code: 'jd', sort: 0, show: true },
|
||||
{ id: 8, name: '极兔速递', code: 'jtexpress', sort: 0, show: true },
|
||||
{ id: 9, name: '邮政快递包裹', code: 'youzhengguonei', sort: 0, show: true },
|
||||
{ id: 10, name: '天天快递', code: 'tiantian', sort: 0, show: true },
|
||||
{ id: 11, name: 'EMS', code: 'ems', sort: 0, show: true },
|
||||
{ id: 12, name: '德邦物流', code: 'debangwuliu', sort: 0, show: true },
|
||||
{ id: 13, name: '德邦快递', code: 'debangkuaidi', sort: 0, show: true },
|
||||
{ id: 14, name: '众邮快递', code: 'zhongyouex', sort: 0, show: true }
|
||||
])
|
||||
|
||||
function onSearch() {
|
||||
uni.showToast({ title: '查询中...', icon: 'none' })
|
||||
}
|
||||
|
||||
function syncLogistics() {
|
||||
uni.showLoading({ title: '同步中...' })
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '同步成功' })
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
function onStatusChange(item: any) {
|
||||
item.show = !item.show
|
||||
uni.showToast({ title: '状态已更新', icon: 'none' })
|
||||
}
|
||||
|
||||
function editItem(item: any) {
|
||||
uni.showToast({ title: '编辑: ' + item.name, icon: 'none' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.admin-page {
|
||||
padding: 20px;
|
||||
background-color: #f5f7f9;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.admin-card {
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.filter-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
margin-right: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filter-select {
|
||||
width: 200px;
|
||||
height: 32px;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.filter-input {
|
||||
height: 32px;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
padding: 0 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.input-lg {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
height: 32px;
|
||||
padding: 0 15px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.action-bar {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
width: 100%;
|
||||
border: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #fafafa;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.col {
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.col-id { width: 80px; }
|
||||
.col-name { flex: 2; }
|
||||
.col-code { flex: 2; }
|
||||
.col-sort { width: 100px; }
|
||||
.col-status { width: 120px; justify-content: center; }
|
||||
.col-action { width: 100px; justify-content: center; }
|
||||
|
||||
.action-btn {
|
||||
color: #1890ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user