| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
- const arrSortType2 = ["较早的", "较近的"];
- var arrUserName = ["程杰", "程晟涵", "洪立人", "唱意班主任"];
- var arrUserID = [1, 2, 3, 4];
- Page({
- data: {
- CardNumber: [],
- IsShowChange: false,
- ProgramName: app.globalData.ProgramName,
- Version:app.globalData.Version,
- },
- onLoad: function () {
- wx.hideShareMenu();
- var that = this;
- for (var i = 5; i <= 200; i++) {
- that.data.CardNumber.push(i);
- }
- that.setData({
- Containnerheight: main.getWindowHeight(),
- CardNumber: that.data.CardNumber,
- MinSecond: 10,
- TimeSecond: 60,
- });
- common.getStorageValue(this, "CardMaxNumberNew", 10, function () {
- that.setData({
- CardMaxNumberNewIndex: that.data.CardMaxNumberNew - 5,
- });
- });
- common.getStorageValue(this, "CardMaxNumberHistory", 30, function () {
- that.setData({
- CardMaxNumberHistoryIndex: that.data.CardMaxNumberHistory - 5,
- });
- });
- common.getStorageValue(this, "SortTypeIndex", 0, function () {
- that.setData({
- SortType: arrSortType2[that.data.SortTypeIndex],
- });
- });
- common.getStorageValue(this, "UserID", 1, function () {
- for (var i = 0; i < arrUserID.length; i++) {
- if (arrUserID[i] == that.data.UserID) {
- that.setData({
- UserName: arrUserName[i],
- });
- break;
- }
- }
- });
- if (app.globalData.userInfo.UserID == 1 || app.globalData.userInfo.UserID == 2) {
- that.setData({
- IsShowChange: true,
- });
- }
- },
- onShow: function () {
- var colorIndex = wx.getStorageSync("ColorIndex");
- if (!colorIndex) {
- this.setData({
- ColorName: "每次更换配色",
- });
- }
- else {
- var color = main.getDetailColor(colorIndex);
- this.setData({
- ColorName: color.Name,
- });
- }
- },
- bindUpdateCardNumberNewMax: function (e) {
- this.data.CardMaxNumberNewIndex = e.detail.value;
- this.setData({
- CardMaxNumberNewIndex: this.data.CardMaxNumberNewIndex,
- CardMaxNumberNew: this.data.CardNumber[this.data.CardMaxNumberNewIndex],
- });
- wx.setStorageSync("CardMaxNumberNew", this.data.CardNumber[this.data.CardMaxNumberNewIndex]);
- },
- bindUpdateCardNumberHistoryMax: function (e) {
- this.data.CardMaxNumberHistoryIndex = e.detail.value;
- this.setData({
- CardMaxNumberHistoryIndex: this.data.CardMaxNumberHistoryIndex,
- CardMaxNumberHistory: this.data.CardNumber[this.data.CardMaxNumberHistoryIndex],
- });
- wx.setStorageSync("CardMaxNumberHistory", this.data.CardNumber[this.data.CardMaxNumberHistoryIndex]);
- },
- setSortType: function () {
- var that = this;
- wx.showActionSheet({
- itemList: arrSortType,
- success(res) {
- that.setData({
- SortType: arrSortType2[res.tapIndex],
- });
- wx.setStorageSync("SortTypeIndex", res.tapIndex);
- },
- fail(res) {
- console.log(res.errMsg)
- }
- })
- },
- setSelectUser: function () {
- var that = this;
- wx.showActionSheet({
- itemList: arrUserName,
- success(res) {
- for (var i = 0; i < arrUserName.length; i++) {
- if (i == res.tapIndex) {
- that.setData({
- UserName: arrUserName[i],
- });
- wx.setStorageSync("UserID", arrUserID[i]);
- wx.setStorageSync("UserName", arrUserName[i]);
- app.globalData.userInfo.UserID = arrUserID[i];
- break;
- }
- }
- },
- fail(res) {
- console.log(res.errMsg)
- }
- })
- },
- setColorPlan: function () {
- wx.navigateTo({
- url: './colorplan',
- })
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- });
|