| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- var downloadData={};
- Page({
- data: {
- IsPromotion:false,
- },
- onLoad: function (options) {
- var that = this;
- var isPromotion=false;
- if (options.AgentCategory=="promotion"){
- isPromotion=true;
- }
- that.setData({
- Containnerheight: main.getWindowHeight(),
- IsPromotion:isPromotion,
- ListType:options.ListType,
- AgentCategory:options.AgentCategory,
- SelectMenuCss1:"selectItem",
- SelectMenuCss2:"",
- });
- wx.setNavigationBarTitle({
- title: that.data.ListType
- });
- this.getList();
- },
- getList:function(e){
- var that = this;
- var url="";
- if (that.data.ListType=="团队动态"){
- url="GetMiaoguoTeamDynamic?UserID=" + app.globalData.userInfo.UserID;
- }
- else{
- url="GetIntroducerUserList2?ListType="+that.data.ListType;
- url+="&AgentCategory="+that.data.AgentCategory;
- url+="&UserID=" + app.globalData.userInfo.UserID;
- }
- main.getData(url, function (data) {
- if (data) {
- downloadData=data;
- var info=data;
- if (that.data.ListType=="团队动态"){
- if (that.data.SelectMenuCss1=="selectItem")
- info=data.团队能量;
- else if (id==2)
- info=data.其他;
- }
- that.setData({
- Info:info,
- });
- }
- });
- },
- gotoRecord: function (e) {
- var that = this;
- var userid = e.currentTarget.dataset.userid;
- if (that.data.ListType=="团队动态"){
- wx.navigateTo({
- url: "user_relation?UserID="+userid,
- });
- }
- else{
- var url="GetMiaoguoAgentRecordID?AgentCategory="+that.data.AgentCategory;
- url+="&UserID=" + userid;
-
- main.getData(url, function (data) {
- if (data) {
- wx.navigateTo({
- url: "earnings_apply?RecordID="+data+"&AgentCategory="+that.data.AgentCategory,
- });
- }
- });
- }
- },
- goto: function (e) {
- var url = e.currentTarget.dataset.url;
- wx.navigateTo({
- url: url,
- });
- },
- onPullDownRefresh: function () {
- wx.stopPullDownRefresh();
- },
- onMenu:function(e){
- var that = this;
- var id=e.currentTarget.dataset.id;
- var SelectMenuCss1="",SelectMenuCss2="";
- if (id==1){
- SelectMenuCss1="selectItem";
- that.data.Info=downloadData.团队能量;
- }
- else if (id==2){
- SelectMenuCss2="selectItem";
- that.data.Info=downloadData.其他;
- }
- this.setData({
- SelectMenuCss1:SelectMenuCss1,
- SelectMenuCss2:SelectMenuCss2,
- Info: that.data.Info
- });
- },
- ShowImage:function(e){
- var url=e.currentTarget.dataset.url;
- wx.downloadFile({
- url: url,
- success(res) {
- wx.previewImage({
- current: res.tempFilePath, // 当前显示图片的http链接
- urls: [res.tempFilePath] // 需要预览的图片http链接列表
- });
- }
- });
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|