From 810a56e40141eddf36d30bda565ad54852079cba Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Fri, 8 Jul 2022 17:55:08 +0800 Subject: [PATCH 1/3] no message --- app.js | 55 ++-- .../dataChild/dataConfig/dataOption.js | 178 ++++++++++++ .../dataChild/dataConfig/totallist.js | 42 +++ components/indexCom/dataChild/index.js | 260 +++--------------- components/indexCom/dataChild/index.wxml | 6 +- 5 files changed, 295 insertions(+), 246 deletions(-) create mode 100644 components/indexCom/dataChild/dataConfig/dataOption.js create mode 100644 components/indexCom/dataChild/dataConfig/totallist.js diff --git a/app.js b/app.js index a15f4cd..30a547e 100644 --- a/app.js +++ b/app.js @@ -1,22 +1,45 @@ //app.js App({ - onLaunch: function () { - // 展示本地存储能力 - var logs = wx.getStorageSync('logs') || [] - logs.unshift(Date.now()) - wx.setStorageSync('logs', logs) - const systemInfo = wx.getSystemInfoSync(); //获取系统信息 - const menuInfo = wx.getMenuButtonBoundingClientRect(); // 获取胶囊按钮的信息 - this.globalData.menuHeight = menuInfo.height; // 获取胶囊按钮的高 - this.globalData.statusBarHeight = systemInfo.statusBarHeight; // 获取状态栏的高 - this.globalData.menuRight = menuInfo.right; // 获取胶囊按钮的距离屏幕最右边的距离(此处用于设置导航栏左侧距离屏幕的距离) - this.globalData.navBarHeight = (menuInfo.top - systemInfo.statusBarHeight) * 2 + menuInfo.height; // 计算出导航栏的高度 - }, + onLaunch: function () { + // 展示本地存储能力 + var logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + const systemInfo = wx.getSystemInfoSync(); //获取系统信息 + const menuInfo = wx.getMenuButtonBoundingClientRect(); // 获取胶囊按钮的信息 + this.globalData.menuHeight = menuInfo.height; // 获取胶囊按钮的高 + this.globalData.statusBarHeight = systemInfo.statusBarHeight; // 获取状态栏的高 + this.globalData.menuRight = menuInfo.right; // 获取胶囊按钮的距离屏幕最右边的距离(此处用于设置导航栏左侧距离屏幕的距离) + this.globalData.navBarHeight = (menuInfo.top - systemInfo.statusBarHeight) * 2 + menuInfo.height; // 计算出导航栏的高度 + }, globalData: { imageUrl: "https://cdn.sws010.com/wxapp/images", - navBarHeight:0,// 导航栏高度 - menuHeight:0,//胶囊按钮 高度 - statusBarHeight:0,//状态栏高度 - menuRight:0,//胶囊按钮 距离屏幕右边的距离 + navBarHeight: 0, // 导航栏高度 + menuHeight: 0, //胶囊按钮 高度 + statusBarHeight: 0, //状态栏高度 + menuRight: 0, //胶囊按钮 距离屏幕右边的距离 + request: function (prarms) { + return new Promise((resolve, reject) => { + wx.request({ + url: 'http://cloud.sws010.com/api/v7.ashx', + data: { + version: "0.0.1", + ...prarms + }, + method: 'get', + success: function (res) { + //接口实际返回的内容在res.data中 + if (res.data.Code == 1) { + resolve(res.data.Data); + } else { + reject(res.data) + } + }, + fail: function (err) { + reject(err); + } + }) + }) + } } }) \ No newline at end of file diff --git a/components/indexCom/dataChild/dataConfig/dataOption.js b/components/indexCom/dataChild/dataConfig/dataOption.js new file mode 100644 index 0000000..7c3bd57 --- /dev/null +++ b/components/indexCom/dataChild/dataConfig/dataOption.js @@ -0,0 +1,178 @@ +export default { + tooltip: { + trigger: 'axis', + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line' // 默认为直线,可选为:'line' | 'shadow' + }, + confine: true + }, + + legend: { + icon: 'rectangle',//data图标样式 + itemWidth: 8,//data图标大小 + itemHeight: 8, + left: 5, + textStyle: { + fontSize: 8, + fontWeight: 400 + }, + data: ['微博', '其他','短视频', '微信','APP', '论坛', '新闻'], + // color:['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF'], + }, + //图表位置 + grid: { + left: 7, + right: 7, + bottom: 7, + top: 36, + containLabel: true + }, + yAxis: [ + { + type: 'value', + axisTick:{ + show:false //去除刻度线 + }, + axisLine:{ + show:false //去除轴线 + }, + axisLabel: { + color: '#999999',//y轴文本颜色 + textStyle: { + fontSize : 9 + } + }, + splitLine: { //分割线 + // lineStyle:{ + // // color:"#2d3436" + + // } + show: true, + lineStyle: { + type: 'dashed', + color: '#E8E8E8', + } + } + } + ], + xAxis: [ + { + type: 'category', + data: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00'], + axisTick:{ + show:false //去除刻度线 + }, + axisLine:{ + show:false, //去除轴线 + }, + axisLabel: { + color: '#999999',//x轴文本颜色 + textStyle: { + fontSize : 9 + } + + } + } + ], + series: [ + { + name: '微博', + type: 'line', + symbol:'none', //去圆点 + data: [1400, 2000, 1500, 1800, 1490, 900, 310], + itemStyle: { + normal:{ + color: '#FF4852', + lineStyle: { + color: '#FF4852' + } + } + } + }, + { + name: '其他', + type: 'line', + symbol:'none', //去圆点 + data: [1520, 1052, 141, 174, 1690, 250, 220], + itemStyle: { + normal:{ + color: '#FF6E25', + lineStyle: { + color: '#FF6E25' + } + } + } + }, + { + name: '短视频', + type: 'line', + symbol:'none', //去圆点 + data: [210, 322, 551, 364, 960, 1307, 10], + itemStyle: { + normal:{ + color: '#FFBF00', + lineStyle: { + color: '#FFBF00' + } + } + } + + }, + { + name: '微信', + type: 'line', + symbol:'none', //去圆点 + data: [250, 362, 71, 374, 970, 130, 170], + itemStyle: { + normal:{ + color: '#20CC62', + lineStyle: { + color: '#20CC62' + } + } + } + }, + { + name: 'APP', + type: 'line', + symbol:'none', //去圆点 + data: [20, 32, 41, 354, 90, 130, 10], + itemStyle: { + normal:{ + color: '#00D6D6', + lineStyle: { + color: '#00D6D6' + } + } + } + }, + { + name: '论坛', + type: 'line', + symbol:'none', //去圆点 + data: [200, 382, 661, 34, 909, 1308, 150], + itemStyle: { + normal:{ + color: '#00AAFF', + lineStyle: { + color: '#00AAFF' + } + } + } + }, + { + name: '新闻', + type: 'line', + symbol:'none', //去圆点 + data: [250, 326, 178, 349, 900, 1300, 140], + itemStyle: { + normal:{ + color: '#7257FF', + lineStyle: { + color: '#7257FF' + } + } + } + } + ] + } \ No newline at end of file diff --git a/components/indexCom/dataChild/dataConfig/totallist.js b/components/indexCom/dataChild/dataConfig/totallist.js new file mode 100644 index 0000000..60e7ad4 --- /dev/null +++ b/components/indexCom/dataChild/dataConfig/totallist.js @@ -0,0 +1,42 @@ +export default [ + { + url:'/ruku.png', + text:'入库数据', + num:'198,897,987', + }, + { + url:'/weibo.png', + text:'微博数据', + num:'198,897,987' + }, + { + url:'/shipin.png', + text:'短视频数据', + num:'198,897,987' + }, + { + url:'/weixin.png', + text:'微信数据', + num:'198,897,987' + }, + { + url:'/app.png', + text:'APP数据', + num:'198,897,987' + }, + { + url:'/luntan.png', + text:'论坛数据', + num:'198,897,987' + }, + { + url:'/xinwen.png', + text:'新闻数据', + num:'198,897,987' + }, + { + url:'/qita.png', + text:'其他数据', + num:'198,897,987' + }, +] \ No newline at end of file diff --git a/components/indexCom/dataChild/index.js b/components/indexCom/dataChild/index.js index fb91287..16f05e6 100644 --- a/components/indexCom/dataChild/index.js +++ b/components/indexCom/dataChild/index.js @@ -1,240 +1,46 @@ - +const app = getApp(); +import totallist from "./dataConfig/totallist" +import dataOption from "./dataConfig/dataOption" Component({ data: { imageUrl: getApp().globalData.imageUrl, active:0, + countYear: 0, + count6month: 0, + countAll: 0, timelist: ['二十四小时', '最近七天', '最近三十天', '自定义'], - totallist:[ - { - url:'/ruku.png', - text:'入库数据', - num:'198,897,987' - }, - { - url:'/weibo.png', - text:'微博数据', - num:'198,897,987' - }, - { - url:'/shipin.png', - text:'短视频数据', - num:'198,897,987' - }, - { - url:'/weixin.png', - text:'微信数据', - num:'198,897,987' - }, - { - url:'/app.png', - text:'APP数据', - num:'198,897,987' - }, - { - url:'/luntan.png', - text:'论坛数据', - num:'198,897,987' - }, - { - url:'/xinwen.png', - text:'新闻数据', - num:'198,897,987' - }, - { - url:'/qita.png', - text:'其他数据', - num:'198,897,987' - }, - - ], + totallist: totallist, showChart: true, - chartOption: { - tooltip: { - trigger: 'axis', - axisPointer: { // 坐标轴指示器,坐标轴触发有效 - type: 'line' // 默认为直线,可选为:'line' | 'shadow' - }, - confine: true - }, - - legend: { - icon: 'rectangle',//data图标样式 - itemWidth: 8,//data图标大小 - itemHeight: 8, - left: 5, - textStyle: { - fontSize: 8, - fontWeight: 400 - }, - data: ['微博', '其他','短视频', '微信','APP', '论坛', '新闻'], - // color:['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF'], - }, - //图表位置 - grid: { - left: 7, - right: 7, - bottom: 7, - top: 36, - containLabel: true - }, - yAxis: [ - { - type: 'value', - axisTick:{ - show:false //去除刻度线 - }, - axisLine:{ - show:false //去除轴线 - }, - axisLabel: { - color: '#999999',//y轴文本颜色 - textStyle: { - fontSize : 9 - } - }, - splitLine: { //分割线 - // lineStyle:{ - // // color:"#2d3436" - - // } - show: true, - lineStyle: { - type: 'dashed', - color: '#E8E8E8', - } - } - } - ], - xAxis: [ - { - type: 'category', - data: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00'], - axisTick:{ - show:false //去除刻度线 - }, - axisLine:{ - show:false, //去除轴线 - }, - axisLabel: { - color: '#999999',//x轴文本颜色 - textStyle: { - fontSize : 9 - } - - } - } - ], - series: [ - { - name: '微博', - type: 'line', - symbol:'none', //去圆点 - data: [1400, 2000, 1500, 1800, 1490, 900, 310], - itemStyle: { - normal:{ - color: '#FF4852', - lineStyle: { - color: '#FF4852' - } - } - } - }, - { - name: '其他', - type: 'line', - symbol:'none', //去圆点 - data: [1520, 1052, 141, 174, 1690, 250, 220], - itemStyle: { - normal:{ - color: '#FF6E25', - lineStyle: { - color: '#FF6E25' - } - } - } - }, - { - name: '短视频', - type: 'line', - symbol:'none', //去圆点 - data: [210, 322, 551, 364, 960, 1307, 10], - itemStyle: { - normal:{ - color: '#FFBF00', - lineStyle: { - color: '#FFBF00' - } - } - } - - }, - { - name: '微信', - type: 'line', - symbol:'none', //去圆点 - data: [250, 362, 71, 374, 970, 130, 170], - itemStyle: { - normal:{ - color: '#20CC62', - lineStyle: { - color: '#20CC62' - } - } - } - }, - { - name: 'APP', - type: 'line', - symbol:'none', //去圆点 - data: [20, 32, 41, 354, 90, 130, 10], - itemStyle: { - normal:{ - color: '#00D6D6', - lineStyle: { - color: '#00D6D6' - } - } - } - }, - { - name: '论坛', - type: 'line', - symbol:'none', //去圆点 - data: [200, 382, 661, 34, 909, 1308, 150], - itemStyle: { - normal:{ - color: '#00AAFF', - lineStyle: { - color: '#00AAFF' - } - } - } - }, - { - name: '新闻', - type: 'line', - symbol:'none', //去圆点 - data: [250, 326, 178, 349, 900, 1300, 140], - itemStyle: { - normal:{ - color: '#7257FF', - lineStyle: { - color: '#7257FF' - } - } - } - } - ] - } + chartOption: dataOption }, lifetimes: { attached() { - // setTimeout(() => { - // this.setData({ - // showChart: false - // }) - // },1000) + app.globalData.request({action: 'getHomeCount0528', sType: 'Home', sTimeType: 3, iStatus: 1}).then(res => { + const data = res; + const sourcetypeCount = data.sourcetypeCount || []; + const arr = [] + const imgObj = {'微博': '/weibo.png', '微信': '/weixin.png', 'APP': '/app.png', '论坛': '/luntan.png', '新闻': '/xinwen.png', '其他': '/qita.png'} + arr.push({ + num: data.count, + text: '入库数据', + url: '/ruku.png' + }) + sourcetypeCount.forEach(ele => { + let obj = { + num: ele.value, + text: ele.key + '数据', + url: imgObj[ele.key] + } + arr.push(obj) + }) + this.setData({ + countYear: data.count_year, + count6month: data.count_6month, + countAll: data.count_all, + totallist: arr + }) + }) }, }, methods: { diff --git a/components/indexCom/dataChild/index.wxml b/components/indexCom/dataChild/index.wxml index 60ad3f8..b046657 100644 --- a/components/indexCom/dataChild/index.wxml +++ b/components/indexCom/dataChild/index.wxml @@ -13,15 +13,15 @@ - 12,233 + {{countAll}} 历史累计入库 - 12,233 + {{countYear}} 一年累计入库 - 12,233 + {{count6month}} 半年累计入库 From bab9bee3a193016412655e3186210f6282bbbfd3 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Fri, 8 Jul 2022 18:04:28 +0800 Subject: [PATCH 2/3] cxw-010203 --- components/indexCom/dataChild/dataConfig/dataOption.js | 1 - components/indexCom/dataChild/index.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/components/indexCom/dataChild/dataConfig/dataOption.js b/components/indexCom/dataChild/dataConfig/dataOption.js index 7c3bd57..35485ad 100644 --- a/components/indexCom/dataChild/dataConfig/dataOption.js +++ b/components/indexCom/dataChild/dataConfig/dataOption.js @@ -6,7 +6,6 @@ export default { }, confine: true }, - legend: { icon: 'rectangle',//data图标样式 itemWidth: 8,//data图标大小 diff --git a/components/indexCom/dataChild/index.js b/components/indexCom/dataChild/index.js index 16f05e6..e0287fa 100644 --- a/components/indexCom/dataChild/index.js +++ b/components/indexCom/dataChild/index.js @@ -9,7 +9,7 @@ Component({ count6month: 0, countAll: 0, timelist: ['二十四小时', '最近七天', '最近三十天', '自定义'], - totallist: totallist, + totallist: [], showChart: true, chartOption: dataOption }, From a35bb9f1571651ce4ee1d36efe4d4130ad2d76a2 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Fri, 8 Jul 2022 18:04:52 +0800 Subject: [PATCH 3/3] 1 --- components/indexCom/eventChild/index.js | 12 ++++ components/indexCom/eventChild/index.wxml | 2 +- pages/index/Rankdetail/Rankdetail.js | 70 +---------------------- pages/index/Rankdetail/Rankdetail.wxml | 2 +- 4 files changed, 17 insertions(+), 69 deletions(-) diff --git a/components/indexCom/eventChild/index.js b/components/indexCom/eventChild/index.js index 9f0ba58..cb86830 100644 --- a/components/indexCom/eventChild/index.js +++ b/components/indexCom/eventChild/index.js @@ -62,7 +62,19 @@ Component({ ] }, + + methods: { + bindtaps(){ + wx.request({ + url: 'http://cloud.sws010.com/api/v7.ashx', + method:"POST", + success:(res)=>{ + + console.log(res.Data) + } + }) + }, priceSel(e){ this.setData({ intervalSel: e.currentTarget.dataset.index diff --git a/components/indexCom/eventChild/index.wxml b/components/indexCom/eventChild/index.wxml index fc47a62..6479ff7 100644 --- a/components/indexCom/eventChild/index.wxml +++ b/components/indexCom/eventChild/index.wxml @@ -2,7 +2,7 @@ - 热点事件 + 热点事件 {{item.tip}} diff --git a/pages/index/Rankdetail/Rankdetail.js b/pages/index/Rankdetail/Rankdetail.js index 3650a17..a40bc46 100644 --- a/pages/index/Rankdetail/Rankdetail.js +++ b/pages/index/Rankdetail/Rankdetail.js @@ -180,76 +180,12 @@ Page({ }, ], showChart: true, - positiveOption: { - grid:{ - - }, - yAxis: [ - { - type: 'value', - axisTick:{ - show:false //去除刻度线 - }, - axisLine:{ - show:false //去除轴线 - }, - axisLabel: { - color: '#999999',//y轴文本颜色 - textStyle: { - fontSize : 9 - } - }, - splitLine: { //分割线 - // lineStyle:{ - // // color:"#2d3436" - - // } - show: true, - lineStyle: { - type: 'dashed', - color: '#E8E8E8', - } - } - } - ], - xAxis: [ - { - type: 'category', - data: ['12月', '1月', '2月', '3月', '4月', '5月', '6月'], - axisTick:{ - show:false //去除刻度线 - }, - axisLine:{ - show:false, //去除轴线 - }, - axisLabel: { - color: '#999999',//x轴文本颜色 - textStyle: { - fontSize : 9 - } - - } - } - ], - series: { - type: 'line', - symbol:'none', //去圆点 - data: [100, 200, 300, 500, 700, 500, 300], - itemStyle: { - normal:{ - color: '#0084FF', - lineStyle: { - color: '#0084FF' - } - } - }} - }, option :{ grid:{ - left:45, + left:30, top:25, - height:168, - width:343 + height:146, + width:323 }, yAxis: [ { diff --git a/pages/index/Rankdetail/Rankdetail.wxml b/pages/index/Rankdetail/Rankdetail.wxml index 83ed950..e6b291f 100644 --- a/pages/index/Rankdetail/Rankdetail.wxml +++ b/pages/index/Rankdetail/Rankdetail.wxml @@ -189,7 +189,7 @@ 销量趋势 宏光MINIEV销量趋势 - +