大数据详情浏览量、首页动态栏目接口修改

This commit is contained in:
itgaojian 2023-03-16 15:57:03 +08:00
parent 7e80b99032
commit 859d40a127
9 changed files with 782 additions and 696 deletions

View File

@ -2,131 +2,143 @@
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
activityUrl: app.activityUrl,
dataMap: {},
token: ''
},
getToken: function() {
var self = this;
return new Promise(resolve =>{
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
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
/**
* 页面的初始数据
*/
data: {
activityUrl: app.activityUrl,
dataMap: {},
token: ''
},
getToken: function () {
var self = this;
return new Promise(resolve => {
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
}
})
}
}, 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
},
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
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 () {
}
}
})

View File

@ -1,99 +1,111 @@
var app = getApp();
function getRandomColor() {
const rgb = []
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16)
color = color.length === 1 ? '0' + color : color
rgb.push(color)
}
return '#' + rgb.join('')
const rgb = []
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16)
color = color.length === 1 ? '0' + color : color
rgb.push(color)
}
return '#' + rgb.join('')
}
Page({
data: {
liveUrl: app.liveUrl,
liveDetail: {},
videoContext: null,
},
data: {
liveUrl: app.liveUrl,
liveDetail: {},
videoContext: null,
},
onShareAppMessage() {
return {
title: 'video',
path: 'page/component/pages/video/video'
}
},
onShareAppMessage() {
return {
title: 'video',
path: 'page/component/pages/video/video'
}
},
onReady() {
// 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);
},
onReady() {
// this.videoContext = wx.createVideoContext('myVideo')
onHide() {
},
inputValue: '',
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
},
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);
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() {
console.log('进入小窗模式')
},
}, function (code, err) {
bindVideoLeavePictureInPicture() {
console.log('退出小窗模式')
},
})
},
onHide() {
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)
}
inputValue: '',
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)
}
})

View File

@ -2,123 +2,136 @@
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
libraryUrl: app.libraryUrl,
swiper: {
imgUrl: [],
indicatorDots: false,
autoplay: true,
current: 0
/**
* 页面的初始数据
*/
data: {
libraryUrl: app.libraryUrl,
swiper: {
imgUrl: [],
indicatorDots: false,
autoplay: true,
current: 0
},
library: null,
libraryPersonList: []
},
library: null,
libraryPersonList: []
},
prevImg: function () {
var swiper = this.data.swiper;
var current = swiper.current;
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;
swiper.current = current < (swiper.imgUrl.length - 1) ? current + 1 : 0;
this.setData({
swiper: swiper,
})
},
doGetLibrary: function(libraryId) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/getintangiblelibrarybyidrelease/{libraryId}', [self.data.libraryUrl, libraryId]), {}, null, function(code, data) {
var covers = data.libraryCover.split(',');
var imageArray = [];
for(var i = 0, item; item = covers[i++];) {
imageArray.push(app.restAjax.path('{libraryUrl}/route/file/download/true/{cover}', [self.data.libraryUrl, item]));
}
self.setData({
library: data,
'swiper.imgUrl': imageArray
});
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
})
},
doGetLibraryPerson: function(libraryId) {
var self = this;
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibraryperson/listintangiblelibrarypersonrelease', [self.data.libraryUrl]), {
intangibleLibraryId: libraryId
}, null, function(code, data) {
self.setData({
libraryPersonList: data
})
}, function(code, data) {
app.dialog.msg(data.msg);
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var libraryId = options.libraryId
this.doGetLibrary(libraryId);
this.doGetLibraryPerson(libraryId)
},
prevImg: function () {
var swiper = this.data.swiper;
var current = swiper.current;
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;
swiper.current = current < (swiper.imgUrl.length - 1) ? current + 1 : 0;
this.setData({
swiper: swiper,
})
},
doGetLibrary: function (libraryId) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/getintangiblelibrarybyidrelease/{libraryId}', [self.data.libraryUrl, libraryId]), {}, null, function (code, data) {
var covers = data.libraryCover.split(',');
var imageArray = [];
for (var i = 0, item; item = covers[i++];) {
imageArray.push(app.restAjax.path('{libraryUrl}/route/file/download/true/{cover}', [self.data.libraryUrl, item]));
}
self.setData({
library: data,
'swiper.imgUrl': imageArray
});
}, function (code, data) {
app.dialog.msg(data.msg);
}, function () {
wx.stopPullDownRefresh();
wx.hideLoading();
})
},
doGetLibraryPerson: function (libraryId) {
var self = this;
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibraryperson/listintangiblelibrarypersonrelease', [self.data.libraryUrl]), {
intangibleLibraryId: libraryId
}, null, function (code, data) {
self.setData({
libraryPersonList: data
})
}, function (code, data) {
app.dialog.msg(data.msg);
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var libraryId = options.libraryId
this.doGetLibrary(libraryId);
this.doGetLibraryPerson(libraryId)
this.saveBigdata(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) {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
}, function (code, err) {
},
})
},
/**
* 生命周期函数--监听页面显示
*/
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 () {
}
})

View File

