欢乐砸蛋多语言完成

This commit is contained in:
dragon
2024-10-14 16:54:15 +08:00
parent 2b99e05e63
commit 77402a8e0b
28 changed files with 259 additions and 100 deletions

View File

@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=UTF-8><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>molistar</title><link href=./static/css/app.f93eab06805cd0eec251914bdfcfb4d4.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.7ef0f6b11dd8f8fd1487.js></script><script type=text/javascript src=./static/js/vendor.15ea60415f84b9c5a7e3.js></script><script type=text/javascript src=./static/js/app.6073143aaecac844f980.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=UTF-8><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>molistar</title><link href=./static/css/app.14202d105e213e5ea05236f39eb6fc08.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.69aa1ad4dea0359b45a4.js></script><script type=text/javascript src=./static/js/vendor.15ea60415f84b9c5a7e3.js></script><script type=text/javascript src=./static/js/app.6073143aaecac844f980.js></script></body></html>

View File

@@ -1,2 +0,0 @@
webpackJsonp([5],{GMXM:function(t,e,a){"use strict";a.d(e,"a",function(){return n});var n=function(t){var e=new Date(t),a=(e.getFullYear(),e.getMonth()+1);a=a<10?"0"+a:a;var n=e.getDate();n=n<10?"0"+n:n;var i=e.getHours();i=i<10?"0"+i:i;var s=e.getMinutes();s=s<10?"0"+s:s;var r=e.getSeconds();return r=r<10?"0"+r:r,a+"-"+n+" "+i+":"+s}},L8Ig:function(t,e){},ht4E:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("BRgg"),i=a("GMXM"),s={data:function(){return{dataList:[],loading:!1,finished:!1,page:0}},created:function(){document.title=this.$route.meta.title},methods:{onLoad:function(){var t=this;this.page++,Object(n.e)({pageSize:20,page:this.page,uid:window.sessionStorage.getItem("uid")||"935026",sortType:"time"}).then(function(e){t.dataList=t.dataList.concat(e.data.data),t.loading=!1,console.log(e.data.data),e.data.data.length<20&&(t.finished=!0)})},createTime:function(t){return Object(i.a)(t)}}},r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"max"},[a("div",{staticClass:"list"},[a("van-list",{attrs:{finished:t.finished,"finished-text":"沒有更多獲獎記錄了",offset:300},on:{load:t.onLoad},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.dataList,function(e,n){return a("div",{key:n,staticClass:"user"},[a("img",{attrs:{src:e.prizeImgUrl,alt:""}}),t._v(" "),a("p",{staticClass:"user-nick"},[t._v("\n "+t._s(e.prizeName)+"\n "),a("span",[t._v(" X "+t._s(e.prizeNum))])]),t._v(" "),a("p",{staticClass:"user-diamond"},[a("span",{staticClass:"diamond-num"},[t._v(t._s(t.createTime(e.createTime)))])])])}),0)],1)])},staticRenderFns:[]};var o=a("VU/8")(s,r,!1,function(t){a("L8Ig")},"data-v-12122600",null);e.default=o.exports}});
//# sourceMappingURL=5.36de0cf38e7936e529ee.js.map

View File

@@ -0,0 +1,2 @@
webpackJsonp([5],{GMXM:function(t,e,a){"use strict";a.d(e,"a",function(){return n});var n=function(t){var e=new Date(t),a=(e.getFullYear(),e.getMonth()+1);a=a<10?"0"+a:a;var n=e.getDate();n=n<10?"0"+n:n;var i=e.getHours();i=i<10?"0"+i:i;var s=e.getMinutes();s=s<10?"0"+s:s;var r=e.getSeconds();return r=r<10?"0"+r:r,a+"-"+n+" "+i+":"+s}},ht4E:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("BRgg"),i=a("GMXM"),s={data:function(){return{dataList:[],loading:!1,finished:!1,page:0}},created:function(){document.title=this.$route.meta.title},methods:{onLoad:function(){var t=this;this.loading=!1,this.page++,Object(n.e)({pageSize:20,page:this.page,uid:window.sessionStorage.getItem("uid")||"935026",sortType:"time"}).then(function(e){t.dataList=t.dataList.concat(e.data.data),t.loading=!1,console.log(e.data.data),e.data.data.length<20&&(t.finished=!0)})},createTime:function(t){return Object(i.a)(t)}}},r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"max"},[a("div",{staticClass:"list"},[a("van-list",{attrs:{finished:t.finished,"finished-text":"",offset:300},on:{load:t.onLoad},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.dataList,function(e,n){return a("div",{key:n,staticClass:"user"},[a("img",{attrs:{src:e.prizeImgUrl,alt:""}}),t._v(" "),a("p",{staticClass:"user-nick"},[t._v("\n "+t._s(e.prizeName)+"\n "),a("span",[t._v(" X "+t._s(e.prizeNum))])]),t._v(" "),a("p",{staticClass:"user-diamond"},[a("span",{staticClass:"diamond-num"},[t._v(t._s(t.createTime(e.createTime)))])])])}),0)],1)])},staticRenderFns:[]};var o=a("VU/8")(s,r,!1,function(t){a("yQ9+")},"data-v-494df2e8",null);e.default=o.exports},"yQ9+":function(t,e){}});
//# sourceMappingURL=5.946613b23d8c5d98c013.js.map

