index.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. "use strict";
  2. var _page = _interopRequireDefault(require("../../common/page"));
  3. var _toast = _interopRequireDefault(require("../../dist/toast/toast"));
  4. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  6. (0, _page["default"])({
  7. data: {
  8. show: {
  9. basic: false,
  10. withDesc: false,
  11. multiLine: false,
  12. customIcon: false
  13. },
  14. options: [{
  15. name: "微信",
  16. icon: "wechat",
  17. openType: "share"
  18. }, {
  19. name: "微博",
  20. icon: "weibo"
  21. }, {
  22. name: "复制链接",
  23. icon: "link"
  24. }, {
  25. name: "分享海报",
  26. icon: "poster"
  27. }, {
  28. name: "二维码",
  29. icon: "qrcode"
  30. }],
  31. multiLineOptions: [[{
  32. name: "微信",
  33. icon: "wechat"
  34. }, {
  35. name: "微博",
  36. icon: "weibo"
  37. }, {
  38. name: "QQ",
  39. icon: "qq"
  40. }], [{
  41. name: "复制链接",
  42. icon: "link"
  43. }, {
  44. name: "分享海报",
  45. icon: "poster"
  46. }, {
  47. name: "二维码",
  48. icon: "qrcode"
  49. }]],
  50. customIconOptions: [{
  51. name: "名称",
  52. icon: "https://img.yzcdn.cn/vant/custom-icon-fire.png"
  53. }, {
  54. name: "名称",
  55. icon: "https://img.yzcdn.cn/vant/custom-icon-light.png"
  56. }, {
  57. name: "名称",
  58. icon: "https://img.yzcdn.cn/vant/custom-icon-water.png"
  59. }],
  60. optionsWithDesc: [{
  61. name: "微信",
  62. icon: "wechat"
  63. }, {
  64. name: "微博",
  65. icon: "weibo"
  66. }, {
  67. name: "复制链接",
  68. icon: "link",
  69. description: "描述信息"
  70. }, {
  71. name: "分享海报",
  72. icon: "poster"
  73. }, {
  74. name: "二维码",
  75. icon: "qrcode"
  76. }]
  77. },
  78. onShowShareSheet: function onShowShareSheet(event) {
  79. this.setData(_defineProperty({}, "show.".concat(event.target.dataset.type), true));
  80. },
  81. onClose: function onClose() {
  82. this.setData({
  83. show: {
  84. basic: false,
  85. withDesc: false,
  86. multiLine: false,
  87. customIcon: false
  88. }
  89. });
  90. },
  91. onSelect: function onSelect(event) {
  92. (0, _toast["default"])(event.detail.name);
  93. this.onClose();
  94. }
  95. });