index.js 1019 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Created by JianJia.Zhou<jianjia.zhou> on 2022/5/26.
  3. */
  4. export function copyText(text, tips) {
  5. uni.setClipboardData({
  6. data: text,
  7. success: function() {
  8. uni.hideLoading()
  9. uni.showToast({
  10. title: tips || '复制成功',
  11. icon: 'none'
  12. })
  13. }
  14. })
  15. }
  16. export function checkOS() {
  17. if (uni.getSystemInfoSync().platform === 'ios') {
  18. uni.showModal({
  19. title: '提示',
  20. content: '由于相关规范,iOS功能暂不可用',
  21. showCancel: false,
  22. success: function(res) {
  23. // res.confirm res.cancel
  24. }
  25. })
  26. return false
  27. }
  28. return true
  29. }
  30. const shareMessage = user => {
  31. // #ifdef MP-KUAISHOU
  32. const title ="四海剧场"
  33. // #endif
  34. // #ifdef MP-TOUTIAO | MP-WEIXIN
  35. const title ="张四爷剧场"
  36. // #endif
  37. console.log('-->data', user)
  38. return {
  39. path: `/pages/index/index?user_id=${user.id}`,
  40. title: title,
  41. desc: title
  42. // imageUrl: ''
  43. }
  44. }
  45. export default {
  46. copyText,
  47. checkOS,
  48. shareMessage
  49. }