补充页面内容

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,274 @@
<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>
<view class="filter-select select-md">
<text class="select-text">中文(zh-CN)</text>
<text class="arrow">▼</text>
</view>
</view>
<view class="filter-item">
<text class="label">搜索:</text>
<input class="filter-input" placeholder="请输入语言备注" />
</view>
<button class="btn primary" @click="onSearch">搜索</button>
</view>
</view>
<!-- 提示栏 -->
<view class="alert-info">
<view class="info-block">
<text class="info-title">页面语言</text>
<text class="info-content">添加页面语言,添加完成之后状态码为中文文字,移动端面使用 $t('xxxx')js文件中使用 this.$t('xxxx') 或者使用 that.$t('xxxx') 实现语言的切换</text>
</view>
<view class="info-block mt-12">
<text class="info-title">接口语言</text>
<text class="info-content">添加接口语言添加完成之后状态码为6位数字接口返回提示信息时直接返回对应的错误码即可实现语言的切换</text>
</view>
</view>
<!-- 操作栏 -->
<view class="action-bar header-actions">
<button class="btn primary" @click="addWord">添加语句</button>
</view>
<!-- 表格内容 -->
<view class="admin-card content-card">
<view class="table-container list-table">
<view class="table-header">
<view class="col col-id"><text>编号</text></view>
<view class="col col-origin"><text>原语句</text></view>
<view class="col col-translation"><text>对应语言翻译</text></view>
<view class="col col-code"><text>状态码/文字(接口/页面调用参考)</text></view>
<view class="col col-type"><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-origin"><text>{{ item.origin }}</text></view>
<view class="col col-translation"><text>{{ item.translation }}</text></view>
<view class="col col-code"><text>{{ item.code }}</text></view>
<view class="col col-type"><text>{{ item.type }}</text></view>
<view class="col col-action">
<text class="action-btn" @click="editWord(item)">编辑</text>
<text class="action-btn divider">|</text>
<text class="action-btn danger" @click="deleteWord(item)">删除</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref } from 'vue'
const dataList = ref([
{ id: 55493, origin: '秒杀活动', translation: '秒杀活动', code: '秒杀活动', type: '中文(zh-CN)' },
{ id: 55483, origin: '哥哥我', translation: '', code: '哥哥我', type: '中文(zh-CN)' },
{ id: 25221, origin: '提交订单', translation: '提交订单', code: '提交订单', type: '中文(zh-CN)' },
{ id: 25211, origin: '用户等级优惠', translation: '用户等级优惠', code: '用户等级优惠', type: '中文(zh-CN)' },
{ id: 25201, origin: '暂不支付', translation: '暂不支付', code: '暂不支付', type: '中文(zh-CN)' },
{ id: 25191, origin: '确认支付', translation: '确认支付', code: '确认支付', type: '中文(zh-CN)' },
{ id: 25181, origin: '支付剩余时间', translation: '支付剩余时间', code: '支付剩余时间', type: '中文(zh-CN)' },
{ id: 24711, origin: '全部已读', translation: '全部已读', code: '全部已读', type: '中文(zh-CN)' },
{ id: 24701, origin: '获得拼团团长佣金', translation: '获得拼团团长佣金', code: '获得拼团团长佣金', type: '中文(zh-CN)' },
{ id: 24691, origin: '获得事业部推广订单佣金', translation: '获得事业部推广订单佣金', code: '获得事业部推广订单佣金', type: '中文(zh-CN)' }
])
function onSearch() {
uni.showToast({ title: '搜索中...', icon: 'none' })
}
function addWord() {
uni.showToast({ title: '添加语句', icon: 'none' })
}
function editWord(item: any) {
uni.showToast({ title: '编辑: ' + item.origin, icon: 'none' })
}
function deleteWord(item: any) {
uni.showModal({
title: '提示',
content: '确定要删除此翻译语句吗?',
success: (res) => {
if (res.confirm) {
uni.showToast({ title: '删除成功' })
}
}
})
}
</script>
<style scoped lang="scss">
.admin-page {
padding: 24px;
background-color: #f5f7f9;
min-height: 100vh;
}
.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: 150px;
height: 32px;
border: 1px solid #d9d9d9;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 10px;
}
.select-md {
width: 200px;
}
.filter-input {
width: 200px;
height: 32px;
border: 1px solid #d9d9d9;
border-radius: 4px;
padding: 0 10px;
font-size: 14px;
}
.alert-info {
background-color: #fff7e6;
border: 1px solid #ffe7ba;
padding: 20px;
border-radius: 4px;
margin: 24px 0;
}
.info-block {
display: flex;
flex-direction: column;
}
.mt-12 {
margin-top: 12px;
}
.info-title {
color: #fa8c16;
font-size: 14px;
font-weight: bold;
margin-bottom: 4px;
}
.info-content {
color: #fa8c16;
font-size: 14px;
line-height: 1.6;
}
.action-bar {
margin-bottom: 20px;
}
.admin-card {
background-color: #fff;
border-radius: 4px;
padding: 0;
overflow: hidden;
}
.btn {
height: 32px;
padding: 0 16px;
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;
}
.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: 16px;
display: flex;
align-items: center;
font-size: 14px;
color: #333;
}
.col-id { width: 80px; }
.col-origin { flex: 2; }
.col-translation { flex: 2; }
.col-code { flex: 2; }
.col-type { width: 150px; }
.col-action { width: 150px; justify-content: flex-end; }
.action-btn {
color: #1890ff;
cursor: pointer;
}
.action-btn.danger {
color: #ff4d4f;
}
.action-btn.divider {
margin: 0 8px;
color: #e8e8e8;
}
</style>