123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- const app = getApp();
- var utils = require("../../../utils/http"),page=1;
- const util = require("../../../utils/util");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- customerlist:[],
- datashow:false,
- aid:'',
- tid:''
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- aid:options.cid,
- tid:options.tid?options.tid:''
- })
- wx.showLoading({
- title: '加载中...',
- })
- this.customerfun();
- },
- customerfun:function(){
- let that=this;
- page=1;
- utils.$post({
- url: app.globalData.webUrl + 'api/spellgroup/join_user_list',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- page:page,
- spellgroup_id:that.data.aid,
- team_id:that.data.tid
- },
- success: function (res) {
- if(res.data.code=='0'){
- that.setData({
- customerlist:res.data.data,
- datashow:true
- })
- wx.hideLoading()
- }
- }
- })
- },
- recevicetap:function(e){
- let that=this;
- wx.showLoading({
- title: '领取中...',
- })
- utils.$post({
- url: app.globalData.webUrl + 'api/spellgroup/receive',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- id:e.currentTarget.dataset.cid
- },
- success: function (res) {
- if(res.data.code=='0'){
- let customerlist=that.data.customerlist;
- customerlist[e.currentTarget.dataset.idx].status=1;
- that.setData({
- customerlist:customerlist
- })
- }
- setTimeout(() => {
- wx.hideLoading()
- }, 1200);
- }
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- let that=this;
- page=1;
- utils.$post({
- url: app.globalData.webUrl + 'api/spellgroup/join_user_list',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- page:page,
- spellgroup_id:that.data.aid,
- team_id:that.data.tid
- },
- success: function (res) {
- wx.stopPullDownRefresh()
- if(res.data.code=='0'){
- that.setData({
- customerlist:res.data.data,
- datashow:true
- })
- wx.hideLoading()
- }
- }
- })
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- let that=this;
- page=page+1;
- utils.$post({
- url: app.globalData.webUrl + 'api/spellgroup/join_user_list',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- page:page,
- spellgroup_id:that.data.aid,
- team_id:that.data.tid
- },
- success: function (res) {
- let customerlist=that.data.customerlist;
- if(res.data.code=='0'){
- customerlist=customerlist.concat(res.data.data);
- that.setData({
- customerlist:customerlist,
- })
- wx.hideLoading()
- }
- }
- })
- },
- /**
- * 用户点击右上角分享
- */
-
- })
|