xiongzhu před 2 roky
rodič
revize
a531302e19

+ 1 - 1
android/app/build.gradle

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

+ 20 - 32
android/app/src/main/AndroidManifest.xml

@@ -1,7 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.bigauction.mobile">
-
+<?xml version="1.0" encoding="utf-8" ?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.bigauction.mobile">
     <application
     <application
         android:allowBackup="true"
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:icon="@mipmap/ic_launcher"
@@ -9,11 +7,9 @@
         android:supportsRtl="true"
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
         android:theme="@style/AppTheme"
         android:usesCleartextTraffic="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"/>
-        <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
+        <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" />
+        <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token" />
         <activity
         <activity
             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
             android:name="com.bigauction.mobile.MainActivity"
             android:name="com.bigauction.mobile.MainActivity"
@@ -21,24 +17,21 @@
             android:theme="@style/AppTheme.NoActionBarLaunch"
             android:theme="@style/AppTheme.NoActionBarLaunch"
             android:launchMode="singleInstance"
             android:launchMode="singleInstance"
             android:exported="true">
             android:exported="true">
-
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
             </intent-filter>
             <intent-filter>
             <intent-filter>
-                <action android:name="android.intent.action.VIEW"/>
-                <category android:name="android.intent.category.DEFAULT"/>
-                <category android:name="android.intent.category.BROWSABLE"/>
-                <data android:scheme="crgkm2"/>
+                <action android:name="android.intent.action.VIEW" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+                <data android:scheme="crgkm2" />
             </intent-filter>
             </intent-filter>
-            <intent-filter  android:autoVerify="true">
+            <intent-filter android:autoVerify="true">
                 <action android:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
                 <category android:name="android.intent.category.BROWSABLE" />
-                <data android:scheme="https"
-                    android:host="ifirstcash.onelink.me"
-                    android:pathPrefix="/cQAJ" />
+                <data android:scheme="https" android:host="ifirstcash.onelink.me" android:pathPrefix="/cQAJ" />
             </intent-filter>
             </intent-filter>
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.VIEW" />
@@ -48,13 +41,12 @@
             </intent-filter>
             </intent-filter>
         </activity>
         </activity>
 
 
-        <activity android:name="com.facebook.FacebookActivity"
-            android:configChanges=
-                "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
-            android:label="@string/app_name" />
         <activity
         <activity
-            android:name="com.facebook.CustomTabActivity"
-            android:exported="true">
+            android:name="com.facebook.FacebookActivity"
+            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+            android:label="@string/app_name"
+        />
+        <activity android:name="com.facebook.CustomTabActivity" android:exported="true">
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -63,25 +55,21 @@
             </intent-filter>
             </intent-filter>
         </activity>
         </activity>
 
 
-
         <provider
         <provider
             android:name="androidx.core.content.FileProvider"
             android:name="androidx.core.content.FileProvider"
             android:authorities="${applicationId}.fileprovider"
             android:authorities="${applicationId}.fileprovider"
             android:exported="false"
             android:exported="false"
             android:grantUriPermissions="true">
             android:grantUriPermissions="true">
-            <meta-data
-                android:name="android.support.FILE_PROVIDER_PATHS"
-                android:resource="@xml/file_paths"></meta-data>
+            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
         </provider>
         </provider>
     </application>
     </application>
 
 
     <!-- Permissions -->
     <!-- Permissions -->
 
 
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
-    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
-    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.WRITE_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="com.google.android.gms.permission.AD_ID" />
-
 </manifest>
 </manifest>

binární
android/app/src/main/assets/cdvasset.manifest


+ 93 - 0
codePush.mjs

