share2.js 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // var app = getApp();
  2. // var network = require('./network.js')
  3. function share(Thepath, title, imageUrl, type) {
  4. var _this = this;
  5. var params = new Object()
  6. params.id = uni.getStorageSync('uid')
  7. //发起请求
  8. uni.request({
  9. url: 'https://trade.5dev.cn/dudaowenlv/content/?l=api.share',
  10. data: params,
  11. method: 'GET',
  12. header: {
  13. 'content-type': 'application/json' // 默认值
  14. },
  15. success(res) {
  16. console.log(777777,res)
  17. // _this.imageUrl=res.data.data.pic
  18. }
  19. })
  20. // 获取群信息和id
  21. wx.showShareMenu({
  22. withShareTicket: true
  23. })
  24. var scene = '&scene=' + uni.getStorageSync('uid');
  25. var datas = {
  26. // id: uni.getStorageSync('uid'),
  27. path: Thepath,
  28. title: title,
  29. imageUrl:imageUrl,
  30. type:type
  31. }
  32. // if (imageUrl) {
  33. // datas['imageUrl'] = imageUrl;
  34. // datas['title'] = title;
  35. // datas['id'] = newsid;
  36. // datas['type'] = type;
  37. // }
  38. console.log(9999, datas)
  39. // uni.setStorageSync('share_data', data);
  40. return datas;
  41. }
  42. module.exports = {
  43. share: share,
  44. }