shareable.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. this.sa_awardid = options.id || 0;
  19. this.shareuserid = options.userid || 0;
  20. uni.setNavigationBarTitle({
  21. title: '活动抽奖'
  22. });
  23. },
  24. onShow() {
  25. this.$Http.basic({
  26. "id": 20240514101502,
  27. "content": {
  28. "sa_awardid": this.sa_awardid,
  29. }
  30. }).then(res => {
  31. console.log("抽奖详情", res)
  32. if (this.cutoff(res.msg)) return;
  33. this.detail = res.data;
  34. this.$refs.sudoku.init();
  35. })
  36. }, methods: {
  37. getSheraDate() {
  38. let detail = this.detail;;
  39. return {
  40. title: detail.name, // 标题
  41. path: "/store/lottery/shareable?sa_awardid=" + detail.sa_awardid + '&shareuserid=' + uni.getStorageSync('userMsg').userid, // 分享路径
  42. imageUrl: ""// 分享图
  43. };
  44. }
  45. },
  46. onShareAppMessage() {
  47. return this.getSheraDate()
  48. },
  49. onShareTimeline() {
  50. return this.getSheraDate()
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped></style>