From 7a282837e81d63b0c4b372328a3063638c55d22b Mon Sep 17 00:00:00 2001
From: tcubic <123456>
Date: Wed, 3 Aug 2022 19:32:29 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=B7=B3=E8=BD=AC?=
=?UTF-8?q?=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Index.vue | 83 +++++++++++++++++++------------------
src/utils/wx-jssdk.1.6.0.js | 1 +
2 files changed, 43 insertions(+), 41 deletions(-)
create mode 100644 src/utils/wx-jssdk.1.6.0.js
diff --git a/src/components/Index.vue b/src/components/Index.vue
index 1a59798..c908f56 100644
--- a/src/components/Index.vue
+++ b/src/components/Index.vue
@@ -33,7 +33,11 @@
-
+
@@ -77,7 +81,6 @@
-
@@ -100,6 +103,7 @@ 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";
@@ -125,7 +129,7 @@ const showServicePop = ref(false);
const drawType = ref(1);
const isDraw = ref(false);
const LuckyWheelCon = ref(null);
-const showDrawCon = ref(false) //抽奖结果弹窗组件
+const showDrawCon = ref(false); //抽奖结果弹窗组件
// 活动列表
const activityList = reactive([
@@ -169,8 +173,8 @@ const activityList = reactive([
// 页面挂载前
onBeforeMount(() => {
- if( store.state.userAccount.isHasPrize.length != 0 ){
- isDraw.value = true
+ if (store.state.userAccount.isHasPrize.length != 0) {
+ isDraw.value = true;
}
});
@@ -235,8 +239,6 @@ onMounted(() => {
// 抽奖按钮
const drawBtn = () => {
-
-
if (!isDraw.value) {
// LuckyWheelCon.value.showDrawAni(3, true)
@@ -255,19 +257,24 @@ const activityBtn = (item) => {
if (item.id == 2) {
console.log("新客专享页面");
- let url='/subs/financial/pages/index/index'
+ // let url = "/subs/financial/pages/index/index";
+ // console.log(wx);
- wx.miniProgram.navigateTo({url})
+ wx.miniProgram.reLaunch({
+ url: "/subs/financial/pages/index/index",
+ });
}
if (item.id == 3) {
console.log("生日专享页面");
- window.location.href='https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_8rrkjpiS'
+ window.location.href =
+ "https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_8rrkjpiS";
}
if (item.id == 4) {
console.log("牛牛杯");
- window.location.href='https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_uD5KUL2d'
+ window.location.href =
+ "https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_uD5KUL2d";
}
if (item.id == 5) {
@@ -275,10 +282,11 @@ const activityBtn = (item) => {
// window.location.href='https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_8rrkjpiS'
}
-
if (item.id == 6) {
console.log("财富日报");
- window.location.href='/subs/wealthpaper/wealthpaper'
+ wx.miniProgram.reLaunch({
+ url: "/subs/wealthpaper/wealthpaper",
+ });
}
};
@@ -301,10 +309,9 @@ const myPrizePop = () => {
};
// 关闭抽奖弹窗
-const drawConFn = ()=>{
- showDrawCon.value = false
-}
-
+const drawConFn = () => {
+ showDrawCon.value = false;
+};
// 企微弹窗
const hideServicePop = () => {
@@ -378,7 +385,7 @@ const getluckyBag = (id) => {
.then((res) => {
console.log("抽取红包结果:", res);
- let prizeNum = res.data.data.amount
+ let prizeNum = res.data.data.amount;
// 判断抽奖类型drawType = 1时转动大转盘
if (drawType.value == 1) {
@@ -406,17 +413,14 @@ const getluckyBag = (id) => {
// 6.66元
LuckyWheelCon.value.showDrawAni(4, true);
}
-
-
} else {
if (res.data.data == 0) {
// 谢谢参与
LuckyWheelCon.value.showDrawAni(5, true);
}
}
- }else{
+ } else {
// 加企业微信奖
-
}
});
};
@@ -447,27 +451,25 @@ const getBrithday = () => {
});
};
-
-const deleteNum = ref(0)
+const deleteNum = ref(0);
// 清数据接口
const deleteData = (type) => {
- 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
- });
+ 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;
+ });
}
-
-
};
-