@ -83,7 +83,7 @@ Page({
//获取首页新闻动态
getMainNewsTab() {
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,
function (code, data) {

View File

@ -15,7 +15,7 @@ swiper {
right: 50rpx;
width: 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%;
padding: 10rpx;

View File

@ -33,6 +33,19 @@ Page({
pageHeight: wx.getSystemInfoSync().windowHeight
})
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() {
var _self = this;

View File

@ -2,300 +2,312 @@
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
dataMap: {},
token: '',
serviceId: '',
type: '',
/**
* 页面的初始数据
*/
data: {
dataMap: {},
token: '',
serviceId: '',
type: '',
teamIndex: 0,
teamResult: '请选择服务区域',
team: {}, // 服务区域-市
teamArray: [], // 服务区域-市
},
getToken: function() {
var self = this;
return new Promise(resolve =>{
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
}
})
})
},
getDetail: function(id) {
var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/getvolunteerservicebyid/' + id, []),
{}, {
headers: {
'token': self.data.token
}
}, function(code, data) {
if('200' == code) {
var ph=data.photo
if(data.photo.endsWith(",")){
ph=data.photo.substr(0,data.photo.length-1);
}
data.photo = app.volunteerUrl + '/route/file/download/true/' +ph;
self.setData({
dataMap: data
})
}
}, function() {
teamIndex: 0,
teamResult: '请选择服务区域',
team: {}, // 服务区域-市
teamArray: [], // 服务区域-市
},
getToken: function () {
var self = this;
return new Promise(resolve => {
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
}
})
})
},
getDetail: function (id) {
var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/getvolunteerservicebyid/' + id, []),
{}, {
headers: {
'token': self.data.token
}
}, function (code, data) {
if ('200' == code) {
var ph = data.photo
if (data.photo.endsWith(",")) {
ph = data.photo.substr(0, data.photo.length - 1);
}
data.photo = app.volunteerUrl + '/route/file/download/true/' + ph;
self.setData({
dataMap: data
})
}
}, function () {
}, function() {
})
},
/**
* 志愿者团队报名
*/
enroll: function(e) {
var self = this;
self.setData({
serviceId: e.target.dataset.serviceid,
type: e.target.dataset.type
})
},
/**
*
* @param {志愿者报名} e
*/
volunteerEnroll: function(e) {
var self = this;
self.setData({
serviceId: e.target.dataset.serviceid,
type: e.target.dataset.type
})
}, function () {
})
},
/**
* 志愿者团队报名
*/
enroll: function (e) {
var self = this;
self.setData({
serviceId: e.target.dataset.serviceid,
type: e.target.dataset.type
})
},
/**
*
* @param {志愿者报名} e
*/
volunteerEnroll: function (e) {
var self = this;
self.setData({
serviceId: e.target.dataset.serviceid,
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 () {
}
})

View File

@ -1,125 +1,137 @@
var app = getApp();
// pages/venueDetail/venueDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
venueUrl: app.venueUrl,
imgRoute : '/route/file/download/true/',
indicatorDots: true,
autoplay: true,
venuesInfoId: '',
venuesDetail:{},
venuesProjectList: [],
swiperImg:[],
venueCharge: '',
hasProject:''
},
/**
* 页面的初始数据
*/
data: {
venueUrl: app.venueUrl,
imgRoute: '/route/file/download/true/',
indicatorDots: true,
autoplay: true,
venuesInfoId: '',
venuesDetail: {},
venuesProjectList: [],
swiperImg: [],
venueCharge: '',
hasProject: ''
},
//场馆详情接口
getVenuesDetail: function(){
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}',[app.venueUrl, self.data.venuesInfoId]),
{
resultLocation: 'TX'
}, null, function(code, data){
var src = 'img src="' + app.venueUrl + '/'
if(data.venueDescription.indexOf('src="') != -1){
data.venueDescription = data.venueDescription.replace(/src="/g, src)
}
var swiperImg = data.venuePanorama.split(',');
if(swiperImg.length <= 1){
self.setData({
indicatorDots: false,
autoplay: false
})
};
self.setData({
venuesDetail: data,
swiperImg: swiperImg,
venueCharge: data.venueCharge,
hasProject : data.hasProject
//场馆详情接口
getVenuesDetail: function () {
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}', [app.venueUrl, self.data.venuesInfoId]),
{
resultLocation: 'TX'
}, null, function (code, data) {
var src = 'img src="' + app.venueUrl + '/'
if (data.venueDescription.indexOf('src="') != -1) {
data.venueDescription = data.venueDescription.replace(/src="/g, src)
}
var swiperImg = data.venuePanorama.split(',');
if (swiperImg.length <= 1) {
self.setData({
indicatorDots: false,
autoplay: false
})
};
self.setData({
venuesDetail: data,
swiperImg: swiperImg,
venueCharge: data.venueCharge,
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);
}
);
},
},
//场馆地图导航
showMap: function(options){
var dataObj = options.currentTarget.dataset
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,
})
},
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) {
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
venuesInfoId: options.venuesInfoId
});
this.getVenuesDetail();
},
}, function (code, err) {
/**
* 生命周期函数--监听页面初次渲染完成
*/
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 () {
}
}
})

View File

@ -24,8 +24,20 @@ Page({
planId: options.id
})
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() {
var _self = this;
app.restAjax.get(app.restAjax.path(_self.data.liveUrl + '/app/liverecord/listpageliverecordrelease/' + _self.data.planId, []),