ts队列组件,兼容安卓小米升级方案

This commit is contained in:
唐明明
2021-11-15 17:17:18 +08:00
parent 24b23ac13c
commit 0f9b01274f
10 changed files with 649 additions and 283 deletions

23
App.vue
View File

@@ -36,12 +36,29 @@
success: modalRes => {
if (modalRes.confirm) {
if (plus.os.name == "Android") {
plus.runtime.openURL(res.info.download, err => {
uni.showToast({
title: err,
title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon : 'none'
})
});
uni.downloadFile({
url : res.info.download,
success : apkPick=> {
plus.runtime.install(apkPick.tempFilePath, '', installRES => {
// 安装完成用于提示新版本引导,暂时无用
}, installERR => {
// 安装失败
})
},
fail(err){
uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试',
icon : 'none'
})
}
})
// plus.runtime.openURL(res.info.download, err => {
// console.log(err)
// }, 'com.android.browser');
} else{
uni.showToast({
title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新',

View File

@@ -2,8 +2,8 @@
"name" : "链商星球",
"appid" : "__UNI__1F65101",
"description" : "安徽星煌,链商星球商家工具",
"versionName" : "1.1.9",
"versionCode" : 119,
"versionName" : "1.2.0",
"versionCode" : 120,
"transformPx" : false,
/* 5+App */
"app-plus" : {

137
package-lock.json generated
View File

@@ -4,6 +4,138 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"requires": {
"fill-range": "^7.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"enhanced-resolve": {
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz",
"integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==",
"requires": {
"graceful-fs": "^4.2.4",
"tapable": "^2.2.0"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"requires": {
"to-regex-range": "^5.0.1"
}
},
"graceful-fs": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg=="
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"micromatch": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
"integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==",
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.2.3"
}
},
"picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw=="
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"requires": {
"has-flag": "^4.0.0"
}
},
"tapable": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"requires": {
"is-number": "^7.0.0"
}
},
"ts-loader": {
"version": "9.2.6",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz",
"integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==",
"requires": {
"chalk": "^4.1.0",
"enhanced-resolve": "^5.0.0",
"micromatch": "^4.0.0",
"semver": "^7.3.4"
}
},
"uni-read-pages": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/uni-read-pages/-/uni-read-pages-1.0.5.tgz",
@@ -23,6 +155,11 @@
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
}

View File

@@ -13,6 +13,7 @@
"author": "web唐明明",
"license": "ISC",
"dependencies": {
"ts-loader": "^9.2.6",
"uni-read-pages": "^1.0.5",
"uni-simple-router": "^2.0.7",
"uview-ui": "^1.8.4",

View File

@@ -804,6 +804,13 @@
"navigationBarTitleText": "订单审核",
"navigationBarBackgroundColor": "#FFFFFF"
}
}, {
"path": "pages/queue/queue",
"style": {
"navigationBarTitleText": "队列",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {

View File

@@ -21,8 +21,7 @@
</view>
<block v-if="isAuth">
<view class="ore-lists">
<view class="oct-float ore-item" v-for="(item, index) in crystalArr" :key="index"
:style="{left: item.left + '%', top: item.top + '%'}" @click="ledCrystal(index)">
<view class="oct-float ore-item" v-for="(item, index) in crystalArr" :key="index" :style="{left: item.left + '%', top: item.top + '%'}" @click="ledCrystal(index)">
<block v-if="item.amount !== null">
<view class="oct-icon">
<image src="@/static/icons/crystal-icon.png" mode="widthFix" class="icon" />
@@ -121,17 +120,11 @@
</template>
<script>
import {
chain,
crystals,
thawlog
} from '@/apis/interfaces/chain'
import { chain, crystals, thawlog } from '@/apis/interfaces/chain'
import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js'
import lF2 from '@/uni_modules/lime-f2/components/lime-f2/'
export default {
components: {
lF2
},
components: { lF2 },
data() {
return {
isAuth: false,
@@ -155,7 +148,10 @@
certification: false,
company: false,
vip: false
}
},
// 领取贡献值队列
queueData : [],
queueState : false
};
},
onShow() {

64
pages/queue/queue.vue Normal file
View File

@@ -0,0 +1,64 @@
<template>
<view>
<view class="item" v-for="(item, index) in items" :key="index" @click="onEnqueue(item)">{{item}}入列</view>
</view>
</template>
<script>
import Queue from '@/public/queue'
let queue = new Queue()
export default {
data() {
return {
items: [0,1,2,3,4,5,6,7,8,9],
start: false
};
},
created() {
},
methods:{
onEnqueue(e){
let startTime
queue.enqueue(e)
if(!this.start){
this.start = true
this.startQueue(queue, startTime)
}
},
startQueue(outTime){
outTime = setInterval(() => {
if(queue.isNull()){
clearInterval(outTime)
this.start = false
return
}
queue.front().then(val => {
console.log(val)
// 此处处理对接接口请求
})
queue.dequeue()
}, 1000)
}
}
}
</script>
<style lang="scss">
.item{
margin: $margin;
background: white;
text-align: center;
color: $mian-color;
line-height: 90rpx;
font-weight: bold;
}
.button{
background: white;
margin: $margin;
height: 90rpx;
line-height: 90rpx;
text-align: center;
}
</style>

27
public/queue.ts Normal file
View File

@@ -0,0 +1,27 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 处理队列
*/
export default class Queue {
constructor(arg: Array) {
this.arrData = arg || []
}
enqueue(el) {
this.arrData.push(el)
}
dequeue(el) {
return this.arrData.shift()
}
front() {
return new Promise((resolve, reject) => {
resolve(this.arrData[0])
})
}
isNull() {
return this.arrData.length === 0
}
}

0
tsconfig.json Normal file
View File

File diff suppressed because one or more lines are too long