You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
3.1 KiB

// pages/quest/subpage/detail/detail.js
import {
http,matchType
} from '../../../../utils/util'
Page({
/**
* 页面的初始数据
*/
data: {
top: [{
name: "详细信息",
url_act: "./image/ic_xxxx_sel@2x.png",
url_non: "./image/ic_xxxx_nor@2x.png"
}, {
name: "上传链接",
url_act: "./image/ic_sclj_sel@2x.png",
url_non: "./image/ic_sclj_nor@2x.png"
}, {
name: "线索收集",
url_act: "./image/ic_xssj_sel@2x.png",
url_non: "./image/img_xxsj_nor@2x.png"
}, {
name: "传播效果",
url_act: "./image/ic_cbsg_sel@2x.png",
url_non: "./image/ic_cbxg_nor@2x.png"
}, ],
flag: 0,
quest: null,
table: [],
data: null,
linkre: null,
effect: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let that = this
wx.setNavigationBarTitle({
title: '任务详情',
})
wx.setNavigationBarColor({
backgroundColor: '#006BFF',
frontColor: '#ffffff',
})
this.setData({
quest: options.id
})
this.getdata()
},
change(e) {
this.setData({
'flag': e.target.dataset.index
})
},
getdata() {
http("/task/detail", "post", {
id: this.data.quest
}).then(res => {
this.setData({
data: res.data,
table: res.data.rewardRuleList,
})
if (this.data.data.teachRefeList.length!==0){
for (let index = 0; index < this.data.data.teachRefeList.length; index++) {
const element = this.data.data.teachRefeList[index];
console.log(matchType(this.data.data.teachRefeList[index].teachRefeFileUrl))
this.data.data.teachRefeList[index].filetype = matchType(this.data.data.teachRefeList[index].teachRefeFileUrl)
}
this.setData({
'data.teachRefeList':this.data.data.teachRefeList
})
}
this.setData({
'data.start': res.data.start.slice(0, 10),
'data.end': res.data.end.slice(0, 10)
})
})
http("/video/addedRecord", "post", {
taskId: this.data.quest
}).then(res => {
this.setData({
linkre: res.data.records
})
})
http("/task/communicationEffect", "post", {
id: this.data.quest
}).then(res => {
let arr =[]
let dark = true
res.data.videoData.forEach(element => {
arr[element.type-1] = element
arr[element.type-1].dark = dark
dark = !dark
});
let a = {}
a = res.data
a.videoData = arr
this.setData({
effect: a
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})