article.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //var api = require("../../api.js"), app = getApp(),
  2. var is_loading_more = !1, is_no_more = !1;
  3. Page({
  4. data: {
  5. page: 1,
  6. video_list: [],
  7. url: "",
  8. hide: "hide",
  9. show: !1,
  10. animationData: {}
  11. },
  12. onLoad: function (a) {
  13. // app.pageOnLoad(this);
  14. this.loadMoreGoodsList();
  15. },
  16. onReady: function () { },
  17. onShow: function () {
  18. // app.pageOnShow(this);
  19. },
  20. onHide: function () { },
  21. onUnload: function () { },
  22. onPullDownRefresh: function () { },
  23. loadMoreGoodsList: function () {
  24. var o = this;
  25. if (!is_loading_more) {
  26. o.setData({
  27. show_loading_bar: !0
  28. }), is_loading_more = !0;
  29. var i = o.data.page;
  30. var v = [{
  31. "id":"234",
  32. "title":"小程序项目整体介绍",
  33. "url":"http://m1.beiyuesi.com/2.mp4",
  34. "sort":"9",
  35. "is_delete":"0",
  36. "addtime":"1515120216",
  37. "store_id":"20926",
  38. "pic_url":"https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/f0/f0734ad93d46497483344846864596a4.jpg",
  39. "content":"想要自己开发APP,却备受组建开发团队的困扰更别说高昂的开发费用与漫长的开",
  40. "type":"0",
  41. "time":"01月05日",
  42. "show":-1
  43. },
  44. {
  45. "id": "235",
  46. "title": "小程序模版介绍",
  47. "url": "http://m1.beiyuesi.com/1.mp4",
  48. "sort": "99",
  49. "is_delete": "0",
  50. "addtime": "1515120395",
  51. "store_id": "20926",
  52. "pic_url": "https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/0e/0e739254177172e4b815d75f88da77b4.png",
  53. "content": "小程序是腾讯旗下继朋友圈、公众号之后推出的又一款战略级的产品。是线下实体店实体零售转型升级、实现新突破的利器。小程序比公众号更容易传播和裂变,比传统电商更容易获客和成交,比朋友圈微商更专业和可信",
  54. "type": "0",
  55. "time": "01月05日",
  56. "show": -1
  57. },
  58. ];
  59. var t = o.data.video_list.concat(v);
  60. o.setData({
  61. video_list: t,
  62. page: i + 1
  63. });
  64. // app.request({
  65. // url: api.default.video_list,
  66. // data: {
  67. // page: i
  68. // },
  69. // success: function (a) {
  70. // 0 == a.data.list.length && (is_no_more = !0);
  71. // var t = o.data.video_list.concat(a.data.list);
  72. // o.setData({
  73. // video_list: t,
  74. // page: i + 1
  75. // });
  76. // },
  77. // complete: function () {
  78. // is_loading_more = !1, o.setData({
  79. // show_loading_bar: !1
  80. // });
  81. // }
  82. // });
  83. }
  84. },
  85. play: function (a) {
  86. var t = a.currentTarget.dataset.index;
  87. wx.createVideoContext("video_" + this.data.show_video).pause(), this.setData({
  88. show_video: t,
  89. show: !0
  90. });
  91. },
  92. onReachBottom: function () {
  93. is_no_more || this.loadMoreGoodsList();
  94. },
  95. more: function (a) {
  96. var t = this, o = a.target.dataset.index, i = t.data.video_list, e = wx.createAnimation({
  97. duration: 1e3,
  98. timingFunction: "ease"
  99. });
  100. this.animation = e, -1 != i[o].show ? (e.rotate(0).step(), i[o].show = -1) : (e.rotate(0).step(),
  101. i[o].show = 0), t.setData({
  102. video_list: i,
  103. animationData: this.animation.export()
  104. });
  105. }
  106. });