dev
liuyongli 3 years ago
parent bf90b06c32
commit 0e4de72dc7

@ -17,7 +17,6 @@
</view>
</view>
</view>
</view>
<view class="content" wx:for="{{questes}}" wx:if="{{index > 5}}" wx:key="events_id" data-id='{{item.events_id}}' bindtap="toEventDetail">
<view class="content_event">

@ -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;
}

@ -46,7 +46,7 @@
}
.brand{
/* width: calc(100% - 32px); */
height: 488rpx;
height: 520rpx;
background-color: #fff;
margin: 32rpx 0;
border-radius: 4rpx;

@ -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;

@ -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;

@ -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
})
}
})

@ -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() {

@ -122,7 +122,7 @@
<view slot="title">
<view class="bc-ws-dd">
<image class="bc-ws-m1" src="{{imageUrl}}/setting-one.png" />
<text style="font-weight: 600;">危机事件推送设置</text>
<text style="font-weight: 600;">危机推送设置</text>
</view>
</view>
</van-cell>

@ -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) {}
})

@ -23,11 +23,11 @@
</view>
<view class="ranks" wx:for="{{ranking}}" wx:key="index" data-ranking='{{item}}'>
<view style="display: flex;">
<view class="time_text" style="width: 30%;"> {{item.times}}</view>
<view class="media_text" style="width: 30%;">{{item.sales}}</view>
<view class="time_text" style="width: 30%;"> {{item.sourcetime}}</view>
<view class="media_text" style="width: 30%;">{{item.salescount}}</view>
<view style="width: 40%;">
<view class="volume">{{item.share}}</view>
<view class="trend" bindtap="detail" data-carTime="{{item.times}}" data-carBrand="{{item.brand}}">
<view class="volume">{{item.percentage}}</view>
<view class="trend" bindtap="detail" data-carTime="{{item.sourcetime}}" data-carBrand="{{item.brand}}">
<view>详细销量</view>
</view>
</view>
@ -35,9 +35,8 @@
</view>
</view>
<view hidden="{{!loadMore}}" style="font-size: 24rpx;text-align: center;">
该品牌暂无销售量
</view>
<view class="loading" hidden="{{!loadMore}}">正在载入更多...</view>
<view class="loading" hidden="{{!loadAll}}">已加载全部</view>
<van-dialog use-slot title="注意" show="{{ showDialog }}" bind:confirm="cdialog">
<view class="tc-d-t">结束时间不能小于开始时间</view>
</van-dialog>

@ -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();
}
},

@ -12,12 +12,14 @@
</view>
<view class="container" wx:for="{{content}}" wx:key="index" data-content='{{item}}'>
<view class="box_left">
<view class="title">{{item.models}} </view>
<view class="num">{{item.count}}</view>
<view class="title">{{item.carseries}} </view>
<view class="num">{{item.salescount}}</view>
</view>
<view class="box_right">
<view class="title">{{item.space}}</view>
<view class="title">{{item.specm}}/{{item.salespm}}</view>
<view class="title">{{item.specname}}</view>
<view class="title">{{item.specpm}}/{{item.salespm}}</view>
</view>
</view>
<view class="loading" hidden="{{!loadMore}}">正在载入更多...</view>
<view class="loading" hidden="{{!loadAll}}">已加载全部</view>
</view>

@ -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;
}

@ -28,6 +28,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/index/Salesranking/Allbrands/Allbrands",
"query": "",
"launchMode": "default",
"scene": null
}
]
}

Loading…
Cancel
Save