<html>
<!-- 日期调用 -->
<div class="center">
<div class="center-one">
<div class="left">
<text type="date" value="{{params.gregoriandate}}"></text>
</div>
<div class="right">
<text>农历{{params.lunardate}}</text>
</div>
</div>
<div class="center-two">
<div class="text-div">
<text class="text">{{params.day}}</text>
</div>
</div>
<div class="center-three">
<div class="text-div">
<div class="left">
<text>{{params.week}}</text>
</div>
<div class="right">
<!-- <text class="text">{{params.weekEng}}</text> -->
</div>
</div>
</div>
<div class="center-four">
<div class="text-div">
<text class="text-four">{{params.fitness}}</text>
</div>
</div>
</div>
<js>
private: {
"params": {
gregoriandate: '',
lunardate: '',
date: '',
day: '',
weekEng:'',
fitness: '',
},
},
ranbowIndex(){
var _this = this
fetch.fetch({
url:'https://app.kuaiyingyong.vip/qucikapp/life/date',
responseType: 'json'
}).then(res => {
var data=res.data.data.data;
if(data.code==200){
var list=data.newslist;
for(var i=0;i<list.length;i++){
var data=list[i];
var gregoriandate= new Date(data.gregoriandate)
gregoriandate=gregoriandate.getFullYear()+"年"+(gregoriandate.getMonth()+1)+"月";
_this.params.gregoriandate =gregoriandate;
_this.params.day = new Date(data.gregoriandate).getDate();
if(data.id){
_this.id=data.id;
}
_this.params.lunardate=data.lubarmonth+data.lunarday;
_this.params.fitness=data.fitness;
}
}else{
alert("网络繁忙,请稍后重试");
}
})
},
css
在这里插入代码片
|