Merge branch 'master' of https://git.szxgl.cn/liangzejun/zszq-celebration-88
融合你的代码提交 # Conflicts: # src/components/Index.vue
This commit is contained in:
commit
cda4a491da
@ -13,12 +13,19 @@ const service = axios.create({
|
|||||||
baseURL: process.env.VUE_APP_API,
|
baseURL: process.env.VUE_APP_API,
|
||||||
// responseType: 'json',
|
// responseType: 'json',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
// 'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
'token': store.state.userAccount.token
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
'i-token': store.state.userAccount.token,
|
||||||
|
|
||||||
},
|
},
|
||||||
|
params: {
|
||||||
|
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 添加请求拦截器
|
// 添加请求拦截器
|
||||||
service.interceptors.request.use(function (config) {
|
service.interceptors.request.use(function (config) {
|
||||||
// 在发送请求之前做些什么
|
// 在发送请求之前做些什么
|
||||||
|
|||||||
@ -16,21 +16,17 @@
|
|||||||
<span class="icon"
|
<span class="icon"
|
||||||
><img src="../assets/img/laba.png" alt="" srcset=""
|
><img src="../assets/img/laba.png" alt="" srcset=""
|
||||||
/></span>
|
/></span>
|
||||||
<span class="num">活动已有{{ participantNum }}人参与</span>
|
<span class="num"
|
||||||
|
>活动已有{{
|
||||||
|
store.state.userAccount.participantNum
|
||||||
|
}}人参与</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="cloud_left_2"></div>
|
<div class="cloud_left_2"></div>
|
||||||
<div class="icon_left_2"></div>
|
<div class="icon_left_2"></div>
|
||||||
<div class="cloud_right_2"></div>
|
<div class="cloud_right_2"></div>
|
||||||
<!-- 大转盘 -->
|
<!-- 大转盘 -->
|
||||||
<div class="zhuanpan">
|
<div class="zhuanpan"></div>
|
||||||
<!-- <div class="liwu">
|
|
||||||
<div>1.99</div>
|
|
||||||
<div>2.99</div>
|
|
||||||
<div>3.99</div>
|
|
||||||
<div>4.99</div>
|
|
||||||
<div>5.99</div>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
|
||||||
<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>
|
||||||
@ -80,7 +76,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>
|
||||||
|
|
||||||
@ -159,7 +155,14 @@ const activityList = reactive([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// 页面挂载前
|
// 页面挂载前
|
||||||
onBeforeMount(() => {});
|
onBeforeMount(() => {
|
||||||
|
// 获取企微二维码
|
||||||
|
gerCardId(94207);
|
||||||
|
getInfo();
|
||||||
|
getMyPrizeRecored();
|
||||||
|
getBrithday();
|
||||||
|
getActivityNum();
|
||||||
|
});
|
||||||
|
|
||||||
// 页面挂载后
|
// 页面挂载后
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
@ -187,25 +190,8 @@ const btn = () => {
|
|||||||
|
|
||||||
// 抽奖按钮
|
// 抽奖按钮
|
||||||
const drawBtn = () => {
|
const drawBtn = () => {
|
||||||
console.log("抽奖22:");
|
console.log("抽奖:");
|
||||||
|
getluckyBag(1);
|
||||||
service
|
|
||||||
.get(
|
|
||||||
process.env.VUE_APP_API + "/cms88/card/qrcode/",
|
|
||||||
(cardId = store.state.userAccount.cardId)
|
|
||||||
)
|
|
||||||
.then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
|
|
||||||
// console.log("授权:",getAuthorize(1));
|
|
||||||
// if (h5plugin.getQueryString("forceauth")) {
|
|
||||||
// console.log("yes-forceauth");
|
|
||||||
// getAuthorize(0);
|
|
||||||
// } else {
|
|
||||||
// console.log("no-forceauth");
|
|
||||||
// getAuthorize(1);
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 活动点击
|
// 活动点击
|
||||||
@ -246,6 +232,94 @@ const getAuthorize = (scopeState) => {
|
|||||||
// return `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${out_href}&scope=${1}"`;
|
// return `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${out_href}&scope=${1}"`;
|
||||||
window.location.href = `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${out_href}&scope=${scopeState}`;
|
window.location.href = `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${out_href}&scope=${scopeState}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询员工企业微信二维码
|
||||||
|
const gerCardId = (carid) => {
|
||||||
|
service
|
||||||
|
.get(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/card/qrcode/" + carid
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log("企微二维码:", res.data.data);
|
||||||
|
store.commit({
|
||||||
|
type: "updateeEqcodeImg",
|
||||||
|
eqcodeImg: res.data.data,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取绑定的资金账号
|
||||||
|
const getInfo = () => {
|
||||||
|
service
|
||||||
|
.post(process.env.VUE_APP_API + "/cms-activity/cms88/nkh/info", {})
|
||||||
|
.then((res) => {
|
||||||
|
console.log("资金账号:", res);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 我的红包记录
|
||||||
|
const getMyPrizeRecored = () => {
|
||||||
|
service
|
||||||
|
.post(process.env.VUE_APP_API + "/cms-activity/cms88/prize/list", {})
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询是否添加了企微: isInActivityDate 0否 1是
|
||||||
|
const getIsAddService = () => {
|
||||||
|
let isInActivityDate = 0;
|
||||||
|
service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API +
|
||||||
|
"/cms-activity/cms88/qywx/isadded/" +
|
||||||
|
isInActivityDate
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 抽取红包 type为红包类型 1为参与红包 2为加企微
|
||||||
|
const getluckyBag = (id) => {
|
||||||
|
let type = id;
|
||||||
|
service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API +
|
||||||
|
"/cms-activity/cms88/redpacket/draw/" +
|
||||||
|
type,
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 活动参与人数
|
||||||
|
const getActivityNum = () => {
|
||||||
|
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 = () => {
|
||||||
|
service
|
||||||
|
.post(
|
||||||
|
process.env.VUE_APP_API + "/cms-activity/cms88/user/isin/birthday",
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -3,8 +3,7 @@
|
|||||||
<div class="service_container">
|
<div class="service_container">
|
||||||
<div class="service_box">
|
<div class="service_box">
|
||||||
<div class="eqcode_box">
|
<div class="eqcode_box">
|
||||||
<img :src="eqcode" alt="">
|
<img :src="store.state.userAccount.eqcodeImg" alt="">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="service_cls_btn" @click="hidePop"></div>
|
<div class="service_cls_btn" @click="hidePop"></div>
|
||||||
|
|||||||
@ -38,34 +38,30 @@ onBeforeMount(() => {
|
|||||||
console.log("link:",window.location.href);
|
console.log("link:",window.location.href);
|
||||||
|
|
||||||
// 微信环境授权
|
// 微信环境授权
|
||||||
// if (h5plugin.isWX()) {
|
if (h5plugin.isWX()) {
|
||||||
// console.log('code:', h5plugin.getQueryString('code'));
|
console.log('code:', h5plugin.getQueryString('code'));
|
||||||
|
|
||||||
|
if (h5plugin.getQueryString('code')) {
|
||||||
|
// 存在code的话去换取openid
|
||||||
|
authCode.value = h5plugin.getQueryString('code')
|
||||||
|
getOpenId(authCode.value)
|
||||||
|
} else {
|
||||||
|
getCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if (h5plugin.getQueryString('code')) {
|
|
||||||
// // 存在code的话去换取openid
|
|
||||||
// authCode.value = h5plugin.getQueryString('code')
|
|
||||||
// getOpenId(authCode.value)
|
|
||||||
// } else {
|
|
||||||
// getCode()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// let token = h5plugin.getQueryString('token')
|
// let token = h5plugin.getQueryString('token')
|
||||||
// 更新openid
|
// 更新openid
|
||||||
store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
|
store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
|
||||||
store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
|
store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
|
||||||
store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') });
|
store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') });
|
||||||
|
|
||||||
|
|
||||||
console.log("用户活动信息:", store.state.userAccount);
|
console.log("用户活动信息:", store.state.userAccount);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 页面挂载
|
// 页面挂载
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
|
|||||||
@ -6,8 +6,8 @@ export default createStore({
|
|||||||
state: {
|
state: {
|
||||||
userAccount: {
|
userAccount: {
|
||||||
xglOpenid: 'openid12138', //用户openid
|
xglOpenid: 'openid12138', //用户openid
|
||||||
token: 'token12138', //用户token
|
token: '13f88993882b4dc0832351566c11a1eb', //用户token
|
||||||
cardId: '', //carid
|
cardId: '94207', //carid
|
||||||
nkh: '', //牛卡号
|
nkh: '', //牛卡号
|
||||||
isDraw: false, //是否抽过奖
|
isDraw: false, //是否抽过奖
|
||||||
isHasAccount: false, //是否存在牛卡号
|
isHasAccount: false, //是否存在牛卡号
|
||||||
@ -15,6 +15,7 @@ export default createStore({
|
|||||||
isHasPrize: [], //是否存在奖品
|
isHasPrize: [], //是否存在奖品
|
||||||
participantNum: 1213821, //活动参与人数
|
participantNum: 1213821, //活动参与人数
|
||||||
prizeResult: 73.11, //中奖金额
|
prizeResult: 73.11, //中奖金额
|
||||||
|
eqcodeImg: '' //二维码
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -41,6 +42,14 @@ export default createStore({
|
|||||||
state.userAccount.nkh = val.nkh
|
state.userAccount.nkh = val.nkh
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateeEqcodeImg(state,val){
|
||||||
|
state.userAccount.eqcodeImg = val.eqcodeImg
|
||||||
|
},
|
||||||
|
|
||||||
|
updateParticipantNum(state,val){
|
||||||
|
state.userAccount.participantNum = val.participantNum
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
// 改变方法:异步
|
// 改变方法:异步
|
||||||
actions: {},
|
actions: {},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user