changePattern.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // pages/changePattern/changePattern.js
  2. //获取应用实例
  3. var app = getApp();
  4. Page({
  5. data: {
  6. urlHttp: '',
  7. //模式选中状态
  8. pattern0: false,
  9. pattern1: false,
  10. showPattern: true, //显示选个模式蒙层
  11. shareFlag : 0
  12. },
  13. onLoad: function (options) {
  14. var that = this;
  15. var host = getApp().globalData.servsers;
  16. var shareFlag = options.shareFlag;
  17. if (shareFlag != '' && shareFlag != null && shareFlag != undefined) {
  18. that.setData({
  19. shareFlag: options.shareFlag
  20. })
  21. }
  22. that.setData({
  23. urlHttp: host,
  24. pattern0: false,
  25. pattern1: false,
  26. })
  27. },
  28. onShow:function(e){
  29. var that = this;
  30. that.setData({
  31. pattern0: false,
  32. pattern1: false
  33. })
  34. },
  35. //选择模式
  36. patternXL: function (e) {
  37. var that = this;
  38. that.setData({
  39. pattern0: true,
  40. pattern1: false
  41. })
  42. setTimeout(function () {
  43. wx.navigateTo({
  44. url: '/pages/patternMenu/patternMenu'
  45. })
  46. }, 200)
  47. },
  48. patternLL: function (e) {
  49. var that = this;
  50. that.setData({
  51. pattern0: false,
  52. pattern1: true
  53. })
  54. setTimeout(function () {
  55. wx.switchTab({
  56. url: '/pages/index/index'
  57. })
  58. }, 500)
  59. },
  60. onShareAppMessage: function (res) {//页面分享
  61. var that = this;
  62. var host = getApp().globalData.servsers;
  63. if (res.from === 'button') {
  64. // 来自页面内转发按钮
  65. console.log(res.target)
  66. }
  67. return {
  68. title: '大良造-精良之选,用心造物!',
  69. path: '/pages/changePattern/changePattern?shareFlag=1',
  70. success: function (res) {
  71. },
  72. fail: function (res) {
  73. // 转发失败
  74. }
  75. }
  76. },
  77. })
  78. var that;
  79. var Util = require('../../utils/util.js');