Update WeChat MiniProgram share config and improve Download Web page logic for HarmonyOS detection

This commit is contained in:
2026-02-09 22:03:24 +08:00
parent 58774dd397
commit a4b3fcdb05
22 changed files with 2556 additions and 12 deletions

View File

@@ -1,12 +1,23 @@
import { config } from '../../config';
Page({
data: {
version: '1.0.0'
},
onLoad() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
},
onShareAppMessage() {
return {
title: '道棋百宝箱 - 您的日常计算好帮手'
}
return config.share;
},
onShareTimeline() {
return config.share;
},
goToPrivacy() {

View File

@@ -1,3 +1,5 @@
import { config } from '../../config';
// pages/calculator/calculator.ts
Page({
data: {
@@ -14,16 +16,11 @@ Page({
},
onShareAppMessage() {
return {
title: '便捷好用的科学计算器',
path: '/pages/calculator/calculator'
}
return config.share;
},
onShareTimeline() {
return {
title: '便捷好用的科学计算器'
}
return config.share;
},
toggleHelp() {
@@ -45,6 +42,12 @@ Page({
},
onLoad() {
// 开启分享菜单
wx.showShareMenu({
withShareTicket: false,
menus: ['shareAppMessage', 'shareTimeline']
});
// 从本地存储恢复历史记录
const saved = wx.getStorageSync('CALC_HISTORY');
if (saved && Array.isArray(saved)) {

View File

@@ -1,4 +1,19 @@
import { config } from '../../config';
Page({
onLoad() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
},
onShareAppMessage() {
return config.share;
},
onShareTimeline() {
return config.share;
},
data: {
originalPrice: '',
discount: '',

View File

@@ -1,5 +1,20 @@
import { config } from '../../config';
Page({
onLoad() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
},
onShareAppMessage() {
return config.share;
},
onShareTimeline() {
return config.share;
},
data: {
historyList: []
},

View File

@@ -34,6 +34,21 @@ Component({
}
},
methods: {
onLoad() {
wx.showShareMenu({
withShareTicket: false,
menus: ['shareAppMessage', 'shareTimeline'] // 需要在 Component 中定义 onShareAppMessage
});
},
onShareAppMessage() {
return config.share;
},
onShareTimeline() {
return config.share;
},
updateGreeting() {
const hour = new Date().getHours();
let greeting = '';

View File

@@ -1,2 +1,16 @@
import { config } from '../../config';
Page({
onLoad() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
},
onShareAppMessage() {
return config.share;
},
onShareTimeline() {
return config.share;
},
});

View File

@@ -1,13 +1,13 @@
<view class="container">
<view class="content">
<view class="h1">隐私政策</view>
<view class="p">生效日期2024年1月1日</view>
<view class="p">生效日期2026年2月1日</view>
<view class="h2">1. 引言</view>
<view class="p">“道棋百宝箱”(以下称为“本小程序”)非常重视您的隐私。本隐私政策旨在说明我们在您使用本小程序提供的服务时,如何处理您的信息。</view>
<view class="h2">2. 信息收集</view>
<view class="p">本小程序作为一款实用工具类产品<text class="bold">不收集、不存储、不上传任何您的个人身份信息</text>(如姓名、电话、地址等)。</view>
<view class="p">本小程序作为一款实用工具类产品。</view>
<view class="p">您在使用计算器、单位换算等功能时产生的数据(如计算历史、设置偏好),仅存储在您设备的本地缓存中,此时不会上传至任何服务器。</view>
<view class="h2">3. 权限使用</view>

View File

@@ -66,6 +66,21 @@ Component({
}
},
methods: {
onLoad() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
},
onShareAppMessage() {
return config.share;
},
onShareTimeline() {
return config.share;
},
// 检查本地 Session
checkLocalSession() {
const session = wx.getStorageSync('USER_SESSION');

View File

@@ -1,5 +1,20 @@
import { config } from '../../config';
Page({
onLoad() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
},
onShareAppMessage() {
return config.share;
},
onShareTimeline() {
return config.share;
},
data: {
categories: ['长度', '面积', '体积', '重量', '温度'],
categoryIndex: 0,