diff --git a/app.json b/app.json index 413c15c..c1ed147 100644 --- a/app.json +++ b/app.json @@ -15,6 +15,7 @@ "pages/insight/pages/eventInsight/index", "pages/insight/pages/themeAnalize/index", "pages/insight/pages/addTheme/index", + "pages/insight/pages/editTheme/index", "pages/insight/pages/brandInsight/tailDataList/index", "pages/insight/pages/brandInsight/brandDataList/index", "pages/insight/pages/modalInsight/tailDataList/index", diff --git a/pages/insight/brandChild/index.js b/pages/insight/brandChild/index.js index 4397291..9b77e91 100644 --- a/pages/insight/brandChild/index.js +++ b/pages/insight/brandChild/index.js @@ -32,6 +32,12 @@ Component({ token: 't%2BrswgjvzGM=', }).then(res => { let arr = [] + let recommandArr = []; + res.forEach(ele => { + if(ele.firstword == '热门') { + recommandArr.push(ele) + } + }); for (let i = 65; i <= 90; i++) { arr.push({ name: String.fromCharCode(i), @@ -46,19 +52,20 @@ Component({ } } this.setData({ - brandList:arr + brandList:arr, + recommandBrand: recommandArr, }); setTimeout(() =>{ wx.hideToast(); },500) }); //推荐品牌 - app.globalData.request({ - action: 'getRecommendSeries', - token: 't%2BrswgjvzGM=', - }).then(res => { - console.log(res); - }); + // app.globalData.request({ + // action: 'getRecommendSeries', + // token: 't%2BrswgjvzGM=', + // }).then(res => { + // console.log(res); + // }); }, }, }) \ No newline at end of file diff --git a/pages/insight/brandChild/index.wxml b/pages/insight/brandChild/index.wxml index 8c89bdb..746c115 100644 --- a/pages/insight/brandChild/index.wxml +++ b/pages/insight/brandChild/index.wxml @@ -1,14 +1,14 @@ - + diff --git a/pages/insight/pages/addTheme/index.js b/pages/insight/pages/addTheme/index.js index 5b27f30..fe351d6 100644 --- a/pages/insight/pages/addTheme/index.js +++ b/pages/insight/pages/addTheme/index.js @@ -155,10 +155,12 @@ Page({ wx.showModal({ title: '添加成功!', showCancel: false, - success: function() { - wx.navigateBack({ - delta: 1, - }) + success: function(result) { + if(result.cancel == false) { + wx.navigateBack({ + delta: 1, + }) + } } }); }); diff --git a/pages/insight/pages/editTheme/index.js b/pages/insight/pages/editTheme/index.js new file mode 100644 index 0000000..0190771 --- /dev/null +++ b/pages/insight/pages/editTheme/index.js @@ -0,0 +1,200 @@ +import moment from "moment" +const app = getApp(); +Page({ + data: { + steps: [ + { + text: '名称设置', + inactiveIcon: 'more-o', + activeIcon: 'more', + }, + { + text: '分析词设置', + inactiveIcon: 'more-o', + activeIcon: 'more', + }, + { + text: '定向监测', + inactiveIcon: 'more-o', + activeIcon: 'more', + } + ], + Guid: '', + //表单 + Name: '', + StartTime: '', + EndTime: '', + DetailsData: [], + AnalyzeWord: '', // 和 或 的主体词 + HuoWord:'', // 和 或 的可选词 + PaiChu: '', // 排除词 + highAnalizeWord: '', // 高级模式分析词 + Source: '', // 定向监测媒体 + UserAuthor: '', // 定向监测作者 + // + active: 0, + activeNames: [], + show1: false, + show2: false, + dt: '', + dt2: '', + // 总体模式 + totalMode: 0, // 0便捷 1高级 + /* 分析词设置 */ + currWordType: '必选词和的关系', + wtShow: false, + wtColumns: ['必选词和的关系','主题词或的关系'], + // 是否推送信息 + infoPushChecked: false, + }, + onLoad: function(options) { + this.setData({Guid: options.Guid}); + }, + onShow() { + app.globalData.request({ + action: 'getSchemeDataByGuid', + token: 't%2BrswgjvzGM=', + Guids: this.data.Guid, + }).then(res => { + if(res.DetailsData) { + if(res.DetailsData[0].IsAdvancedQuery == 1) { + this.setData({totalMode: 1, highAnalizeWord: res.DetailsData[0].AnalyzeWord,}) + } else if(res.DetailsData[0].IsAdvancedQuery == 0) { + this.setData({totalMode: 0, currWordType: '必选词和的关系'}) + } else { + this.setData({totalMode: 0, currWordType: '主题词或的关系'}) + } + this.setData({ + AnalyzeWord: res.DetailsData[0].AnalyzeWord, + HuoWord: res.DetailsData[0].HuoWord, + PaiChu: res.DetailsData[0].PaiChu, + UserAuthor: res.DetailsData[0].UserAuthor, + Source: res.DetailsData[0].Source, + }) + } + this.setData({ + Name: res.Name, + StartTime: res.StartTime, + start: res.StartTime, + EndTime: res.EndTime, + end: res.EndTime, + }) + }); + }, + //表单 + themeNameInput(event) { + this.setData({ Name: event.detail.value}) + }, + // + changeTips(value) { + this.setData({ + activeNames: value.detail, + }); + }, + onConfirm(event) { + var time = moment(event.detail).format("YYYY-MM-DD HH:mm:ss") + this.setData({ + show1: false, + StartTime: time, + start: time + }); + }, + onConfirm2(event) { + var time = moment(event.detail).format("YYYY-MM-DD HH:mm:ss") + this.setData({ + show2: false, + EndTime: time, + end: time + }); + }, + onDisplay() { + this.setData({ show1: true }); + }, + onDisplay2() { + this.setData({ show2: true }); + }, + onCancel() { + this.setData({ show1: false, }); + }, + onCancel2() { + this.setData({ show2: false, }); + }, + changeTotalMode(event) { + this.setData({ totalMode: event.detail.index }); + }, + wordType() { + this.setData({ wtShow: true }); + }, + wtConfirm(event) { + this.setData({ wtShow: false, currWordType: event.detail.value }); + }, + wtCancel() { + this.setData({ wtShow: false }); + }, + infoPushChange(event) { + this.setData({ infoPushChecked: event.detail }); + }, + goBeforeStep() { + this.setData({ active: this.data.active - 1 }) + }, + goNextStep() { + this.setData({ active: this.data.active + 1 }) + }, + // 分析词设置 + bindAnalyzeWord(event) { + this.setData({ AnalyzeWord: event.detail.value}) + }, + bindHuoWord(event) { + this.setData({ HuoWord: event.detail.value}) + }, + bindPaiChu(event) { + this.setData({ PaiChu: event.detail.value}) + }, + bindHighAnalizeWord(event) { + this.setData({ highAnalizeWord: event.detail.value}) + }, + // 定向监测 + bindSource(event) { + this.setData({ Source: event.detail.value}) + }, + bindUserAuthor(event) { + this.setData({ UserAuthor: event.detail.value}) + }, + themeSave() { + let dtData = { + "AnalyzeWord": this.data.AnalyzeWord, + "HuoWord": this.data.HuoWord, + "PaiChu": this.data.PaiChu, + "IsAdvancedQuery": this.data.totalMode == 0&&this.data.currWordType == '必选词和的关系'?0:this.data.totalMode == 1 ? 1:2, + "Source": this.data.Source, + "UserAuthor": this.data.UserAuthor + }; + let jsonObj = { + "Guids": this.data.Guid, + "Name": this.data.Name, + "Classify": 0, + "StartTime": this.data.StartTime, + "EndTime": this.data.EndTime, + "Types": "theme", + "DetailsData": [dtData] + } + var dtJson = JSON.stringify(jsonObj) + app.globalData.request({ + action: 'setSchemeData', //数据列表 + token: 't%2BrswgjvzGM=', + DataJson: dtJson, + }).then(res => { + wx.showModal({ + title: '编辑成功!', + showCancel: false, + success: function(result) { + if(result.cancel == false) { + wx.navigateBack({ + delta: 1, + }) + } + } + }); + }); + } +}) \ No newline at end of file diff --git a/pages/insight/pages/editTheme/index.json b/pages/insight/pages/editTheme/index.json new file mode 100644 index 0000000..a16d82c --- /dev/null +++ b/pages/insight/pages/editTheme/index.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + + }, + "navigationBarTitleText":"编辑主题", + "navigationBarBackgroundColor":"#ffffff", + "navigationBarTextStyle":"black" +} \ No newline at end of file diff --git a/pages/insight/pages/editTheme/index.wxml b/pages/insight/pages/editTheme/index.wxml new file mode 100644 index 0000000..76ffbff --- /dev/null +++ b/pages/insight/pages/editTheme/index.wxml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + 主题名称 + + 监测开始时间 + + + + 监测结束时间 + + + + + + + + + + + + 便捷模式注释 + 高级模式注释 + + + Q 必选关键词含义 + A 所有词语全部匹配;关键词之间是和的关系;最大字符不能超过50个中文字符;必选关键词用逗号分词。 + + + Q 可选关键词含义 + A 词语中至少有一个匹配;可选词与必选词是或的关系;最大字符不能超过250个中文字符;可选关键词用逗号分词。 + + + Q 排除关键词 + A 排除相关内容 ,主要是去除信息中的冗余、垃圾信息。最大字符不能超过250个中文字符;排除关键词用逗号分词。 + + + Q 示例解释 + A + 必选词(宝马,大众):同时包含宝马和大众的数据。 + 可选词(别克,吉利):包含别克或吉利的数据。 + 可选词(别克,吉利)+ 排除词(促销,广告):包含别克或吉利同时不包含促销和广告的数据。 + 必要词(宝马,吉利)+ 可选词(别克,吉利)+ 排除词(促销):包含宝马和吉利,同时包含别克或吉利,且不包含促销的数据。 + + + + + Q 符号含义 + A 高级模式由关键词及 + - | () 4种符号组成。(1)“+”:和的关系,同时包含。(2)“-”:排除的关系,不包含。(3)“|”:或的关系。 + + + Q 示例解释 + A + (1)宝马 + 大众:同时包含宝马及大众的数据。 + (2)宝马- 大众:包含宝马,但不包含大众的数据 + (3)宝马| 大众:包含宝马或大众的数据 + (4)(宝马+ 大众)|(别克+吉利):同时包含宝马及大众 或者 同时包含别克及吉利的数据 + (5)(宝马| 大众)+(别克|吉利)-(促销|广告):包含'宝马'或'大众' 同时包含'别克'或'吉利' 且不包含'促销'或'广告'的数据 + + + + + 必选词与主题词 + + + + + + 必选词(必选词逗号间是和的关系) + + 可选词(可选词与必选词是或的关系) + + + + 主体词(主体词逗号之间是或的关系) + + 关键词组(主体词逗号之间是或的关系) + + + 排除词(搜索结果将不会含有排除词的数据) + + + + + + + 分析词设置 + + + + + 媒体 + + 作者 + + 域名 + + + 是否配置推送消息 + + + + + + + + + + 下一步 + + + 上一步 + 下一步 + 保存 + + \ No newline at end of file diff --git a/pages/insight/pages/editTheme/index.wxss b/pages/insight/pages/editTheme/index.wxss new file mode 100644 index 0000000..6bf4614 --- /dev/null +++ b/pages/insight/pages/editTheme/index.wxss @@ -0,0 +1,56 @@ +.at-content{ + margin-top: 34rpx; + width: 92%; + /* height: 528rpx; */ + margin-left:32rpx; + padding: 0rpx 0rpx 32rpx 0rpx; +} +.form-content { + font-size: 28rpx; + font-weight: bolder; + margin-top: 32rpx; + padding: 24rpx 10rpx 24rpx 10rpx; + background: #ffffff; +} +.next-btn { + font-size: 28rpx; + width: 50%; + font-weight: bolder; + padding: 24rpx 0rpx 24rpx 0rpx; + background: #f9f9f9; +} +.at-content input{ + height: 96rpx; + width: 570rpx; + background-color: #f9f9f9; + margin-top: 24rpx; + margin-left: 32rpx; + padding-left: 32rpx; + font-size: 28rpx; + color: #333333; +} +.at-content textarea{ + height: 128rpx; + width: 570rpx; + background-color: #f9f9f9; + margin-top: 24rpx; + margin-left: 32rpx; + padding: 32rpx 8rpx 32rpx 24rpx; + font-size: 28rpx; + color: #333333; +} +.placeholder-style{ + font-size: 28rpx; +} +.date-picker-cell { + background-color: #f9f9f9; + margin-top: 24rpx; +} +/* tabs */ +.view-tabs .van-tab--active{ + font-weight: 600; +} +/* steps */ +.van-step__title{ + font-size: 14px !important; +} \ No newline at end of file diff --git a/pages/insight/pages/themeList/index.js b/pages/insight/pages/themeList/index.js index a3c9525..5148ec5 100644 --- a/pages/insight/pages/themeList/index.js +++ b/pages/insight/pages/themeList/index.js @@ -19,6 +19,10 @@ Page({ dataList: [], //全选 isSelectAll: [], + //搜索 + sTitleType: -1, + searchOption: [], + sTitle: '', }, onLoad: function(options) { this.setData({Guid: options.Guid}) @@ -40,6 +44,17 @@ Page({ }).then(res => { this.setData({qgList: res}) }); + app.globalData.request({ + action: 'getQueryType', //获取查询类型 + token: 't%2BrswgjvzGM=', + }).then(res => { + let option = []; + res.forEach(ele => { + let obj = {text: ele.value, value: ele.key}; + option.push(obj) + }); + this.setData({searchOption: option}) + }); }, getData() { app.globalData.request({ @@ -50,7 +65,8 @@ Page({ sEndTime: wx.getStorageSync('sEndTime') || '', sQuDao: (this.data.sQuDao).join(',') || '-1', sQingGan: (this.data.sQingGan).join(',') || '-1', - sTitle: '', + sTitle: this.data.sTitle, + sTitleType: this.data.sTitleType, iPageIndex: 1, iPageSize: 20, sType: 'ZhuTiFenXiBl', @@ -79,6 +95,7 @@ Page({ iGroupByChange(event) {this.setData({ iGroupBy: event.detail });this.getData()}, iTimeTypeChange(event) {this.setData({ iTimeType: event.detail });this.getData()}, listTypeChange(event) {this.setData({ listType: event.detail });this.getData()}, + sTitleChange(event) {this.setData({ sTitle: event.detail });this.getData()}, changeSelectAll(event) { this.setData({ isSelectAll: event.detail}); }, diff --git a/pages/insight/pages/themeList/index.wxml b/pages/insight/pages/themeList/index.wxml index 3ae77bf..a7b065b 100644 --- a/pages/insight/pages/themeList/index.wxml +++ b/pages/insight/pages/themeList/index.wxml @@ -1,4 +1,14 @@ + + + + + + + + + + diff --git a/pages/insight/themeChild/index.js b/pages/insight/themeChild/index.js index 09e0795..29f8436 100644 --- a/pages/insight/themeChild/index.js +++ b/pages/insight/themeChild/index.js @@ -58,10 +58,26 @@ Component({ }) }, editTheme(event) { - console.log(event.currentTarget.dataset.id) + let id = event.currentTarget.dataset.id + wx.navigateTo({ + url: '/pages/insight/pages/editTheme/index' + '?Guid=' + id, + }) }, deleteTheme(event) { - console.log(event.currentTarget.dataset.id) + wx.showModal({ + title: '是否要删除该主题?', + success: (result) => { + if(result.cancel == false) { + app.globalData.request({ + action: 'delCarBigDataByGuid', + token: 't%2BrswgjvzGM=', + Guids: event.currentTarget.dataset.id + }).then(res => { + this.getData() + }); + } + } + }); } }, lifetimes: {