Compare commits

..
2 Commits
Author SHA1 Message Date
lik ed36a0db0a 有新版本提示升级 2026-10-07 16:57:09 +08:00
lik 60a7c1fd56 删除不用的图片,增加页面转发给朋友 2026-10-07 16:47:28 +08:00
19 changed files with 81 additions and 10 deletions
+20 -3
View File
@@ -123,32 +123,49 @@ App({
},
checkUpdate() {
// 老基础库(< 1.9.90)没有 getUpdateManager,先挡一层:
// 否则下面直接 .onCheckForUpdate 会抛 TypeError
if (!wx.canIUse('getUpdateManager')) {
return;
}
// 获取小程序更新管理器实例
const updateManager = wx.getUpdateManager();
// 监听检查更新事件,当小程序有新版本时会触发此回调
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
console.log(res.hasUpdate); // 打印是否有新版本
console.log('[App] 是否有新版本:', res.hasUpdate); // 打印是否有新版本
});
// 监听更新准备就绪事件,当新版本下载完成时会触发此回调
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,可以重启应用小程序了!',
content: '新版本已经准备好,是否重启应用?',
confirmText: '立即重启',
cancelText: '稍后',
success(res) {
if (res.confirm) {
// 用户确认更新,调用 applyUpdate 应用新版本并重启小程序
updateManager.applyUpdate();
return;
}
// 用户选了「稍后」:新版本此时不会生效,要等下次冷启动才自动应用。
// 这里必须说清楚,否则用户以为已经升级完了
wx.showToast({
title: '下次打开将自动更新',
icon: 'none'
});
}
});
});
// 监听更新失败事件,当新版本下载失败时会触发此回调
updateManager.onUpdateFailed(function () {
// 新版本下载失败,可以在这里处理失败逻辑,例如提示用户稍后再试
// 下载失败没有可交给用户的动作(微信会在下次启动时重试),
// 只留日志便于线上排查,不打断用户
console.warn('[App] 新版本下载失败');
});
},
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 38 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

+19
View File
@@ -134,5 +134,24 @@ Page({
title: `暖橙陪诊 · ${attendant.name}`,
path: `/pages/attendant/attendantdetail?id=${attendant.id}`
}
},
// 朋友圈只能分享当前页,陪诊师 id 只能靠 query 带上;
// 详情还没回来(attendant 为 null)时不带 query,好友打开是列表页口径的空态
onShareTimeline() {
const {
attendant
} = this.data
if (!attendant) {
return {
title: '暖橙陪诊 · 陪诊师团队'
}
}
return {
title: `暖橙陪诊 · ${attendant.name}`,
query: `id=${attendant.id}`
}
}
})
+6
View File
@@ -75,5 +75,11 @@ Page({
title: '暖橙陪诊服务协议',
path: '/pages/escort/agreement'
}
},
onShareTimeline() {
return {
title: '暖橙陪诊服务协议'
}
}
})
+17
View File
@@ -402,5 +402,22 @@ Page({
title: `${service.title} - 专业陪诊服务`,
path: `/pages/escort/itemdetail?id=${service.id}`
}
},
// 朋友圈只能分享当前页,服务 id 只能靠 query 带上;
// 服务未加载完(service.id 为 null)时不带 query,落到默认项,避免拼出 id=null
onShareTimeline() {
const {
service
} = this.data
if (!service.id) {
return {
title: '暖橙陪诊 · 专业陪诊服务'
}
}
return {
title: `${service.title} - 专业陪诊服务`,
query: `id=${service.id}`
}
}
})
+2
View File
@@ -580,6 +580,8 @@ Page({
})
},
// 本页含就诊人姓名 / 手机号 / 身份证号与订单号,转发卡片不指向本页,统一落到首页;
// 也不提供朋友圈分享——朋友圈只能分享当前页 URL,会把订单页地址带出去
onShareAppMessage() {
return {
title: '暖橙陪诊 - 专业陪诊服务',
+10
View File
@@ -232,5 +232,15 @@ Page({
saving: false
})
})
},
// 本页是就诊人档案表单(姓名 / 手机号 / 身份证号),转发卡片不指向本页,
// 统一落到首页,避免好友打开一个需要登录的空表单;
// 也不提供朋友圈分享——朋友圈只能分享当前页 URL,会把档案页地址带出去
onShareAppMessage() {
return {
title: '暖橙陪诊 · 专业陪诊服务',
path: '/pages/home/index'
}
}
})
-7
View File
@@ -70,13 +70,6 @@ Page({
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
// 跳转「联系我们」页:本页不再平铺联系方式,四项内容与那一页重合,
// 且那一页每行还带「拨打」「复制」动作词,是更完整的一份
goToContact() {
+7
View File
@@ -83,5 +83,12 @@ Page({
title: '暖橙陪诊 · 合作与入驻',
path: '/pages/mine/business'
}
},
// 朋友圈只能分享当前页,本页无需带入 ?section=,好友打开即为页首
onShareTimeline() {
return {
title: '暖橙陪诊 · 合作与入驻'
}
}
})