| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- PayList:[],
- IsLogin:1,
- },
- onLoad: function (options) {
- var that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
- if (app.globalData.userInfo){
- that.init();
- }
- else{
- this.setData({
- IsLogin: -1,
- });
- }
- },
- init:function(){
- var that = this;
- var url = "GetUserPayList?UserID=" + app.globalData.userInfo.UserID;
- main.getData(url, function (data) {
- if (data) {
- that.setData({
- PayList: data,
- IsLogin: 1,
- });
- }
- });
- },
- showLogin:function(){
- this.setData({
- IsLogin: -2,
- });
- },
- hideLogin:function(){
- this.setData({
- IsLogin: -1,
- });
- },
- onKeyInput: function (e) {
- var that=this;
- that.setData({
- UserName: e.detail.value
- });
- },
- onKeyInput2: function (e) {
- var that=this;
- that.setData({
- UserPwd: e.detail.value
- });
- },
- login: function () {
- var that = this;
- main.getData('Login20221228?UserName=' + that.data.UserName + "&UserPwd="+that.data.UserPwd+"&ProductID=" + app.globalData.ProgramID, function (data) {
- if (data) {
- if (data>0){
- app.globalData.userInfo={};
- app.globalData.userInfo.UserID=data;
- main.getData('GetWXUsersAllPayInfo500?UserID=' + app.globalData.userInfo.UserID + "&ProductID=" + app.globalData.ProgramID, function (data2) {
- if (data2) {
- that.setData({
- IsLogin: 1,
- PayList: data2,
- });
- }
- else {
- that.setData({
- IsLogin: 1,
- PayList: [],
- });
- }
- });
- }
- else {
- wx.showToast({
- title: '用户名或密码不正确',
- });
- }
- }
- else {
- wx.showToast({
- title: '登录出错',
- });
- }
- });
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|