Compare commits

..

1 Commits

Author SHA1 Message Date
rucky
9424a5beae 稍微做了个没办法的适配 2022-08-05 17:42:07 +08:00
99 changed files with 821 additions and 2896 deletions

View File

@ -2,16 +2,16 @@
NODE_ENV = 'production'
// 入口地址
VUE_APP_BASE_URL = 'https://wealthplus.cmschina.com'
VUE_APP_BASE_URL = 'https://cdn.xglpa.com/tcubic/pdf/'
// 业务接口
VUE_APP_API = 'https://wealthplus.cmschina.com'
VUE_APP_API = 'https://cdn.xglpa.com/tcubic/pdf/'
// CDN地址
VUE_APP_CDN = './'
VUE_APP_CDN = 'https://cdn.xglpa.com/tcubic/pdf/'
// XGL授权接口
VUE_APP_XGL_DOMAIN = https://wealthplus.cmschina.com
VUE_APP_XGL_DOMAIN = https://wealth.newone.com.cn
// 招商证券授权接口
VUE_APP_ZS_DOMAIN = https://wealthplus.cmschina.com
VUE_APP_ZS_DOMAIN = https://wealth.newone.com.cn

2
package-lock.json generated
View File

@ -2350,7 +2350,7 @@
"dev": true
},
"vue-loader-v16": {
"version": "npm:vue-loader-v16@16.8.3",
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,

View File

@ -2,11 +2,7 @@ const AutoPrefixer = require("autoprefixer");
const px2rem = require("postcss-px2rem");
module.exports = ({ file }) => {
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 {
plugins: [
px2rem({ remUnit: remUnit, }),

View File

@ -29,7 +29,7 @@ const service = axios.create({
// 添加请求拦截器
service.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
// console.log("开始请求");
console.log("开始请求");
config
return config;
}, function (error) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1,230 +0,0 @@
<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>

View File

@ -1,39 +1,39 @@
<template>
<div class="indexPage">
<div class="indexCon">
<div class="logo" @click="deleteData"></div>
<div class="logo"></div>
<div class="title_main"></div>
<div class="cloud_left_1"></div>
<div class="cloud_right_1"></div>
<div class="luckybag_left"></div>
<div class="luckybag_right"></div>
<div class="icon_left_1"></div>
<div class="lucky_bag" v-if="!gameOver"></div>
<div class="lucky_bag_2" v-if="gameOver">
<div class="no_prize_text" v-if="drawAmount == 0"></div>
<div class="prize_text" v-if="drawAmount != 0"></div>
<div class="prize_num" v-if="drawAmount != 0">
{{ drawAmount }}<span></span>
</div>
<div class="lucky_bag"></div>
<div class="lucky_bag_2">
<div class="prize_num">{{ prizeResult }}<span></span></div>
</div>
<div class="notice">
<span class="icon"><img src="../assets/img/laba.png" alt="" srcset="" /></span>
<span class="num">活动已有{{ store.state.userAccount.participantNum }}人参与</span>
<span class="icon"
><img src="../assets/img/laba.png" alt="" srcset=""
/></span>
<span class="num"
>活动已有{{
store.state.userAccount.participantNum
}}人参与</span
>
</div>
<div class="cloud_left_2"></div>
<div class="icon_left_2"></div>
<div class="cloud_right_2"></div>
<!-- 大转盘 -->
<div class="zhuanpan"></div>
<LuckyWheel v-if="true" ref="LuckyWheelCon" @luckyWheel="luckyWheelFn" />
<!-- <div class="LuckyWheel_zz"></div> -->
<div class="icon_right_2"></div>
<div class="icon_right_3"></div>
<div class="cloud_left_3"></div>
<div class="cloud_right_3"></div>
<div class="icon_right_1"></div>
<div class="select_box"></div>
<div class="draw_btn" :class="isDraw ? 'is_draw' : ''" @click="drawBtn"></div>
<div class="draw_btn" @click="drawBtn"></div>
<div class="rule_btn" @click="showRluesBtn"></div>
<div class="prize_btn" @click="showMyPrizePop"></div>
<div class="rule_btn_text"></div>
@ -47,12 +47,22 @@
<img src="../assets/img/activity_title.png" alt="" />
</div>
<div class="activity_list">
<div class="activity_li" v-for="(item, index) in activityList" :key="index" :style="{
<div
class="activity_li"
v-for="(item, index) in activityList"
:key="index"
:style="{
'background-image': 'url(' + item.banner + ')',
}" v-show="item.show">
<div class="btn" :style="{
}"
v-show="item.show"
>
<div
class="btn"
:style="{
'background-image': 'url(' + item.btnImg + ')',
}" @click="activityBtn(item)"></div>
}"
@click="activityBtn(item)"
></div>
</div>
</div>
</div>
@ -65,31 +75,8 @@
<MyPrize v-if="showMyPrize" @MyPrize="myPrizePop" />
<!-- 添加专属服务人员企微弹窗 -->
<ServiceList v-if="showServicePop" @ServicePop="hideServicePop" />
<!-- 抽奖结果弹窗 -->
<Draw v-if="showDrawCon" @drawCon="drawConFn" :prizeMsg="prizeMsg" />
</div>
<!-- 如果添加过企微进入页面后弹窗显示中奖结果未中奖的不显示 -->
<div class="serviceLuckyPop">
<div class="serviceLuckyPop_container">
<!-- 企微中奖弹窗 -->
<div class="serviceLuckyPop_box" v-if="serviceLuckyPopBox">
<div class="money">{{ serviceLuckyMsg.money }}</div>
<div class="get_luckybag" @click="getServiceLucky"></div>
</div>
<!-- 领奖弹窗 -->
<div class="serviceLuckyPop_get_box" v-if="!serviceLuckyPopBox">
<div class="go_index_btn" @click="hideServiceLuckyPop"></div>
</div>
<div class="cls_btn" @click="hideServiceLuckyPop"></div>
</div>
</div>
<div class="ishas_service_pop">
<div class="ishas_service_box"></div>
<div class="ishas_service_box_cls" @click="ishasServicePopHide"></div>
<LuckyWheel v-if="true" />
</div>
</template>
@ -106,20 +93,17 @@ import {
computed,
} from "vue";
import gsap from "gsap";
import axios from "axios";
import { Toast, Dialog } from "vant";
import { useStore } from "vuex";
// import { get_authorize, get_jssdk } from '@/api/authorize-api'
import service from "@/api/httpServe";
import qs from "qs";
import wx from "@/utils/wx-jssdk.1.6.0.js";
import h5plugin from "@/utils/plugin";
import Rules from "@/components/Rules";
import MyPrize from "@/components/MyPrize";
import ServiceList from "@/components/ServiceList";
import LuckyWheel from "@/components/LuckyWheel";
import Draw from "@/components/Draw";
//
const emit = defineEmits(["indexPage"]); //
@ -136,90 +120,6 @@ const showRulesPop = ref(false);
const showMyPrize = ref(false);
const showServicePop = ref(false);
const gameOver = ref(false);
const drawType = ref(1);
const isDraw = ref(false);
const LuckyWheelCon = ref(null);
const showDrawCon = ref(false); //
const drawAmount = ref(""); //
const prizeMsg = reactive({
amount: 0,
id: 1,
});
const serviceLuckyPopBox = ref(true);
//
const isGetedServiceLucky = ref(false);
const serviceLuckyMsg = reactive({
money: 0,
id: 1,
});
//
const isLost1 = ref(false);
const isLost2 = ref(false);
const hideServiceLuckyPop = () => {
gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 0 });
};
//
const ishasServicePop = () => {
gsap.to(".ishas_service_pop", { duration: 0.5, autoAlpha: 1 });
};
const ishasServicePopHide = () => {
gsap.to(".ishas_service_pop", { duration: 0.5, autoAlpha: 0 });
};
//
const getServiceLucky = () => {
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 {
//
console.log("getServiceLucky:", serviceLuckyMsg);
redpacket(serviceLuckyMsg.id);
}
};
//
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) {
serviceLuckyPopBox.value = false;
getMyPrizeRecored(); //
} else {
Toast(data.msg);
}
});
};
//
const activityList = reactive([
{
@ -236,8 +136,7 @@ const activityList = reactive([
},
{
id: 3,
show: store.state.userAccount.isBirthMon,
// show: 1,
show: true,
banner: require("../assets/img/activity_3.png"),
btnImg: require("../assets/img/li_btn_3.png"),
},
@ -253,219 +152,55 @@ const activityList = reactive([
banner: require("../assets/img/activity_5.png"),
btnImg: require("../assets/img/li_btn_5.png"),
},
{
id: 6,
show: true,
banner: require("../assets/img/activity_6.png"),
btnImg: require("../assets/img/li_btn_6.png"),
},
]);
// const hasServicePrize = ref(false)
//
onBeforeMount(() => {
//
let arr = store.state.userAccount.prizeList;
arr.forEach((element) => {
if (element.type == 1) {
isDraw.value = true;
gameOver.value = true;
drawAmount.value = element.amount;
if (element.receiveStatus == -2) {
isLost1.value = true;
}
}
//
if (element.type == 2) {
isGetedServiceLucky.value = true;
if (element.receiveStatus == -2) {
isLost2.value = true;
}
}
//
gerCardId(94207);
getInfo();
getMyPrizeRecored();
getBrithday();
getActivityNum();
});
});
//
const animationIndex = () => {
gsap.from(".title_main", { duration: 0.5, scale: 0 });
gsap.from(".indexCon", { duration: 0.5, autoAlpha: 0 });
gsap.from(".cloud_left_1,.cloud_left_2,.cloud_left_3", {
duration: 0.5,
x: -200,
delay: 0.5,
});
gsap.from(".cloud_right_1,.cloud_right_2", {
duration: 0.5,
x: 200,
delay: 0.5,
});
gsap.from(".lucky_bag_2,.lucky_bag,.notice", {
duration: 0.5,
y: -200,
autoAlpha: 0,
});
gsap.from(".LuckyWheelCon", { duration: 0.5, autoAlpha: 0, delay: 1 });
gsap.from(".activity_li", {
duration: 1,
autoAlpha: 0,
y: 150,
stagger: 0.1,
});
gsap.from(
".activityCon,.zhuanpan,.select_box,.draw_btn,.rule_btn,.rule_btn_text,.prize_btn,.prize_btn_text",
{
duration: 0.5,
y: 200,
autoAlpha: 0,
onComplete: () => {
gsap.from(".icon_right_3", {
duration: 1,
rotation: -10,
scale: 1.1,
repeat: -1,
yoyo: true,
});
gsap.from(".luckybag_left", {
duration: 0.75,
rotation: 10,
scale: 1.2,
repeat: -1,
yoyo: true,
ease: "Bounce.easeIn",
});
gsap.from(".luckybag_right", {
duration: 1,
rotation: -10,
scale: 1.2,
repeat: -1,
yoyo: true,
ease: "Bounce.easeInOut",
});
gsap.to(".title_main", {
duration: 2,
y: -10,
scale: 1.05,
repeat: -1,
yoyo: true,
});
},
}
);
};
//
onMounted(() => {
//
animationIndex();
onMounted(() => {});
//
addPoint();
const btn = () => {
// Toast('');
emit("indexPage", "hello");
// ,,,
if (
store.state.userAccount.isAddCustomerBefore == 0 &&
!isGetedServiceLucky.value
) {
if (
store.state.userAccount.isAddCustomer == 1 &&
!isGetedServiceLucky.value
) {
if (!isLost2.value) {
getluckyBag2(2);
}
}
}
Dialog.alert({
title: "招商证券88司庆活动",
message: "项目开发中",
confirmButtonText: "确定",
showCancelButton: true,
})
.then((e) => {
// openid
store.commit({ type: "updateOpenid", openid: "openid110" });
if (!isDraw.value) {
gsap.to(".draw_btn", {
duration: 0.5,
scale: 1.1,
repeat: -1,
yoyo: true,
ease: "Bounce.easeIn",
});
}
console.log(e, store.state.userAccount);
})
.catch((e) => {
console.log(e);
});
};
//
const drawBtn = () => {
if (!isDraw.value) {
// LuckyWheelCon.value.showDrawAni(3, true)
gsap.killTweensOf(".draw_btn");
if (!isLost1.value) {
getluckyBag(1); //1
}
} else {
Toast("您已经抽过奖");
}
};
//
const luckyWheelFn = () => {
console.log("game over");
showDrawCon.value = true;
gameOver.value = true;
console.log("抽奖:");
getluckyBag(1);
};
//
const activityBtn = (item) => {
console.log(item.id);
console.log(wx);
if (item.id == 1) {
if (store.state.userAccount.isAddCustomerBefore == 1) {
// Toast("")
ishasServicePop();
} else {
showServicePop.value = true;
}
}
if (item.id == 2) {
console.log("新客专享页面");
// let url = "/subs/financial/pages/index/index";
wx.miniProgram.navigateTo({
url: "/subs/financial/pages/index/index",
});
}
if (item.id == 3) {
console.log("生日专享页面");
console.log("跳转:", "https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_MxCbQgYb&uuid=" + store.state.userAccount.uuid);
window.location.href =
"https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_MxCbQgYb&uuid=" + store.state.userAccount.uuid;
}
if (item.id == 4) {
console.log("牛牛杯");
window.location.href =
"https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_uD5KUL2d";
// setTimeout(()=>{
// location.replace(location.href)
// },1000)
}
if (item.id == 5) {
console.log("财富微课堂");
// window.location.href='/subs/activity/pages/classroom/classroom'
wx.miniProgram.navigateTo({
url: "/subs/activity/pages/classroom/classroom",
});
}
if (item.id == 6) {
console.log("财富日报");
wx.miniProgram.navigateTo({
url: "/subs/wealthpaper/wealthpaper",
});
}
};
//
@ -480,17 +215,10 @@ const hideRulesPop = () => {
const showMyPrizePop = () => {
showMyPrize.value = true;
};
//
const myPrizePop = () => {
showMyPrize.value = false;
};
//
const drawConFn = () => {
showDrawCon.value = false;
};
//
const hideServicePop = () => {
showServicePop.value = false;
@ -508,7 +236,9 @@ const getAuthorize = (scopeState) => {
//
const gerCardId = (carid) => {
service
.get(process.env.VUE_APP_API + "/cms-activity/cms88/card/qrcode/" + carid)
.get(
process.env.VUE_APP_API + "/cms-activity/cms88/card/qrcode/" + carid
)
.then((res) => {
console.log("企微二维码:", res.data.data);
store.commit({
@ -532,113 +262,36 @@ 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,
});
console.log(res);
});
};
// isInActivityDate 0 1
const getIsAddService = (id) => {
let isInActivityDate = id;
// isInActivityDate 0 1
const getIsAddService = () => {
let isInActivityDate = 0;
service
.post(
process.env.VUE_APP_API +
"/cms-activity/cms88/qywx/isadded/" +
isInActivityDate,
{}
isInActivityDate
)
.then((res) => {
console.log("是否添加了企微", res);
console.log(res);
});
};
// type 1 2
const getluckyBag = (id) => {
let type = id;
drawType.value = id;
service
.post(process.env.VUE_APP_API + "/cms-activity/cms88/redpacket/draw", {
xglOpenId: store.state.userAccount.xglOpenId,
redpacketType: type,
})
.post(
process.env.VUE_APP_API +
"/cms-activity/cms88/redpacket/draw/" +
type,
{}
)
.then((res) => {
console.log("抽取红包结果:", res);
if (res.data.code == 0) {
isDraw.value = true;
let prizeNum = res.data.data.amount;
drawAmount.value = res.data.data.amount;
prizeMsg.amount = res.data.data.amount;
prizeMsg.id = res.data.data.id;
gsap.set(".LuckyWheel_zz", { autoAlpha: 0 });
//
if (prizeNum == 0) {
//
LuckyWheelCon.value.showDrawAni(5, true);
}
if (prizeNum == 1.08) {
// 1.88
LuckyWheelCon.value.showDrawAni(1, true);
}
if (prizeNum == 2.68) {
// 2.68
LuckyWheelCon.value.showDrawAni(2, true);
}
if (prizeNum == 6.66) {
// 6.66
LuckyWheelCon.value.showDrawAni(3, true);
}
if (prizeNum == 8.88) {
// 6.66
LuckyWheelCon.value.showDrawAni(4, true);
}
getMyPrizeRecored(); //
} else {
Toast(res.data.msg);
}
});
};
const getluckyBag2 = (id) => {
let type = id;
service
.post(process.env.VUE_APP_API + "/cms-activity/cms88/redpacket/draw", {
xglOpenId: store.state.userAccount.xglOpenId,
redpacketType: type,
})
.then((res) => {
console.log("抽取红包结果2", res);
if (res.data.code == 0) {
//
if (res.data.data.amount != 0) {
serviceLuckyMsg.money = res.data.data.amount;
serviceLuckyMsg.id = res.data.data.id;
console.log("企微中奖");
gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 1 });
gsap.from(".serviceLuckyPop_box", {
duration: 0.5,
autoAlpha: 0,
scale: 0,
});
gsap.from(".cls_btn", {
duration: 0.5,
autoAlpha: 0,
y: 50,
delay: 0.5,
});
} else {
console.log("企微不中奖");
}
getMyPrizeRecored(); //
} else {
Toast(res.data.msg);
}
console.log(res);
});
};
@ -667,44 +320,6 @@ const getBrithday = () => {
console.log(res);
});
};
//
const addPoint = () => {
service
.post(
process.env.VUE_APP_API + "/action/application/action/event/user/brows",
{
actionType: 24,
actionId: 20220805,
cardId: store.state.userAccount.cardId,
}
)
.then((res) => {
console.log("埋点成功:", res);
});
};
const deleteNum = ref(0);
//
const deleteData = (type) => {
if (process.env.NODE_ENV == "test") {
deleteNum.value++;
if (deleteNum.value == 3) {
let type = 0;
service
.post(
process.env.VUE_APP_API +
"/cms-activity/cms88/redpacket/delete/" +
type,
{}
)
.then((res) => {
console.log("数据已清空", res);
deleteNum.value = 0;
});
}
}
};
</script>
<style lang="scss" scoped>
@ -718,7 +333,6 @@ const deleteData = (type) => {
right: 0;
overflow: hidden;
overflow-y: scroll;
background: #ffd195;
.indexCon {
// @include pos(100%, 1090px, 0, 0);
@ -733,7 +347,7 @@ const deleteData = (type) => {
.logo {
@include pos(241px, 36px, 31px, 41px);
@include bg_pos("../assets/img/logo.png");
// pointer-events: none;
pointer-events: none;
}
.notice {
@ -771,12 +385,6 @@ const deleteData = (type) => {
pointer-events: none;
}
.LuckyWheel_zz {
@include pos(750px, 496px, 0px, 657px);
@include bg_pos("../assets/img/zz.png");
pointer-events: none;
}
.caidai {
@include pos(641px, 503px, 47px, 79px);
@include bg_pos("../assets/img/caidai.png");
@ -865,7 +473,7 @@ const deleteData = (type) => {
@include pos(308px, 355px, 227px, 356px);
@include bg_pos("../assets/img/luckybag.png");
pointer-events: none;
// visibility: hidden;
visibility: hidden;
}
.lucky_bag_2 {
@ -875,18 +483,6 @@ const deleteData = (type) => {
// display: flex;
.no_prize_text {
@include pos(221px, 59px, 55px, 55px);
@include bg_pos("../assets/img/no_prize_text.png");
pointer-events: none;
}
.prize_text {
@include pos(172px, 23px, 80px, 37px);
@include bg_pos("../assets/img/prize_text.png");
pointer-events: none;
}
.prize_num {
@include pos(330px, 50px, 0px, 79px);
font-weight: 700;
@ -913,11 +509,6 @@ const deleteData = (type) => {
@include bg_pos("../assets/img/draw_btn.png");
}
.is_draw {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
.rule_btn {
@include pos(137px, 153px, 75px, 883px);
@include bg_pos("../assets/img/rule_btn.png");
@ -1025,99 +616,10 @@ const deleteData = (type) => {
.cloud_bottom {
width: 750px;
height: 132px;
margin-top: 0px;
height: 255px;
margin-top: -160px;
@include bg_pos("../assets/img/cloud_bottom.png");
}
}
}
.serviceLuckyPop {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: rgba(0, 0, 0, 0.7);
visibility: hidden;
.serviceLuckyPop_container {
width: 750px;
height: 1180px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.serviceLuckyPop_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");
}
}
.cls_btn {
@include box(72px, 72px);
@include bg_pos("../assets/img/pop/cls_btn.png");
margin-top: 50px;
}
}
.serviceLuckyPop_get_box {
@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");
}
}
}
.ishas_service_pop {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: rgba(0, 0, 0, 0.7);
visibility: hidden;
.ishas_service_box {
@include box(573px, 362px);
@include bg_pos("../assets/img/pop/ishas_service.png");
}
.ishas_service_box_cls {
@include box(72px, 72px);
@include bg_pos("../assets/img/pop/cls_btn.png");
margin-top: 50px;
}
}
</style>

View File

@ -1,204 +0,0 @@
<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>

View File

@ -1,280 +0,0 @@
<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 pArrindex
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>

View File

@ -37,7 +37,7 @@
<!-- 对照div 重点 -->
<div class="relative-box" ref="container"></div>
<!-- <div class="btn" @click="btn">开始抽奖</div> -->
<div class="btn" @click="btn">开始抽奖</div>
</div>
</div>
</template>
@ -60,6 +60,7 @@ import { useStore } from "vuex";
// import { PixiPlugin } from "gsap/PixiPlugin.js";
import { MotionPathPlugin } from "gsap/MotionPathPlugin.js";
// import { MorphSVGPlugin } from "gsap/MorphSVGPlugin";
gsap.registerPlugin(MotionPathPlugin);
//
@ -89,19 +90,6 @@ const aniGroup = ref([]);
const container = 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(() => {});
@ -181,14 +169,6 @@ const showDrawAni = (bingo, repeat) => {
offsetY: 70,
alignOrigin: [0.5, 0],
},
onStart: ()=>{
if (i == pArr.length - 1) {
setTimeout(() => {
// console.log("2");
isStop()
}, 5000);
}
},
onUpdate: () => {
// if (i === 1) console.log(ani.progress());
},
@ -216,30 +196,22 @@ const btn = () => {
// id, fasle
showDrawAni(1, true);
};
//
defineExpose({
showDrawAni,
});
</script>
<style lang="scss" scoped>
.LuckyWheelCon {
width: 100%;
height: 800px;
position: absolute;
// z-index: 10;
height: 100%;
position: fixed;
z-index: 10;
top: 0;
left: 0;
pointer-events: none;
// right: 0;
// bottom: 0;
// display: flex;
// justify-content: center;
// align-items: center;
// background-color: rgba(0, 0, 0, 0.3);
background-color: rgba(0, 0, 0, 0.3);
.LuckyWheel_container {
position: absolute;

View File

@ -1,240 +1,82 @@
<template>
<div class="myPrizeCon" @touchmove.prevent>
<div class="myPrize_container">
<!-- 有奖品 -->
<div class="prize_has" v-if="prizeList.length != 0">
<div class="cake"></div>
<div class="prize_box">
<div class="prize_top">
<div class="prize_title"></div>
</div>
<div class="prize_middle">
<div class="prize_item" v-for="(item, key) in prizeList" :key="key">
<div class="prize_item" v-for="item in prizeList" v-show="item.isHas">
<div class="prize_li">
<div class="prize_num">{{ item.prizeNum }}元红包</div>
<div class="prize_spe">{{ item.spe }}</div>
</div>
<div class="buttom">
<img
:src="
item.isGeted == 1
? require('../assets/img/pop/got_btn.png')
: require('../assets/img/pop/view_btn.png')
"
@click="getMoney(item)"
/>
:src="item.isGeted ? require('../assets/img/pop/view_btn.png') : require('../assets/img/pop/got_btn.png')" />
</div>
</div>
</div>
<div class="prize_bottom"></div>
</div>
</div>
<!-- 没奖品记录 -->
<div class="prize_no" v-if="prizeList.length == 0"></div>
<div class="cls_btn" @click="hide"></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>
<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 axios from "axios";
import service from "@/api/httpServe";
import qs from "qs";
import { Toast, Dialog } from "vant";
import axios from 'axios'
import { Toast } from 'vant';
import { useStore } from "vuex";
import wx from "@/utils/wx-jssdk.1.6.0.js";
//
const emit = defineEmits(["MyPrize"]); //
const props = defineProps({ sendMessage: Object }); // props
const store = useStore();
const store = useStore()
const prizeList = reactive([
// {
// id: 1,
// prizeNum: 8.8,
// isGeted: true,
// isHas: true,
// spe: "88",
// },
// {
// id: 2,
// prizeNum: 8.8,
// isGeted: false,
// isHas: true,
// spe: "",
// },
]);
{
id: 1,
prizeNum: 8.8,
isGeted: true,
isHas: true,
spe: '财富88与“礼”共见证',
},
{
id: 2,
prizeNum: 8.8,
isGeted: false,
isHas: true,
spe: '添加专属服务人员企微',
},
])
//
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与“礼”共见证",
});
}
onBeforeMount(() => { })
if (element.type == 2) {
prizeList.push({
id: element.id,
type: element.type,
prizeNum: element.amount,
isGeted: element.receiveStatus,
spe: "添加专属服务人员企微",
});
}
}
});
});
//
onMounted(() => {
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('.myPrizeCon', { duration: 0.3, autoAlpha: 0 })
gsap.from('.myPrize_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("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);
}
emit('MyPrize')
}
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>
<style lang="scss" scoped>
@ -259,15 +101,10 @@ const getMyPrizeRecored = () => {
align-items: center;
flex-direction: column;
//
.prize_has {
display: flex;
flex-direction: column;
align-items: center;
.cake {
width: 382px;
height: 201px;
@include bg_pos("../assets/img/pop/cake.png");
@include bg_pos('../assets/img/pop/cake.png');
z-index: 999;
}
@ -278,7 +115,7 @@ const getMyPrizeRecored = () => {
.prize_top {
width: 550px;
height: 135px;
@include bg_pos("../assets/img/pop/prize_box_top.png");
@include bg_pos('../assets/img/pop/prize_box_top.png');
pointer-events: none;
display: flex;
justify-content: center;
@ -287,20 +124,21 @@ const getMyPrizeRecored = () => {
.prize_title {
width: 267px;
height: 58px;
@include bg_pos("../assets/img/pop/my_prize.png");
@include bg_pos('../assets/img/pop/my_prize.png');
}
}
.prize_middle {
width: 550px;
height: 190px;
@include bg_pos("../assets/img/pop/prize_box_middle.png");
@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_item {
width: 463px;
height: 67px;
@ -329,6 +167,7 @@ const getMyPrizeRecored = () => {
font-size: 24px;
margin-top: 5px;
}
}
.buttom {
@ -341,71 +180,34 @@ const getMyPrizeRecored = () => {
height: 100%;
}
}
}
}
.prize_bottom {
width: 550px;
height: 50px;
@include bg_pos("../assets/img/pop/prize_box_bottom.png");
@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");
@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>

View File

@ -1,71 +1,49 @@
<template>
<div class="zz" @touchmove.prevent></div>
<div class="rulesCon">
<div class="rulesCon" @touchmove.prevent>
<div class="rules_container">
<div class="rule_t">
<div class="rule_text">
<img src="../assets/img/rule_text.png" alt="" srcset="">
</div>
</div>
<div class="rule_t"></div>
<div class="rule_cls_btn" @click="hidePop"></div>
</div>
</div>
</template>
<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 axios from "axios";
import { Toast } from "vant";
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();
const store = useStore()
//
onBeforeMount(() => {});
onBeforeMount(() => { })
//
onMounted(() => {
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_cls_btn", {
duration: 0.3,
y: 20,
autoAlpha: 0,
delay: 0.5,
});
});
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_cls_btn', { duration: 0.3, y: 20, autoAlpha: 0, delay: 0.5 })
})
const hidePop = () => {
emit("RulesPop");
};
emit('RulesPop')
}
</script>
<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 {
width: 100%;
height: 100%;
@ -89,30 +67,16 @@ const hidePop = () => {
.rule_t {
@include box(629px, 762px);
@include bg_pos("../assets/img/pop/rule_pop.png");
// pointer-events: none;
position: relative;
.rule_text{
@include pos(563px, 630px, 30px, 95px);
overflow: hidden;
overflow-y: scroll;
// @include bg_pos("../assets/img/rule_text.png");
img{
width: 100%;
height: 2874px;
}
}
@include bg_pos('../assets/img/pop/rule_pop.png');
pointer-events: none;
}
.rule_cls_btn {
@include box(72px, 72px);
@include bg_pos("../assets/img/pop/cls_btn.png");
@include bg_pos('../assets/img/pop/cls_btn.png');
margin-top: 50px;
}
}
}
</style>

View File

@ -1,269 +1,48 @@
<template>
<div class="serviceCon" @touchmove.prevent>
<div class="service_container">
<!-- 未添加 -->
<div class="service_box" v-if="isadd == 0">
<div class="service_box">
<div class="eqcode_box">
<img :src="store.state.userAccount.eqcodeImg" alt="" />
<img :src="store.state.userAccount.eqcodeImg" alt="">
</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 class="getMoneyCon">
<div class="getMoney_container">
<div class="is_added">
<div class="go_index_btn" @click="hidePop"></div>
</div>
</div>
</div>
</template>
<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 axios from "axios";
import { Toast, Dialog } from "vant";
import axios from 'axios'
import { Toast } from 'vant';
import { useStore } from "vuex";
import service from "@/api/httpServe";
import qs from "qs";
//
const emit = defineEmits(["ServicePop"]); //
const props = defineProps({ sendMessage: Object }); // props
const store = useStore();
const store = useStore()
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 eqcode = ref(require('../assets/img/pop/eqcode.png'))
const noPrize = ref(false); //
const noFirstAdd = ref(false);
//
const updateStaus = () => {
getIsAddService();
};
const isLost = ref(false);
//
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;
}
});
onBeforeMount(() => { })
//
onMounted(() => {
gsap.from(".serviceCon", { duration: 0.3, autoAlpha: 0 });
gsap.from(".service_box,.has_service_box,.is_got_box", {
duration: 0.3,
scale: 0.2,
autoAlpha: 0,
delay: 0.1,
});
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_cls_btn', { duration: 0.3, y: 20, autoAlpha: 0, delay: 0.5 })
})
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 = () => {
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();
emit('ServicePop')
}
if (data.data == 0) {
Toast("您还未添加企微,请扫码添加");
}
});
};
</script>
<style lang="scss" scoped>
@ -280,6 +59,7 @@ const getIsAddService = () => {
align-items: center;
background-color: rgba(0, 0, 0, 0.7);
.service_container {
width: 750px;
height: 1180px;
@ -288,43 +68,14 @@ const getIsAddService = () => {
align-items: center;
flex-direction: column;
.is_got_box {
@include box(530px, 594px);
@include bg_pos("../assets/img/pop/has_service_pop.png");
}
.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;
@include bg_pos('../assets/img/pop/service_box.png');
pointer-events: none;
position: relative;
.eqcode_box {
width: 210px;
height: 210px;
@ -334,63 +85,17 @@ const getIsAddService = () => {
img {
width: 100%;
height: 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");
@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>

View File

@ -1,79 +1,4 @@
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'),
];

View File

@ -1,305 +1,112 @@
<template>
<div class="homePage">
<!-- 首页 -->
<Index @indexPage="indexPage" v-if="showIndex" />
<!-- 加载页 -->
<Loading v-if="!showIndex" />
<!-- 首页 -->
<Index @indexPage="indexPage" />
</div>
</template>
<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 axios from "axios";
import { Toast, Dialog } from "vant";
import axios from 'axios'
import { Toast, Dialog } from 'vant';
import { useStore } from "vuex";
// import { get_authorize, get_jssdk } from '@/api/authorize-api'
import service from "@/api/httpServe";
import qs from "qs";
import h5plugin from "@/utils/plugin";
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";
import service from "@/api/httpServe"
import qs from 'qs'
import h5plugin from '@/utils/plugin'
import Index from "@/components/Index"
//
const emit = defineEmits(["indexPage"]); //
const props = defineProps({ sendMessage: Object }); // props
const store = useStore(); //vuex
const store = useStore() //vuex
const { proxy } = getCurrentInstance(); //plugin
//
const authData = ref("");
const authCode = ref("");
const showIndex = ref(false);
const authData = ref('')
const authCode = ref('')
//
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(() => {
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.getQueryString("code")) {
console.log('code:', h5plugin.getQueryString('code'));
if (h5plugin.getQueryString('code')) {
// codeopenid
authCode.value = h5plugin.getQueryString("code");
getOpenId(authCode.value);
authCode.value = h5plugin.getQueryString('code')
getOpenId(authCode.value)
} 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(() => {
fontAdpat();
// stopBack()
});
//
const indexPage = (actions) => {
console.log("来自index组件", actions);
};
}
// code
const getCode = () => {
let redirect_uri = window.location.href;
service.post(process.env.VUE_APP_API + '/zsApi/xfhdAuthorize', qs.stringify({
redirect_uri: redirect_uri
service
.post(process.env.VUE_APP_API + "/cms-activity/cms88/zsApi/xfhdAuthorize", {
redirect_uri: redirect_uri,
})).then((res) => {
let code = res.data.data
authCode.value = res.data.data
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
const getOpenId = (code) => {
service
.post(
process.env.VUE_APP_API + "/cms-activity/cms88/zsApi/oauthInfo",
// qs.stringify({
// code: code
// })
{
code: code,
}
)
.then((res) => {
service.post(process.env.VUE_APP_API + '/zsApi/oauthInfo', qs.stringify({
code: code
})).then((res) => {
if (res.data.code == 0) {
console.log("后端返回的openid", res.data);
// openid
store.commit({ type: "updateXGLOpenid", openid: res.data.data });
apiAll();
store.commit({ type: 'updateXGLOpenid', openid: res.data.data })
console.log("用户活动信息2", store.state.userAccount);
}
});
};
//
const imgPreloader = (url) => {
return new Promise((resolve, reject) => {
let image = new Image();
image.src = url;
image.onload = () => {
resolve();
};
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>
<style lang="scss" scoped>
@ -312,6 +119,7 @@ const goBackEvent = () => {
user-select: none;
}
div {
color: #fff;
}
@ -325,6 +133,6 @@ div {
position: absolute;
top: 0;
left: 0;
background: #ffd195;
background: rgb(255, 255, 255);
}
</style>

View File

@ -3,8 +3,7 @@ import { createRouter, createWebHashHistory } from 'vue-router';
const router = createRouter({
history: createWebHashHistory(),
routes: [
{ path: '/', component: () => import('@/views/Home/Home.vue') },
{ path: '/login', component: () => import('@/views/Home/Login.vue') }
{ path: '/', component: () => import('@/views/Home.vue') }
]
});

View File

@ -1,30 +1,21 @@
import { createStore } from 'vuex';
import h5plugin from "@/utils/plugin.js"
export default createStore({
// 数据源
state: {
userAccount: {
// xglOpenId: 'o9B_fvjtyh2KELQYc2t9A3MEh7JQ', //用户openid
xglOpenId: '', //用户openid
// xglOpenId: h5plugin.getQueryString('openid'), //用户openid
token: h5plugin.getQueryString('token'), //用户token
cardId: h5plugin.getQueryString('cardId'), //carid
xglOpenid: 'openid12138', //用户openid
token: '13f88993882b4dc0832351566c11a1eb', //用户token
cardId: '94207', //carid
nkh: '', //牛卡号
isDraw: false, //是否抽过奖
isHasAccount: false, //是否存在牛卡号
isAddCustomer: 0, //活动期间内是否添加过服务人员
isAddCustomerBefore:0, //活动前是否存在服务人员
isAddCustomer: false, //是否添加过服务人员
isHasPrize: [], //是否存在奖品
participantNum: 0, //活动参与人数
prizeResult: 0, //中奖金额
eqcodeImg: '', //二维码
isBirthMon: 1, //生日是否处于当月
prizeList: [], //奖品列表
uuid: h5plugin.getQueryString('uuid'), //carid
participantNum: 1213821, //活动参与人数
prizeResult: 73.11, //中奖金额
eqcodeImg: '' //二维码
},
},
@ -35,7 +26,7 @@ export default createStore({
mutations: {
// 更新信广龙openid
updateXGLOpenid(state, val) {
state.userAccount.xglOpenId = val.openid
state.userAccount.xglOpenid = val.openid
},
// 更新token
@ -43,46 +34,22 @@ export default createStore({
state.userAccount.token = val.token
},
// 更新牛卡号
updateeNkh(state,val){
state.userAccount.nkh = val.nkh
},
// 更新cardId
updateCardId(state,val){
state.userAccount.cardId = val.cardId
},
// 更新二维码
updateNkh(state,val){
state.userAccount.nkh = val.nkh
},
updateeEqcodeImg(state,val){
state.userAccount.eqcodeImg = val.eqcodeImg
},
// 更新活动参与人数
updateParticipantNum(state,val){
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
}
},
// 改变方法:异步
actions: {},

File diff suppressed because one or more lines are too long