From a348a792594f67c078d43d9633e41d060e0d4416 Mon Sep 17 00:00:00 2001 From: dengtongyu Date: Tue, 11 Apr 2023 08:37:53 +0800 Subject: [PATCH] feat:update --- public/index.html | 9 ++ src/assets/images/hh_btn.png | Bin 7027 -> 5277 bytes src/assets/images/hh_btn_g.png | Bin 8245 -> 6764 bytes src/assets/images/wheel/button_bg.png | Bin 0 -> 8259 bytes src/assets/images/wheel/lucky_wheel_bg.png | Bin 0 -> 161596 bytes src/assets/images/wheel/wheel_bg.png | Bin 0 -> 156652 bytes src/assets/images/xy_btn.png | Bin 9848 -> 7670 bytes src/assets/images/xy_btn_g.png | Bin 6188 -> 5064 bytes src/components/ballContent/notice.vue | 4 +- src/components/boboLottery/main.vue | 1 + src/components/dataList/main.vue | 4 +- src/components/luckyGridView/main.vue | 1 + src/components/rankPane/main.vue | 4 +- src/components/recordList/main.vue | 4 +- src/components/recordList/wheelRecord.vue | 154 +++++++++++++++++++++ src/components/swiperNotice/main.vue | 4 +- src/components/wheelEnterBtn/index.js | 7 + src/components/wheelEnterBtn/main.vue | 44 ++++++ src/components/wheelEnterView/index.js | 7 + src/components/wheelEnterView/main.vue | 53 +++++++ src/lib/tool.js | 21 ++- src/router/index.js | 16 ++- src/store/index.js | 28 ++-- src/styles/cover.less | 4 +- src/views/prizesView.vue | 4 +- src/views/ruleView.vue | 4 +- src/views/wheel.vue | 115 +++++++++++++++ 27 files changed, 453 insertions(+), 35 deletions(-) create mode 100644 src/assets/images/wheel/button_bg.png create mode 100644 src/assets/images/wheel/lucky_wheel_bg.png create mode 100644 src/assets/images/wheel/wheel_bg.png create mode 100644 src/components/recordList/wheelRecord.vue create mode 100644 src/components/wheelEnterBtn/index.js create mode 100644 src/components/wheelEnterBtn/main.vue create mode 100644 src/components/wheelEnterView/index.js create mode 100644 src/components/wheelEnterView/main.vue create mode 100644 src/views/wheel.vue diff --git a/public/index.html b/public/index.html index 8b36450..ee7440b 100644 --- a/public/index.html +++ b/public/index.html @@ -7,6 +7,7 @@ <%= htmlWebpackPlugin.options.title %> diff --git a/src/components/swiperNotice/main.vue b/src/components/swiperNotice/main.vue index dc33d5b..0d78195 100644 --- a/src/components/swiperNotice/main.vue +++ b/src/components/swiperNotice/main.vue @@ -72,11 +72,11 @@ export default { getQueryPrizeMsg() { queryPrizeMsg({ actId: this.actId, drawType: this.drawType }).then( res => { - const { code, data, msg } = res; + const { code, data, message } = res; if (code === 200) { this.recordList = data; } else { - this.$toast.fail(msg); + this.$toast.fail(message); } } ); diff --git a/src/components/wheelEnterBtn/index.js b/src/components/wheelEnterBtn/index.js new file mode 100644 index 0000000..4e13ee0 --- /dev/null +++ b/src/components/wheelEnterBtn/index.js @@ -0,0 +1,7 @@ +import BoboEnterBtn from "./main"; + +BoboEnterBtn.install = function(Vue) { + Vue.component(BoboEnterBtn.name, BoboEnterBtn); +}; + +export default BoboEnterBtn; diff --git a/src/components/wheelEnterBtn/main.vue b/src/components/wheelEnterBtn/main.vue new file mode 100644 index 0000000..9a9e99f --- /dev/null +++ b/src/components/wheelEnterBtn/main.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/wheelEnterView/index.js b/src/components/wheelEnterView/index.js new file mode 100644 index 0000000..9d78391 --- /dev/null +++ b/src/components/wheelEnterView/index.js @@ -0,0 +1,7 @@ +import BoboEnterView from "./main"; + +BoboEnterView.install = function(Vue) { + Vue.component(BoboEnterView.name, BoboEnterView); +}; + +export default BoboEnterView; diff --git a/src/components/wheelEnterView/main.vue b/src/components/wheelEnterView/main.vue new file mode 100644 index 0000000..fed2f16 --- /dev/null +++ b/src/components/wheelEnterView/main.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/src/lib/tool.js b/src/lib/tool.js index 2382595..2d43202 100644 --- a/src/lib/tool.js +++ b/src/lib/tool.js @@ -25,8 +25,8 @@ const checkVersion = function() { webApp: u.indexOf("Safari") > -1, // 是否web应该程序,没有头部与底部 weixin: u.indexOf("MicroMessenger") > -1, // 是否微信 qq: u.match(/\sQQ/i) === " qq", // 是否QQ - tutuApp: u.match("tutuApp"), - app: u.match("tutuApp") // 是否在app内 + tutuApp: u.match("toupaiApp"), + app: u.match("toupaiApp") // 是否在app内 }; }; @@ -212,11 +212,18 @@ const getMsgFromDevice = function() { info.ticket = tools.nativeUtils.getTicket(); info.appVersion = tools.nativeUtils.getAppVersion(); } else { - info.roomUid = 904860; - info.uid = 1000002; - info.deviceId = "afhksafhksajhfs1kjahsfkjsf0000aaaaaaaacaa"; - info.ticket = - "eyJhbGciOiJIUzI1NiJ9.eyJ0aWNrZXRfdHlwZSI6bnVsbCwidWlkIjo5MTMzOSwidGlja2V0X2lkIjoiOGJmMTdlYmQtMTY4ZC00NTliLWI0NzUtMDU3M2Y1ZmM4MDQzIiwiZXhwIjozNjAwLCJjbGllbnRfaWQiOiJlcmJhbi1jbGllbnQifQ.MnKGEc6bSkyOkCbx26lib6J0koFDA2uiKnbwkhdk3MU"; + const params = getQueryString(); + if ( + params.debug === true || + params.debug === "true" || + location.hostname === "localhost" + ) { + info.roomUid = 904860; + info.uid = 1000002; + info.deviceId = "afhksafhksajhfs1kjahsfkjsf0000aaaaaaaacaa"; + info.ticket = + "eyJhbGciOiJIUzI1NiJ9.eyJ0aWNrZXRfdHlwZSI6bnVsbCwidWlkIjo5MTMzOSwidGlja2V0X2lkIjoiOGJmMTdlYmQtMTY4ZC00NTliLWI0NzUtMDU3M2Y1ZmM4MDQzIiwiZXhwIjozNjAwLCJjbGllbnRfaWQiOiJlcmJhbi1jbGllbnQifQ.MnKGEc6bSkyOkCbx26lib6J0koFDA2uiKnbwkhdk3MU"; + } } return info; }; diff --git a/src/router/index.js b/src/router/index.js index c8b0456..30bf6dd 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,12 +8,18 @@ const routes = [ path: "/", name: "Home", component: () => import(/* webpackChunkName: "Home" */ "../views/Home.vue") - }, - { - path: "/bobo", - name: "Bobo", - component: () => import(/* webpackChunkName: "Bobo" */ "../views/bobo.vue") } + // { + // path: "/bobo", + // name: "Bobo", + // component: () => import(/* webpackChunkName: "Bobo" */ "../views/bobo.vue") + // }, + // { + // path: "/wheel", + // name: "Wheel", + // component: () => + // import(/* webpackChunkName: "Wheel" */ "../views/wheel.vue") + // } ]; const router = new VueRouter({ diff --git a/src/store/index.js b/src/store/index.js index fbed57c..31bdd64 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -205,13 +205,13 @@ export default new Vuex.Store({ actId: locateObj.actId }) .then(res => { - const { code, data, msg } = res; + const { code, data, message } = res; if (code === 200) { const list = data[drawTypes]; commit("SetDrawTypePrizeInfo", { drawType: drawTypes, list }); resolve(list); } else { - Toast.fail(msg); + Toast.fail(message); reject(res); } }) @@ -224,7 +224,7 @@ export default new Vuex.Store({ getqueryTicketRule({ commit }, drawType) { queryTicketRule({ drawType: drawType, actId: locateObj.actId }) .then(res => { - const { code, data, msg } = res; + const { code, data, message } = res; if (code === 200) { const { timesRule } = data; if (!timesRule) return; @@ -236,7 +236,7 @@ export default new Vuex.Store({ } commit("SetTicketRule", json || null); } else { - Toast.fail(msg); + Toast.fail(message); } }) .catch(() => { @@ -244,6 +244,18 @@ export default new Vuex.Store({ }); }, runLottery({ state, commit }) { + if (!locateObj.actId) { + Toast.fail("获取活动信息失败!"); + return; + } + if (!info.roomUid) { + Toast.fail("获取房间信息失败!"); + return; + } + if (!info.deviceId) { + Toast.fail("获取设备id失败!"); + return; + } return new Promise((resolve, reject) => { doLottery({ actId: locateObj.actId, @@ -254,13 +266,13 @@ export default new Vuex.Store({ deviceId: info.deviceId }) .then(res => { - const { code, data, msg } = res; + const { code, data, message } = res; if (code === 200) { commit("SetRemainTicketNum", data.remainTicketNum || 0); commit("SetLotteryData", data); // dispatch("postSaveLog", option); } else { - Toast.fail(msg); + Toast.fail(message); } resolve(res); }) @@ -282,12 +294,12 @@ export default new Vuex.Store({ getQueryTicketNum({ commit }) { queryTicketNum({ deviceId: info.deviceId, actId: locateObj.actId }) .then(res => { - const { code, data, msg } = res; + const { code, data, message } = res; if (code === 200) { commit("SetRemainTicketNum", data.num || 0); commit("SetGoldNum", data.goldNum || 0); } else { - Toast.fail(msg); + Toast.fail(message); } }) .catch(() => { diff --git a/src/styles/cover.less b/src/styles/cover.less index 35cc1cf..7bd9b19 100644 --- a/src/styles/cover.less +++ b/src/styles/cover.less @@ -5,4 +5,6 @@ @empty-description-color: #AFAAFF; -@list-text-color: #AFAAFF; \ No newline at end of file +@list-text-color: #AFAAFF; + +// @button-plain-background-color: rgba(0, 0, 0, 0); \ No newline at end of file diff --git a/src/views/prizesView.vue b/src/views/prizesView.vue index 894a56e..e8cf59d 100644 --- a/src/views/prizesView.vue +++ b/src/views/prizesView.vue @@ -3,7 +3,7 @@
@@ -12,7 +12,7 @@
diff --git a/src/views/ruleView.vue b/src/views/ruleView.vue index 6983523..e32fff4 100644 --- a/src/views/ruleView.vue +++ b/src/views/ruleView.vue @@ -37,11 +37,11 @@ export default { ruleTip() { getRulePic({ drawType: this.drawType, actId: this.actId }) .then(res => { - const { code, data, msg } = res; + const { code, data, message } = res; if (code === 200) { this.ruleContent = data; } else { - this.$toast.fail(msg); + this.$toast.fail(message); } }) .catch(() => { diff --git a/src/views/wheel.vue b/src/views/wheel.vue new file mode 100644 index 0000000..c240871 --- /dev/null +++ b/src/views/wheel.vue @@ -0,0 +1,115 @@ + + + + +