优化名字

This commit is contained in:
Dragon
2024-03-28 10:58:09 +08:00
parent d61d352a6b
commit 1d5a2afcb1
4 changed files with 46 additions and 34 deletions

View File

@@ -173,6 +173,7 @@ body {
left: 0; left: 0;
bottom: -0.56rem; bottom: -0.56rem;
text-align: center; text-align: center;
white-space: nowrap;
} }
.largestBox .top3 .no1 .box p span { .largestBox .top3 .no1 .box p span {
@@ -272,6 +273,7 @@ body {
left: 0; left: 0;
bottom: -0.56rem; bottom: -0.56rem;
text-align: center; text-align: center;
white-space: nowrap;
} }
.largestBox .top3 .no2 .box p span { .largestBox .top3 .no2 .box p span {
@@ -371,6 +373,7 @@ body {
left: 0; left: 0;
bottom: -0.56rem; bottom: -0.56rem;
text-align: center; text-align: center;
white-space: nowrap;
} }
.largestBox .top3 .no3 .box p span { .largestBox .top3 .no3 .box p span {

View File

@@ -176,6 +176,7 @@ body {
left: 0; left: 0;
bottom: px2rem(-42); bottom: px2rem(-42);
text-align: center; text-align: center;
white-space: nowrap;
span { span {
vertical-align: middle; vertical-align: middle;
@@ -276,6 +277,7 @@ body {
left: 0; left: 0;
bottom: px2rem(-42); bottom: px2rem(-42);
text-align: center; text-align: center;
white-space: nowrap;
span { span {
vertical-align: middle; vertical-align: middle;
@@ -376,6 +378,7 @@ body {
left: 0; left: 0;
bottom: px2rem(-42); bottom: px2rem(-42);
text-align: center; text-align: center;
white-space: nowrap;
span { span {
vertical-align: middle; vertical-align: middle;

View File

@@ -4,21 +4,21 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title> <title></title>
<link rel="stylesheet" href="../../common/css/reset.css"> <link rel="stylesheet" href="../../common/css/reset.css">
<link rel="stylesheet" href="./css/index.css"> <link rel="stylesheet" href="./css/index.css">
</head> </head>
<body> <body>
<!-- 最外容器 --> <!-- 最外容器 -->
<div class="largestBox"> <div class="largestBox">
<!-- 标题 --> <!-- 標題 -->
<img src="./images/title.png" alt="" class="title"> <img src="./images/title.png" alt="" class="title">
<!-- 富榜&魅力榜 --> <!-- 富榜&魅力榜 -->
<div class="tab"> <div class="tab">
<div class="tabColor1"> <div class="tabColor1">
意榜 意榜
<span></span> <span></span>
</div> </div>
<div class=""> <div class="">
@@ -39,14 +39,14 @@
<img src="./images/no1.png" alt="" class="ts"> <img src="./images/no1.png" alt="" class="ts">
<img src="./images/logo.png" alt="" class="tx"> <img src="./images/logo.png" alt="" class="tx">
<p> <p>
<span class="sp1">我是很长的...</span> <span class="sp1"></span>
<span class="sp boy"><img src="./images/boy.png" alt=""></span> <span class="sp boy"><img src="./images/boy.png" alt=""></span>
</p> </p>
<div class="icon"> <div class="icon">
<img src="./images/icon1.png" alt="" class="icon1"> <img src="" alt="" class="icon1">
<img src="./images/icon2.png" alt="" class="icon2"> <img src="" alt="" class="icon2">
</div> </div>
<div class="score">10000</div> <div class="score">0</div>
</div> </div>
</div> </div>
<div class="no no2"> <div class="no no2">
@@ -86,12 +86,12 @@
<div class="num">4</div> <div class="num">4</div>
<img src="./images/logo.png" alt="" class="tx"> <img src="./images/logo.png" alt="" class="tx">
<div class="userInfo"> <div class="userInfo">
<p>我是名字名字名字名字名字</p> <p></p>
<img src="./images/icon1.png" alt="" class="icon1"> <img src="./images/icon1.png" alt="" class="icon1">
<img src="./images/icon2.png" alt="" class="icon2"> <img src="./images/icon2.png" alt="" class="icon2">
</div> </div>
<div class="score"> <div class="score">
<p>1000</p> <p>0</p>
<span>魅力值</span> <span>魅力值</span>
</div> </div>
</li> </li>

View File

@@ -5,9 +5,9 @@ var urlData = getQueryString();
if (env == 'test') { if (env == 'test') {
new VConsole(); new VConsole();
} }
// 封layer消息提醒框 // 封layer消息提醒框
let layerIndex let layerIndex
const showLoading = (content = '加中...') => { const showLoading = (content = '加中...') => {
layer.open({ layer.open({
type: 2, type: 2,
shadeClose: false, shadeClose: false,
@@ -30,12 +30,12 @@ const toastMsg = (content = '操作完成', time = 2) => {
var listType = 1; var listType = 1;
var experImgUrl = 'https://yinmeng-1318633625.cos.ap-guangzhou.myqcloud.com/new_exper_'; var experImgUrl = 'https://yinmeng-1318633625.cos.ap-guangzhou.myqcloud.com/new_exper_';
var charmImgUrl = 'https://yinmeng-1318633625.cos.ap-guangzhou.myqcloud.com/new_charm_'; var charmImgUrl = 'https://yinmeng-1318633625.cos.ap-guangzhou.myqcloud.com/new_charm_';
var typeWealth = 'day';//富榜型day 日 week 周 month 月 total var typeWealth = 'day';//富榜型day 日 week 周 month 月 total
// 初始化函 // 初始化函
$(function () { $(function () {
getInfoFromClient() getInfoFromClient()
setTimeout(function () { setTimeout(function () {
// 面全屏 // 面全屏
if (browser.app) { if (browser.app) {
if (browser.android) { if (browser.android) {
window.androidJsObj.initShowNav(false) window.androidJsObj.initShowNav(false)
@@ -43,7 +43,7 @@ $(function () {
window.webkit.messageHandlers.initShowNav.postMessage(0) window.webkit.messageHandlers.initShowNav.postMessage(0)
} }
}; };
// 部返回事件 // 部返回事件
$('.back').click(() => { $('.back').click(() => {
if (browser.android) { if (browser.android) {
window.androidJsObj.closeWebView() window.androidJsObj.closeWebView()
@@ -54,7 +54,7 @@ $(function () {
getRankingsWealth(); getRankingsWealth();
}, 100) }, 100)
}) })
// 榜单切换 // 榜單切換
$('.largestBox .tab div').click(function () { $('.largestBox .tab div').click(function () {
var i = $(this).index() + 1; var i = $(this).index() + 1;
listType = i; listType = i;
@@ -69,12 +69,12 @@ $('.largestBox .tab div').click(function () {
getReciveRankingsWealth(); getReciveRankingsWealth();
} }
}) })
// 日榜切 // 日榜切
$('.largestBox .dayTab div').click(function () { $('.largestBox .dayTab div').click(function () {
var i = $(this).index() + 1; var i = $(this).index() + 1;
$(this).addClass(`dayTabColor${listType}`).siblings().removeClass('dayTabColor1').removeClass('dayTabColor2'); $(this).addClass(`dayTabColor${listType}`).siblings().removeClass('dayTabColor1').removeClass('dayTabColor2');
if (i == 1) { if (i == 1) {
typeWealth = 'day';//富榜型day 日 week 周 month 月 total typeWealth = 'day';//富榜型day 日 week 周 month 月 total
} else if (i == 2) { } else if (i == 2) {
typeWealth = 'week'; typeWealth = 'week';
} else if (i == 3) { } else if (i == 3) {
@@ -86,7 +86,7 @@ $('.largestBox .dayTab div').click(function () {
getReciveRankingsWealth(); getReciveRankingsWealth();
} }
}) })
// 意榜接口 // 意榜接口
function getRankingsWealth () { function getRankingsWealth () {
showLoading() showLoading()
networkRequest({ networkRequest({
@@ -108,7 +108,7 @@ function getRankingsWealth () {
}, },
error (err) { error (err) {
hideLoading(layerIndex) hideLoading(layerIndex)
toastMsg('网络错误,请退出重') toastMsg('網絡錯誤,請退出重')
} }
}) })
} }
@@ -134,19 +134,19 @@ function getReciveRankingsWealth () {
}, },
error (err) { error (err) {
hideLoading(layerIndex) hideLoading(layerIndex)
toastMsg('网络错误,请退出重') toastMsg('網絡錯誤,請退出重')
} }
}) })
} }
// 渲染 // 渲染
function listDomFun (res, num) { function listDomFun (res, num) {
$('.largestBox ul li').remove(); $('.largestBox ul li').remove();
// 理前三 // 理前三
var top3 = res.data.rankings.slice(0, 3); var top3 = res.data.rankings.slice(0, 3);
if (top3.length < 3) { if (top3.length < 3) {
let arr = new Array(3 - top3.length).fill({ let arr = new Array(3 - top3.length).fill({
avatar: './images/logo.png', avatar: './images/logo.png',
nick: '位以待', nick: '位以待',
goldAmount: '', goldAmount: '',
}) })
top3.push(...arr); top3.push(...arr);
@@ -165,35 +165,40 @@ function listDomFun (res, num) {
$(`.largestBox .top3 .no${i + 1} .box p .sp`).removeClass('boy').removeClass('woman') $(`.largestBox .top3 .no${i + 1} .box p .sp`).removeClass('boy').removeClass('woman')
$(`.largestBox .top3 .no${i + 1} .box p .sp`).addClass(`${res.gender == 1 ? 'boy' : 'woman'}`); $(`.largestBox .top3 .no${i + 1} .box p .sp`).addClass(`${res.gender == 1 ? 'boy' : 'woman'}`);
$(`.largestBox .top3 .no${i + 1} .box p .sp img`).attr('src', res.gender == 1 ? './images/boy.png' : './images/woman.png'); $(`.largestBox .top3 .no${i + 1} .box p .sp img`).attr('src', res.gender == 1 ? './images/boy.png' : './images/woman.png');
$(`.largestBox .top3 .no${i + 1} .box .icon .icon1`).attr('src', experImgUrl + `${res.experSeq <= 9 ? '0' + res.experSeq : res.experSeq}.png`) // $(`.largestBox .top3 .no${i + 1} .box .icon .icon1`).attr('src', experImgUrl + `${res.experSeq <= 9 ? '0' + res.experSeq : res.experSeq}.png`)
$(`.largestBox .top3 .no${i + 1} .box .icon .icon2`).attr('src', charmImgUrl + `${res.charmSeq <= 9 ? '0' + res.charmSeq : res.charmSeq}.png`) // $(`.largestBox .top3 .no${i + 1} .box .icon .icon2`).attr('src', charmImgUrl + `${res.charmSeq <= 9 ? '0' + res.charmSeq : res.charmSeq}.png`)
$(`.largestBox .top3 .no${i + 1} .box .icon .icon1`).attr('src', res.experUrl)
$(`.largestBox .top3 .no${i + 1} .box .icon .icon2`).attr('src', res.charmUrl)
$(`.largestBox .top3 .no${i + 1} .box .score`).text(unitProcessing(res.goldAmount, 10000, 1, 'W')); $(`.largestBox .top3 .no${i + 1} .box .score`).text(unitProcessing(res.goldAmount, 10000, 1, 'W'));
}) })
// 理非前三 // 理非前三
var notTop3 = res.data.rankings.slice(3); var notTop3 = res.data.rankings.slice(3);
var str = ''; var str = '';
notTop3.forEach((res, i) => { notTop3.forEach((res, i) => {
// experImgUrl + `${res.experSeq <= 9 ? '0' + res.experSeq : res.experSeq}.png`
// charmImgUrl + `${res.charmSeq <= 9 ? '0' + res.charmSeq : res.charmSeq}.png`
str += ` str += `
<li> <li>
<div class="num">${i + 4}</div> <div class="num">${i + 4}</div>
<img src="${res.avatar}" uid=${res.uid} alt="" class="tx"> <img src="${res.avatar}" uid=${res.uid} alt="" class="tx">
<div class="userInfo"> <div class="userInfo">
<p>${res.nick}</p> <p>${res.nick}</p>
<img src="${experImgUrl + `${res.experSeq <= 9 ? '0' + res.experSeq : res.experSeq}.png`}" alt="" class="icon1"> <img src="${res.experUrl}" alt="" class="icon1">
<img src="${charmImgUrl + `${res.charmSeq <= 9 ? '0' + res.charmSeq : res.charmSeq}.png`}" alt="" class="icon2"> <img src="${res.charmUrl}" alt="" class="icon2">
</div> </div>
<div class="score"> <div class="score">
<p>${unitProcessing(res.goldAmount, 10000, 1, 'W')}</p> <p>${unitProcessing(res.goldAmount, 10000, 1, 'W')}</p>
<span>${num == 1 ? '意值' : '魅力值'}</span> <span>${num == 1 ? '意值' : '魅力值'}</span>
</div> </div>
</li> </li>
` `
}) })
$('.largestBox ul').append(str); $('.largestBox ul').append(str);
} }
// 点击前三跳转房间 // 點擊前三跳轉房間
$('.largestBox').on('click', '.top3 .no .box .ts', function () { $('.largestBox').on('click', '.top3 .no .box .ts', function () {
var uid = $(this).attr('uid'); var uid = $(this).attr('uid');
return;
if (browser.ios) { if (browser.ios) {
window.webkit.messageHandlers.openPersonPage.postMessage(uid); window.webkit.messageHandlers.openPersonPage.postMessage(uid);
} else if (browser.android) { } else if (browser.android) {
@@ -202,9 +207,10 @@ $('.largestBox').on('click', '.top3 .no .box .ts', function () {
} }
} }
}) })
// 点击非前三跳转房间 // 點擊非前三跳轉房間
$('.largestBox').on('click', 'ul li .tx', function () { $('.largestBox').on('click', 'ul li .tx', function () {
var uid = $(this).attr('uid'); var uid = $(this).attr('uid');
return;
if (browser.ios) { if (browser.ios) {
window.webkit.messageHandlers.openPersonPage.postMessage(uid); window.webkit.messageHandlers.openPersonPage.postMessage(uid);
} else if (browser.android) { } else if (browser.android) {