补充页面内容

This commit is contained in:
2026-02-11 19:51:32 +08:00
parent 50ddf01e7c
commit 53820a4654
30 changed files with 5915 additions and 259 deletions

View 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>