ts_aimz/app.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2025-03-21 09:02:29 +08:00
// app.js
import {
imgAssets
} from './net/http'
2025-03-21 09:02:29 +08:00
App({
globalData: {
imgAssetsUrl: imgAssets,
localAssets: "/static/images"
2025-03-21 09:02:29 +08:00
},
onLaunch() {
//自定义字体
2025-04-24 18:46:40 +08:00
// wx.loadFontFace({
// family: 'PingFang-regular',
// global: true,
// source: 'https://www.aimzhu.com/miniapp-assets/PingFangSC-Regular.ttf',
// success(res) {
// console.log('字体加载成功')
// },
// fail(err) {
// console.log('字体加载错误')
// }
// })
2025-04-09 11:31:24 +08:00
// 全局事件对象
// this.eventBus = {}
// // 监听事件
// this.on = function (eventName, callback) {
// if (!this.eventBus[eventName]) {
// this.eventBus[eventName] = []
// }
// this.eventBus[eventName].push(callback)
// }
// // 触发事件
// this.emit = function (eventName, data) {
// const callbacks = this.eventBus[eventName]
// if (callbacks) {
// callbacks.forEach(callback => {
// callback(data)
// })
// }
// }
}
2025-03-21 09:02:29 +08:00
})