three version

This commit is contained in:
2025-12-04 11:00:36 +08:00
parent 4d267d4eba
commit 88b7a7f2c0
12 changed files with 105 additions and 48 deletions

View File

@@ -48,6 +48,27 @@
{
"navigationBarTitleText" : "最终结算"
}
},
{
"path" : "pages/multiplayer/multiplayer",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/mul-compute/mul-compute",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/mul-over/mul-over",
"style" :
{
"navigationBarTitleText" : ""
}
}
],
"globalStyle": {

View File

@@ -10,7 +10,7 @@
</view>
</view>
<view class="function-list">
<view class="function-item">
<view class="function-item" @click="gotoNewPage1">
<view class="function-icon">
<image src="https://t14.baidu.com/it/u=3165460156,649373630&fm=224&app=112&f=JPEG?w=500&h=500"></image>
</view>
@@ -62,10 +62,7 @@
</view>
</view>
</view>
<view class="">
{{roomData}}
</view>
<!-- -->
</view>
</view>
</template>
@@ -110,35 +107,6 @@ const gotoNewPage = async () => {
bossId: roomData.value.userId,
roomName: `${roomData.value.nickName}的房间`,
});
//再次发送get请求拿到当前roomId
// const response1 = await GET('/system/room/list',{
// roomStatus: 1,
// });
// const dataArray1 = response1.data;
// console.log('new的房间号为', dataArray1[0].roomId);
// console.log("再次发送get请求",response1)
// var roomId1 = dataArray1[0].roomId;
// const userData = {
// nickName: "孤心", // 使用 trim() 处理后的名称
// avatars: "https://img1.baidu.com/it/u=3612220943,2414740890&fm=253&app=138&f=JPEG?w=526&h=500",
// openId: generateTenDigitRandom().toString(),
// };
// const userResponse = await POST('/system/score/user/add', userData);
// POST("/system/score/room/user",{
// roomId: roomId1,
// userId: roomData.value.userId,
// totalScore: "0",
// playerType: "user",
// nickName: "孤心",
// avatars: "https://q3.itc.cn/q_70/images03/20250110/1e71eecf56b34344bcae6a5b85c0bec2.jpeg",
// });
}
} else {
console.error('接口请求失败:', response.msg);
@@ -152,6 +120,41 @@ const gotoNewPage = async () => {
})
}
const gotoNewPage1 = async () => {
//判断有无历史房间记录
const response = await GET('/system/room/createUser/'+ roomData.value.userId);
//检查是否请求成功
if (response.code = 200) {
//检查数组是否有对象
const dataArray = response.data;
if (dataArray && dataArray.length > 0) {
console.log(`查询到 ${dataArray.length} 条房间记录`);
} else {
// 数据条数为0执行B方法
console.log('未查询到房间记录,新建个人房间');
//创建新房间
POST('/system/room', {
createUser: roomData.value.userId,
odds: 1,
roomStatus: 1,
bossId: roomData.value.userId,
roomName: `${roomData.value.nickName}的房间`,
});
}
} else {
console.error('接口请求失败:', response.msg);
uni.showToast({
title: '查询失败',
icon: 'none'
});
}
wx.navigateTo({
url: '/pages/multiplayer/multiplayer'
})
}
</script>
<style lang="less" scoped>

View File

