Skip to content

Commit

Permalink
feat(cron): 添加定时任务静态页面;
Browse files Browse the repository at this point in the history
  • Loading branch information
ztkuaikuai committed Jul 9, 2024
1 parent 01dac70 commit a8a2ebb
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 79 deletions.
145 changes: 72 additions & 73 deletions pages.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "妙记"
}
}, {
"path": "pages/bills/bills",
"style": {
"navigationBarTitleText": "账单",
"enablePullDownRefresh": false
}
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "妙记"
}
}, {
"path": "pages/bills/bills",
"style": {
"navigationBarTitleText": "账单",
"enablePullDownRefresh": false
}

}, {
"path": "pages/charts/charts",
"style": {
"navigationBarTitleText": "报表",
"enablePullDownRefresh": false
}
}, {
"path": "pages/charts/charts",
"style": {
"navigationBarTitleText": "报表",
"enablePullDownRefresh": false
}

}, {
"path": "pages/my/my",
"style": {
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
}
}, {
"path": "pages/my/my",
"style": {
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
}
],
}],
"subPackages": [{
"root": "pagesAccount",
"pages": [{
Expand All @@ -53,55 +51,56 @@
}, {
"root": "pagesMy",
"pages": [{
"path": "user-info/user-info",
"style": {
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
}
"path": "user-info/user-info",
"style": {
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
}

}, {
"path": "feedback/feedback",
"style": {
"navigationBarTitleText": "反馈",
"enablePullDownRefresh": false
}
}, {
"path": "feedback/feedback",
"style": {
"navigationBarTitleText": "反馈",
"enablePullDownRefresh": false
}

}, {
"path": "about/about",
"style": {
"navigationBarTitleText": "关于",
"enablePullDownRefresh": false
}

}, {
"path": "my-assets/my-assets",
"style": {
"navigationBarTitleText": "我的资产",
"enablePullDownRefresh": false
}

} ,{
"path" : "about/about",
"style" :
{
"navigationBarTitleText": "关于",
"enablePullDownRefresh": false
}

}
,{
"path" : "my-assets/my-assets",
"style" :
{
"navigationBarTitleText": "我的资产",
"enablePullDownRefresh": false
}

}
,{
"path" : "bill-template/bill-template",
"style" :
{
"navigationBarTitleText": "我的模板",
"enablePullDownRefresh": false
}

},
{
"path" : "seconds/seconds",
"style" :
{
"navigationBarTitleText" : "秒记管理",
"enablePullDownRefresh" : false
}
}
]
}, {
"path": "bill-template/bill-template",
"style": {
"navigationBarTitleText": "我的模板",
"enablePullDownRefresh": false
}

},
{
"path": "seconds/seconds",
"style": {
"navigationBarTitleText": "秒记管理",
"enablePullDownRefresh": false
}
},
{
"path": "cron-accounting/cron-accounting",
"style": {
"navigationBarTitleText": "定时记账",
"enablePullDownRefresh": false
}
}
]
}, {
"root": "pagesFilter",
"pages": [{
Expand Down Expand Up @@ -188,7 +187,7 @@
]
},
"uniIdRouter": {
"loginPage": "uni_modules/uni-id-pages/pages/login/login-withoutpwd",
"loginPage": "uni_modules/uni-id-pages/pages/login/login-withoutpwd",
"needLogin": [
"pagesMy/.*",
"pagesAccount/.*",
Expand Down
5 changes: 5 additions & 0 deletions pages/my/my.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@
url:"/pagesMy/seconds/seconds"
})
break
case 3:
uni.navigateTo({
url:"/pagesMy/cron-accounting/cron-accounting"
})
break
default:
uni.showToast({
title:"正在开发中~",
Expand Down
8 changes: 3 additions & 5 deletions pagesMy/bill-template/bill-template.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<view class="temp">
<view class="linear-gradient"></view>
<mj-card title="提示">
<mj-card title="食用说明">
<view style="font-size: 28rpx;color: rgba(0, 0, 0, 0.6);">
账单模板可<span style="font-weight: 700;">用于记录经常购买的账单</span>,如每天都吃香菇滑鸡11元,每月交房租1500元等,可保存为帐单模板<span style="font-weight: 700;">方便快速记账</span>。
</view>
Expand All @@ -10,7 +10,8 @@
<view class="bill-template-wrapper">
<mj-bill-template :templateList="templateList" @updateList="getUserTemplate" pageType="temp"></mj-bill-template>
</view>
<view class="placeholder"></view>
<!-- 防挡 -->
<view style="height: 64px;"></view>
<!-- 固定定位,最底下 -->
<view class="bottom-btn" >
<u-button text="添加模板" color="#9fcba7" shape="circle" @click="clickBottomBtn"></u-button>
Expand Down Expand Up @@ -63,9 +64,6 @@
}
}
.placeholder {
height: 64px;
}
.bottom-btn {
box-sizing: border-box;
z-index: 999;
Expand Down
164 changes: 164 additions & 0 deletions pagesMy/cron-accounting/cron-accounting.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<template>
<view class="cron-accounting">
<view class="linear-gradient"></view>
<mj-card title="食用说明">
<view style="font-size: 28rpx;color: rgba(0, 0, 0, 0.6);">
定时记账可<span style="font-weight: 700;">用于记录定期重复的账单,配置好规则即可自动记账</span>。如每30天买一张月卡花费30元,每天通勤花费8元等等,类似上述情况可设置为定时记账。
</view>
</mj-card>
<!-- 定时任务卡片:遍历展示用户定时任务 -->
<mj-card title="定时任务名称" v-for="n in 10">
<template #right>
<view class="edit">
修改
</view>
</template>

<mj-bill-one-template :oneTemplate="testTemplete"></mj-bill-one-template>
<view class="cron-info-wrapper">
<div class="left">
<div class="next-time">
预计2024年07月10日执行
</div>
<div class="info">
<span>执行2次结束</span>
<span>每5天</span>
<span>已执行1次</span>
</div>
</div>
<div v-if="true" class="right start">
进行中
</div>
</view>
</mj-card>

<!-- 防挡 -->
<view style="height: 64px;"></view>
<!-- 固定定位,最底下 -->
<view class="bottom-btn" >
<u-button text="添加" color="#9fcba7" shape="circle" @click="clickBottomBtn"></u-button>
</view>
</view>
</template>

<script>
export default {
data() {
return {
testTemplete: {
assetStyle: {
color: "#6bcc03",
icon: "mj-wechat",
title: "微信钱包",
type: "weixin"
},
asset_id: [{
asset_name: "生活微信",
asset_type: "weixin",
user_id: "64fe8b5abd0220bf8c6552b5",
_id: "6500776ffe975fba5a9b8cd7"
}],
billStyle: {
icon: "mj-other-income",
title: "其他收入",
type: "other-income"
},
bill_amount: 40,
bill_notes: "代肝",
bill_type: 1,
category_type: "other-income",
destinationAssetStyle: {
title: "资产已删除"
},
destination_asset_id: [],
hasAsset: true,
hasDestinationAsset: false,
template_creation_date: 1697943655841,
user_id: "64fe8b5abd0220bf8c6552b5",
_id: "6534906799c6248d8023d50d"
}
};
},
methods: {
}
}
</script>

<style lang="scss">
.cron-accounting {
position: relative;
.linear-gradient {
position: absolute;
top: -24rpx;
left: 0;
right: 0;
height: 130rpx;
background-image: linear-gradient(#9fcba7, #fafafa);
z-index: -1;
}
.cron-info-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 16rpx;
.left {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
color: $mj-text-color-grey;
font-size: 24rpx;
.info {
margin-top: 8rpx;
span {
border: 1px solid $mj-text-color-grey;
margin-right: 8rpx;
font-size: 20rpx;
}
}
}
.right {
display: flex;
align-items: center;
box-sizing: border-box;
padding: 4px 8px;
margin-right: 4px;
border-radius: 16px;
font-size: 24rpx;
}
.start {
border: 2rpx solid $mj-theme-color-black;
}
.pause {
border: 2rpx solid $uni-color-warning;
}
.end {
border: 2rpx solid $uni-color-error;
}
}
.bottom-btn {
box-sizing: border-box;
z-index: 999;
position: fixed;
width: 100%;
padding: 0 24rpx 12px;
bottom: 20rpx;
opacity: 0.98;
}
.edit {
display: flex;
align-items: center;
box-sizing: border-box;
padding: 4px 8px;
margin-right: 4px;
border-radius: 16px;
font-size: 24rpx;
color: $mj-bg-color;
background-color: $mj-theme-color-2;
}
}
</style>
3 changes: 2 additions & 1 deletion pagesMy/seconds/seconds.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<view class="seconds">
<view class="linear-gradient"></view>
<mj-card title="提示">
<mj-card title="食用说明">
<view style="font-size: 28rpx;color: rgba(0, 0, 0, 0.6);">
秒记可<span style="font-weight: 700;">用于记录经常购买的账单</span>,如每天喝咖啡9.9元,可设置为秒记方便快速记账。
</view>
Expand Down Expand Up @@ -175,6 +175,7 @@
const index = this.templateList.findIndex(item => item._id === this.secondTwoData.tempId)
if (index !== -1) {
this.secondTwoTemp = formatOneTemplate(this.templateList[index])
console.log('this.secondTwoTemp: ',this.secondTwoTemp);
}
}
},
Expand Down

0 comments on commit a8a2ebb

Please sign in to comment.