xiongzhu преди 3 години
родител
ревизия
1f26d038f2
променени са 4 файла, в които са добавени 19 реда и са изтрити 12 реда
  1. 1 1
      config.xml
  2. 7 0
      scripts/changeVersion.js
  3. 6 6
      www/index.html
  4. 5 5
      www/template.html

+ 1 - 1
config.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<widget id="vip.raex.nft" version="1.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" ios-CFBundleIdentifier="me.zc.store" ios-CFBundleVersion="199" android-versionCode="1256">
+<widget id="vip.raex.nft" version="1.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" ios-CFBundleIdentifier="me.zc.store" ios-CFBundleVersion="199" android-versionCode="1261">
 	<name>绿洲宇宙</name>
 	<name>绿洲宇宙</name>
 	<description>
 	<description>
         A sample Apache Cordova application that responds to the deviceready event.
         A sample Apache Cordova application that responds to the deviceready event.

+ 7 - 0
scripts/changeVersion.js

@@ -14,6 +14,12 @@ module.exports = function (context) {
     if (context.cmdLine.includes("--dev")) {
     if (context.cmdLine.includes("--dev")) {
         baseUrl = "http://192.168.6.116:8082/";
         baseUrl = "http://192.168.6.116:8082/";
     }
     }
+    let channel = "default";
+    let match = context.cmdLine.match(/channel=(.+?)(\s|$)/);
+    if (match) {
+        channel = match[1];
+        console.log("channel: " + channel);
+    }
     fs.writeFileSync(
     fs.writeFileSync(
         path.resolve(projectRoot, "www", "index.html"),
         path.resolve(projectRoot, "www", "index.html"),
         fs
         fs
@@ -23,5 +29,6 @@ module.exports = function (context) {
             .replace("${iosCFBundleVersion}", appConfig.ios_CFBundleVersion())
             .replace("${iosCFBundleVersion}", appConfig.ios_CFBundleVersion())
             .replace("${androidVersionCode}", appConfig.android_versionCode())
             .replace("${androidVersionCode}", appConfig.android_versionCode())
             .replace(/\$\{baseUrl\}/g, baseUrl)
             .replace(/\$\{baseUrl\}/g, baseUrl)
+            .replaceAll('$channel', channel)
     );
     );
 };
 };

+ 6 - 6
www/index.html

@@ -28,22 +28,22 @@
 
 
         var version = '1.0.3';
         var version = '1.0.3';
         var iosCFBundleVersion = '199';
         var iosCFBundleVersion = '199';
-        var androidVersionCode = '1255';
+        var androidVersionCode = '1260';
         document.addEventListener("online", function () {
         document.addEventListener("online", function () {
-            axios.get('https://www.raex.vip/appVersion/getVersion?version=' + version + '&platform=' + cordova.platformId)
+            axios.get('https://www.raex.vip/appVersion/getVersion?version=' + version + '&platform=' + cordova.platformId + '&channel=huawei')
                 .then(function (res) {
                 .then(function (res) {
                     if (res.data.review) {
                     if (res.data.review) {
                         if ('ios' === cordova.platformId) {
                         if ('ios' === cordova.platformId) {
-                            location.href = 'https://ios.raex.vip/9th/?review=true&dateFlag=' + dateFlag;
+                            location.href = 'https://ios.raex.vip/9th/?review=true&dateFlag=' + dateFlag + '&channel=huawei';
                         } else {
                         } else {
-                            location.href = 'https://www.raex.vip/9th/?review=true&reviewPay=true&dateFlag=' + dateFlag;
+                            location.href = 'https://www.raex.vip/9th/?review=true&reviewPay=true&dateFlag=' + dateFlag + '&channel=huawei';
                         }
                         }
                     } else {
                     } else {
-                        location.href = 'https://www.raex.vip/9th/?dateFlag=' + dateFlag;
+                        location.href = 'https://www.raex.vip/9th/?dateFlag=' + dateFlag + '&channel=huawei';
                     }
                     }
                 })
                 })
                 .catch(function (e) {
                 .catch(function (e) {
-                    location.href = 'https://www.raex.vip/9th/?dateFlag=' + dateFlag;
+                    location.href = 'https://www.raex.vip/9th/?dateFlag=' + dateFlag + '&channel=huawei';
                 });
                 });
         }, false);
         }, false);
     </script>
     </script>

+ 5 - 5
www/template.html

@@ -30,20 +30,20 @@
         var iosCFBundleVersion = '${iosCFBundleVersion}';
         var iosCFBundleVersion = '${iosCFBundleVersion}';
         var androidVersionCode = '${androidVersionCode}';
         var androidVersionCode = '${androidVersionCode}';
         document.addEventListener("online", function () {
         document.addEventListener("online", function () {
-            axios.get('${baseUrl}/appVersion/getVersion?version=' + version + '&platform=' + cordova.platformId)
+            axios.get('${baseUrl}/appVersion/getVersion?version=' + version + '&platform=' + cordova.platformId + '&channel=$channel')
                 .then(function (res) {
                 .then(function (res) {
                     if (res.data.review) {
                     if (res.data.review) {
                         if ('ios' === cordova.platformId) {
                         if ('ios' === cordova.platformId) {
-                            location.href = 'https://ios.raex.vip/9th/?review=true&dateFlag=' + dateFlag;
+                            location.href = 'https://ios.raex.vip/9th/?review=true&dateFlag=' + dateFlag + '&channel=$channel';
                         } else {
                         } else {
-                            location.href = '${baseUrl}/9th/?review=true&reviewPay=true&dateFlag=' + dateFlag;
+                            location.href = '${baseUrl}/9th/?review=true&reviewPay=true&dateFlag=' + dateFlag + '&channel=$channel';
                         }
                         }
                     } else {
                     } else {
-                        location.href = '${baseUrl}/9th/?dateFlag=' + dateFlag;
+                        location.href = '${baseUrl}/9th/?dateFlag=' + dateFlag + '&channel=$channel';
                     }
                     }
                 })
                 })
                 .catch(function (e) {
                 .catch(function (e) {
-                    location.href = '${baseUrl}/9th/?dateFlag=' + dateFlag;
+                    location.href = '${baseUrl}/9th/?dateFlag=' + dateFlag + '&channel=$channel';
                 });
                 });
         }, false);
         }, false);
     </script>
     </script>