xiongzhu 2 лет назад
Родитель
Сommit
a200f7a7ef

+ 1 - 1
android/app/build.gradle

@@ -6,7 +6,7 @@ android {
         applicationId "com.bigauction.mobile"
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
-        versionCode 43
+        versionCode 47
         versionName "1.0.0"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         aaptOptions {

+ 1 - 0
android/app/capacitor.build.gradle

@@ -9,6 +9,7 @@ android {
 
 apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
 dependencies {
+    implementation project(':capacitor-community-barcode-scanner')
     implementation project(':capacitor-community-http')
     implementation project(':capacitor-community-media')
     implementation project(':capacitor-action-sheet')

+ 7 - 1
android/app/src/main/AndroidManifest.xml

@@ -1,11 +1,15 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.bigauction.mobile">
+<manifest
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    package="com.bigauction.mobile">
     <application
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
+        android:hardwareAccelerated="true"
         android:usesCleartextTraffic="true">
         <meta-data android:name="com.openinstall.APP_KEY" android:value="crgkm2" />
         <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
@@ -72,4 +76,6 @@
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="com.google.android.gms.permission.AD_ID" />
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
 </manifest>

BIN
android/app/src/main/assets/cdvasset.manifest


+ 3 - 0
android/capacitor.settings.gradle

@@ -2,6 +2,9 @@
 include ':capacitor-android'
 project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
 
+include ':capacitor-community-barcode-scanner'
+project(':capacitor-community-barcode-scanner').projectDir = new File('../node_modules/@capacitor-community/barcode-scanner/android')
+
 include ':capacitor-community-http'
 project(':capacitor-community-http').projectDir = new File('../node_modules/@capacitor-community/http/android')
 

+ 1 - 1
codePush.mjs

@@ -20,7 +20,7 @@ inquirer
             type: 'checkbox',
             message: 'Platform',
             choices: ['Android', 'iOS'],
-            default: ['Android', 'iOS']
+            default: ['Android']
         },
         { name: 'build', type: 'list', message: 'build', choices: ['YES', 'NO'], default: 'YES' }
     ])

+ 2 - 2
ios/App/App.xcodeproj/project.pbxproj

@@ -352,7 +352,7 @@
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
 				CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 43;
+				CURRENT_PROJECT_VERSION = 47;
 				DEFINES_MODULE = NO;
 				DEVELOPMENT_TEAM = 72P5Y6N578;
 				INFOPLIST_FILE = App/Info.plist;
@@ -377,7 +377,7 @@
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
 				CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 43;
+				CURRENT_PROJECT_VERSION = 47;
 				DEFINES_MODULE = NO;
 				DEVELOPMENT_TEAM = 72P5Y6N578;
 				INFOPLIST_FILE = App/Info.plist;

+ 1 - 0
package.json

@@ -9,6 +9,7 @@
     "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
   },
   "dependencies": {
+    "@capacitor-community/barcode-scanner": "^3.0.1",
     "@capacitor-community/http": "^2.0.0-0",
     "@capacitor-community/media": "^3.0.0",
     "@capacitor/action-sheet": "^4.1.0",

+ 3 - 1
src/App.vue

@@ -4,7 +4,9 @@
             <ion-router-outlet />
         </ion-app>
     </vant-config-provider>
-    <img id="btn-customer" src="@/assets/icon_custumer.png" @click="customer" />
+    <transition name="fade">
+        <img id="btn-customer" src="@/assets/icon_custumer.png" @click="customer" v-if="store.showCS" />
+    </transition>
     <div class="customer-modal">
         <transition name="fade">
             <div class="dim" @click="showCustmer = false" v-if="showCustmer"></div>

+ 4 - 1
src/locales/en.json

@@ -12,7 +12,10 @@
             "pay": "to pay",
             "receipt": "collect money",
             "recharge": "recharge",
-            "withdraw": "withdraw"
+            "withdraw": "withdraw",
+            "stake": "stake",
+            "redeem": "redeem",
+            "return": "return"
         },
         "symbol": "$",
         "totalWithdraw": "Cumulative withdrawal",

+ 4 - 1
src/locales/zh.json

@@ -107,7 +107,10 @@
             "receipt": "收款",
             "recharge": "充值",
             "withdraw": "提现",
-            "commission": "佣金"
+            "commission": "佣金",
+            "stake": "质押",
+            "redeem": "赎回",
+            "return": "退回"
         },
         "withdrawModalTitle": "申请提现",
         "confirmWithdraw": "确认提现",

