shares.js 869 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // var app = getApp();
  2. // var network = require('./network.js')
  3. function share(newsname, Thepath, newsid, typevalue, nthis, imageUrl, title) {
  4. var _this = this;
  5. var params = new Object()
  6. params.id = newsid
  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. })
  17. // 获取群信息和id
  18. wx.showShareMenu({
  19. withShareTicket: true
  20. })
  21. var scene = '&scene=' + newsid;
  22. var data = {
  23. // id: uni.getStorageSync('uid'),
  24. title: typevalue,
  25. id: newsid,
  26. path: Thepath + newsid
  27. }
  28. if (imageUrl) {
  29. data['imageUrl'] = imageUrl;
  30. data['title'] = title;
  31. data['id'] = newsid;
  32. }
  33. console.log(9999, data)
  34. // uni.setStorageSync('share_data', data);
  35. return data;
  36. }
  37. module.exports = {
  38. share: share,
  39. }