C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.5 KiB

  1. const Http = require("../../utils/HttpBasics");
  2. //获取应用实例
  3. const app = getApp();
  4. Page({
  5. data: {
  6. market: app.globalData.market,
  7. imgUrls: [
  8. "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  9. "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
  10. "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg"
  11. ],
  12. swiperCurrent: 0,
  13. scrollTop: 0
  14. },
  15. swiperChange: function(e) {
  16. this.setData({
  17. swiperCurrent: e.detail.current
  18. });
  19. },
  20. /**
  21. * 生命周期函数--监听页面初次渲染完成
  22. */
  23. onReady: function() {},
  24. onLoad: function(options) {
  25. var that = this;
  26. if (app.globalData.token && app.globalData.token != null) {
  27. console.log("index ++ " + app.globalData.token);
  28. } else {
  29. // 由于是网络请求,可能会在 Page.onLoad 之后才返回
  30. // 所以此处加入 callback 以防止这种情况
  31. app.tokenCallback = token => {
  32. console.log("index + " + token);
  33. };
  34. }
  35. wx.showLoading({
  36. title: "加载中"
  37. });
  38. var scene = decodeURIComponent(options.scene);
  39. setTimeout(function() {
  40. wx.hideLoading();
  41. }, 2200);
  42. },
  43. // 用户点击右上角分享
  44. onShareAppMessage: function() {
  45. return {
  46. title: "富茂链客",
  47. desc: "分享个小程序,希望你喜欢",
  48. success: function(res) {
  49. wx.showToast({
  50. title: "分享成功",
  51. duration: 1000,
  52. icon: "success"
  53. });
  54. }
  55. };
  56. }
  57. });