dev
liuyongli 3 years ago
parent 8a97578504
commit 6b2300b388

@ -1,112 +1,60 @@
// pages/index/Salesranking/Brandranking/Brandranking.js
const app = getApp()
Page({
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
mockData:[]
},
Allbrands(){
wx.navigateTo({
url: '/pages/index/Salesranking/Allbrands/Allbrands',
})
},
brands(){
wx.navigateTo({
url: '/pages/index/Brandsales/Brandsales',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getTabBar().init();
this.getData();
},
getData() {
//页面数据
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 30000
})
app.globalData.request({
action: 'getUserBrand',
token: 't%2BrswgjvzGM=',
}).then(res => {
let arr = []
for (let i = 65; i <= 90; i++) {
arr.push({
name: String.fromCharCode(i),
data: []
});
}
for(let i of res){
for(let j of arr){
if(i.firstword == j.name){
j.data.push(i)
}
}
}
this.setData({
mockData:arr
lifetimes: {
attached() {
//页面数据
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 300000
})
app.globalData.request({
action: 'getUserBrand',
token: 't%2BrswgjvzGM=',
}).then(res => {
let arr = []
for (let i = 65; i <= 90; i++) {
arr.push({
name: String.fromCharCode(i),
data: []
});
}
for(let i of res){
for(let j of arr){
if(i.firstword == j.name){
j.data.push(i)
}
}
}
this.setData({
mockData:arr
})
setTimeout(() => {
wx.hideToast();
}, 2000)
}
)}
},
methods: {
Allbrands(){
wx.navigateTo({
url: '/pages/index/Salesranking/Allbrands/Allbrands',
})
setTimeout(() => {
wx.hideToast();
}, 1000)
},
brands(){
wx.navigateTo({
url: '/pages/index/Brandsales/Brandsales',
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"component": true
}

@ -1,9 +1,9 @@
<!--pages/index/Salesranking/Brandranking/Brandranking.wxml-->
<view class="event_recom1">
<!-- 占位盒子 -->
<view class="event_box"></view>
<!-- <view class="event_box"></view> -->
<view class="my_cell" bindtap="Allbrands">
<van-image width="48" height="36" src="{{imageUrl}}/carSide.png" />
<view class="all">ALL</view>
<text>全部品牌</text>
</view>
<van-index-bar>

@ -1,6 +1,6 @@
/* pages/index/Salesranking/Brandranking/Brandranking.wxss */
.add1{
width:750rpx;
width:686rpx;
overflow-x:scroll;
white-space: nowrap;
}
@ -73,11 +73,12 @@
font-size: 28rpx;
}
.my_cell{
width: 750rpx;
width: 686rpx;
height: 96rpx;
background: white;
display: flex;
align-items: center;
padding: 0 32rpx;
}
.van-checkbox{
display: inline-block !important;
@ -102,7 +103,17 @@
}
.bs-item-image {
display: inline-block;
width: 80rpx;
height: 80rpx;
margin-right: 20rpx;
width: 96rpx;
height: 96rpx;
margin-right: 24rpx;
}
.all{
background: #027AFF;
width: 72rpx;
height: 72rpx;
line-height: 72rpx;
color: #ffffff;
font-size: 24rpx;
text-align: center;
border-radius: 50rpx;
}

@ -33,6 +33,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getTabBar().init()
},
changeTab(val) {

@ -1,21 +1,10 @@
// pages/index/Salesranking/Vehicletype/Vehicletype.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
date:'2021-01',
accountIndex:0,
accounts: [ // value传给后台的值 label页面上显示的文字
{value:'today', label:'今天'},
{value:'tomorrow', label:'明天'},
{value:'week', label:'本周'},
{value:'month', label:'本月'},
{value:'year', label:'本年'},
],
//列表展示
sortOpt: [
{
@ -27,8 +16,8 @@ Page({
value1: 1
}
],
// 级别
level:[
//级别
level:[
{
text:'全部级别',
value4:'0'
@ -62,8 +51,8 @@ Page({
value4:'7'
}
],
// 价格
Price:[
// 价格
Price:[
{
text:'全部价格',
value5:'0'
@ -177,165 +166,54 @@ Page({
ranking:[],
},
bindDateChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.setData({
date: e.detail.value
})
},
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
},
bindAccountChange(e){
console.log('切换改变的值', e.detail.value);
this.setData({
accountIndex: e.detail.value
})
},
getData() {
//页面数据
app.globalData.request({
action: 'getCheZhuCarSeriesRankingHome',
sType:'Marketing',
sTimeType: 34,
iPageIndex:'',
iPageSize:'',
sBrand:'',
sSeriesName:'',
sStartTime:'',
sEndTime:'',
sSpec:'',
sPriceType:'',
sEnergyType:'',
}).then(res => {
let arr = []
res.forEach(ele =>{
let obj = {
media:ele.seriesname,
volume:ele.salescount,
num:ele.price,
}
arr.push(obj)
})
this.setData({
ranking:arr
})
setTimeout(() => {
wx.hideToast();
}, 1000)
})
},
dropdown(){
lifetimes: {
attached() {
//页面数据
app.globalData.request({
action: 'getEnergy',
action: 'getCheZhuCarSeriesRankingHome',
sType:'Home',
sTimeType: 34,
iPageIndex:'1',
iPageSize:'10',
sSpec:'',
sPriceType:'',
sEnergyType:'',
}).then(res => {
const data = res;
let arr = []
res.forEach(ele => {
res.forEach(ele =>{
let obj = {
text:ele.key,
value6:ele.value
media:ele.seriesname,
volume:ele.salescount,
num:ele.price,
}
arr.push(obj)
})
this.setData({
energy:arr
ranking:arr
})
})
app.globalData.request({
action: 'getPrice',
}).then(res => {
const data = res;
let arr = []
res.forEach(ele => {
let obj = {
text:ele.key,
value4:ele.value
}
arr.push(obj)
})
this.setData({
Price:arr
})
})
app.globalData.request({
action: 'getSpec',
}).then(res => {
const data = res;
let arr = []
res.forEach(ele => {
let obj = {
text:ele.key,
value4:ele.value
}
arr.push(obj)
},
methods: {
bindDateChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.setData({
date: e.detail.value
})
},
priceSel(e){
this.setData({
level:arr
intervalSel: e.currentTarget.dataset.index
})
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getData()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
bindAccountChange(e){
console.log('切换改变的值', e.detail.value);
this.setData({
accountIndex: e.detail.value
})
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"component": true
}

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

Loading…
Cancel
Save