project init

This commit is contained in:
limqhz
2022-11-11 21:51:57 +08:00
parent e9e20765f2
commit 82dbb842ba
68 changed files with 2771 additions and 43 deletions

View File

@@ -1,7 +1,5 @@
{
"component": true,
"usingComponents": {
"t-tab-bar": "/components/tab-bar/tab-bar",
"t-tab-bar-item": "/components/tab-bar/tab-bar-item"
}
}

View File

@@ -1,11 +1,15 @@
// pages/today/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
aIconList: ['check-rectangle','star-filled','notification','info-circle'],
aIconList: ['check-rectangle', 'star-filled', 'notification', 'info-circle'],
taskList: [{'taskId':'1','title':'标题德外旗舰店1','note':'2022-11-11'},{'taskId':'2','title':'标题德外旗舰店2','note':'2022-11-11'}],
todayList: [{'taskId':'1','title':'标题德外旗舰店1','note':'2022-11-11'},{'taskId':'2','title':'标题德外旗舰店2','note':'2022-11-11'}],
delayList: [{'taskId':'1','title':'标题德外旗舰店1','note':'2022-11-11'}],
},
/**
@@ -26,41 +30,30 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
wx.showLoading({
title: '请稍候...',
mask: true,
})
console.log('请求中...')
app.$api.taskList({}).then(res =>{
console.log(res);
console.log(res.data);
this.setData({
taskList:res.data.taskList,
})
})
},
onEdit(e) {
console.log('收藏' + e.currentTarget.dataset.id);
},
onDelete(e) {
console.log('删除' + e.currentTarget.dataset.id);
},
onTabsChange(event) {
console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
onTabsClick(event) {
console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -1,5 +1,42 @@
<!--pages/today/index.wxml-->
<text>今日任务</text>
<t-tabs
defaultValue="{{0}}"
bind:change="onTabsChange"
bind:click="onTabsClick"
showBottomLine="{{false}}"
t-class="custom-tabs"
>
<t-tab-panel label="任务清单" value="0">
<t-swipe-cell wx:for="{{taskList}}" wx:key="{{index}}" >
<t-cell class="text_ath" title="{{item.title}}" note="{{item.note}}" bordered="{{true}}" hover/>
<view slot="right" class="t-swipe-cell-demo-btn-wrapper">
<view class="t-swipe-cell-demo-btn favor-btn" data-id='{{item.taskId}}' bind:tap="onEdit">收藏</view>
<view class="t-swipe-cell-demo-btn delete-btn" data-id='{{item.taskId}}' bind:tap="onDelete">删除</view>
</view>
</t-swipe-cell>
</t-tab-panel>
<t-tab-panel label="收藏任务" value="1">
<t-swipe-cell wx:for="{{todayList}}" wx:key="{{index}}" >
<t-cell class="text_ath" title="{{item.title}}" note="{{item.note}}" bordered="{{true}}" hover/>
<view slot="right" class="t-swipe-cell-demo-btn-wrapper">
<view class="t-swipe-cell-demo-btn delete-btn" data-id='{{item.taskId}}' bind:tap="onDelete">删除</view>
</view>
</t-swipe-cell>
</t-tab-panel>
<t-tab-panel label="延期任务" value="2">
<t-swipe-cell wx:for="{{delayList}}" wx:key="{{index}}" >
<t-cell class="text_ath" title="{{item.title}}" note="{{item.note}}" bordered="{{true}}" hover/>
<view slot="right" class="t-swipe-cell-demo-btn-wrapper">
<view class="t-swipe-cell-demo-btn delete-btn" data-id='{{item.taskId}}' bind:tap="onDelete">删除</view>
</view>
</t-swipe-cell>
</t-tab-panel>
</t-tabs>
<cover-view class='phone-box' style='bottom: 170rpx' bindtap='callPhone'>
<cover-image icon="add"></cover-image>
<button class='hide-btn'></button>
</cover-view>
<t-fab icon="add" bind:click="handleClick"></t-fab>
<view>
<foot-tab iconList="{{aIconList}}"/>
</view>

View File

@@ -1 +1,52 @@
/* pages/today/index.wxss */
/* pages/today/index.wxss */
.t-swipe-cell-demo-btn-wrapper {
height: 100%;
}
.t-swipe-cell-demo-btn {
display: inline-flex;
justify-content: center;
align-items: center;
width: 144rpx !important;
height: 100%;
text-align: center;
color: white;
}
.t-swipe-cell-demo-btn.delete-btn {
background-color: #e34d59;
}
.t-swipe-cell-demo-btn.edit-btn {
background-color: #ed7b2f;
}
.t-swipe-cell-demo-btn.favor-btn {
background-color: #0052d9;
}
.title-image-large {
margin-right: 8rpx;
width: 144rpx;
height: 144rpx;
}
.text_ath {
text-decoration:line-through
}
.custom-tabs t-tab-panel {
text-align: center;
justify-content: center;
height: 172rpx;
line-height: 172rpx;
color: rgba(0, 0, 0, 0.26);
}
.phone-box {
position: absolute;
bottom: 30rpx;
left: 30rpx;
width: 130rpx;
height: 130rpx;
}