feat: 将多个页面从JavaScript转换为TypeScript
- 将 agreement.js、no-auth-plugin.js、processEntry.js、https.js、 menuConfig.js、voiceUtil.js 文件重命名为对应的 .ts 扩展名 - 在 agreement.ts 中引入配置并动态设置标题 - 在 no-auth-plugin.ts 中使用工具函数替代硬编码跳转 - 为 processEntry.ts 添加类型注解并重构代码结构 - 为 https.ts 添加类型定义并优化错误处理 - 创建 menuConfig.ts 并迁移导航配置 - 为 voiceUtil.ts 添加类型注解
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// pages/agreement/agreement.js
|
||||
import { base } from "@/utils/config";
|
||||
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
@@ -11,14 +12,12 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
type: options.type,
|
||||
});
|
||||
const appletName = base.appletName;
|
||||
this.setData({ type: options.type });
|
||||
wx.setNavigationBarTitle({
|
||||
title:
|
||||
options.type == "user"
|
||||
? "易宝赞数据化管理系统平台用户服务协议"
|
||||
: "易宝赞数据化管理系统隐私权政策",
|
||||
title: `${appletName}${
|
||||
options.type == "user" ? "平台用户服务协议" : "隐私权政策"
|
||||
}`,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user