@@ -0,0 +1,93 @@
+#!/usr/bin/env node
+import CodePush from 'code-push'
+import { build } from 'vite'
+import { MobileProject } from '@trapezedev/project'
+import fs from 'fs'
+import path from 'path'
+import inquirer from 'inquirer'
+import { sync } from '@capacitor/cli/dist/tasks/sync.js'
+import { loadConfig } from '@capacitor/cli/dist/config.js'
+import ProgressBar from 'progress'
+
+const token = '064853a8cdbfb94ed9b62ce30da17f162a1444a0'
+const androidName = 'ASNFTNGFHP-Android'
+const iosName = 'ASNFTNGFHP-iOS'
+
+inquirer
+    .prompt([
+        {
+            name: 'platform',
+            type: 'checkbox',
+            message: 'Platform',
+            choices: ['Android', 'iOS'],
+            default: ['Android', 'iOS']
+        },
+        { name: 'build', type: 'list', message: 'build', choices: ['YES', 'NO'], default: 'YES' }
+    ])
+    .then(async answers => {
+        console.log(answers)
+        const capacitorConfig = await loadConfig()
+        const codePush = new CodePush(token)
+        const projectConfig = {
+            ios: {
+                path: 'ios/App'
+            },
+            android: {
+                path: 'android'
+            }
+        }
+        const project = new MobileProject(process.cwd(), projectConfig)
+        await project.load()
+        await project.android.incrementVersionCode()
+        await project.ios.incrementBuild('App')
+        project.commit()
+
+        let version = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), 'src', 'version.json')))
+        version.android.version = await project.android.getVersionName()
+        version.android.build = await project.android.getVersionCode()
+        version.ios.version = await project.ios.getVersion('App')
+        version.ios.build = await project.ios.getBuild('App')
+        if (answers.build === 'YES') {
+            version.www++
+            fs.writeFileSync(path.resolve(process.cwd(), 'src', 'version.json'), JSON.stringify(version, null, 4))
+            await build({
+                configFile: 'vite.config.js',
+                mode: 'app'
+            })
+        }
+        if (answers.platform.includes('Android')) {
+            var bar1 = new ProgressBar('Upload Android Bundle [:bar] :percent', { total: 100 })
+            await sync(capacitorConfig, 'android', null, false)
+            await codePush
+                .release(androidName, 'Release', 'android/app/src/main/assets/public/', '~1.0.0', {}, percent => {
+                    bar1.tick(percent)
+                })
+                .then(res => {
+                    console.log('Upload Android Bundle Success', res)
+                })
+        }
+        if (answers.platform.includes('iOS')) {
+            var bar2 = new ProgressBar('Upload iOS Bundle [:bar] :percent', { total: 100 })
+            await sync(capacitorConfig, 'ios', null, false)
+            await codePush
+                .release(androidName, 'Release', 'ios/App/App/public/', '~1.0.0', {}, percent => {
+                    bar2.tick(percent)
+                })
+                .then(res => {
+                    console.log('Upload iOS Bundle Success', res)
+                })
+        }
+        fs.readdirSync(process.cwd()).forEach(file => {
+            if (/^\w+\.zip$/.test(file)) {
+                fs.unlinkSync(path.resolve(process.cwd(), file))
+            }
+        })
+    })
+    .catch(error => {
+        console.log(error)
+        if (error.isTtyError) {
+            // Prompt couldn't be rendered in the current environment
+        } else {
+            // Something else went wrong
+        }
+    })

+ 1 - 37
index.html

@@ -29,43 +29,7 @@
     <script type="module" src="/src/main.js"></script>
     <script type="module" src="/src/main.js"></script>
     <!-- <script src="https://assets.salesmartly.com/js/project_9355_9754_1670553307.js"></script> -->
     <!-- <script src="https://assets.salesmartly.com/js/project_9355_9754_1670553307.js"></script> -->
     <!-- <script src="//code.tidio.co/kguf93rbmc3c9icmkbgbh3akvjznunfo.js" async></script> -->
     <!-- <script src="//code.tidio.co/kguf93rbmc3c9icmkbgbh3akvjznunfo.js" async></script> -->
-    <script src="./jquery-3.6.1.min.js"></script>
-    <script>
-        function onTidioChatApiReady() {
-            $('#tidio-chat-iframe').css('display', 'none')
-            $("#tidio-chat-iframe").ready(function () {
-                var head = $("#tidio-chat-iframe").contents().find("head");
-                head.append($('<meta name="color-scheme" content="dark">'));
-                head.append($('<style>textarea {color: black; background: white;} .chat-header{padding:40px 22px 0px !important} #button.chat-closed{display:none !important;}</style>'));
-            });
-
-            window.tidioChatApi.on('close', function () {
-                //tidioChatApi.hide()
-                $('#tidio-chat-iframe').css('display', 'none')
-            })
-
-            window.tidioChatApi.on('open', function () {
-                $("#tidio-chat-iframe").ready(function () {
-                    console.log('tidio-chat-iframe open')
-                    var head = $("#tidio-chat-iframe").contents().find("head");
-                    head.append($('<meta name="color-scheme" content="dark">'));
-                    head.append($('<style>textarea {color: black; background: white;} .chat-header{padding:40px 22px 0px !important} #button.chat-closed{display:none !important;}</style>'));
-                });
-            })
-        }
-
-        if (window.tidioChatApi) {
-            window.tidioChatApi.on('ready', onTidioChatApiReady)
-        } else {
-            document.addEventListener('tidioChat-ready', onTidioChatApiReady)
-        }
-        $("#s-chat-plugin").ready(function () {
-            var head = $("#s-chat-plugin").contents().find("head");
-            head.append($('<meta name="color-scheme" content="dark">'));
-            head.append($('<style>textarea {color: black; background: white;}</style>'));
-        });
-
-    </script>
+    <script src="/jquery-3.6.1.min.js" type="module"></script>
 </body>
 </body>
 
 
 </html>
 </html>

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

