share.js 651 B

1234567891011121314151617181920212223242526
  1. const app = getApp();
  2. const share_title = 'sharetitle';
  3. const share_path = 'sharepath';
  4. const share_imageurl = 'shareimageurl';
  5. function ShareSetInfo(){
  6. app.postRequest('my/other/share', {}, function (res) {
  7. if (res.code == 201) {
  8. wx.setStorageSync(share_title, res.data.title);
  9. wx.setStorageSync(share_path, res.data.path);
  10. wx.setStorageSync(share_imageurl, res.data.imageUrl);
  11. }
  12. })
  13. }
  14. function Shareginfo(){
  15. return{
  16. title: wx.getStorageSync(share_title),
  17. path: wx.getStorageSync(share_path),
  18. imageurl: wx.getStorageSync(share_imageurl),
  19. };
  20. }
  21. module.exports = {
  22. ShareSetInfo,
  23. Shareginfo
  24. };