榆钱落尽槿花稀 448712ece5 feat: 添加积分申请系统基础功能与UI组件
本次提交主要包含以下内容:

1. 新增积分申请系统核心功能:
   - 添加登录页面及API接口
   - 实现积分申请记录查看功能
   - 集成微信小程序分享功能
   - 添加请求管理工具类

2. 引入Tuniao UI组件库:
   - 添加时间线、折叠面板、表格等UI组件
   - 集成头像组、单选框组等交互组件
   - 配置全局样式和主题颜色

3. 基础架构搭建:
   - 配置项目manifest和pages.json路由
   - 添加状态管理store
   - 实现自定义导航栏适配
   - 添加工具函数(加解密、数字处理等)

4. 静态资源:
   - 添加项目logo和背景图片
   - 配置uni.scss全局样式变量

本次提交为系统基础功能搭建,后续将进一步完善积分申请流程和审批功能。
2025-05-27 16:40:02 +08:00

68 lines
2.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = {
data() {
return {}
},
onLoad() {
// getRect挂载再$t上用为这个方法需要使用inthis所以无法把它独立层一个单独的文件导出
this.$t.getRect = this._tGetRect
},
beforeDestory() {
// 判断当前页面是否存在parent和children
// 组件销毁时移除子组件在父组件children数组中的实例释放资源避免数据混乱
if (this.parent && uni.$t.test.array(this.parent.children)) {
// 组件销毁时移除子组件在父组件children数组中的实例
const childrenList = this.parent.children
childrenList.map((child, index) => {
// 如果相对,则移除
if (child === this) {
childrenList.splice(index, 1)
}
})
}
},
methods: {
/**
* 查询节点信息
* 当前方法在支付宝小程序中无法获取组件跟接点的尺寸
* 解决办法为组件根部再套一个没有任何作用的view元素
*/
_tGetRect(selector, all) {
return new Promise((resolve) => {
uni.createSelectorQuery()
.in(this)[all ? 'selectAll' : 'select'](selector)
.boundingClientRect(rect => {
if (all && Array.isArray(rect) && rect.length) {
resolve(rect)
}
if (!all && rect) {
resolve(rect)
}
})
.exec()
})
},
/**
* 获取父组件的数据
*/
getParentData(parentName = '') {
// 避免再created中定义parent变量
if (!this.parent) this.parent = false
// 通过获取父组件实例
// 将父组件this中对应的参数赋值给本组件的parentData对象中对应的属性
// 头条小程序不支持通过this.parent.xxx去监听父组件参数的变化所以需要本方法进行实现
this.parent = this.$t.$parent.call(this, parentName)
if (this.parent) {
// 遍历parentData中的属性将parent中同名的属性赋值给parentData
Object.keys(this.parentData).map(key => {
this.parentData[key] = this.parent[key]
})
}
},
/**
* 阻止事件冒泡
*/
preventEvent(e) {
e && e.stopPropagation && e.stopPropagation()
}
}
}