修改bug-爱的告白

This commit is contained in:
dragon
2024-06-25 19:30:59 +08:00
parent 734d2539d8
commit d553fa35a0
9 changed files with 87 additions and 43 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -56,13 +56,7 @@ $(function () {
$('.text2').html(langReplace(localLang.demoModule.text2));
$('.text3').html(langReplace(localLang.demoModule.text3));
$('.text4').html(langReplace(localLang.demoModule.text4));
$('.text5').attr('placeholder', partitionId == 1 ? '請輸入4個字' : partitionId == 2) ? `يرجى إدخال 13 أحرف` : `Enter 13 characters`;
if (partitionId == 1 || partitionId == 2) {
$('.text5').attr('maxlength', 13);
} else {
$('.text5').attr('maxlength', 4);
}
$('.text5').attr('placeholder', langReplace(localLang.demoModule.text5));
}
if (browser.app) {
_hmt.push(['_trackEvent', 'client', 'click', "act_nameplate"]);
@@ -182,7 +176,8 @@ $(function () {
// 申請新銘牌彈窗 確定申請 按鈕點擊事件
$('.shade-mask-new').on('click', '.apply-btn', function () {
let content = $(this).parent();
let ipt = content.find('input.new-nameplate-desc').val()
// let ipt = content.find('input.new-nameplate-desc').val()
let ipt = $('.text5').val();
if (!newNameplateId) {
toastMsg(langReplace(localLang.demoModule.text8));
return
@@ -243,12 +238,17 @@ const userGet = () => {
type: 'GET',
url: urlPrefix + '/user/get',
data: {
uid: 2615
uid: pubInfo.uid
},
success(res) {
hideLoading(layerIndex);
if (res.code === 200) {
partitionId = res.data.partitionId
if (partitionId == 1 || partitionId == 2) {
$('.text5').attr('maxlength', 13);
} else {
$('.text5').attr('maxlength', 4);
}
renderBtnStatus()
} else {
toastMsg(res.message)
@@ -321,13 +321,13 @@ const renderNameplateList = () => {
userNameplateList.map(item => {
str += `
<li data-apply-day=${item.applyDay} data-nameplate-id=${item.nameplateId} data-type=${item.type} data-text=${item.fixedWord}>
<p>剩余${item.expireDays}${langReplace(localLang.demoModule.text3)}</p>
<p>${langReplace(localLang.demoModule.text13)}${item.expireDays}${langReplace(localLang.demoModule.text3)}</p>
<div class="nameplate">
<img src="${item.nameplateImage}" alt="">
<span>${item.word}</span>
</div>
<div class="delay-btn">
<img src="./images/delay-btn.png" alt="">
<img src="${langReplace(localLang.demoModule.img7)}" alt="">
</div>
</li>
`

View File

@@ -1,9 +1,11 @@
let urlPrefix = getUrlPrefix();
if (EnvCheck() === 'test') new VConsole
// 封layer消息提醒框
let layerIndex
const showLoading = (content = '加載中...') => {
// 封layer消息提醒框
let layerIndex;
var langReplace;
var localLang;
const showLoading = (content = langReplace(localLang.demoModule.layerIndex1)) => {
layer.open({
type: 2,
shadeClose: false,
@@ -16,7 +18,7 @@ const showLoading = (content = '加載中...') => {
const hideLoading = (index) => {
layer.close(index)
}
const toastMsg = (content = '操作完成', time = 2) => {
const toastMsg = (content = langReplace(localLang.demoModule.layerIndex2), time = 2) => {
layer.open({
content,
time,
@@ -40,53 +42,52 @@ const getUserApplyRecord = () => {
pageNumber,
pageSize
},
success(res){
success(res) {
hideLoading(layerIndex)
if(res.code === 200){
if(!res.data.length){
if (res.code === 200) {
if (!res.data.length) {
$('.max').hide()
}else{
} else {
$('.no-record-wrap').hide()
}
if(res.data.length === pageSize){
if (res.data.length === pageSize) {
// 能够继续请求下一页
canNext = true
}else{
} else {
canNext = false
}
recordList.push(...res.data)
renderRecord()
isLock = true
}else{
toastMsg(res.message)
} else {
toastMsg(res.message)
}
},
error(){
},
error() {
hideLoading(layerIndex);
toastMsg('網絡錯誤')
}
toastMsg(langReplace(localLang.demoModule.layerIndex3))
}
})
}
// 渲染申请记录
const renderRecord = () => {
let str = '';
recordList.map( item => {
recordList.map(item => {
str += `
<li>
<div class="nameplate-style"><img src="${item.iconPic}" alt=""></div>
<div class="nameplate-desc-wrap">
<span class="nameplate-desc">${item.text}</span>
<p>
<span>${item.applyType === 1 ? '申请' : '延长'}${item.applyDay}</span>
<span>${item.applyType === 1 ? langReplace(localLang.demoModule.text16) : langReplace(localLang.demoModule.text17)}${item.applyDay}${langReplace(localLang.demoModule.text3)}</span>
<span>${dateFormat(item.createTime, "yyyy-MM-dd")}</span>
</p>
</div>
<div class="isPass">
<p class='${item.auditType === 1 ? 'not-pass' : ''}'>${item.auditType === 0 ? '申请中' : (item.auditType === 1 ? '不通过' : '已通过')}</p>
${
item.remark ? (item.remark.length > 8 ? `<p class="result">${item.remark.slice(0, 8) + '...'}</p>` : `<p class="result">${item.remark}</p>`) : ''
}
<p class='${item.auditType === 1 ? 'not-pass' : ''}'>${item.auditType === 0 ? langReplace(localLang.demoModule.text18) : (item.auditType === 1 ? langReplace(localLang.demoModule.text19) : langReplace(localLang.demoModule.text20))}</p>
${item.remark ? (item.remark.length > 8 ? `<p class="result">${item.remark.slice(0, 8) + '...'}</p>` : `<p class="result">${item.remark}</p>`) : ''
}
</div>
</li>
@@ -95,21 +96,32 @@ const renderRecord = () => {
$('.max').html(str)
}
$(function(){
$(function () {
getInfoFromClient()
setTimeout( () => {
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
setTimeout(() => {
langReplace = window.lang.replace;
localLang = window.lang;
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
translateFun();
getUserApplyRecord()
}, 50)
function translateFun() {
var langReplace = window.lang.replace;
var localLang = window.lang;
$('.text14').text(langReplace(localLang.demoModule.text14));
$('.text15').text(langReplace(localLang.demoModule.text15));
}
// 监听滚动
$('ul').scroll(function(){
$('ul').scroll(function () {
let scrollTop = $(this).scrollTop()
let scrollHeight = $('ul')[0].scrollHeight
let ulHeight = $(this).innerHeight()
if(scrollTop + ulHeight + 100 >= scrollHeight){
if(isLock){
if (scrollTop + ulHeight + 100 >= scrollHeight) {
if (isLock) {
// 请求下一页
if(canNext){
if (canNext) {
getUserApplyRecord(pageNumber++)
isLock = false
}

View File

@@ -12,12 +12,13 @@ langAr = {
img2: `./images/disabled-btn-ar.png`,
img3: `./images/apply-btn-basics-ar.png`,
img6: `./images/record-ar.png`,
img7: `./images/delay-btn-ar.png`,
title_t: `مخصص`,
text1: `نمط اللوحة:`,
text2: `مدة التطبيق:`,
text3: `أيام`,
text4: `نص اللوحة:`,
text5: `يرجى إدخال 13 أحرف`,
text5: `الرجاء إدخال...`,
text55: `13`,
text6: `يجب تطبيق اللوحة لمدة 7 أيام على الأقل`,
text7: `تم بلوغ أقصى مدة للتطبيق`,
@@ -26,6 +27,14 @@ langAr = {
text10: `يرجى إضافة نص اللوحة من 4 أحرف`,
text11: `لا توجد لوحات متاحة حالياً`,
text12: `تم التطبيق بنجاح`,
text13: 'متبقٍ',
text14: 'سجل الطلبات',
text15: 'لا توجد سجلات للطلبات',
text16: 'تقديم الطلب',
text17: 'تمديد',
text18: 'قيد الطلب',
text19: 'لم يتم القبول',
text20: 'تم القبول'
}
}

View File

@@ -12,12 +12,13 @@ langEn = {
img2: `./images/disabled-btn-en.png`,
img3: `./images/apply-btn-basics-en.png`,
img6: `./images/record-en.png`,
img7: `./images/delay-btn-en.png`,
title_t: `Customized`,
text1: `Style: `,
text2: `Duration: `,
text3: `days`,
text4: `Text: `,
text5: `Enter 13 characters`,
text5: `please enter...`,
text55: `13`,
text6: `Minimum 7 days required`,
text7: `Maximum duration reached`,
@@ -26,6 +27,14 @@ langEn = {
text10: `Add 4 characters of text`,
text11: `No nameplates available`,
text12: `Successful`,
text13: 'Remaining',
text14: 'Application Records',
text15: 'No Application Records',
text16: 'Apply',
text17: 'Extend',
text18: 'In Progress',
text19: 'Rejected',
text20: 'Approved',
}
}

View File

@@ -12,6 +12,7 @@ langZh = {
img2: `./images/disabled-btn.png`,
img3: `./images/apply-btn-basics.png`,
img6: `./images/record.png`,
img7: `./images/delay-btn.png`,
title_t: `私人訂製`,
text1: `銘牌樣式:`,
text2: `申請時長:`,
@@ -26,5 +27,13 @@ langZh = {
text10: `請添加4個字的銘牌文字`,
text11: `暫時沒有銘牌可申請`,
text12: `申請成功`,
text13: `剩余`,
text14: `申请记录`,
text15: `暂无申请记录`,
text16: `申请`,
text17: `延长`,
text18: `申请中`,
text19: `不通过`,
text20: `已通过`,
}
}

View File

@@ -9,7 +9,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport"
content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no, viewport-fit=cover" />
<title>申请记录</title>
<title class="text14"></title>
<!-- 申请记录 -->
<link rel="stylesheet" href="../../common/css/reset.css">
<link rel="stylesheet" href="./css/record.css">
@@ -23,13 +24,17 @@
</ul>
<div class="no-record-wrap">
<img src="./images/default.png" alt="">
<span>暂无申请记录</span>
<span class="text15"></span>
</div>
<script src="../../common/js/jquery-3.2.1.min.js"></script>
<script src="../../common/js/common2.js"></script>
<script src="../../common/js/layer.js"></script>
<script src="../../common/js/vconsole.min.js"></script>
<script src="./local/en.js"></script>
<script src="./local/zh.js"></script>
<script src="./local/ar.js"></script>
<script src="./js/record.js"></script>
<script src="../../common/local/langHandler.js"></script>
</body>
</html>