2124
This commit is contained in:
@@ -77,6 +77,7 @@ public class ScoreRoomDetailController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScoreRoomDetail scoreRoomDetail)
|
||||
{
|
||||
System.out.println(scoreRoomDetail);
|
||||
return toAjax(scoreRoomDetailService.insertScoreRoomDetail(scoreRoomDetail));
|
||||
}
|
||||
|
||||
@@ -88,6 +89,8 @@ public class ScoreRoomDetailController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScoreRoomDetail scoreRoomDetail)
|
||||
{
|
||||
|
||||
System.out.println(scoreRoomDetail);
|
||||
return toAjax(scoreRoomDetailService.updateScoreRoomDetail(scoreRoomDetail));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.ruoyi.system.controller;
|
||||
package com.ruoyi.web.controller.scoring;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -77,6 +77,7 @@ public class ScoreUserController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScoreUser scoreUser)
|
||||
{
|
||||
System.out.println(scoreUser);
|
||||
return toAjax(scoreUserService.insertScoreUser(scoreUser));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.web.controller.scoring;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.ScoringAdomain;
|
||||
import com.ruoyi.system.service.IScoringAdomainService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 测试Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/adomain")
|
||||
public class ScoringAdomainController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IScoringAdomainService scoringAdomainService;
|
||||
|
||||
/**
|
||||
* 查询测试列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:adomain:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ScoringAdomain scoringAdomain)
|
||||
{
|
||||
startPage();
|
||||
List<ScoringAdomain> list = scoringAdomainService.selectScoringAdomainList(scoringAdomain);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出测试列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:adomain:export')")
|
||||
@Log(title = "测试", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScoringAdomain scoringAdomain)
|
||||
{
|
||||
List<ScoringAdomain> list = scoringAdomainService.selectScoringAdomainList(scoringAdomain);
|
||||
ExcelUtil<ScoringAdomain> util = new ExcelUtil<ScoringAdomain>(ScoringAdomain.class);
|
||||
util.exportExcel(response, list, "测试数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取测试详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:adomain:query')")
|
||||
@GetMapping(value = "/{name}")
|
||||
public AjaxResult getInfo(@PathVariable("name") String name)
|
||||
{
|
||||
return success(scoringAdomainService.selectScoringAdomainByName(name));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:adomain:add')")
|
||||
@Log(title = "测试", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScoringAdomain scoringAdomain)
|
||||
{
|
||||
return toAjax(scoringAdomainService.insertScoringAdomain(scoringAdomain));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测试
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:adomain:edit')")
|
||||
@Log(title = "测试", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScoringAdomain scoringAdomain)
|
||||
{
|
||||
return toAjax(scoringAdomainService.updateScoringAdomain(scoringAdomain));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测试
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:adomain:remove')")
|
||||
@Log(title = "测试", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{names}")
|
||||
public AjaxResult remove(@PathVariable String[] names)
|
||||
{
|
||||
return toAjax(scoringAdomainService.deleteScoringAdomainByNames(names));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
-- 创建scoring_adomain表
|
||||
CREATE TABLE IF NOT EXISTS scoring_adomain (
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
|
||||
name VARCHAR(255) DEFAULT NULL COMMENT '名称',
|
||||
age INT DEFAULT NULL COMMENT '年龄',
|
||||
create_by VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
create_time DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
update_by VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
update_time DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
remark VARCHAR(500) DEFAULT NULL COMMENT '备注'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='计分系统域名表';
|
||||
|
||||
-- 插入示例数据
|
||||
INSERT INTO scoring_adomain (name, age) VALUES ('测试名称', 25) ON DUPLICATE KEY UPDATE name='测试名称', age=25;
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 测试对象 scoring_adomain
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-24
|
||||
*/
|
||||
public class ScoringAdomain extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 名字 */
|
||||
@Excel(name = "名字")
|
||||
private String name;
|
||||
|
||||
/** 年龄 */
|
||||
@Excel(name = "年龄")
|
||||
private Long age;
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setAge(Long age)
|
||||
{
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public Long getAge()
|
||||
{
|
||||
return age;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("age", getAge())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分数房间详情VO类,用于接收前端提交的复杂数据结构
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-10-30
|
||||
*/
|
||||
@Data
|
||||
public class ScoreRoomDetailVO {
|
||||
/** 房间id */
|
||||
private Long roomId;
|
||||
|
||||
/** 玩家列表 */
|
||||
private List<PlayerScoreVO> players;
|
||||
|
||||
/** 局数 */
|
||||
private Integer roundCount;
|
||||
|
||||
/** 创建时间 */
|
||||
private Date createTime;
|
||||
|
||||
/** 玩家分数VO类 */
|
||||
@Data
|
||||
public static class PlayerScoreVO {
|
||||
/** 玩家id */
|
||||
private String playerId;
|
||||
|
||||
/** 玩家名称 */
|
||||
private String playerName;
|
||||
|
||||
/** 玩家头像 */
|
||||
private String avatar;
|
||||
|
||||
/** 总分 */
|
||||
private Integer totalScore;
|
||||
|
||||
/** 每局分数 */
|
||||
private List<Integer> roundScores;
|
||||
}
|
||||
}
|
||||
@@ -58,4 +58,12 @@ public interface ScoreRoomDetailMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScoreRoomDetailByDetailIds(Long[] detailIds);
|
||||
|
||||
/**
|
||||
* 批量新增分数记录
|
||||
*
|
||||
* @param scoreRoomDetails 分数记录集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertScoreRoomDetail(List<ScoreRoomDetail> scoreRoomDetails);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.ScoringAdomain;
|
||||
|
||||
/**
|
||||
* 测试Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-24
|
||||
*/
|
||||
public interface ScoringAdomainMapper
|
||||
{
|
||||
/**
|
||||
* 查询测试
|
||||
*
|
||||
* @param name 测试主键
|
||||
* @return 测试
|
||||
*/
|
||||
public ScoringAdomain selectScoringAdomainByName(String name);
|
||||
|
||||
/**
|
||||
* 查询测试列表
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 测试集合
|
||||
*/
|
||||
public List<ScoringAdomain> selectScoringAdomainList(ScoringAdomain scoringAdomain);
|
||||
|
||||
/**
|
||||
* 新增测试
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScoringAdomain(ScoringAdomain scoringAdomain);
|
||||
|
||||
/**
|
||||
* 修改测试
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScoringAdomain(ScoringAdomain scoringAdomain);
|
||||
|
||||
/**
|
||||
* 删除测试
|
||||
*
|
||||
* @param name 测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScoringAdomainByName(String name);
|
||||
|
||||
/**
|
||||
* 批量删除测试
|
||||
*
|
||||
* @param names 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScoringAdomainByNames(String[] names);
|
||||
}
|
||||
@@ -58,4 +58,12 @@ public interface IScoreRoomDetailService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScoreRoomDetailByDetailId(Long detailId);
|
||||
|
||||
/**
|
||||
* 批量新增分数记录
|
||||
*
|
||||
* @param scoreRoomDetails 分数记录集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertScoreRoomDetail(List<ScoreRoomDetail> scoreRoomDetails);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.ScoringAdomain;
|
||||
|
||||
/**
|
||||
* 测试Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-24
|
||||
*/
|
||||
public interface IScoringAdomainService
|
||||
{
|
||||
/**
|
||||
* 查询测试
|
||||
*
|
||||
* @param name 测试主键
|
||||
* @return 测试
|
||||
*/
|
||||
public ScoringAdomain selectScoringAdomainByName(String name);
|
||||
|
||||
/**
|
||||
* 查询测试列表
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 测试集合
|
||||
*/
|
||||
public List<ScoringAdomain> selectScoringAdomainList(ScoringAdomain scoringAdomain);
|
||||
|
||||
/**
|
||||
* 新增测试
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertScoringAdomain(ScoringAdomain scoringAdomain);
|
||||
|
||||
/**
|
||||
* 修改测试
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateScoringAdomain(ScoringAdomain scoringAdomain);
|
||||
|
||||
/**
|
||||
* 批量删除测试
|
||||
*
|
||||
* @param names 需要删除的测试主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScoringAdomainByNames(String[] names);
|
||||
|
||||
/**
|
||||
* 删除测试信息
|
||||
*
|
||||
* @param name 测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteScoringAdomainByName(String name);
|
||||
}
|
||||
@@ -90,4 +90,10 @@ public class ScoreRoomDetailServiceImpl implements IScoreRoomDetailService
|
||||
{
|
||||
return scoreRoomDetailMapper.deleteScoreRoomDetailByDetailId(detailId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsertScoreRoomDetail(List<ScoreRoomDetail> scoreRoomDetails)
|
||||
{
|
||||
return scoreRoomDetailMapper.batchInsertScoreRoomDetail(scoreRoomDetails);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.ScoringAdomainMapper;
|
||||
import com.ruoyi.system.domain.ScoringAdomain;
|
||||
import com.ruoyi.system.service.IScoringAdomainService;
|
||||
|
||||
/**
|
||||
* 测试Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-24
|
||||
*/
|
||||
@Service
|
||||
public class ScoringAdomainServiceImpl implements IScoringAdomainService
|
||||
{
|
||||
@Autowired
|
||||
private ScoringAdomainMapper scoringAdomainMapper;
|
||||
|
||||
/**
|
||||
* 查询测试
|
||||
*
|
||||
* @param name 测试主键
|
||||
* @return 测试
|
||||
*/
|
||||
@Override
|
||||
public ScoringAdomain selectScoringAdomainByName(String name)
|
||||
{
|
||||
return scoringAdomainMapper.selectScoringAdomainByName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询测试列表
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 测试
|
||||
*/
|
||||
@Override
|
||||
public List<ScoringAdomain> selectScoringAdomainList(ScoringAdomain scoringAdomain)
|
||||
{
|
||||
return scoringAdomainMapper.selectScoringAdomainList(scoringAdomain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertScoringAdomain(ScoringAdomain scoringAdomain)
|
||||
{
|
||||
return scoringAdomainMapper.insertScoringAdomain(scoringAdomain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测试
|
||||
*
|
||||
* @param scoringAdomain 测试
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateScoringAdomain(ScoringAdomain scoringAdomain)
|
||||
{
|
||||
return scoringAdomainMapper.updateScoringAdomain(scoringAdomain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除测试
|
||||
*
|
||||
* @param names 需要删除的测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScoringAdomainByNames(String[] names)
|
||||
{
|
||||
return scoringAdomainMapper.deleteScoringAdomainByNames(names);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测试信息
|
||||
*
|
||||
* @param name 测试主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteScoringAdomainByName(String name)
|
||||
{
|
||||
return scoringAdomainMapper.deleteScoringAdomainByName(name);
|
||||
}
|
||||
}
|
||||
@@ -78,4 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{detailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertScoreRoomDetail" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="detailId">
|
||||
insert into score_room_detail (room_id, user_id, score, created_time, detail_type, getter_id)
|
||||
values
|
||||
<foreach item="detail" collection="list" separator=",">
|
||||
(#{detail.roomId}, #{detail.userId}, #{detail.score}, #{detail.createdTime}, #{detail.detailType}, #{detail.getterId})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.ScoringAdomainMapper">
|
||||
|
||||
<resultMap type="ScoringAdomain" id="ScoringAdomainResult">
|
||||
<result property="name" column="name" />
|
||||
<result property="age" column="age" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScoringAdomainVo">
|
||||
select name, age from scoring_adomain
|
||||
</sql>
|
||||
|
||||
<select id="selectScoringAdomainList" parameterType="ScoringAdomain" resultMap="ScoringAdomainResult">
|
||||
<include refid="selectScoringAdomainVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="age != null "> and age = #{age}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScoringAdomainByName" parameterType="String" resultMap="ScoringAdomainResult">
|
||||
<include refid="selectScoringAdomainVo"/>
|
||||
where name = #{name}
|
||||
</select>
|
||||
|
||||
<insert id="insertScoringAdomain" parameterType="ScoringAdomain">
|
||||
insert into scoring_adomain
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="age != null">age,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="age != null">#{age},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScoringAdomain" parameterType="ScoringAdomain">
|
||||
update scoring_adomain
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="age != null">age = #{age},</if>
|
||||
</trim>
|
||||
where name = #{name}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScoringAdomainByName" parameterType="String">
|
||||
delete from scoring_adomain where name = #{name}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScoringAdomainByNames" parameterType="String">
|
||||
delete from scoring_adomain where name in
|
||||
<foreach item="name" collection="array" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
34
scoring/node_modules/.package-lock.json
generated
vendored
34
scoring/node_modules/.package-lock.json
generated
vendored
@@ -5,8 +5,6 @@
|
||||
"packages": {
|
||||
"node_modules/copy-anything": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz",
|
||||
"integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-what": "^3.14.1"
|
||||
@@ -17,8 +15,6 @@
|
||||
},
|
||||
"node_modules/errno": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
|
||||
"integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -30,15 +26,11 @@
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"license": "ISC",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -50,8 +42,6 @@
|
||||
},
|
||||
"node_modules/image-size": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
|
||||
"integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
@@ -63,8 +53,6 @@
|
||||
},
|
||||
"node_modules/is-what": {
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz",
|
||||
"integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/less": {
|
||||
@@ -117,8 +105,6 @@
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
|
||||
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -131,8 +117,6 @@
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
@@ -144,8 +128,6 @@
|
||||
},
|
||||
"node_modules/needle": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz",
|
||||
"integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -161,8 +143,6 @@
|
||||
},
|
||||
"node_modules/parse-node-version": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz",
|
||||
"integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
@@ -170,8 +150,6 @@
|
||||
},
|
||||
"node_modules/pify": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
||||
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
@@ -180,29 +158,21 @@
|
||||
},
|
||||
"node_modules/prr": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
|
||||
"integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
|
||||
"integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
|
||||
"license": "ISC",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"license": "ISC",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
@@ -211,8 +181,6 @@
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"license": "BSD-3-Clause",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
@@ -221,8 +189,6 @@
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"license": "0BSD"
|
||||
}
|
||||
}
|
||||
|
||||
34
scoring/package-lock.json
generated
34
scoring/package-lock.json
generated
@@ -11,8 +11,6 @@
|
||||
},
|
||||
"node_modules/copy-anything": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz",
|
||||
"integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-what": "^3.14.1"
|
||||
@@ -23,8 +21,6 @@
|
||||
},
|
||||
"node_modules/errno": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
|
||||
"integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -36,15 +32,11 @@
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"license": "ISC",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -56,8 +48,6 @@
|
||||
},
|
||||
"node_modules/image-size": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
|
||||
"integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
@@ -69,8 +59,6 @@
|
||||
},
|
||||
"node_modules/is-what": {
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz",
|
||||
"integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/less": {
|
||||
@@ -123,8 +111,6 @@
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
|
||||
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -137,8 +123,6 @@
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
@@ -150,8 +134,6 @@
|
||||
},
|
||||
"node_modules/needle": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz",
|
||||
"integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -167,8 +149,6 @@
|
||||
},
|
||||
"node_modules/parse-node-version": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz",
|
||||
"integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
@@ -176,8 +156,6 @@
|
||||
},
|
||||
"node_modules/pify": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
||||
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
@@ -186,29 +164,21 @@
|
||||
},
|
||||
"node_modules/prr": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
|
||||
"integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
|
||||
"integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
|
||||
"license": "ISC",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"license": "ISC",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
@@ -217,8 +187,6 @@
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"license": "BSD-3-Clause",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
@@ -227,8 +195,6 @@
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"license": "0BSD"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"pages": [
|
||||
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
|
||||
@@ -1,27 +1,19 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 自定义头部 -->
|
||||
<view class="header">
|
||||
<view class="back-btn" @click="goBack">
|
||||
<uni-icons type="left" size="22" color="#fff" />
|
||||
</view>
|
||||
<view class="title">用户信息</view>
|
||||
<view class="placeholder"></view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<view class="content">
|
||||
<!-- 昵称输入 -->
|
||||
<view class="form-item">
|
||||
<view class="label">昵称:</view>
|
||||
<input class="input" v-model="userInfo.nickName" placeholder="请输入昵称" />
|
||||
<input class="input" v-model="userInfo.name" placeholder="请输入昵称" />
|
||||
</view>
|
||||
|
||||
<!-- 头像选择 -->
|
||||
<view class="form-item">
|
||||
<view class="label">头像:</view>
|
||||
<view class="avatar-wrapper" @click="chooseNewAvatar">
|
||||
<image :src="userInfo.avatarUrl || '/static/logo.png'" mode="aspectFill" class="avatar" />
|
||||
<image :src="userInfo.avatar || '/static/logo.png'" mode="aspectFill" class="avatar" />
|
||||
<view class="avatar-tip">点击更新头像</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -33,20 +25,18 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, getCurrentInstance } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { updateGlobalUserInfo } from '../../../main.js'
|
||||
|
||||
// 用户信息
|
||||
const userInfo = ref({
|
||||
id: '',
|
||||
nickName: '',
|
||||
avatarUrl: ''
|
||||
name: '',
|
||||
avatar: ''
|
||||
})
|
||||
|
||||
// 初始化
|
||||
onLoad((options) => {
|
||||
// 从选项中获取用户数据
|
||||
if (options.userData) {
|
||||
try {
|
||||
const data = JSON.parse(decodeURIComponent(options.userData))
|
||||
@@ -55,27 +45,16 @@ onLoad((options) => {
|
||||
console.error('解析用户数据失败:', e)
|
||||
}
|
||||
}
|
||||
|
||||
// 记录来源页面信息,支持返回到正确页面
|
||||
if (options.from) {
|
||||
console.log('来源页面:', options.from)
|
||||
}
|
||||
})
|
||||
|
||||
// 返回上一页
|
||||
const goBack = () => {
|
||||
// 检查是否有未保存的修改
|
||||
if (userInfo.value.nickName.trim()) {
|
||||
// 使用全局方法保存用户信息,确保全局可用
|
||||
updateGlobalUserInfo(userInfo.value)
|
||||
}
|
||||
|
||||
wx.navigateBack()
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
// 选择新头像
|
||||
const chooseNewAvatar = () => {
|
||||
wx.chooseMedia({
|
||||
uni.chooseMedia({
|
||||
count: 1,
|
||||
mediaType: ['image'],
|
||||
sourceType: ['album', 'camera'],
|
||||
@@ -85,10 +64,10 @@ const chooseNewAvatar = () => {
|
||||
// 统一处理头像选择逻辑,支持所有平台
|
||||
try {
|
||||
const tempFilePath = res.tempFiles[0].tempFilePath
|
||||
userInfo.value.avatarUrl = tempFilePath
|
||||
userInfo.value.avatar = tempFilePath
|
||||
} catch (error) {
|
||||
console.error('处理头像文件路径失败:', error)
|
||||
wx.showToast({
|
||||
uni.showToast({
|
||||
title: '头像设置失败',
|
||||
icon: 'none'
|
||||
})
|
||||
@@ -96,7 +75,7 @@ const chooseNewAvatar = () => {
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('选择图片失败:', err)
|
||||
wx.showToast({
|
||||
uni.showToast({
|
||||
title: '选择图片失败',
|
||||
icon: 'none'
|
||||
})
|
||||
@@ -106,45 +85,46 @@ const chooseNewAvatar = () => {
|
||||
|
||||
// 保存用户信息
|
||||
const saveUserInfo = () => {
|
||||
if (!userInfo.value.nickName.trim()) {
|
||||
wx.showToast({
|
||||
if (!userInfo.value.name.trim()) {
|
||||
uni.showToast({
|
||||
title: '昵称不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 使用全局方法保存用户信息,确保全局可用
|
||||
updateGlobalUserInfo(userInfo.value)
|
||||
|
||||
// 保存成功,返回上一页并传递更新的数据
|
||||
const pages = getCurrentPages()
|
||||
const prevPage = pages[pages.length - 2]
|
||||
if (prevPage) {
|
||||
// 通过事件通知上一页更新数据
|
||||
// 通过页面实例调用方法更新数据
|
||||
if (prevPage.$vm && prevPage.$vm.updateUserData) {
|
||||
prevPage.$vm.updateUserData(userInfo.value)
|
||||
} else {
|
||||
// 如果上一页没有updateUserData方法,通过全局事件通知
|
||||
wx.$emit && wx.$emit('userDataUpdated', userInfo.value)
|
||||
}
|
||||
}
|
||||
|
||||
// 通过全局事件通知更新数据(作为备选方案)
|
||||
uni.$emit('userDataUpdated', userInfo.value)
|
||||
|
||||
// 将用户信息保存到本地存储
|
||||
uni.setStorageSync('userInfo', userInfo.value)
|
||||
uni.setStorageSync('currentUserInfo', userInfo.value)
|
||||
|
||||
// 显示保存成功提示
|
||||
wx.showToast({
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'success',
|
||||
duration: 1500,
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
wx.navigateBack()
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="less" scoped>
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
|
||||
@@ -106,7 +106,6 @@
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom-actions" v-if="!showKeyboard">
|
||||
<button class="action-btn" type="default" @click="nextRound">下一局</button>
|
||||
<button class="action-btn primary" type="primary" @click="endGame">结束对局</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -472,6 +471,17 @@ onMounted(() => {
|
||||
if (savedSound !== '') {
|
||||
soundEnabled.value = savedSound
|
||||
}
|
||||
|
||||
// 检查是否有选中的玩家索引(用于分数编辑)
|
||||
const selectedIndex = uni.getStorageSync('selectedPlayerIndex')
|
||||
if (selectedIndex !== '' && players.value.length > 0) {
|
||||
// 延迟执行,确保玩家数据已加载
|
||||
setTimeout(() => {
|
||||
selectPlayer(parseInt(selectedIndex))
|
||||
// 清除临时存储的选中玩家索引
|
||||
uni.removeStorageSync('selectedPlayerIndex')
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
@@ -48,27 +48,47 @@
|
||||
<text class="player-count">({{ players.length }}位)</text>
|
||||
</view>
|
||||
|
||||
<!-- 玩家表格 -->
|
||||
<view class="players-table">
|
||||
<view class="table-header">
|
||||
<view class="player-column">玩家</view>
|
||||
<view class="score-column">总分</view>
|
||||
</view>
|
||||
|
||||
<view class="table-body">
|
||||
<view v-for="(player, index) in displayPlayers" :key="player.id" class="player-row">
|
||||
<view class="player-info">
|
||||
<image :src="player.avatar" mode="aspectFill"></image>
|
||||
<text>{{ player.name }}</text>
|
||||
<!-- 玩家表格(表头在左侧) -->
|
||||
<view class="players-table-container vertical">
|
||||
<view class="players-table vertical">
|
||||
<!-- 表头行 -->
|
||||
<view class="table-row header-row">
|
||||
<!-- 固定表头:玩家 -->
|
||||
<view class="header-cell player-column">玩家</view>
|
||||
<!-- 每个玩家作为一列 -->
|
||||
<view v-for="(player, index) in displayPlayers" :key="player.id" class="data-cell">
|
||||
<view class="player-info">
|
||||
<image :src="player.avatar" mode="aspectFill"></image>
|
||||
<text>{{ player.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="score-display" @click="editScore(index)">
|
||||
</view>
|
||||
|
||||
<!-- 总分行 -->
|
||||
<view class="table-row">
|
||||
<view class="header-cell score-column">总分</view>
|
||||
<view v-for="(player, index) in displayPlayers" :key="player.id" class="data-cell score-display" >
|
||||
{{ player.score }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 每局分数行 -->
|
||||
<view v-for="(round, roundIndex) in rounds" :key="round" class="table-row">
|
||||
<view class="header-cell score-column">第{{ round }}局</view>
|
||||
<view @click="editScore(index)" v-for="(player, playerIndex) in displayPlayers" :key="player.id" class="data-cell score-display">
|
||||
{{ player.roundScores[roundIndex] || 0 }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--
|
||||
<view>
|
||||
<button @click="postscore">提交分数</button>
|
||||
<input v-model="score.value.playerId" type="number" placeholder="输入分数" :src="score.value.playerId">
|
||||
</view> -->
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<view class="bottom-buttons">
|
||||
@@ -76,28 +96,114 @@
|
||||
<button class="settle-btn" type="default" @click="settleRoom">结算房间</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||
import { ref, computed, onMounted, onUnmounted, toRaw } from 'vue'
|
||||
import { GET,POST } from '../../../utils/request'
|
||||
import { BASE_URL } from '../../../utils/CommonValues.js';
|
||||
const res=ref(null)
|
||||
// const score=ref(
|
||||
// playerId: currentUser.id
|
||||
// )
|
||||
|
||||
const getuserinfo =()=>{
|
||||
GET('/score/info/list',null,).then(res=>{
|
||||
console.log('获取用户信息成功:', res.data)
|
||||
|
||||
// 检查API返回数据结构
|
||||
if(res.data && res.data.code === 200 && Array.isArray(res.data.rows)) {
|
||||
const userList = res.data.rows;
|
||||
|
||||
// 清空现有的玩家列表(保留自己)
|
||||
const selfPlayer = players.value.find(p => p.id === 'self');
|
||||
players.value = selfPlayer ? [selfPlayer] : [];
|
||||
|
||||
// 将API返回的用户信息添加到玩家列表
|
||||
userList.forEach(user => {
|
||||
if(user.nickName) {
|
||||
// 处理头像URL:如果是相对路径则与BASE_URL拼接
|
||||
let avatarUrl = user.avatars;
|
||||
if (avatarUrl) {
|
||||
// 检查是否是相对路径(以/开头)
|
||||
if (avatarUrl.startsWith('/')) {
|
||||
avatarUrl = `${BASE_URL}${avatarUrl}`;
|
||||
} else if (!avatarUrl.startsWith('http://') && !avatarUrl.startsWith('https://')) {
|
||||
// 不是绝对URL也不是以/开头的相对路径,拼接完整路径
|
||||
avatarUrl = `${BASE_URL}/${avatarUrl}`;
|
||||
}
|
||||
} else {
|
||||
// 如果没有头像则使用默认头像
|
||||
avatarUrl = '/static/avatar14.png';
|
||||
}
|
||||
|
||||
const newPlayer = {
|
||||
id: `player_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
||||
name: user.nickName, // 使用API返回的nickName作为玩家名称
|
||||
avatar: avatarUrl, // 使用处理后的头像URL
|
||||
score: 0,
|
||||
roundScores: []
|
||||
};
|
||||
players.value.push(newPlayer);
|
||||
}
|
||||
});
|
||||
|
||||
console.log('玩家列表更新完成:', players.value);
|
||||
uni.showToast({
|
||||
title: `成功添加${userList.length}位玩家`,
|
||||
icon: 'success'
|
||||
});
|
||||
} else {
|
||||
console.error('API返回数据结构异常:', res.data);
|
||||
uni.showToast({
|
||||
title: '获取玩家信息失败,数据结构异常',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}).catch(err=>{
|
||||
console.error('获取用户信息失败:', err);
|
||||
// 使用request.js中提供的友好错误信息
|
||||
const errorMsg = err.userFriendlyMsg || '获取玩家信息失败';
|
||||
uni.showToast({
|
||||
title: errorMsg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// const postscore = () => {
|
||||
// POST('/a/post',score.value).then(r=>{
|
||||
// console.log('提交分数成功:', r.data,)
|
||||
// console.log(score.value)
|
||||
// res.value=r.data
|
||||
// }).catch(err=>{
|
||||
// console.error('提交分数失败:', err);
|
||||
// })
|
||||
// }
|
||||
// 状态管理
|
||||
const voiceBroadcast = ref(false)
|
||||
const tableMode = ref(false)
|
||||
const roomId = ref('')
|
||||
// 当前用户信息 - 从本地存储获取
|
||||
const storedUserInfo = uni.getStorageSync('userInfo');
|
||||
const currentUser = ref({
|
||||
id: 'self',
|
||||
name: '玩家50950',
|
||||
avatar: 'https://t14.baidu.com/it/u=3165460156,649373630&fm=224&app=112&f=JPEG?w=500&h=500'
|
||||
})
|
||||
name: storedUserInfo?.name||'玩家50920' ,
|
||||
avatar: storedUserInfo?.avatar ||'/static/logo.png' })
|
||||
|
||||
// 局数信息
|
||||
const rounds = ref([]) // 存储每局信息,每个元素是局数编号
|
||||
|
||||
// 玩家列表(初始包含自己)
|
||||
const players = ref([
|
||||
{
|
||||
id: 'self',
|
||||
name: '玩家50950',
|
||||
avatar: 'https://t14.baidu.com/it/u=3165460156,649373630&fm=224&app=112&f=JPEG?w=500&h=500',
|
||||
score: 0
|
||||
name: currentUser.value.name ||'玩家50920',
|
||||
avatar: currentUser.value.avatar||'/static/logo.png',
|
||||
score: 0,
|
||||
roundScores: [] // 存储每局的分数
|
||||
}
|
||||
])
|
||||
|
||||
@@ -106,7 +212,8 @@ const tablePlayer = {
|
||||
id: 'table',
|
||||
name: '台板',
|
||||
avatar: '/static/robot.png',
|
||||
score: 0
|
||||
score: 0,
|
||||
roundScores: [] // 存储每局的分数
|
||||
}
|
||||
|
||||
// 计算属性:动态返回包含或不包含台板玩家的列表
|
||||
@@ -151,8 +258,9 @@ const addPlayer = () => {
|
||||
const newPlayer = {
|
||||
id: `player_${Date.now()}`,
|
||||
name: playerName,
|
||||
avatar: '/static/people.png',
|
||||
score: 0
|
||||
avatar: '/static/avatar14.png',
|
||||
score: 0,
|
||||
roundScores: [] // 存储每局的分数
|
||||
}
|
||||
|
||||
// 添加到玩家列表
|
||||
@@ -229,91 +337,47 @@ const updateUserData = (updatedUser) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 当启用台板模式时,确保台板玩家信息正确
|
||||
if (tableMode.value) {
|
||||
const tablePlayerIndex = players.value.findIndex(p => p.id === 'table')
|
||||
if (tablePlayerIndex === -1) {
|
||||
// 如果需要,重新添加台板玩家(这通常不会发生,因为计算属性会处理)
|
||||
players.value.push(tablePlayer)
|
||||
}
|
||||
}
|
||||
// 将更新后的用户信息保存到本地存储
|
||||
uni.setStorageSync('userInfo', updatedUser)
|
||||
uni.setStorageSync('currentUserInfo', updatedUser)
|
||||
}
|
||||
|
||||
// 头像和昵称编辑功能已迁移到change页面
|
||||
|
||||
// 编辑分数
|
||||
const editScore = (index) => {
|
||||
console.log('编辑分数', index)
|
||||
const player = displayPlayers.value[index]
|
||||
// 编辑分数 - 点击分数时调用
|
||||
const editScore = (playerIndex) => {
|
||||
console.log('编辑分数,玩家索引:', playerIndex)
|
||||
|
||||
// 检查是否是台板玩家
|
||||
if (player.id === 'table') {
|
||||
// 台板玩家的分数编辑逻辑
|
||||
uni.showModal({
|
||||
title: '修改台板分数',
|
||||
content: `当前分数: ${player.score}`,
|
||||
editable: true,
|
||||
placeholderText: '请输入新分数',
|
||||
success: (res) => {
|
||||
if (res.confirm && res.content !== null) {
|
||||
const newScore = parseInt(res.content)
|
||||
if (!isNaN(newScore)) {
|
||||
// 找到台板玩家在原始数组中的位置
|
||||
const tableIndex = players.value.findIndex(p => p.id === 'table')
|
||||
if (tableIndex !== -1) {
|
||||
players.value[tableIndex].score = newScore
|
||||
} else {
|
||||
// 如果台板玩家不在原始数组中,创建一个副本并更新
|
||||
tablePlayer.score = newScore
|
||||
}
|
||||
|
||||
// 语音播报分数(如果开启)
|
||||
if (voiceBroadcast.value) {
|
||||
console.log(`语音播报: 台板 分数更新为 ${newScore}`)
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请输入有效的数字',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取当前选中的玩家
|
||||
const selectedPlayer = displayPlayers.value[playerIndex]
|
||||
|
||||
// 检查是否有局数记录
|
||||
if (rounds.value.length === 0) {
|
||||
uni.showToast({
|
||||
title: '暂无局数记录,无法编辑分数',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 普通玩家的分数编辑逻辑
|
||||
uni.showModal({
|
||||
title: '修改分数',
|
||||
content: `${player.score}`,
|
||||
editable: true,
|
||||
placeholderText: '请输入新分数',
|
||||
success: (res) => {
|
||||
if (res.confirm && res.content !== null) {
|
||||
const newScore = parseInt(res.content)
|
||||
if (!isNaN(newScore)) {
|
||||
// 找到对应的普通玩家
|
||||
const playerIndex = players.value.findIndex(p => p.id === player.id)
|
||||
if (playerIndex !== -1) {
|
||||
players.value[playerIndex].score = newScore
|
||||
}
|
||||
|
||||
// 语音播报分数(如果开启)
|
||||
if (voiceBroadcast.value) {
|
||||
console.log(`语音播报: ${player.name} 分数更新为 ${newScore}`)
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请输入有效的数字',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取当前局数
|
||||
const currentRound = rounds.value.length
|
||||
|
||||
// 准备要传递的玩家数据
|
||||
const playersToPass = [...displayPlayers.value]
|
||||
|
||||
// 保存到临时存储,用于页面间数据传递
|
||||
uni.setStorageSync('currentPlayers', JSON.stringify(playersToPass))
|
||||
// 保存当前局数
|
||||
uni.setStorageSync('currentRound', currentRound)
|
||||
// 保存选中的玩家索引
|
||||
uni.setStorageSync('selectedPlayerIndex', playerIndex)
|
||||
|
||||
// 跳转到计分页面进行分数编辑
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/singleplay/scoring'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 开局计分
|
||||
const startScoring = () => {
|
||||
console.log('开局计分')
|
||||
@@ -327,21 +391,17 @@ const startScoring = () => {
|
||||
return
|
||||
}
|
||||
|
||||
// 重置所有玩家分数
|
||||
players.value.forEach(player => {
|
||||
player.score = 0
|
||||
})
|
||||
|
||||
// 重置台板玩家分数(即使不在原始数组中)
|
||||
if (tableMode.value) {
|
||||
tablePlayer.score = 0
|
||||
}
|
||||
// 新增一局
|
||||
const newRound = rounds.value.length + 1
|
||||
rounds.value.push(newRound)
|
||||
|
||||
// 准备要传递的玩家数据
|
||||
const playersToPass = [...displayPlayers.value]
|
||||
|
||||
// 保存到临时存储,用于页面间数据传递
|
||||
uni.setStorageSync('currentPlayers', JSON.stringify(playersToPass))
|
||||
// 保存当前局数
|
||||
uni.setStorageSync('currentRound', newRound)
|
||||
|
||||
// 跳转到计分页面
|
||||
uni.navigateTo({
|
||||
@@ -380,6 +440,7 @@ const settleRoom = () => {
|
||||
onMounted(() => {
|
||||
console.log('单人模式页面加载完成')
|
||||
// 可以在这里初始化数据或加载用户信息
|
||||
getuserinfo();
|
||||
|
||||
// 生成随机房间号(4位数字)
|
||||
roomId.value = Math.floor(1000 + Math.random() * 9000).toString()
|
||||
@@ -398,16 +459,34 @@ onMounted(() => {
|
||||
const parsedPlayers = JSON.parse(updatedPlayers)
|
||||
console.log('收到更新的玩家数据:', parsedPlayers)
|
||||
|
||||
// 获取当前局数
|
||||
const currentRound = uni.getStorageSync('currentRound') || 1
|
||||
const roundIndex = currentRound - 1
|
||||
|
||||
// 更新玩家列表中的分数
|
||||
parsedPlayers.forEach(updatedPlayer => {
|
||||
// 查找对应的玩家
|
||||
const playerIndex = players.value.findIndex(p => p.id === updatedPlayer.id)
|
||||
if (playerIndex !== -1) {
|
||||
// 更新普通玩家的分数
|
||||
players.value[playerIndex].score = updatedPlayer.score
|
||||
// 更新普通玩家当前局的分数
|
||||
// 确保roundScores数组有足够的空间
|
||||
if (players.value[playerIndex].roundScores.length <= roundIndex) {
|
||||
players.value[playerIndex].roundScores.length = roundIndex + 1
|
||||
}
|
||||
// 保存当前局的分数
|
||||
players.value[playerIndex].roundScores[roundIndex] = updatedPlayer.score
|
||||
// 计算总分:所有局分数的总和
|
||||
players.value[playerIndex].score = players.value[playerIndex].roundScores.reduce((sum, score) => sum + (score || 0), 0)
|
||||
} else if (updatedPlayer.id === 'table') {
|
||||
// 更新台板玩家的分数
|
||||
tablePlayer.score = updatedPlayer.score
|
||||
// 更新台板玩家当前局的分数
|
||||
// 确保roundScores数组有足够的空间
|
||||
if (tablePlayer.roundScores.length <= roundIndex) {
|
||||
tablePlayer.roundScores.length = roundIndex + 1
|
||||
}
|
||||
// 保存当前局的分数
|
||||
tablePlayer.roundScores[roundIndex] = updatedPlayer.score
|
||||
// 计算总分:所有局分数的总和
|
||||
tablePlayer.score = tablePlayer.roundScores.reduce((sum, score) => sum + (score || 0), 0)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -422,18 +501,46 @@ onMounted(() => {
|
||||
// 监听页面显示事件
|
||||
uni.$on('updatePlayers', updateListener)
|
||||
|
||||
// 监听用户数据更新事件(来自change页面)
|
||||
const userDataListener = (updatedUser) => {
|
||||
updateUserData(updatedUser)
|
||||
}
|
||||
uni.$on('userDataUpdated', userDataListener)
|
||||
|
||||
// 监听页面显示生命周期
|
||||
uni.onShow(() => {
|
||||
updateListener()
|
||||
})
|
||||
|
||||
// 组件卸载时移除监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('updatePlayers', updateListener)
|
||||
|
||||
// 从本地存储获取最新的用户信息
|
||||
try {
|
||||
const storedUserInfo = uni.getStorageSync('userInfo');
|
||||
if (storedUserInfo) {
|
||||
console.log('从本地存储加载用户信息:', storedUserInfo);
|
||||
// 更新当前用户信息
|
||||
currentUser.value = { ...storedUserInfo };
|
||||
|
||||
// 更新玩家列表中的用户信息
|
||||
const selfPlayerIndex = players.value.findIndex(p => p.id === 'self');
|
||||
if (selfPlayerIndex !== -1) {
|
||||
players.value[selfPlayerIndex] = {
|
||||
...players.value[selfPlayerIndex],
|
||||
name: storedUserInfo.name,
|
||||
avatar: storedUserInfo.avatar
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('从本地存储获取用户信息失败:', error);
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
onUnmounted(() => {
|
||||
// 移除事件监听器
|
||||
uni.$off('updatePlayers');
|
||||
uni.$off('userDataUpdated');
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.singleplay {
|
||||
width: 750rpx;
|
||||
@@ -599,12 +706,16 @@ onMounted(() => {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 15rpx;
|
||||
|
||||
.header-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
.player-count {
|
||||
@@ -615,82 +726,111 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
/* 玩家表格容器 - 实现横向滚动 */
|
||||
.players-table-container {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid #e0e0e0;
|
||||
}
|
||||
|
||||
/* 垂直表格容器 - 实现垂直滚动和横向滑动 */
|
||||
.players-table-container.vertical {
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
max-height: 500rpx;
|
||||
-webkit-overflow-scrolling: touch; /* 优化移动端滚动体验 */
|
||||
}
|
||||
|
||||
/* 玩家表格 */
|
||||
.players-table {
|
||||
border: 1rpx solid #e0e0e0;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.table-header {
|
||||
min-width: 100%;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* 垂直表格样式 */
|
||||
.players-table.vertical {
|
||||
.table-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #f5f5f5;
|
||||
border-bottom: 1rpx solid #e0e0e0;
|
||||
|
||||
.player-column {
|
||||
flex: 2;
|
||||
padding: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
border-right: 1rpx solid #e0e0e0;
|
||||
}
|
||||
|
||||
.score-column {
|
||||
flex: 1;
|
||||
padding: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.table-body {
|
||||
.player-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1rpx solid #e0e0e0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.player-info {
|
||||
flex: 2;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 15rpx;
|
||||
padding: 15rpx;
|
||||
border-right: 1rpx solid #e0e0e0;
|
||||
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.score-display {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 15rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #007aff;
|
||||
|
||||
&:active {
|
||||
background-color: #f0f8ff;
|
||||
}
|
||||
}
|
||||
.header-row {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.header-cell {
|
||||
width: 150rpx;
|
||||
flex-shrink: 0;
|
||||
padding: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
border-right: 1rpx solid #e0e0e0;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.player-column {
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.score-column {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.data-cell {
|
||||
min-width: 120rpx;
|
||||
flex-shrink: 0;
|
||||
padding: 15rpx;
|
||||
border-right: 1rpx solid #e0e0e0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
/* 最后一列不需要右边框 */
|
||||
&:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
.player-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
width: 100%;
|
||||
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.score-display {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #007aff;
|
||||
|
||||
&:active {
|
||||
background-color: #f0f8ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
scoring/static/avatar14.png
Normal file
BIN
scoring/static/avatar14.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
1
scoring/unpackage/dist/dev/.sourcemap/mp-weixin/api/scoreRoom.js.map
vendored
Normal file
1
scoring/unpackage/dist/dev/.sourcemap/mp-weixin/api/scoreRoom.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scoreRoom.js","sources":["api/scoreRoom.js"],"sourcesContent":["import { GET, POST } from '@/utils/request.js'\n\n// 创建单人房间\nexport const createSingleRoom = (roomInfo) => {\n return POST('/score/room', roomInfo);\n}\n\n// 获取房间信息\nexport const getRoomInfo = (roomId) => {\n return GET(`/score/room/${roomId}`);\n}\n\n// 提交分数\nexport const submitScore = (scoreInfo) => {\n return POST('/system/detail', scoreInfo);\n}\n\n// 获取房间分数记录\nexport const getRoomScores = (roomId) => {\n return GET(`/system/detail/list?roomId=${roomId}`);\n}\n\n// 结算房间\nexport const settleRoom = (roomId) => {\n return POST(`/score/room/settle/${roomId}`);\n}\n\n// 获取用户房间列表\nexport const getUserRooms = (userId) => {\n return GET(`/score/room/list?createUser=${userId}`);\n}"],"names":["POST"],"mappings":";;AAaY,MAAC,cAAc,CAAC,cAAc;AACtC,SAAOA,cAAI,KAAC,kBAAkB,SAAS;AAC3C;;"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
scoring/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/singleplay/test.js.map
vendored
Normal file
1
scoring/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/singleplay/test.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
scoring/unpackage/dist/dev/.sourcemap/mp-weixin/pages/test/test.js.map
vendored
Normal file
1
scoring/unpackage/dist/dev/.sourcemap/mp-weixin/pages/test/test.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"CommonValues.js","sources":["utils/CommonValues.js"],"sourcesContent":["\r\nexport const BASE_URL = 'http://172.20.10.2:8080';\r\n// export const BASE_URL = 'https://www.jianxinghome.cn:8484';\r\n// export const BASE_URL = 'https://www.safeguardfull.cn:8484';\r\n\r\n\r\nexport const WEBSOCKET_URL = 'wss://www.safeguardfull.cn:8484/websocket';\r\nexport default {\r\n\tBASE_URL,\r\n\tWEBSOCKET_URL\r\n}"],"names":[],"mappings":";AACY,MAAC,WAAW;;"}
|
||||
{"version":3,"file":"CommonValues.js","sources":["utils/CommonValues.js"],"sourcesContent":["\r\nexport const BASE_URL = 'http://10.87.64.114:8080';\r\n// export const BASE_URL = 'https://www.jianxinghome.cn:8484';\r\n// export const BASE_URL = 'https://www.safeguardfull.cn:8484';\r\n\r\n\r\nexport const WEBSOCKET_URL = 'wss://www.safeguardfull.cn:8484/websocket';\r\nexport default {\r\n\tBASE_URL,\r\n\tWEBSOCKET_URL\r\n}"],"names":[],"mappings":";AACY,MAAC,WAAW;;"}
|
||||
File diff suppressed because one or more lines are too long
@@ -7046,9 +7046,9 @@ function isConsoleWritable() {
|
||||
return isWritable;
|
||||
}
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "192.168.124.114,127.0.0.1";
|
||||
const hosts = "10.87.64.114,127.0.0.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_rbm27H";
|
||||
const id = "mp-weixin_RXuSqC";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const app = require("../../../app.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "change",
|
||||
setup(__props) {
|
||||
const userInfo = common_vendor.ref({
|
||||
id: "",
|
||||
nickName: "",
|
||||
avatarUrl: ""
|
||||
name: "",
|
||||
avatar: ""
|
||||
});
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.userData) {
|
||||
@@ -23,21 +14,12 @@ const _sfc_main = {
|
||||
const data = JSON.parse(decodeURIComponent(options.userData));
|
||||
userInfo.value = { ...data };
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/change.vue:55", "解析用户数据失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/change.vue:45", "解析用户数据失败:", e);
|
||||
}
|
||||
}
|
||||
if (options.from) {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/change.vue:61", "来源页面:", options.from);
|
||||
}
|
||||
});
|
||||
const goBack = () => {
|
||||
if (userInfo.value.nickName.trim()) {
|
||||
app.updateGlobalUserInfo(userInfo.value);
|
||||
}
|
||||
common_vendor.wx$1.navigateBack();
|
||||
};
|
||||
const chooseNewAvatar = () => {
|
||||
common_vendor.wx$1.chooseMedia({
|
||||
common_vendor.index.chooseMedia({
|
||||
count: 1,
|
||||
mediaType: ["image"],
|
||||
sourceType: ["album", "camera"],
|
||||
@@ -46,18 +28,18 @@ const _sfc_main = {
|
||||
success: (res) => {
|
||||
try {
|
||||
const tempFilePath = res.tempFiles[0].tempFilePath;
|
||||
userInfo.value.avatarUrl = tempFilePath;
|
||||
userInfo.value.avatar = tempFilePath;
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/change.vue:90", "处理头像文件路径失败:", error);
|
||||
common_vendor.wx$1.showToast({
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/change.vue:69", "处理头像文件路径失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "头像设置失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/change.vue:98", "选择图片失败:", err);
|
||||
common_vendor.wx$1.showToast({
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/change.vue:77", "选择图片失败:", err);
|
||||
common_vendor.index.showToast({
|
||||
title: "选择图片失败",
|
||||
icon: "none"
|
||||
});
|
||||
@@ -65,47 +47,41 @@ const _sfc_main = {
|
||||
});
|
||||
};
|
||||
const saveUserInfo = () => {
|
||||
if (!userInfo.value.nickName.trim()) {
|
||||
common_vendor.wx$1.showToast({
|
||||
if (!userInfo.value.name.trim()) {
|
||||
common_vendor.index.showToast({
|
||||
title: "昵称不能为空",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
app.updateGlobalUserInfo(userInfo.value);
|
||||
const pages = getCurrentPages();
|
||||
const prevPage = pages[pages.length - 2];
|
||||
if (prevPage) {
|
||||
if (prevPage.$vm && prevPage.$vm.updateUserData) {
|
||||
prevPage.$vm.updateUserData(userInfo.value);
|
||||
} else {
|
||||
common_vendor.wx$1.$emit && common_vendor.wx$1.$emit("userDataUpdated", userInfo.value);
|
||||
}
|
||||
}
|
||||
common_vendor.wx$1.showToast({
|
||||
common_vendor.index.$emit("userDataUpdated", userInfo.value);
|
||||
common_vendor.index.setStorageSync("userInfo", userInfo.value);
|
||||
common_vendor.index.setStorageSync("currentUserInfo", userInfo.value);
|
||||
common_vendor.index.showToast({
|
||||
title: "保存成功",
|
||||
icon: "success",
|
||||
duration: 1500,
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
common_vendor.wx$1.navigateBack();
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
type: "left",
|
||||
size: "22",
|
||||
color: "#fff"
|
||||
}),
|
||||
b: common_vendor.o(goBack),
|
||||
c: userInfo.value.nickName,
|
||||
d: common_vendor.o(($event) => userInfo.value.nickName = $event.detail.value),
|
||||
e: userInfo.value.avatarUrl || "/static/logo.png",
|
||||
f: common_vendor.o(chooseNewAvatar),
|
||||
g: common_vendor.o(saveUserInfo)
|
||||
a: userInfo.value.name,
|
||||
b: common_vendor.o(($event) => userInfo.value.name = $event.detail.value),
|
||||
c: userInfo.value.avatar || "/static/logo.png",
|
||||
d: common_vendor.o(chooseNewAvatar),
|
||||
e: common_vendor.o(saveUserInfo)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "用户信息",
|
||||
"navigationBarHidden": true,
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view class="container data-v-9c38dc47"><view class="header data-v-9c38dc47"><view class="back-btn data-v-9c38dc47" bindtap="{{b}}"><uni-icons wx:if="{{a}}" class="data-v-9c38dc47" u-i="9c38dc47-0" bind:__l="__l" u-p="{{a}}"/></view><view class="title data-v-9c38dc47">用户信息</view><view class="placeholder data-v-9c38dc47"></view></view><view class="content data-v-9c38dc47"><view class="form-item data-v-9c38dc47"><view class="label data-v-9c38dc47">昵称:</view><input class="input data-v-9c38dc47" placeholder="请输入昵称" value="{{c}}" bindinput="{{d}}"/></view><view class="form-item data-v-9c38dc47"><view class="label data-v-9c38dc47">头像:</view><view class="avatar-wrapper data-v-9c38dc47" bindtap="{{f}}"><image src="{{e}}" mode="aspectFill" class="avatar data-v-9c38dc47"/><view class="avatar-tip data-v-9c38dc47">点击更新头像</view></view></view><button class="save-btn data-v-9c38dc47" bindtap="{{g}}">保存</button></view></view>
|
||||
<view class="container data-v-9c38dc47"><view class="content data-v-9c38dc47"><view class="form-item data-v-9c38dc47"><view class="label data-v-9c38dc47">昵称:</view><input class="input data-v-9c38dc47" placeholder="请输入昵称" value="{{a}}" bindinput="{{b}}"/></view><view class="form-item data-v-9c38dc47"><view class="label data-v-9c38dc47">头像:</view><view class="avatar-wrapper data-v-9c38dc47" bindtap="{{d}}"><image src="{{c}}" mode="aspectFill" class="avatar data-v-9c38dc47"/><view class="avatar-tip data-v-9c38dc47">点击更新头像</view></view></view><button class="save-btn data-v-9c38dc47" bindtap="{{e}}">保存</button></view></view>
|
||||
@@ -1,9 +1,7 @@
|
||||
|
||||
.container.data-v-9c38dc47 {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 自定义头部 */
|
||||
.header.data-v-9c38dc47 {
|
||||
display: flex;
|
||||
@@ -32,7 +30,6 @@
|
||||
.placeholder.data-v-9c38dc47 {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
/* 内容区域 */
|
||||
.content.data-v-9c38dc47 {
|
||||
padding: 20rpx;
|
||||
@@ -62,7 +59,6 @@
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
/* 头像样式 */
|
||||
.avatar-wrapper.data-v-9c38dc47 {
|
||||
flex: 1;
|
||||
@@ -80,7 +76,6 @@
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 保存按钮 */
|
||||
.save-btn.data-v-9c38dc47 {
|
||||
width: 100%;
|
||||
|
||||
@@ -32,7 +32,7 @@ const _sfc_main = {
|
||||
saveHistoryState();
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/scoring.vue:142", "加载玩家数据失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/scoring.vue:141", "加载玩家数据失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "加载数据失败",
|
||||
icon: "none"
|
||||
@@ -187,26 +187,6 @@ const _sfc_main = {
|
||||
icon: "success"
|
||||
});
|
||||
};
|
||||
const nextRound = () => {
|
||||
common_vendor.index.showModal({
|
||||
title: "确认",
|
||||
content: "确定要开始下一局吗?",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
saveHistoryState();
|
||||
players.value.forEach((player) => {
|
||||
player.score = 0;
|
||||
player.result = "";
|
||||
});
|
||||
roundCount.value++;
|
||||
common_vendor.index.showToast({
|
||||
title: `第${roundCount.value}局`,
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const playSound = () => {
|
||||
const innerAudioContext = common_vendor.index.createInnerAudioContext();
|
||||
innerAudioContext.src = "/static/sound/click.mp3";
|
||||
@@ -257,7 +237,7 @@ const _sfc_main = {
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/scoring.vue:454", "结束对局失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/scoring.vue:453", "结束对局失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none"
|
||||
@@ -268,12 +248,19 @@ const _sfc_main = {
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/scoring.vue:467", "计分页面加载完成");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/scoring.vue:466", "计分页面加载完成");
|
||||
loadPlayersData();
|
||||
const savedSound = common_vendor.index.getStorageSync("soundEnabled");
|
||||
if (savedSound !== "") {
|
||||
soundEnabled.value = savedSound;
|
||||
}
|
||||
const selectedIndex = common_vendor.index.getStorageSync("selectedPlayerIndex");
|
||||
if (selectedIndex !== "" && players.value.length > 0) {
|
||||
setTimeout(() => {
|
||||
selectPlayer(parseInt(selectedIndex));
|
||||
common_vendor.index.removeStorageSync("selectedPlayerIndex");
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
});
|
||||
@@ -328,8 +315,7 @@ const _sfc_main = {
|
||||
} : {}, {
|
||||
y: !showKeyboard.value
|
||||
}, !showKeyboard.value ? {
|
||||
z: common_vendor.o(nextRound),
|
||||
A: common_vendor.o(endGame)
|
||||
z: common_vendor.o(endGame)
|
||||
} : {});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="scoring-page data-v-94d9c592"><view class="header data-v-94d9c592"><view class="back-btn data-v-94d9c592" bindtap="{{b}}"><uni-icons wx:if="{{a}}" class="data-v-94d9c592" u-i="94d9c592-0" bind:__l="__l" u-p="{{a}}"></uni-icons></view><view class="title data-v-94d9c592">第{{c}}局</view><view class="header-right data-v-94d9c592"><view class="more-btn data-v-94d9c592" bindtap="{{d}}">...</view><view class="separator data-v-94d9c592"></view><view class="sound-toggle data-v-94d9c592" bindtap="{{f}}"><text class="sound-icon data-v-94d9c592">{{e}}</text></view></view></view><view class="players-list data-v-94d9c592"><view class="list-header data-v-94d9c592"><view class="col-player data-v-94d9c592">玩家</view><view class="col-result data-v-94d9c592">胜负</view><view class="col-score data-v-94d9c592">得分</view></view><view wx:for="{{g}}" wx:for-item="player" wx:key="l" class="{{['player-row', 'data-v-94d9c592', player.m && 'selected']}}" bindtap="{{player.n}}"><view class="col-player data-v-94d9c592"><image src="{{player.a}}" mode="aspectFill" class="player-avatar data-v-94d9c592"></image><text class="player-name data-v-94d9c592">{{player.b}}</text></view><view class="col-result data-v-94d9c592"><view class="result-buttons data-v-94d9c592"><button class="{{['result-btn', 'win', 'data-v-94d9c592', player.c && 'active']}}" catchtap="{{player.d}}">胜</button><button class="{{['result-btn', 'lose', 'data-v-94d9c592', player.e && 'active']}}" catchtap="{{player.f}}">负</button></view></view><view class="col-score data-v-94d9c592"><view class="score-input-container data-v-94d9c592"><input type="number" class="score-input data-v-94d9c592" value="{{player.g}}" catchfocus="{{player.h}}" catchtap="{{player.i}}" readonly disabled/><button class="combine-btn data-v-94d9c592" catchtap="{{player.j}}" disabled="{{player.k}}">合分</button></view></view></view></view><view wx:if="{{h}}" class="number-keyboard data-v-94d9c592"><view class="keyboard-row data-v-94d9c592"><view class="key data-v-94d9c592" bindtap="{{i}}">1</view><view class="key data-v-94d9c592" bindtap="{{j}}">2</view><view class="key data-v-94d9c592" bindtap="{{k}}">3</view><view class="key operation data-v-94d9c592" bindtap="{{l}}">+</view><view class="key delete data-v-94d9c592" bindtap="{{m}}"><text class="data-v-94d9c592">⌫</text></view></view><view class="keyboard-row data-v-94d9c592"><view class="key data-v-94d9c592" bindtap="{{n}}">4</view><view class="key data-v-94d9c592" bindtap="{{o}}">5</view><view class="key data-v-94d9c592" bindtap="{{p}}">6</view><view class="key operation data-v-94d9c592" bindtap="{{q}}">-</view><view class="key empty data-v-94d9c592"></view></view><view class="keyboard-row data-v-94d9c592"><view class="key data-v-94d9c592" bindtap="{{r}}">7</view><view class="key data-v-94d9c592" bindtap="{{s}}">8</view><view class="key data-v-94d9c592" bindtap="{{t}}">9</view><view class="key operation data-v-94d9c592" bindtap="{{v}}">C</view><view class="key confirm data-v-94d9c592" bindtap="{{w}}">提交</view></view><view class="keyboard-row data-v-94d9c592"><view class="key zero data-v-94d9c592" bindtap="{{x}}">0</view></view></view><view wx:if="{{y}}" class="bottom-actions data-v-94d9c592"><button class="action-btn data-v-94d9c592" type="default" bindtap="{{z}}">下一局</button><button class="action-btn primary data-v-94d9c592" type="primary" bindtap="{{A}}">结束对局</button></view></view>
|
||||
<view class="scoring-page data-v-94d9c592"><view class="header data-v-94d9c592"><view class="back-btn data-v-94d9c592" bindtap="{{b}}"><uni-icons wx:if="{{a}}" class="data-v-94d9c592" u-i="94d9c592-0" bind:__l="__l" u-p="{{a}}"></uni-icons></view><view class="title data-v-94d9c592">第{{c}}局</view><view class="header-right data-v-94d9c592"><view class="more-btn data-v-94d9c592" bindtap="{{d}}">...</view><view class="separator data-v-94d9c592"></view><view class="sound-toggle data-v-94d9c592" bindtap="{{f}}"><text class="sound-icon data-v-94d9c592">{{e}}</text></view></view></view><view class="players-list data-v-94d9c592"><view class="list-header data-v-94d9c592"><view class="col-player data-v-94d9c592">玩家</view><view class="col-result data-v-94d9c592">胜负</view><view class="col-score data-v-94d9c592">得分</view></view><view wx:for="{{g}}" wx:for-item="player" wx:key="l" class="{{['player-row', 'data-v-94d9c592', player.m && 'selected']}}" bindtap="{{player.n}}"><view class="col-player data-v-94d9c592"><image src="{{player.a}}" mode="aspectFill" class="player-avatar data-v-94d9c592"></image><text class="player-name data-v-94d9c592">{{player.b}}</text></view><view class="col-result data-v-94d9c592"><view class="result-buttons data-v-94d9c592"><button class="{{['result-btn', 'win', 'data-v-94d9c592', player.c && 'active']}}" catchtap="{{player.d}}">胜</button><button class="{{['result-btn', 'lose', 'data-v-94d9c592', player.e && 'active']}}" catchtap="{{player.f}}">负</button></view></view><view class="col-score data-v-94d9c592"><view class="score-input-container data-v-94d9c592"><input type="number" class="score-input data-v-94d9c592" value="{{player.g}}" catchfocus="{{player.h}}" catchtap="{{player.i}}" readonly disabled/><button class="combine-btn data-v-94d9c592" catchtap="{{player.j}}" disabled="{{player.k}}">合分</button></view></view></view></view><view wx:if="{{h}}" class="number-keyboard data-v-94d9c592"><view class="keyboard-row data-v-94d9c592"><view class="key data-v-94d9c592" bindtap="{{i}}">1</view><view class="key data-v-94d9c592" bindtap="{{j}}">2</view><view class="key data-v-94d9c592" bindtap="{{k}}">3</view><view class="key operation data-v-94d9c592" bindtap="{{l}}">+</view><view class="key delete data-v-94d9c592" bindtap="{{m}}"><text class="data-v-94d9c592">⌫</text></view></view><view class="keyboard-row data-v-94d9c592"><view class="key data-v-94d9c592" bindtap="{{n}}">4</view><view class="key data-v-94d9c592" bindtap="{{o}}">5</view><view class="key data-v-94d9c592" bindtap="{{p}}">6</view><view class="key operation data-v-94d9c592" bindtap="{{q}}">-</view><view class="key empty data-v-94d9c592"></view></view><view class="keyboard-row data-v-94d9c592"><view class="key data-v-94d9c592" bindtap="{{r}}">7</view><view class="key data-v-94d9c592" bindtap="{{s}}">8</view><view class="key data-v-94d9c592" bindtap="{{t}}">9</view><view class="key operation data-v-94d9c592" bindtap="{{v}}">C</view><view class="key confirm data-v-94d9c592" bindtap="{{w}}">提交</view></view><view class="keyboard-row data-v-94d9c592"><view class="key zero data-v-94d9c592" bindtap="{{x}}">0</view></view></view><view wx:if="{{y}}" class="bottom-actions data-v-94d9c592"><button class="action-btn primary data-v-94d9c592" type="primary" bindtap="{{z}}">结束对局</button></view></view>
|
||||
@@ -1,30 +1,92 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const common_assets = require("../../../common/assets.js");
|
||||
const utils_request = require("../../../utils/request.js");
|
||||
const utils_CommonValues = require("../../../utils/CommonValues.js");
|
||||
const _sfc_main = {
|
||||
__name: "singleplay",
|
||||
setup(__props) {
|
||||
common_vendor.ref(null);
|
||||
const getuserinfo = () => {
|
||||
utils_request.GET("/score/info/list", null).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:113", "获取用户信息成功:", res.data);
|
||||
if (res.data && res.data.code === 200 && Array.isArray(res.data.rows)) {
|
||||
const userList = res.data.rows;
|
||||
const selfPlayer = players.value.find((p) => p.id === "self");
|
||||
players.value = selfPlayer ? [selfPlayer] : [];
|
||||
userList.forEach((user) => {
|
||||
if (user.nickName) {
|
||||
let avatarUrl = user.avatars;
|
||||
if (avatarUrl) {
|
||||
if (avatarUrl.startsWith("/")) {
|
||||
avatarUrl = `${utils_CommonValues.BASE_URL}${avatarUrl}`;
|
||||
} else if (!avatarUrl.startsWith("http://") && !avatarUrl.startsWith("https://")) {
|
||||
avatarUrl = `${utils_CommonValues.BASE_URL}/${avatarUrl}`;
|
||||
}
|
||||
} else {
|
||||
avatarUrl = "/static/avatar14.png";
|
||||
}
|
||||
const newPlayer = {
|
||||
id: `player_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
||||
name: user.nickName,
|
||||
// 使用API返回的nickName作为玩家名称
|
||||
avatar: avatarUrl,
|
||||
// 使用处理后的头像URL
|
||||
score: 0,
|
||||
roundScores: []
|
||||
};
|
||||
players.value.push(newPlayer);
|
||||
}
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:152", "玩家列表更新完成:", players.value);
|
||||
common_vendor.index.showToast({
|
||||
title: `成功添加${userList.length}位玩家`,
|
||||
icon: "success"
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:158", "API返回数据结构异常:", res.data);
|
||||
common_vendor.index.showToast({
|
||||
title: "获取玩家信息失败,数据结构异常",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}).catch((err) => {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:165", "获取用户信息失败:", err);
|
||||
const errorMsg = err.userFriendlyMsg || "获取玩家信息失败";
|
||||
common_vendor.index.showToast({
|
||||
title: errorMsg,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
});
|
||||
};
|
||||
const voiceBroadcast = common_vendor.ref(false);
|
||||
const tableMode = common_vendor.ref(false);
|
||||
const roomId = common_vendor.ref("");
|
||||
const storedUserInfo = common_vendor.index.getStorageSync("userInfo");
|
||||
const currentUser = common_vendor.ref({
|
||||
id: "self",
|
||||
name: "玩家50950",
|
||||
avatar: "https://t14.baidu.com/it/u=3165460156,649373630&fm=224&app=112&f=JPEG?w=500&h=500"
|
||||
name: (storedUserInfo == null ? void 0 : storedUserInfo.name) || "玩家50920",
|
||||
avatar: (storedUserInfo == null ? void 0 : storedUserInfo.avatar) || "/static/logo.png"
|
||||
});
|
||||
const rounds = common_vendor.ref([]);
|
||||
const players = common_vendor.ref([
|
||||
{
|
||||
id: "self",
|
||||
name: "玩家50950",
|
||||
avatar: "https://t14.baidu.com/it/u=3165460156,649373630&fm=224&app=112&f=JPEG?w=500&h=500",
|
||||
score: 0
|
||||
name: currentUser.value.name || "玩家50920",
|
||||
avatar: currentUser.value.avatar || "/static/logo.png",
|
||||
score: 0,
|
||||
roundScores: []
|
||||
// 存储每局的分数
|
||||
}
|
||||
]);
|
||||
const tablePlayer = {
|
||||
id: "table",
|
||||
name: "台板",
|
||||
avatar: "/static/robot.png",
|
||||
score: 0
|
||||
score: 0,
|
||||
roundScores: []
|
||||
// 存储每局的分数
|
||||
};
|
||||
const displayPlayers = common_vendor.computed(() => {
|
||||
if (tableMode.value) {
|
||||
@@ -38,7 +100,7 @@ const _sfc_main = {
|
||||
}
|
||||
});
|
||||
const addPlayer = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:130", "添加玩家");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:237", "添加玩家");
|
||||
const defaultPlayerName = "请输入玩家名称";
|
||||
common_vendor.index.showModal({
|
||||
title: "添加玩家",
|
||||
@@ -54,8 +116,10 @@ const _sfc_main = {
|
||||
const newPlayer = {
|
||||
id: `player_${Date.now()}`,
|
||||
name: playerName,
|
||||
avatar: "/static/people.png",
|
||||
score: 0
|
||||
avatar: "/static/avatar14.png",
|
||||
score: 0,
|
||||
roundScores: []
|
||||
// 存储每局的分数
|
||||
};
|
||||
players.value.push(newPlayer);
|
||||
if (voiceBroadcast.value) {
|
||||
@@ -72,12 +136,12 @@ const _sfc_main = {
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:177", "添加玩家失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:285", "添加玩家失败:", err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const transferScorer = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:184", "转让计分员");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:292", "转让计分员");
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "房间内暂无扫码或分享加入房间的玩家,无法转让计分员。",
|
||||
@@ -85,81 +149,55 @@ const _sfc_main = {
|
||||
confirmText: "确定",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:196", "用户确认提示");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:304", "用户确认提示");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:200", "显示提示失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:308", "显示提示失败:", err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const editUserInfo = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:207", "跳转到用户信息编辑页面");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:315", "跳转到用户信息编辑页面");
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/index/singleplay/change?userData=${encodeURIComponent(JSON.stringify(currentUser.value))}`
|
||||
});
|
||||
};
|
||||
const editScore = (index) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:246", "编辑分数", index);
|
||||
const player = displayPlayers.value[index];
|
||||
if (player.id === "table") {
|
||||
common_vendor.index.showModal({
|
||||
title: "修改台板分数",
|
||||
content: `当前分数: ${player.score}`,
|
||||
editable: true,
|
||||
placeholderText: "请输入新分数",
|
||||
success: (res) => {
|
||||
if (res.confirm && res.content !== null) {
|
||||
const newScore = parseInt(res.content);
|
||||
if (!isNaN(newScore)) {
|
||||
const tableIndex = players.value.findIndex((p) => p.id === "table");
|
||||
if (tableIndex !== -1) {
|
||||
players.value[tableIndex].score = newScore;
|
||||
} else {
|
||||
tablePlayer.score = newScore;
|
||||
}
|
||||
if (voiceBroadcast.value) {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:272", `语音播报: 台板 分数更新为 ${newScore}`);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入有效的数字",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
const updateUserData = (updatedUser) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:325", "更新用户数据", updatedUser);
|
||||
currentUser.value = { ...updatedUser };
|
||||
const selfPlayerIndex = players.value.findIndex((p) => p.id === "self");
|
||||
if (selfPlayerIndex !== -1) {
|
||||
players.value[selfPlayerIndex] = {
|
||||
...players.value[selfPlayerIndex],
|
||||
name: updatedUser.name,
|
||||
avatar: updatedUser.avatar
|
||||
};
|
||||
}
|
||||
common_vendor.index.setStorageSync("userInfo", updatedUser);
|
||||
common_vendor.index.setStorageSync("currentUserInfo", updatedUser);
|
||||
};
|
||||
const editScore = (playerIndex) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:347", "编辑分数,玩家索引:", playerIndex);
|
||||
displayPlayers.value[playerIndex];
|
||||
if (rounds.value.length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "暂无局数记录,无法编辑分数",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showModal({
|
||||
title: "修改分数",
|
||||
content: `${player.score}`,
|
||||
editable: true,
|
||||
placeholderText: "请输入新分数",
|
||||
success: (res) => {
|
||||
if (res.confirm && res.content !== null) {
|
||||
const newScore = parseInt(res.content);
|
||||
if (!isNaN(newScore)) {
|
||||
const playerIndex = players.value.findIndex((p) => p.id === player.id);
|
||||
if (playerIndex !== -1) {
|
||||
players.value[playerIndex].score = newScore;
|
||||
}
|
||||
if (voiceBroadcast.value) {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:304", `语音播报: ${player.name} 分数更新为 ${newScore}`);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入有效的数字",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
const currentRound = rounds.value.length;
|
||||
const playersToPass = [...displayPlayers.value];
|
||||
common_vendor.index.setStorageSync("currentPlayers", JSON.stringify(playersToPass));
|
||||
common_vendor.index.setStorageSync("currentRound", currentRound);
|
||||
common_vendor.index.setStorageSync("selectedPlayerIndex", playerIndex);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/index/singleplay/scoring"
|
||||
});
|
||||
};
|
||||
const startScoring = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:319", "开局计分");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:383", "开局计分");
|
||||
if (displayPlayers.value.length < 2) {
|
||||
common_vendor.index.showToast({
|
||||
title: "玩家数不超过两个人时无法点击进行开始计分",
|
||||
@@ -167,20 +205,17 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
players.value.forEach((player) => {
|
||||
player.score = 0;
|
||||
});
|
||||
if (tableMode.value) {
|
||||
tablePlayer.score = 0;
|
||||
}
|
||||
const newRound = rounds.value.length + 1;
|
||||
rounds.value.push(newRound);
|
||||
const playersToPass = [...displayPlayers.value];
|
||||
common_vendor.index.setStorageSync("currentPlayers", JSON.stringify(playersToPass));
|
||||
common_vendor.index.setStorageSync("currentRound", newRound);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/index/singleplay/scoring"
|
||||
});
|
||||
};
|
||||
const settleRoom = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:354", "结算房间");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:414", "结算房间");
|
||||
let result = "结算结果:\n";
|
||||
displayPlayers.value.forEach((player) => {
|
||||
result += `${player.name}: ${player.score}分
|
||||
@@ -202,7 +237,8 @@ const _sfc_main = {
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:381", "单人模式页面加载完成");
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:441", "单人模式页面加载完成");
|
||||
getuserinfo();
|
||||
roomId.value = Math.floor(1e3 + Math.random() * 9e3).toString();
|
||||
common_vendor.index.setNavigationBarTitle({
|
||||
title: `单人 - ${roomId.value}号房间`
|
||||
@@ -212,28 +248,60 @@ const _sfc_main = {
|
||||
if (updatedPlayers) {
|
||||
try {
|
||||
const parsedPlayers = JSON.parse(updatedPlayers);
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:399", "收到更新的玩家数据:", parsedPlayers);
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:460", "收到更新的玩家数据:", parsedPlayers);
|
||||
const currentRound = common_vendor.index.getStorageSync("currentRound") || 1;
|
||||
const roundIndex = currentRound - 1;
|
||||
parsedPlayers.forEach((updatedPlayer) => {
|
||||
const playerIndex = players.value.findIndex((p) => p.id === updatedPlayer.id);
|
||||
if (playerIndex !== -1) {
|
||||
players.value[playerIndex].score = updatedPlayer.score;
|
||||
if (players.value[playerIndex].roundScores.length <= roundIndex) {
|
||||
players.value[playerIndex].roundScores.length = roundIndex + 1;
|
||||
}
|
||||
players.value[playerIndex].roundScores[roundIndex] = updatedPlayer.score;
|
||||
players.value[playerIndex].score = players.value[playerIndex].roundScores.reduce((sum, score) => sum + (score || 0), 0);
|
||||
} else if (updatedPlayer.id === "table") {
|
||||
tablePlayer.score = updatedPlayer.score;
|
||||
if (tablePlayer.roundScores.length <= roundIndex) {
|
||||
tablePlayer.roundScores.length = roundIndex + 1;
|
||||
}
|
||||
tablePlayer.roundScores[roundIndex] = updatedPlayer.score;
|
||||
tablePlayer.score = tablePlayer.roundScores.reduce((sum, score) => sum + (score || 0), 0);
|
||||
}
|
||||
});
|
||||
common_vendor.index.removeStorageSync("updatedPlayers");
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:417", "解析更新的玩家数据失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:496", "解析更新的玩家数据失败:", error);
|
||||
}
|
||||
}
|
||||
};
|
||||
common_vendor.index.$on("updatePlayers", updateListener);
|
||||
const userDataListener = (updatedUser) => {
|
||||
updateUserData(updatedUser);
|
||||
};
|
||||
common_vendor.index.$on("userDataUpdated", userDataListener);
|
||||
common_vendor.index.onShow(() => {
|
||||
updateListener();
|
||||
try {
|
||||
const storedUserInfo2 = common_vendor.index.getStorageSync("userInfo");
|
||||
if (storedUserInfo2) {
|
||||
common_vendor.index.__f__("log", "at pages/index/singleplay/singleplay.vue:518", "从本地存储加载用户信息:", storedUserInfo2);
|
||||
currentUser.value = { ...storedUserInfo2 };
|
||||
const selfPlayerIndex = players.value.findIndex((p) => p.id === "self");
|
||||
if (selfPlayerIndex !== -1) {
|
||||
players.value[selfPlayerIndex] = {
|
||||
...players.value[selfPlayerIndex],
|
||||
name: storedUserInfo2.name,
|
||||
avatar: storedUserInfo2.avatar
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/singleplay/singleplay.vue:533", "从本地存储获取用户信息失败:", error);
|
||||
}
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.index.$off("updatePlayers", updateListener);
|
||||
});
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.index.$off("updatePlayers");
|
||||
common_vendor.index.$off("userDataUpdated");
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
@@ -253,13 +321,30 @@ const _sfc_main = {
|
||||
return {
|
||||
a: player.avatar,
|
||||
b: common_vendor.t(player.name),
|
||||
c: common_vendor.t(player.score),
|
||||
d: common_vendor.o(($event) => editScore(index), player.id),
|
||||
e: player.id
|
||||
c: player.id
|
||||
};
|
||||
}),
|
||||
n: common_vendor.o(startScoring),
|
||||
o: common_vendor.o(settleRoom)
|
||||
n: common_vendor.f(displayPlayers.value, (player, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(player.score),
|
||||
b: player.id
|
||||
};
|
||||
}),
|
||||
o: common_vendor.f(rounds.value, (round, roundIndex, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(round),
|
||||
b: common_vendor.f(displayPlayers.value, (player, playerIndex, i1) => {
|
||||
return {
|
||||
a: common_vendor.t(player.roundScores[roundIndex] || 0),
|
||||
b: common_vendor.o(($event) => editScore(_ctx.index), player.id),
|
||||
c: player.id
|
||||
};
|
||||
}),
|
||||
c: round
|
||||
};
|
||||
}),
|
||||
p: common_vendor.o(startScoring),
|
||||
q: common_vendor.o(settleRoom)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="singleplay data-v-d36a0b1a"><view class="top-functions data-v-d36a0b1a"><view class="function-btn data-v-d36a0b1a" bindtap="{{b}}"><image src="{{a}}" class="btn-icon data-v-d36a0b1a" mode="aspectFill"></image><text class="data-v-d36a0b1a">添加玩家</text></view><view class="function-btn data-v-d36a0b1a" bindtap="{{d}}"><image src="{{c}}" class="btn-icon data-v-d36a0b1a" mode="aspectFill"></image><text class="data-v-d36a0b1a">转让计分员</text></view><view class="switch-group data-v-d36a0b1a"><text class="data-v-d36a0b1a">语音播报</text><switch class="data-v-d36a0b1a" checked="{{e}}" bindchange="{{f}}" color="#007aff"/></view><view class="switch-group data-v-d36a0b1a"><text class="data-v-d36a0b1a">台板</text><switch class="data-v-d36a0b1a" checked="{{g}}" bindchange="{{h}}" color="#007aff"/></view></view><view class="game-record data-v-d36a0b1a"><view class="record-title data-v-d36a0b1a"> 对局记录 <text class="hint data-v-d36a0b1a">点击对局分数进行修改</text></view><view class="user-section data-v-d36a0b1a"><text class="user-hint data-v-d36a0b1a">点击自己头像编辑用户头像和昵称~</text><view class="user-info data-v-d36a0b1a" bindtap="{{k}}"><image class="user-avatar data-v-d36a0b1a" src="{{i}}" mode="aspectFill"></image><view class="user-details data-v-d36a0b1a"><view class="user-name data-v-d36a0b1a">{{j}} <text class="self-tag data-v-d36a0b1a">自己</text></view></view></view></view><view class="players-section data-v-d36a0b1a"><view class="section-header data-v-d36a0b1a"><text class="header-title data-v-d36a0b1a">玩家</text><text class="player-count data-v-d36a0b1a">({{l}}位)</text></view><view class="players-table data-v-d36a0b1a"><view class="table-header data-v-d36a0b1a"><view class="player-column data-v-d36a0b1a">玩家</view><view class="score-column data-v-d36a0b1a">总分</view></view><view class="table-body data-v-d36a0b1a"><view wx:for="{{m}}" wx:for-item="player" wx:key="e" class="player-row data-v-d36a0b1a"><view class="player-info data-v-d36a0b1a"><image class="data-v-d36a0b1a" src="{{player.a}}" mode="aspectFill"></image><text class="data-v-d36a0b1a">{{player.b}}</text></view><view class="score-display data-v-d36a0b1a" bindtap="{{player.d}}">{{player.c}}</view></view></view></view></view></view><view class="bottom-buttons data-v-d36a0b1a"><button class="start-btn data-v-d36a0b1a" type="primary" bindtap="{{n}}">开局计分</button><button class="settle-btn data-v-d36a0b1a" type="default" bindtap="{{o}}">结算房间</button></view></view>
|
||||
<view class="singleplay data-v-d36a0b1a"><view class="top-functions data-v-d36a0b1a"><view class="function-btn data-v-d36a0b1a" bindtap="{{b}}"><image src="{{a}}" class="btn-icon data-v-d36a0b1a" mode="aspectFill"></image><text class="data-v-d36a0b1a">添加玩家</text></view><view class="function-btn data-v-d36a0b1a" bindtap="{{d}}"><image src="{{c}}" class="btn-icon data-v-d36a0b1a" mode="aspectFill"></image><text class="data-v-d36a0b1a">转让计分员</text></view><view class="switch-group data-v-d36a0b1a"><text class="data-v-d36a0b1a">语音播报</text><switch class="data-v-d36a0b1a" checked="{{e}}" bindchange="{{f}}" color="#007aff"/></view><view class="switch-group data-v-d36a0b1a"><text class="data-v-d36a0b1a">台板</text><switch class="data-v-d36a0b1a" checked="{{g}}" bindchange="{{h}}" color="#007aff"/></view></view><view class="game-record data-v-d36a0b1a"><view class="record-title data-v-d36a0b1a"> 对局记录 <text class="hint data-v-d36a0b1a">点击对局分数进行修改</text></view><view class="user-section data-v-d36a0b1a"><text class="user-hint data-v-d36a0b1a">点击自己头像编辑用户头像和昵称~</text><view class="user-info data-v-d36a0b1a" bindtap="{{k}}"><image class="user-avatar data-v-d36a0b1a" src="{{i}}" mode="aspectFill"></image><view class="user-details data-v-d36a0b1a"><view class="user-name data-v-d36a0b1a">{{j}} <text class="self-tag data-v-d36a0b1a">自己</text></view></view></view></view><view class="players-section data-v-d36a0b1a"><view class="section-header data-v-d36a0b1a"><text class="header-title data-v-d36a0b1a">玩家</text><text class="player-count data-v-d36a0b1a">({{l}}位)</text></view><view class="players-table-container vertical data-v-d36a0b1a"><view class="players-table vertical data-v-d36a0b1a"><view class="table-row header-row data-v-d36a0b1a"><view class="header-cell player-column data-v-d36a0b1a">玩家</view><view wx:for="{{m}}" wx:for-item="player" wx:key="c" class="data-cell data-v-d36a0b1a"><view class="player-info data-v-d36a0b1a"><image class="data-v-d36a0b1a" src="{{player.a}}" mode="aspectFill"></image><text class="data-v-d36a0b1a">{{player.b}}</text></view></view></view><view class="table-row data-v-d36a0b1a"><view class="header-cell score-column data-v-d36a0b1a">总分</view><view wx:for="{{n}}" wx:for-item="player" wx:key="b" class="data-cell score-display data-v-d36a0b1a">{{player.a}}</view></view><view wx:for="{{o}}" wx:for-item="round" wx:key="c" class="table-row data-v-d36a0b1a"><view class="header-cell score-column data-v-d36a0b1a">第{{round.a}}局</view><view wx:for="{{round.b}}" wx:for-item="player" wx:key="c" bindtap="{{player.b}}" class="data-cell score-display data-v-d36a0b1a">{{player.a}}</view></view></view></view></view></view><view class="bottom-buttons data-v-d36a0b1a"><button class="start-btn data-v-d36a0b1a" type="primary" bindtap="{{p}}">开局计分</button><button class="settle-btn data-v-d36a0b1a" type="default" bindtap="{{q}}">结算房间</button></view></view>
|
||||
@@ -133,83 +133,111 @@
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.players-section .section-header .header-title.data-v-d36a0b1a {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.players-section .section-header .player-count.data-v-d36a0b1a {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
/* 玩家表格容器 - 实现横向滚动 */
|
||||
.players-table-container.data-v-d36a0b1a {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid #e0e0e0;
|
||||
}
|
||||
/* 垂直表格容器 - 实现垂直滚动和横向滑动 */
|
||||
.players-table-container.vertical.data-v-d36a0b1a {
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
max-height: 500rpx;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
/* 优化移动端滚动体验 */
|
||||
}
|
||||
/* 玩家表格 */
|
||||
.players-table.data-v-d36a0b1a {
|
||||
border: 1rpx solid #e0e0e0;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
min-width: 100%;
|
||||
overflow: visible;
|
||||
}
|
||||
.players-table .table-header.data-v-d36a0b1a {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #f5f5f5;
|
||||
border-bottom: 1rpx solid #e0e0e0;
|
||||
}
|
||||
.players-table .table-header .player-column.data-v-d36a0b1a {
|
||||
flex: 2;
|
||||
padding: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
border-right: 1rpx solid #e0e0e0;
|
||||
}
|
||||
.players-table .table-header .score-column.data-v-d36a0b1a {
|
||||
flex: 1;
|
||||
padding: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
.players-table .table-body .player-row.data-v-d36a0b1a {
|
||||
/* 垂直表格样式 */
|
||||
.players-table.vertical .table-row.data-v-d36a0b1a {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1rpx solid #e0e0e0;
|
||||
}
|
||||
.players-table .table-body .player-row.data-v-d36a0b1a:last-child {
|
||||
.players-table.vertical .table-row.data-v-d36a0b1a:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.players-table .table-body .player-row .player-info.data-v-d36a0b1a {
|
||||
flex: 2;
|
||||
.players-table.vertical .header-row.data-v-d36a0b1a {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.players-table.vertical .header-cell.data-v-d36a0b1a {
|
||||
width: 150rpx;
|
||||
flex-shrink: 0;
|
||||
padding: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
border-right: 1rpx solid #e0e0e0;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 15rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
.players-table.vertical .player-column.data-v-d36a0b1a {
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.players-table.vertical .score-column.data-v-d36a0b1a {
|
||||
text-align: center;
|
||||
}
|
||||
.players-table.vertical .data-cell.data-v-d36a0b1a {
|
||||
min-width: 120rpx;
|
||||
flex-shrink: 0;
|
||||
padding: 15rpx;
|
||||
border-right: 1rpx solid #e0e0e0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
/* 最后一列不需要右边框 */
|
||||
}
|
||||
.players-table .table-body .player-row .player-info image.data-v-d36a0b1a {
|
||||
.players-table.vertical .data-cell.data-v-d36a0b1a:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
.players-table.vertical .player-info.data-v-d36a0b1a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.players-table.vertical .player-info image.data-v-d36a0b1a {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.players-table .table-body .player-row .player-info text.data-v-d36a0b1a {
|
||||
font-size: 26rpx;
|
||||
.players-table.vertical .player-info text.data-v-d36a0b1a {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
word-break: break-word;
|
||||
}
|
||||
.players-table .table-body .player-row .score-display.data-v-d36a0b1a {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 15rpx;
|
||||
.players-table.vertical .score-display.data-v-d36a0b1a {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #007aff;
|
||||
}
|
||||
.players-table .table-body .player-row .score-display.data-v-d36a0b1a:active {
|
||||
.players-table.vertical .score-display.data-v-d36a0b1a:active {
|
||||
background-color: #f0f8ff;
|
||||
}
|
||||
/* 底部操作按钮 */
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"libVersion": "3.11.1",
|
||||
"projectname": "scoring",
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"coverView": true,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"skylineRenderEnable": false,
|
||||
"preloadBackgroundData": false,
|
||||
"autoAudits": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"compileHotReLoad": true
|
||||
}
|
||||
"libVersion": "3.11.1",
|
||||
"projectname": "scoring",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"coverView": true,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"skylineRenderEnable": false,
|
||||
"preloadBackgroundData": false,
|
||||
"autoAudits": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"compileHotReLoad": true
|
||||
}
|
||||
}
|
||||
BIN
scoring/unpackage/dist/dev/mp-weixin/static/avatar14.png
vendored
Normal file
BIN
scoring/unpackage/dist/dev/mp-weixin/static/avatar14.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +1,4 @@
|
||||
"use strict";
|
||||
const BASE_URL = "http://172.20.10.2:8080";
|
||||
const BASE_URL = "http://10.87.64.114:8080";
|
||||
exports.BASE_URL = BASE_URL;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/CommonValues.js.map
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
const common_vendor = require("../common/vendor.js");
|
||||
const utils_CommonValues = require("./CommonValues.js");
|
||||
const api_login = require("../api/login.js");
|
||||
function GET(url, data) {
|
||||
return SIMPLE(url, data, "GET");
|
||||
}
|
||||
function GET_TOKEN(url, data, token) {
|
||||
return SIMPLE_TOKEN(url, data, token, "GET");
|
||||
}
|
||||
@@ -10,19 +13,24 @@ function POST(url, data) {
|
||||
}
|
||||
let requestTime = 0;
|
||||
async function SIMPLE(url, data, method) {
|
||||
if (requestTime == 0) {
|
||||
token = await api_login.loginSystem();
|
||||
if (token.data) {
|
||||
SIMPLE(url, data, method);
|
||||
return;
|
||||
let token = common_vendor.index.getStorageSync("APP_TOKEN") || "";
|
||||
if (requestTime == 0 && false) {
|
||||
try {
|
||||
token = await api_login.loginSystem();
|
||||
if (typeof token === "string") {
|
||||
requestTime += 1;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("log", "at utils/request.js:44", "登录系统失败:", error);
|
||||
}
|
||||
} else if (requestTime == 0) {
|
||||
requestTime += 1;
|
||||
} else {
|
||||
var token = common_vendor.index.getStorageSync("APP_TOKEN");
|
||||
}
|
||||
const fullUrl = `${utils_CommonValues.BASE_URL}${url}`;
|
||||
common_vendor.index.__f__("log", "at utils/request.js:51", `[网络请求] ${method} ${fullUrl}`, data);
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.request({
|
||||
url: `${utils_CommonValues.BASE_URL}${url}`,
|
||||
url: fullUrl,
|
||||
method,
|
||||
header: {
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
@@ -31,22 +39,46 @@ async function SIMPLE(url, data, method) {
|
||||
dataType: "json",
|
||||
data,
|
||||
success: (res) => {
|
||||
if (res.data.code == "200" || res.data.statusCode == "200") {
|
||||
resolve(res.data);
|
||||
common_vendor.index.__f__("log", "at utils/request.js:64", `[网络响应] ${method} ${fullUrl}`, res.data);
|
||||
if (res.statusCode === 200) {
|
||||
resolve(res);
|
||||
} else {
|
||||
reject(res);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at utils/request.js:74", `[网络错误] ${method} ${fullUrl}`, err);
|
||||
let errorMsg = "网络请求失败";
|
||||
if (err.errMsg && err.errMsg.includes("url not in domain list")) {
|
||||
errorMsg = "请求地址未在小程序管理后台配置,请联系管理员";
|
||||
{
|
||||
common_vendor.index.__f__("error", "at utils/request.js:81", "\n=== 开发环境网络请求错误解决方案 ===");
|
||||
common_vendor.index.__f__("error", "at utils/request.js:82", "错误原因:请求的URL不在小程序合法域名列表中");
|
||||
common_vendor.index.__f__("error", "at utils/request.js:83", "当前请求URL:", fullUrl);
|
||||
common_vendor.index.__f__("error", "at utils/request.js:84", "解决方案:");
|
||||
common_vendor.index.__f__("error", "at utils/request.js:85", '1. 在微信开发者工具中,点击右上角的"详情"');
|
||||
common_vendor.index.__f__("error", "at utils/request.js:86", '2. 选择"本地设置"');
|
||||
common_vendor.index.__f__("error", "at utils/request.js:87", '3. 勾选"不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书"');
|
||||
common_vendor.index.__f__("error", "at utils/request.js:88", "4. 重新编译小程序");
|
||||
common_vendor.index.__f__("error", "at utils/request.js:89", "==================================\n");
|
||||
}
|
||||
} else if (err.errMsg && err.errMsg.includes("connect fail")) {
|
||||
errorMsg = "网络连接失败,请检查网络设置";
|
||||
} else if (err.errMsg && err.errMsg.includes("localhost")) {
|
||||
errorMsg = "无法连接到本地服务器,请检查BASE_URL配置";
|
||||
}
|
||||
err.userFriendlyMsg = errorMsg;
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function SIMPLE_TOKEN(url, data, token, method) {
|
||||
const fullUrl = `${utils_CommonValues.BASE_URL}${url}`;
|
||||
common_vendor.index.__f__("log", "at utils/request.js:105", `[网络请求] ${method} ${fullUrl}`, data);
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.request({
|
||||
url: `${utils_CommonValues.BASE_URL}${url}`,
|
||||
url: fullUrl,
|
||||
method,
|
||||
header: {
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
@@ -55,18 +87,28 @@ function SIMPLE_TOKEN(url, data, token, method) {
|
||||
dataType: "json",
|
||||
data,
|
||||
success: (res) => {
|
||||
if (res.data.code == "200" || res.data.statusCode == "200") {
|
||||
resolve(res.data);
|
||||
common_vendor.index.__f__("log", "at utils/request.js:118", `[网络响应] ${method} ${fullUrl}`, res.data);
|
||||
if (res.statusCode === 200) {
|
||||
resolve(res);
|
||||
} else {
|
||||
reject(res);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at utils/request.js:128", `[网络错误] ${method} ${fullUrl}`, err);
|
||||
let errorMsg = "网络请求失败";
|
||||
if (err.errMsg && err.errMsg.includes("url not in domain list")) {
|
||||
errorMsg = "请求地址未在小程序管理后台配置,请联系管理员";
|
||||
} else if (err.errMsg && err.errMsg.includes("connect fail")) {
|
||||
errorMsg = "网络连接失败,请检查网络设置";
|
||||
}
|
||||
err.userFriendlyMsg = errorMsg;
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.GET = GET;
|
||||
exports.GET_TOKEN = GET_TOKEN;
|
||||
exports.POST = POST;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/request.js.map
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
export const BASE_URL = 'http://172.20.10.2:8080';
|
||||
export const BASE_URL = 'http://10.87.64.114:8080';
|
||||
// export const BASE_URL = 'https://www.jianxinghome.cn:8484';
|
||||
// export const BASE_URL = 'https://www.safeguardfull.cn:8484';
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ export function POST(url, data) {
|
||||
}
|
||||
|
||||
export function POST_TOKEN(url, data) {
|
||||
// 从本地存储获取token
|
||||
var token = uni.getStorageSync("APP_TOKEN") || "";
|
||||
return SIMPLE_TOKEN(url, data, token, 'POST');
|
||||
}
|
||||
|
||||
@@ -27,21 +29,30 @@ export function PUT(url, data) {
|
||||
let requestTime = 0;
|
||||
|
||||
export async function SIMPLE(url, data, method) {
|
||||
// 防止首次访问没有token
|
||||
if(requestTime == 0) {
|
||||
token = await loginSystem();
|
||||
if(token.data) {
|
||||
// 如果有code表示没有拿到token
|
||||
SIMPLE(url, data, method)
|
||||
return;
|
||||
// 声明token变量
|
||||
let token = uni.getStorageSync("APP_TOKEN") || "";
|
||||
|
||||
// 在开发环境下跳过自动登录,避免网络请求失败
|
||||
// 微信小程序无法访问localhost,需要使用实际IP或域名
|
||||
if(requestTime == 0 && process.env.NODE_ENV !== 'development') {
|
||||
try {
|
||||
token = await loginSystem();
|
||||
if(typeof token === 'string') {
|
||||
requestTime += 1;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("登录系统失败:", error);
|
||||
}
|
||||
} else if(requestTime == 0) {
|
||||
requestTime += 1;
|
||||
} else {
|
||||
var token = uni.getStorageSync("APP_TOKEN");
|
||||
}
|
||||
|
||||
const fullUrl = `${BASE_URL}${url}`;
|
||||
console.log(`[网络请求] ${method} ${fullUrl}`, data);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `${BASE_URL}${url}`,
|
||||
url: fullUrl,
|
||||
method: method,
|
||||
header: {
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
@@ -50,13 +61,39 @@ export async function SIMPLE(url, data, method) {
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: res => {
|
||||
if(res.data.code == '200' || res.data.statusCode == '200') {
|
||||
resolve(res.data)
|
||||
console.log(`[网络响应] ${method} ${fullUrl}`, res.data);
|
||||
// 首先检查HTTP状态码
|
||||
if(res.statusCode === 200) {
|
||||
// 无论返回内容是什么格式,都视为成功
|
||||
resolve(res)
|
||||
} else {
|
||||
reject(res)
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.error(`[网络错误] ${method} ${fullUrl}`, err);
|
||||
// 提供更友好的错误信息
|
||||
let errorMsg = "网络请求失败";
|
||||
if(err.errMsg && err.errMsg.includes('url not in domain list')) {
|
||||
errorMsg = "请求地址未在小程序管理后台配置,请联系管理员";
|
||||
// 在开发环境下显示更详细的解决方案
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.error('\n=== 开发环境网络请求错误解决方案 ===');
|
||||
console.error('错误原因:请求的URL不在小程序合法域名列表中');
|
||||
console.error('当前请求URL:', fullUrl);
|
||||
console.error('解决方案:');
|
||||
console.error('1. 在微信开发者工具中,点击右上角的"详情"');
|
||||
console.error('2. 选择"本地设置"');
|
||||
console.error('3. 勾选"不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书"');
|
||||
console.error('4. 重新编译小程序');
|
||||
console.error('==================================\n');
|
||||
}
|
||||
} else if(err.errMsg && err.errMsg.includes('connect fail')) {
|
||||
errorMsg = "网络连接失败,请检查网络设置";
|
||||
} else if(err.errMsg && err.errMsg.includes('localhost')) {
|
||||
errorMsg = "无法连接到本地服务器,请检查BASE_URL配置";
|
||||
}
|
||||
err.userFriendlyMsg = errorMsg;
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
@@ -64,9 +101,12 @@ export async function SIMPLE(url, data, method) {
|
||||
}
|
||||
|
||||
export function SIMPLE_TOKEN(url, data, token, method) {
|
||||
const fullUrl = `${BASE_URL}${url}`;
|
||||
console.log(`[网络请求] ${method} ${fullUrl}`, data);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `${BASE_URL}${url}`,
|
||||
url: fullUrl,
|
||||
method: method,
|
||||
header: {
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
@@ -75,13 +115,25 @@ export function SIMPLE_TOKEN(url, data, token, method) {
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: res => {
|
||||
if(res.data.code == '200' || res.data.statusCode == '200') {
|
||||
resolve(res.data)
|
||||
console.log(`[网络响应] ${method} ${fullUrl}`, res.data);
|
||||
// 首先检查HTTP状态码
|
||||
if(res.statusCode === 200) {
|
||||
// 无论返回内容是什么格式,都视为成功
|
||||
resolve(res)
|
||||
} else {
|
||||
reject(res)
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.error(`[网络错误] ${method} ${fullUrl}`, err);
|
||||
// 提供更友好的错误信息
|
||||
let errorMsg = "网络请求失败";
|
||||
if(err.errMsg && err.errMsg.includes('url not in domain list')) {
|
||||
errorMsg = "请求地址未在小程序管理后台配置,请联系管理员";
|
||||
} else if(err.errMsg && err.errMsg.includes('connect fail')) {
|
||||
errorMsg = "网络连接失败,请检查网络设置";
|
||||
}
|
||||
err.userFriendlyMsg = errorMsg;
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user