dev
liuyongli 3 years ago
parent 0ba8d19d1d
commit e2c6391ac8

@ -3,260 +3,261 @@ const app = getApp()
import timer from '../../../../utils/timer'
Page({
/**
* 页面的初始数据
*/
data: {
sUserName: '',
sPwd: '',
sPhone: '',
sEmail: '',
companyName: '',
brandName: '',
sVerifycode: '',
captchaLabel: '获取验证码',
captchaDisabled: false
},
//用户输入
usernameInput(e) {
this.setData({
sUserName: e.detail.value
})
},
//密码输入
passwordInput(e) {
this.setData({
sPwd: e.detail.value
})
},
//手机号输入
sPhoneInput(e) {
this.setData({
sPhone: e.detail.value
})
},
//邮箱输入
sEmailInput(e) {
this.setData({
sEmail: e.detail.value
})
},
//名称输入
companyInput(e) {
this.setData({
companyName: e.detail.value
})
},
//品牌输入
brandInput(e) {
this.setData({
brandName: e.detail.value
})
},
//验证码输入
codeInput(e) {
this.setData({
sVerifycode: e.detail.value
})
},
//获取验证码
captcha() {
let b = this.validPhone();
if (!b) return;
let obj = {
action: 'getVERCode',
sPhone: this.data.sPhone,
}
app.globalData.request(obj).then((res) => {
if (res.Code == 1) {
wx.showModal({
title: '提示',
content: data.Msg,
})
// 定时60s
timer(this)
}
}).catch(err => {
wx.showModal({
title: '提示',
content: err.Msg,
})
})
},
/**
* 生命周期函数--监听页面加载
*/
//提交审核
Submit() {
let a = this.validfrom();
if (!a) return;
let obj = {
action: 'regUser',
sUserName: this.data.sUserName,
sPwd: this.data.sPwd,
sPhone: this.data.sPhone,
sEmail: this.data.sEmail,
companyName: this.data.companyName,
brandName: this.data.brandName,
sVerifycode: this.data.sVerifycode,
}
app.globalData.request(obj).then((res) => {
wx.showModal({
title: '提示',
content: data.Msg,
})
}).catch(err => {
wx.showModal({
title: '提示',
content: err.Msg,
})
/**
* 页面的初始数据
*/
data: {
sUserName: '',
sPwd: '',
sPhone: '',
sEmail: '',
companyName: '',
brandName: '',
sVerifycode: '',
captchaLabel: '获取验证码',
captchaDisabled: false
},
//用户输入
usernameInput(e) {
this.setData({
sUserName: e.detail.value
})
},
//密码输入
passwordInput(e) {
this.setData({
sPwd: e.detail.value
})
},
//手机号输入
sPhoneInput(e) {
this.setData({
sPhone: e.detail.value
})
},
//邮箱输入
sEmailInput(e) {
this.setData({
sEmail: e.detail.value
})
},
//名称输入
companyInput(e) {
this.setData({
companyName: e.detail.value
})
},
//品牌输入
brandInput(e) {
this.setData({
brandName: e.detail.value
})
},
//验证码输入
codeInput(e) {
this.setData({
sVerifycode: e.detail.value
})
},
//获取验证码
captcha() {
let b = this.validPhone();
if (!b) return;
let obj = {
action: 'getVERCode',
sPhone: this.data.sPhone,
}
app.globalData.request(obj).then(res => {
// 定时60s
timer(this)
if (res.Code == 1) {
wx.showModal({
title: '提示',
content: data.Msg,
})
},
validPhone() {
let b = true;
let sPhone = this.data.sPhone;
//验证手机号
if (!this.data.sPhone) {
wx.showModal({
title: '提示',
content: "手机号不能为空",
})
b = false;
return b;
}
//验证手机格式
if (!(/^1[34578]\d{9}$/.test(sPhone))) {
wx.showModal({
title: '提示',
content: "手机格式错误",
})
b = false
return b;
}
return b;
},
validfrom() {
let a = true;
//验证用户名
if (!this.data.sUserName) {
wx.showModal({
title: '提示',
content: "用户名不能为空",
})
a = false;
return a;
}
//验证密码
if (!this.data.sPwd) {
wx.showModal({
title: '提示',
content: "密码不能为空",
})
a = false;
return a;
}
//验证手机号
if (!this.data.sPhone) {
wx.showModal({
title: '提示',
content: "手机号不能为空",
})
a = false;
return a;
}
//验证邮箱
if (!this.data.sEmail) {
wx.showModal({
title: '提示',
content: "邮箱不能为空",
})
a = false;
return a;
}
//验证公司名称
if (!this.data.companyName) {
wx.showModal({
title: '提示',
content: "公司名称不能为空",
})
a = false;
return a;
}
//验证品牌
if (!this.data.brandName) {
wx.showModal({
title: '提示',
content: "公司品牌不能为空",
})
a = false;
return a;
}
//验证验证码
if (!this.data.sVerifycode) {
wx.showModal({
title: '提示',
content: "公司品牌不能为空",
})
a = false;
return a;
}
return a;
},
handlerBack() {
wx.navigateBack({
delta: 1
});
},
onLoad(options) {
}
}).catch(err => {
wx.showModal({
title: '提示',
content: err.Msg,
})
})
},
/**
* 生命周期函数--监听页面加载
*/
//提交审核
Submit() {
let a = this.validfrom();
if (!a) return;
let obj = {
action: 'regUser',
sUserName: this.data.sUserName,
sPwd: this.data.sPwd,
sPhone: this.data.sPhone,
sEmail: this.data.sEmail,
companyName: this.data.companyName,
brandName: this.data.brandName,
sVerifycode: this.data.sVerifycode,
}
app.globalData.request(obj).then((res) => {
wx.showModal({
title: '提示',
content: data.Msg,
})
}).catch(err => {
wx.showModal({
title: '提示',
content: err.Msg,
})
})
},
validPhone() {
let b = true;
let sPhone = this.data.sPhone;
//验证手机号
if (!this.data.sPhone) {
wx.showModal({
title: '提示',
content: "手机号不能为空",
})
b = false;
return b;
}
//验证手机格式
if (!(/^1[34578]\d{9}$/.test(sPhone))) {
wx.showModal({
title: '提示',
content: "手机格式错误",
})
b = false
return b;
}
return b;
},
validfrom() {
let a = true;
//验证用户名
if (!this.data.sUserName) {
wx.showModal({
title: '提示',
content: "用户名不能为空",
})
a = false;
return a;
}
//验证密码
if (!this.data.sPwd) {
wx.showModal({
title: '提示',
content: "密码不能为空",
})
a = false;
return a;
}
//验证手机号
if (!this.data.sPhone) {
wx.showModal({
title: '提示',
content: "手机号不能为空",
})
a = false;
return a;
}
//验证邮箱
if (!this.data.sEmail) {
wx.showModal({
title: '提示',
content: "邮箱不能为空",
})
a = false;
return a;
}
//验证公司名称
if (!this.data.companyName) {
wx.showModal({
title: '提示',
content: "公司名称不能为空",
})
a = false;
return a;
}
//验证品牌
if (!this.data.brandName) {
wx.showModal({
title: '提示',
content: "公司品牌不能为空",
})
a = false;
return a;
}
//验证验证码
if (!this.data.sVerifycode) {
wx.showModal({
title: '提示',
content: "公司品牌不能为空",
})
a = false;
return a;
}
return a;
},
handlerBack() {
wx.navigateBack({
delta: 1
});
},
onLoad(options) {
},
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}
})

@ -1,73 +1,75 @@
<wxs src="./filter.wxs" module="filter"></wxs>
<van-dialog id="van-dialog" />
<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">添加主题{{tempLate[index]}}</view>
</view>
<view class="del_box" wx:else>
<!-- <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">添加主题{{tempLate[index]}}</view>
</view>
<view class="del_box" wx:else>
<view class="del_top">
<view style="display:inline-block;margin-left:26rpx;" bindtap="switchTheme" data-index="{{index}}">
<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.Name}}
</view>
<view class="del_foot">
<text>主题</text>
</view>
</view>
<view class="del_top">
<view style="display:inline-block;margin-left:26rpx;" bindtap="switchTheme" data-index="{{index}}">
<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.Name}}
</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="{{themeList}}" 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.AddTime}}
</view>
<view class="tag"> 已完成</view>
</view>
<view class="card_title">
<text>{{item.Name}}</text>
</view>
<view class="card_label" style="margin-top: 32rpx;">
<text style="color: rgba(153, 153, 153, 1);">相关报道(条)</text>
<text>{{item.ReportSum}}</text>
</view>
<view class="card_label" style="margin-top: 24rpx;">
<text style="color: rgba(153, 153, 153, 1);">开始时间</text>
<text>{{item.StartTime}}</text>
</view>
<view class="card_label" style="margin-top: 24rpx;">
<text style="color: rgba(153, 153, 153, 1);">结束时间</text>
<text>{{item.EndTime}}</text>
</view>
<!-- <view class="card_label" style="margin-top: 24rpx;">
<!-- </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="{{themeList}}" wx:key="idxa">
<view class="card_head">
<view>
<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.AddTime}}
</view>
</view>
<view class="tag"> 已完成</view>
</view>
<view class="card_title">
<text>{{item.Name}}</text>
</view>
<view class="card_label" style="margin-top: 32rpx;">
<text style="color: rgba(153, 153, 153, 1);">相关报道(条)</text>
<text>{{item.ReportSum}}</text>
</view>
<view class="card_label" style="margin-top: 24rpx;">
<text style="color: rgba(153, 153, 153, 1);">开始时间</text>
<text>{{item.StartTime}}</text>
</view>
<view class="card_label" style="margin-top: 24rpx;">
<text style="color: rgba(153, 153, 153, 1);">结束时间</text>
<text>{{item.EndTime}}</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>
</van-checkbox-group>
</view>
<van-popup show="{{ show }}" position="bottom" custom-style="height: 70%;" bind:close="onClose" />
</view>

@ -116,7 +116,9 @@ page {
}
.card_head {
margin-left: 32rpx;
display: flex;
justify-content: space-between;
margin-left: 32rpx;
}
checkbox .wx-checkbox-input {
@ -133,7 +135,6 @@ checkbox .wx-checkbox-input {
font-size: 24rpx;
text-align: center;
line-height: 40rpx;
margin-left: 210rpx;
}
.card_title{

Loading…
Cancel
Save