one version
This commit is contained in:
1
scoring/unpackage/dist/dev/mp-weixin/app.js
vendored
1
scoring/unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -10,6 +10,7 @@ if (!Math) {
|
||||
"./pages/single/single.js";
|
||||
"./pages/user-detail/user-detail.js";
|
||||
"./pages/compute/compute.js";
|
||||
"./pages/over/over.js";
|
||||
}
|
||||
const _sfc_main = {
|
||||
onLaunch: function() {
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"pages/my/my",
|
||||
"pages/single/single",
|
||||
"pages/user-detail/user-detail",
|
||||
"pages/compute/compute"
|
||||
"pages/compute/compute",
|
||||
"pages/over/over"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
||||
@@ -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_hNfmC4";
|
||||
const id = "mp-weixin_a0hLXb";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const utils_request = require("../../utils/request.js");
|
||||
const _sfc_main = {
|
||||
__name: "compute",
|
||||
setup(__props) {
|
||||
const players1 = common_vendor.ref([]);
|
||||
const round1 = common_vendor.ref();
|
||||
common_vendor.ref([]);
|
||||
const setResult = (index, result) => {
|
||||
players1.value[index].result = result;
|
||||
if (players1.value[index].score) {
|
||||
@@ -45,7 +45,6 @@ const _sfc_main = {
|
||||
try {
|
||||
const rawData = JSON.parse(decodeURIComponent(options.players));
|
||||
round1.value = JSON.parse(decodeURIComponent(options.round));
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:110", "round:", round1.value);
|
||||
players1.value = rawData.map((player) => ({
|
||||
...player,
|
||||
result: "win",
|
||||
@@ -53,7 +52,7 @@ const _sfc_main = {
|
||||
gameTime: round1.value
|
||||
}));
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/compute/compute.vue:125", "解析失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/compute/compute.vue:126", "解析失败:", error);
|
||||
players1.value = [];
|
||||
}
|
||||
});
|
||||
@@ -61,9 +60,47 @@ const _sfc_main = {
|
||||
const updataScore = players1.value.map((updata) => ({
|
||||
roomId: updata.roomId,
|
||||
userId: updata.userId,
|
||||
score: updata.score
|
||||
totalScore: updata.score
|
||||
}));
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:138", "输入框的值:", updataScore);
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:139", "总分修改接口:", updataScore);
|
||||
const detailDatas = players1.value.map((detaildata) => ({
|
||||
roomId: detaildata.roomId,
|
||||
userId: detaildata.userId,
|
||||
detailScore: detaildata.score,
|
||||
gameTime: round1.value
|
||||
}));
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:148", "细分新增接口:", detailDatas);
|
||||
if (validateScore1(detailDatas)) {
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:151", "发送网络请求");
|
||||
try {
|
||||
utils_request.PUT("/system/score/room/user", updataScore);
|
||||
utils_request.POST("/system/detail", detailDatas);
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:155", "用户计分成功");
|
||||
common_vendor.wx$1.navigateTo({
|
||||
url: "/pages/single/single"
|
||||
});
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/compute/compute.vue:161", "用户计分失败:", error);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:165", "请求中止");
|
||||
}
|
||||
};
|
||||
const isScoreInvaild1 = (score) => {
|
||||
return score === null || score === void 0 || score === "";
|
||||
};
|
||||
const validateScore1 = (arrayData) => {
|
||||
const invalidItems = arrayData.filter((item) => isScoreInvaild1(item.detailScore));
|
||||
if (invalidItems.length > 0) {
|
||||
common_vendor.index.__f__("log", "at pages/compute/compute.vue:180", "发现有未计分玩家:", invalidItems);
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: `发现 ${invalidItems.length} 个未计分玩家,请检查!`,
|
||||
showCancel: false
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const usersData = common_vendor.ref([
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarTitleText": "计分页面",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -25,9 +25,9 @@ const _sfc_main = {
|
||||
if (response.code = 200) {
|
||||
const dataArray = response.data;
|
||||
if (dataArray && dataArray.length > 0) {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:96", `查询到 ${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:100", "未查询到房间记录,新建个人房间");
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:101", "未查询到房间记录,新建个人房间");
|
||||
utils_request.POST("/system/room", {
|
||||
createUser: roomData.value.userId,
|
||||
odds: 1,
|
||||
@@ -37,7 +37,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:111", "接口请求失败:", response.msg);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:141", "接口请求失败:", response.msg);
|
||||
common_vendor.index.showToast({
|
||||
title: "查询失败",
|
||||
icon: "none"
|
||||
@@ -53,8 +53,7 @@ const _sfc_main = {
|
||||
type: "sound",
|
||||
size: "20"
|
||||
}),
|
||||
b: common_vendor.o(gotoNewPage),
|
||||
c: common_vendor.t(roomData.value)
|
||||
b: common_vendor.o(gotoNewPage)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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"><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></view>
|
||||
81
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.js
vendored
Normal file
81
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.js
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const utils_request = require("../../utils/request.js");
|
||||
const utils_StaticValue = require("../../utils/StaticValue.js");
|
||||
const _sfc_main = {
|
||||
__name: "over",
|
||||
setup(__props) {
|
||||
const roomData = common_vendor.ref([]);
|
||||
const loading = common_vendor.ref(true);
|
||||
const scoredetailData1 = common_vendor.ref([]);
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:44", "打印数组scoredetailData1:", scoredetailData1.value);
|
||||
const odd1 = common_vendor.ref();
|
||||
common_vendor.onLoad((options) => {
|
||||
try {
|
||||
odd1.value = JSON.parse(decodeURIComponent(options.multiple));
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:67", "odd1:", odd1);
|
||||
} catch (error) {
|
||||
}
|
||||
});
|
||||
common_vendor.onMounted(async () => {
|
||||
const getUserInfo = utils_StaticValue.StaticValue.getUserInfo;
|
||||
roomData.value = getUserInfo();
|
||||
try {
|
||||
await ByGetLocalUseId();
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:81", "当前scoredetailData1为:", scoredetailData1.value);
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/over/over.vue:83", "数据加载失败:", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
const ByGetLocalUseId = async () => {
|
||||
const response2 = await utils_request.GET("/system/room/createUser/" + roomData.value.userId);
|
||||
const dataArray1 = response2.data;
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:106", "结算房间的房间号为:", dataArray1[0].roomId);
|
||||
var roomId1 = dataArray1[0].roomId;
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:110", "拿到本地用户所在的房间id:", roomId1);
|
||||
const response = await utils_request.GET("/system/score/room/user/list", { roomId: roomId1 });
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:114", "拿到房间下的所有用户信息:", response.rows);
|
||||
scoredetailData1.value = response.rows.map((player) => ({
|
||||
avatars: player.avatars,
|
||||
Nickname: player.nickName,
|
||||
score: player.totalScore,
|
||||
oddscore: player.totalScore * odd1.value
|
||||
}));
|
||||
try {
|
||||
const response5 = await utils_request.PUT("/system/room", {
|
||||
roomId: roomId1,
|
||||
odds: odd1.value,
|
||||
roomStatus: 2
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:130", "关闭房间成功", response5);
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("log", "at pages/over/over.vue:133", "关闭房间失败", error);
|
||||
}
|
||||
};
|
||||
const onsubmit = () => {
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: loading.value
|
||||
}, loading.value ? {} : {
|
||||
b: common_vendor.f(scoredetailData1.value, (item, index, i0) => {
|
||||
return {
|
||||
a: item.avatars,
|
||||
b: common_vendor.t(item.Nickname),
|
||||
c: common_vendor.t(item.score),
|
||||
d: common_vendor.t(item.oddscore),
|
||||
e: index
|
||||
};
|
||||
}),
|
||||
c: common_vendor.o(onsubmit)
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
wx.createPage(_sfc_main);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/over/over.js.map
|
||||
4
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.json
vendored
Normal file
4
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "最终结算",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.wxml
vendored
Normal file
1
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="over"><view class="over-lan"><view class="over-lan-player">玩家</view><view class="over-lan-score">得分</view><view class="over-lan-oddscore">倍率分</view></view><view wx:if="{{a}}">正在努力加载数据中...</view><view wx:else><view wx:for="{{b}}" wx:for-item="item" wx:key="e" class="over-content"><view class="over-content-player"><image src="{{item.a}}" mode="widthFix" style="width:80rpx"></image><text>{{item.b}}</text></view><view class="over-content-score">{{item.c}}</view><view class="over-content-oddscore">{{item.d}}</view></view><button bindtap="{{c}}"> 返回首页 </button></view></view>
|
||||
48
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.wxss
vendored
Normal file
48
scoring/unpackage/dist/dev/mp-weixin/pages/over/over.wxss
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
.over {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.over .over-lan {
|
||||
display: flex;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.over .over-lan .over-lan-player {
|
||||
margin-left: 50rpx;
|
||||
}
|
||||
.over .over-lan .over-lan-score {
|
||||
margin-left: 210rpx;
|
||||
}
|
||||
.over .over-lan .over-lan-oddscore {
|
||||
margin-left: 210rpx;
|
||||
}
|
||||
.over .over-content {
|
||||
margin-top: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.over .over-content .over-content-player {
|
||||
margin-left: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 240rpx;
|
||||
}
|
||||
.over .over-content .over-content-player image {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
.over .over-content .over-content-score {
|
||||
margin-left: 70rpx;
|
||||
width: 150rpx;
|
||||
}
|
||||
.over .over-content .over-content-oddscore {
|
||||
margin-left: 140rpx;
|
||||
}
|
||||
.over button {
|
||||
position: fixed;
|
||||
bottom: 60rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-radius: 15rpx;
|
||||
background-color: #372fac;
|
||||
color: #fff;
|
||||
width: 650rpx;
|
||||
}
|
||||
@@ -25,46 +25,54 @@ const _sfc_main = {
|
||||
const userScores = common_vendor.ref([]);
|
||||
const confirmAddPlayer = async () => {
|
||||
const response = await utils_request.GET("/system/room/createUser/" + roomData.value.userId);
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:147", response);
|
||||
if (response.code === 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: "查询roomId成功",
|
||||
icon: "success"
|
||||
});
|
||||
const dataArray = response.data;
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:155", "dataArray.roomId:", dataArray[0].roomId);
|
||||
const trimmedName = newPlayerName.value.trim();
|
||||
const userData = {
|
||||
nickName: trimmedName,
|
||||
// 使用 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 utils_request.POST("/system/score/user/add", userData);
|
||||
if (userResponse.code === 200) {
|
||||
const userId1 = userResponse.data.userId;
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:171", "新创建的用户ID:", userId1);
|
||||
const roomUserData = {
|
||||
roomId: dataArray[0].roomId,
|
||||
userId: userId1,
|
||||
// 使用后端返回的userId
|
||||
totalScore: 0,
|
||||
playerType: "robot",
|
||||
if (round.value < 2) {
|
||||
if (response.code === 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: "查询roomId成功",
|
||||
icon: "success"
|
||||
});
|
||||
const dataArray = response.data;
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:155", "dataArray.roomId:", dataArray[0].roomId);
|
||||
const trimmedName = newPlayerName.value.trim();
|
||||
const userData = {
|
||||
nickName: trimmedName,
|
||||
avatars: "https://img1.baidu.com/it/u=3612220943,2414740890&fm=253&app=138&f=JPEG?w=526&h=500"
|
||||
// 使用 trim() 处理后的名称
|
||||
avatars: "https://q3.itc.cn/q_70/images03/20250110/1e71eecf56b34344bcae6a5b85c0bec2.jpeg",
|
||||
openId: generateTenDigitRandom().toString()
|
||||
};
|
||||
const response2 = await utils_request.POST("/system/score/room/user", roomUserData);
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:184", "返回结果: ", response2);
|
||||
if (response2.code === 200) {
|
||||
fetchUserScores();
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:188", "添加新玩家成功");
|
||||
common_vendor.index.showToast({
|
||||
title: "添加成功,数据已更新",
|
||||
icon: "success"
|
||||
});
|
||||
const userResponse = await utils_request.POST("/system/score/user/add", userData);
|
||||
if (userResponse.code === 200) {
|
||||
const userId1 = userResponse.data.userId;
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:173", "新创建的用户ID:", userId1);
|
||||
const roomUserData = {
|
||||
roomId: dataArray[0].roomId,
|
||||
userId: userId1,
|
||||
// 使用后端返回的userId
|
||||
totalScore: 0,
|
||||
playerType: "robot",
|
||||
nickName: trimmedName,
|
||||
avatars: "https://q3.itc.cn/q_70/images03/20250110/1e71eecf56b34344bcae6a5b85c0bec2.jpeg"
|
||||
};
|
||||
const response2 = await utils_request.POST("/system/score/room/user", roomUserData);
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:188", "返回结果: ", response2);
|
||||
if (response2.code === 200) {
|
||||
fetchUserScores();
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:192", "添加新玩家成功");
|
||||
common_vendor.index.showToast({
|
||||
title: "添加成功",
|
||||
icon: "success"
|
||||
});
|
||||
virtueplayer.value = false;
|
||||
}
|
||||
}
|
||||
virtueplayer.value = false;
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:204", "游戏已开始,不可添加新玩家:", round.value);
|
||||
common_vendor.index.showToast({
|
||||
title: "游戏已开始",
|
||||
icon: "error"
|
||||
});
|
||||
virtueplayer.value = false;
|
||||
}
|
||||
};
|
||||
function generateTenDigitRandom() {
|
||||
@@ -88,32 +96,53 @@ const _sfc_main = {
|
||||
const rounds = maxRounds.value;
|
||||
return isNaN(rounds) ? 0 : Math.max(0, rounds + 1);
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:222", "round:", round);
|
||||
const formatScore = (score) => {
|
||||
return score > 0 ? `+${score}` : `${score}`;
|
||||
};
|
||||
const fetchUserScores = async () => {
|
||||
try {
|
||||
const response2 = await utils_request.GET("/system/room/createUser/" + roomData.value.userId);
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:234", response2);
|
||||
const dataArray1 = response2.data;
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:237", "房间号为:", dataArray1[0].roomId);
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:251", "获取分数数据房间号为:", dataArray1[0].roomId);
|
||||
var roomId1 = dataArray1[0].roomId;
|
||||
const response3 = await utils_request.GET(`/system/score/room/user/user-details/${roomId1}`);
|
||||
if (response3.code === 200) {
|
||||
userScores.value = response3.data;
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:244", "用户得分数据加载成功");
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:259", "用户得分数据加载成功");
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/single/single.vue:247", "获取用户得分失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/single/single.vue:262", "获取用户得分失败:", error);
|
||||
}
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
const getUserInfo = utils_StaticValue.StaticValue.getUserInfo;
|
||||
roomData.value = getUserInfo();
|
||||
fetchUserScores();
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:255", "userScores为:", userScores);
|
||||
reSubmitGet();
|
||||
});
|
||||
const reSubmitGet = async () => {
|
||||
const response2 = await utils_request.GET("/system/room/createUser/" + roomData.value.userId);
|
||||
const dataArray1 = response2.data;
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:280", "当前房间号为:", dataArray1[0].roomId);
|
||||
var roomId1 = dataArray1[0].roomId;
|
||||
const response4 = await utils_request.GET("/system/score/room/user/list", {
|
||||
roomId: roomId1,
|
||||
userId: roomData.value.userId
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:289", "response4:", response4.rows.length);
|
||||
if (response4.rows.length === 0) {
|
||||
const addlocaluser = await utils_request.POST("/system/score/room/user", {
|
||||
roomId: roomId1,
|
||||
userId: roomData.value.userId,
|
||||
totalScore: "0",
|
||||
playerType: "user",
|
||||
nickName: "孤心",
|
||||
avatars: "https://img1.baidu.com/it/u=3612220943,2414740890&fm=253&app=138&f=JPEG?w=526&h=500"
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:300", "addlocaluser:", addlocaluser);
|
||||
fetchUserScores();
|
||||
}
|
||||
};
|
||||
const gotoNewPage1 = () => {
|
||||
const roomUserData1 = common_vendor.ref(userScores);
|
||||
const encodedPlayers = encodeURIComponent(JSON.stringify(roomUserData1.value));
|
||||
@@ -143,11 +172,21 @@ const _sfc_main = {
|
||||
};
|
||||
const isPopupVisible2 = common_vendor.ref(false);
|
||||
const multiple = () => {
|
||||
oddvalue.value = void 0;
|
||||
isPopupVisible2.value = true;
|
||||
};
|
||||
const closemultiple = () => {
|
||||
isPopupVisible2.value = false;
|
||||
};
|
||||
const oddvalue = common_vendor.ref();
|
||||
const overmultiple = () => {
|
||||
common_vendor.index.__f__("log", "at pages/single/single.vue:380", "输入的倍率为:", oddvalue.value);
|
||||
const encodedMultiple = encodeURIComponent(JSON.stringify(oddvalue.value));
|
||||
isPopupVisible2.value = false;
|
||||
common_vendor.wx$1.redirectTo({
|
||||
url: `/pages/over/over?multiple=${encodedMultiple}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
@@ -175,57 +214,56 @@ const _sfc_main = {
|
||||
c: common_vendor.t(formatScore(item.totalScore)),
|
||||
d: common_vendor.f(item.details, (detail, k1, i1) => {
|
||||
return {
|
||||
a: common_vendor.t(formatScore(detail.detailScore)),
|
||||
a: common_vendor.t(detail.detailScore),
|
||||
b: detail.gameTime
|
||||
};
|
||||
}),
|
||||
e: item.userId
|
||||
};
|
||||
}),
|
||||
i: common_vendor.t(userScores.value),
|
||||
j: common_vendor.o(gotoNewPage1),
|
||||
k: common_vendor.o(multiple),
|
||||
l: common_assets._imports_0,
|
||||
m: common_vendor.o(addvirtue),
|
||||
n: common_vendor.o(($event) => isPopupVisible.value = $event),
|
||||
o: common_vendor.p({
|
||||
i: common_vendor.o(gotoNewPage1),
|
||||
j: common_vendor.o(multiple),
|
||||
k: common_assets._imports_0,
|
||||
l: common_vendor.o(addvirtue),
|
||||
m: common_vendor.o(($event) => isPopupVisible.value = $event),
|
||||
n: common_vendor.p({
|
||||
closeable: true,
|
||||
modelValue: isPopupVisible.value
|
||||
}),
|
||||
p: common_vendor.o(closetransfer),
|
||||
q: common_vendor.o(($event) => isPopupVisible1.value = $event),
|
||||
r: common_vendor.p({
|
||||
o: common_vendor.o(closetransfer),
|
||||
p: common_vendor.o(($event) => isPopupVisible1.value = $event),
|
||||
q: common_vendor.p({
|
||||
closeable: true,
|
||||
modelValue: isPopupVisible1.value
|
||||
}),
|
||||
s: common_vendor.o(confirmAddPlayer),
|
||||
t: common_vendor.o(($event) => newPlayerName.value = $event),
|
||||
v: common_vendor.p({
|
||||
r: common_vendor.o(confirmAddPlayer),
|
||||
s: common_vendor.o(($event) => newPlayerName.value = $event),
|
||||
t: common_vendor.p({
|
||||
placeholder: "请输入名称",
|
||||
modelValue: newPlayerName.value
|
||||
}),
|
||||
w: common_vendor.o(closevirtue),
|
||||
x: common_vendor.o(confirmAddPlayer),
|
||||
y: common_vendor.o(($event) => virtueplayer.value = $event),
|
||||
z: common_vendor.p({
|
||||
v: common_vendor.o(closevirtue),
|
||||
w: common_vendor.o(confirmAddPlayer),
|
||||
x: common_vendor.o(($event) => virtueplayer.value = $event),
|
||||
y: common_vendor.p({
|
||||
closeable: true,
|
||||
modelValue: virtueplayer.value
|
||||
}),
|
||||
A: common_vendor.o(($event) => _ctx.value = $event),
|
||||
B: common_vendor.p({
|
||||
z: common_vendor.o(($event) => oddvalue.value = $event),
|
||||
A: common_vendor.p({
|
||||
placeholder: "请输入倍率",
|
||||
modelValue: _ctx.value
|
||||
modelValue: oddvalue.value
|
||||
}),
|
||||
C: common_vendor.o(closemultiple),
|
||||
D: common_vendor.o(closemultiple),
|
||||
E: common_vendor.o(($event) => isPopupVisible2.value = $event),
|
||||
F: common_vendor.p({
|
||||
B: common_vendor.o(closemultiple),
|
||||
C: common_vendor.o(overmultiple),
|
||||
D: common_vendor.o(($event) => isPopupVisible2.value = $event),
|
||||
E: common_vendor.p({
|
||||
closeable: true,
|
||||
modelValue: isPopupVisible2.value
|
||||
}),
|
||||
G: isLoading.value
|
||||
F: isLoading.value
|
||||
}, isLoading.value ? {
|
||||
H: common_vendor.p({
|
||||
G: common_vendor.p({
|
||||
status: "loading"
|
||||
})
|
||||
} : {});
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="single data-v-6410b918"><view class="single-lan data-v-6410b918"><button class="data-v-6410b918" bindtap="{{b}}"><uni-icons wx:if="{{a}}" class="data-v-6410b918" u-i="6410b918-0" bind:__l="__l" u-p="{{a}}"></uni-icons><text class="data-v-6410b918">添加玩家</text></button><button class="data-v-6410b918" bindtap="{{d}}"><uni-icons wx:if="{{c}}" class="data-v-6410b918" u-i="6410b918-1" bind:__l="__l" u-p="{{c}}"></uni-icons><text class="data-v-6410b918">转让计分员</text></button><view class="lan-switch data-v-6410b918"><switch class="data-v-6410b918" bindchange="{{e}}"/><text class="data-v-6410b918">语音播报</text></view><view class="lan-switch data-v-6410b918"><switch class="data-v-6410b918" bindchange="{{f}}"/><text class="data-v-6410b918">台版</text></view></view><view class="single-detail data-v-6410b918"><text class="sing-detail-title data-v-6410b918">对局记录</text><text class="data-v-6410b918">点击对局分数进行修改</text></view><scroll-view class="single-score data-v-6410b918" scroll-x="true"><text style="color:red" class="score-remind data-v-6410b918"> 点击头像编辑自己的昵称和性别~ </text><view class="single-score-record data-v-6410b918"><view class="tab-head data-v-6410b918"><text class="tab-head-player data-v-6410b918">玩家</text><text class="tab-head-total data-v-6410b918">总分</text><view wx:for="{{g}}" wx:for-item="n" wx:key="b" class="tab-head-detail data-v-6410b918"> 第{{n.a}}局 </view></view><view wx:for="{{h}}" wx:for-item="item" wx:key="e" class="tab-body data-v-6410b918"><view class="tab-body-player data-v-6410b918"><image class="data-v-6410b918" src="{{item.a}}" mode="widthFix"></image><text class="data-v-6410b918">{{item.b}}</text></view><view class="tab-total-score data-v-6410b918">{{item.c}}</view><view wx:for="{{item.d}}" wx:for-item="detail" wx:key="b" class="round-score data-v-6410b918">{{detail.a}}</view></view> {{i}}</view></scroll-view><view class="single-bottom data-v-6410b918"><button class="data-v-6410b918" style="color:aliceblue;background-color:rgb(55, 47, 172)" bindtap="{{j}}"> 开局计分</button><button class="data-v-6410b918" bindtap="{{k}}">结算房间</button></view><l-popup wx:if="{{o}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-2" bind:__l="__l" bindupdateModelValue="{{n}}" u-p="{{o}}"><view class="popup-add data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918">扫码加入房间</text></view><view class="line data-v-6410b918"></view><text class="small data-v-6410b918">邀请好友扫描下方二维码加入房间</text><image class="data-v-6410b918" src="{{l}}" mode=""></image><button class="share data-v-6410b918">分享给好友邀请加入房间</button><button class="hand data-v-6410b918" bindtap="{{m}}">手动添加虚拟玩家</button></view></l-popup><l-popup wx:if="{{r}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-3" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"><view class="popup-add data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918">提示</text></view><view class="line data-v-6410b918"></view><text class="small data-v-6410b918">房间内暂无扫码或分享加入房间的玩家,暂时无法转让计分员</text><button class="data-v-6410b918" bindtap="{{p}}">确定</button></view></l-popup><l-popup wx:if="{{z}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-4" bind:__l="__l" bindupdateModelValue="{{y}}" u-p="{{z}}"><view class="popup-virtue data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918">添加玩家</text></view><view class="line data-v-6410b918"></view><view class="lan-input data-v-6410b918"><uni-easyinput wx:if="{{v}}" class="data-v-6410b918" style="width:500rpx" bindconfirm="{{s}}" u-i="6410b918-5,6410b918-4" bind:__l="__l" bindupdateModelValue="{{t}}" u-p="{{v}}"></uni-easyinput></view><view class="lan-button data-v-6410b918"><button class="data-v-6410b918" bindtap="{{w}}">取消</button><button class="data-v-6410b918" bindtap="{{x}}">确定</button></view></view></l-popup><l-popup wx:if="{{F}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-6" bind:__l="__l" bindupdateModelValue="{{E}}" u-p="{{F}}"><view class="popup-virtue data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918" style="font-weight:600">输入倍率,快速结算!</text></view><view class="line data-v-6410b918"></view><view class="lan-input data-v-6410b918"><uni-easyinput wx:if="{{B}}" class="data-v-6410b918" style="width:400rpx" u-i="6410b918-7,6410b918-6" bind:__l="__l" bindupdateModelValue="{{A}}" u-p="{{B}}"></uni-easyinput></view><view class="lan-button data-v-6410b918"><button class="data-v-6410b918" bindtap="{{C}}">取消</button><button class="data-v-6410b918" bindtap="{{D}}">确定</button></view></view></l-popup><uni-load-more wx:if="{{G}}" class="data-v-6410b918" u-i="6410b918-8" bind:__l="__l" u-p="{{H}}"/></view>
|
||||
<view class="single data-v-6410b918"><view class="single-lan data-v-6410b918"><button class="data-v-6410b918" bindtap="{{b}}"><uni-icons wx:if="{{a}}" class="data-v-6410b918" u-i="6410b918-0" bind:__l="__l" u-p="{{a}}"></uni-icons><text class="data-v-6410b918">添加玩家</text></button><button class="data-v-6410b918" bindtap="{{d}}"><uni-icons wx:if="{{c}}" class="data-v-6410b918" u-i="6410b918-1" bind:__l="__l" u-p="{{c}}"></uni-icons><text class="data-v-6410b918">转让计分员</text></button><view class="lan-switch data-v-6410b918"><switch class="data-v-6410b918" bindchange="{{e}}"/><text class="data-v-6410b918">语音播报</text></view><view class="lan-switch data-v-6410b918"><switch class="data-v-6410b918" bindchange="{{f}}"/><text class="data-v-6410b918">台版</text></view></view><view class="single-detail data-v-6410b918"><text class="sing-detail-title data-v-6410b918">对局记录</text><text class="data-v-6410b918">点击对局分数进行修改</text></view><scroll-view class="single-score data-v-6410b918" scroll-x="true"><text style="color:red" class="score-remind data-v-6410b918"> 点击头像编辑自己的昵称和性别~ </text><view class="single-score-record data-v-6410b918"><view class="tab-head data-v-6410b918"><text class="tab-head-player data-v-6410b918">玩家</text><text class="tab-head-total data-v-6410b918">总分</text><view wx:for="{{g}}" wx:for-item="n" wx:key="b" class="tab-head-detail data-v-6410b918"> 第{{n.a}}局 </view></view><view wx:for="{{h}}" wx:for-item="item" wx:key="e" class="tab-body data-v-6410b918"><view class="tab-body-player data-v-6410b918"><image class="data-v-6410b918" src="{{item.a}}" mode="widthFix"></image><text class="data-v-6410b918">{{item.b}}</text></view><view class="tab-total-score data-v-6410b918">{{item.c}}</view><view wx:for="{{item.d}}" wx:for-item="detail" wx:key="b" class="round-score data-v-6410b918">{{detail.a}}</view></view></view></scroll-view><view class="single-bottom data-v-6410b918"><button class="data-v-6410b918" style="color:aliceblue;background-color:rgb(55, 47, 172)" bindtap="{{i}}"> 开局计分</button><button class="data-v-6410b918" bindtap="{{j}}">结算房间</button></view><l-popup wx:if="{{n}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-2" bind:__l="__l" bindupdateModelValue="{{m}}" u-p="{{n}}"><view class="popup-add data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918">扫码加入房间</text></view><view class="line data-v-6410b918"></view><text class="small data-v-6410b918">邀请好友扫描下方二维码加入房间</text><image class="data-v-6410b918" src="{{k}}" mode=""></image><button class="share data-v-6410b918">分享给好友邀请加入房间</button><button class="hand data-v-6410b918" bindtap="{{l}}">手动添加虚拟玩家</button></view></l-popup><l-popup wx:if="{{q}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-3" bind:__l="__l" bindupdateModelValue="{{p}}" u-p="{{q}}"><view class="popup-add data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918">提示</text></view><view class="line data-v-6410b918"></view><text class="small data-v-6410b918">房间内暂无扫码或分享加入房间的玩家,暂时无法转让计分员</text><button class="data-v-6410b918" bindtap="{{o}}">确定</button></view></l-popup><l-popup wx:if="{{y}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-4" bind:__l="__l" bindupdateModelValue="{{x}}" u-p="{{y}}"><view class="popup-virtue data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918">添加玩家</text></view><view class="line data-v-6410b918"></view><view class="lan-input data-v-6410b918"><uni-easyinput wx:if="{{t}}" class="data-v-6410b918" style="width:500rpx" bindconfirm="{{r}}" u-i="6410b918-5,6410b918-4" bind:__l="__l" bindupdateModelValue="{{s}}" u-p="{{t}}"></uni-easyinput></view><view class="lan-button data-v-6410b918"><button class="data-v-6410b918" bindtap="{{v}}">取消</button><button class="data-v-6410b918" bindtap="{{w}}">确定</button></view></view></l-popup><l-popup wx:if="{{E}}" class="data-v-6410b918" u-s="{{['d']}}" u-i="6410b918-6" bind:__l="__l" bindupdateModelValue="{{D}}" u-p="{{E}}"><view class="popup-virtue data-v-6410b918"><view class="tilte data-v-6410b918"><text class="title data-v-6410b918" style="font-weight:600">输入倍率,快速结算!</text></view><view class="line data-v-6410b918"></view><view class="lan-input data-v-6410b918"><uni-easyinput wx:if="{{A}}" class="data-v-6410b918" style="width:400rpx" u-i="6410b918-7,6410b918-6" bind:__l="__l" bindupdateModelValue="{{z}}" u-p="{{A}}"></uni-easyinput></view><view class="lan-button data-v-6410b918"><button class="data-v-6410b918" bindtap="{{B}}">取消</button><button class="data-v-6410b918" bindtap="{{C}}">确定</button></view></view></l-popup><uni-load-more wx:if="{{F}}" class="data-v-6410b918" u-i="6410b918-8" bind:__l="__l" u-p="{{G}}"/></view>
|
||||
@@ -11,6 +11,9 @@ function GET_TOKEN(url, data, token) {
|
||||
function POST(url, data) {
|
||||
return SIMPLE(url, data, "POST");
|
||||
}
|
||||
function PUT(url, data) {
|
||||
return SIMPLE(url, data, "PUT");
|
||||
}
|
||||
let requestTime = 0;
|
||||
async function SIMPLE(url, data, method) {
|
||||
if (requestTime == 0) {
|
||||
@@ -73,4 +76,5 @@ function SIMPLE_TOKEN(url, data, token, method) {
|
||||
exports.GET = GET;
|
||||
exports.GET_TOKEN = GET_TOKEN;
|
||||
exports.POST = POST;
|
||||
exports.PUT = PUT;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/request.js.map
|
||||
|
||||
Reference in New Issue
Block a user