From e3483b4b4dd957045a2de1edc918e6fe5e408d6f Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Fri, 5 Jan 2024 15:09:02 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=87=B3=20/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4d7d085 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,28 @@ +kind: pipeline +type: docker +name: ci + +steps: + - name: install & build + image: node + commands: + - npm config set registry http://mirrors.cloud.tencent.com/npm/ + - npm i -g pnpm + - pnpm i + - pnpm build + - tar -zcvf dist.tar ./dist ./default.conf ./Dockerfile + + - name: upload + image: appleboy/drone-scp + settings: + host: + from_secret: host + username: + from_secret: username + password: + from_secret: password + port: 22 + command_timeout: 2m + target: /www/builder + source: + - ./dist.tar From 29debbe141de86a92bc5ca72d1f148b2437b59db Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Fri, 5 Jan 2024 15:28:09 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.drone.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 4d7d085..0ef1f62 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,7 +6,7 @@ steps: - name: install & build image: node commands: - - npm config set registry http://mirrors.cloud.tencent.com/npm/ + - npm config set registry https://registry.npmmirror.com/ - npm i -g pnpm - pnpm i - pnpm build From 4be08a702fde062bcf336eaa2356c193a945a720 Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Fri, 5 Jan 2024 15:33:42 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.drone.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 0ef1f62..307c862 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,4 +25,4 @@ steps: command_timeout: 2m target: /www/builder source: - - ./dist.tar + - dist.tar From 324453fc8b15a52a068d6f6c2956631ca3fe6ae8 Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Fri, 5 Jan 2024 16:04:19 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.drone.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 307c862..0ef1f62 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,4 +25,4 @@ steps: command_timeout: 2m target: /www/builder source: - - dist.tar + - ./dist.tar From 62b87484a9cc3be7c5133527d91518b7e3dac011 Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Fri, 5 Jan 2024 16:05:50 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=20.drone.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 0ef1f62..0000000 --- a/.drone.yml +++ /dev/null @@ -1,28 +0,0 @@ -kind: pipeline -type: docker -name: ci - -steps: - - name: install & build - image: node - commands: - - npm config set registry https://registry.npmmirror.com/ - - npm i -g pnpm - - pnpm i - - pnpm build - - tar -zcvf dist.tar ./dist ./default.conf ./Dockerfile - - - name: upload - image: appleboy/drone-scp - settings: - host: - from_secret: host - username: - from_secret: username - password: - from_secret: password - port: 22 - command_timeout: 2m - target: /www/builder - source: - - ./dist.tar From 62b3b9e9a4add4ff0f3d8173aecc66e259e1d2c6 Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Thu, 25 Jan 2024 22:45:30 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat(custom):=20=E6=96=B0=E5=A2=9E=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 48 +++-- .../sidebar/components/SideMenu.vue | 50 ++--- src/views/business/mer_list/api.js | 2 + src/views/business/mer_list/index.vue | 116 +++++++++++ src/views/game/api.js | 20 +- src/views/game/balloon/data/index.vue | 150 +++++++++++++- src/views/game/balloon/statistics/index.vue | 4 +- src/views/game/balloon/zs/index.vue | 189 ++++++++++++++++++ 8 files changed, 519 insertions(+), 60 deletions(-) create mode 100644 src/views/game/balloon/zs/index.vue diff --git a/.env.development b/.env.development index 569fa74..38c86b7 100644 --- a/.env.development +++ b/.env.development @@ -1,22 +1,26 @@ -# 资源公共路径,需要以 /开头和结尾 -VITE_PUBLIC_PATH='/' - -# 是否启用MOCK -VITE_USE_MOCK=false - -# 是否启用代理 -VITE_USE_PROXY=true - -# base api -VITE_BASE_API='https://test.wanzhuanyongcheng.cn/admin' - -VITE_WS1_URL='game.wanzhuanyongcheng.cn/dice/home' - -VITE_WS_URL='test.wanzhuanyongcheng.cn/admin/data' - -VITE_MER_LOGIN_URL='//localhost:3100/login' - -VITE_GAME_API='https://www.jdt168.com' - -# 是否启用监控 -VITE_SENTRY=false +# 资源公共路径,需要以 /开头和结尾 +VITE_PUBLIC_PATH='/' + +# 是否启用MOCK +VITE_USE_MOCK=false + +# 是否启用代理 +VITE_USE_PROXY=true + +# base api +VITE_BASE_API='https://test.wanzhuanyongcheng.cn/admin' + +VITE_WS1_URL='game.wanzhuanyongcheng.cn/dice/home' + +VITE_WS_URL='test.wanzhuanyongcheng.cn/admin/data' + +VITE_MER_LOGIN_URL='//localhost:3100/login' + +VITE_GAME_API='https://www.jdt168.com' + +# 转盘相关 +VITE_TRUN_WS_URL='test.wanzhuanyongcheng.cn/admin/turntable' +VITE_TRUN_WS1_URL='game2.wanzhuanyongcheng.cn/turntable/home' + +# 是否启用监控 +VITE_SENTRY=false diff --git a/src/layout/components/sidebar/components/SideMenu.vue b/src/layout/components/sidebar/components/SideMenu.vue index a7d9d0e..cf54a9e 100644 --- a/src/layout/components/sidebar/components/SideMenu.vue +++ b/src/layout/components/sidebar/components/SideMenu.vue @@ -58,32 +58,32 @@ function getMenuItem(route, basePath = '') { if (!visibleChildren.length) return menuItem - if (visibleChildren.length === 1) { - // 单个子路由处理 - const singleRoute = visibleChildren[0] - menuItem = { - ...menuItem, - label: singleRoute.meta?.title || singleRoute.name, - key: singleRoute.name, - path: resolvePath(menuItem.path, singleRoute.path), - icon: getIcon(singleRoute.meta), - } - const visibleItems = singleRoute.children - ? singleRoute.children.filter((item) => item.name && !item.isHidden) - : [] + // if (visibleChildren.length === 1) { + // // 单个子路由处理 + // const singleRoute = visibleChildren[0] + // menuItem = { + // ...menuItem, + // label: singleRoute.meta?.title || singleRoute.name, + // key: singleRoute.name, + // path: resolvePath(menuItem.path, singleRoute.path), + // icon: getIcon(singleRoute.meta), + // } + // const visibleItems = singleRoute.children + // ? singleRoute.children.filter((item) => item.name && !item.isHidden) + // : [] - if (visibleItems.length === 1) { - menuItem = getMenuItem(visibleItems[0], menuItem.path) - } else if (visibleItems.length > 1) { - menuItem.children = visibleItems - .map((item) => getMenuItem(item, menuItem.path)) - .sort((a, b) => a.order - b.order) - } - } else { - menuItem.children = visibleChildren - .map((item) => getMenuItem(item, menuItem.path)) - .sort((a, b) => a.order - b.order) - } + // if (visibleItems.length === 1) { + // menuItem = getMenuItem(visibleItems[0], menuItem.path) + // } else if (visibleItems.length > 1) { + // menuItem.children = visibleItems + // .map((item) => getMenuItem(item, menuItem.path)) + // .sort((a, b) => a.order - b.order) + // } + // } else { + menuItem.children = visibleChildren + .map((item) => getMenuItem(item, menuItem.path)) + .sort((a, b) => a.order - b.order) + // } return menuItem } diff --git a/src/views/business/mer_list/api.js b/src/views/business/mer_list/api.js index e68cff8..c2afdb3 100644 --- a/src/views/business/mer_list/api.js +++ b/src/views/business/mer_list/api.js @@ -6,4 +6,6 @@ export default { getMerType: () => request.post('/store/getOther'), // 一键登录 login: (data) => request.post('/store/easy/login', data), + // 退积分 + outJf: (data) => request.post('/store/set/integral', data), } diff --git a/src/views/business/mer_list/index.vue b/src/views/business/mer_list/index.vue index 2e460f4..543efac 100644 --- a/src/views/business/mer_list/index.vue +++ b/src/views/business/mer_list/index.vue @@ -153,6 +153,39 @@ + + + + + + + + + + + + + + 提交 + + 取消 + + + + + @@ -165,12 +198,67 @@ const vPerms = resolveDirective('perms') const isEdit = computed(() => drawerTitle.value === '编辑商户') +const showModalJf = ref(false) + +const formRefJf = ref(null) + +const model = ref({ + name: '', + bid: null, + number: null, +}) + +const rulesJf = ref({ + number: { + required: true, + type: 'number', + message: '请输入退积分', + trigger: 'blur', + }, +}) + +const handleOutClick = (e) => { + e.preventDefault() + formRefJf.value?.validate(async (errors) => { + if (!errors) { + try { + await api.outJf({ + bid: model.value.bid, + number: model.value.number, + }) + $message.success('成功') + handleClearOutClick() + await getMertype() + await getList() + showModalJf.value = false + } catch (error) { + $message.error(error.msg) + } + } else { + $message.error('Invalid') + } + }) +} + +const handleClearOutClick = () => { + formRefJf.value?.restoreValidation() + model.value = { + number: null, + } + showModalJf.value = false +} + const columns = ref([ { title: '商户名称', align: 'center', key: 'name', }, + { + title: '电话', + align: 'center', + key: 'phone', + }, { title: '状态', align: 'center', @@ -179,6 +267,16 @@ const columns = ref([ return h('span', row.status === 1 ? '正常' : '禁用') }, }, + { + title: '积分', + align: 'center', + key: 'integral', + }, + { + title: '创建时间', + align: 'center', + key: 'add_time', + }, { title: '操作', align: 'center', @@ -202,6 +300,24 @@ const columns = ref([ ), [[vPerms, ['/admin/store/edit']]] ), + withDirectives( + h( + NButton, + { + class: 'ml-10', + type: 'primary', + text: true, + size: 'small', + onClick: () => { + model.value.name = row.name + model.value.bid = row.bid + showModalJf.value = true + }, + }, + () => '退积分' + ), + [[vPerms, ['/admin/store/set/integral']]] + ), withDirectives( h( NButton, diff --git a/src/views/game/api.js b/src/views/game/api.js index 6106309..9ebd69a 100644 --- a/src/views/game/api.js +++ b/src/views/game/api.js @@ -27,17 +27,23 @@ export default { // 全部投注用户 allUser: () => request.post('/all/draw/user', {}), - // 吹气球相关 + // 转盘相关 // 游戏状态 - getisBalloonStart: () => request.post('/getisBalloonStart'), + getisBalloonStart: () => request.post('/getisTurntableStart'), // 修改游戏状态 - setisBalloonStart: (data) => request.post('/isBalloonStart', data), + setisBalloonStart: (data) => request.post('/isTurntableStart', data), + // 你猜 + setZsNum: () => request.post('/setTurntable'), // 全部开奖记录 - getBalloonList: () => request.post('/balloon/draw'), + getBalloonList: () => request.post('/turntable/draw'), // 本局投注记录 - getBalloonUser: () => request.post('/now/balloon/draw/user'), + getBalloonUser: () => request.post('/now/turntable/draw/user'), // 全部投注记录 - getAllBalloonUser: () => request.post('/all/balloon/draw/user'), + getAllBalloonUser: () => request.post('/all/turntable/draw/user'), // 统计全部投注和中奖列表 - getUserList: () => request.post('/user/balloon/list'), + getTjList: () => request.post('/user/turntable/list'), + // 宙斯记录 + getZsBalloon: (data) => request.post('/turntable/log', data), + // 宙斯中奖 + getZsBalloonUser: (data) => request.post('/log/turntable/list', data), } diff --git a/src/views/game/balloon/data/index.vue b/src/views/game/balloon/data/index.vue index 52139e8..65298c5 100644 --- a/src/views/game/balloon/data/index.vue +++ b/src/views/game/balloon/data/index.vue @@ -7,7 +7,7 @@ v-model:value="gameStatus" :checked-value="1" :unchecked-value="2" - @update:value="handleUpdateValue" + @update:value="handleUpdateValue1" />
@@ -19,6 +19,69 @@ 预览
+
+
+ 预开期数: + {{ list[0]?.Periods || 0 }} +
+
+ 剩余开奖时间: + {{ time || 0 }} +
+
+ 本局总下注: + {{ totalA || 0 }} +
+
+ +
+
+ 第 + {{ data[0]?.Periods || 0 }} + 期开奖结果: + {{ data[0]?.Name || 0 }} +
+
+ +
+ +

