ts_aimz/pages/index/index.js
2025-03-26 18:15:07 +08:00

67 lines
2.0 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.

// index.js
const app = getApp()
const deviceInfo = wx.getDeviceInfo()
const screenInfo = wx.getWindowInfo();
const statusBarHeight = screenInfo.statusBarHeight; // 状态栏高度
const navBarHeight = deviceInfo.platform == 'IOS' ? 48 : 50; // 导航栏高度iOS 为 44pxAndroid 为 48px
const windowHeight = screenInfo.windowHeight - navBarHeight - statusBarHeight; //可用内容高度
Page({
data: {
statusBarHeight: statusBarHeight,
navBarHeight: navBarHeight,
totalHeight: navBarHeight, // 导航栏总高度
contentHeight: windowHeight,
tabList: ["写材料", "全托管", "安装包", "演示视频", "加急", "提交版权中心", "已经下证"],
currentTypeTab: "写材料",
currentStatus: 1, //默认状态 1进行 2完成
listLoading: 'loading', //loading 状态
listRefreshTrig: false, //是否正在刷新
},
onLoad(e) {
const _self = this
setTimeout(() => {
_self.setData({
listLoading: 'success'
})
}, 1000);
},
//创建项目
createCopy() {
wx.navigateTo({
url: '/pages/copyright/createBuy/createBuy',
})
},
//充值
goPayment() {
wx.navigateTo({
url: '/pages/copyright/payment/payment',
})
},
//切换状态
doChangeStatus(e) {
this.setData({
currentStatus: e.currentTarget.dataset.value
})
},
//切换类型
doChangeTypeTab(e) {
var _self = this
_self.setData({
currentTypeTab: e.currentTarget.dataset.value
})
},
//刷新列表
doRefreshList() {
console.log('正在刷新...')
const _self = this
_self.setData({
listRefreshTrig: true,
listLoading: 'loading'
})
setTimeout(() => {
_self.setData({
listRefreshTrig: false
})
}, 5000);
}
})