@@ -124,8 +124,8 @@
 		504EC2FC1FED79650016851F /* Project object */ = {
 		504EC2FC1FED79650016851F /* Project object */ = {
 			isa = PBXProject;
 			isa = PBXProject;
 			attributes = {
 			attributes = {
-				LastSwiftUpdateCheck = 0920;
-				LastUpgradeCheck = 0920;
+				LastSwiftUpdateCheck = 920;
+				LastUpgradeCheck = 920;
 				TargetAttributes = {
 				TargetAttributes = {
 					504EC3031FED79650016851F = {
 					504EC3031FED79650016851F = {
 						CreatedOnToolsVersion = 9.2;
 						CreatedOnToolsVersion = 9.2;
@@ -352,7 +352,7 @@
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
 				CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
 				CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 23;
 				DEFINES_MODULE = NO;
 				DEFINES_MODULE = NO;
 				DEVELOPMENT_TEAM = 72P5Y6N578;
 				DEVELOPMENT_TEAM = 72P5Y6N578;
 				INFOPLIST_FILE = App/Info.plist;
 				INFOPLIST_FILE = App/Info.plist;
@@ -377,7 +377,7 @@
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
 				CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
 				CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 23;
 				DEFINES_MODULE = NO;
 				DEFINES_MODULE = NO;
 				DEVELOPMENT_TEAM = 72P5Y6N578;
 				DEVELOPMENT_TEAM = 72P5Y6N578;
 				INFOPLIST_FILE = App/Info.plist;
 				INFOPLIST_FILE = App/Info.plist;

+ 3 - 3
ios/App/App/Info.plist

@@ -2,8 +2,8 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <plist version="1.0">
 <dict>
 <dict>
-    <key>ITSAppUsesNonExemptEncryption</key>
-    <false/>
+	<key>ITSAppUsesNonExemptEncryption</key>
+	<false/>
 	<key>NSPhotoLibraryUsageDescription</key>
 	<key>NSPhotoLibraryUsageDescription</key>
 	<string>Requires access to the photo library to save images</string>
 	<string>Requires access to the photo library to save images</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<key>CFBundleDevelopmentRegion</key>
@@ -65,4 +65,4 @@
 	<key>com.openinstall.APP_KEY</key>
 	<key>com.openinstall.APP_KEY</key>
 	<string>crgkm2</string>
 	<string>crgkm2</string>
 </dict>
 </dict>
-</plist>
+</plist>

+ 1 - 0
ios/App/Podfile

@@ -31,6 +31,7 @@ def capacitor_pods
   pod 'AppsflyerCapacitorPlugin', :path => '../../node_modules/appsflyer-capacitor-plugin'
   pod 'AppsflyerCapacitorPlugin', :path => '../../node_modules/appsflyer-capacitor-plugin'
   pod 'CapacitorCodepush', :path => '../../node_modules/capacitor-codepush'
   pod 'CapacitorCodepush', :path => '../../node_modules/capacitor-codepush'
   pod 'CapacitorFacebook', :path => '../../../../capacitor/capacitor-facebook'
   pod 'CapacitorFacebook', :path => '../../../../capacitor/capacitor-facebook'
+  pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
 end
 end
 
 
 target 'App' do
 target 'App' do

+ 4 - 0
package.json

@@ -70,11 +70,15 @@
   "devDependencies": {
   "devDependencies": {
     "@capacitor/cli": "^4.6.1",
     "@capacitor/cli": "^4.6.1",
     "@rushstack/eslint-patch": "^1.1.4",
     "@rushstack/eslint-patch": "^1.1.4",
+    "@trapezedev/project": "^7.0.6",
     "@vitejs/plugin-vue": "^3.2.0",
     "@vitejs/plugin-vue": "^3.2.0",
     "@vue/eslint-config-prettier": "^7.0.0",
     "@vue/eslint-config-prettier": "^7.0.0",
+    "code-push": "^4.1.0",
     "eslint": "^8.22.0",
     "eslint": "^8.22.0",
     "eslint-plugin-vue": "^9.3.0",
     "eslint-plugin-vue": "^9.3.0",
+    "inquirer": "^9.1.4",
     "prettier": "^2.7.1",
     "prettier": "^2.7.1",
+    "progress": "^2.0.3",
     "vite": "^3.2.4",
     "vite": "^3.2.4",
     "vite-plugin-imagemin": "^0.6.1",
     "vite-plugin-imagemin": "^0.6.1",
     "vite-plugin-pwa": "^0.14.1"
     "vite-plugin-pwa": "^0.14.1"

+ 6 - 2
src/locales/en.json

@@ -127,7 +127,7 @@
         "noBind": "Not added",
         "noBind": "Not added",
         "noLogin": "not logged in",
         "noLogin": "not logged in",
         "noSetting": "not set",
         "noSetting": "not set",
-        "setting": "Setting",
+        "settings": "Settings",
         "sex": "Gender",
         "sex": "Gender",
         "user": "User",
         "user": "User",
         "common": "Common Functions",
         "common": "Common Functions",
@@ -218,7 +218,11 @@
         "withdrawRechargeRate": "Recharge revenue ratio"
         "withdrawRechargeRate": "Recharge revenue ratio"
     },
     },
     "settings": {
     "settings": {
-        "darkMode": "Dark Mode"
+        "darkMode": "Dark Mode",
+        "checkUpdate": "Check for update",
+        "checkingUpdate": "Checking for update",
+        "upToDate": "Already up to date",
+        "updating": "Updating"
     },
     },
     "title": {
     "title": {
         "balanceRecord": "Transaction details",
         "balanceRecord": "Transaction details",

+ 6 - 2
src/locales/zh.json

@@ -168,7 +168,11 @@
         "all": "全部"
         "all": "全部"
     },
     },
     "settings": {
     "settings": {
-        "darkMode": "黑暗模式"
+        "darkMode": "黑暗模式",
+        "checkUpdate": "检查更新",
+        "checkingUpdate": "正在检查更新...",
+        "upToDate": "当前已是最新版本",
+        "updating": "正在更新..."
     },
     },
     "rank": {
     "rank": {
         "rankByProfit": "收益排行",
         "rankByProfit": "收益排行",
@@ -215,7 +219,7 @@
         "bankCard": "我的银行卡",
         "bankCard": "我的银行卡",
         "noBind": "未绑定",
         "noBind": "未绑定",
         "address": "收货地址",
         "address": "收货地址",
-        "setting": "设置",
+        "settings": "设置",
         "avatar": "头像",
         "avatar": "头像",
         "nickname": "昵称",
         "nickname": "昵称",
         "sex": "性别",
         "sex": "性别",

+ 4 - 1
src/router/index.js

@@ -154,7 +154,10 @@ const router = createRouter({
         {
         {
             path: '/setting',
             path: '/setting',
             name: 'setting',
             name: 'setting',
-            component: () => import('@/views/SettingPage.vue')
+            component: () => import('@/views/SettingPage.vue'),
+            meta: {
+                allowGuest: true
+            }
         },
         },
         {
         {
             path: '/changeText',
             path: '/changeText',

+ 12 - 0
src/version.json

@@ -0,0 +1,12 @@
+{
+    "ios": {
+        "version": "1.0.0",
+        "build": 22
+    },
+    "android": {
+        "version": "1.0.0",
+        "build": 22,
+        "versionCode": 12
+    },
+    "www": 1006
+}

+ 1 - 1
src/views/MinePage.vue

@@ -153,7 +153,7 @@
                     <template #right-icon> <ion-icon class="right-icon" :icon="intoIcon"></ion-icon> </template>
                     <template #right-icon> <ion-icon class="right-icon" :icon="intoIcon"></ion-icon> </template>
                 </van-cell>
                 </van-cell>
 
 
-                <van-cell :title="$t('mine.setting')" is-link :to="{ name: 'setting' }" :border="false">
+                <van-cell :title="$t('mine.settings')" is-link :to="{ name: 'setting' }" :border="false">
                     <template #icon>
                     <template #icon>
                         <img class="menu-icon" src="../assets/info_icon_shezhi.png" alt="" />
                         <img class="menu-icon" src="../assets/info_icon_shezhi.png" alt="" />
                     </template>
                     </template>

+ 38 - 5
src/views/SettingPage.vue

@@ -5,12 +5,12 @@
                 <ion-buttons slot="start">
                 <ion-buttons slot="start">
                     <ion-back-button text="" default-href="#" @click="$router.back()"></ion-back-button>
                     <ion-back-button text="" default-href="#" @click="$router.back()"></ion-back-button>
                 </ion-buttons>
                 </ion-buttons>
-                <ion-title>{{ $t('user.profile') }}</ion-title>
+                <ion-title>{{ $t('mine.settings') }}</ion-title>
             </ion-toolbar>
             </ion-toolbar>
         </ion-header>
         </ion-header>
         <ion-content>
         <ion-content>
             <div class="setting">
             <div class="setting">
-                <van-cell-group inset>
+                <van-cell-group inset v-if="user">
                     <van-cell :title="$t('mine.avatar')" is-link>
                     <van-cell :title="$t('mine.avatar')" is-link>
                         <template #value>
                         <template #value>
                             <van-image
                             <van-image
@@ -63,12 +63,17 @@
                         </template>
                         </template>
                     </van-cell>
                     </van-cell>
                 </van-cell-group> -->
                 </van-cell-group> -->
-                <van-cell-group inset>
+                <van-cell-group inset v-if="user">
                     <van-cell :title="$t('mine.bindPhone')" class="not" :value="(user || {}).phone"> </van-cell>
                     <van-cell :title="$t('mine.bindPhone')" class="not" :value="(user || {}).phone"> </van-cell>
                     <!-- <van-cell title="修改密码" is-link></van-cell> -->
                     <!-- <van-cell title="修改密码" is-link></van-cell> -->
                     <van-cell class="not" :title="`${$t('mine.user')}ID`" :value="(user || {}).id" />
                     <van-cell class="not" :title="`${$t('mine.user')}ID`" :value="(user || {}).id" />
                 </van-cell-group>
                 </van-cell-group>
 
 
+                <van-cell-group inset>
+                    <van-cell :title="$t('settings.checkUpdate')" @click="checkUpdate">
+                        <span slot="value" class="version">v{{ version.www }}</span>
+                    </van-cell>
+                </van-cell-group>
                 <!-- <van-cell-group :border="false">
                 <!-- <van-cell-group :border="false">
                     <van-cell :title="$t('settings.darkMode')" @click="toggleDark()">
                     <van-cell :title="$t('settings.darkMode')" @click="toggleDark()">
                         <template #right-icon>
                         <template #right-icon>
@@ -85,7 +90,7 @@
                 />
                 />
 
 
                 <!-- <van-area title="选择地址" :area-list="areaList" :columns-num="2" /> -->
                 <!-- <van-area title="选择地址" :area-list="areaList" :columns-num="2" /> -->
-                <div style="padding: 16px">
+                <div style="padding: 16px" v-if="user">
                     <van-button type="primary" block @click="onLogout">{{ $t('mine.logout') }}</van-button>
                     <van-button type="primary" block @click="onLogout">{{ $t('mine.logout') }}</van-button>
                 </div>
                 </div>
             </div>
             </div>
@@ -99,11 +104,16 @@ import { ref, computed, getCurrentInstance } from 'vue'
 import defaultAvatar from '../assets/png_moren.png'
 import defaultAvatar from '../assets/png_moren.png'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import { useSettingsStore } from '@/stores/settings'
 import { useSettingsStore } from '@/stores/settings'
+import { codePush, InstallMode } from 'capacitor-codepush'
+import { SyncStatus } from 'capacitor-codepush/dist/esm/syncStatus'
+import { Capacitor } from '@capacitor/core'
+import version from '@/version.json'
 
 
 export default {
 export default {
     data() {
     data() {
         return {
         return {
-            showTest: false
+            showTest: false,
+            version
         }
         }
     },
     },
     computed: {
     computed: {
@@ -214,6 +224,25 @@ export default {
         onLogout() {
         onLogout() {
             this.logout()
             this.logout()
             this.$router.back()
             this.$router.back()
+        },
+        checkUpdate() {
+            if (Capacitor.isNativePlatform()) {
+                this.$toast.loading(this.$t('settings.checkingUpdate'))
+                codePush
+                    .sync({
+                        updateDialog: false,
+                        installMode: InstallMode.IMMEDIATE,
+                        ignoreFailedUpdates: false
+                    })
+                    .then(status => {
+                        console.log('codePush sync status:', SyncStatus[status])
+                        if (status === SyncStatus.UP_TO_DATE) {
+                            this.$toast(this.$t('settings.upToDate'))
+                        }
+                    })
+            } else {
+                this.$toast(this.$t('settings.upToDate'))
+            }
         }
         }
     }
     }
 }
 }
@@ -297,4 +326,8 @@ export default {
     width: 24px;
     width: 24px;
     height: 24px;
     height: 24px;
 }
 }
+.version {
+    font-size: 14px !important;
+    opacity: 0.5;
+}
 </style>
 </style>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 621 - 22
yarn.lock


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů