wxShare.js 608 B

123456789101112131415161718192021222324252627282930
  1. export default {
  2. onShow(){
  3. let pages = getCurrentPages();
  4. let curPage = pages[pages.length-1];
  5. let route = '/'+curPage.route;
  6. let options = curPage.options;
  7. if(JSON.stringify(options)!='{}'){
  8. let i = 0;
  9. for (let o in options) {
  10. route+=(i==0?'?':'&')+o+'='+options[o];
  11. i++;
  12. }
  13. }
  14. this.$path = route;
  15. },
  16. /* 用户点击右上角分享 */
  17. onShareAppMessage: function () {
  18. return {
  19. title: '酒店民宿商家端',
  20. path: this.$path
  21. }
  22. },
  23. /* 分享到朋友圈 */
  24. onShareTimeline: function () {
  25. return {
  26. title: '酒店民宿商家端',
  27. path: this.$path
  28. }
  29. }
  30. }