C端小程序
25개 이상의 토픽을 선택하실 수 없습니다. 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. },
  25. onLoad: function (options) {
  26. wx.showLoading({
  27. title: '加载中',
  28. })
  29. var scene = decodeURIComponent(options.scene);
  30. var that = this;
  31. if (app.globalData.openId && app.globalData.openId != null) {
  32. } else {
  33. // 由于是网络请求,可能会在 Page.onLoad 之后才返回
  34. // 所以此处加入 callback 以防止这种情况
  35. app.openIdCallback = openId => {
  36. console.log(openId);
  37. }
  38. setTimeout(function () {
  39. wx.hideLoading()
  40. }, 2200)
  41. }
  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. })