index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view>
  3. <diyC ref="diy" v-if="isDiy" @pullResh="pullResh"></diyC>
  4. </view>
  5. </template>
  6. <script>
  7. import diyC from './diy/index_mall.vue'
  8. export default {
  9. data() {
  10. return {
  11. isDiy: uni.getStorageSync('is_diy'),
  12. shareInfo: {}
  13. }
  14. },
  15. components: {
  16. diyC
  17. },
  18. onShow() {
  19. uni.$on('is_diy', (data) => {
  20. this.isDiy = data
  21. })
  22. },
  23. onHide() {
  24. // this.isDiy = -1
  25. },
  26. onPullDownRefresh() {
  27. this.$refs.diy.pullResh();
  28. // uni.stopPullDownRefresh()
  29. },
  30. methods: {
  31. },
  32. // onReachBottom: function() {
  33. // if (this.isDiy) {
  34. // this.$refs.diy.onsollBotton()
  35. // }
  36. // },
  37. //#ifdef MP
  38. //发送给朋友
  39. onShareAppMessage: function (option) {
  40. console.log(option)
  41. let groupon = option.target.dataset.groupon;
  42. let userInfo = this.$Cache.get("USER_INFO", true)
  43. let that = this;
  44. return {
  45. title: groupon.mainTitle,
  46. imageUrl: groupon.slideshow[0],
  47. path: `/pages/groupbuying_details/index?id=${groupon.id}&selfTakeId=${that.selfTakeId}&organizerUserId=${that.organizerUserId}&inviteUserId=${userInfo.userId}`,
  48. success(res) {
  49. uni.showToast({
  50. title: '分享成功'
  51. })
  52. },
  53. fail(res) {
  54. uni.showToast({
  55. title: '分享失败',
  56. icon: 'none'
  57. })
  58. }
  59. };
  60. },
  61. //分享到朋友圈
  62. // onShareTimeline() {
  63. // return {
  64. // title: this.shareInfo.title,
  65. // imageUrl: this.shareInfo.img,
  66. // };
  67. // },
  68. //#endif
  69. }
  70. </script>
  71. <style></style>