+ {{ item.count }} +

+
+
+
+
+
+ +
+ +

+ {{ item.Total }} +

+ + + 一切都将一去杳然,任何人都无法将其捕获。 + +
+
+
+
+
+
+
import api from '../../api' +import { getToken } from '@/utils' + +const ws = new WebSocket(`wss://${import.meta.env.VITE_TRUN_WS_URL}`) + +const ws1 = new WebSocket(`wss://${import.meta.env.VITE_TRUN_WS1_URL}`) const gameStatus = ref(2) +const t_1 = ref() +const t_2 = ref() + +const show = ref(true) +const show1 = ref(true) + +const list = ref([]) +const list1 = ref([]) +const totalA = ref(0) + +const time = ref(0) + +const data = ref([]) + +onBeforeUnmount(() => { + clearInterval(t_1.value) + clearInterval(t_2.value) +}) + +ws.onopen = () => { + t_1.value = setInterval(() => { + ws.send('ping') + }, 2500) +} + +ws1.onopen = () => { + t_2.value = setInterval(() => { + ws1.send('ping') + }, 2500) +} + +ws.onmessage = (e) => { + const res = JSON.parse(e.data) + list.value = res.betting.sort((a, b) => b.Total - a.Total) + show.value = false + list1.value = res.list.sort((a, b) => b.Total - a.Total) + show1.value = false + totalA.value = res.total +} + +ws1.onmessage = (e) => { + const res = JSON.parse(e.data) + switch (res.code) { + case 200: + // let num = res.data + time.value = res.data + break + case 301: + $message.error(res.msg) + break + } +} + onMounted(() => { get_status() + get_kj_jl() }) +const get_kj_jl = async () => { + try { + const res = await api.getBalloonList() + data.value = res.data.data + } catch (error) { + $message.error(error.msg) + throw error + } +} + const get_status = async () => { const res = await api.getisBalloonStart() - gameStatus.value = res.data.balloonStart + gameStatus.value = res.data.diceStart } const handleUpdateValue = async (e) => { + const res = await api.setDS({ + status: 1, + id: e, + user_id: getToken(), + Periods: list.value[0]?.Periods, + }) + $message.success(res.msg) +} + +const handleUpdateValue1 = async (e) => { await api.setisBalloonStart({ - Start: e, + start: e, }) $message.success('修改成功') get_status() @@ -144,7 +286,7 @@ const { value: tempCol } = ref([ sortOrder: false, }, { - title: '购买秒数', + title: '购买选项', key: 'DrawTime', align: 'center', }, diff --git a/src/views/game/balloon/statistics/index.vue b/src/views/game/balloon/statistics/index.vue index 23f79f0..bc4ca26 100644 --- a/src/views/game/balloon/statistics/index.vue +++ b/src/views/game/balloon/statistics/index.vue @@ -127,7 +127,7 @@ const columns = ref([ align: 'center', }, { - title: '开奖秒数', + title: '开奖号码', key: 'Name', align: 'center', }, @@ -167,7 +167,7 @@ const getList = async () => { dataObj.StartTime = range.value[0] dataObj.EndTime = range.value[1] } - const res = await api.getUserList(dataObj) + const res = await api.getTjList(dataObj) const newData = res.data.data || [] data.value = newData option.value.xAxis.data = [] diff --git a/src/views/game/balloon/zs/index.vue b/src/views/game/balloon/zs/index.vue new file mode 100644 index 0000000..46c6499 --- /dev/null +++ b/src/views/game/balloon/zs/index.vue @@ -0,0 +1,189 @@ + + + + + From 84a2881757b4db868a5640a12abcbfc2f429d445 Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Thu, 25 Jan 2024 23:01:38 +0800 Subject: [PATCH 7/7] =?UTF-8?q?mod(custom):=20=E5=A2=9E=E5=8A=A0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.env.test b/.env.test index 9197f2b..ea977af 100644 --- a/.env.test +++ b/.env.test @@ -24,5 +24,9 @@ VITE_GAME_API='https://game.wanzhuanyongcheng.cn' VITE_MER_LOGIN_URL='//jdt-test-mer.wanzhuanyongcheng.cn/login' +# 转盘相关 +VITE_TRUN_WS_URL='test.wanzhuanyongcheng.cn/admin/turntable' +VITE_TRUN_WS1_URL='game2.wanzhuanyongcheng.cn/turntable/home' + # 是否启用监控 VITE_SENTRY=false