@@ -385,7 +385,7 @@ const overmultiple = ()=>{
isPopupVisible2.value = false;
wx.redirectTo({
wx.reLaunch({
url: `/pages/over/over?multiple=${encodedMultiple}`
})
}

View File

@@ -1 +1 @@
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n</style>\n","import App from './App'\nimport { getToken,checkLoginStatus } from '@/api/login.js';\nimport StaticValue from '@/utils/StaticValue.js'\n\n// #ifndef VUE3\nimport Vue from 'vue'\nimport './uni.promisify.adaptor'\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n ...App\n})\napp.$mount()\n// #endif\n\n// #ifdef VUE3\nimport { createSSRApp } from 'vue'\nexport function createApp() {\n const app = createSSRApp(App)\n app.config.globalProperties.$StaticValue = StaticValue; // 挂载全局变量\n return {\n app\n }\n}\n// #endif\ncheckLoginStatus();\ngetToken();"],"names":["uni","createSSRApp","App","StaticValue","checkLoginStatus","getToken"],"mappings":";;;;;;;;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACMM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,MAAI,OAAO,iBAAiB,eAAeC,kBAAAA;AAC3C,SAAO;AAAA,IACL;AAAA,EACD;AACH;AAEAC,UAAAA;AACAC,UAAQ,SAAA;;;"}
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n</style>\n","import App from './App'\nimport { getToken,checkLoginStatus } from '@/api/login.js';\nimport StaticValue from '@/utils/StaticValue.js'\n\n// #ifndef VUE3\nimport Vue from 'vue'\nimport './uni.promisify.adaptor'\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n ...App\n})\napp.$mount()\n// #endif\n\n// #ifdef VUE3\nimport { createSSRApp } from 'vue'\nexport function createApp() {\n const app = createSSRApp(App)\n app.config.globalProperties.$StaticValue = StaticValue; // 挂载全局变量\n return {\n app\n }\n}\n// #endif\ncheckLoginStatus();\ngetToken();"],"names":["uni","createSSRApp","App","StaticValue","checkLoginStatus","getToken"],"mappings":";;;;;;;;;;;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACMM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,MAAI,OAAO,iBAAiB,eAAeC,kBAAAA;AAC3C,SAAO;AAAA,IACL;AAAA,EACD;AACH;AAEAC,UAAAA;AACAC,UAAQ,SAAA;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,9 @@ if (!Math) {
"./pages/user-detail/user-detail.js";
"./pages/compute/compute.js";
"./pages/over/over.js";
"./pages/multiplayer/multiplayer.js";
"./pages/mul-compute/mul-compute.js";
"./pages/mul-over/mul-over.js";
}
const _sfc_main = {
onLaunch: function() {

View File

@@ -6,7 +6,10 @@
"pages/single/single",
"pages/user-detail/user-detail",
"pages/compute/compute",
"pages/over/over"
"pages/over/over",
"pages/multiplayer/multiplayer",
"pages/mul-compute/mul-compute",
"pages/mul-over/mul-over"
],
"window": {
"navigationBarTextStyle": "black",

View File

@@ -7055,7 +7055,7 @@ function isConsoleWritable() {
function initRuntimeSocketService() {
const hosts = "172.19.45.41,127.0.0.1";
const port = "8090";
const id = "mp-weixin_a0hLXb";
const id = "mp-weixin_0nwKG2";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();

View File

@@ -19,16 +19,16 @@ const _sfc_main = {
common_vendor.onMounted(() => {
const getUserInfo = utils_StaticValue.StaticValue.getUserInfo;
roomData.value = getUserInfo();
common_vendor.index.__f__("log", "at pages/index/index.vue:88", "roomData:", roomData.value.userId);
common_vendor.index.__f__("log", "at pages/index/index.vue:85", "roomData:", roomData.value.userId);
});
const gotoNewPage = async () => {
const response = await utils_request.GET("/system/room/createUser/" + roomData.value.userId);
if (response.code = 200) {
const dataArray = response.data;
if (dataArray && dataArray.length > 0) {
common_vendor.index.__f__("log", "at pages/index/index.vue:100", `查询到 ${dataArray.length} 条房间记录`);
common_vendor.index.__f__("log", "at pages/index/index.vue:97", `查询到 ${dataArray.length} 条房间记录`);
} else {
common_vendor.index.__f__("log", "at pages/index/index.vue:104", "未查询到房间记录,新建个人房间");
common_vendor.index.__f__("log", "at pages/index/index.vue:101", "未查询到房间记录,新建个人房间");
utils_request.POST("/system/room", {
createUser: roomData.value.userId,
odds: 1,
@@ -38,7 +38,7 @@ const _sfc_main = {
});
}
} else {
common_vendor.index.__f__("error", "at pages/index/index.vue:144", "接口请求失败:", response.msg);
common_vendor.index.__f__("error", "at pages/index/index.vue:112", "接口请求失败:", response.msg);
common_vendor.index.showToast({
title: "查询失败",
icon: "none"
@@ -48,14 +48,41 @@ const _sfc_main = {
url: "/pages/single/single"
});
};
const gotoNewPage1 = async () => {
const response = await utils_request.GET("/system/room/createUser/" + roomData.value.userId);
if (response.code = 200) {
const dataArray = response.data;
if (dataArray && dataArray.length > 0) {
common_vendor.index.__f__("log", "at pages/index/index.vue:131", `查询到 ${dataArray.length} 条房间记录`);
} else {
common_vendor.index.__f__("log", "at pages/index/index.vue:135", "未查询到房间记录,新建个人房间");
utils_request.POST("/system/room", {
createUser: roomData.value.userId,
odds: 1,
roomStatus: 1,
bossId: roomData.value.userId,
roomName: `${roomData.value.nickName}的房间`
});
}
} else {
common_vendor.index.__f__("error", "at pages/index/index.vue:146", "接口请求失败:", response.msg);
common_vendor.index.showToast({
title: "查询失败",
icon: "none"
});
}
common_vendor.wx$1.navigateTo({
url: "/pages/multiplayer/multiplayer"
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.p({
type: "sound",
size: "20"
}),
b: common_vendor.o(gotoNewPage),
c: common_vendor.t(roomData.value)
b: common_vendor.o(gotoNewPage1),
c: common_vendor.o(gotoNewPage)
};
};
}

View File

@@ -1 +1 @@
<view class="index data-v-1cf27b2a"><view class="notice data-v-1cf27b2a"><view class="icon data-v-1cf27b2a"><uni-icons wx:if="{{a}}" class="data-v-1cf27b2a" u-i="1cf27b2a-0" bind:__l="__l" u-p="{{a}}"></uni-icons></view><view class="text data-v-1cf27b2a"> 您还有未结束的对局, <text class="underline data-v-1cf27b2a">点击前往</text></view></view><view class="function-list data-v-1cf27b2a"><view class="function-item data-v-1cf27b2a"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://t14.baidu.com/it/u=3165460156,649373630&fm=224&app=112&f=JPEG?w=500&h=500"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 多人模式 </view><view class="function-desc data-v-1cf27b2a"> 所有玩家自己计分 </view></view></view><view class="function-item data-v-1cf27b2a" bindtap="{{b}}"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://pic.rmb.bdstatic.com/bjh/down/1742bc3845cbbcf0c78c01eb59bb1c1a.jpeg"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 单人模式 </view><view class="function-desc data-v-1cf27b2a"> 房主给所有玩家计分 </view></view></view><view class="function-item data-v-1cf27b2a"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://pic.rmb.bdstatic.com/bjh/down/1742bc3845cbbcf0c78c01eb59bb1c1a.jpeg"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 手动进入房间 </view><view class="function-desc data-v-1cf27b2a"> 输入房间id进入房间 </view></view></view><view class="function-item data-v-1cf27b2a"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://pic.rmb.bdstatic.com/bjh/down/1742bc3845cbbcf0c78c01eb59bb1c1a.jpeg"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 扫码加入房间 </view><view class="function-desc data-v-1cf27b2a"> 扫码房间二维码加入房间 </view></view></view><view class=" data-v-1cf27b2a">{{c}}</view></view></view>
<view class="index data-v-1cf27b2a"><view class="notice data-v-1cf27b2a"><view class="icon data-v-1cf27b2a"><uni-icons wx:if="{{a}}" class="data-v-1cf27b2a" u-i="1cf27b2a-0" bind:__l="__l" u-p="{{a}}"></uni-icons></view><view class="text data-v-1cf27b2a"> 您还有未结束的对局, <text class="underline data-v-1cf27b2a">点击前往</text></view></view><view class="function-list data-v-1cf27b2a"><view class="function-item data-v-1cf27b2a" bindtap="{{b}}"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://t14.baidu.com/it/u=3165460156,649373630&fm=224&app=112&f=JPEG?w=500&h=500"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 多人模式 </view><view class="function-desc data-v-1cf27b2a"> 所有玩家自己计分 </view></view></view><view class="function-item data-v-1cf27b2a" bindtap="{{c}}"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://pic.rmb.bdstatic.com/bjh/down/1742bc3845cbbcf0c78c01eb59bb1c1a.jpeg"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 单人模式 </view><view class="function-desc data-v-1cf27b2a"> 房主给所有玩家计分 </view></view></view><view class="function-item data-v-1cf27b2a"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://pic.rmb.bdstatic.com/bjh/down/1742bc3845cbbcf0c78c01eb59bb1c1a.jpeg"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 手动进入房间 </view><view class="function-desc data-v-1cf27b2a"> 输入房间id进入房间 </view></view></view><view class="function-item data-v-1cf27b2a"><view class="function-icon data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="https://pic.rmb.bdstatic.com/bjh/down/1742bc3845cbbcf0c78c01eb59bb1c1a.jpeg"></image></view><view class="function-introduce data-v-1cf27b2a"><view class="function-name data-v-1cf27b2a"> 扫码加入房间 </view><view class="function-desc data-v-1cf27b2a"> 扫码房间二维码加入房间 </view></view></view></view></view>

View File

@@ -184,7 +184,7 @@ const _sfc_main = {
common_vendor.index.__f__("log", "at pages/single/single.vue:381", "输入的倍率为:", oddvalue.value);
const encodedMultiple = encodeURIComponent(JSON.stringify(oddvalue.value));
isPopupVisible2.value = false;
common_vendor.wx$1.redirectTo({
common_vendor.wx$1.reLaunch({
url: `/pages/over/over?multiple=${encodedMultiple}`
});
};