| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- },
- onLoad: function (options) {
- wx.hideShareMenu();
- var that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
- that.init(options.id);
- },
- init: function (id) {
- var that = this;
- var arr = main.getDetailColor(-1);
- common.getStorageValue(this, "ColorIndex", 0, function () {
- var isChangeColor = false;
- if (that.data.ColorIndex == 0)
- isChangeColor = true;
- else {
- for (var i = 1; i < arr.length; i++) {
- arr[i].SelectedCSS = "";
- if (that.data.ColorIndex == i) {
- arr[i].SelectedCSS = "panelItemSelected";
- }
- }
- }
- that.setData({
- ColorList: arr,
- IsChangeColor: isChangeColor,
- });
- });
- },
- switch1Change(e) {
- var that = this;
- that.data.IsChangeColor = e.detail.value;
- for (var i = 0; i < that.data.ColorList.length; i++) {
- that.data.ColorList[i].SelectedCSS = "";
- if (!that.data.IsChangeColor && i == 1) {
- that.data.ColorList[i].SelectedCSS = "panelItemSelected";
- }
- }
- that.setData({
- ColorList: that.data.ColorList,
- IsChangeColor: that.data.IsChangeColor,
- });
- var index = 1;
- if (that.data.IsChangeColor)
- index = 0;
- wx.setStorageSync("ColorIndex", index);
- },
- selectColor: function (e) {
- var that = this;
- var index = e.currentTarget.dataset.index;
- for (var i = 0; i < that.data.ColorList.length; i++) {
- that.data.ColorList[i].SelectedCSS = "";
- if (i == index) {
- that.data.ColorList[i].SelectedCSS = "panelItemSelected";
- }
- }
- that.setData({
- ColorList: that.data.ColorList,
- IsChangeColor: false,
- });
- wx.setStorageSync("ColorIndex", index);
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|