123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- const app = getApp();
- var utils = require("../../../utils/http"),page=1;
- const util = require("../../../utils/util");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- wshareshow: false,
- nowid:'',
- nowtitle:'',
- nowimg:'',
- collagelist:[],
- datashow:false,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- wx.showLoading({
- title: '加载中...',
- })
- this.teamfun();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- teamfun:function(){
- let that=this;
- page=1;
- utils.$post({
- url: app.globalData.webUrl + 'api/spellgroup/list',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- page:page
- },
- success: function (res) {
- if(res.data.code=='0'){
- that.setData({
- collagelist:res.data.data,
- datashow:true
- })
- wx.hideLoading()
- }
- }
- })
- },
- collagemsgtap:function(e){
- wx.navigateTo({
- url: '/index/pages/collagemsg/collagemsg?cid='+e.currentTarget.dataset.cid,
- })
- },
- shareshowtap:function(e){
- this.setData({
- wshareshow:true,
- nowid:e.currentTarget.dataset.cid,
- nowtitle:e.currentTarget.dataset.title,
- nowimg:e.currentTarget.dataset.img,
- })
- },
- addsharetap:function(){
- let that=this;
- utils.$post({
- url: app.globalData.webUrl + 'api/share/addlog',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data: {
- id:that.data.nowid,
- type:'spellgroup',
- },
- success: function (r) {
- }
- })
- },
- shareurltap: function () {
- wx.showLoading({
- title: '加载中...',
- })
- this.addsharetap();
- util.schemefun('/share/pages/collagemsg/collagemsg', 'aid=' + this.data.nowid + '&uid=' + app.globalData.personMsg.id+'&tid='+'&eid='+app.globalData.personMsg.binded.id+'&ctp='+app.globalData.clientype, this.data.nowid, 'spellgroup', '');
- },
- setpostertap: function () {
- wx.navigateTo({
- url: '/index/pages/setposter/setposter?type=spellgroup&aid=' + this.data.nowid + "&listshare=",
- })
- },
- teamtap: function (e) {
- wx.navigateTo({
- url: "/index/pages/collageteam/collageteam?cid="+e.currentTarget.dataset.cid,
- });
- },
- customertap: function (e) {
- wx.navigateTo({
- url: "/index/pages/collagecustomer/collagecustomer?cid="+e.currentTarget.dataset.cid,
- });
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- let that=this;
- page=1;
- utils.$post({
- url: app.globalData.webUrl + 'api/spellgroup/list',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- page:page
- },
- success: function (res) {
- wx.stopPullDownRefresh()
- if(res.data.code=='0'){
- that.setData({
- collagelist:res.data.data
- })
- wx.hideLoading()
- }
- }
- })
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- let that=this;
- page=page+1;
- utils.$post({
- url: app.globalData.webUrl + 'api/spellgroup/list',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- page:page
- },
- success: function (res) {
- let collagelist=that.data.collagelist;
- if(res.data.code=='0'){
- collagelist=collagelist.concat(res.data.data)
- that.setData({
- collagelist:collagelist,
- })
- }
- }
- })
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- var img=this.data.nowimg;
- return {
- title: this.data.nowtitle,
- imageUrl: img,
- path: '/share/pages/collagemsg/collagemsg?aid='+this.data.nowid+'&uid='+app.globalData.personMsg.id+'&eid='+app.globalData.personMsg.binded.id+'&ctp='+app.globalData.clientype
- }
- }
- })
|