123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- var app = getApp()
- var that;
- Page({
- data: {
- showTissue:false,//显示部门组件
- TissueVal:'全公司',
- isPx:true,
- page:1,
- scroll_top:0,
- popupCx: '',
- // pt_id: app.getTypesItem('BF').id,
- },
- onLoad() {
- that = this;
- dd.setNavigationBar({ title: "累计B分排名" });
- this.getData();
- },
- onShareAppMessage() {
- return {
- title: '累计B分排名',
- desc: '积分排名有变动了,快来看看!',
- path: 'pages/statistics/B_ranking/B_ranking'
- };
- },
- onShow() {
- if (app.globalData.userData) {
- if (that.data.page == 1) {
- dd.hideLoading();
- that.getData();
- }
- } else {
- app.login(app.globalData.corpId, function (is) {
- if (is) {
- if (that.data.page == 1) {
- dd.hideLoading();
- that.getData();
- }
- } else {
- dd.reLaunch({
- url: '../../noJurisdiction/noJurisdiction'
- })
- }
- },function(){})
- }
- },
- getData(is){
- var data = {
- page: that.data.page,
- page_size: 20,
- dept_id:that.data.dept_id,
- pt_id:3,
- sort: that.data.isPx?'DESC':'ASC',
- type: 'all',
- }
- app.$get('api/integral/statistics/ranking',data,'application/vnd.test.v2+json').then((res) => {
- var data = res.data.data.list;
- if (is) {
- if (data.length == 0) {
- this.setData({isData: true})
- return;
- }
- var list = that.data.list;
- this.setData({
- list: list.concat(data)
- })
- } else {
- this.setData({list:[]});
- this.setData({
- list: data,
- isData: false,
- })
- }
- })
- },
- //上啦加载
- onScrollToLower() {
- if(!that.data.isData){
- this.setData({ page: ++that.data.page })
- this.getData(true);
- }
- },
- selectIsPx(){
- this.setData({
- isPx:!this.data.isPx,
- page:1
- })
- this.getData();
- },
- //打开兴趣
- openDetail(e){
- var item=e.target.dataset.item;
- dd.navigateTo({
- url: '../prizeBuckleDetail/prizeBuckleDetail?item='+item
- })
- },
- //关闭弹窗
- onClose() {
- this.setData({
- showTissue:false,
- popupCx: ''
- })
- },
- //显示部门选择组件
- selectTissue(){
- this.setData({showTissue:!this.data.showTissue,popupCx: 'container__mask',})
- },
- //选择部门
- onConfirmTissue(data) {
- if(data){
- this.setData({ dept_id: data.id,page:1,TissueVal:data.name })
- }
- this.getData();
- },
- });
|