Files
medical-mall/pages/mall/admin/setting/delivery/station.uvue
2026-02-11 20:16:51 +08:00

231 lines
5.2 KiB
Plaintext

<template>
<view class="admin-page-container">
<view class="page-card">
<!-- 搜索栏 -->
<view class="search-wrap">
<view class="search-item">
<text class="label">提货点搜索:</text>
<input class="input" placeholder="请输入提货点名称,电话" v-model="searchKey" />
</view>
<button class="btn btn-primary" @click="onSearch">查询</button>
</view>
<!-- 状态 Tabs -->
<view class="tabs-wrap">
<view class="tab-item active"><text class="tab-text">显示中的提货点(2)</text></view>
<view class="tab-item"><text class="tab-text">隐藏中的提货点(0)</text></view>
<view class="tab-item"><text class="tab-text">回收站中的提货点(9)</text></view>
</view>
<view class="action-wrap">
<button class="btn btn-primary" @click="onAdd">添加提货点</button>
</view>
<!-- 表格区域 -->
<view class="table-wrap">
<view class="table-header">
<view class="th" style="flex: 1;">ID</view>
<view class="th" style="flex: 2;">提货点图片</view>
<view class="th" style="flex: 2;">提货点名称</view>
<view class="th" style="flex: 2;">提货点电话</view>
<view class="th" style="flex: 3;">地址</view>
<view class="th" style="flex: 3;">营业时间</view>
<view class="th" style="flex: 1.5;">是否显示</view>
<view class="th" style="flex: 2;">操作</view>
</view>
<view class="table-body">
<view v-for="item in stationList" :key="item.id" class="tr">
<view class="td" style="flex: 1;">{{ item.id }}</view>
<view class="td" style="flex: 2;">
<image class="station-img" :src="item.image" mode="aspectFill" />
</view>
<view class="td" style="flex: 2;">{{ item.name }}</view>
<view class="td" style="flex: 2;">{{ item.phone }}</view>
<view class="td" style="flex: 3;">{{ item.address }}</view>
<view class="td" style="flex: 3;">{{ item.hours }}</view>
<view class="td" style="flex: 1.5;">
<switch :checked="item.isshow" color="#1890ff" />
</view>
<view class="td" style="flex: 2;">
<text class="action-btn" @click="onEdit(item)">编辑</text>
<text class="action-btn-del" @click="onDel(item)">删除</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, reactive } from 'vue'
const searchKey = ref('')
type StationItem = {
id: number
image: string
name: string
phone: string
address: string
hours: string
isshow: boolean
}
const stationList = reactive<StationItem[]>([
{ id: 46, image: '/static/logo.png', name: '提货点222', phone: '13769102384', address: '能看见你的困难', hours: '00:00:00 - 23:00:00', isshow: true },
{ id: 44, image: '/static/logo.png', name: '美东科技', phone: '15912341234', address: '襄阳火车站', hours: '08:00:00 - 22:00:00', isshow: true }
])
function onSearch() {
console.log('Search:', searchKey.value)
}
function onAdd() {
console.log('Add station')
}
function onEdit(item: StationItem) {
console.log('Edit:', item.name)
}
function onDel(item: StationItem) {
console.log('Delete:', item.id)
}
</script>
<style scoped>
.admin-page-container {
padding: 15px;
background-color: #f5f7f9;
min-height: 100vh;
}
.page-card {
background-color: #fff;
border-radius: 4px;
padding: 20px;
}
.search-wrap {
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 20px;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 20px;
}
.label {
font-size: 14px;
color: #606266;
}
.input {
width: 250px;
height: 32px;
padding: 0 10px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
color: #606266;
margin-right: 15px;
}
.tabs-wrap {
display: flex;
flex-direction: row;
margin-bottom: 20px;
border-bottom: 1px solid #f0f2f5;
}
.tab-item {
padding: 10px 15px;
cursor: pointer;
}
.tab-item.active {
border-bottom: 2px solid #1890ff;
}
.tab-item.active .tab-text {
color: #1890ff;
}
.tab-text {
font-size: 14px;
color: #515a6e;
}
.action-wrap {
margin-bottom: 20px;
}
.btn {
height: 32px;
line-height: 30px;
padding: 0 15px;
font-size: 14px;
border-radius: 4px;
border: none;
}
.btn-primary {
background-color: #1890ff;
color: #fff;
}
.table-wrap {
width: 100%;
border: 1px solid #f0f0f0;
}
.table-header {
display: flex;
flex-direction: row;
background-color: #f8f8f9;
}
.th {
padding: 12px 10px;
font-size: 14px;
font-weight: bold;
color: #515a6e;
border-bottom: 1px solid #f0f0f0;
text-align: center;
}
.tr {
display: flex;
flex-direction: row;
border-bottom: 1px solid #f0f0f0;
}
.td {
padding: 12px 10px;
font-size: 14px;
color: #515a6e;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.station-img {
width: 40px;
height: 40px;
border-radius: 4px;
}
.action-btn {
color: #1890ff;
font-size: 13px;
margin-right: 10px;
}
.action-btn-del {
color: #ed4014;
font-size: 13px;
}
</style>