From 2ea96ae0faae0ad4e8b2731c40c95641fd633ace Mon Sep 17 00:00:00 2001
From: tangxinyue <524779910@qq.com>
Date: Fri, 17 Apr 2026 11:16:04 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A3=9E=E4=B9=A6=E8=AE=B0?=
=?UTF-8?q?=E5=BD=95=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 58 ++++---
components/balance-list/balance-list.vue | 2 +-
components/common/auto-width-input.vue | 39 ++++-
components/nav-bar/nav-bar.vue | 12 +-
.../shopping/jingdong/shopping-card.vue | 48 +++---
components/watermark/watermark.vue | 6 +-
main.js | 2 +-
pages/ant-credit-pay/index.vue | 50 ++++--
.../overdue-payment/overdue-payment.vue | 4 +-
pages/balance/index.vue | 4 +-
pages/bill/bill-detail/bill-detail.vue | 4 +-
pages/bill/bill-list/bill-list.vue | 4 +-
pages/common/recharge/index.vue | 163 ++++++++++--------
.../shopping/jingdong/add-order/add-order.vue | 6 +-
.../jingdong/add-waimai/add-waimai.vue | 41 ++++-
pages/shopping/jingdong/json/order.json | 63 ++++---
.../waimai-order-detail.vue | 93 ++++++----
utils/globalMethods.js | 62 +++----
18 files changed, 409 insertions(+), 252 deletions(-)
diff --git a/App.vue b/App.vue
index e4403f4..e533e63 100644
--- a/App.vue
+++ b/App.vue
@@ -78,37 +78,41 @@ export default {
this.globalData.NativeEvent = false
console.log('开始监听宿主消息')
- uni.onNativeEventReceive((event, data) => {
- if (event) {
- console.log('接收到宿主消息:', event, data)
+ if (typeof uni.onNativeEventReceive === 'function') {
+ uni.onNativeEventReceive((event, data) => {
+ if (event) {
+ console.log('接收到宿主消息:', event, data)
- if (event == "token") {
- let header = uni.getStorageSync('header') || {}
- header["x-token"] = data
- uni.setStorageSync('header', header)
- console.log('已更新 token')
+ if (event == "token") {
+ let header = uni.getStorageSync('header') || {}
+ header["x-token"] = data
+ uni.setStorageSync('header', header)
+ console.log('已更新 token')
- //获取宿主用户信息
- try {
- this.$getUserInfo()
- } catch (error) {
- console.error('获取用户信息失败:', error)
+ //获取宿主用户信息
+ try {
+ this.$getUserInfo()
+ } catch (error) {
+ console.error('获取用户信息失败:', error)
+ }
+ } else if (event == "jump") {
+ if (data) {
+ console.log('接收到跳转指令,已缓存目标地址:', data);
+ uni.setStorageSync('jumpTarget_url', data);
+ // 强制重定向到首页,触发onShow获取用户信息后再跳转
+ uni.reLaunch({
+ url: '/pages/index/index'
+ });
+ }
+ } else if (event == 'wx_pay_result' || event == 'ios_pay_result') {
+ this.globalData.recentNativeEvent = event
+ this.globalData.recentNativeData = data
}
- } else if (event == "jump") {
- if (data) {
- console.log('接收到跳转指令,已缓存目标地址:', data);
- uni.setStorageSync('jumpTarget_url', data);
- // 强制重定向到首页,触发onShow获取用户信息后再跳转
- uni.reLaunch({
- url: '/pages/index/index'
- });
- }
- } else if (event == 'wx_pay_result' || event == 'ios_pay_result') {
- this.globalData.recentNativeEvent = event
- this.globalData.recentNativeData = data
}
- }
- })
+ })
+ } else {
+ console.log('uni.onNativeEventReceive 不可用,跳过监听')
+ }
}
},
diff --git a/components/balance-list/balance-list.vue b/components/balance-list/balance-list.vue
index 480819c..5cb9bb0 100644
--- a/components/balance-list/balance-list.vue
+++ b/components/balance-list/balance-list.vue
@@ -98,7 +98,7 @@ const handleTouchStart = (e, item) => {
event: e,
item
})
- }, 1500)
+ }, 1000)
}
const handleTouchMove = (e) => {
diff --git a/components/common/auto-width-input.vue b/components/common/auto-width-input.vue
index a25414a..3425c1a 100644
--- a/components/common/auto-width-input.vue
+++ b/components/common/auto-width-input.vue
@@ -7,12 +7,21 @@
-
+
+
+ {{ modelValue || placeholder }}
+
-
+
+
+ {{ modelValue || placeholder }}
+
@@ -67,6 +76,14 @@ const props = defineProps({
showEdit: {
type: Boolean,
default: false
+ },
+ readonly: {
+ type: Boolean,
+ default: false
+ },
+ disabled: {
+ type: Boolean,
+ default: false
}
});
@@ -86,6 +103,20 @@ const finalInputWidth = computed(() => {
});
const isFocus = ref(false);
+const placeholderStyleObject = computed(() => {
+ const style = {};
+ if (!props.placeholderStyle) return style;
+ const parts = props.placeholderStyle.split(';');
+ parts.forEach(part => {
+ const [key, value] = part.split(':');
+ if (key && value) {
+ const camelKey = key.trim().replace(/-([a-z])/g, (g) => g[1].toUpperCase());
+ style[camelKey] = value.trim();
+ }
+ });
+ return style;
+});
+
const inputStyle = computed(() => ({
fontSize: props.fontSize,
fontWeight: props.fontWeight,
diff --git a/components/nav-bar/nav-bar.vue b/components/nav-bar/nav-bar.vue
index 56fb6d9..a493c5e 100644
--- a/components/nav-bar/nav-bar.vue
+++ b/components/nav-bar/nav-bar.vue
@@ -203,11 +203,21 @@ const onRightClick = () => {
emit('right-click')
}
+const closeTopPopup = () => {
+ topPopup.value.close()
+}
+
const buttonClick = (button) => {
- topPopup.value.close()
+ closeTopPopup()
emit('button-click', button)
}
+
+// 暴露给父组件的方法
+defineExpose({
+ openPopup,
+ closeTopPopup
+})