From f55f3133cc367a119378c291503b41bd046622b6 Mon Sep 17 00:00:00 2001 From: tcubic <123456> Date: Wed, 3 Aug 2022 18:53:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=A5=96=E6=8E=A5=E5=8F=A3=E5=B7=B2?= =?UTF-8?q?=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Draw.vue | 28 ++++++++++++--- src/components/Index.vue | 62 +++++++++++++++++++++++++++------- src/components/ServiceList.vue | 2 +- src/page/Home/Home.vue | 3 +- src/store/index.js | 4 +-- 5 files changed, 78 insertions(+), 21 deletions(-) diff --git a/src/components/Draw.vue b/src/components/Draw.vue index c92edbd..18b876f 100644 --- a/src/components/Draw.vue +++ b/src/components/Draw.vue @@ -40,6 +40,10 @@ import { } from "vue"; import gsap from "gsap"; import axios from "axios"; +import service from "@/api/httpServe"; +import qs from "qs"; + + import { Toast } from "vant"; import { useStore } from "vuex"; @@ -73,16 +77,16 @@ const hide = () => { }; + + // 立即领取红包 const getMoney = ()=>{ - +redpacket() gsap.to('.draw_container',{duration:0.3,scale:0,autoAlpha:0,onComplete:()=>{ drawStatus.value = false isgetMoney.value = true - - gsap.form('.add_container',{duration:0.3,scale:0,autoAlpha:0,}) - + gsap.form('.add_container',{duration:0.5,scale:0,autoAlpha:0,}) }}) @@ -90,6 +94,22 @@ const getMoney = ()=>{ } +// 领取接口 +const redpacket = (prizeId) => { + let redpacketId = 84; + service + .post( + process.env.VUE_APP_API + + "/cms-activity/cms88/redpacket/receive/" + + redpacketId, + {} + ) + .then((res) => { + console.log("领取红包结果", res); + }); +}; + + \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 0fa2c22..0891dc3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -7,7 +7,7 @@ export default createStore({ // 数据源 state: { userAccount: { - xglOpenid: '', //用户openid + xglOpenId: 'o9B_fvjtyh2KELQYc2t9A3MEh7JQ', //用户openid token: h5plugin.getQueryString('token'), //用户token cardId: h5plugin.getQueryString('cardId'), //carid nkh: h5plugin.getQueryString('nkh'), //牛卡号 @@ -18,7 +18,7 @@ export default createStore({ participantNum: 0, //活动参与人数 prizeResult: 0, //中奖金额 eqcodeImg: '', //二维码 - isBirthMon: 0, //生日是否处于当月 + isBirthMon: 1, //生日是否处于当月 }, },