parent
7d789b35a9
commit
95e4bb7e79
@ -0,0 +1,12 @@
|
||||
var method = {
|
||||
stringify: function (val) {
|
||||
return JSON.stringify(val)
|
||||
},
|
||||
getStorage:function(val){
|
||||
return wx.getStorageSync(val)
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
stringify: method.stringify,
|
||||
getStorage:method.getStorage
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
import Dialog from '../../../../miniprogram_npm/@vant/weapp/dialog/dialog';
|
||||
const app = getApp()
|
||||
Component({
|
||||
data: {
|
||||
eventList: [],
|
||||
result: [],
|
||||
boxArr:new Array(6).fill(undefined),
|
||||
show:false,
|
||||
},
|
||||
methods: {
|
||||
startCp(){
|
||||
wx.setStorageSync('eventData', this.data.boxArr)
|
||||
wx.navigateTo({
|
||||
url: `/pages/varComm/pages/eventRatio/index`,
|
||||
})
|
||||
},
|
||||
onClose(){
|
||||
this.setData({
|
||||
show:false
|
||||
})
|
||||
},
|
||||
add(){
|
||||
wx.navigateTo({
|
||||
url: 'pages/addEvent/index',
|
||||
})
|
||||
},
|
||||
del(e){
|
||||
let index = e.currentTarget.dataset.index
|
||||
let result = [...this.data.result]
|
||||
let boxArr = []
|
||||
result.splice(index,1)
|
||||
for(let i of result){
|
||||
boxArr.push(JSON.parse(i))
|
||||
}
|
||||
boxArr.length = 6
|
||||
this.setData({
|
||||
result:result,
|
||||
boxArr:boxArr
|
||||
})
|
||||
},
|
||||
|
||||
onChange(event) {
|
||||
const {
|
||||
detail
|
||||
} = event
|
||||
console.log(detail);
|
||||
if(detail.length>6){
|
||||
console.log("至多六个");
|
||||
return
|
||||
}
|
||||
let boxArr = []
|
||||
for(let i of detail){
|
||||
let obj = JSON.parse(i)
|
||||
boxArr.push(obj)
|
||||
}
|
||||
boxArr.length = 6
|
||||
this.setData({
|
||||
result: detail,
|
||||
boxArr:boxArr
|
||||
})
|
||||
},
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
console.log(132345);
|
||||
app.globalData.request({
|
||||
action: 'getEventList',
|
||||
token: wx.getStorageSync('token'),
|
||||
sType: 'HotLibraryC',
|
||||
iPageIndex: 1,
|
||||
iPageSize: 4,
|
||||
sTimeType: 20
|
||||
}).then(res => {
|
||||
this.setData({
|
||||
eventList: res
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
})
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
<wxs src="./filter.wxs" module="filter"></wxs>
|
||||
<view class="box">
|
||||
<!-- <scroll-view scroll-x="true" style=" white-space: nowrap; display: flex"> -->
|
||||
<view class="add">
|
||||
<view wx:for="{{boxArr}}" wx:key="{{item.events_id}}" style="margin-left: 32rpx;width: 280rpx;">
|
||||
<view class="add_box" bindtap="add" wx:if="{{item == undefined }}" data-index="{{index}}">
|
||||
<view class="heng"></view>
|
||||
<view class="shu"></view>
|
||||
<view class="event">添加主题一</view>
|
||||
</view>
|
||||
<view class="del_box" wx:else>
|
||||
|
||||
<view class="del_top">
|
||||
<view style="display:inline-block;margin-left:26rpx;">
|
||||
<van-icon name="sort" size="12px" color="white" />
|
||||
<text style="font-size: 24rpx; color: rgba(255, 255, 255, 1);">切换</text>
|
||||
</view>
|
||||
<view style="display:inline-block;margin-left:32rpx;color: rgba(255, 255, 255, 1);">|</view>
|
||||
<view style="display:inline-block;margin-left:36rpx;" bindtap="del" data-index="{{index}}">
|
||||
<van-icon name="cross" size="12px" color="white" />
|
||||
<view style="margin-left: 2rpx; display: inline-block;"></view>
|
||||
<text style="font-size: 24rpx; color: rgba(255, 255, 255, 1);">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="del_title">
|
||||
{{item.events_title}}
|
||||
</view>
|
||||
<view class="del_foot">
|
||||
<text>主题</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- </scroll-view> -->
|
||||
<button class="btns" bindtap='startCp'>开始对比</button>
|
||||
<view class="event_recom">
|
||||
<van-checkbox-group value="{{ result }}" bind:change="onChange">
|
||||
<text style="font-size: 40rpx;font-weight: bolder;">主题推荐</text>
|
||||
<view class="event_card" wx:for="{{eventList}}" wx:key="idxa">
|
||||
<view class="card_head">
|
||||
<van-checkbox name="{{filter.stringify(item)}}" shape="square" class="van-checkbox"></van-checkbox>
|
||||
<view style="display: inline-block; font-size: 24rpx;color: rgba(153, 153, 153, 1);margin-left:16rpx;">
|
||||
{{item.maxSourcetime}}
|
||||
</view>
|
||||
<view class="tag"> {{item.events_type}}</view>
|
||||
</view>
|
||||
<view class="card_title">
|
||||
<text>{{item.events_title}}</text>
|
||||
</view>
|
||||
<view class="card_label" style="margin-top: 32rpx;">
|
||||
<text style="color: rgba(153, 153, 153, 1);">文章篇数(条)</text>
|
||||
<text>{{item.events_count}}</text>
|
||||
</view>
|
||||
<view class="card_label" style="margin-top: 24rpx;">
|
||||
<text style="color: rgba(153, 153, 153, 1);">相关品牌</text>
|
||||
<text>{{item.events_brand}}</text>
|
||||
</view>
|
||||
<view class="card_label" style="margin-top: 24rpx;">
|
||||
<text style="color: rgba(153, 153, 153, 1);">相关车型</text>
|
||||
<text>{{item.events_series}}</text>
|
||||
</view>
|
||||
<view class="card_label" style="margin-top: 24rpx;">
|
||||
<text style="color: rgba(153, 153, 153, 1);">传播周期(条)</text>
|
||||
<text>{{item.events_influence}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</van-checkbox-group>
|
||||
</view>
|
||||
<van-popup show="{{ show }}" position="bottom" custom-style="height: 70%;" bind:close="onClose" />
|
||||
</view>
|
@ -0,0 +1,168 @@
|
||||
/* pages/varComm/pages/event/index.wxss */
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.box {
|
||||
/* height:400rpx; */
|
||||
background: #006bff;
|
||||
padding-top: 16rpx;
|
||||
}
|
||||
|
||||
.add {
|
||||
height: 222rpx;
|
||||
/* background-color: pink; */
|
||||
/* width: 100%; */
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
overflow-x: auto;
|
||||
white-space:nowrap;
|
||||
}
|
||||
.del_box{
|
||||
height: 218rpx;
|
||||
width: 280rpx;
|
||||
background-color: #339cff;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #85c3ff;
|
||||
}
|
||||
.del_title{
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-line-clamp:2;
|
||||
-webkit-box-orient: vertical;
|
||||
width:232rpx;margin-left: 24rpx;font-size: 28rpx;color: rgba(255, 255, 255, 1);height: 72rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.del_foot{
|
||||
width:280rpx;
|
||||
margin-left: 24rpx;
|
||||
margin-top: 16rpx;
|
||||
color:rgba(255, 255, 255, 0.6000);
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.del_top{
|
||||
height:62rpx ;
|
||||
width: 100%;
|
||||
/* background: pink; */
|
||||
border-bottom: 1rpx solid;
|
||||
line-height:62rpx ;
|
||||
border-image: linear-gradient(to right, rgba(245, 245, 245, 0), rgba(238, 238, 238, 1), rgba(232, 232, 232, 0))1;
|
||||
}
|
||||
.add_box {
|
||||
height: 218rpx;
|
||||
width: 280rpx;
|
||||
background-color: #339cff;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #85c3ff;
|
||||
}
|
||||
|
||||
.heng {
|
||||
height: 8rpx;
|
||||
width: 72rpx;
|
||||
background: white;
|
||||
border-radius: 6rpx;
|
||||
position: relative;
|
||||
left: 104rpx;
|
||||
top: 82rpx
|
||||
}
|
||||
|
||||
.shu {
|
||||
width: 8rpx;
|
||||
height: 72rpx;
|
||||
background: white;
|
||||
border-radius: 6rpx;
|
||||
position: relative;
|
||||
left: 136rpx;
|
||||
top: 45rpx
|
||||
}
|
||||
|
||||
.event {
|
||||
display: inline-block;
|
||||
color: white;
|
||||
font-size: 28rpx;
|
||||
margin-left: 70rpx;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-top: 32rpx;
|
||||
width: 686rpx;
|
||||
height: 88rpx;
|
||||
font-weight: bold;
|
||||
line-height: 88rpx;
|
||||
color: rgba(0, 132, 255, 1);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.event_recom {
|
||||
margin-top: 32rpx;
|
||||
min-height: 1000rpx;
|
||||
background-color: #f9f9f9;
|
||||
border-top-left-radius: 24rpx;
|
||||
border-top-right-radius: 24rpx;
|
||||
padding-top: 32rpx;
|
||||
padding-left: 32rpx;
|
||||
}
|
||||
|
||||
.event_card {
|
||||
width: 686rpx;
|
||||
height: 350rpx;
|
||||
background-color: white;
|
||||
margin-top: 32rpx;
|
||||
padding-top: 36rpx;
|
||||
}
|
||||
|
||||
.card_head {
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
|
||||
checkbox .wx-checkbox-input {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
}
|
||||
|
||||
.tag {
|
||||
display: inline-block;
|
||||
background: #f0f8ff;
|
||||
color: rgba(0, 132, 255, 1);
|
||||
width: 128rpx;
|
||||
height: 40rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
line-height: 40rpx;
|
||||
margin-left: 210rpx;
|
||||
}
|
||||
|
||||
.card_title{
|
||||
overflow:hidden;
|
||||
text-overflow: ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-line-clamp:1;
|
||||
-webkit-box-orient: vertical;
|
||||
margin-left: 32rpx;
|
||||
margin-top: 24rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.card_label{
|
||||
width: 622rpx;
|
||||
margin-left: 32rpx;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
height: 24rpx;
|
||||
justify-content:space-between;
|
||||
}
|
||||
.van-checkbox__icon {
|
||||
margin-left: 32rpx ;
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
.van-image{
|
||||
margin-left: 48rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
.card_head .van-checkbox{
|
||||
display: inline-block !important;
|
||||
}
|
Loading…
Reference in new issue