授权整合

This commit is contained in:
tcubic 2022-08-02 18:21:13 +08:00
parent a436e20577
commit 207c1f4d94
4 changed files with 36 additions and 21 deletions

View File

@ -27,6 +27,8 @@
<div class="cloud_right_2"></div> <div class="cloud_right_2"></div>
<!-- 大转盘 --> <!-- 大转盘 -->
<div class="zhuanpan"></div> <div class="zhuanpan"></div>
<LuckyWheel v-if="true" />
<div class="icon_right_2"></div> <div class="icon_right_2"></div>
<div class="icon_right_3"></div> <div class="icon_right_3"></div>
<div class="cloud_left_3"></div> <div class="cloud_left_3"></div>
@ -76,7 +78,7 @@
<!-- 添加专属服务人员企微弹窗 --> <!-- 添加专属服务人员企微弹窗 -->
<ServiceList v-if="showServicePop" @ServicePop="hideServicePop" /> <ServiceList v-if="showServicePop" @ServicePop="hideServicePop" />
<LuckyWheel v-if="false" /> <!-- <LuckyWheel v-if="true" /> -->
</div> </div>
</template> </template>
@ -120,6 +122,8 @@ const showRulesPop = ref(false);
const showMyPrize = ref(false); const showMyPrize = ref(false);
const showServicePop = ref(false); const showServicePop = ref(false);
const isDraw = ref(false)
// //
const activityList = reactive([ const activityList = reactive([
{ {
@ -192,7 +196,11 @@ const btn = () => {
const drawBtn = () => { const drawBtn = () => {
console.log("抽奖:"); console.log("抽奖:");
getluckyBag(1);
if(!isDraw.value){
getluckyBag(1);
isDraw.value = true
}
}; };

View File

@ -159,16 +159,16 @@ const btn = () => {
// 4 - 8.88 // 4 - 8.88
// 5 - // 5 -
// id, fasle // id, fasle
showDrawAni(1, true); showDrawAni(2, true);
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.LuckyWheelCon { .LuckyWheelCon {
width: 100%; width: 100%;
height: 100%; height: 800px;
position: fixed; position: top;
z-index: 10; // z-index: 10;
top: 0; top: 0;
left: 0; left: 0;
// right: 0; // right: 0;
@ -176,7 +176,8 @@ const btn = () => {
// 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);
pointer-events: none;
.LuckyWheel_container { .LuckyWheel_container {
position: absolute; position: absolute;

View File

@ -37,6 +37,12 @@ const authCode = ref('')
onBeforeMount(() => { onBeforeMount(() => {
console.log("link",window.location.href); console.log("link",window.location.href);
// URLtoken
// store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
// store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
// store.commit({ type: "updateNkh", nkh: h5plugin.getQueryString('nkh') });
console.log("用户活动信息:", store.state.userAccount);
// //
if (h5plugin.isWX()) { if (h5plugin.isWX()) {
console.log('code:', h5plugin.getQueryString('code')); console.log('code:', h5plugin.getQueryString('code'));
@ -51,12 +57,8 @@ onBeforeMount(() => {
} }
// 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);
}); });
@ -98,8 +100,10 @@ const getOpenId = (code) => {
console.log("后端返回的openid", res.data); console.log("后端返回的openid", res.data);
// openid // openid
store.commit({ type: 'updateXGLOpenid', openid: res.data.data }) store.commit({ type: 'updateXGLOpenid', openid: res.data.data })
console.log("用户活动信息2", store.state.userAccount); 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);
} }

View File

@ -1,20 +1,22 @@
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: '', //用户openid
token: '13f88993882b4dc0832351566c11a1eb', //用户token token: h5plugin.getQueryString('token'), //用户token
cardId: '94207', //carid cardId: h5plugin.getQueryString('cardId'), //carid
nkh: '', //牛卡号 nkh: h5plugin.getQueryString('nkh'), //牛卡号
isDraw: false, //是否抽过奖 isDraw: false, //是否抽过奖
isHasAccount: false, //是否存在牛卡号 isHasAccount: false, //是否存在牛卡号
isAddCustomer: false, //是否添加过服务人员 isAddCustomer: false, //是否添加过服务人员
isHasPrize: [], //是否存在奖品 isHasPrize: [], //是否存在奖品
participantNum: 1213821, //活动参与人数 participantNum: 0, //活动参与人数
prizeResult: 73.11, //中奖金额 prizeResult: 0, //中奖金额
eqcodeImg: '' //二维码 eqcodeImg: '' //二维码
}, },