+ 1 - 1
src/mixins/phone.js

@@ -32,7 +32,7 @@ export default {
                 })
                 .then(res => {
                     this.msgCode = res
-                    this.$toast.success('发送成功')
+                    this.$toast.success(this.$t('loginPage.sended'))
                     return Promise.resolve()
                 })
                 .catch(e => {

+ 40 - 12
src/router/index.js

@@ -2,6 +2,7 @@ import { createRouter, createWebHistory, createWebHashHistory } from '@ionic/vue
 import TabsPage from '../views/TabsPage.vue'
 import { Page } from './Page'
 import { useUserStore } from '../stores/user'
+import { useSettingsStore } from '../stores/settings'
 import { emitter } from '../utils/eventBus'
 
 const router = createRouter({
@@ -30,7 +31,8 @@ const router = createRouter({
                     redirect: '/home',
                     name: 'redirect',
                     meta: {
-                        allowGuest: true
+                        allowGuest: true,
+                        showCS: true
                     }
                 },
                 {
@@ -38,7 +40,8 @@ const router = createRouter({
                     name: 'home',
                     component: () => import('@/views/HomePage.vue'),
                     meta: {
-                        allowGuest: true
+                        allowGuest: true,
+                        showCS: true
                     }
                 },
                 {
@@ -46,7 +49,8 @@ const router = createRouter({
                     name: 'BLF',
                     component: () => import('@/views/BLFPage.vue'),
                     meta: {
-                        allowGuest: true
+                        allowGuest: true,
+                        showCS: true
                     }
                 },
                 {
@@ -54,7 +58,8 @@ const router = createRouter({
                     name: 'rank',
                     component: () => import('@/views/RankPage.vue'),
                     meta: {
-                        allowGuest: true
+                        allowGuest: true,
+                        showCS: true
                     }
                 },
                 {
@@ -62,13 +67,18 @@ const router = createRouter({
                     name: 'mine',
                     component: () => import('@/views/MinePage.vue'),
                     meta: {
-                        allowGuest: true
+                        allowGuest: true,
+                        showCS: true
                     }
                 },
                 {
                     path: 'distribution1',
                     name: 'distribution1',
-                    component: () => import('@/views/DistributionPage.vue')
+                    component: () => import('@/views/DistributionPage.vue'),
+                    meta: {
+                        allowGuest: true,
+                        showCS: true
+                    }
                 }
             ]
         },
@@ -86,7 +96,8 @@ const router = createRouter({
             component: () => import('@/views/LoginPage.vue'),
             meta: {
                 allowGuest: true,
-                guestOnly: true
+                guestOnly: true,
+                showCS: true
             }
         },
         {
@@ -95,7 +106,8 @@ const router = createRouter({
             component: () => import('@/views/LoginPhonePage.vue'),
             meta: {
                 allowGuest: true,
-                guestOnly: true
+                guestOnly: true,
+                showCS: true
             }
         },
         {
@@ -104,18 +116,25 @@ const router = createRouter({
             component: () => import('@/views/RegisterPage.vue'),
             meta: {
                 allowGuest: true,
-                guestOnly: true
+                guestOnly: true,
+                showCS: true
             }
         },
         {
             path: '/order',
             name: 'order',
-            component: () => import('@/views/OrderPage.vue')
+            component: () => import('@/views/OrderPage.vue'),
+            meta: {
+                showCS: true
+            }
         },
         {
             path: '/orderDetail',
             name: 'orderDetail',
-            component: () => import('@/views/OrderDetailPage.vue')
+            component: () => import('@/views/OrderDetailPage.vue'),
+            meta: {
+                showCS: true
+            }
         },
         {
             path: '/wallet',
@@ -223,6 +242,11 @@ const router = createRouter({
             path: '/editBank',
             name: 'editBank',
             component: () => import('@/views/EditBankPage.vue')
+        },
+        {
+            path: '/scanCode',
+            name: 'scanCode',
+            component: () => import('@/views/ScanCodePage.vue')
         }
     ]
 })
@@ -243,5 +267,9 @@ router.beforeEach(async (to, from, next) => {
         next()
     }
 })
-
+router.afterEach((to, from) => {
+    const { toggleCS } = useSettingsStore()
+    toggleCS(to.meta.showCS === true)
+})
+window.router = router
 export default router

+ 3 - 1
src/stores/settings.js

@@ -6,9 +6,11 @@ export const useSettingsStore = defineStore('settings', () => {
     const isDark = useDark()
     const toggleDark = useToggle(isDark)
     const firstOpen = useStorage('firstOpen', 1, localStorage)
+    const showCS = ref(true)
     if (firstOpen.value !== 2) {
         firstOpen.value = 2
         isDark.value = true
     }
-    return { isDark, toggleDark }
+    const toggleCS = useToggle(showCS)
+    return { isDark, toggleDark, showCS, toggleCS }
 })

+ 46 - 9
src/utils/console.js

@@ -1,12 +1,10 @@
-// import eruda from 'eruda'
-// import erudaCode from 'eruda-code'
-// import erudaFeatures from 'eruda-features'
-// import erudaFps from 'eruda-fps'
-// import erudaTiming from 'eruda-timing'
-// import erudaMemory from 'eruda-memory'
+import { App } from '@capacitor/app'
+import { Capacitor } from '@capacitor/core'
+import { Device } from '@capacitor/device'
+
 let initialized = false
 let loading = false
-function init() {
+async function init() {
     // eruda.init({
     //     useShadowDom: false,
     //     defaults: {
@@ -25,9 +23,10 @@ function init() {
             loading = false
             let eruda = res.default
             eruda.init({
-                useShadowDom: false,
+                useShadowDom: true,
                 defaults: {
-                    theme: 'Material Oceanic'
+                    theme: 'Material Oceanic',
+                    displaySize: '90'
                 }
             })
             initialized = true
@@ -46,6 +45,44 @@ function init() {
             // import('eruda-memory').then(res => {
             //     eruda.add(res.default)
             // })
+            eruda.remove('sources')
+            let snippets = eruda.get('snippets')
+            let info = eruda.get('info')
+            info.remove('Backers')
+            info.remove('About')
+            if (Capacitor.isNativePlatform()) {
+                App.getInfo().then(appInfo => {
+                    info.add(
+                        'AppInfo',
+                        `<table><tbody>
+                        <tr><td class="eruda-device-key">name</td><td>${appInfo.name}</td></tr>
+                        <tr><td>id</td><td>${appInfo.id}</td></tr>
+                        <tr><td>build</td><td>${appInfo.build}</td></tr>
+                        <tr><td>version</td><td>${appInfo.version}</td></tr>
+                        </tbody></table>`
+                    )
+                })
+                Device.getInfo().then(deviceInfo => {
+                    info.add(
+                        'DeviceInfo',
+                        `<table><tbody>
+                        <tr><td class="eruda-device-key">name</td><td>${deviceInfo.name}</td></tr>
+                        <tr><td>model</td><td>${deviceInfo.model}</td></tr>
+                        <tr><td>platform</td><td>${deviceInfo.platform}</td></tr>
+                        <tr><td>operatingSystem</td><td>${deviceInfo.operatingSystem}</td></tr>
+                        <tr><td>osVersion</td><td>${deviceInfo.operatingSystem}</td></tr>
+                        <tr><td>manufacturer</td><td>${deviceInfo.manufacturer}</td></tr>
+                        <tr><td>isVirtual</td><td>${deviceInfo.isVirtual}</td></tr>
+                        <tr><td>memUsed</td><td>${deviceInfo.memUsed}</td></tr>
+                        <tr><td>diskFree</td><td>${deviceInfo.diskFree}</td></tr>
+                        <tr><td>diskTotal</td><td>${deviceInfo.diskTotal}</td></tr>
+                        <tr><td>realDiskFree</td><td>${deviceInfo.realDiskFree}</td></tr>
+                        <tr><td>realDiskTotal</td><td>${deviceInfo.realDiskTotal}</td></tr>
+                        <tr><td>webViewVersion</td><td>${deviceInfo.webViewVersion}</td></tr>
+                        </tbody></table>`
+                    )
+                })
+            }
         })
         .catch(e => {
             loading = false

+ 3 - 3
src/version.json

@@ -1,12 +1,12 @@
 {
     "ios": {
         "version": "1.0.0",
-        "build": 43
+        "build": 47
     },
     "android": {
         "version": "1.0.0",
-        "build": 43,
+        "build": 47,
         "versionCode": 12
     },
-    "www": 1026
+    "www": 1030
 }

+ 1 - 1
src/views/BLFPage.vue

@@ -155,7 +155,7 @@ function getOrder() {
             '/financeOrder/my',
             {
                 query: {
-                    status: 'PENDING, STAKING'
+                    status: 'PENDING,STAKING'
                 },
                 sort: 'id,desc'
             },

+ 1 - 1
src/views/DistributionPage.vue

@@ -146,8 +146,8 @@ export default {
         setTimeout(() => {
             if (this.$route.query.showShare === 'true' || this.$route.query.showShare == true) {
                 this.onOpenInviteModal()
+                this.$router.replace({ query: {} })
             }
-            this.$router.replace({ query: {} })
         }, 500)
     },
     methods: {

+ 1 - 7
src/views/MinePage.vue

@@ -221,13 +221,7 @@ onIonViewWillEnter(() => {
 })
 const balanceText = computed(() => {
     if (balance.value && balance.value.balance != undefined) {
-        if (balance.value.balance > 1000000) {
-            return (balance.value.balance / 1000000).toFixed(1).replace(/\.0$/, '') + 'M'
-        } else if (balance.value.balance > 10000) {
-            return (balance.value.balance / 10000).toFixed(1).replace(/\.0$/, '') + 'K'
-        } else {
-            return balance.value.balance + ''
-        }
+        return balance.value.balance.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
     }
     return '-'
 })

+ 48 - 0
src/views/ScanCodePage.vue

@@ -0,0 +1,48 @@
+<template>
+    <ion-page class="scan-code">
+        <ion-header>
+            <ion-toolbar>
+                <ion-buttons slot="start">
+                    <ion-back-button text="" default-href="#" @click="$router.back()"></ion-back-button>
+                </ion-buttons>
+                <ion-title>Scan Code</ion-title>
+            </ion-toolbar>
+        </ion-header>
+    </ion-page>
+</template>
+<script setup>
+import { onIonViewWillEnter, onIonViewDidEnter, onIonViewWillLeave } from '@ionic/vue'
+import { BarcodeScanner } from '@capacitor-community/barcode-scanner'
+
+const startScan = async () => {
+    // Check camera permission
+    // This is just a simple example, check out the better checks below
+    await BarcodeScanner.checkPermission({ force: true })
+
+    // make background of WebView transparent
+    // note: if you are using ionic this might not be enough, check below
+    BarcodeScanner.hideBackground()
+
+    const result = await BarcodeScanner.startScan() // start scanning and wait for a result
+
+    // if the result has content
+    if (result.hasContent) {
+        console.log(result.content) // log the raw scanned content
+    }
+}
+const stopScan = () => {
+    BarcodeScanner.showBackground()
+    BarcodeScanner.stopScan()
+}
+onIonViewDidEnter(() => {
+    startScan()
+})
+onIonViewWillLeave(() => {
+    stopScan()
+})
+</script>
+<style lang="less">
+.scan-code {
+    --ion-background-color: transparent;
+}
+</style>

+ 1 - 1
src/views/WalletPage.vue

@@ -12,7 +12,7 @@
             <div class="head">
                 <div class="balance">
                     <span class="sym">{{ $t('balance.symbol') }}</span
-                    >{{ balance.balance }}
+                    >{{ balance.balance.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}
                 </div>
                 <div class="label">{{ $t('balance.balance') }}</div>
                 <div class="btn-record" @click="$router.push({ name: 'balanceRecord' })">

+ 5 - 0
yarn.lock

@@ -913,6 +913,11 @@
     "@babel/helper-validator-identifier" "^7.19.1"
     to-fast-properties "^2.0.0"
 
+"@capacitor-community/barcode-scanner@^3.0.1":
+  version "3.0.1"
+  resolved "https://registry.npmmirror.com/@capacitor-community/barcode-scanner/-/barcode-scanner-3.0.1.tgz#3cee584046f2fa71d6047b05b4bc7b5c5c4f926d"
+  integrity sha512-3R6LXQ3kikuc71Pvffkul9pLvHK8v85VcvBw6E0rjAWgWJbCLf0ssBmycrqMa8/aMZjdw1XNn3nJTXijkfCifQ==
+
 "@capacitor-community/http@^2.0.0-0":
   version "2.0.0-0"
   resolved "https://registry.npmmirror.com/@capacitor-community/http/-/http-2.0.0-0.tgz#43d739668e1754590feb22170fc70ba730055581"