Просмотр исходного кода

fix bug: 根据客户端环境进行编译

shizhongqi 6 месяцев назад
Родитель
Сommit
17ba0241a3
4 измененных файлов с 13 добавлено и 5 удалено
  1. 4 0
      ghsApp/src/App.vue
  2. 1 1
      ghsApp/src/manifest.json
  3. 6 2
      hdApp/src/App.vue
  4. 2 2
      hdApp/src/manifest.json

+ 4 - 0
ghsApp/src/App.vue

@@ -8,8 +8,10 @@ export default {
 	// 有坑 分包里的页面访问不到
 	globalData: {},
 	onLaunch() {
+		// #ifdef APP-PLUS
 		// 清除角标数字
 		plus.runtime.setBadgeNumber(0);
+		// #endif
 	
 		uni.onPushMessage((res) => {
 			console.log("收到推送消息:",res) //监听推送消息
@@ -72,8 +74,10 @@ export default {
 
 	},
 	onShow() {
+		// #ifdef APP-PLUS
 		// 清除角标数字
 		plus.runtime.setBadgeNumber(0);
+		// #endif
 		
 		// permissionEnums枚举建议单独一个js文件,然后引入
 		const permissionEnums = {

+ 1 - 1
ghsApp/src/manifest.json

@@ -207,7 +207,7 @@
         "optimization" : {
             "subPackages" : true
         },
-        "lazyCodeLoading":"requiredComponents",
+        "lazyCodeLoading" : "requiredComponents",
         "uniStatistics" : {
             "enable" : false
         },

+ 6 - 2
hdApp/src/App.vue

@@ -1,7 +1,7 @@
 <script>
 import store from '@/store'
 import { mapMutations, mapActions, mapGetters } from 'vuex'
-import { setTimeout } from 'timers'
+//import { setTimeout } from 'timers'
 import { getDictionaries } from '@/api/mini'
 import util from "./utils/util"
 import priceSocket from "./mixins/priceSocket";
@@ -17,8 +17,10 @@ export default {
 	uni.removeStorageSync('productInfoList');
 	uni.removeStorageSync('pxClassInfoList');
 
+	// #ifdef APP-PLUS
 	// 清除角标数字
 	plus.runtime.setBadgeNumber(0);
+	// #endif
 
     uni.onPushMessage((res) => {
 			console.log("收到推送消息:",res) //监听推送消息
@@ -99,9 +101,11 @@ export default {
     // console.log(1111,url)
   },
   onShow (extraData) {
+	// #ifdef APP-PLUS
 	// 清除角标数字
 	plus.runtime.setBadgeNumber(0);
-	
+	// #endif
+
   	if(extraData){
   		uni.setStorageSync('extraData',extraData)
 	}

+ 2 - 2
hdApp/src/manifest.json

@@ -191,8 +191,8 @@
         "optimization" : {
             "subPackages" : true
         },
-        "lazyCodeLoading":"requiredComponents",
-       "uniStatistics" : {
+        "lazyCodeLoading" : "requiredComponents",
+        "uniStatistics" : {
             "enable" : false
         },
         "unipush" : {