unshareable.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view>
  3. <sudoku
  4. ref="sudoku"
  5. :detail="detail"
  6. :sa_awardid="sa_awardid"
  7. :shareuserid="shareuserid"
  8. />
  9. </view>
  10. </template>
  11. <script>
  12. import sudoku from "./modules/sudoku";
  13. import { winTheCustomer } from "../../utils/share";
  14. export default {
  15. components: { sudoku },
  16. data() {
  17. return {
  18. sa_awardid: 0,
  19. shareuserid: 0,
  20. detail: {},
  21. initialize: true,
  22. };
  23. },
  24. onLoad(options) {
  25. console.log("options", options);
  26. this.sa_awardid = options.sa_awardid || 0;
  27. this.isInitializeLogin(render.bind(this));
  28. function render() {
  29. this.getDetail();
  30. this.shareUserid = winTheCustomer(options.shareUserid || 0, "活动抽奖");
  31. }
  32. uni.setNavigationBarTitle({
  33. title: "活动抽奖",
  34. });
  35. },
  36. onShow() {
  37. if (!this.initialize) this.getDetail();
  38. },
  39. methods: {
  40. getDetail() {
  41. this.$Http
  42. .basic({
  43. id: 20240514101502,
  44. content: {
  45. sa_awardid: this.sa_awardid,
  46. },
  47. })
  48. .then((res) => {
  49. console.log("抽奖详情", res);
  50. if (this.cutoff(res.msg)) return;
  51. this.initialize = false;
  52. this.detail = res.data;
  53. this.$refs.sudoku.init();
  54. });
  55. },
  56. },
  57. };
  58. </script>
  59. <style lang="scss" scoped></style>