View File

@@ -1,2 +1,2 @@
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,s=0,d=[];s<r.length;s++)u=r[s],t[u]&&d.push(t[u][0]),t[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,a);d.length;)d.shift()();if(a)for(s=0;s<a.length;s++)f=o(o.s=a[s]);return f};var r={},t={9:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"8df79ff5365eaaec9298",1:"2660322e6ec3ab36d36b",2:"c400ed84fcfb7544002c",3:"7a4dfeb0d7ea325598f5",4:"74c8770604d782011a1a",5:"36de0cf38e7936e529ee",6:"92d7991962d3719f0ac8"}[e]+".js";var i=setTimeout(u,12e4);function u(){a.onerror=a.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=u,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.7ef0f6b11dd8f8fd1487.js.map
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,d=0,s=[];d<r.length;d++)u=r[d],t[u]&&s.push(t[u][0]),t[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,a);s.length;)s.shift()();if(a)for(d=0;d<a.length;d++)f=o(o.s=a[d]);return f};var r={},t={9:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"8df79ff5365eaaec9298",1:"2660322e6ec3ab36d36b",2:"c400ed84fcfb7544002c",3:"7a4dfeb0d7ea325598f5",4:"74c8770604d782011a1a",5:"946613b23d8c5d98c013",6:"92d7991962d3719f0ac8"}[e]+".js";var i=setTimeout(u,12e4);function u(){a.onerror=a.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=u,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.69aa1ad4dea0359b45a4.js.map

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -3,7 +3,9 @@ getInfoFromClient()
// 封装layer消息提醒框
let layerIndex
const showLoading = (content = '加載中...') => {
var langReplace;
var localLang;
const showLoading = (content = langReplace(localLang.newWishingWellRule.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.newWishingWellRule.layerIndex2), time = 2) => {
layer.open({
content,
time,
@@ -24,6 +26,41 @@ const toastMsg = (content = '操作完成', time = 2) => {
})
}
$(function () {
getInfoFromClient();
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
setTimeout(() => {
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
langReplace = window.lang.replace;
localLang = window.lang;
translateFun();
getData()
}, 100)
let currentIndex = 0
$('.tab').on('click', 'div', function () {
let index = $(this).index()
if (index === currentIndex) return;
$(this).addClass('active').siblings('div').removeClass('active')
if (index) {
getData(7)
} else {
getData(2)
}
currentIndex = index
})
})
function translateFun() {
var langReplace = window.lang.replace;
var localLang = window.lang;
$('.text1').text(langReplace(localLang.newWishingWellRule.text1));
$('.text2').text(langReplace(localLang.newWishingWellRule.text2));
$('.text3').text(langReplace(localLang.newWishingWellRule.text3));
$('.text4').text(langReplace(localLang.newWishingWellRule.text4));
$('.text5').text(langReplace(localLang.newWishingWellRule.text5));
$('.text6').text(langReplace(localLang.newWishingWellRule.text6));
}
let wishingWellList = []
const getData = (boxType = 2) => {
showLoading()
@@ -33,18 +70,18 @@ const getData = (boxType = 2) => {
data: {
boxType
},
success(res){
success(res) {
hideLoading(layerIndex)
if(res.code === 200){
if (res.code === 200) {
wishingWellList = res.data
renderList()
}else{
} else {
toastMsg(res.message)
}
},
error(){
error() {
hideLoading(layerIndex)
toastMsg('網絡錯誤')
toastMsg(langReplace(localLang.newWishingWellRule.layerIndex3))
}
})
}
@@ -64,22 +101,4 @@ const renderList = () => {
`
$('ul').html(str)
})
}
$(function () {
setTimeout(() => {
getData()
}, 50)
let currentIndex = 0
$('.tab').on('click', 'div', function(){
let index = $(this).index()
if(index === currentIndex) return;
$(this).addClass('active').siblings('div').removeClass('active')
if(index){
getData(7)
}else{
getData(2)
}
currentIndex = index
})
})
}

View File

@@ -2319,6 +2319,17 @@ langAr = {
<h3>5. كلما زاد مستوى الـ BOOM، زادت المكافآت التي تحصل عليها.</h3>
<h3>6. يتم تحديث قيمة الـ BOOM يوميًا في الساعة 00:00 (GMT+3).</h3>
<h3>7. يحتفظ هذا النظام بحق التفسير النهائي لهذا النشاط.</h3>
`
`
},
newWishingWellRule: {
layerIndex1: `جارٍ التحميل...`,
layerIndex2: `نجاح`,
layerIndex3: `خطأ في الشبكة`,
text1: `قواعد اللعبة`,
text2: `الهدايا التي يتم الحصول عليها من تحطيم البيض السعيد توضع في حقيبة الهدايا، يمكنك عرضها بفتح لوحة الهدايا؛`,
text3: `تضمن الحصول على هدية في كل مرة في تحطيم البيض السعيد.`,
text4: `هذا الحدث ومكافآته غير مرتبطين بشركة Google/Apple.`,
text5: `تحطيم البيض السعيد`,
text6: `بئر الأمنيات الخيالي (مفتوح لفترة محدودة)`,
}
}

View File

@@ -2329,5 +2329,16 @@ langEn = {
<h3>6. BOOM value is reset daily at 00:00 (GMT+3).</h3>
<h3>7. The platform reserves the final right of interpretation for this event.</h3>
`
},
newWishingWellRule: {
layerIndex1: `Loading...`,
layerIndex2: `Success`,
layerIndex3: `Network Error`,
text1: `Game Rules`,
text2: `Gifts obtained from Happy Egg Smash are placed in the gift bag, you can view them by opening the gift panel;`,
text3: `You are guaranteed to receive a gift every time in Happy Egg Smash.`,
text4: `This event and its rewards are not associated with Google/Apple Inc.`,
text5: `Happy Egg Smash`,
text6: `Fantasy Wishing Well (Limited Time Open)`,
}
}

View File

@@ -2320,5 +2320,16 @@ langZh = {
<h3>6. BOOM值每天0:00GMT+3更新。</h3>
<h3>7. 本平台擁有本活動最終解釋權。</h3>
`//英语区
},
newWishingWellRule: {
layerIndex1: `加载中...`,
layerIndex2: `成功`,
layerIndex3: `网络错误`,
text1: `玩法规则`,
text2: `從歡樂砸蛋處獲得的禮物放到禮物包裹,點開禮物面板即可查看;`,
text3: `每次在歡樂砸蛋100%獲得禮物。`,
text4: `本活動以及活動獎勵與Google/蘋果公司無關。`,
text5: `歡樂砸蛋`,
text6: `梦幻许愿池(限时开放)`,
}
}

View File

@@ -7,9 +7,9 @@
<meta name="viewport"
content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" type="text/css" href="../../common/css/reset.css"/>
<link rel="stylesheet" type="text/css" href="../../common/css/reset.css" />
<link rel="stylesheet" href="./style/wishingWellRule.css">
<title>玩法规则</title>
<title class="text1"></title>
</head>
@@ -17,25 +17,25 @@
<div class="max">
<p class="rule">
<span class="icon">1</span>
<span>從歡樂砸蛋處獲得的禮物放到禮物包裹,點開禮物面板即可查看;</span>
<span class="text2"> </span>
</p>
<p class="rule">
<span class="icon">2</span>
<span>每次在歡樂砸蛋100%獲得禮物。</span>
<span class="text3"></span>
</p>
<p class="rule">
<span class="icon">3</span>
<span>本活動以及活動獎勵與Google/蘋果公司無關。</span>
<span class="text4"></span>
</p>
</div>
<div class="tab">
<div class="active">
<span class="tab-name">歡樂砸蛋</span>
<span class="tab-name text5"></span>
<span class="line"></span>
</div>
<div style="display: none;">
<span class="tab-name">梦幻许愿池(限时开放)</span>
<span class="tab-name text6"></span>
<span class="line"></span>
</div>
</div>
@@ -48,5 +48,10 @@
<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="./js/newWishingWellRule.js?v=1.0"></script>
<script src="./local/en.js"></script>
<script src="./local/zh.js"></script>
<script src="./local/ar.js"></script>
<script src="./js/newWishingWellRule.js"></script>
<script src="../../common/local/langHandler.js"></script>
</html>

View File

@@ -91,8 +91,8 @@ ul li div .gift-prize {
}
ul li div .gift-prize img {
width: 0.34667rem;
height: 0.26667rem;
width: 0.45333rem;
height: 0.45333rem;
}
ul li .gift-rate {

View File

@@ -81,8 +81,8 @@ ul{
align-items: center;
margin: 0;
img{
width: px2rem(26);
height: px2rem(20);
width: px2rem(34);
height: px2rem(34);
}
}
}

View File

@@ -42,7 +42,7 @@ body {
.box .a {
position: absolute;
background: rgba(255, 255, 255, 0.6);
width: 1.5rem;
min-width: 1.5rem;
text-align: center;
color: #4F00B0;
height: 0.53333rem;
@@ -52,6 +52,7 @@ body {
text-indent: 0.15rem;
font-size: 0.30667rem;
font-weight: 500;
padding: 0 0.13333rem;
}
.box .rank {
@@ -255,3 +256,8 @@ body {
transform: translate(-50%, -50%);
font-size: 0.34667rem;
}
.english .box {
background: url(../images/box-en.png) no-repeat;
background-size: 100% 100%;
}

View File

@@ -46,7 +46,7 @@ body {
.a {
position: absolute;
background: rgba(255, 255, 255, 0.6);
width: 1.5rem;
min-width: 1.5rem;
text-align: center;
color: #4F00B0;
height: px2rem(40);
@@ -56,6 +56,7 @@ body {
text-indent: 0.15rem;
font-size: px2rem(23);
font-weight: 500;
padding: 0 px2rem(10);
}
.rank {
@@ -261,4 +262,11 @@ body {
transform: translate(-50%, -50%);
font-size: px2rem(26);
}
}
.english {
.box {
background: url(../images/box-en.png) no-repeat;
background-size: 100% 100%;
}
}

View File

@@ -131,3 +131,7 @@ body {
width: 0.4rem;
height: 0.4rem;
}
.arabic .box .tab {
direction: ltr;
}

View File

@@ -136,4 +136,9 @@ body {
}
}
}
}
.arabic{
.box .tab{
direction: ltr;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>歡樂砸蛋</title>
<title class="text1"></title>
<link rel="stylesheet" href="../../common/css/reset.css">
<link rel="stylesheet" href="./css/index.css">
</head>
@@ -17,12 +17,14 @@
<!-- 容器 -->
<div class="box">
<!-- 排行榜 -->
<div href="" class="a rank">排行榜</div>
<div href="" class="a rank text2"></div>
<!-- 遊戲規則 -->
<div href="https://api.molistar.xyz/molistar/modules/rule/newWishingWellRule.html" class="a rule">遊戲規則</div>
<div href="https://api.molistar.xyz/molistar/modules/rule/newWishingWellRule.html" class="a rule text3">
</div>
<!-- 獲獎記錄 -->
<div href="https://api.molistar.xyz/molistar/modules/rank/index.html#/newWishingWellRecord" class="a record">
獲獎記錄
<div href="https://api.molistar.xyz/molistar/modules/rank/index.html#/newWishingWellRecord"
class="a record text4">
</div>
<!---->
<img src="./images/egg.png" alt="" class="egg">
@@ -36,15 +38,15 @@
<!-- 購買 -->
<div class="buyBox">
<div class="prop">
<span>我的道具: <b>0</b></span>
<span><strong class="text5"> </strong> <b>0</b></span>
</div>
<div class="tab">
<span class="act">1</span>
<span>10</span>
<span>100</span>
</div>
<input type="number" placeholder="自定義購買">
<div class="buy">購買</div>
<input type="number" class="text6" placeholder="">
<div class="buy text7"></div>
</div>
<!-- 獲獎提示 -->
<ul>
@@ -71,4 +73,8 @@
<script src="../../common/js/vconsole.min.js"></script>
<script src="../../common/js/route-constant.js"></script>
<script src="../../common/js/svga.min.js"></script>
<script src="./js/index.js"></script>
<script src="./local/en.js"></script>
<script src="./local/zh.js"></script>
<script src="./local/ar.js"></script>
<script src="./js/index.js"></script>
<script src="../../common/local/langHandler.js"></script>

View File

@@ -6,7 +6,9 @@ if (env == 'test') {
}
// 封裝layer消息提醒框
let layerIndex
const showLoading = (content = "加載中...") => {
var langReplace;
var localLang;
const showLoading = (content = langReplace(localLang.demoModule.layerIndex1)) => {
layer.open({
type: 2,
shadeClose: false,
@@ -19,7 +21,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,
@@ -31,6 +33,7 @@ var ticketNum = 0;//道具數量
// 初始化函數
$(function () {
getInfoFromClient();
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
setTimeout(function () {
// 頁面全屏
if (browser.app) {
@@ -48,32 +51,26 @@ $(function () {
window.webkit.messageHandlers.closeWebView.postMessage(null)
}
})
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
langReplace = window.lang.replace;
localLang = window.lang;
translateFun();
showLoading()
getConfig();
}, 100)
})
// 處理SVGA
document.addEventListener('DOMContentLoaded', function () {
// function loadSVGA(containerId, svgaPath) {
// var container = document.getElementById(containerId);
// var player = new SVGA.Player(container);
// var parser = new SVGA.Parser();
// parser.load(svgaPath, function (videoItem) {
// player.setVideoItem(videoItem);
// player.startAnimation();
// });
// }
// loadSVGA('xz1', './svga/xz1.svga');
// loadSVGA('xz2', './svga/xz2.svga');
// loadSVGA('ts1', './svga/1.svga');
// loadSVGA('ts2', './svga/23.svga');
// loadSVGA('ts3', './svga/23.svga');
// loadSVGA('lsls', './svga/lsls.svga');
// loadSVGA('kt', './svga/kt.svga');
// loadSVGA('kt2', './svga/kt.svga');
});
function translateFun() {
var langReplace = window.lang.replace;
var localLang = window.lang;
$('.text1').text(langReplace(localLang.demoModule.text1));
$('.text2').text(langReplace(localLang.demoModule.text2));
$('.text3').text(langReplace(localLang.demoModule.text3));
$('.text4').text(langReplace(localLang.demoModule.text4));
$('.text5').text(langReplace(localLang.demoModule.text5));
$('.text6').attr('placeholder', langReplace(localLang.demoModule.text6));
$('.text7').text(langReplace(localLang.demoModule.text7));
}
// 配置接口
function getConfig() {
networkRequest({
@@ -90,7 +87,7 @@ function getConfig() {
},
error(err) {
hideLoading(layerIndex)
toastMsg("網路錯誤")
toastMsg(langReplace(localLang.demoModule.layerIndex3))
}
})
}
@@ -112,7 +109,7 @@ function buyTicket(num) {
},
success(res) {
if (res.code === 200) {
toastMsg('購買成功~');
toastMsg(langReplace(localLang.demoModule.text8));
getConfig();
} else {
toastMsg(res.message)
@@ -121,7 +118,7 @@ function buyTicket(num) {
},
error(err) {
hideLoading(layerIndex)
toastMsg("網路錯誤")
toastMsg(langReplace(localLang.demoModule.layerIndex3))
}
})
}
@@ -172,7 +169,7 @@ function draw(num) {
},
error(err) {
hideLoading(layerIndex)
toastMsg("網路錯誤")
toastMsg(langReplace(localLang.demoModule.layerIndex3))
}
})
}
@@ -184,7 +181,7 @@ $('.box .but img').click(function () {
if (ticketNum >= num) {
draw(num);
} else {
toastMsg('道具不足~');
toastMsg(langReplace(localLang.demoModule.text9));
}
})
$('.rank').click(function () {

View File

@@ -6,7 +6,9 @@ if (env == 'test') {
}
// 封裝layer消息提醒框
let layerIndex
const showLoading = (content = "加載中...") => {
var langReplace;
var localLang;
const showLoading = (content = langReplace(localLang.demoModule.layerIndex1)) => {
layer.open({
type: 2,
shadeClose: false,
@@ -19,7 +21,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,
@@ -32,6 +34,7 @@ var lock = true;
// 初始化函數
$(function () {
getInfoFromClient();
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
setTimeout(function () {
// 頁面全屏
if (browser.app) {
@@ -45,9 +48,19 @@ $(function () {
$('.back img').click(() => {
history.back();
})
fuzzyMatchUpdateQueryStringParameterFun(); // 判断语言
langReplace = window.lang.replace;
localLang = window.lang;
translateFun();
rank(type, page);
}, 100)
})
function translateFun() {
var langReplace = window.lang.replace;
var localLang = window.lang;
$('.text10').text(langReplace(localLang.demoModule.text10));
$('.text11').text(langReplace(localLang.demoModule.text11));
}
// 配置接口
function rank(type, page) {
showLoading()
@@ -86,7 +99,7 @@ function rank(type, page) {
error(err) {
lock = true;
hideLoading(layerIndex)
toastMsg("網路錯誤")
toastMsg(langReplace(localLang.demoModule.layerIndex3))
}
})
}

View File

@@ -0,0 +1,20 @@
// 阿拉伯
langAr = {
// 模块
demoModule: {
layerIndex1: `جاري التحميل...`,
layerIndex2: `نجاح`,
layerIndex3: `خطأ في الشبكة`,
text1: `تحطيم البيض السعيد`,
text2: `التصنيف`,
text3: `قواعد اللعبة`,
text4: `سجلات الفوز`,
text5: `عناصري:`,
text6: `شراء مخصص`,
text7: `شراء`,
text8: `تم الشراء بنجاح~`,
text9: `العناصر غير كافية~`,
text10: `ترتيب اليوم`,
text11: `ترتيب الأمس`,
}
}

View File

@@ -0,0 +1,18 @@
langEn = {
demoModule: {
layerIndex1: `Loading...`,
layerIndex2: `Success`,
layerIndex3: `Network error`,
text1: `Happy Egg Smash`,
text2: `Ranking`,
text3: `Game Rules`,
text4: `Winning Records`,
text5: `My Items:`,
text6: `Custom Purchase`,
text7: `Purchase`,
text8: `Purchase Successful~`,
text9: `Insufficient Items~`,
text10: `Today`,
text11: `Yesterday`,
}
}

View File

@@ -0,0 +1,20 @@
// 中文
langZh = {
// 模塊
demoModule: {
layerIndex1: `加载中...`,
layerIndex2: `成功`,
layerIndex3: `网络错误`,
text1: `歡樂砸蛋`,
text2: `排行榜`,
text3: `遊戲規則`,
text4: `獲獎記錄`,
text5: `我的道具:`,
text6: `自定義購買`,
text7: `購買`,
text8: `購買成功~`,
text9: `道具不足~`,
text10: `今日榜單`,
text11: `昨日榜單`,
},
}

View File

@@ -16,8 +16,8 @@
</div>
<div class="box">
<div class="tab">
<div class="act0">今日榜單</div>
<div class="">昨日榜單</div>
<div class="act0 text10"></div>
<div class="text11"></div>
</div>
<ul>
@@ -33,4 +33,8 @@
<script src="../../common/js/vconsole.min.js"></script>
<script src="../../common/js/route-constant.js"></script>
<script src="../../common/js/svga.min.js"></script>
<script src="./js/rank.js"></script>
<script src="./local/en.js"></script>
<script src="./local/zh.js"></script>
<script src="./local/ar.js"></script>
<script src="./js/rank.js"></script>
<script src="../../common/local/langHandler.js"></script>

View File

@@ -22,7 +22,7 @@ module.exports = {
}},
// Various Dev Server settings
host: '192.168.19.136',
host: '192.168.10.42',
// host: '192.168.8.97', // can be overwritten by process.env.HOST
port: 5500, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,

View File

@@ -6,7 +6,7 @@
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多获奖记录了"
finished-text=""
@load="onLoad"
:offset="300"
>
@@ -14,7 +14,7 @@
<img :src="item.prizeImgUrl" alt="" />
<p class="user-nick">
{{ item.prizeName }}
<span> X {{item.prizeNum}}</span>
<span> X {{ item.prizeNum }}</span>
</p>
<p class="user-diamond">
<span class="diamond-num">{{ createTime(item.createTime) }}</span>
@@ -35,7 +35,7 @@ export default {
dataList: [],
loading: false,
finished: false,
page: 0
page: 0,
};
},
created() {
@@ -43,13 +43,14 @@ export default {
},
methods: {
onLoad() {
this.loading = false;
this.page++;
wishingDrawRecord({
pageSize: 20,
page: this.page,
uid: window.sessionStorage.getItem("uid") || "935026",
sortType: "time"
}).then(res => {
sortType: "time",
}).then((res) => {
this.dataList = this.dataList.concat(res.data.data);
this.loading = false;
console.log(res.data.data);
@@ -60,8 +61,8 @@ export default {
},
createTime(time) {
return formatDate(time);
}
}
},
},
};
</script>
@@ -105,7 +106,7 @@ export default {
.user-nick {
font-size: 15px;
color: #333333;
span{
span {
font-size: 12px;
color: #999;
}