project init
This commit is contained in:
@@ -15,11 +15,27 @@ Page({
|
||||
]
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
if (wx.canIUse('hideHomeButton')) {
|
||||
wx.hideHomeButton()
|
||||
}
|
||||
let isRun = wx.getStorageSync("isRun");
|
||||
if (!isRun) {
|
||||
this.startInter();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 启动定时器
|
||||
*/
|
||||
startInter : function(){
|
||||
wx.setStorageSync("isRun",true);
|
||||
let times = 1;
|
||||
setInterval(
|
||||
function () {
|
||||
times ++;
|
||||
// 提交远程服务器修改的内容,降低服务器压力,如果网络异常,也可以正常操作
|
||||
console.log('setInterval 每过500毫秒执行一次任务' + times)
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-progress": "/miniprogram_npm/tdesign-miniprogram/progress/progress"
|
||||
},
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
|
||||
@@ -24,14 +24,20 @@
|
||||
<view class="padding_box">
|
||||
<t-button theme="primary" size="medium" block>记一笔</t-button>
|
||||
<t-divider dashed content="今日记账清单"/>
|
||||
<t-cell wx:for="{{todayList}}" wx:key="index"
|
||||
title="{{item.title}}"
|
||||
description="{{item.dateTime}} • {{item.from}}"
|
||||
align="top"
|
||||
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
|
||||
note="{{item.money}}"
|
||||
class="t_{{item.type}}"
|
||||
/>
|
||||
<view wx:if="{{todayList != null && todayList.length > 0}}">
|
||||
<t-cell wx:for="{{todayList}}" wx:key="index"
|
||||
title="{{item.title}}"
|
||||
description="{{item.dateTime}} • {{item.from}}"
|
||||
align="top"
|
||||
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
|
||||
note="{{item.money}}"
|
||||
class="t-cell-{{item.type}}"
|
||||
/>
|
||||
</view>
|
||||
<view wx:else class="empty-view" >
|
||||
<t-empty icon="chart-bubble" description="今日还未记账" />
|
||||
</view>
|
||||
<!-- <t-empty wx:else t-class="empty-cls" t-class-image="t-empty__image" image="{{image}}" description="描述文字" />-->
|
||||
</view>
|
||||
<view class="placeholder"/>
|
||||
<foot-tab value="label_1"/>
|
||||
|
||||
@@ -18,4 +18,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.empty-view {
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user