榆钱落尽槿花稀 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

146 lines
3.7 KiB
Vue
Raw Permalink 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.

<script>
import Vue from 'vue'
import store from './store/index.js'
import updateCustomBarInfo from './tuniao-ui/libs/function/updateCustomBarInfo.js'
import {
wechatLogin,
} from '@/utils/api.js'
export default {
onLaunch: function() {
const userToken = uni.getStorageSync('user');
if(!userToken){
uni.reLaunch({
url:'/pages/login/login'
})
}
uni.getSystemInfo({
success: function(e) {
console.log(e);
// 获取手机系统版本
const system = e.system.toLowerCase()
const platform = e.osName.toLowerCase()
// 判断是否为ios设备
if (platform.indexOf('ios') != -1 && (system.indexOf('ios') != -1 || system.indexOf(
'macos') != -1)) {
Vue.prototype.SystemPlatform = 'ios'
} else if (platform.indexOf('android') != -1 && (system.indexOf('android') != -1)) {
Vue.prototype.SystemPlatform = 'android'
} else {
Vue.prototype.SystemPlatform = 'devtools'
}
}
})
// 获取设备的状态栏信息和自定义顶栏信息
// store.dispatch('updateCustomBarInfo')
updateCustomBarInfo().then((res) => {
store.commit('$tStore', {
name: 'vuex_status_bar_height',
value: res.statusBarHeight
})
store.commit('$tStore', {
name: 'vuex_custom_bar_height',
value: res.customBarHeight
})
})
// #ifdef MP-WEIXIN
//更新检测
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager();
updateManager && updateManager.onCheckForUpdate((res) => {
if (res.hasUpdate) {
updateManager.onUpdateReady(() => {
uni.showModal({
title: '更新提示',
content: '新版本已经准备就绪,是否需要重新启动应用?',
success: (res) => {
if (res.confirm) {
uni.clearStorageSync() // 更新完成后刷新storage的数据
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(() => {
uni.showModal({
title: '已有新版本上线',
content: '小程序自动更新失败,请删除该小程序后重新搜索打开哟~~~',
showCancel: false
})
})
} else {
//没有更新
}
})
} else {
uni.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请更新到最新的微信后再重试。',
showCancel: false
})
}
// #endif
},
onShow: function() {
},
onHide: function() {
// console.log('App Hide')
},
methods: {
getUserLogin(returnA) {
//查询是否有缓存
const u = uni.getStorageSync('user');
console.log(u);
// if (u && u != '') {
// returnA({
// 'code': 1,
// 'info': u
// });
// return;
// }
uni.getProvider({
service: 'oauth',
success: function(res) {
console.log(res)
if (~res.provider.indexOf('weixin')) {
uni.login({
provider: "weixin",
success: function(loginRes) {
wechatLogin({
code: loginRes.code,
})
.then(response => {
console.log(response);
if (response.code == 1) {
uni.setStorageSync('user', response.info);
}
returnA(response);
})
.catch(error => {
uni.showToast({
icon: 'none',
title: error,
duration: 2000
});
});
}
});
} else {
console.log(123);
}
}
});
},
}
}
</script>
<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import './tuniao-ui/index.scss';
@import './tuniao-ui/iconfont.css';
</style>