Commit cb9e41f4 authored by Facius's avatar Facius
parents 1d405460 994342a4
Pipeline #2911 canceled with stages
......@@ -137,15 +137,11 @@ export default {
try {
let { data } = await getBillTypes({ type: this.form.type });
let list = [];
let resData = [...data];
data.forEach((item, index) => {
if (index === 0 && item.id !== 'setting') {
this.form.classificationId = item.id;
}
if (index % this.limit === 0) {
list.push(resData.slice(index, index + this.limit));
}
});
let resData = this.deepClone(data);
if (!this.form.classificationId && data[0]) {
this.form.classificationId = data[0].id;
}
list = this.chunk(resData, this.limit);
if (list[list.length - 1].length < this.limit) {
list[list.length - 1].push(this.settingItem);
} else {
......@@ -157,6 +153,20 @@ export default {
console.log(e);
}
},
chunk(arr, num) {
// let j = 0,
// o = j;
let newArray = [];
for (let i = 0; i < arr.length; i += num) {
newArray.push(arr.slice(i, i + num));
}
// while (j < arr.length) {
// j += num;
// newArray.push([arr.slice(o, j)]);
// o = j;
// }
return newArray;
},
async getQiniuToken() {
try {
let { data } = await getQiNiuToken();
......@@ -169,7 +179,7 @@ export default {
this.getQiniuToken();
if (id) {
this.id = id;
this.getDetail()
this.getDetail();
} else {
this.form = {
type: 'INCOME',
......@@ -189,8 +199,9 @@ export default {
let { data } = await get({ id: this.id });
data.classificationId = data.classification.id;
data.type = data.type.code;
data.happenTime = this.parseTime(data.happenTime,'{y}-{m}-{d}')
data.happenTime = this.parseTime(data.happenTime, '{y}-{m}-{d}');
this.form = data;
await this.getBillTypeOptions();
this.show = true;
} catch (e) {
console.log(e);
......@@ -263,6 +274,7 @@ export default {
billingTypeChange(e) {
console.log(e);
this.form.type = e.value;
this.getBillTypeOptions();
},
openCalendarPopup() {
this.$refs['calendar-popup'].open();
......@@ -349,7 +361,7 @@ export default {
justify-content: center;
font-size: 24upx;
color: #333333;
&-text{
&-text {
text-align: right;
width: 140rpx;
height: 48upx;
......
......@@ -9,7 +9,7 @@
<image :src="billBaseUrl + item.recordSelectedIcon" mode="" v-if="item.id === checked || item.id === 'setting'"></image>
<image :src="billBaseUrl + item.recordIcon" mode="" v-else></image>
</view>
<view class="billing-category-item-text" :class="{'billing-category-item-setting':item.id === 'setting'}">
<view class="billing-category-item-text ellipsis" :class="{'billing-category-item-setting':item.id === 'setting'}">
<text>{{ item.name }}</text>
<u-icon name="arrow-right" v-if="item.id === 'setting'" class="billing-category-item-setting-icon"></u-icon>
</view>
......@@ -83,8 +83,9 @@ export default {
}
}
&-item {
height: 136rpx;
padding: 0 22upx;
height: 140rpx;
padding: 0 12upx;
width: 16.66%;
padding-bottom: 32upx;
font-size: 28upx;
color: #8d8d8d;
......@@ -99,9 +100,11 @@ export default {
border-radius: 50%;
}
&-text {
width: 100%;
text-align: center;
margin-top: 12upx;
font-size: 20upx;
line-height: 20upx;
line-height: 24upx;
color: #8d8d8d;
}
&-setting{
......
......@@ -22,7 +22,7 @@
</view>
<view class="card-bdoy-images" v-if="detail.attach">
<view class="card-bdoy-images-item" v-for="(item, index) in detail.attach" :key="index">
<image :src="item" v-if="item" @click="preview(item, index)"></image>
<image :src="item" mode="aspectFit" v-if="item" @click="preview(item, index)"></image>
</view>
</view>
</view>
......
......@@ -3,6 +3,7 @@
<view>
<view class="calendar">
<lunc-calendar
ref="lunc-calendar"
:showLunar="true"
:showMonthBg="false"
:shouChangeBtn="true"
......@@ -15,7 +16,7 @@
></lunc-calendar>
</view>
<view class=""><plan-view ref="plan-view" :day="date"></plan-view></view>
<mid-popup ref="midPopup"></mid-popup>
<mid-popup ref="midPopup" v-if="ready"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
</template>
......@@ -25,7 +26,7 @@ import MidPopup from '@/components/mid-popup/mid-popup.vue';
import NavbarNormal from '@/components/navbar-normal';
import PlanView from './components/plan-view.vue';
import { tabbar } from '@/utils/settings.js';
import {getSign} from "@/api/schedule/index.js"
import { getSign } from '@/api/schedule/index.js';
export default {
components: {
MidPopup,
......@@ -36,31 +37,24 @@ export default {
return {
tabbar,
signList: [
{
date: '2022-07-08',
// title: '张三生日',
// info: '八月初四张三生日'
},
{
date: '2022-07-09',
// title: '生日',
// info: '八月初四张三生日'
},
{
date: '2022-07-12'
// title: '朋友聚会'
}
// {
// date: '2022-07-08'
// title: '张三生日',
// info: '八月初四张三生日'
// },
],
date: '',
month:'',
firstEnter: true
month: '',
firstEnter: true,
ready:false
};
},
onReady() {
this.date = this.parseTime(new Date(), '{y}-{m}-{d}');
this.month = this.parseTime(new Date(), '{y}-{m}')+'-01';
this.month = this.parseTime(new Date(), '{y}-{m}') + '-01';
this.getList();
this.getSignList()
this.getSignList();
this.ready=true
},
onShow() {
if (!this.firstEnter) {
......@@ -85,27 +79,41 @@ export default {
},
monthChange(e) {
console.log('monthChange', e);
let {date}=e
this.month=this.parseTime(date, '{y}-{m}')+'-01';
this.getSignList()
let { date } = e;
this.month = this.parseTime(date, '{y}-{m}') + '-01';
this.getSignList();
},
chooseMonth(selDate) {
console.log('selDate', selDate);
let {date}=e
this.month=this.parseTime(date, '{y}-{m}')+'-01';
this.getSignList()
let { date } = e;
this.month = this.parseTime(date, '{y}-{m}') + '-01';
this.getSignList();
},
getList() {
this.$refs['plan-view'].getList(this.date);
this.firstEnter = false;
},
async getSignList(){
try{
let params={
month:this.month
async getSignList() {
try {
let params = {
month: this.month
};
let { data } = await getSign(params);
if (data) {
this.signList = data.map(item => {
return {
date: item.t1,
info: '',
title: ''
};
});
console.log(this.signList)
this.$nextTick(()=>{
this.$refs["lunc-calendar"].init(this.date)
})
}
let res=await getSign(params)
}catch(e){
} catch (e) {
console.log(e)
//TODO handle the exception
}
}
......
......@@ -246,7 +246,9 @@ export default {
let sY = new Date(item.date).getFullYear();
let sM = new Date(item.date).getMonth() + 1;
let sD = new Date(item.date).getDate();
if (sY == year && sM == month && sD == day) daySign = item;
if (sY == year && sM == month && sD == day){
daySign = item
};
});
let dayInfo = { day, sYear: year, sMonth: month, week, lunar, dayLunar, isFestival, isToday, dayType, daySign };
let dayClass = this.getDayClass(dayInfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment