|
|
@@ -159,8 +159,48 @@ export default {
|
|
|
const systemInfo = uni.getSystemInfoSync()
|
|
|
this.statusBarHeight = systemInfo.statusBarHeight || 0
|
|
|
// this.getData()
|
|
|
+ this.getZwList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getZwList(){
|
|
|
+ this.$Request.getT("/app/postPush/getMyPostPush").then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ res.data.records.forEach(item=>{
|
|
|
+ this.zwList.push({
|
|
|
+ name:item.ruleClassifyName,
|
|
|
+ id:item.postPushId
|
|
|
+ })
|
|
|
+ this.getDataStatics()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDataStatics(){
|
|
|
+ let data = {
|
|
|
+ postPushId:this.zwList[this.zwIndex].postPushId,
|
|
|
+ todayStart:this.formatDateRange(new Date(),new Date())[0],
|
|
|
+ todayEnd:this.formatDateRange(new Date(),new Date())[1],
|
|
|
+ }
|
|
|
+ this.$Request.getT("/app/user/userYesterdayData",data).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ formatDateRange(startDate, endDate) {
|
|
|
+ // 格式化日期为 YYYY-MM-DD 格式
|
|
|
+ const formatDate = (date) => {
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
+ const day = String(date.getDate()).padStart(2, '0');
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 创建开始日期的 00:00:00
|
|
|
+ const startDateTime = `${formatDate(startDate)} 00:00:00`;
|
|
|
+
|
|
|
+ // 创建结束日期的 23:59:59
|
|
|
+ const endDateTime = `${formatDate(endDate)} 23:59:59`;
|
|
|
+
|
|
|
+ return [startDateTime, endDateTime];
|
|
|
+ },
|
|
|
changeZw (e){
|
|
|
this.zwIndex=e.detail.value
|
|
|
},
|