diff --git a/components/indexCom/eventChild/index.wxml b/components/indexCom/eventChild/index.wxml index d3cf3a3..ab81bb8 100644 --- a/components/indexCom/eventChild/index.wxml +++ b/components/indexCom/eventChild/index.wxml @@ -17,7 +17,6 @@ - diff --git a/components/indexCom/eventChild/index.wxss b/components/indexCom/eventChild/index.wxss index 536348e..9e63896 100644 --- a/components/indexCom/eventChild/index.wxss +++ b/components/indexCom/eventChild/index.wxss @@ -5,9 +5,10 @@ } .list_event{ margin: 32rpx 0; + padding: 0 0 20rpx 0; background-size: cover; /* width: calc(100% - 32px); */ - height: 616rpx; + /* height: 616rpx; */ border-radius: 8rpx; } diff --git a/components/indexCom/rankingChild/index.wxss b/components/indexCom/rankingChild/index.wxss index cf81474..42b1b9a 100644 --- a/components/indexCom/rankingChild/index.wxss +++ b/components/indexCom/rankingChild/index.wxss @@ -46,7 +46,7 @@ } .brand{ /* width: calc(100% - 32px); */ - height: 488rpx; + height: 520rpx; background-color: #fff; margin: 32rpx 0; border-radius: 4rpx; diff --git a/components/indexCom/soundChild/index.wxss b/components/indexCom/soundChild/index.wxss index dd0f68e..ba55cdd 100644 --- a/components/indexCom/soundChild/index.wxss +++ b/components/indexCom/soundChild/index.wxss @@ -5,7 +5,7 @@ } .brand{ /* width: 100%; */ - height: 484rpx; + height: 520rpx; background-color: rgb(255, 255, 255); margin: 32rpx 0; border-radius: 4rpx; @@ -13,6 +13,8 @@ .brand_tu{ width: 100%; height: 350rpx; + margin-bottom: 30rpx; + padding-bottom: 30rpx; } .text{ font-size: 36rpx; diff --git a/contrastPackages/eventRatio/survey/index.wxss b/contrastPackages/eventRatio/survey/index.wxss index 152cbf4..1a01fcc 100644 --- a/contrastPackages/eventRatio/survey/index.wxss +++ b/contrastPackages/eventRatio/survey/index.wxss @@ -9,14 +9,15 @@ font-size: 36rpx; font-weight: bold; margin-left:32rpx ; - height: 100rpx; - line-height: 100rpx; + /* height: 100rpx; + line-height: 100rpx; */ } .table{ height: 380rpx; width: 95%; margin-left:16rpx ; margin-top: 32rpx; + padding-bottom: 24rpx; } .table_pie{ height: 380rpx; diff --git a/pages/brandCrisis/chooseModel/index.js b/pages/brandCrisis/chooseModel/index.js index 4331ce0..45723ac 100644 --- a/pages/brandCrisis/chooseModel/index.js +++ b/pages/brandCrisis/chooseModel/index.js @@ -52,8 +52,9 @@ Page({ noop() {}, save() { wx.setStorageSync("sSeriesArr", this.data.result.toString()); - wx.redirectTo({ - url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.brand + wx.navigateBack({ + delta: 1 + // url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.brand }) } }) \ No newline at end of file diff --git a/pages/brandCrisis/crisiSet/index.js b/pages/brandCrisis/crisiSet/index.js index 67edada..e3800f9 100644 --- a/pages/brandCrisis/crisiSet/index.js +++ b/pages/brandCrisis/crisiSet/index.js @@ -60,13 +60,16 @@ Page({ this.setData({ checked: detail }); - app.globalData.request({ + let data = { action: 'addOrUpdSwsQyQuartzList', - data: { + data: JSON.stringify({ Id: this.data.Id, Statu: Statu - }, + }), token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' + } + app.globalData.request(data).then(() =>{ + }) }, handlerModel() { diff --git a/pages/brandCrisis/index.wxml b/pages/brandCrisis/index.wxml index 1fa88ed..0d47246 100644 --- a/pages/brandCrisis/index.wxml +++ b/pages/brandCrisis/index.wxml @@ -122,7 +122,7 @@ - 危机事件推送设置 + 危机推送设置 diff --git a/pages/index/Brandsales/Brandsales.js b/pages/index/Brandsales/Brandsales.js index 0a37245..b232f15 100644 --- a/pages/index/Brandsales/Brandsales.js +++ b/pages/index/Brandsales/Brandsales.js @@ -5,6 +5,8 @@ import { times2 } from "../../../components/option/text" import moment from "moment"; +let iPageIndex = 1 // 当前第几页,0代表第一页 +let iPageSize = 20 //每页显示多少数据 Page({ /** * 页面的初始数据 @@ -19,7 +21,8 @@ Page({ ranking: [], carName: "", showDialog: false, - loadMore: false + loadMore: false, //"上拉加载"的变量,默认false,隐藏 + loadAll: false, //“没有数据”的变量,默认false,隐藏 }, dropdownSel(e) { this.setData({ @@ -27,50 +30,75 @@ Page({ }) }, getData() { - app.globalData.request({ - action: 'getCheZhuCarSeriesListHome', + let obj = { + action: 'getCheZhuCarBrandTimeRankingHome', sType: 'Marketing', sBrand: this.data.carName || '', sStartTime: this.data.date || "", sEndTime: this.data.date2 || '', - }).then(res => { - const arr = [] - const time = [] - const obj = {} - var totalSum = 0 - var num = 0 - - res.forEach(i => { - totalSum += parseInt(i.salescount) - // console.log(i.salescount) - if (!obj[i.sourcetime]) { - obj[i.sourcetime] = [] - time.push(i.sourcetime) - num++ - } - obj[i.sourcetime].push(i) + iPageIndex: iPageIndex, + iPageSize: iPageSize, + } + //第一次加载数据 + if (iPageIndex == 1) { + this.setData({ + loadMore: true, //把"上拉加载"的变量设为true,显示 + loadAll: false //把“没有数据”设为false,隐藏 }) - for (let j = 0; j < num; j++) { - var sum = 0 - for (let a = 0; a < obj[time[j]].length; a++) { - sum += parseInt(obj[time[j]][a].salescount) - } - arr.push({ - times: time[j], - sales: sum, - share: ((sum / totalSum) * 100).toFixed(2), - brand: this.data.carName + } + app.globalData.request(obj).then(res => { + if (res && res.length > 0) { + iPageIndex++; + // const arr = [] + // const time = [] + // const obj = {} + // var totalSum = 0 + // var num = 0 + + // res.forEach(i => { + // totalSum += parseInt(i.salescount) + // // console.log(i.salescount) + // if (!obj[i.sourcetime]) { + // obj[i.sourcetime] = [] + // time.push(i.sourcetime) + // num++ + // } + // obj[i.sourcetime].push(i) + // }) + // for (let j = 0; j < num; j++) { + // var sum = 0 + // for (let a = 0; a < obj[time[j]].length; a++) { + // sum += parseInt(obj[time[j]][a].salescount) + // } + // arr.push({ + // times: time[j], + // sales: sum, + // share: ((sum / totalSum) * 100).toFixed(2), + // brand: this.data.carName + // }) + // } + // if (arr.length == 0) { + // this.data.loadMore = true + // } else { + // this.data.loadMore = false + // } + let arr = this.data.ranking.concat(res); + this.setData({ + ranking: arr, + loadMore: false }) - } - if (arr.length == 0) { - this.data.loadMore = true + if (res.length < iPageSize) { + this.setData({ + loadMore: false, //隐藏加载中。。 + loadAll: true //所有数据都加载完了 + }); + } } else { - this.data.loadMore = false + this.setData({ + loadAll: true, //把“没有数据”设为true,显示 + loadMore: false //把"上拉加载"的变量设为false,隐藏 + }); } - this.setData({ - ranking: arr, - loadMore: this.data.loadMore - }) }) }, @@ -81,7 +109,6 @@ Page({ }, //详情跳转 detail(e) { - console.log(e) const carBrand = e.currentTarget.dataset.carbrand const carTime = e.currentTarget.dataset.cartime // console.log(carbrand,carTime) @@ -109,8 +136,11 @@ Page({ let isBefore = moment(this.data.date2).isBefore(this.data.date) // console.log(isBefore) if (!isBefore) { + iPageIndex = 1 + iPageSize = 20 this.setData({ - date: e.detail.value + date: e.detail.value, + ranking: [], }) this.getData() } else { @@ -123,8 +153,11 @@ Page({ this.data.date2 = e.detail.value let isBefore = moment(this.data.date2).isBefore(this.data.date) if (!isBefore) { + iPageIndex = 1 + iPageSize = 20 this.setData({ - date2: e.detail.value + date2: e.detail.value, + ranking: [], }) this.getData() } else { @@ -145,6 +178,7 @@ Page({ this.data.date = options.date this.data.date2 = options.date2 } + iPageIndex = 1; this.getData() this.setData({ @@ -163,7 +197,16 @@ Page({ }, onReachBottom: function () { - console.log("触发刷行") + console.log("上拉触底事件") + let that = this + if (!that.data.loadMore) { + that.setData({ + loadMore: true, //加载中 + loadAll: false //是否加载完所有数据 + }); + //加载更多,这里做下延时加载 + that.getData(); + } }, onShow: function (options) {} }) \ No newline at end of file diff --git a/pages/index/Brandsales/Brandsales.wxml b/pages/index/Brandsales/Brandsales.wxml index 07bd093..7b0022f 100644 --- a/pages/index/Brandsales/Brandsales.wxml +++ b/pages/index/Brandsales/Brandsales.wxml @@ -23,11 +23,11 @@ - {{item.times}} - {{item.sales}} + {{item.sourcetime}} + {{item.salescount}} - {{item.share}} - + {{item.percentage}} + 详细销量 @@ -35,9 +35,8 @@ - + + 结束时间不能小于开始时间 diff --git a/pages/index/detailedvolume/detailedvolume.js b/pages/index/detailedvolume/detailedvolume.js index ff610f0..1383537 100644 --- a/pages/index/detailedvolume/detailedvolume.js +++ b/pages/index/detailedvolume/detailedvolume.js @@ -1,47 +1,82 @@ // pages/index/detailedvolume/detailedvolume.js const app = getApp(); +let iPageIndex = 1 // 当前第几页,0代表第一页 +let iPageSize = 20 //每页显示多少数据 Page({ /** * 页面的初始数据 */ data: { - content:[], + content: [], + loadMore: false, //"上拉加载"的变量,默认false,隐藏 + loadAll: false, //“没有数据”的变量,默认false,隐藏 }, /** * 生命周期函数--监听页面加载 */ - onLoad(options) { - console.log(this.options) - this.getData(this.options.brand,this.options.time) + onLoad() { + let pages = getCurrentPages(); + let currentPage = pages[pages.length - 1] + let options = currentPage.options + this.setData({ + brand: options.brand, + time:options.time + }) + iPageIndex = 1; + this.getData() }, - getData(carbrand,cartime ){ - app.globalData.request({ - action: 'getCheZhuCarSeriesListHome', - sType: 'Marketing', - sTimeType:'4', - sBrand:carbrand||'', - sStartTime:cartime||'', - sEndTime:cartime||'' - }).then(res => { - console.log(res) - const arr=[] - res.forEach(e => { - let obj={ - models:e.carseries, - count:e.salescount, - space:e.specname, - specm:e.specpm, - salespm:e.salespm - } - arr.push(obj) - }); - + getData() { + let obj = { + action: 'getCheZhuCarSeriesListHome', + sType: 'Marketing', + sTimeType: '4', + sBrand: this.data.brand, + sStartTime: this.data.time, + sEndTime: this.data.time, + } + //第一次加载数据 + if (iPageIndex == 1) { this.setData({ - content:arr - })}) - + loadMore: true, //把"上拉加载"的变量设为true,显示 + loadAll: false //把“没有数据”设为false,隐藏 + }) + } + app.globalData.request(obj).then(res => { + console.log(res) + // const arr=[] + // res.forEach(e => { + // let obj={ + // models:e.carseries, + // count:e.salescount, + // space:e.specname, + // specm:e.specpm, + // salespm:e.salespm + // } + // arr.push(obj) + // }); + if (res && res.length > 0) { + iPageIndex++; + let arr = this.data.content.concat(res); + this.setData({ + content: arr, + loadMore: false + }) + if (res.length < iPageSize) { + this.setData({ + loadMore: false, //隐藏加载中。。 + loadAll: true //所有数据都加载完了 + }); + } + } else { + this.setData({ + loadAll: true, //把“没有数据”设为true,显示 + loadMore: false //把"上拉加载"的变量设为false,隐藏 + }); + } + }) + }, /** @@ -83,6 +118,16 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom() { + console.log("上拉触底事件") + let that = this + if (!that.data.loadMore) { + that.setData({ + loadMore: true, //加载中 + loadAll: false //是否加载完所有数据 + }); + //加载更多,这里做下延时加载 + that.getData(); + } }, diff --git a/pages/index/detailedvolume/detailedvolume.wxml b/pages/index/detailedvolume/detailedvolume.wxml index 12fde88..c96515c 100644 --- a/pages/index/detailedvolume/detailedvolume.wxml +++ b/pages/index/detailedvolume/detailedvolume.wxml @@ -12,12 +12,14 @@ - {{item.models}} - {{item.count}} + {{item.carseries}} + {{item.salescount}} - {{item.space}} - {{item.specm}}/{{item.salespm}} + {{item.specname}} + {{item.specpm}}/{{item.salespm}} + + \ No newline at end of file diff --git a/pages/index/detailedvolume/detailedvolume.wxss b/pages/index/detailedvolume/detailedvolume.wxss index 4a8c146..4eb8963 100644 --- a/pages/index/detailedvolume/detailedvolume.wxss +++ b/pages/index/detailedvolume/detailedvolume.wxss @@ -1,9 +1,10 @@ /* pages/index/detailedvolume/detailedvolume.wxss */ .box{ width: 686rpx; - height: 1302rpx; + /* height: 1302rpx; */ background: #ffffff; margin: 32rpx; + padding: 32rpx 0; border-radius: 8rpx; } .box_left{ @@ -43,4 +44,11 @@ line-height: 104rpx; background: #ffffff; +} +.loading { + position: relative; + bottom: 5rpx; + padding: 10rpx; + text-align: center; + font-size: 12px; } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index ba276ba..b9c9184 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -28,6 +28,13 @@ "query": "", "launchMode": "default", "scene": null + }, + { + "name": "", + "pathName": "pages/index/Salesranking/Allbrands/Allbrands", + "query": "", + "launchMode": "default", + "scene": null } ] }