12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052 |
- const app=getApp();
- const utils=require("../../../utils/http");
- import * as echarts from '../../ec-canvas/echarts';
- var dataList = [];
- var dataList0 = [];
- var dataList1 = [];
- var obj=[];
- var time = [];
- var Chart = null;
- var that
- var list = [];
- let pkpage=1,page=1;
- let trpage=1;//团队
- let mrpage=1;//员工
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- loadflag:0,//0是进来的状态,1是加入团队,2是没有加入团队
- wburl:app.globalData.wburl,
- imgUrl:app.globalData.imgUrl,
- ec: {
- lazyLoad: true // 延迟加载
- },
- type:1,
- funshow:false,
- despointshow:false,
- signshow:false,
- chartflag:true,
- lunarr:['第一轮','第二轮','第三轮'],
- oppoflag:false,
- lunidx:0,
- footype:1,
- rtype:1,
- aid:'',
- addfunimgarr:[],
- funnum:0,
- editflag:false,
- nowimagearr:[],//当前上传oss图片的路径
- depositshow:false,
- addepositimgarr:[],
- depositnum:0,
- contractshow:false,
- addcontractimgarr:[],
- contractnum:0,
- wxindexobj:{},
- footfun:[],
- footdespoit:[],
- pkfootfun:[],
- pkfootdespoit:[],
- personobj: app.globalData.personMsg,
- numtype:'fans',
- recordlist:[],
- PKobj:{},
- datashow:false,
- ranktype:'fans',//fans deposit contract
- sort:'desc',
- teamobj:[],
- myteamobj:{},
- personranklist:[],
- mydataobj:{},
- pk_contract:[],
- teamlist:[],
- atitle:'',
- nowteamidx:0
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- aid:options.aid,
- personobj: app.globalData.personMsg,
- wburl:app.globalData.wburl,
- imgUrl:app.globalData.imgUrl,
- atitle:options.name
- })
- wx.showLoading({
- title: '加载中...',
- })
- this.topindexdatafun();
-
- },
- bindteamChange(e){
- const that=this;
- this.setData({
- nowteamidx:e.detail.value
- })
- },
- topindexdatafun(){
- const that=this;
- utils.$get({
- url: app.globalData.webUrl + 'api/wechatActivity/empData',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:this.data.aid
- },
- success: function (res) {
- if(res.data.code=='0'){
- if(res.data.data.length==0){
- that.setData({
- loadflag:2
- })
- wx.setNavigationBarTitle({
- title: '队伍邀请',
- })
- that.teamlistfun();
- }else{
- if(res.data.data.my.lv.length!=0){
- let num1=res.data.data.my.lv.my_deposit_lv.my_deposit_num/res.data.data.my.lv.my_deposit_lv.deposit_Num
- res.data.data.my.lv.my_deposit_lv.finishlv=num1*100+'%';
- let num2=res.data.data.my.lv.my_fans_lv.my_fans_num/res.data.data.my.lv.my_fans_lv.fans_Num
- res.data.data.my.lv.my_fans_lv.finishlv=num1*100+'%';
- }
-
- that.setData({
- loadflag:1,
- wxindexobj:res.data.data,
- lunarr:res.data.data.bar?res.data.data.bar.x:[],
- footfun:res.data.data.bar?res.data.data.bar.y.my_fans:[],
- footdespoit:res.data.data.bar?res.data.data.bar.y.my_deposit:[],
- pkfootfun:res.data.data.bar&&res.data.data.bar.y.pk_fans?res.data.data.bar.y.pk_fans:[],
- pkfootdespoit:res.data.data.bar&&res.data.data.bar.y.pk_deposit?res.data.data.bar.y.pk_deposit:[],
- pk_contract:res.data.data.bar&&res.data.data.bar.y.pk_contract?res.data.data.bar.y.pk_contract:[],
- })
- that.echartsComponnet = that.selectComponent('#mychart-dom-bar');
- that.init_echarts();
- }
-
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- },
- teamlistfun(){
- const that=this;
- utils.$get({
- url: app.globalData.webUrl + "api/wechatActivity/team",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:that.data.aid
- },
- success: function (res) {
- if(res.data.code=='0'){
- that.setData({
- teamlist:res.data.data
- })
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- },
- jointeamtap(){
- const that=this;
- wx.showLoading({
- title: '队伍加入中...',
- })
- utils.$post({
- url: app.globalData.webUrl + "api/wechatActivity/join",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:that.data.aid,
- team_id:that.data.teamlist[that.data.nowteamidx].id
- },
- success: function (res) {
-
- if(res.data.code=='0'){
- wx.showToast({
- title: res.data.msg,
- icon:'none',
- duration: 2000
- })
- that.topindexdatafun();
- }else{
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- }
- })
- },
- inputfuntap(e){
- this.setData({
- funnum:e.detail.value
- })
- },
- editap(){
- this.setData({
- editflag:true
- })
- },
- upfunloadimg:function(){
- const that=this;
- wx.chooseMedia({
- count: 3,
- mediaType:['image'],
- sizeType: ['compressed'],
- sourceType: ['album', 'camera'],
- success (res) {
- let addfunimgarr=that.data.addfunimgarr;
- if(res.errMsg=="chooseMedia:ok"){
- console.log(res)
- let arr=res.tempFiles;
- for(let i=0;i<arr.length;i++){
- if(addfunimgarr.length<3){
- addfunimgarr.push(arr[i]);
- }else{
- addfunimgarr.shift();
- addfunimgarr.push(arr[i]);
- }
- }
- that.setData({
- addfunimgarr:addfunimgarr,
- funnum:addfunimgarr.length,
- })
- if(addfunimgarr.length>=3){
- wx.showToast({
- title: '最多上传三张图片!',
- icon:'none',
- duration: 2000
- })
- }
- }
- },
- fail(res){
- wx.showToast({
- title: '上传失败请重试!',
- icon: 'error',
- duration: 2000
- })
- }
- })
- },
- ossuploadimg:function(e){
- let that=this;
- let addfunimgarr=[];
- if(this.data.funshow){
- addfunimgarr=that.data.addfunimgarr;
- }else if(this.data.depositshow){
- addfunimgarr=that.data.addepositimgarr;
- }else if(this.data.contractshow){
- addfunimgarr=that.data.addcontractimgarr;
- }
- var arr = [];
- for (let i = 0; i < addfunimgarr.length; i++) {
- //获取文件后缀
- // 随机生成文件名称
- let rstr=addfunimgarr[i].tempFilePath.split('.');
- var fileRandName = Date.now() + "" + parseInt(Math.random() *10000)+i;
- var imgName = fileRandName + '.' + rstr[rstr.length-1];
- var date=new Date();
- var time=date.getFullYear()+''+(date.getMonth()*1+1)+''+date.getDate();
- var imgstr= 'communityActivism/'+time+'/'+imgName;
- var nowimagearr=that.data.nowimagearr;
- nowimagearr.push(imgstr);
- that.setData({
- nowimagearr:nowimagearr
- })
- // 上传有效时间 2040-01-01
- wx.uploadFile({
- url: 'https://wzh-zqxg.oss-cn-hangzhou.aliyuncs.com',
- filePath: addfunimgarr[i].tempFilePath,
- name: 'file',
- formData: {
- key: 'communityActivism/'+time+'/' + imgName,
- policy: "eyJleHBpcmF0aW9uIjoiMjA0MC0wMS0wMVQxMjowMDowMC4wMDBaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF1dfQ==",
- OSSAccessKeyId: "LTAI5tHjWupJSCAycy2yVbQZ",
- success_action_status: "200",
- signature: "GPu5wBYVzdhICS/hdJH6rKG0kos=",
- },
- header: {
- "Content-Type": "multipart/form-data",
- 'accept': 'application/json',
- },
- success: function (rs) {
- if (rs.errMsg == 'uploadFile:ok' ) {
- arr.push('0');
- if(arr.length==addfunimgarr.length){
- that.addrecord();
- }
- }
- },
- fail(res){
- wx.hideLoading()
- }
- })
- }
- },
- addfuntap(){
- const that=this;
- if(!this.data.addfunimgarr.length){
- wx.showToast({
- title: '微信截图必须上传!',
- icon:'none',
- duration: 2000
- })
- return false
- }
- wx.showLoading({
- title: '数据上传中...',
- })
- this.ossuploadimg();
- },
- addrecord(){
- const that=this;
- let str="";
- if(this.data.funshow){
- str='api/wechatActivity/addFans';
- }else if(this.data.depositshow){
- str='api/wechatActivity/addDeposit';
- }else if(this.data.contractshow){
- str='api/wechatActivity/addContract';
- }
- utils.$post({
- url: app.globalData.webUrl + str,
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:this.data.aid,
- num:this.data.funshow?this.data.funnum:this.data.depositshow?that.data.depositnum:that.data.contractnum,
- img_log:this.data.nowimagearr
- },
- success: function (res) {
- if(res.data.code=='0'){
- wx.showToast({
- title: '加粉上传成功!',
- icon: 'none',
- duration: 2000
- })
- that.closefuntap();
- that.closedeposittap();
- that.closecontractap();
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- },
- depositap(){
- this.setData({
- depositshow:true,
- chartflag:false
- })
- },
- closedeposittap(){
- this.setData({
- depositshow:false,
- chartflag:true,
- nowimagearr:[],
- addepositimgarr:[],
- editflag:false,
- })
- this.echartsComponnet = this.selectComponent('#mychart-dom-bar');
- this.init_echarts();
- },
- updepositloadimg:function(){
- const that=this;
- wx.chooseMedia({
- count: 3,
- mediaType:['image'],
- sizeType: ['compressed'],
- sourceType: ['album', 'camera'],
- success (res) {
- let addepositimgarr=that.data.addepositimgarr;
- if(res.errMsg=="chooseMedia:ok"){
- console.log(res)
- let arr=res.tempFiles;
- for(let i=0;i<arr.length;i++){
- if(addepositimgarr.length<3){
- addepositimgarr.push(arr[i]);
- }else{
- addepositimgarr.shift();
- addepositimgarr.push(arr[i]);
- }
- }
- that.setData({
- addepositimgarr:addepositimgarr,
- depositnum:addepositimgarr.length
- })
- if(addepositimgarr.length>=3){
- wx.showToast({
- title: '最多上传三张图片!',
- icon:'none',
- duration: 2000
- })
- }
- }
- },
- fail(res){
- wx.showToast({
- title: '上传失败请重试!',
- icon: 'error',
- duration: 2000
- })
- }
- })
- },
- inputdepositap(e){
- this.setData({
- depositnum:e.detail.value
- })
- },
- addepositap(){
- const that=this;
- if(!this.data.addepositimgarr.length){
- wx.showToast({
- title: '微信截图必须上传!',
- icon:'none',
- duration: 2000
- })
- return false
- }
- wx.showLoading({
- title: '数据上传中...',
- })
- this.ossuploadimg();
- },
- contractap(){
- this.setData({
- contractshow:true,
- chartflag:false
- })
- },
- closecontractap(){
- this.setData({
- contractshow:false,
- chartflag:true,
- nowimagearr:[],
- addcontractimgarr:[],
- editflag:false,
- })
- this.echartsComponnet = this.selectComponent('#mychart-dom-bar');
- this.init_echarts();
- },
- upcontractloadimg:function(){
- const that=this;
- wx.chooseMedia({
- count: 3,
- mediaType:['image'],
- sizeType: ['compressed'],
- sourceType: ['album', 'camera'],
- success (res) {
- let addcontractimgarr=that.data.addcontractimgarr;
- if(res.errMsg=="chooseMedia:ok"){
- console.log(res)
- let arr=res.tempFiles;
- for(let i=0;i<arr.length;i++){
- if(addcontractimgarr.length<3){
- addcontractimgarr.push(arr[i]);
- }else{
- addcontractimgarr.shift();
- addcontractimgarr.push(arr[i]);
- }
- }
- that.setData({
- addcontractimgarr:addcontractimgarr,
- contractnum:addcontractimgarr.length
- })
- if(addcontractimgarr.length>=3){
- wx.showToast({
- title: '最多上传三张图片!',
- icon:'none',
- duration: 2000
- })
- }
- }
- },
- fail(res){
- wx.showToast({
- title: '上传失败请重试!',
- icon: 'error',
- duration: 2000
- })
- }
- })
- },
- inputcontractap(e){
- this.setData({
- contractnum:e.detail.value
- })
- },
- addcontractap(){
- const that=this;
- if(!this.data.addcontractimgarr.length){
- wx.showToast({
- title: '微信截图必须上传!',
- icon:'none',
- duration: 2000
- })
- return false
- }
- wx.showLoading({
- title: '数据上传中...',
- })
- this.ossuploadimg();
- },
- setechartypetap(e){
- this.setData({
- type:e.currentTarget.dataset.type
- })
- this.echartsComponnet = this.selectComponent('#mychart-dom-bar');
- this.init_echarts();
- },
- footsetypetap(e){
- this.setData({
- footype:e.currentTarget.dataset.type
- })
- if(this.data.footype==1){
- wx.setNavigationBarTitle({
- title: '社群活动'
- })
- this.echartsComponnet = this.selectComponent('#mychart-dom-bar');
- this.init_echarts();
- }else if(this.data.footype==2){
- wx.setNavigationBarTitle({
- title: '操作记录'
- })
- this.setData({
- lunidx:0,
- })
- this.setrecord();
- }else if(this.data.footype==3){
- wx.setNavigationBarTitle({
- title: '团队管理'
- })
- this.setData({
- rtype:1,
- lunidx:0,
- })
- this.teamRankfun();
- }
- },
- openoppotap(){
- this.setData({
- oppoflag:true,
- chartflag:false,
- recordlist:[],
- PKobj:[],
- })
- this.setrecord();
- },
- closeoppotap(){
- this.setData({
- oppoflag:false,
- chartflag:true
- })
- this.echartsComponnet = this.selectComponent('#mychart-dom-bar');
- this.init_echarts();
- },
- bindPickerChange: function(e) {
- this.setData({
- lunidx: e.detail.value
- })
- this.setrecord();
- },
- lookimgtap(e){
- var arr=[];
- for(var i=0;i<this.data.recordlist[e.currentTarget.dataset.idx].img_log.length;i++){
- arr.push(app.globalData.imgUrl+this.data.recordlist[e.currentTarget.dataset.idx].img_log[i]);
- }
- wx.previewImage({
- current: app.globalData.imgUrl+this.data.recordlist[e.currentTarget.dataset.idx].img_log[e.currentTarget.dataset.imgidx], // 当前显示图片的 http 链接
- urls:arr // 需要预览的图片 http 链接列表
- })
- },
- setypetap(e){
- this.setData({
- numtype:e.currentTarget.dataset.type
- })
- this.setrecord();
- },
- // 操作记录
- setrecord:function(){
- const that=this;
- let p=1;
- if(this.data.oppoflag){
- pkpage=1;
- }else{
- page=1;
- }
- // type:fans deposit contract, pk:1 对手数据, schedule第几轮
- utils.$post({
- url: app.globalData.webUrl + "api/wechatActivity/log",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:that.data.aid,
- type:that.data.numtype,
- page:p,
- limit:10,
- schedule:that.data.lunidx*1+1,
- pk:that.data.oppoflag?1:0
- },
- success: function (res) {
- that.setData({
- datashow:true
- })
-
- if(res.data.code=='0'){
- that.setData({
- recordlist:res.data.data.log,
- PKobj:res.data.data.pk?res.data.data.pk:{}
- })
- }else{
- console.log(113)
- that.closeoppotap();
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- },
- setrecordgun(){
- const that=this;
- let p=1;
- if(this.data.oppoflag){
- pkpage=pkpage*1+1;
- p=pkpage;
- }else{
- page=page*1+1;
- p=page;
- }
- utils.$post({
- url: app.globalData.webUrl + "api/wechatActivity/log",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:this.data.aid,
- type:that.data.numtype,
- page:p,
- limit:10,
- schedule:this.data.lunidx*1+1,
- pk:this.data.oppoflag?1:0
- },
- success: function (res) {
- let recordlist=that.data.recordlist;
- if(res.data.code=='0'){
- recordlist=recordlist.concat(res.data.data.log);
- that.setData({
- recordlist:recordlist
- })
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- },
- setranktypetap(e){
- this.setData({
- ranktype:e.currentTarget.dataset.type
- })
- if(this.data.rtype==1){
- this.teamRankfun();
- }else{
- this.personRankfun();
- }
- },
- seteamtap(){
- this.setData({
- rtype:1,
- })
- this.teamRankfun();
- },
- setsortap(){
- if(this.data.sort=='desc'){
- this.setData({
- sort:'asc'
- })
- }else{
- this.setData({
- sort:'desc'
- })
- }
- if(this.data.rtype==1){
- this.teamRankfun();
- }else{
- this.personRankfun();
- }
- },
- teamRankfun(){
- const that=this;
- trpage=1;
- utils.$post({
- url: app.globalData.webUrl + "api/wechatActivity/teamRank",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:this.data.aid,
- type:that.data.ranktype,
- page:trpage,
- limit:10,
- schedule:this.data.lunidx*1+1,
- sort:this.data.sort
- },
- success: function (res) {
- if(res.data.code=='0'){
- that.setData({
- teamobj:res.data.data.rank,
- myteamobj:res.data.data.my,
- })
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- },
- setmembertap(){
- this.setData({
- rtype:2,
- })
- this.personRankfun();
- },
- personRankfun(){
- const that=this;
- mrpage=1;
- utils.$post({
- url: app.globalData.webUrl + "api/wechatActivity/personRank",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:this.data.aid,
- type:that.data.ranktype,
- page:mrpage,
- limit:10,
- schedule:this.data.lunidx*1+1,
- sort:this.data.sort
- },
- success: function (res) {
- if(res.data.code=='0'){
- that.setData({
- personranklist:res.data.data.rank,
- mydataobj:res.data.data.my,
- })
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- funtap(){
- this.setData({
- funshow:true,
- chartflag:false
- })
- },
- closefuntap(){
- this.setData({
- funshow:false,
- chartflag:true,
- nowimagearr:[],
- addfunimgarr:[],
- editflag:false,
- })
- this.echartsComponnet = this.selectComponent('#mychart-dom-bar');
- this.init_echarts();
- },
- dothis(){},
- managetap(){
- wx.navigateTo({
- url: '/index/pages/teamanage/teamanage?aid='+this.data.aid,
- })
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- recordtap(){
-
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- init_echarts: function () {
- this.echartsComponnet.init((canvas, width, height) => {
- // 初始化图表
- Chart = echarts.init(canvas, null, {
- width: width,
- height: height
- });
- Chart.setOption(this.getOption());
- return Chart;
- });
- },
-
- getOption: function () {
- // 指定图表的配置项和数据
- const that=this;
- var option = {
-
- grid: {
- top:'7%',
- left: '4%',
- right: '4%',
- bottom: '0%',
- z: 11,
- containLabel: true
- },
- tooltip: {
- trigger: 'axis',
- position: function (pos, params, dom, rect, size) {
- console.log(rect);
- console.log(size);
- var t,l;
- if (pos[0] > (size.viewSize[0]/2)){
- t = pos[0]-100;
- }else{
- t = pos[0];
- }
- if (pos[1] > size.viewSize[1] / 2){
- l = pos[1] - 100;
- }else{
- l = pos[1];
- }
- return [t,l];
- }
- },
- dataZoom: [{
- type: 'inside',
- show: true, //flase直接隐藏图形
- //xAxisIndex: [0],
- left: '9%', //滚动条靠左侧的百分比
- bottom: -5,
- start: 0,//滚动条的起始位置
- end: 80 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
- }],
- color: ["#FF0035", "#0089FF"],
- xAxis: {
- type: 'category',
- axisLabel: {
- show: true,
- color:'#444',
- fontFamily:'PingFangSC-Regular',
- fontSize: 12,//字体大小
- },
- axisLine:{
- color:'#ccc',
- lineStyle: {
- type: 'solid',
- color: '#ccc',
- },
- },
- splitLine:{
- lineStyle:{
- type:'solid'
- }
- },
- boundaryGap: true,
- data: this.data.lunarr,//time
- z: 7,
- },
- yAxis: {
- type: 'value',
- position: 'right',
- axisTick:{
- show: false,
- },
- axisLabel: {
- show: true,
- color: '#444',
- inside: true,
- padding:[0,0,10,0]
- },
- axisLine: {
- color: 'transparent',
- lineStyle: {
- type: 'solid',
- color: 'transparent',
- },
- },
- splitLine: {
- lineStyle: {
- type: 'dashed'
- }
- },
- yAxisLabel: {
- show: true,
- color: '#444',
- fontFamily: 'PingFangSC-Regular',
- show: true,
- fontSize: 12,//字体大小
- }
- },
- series: [
- {
- animation: true,
- barWidth: 10,
- data: that.data.type==1?that.data.footfun:that.data.footdespoit,
- itemStyle:{
- normal: {color: "rgba(255,0,53,1)"}
- },
- name: that.data.type==1?"加粉":'定金',
- type: "bar"
- },
- {
- animation: true,
- barWidth: 10,
- data: that.data.type==1?that.data.pkfootfun:that.data.pkfootdespoit,
- itemStyle:{
- normal: {color: "rgba(0,137,255,0.8)"}
- },
- name: that.data.type==1?"加粉":'定金',
- type: "bar"
- }
- ]
- }
- return option;
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- if(this.data.type==1){
- this.topindexdatafun();
- this.setrecord();
- wx.stopPullDownRefresh();
- }else if(this.data.type==2){
- this.setrecord();
- wx.stopPullDownRefresh();
- }else if(this.data.type==3){
- if(this.data.rtype==1){
- this.teamRankfun();
- }else{
- this.personRankfun();
- }
- wx.stopPullDownRefresh();
- }
-
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- if(this.data.type==2){
- this.setrecordgun();
- }else if(this.data.type==3){
- if(this.data.rtype==1){
- trpage=trpage*1+1;
- utils.$post({
- url: app.globalData.webUrl + "api/wechatActivity/teamRank",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:this.data.aid,
- type:that.data.ranktype,
- page:trpage,
- limit:10,
- schedule:this.data.lunidx*1+1,
- sort:this.data.sort
- },
- success: function (res) {
- let teamobj=that.data.teamobj;
- if(res.data.code=='0'){
- teamobj=teamobj.concat(res.data.data.rank);
- that.setData({
- teamobj:teamobj,
- myteamobj:res.data.data.my,
- })
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- }else{
- mrpage=mrpage*1+1;
- utils.$post({
- url: app.globalData.webUrl + "api/wechatActivity/personRank",
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- activity_id:this.data.aid,
- type:that.data.ranktype,
- page:mrpage,
- limit:10,
- schedule:this.data.lunidx*1+1,
- sort:this.data.sort
- },
- success: function (res) {
- let personranklist=that.data.personranklist;
- if(res.data.code=='0'){
- personranklist=personranklist.concat(res.data.data.rank);
- that.setData({
- personranklist:personranklist,
- mydataobj:res.data.data.my,
- })
- }
- setTimeout(function(){
- wx.hideLoading()
- },1000)
- }
- })
- }
- }
- },
- })
|