From 2af5f043b60c1f7ac38ecccc8f5bf44743134325 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:08:00 +0800
Subject: [PATCH] test
---
pages/teaching/list.vue | 36 +++++++++++++++++++++---------------
1 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/pages/teaching/list.vue b/pages/teaching/list.vue
index 35d2ef8..9230d0c 100644
--- a/pages/teaching/list.vue
+++ b/pages/teaching/list.vue
@@ -10,7 +10,8 @@
<view class="item-title">{{item.name}}</view>
<view class="item-text">{{getTeachingSrcDst(item)}}</view>
<template v-slot:right>
- <view class="btn-del" @click="clickDelTeachingMode('Public',item)">鍒犻櫎</view>
+ <view class="btn-del" @click="clickDelTeachingMode('Public',item)">{{translate("delete")}}
+ </view>
</template>
</uni-swipe-action-item>
<uni-swipe-action-item class="list-item"
@@ -20,7 +21,8 @@
<view class="item-title">{{item.name}}</view>
<view class="item-text">{{getTeachingSrcDst(item)}}</view>
<template v-slot:right>
- <view class="btn-del" @click="clickDelTeachingMode('Stations',item)">鍒犻櫎</view>
+ <view class="btn-del" @click="clickDelTeachingMode('Stations',item)">{{translate("delete")}}
+ </view>
</template>
</uni-swipe-action-item>
</uni-swipe-action>
@@ -44,6 +46,8 @@
showToast,
showModal,
session,
+ showError,
+ showInfo
} from "@/comm/utils.js"
import {
Button
@@ -129,7 +133,7 @@
} catch (ex) {
- this.showError(ex)
+ showError(ex, this.translate('error'))
}
},
@@ -141,7 +145,7 @@
this.teachingPublic = data?.Public || []
this.teachingStation = data?.Stations || []
} catch (ex) {
- this.showError(ex)
+ showError(ex, this.translate('error'))
}
},
clickAddTeaching() {
@@ -217,7 +221,8 @@
const list = item.pos_list || []
let tip = ""
if (list.length > 1) {
- tip = `(${Number(list[0].x).toFixed(2)},${Number(list[0].y).toFixed(2)}) (${Number(list[1].x).toFixed(2)},${Number(list[1].y).toFixed(2)})`
+ tip =
+ `(${Number(list[0].x).toFixed(2)},${Number(list[0].y).toFixed(2)}) (${Number(list[1].x).toFixed(2)},${Number(list[1].y).toFixed(2)})`
}
if (list.length == 1) {
tip = `(${Number(list[0].x).toFixed(2)},${Number(list[0].y).toFixed(2)})`
@@ -225,7 +230,12 @@
return tip
},
clickDelTeachingMode(mode, item) {
- showModal("纭鍒犻櫎绀烘暀", "璀﹀憡").then((res) => {
+ showModal({
+ title: "",
+ content: `${this.translate('ask_deleting_teaching')}`,
+ confirmText: this.translate('ok'),
+ cancelText: this.translate('cancel'),
+ }).then((res) => {
if (res) {
this.deleteTeachingMode(mode, item)
}
@@ -259,17 +269,13 @@
}
} catch (ex) {
- this.showError(ex)
+ showError(ex, this.translate('error'))
}
},
-
- showError(ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.msg == "string" ? ex.msg : exStr
- showModal(tip, "閿欒", false)
+ translate(t) {
+ if (typeof this.$t == "function") return this.$t(`page.${t}`)
+ else return t;
},
@@ -368,7 +374,7 @@
.item-title {
font-size: 32rpx;
- padding: 10rpx 20rpx;
+ padding: 10rpx 20rpx;
}
--
Gitblit v1.9.1