Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8da4a1ed7 | ||
|
|
2c55a30a27 | ||
|
|
0736d97106 | ||
|
|
c99f1d7d36 | ||
|
|
1d2641b902 | ||
|
|
1188292b78 | ||
|
|
bb1e6e8e08 | ||
|
|
ffc13f66f5 | ||
|
|
c4fdea54c5 | ||
|
|
13c6126f23 | ||
|
|
b660b31e9a | ||
|
|
5f6b3f39d9 | ||
|
|
a67a865e35 | ||
|
|
13157bec19 | ||
|
|
6cf8c342be | ||
|
|
12e413771a | ||
|
|
ac50f32e06 | ||
|
|
9d9cafd74a | ||
|
|
f28efe8103 | ||
|
|
4bf9082409 | ||
|
|
3546401ffc | ||
|
|
93221c76e6 | ||
|
|
8e07827b3e | ||
|
|
1f3d09053e | ||
|
|
6ad2f1368f | ||
|
|
0b961fa4a5 | ||
|
|
37a68998ad | ||
|
|
1f1a6cb282 | ||
|
|
8e6454475c | ||
|
|
50fefbc1c0 | ||
|
|
b6951dd73c | ||
|
|
a538eaeda4 | ||
|
|
765ac757aa | ||
|
|
06fc7db4af | ||
|
|
8cd479c89d | ||
|
|
5ecf23bfc2 | ||
|
|
20c23c8f47 | ||
|
|
0a8c3a14d3 | ||
|
|
5648683c86 | ||
|
|
d456880c91 | ||
|
|
ddc22a042d | ||
|
|
8c0fd1d4f1 | ||
|
|
ad77e59004 | ||
|
|
4035a339e3 | ||
|
|
66fa09c4c2 | ||
|
|
4872bfb7be | ||
|
|
2561a377bd | ||
|
|
e391123b4e | ||
|
|
f45b6731c2 | ||
|
|
26dba43e0c | ||
|
|
9efb1f8afc | ||
|
|
1fc02e0265 | ||
|
|
99771a2be2 | ||
|
|
4b973c5903 | ||
|
|
2fd1a1e284 | ||
|
|
4b9f4586c8 | ||
|
|
5eff916173 | ||
|
|
aae6575e39 | ||
|
|
434c3af16d | ||
|
|
ef0b91c95c | ||
|
|
cd86b96687 | ||
|
|
75d368ff9a | ||
|
|
bbabfb7ca7 | ||
|
|
0a73369355 | ||
|
|
32c4b6d778 | ||
|
|
7f51855c5e | ||
|
|
dade828609 | ||
|
|
2ce1832a78 | ||
|
|
d0e586767b | ||
|
|
dd375571a7 | ||
|
|
bd6a6a9771 | ||
|
|
27ca11bb8f | ||
|
|
47b44073e0 | ||
|
|
abf6ac7b94 | ||
|
|
fd77fd38dd | ||
|
|
89d50baaf6 | ||
|
|
9ee3d79f83 | ||
|
|
a86a68fd93 | ||
|
|
a2e35460a1 | ||
|
|
fb0ba50d3a | ||
|
|
60fc2dcd98 | ||
|
|
736d3b9616 | ||
|
|
fc817eafb8 | ||
|
|
fd0f93cf80 | ||
|
|
4c0b6775f9 | ||
|
|
adde4b4181 | ||
|
|
7a282837e8 | ||
|
|
c550251031 | ||
|
|
6852262f18 | ||
|
|
8f73f86c25 | ||
|
|
4d6cda15c7 | ||
|
|
f55f3133cc | ||
|
|
933bdc7f9e | ||
|
|
40c8d978aa | ||
|
|
0c981bbe6e | ||
|
|
d67f516e7b | ||
|
|
ccee9819d8 | ||
|
|
b24f8c59bb | ||
|
|
02e09e539a | ||
|
|
800d0300ad | ||
|
|
87396c125c | ||
|
|
36d134f036 | ||
|
|
adbe28f168 | ||
|
|
e73f1fa52f | ||
|
|
61beec853f | ||
|
|
207c1f4d94 | ||
|
|
a436e20577 | ||
|
|
4c253247e8 |
10
.env.prod
@ -2,16 +2,16 @@
|
|||||||
NODE_ENV = 'production'
|
NODE_ENV = 'production'
|
||||||
|
|
||||||
// 入口地址
|
// 入口地址
|
||||||
VUE_APP_BASE_URL = 'https://cdn.xglpa.com/tcubic/pdf/'
|
VUE_APP_BASE_URL = 'https://wealthplus.cmschina.com'
|
||||||
|
|
||||||
// 业务接口
|
// 业务接口
|
||||||
VUE_APP_API = 'https://cdn.xglpa.com/tcubic/pdf/'
|
VUE_APP_API = 'https://wealthplus.cmschina.com'
|
||||||
|
|
||||||
// CDN地址
|
// CDN地址
|
||||||
VUE_APP_CDN = 'https://cdn.xglpa.com/tcubic/pdf/'
|
VUE_APP_CDN = './'
|
||||||
|
|
||||||
// XGL授权接口
|
// XGL授权接口
|
||||||
VUE_APP_XGL_DOMAIN = https://wealth.newone.com.cn
|
VUE_APP_XGL_DOMAIN = https://wealthplus.cmschina.com
|
||||||
|
|
||||||
// 招商证券授权接口
|
// 招商证券授权接口
|
||||||
VUE_APP_ZS_DOMAIN = https://wealth.newone.com.cn
|
VUE_APP_ZS_DOMAIN = https://wealthplus.cmschina.com
|
||||||
2
package-lock.json
generated
@ -2350,7 +2350,7 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"vue-loader-v16": {
|
"vue-loader-v16": {
|
||||||
"version": "npm:vue-loader@16.8.3",
|
"version": "npm:vue-loader-v16@16.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
|
||||||
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
|
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
|||||||
@ -2,7 +2,11 @@ const AutoPrefixer = require("autoprefixer");
|
|||||||
const px2rem = require("postcss-px2rem");
|
const px2rem = require("postcss-px2rem");
|
||||||
module.exports = ({ file }) => {
|
module.exports = ({ file }) => {
|
||||||
let remUnit; // 判断条件 请自行调整 我使用的是 mand-mobile ui 没有对vant引入进行测试
|
let remUnit; // 判断条件 请自行调整 我使用的是 mand-mobile ui 没有对vant引入进行测试
|
||||||
if (file && file.dirname && file.dirname.indexOf("vant") > -1) { remUnit = 37.5; } else { remUnit = 75; }
|
if (file && file.dirname && file.dirname.indexOf("vant") > -1) {
|
||||||
|
remUnit = 37.5;
|
||||||
|
} else {
|
||||||
|
remUnit = 75;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
plugins: [
|
plugins: [
|
||||||
px2rem({ remUnit: remUnit, }),
|
px2rem({ remUnit: remUnit, }),
|
||||||
|
|||||||
@ -29,7 +29,7 @@ const service = axios.create({
|
|||||||
// 添加请求拦截器
|
// 添加请求拦截器
|
||||||
service.interceptors.request.use(function (config) {
|
service.interceptors.request.use(function (config) {
|
||||||
// 在发送请求之前做些什么
|
// 在发送请求之前做些什么
|
||||||
console.log("开始请求");
|
// console.log("开始请求");
|
||||||
config
|
config
|
||||||
return config;
|
return config;
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 21 KiB |
BIN
src/assets/img/activity_6.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 404 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 15 KiB |
BIN
src/assets/img/cloud_bottom3.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 425 B |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 7.7 KiB |
BIN
src/assets/img/li_btn_6.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 26 KiB |
BIN
src/assets/img/luckybag_2(1659700116).png
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 4.0 KiB |
BIN
src/assets/img/no_prize_text.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/img/p_4(1659700125).png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 648 B |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 39 KiB |
BIN
src/assets/img/pop/ishas_service.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/img/pop/no_prize_pop.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
src/assets/img/pop/no_recored_pop.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 352 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/img/prize_text.png
Normal file
|
After Width: | Height: | Size: 987 B |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/img/rule_text.png
Normal file
|
After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 22 KiB |
BIN
src/assets/img/update_btn.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
src/assets/img/zhuanpan(1659700137).png
Normal file
|
After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 48 KiB |
BIN
src/assets/img/zz.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
230
src/components/Draw.vue
Normal file
@ -0,0 +1,230 @@
|
|||||||
|
<template>
|
||||||
|
<div class="drawCon" @touchmove.prevent>
|
||||||
|
<!-- 抽奖结果反馈 -->
|
||||||
|
<div class="draw_container" v-if="!isgetMoney">
|
||||||
|
<!-- 正常中奖 -->
|
||||||
|
<div class="has_prize" v-if="drawStatus">
|
||||||
|
<div class="money_num">
|
||||||
|
<span>{{ amount }}</span>元
|
||||||
|
</div>
|
||||||
|
<div class="get_btn" @click="getMoney"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 谢谢参与 -->
|
||||||
|
<div class="no_prize" v-if="!drawStatus"></div>
|
||||||
|
|
||||||
|
<div class="cls_btn" @click="hide"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 领奖后的弹窗 -->
|
||||||
|
<div class="add_container" v-if="isgetMoney">
|
||||||
|
<!-- 已经添加过企微人员 -->
|
||||||
|
<div class="is_added">
|
||||||
|
<div class="go_index_btn" @click="hide"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cls_btn" @click="hide"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
} from "vue";
|
||||||
|
import gsap from "gsap";
|
||||||
|
import axios from "axios";
|
||||||
|
import service from "@/api/httpServe";
|
||||||
|
import qs from "qs";
|
||||||
|
import wx from "@/utils/wx-jssdk.1.6.0.js";
|
||||||
|
import { Toast, Dialog } from "vant";
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
const emit = defineEmits(["drawCon"]); // 声明触发事件,对应父组件上面的方法
|
||||||
|
const props = defineProps({ prizeMsg: Object }); // 获取props
|
||||||
|
const store = useStore();
|
||||||
|
|
||||||
|
const drawStatus = ref(true);
|
||||||
|
const isgetMoney = ref(false);
|
||||||
|
const amount = ref(0);
|
||||||
|
const prizeId = ref(1);
|
||||||
|
|
||||||
|
// 页面挂载前
|
||||||
|
onBeforeMount(() => {
|
||||||
|
amount.value = props.prizeMsg.amount;
|
||||||
|
prizeId.value = props.prizeMsg.id;
|
||||||
|
|
||||||
|
if (props.prizeMsg.amount == 0) {
|
||||||
|
drawStatus.value = false;
|
||||||
|
}
|
||||||
|
console.log("props:", props.prizeMsg);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 页面挂载后
|
||||||
|
onMounted(() => {
|
||||||
|
gsap.from(".drawCon", { duration: 0.3, autoAlpha: 0 });
|
||||||
|
gsap.from(".draw_container", {
|
||||||
|
duration: 0.3,
|
||||||
|
scale: 0.2,
|
||||||
|
autoAlpha: 0,
|
||||||
|
delay: 0.1,
|
||||||
|
});
|
||||||
|
// gsap.from('.rule_cls_btn', { duration: 0.3, y: 20, autoAlpha: 0, delay: 0.5 })
|
||||||
|
});
|
||||||
|
|
||||||
|
const hide = () => {
|
||||||
|
emit("drawCon");
|
||||||
|
};
|
||||||
|
|
||||||
|
// 立即领取红包
|
||||||
|
const getMoney = () => {
|
||||||
|
redpacket(prizeId.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 领取接口
|
||||||
|
const redpacket = (prizeId) => {
|
||||||
|
let redpacketId = prizeId;
|
||||||
|
service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API +
|
||||||
|
"/cms-activity/cms88/redpacket/receive/" +
|
||||||
|
redpacketId,
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log("领取红包结果", res);
|
||||||
|
let data = res.data;
|
||||||
|
if (data.code == 0) {
|
||||||
|
gsap.to(".draw_container", {
|
||||||
|
duration: 0.3,
|
||||||
|
scale: 0,
|
||||||
|
autoAlpha: 0,
|
||||||
|
onComplete: () => {
|
||||||
|
drawStatus.value = false;
|
||||||
|
isgetMoney.value = true;
|
||||||
|
getMyPrizeRecored()
|
||||||
|
// gsap.form('.add_container',{duration:0.5,scale:0,autoAlpha:0,})
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Dialog.confirm({
|
||||||
|
title: "温馨提示",
|
||||||
|
message: '请先绑定牛卡号',
|
||||||
|
confirmButtonText: '前往绑定',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
wx.miniProgram.navigateTo({
|
||||||
|
url: "/subs/bind/pages/login/login?source=zszq",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(2);
|
||||||
|
// on cancel
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 我的红包记录
|
||||||
|
const getMyPrizeRecored = () => {
|
||||||
|
service
|
||||||
|
.post(process.env.VUE_APP_API + "/cms-activity/cms88/prize/list", {})
|
||||||
|
.then((res) => {
|
||||||
|
console.log("红包记录:", res.data);
|
||||||
|
|
||||||
|
store.commit({
|
||||||
|
type: "updatePrizeList",
|
||||||
|
prizeList: res.data.data,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.drawCon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
|
||||||
|
.draw_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.has_prize {
|
||||||
|
@include box(530px, 594px);
|
||||||
|
@include bg_pos("../assets/img/pop/luckybag.png");
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.money_num {
|
||||||
|
@include pos(530px, 92px, 0px, 134px);
|
||||||
|
color: #ff480e;
|
||||||
|
font-size: 32px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 82px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.get_btn {
|
||||||
|
@include pos(274px, 92px, 139px, 389px);
|
||||||
|
@include bg_pos("../assets/img/pop/draw_got_btn.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.no_prize {
|
||||||
|
@include box(573px, 362px);
|
||||||
|
@include bg_pos("../assets/img/pop/no_prize_pop.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.add_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.is_added {
|
||||||
|
@include box(530px, 594px);
|
||||||
|
@include bg_pos("../assets/img/pop/got_luckyBag_pop.png");
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.go_index_btn {
|
||||||
|
@include pos(394px, 92px, 79px, 389px);
|
||||||
|
@include bg_pos("../assets/img/pop/to_index_btn.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cls_btn {
|
||||||
|
@include box(72px, 72px);
|
||||||
|
@include bg_pos("../assets/img/pop/cls_btn.png");
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
204
src/components/Loading.vue
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
<template>
|
||||||
|
<div class="loadCon" @touchmove.prevent>
|
||||||
|
<div class="load_container">
|
||||||
|
<div class="load_box">
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
} from "vue";
|
||||||
|
import gsap from "gsap";
|
||||||
|
import axios from "axios";
|
||||||
|
import { Toast } from "vant";
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
const emit = defineEmits(["RulesPop"]); // 声明触发事件,对应父组件上面的方法
|
||||||
|
const props = defineProps({ sendMessage: Object }); // 获取props
|
||||||
|
const store = useStore();
|
||||||
|
|
||||||
|
// 页面挂载前
|
||||||
|
onBeforeMount(() => {});
|
||||||
|
|
||||||
|
// 页面挂载后
|
||||||
|
onMounted(() => {});
|
||||||
|
|
||||||
|
const hidePop = () => {
|
||||||
|
emit("RulesPop");
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.loadCon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-image: -moz-linear-gradient( 90deg, rgb(254,186,136) 37%, rgb(253,240,227) 100%);
|
||||||
|
background-image: -webkit-linear-gradient( 90deg, rgb(254,186,136) 37%, rgb(253,240,227) 100%);
|
||||||
|
background-image: -ms-linear-gradient( 90deg, rgb(254,186,136) 37%, rgb(253,240,227) 100%);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.load_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
@keyframes load_box {
|
||||||
|
0% {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box{
|
||||||
|
width: 40px !important;
|
||||||
|
height: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div {
|
||||||
|
// left: 94px;
|
||||||
|
// top: 48px;
|
||||||
|
position: absolute;
|
||||||
|
animation: load_box linear 1s infinite;
|
||||||
|
background: #df1317;
|
||||||
|
width: 12px;
|
||||||
|
height: 24px;
|
||||||
|
border-radius: 6px / 12px;
|
||||||
|
transform-origin: 6px 52px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(1) {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
animation-delay: -0.9166666666666666s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(2) {
|
||||||
|
transform: rotate(30deg);
|
||||||
|
animation-delay: -0.8333333333333334s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(3) {
|
||||||
|
transform: rotate(60deg);
|
||||||
|
animation-delay: -0.75s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(4) {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
animation-delay: -0.6666666666666666s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(5) {
|
||||||
|
transform: rotate(120deg);
|
||||||
|
animation-delay: -0.5833333333333334s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(6) {
|
||||||
|
transform: rotate(150deg);
|
||||||
|
animation-delay: -0.5s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(7) {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
animation-delay: -0.4166666666666667s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(8) {
|
||||||
|
transform: rotate(210deg);
|
||||||
|
animation-delay: -0.3333333333333333s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(9) {
|
||||||
|
transform: rotate(240deg);
|
||||||
|
animation-delay: -0.25s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(10) {
|
||||||
|
transform: rotate(270deg);
|
||||||
|
animation-delay: -0.16666666666666666s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(11) {
|
||||||
|
transform: rotate(300deg);
|
||||||
|
animation-delay: -0.08333333333333333s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div:nth-child(12) {
|
||||||
|
transform: rotate(330deg);
|
||||||
|
animation-delay: 0s;
|
||||||
|
background: #df1317;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loadingio-spinner-spinner-z60ni5wxaaj {
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
display: inline-block;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #f1f2f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
transform: translateZ(0) scale(1);
|
||||||
|
backface-visibility: hidden;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
/* see note above */
|
||||||
|
}
|
||||||
|
|
||||||
|
.load_box div {
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
280
src/components/LuckyWheel copy.vue
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
<template>
|
||||||
|
<div class="LuckyWheelCon" @touchmove.prevent>
|
||||||
|
<div class="LuckyWheel_container">
|
||||||
|
<div class="LuckyWheel_box">
|
||||||
|
<div class="prize p-1" ref="p1"></div>
|
||||||
|
<div class="prize p-2" ref="p2"></div>
|
||||||
|
<div class="prize p-3" ref="p3"></div>
|
||||||
|
<div class="prize p-4" ref="p4"></div>
|
||||||
|
<div class="prize p-5" ref="p5"></div>
|
||||||
|
<div class="prize p-1" ref="p6"></div>
|
||||||
|
<div class="prize p-2" ref="p7"></div>
|
||||||
|
<div class="prize p-3" ref="p8"></div>
|
||||||
|
<div class="prize p-4" ref="p9"></div>
|
||||||
|
<div class="prize p-5" ref="p10"></div>
|
||||||
|
<div class="prize p-1" ref="p11"></div>
|
||||||
|
<div class="prize p-2" ref="p12"></div>
|
||||||
|
<div class="prize p-3" ref="p13"></div>
|
||||||
|
<div class="prize p-4" ref="p14"></div>
|
||||||
|
<div class="prize p-5" ref="p15"></div>
|
||||||
|
<div class="prize p-5" ref="p16"></div>
|
||||||
|
<div class="prize p-5" ref="p17"></div>
|
||||||
|
<div class="prize p-5" ref="p18"></div>
|
||||||
|
<div class="prize p-5" ref="p19"></div>
|
||||||
|
<!-- <div class="prize p-3" ref="p20"></div> -->
|
||||||
|
</div>
|
||||||
|
<!-- <div class="btn" @click="btn">开始抽奖</div> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
defineExpose,
|
||||||
|
} from "vue";
|
||||||
|
import gsap from "gsap";
|
||||||
|
import axios from "axios";
|
||||||
|
import { Toast } from "vant";
|
||||||
|
import { useStore } from "vuex";
|
||||||
|
|
||||||
|
// import { PixiPlugin } from "gsap/PixiPlugin.js";
|
||||||
|
import { MotionPathPlugin } from "gsap/MotionPathPlugin.js";
|
||||||
|
// import { MorphSVGPlugin } from "gsap/MorphSVGPlugin";
|
||||||
|
|
||||||
|
gsap.registerPlugin(MotionPathPlugin);
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
const emit = defineEmits(["luckyWheel"]); // 声明触发事件,对应父组件上面的方法
|
||||||
|
const props = defineProps({ sendMessage: Object }); // 获取props
|
||||||
|
const store = useStore();
|
||||||
|
const p1 = ref(null);
|
||||||
|
const p2 = ref(null);
|
||||||
|
const p3 = ref(null);
|
||||||
|
const p4 = ref(null);
|
||||||
|
const p5 = ref(null);
|
||||||
|
const p6 = ref(null);
|
||||||
|
const p7 = ref(null);
|
||||||
|
const p8 = ref(null);
|
||||||
|
const p9 = ref(null);
|
||||||
|
const p10 = ref(null);
|
||||||
|
const p11 = ref(null);
|
||||||
|
const p12 = ref(null);
|
||||||
|
const p13 = ref(null);
|
||||||
|
const p14 = ref(null);
|
||||||
|
const p15 = ref(null);
|
||||||
|
const p16 = ref(null);
|
||||||
|
const p17 = ref(null);
|
||||||
|
const p18 = ref(null);
|
||||||
|
const p19 = ref(null);
|
||||||
|
const aniGroup = ref([]);
|
||||||
|
|
||||||
|
const eqcode = ref(require("../assets/img/pop/eqcode.png"));
|
||||||
|
const luckyWheelStatus = ref(false);
|
||||||
|
|
||||||
|
// 大转盘结束回调
|
||||||
|
const isStop = () => {
|
||||||
|
if (!luckyWheelStatus.value) {
|
||||||
|
luckyWheelStatus.value = true;
|
||||||
|
console.log("大转盘结束");
|
||||||
|
emit('luckyWheel') //告诉主页弹出相应结果弹窗
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 页面挂载前
|
||||||
|
onBeforeMount(() => {});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
showDrawAni();
|
||||||
|
});
|
||||||
|
|
||||||
|
// bingo 为中奖index 对应 pArr的index
|
||||||
|
const showDrawAni = (bingo, repeat) => {
|
||||||
|
|
||||||
|
const pArr = [
|
||||||
|
p1, // 1.08
|
||||||
|
p2, // 2.68
|
||||||
|
p3, // 6.66
|
||||||
|
p4, // 8.88
|
||||||
|
p5, // 谢谢 默认选中值
|
||||||
|
p6, //以下皆为填充奖品 可随便填充
|
||||||
|
p7,
|
||||||
|
p8,
|
||||||
|
p9,
|
||||||
|
p10,
|
||||||
|
p11,
|
||||||
|
p12,
|
||||||
|
p13,
|
||||||
|
p14,
|
||||||
|
p15,
|
||||||
|
p16,
|
||||||
|
p17,
|
||||||
|
p18,
|
||||||
|
p19,
|
||||||
|
];
|
||||||
|
const singleRate = 1 / pArr.length; // 路径平均分 单个元素在路径上的位置
|
||||||
|
const delta = singleRate + 0.068; // 修正偏移量
|
||||||
|
let rotateDelta = 0; //转到哪一个停止 | 默认为第五个奖品 谢谢参与
|
||||||
|
if (bingo) {
|
||||||
|
rotateDelta = (5 - bingo) * singleRate;
|
||||||
|
}
|
||||||
|
for (let i = 1; i < pArr.length + 1; i++) {
|
||||||
|
let ani = gsap.to(
|
||||||
|
[pArr[i - 1].value],
|
||||||
|
{
|
||||||
|
duration: 10,
|
||||||
|
paused: bingo ? false : true, //没有中奖结果则为初始化
|
||||||
|
// repeat: -1,
|
||||||
|
// delay: i * 0.5 - 1,
|
||||||
|
// stagger: 0.5,
|
||||||
|
// repeatDelay: 3,
|
||||||
|
// yoyo: true,
|
||||||
|
ease: "back.out(1.4)",
|
||||||
|
motionPath: {
|
||||||
|
path: "M115.37,73.45C177.05-25.14,462-22.69,535,70,686.45,248.93,797.17,321.7,324.48,321.7-121,321.7-20.39,248.93,115.37,73.45Z",
|
||||||
|
// align: [1, 1],
|
||||||
|
autoRotate: true,
|
||||||
|
start: i * singleRate + rotateDelta - delta, // 动画开始于路径的位置 0-1
|
||||||
|
end: i * singleRate + 1 + rotateDelta - delta, // 动画结束于路径的位置 0-无穷
|
||||||
|
offsetX: -177,
|
||||||
|
offsetY: -43,
|
||||||
|
alignOrigin: [0.5, 0],
|
||||||
|
},
|
||||||
|
onUpdate: () => {
|
||||||
|
// if (i === 1) console.log(ani.progress());
|
||||||
|
},
|
||||||
|
onStart: () => {
|
||||||
|
if (i == pArr.length - 1) {
|
||||||
|
setTimeout(() => {
|
||||||
|
// console.log("停止2");
|
||||||
|
isStop()
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onComplete: () => {},
|
||||||
|
},
|
||||||
|
"same"
|
||||||
|
);
|
||||||
|
// 更新视图
|
||||||
|
ani.seek(0);
|
||||||
|
if (bingo && repeat) {
|
||||||
|
setTimeout(() => {
|
||||||
|
showDrawAni(bingo, false);
|
||||||
|
}, 800);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const btn = () => {
|
||||||
|
console.log("抽奖");
|
||||||
|
// 中奖奖品ID
|
||||||
|
// 奖品 1 - 1.08
|
||||||
|
// 奖品 2 - 2.68
|
||||||
|
// 奖品 3 - 6.66
|
||||||
|
// 奖品 4 - 8.88
|
||||||
|
// 奖品 5 - 谢谢参与
|
||||||
|
// 第一个参数 对应奖品对应id, 第二个参数是是否多旋转一会儿 fasle旋转一圈就停止
|
||||||
|
showDrawAni(2, true);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 暴露出方法给父组件调用
|
||||||
|
defineExpose({
|
||||||
|
showDrawAni,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.LuckyWheelCon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
|
||||||
|
.LuckyWheel_container {
|
||||||
|
position: absolute;
|
||||||
|
top: 770px;
|
||||||
|
left: 0px;
|
||||||
|
width: 760px;
|
||||||
|
height: 500px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.LuckyWheel_box {
|
||||||
|
|
||||||
|
width: 760px;
|
||||||
|
height: 500px;
|
||||||
|
|
||||||
|
// // border-width: 123px;
|
||||||
|
// border-style: solid;
|
||||||
|
// border-radius: 50%;
|
||||||
|
// // box-shadow: -1.569px -17.932px 16px 0px rgba(234, 6, 16, 0.16);
|
||||||
|
// width: 831px;
|
||||||
|
// height: 305px;
|
||||||
|
|
||||||
|
// width: 100%;
|
||||||
|
// height: 100%;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 0;
|
||||||
|
// left: 20px;
|
||||||
|
|
||||||
|
.li {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
background-color: #ff6000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 200px;
|
||||||
|
height: 100px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 100px;
|
||||||
|
font-size: 30px;
|
||||||
|
color: #fff;
|
||||||
|
background: #ff6000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.prize {
|
||||||
|
position: absolute;
|
||||||
|
width: 160px;
|
||||||
|
height: 96px;
|
||||||
|
left: 0px;
|
||||||
|
top: 10px;
|
||||||
|
// 奖品图
|
||||||
|
&.p-1 {
|
||||||
|
background-image: url("~@/assets/img/p_1.png");
|
||||||
|
background-size: 160px 96px;
|
||||||
|
}
|
||||||
|
&.p-2 {
|
||||||
|
background-image: url("~@/assets/img/p_2.png");
|
||||||
|
background-size: 160px 96px;
|
||||||
|
}
|
||||||
|
&.p-3 {
|
||||||
|
background-image: url("~@/assets/img/p_3.png");
|
||||||
|
background-size: 160px 96px;
|
||||||
|
}
|
||||||
|
&.p-4 {
|
||||||
|
background-image: url("~@/assets/img/p_4.png");
|
||||||
|
background-size: 160px 96px;
|
||||||
|
}
|
||||||
|
&.p-5 {
|
||||||
|
background-image: url("~@/assets/img/p_5.png");
|
||||||
|
background-size: 160px 96px;
|
||||||
|
}
|
||||||
|
// background-color: #f00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<!-- 对照div 重点 -->
|
<!-- 对照div 重点 -->
|
||||||
<div class="relative-box" ref="container"></div>
|
<div class="relative-box" ref="container"></div>
|
||||||
|
|
||||||
<div class="btn" @click="btn">开始抽奖</div>
|
<!-- <div class="btn" @click="btn">开始抽奖</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -60,7 +60,6 @@ import { useStore } from "vuex";
|
|||||||
// import { PixiPlugin } from "gsap/PixiPlugin.js";
|
// import { PixiPlugin } from "gsap/PixiPlugin.js";
|
||||||
import { MotionPathPlugin } from "gsap/MotionPathPlugin.js";
|
import { MotionPathPlugin } from "gsap/MotionPathPlugin.js";
|
||||||
// import { MorphSVGPlugin } from "gsap/MorphSVGPlugin";
|
// import { MorphSVGPlugin } from "gsap/MorphSVGPlugin";
|
||||||
|
|
||||||
gsap.registerPlugin(MotionPathPlugin);
|
gsap.registerPlugin(MotionPathPlugin);
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
@ -90,6 +89,19 @@ const aniGroup = ref([]);
|
|||||||
const container = ref();
|
const container = ref();
|
||||||
|
|
||||||
const eqcode = ref(require("../assets/img/pop/eqcode.png"));
|
const eqcode = ref(require("../assets/img/pop/eqcode.png"));
|
||||||
|
const luckyWheelStatus = ref(false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 大转盘结束回调
|
||||||
|
const isStop = () => {
|
||||||
|
if (!luckyWheelStatus.value) {
|
||||||
|
luckyWheelStatus.value = true;
|
||||||
|
console.log("大转盘结束");
|
||||||
|
emit('luckyWheel') //告诉主页弹出相应结果弹窗
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// 页面挂载前
|
// 页面挂载前
|
||||||
onBeforeMount(() => {});
|
onBeforeMount(() => {});
|
||||||
@ -169,6 +181,14 @@ const showDrawAni = (bingo, repeat) => {
|
|||||||
offsetY: 70,
|
offsetY: 70,
|
||||||
alignOrigin: [0.5, 0],
|
alignOrigin: [0.5, 0],
|
||||||
},
|
},
|
||||||
|
onStart: ()=>{
|
||||||
|
if (i == pArr.length - 1) {
|
||||||
|
setTimeout(() => {
|
||||||
|
// console.log("停止2");
|
||||||
|
isStop()
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
},
|
||||||
onUpdate: () => {
|
onUpdate: () => {
|
||||||
// if (i === 1) console.log(ani.progress());
|
// if (i === 1) console.log(ani.progress());
|
||||||
},
|
},
|
||||||
@ -196,22 +216,30 @@ const btn = () => {
|
|||||||
// 第一个参数 对应奖品对应id, 第二个参数是是否多旋转一会儿 fasle旋转一圈就停止
|
// 第一个参数 对应奖品对应id, 第二个参数是是否多旋转一会儿 fasle旋转一圈就停止
|
||||||
showDrawAni(1, true);
|
showDrawAni(1, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 暴露出方法给父组件调用
|
||||||
|
defineExpose({
|
||||||
|
showDrawAni,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.LuckyWheelCon {
|
.LuckyWheelCon {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 800px;
|
||||||
position: fixed;
|
position: absolute;
|
||||||
z-index: 10;
|
// z-index: 10;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
pointer-events: none;
|
||||||
// right: 0;
|
// right: 0;
|
||||||
// bottom: 0;
|
// bottom: 0;
|
||||||
// display: flex;
|
// display: flex;
|
||||||
// justify-content: center;
|
// justify-content: center;
|
||||||
// align-items: center;
|
// align-items: center;
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
// background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
|
||||||
.LuckyWheel_container {
|
.LuckyWheel_container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@ -1,213 +1,411 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="myPrizeCon" @touchmove.prevent>
|
<div class="myPrizeCon" @touchmove.prevent>
|
||||||
<div class="myPrize_container">
|
<div class="myPrize_container">
|
||||||
<div class="cake"></div>
|
<!-- 有奖品 -->
|
||||||
<div class="prize_box">
|
<div class="prize_has" v-if="prizeList.length != 0">
|
||||||
<div class="prize_top">
|
<div class="cake"></div>
|
||||||
<div class="prize_title"></div>
|
<div class="prize_box">
|
||||||
</div>
|
<div class="prize_top">
|
||||||
<div class="prize_middle">
|
<div class="prize_title"></div>
|
||||||
<div class="prize_item" v-for="item in prizeList" v-show="item.isHas">
|
</div>
|
||||||
<div class="prize_li">
|
<div class="prize_middle">
|
||||||
<div class="prize_num">{{ item.prizeNum }}元红包</div>
|
<div class="prize_item" v-for="(item, key) in prizeList" :key="key">
|
||||||
<div class="prize_spe">{{ item.spe }}</div>
|
<div class="prize_li">
|
||||||
</div>
|
<div class="prize_num">{{ item.prizeNum }}元红包</div>
|
||||||
<div class="buttom">
|
<div class="prize_spe">{{ item.spe }}</div>
|
||||||
<img
|
</div>
|
||||||
:src="item.isGeted ? require('../assets/img/pop/view_btn.png') : require('../assets/img/pop/got_btn.png')" />
|
<div class="buttom">
|
||||||
</div>
|
<img
|
||||||
</div>
|
:src="
|
||||||
</div>
|
item.isGeted == 1
|
||||||
<div class="prize_bottom"></div>
|
? require('../assets/img/pop/got_btn.png')
|
||||||
|
: require('../assets/img/pop/view_btn.png')
|
||||||
|
"
|
||||||
|
@click="getMoney(item)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cls_btn" @click="hide"></div>
|
</div>
|
||||||
|
<div class="prize_bottom"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 没奖品记录 -->
|
||||||
|
<div class="prize_no" v-if="prizeList.length == 0"></div>
|
||||||
|
<div class="cls_btn" @click="hide"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 领取成功反馈弹窗 -->
|
||||||
|
<div class="GotedPop" @touchmove.prevent>
|
||||||
|
<div class="goted_container">
|
||||||
|
<div class="goted_box">
|
||||||
|
<div class="to_index_btn" @click="hide"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cls_btn" @click="hidePop"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, onMounted, defineEmits, defineProps, reactive, ref, toRefs } from 'vue'
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
} from "vue";
|
||||||
import gsap from "gsap";
|
import gsap from "gsap";
|
||||||
import axios from 'axios'
|
import axios from "axios";
|
||||||
import { Toast } from 'vant';
|
import service from "@/api/httpServe";
|
||||||
|
import qs from "qs";
|
||||||
|
import { Toast, Dialog } from "vant";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
|
import wx from "@/utils/wx-jssdk.1.6.0.js";
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
const emit = defineEmits(["MyPrize"]); // 声明触发事件,对应父组件上面的方法
|
const emit = defineEmits(["MyPrize"]); // 声明触发事件,对应父组件上面的方法
|
||||||
const props = defineProps({ sendMessage: Object }); // 获取props
|
const props = defineProps({ sendMessage: Object }); // 获取props
|
||||||
const store = useStore()
|
const store = useStore();
|
||||||
|
|
||||||
|
|
||||||
const prizeList = reactive([
|
const prizeList = reactive([
|
||||||
{
|
// {
|
||||||
id: 1,
|
// id: 1,
|
||||||
prizeNum: 8.8,
|
// prizeNum: 8.8,
|
||||||
isGeted: true,
|
// isGeted: true,
|
||||||
isHas: true,
|
// isHas: true,
|
||||||
spe: '财富88,与“礼”共见证',
|
// spe: "财富88,与“礼”共见证",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 2,
|
// id: 2,
|
||||||
prizeNum: 8.8,
|
// prizeNum: 8.8,
|
||||||
isGeted: false,
|
// isGeted: false,
|
||||||
isHas: true,
|
// isHas: true,
|
||||||
spe: '添加专属服务人员企微',
|
// spe: "添加专属服务人员企微",
|
||||||
|
// },
|
||||||
},
|
]);
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
// 页面挂载前
|
// 页面挂载前
|
||||||
onBeforeMount(() => { })
|
onBeforeMount(() => {
|
||||||
|
let arr = store.state.userAccount.prizeList;
|
||||||
|
arr.forEach((element) => {
|
||||||
|
if (element.receiveStatus != -1) {
|
||||||
|
if (element.type == 1) {
|
||||||
|
prizeList.push({
|
||||||
|
id: element.id,
|
||||||
|
type: element.type,
|
||||||
|
prizeNum: element.amount,
|
||||||
|
isGeted: element.receiveStatus,
|
||||||
|
spe: "财富88,与“礼”共见证",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element.type == 2) {
|
||||||
|
prizeList.push({
|
||||||
|
id: element.id,
|
||||||
|
type: element.type,
|
||||||
|
prizeNum: element.amount,
|
||||||
|
isGeted: element.receiveStatus,
|
||||||
|
spe: "添加专属服务人员企微",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// 页面挂载后
|
// 页面挂载后
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
gsap.from('.myPrizeCon', { duration: 0.3, autoAlpha: 0 })
|
gsap.from(".myPrizeCon", { duration: 0.3, autoAlpha: 0 });
|
||||||
gsap.from('.myPrize_container', { duration: 0.3, scale: 0.2, autoAlpha: 0, delay: 0.1 })
|
gsap.from(".myPrize_container", {
|
||||||
// gsap.from('.rule_cls_btn', { duration: 0.3, y: 20, autoAlpha: 0, delay: 0.5 })
|
duration: 0.3,
|
||||||
})
|
scale: 0.2,
|
||||||
|
autoAlpha: 0,
|
||||||
|
delay: 0.1,
|
||||||
|
});
|
||||||
|
// gsap.from('.rule_cls_btn', { duration: 0.3, y: 20, autoAlpha: 0, delay: 0.5 })
|
||||||
|
});
|
||||||
|
|
||||||
const hide = () => {
|
const hide = () => {
|
||||||
emit('MyPrize')
|
emit("MyPrize");
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const hidePop = () => {
|
||||||
|
gsap.to(".GotedPop", { duration: 0.5, autoAlpha: 0 });
|
||||||
|
gsap.to(".myPrizeCon", { duration: 0.5, autoAlpha: 1, delay: 0.2 });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 领取按钮
|
||||||
|
const getMoney = (val) => {
|
||||||
|
console.log("val:", val);
|
||||||
|
|
||||||
|
// 先判断红包是否生效
|
||||||
|
if (val.isGeted == -2) {
|
||||||
|
Toast("红包已过24小时,不能再提现啦");
|
||||||
|
} else {
|
||||||
|
// 红包类型未参与红包: 需先绑定牛卡号
|
||||||
|
if (val.type == 1) {
|
||||||
|
console.log("牛卡号:", store.state.userAccount.nkh);
|
||||||
|
if (
|
||||||
|
store.state.userAccount.nkh == "" ||
|
||||||
|
store.state.userAccount.nkh == undefined
|
||||||
|
) {
|
||||||
|
// Toast("牛卡号为空,先绑定牛卡号");
|
||||||
|
Dialog.confirm({
|
||||||
|
title: "温馨提示",
|
||||||
|
message: "请先绑定牛卡号",
|
||||||
|
confirmButtonText: "前往绑定",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
wx.miniProgram.navigateTo({
|
||||||
|
url: "/subs/bind/pages/login/login?source=zszq",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(2);
|
||||||
|
// on cancel
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getLuckyBag(val.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val.type == 2) {
|
||||||
|
if (val.isGeted == 0) {
|
||||||
|
if (
|
||||||
|
store.state.userAccount.nkh == "" ||
|
||||||
|
store.state.userAccount.nkh == undefined
|
||||||
|
) {
|
||||||
|
// Toast("牛卡号为空,先绑定牛卡号");
|
||||||
|
Dialog.confirm({
|
||||||
|
title: "温馨提示",
|
||||||
|
message: "请先绑定牛卡号",
|
||||||
|
confirmButtonText: "前往绑定",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
wx.miniProgram.navigateTo({
|
||||||
|
url: "/subs/bind/pages/login/login?source=zszq",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log(2);
|
||||||
|
// on cancel
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log("未领取", val);
|
||||||
|
getLuckyBag(val.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 领取接口
|
||||||
|
const getLuckyBag = (id) => {
|
||||||
|
service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/redpacket/receive/" + id,
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log("领取红包结果", res);
|
||||||
|
|
||||||
|
let data = res.data;
|
||||||
|
|
||||||
|
if (data.code == 0) {
|
||||||
|
gsap.to(".GotedPop", { duration: 1, autoAlpha: 1, delay: 0.2 });
|
||||||
|
gsap.to(".myPrizeCon", { duration: 1, autoAlpha: 0 });
|
||||||
|
getMyPrizeRecored();
|
||||||
|
} else {
|
||||||
|
Toast(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 我的红包记录
|
||||||
|
const getMyPrizeRecored = () => {
|
||||||
|
service
|
||||||
|
.post(process.env.VUE_APP_API + "/cms-activity/cms88/prize/list", {})
|
||||||
|
.then((res) => {
|
||||||
|
console.log("红包记录:", res.data);
|
||||||
|
|
||||||
|
store.commit({
|
||||||
|
type: "updatePrizeList",
|
||||||
|
prizeList: res.data.data,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.myPrizeCon {
|
.myPrizeCon {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
|
||||||
|
.myPrize_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: rgba(0, 0, 0, 0.7);
|
flex-direction: column;
|
||||||
|
|
||||||
.myPrize_container {
|
// 有奖品央视
|
||||||
width: 750px;
|
.prize_has {
|
||||||
height: 1180px;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
justify-content: center;
|
align-items: center;
|
||||||
align-items: center;
|
.cake {
|
||||||
flex-direction: column;
|
width: 382px;
|
||||||
|
height: 201px;
|
||||||
|
@include bg_pos("../assets/img/pop/cake.png");
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
.cake {
|
.prize_box {
|
||||||
width: 382px;
|
width: 550px;
|
||||||
height: 201px;
|
margin-top: -34px;
|
||||||
@include bg_pos('../assets/img/pop/cake.png');
|
|
||||||
z-index: 999;
|
.prize_top {
|
||||||
|
width: 550px;
|
||||||
|
height: 135px;
|
||||||
|
@include bg_pos("../assets/img/pop/prize_box_top.png");
|
||||||
|
pointer-events: none;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.prize_title {
|
||||||
|
width: 267px;
|
||||||
|
height: 58px;
|
||||||
|
@include bg_pos("../assets/img/pop/my_prize.png");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.prize_box {
|
.prize_middle {
|
||||||
width: 550px;
|
width: 550px;
|
||||||
margin-top: -34px;
|
height: 190px;
|
||||||
|
@include bg_pos("../assets/img/pop/prize_box_middle.png");
|
||||||
|
margin-top: 0px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
.prize_top {
|
.prize_item {
|
||||||
width: 550px;
|
width: 463px;
|
||||||
height: 135px;
|
height: 67px;
|
||||||
@include bg_pos('../assets/img/pop/prize_box_top.png');
|
display: flex;
|
||||||
pointer-events: none;
|
justify-content: space-between;
|
||||||
display: flex;
|
align-items: center;
|
||||||
justify-content: center;
|
flex-direction: row;
|
||||||
align-items: center;
|
margin: 20px auto;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
|
||||||
.prize_title {
|
.prize_li {
|
||||||
width: 267px;
|
display: flex;
|
||||||
height: 58px;
|
// justify-content: center;
|
||||||
@include bg_pos('../assets/img/pop/my_prize.png');
|
// align-items: center;
|
||||||
}
|
flex-direction: column;
|
||||||
|
|
||||||
|
.prize_num {
|
||||||
|
color: #ca2f0a;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prize_spe {
|
||||||
|
color: #ca2f0a;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 24px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.prize_middle {
|
.buttom {
|
||||||
width: 550px;
|
width: 147px;
|
||||||
height: 190px;
|
height: 62px;
|
||||||
@include bg_pos('../assets/img/pop/prize_box_middle.png');
|
background-size: 100%;
|
||||||
margin-top: 0px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
|
img {
|
||||||
.prize_item {
|
width: 100%;
|
||||||
width: 463px;
|
height: 100%;
|
||||||
height: 67px;
|
}
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: row;
|
|
||||||
margin: 20px auto;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
|
|
||||||
.prize_li {
|
|
||||||
display: flex;
|
|
||||||
// justify-content: center;
|
|
||||||
// align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.prize_num {
|
|
||||||
color: #ca2f0a;
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.prize_spe {
|
|
||||||
color: #ca2f0a;
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 24px;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttom {
|
|
||||||
width: 147px;
|
|
||||||
height: 62px;
|
|
||||||
background-size: 100%;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.prize_bottom {
|
|
||||||
width: 550px;
|
|
||||||
height: 50px;
|
|
||||||
@include bg_pos('../assets/img/pop/prize_box_bottom.png');
|
|
||||||
margin-top: 0px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cls_btn {
|
.prize_bottom {
|
||||||
@include box(72px, 72px);
|
width: 550px;
|
||||||
@include bg_pos('../assets/img/pop/cls_btn.png');
|
height: 50px;
|
||||||
margin-top: 50px;
|
@include bg_pos("../assets/img/pop/prize_box_bottom.png");
|
||||||
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 无奖品样式
|
||||||
|
.prize_no {
|
||||||
|
width: 573px;
|
||||||
|
height: 524px;
|
||||||
|
@include bg_pos("../assets/img/pop/no_recored_pop.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
.cls_btn {
|
||||||
|
@include box(72px, 72px);
|
||||||
|
@include bg_pos("../assets/img/pop/cls_btn.png");
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.GotedPop {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
|
.goted_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.goted_box {
|
||||||
|
@include box(530px, 594px);
|
||||||
|
@include bg_pos("../assets/img/pop/got_luckyBag_pop.png");
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.to_index_btn {
|
||||||
|
@include pos(394px, 92px, 79px, 389px);
|
||||||
|
@include bg_pos("../assets/img/pop/to_index_btn.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cls_btn {
|
||||||
|
@include box(72px, 72px);
|
||||||
|
@include bg_pos("../assets/img/pop/cls_btn.png");
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -1,82 +1,118 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="rulesCon" @touchmove.prevent>
|
<div class="zz" @touchmove.prevent></div>
|
||||||
<div class="rules_container">
|
<div class="rulesCon">
|
||||||
<div class="rule_t"></div>
|
<div class="rules_container">
|
||||||
<div class="rule_cls_btn" @click="hidePop"></div>
|
<div class="rule_t">
|
||||||
|
<div class="rule_text">
|
||||||
|
<img src="../assets/img/rule_text.png" alt="" srcset="">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="rule_cls_btn" @click="hidePop"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, onMounted, defineEmits, defineProps, reactive, ref, toRefs } from 'vue'
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
} from "vue";
|
||||||
import gsap from "gsap";
|
import gsap from "gsap";
|
||||||
import axios from 'axios'
|
import axios from "axios";
|
||||||
import { Toast } from 'vant';
|
import { Toast } from "vant";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
const emit = defineEmits(["RulesPop"]); // 声明触发事件,对应父组件上面的方法
|
const emit = defineEmits(["RulesPop"]); // 声明触发事件,对应父组件上面的方法
|
||||||
const props = defineProps({ sendMessage: Object }); // 获取props
|
const props = defineProps({ sendMessage: Object }); // 获取props
|
||||||
const store = useStore()
|
const store = useStore();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 页面挂载前
|
// 页面挂载前
|
||||||
onBeforeMount(() => { })
|
onBeforeMount(() => {});
|
||||||
|
|
||||||
// 页面挂载后
|
// 页面挂载后
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
gsap.from('.rulesCon', { duration: 0.3, autoAlpha: 0 })
|
gsap.from(".rulesCon", { duration: 0.3, autoAlpha: 0 });
|
||||||
gsap.from('.rule_t', { duration: 0.3, scale: 0.2, autoAlpha: 0, delay: 0.1 })
|
gsap.from(".rule_t", { duration: 0.3, scale: 0.2, autoAlpha: 0, delay: 0.1 });
|
||||||
gsap.from('.rule_cls_btn', { duration: 0.3, y: 20, autoAlpha: 0, delay: 0.5 })
|
gsap.from(".rule_cls_btn", {
|
||||||
|
duration: 0.3,
|
||||||
})
|
y: 20,
|
||||||
|
autoAlpha: 0,
|
||||||
|
delay: 0.5,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const hidePop = () => {
|
const hidePop = () => {
|
||||||
emit('RulesPop')
|
emit("RulesPop");
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.zz {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.rulesCon {
|
.rulesCon {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
|
||||||
|
.rules_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: rgba(0, 0, 0, 0.7);
|
flex-direction: column;
|
||||||
|
|
||||||
.rules_container {
|
.rule_t {
|
||||||
width: 750px;
|
@include box(629px, 762px);
|
||||||
height: 1180px;
|
@include bg_pos("../assets/img/pop/rule_pop.png");
|
||||||
display: flex;
|
// pointer-events: none;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
position: relative;
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.rule_t {
|
.rule_text{
|
||||||
@include box(629px, 762px);
|
@include pos(563px, 630px, 30px, 95px);
|
||||||
@include bg_pos('../assets/img/pop/rule_pop.png');
|
overflow: hidden;
|
||||||
pointer-events: none;
|
overflow-y: scroll;
|
||||||
|
|
||||||
|
// @include bg_pos("../assets/img/rule_text.png");
|
||||||
|
img{
|
||||||
|
width: 100%;
|
||||||
|
height: 2874px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.rule_cls_btn {
|
|
||||||
@include box(72px, 72px);
|
|
||||||
@include bg_pos('../assets/img/pop/cls_btn.png');
|
|
||||||
margin-top: 50px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rule_cls_btn {
|
||||||
|
@include box(72px, 72px);
|
||||||
|
@include bg_pos("../assets/img/pop/cls_btn.png");
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -1,101 +1,396 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="serviceCon" @touchmove.prevent>
|
<div class="serviceCon" @touchmove.prevent>
|
||||||
<div class="service_container">
|
<div class="service_container">
|
||||||
<div class="service_box">
|
<!-- 未添加 -->
|
||||||
<div class="eqcode_box">
|
<div class="service_box" v-if="isadd == 0">
|
||||||
<img :src="store.state.userAccount.eqcodeImg" alt="">
|
<div class="eqcode_box">
|
||||||
</div>
|
<img :src="store.state.userAccount.eqcodeImg" alt="" />
|
||||||
</div>
|
|
||||||
<div class="service_cls_btn" @click="hidePop"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="update" v-if="!isgot" @click="updateStaus"></div>
|
||||||
|
|
||||||
|
<!-- 已经添加过:并且领取了红包 -->
|
||||||
|
<div class="is_got_box" v-if="isadd == 1 && isgot"></div>
|
||||||
|
|
||||||
|
<!-- 红包中奖 -->
|
||||||
|
<div class="has_service_box" v-if="isadd == 1 && !isgot && !noPrize">
|
||||||
|
<div class="money">{{ moneyNum }}</div>
|
||||||
|
<div class="get_luckybag" @click="getMoneyFn"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 红包未中奖 -->
|
||||||
|
<div class="no_prize" v-if="isadd == 1 && !isgot && noPrize"></div>
|
||||||
|
|
||||||
|
<div class="service_cls_btn" @click="hidePop"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 领奖页面 -->
|
||||||
|
<div class="getMoneyCon">
|
||||||
|
<div class="getMoney_container">
|
||||||
|
<div class="is_added">
|
||||||
|
<div class="go_index_btn" @click="hidePop"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, onMounted, defineEmits, defineProps, reactive, ref, toRefs } from 'vue'
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
} from "vue";
|
||||||
import gsap from "gsap";
|
import gsap from "gsap";
|
||||||
import axios from 'axios'
|
import axios from "axios";
|
||||||
import { Toast } from 'vant';
|
import { Toast, Dialog } from "vant";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
|
import service from "@/api/httpServe";
|
||||||
|
import qs from "qs";
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
const emit = defineEmits(["ServicePop"]); // 声明触发事件,对应父组件上面的方法
|
const emit = defineEmits(["ServicePop"]); // 声明触发事件,对应父组件上面的方法
|
||||||
const props = defineProps({ sendMessage: Object }); // 获取props
|
const props = defineProps({ sendMessage: Object }); // 获取props
|
||||||
const store = useStore()
|
const store = useStore();
|
||||||
|
|
||||||
|
const eqcode = ref(require("../assets/img/pop/eqcode.png"));
|
||||||
|
|
||||||
const eqcode = ref(require('../assets/img/pop/eqcode.png'))
|
const isadd = ref(0); // 是否已经添加
|
||||||
|
const isgot = ref(false); //是否领取
|
||||||
|
const isDraw = ref(false); //是否抽过奖
|
||||||
|
const redpacketId = ref(0); //奖品Id
|
||||||
|
const moneyNum = ref(""); //奖品金额
|
||||||
|
const isBingo = ref(false); //是否中过奖
|
||||||
|
|
||||||
|
const noPrize = ref(false); //未中奖
|
||||||
|
|
||||||
|
const noFirstAdd = ref(false);
|
||||||
|
|
||||||
|
// 刷新添加状态
|
||||||
|
const updateStaus = () => {
|
||||||
|
getIsAddService();
|
||||||
|
};
|
||||||
|
|
||||||
|
const isLost = ref(false);
|
||||||
|
|
||||||
// 页面挂载前
|
// 页面挂载前
|
||||||
onBeforeMount(() => { })
|
onBeforeMount(() => {
|
||||||
|
let arr = store.state.userAccount.prizeList;
|
||||||
|
|
||||||
|
arr.forEach((element) => {
|
||||||
|
if (element.type == 2) {
|
||||||
|
console.log("已经抽过》》》》》");
|
||||||
|
isgot.value = true;
|
||||||
|
isDraw.value = true;
|
||||||
|
noFirstAdd.value = true;
|
||||||
|
if (element.receiveStatus == -2) {
|
||||||
|
isLost.value = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if(element.amount != 0){
|
||||||
|
// isBingo.value = true
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (store.state.userAccount.isAddCustomer == 1) {
|
||||||
|
isadd.value = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (store.state.userAccount.isAddCustomer == 0 && !noFirstAdd.value) {
|
||||||
|
isadd.value = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 页面挂载后
|
// 页面挂载后
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
gsap.from('.serviceCon', { duration: 0.3, autoAlpha: 0 })
|
gsap.from(".serviceCon", { duration: 0.3, autoAlpha: 0 });
|
||||||
gsap.from('.service_box', { duration: 0.3, scale: 0.2, autoAlpha: 0, delay: 0.1 })
|
gsap.from(".service_box,.has_service_box,.is_got_box", {
|
||||||
gsap.from('.service_cls_btn', { duration: 0.3, y: 20, autoAlpha: 0, delay: 0.5 })
|
duration: 0.3,
|
||||||
})
|
scale: 0.2,
|
||||||
|
autoAlpha: 0,
|
||||||
|
delay: 0.1,
|
||||||
|
});
|
||||||
|
|
||||||
|
gsap.from(".update", {
|
||||||
|
duration: 0.3,
|
||||||
|
y: 20,
|
||||||
|
autoAlpha: 0,
|
||||||
|
delay: 0.3,
|
||||||
|
});
|
||||||
|
gsap.from(".service_cls_btn", {
|
||||||
|
duration: 0.3,
|
||||||
|
y: 20,
|
||||||
|
autoAlpha: 0,
|
||||||
|
delay: 0.5,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("添加企微状态:", isadd.value);
|
||||||
|
|
||||||
|
// 如果已经添加但是没有抽奖的话,调抽奖接口
|
||||||
|
if (isadd.value == 1) {
|
||||||
|
if (isgot.value == false) {
|
||||||
|
draw();
|
||||||
|
} else {
|
||||||
|
// 已经抽过奖的
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const hidePop = () => {
|
const hidePop = () => {
|
||||||
emit('ServicePop')
|
emit("ServicePop");
|
||||||
}
|
};
|
||||||
|
|
||||||
|
// 抽奖接口
|
||||||
|
const draw = () => {
|
||||||
|
let type = 2;
|
||||||
|
service
|
||||||
|
.post(process.env.VUE_APP_API + "/cms-activity/cms88/redpacket/draw", {
|
||||||
|
xglOpenId: store.state.userAccount.xglOpenId,
|
||||||
|
redpacketType: type,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
console.log("添加企微-抽取红包结果:", res);
|
||||||
|
|
||||||
|
let data = res.data;
|
||||||
|
getMyPrizeRecored();
|
||||||
|
|
||||||
|
if (data.code == 0) {
|
||||||
|
isadd.value = true;
|
||||||
|
redpacketId.value = data.data.id;
|
||||||
|
moneyNum.value = data.data.amount;
|
||||||
|
if (data.data.amount == 0) {
|
||||||
|
noPrize.value = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getMoneyFn = () => {
|
||||||
|
if (!isLost.value) {
|
||||||
|
if (
|
||||||
|
store.state.userAccount.nkh == "" ||
|
||||||
|
store.state.userAccount.nkh == undefined
|
||||||
|
) {
|
||||||
|
// Toast("牛卡号为空,先绑定牛卡号");
|
||||||
|
Dialog.confirm({
|
||||||
|
title: "温馨提示",
|
||||||
|
message: "请先绑定牛卡号",
|
||||||
|
confirmButtonText: "前往绑定",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
wx.miniProgram.navigateTo({
|
||||||
|
url: "/subs/bind/pages/login/login?source=zszq",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// on cancel
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 有牛卡号的话领取
|
||||||
|
getLuckyBag();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 领取接口
|
||||||
|
const getLuckyBag = () => {
|
||||||
|
service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API +
|
||||||
|
"/cms-activity/cms88/redpacket/receive/" +
|
||||||
|
redpacketId.value,
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log("领取红包结果", res);
|
||||||
|
let data = res.data;
|
||||||
|
if (data.code == 0) {
|
||||||
|
gsap.to(".serviceCon", { duration: 0.5, autoAlpha: 0 });
|
||||||
|
gsap.to(".getMoneyCon", { duration: 0.5, autoAlpha: 1 });
|
||||||
|
|
||||||
|
getMyPrizeRecored();
|
||||||
|
} else {
|
||||||
|
Toast(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 我的红包记录
|
||||||
|
const getMyPrizeRecored = () => {
|
||||||
|
service
|
||||||
|
.post(process.env.VUE_APP_API + "/cms-activity/cms88/prize/list", {})
|
||||||
|
.then((res) => {
|
||||||
|
console.log("红包记录:", res.data);
|
||||||
|
|
||||||
|
store.commit({
|
||||||
|
type: "updatePrizeList",
|
||||||
|
prizeList: res.data.data,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询是否添加了企微: isInActivityDate 0否 1是
|
||||||
|
const getIsAddService = () => {
|
||||||
|
let isInActivityDate = 1;
|
||||||
|
return service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API +
|
||||||
|
"/cms-activity/cms88/qywx/isadded/" +
|
||||||
|
isInActivityDate,
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log("是否添加了企微", res.data);
|
||||||
|
// store.state.userAccount.isBirthMon = res.data.data
|
||||||
|
store.commit({
|
||||||
|
type: "updateIsAddCustomer",
|
||||||
|
isAddCustomer: res.data.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = res.data;
|
||||||
|
|
||||||
|
if (data.data == 1) {
|
||||||
|
draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.data == 0) {
|
||||||
|
Toast("您还未添加企微,请扫码添加");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.serviceCon {
|
.serviceCon {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
|
||||||
|
.service_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: rgba(0, 0, 0, 0.7);
|
flex-direction: column;
|
||||||
|
|
||||||
|
.is_got_box {
|
||||||
.service_container {
|
@include box(530px, 594px);
|
||||||
width: 750px;
|
@include bg_pos("../assets/img/pop/has_service_pop.png");
|
||||||
height: 1180px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.service_box {
|
|
||||||
@include box(573px, 688px);
|
|
||||||
@include bg_pos('../assets/img/pop/service_box.png');
|
|
||||||
pointer-events: none;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.eqcode_box {
|
|
||||||
width: 210px;
|
|
||||||
height: 210px;
|
|
||||||
position: absolute;
|
|
||||||
top: 412px;
|
|
||||||
left: 192px;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.service_cls_btn {
|
|
||||||
@include box(72px, 72px);
|
|
||||||
@include bg_pos('../assets/img/pop/cls_btn.png');
|
|
||||||
margin-top: 50px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has_service_box {
|
||||||
|
@include box(530px, 594px);
|
||||||
|
@include bg_pos("../assets/img/pop/service_pop_1.png");
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.money {
|
||||||
|
@include pos(90px, 45px, 198px, 150px);
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
line-height: 45px;
|
||||||
|
color: #ca2f0a;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.get_luckybag {
|
||||||
|
@include pos(274px, 92px, 139px, 389px);
|
||||||
|
@include bg_pos("../assets/img/pop/get_luckyBag_btn.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 未中奖
|
||||||
|
.no_prize {
|
||||||
|
@include box(573px, 362px);
|
||||||
|
@include bg_pos("../assets/img/pop/no_prize_pop.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
.service_box {
|
||||||
|
@include box(573px, 688px);
|
||||||
|
@include bg_pos("../assets/img/pop/service_box.png");
|
||||||
|
// pointer-events: none;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.eqcode_box {
|
||||||
|
width: 210px;
|
||||||
|
height: 210px;
|
||||||
|
position: absolute;
|
||||||
|
top: 412px;
|
||||||
|
left: 192px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.update {
|
||||||
|
@include box(274px, 92px);
|
||||||
|
@include bg_pos("../assets/img/update_btn.png");
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.service_cls_btn {
|
||||||
|
@include box(72px, 72px);
|
||||||
|
@include bg_pos("../assets/img/pop/cls_btn.png");
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.getMoneyCon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
|
.getMoney_container {
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
width: 750px;
|
||||||
|
height: 1180px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.is_added {
|
||||||
|
@include box(530px, 594px);
|
||||||
|
@include bg_pos("../assets/img/pop/got_luckyBag_pop.png");
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.go_index_btn {
|
||||||
|
@include pos(394px, 92px, 79px, 389px);
|
||||||
|
@include bg_pos("../assets/img/pop/to_index_btn.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -1,4 +1,79 @@
|
|||||||
export default [
|
export default [
|
||||||
|
require('../assets/img/rule_text.png'),
|
||||||
|
require('../assets/img/zz.png'),
|
||||||
|
require('../assets/img/select_box.png'),
|
||||||
|
require('../assets/img/title_main.png'),
|
||||||
|
require('../assets/img/top_bg.jpg'),
|
||||||
|
require('../assets/img/zhuanpan.png'),
|
||||||
|
require('../assets/img/activity_1.png'),
|
||||||
|
require('../assets/img/activity_2.png'),
|
||||||
|
require('../assets/img/activity_3.png'),
|
||||||
|
require('../assets/img/activity_4.png'),
|
||||||
|
require('../assets/img/activity_5.png'),
|
||||||
|
require('../assets/img/activity_6.png'),
|
||||||
|
require('../assets/img/activity_bg.jpg'),
|
||||||
|
require('../assets/img/activity_box.png'),
|
||||||
|
require('../assets/img/activity_title.png'),
|
||||||
|
require('../assets/img/caidai.png'),
|
||||||
|
require('../assets/img/cloud_bottom.png'),
|
||||||
|
require('../assets/img/cloud_bottom3.png'),
|
||||||
|
require('../assets/img/cloud_left_1.png'),
|
||||||
|
require('../assets/img/cloud_left_2.png'),
|
||||||
|
require('../assets/img/cloud_left_3.png'),
|
||||||
|
require('../assets/img/cloud_right_1.png'),
|
||||||
|
require('../assets/img/cloud_right_2.png'),
|
||||||
|
require('../assets/img/cloud_right_3.png'),
|
||||||
|
require('../assets/img/draw_btn.png'),
|
||||||
|
require('../assets/img/icon_left_1.png'),
|
||||||
|
require('../assets/img/icon_left_2.png'),
|
||||||
|
require('../assets/img/icon_right_1.png'),
|
||||||
|
require('../assets/img/icon_right_2.png'),
|
||||||
|
require('../assets/img/laba.png'),
|
||||||
|
require('../assets/img/li_btn_1.png'),
|
||||||
|
require('../assets/img/li_btn_2.png'),
|
||||||
|
require('../assets/img/li_btn_3.png'),
|
||||||
|
require('../assets/img/li_btn_4.png'),
|
||||||
|
require('../assets/img/li_btn_5.png'),
|
||||||
|
require('../assets/img/li_btn_6.png'),
|
||||||
|
require('../assets/img/logo.png'),
|
||||||
|
require('../assets/img/luckybag.png'),
|
||||||
|
require('../assets/img/luckybag_2.png'),
|
||||||
|
require('../assets/img/luckybag_left.png'),
|
||||||
|
require('../assets/img/luckybag_right.png'),
|
||||||
|
require('../assets/img/luckybag_right_2.png'),
|
||||||
|
require('../assets/img/no_prize_text.png'),
|
||||||
|
require('../assets/img/notice_box.png'),
|
||||||
|
require('../assets/img/p_1.png'),
|
||||||
|
require('../assets/img/p_2.png'),
|
||||||
|
require('../assets/img/p_3.png'),
|
||||||
|
require('../assets/img/p_4.png'),
|
||||||
|
require('../assets/img/p_5.png'),
|
||||||
|
require('../assets/img/prize_btn.png'),
|
||||||
|
require('../assets/img/prize_btn_text.png'),
|
||||||
|
require('../assets/img/prize_text.png'),
|
||||||
|
require('../assets/img/rule_btn.png'),
|
||||||
|
require('../assets/img/rule_btn_text.png'),
|
||||||
|
require('../assets/img/pop/cake.png'),
|
||||||
|
require('../assets/img/pop/cls_btn.png'),
|
||||||
|
require('../assets/img/pop/draw_got_btn.png'),
|
||||||
|
require('../assets/img/pop/eqcode.png'),
|
||||||
|
require('../assets/img/pop/get_luckyBag_btn.png'),
|
||||||
|
require('../assets/img/pop/got_btn.png'),
|
||||||
|
require('../assets/img/pop/got_luckyBag_pop.png'),
|
||||||
|
require('../assets/img/pop/has_service_pop.png'),
|
||||||
|
require('../assets/img/pop/luckybag.png'),
|
||||||
|
require('../assets/img/pop/my_prize.png'),
|
||||||
|
require('../assets/img/pop/no_prize_pop.png'),
|
||||||
|
require('../assets/img/pop/no_recored_pop.png'),
|
||||||
|
require('../assets/img/pop/prize_box.png'),
|
||||||
|
require('../assets/img/pop/prize_box_bottom.png'),
|
||||||
|
require('../assets/img/pop/prize_box_middle.png'),
|
||||||
|
require('../assets/img/pop/prize_box_top.png'),
|
||||||
|
require('../assets/img/pop/rule_pop.png'),
|
||||||
|
require('../assets/img/pop/service_box.png'),
|
||||||
|
require('../assets/img/pop/service_pop_1.png'),
|
||||||
|
require('../assets/img/pop/service_pop_2.png'),
|
||||||
|
require('../assets/img/pop/to_index_btn.png'),
|
||||||
|
require('../assets/img/pop/view_btn.png'),
|
||||||
|
require('../assets/img/pop/ishas_service.png'),
|
||||||
];
|
];
|
||||||
@ -1,112 +1,305 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="homePage">
|
<div class="homePage">
|
||||||
<!-- 加载页 -->
|
|
||||||
|
|
||||||
<!-- 首页 -->
|
<!-- 首页 -->
|
||||||
<Index @indexPage="indexPage" />
|
<Index @indexPage="indexPage" v-if="showIndex" />
|
||||||
|
|
||||||
|
<!-- 加载页 -->
|
||||||
|
<Loading v-if="!showIndex" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, onMounted, defineEmits, defineProps, reactive, ref, toRefs, getCurrentInstance, computed } from 'vue'
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRefs,
|
||||||
|
getCurrentInstance,
|
||||||
|
computed,
|
||||||
|
} from "vue";
|
||||||
import gsap from "gsap";
|
import gsap from "gsap";
|
||||||
import axios from 'axios'
|
import axios from "axios";
|
||||||
import { Toast, Dialog } from 'vant';
|
import { Toast, Dialog } from "vant";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
// import { get_authorize, get_jssdk } from '@/api/authorize-api'
|
// import { get_authorize, get_jssdk } from '@/api/authorize-api'
|
||||||
import service from "@/api/httpServe"
|
import service from "@/api/httpServe";
|
||||||
import qs from 'qs'
|
import qs from "qs";
|
||||||
import h5plugin from '@/utils/plugin'
|
import h5plugin from "@/utils/plugin";
|
||||||
import Index from "@/components/Index"
|
import Index from "@/components/Index";
|
||||||
|
import Loading from "@/components/Loading";
|
||||||
|
import imgList from "@/data/imgList";
|
||||||
|
import wx from "@/utils/wx-jssdk.1.6.0.js";
|
||||||
|
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
const emit = defineEmits(["indexPage"]); // 声明触发事件,对应父组件上面的方法
|
const emit = defineEmits(["indexPage"]); // 声明触发事件,对应父组件上面的方法
|
||||||
const props = defineProps({ sendMessage: Object }); // 获取props
|
const props = defineProps({ sendMessage: Object }); // 获取props
|
||||||
const store = useStore() //初始化vuex
|
const store = useStore(); //初始化vuex
|
||||||
const { proxy } = getCurrentInstance(); //初始化全局方法:plugin工具箱
|
const { proxy } = getCurrentInstance(); //初始化全局方法:plugin工具箱
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 变量定义
|
// 变量定义
|
||||||
const authData = ref('')
|
const authData = ref("");
|
||||||
const authCode = ref('')
|
const authCode = ref("");
|
||||||
|
const showIndex = ref(false);
|
||||||
|
|
||||||
|
// 活动参与人数
|
||||||
|
const getActivityNum = () => {
|
||||||
|
return service.post(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/user/count/"
|
||||||
|
);
|
||||||
|
// .then((res) => {
|
||||||
|
// console.log(res.data.data);
|
||||||
|
// store.commit({
|
||||||
|
// type: "updateParticipantNum",
|
||||||
|
// participantNum: res.data.data,
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 是否在活动期间生日
|
||||||
|
const getBrithday = () => {
|
||||||
|
return service.post(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/user/isin/birthday/",{}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询是否添加了企微: isInActivityDate 0活动前是否存在 1活动期间是否存在
|
||||||
|
const getIsAddService = (id) => {
|
||||||
|
let isInActivityDate = id;
|
||||||
|
return service.post(
|
||||||
|
process.env.VUE_APP_API +
|
||||||
|
"/cms-activity/cms88/qywx/isadded/" +
|
||||||
|
isInActivityDate,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 红包记录
|
||||||
|
const getMyPrizeRecored = () => {
|
||||||
|
return service.post(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/prize/list",
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询员工企业-微信二维码
|
||||||
|
const gerCardId = (carid) => {
|
||||||
|
return service.get(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/card/qrcode/" + carid
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取绑定的资金账号
|
||||||
|
const getInfo = () => {
|
||||||
|
return service.post(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/nkh/info",
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 接口数据处理
|
||||||
|
const apiAll = () => {
|
||||||
|
// 页面挂载前请求接口
|
||||||
|
Promise.all([
|
||||||
|
gerCardId(store.state.userAccount.cardId),
|
||||||
|
getInfo(),
|
||||||
|
getMyPrizeRecored(),
|
||||||
|
getBrithday(),
|
||||||
|
getActivityNum(),
|
||||||
|
getIsAddService(0),
|
||||||
|
getIsAddService(1),
|
||||||
|
]).then((result) => {
|
||||||
|
// console.log("接口都请求完成", result);
|
||||||
|
console.log("1.获取企业微信二维码:", result[0].data);
|
||||||
|
console.log("2.获取资金账号:", result[1].data);
|
||||||
|
console.log("3.获取红包记录:", result[2].data);
|
||||||
|
console.log("4.获取生日状态:", result[3].data);
|
||||||
|
console.log("5.获取活动人数:", result[4].data);
|
||||||
|
console.log("6.获取添加企业微信状态【活动前是否存在】:", result[5].data);
|
||||||
|
console.log("7.获取添加企业微信状态【活动期间是否添加】:", result[6].data);
|
||||||
|
|
||||||
|
// 更细二维码
|
||||||
|
store.commit({ type: "updateeEqcodeImg", eqcodeImg: result[0].data.data });
|
||||||
|
// 更新资金账号记录
|
||||||
|
store.commit({ type: "updateeNkh", nkh: result[1].data.data });
|
||||||
|
|
||||||
|
// 更新红包记录
|
||||||
|
store.commit({ type: "updatePrizeList", prizeList: result[2].data.data });
|
||||||
|
|
||||||
|
// 更新生日状态
|
||||||
|
store.commit({ type: "updateBirthMoon", isBirthMon: result[3].data.data });
|
||||||
|
|
||||||
|
// 更新活动人数
|
||||||
|
store.commit({
|
||||||
|
type: "updateParticipantNum",
|
||||||
|
participantNum: result[4].data.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新添加企微状态:活动前是否存在
|
||||||
|
store.commit({
|
||||||
|
type: "updateisAddCustomerBefore",
|
||||||
|
isAddCustomerBefore: result[5].data.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新添加企微状态:活动期间
|
||||||
|
store.commit({
|
||||||
|
type: "updateIsAddCustomer",
|
||||||
|
isAddCustomer: result[6].data.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 预加载图片资源
|
||||||
|
pageImgsArrLoad(imgList).then(() => {
|
||||||
|
console.log("load done");
|
||||||
|
showIndex.value = true;
|
||||||
|
gsap.from(".homePage", { duration: 0.1, autoAlpha: 0, y: 100 });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 页面未挂载
|
// 页面未挂载
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
console.log("link:",window.location.href);
|
goBackEvent()
|
||||||
|
|
||||||
|
if (!h5plugin.isWX()) {
|
||||||
|
apiAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("link:", window.location.href);
|
||||||
|
console.log("用户活动信息:", store.state.userAccount);
|
||||||
|
|
||||||
|
console.log("code:", h5plugin.getQueryString("code"));
|
||||||
|
|
||||||
// 微信环境授权
|
// 微信环境授权
|
||||||
if (h5plugin.isWX()) {
|
if (h5plugin.isWX()) {
|
||||||
console.log('code:', h5plugin.getQueryString('code'));
|
if (h5plugin.getQueryString("code")) {
|
||||||
|
|
||||||
if (h5plugin.getQueryString('code')) {
|
|
||||||
// 存在code的话去换取openid
|
// 存在code的话去换取openid
|
||||||
authCode.value = h5plugin.getQueryString('code')
|
authCode.value = h5plugin.getQueryString("code");
|
||||||
getOpenId(authCode.value)
|
getOpenId(authCode.value);
|
||||||
} else {
|
} else {
|
||||||
getCode()
|
getCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// let token = h5plugin.getQueryString('token')
|
|
||||||
// 更新openid
|
|
||||||
store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
|
|
||||||
store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
|
|
||||||
store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') });
|
|
||||||
console.log("用户活动信息:", store.state.userAccount);
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 页面挂载
|
// 页面挂载
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
fontAdpat();
|
||||||
});
|
// stopBack()
|
||||||
|
});
|
||||||
|
|
||||||
// 来自首页的事件
|
// 来自首页的事件
|
||||||
const indexPage = (actions) => {
|
const indexPage = (actions) => {
|
||||||
console.log("来自index组件:", actions);
|
console.log("来自index组件:", actions);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// 授权获取code
|
|
||||||
const getCode = () => {
|
const getCode = () => {
|
||||||
let redirect_uri = window.location.href;
|
let redirect_uri = window.location.href;
|
||||||
service.post(process.env.VUE_APP_API + '/zsApi/xfhdAuthorize', qs.stringify({
|
|
||||||
redirect_uri: redirect_uri
|
|
||||||
|
|
||||||
})).then((res) => {
|
service
|
||||||
let code = res.data.data
|
.post(process.env.VUE_APP_API + "/cms-activity/cms88/zsApi/xfhdAuthorize", {
|
||||||
authCode.value = res.data.data
|
redirect_uri: redirect_uri,
|
||||||
window.location.href = res.data.data
|
})
|
||||||
})
|
.then((res) => {
|
||||||
}
|
let code = res.data.data;
|
||||||
|
console.log("get code结果3", res);
|
||||||
|
authCode.value = res.data.data;
|
||||||
|
window.location.href = res.data.data;
|
||||||
|
// location.href = res.data.data;
|
||||||
|
// window.open(res.data.data)
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 授权获取openid
|
// 授权获取openid
|
||||||
const getOpenId = (code) => {
|
const getOpenId = (code) => {
|
||||||
|
service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/zsApi/oauthInfo",
|
||||||
|
// qs.stringify({
|
||||||
|
// code: code
|
||||||
|
// })
|
||||||
|
{
|
||||||
|
code: code,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
console.log("后端返回的openid:", res.data);
|
||||||
|
// 更新openid
|
||||||
|
store.commit({ type: "updateXGLOpenid", openid: res.data.data });
|
||||||
|
apiAll();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
service.post(process.env.VUE_APP_API + '/zsApi/oauthInfo', qs.stringify({
|
// 资源预加载器
|
||||||
code: code
|
const imgPreloader = (url) => {
|
||||||
})).then((res) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
let image = new Image();
|
||||||
if (res.data.code == 0) {
|
image.src = url;
|
||||||
console.log("后端返回的openid:", res.data);
|
image.onload = () => {
|
||||||
// 更新openid
|
resolve();
|
||||||
store.commit({ type: 'updateXGLOpenid', openid: res.data.data })
|
};
|
||||||
console.log("用户活动信息2:", store.state.userAccount);
|
image.onerror = () => {
|
||||||
|
reject();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 加载进度监控
|
||||||
|
const pageImgsArrLoad = (imgs) => {
|
||||||
|
let promiseArr = [];
|
||||||
|
imgs.forEach((element) => {
|
||||||
|
promiseArr.push("img", imgPreloader(element));
|
||||||
|
});
|
||||||
|
return Promise.all(promiseArr);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 字体适配
|
||||||
|
const fontAdpat = () => {
|
||||||
|
if (
|
||||||
|
typeof WeixinJSBridge == "object" &&
|
||||||
|
typeof WeixinJSBridge.invoke == "function"
|
||||||
|
) {
|
||||||
|
handleFontSize();
|
||||||
|
} else {
|
||||||
|
if (document.addEventListener) {
|
||||||
|
document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
|
||||||
|
} else if (document.attachEvent) {
|
||||||
|
document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
function handleFontSize() {
|
||||||
|
// 设置网页字体为默认大小
|
||||||
|
WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 });
|
||||||
|
// 重写设置网页字体大小的事件
|
||||||
|
WeixinJSBridge.on("menu:setfont", function () {
|
||||||
|
WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
})
|
// 禁止返回
|
||||||
}
|
const stopBack = () => {
|
||||||
|
history.pushState(null, null, document.URL);
|
||||||
|
|
||||||
|
window.addEventListener("popstate", function () {
|
||||||
|
// history.pushState(null, null, document.URL);
|
||||||
|
history.back(-1);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 监听后退事件
|
||||||
|
const goBackEvent = () => {
|
||||||
|
history.pushState({ page: 1 }, null, window.location.href);
|
||||||
|
//然后监听popstate事件
|
||||||
|
window.addEventListener("popstate", (event) => {
|
||||||
|
console.log("退出");
|
||||||
|
wx.miniProgram.navigateBack();
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -119,7 +312,6 @@ const getOpenId = (code) => {
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
div {
|
div {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
@ -133,6 +325,6 @@ div {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
background: rgb(255, 255, 255);
|
background: #ffd195;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
0
src/page/Home/Login.vue
Normal file
@ -3,7 +3,8 @@ import { createRouter, createWebHashHistory } from 'vue-router';
|
|||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes: [
|
routes: [
|
||||||
{ path: '/', component: () => import('@/views/Home.vue') }
|
{ path: '/', component: () => import('@/views/Home/Home.vue') },
|
||||||
|
{ path: '/login', component: () => import('@/views/Home/Login.vue') }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,21 +1,30 @@
|
|||||||
import { createStore } from 'vuex';
|
import { createStore } from 'vuex';
|
||||||
import h5plugin from "@/utils/plugin.js"
|
import h5plugin from "@/utils/plugin.js"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default createStore({
|
export default createStore({
|
||||||
// 数据源
|
// 数据源
|
||||||
state: {
|
state: {
|
||||||
userAccount: {
|
userAccount: {
|
||||||
xglOpenid: 'openid12138', //用户openid
|
// xglOpenId: 'o9B_fvjtyh2KELQYc2t9A3MEh7JQ', //用户openid
|
||||||
token: '13f88993882b4dc0832351566c11a1eb', //用户token
|
xglOpenId: '', //用户openid
|
||||||
cardId: '94207', //carid
|
// xglOpenId: h5plugin.getQueryString('openid'), //用户openid
|
||||||
|
token: h5plugin.getQueryString('token'), //用户token
|
||||||
|
cardId: h5plugin.getQueryString('cardId'), //carid
|
||||||
nkh: '', //牛卡号
|
nkh: '', //牛卡号
|
||||||
isDraw: false, //是否抽过奖
|
isDraw: false, //是否抽过奖
|
||||||
isHasAccount: false, //是否存在牛卡号
|
isHasAccount: false, //是否存在牛卡号
|
||||||
isAddCustomer: false, //是否添加过服务人员
|
isAddCustomer: 0, //活动期间内是否添加过服务人员
|
||||||
|
isAddCustomerBefore:0, //活动前是否存在服务人员
|
||||||
isHasPrize: [], //是否存在奖品
|
isHasPrize: [], //是否存在奖品
|
||||||
participantNum: 1213821, //活动参与人数
|
participantNum: 0, //活动参与人数
|
||||||
prizeResult: 73.11, //中奖金额
|
prizeResult: 0, //中奖金额
|
||||||
eqcodeImg: '' //二维码
|
eqcodeImg: '', //二维码
|
||||||
|
isBirthMon: 1, //生日是否处于当月
|
||||||
|
prizeList: [], //奖品列表
|
||||||
|
uuid: h5plugin.getQueryString('uuid'), //carid
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -26,7 +35,7 @@ export default createStore({
|
|||||||
mutations: {
|
mutations: {
|
||||||
// 更新信广龙openid
|
// 更新信广龙openid
|
||||||
updateXGLOpenid(state, val) {
|
updateXGLOpenid(state, val) {
|
||||||
state.userAccount.xglOpenid = val.openid
|
state.userAccount.xglOpenId = val.openid
|
||||||
},
|
},
|
||||||
|
|
||||||
// 更新token
|
// 更新token
|
||||||
@ -34,21 +43,45 @@ export default createStore({
|
|||||||
state.userAccount.token = val.token
|
state.userAccount.token = val.token
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 更新牛卡号
|
||||||
|
updateeNkh(state,val){
|
||||||
|
state.userAccount.nkh = val.nkh
|
||||||
|
},
|
||||||
|
|
||||||
|
// 更新cardId
|
||||||
updateCardId(state,val){
|
updateCardId(state,val){
|
||||||
state.userAccount.cardId = val.cardId
|
state.userAccount.cardId = val.cardId
|
||||||
},
|
},
|
||||||
|
|
||||||
updateNkh(state,val){
|
// 更新二维码
|
||||||
state.userAccount.nkh = val.nkh
|
|
||||||
},
|
|
||||||
|
|
||||||
updateeEqcodeImg(state,val){
|
updateeEqcodeImg(state,val){
|
||||||
state.userAccount.eqcodeImg = val.eqcodeImg
|
state.userAccount.eqcodeImg = val.eqcodeImg
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 更新活动参与人数
|
||||||
updateParticipantNum(state,val){
|
updateParticipantNum(state,val){
|
||||||
state.userAccount.participantNum = val.participantNum
|
state.userAccount.participantNum = val.participantNum
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 更新生日是否处于当月状态
|
||||||
|
updateBirthMoon(state,val){
|
||||||
|
state.userAccount.isBirthMon = val.isBirthMon
|
||||||
|
},
|
||||||
|
|
||||||
|
// 更新活动期间内是否添加过企微状态
|
||||||
|
updateIsAddCustomer(state,val){
|
||||||
|
state.userAccount.isAddCustomer = val.isAddCustomer
|
||||||
|
},
|
||||||
|
|
||||||
|
// 更新活动前是否存在企微状态
|
||||||
|
updateisAddCustomerBefore(state,val){
|
||||||
|
state.userAccount.isAddCustomerBefore = val.isAddCustomerBefore
|
||||||
|
},
|
||||||
|
|
||||||
|
// 更新奖品列表
|
||||||
|
updatePrizeList(state,val){
|
||||||
|
state.userAccount.prizeList = val.prizeList
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 改变方法:异步
|
// 改变方法:异步
|
||||||
|
|||||||