大数据详情浏览量、首页动态栏目接口修改
This commit is contained in:
parent
7e80b99032
commit
859d40a127
@ -2,131 +2,143 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
activityUrl: app.activityUrl,
|
activityUrl: app.activityUrl,
|
||||||
dataMap: {},
|
dataMap: {},
|
||||||
token: ''
|
token: ''
|
||||||
},
|
},
|
||||||
getToken: function() {
|
getToken: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(resolve =>{
|
return new Promise(resolve => {
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
key: 'token',
|
key: 'token',
|
||||||
success(res) {
|
success(res) {
|
||||||
self.setData({
|
self.setData({
|
||||||
token: res.data
|
token: res.data
|
||||||
})
|
})
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goSign: function (e) {
|
|
||||||
var activityId = e.currentTarget.dataset.id;
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../activitySign/activitySign?id=' + activityId
|
|
||||||
})
|
|
||||||
},
|
|
||||||
cancel: function(e) {
|
|
||||||
var activityId = e.currentTarget.dataset.id;
|
|
||||||
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/cancelapply/' + activityId, []),
|
|
||||||
{}, {
|
|
||||||
headers: {
|
|
||||||
token: self.data.token
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
if('200' == code) {
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../activityDetail/activityDetail?id=' + activityId
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad: function (options) {
|
|
||||||
var self = this;
|
|
||||||
this.getToken().then(result => {
|
|
||||||
var url;
|
|
||||||
var id = options.id;
|
|
||||||
if(!self.data.token) {
|
|
||||||
url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id;
|
|
||||||
self.setData({
|
|
||||||
token: null
|
|
||||||
})
|
})
|
||||||
}else {
|
},
|
||||||
url = '/app/activitylibrary/getactivitylibrarybyid/' + id
|
goSign: function (e) {
|
||||||
self.getToken()
|
var activityId = e.currentTarget.dataset.id;
|
||||||
}
|
wx.navigateTo({
|
||||||
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, {
|
url: '../activitySign/activitySign?id=' + activityId
|
||||||
headers: {
|
})
|
||||||
token: self.data.token
|
},
|
||||||
}
|
cancel: function (e) {
|
||||||
}, function(code, data) {
|
var activityId = e.currentTarget.dataset.id;
|
||||||
data.activityImageArray = data.activityImage.split(',');
|
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/cancelapply/' + activityId, []),
|
||||||
self.setData({
|
{}, {
|
||||||
dataMap: data
|
headers: {
|
||||||
|
token: self.data.token
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
if ('200' == code) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../activityDetail/activityDetail?id=' + activityId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
var self = this;
|
||||||
|
this.getToken().then(result => {
|
||||||
|
var url;
|
||||||
|
var id = options.id;
|
||||||
|
if (!self.data.token) {
|
||||||
|
url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id;
|
||||||
|
self.setData({
|
||||||
|
token: null
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
url = '/app/activitylibrary/getactivitylibrarybyid/' + id
|
||||||
|
self.getToken()
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, {
|
||||||
|
headers: {
|
||||||
|
token: self.data.token
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
data.activityImageArray = data.activityImage.split(',');
|
||||||
|
self.setData({
|
||||||
|
dataMap: data
|
||||||
|
})
|
||||||
|
}, function (code, data) {
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
this.saveBigdata(options.id);
|
||||||
|
},
|
||||||
|
saveBigdata(id) {
|
||||||
|
var params = "小程序" + id + "活动";
|
||||||
|
var info = {
|
||||||
|
requestUrl: params
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null,
|
||||||
|
function (code, data) {
|
||||||
|
|
||||||
|
}, function (code, err) {
|
||||||
|
|
||||||
})
|
})
|
||||||
}, function(code, data) {
|
},
|
||||||
app.dialog.msg(data.msg);
|
/**
|
||||||
});
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
})
|
*/
|
||||||
},
|
onReady: function () {
|
||||||
|
|
||||||
/**
|
},
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady: function () {
|
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
/**
|
},
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow: function () {
|
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
/**
|
},
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide: function () {
|
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
/**
|
},
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload: function () {
|
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
/**
|
},
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh: function () {
|
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
/**
|
},
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom: function () {
|
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
/**
|
}
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage: function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
@ -1,99 +1,111 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
function getRandomColor() {
|
function getRandomColor() {
|
||||||
const rgb = []
|
const rgb = []
|
||||||
for (let i = 0; i < 3; ++i) {
|
for (let i = 0; i < 3; ++i) {
|
||||||
let color = Math.floor(Math.random() * 256).toString(16)
|
let color = Math.floor(Math.random() * 256).toString(16)
|
||||||
color = color.length === 1 ? '0' + color : color
|
color = color.length === 1 ? '0' + color : color
|
||||||
rgb.push(color)
|
rgb.push(color)
|
||||||
}
|
}
|
||||||
return '#' + rgb.join('')
|
return '#' + rgb.join('')
|
||||||
}
|
}
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
liveUrl: app.liveUrl,
|
liveUrl: app.liveUrl,
|
||||||
liveDetail: {},
|
liveDetail: {},
|
||||||
videoContext: null,
|
videoContext: null,
|
||||||
},
|
},
|
||||||
|
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
title: 'video',
|
title: 'video',
|
||||||
path: 'page/component/pages/video/video'
|
path: 'page/component/pages/video/video'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onReady() {
|
onReady() {
|
||||||
// this.videoContext = wx.createVideoContext('myVideo')
|
// this.videoContext = wx.createVideoContext('myVideo')
|
||||||
|
|
||||||
},
|
|
||||||
getLivePlan(livePlanId) {
|
|
||||||
var self = this;
|
|
||||||
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/getliveplanbyidrelease/{livePlanId}', [self.data.liveUrl, livePlanId]), {}, null, function(code, data) {
|
|
||||||
self.setData({
|
|
||||||
liveDetail: data
|
|
||||||
});
|
|
||||||
self.videoContext = wx.createLivePlayerContext('liveVideo');
|
|
||||||
self.videoContext.play();
|
|
||||||
}, function(code, data) {
|
|
||||||
app.dialog.msg(data.msg);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
goLiveRecord(event) {
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../broadcastList/broadcastList?livePlanId='+ event.currentTarget.dataset.livePlanId,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onLoad(option) {
|
|
||||||
this.getLivePlan(option.livePlanId);
|
|
||||||
},
|
|
||||||
|
|
||||||
onHide() {
|
},
|
||||||
|
getLivePlan(livePlanId) {
|
||||||
},
|
var self = this;
|
||||||
|
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/getliveplanbyidrelease/{livePlanId}', [self.data.liveUrl, livePlanId]), {}, null, function (code, data) {
|
||||||
inputValue: '',
|
self.setData({
|
||||||
|
liveDetail: data
|
||||||
|
});
|
||||||
bindInputBlur(e) {
|
self.videoContext = wx.createLivePlayerContext('liveVideo');
|
||||||
this.inputValue = e.detail.value
|
self.videoContext.play();
|
||||||
},
|
}, function (code, data) {
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
bindButtonTap() {
|
});
|
||||||
const that = this
|
},
|
||||||
wx.chooseVideo({
|
goLiveRecord(event) {
|
||||||
sourceType: ['album', 'camera'],
|
wx.navigateTo({
|
||||||
maxDuration: 60,
|
url: '../broadcastList/broadcastList?livePlanId=' + event.currentTarget.dataset.livePlanId,
|
||||||
camera: ['front', 'back'],
|
|
||||||
success(res) {
|
|
||||||
that.setData({
|
|
||||||
src: res.tempFilePath
|
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
})
|
onLoad(option) {
|
||||||
},
|
this.getLivePlan(option.livePlanId);
|
||||||
|
this.saveBigdata(option.livePlanId)
|
||||||
|
},
|
||||||
|
saveBigdata(id) {
|
||||||
|
var params = "小程序" + id + "直播";
|
||||||
|
var info = {
|
||||||
|
requestUrl: params
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null,
|
||||||
|
function (code, data) {
|
||||||
|
|
||||||
bindVideoEnterPictureInPicture() {
|
}, function (code, err) {
|
||||||
console.log('进入小窗模式')
|
|
||||||
},
|
|
||||||
|
|
||||||
bindVideoLeavePictureInPicture() {
|
})
|
||||||
console.log('退出小窗模式')
|
},
|
||||||
},
|
onHide() {
|
||||||
|
|
||||||
bindPlayVideo() {
|
},
|
||||||
console.log('1')
|
|
||||||
this.videoContext.play()
|
|
||||||
},
|
|
||||||
bindSendDanmu() {
|
|
||||||
this.videoContext.sendDanmu({
|
|
||||||
text: this.inputValue,
|
|
||||||
color: getRandomColor()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
videoErrorCallback(e) {
|
inputValue: '',
|
||||||
console.log('视频错误信息:')
|
|
||||||
console.log(e.detail.errMsg)
|
|
||||||
}
|
bindInputBlur(e) {
|
||||||
|
this.inputValue = e.detail.value
|
||||||
|
},
|
||||||
|
|
||||||
|
bindButtonTap() {
|
||||||
|
const that = this
|
||||||
|
wx.chooseVideo({
|
||||||
|
sourceType: ['album', 'camera'],
|
||||||
|
maxDuration: 60,
|
||||||
|
camera: ['front', 'back'],
|
||||||
|
success(res) {
|
||||||
|
that.setData({
|
||||||
|
src: res.tempFilePath
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
bindVideoEnterPictureInPicture() {
|
||||||
|
console.log('进入小窗模式')
|
||||||
|
},
|
||||||
|
|
||||||
|
bindVideoLeavePictureInPicture() {
|
||||||
|
console.log('退出小窗模式')
|
||||||
|
},
|
||||||
|
|
||||||
|
bindPlayVideo() {
|
||||||
|
console.log('1')
|
||||||
|
this.videoContext.play()
|
||||||
|
},
|
||||||
|
bindSendDanmu() {
|
||||||
|
this.videoContext.sendDanmu({
|
||||||
|
text: this.inputValue,
|
||||||
|
color: getRandomColor()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
videoErrorCallback(e) {
|
||||||
|
console.log('视频错误信息:')
|
||||||
|
console.log(e.detail.errMsg)
|
||||||
|
}
|
||||||
})
|
})
|
@ -2,123 +2,136 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
libraryUrl: app.libraryUrl,
|
libraryUrl: app.libraryUrl,
|
||||||
swiper: {
|
swiper: {
|
||||||
imgUrl: [],
|
imgUrl: [],
|
||||||
indicatorDots: false,
|
indicatorDots: false,
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
current: 0
|
current: 0
|
||||||
|
},
|
||||||
|
library: null,
|
||||||
|
libraryPersonList: []
|
||||||
},
|
},
|
||||||
library: null,
|
prevImg: function () {
|
||||||
libraryPersonList: []
|
var swiper = this.data.swiper;
|
||||||
},
|
var current = swiper.current;
|
||||||
prevImg: function () {
|
swiper.current = current > 0 ? current - 1 : swiper.imgUrl.length - 1;
|
||||||
var swiper = this.data.swiper;
|
this.setData({
|
||||||
var current = swiper.current;
|
swiper: swiper,
|
||||||
swiper.current = current > 0 ? current - 1 : swiper.imgUrl.length - 1;
|
})
|
||||||
this.setData({
|
},
|
||||||
swiper: swiper,
|
nextImg: function () {
|
||||||
})
|
var swiper = this.data.swiper;
|
||||||
},
|
var current = swiper.current;
|
||||||
nextImg: function() {
|
swiper.current = current < (swiper.imgUrl.length - 1) ? current + 1 : 0;
|
||||||
var swiper = this.data.swiper;
|
this.setData({
|
||||||
var current = swiper.current;
|
swiper: swiper,
|
||||||
swiper.current = current < (swiper.imgUrl.length - 1) ? current + 1 : 0;
|
})
|
||||||
this.setData({
|
},
|
||||||
swiper: swiper,
|
doGetLibrary: function (libraryId) {
|
||||||
})
|
var self = this;
|
||||||
},
|
app.dialog.loading('正在加载');
|
||||||
doGetLibrary: function(libraryId) {
|
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/getintangiblelibrarybyidrelease/{libraryId}', [self.data.libraryUrl, libraryId]), {}, null, function (code, data) {
|
||||||
var self = this;
|
var covers = data.libraryCover.split(',');
|
||||||
app.dialog.loading('正在加载');
|
var imageArray = [];
|
||||||
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/getintangiblelibrarybyidrelease/{libraryId}', [self.data.libraryUrl, libraryId]), {}, null, function(code, data) {
|
for (var i = 0, item; item = covers[i++];) {
|
||||||
var covers = data.libraryCover.split(',');
|
imageArray.push(app.restAjax.path('{libraryUrl}/route/file/download/true/{cover}', [self.data.libraryUrl, item]));
|
||||||
var imageArray = [];
|
}
|
||||||
for(var i = 0, item; item = covers[i++];) {
|
self.setData({
|
||||||
imageArray.push(app.restAjax.path('{libraryUrl}/route/file/download/true/{cover}', [self.data.libraryUrl, item]));
|
library: data,
|
||||||
}
|
'swiper.imgUrl': imageArray
|
||||||
self.setData({
|
});
|
||||||
library: data,
|
}, function (code, data) {
|
||||||
'swiper.imgUrl': imageArray
|
app.dialog.msg(data.msg);
|
||||||
});
|
}, function () {
|
||||||
}, function(code, data) {
|
wx.stopPullDownRefresh();
|
||||||
app.dialog.msg(data.msg);
|
wx.hideLoading();
|
||||||
}, function() {
|
})
|
||||||
wx.stopPullDownRefresh();
|
},
|
||||||
wx.hideLoading();
|
doGetLibraryPerson: function (libraryId) {
|
||||||
})
|
var self = this;
|
||||||
},
|
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibraryperson/listintangiblelibrarypersonrelease', [self.data.libraryUrl]), {
|
||||||
doGetLibraryPerson: function(libraryId) {
|
intangibleLibraryId: libraryId
|
||||||
var self = this;
|
}, null, function (code, data) {
|
||||||
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibraryperson/listintangiblelibrarypersonrelease', [self.data.libraryUrl]), {
|
self.setData({
|
||||||
intangibleLibraryId: libraryId
|
libraryPersonList: data
|
||||||
}, null, function(code, data) {
|
})
|
||||||
self.setData({
|
}, function (code, data) {
|
||||||
libraryPersonList: data
|
app.dialog.msg(data.msg);
|
||||||
})
|
});
|
||||||
}, function(code, data) {
|
},
|
||||||
app.dialog.msg(data.msg);
|
/**
|
||||||
});
|
* 生命周期函数--监听页面加载
|
||||||
},
|
*/
|
||||||
/**
|
onLoad: function (options) {
|
||||||
* 生命周期函数--监听页面加载
|
var libraryId = options.libraryId
|
||||||
*/
|
this.doGetLibrary(libraryId);
|
||||||
onLoad: function (options) {
|
this.doGetLibraryPerson(libraryId)
|
||||||
var libraryId = options.libraryId
|
this.saveBigdata(libraryId);
|
||||||
this.doGetLibrary(libraryId);
|
},
|
||||||
this.doGetLibraryPerson(libraryId)
|
saveBigdata(id) {
|
||||||
},
|
var params = "小程序" + id + "非遗";
|
||||||
|
var info = {
|
||||||
|
requestUrl: params
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null,
|
||||||
|
function (code, data) {
|
||||||
|
|
||||||
/**
|
}, function (code, err) {
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady: function () {
|
|
||||||
|
|
||||||
},
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
onShow: function () {
|
onReady: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面隐藏
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onHide: function () {
|
onShow: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面卸载
|
* 生命周期函数--监听页面隐藏
|
||||||
*/
|
*/
|
||||||
onUnload: function () {
|
onHide: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 生命周期函数--监听页面卸载
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh: function () {
|
onUnload: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onReachBottom: function () {
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onShareAppMessage: function () {
|
onReachBottom: function () {
|
||||||
|
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
@ -83,7 +83,7 @@ Page({
|
|||||||
//获取首页新闻动态
|
//获取首页新闻动态
|
||||||
getMainNewsTab() {
|
getMainNewsTab() {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/list/areaplate/release/{areaCode}', [_self.data.news.newsUrl, app.areaCode]),
|
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listsub/areaauth/release/{newsDirectoriesId}/{areaCode}', [_self.data.news.newsUrl, '0', app.areaCode]),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
function (code, data) {
|
function (code, data) {
|
||||||
|
@ -15,7 +15,7 @@ swiper {
|
|||||||
right: 50rpx;
|
right: 50rpx;
|
||||||
width: 70rpx;
|
width: 70rpx;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
background: linear-gradient(to right bottom, rgb(238 238 236 / 22%), rgb(105 105 104 / 28%) 70px);
|
background: linear-gradient(to right bottom, #9f15129e, #9f1512 70px);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
padding: 10rpx;
|
padding: 10rpx;
|
||||||
|
|
||||||
|
@ -33,6 +33,19 @@ Page({
|
|||||||
pageHeight: wx.getSystemInfoSync().windowHeight
|
pageHeight: wx.getSystemInfoSync().windowHeight
|
||||||
})
|
})
|
||||||
this.getNewsDetail();
|
this.getNewsDetail();
|
||||||
|
this.saveBigdata(options.id);
|
||||||
|
},
|
||||||
|
saveBigdata(id) {
|
||||||
|
var params = "小程序" + id + "新闻";
|
||||||
|
var info = {
|
||||||
|
requestUrl: params
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null,
|
||||||
|
function (code, data) {
|
||||||
|
|
||||||
|
}, function (code, err) {
|
||||||
|
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getNewsDetail() {
|
getNewsDetail() {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
|
@ -2,300 +2,312 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
dataMap: {},
|
dataMap: {},
|
||||||
token: '',
|
token: '',
|
||||||
serviceId: '',
|
serviceId: '',
|
||||||
type: '',
|
type: '',
|
||||||
|
|
||||||
teamIndex: 0,
|
teamIndex: 0,
|
||||||
teamResult: '请选择服务区域',
|
teamResult: '请选择服务区域',
|
||||||
team: {}, // 服务区域-市
|
team: {}, // 服务区域-市
|
||||||
teamArray: [], // 服务区域-市
|
teamArray: [], // 服务区域-市
|
||||||
},
|
},
|
||||||
getToken: function() {
|
getToken: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(resolve =>{
|
return new Promise(resolve => {
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
key: 'token',
|
key: 'token',
|
||||||
success(res) {
|
success(res) {
|
||||||
self.setData({
|
self.setData({
|
||||||
token: res.data
|
token: res.data
|
||||||
})
|
})
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDetail: function(id) {
|
getDetail: function (id) {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/getvolunteerservicebyid/' + id, []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/getvolunteerservicebyid/' + id, []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': self.data.token
|
'token': self.data.token
|
||||||
}
|
}
|
||||||
}, function(code, data) {
|
}, function (code, data) {
|
||||||
if('200' == code) {
|
if ('200' == code) {
|
||||||
var ph=data.photo
|
var ph = data.photo
|
||||||
if(data.photo.endsWith(",")){
|
if (data.photo.endsWith(",")) {
|
||||||
ph=data.photo.substr(0,data.photo.length-1);
|
ph = data.photo.substr(0, data.photo.length - 1);
|
||||||
}
|
}
|
||||||
data.photo = app.volunteerUrl + '/route/file/download/true/' +ph;
|
data.photo = app.volunteerUrl + '/route/file/download/true/' + ph;
|
||||||
self.setData({
|
self.setData({
|
||||||
dataMap: data
|
dataMap: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, function() {
|
}, function () {
|
||||||
|
|
||||||
}, function() {
|
}, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 志愿者团队报名
|
* 志愿者团队报名
|
||||||
*/
|
*/
|
||||||
enroll: function(e) {
|
enroll: function (e) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.setData({
|
self.setData({
|
||||||
serviceId: e.target.dataset.serviceid,
|
serviceId: e.target.dataset.serviceid,
|
||||||
type: e.target.dataset.type
|
type: e.target.dataset.type
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {志愿者报名} e
|
* @param {志愿者报名} e
|
||||||
*/
|
*/
|
||||||
volunteerEnroll: function(e) {
|
volunteerEnroll: function (e) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.setData({
|
self.setData({
|
||||||
serviceId: e.target.dataset.serviceid,
|
serviceId: e.target.dataset.serviceid,
|
||||||
type: e.target.dataset.type
|
type: e.target.dataset.type
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 提交报名请求
|
||||||
|
var serviceMemberVO = {
|
||||||
|
serviceId: self.data.serviceId,
|
||||||
|
voluntaryType: self.data.type
|
||||||
|
}
|
||||||
|
self.sendEnrollRequest(serviceMemberVO);
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {团队报名} e
|
||||||
|
*/
|
||||||
|
teamChange: function (e) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
self.setData({
|
||||||
|
teamIndex: e.detail.value
|
||||||
|
})
|
||||||
|
|
||||||
|
// 提交报名请求
|
||||||
|
var serviceMemberVO = {
|
||||||
|
serviceId: self.data.serviceId,
|
||||||
|
teamId: self.data.team[self.data.teamIndex].teamId,
|
||||||
|
voluntaryType: self.data.type
|
||||||
|
}
|
||||||
|
self.sendEnrollRequest(serviceMemberVO);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {团队取消报名} e
|
||||||
|
*/
|
||||||
|
teamCancelChange: function (e) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
self.setData({
|
||||||
|
teamIndex: e.detail.value
|
||||||
|
})
|
||||||
|
|
||||||
|
self.sendCancelEnrollRequest();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {志愿者取消报名} e
|
||||||
|
*/
|
||||||
|
volunteerCancelEnroll: function (e) {
|
||||||
|
var self = this;
|
||||||
|
self.setData({
|
||||||
|
serviceId: e.target.dataset.serviceid,
|
||||||
|
type: e.target.dataset.type,
|
||||||
|
teamArray: []
|
||||||
|
})
|
||||||
|
self.sendCancelEnrollRequest();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {发送报名请求} serviceMemberVO
|
||||||
|
*/
|
||||||
|
sendEnrollRequest: function (serviceMemberVO) {
|
||||||
|
var self = this;
|
||||||
|
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/servicemember/saveservicemember', []),
|
||||||
|
serviceMemberVO, {
|
||||||
|
headers: {
|
||||||
|
token: self.data.token
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
if ('200' == code) {
|
||||||
|
app.dialog.msg('注册成功!');
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../volunteer/volunteer',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 发送取消报名请求
|
||||||
|
*/
|
||||||
|
sendCancelEnrollRequest() {
|
||||||
|
var self = this;
|
||||||
|
var url;
|
||||||
|
if (self.data.teamArray.length > 0) {
|
||||||
|
url = app.volunteerUrl + '/app/servicemember/cancelapply/' + self.data.type + '/' + self.data.serviceId + '/' + self.data.team[self.data.teamIndex].teamId;
|
||||||
|
} else {
|
||||||
|
url = app.volunteerUrl + '/app/servicemember/cancelapply/' + self.data.type + '/' + self.data.serviceId + '/null';
|
||||||
|
}
|
||||||
|
|
||||||
|
app.restAjax.get(app.restAjax.path(url, []), {}, {
|
||||||
|
headers: {
|
||||||
|
token: self.data.token
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
if ('200' == code) {
|
||||||
|
app.dialog.msg('取消报名成功!');
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '../volunteer/volunteer',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取我的团队
|
||||||
|
*/
|
||||||
|
getMyTeam: function () {
|
||||||
|
var self = this;
|
||||||
|
console.log(self.data.token)
|
||||||
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/team/myteamm', []),
|
||||||
|
{}, {
|
||||||
|
headers: {
|
||||||
|
token: self.data.token
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
if ('200' == code) {
|
||||||
|
var array = [];
|
||||||
|
for (var item of data.rows) {
|
||||||
|
delete item.teamArea;
|
||||||
|
delete item.teamAreaDictionaryName;
|
||||||
|
delete item.teamWatchword;
|
||||||
|
delete item.teamOwner;
|
||||||
|
delete item.memberId;
|
||||||
|
delete item.memberName;
|
||||||
|
delete item.gmtCreate;
|
||||||
|
delete item.photo;
|
||||||
|
delete item.count;
|
||||||
|
delete item.status;
|
||||||
|
delete item.content;
|
||||||
|
delete item.isTeamOwner;
|
||||||
|
delete item.checkStatus;
|
||||||
|
delete item.teamCounty;
|
||||||
|
delete item.teamCity;
|
||||||
|
delete item.teamCityDictionaryName;
|
||||||
|
delete item.teamCountyDictionaryName;
|
||||||
|
delete item.teamCity;
|
||||||
|
|
||||||
|
array.push(item.teamName);
|
||||||
|
}
|
||||||
|
self.setData({
|
||||||
|
teamArray: array,
|
||||||
|
team: data.rows
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toActivityHis: function (e) {
|
||||||
|
var self = this;
|
||||||
|
const status = e.currentTarget.dataset.status;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../activityDialog/activityDialog?serviceId=' + self.data.serviceId + '&status=' + status,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
var id = options.id;
|
||||||
|
var self = this;
|
||||||
|
self.setData({
|
||||||
|
serviceId: id
|
||||||
|
})
|
||||||
|
this.getToken().then(result => {
|
||||||
|
this.getDetail(id);
|
||||||
|
this.getMyTeam();
|
||||||
|
})
|
||||||
|
this.saveBigdata(id);
|
||||||
|
},
|
||||||
|
saveBigdata(id) {
|
||||||
|
var params = "小程序" + id + "志愿";
|
||||||
|
var info = {
|
||||||
|
requestUrl: params
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null,
|
||||||
|
function (code, data) {
|
||||||
|
|
||||||
|
}, function (code, err) {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
// 提交报名请求
|
|
||||||
var serviceMemberVO = {
|
|
||||||
serviceId: self.data.serviceId,
|
|
||||||
voluntaryType: self.data.type
|
|
||||||
}
|
}
|
||||||
self.sendEnrollRequest(serviceMemberVO);
|
|
||||||
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {团队报名} e
|
|
||||||
*/
|
|
||||||
teamChange: function(e) {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
self.setData({
|
|
||||||
teamIndex: e.detail.value
|
|
||||||
})
|
|
||||||
|
|
||||||
// 提交报名请求
|
|
||||||
var serviceMemberVO = {
|
|
||||||
serviceId: self.data.serviceId,
|
|
||||||
teamId: self.data.team[self.data.teamIndex].teamId,
|
|
||||||
voluntaryType: self.data.type
|
|
||||||
}
|
|
||||||
self.sendEnrollRequest(serviceMemberVO);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {团队取消报名} e
|
|
||||||
*/
|
|
||||||
teamCancelChange: function(e) {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
self.setData({
|
|
||||||
teamIndex: e.detail.value
|
|
||||||
})
|
|
||||||
|
|
||||||
self.sendCancelEnrollRequest();
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {志愿者取消报名} e
|
|
||||||
*/
|
|
||||||
volunteerCancelEnroll: function(e) {
|
|
||||||
var self = this;
|
|
||||||
self.setData({
|
|
||||||
serviceId: e.target.dataset.serviceid,
|
|
||||||
type: e.target.dataset.type,
|
|
||||||
teamArray: []
|
|
||||||
})
|
|
||||||
self.sendCancelEnrollRequest();
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {发送报名请求} serviceMemberVO
|
|
||||||
*/
|
|
||||||
sendEnrollRequest: function(serviceMemberVO) {
|
|
||||||
var self = this;
|
|
||||||
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/servicemember/saveservicemember', []),
|
|
||||||
serviceMemberVO, {
|
|
||||||
headers: {
|
|
||||||
token: self.data.token
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
if('200' == code) {
|
|
||||||
app.dialog.msg('注册成功!');
|
|
||||||
wx.redirectTo({
|
|
||||||
url: '../volunteer/volunteer',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 发送取消报名请求
|
|
||||||
*/
|
|
||||||
sendCancelEnrollRequest() {
|
|
||||||
var self = this;
|
|
||||||
var url;
|
|
||||||
if(self.data.teamArray.length > 0) {
|
|
||||||
url = app.volunteerUrl + '/app/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/' + self.data.team[self.data.teamIndex].teamId;
|
|
||||||
}else {
|
|
||||||
url = app.volunteerUrl + '/app/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/null';
|
|
||||||
}
|
|
||||||
|
|
||||||
app.restAjax.get(app.restAjax.path(url, []), {}, {
|
|
||||||
headers: {
|
|
||||||
token: self.data.token
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
if('200' == code) {
|
|
||||||
app.dialog.msg('取消报名成功!');
|
|
||||||
wx.redirectTo({
|
|
||||||
url: '../volunteer/volunteer',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取我的团队
|
|
||||||
*/
|
|
||||||
getMyTeam: function() {
|
|
||||||
var self = this;
|
|
||||||
console.log(self.data.token)
|
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/team/myteamm', []),
|
|
||||||
{}, {
|
|
||||||
headers: {
|
|
||||||
token: self.data.token
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
if('200' == code) {
|
|
||||||
var array = [];
|
|
||||||
for(var item of data.rows) {
|
|
||||||
delete item.teamArea;
|
|
||||||
delete item.teamAreaDictionaryName;
|
|
||||||
delete item.teamWatchword;
|
|
||||||
delete item.teamOwner;
|
|
||||||
delete item.memberId;
|
|
||||||
delete item.memberName;
|
|
||||||
delete item.gmtCreate;
|
|
||||||
delete item.photo;
|
|
||||||
delete item.count;
|
|
||||||
delete item.status;
|
|
||||||
delete item.content;
|
|
||||||
delete item.isTeamOwner;
|
|
||||||
delete item.checkStatus;
|
|
||||||
delete item.teamCounty;
|
|
||||||
delete item.teamCity;
|
|
||||||
delete item.teamCityDictionaryName;
|
|
||||||
delete item.teamCountyDictionaryName;
|
|
||||||
delete item.teamCity;
|
|
||||||
|
|
||||||
array.push(item.teamName);
|
|
||||||
}
|
|
||||||
self.setData({
|
|
||||||
teamArray: array,
|
|
||||||
team: data.rows
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
app.dialog.msg(data.msg);
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
toActivityHis: function(e) {
|
|
||||||
var self = this;
|
|
||||||
const status = e.currentTarget.dataset.status;
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../activityDialog/activityDialog?serviceId=' + self.data.serviceId + '&status=' + status,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad: function (options) {
|
|
||||||
var id = options.id;
|
|
||||||
var self = this;
|
|
||||||
self.setData({
|
|
||||||
serviceId: id
|
|
||||||
})
|
|
||||||
this.getToken().then(result => {
|
|
||||||
this.getDetail(id);
|
|
||||||
this.getMyTeam();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage: function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
@ -1,125 +1,137 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
// pages/venueDetail/venueDetail.js
|
// pages/venueDetail/venueDetail.js
|
||||||
Page({
|
Page({
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
venueUrl: app.venueUrl,
|
venueUrl: app.venueUrl,
|
||||||
imgRoute : '/route/file/download/true/',
|
imgRoute: '/route/file/download/true/',
|
||||||
indicatorDots: true,
|
indicatorDots: true,
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
venuesInfoId: '',
|
venuesInfoId: '',
|
||||||
venuesDetail:{},
|
venuesDetail: {},
|
||||||
venuesProjectList: [],
|
venuesProjectList: [],
|
||||||
swiperImg:[],
|
swiperImg: [],
|
||||||
venueCharge: '',
|
venueCharge: '',
|
||||||
hasProject:''
|
hasProject: ''
|
||||||
},
|
},
|
||||||
|
|
||||||
//场馆详情接口
|
//场馆详情接口
|
||||||
getVenuesDetail: function(){
|
getVenuesDetail: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}',[app.venueUrl, self.data.venuesInfoId]),
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}', [app.venueUrl, self.data.venuesInfoId]),
|
||||||
{
|
{
|
||||||
resultLocation: 'TX'
|
resultLocation: 'TX'
|
||||||
}, null, function(code, data){
|
}, null, function (code, data) {
|
||||||
var src = 'img src="' + app.venueUrl + '/'
|
var src = 'img src="' + app.venueUrl + '/'
|
||||||
if(data.venueDescription.indexOf('src="') != -1){
|
if (data.venueDescription.indexOf('src="') != -1) {
|
||||||
data.venueDescription = data.venueDescription.replace(/src="/g, src)
|
data.venueDescription = data.venueDescription.replace(/src="/g, src)
|
||||||
}
|
}
|
||||||
var swiperImg = data.venuePanorama.split(',');
|
var swiperImg = data.venuePanorama.split(',');
|
||||||
if(swiperImg.length <= 1){
|
if (swiperImg.length <= 1) {
|
||||||
self.setData({
|
self.setData({
|
||||||
indicatorDots: false,
|
indicatorDots: false,
|
||||||
autoplay: false
|
autoplay: false
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
self.setData({
|
self.setData({
|
||||||
venuesDetail: data,
|
venuesDetail: data,
|
||||||
swiperImg: swiperImg,
|
swiperImg: swiperImg,
|
||||||
venueCharge: data.venueCharge,
|
venueCharge: data.venueCharge,
|
||||||
hasProject : data.hasProject
|
hasProject: data.hasProject
|
||||||
|
});
|
||||||
|
}, function (code, data) {
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
//场馆地图导航
|
||||||
|
showMap: function (options) {
|
||||||
|
var dataObj = options.currentTarget.dataset
|
||||||
|
wx.openLocation({//使用微信内置地图查看位置。
|
||||||
|
latitude: Number(dataObj.latitude),//要去的纬度-地址
|
||||||
|
longitude: Number(dataObj.longitude),//要去的经度-地址
|
||||||
|
name: dataObj.venuename,
|
||||||
|
address: dataObj.venueposition
|
||||||
});
|
});
|
||||||
}, function(code,data){
|
},
|
||||||
app.dialog.msg(data.msg);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
//场馆地图导航
|
goBooking: function () {
|
||||||
showMap: function(options){
|
wx.navigateTo({
|
||||||
var dataObj = options.currentTarget.dataset
|
url: '../book/book?venuesInfoId=' + this.data.venuesInfoId,
|
||||||
wx.openLocation({//使用微信内置地图查看位置。
|
})
|
||||||
latitude: Number(dataObj.latitude),//要去的纬度-地址
|
},
|
||||||
longitude: Number(dataObj.longitude),//要去的经度-地址
|
|
||||||
name: dataObj.venuename,
|
|
||||||
address: dataObj.venueposition
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
goBooking: function(){
|
/**
|
||||||
wx.navigateTo({
|
* 生命周期函数--监听页面加载
|
||||||
url: '../book/book?venuesInfoId=' + this.data.venuesInfoId,
|
*/
|
||||||
})
|
onLoad: function (options) {
|
||||||
},
|
this.setData({
|
||||||
|
venuesInfoId: options.venuesInfoId
|
||||||
|
});
|
||||||
|
this.getVenuesDetail();
|
||||||
|
this.saveBigdata(options.venuesInfoId);
|
||||||
|
},
|
||||||
|
saveBigdata(id) {
|
||||||
|
var params = "小程序" + id + "场馆";
|
||||||
|
var info = {
|
||||||
|
requestUrl: params
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null,
|
||||||
|
function (code, data) {
|
||||||
|
|
||||||
/**
|
}, function (code, err) {
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad: function (options) {
|
|
||||||
this.setData({
|
|
||||||
venuesInfoId: options.venuesInfoId
|
|
||||||
});
|
|
||||||
this.getVenuesDetail();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
})
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
},
|
||||||
*/
|
/**
|
||||||
onReady: function () {
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面隐藏
|
* 生命周期函数--监听页面隐藏
|
||||||
*/
|
*/
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面卸载
|
* 生命周期函数--监听页面卸载
|
||||||
*/
|
*/
|
||||||
onUnload: function () {
|
onUnload: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh: function () {
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onReachBottom: function () {
|
onReachBottom: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 用户点击右上角分享
|
||||||
*/
|
*/
|
||||||
onShareAppMessage: function () {
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -24,8 +24,20 @@ Page({
|
|||||||
planId: options.id
|
planId: options.id
|
||||||
})
|
})
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.saveBigdata(options.id)
|
||||||
},
|
},
|
||||||
|
saveBigdata(id) {
|
||||||
|
var params = "小程序" + id + "直播";
|
||||||
|
var info = {
|
||||||
|
requestUrl: params
|
||||||
|
}
|
||||||
|
app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null,
|
||||||
|
function (code, data) {
|
||||||
|
|
||||||
|
}, function (code, err) {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
app.restAjax.get(app.restAjax.path(_self.data.liveUrl + '/app/liverecord/listpageliverecordrelease/' + _self.data.planId, []),
|
app.restAjax.get(app.restAjax.path(_self.data.liveUrl + '/app/liverecord/listpageliverecordrelease/' + _self.data.planId, []),
|
||||||
|
Loading…
Reference in New Issue
Block a user