1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <template>
- <view>
- <sudoku
- ref="sudoku"
- :detail="detail"
- :sa_awardid="sa_awardid"
- :shareuserid="shareuserid"
- />
- </view>
- </template>
- <script>
- import sudoku from "./modules/sudoku";
- import { winTheCustomer } from "../../utils/share";
- export default {
- components: { sudoku },
- data() {
- return {
- sa_awardid: 0,
- shareuserid: 0,
- detail: {},
- initialize: true,
- };
- },
- onLoad(options) {
- console.log("options", options);
- this.sa_awardid = options.sa_awardid || 0;
- this.isInitializeLogin(render.bind(this));
- function render() {
- this.getDetail();
- this.shareUserid = winTheCustomer(options.shareUserid || 0, "活动抽奖", {
- ownertable: "sa_award",
- ownerid: this.sa_awardid,
- });
- }
- uni.setNavigationBarTitle({
- title: "活动抽奖",
- });
- },
- onShow() {
- if (!this.initialize) this.getDetail();
- },
- methods: {
- getDetail() {
- this.$Http
- .basic({
- id: 20240514101502,
- content: {
- sa_awardid: this.sa_awardid,
- },
- })
- .then((res) => {
- console.log("抽奖详情", res);
- if (this.cutoff(res.msg)) return;
- this.initialize = false;
- this.detail = res.data;
- this.$refs.sudoku.init();
- });
- },
- getSheraDate() {
- let detail = this.detail;
- return {
- title: detail.name, // 标题
- path:
- "/store/lottery/shareable?sa_awardid=" +
- detail.sa_awardid +
- "&shareUserid=" +
- this.shareUserid, // 分享路径
- imageUrl: "", // 分享图
- };
- },
- },
- onShareAppMessage() {
- return this.getSheraDate();
- },
- onShareTimeline() {
- return this.getSheraDate();
- },
- };
- </script>
- <style lang="scss" scoped></style>
|