diff --git a/.env.development b/.env.development index 508568c..381159f 100644 --- a/.env.development +++ b/.env.development @@ -3,4 +3,6 @@ TARO_APP_API = 'https://game.wanzhuanyongcheng.cn/dice' -TARO_APP_WS = 'wss://game.wanzhuanyongcheng.cn/dice/home?uid=' +TARO_APP_WS = 'wss://game.wanzhuanyongcheng.cn/dice/home' + +TARO_APP_HOME= 'https://test.wanzhuanyongcheng.cn/app/game' diff --git a/.env.production b/.env.production index cc21fee..1c3e68b 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,7 @@ # TARO_APP_ID="生产环境下的小程序appid" TARO_APP_API = 'https://www.jdt168.com/dice' -TARO_APP_WS = 'wss://www.jdt168.com/dice/home?uid=' +TARO_APP_WS = 'wss://www.jdt168.com/dice/home' + + +TARO_APP_HOME= 'https://www.wanzhuanyongcheng.cn/app/game' diff --git a/.env.test b/.env.test index 0c9484a..9191f29 100644 --- a/.env.test +++ b/.env.test @@ -2,4 +2,7 @@ TARO_APP_API = 'https://game.wanzhuanyongcheng.cn/dice' -TARO_APP_WS = 'wss://game.wanzhuanyongcheng.cn/dice/home?uid=' +TARO_APP_WS = 'wss://game.wanzhuanyongcheng.cn/dice/home' + + +TARO_APP_HOME= 'https://test.wanzhuanyongcheng.cn/app/game' diff --git a/src/config/index.ts b/src/config/index.ts index 489ab27..e878d51 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -3,5 +3,8 @@ import Taro from "@tarojs/taro"; export const app = { API_URL: () => `${process.env.TARO_APP_API}`, - API_WS: () => `${process.env.TARO_APP_WS}${Taro.getStorageSync("uid")}`, + API_WS: () => + `${process.env.TARO_APP_WS}?uid=${Taro.getStorageSync("uid")}&gema_id=${ + Taro.getStorageSync("gameItem").ID + }`, }; diff --git a/src/pages/game_detail/index.scss b/src/pages/game_detail/index.scss index 87d5994..c6530ea 100644 --- a/src/pages/game_detail/index.scss +++ b/src/pages/game_detail/index.scss @@ -1,3 +1,7 @@ +page { + font-size: 10px; +} + .index { position: relative; width: 100%; diff --git a/src/pages/game_detail/index.vue b/src/pages/game_detail/index.vue index 19faf4e..d64e0ba 100644 --- a/src/pages/game_detail/index.vue +++ b/src/pages/game_detail/index.vue @@ -7,30 +7,8 @@ - 游戏介绍 - - 用户需要购买平台促销商品获得游戏豆; - 竞猜游戏消耗游戏豆; - 游戏积分作为竞猜奖品; - 竞猜限制: 用户进行竞猜,大小两格限制20000/格,其它限制5000/格; - 活动时间: 我们将在活动页面提示活动时间; - - 骰子竞猜规则 - - 竞猜方式: - 参与者需要在规定时间内,提交自己的竞猜范围,参与者需要预测两个骰子相加的点数或大、小范围,请确保你的预测在正确范围内; - 结算方式: - 我们将根据所有参与者的猜测结果进行统计和比对,找出与实际骰子点数相同的预测,实时开奖,发送奖励; - 奖励机制: - 奖励将根据活动参与人竞猜游戏豆数额做结算,将以游戏积分方式发放给猜中相同开奖点数的的幸运者; - + 开始游戏 @@ -41,6 +19,12 @@ import { ref } from "vue"; import Taro from "@tarojs/taro"; import "./index.scss"; +const info = ref({}); + +Taro.useLoad(() => { + info.value = Taro.getStorageSync("gameItem"); +}); + const list = ref([ "https://files.wanzhuanyongcheng.com/file/img/yaotouzi/banner/qietu.png", ]); diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ff42017..52958b8 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -3,8 +3,8 @@ 游戏大厅 - - + + @@ -22,6 +22,7 @@ Taro.useLoad((options) => { title: `登陆成功`, icon: "none", }); + getList(); } else { Taro.showToast({ title: "登陆失败,请重新进入游戏大厅", @@ -30,16 +31,23 @@ Taro.useLoad((options) => { } }); -const list = ref([ - { - id: 1, - name: "摇骰子", - }, -]); +const list = ref([]); -const toPage = (id: number) => { +const getList = async () => { + Taro.request({ + url: process.env.TARO_APP_HOME, + method: "POST", + success: ({ data: res }) => { + console.log(res); + list.value = res.data.data || []; + }, + }); +}; + +const toPage = (item: any) => { + Taro.setStorageSync("gameItem", item); Taro.navigateTo({ - url: `/pages/game_detail/index?id=${id}`, + url: `/pages/game_detail/index?id=${item.ID}`, }); }; diff --git a/src/pages/yaotouzi/index/index.vue b/src/pages/yaotouzi/index/index.vue index ebca3e2..7f64c3c 100644 --- a/src/pages/yaotouzi/index/index.vue +++ b/src/pages/yaotouzi/index/index.vue @@ -284,11 +284,11 @@ const numColor = (num: string) => { }; Taro.useDidShow(() => { - console.log("useDidShow"); startMusic( "https://files.wanzhuanyongcheng.com/file/music/yaotouzi/bg.MP3", true ); + initWs(); initData(); });