shareable.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view>
  3. <sudoku ref="sudoku" :sa_awardid="sa_awardid" :shareuserid="shareuserid" />
  4. </view>
  5. </template>
  6. <script>
  7. import sudoku from "./modules/sudoku"
  8. export default {
  9. components: { sudoku },
  10. data() {
  11. return {
  12. sa_awardid: 0,
  13. shareuserid: 0,
  14. detail: {},
  15. }
  16. },
  17. onLoad(options) {
  18. console.log("options", options)
  19. this.sa_awardid = options.sa_awardid || 0;
  20. this.shareuserid = options.userid || 0;
  21. uni.setNavigationBarTitle({
  22. title: '活动抽奖'
  23. });
  24. },
  25. onShow() {
  26. this.$Http.basic({
  27. "id": 20240514101502,
  28. "content": {
  29. "sa_awardid": this.sa_awardid,
  30. }
  31. }).then(res => {
  32. console.log("抽奖详情", res)
  33. if (this.cutoff(res.msg)) return;
  34. this.detail = res.data;
  35. this.$refs.sudoku.init();
  36. })
  37. }, methods: {
  38. getSheraDate() {
  39. let detail = this.detail;;
  40. return {
  41. title: detail.name, // 标题
  42. path: "/store/lottery/shareable?sa_awardid=" + detail.sa_awardid + '&shareuserid=' + uni.getStorageSync('userMsg').userid, // 分享路径
  43. imageUrl: ""// 分享图
  44. };
  45. }
  46. },
  47. onShareAppMessage() {
  48. return this.getSheraDate()
  49. },
  50. onShareTimeline() {
  51. return this.getSheraDate()
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped></style>