index.js 910 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Page({
  2. dever: getApp().dever,
  3. product: null,
  4. data: {
  5. content: ""
  6. },
  7. onLoad: function (options) {
  8. var that = this;
  9. var callback = {
  10. success: function (data, res) {
  11. that.product = data.product;
  12. var temp = that.dever.html('content', data.product.content, that);
  13. that.setData({
  14. content: temp
  15. })
  16. }
  17. }
  18. that.dever.request('product.api.view',{
  19. signature: '',
  20. id: options.id
  21. }, callback);
  22. },
  23. /**
  24. * 分享
  25. */
  26. onShareAppMessage: function (options){
  27. wx.showShareMenu({
  28. withShareTicket: true,
  29. success: function(res){
  30. //TODO
  31. },
  32. fail: function(res){
  33. //TODO
  34. }
  35. })
  36. //options.from可以用来判断是从自定义button打开的转发页面,还是从右上角的打开的转发页面。
  37. },
  38. /**
  39. * 立即购买
  40. */
  41. doBuy: function(){
  42. }
  43. })