|
|
|
@ -34,23 +34,33 @@ Page({
|
|
|
|
|
rank: [{
|
|
|
|
|
name: '全部日期',
|
|
|
|
|
is: true,
|
|
|
|
|
month:''
|
|
|
|
|
month: '',
|
|
|
|
|
id: ''
|
|
|
|
|
}, {
|
|
|
|
|
name: '一个月内',
|
|
|
|
|
is: false,
|
|
|
|
|
month:1
|
|
|
|
|
month: 1,
|
|
|
|
|
id: 0
|
|
|
|
|
}, {
|
|
|
|
|
name: '三个月内',
|
|
|
|
|
is: false,
|
|
|
|
|
month:3
|
|
|
|
|
month: 3,
|
|
|
|
|
id: 1
|
|
|
|
|
}, {
|
|
|
|
|
name: '半年内',
|
|
|
|
|
is: false,
|
|
|
|
|
month:6
|
|
|
|
|
month: 6,
|
|
|
|
|
id: 2
|
|
|
|
|
}, {
|
|
|
|
|
name: '一年内',
|
|
|
|
|
is: false,
|
|
|
|
|
month:12
|
|
|
|
|
month: 12,
|
|
|
|
|
id: 3
|
|
|
|
|
}, {
|
|
|
|
|
name: '自定义',
|
|
|
|
|
is: false,
|
|
|
|
|
month: 99,
|
|
|
|
|
id: 4
|
|
|
|
|
}]
|
|
|
|
|
}, {
|
|
|
|
|
id: 2,
|
|
|
|
@ -75,7 +85,10 @@ Page({
|
|
|
|
|
brandIdList: [],
|
|
|
|
|
keyword: '',
|
|
|
|
|
cdn: getApp().globalData.cdn,
|
|
|
|
|
flag: true
|
|
|
|
|
flag: true,
|
|
|
|
|
beginTime: '',
|
|
|
|
|
endTime: '',
|
|
|
|
|
datepick: false
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
@ -126,14 +139,16 @@ Page({
|
|
|
|
|
http("/userReference/list", "post", {
|
|
|
|
|
pageNum: this.data.page,
|
|
|
|
|
month: this.data.month,
|
|
|
|
|
tagIdList: this.data.tagIdList[0]?this.data.tagIdList:[],
|
|
|
|
|
brandIdList: this.data.brandIdList[0]?this.data.brandIdList:[],
|
|
|
|
|
beginTime: this.data.beginTime ? this.data.beginTime + ' 00:00:00' : '',
|
|
|
|
|
endTime: this.data.endTime ? this.data.endTime + ' 00:00:00' : '',
|
|
|
|
|
tagIdList: this.data.tagIdList[0] ? this.data.tagIdList : [],
|
|
|
|
|
brandIdList: this.data.brandIdList[0] ? this.data.brandIdList : [],
|
|
|
|
|
keyword: this.data.keyword
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let arr = []
|
|
|
|
|
res.data.records.forEach(el => {
|
|
|
|
|
el.referenceList.forEach(e => {
|
|
|
|
|
e.isCollected=true
|
|
|
|
|
e.isCollected = true
|
|
|
|
|
arr.push(e)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
@ -167,7 +182,7 @@ Page({
|
|
|
|
|
// 点击事件,开始时一定会执行的,先令所有下拉选项先隐藏
|
|
|
|
|
const promise = new Promise((res) => {
|
|
|
|
|
this.setData({
|
|
|
|
|
showOrHide: true
|
|
|
|
|
showOrHide: false
|
|
|
|
|
})
|
|
|
|
|
res()
|
|
|
|
|
})
|
|
|
|
@ -229,25 +244,33 @@ Page({
|
|
|
|
|
navItem,
|
|
|
|
|
selectedItem
|
|
|
|
|
})
|
|
|
|
|
this.data.selectItem[1].rank.forEach(el=>{
|
|
|
|
|
this.data.selectItem[1].rank.forEach(el => {
|
|
|
|
|
// console.log(el)
|
|
|
|
|
if(el.is){
|
|
|
|
|
this.setData({
|
|
|
|
|
month: el.month
|
|
|
|
|
})
|
|
|
|
|
if (el.is) {
|
|
|
|
|
if (el.month === 99) {
|
|
|
|
|
this.setData({
|
|
|
|
|
datepick: true
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.setData({
|
|
|
|
|
month: el.month,
|
|
|
|
|
beginTime: '',
|
|
|
|
|
endTime: ''
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.data.selectItem[0].rank.forEach(el=>{
|
|
|
|
|
this.data.selectItem[0].rank.forEach(el => {
|
|
|
|
|
// console.log(el)
|
|
|
|
|
if(el.is){
|
|
|
|
|
if (el.is) {
|
|
|
|
|
this.setData({
|
|
|
|
|
'tagIdList[0]': el.id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.data.selectItem[2].rank.forEach(el=>{
|
|
|
|
|
this.data.selectItem[2].rank.forEach(el => {
|
|
|
|
|
// console.log(el)
|
|
|
|
|
if(el.is){
|
|
|
|
|
if (el.is) {
|
|
|
|
|
this.setData({
|
|
|
|
|
'brandIdList[0]': el.id
|
|
|
|
|
})
|
|
|
|
@ -260,13 +283,71 @@ Page({
|
|
|
|
|
})
|
|
|
|
|
this.getdata()
|
|
|
|
|
},
|
|
|
|
|
handleSearch(e){
|
|
|
|
|
bindDateChange: function (e) {
|
|
|
|
|
this.setData({
|
|
|
|
|
beginTime: e.detail.value
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
bindDateChange2: function (e) {
|
|
|
|
|
this.setData({
|
|
|
|
|
endTime: e.detail.value
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
timeclick(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
if (e.currentTarget.dataset.tu === '1') {
|
|
|
|
|
this.setData({
|
|
|
|
|
beginTime: '',
|
|
|
|
|
endTime: '',
|
|
|
|
|
datepick: false,
|
|
|
|
|
'selectItem[1].rank[5].title': '自定义',
|
|
|
|
|
'selectItem[1].rank[0].is': true,
|
|
|
|
|
'selectItem[1].rank[0].is': false,
|
|
|
|
|
'navItem[1].name': '全部日期'
|
|
|
|
|
})
|
|
|
|
|
let e = {
|
|
|
|
|
currentTarget:{
|
|
|
|
|
dataset:{
|
|
|
|
|
contant: '全部日期',
|
|
|
|
|
id: 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.closeMask(e)
|
|
|
|
|
} else {
|
|
|
|
|
if (this.data.beginTime === '') {
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '请输入开始时间',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
} else if (this.data.endTime === '') {
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '请输入结束时间',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.setData({
|
|
|
|
|
datepick: false,
|
|
|
|
|
'selectItem[1].rank[5].title': this.data.beginTime + ' ~ ' + this.data.endTime,
|
|
|
|
|
'navItem[1].name': this.data.beginTime + ' ~ ' + this.data.endTime,
|
|
|
|
|
month: '',
|
|
|
|
|
questes: [],
|
|
|
|
|
page: 1,
|
|
|
|
|
maxpage: 1
|
|
|
|
|
})
|
|
|
|
|
this.getdata()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSearch(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
this.setData({
|
|
|
|
|
keyword: e.detail,
|
|
|
|
|
listdata: [],
|
|
|
|
|
max:1,
|
|
|
|
|
page:1
|
|
|
|
|
max: 1,
|
|
|
|
|
page: 1
|
|
|
|
|
})
|
|
|
|
|
this.getdata()
|
|
|
|
|
},
|
|
|
|
@ -281,13 +362,12 @@ Page({
|
|
|
|
|
let c = 'listdata[' + a + '].referenceList[' + b + '].choose'
|
|
|
|
|
// console.log(e.currentTarget.dataset.data)
|
|
|
|
|
this.setData({
|
|
|
|
|
[c] : !this.data.listdata[a].referenceList[b].choose
|
|
|
|
|
[c]: !this.data.listdata[a].referenceList[b].choose
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let flag = true
|
|
|
|
|
for (let i = 0; i < this.data.listdata[a].referenceList.length; i++) {
|
|
|
|
|
if (this.data.listdata[a].referenceList[i].choose) {
|
|
|
|
|
} else {
|
|
|
|
|
if (this.data.listdata[a].referenceList[i].choose) {} else {
|
|
|
|
|
flag = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -319,19 +399,19 @@ Page({
|
|
|
|
|
batch() {
|
|
|
|
|
let arr = []
|
|
|
|
|
this.data.listdata.forEach(el => {
|
|
|
|
|
el.referenceList.forEach(e=> {
|
|
|
|
|
el.referenceList.forEach(e => {
|
|
|
|
|
// console.log(e.choose)
|
|
|
|
|
if(e.choose){
|
|
|
|
|
if (e.choose) {
|
|
|
|
|
arr.push(e)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
return arr
|
|
|
|
|
},
|
|
|
|
|
add () {
|
|
|
|
|
add() {
|
|
|
|
|
let arr = this.batch()
|
|
|
|
|
let b = []
|
|
|
|
|
arr.forEach(el=>{
|
|
|
|
|
arr.forEach(el => {
|
|
|
|
|
b.push(el.id)
|
|
|
|
|
})
|
|
|
|
|
if (b.length === 0) {
|
|
|
|
@ -339,8 +419,8 @@ Page({
|
|
|
|
|
title: '请选择',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 1000
|
|
|
|
|
})
|
|
|
|
|
return 0
|
|
|
|
|
})
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
http("/userReference/addGroup", "post", {
|
|
|
|
|
referenceIdList: b
|
|
|
|
@ -350,7 +430,7 @@ Page({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (re.code === 200){
|
|
|
|
|
if (re.code === 200) {
|
|
|
|
|
this.setData({
|
|
|
|
|
listdata: [],
|
|
|
|
|
page: 1
|
|
|
|
@ -360,10 +440,10 @@ Page({
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
del () {
|
|
|
|
|
del() {
|
|
|
|
|
let arr = this.batch()
|
|
|
|
|
let b = []
|
|
|
|
|
arr.forEach(el=>{
|
|
|
|
|
arr.forEach(el => {
|
|
|
|
|
b.push(el.id)
|
|
|
|
|
})
|
|
|
|
|
if (b.length === 0) {
|
|
|
|
@ -371,8 +451,8 @@ Page({
|
|
|
|
|
title: '请选择',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 1000
|
|
|
|
|
})
|
|
|
|
|
return 0
|
|
|
|
|
})
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
http("/userReference/delGroup", "post", {
|
|
|
|
|
referenceIdList: b
|
|
|
|
@ -382,7 +462,7 @@ Page({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (re.code === 200){
|
|
|
|
|
if (re.code === 200) {
|
|
|
|
|
this.setData({
|
|
|
|
|
listdata: [],
|
|
|
|
|
page: 1
|
|
|
|
@ -392,10 +472,10 @@ Page({
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
batchdown(){
|
|
|
|
|
batchdown() {
|
|
|
|
|
let arr = this.batch()
|
|
|
|
|
let b = []
|
|
|
|
|
arr.forEach(el=>{
|
|
|
|
|
arr.forEach(el => {
|
|
|
|
|
b.push(el.fileUrl)
|
|
|
|
|
})
|
|
|
|
|
if (b.length === 0) {
|
|
|
|
@ -403,14 +483,14 @@ Page({
|
|
|
|
|
title: '请选择',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 1000
|
|
|
|
|
})
|
|
|
|
|
return 0
|
|
|
|
|
})
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
b.forEach(el=>{
|
|
|
|
|
b.forEach(el => {
|
|
|
|
|
this.downloadfile(el)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
downloadfile(url){
|
|
|
|
|
downloadfile(url) {
|
|
|
|
|
wx.showLoading({
|
|
|
|
|
title: '正在下载',
|
|
|
|
|
mask: true
|
|
|
|
@ -426,12 +506,12 @@ Page({
|
|
|
|
|
tempFilePath: res.tempFilePath,
|
|
|
|
|
success: function (res) {
|
|
|
|
|
console.log(res)
|
|
|
|
|
console.log('保存到本地',res)
|
|
|
|
|
console.log('保存到本地', res)
|
|
|
|
|
wx.saveVideoToPhotosAlbum({
|
|
|
|
|
filePath: res.savedFilePath,
|
|
|
|
|
complete(res){
|
|
|
|
|
complete(res) {
|
|
|
|
|
wx.hideLoading();
|
|
|
|
|
console.log('保存到相册',res)
|
|
|
|
|
console.log('保存到相册', res)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -439,7 +519,7 @@ Page({
|
|
|
|
|
wx.hideLoading();
|
|
|
|
|
console.log('保存失败:', err)
|
|
|
|
|
},
|
|
|
|
|
complete(res){
|
|
|
|
|
complete(res) {
|
|
|
|
|
wx.hideLoading();
|
|
|
|
|
console.log(res)
|
|
|
|
|
}
|
|
|
|
|