wylyl22 3 years ago
commit 84fbed8197

@ -1,45 +1,48 @@
//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; // 计算出导航栏的高度
},
globalData: {
imageUrl: "https://cdn.sws010.com/wxapp/images",
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: "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);
}
})
})
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, //胶囊按钮 距离屏幕右边的距离
request: function (prarms, callback) {
return new Promise((resolve, reject) => {
wx.request({
url: 'http://cloud.sws010.com/api/v7.ashx',
data: {
version: "1",
...prarms
},
method: 'get',
success: function (res) {
//接口实际返回的内容在res.data中
if (res.data.Code == 1) {
if (typeof callback === 'function') {
callback(res.data);
}
resolve(res.data.Data);
} else {
reject(res.data)
}
},
fail: function (err) {
reject(err);
}
})
})
}
}
}
})

@ -1,5 +1,5 @@
// 饼图
export default function pieOption(color=[],data=[]){
export default function pieOption(color=[],data=[],){
return{
tooltip: {
trigger: 'item'
@ -18,11 +18,10 @@ export default function pieOption(color=[],data=[]){
{
// bottom:68,
// right:6,
// name:['女性','男性'],
// name: name,
type: 'pie',
radius: ['66', '40'],
avoidLabelOverlap: false,
itemStyle: {
// borderRadius: 10,
borderColor: '#fff',
@ -30,15 +29,15 @@ export default function pieOption(color=[],data=[]){
},
// 点击弹出提示位置
label: {
show: true,
show: false,
position: 'center'
},
color:color,
//点击弹出提示样式
emphasis: {
label: {
label: {
show: true,
fontSize: '10',
fontSize: '40',
fontWeight: 'bold'
}
},

@ -1,4 +1,6 @@
const app = getApp();
let iPageIndex = 1 // 当前第几页,0代表第一页
let iPageSize = 10 //每页显示多少数据
Page({
data: {
imageUrl: getApp().globalData.imageUrl,
@ -7,40 +9,126 @@ Page({
user_author: "",
sourcetime: "",
title: "",
content: ""
content: "",
affections: "",
crisis: "",
ssim: "",
dataList: [], //放置返回数据的数组
loadMore: false, //"上拉加载"的变量默认false隐藏
loadAll: false, //“没有数据”的变量默认false隐藏
totalNum: 0
},
onLoad() {
wx.setNavigationBarTitle({
title: '详情'
})
let pages = getCurrentPages();
let currentPage = pages[pages.length-1]
let options = currentPage.options
let currentPage = pages[pages.length - 1]
let options = currentPage.options
this.setData({
id: options.id
})
},
onShow() {
this.getData()
this.getData().then(() => {
this.getLikeData()
})
},
//页面上拉触底事件的处理函数
onReachBottom: function () {
console.log("上拉触底事件")
let that = this
if (!that.data.loadMore) {
that.setData({
loadMore: true, //加载中
loadAll: false //是否加载完所有数据
});
//加载更多,这里做下延时加载
that.getLikeData();
}
},
searchScrollLower() {
this.getLikeData();
},
getData() {
app.globalData.request({
action: 'getDataById',
return new Promise((resolve, reject) => {
app.globalData.request({
action: 'getDataById',
sId: this.data.id,
sType: 'ZhuTiFenXiBl',
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
}).then(res => {
let arr = res || [];
if (arr.length > 0) {
let data = arr[0];
this.setData({
source: data._source.source,
user_author: data._source.user_author,
sourcetime: data._source.sourcetime,
title: data._source.title,
content: data._source.content,
affections: data._source.affections,
crisis: data._source.crisis,
ssim: data._source.ssim
})
}
resolve(true)
}).catch(() => {
reject(false)
})
})
},
getLikeData() {
let sTimeType = wx.getStorageSync('sTimeType') || 34;
let sStartTime = "";
let sEndTime = "";
if (sTimeType == 4) {
sStartTime = wx.getStorageSync('sStartTime') || '';
sEndTime = wx.getStorageSync('sEndTime') || '';
}
let obj = {
action: "getSimilarityData",
sId: this.data.id,
sType: 'ZhuTiFenXiBl',
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
sSsim: this.data.sSsim,
sType: "ZhuTiFenXiBl",
iPageIndex: iPageIndex,
iPageSize: iPageSize,
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
sTimeType: sTimeType,
sStartTime: sStartTime,
sEndTime: sEndTime
}
//第一次加载数据
if (iPageIndex == 1) {
this.setData({
loadMore: true, //把"上拉加载"的变量设为true显示
loadAll: false //把“没有数据”设为false隐藏
})
}
app.globalData.request(obj, (database) => {
this.setData({
totalNum: database.totalNum
})
}).then(res => {
let arr = res || [];
if(arr.length > 0) {
let data = arr[0];
console.log(data)
if (res && res.length > 0) {
iPageIndex++;
//把新请求到的数据添加到dataList里
let list = this.data.dataList.concat(res);
this.setData({
dataList: list, //获取数据数组
loadMore: false //把"上拉加载"的变量设为false显示
});
if (res.length < pageSize) {
this.setData({
loadMore: false, //隐藏加载中。。
loadAll: true //所有数据都加载完了
});
}
} else {
this.setData({
source: data._source.source,
user_author: data._source.user_author,
sourcetime: data._source.sourcetime,
title: data._source.title,
content: data._source.content
})
loadAll: true, //把“没有数据”设为true显示
loadMore: false //把"上拉加载"的变量设为false隐藏
});
}
})
}

@ -2,8 +2,13 @@
<view class="d-top">
<view class="d-top-cp">
<view class="d-top-cp-d1">
<view>
<view class="d-top-cp-d1-s1">正面</view>
<view style="display: flex;justify-content: flex-start;">
<view class="d-top-cp-d1-s1" wx:if="{{affections == 1}}">正面</view>
<view class="d-top-cp-d1-s1" style="background: #FFF0F1;color: #FF4852;" wx:if="{{affections == 2}}">负面</view>
<view class="d-top-cp-d1-s1" style="background: #FFFBF0;color: #FDCD42;" wx:if="{{affections == 3}}">中性</view>
<view class="d-top-cp-d1-s1" style="margin-left: 7px;color: #d48c44;" wx:if="{{crisis == 1}}">低级危机</view>
<view class="d-top-cp-d1-s1" style="margin-left: 7px;background: #FFFBF0;color: #FDCD42;" wx:if="{{crisis == 2}}">中级危机</view>
<view class="d-top-cp-d1-s1" style="margin-left: 7px;background: #FFF0F1;color: #FF4852;" wx:if="{{crisis == 3}}">高级危机</view>
</view>
<view class="dtcd1-dd2">
<image class="d-top-cp-d1-m1" src="{{imageUrl}}/copy.png"></image>
@ -37,24 +42,28 @@
</view>
<view class="bc-c-d2">
<view style="font-size: 14px; color: #333333;">相似信息</view>
<view style="font-size: 12px; color: #333333;margin-left: 8px;">共计23条相似数据</view>
<view style="font-size: 12px; color: #333333;margin-left: 8px;">共计{{totalNum}}条相似数据</view>
</view>
<view class="bc-c-d3">
<view class="bc-c-d3-dd1">
<view style="color: #999999;font-size: 12px;">
2022-04-29 23:02:01
<scroll-view scroll-y="true" bindscrolltolower="searchScrollLower">
<view class="bc-c-d3" wx:for="{{dataList}}">
<view class="bc-c-d3-dd1">
<view style="color: #999999;font-size: 12px;">
2022-04-29 23:02:01
</view>
<view>
<view class="d-top-cp-d1-s1" style="background: #F0F8FF;color: #0084FF;">正面</view>
</view>
</view>
<view>
<view class="d-top-cp-d1-s1" style="background: #F0F8FF;color: #0084FF;">正面</view>
<view class="bc-c-d3-dd2">
谁说国产没有高性能SUV这3款国产SUV
</view>
<view class="bc-c-d3-dd3">
<view style="color: #999999;font-size: 12px;width: 50%">来源:百度百家</view>
<view style="color: #999999;font-size: 12px;">作者:无心</view>
</view>
</view>
<view class="bc-c-d3-dd2">
谁说国产没有高性能SUV这3款国产SUV
</view>
<view class="bc-c-d3-dd3">
<view style="color: #999999;font-size: 12px;width: 50%">来源:百度百家</view>
<view style="color: #999999;font-size: 12px;">作者:无心</view>
</view>
</view>
<view class="loading" hidden="{{!loadMore}}">正在载入更多...</view>
<view class="loading" hidden="{{!loadAll}}">已加载全部</view>
</scroll-view>
</view>
</view>

@ -70,6 +70,7 @@
left: 0px;
bottom: 53px;
}
.d-top-cp-d4 {
position: absolute;
display: flex;
@ -78,9 +79,11 @@
height: 50px;
bottom: 0px;
}
.d-top-cp-d4-dd1 {
margin-top: 8px;
}
.b-c-top-bm {
position: absolute;
width: 100%;
@ -91,9 +94,11 @@
border-top-left-radius: 20px;
border-top-right-radius: 20px;
}
.bc-cont {
padding: 0px 13px 10px 15px;
}
.bc-c-d1 {
background-color: #fff;
padding: 16px;
@ -101,28 +106,41 @@
color: #333333;
line-height: 1.6;
}
.bc-c-d2 {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 16px;
}
.bc-c-d3 {
position: relative;
background-color: #fff;
padding: 16px;
margin-top: 8px;
}
.bc-c-d3-dd1 {
display: flex;
justify-content: space-between;
}
.bc-c-d3-dd2 {
color: #333333;
margin-top: 12px;
}
.bc-c-d3-dd3 {
display: flex;
justify-content: flex-start;
margin-top: 12px;
}
.loading {
position: relative;
bottom: 5rpx;
padding: 10rpx;
text-align: center;
font-size: 12px;
}

@ -1,4 +1,5 @@
// pages/index/Salesranking/Salesranking.js
const app = getApp();
Page({
data: {
active: 0,

@ -1,93 +1,220 @@
// pages/index/total/tatal.js
Page({
/**
* 页面的初始数据
*/
data: {
content:[
{
time: '2022-04-29 23:00:00',
title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机星途凌云换个运动轮胎妥妥的6秒3最快6...',
author: '明哥飞扬',
media:'新浪微博'
},
{
time: '2022-04-29 23:00:00',
title: '星途凌云S上市传播分析评论中毒 奇瑞车为何如此招黑?',
author: '明哥飞扬',
media:'新浪微博'
},
{
time: '2022-04-29 23:00:00',
title: 'MG5天蝎座上市传播分析评论区疑似闹“水灾',
author: '明哥飞扬',
media:'新浪微博'
},
{
time: '2022-04-29 23:00:00',
title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机星途凌云换个运动轮胎妥妥的6秒3最快6...',
author: '明哥飞扬',
media:'新浪微博'
},
const app =getApp();
// Page({
// /**
// * 页面的初始数据
// */
// data: {
// content:[
// {
// time: '2022-04-29 23:00:00',
// title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机星途凌云换个运动轮胎妥妥的6秒3最快6...',
// author: '明哥飞扬',
// media:'新浪微博'
// },
// {
// time: '2022-04-29 23:00:00',
// title: '星途凌云S上市传播分析评论中毒 奇瑞车为何如此招黑?',
// author: '明哥飞扬',
// media:'新浪微博'
// },
// {
// time: '2022-04-29 23:00:00',
// title: 'MG5天蝎座上市传播分析评论区疑似闹“水灾',
// author: '明哥飞扬',
// media:'新浪微博'
// },
// {
// time: '2022-04-29 23:00:00',
// title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机星途凌云换个运动轮胎妥妥的6秒3最快6...',
// author: '明哥飞扬',
// media:'新浪微博'
// },
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
// ]
// },
// /**
// * 生命周期函数--监听页面加载
// */
// onLoad(options) {
// },
// /**
// * 生命周期函数--监听页面初次渲染完成
// */
// onReady() {
// },
// /**
// * 生命周期函数--监听页面显示
// */
// onShow() {
// },
// /**
// * 生命周期函数--监听页面隐藏
// */
// onHide() {
// },
// /**
// * 生命周期函数--监听页面卸载
// */
// onUnload() {
// },
// /**
// * 页面相关事件处理函数--监听用户下拉动作
// */
// onPullDownRefresh() {
// },
// /**
// * 页面上拉触底事件的处理函数
// */
// onReachBottom() {
// },
// /**
// * 用户点击右上角分享
// */
// onShareAppMessage() {
// }
// })
Component({
data: {
content: {},
},
methods: {
// modalChoose(e) {
// let id = e.currentTarget.dataset.id; //获取点击的id
// app.globalData.request({
// action: 'getUserSeriesName',
// token: 't%2BrswgjvzGM=',
// sBrandName: id
// }).then(res => {
// this.setData({
// modalList: res,
// popShow: true,
// currentBrand: id,
// })
// });
// },
// handlerSearch(value) {
// let keyword = value.detail;
// app.globalData.request({
// action: 'getQueryrSeriesName',
// token: 't%2BrswgjvzGM=',
// queryname: keyword
// }).then(res => {
// //图片少了.png后缀
// 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){
// let obj = {
// brandname: i.name,
// img: i.img+'.png',
// data: i.data,
// firstword: i.firstword
// }
// j.data.push(obj)
// }
// }
// };
// this.setData({
// brandList: arr
// });
// });
// },
// toModalInsight(value) {
// let id = value.target.dataset.id;
// wx.setStorageSync('sSeriesName', id);
// // wx.navigateTo({
// // url: "/pages/insight/pages/modalInsight/index"
// // })
// },
// onClose() {
// this.setData({
// popShow: false
// })
// }
},
lifetimes: {
attached() {
let sTimeType = wx.getStorageSync("sTimeType") || 34;
let sStartTime = wx.getStorageSync("sStartTime") || '';
let sEndTime = wx.getStorageSync("sEndTime") || '';
this.getData(sTimeType, sStartTime, sEndTime);
}
},
methods: {
// 时间
changeTime(e){
let sTimeType = e.detail.sTimeType;
let sStartTime = e.detail.sStartTime;
let sEndTime = e.detail.sEndTime;
this.getData(sTimeType, sStartTime, sEndTime);
},
getData(sTimeType, sStartTime, sEndTime){
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 300000
})
let key = ele.key
app.globalData.request({
action: 'getHomeList0528',
sType: 'Home',
sTimeType:sTimeType,
sStartTime:sStartTime,
sEndTime:sEndTime,
sQuDao:key
}).then(res => {
const data= res;
const _source = []
// for (let i = 0 ;i<res.length;i++){
// data.push(res[i])
// }
// res.forEach(ele =>{
// let obj = {
// sourcetime:data._source.sourcetime,
// title:data._source.title,
// user_author:data._source.user_author,
// source:data._source.source
// }
// _source.push(obj)
// })
this.setData({
content:data._source
});
console.log('9999',data)
// console.log('9999',arr)
});
setTimeout(() =>{
wx.hideToast();
},500)
},
},
})

@ -1,14 +1,14 @@
<!--pages/index/total/tatal.wxml-->
<view class="content" wx:for="{{content}}" wx:key="index" data-quest='{{item}}'>
<view class="content" wx:for="{{content}}" wx:key="index" data-id='{{content.id}}'>
<view class="content_event">
<view class="content_pinpai">{{item.time}}
<view class="content_pinpai">{{content.sourcetime}}
</view>
<view class="content_title">{{item.title}}
<view class="content_title">{{content.title}}
</view>
<view class="content_text">
<view class="content_pinpai">作者:{{item.author}}
<view class="content_pinpai">作者:{{content.user_author}}
</view>
<view class="content_pinpai">媒体:{{item.media}}
<view class="content_pinpai">媒体:{{content.source}}
</view>
</view>
</view>

Loading…
Cancel
Save