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

新增 uni-push2.0 与 uni统计

shizhongqi 9 месяцев назад
Родитель
Сommit
8505e8a421
24 измененных файлов с 926 добавлено и 153 удалено
  1. 28 18
      ghsApp/.hbuilderx/launch.json
  2. 57 2
      ghsApp/src/App.vue
  3. 21 2
      ghsApp/src/admin/home/login.vue
  4. 96 7
      ghsApp/src/manifest.json
  5. 6 6
      ghsApp/uniCloud-aliyun/cloudfunctions/getMobileNumber/package.json
  6. 10 0
      hdApp/.hbuilderx/launch.json
  7. 101 58
      hdApp/src/App.vue
  8. 21 0
      hdApp/src/admin/home/login.vue
  9. 24 24
      hdApp/src/androidPrivacy.json
  10. 99 10
      hdApp/src/manifest.json
  11. 12 0
      hdApp/uniCloud-aliyun/database/JQL查询.jql
  12. 15 0
      mallApp/.hbuilderx/launch.json
  13. 88 26
      mallApp/src/manifest.json
  14. 6 0
      mallApp/src/uni_modules/uni-config-center/changelog.md
  15. 81 0
      mallApp/src/uni_modules/uni-config-center/package.json
  16. 93 0
      mallApp/src/uni_modules/uni-config-center/readme.md
  17. 0 0
      mallApp/src/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js
  18. 13 0
      mallApp/src/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/package.json
  19. 36 0
      mallApp/src/uni_modules/uni-id-common/changelog.md
  20. 84 0
      mallApp/src/uni_modules/uni-id-common/package.json
  21. 3 0
      mallApp/src/uni_modules/uni-id-common/readme.md
  22. 0 0
      mallApp/src/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js
  23. 20 0
      mallApp/src/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/package.json
  24. 12 0
      mallApp/uniCloud-aliyun/database/JQL查询.jql

+ 28 - 18
ghsApp/.hbuilderx/launch.json

@@ -1,20 +1,30 @@
-{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
-  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
-    "version": "0.0",
-    "configurations": [{
-     	"app-plus" : 
-     	{
-     		"launchtype" : "local"
-     	},
-     	"default" : 
-     	{
-     		"launchtype" : "local"
-     	},
-     	"mp-weixin" : 
-     	{
-     		"launchtype" : "local"
-     	},
-     	"type" : "uniCloud"
-     }
+{
+    // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+    // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version" : "0.0",
+    "configurations" : [
+        {
+            "app" : {
+                "launchtype" : "local"
+            },
+            "app-plus" : {
+                "launchtype" : "local"
+            },
+            "default" : {
+                "launchtype" : "local"
+            },
+            "h5" : {
+                "launchtype" : "local"
+            },
+            "mp-weixin" : {
+                "launchtype" : "local"
+            },
+            "provider" : "aliyun",
+            "type" : "uniCloud"
+        },
+        {
+            "playground" : "custom",
+            "type" : "uni-app:app-ios"
+        }
     ]
 }

+ 57 - 2
ghsApp/src/App.vue

@@ -6,6 +6,62 @@ export default {
 	// 有坑 分包里的页面访问不到
 	globalData: {},
 	onLaunch() {
+		uni.onPushMessage((res) => {
+			console.log("收到推送消息:",res) //监听推送消息
+			let message = res.data;
+			// 兼容两种可能的数据结构
+			let title = message.aps && message.aps.alert ? message.aps.alert.title : '';
+			let content = message.content || (message.aps && message.aps.alert ? message.aps.alert.body : '');
+			
+			// 提取页面路径(支持 pagesOrder/detail 这样的格式)
+			let pagePath = message.payload && message.payload.page;
+			// 用户点击查看详情,跳转到指定页面
+			// 检查是否需要添加 / 前缀
+			let url = pagePath.startsWith('/') ? pagePath : `/${pagePath}`;
+			
+			// 如果有额外参数,拼接到URL
+			if (message.params || (message.payload && message.payload.params)) {
+				let params = message.params || message.payload.params;
+				let queryString = Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
+				url = `${url}?${queryString}`;
+			}
+			console.log('推送消息跳转页面:', url);
+			
+			// uni.showModal({
+			// 	title: title || '收到一条推送消息',
+			// 	content: content,
+			// 	showCancel: !!pagePath, // 如果有页面路径,显示取消按钮
+			// 	confirmText: pagePath ? '查看详情' : '确定',
+			// 	success: (modalRes) => {
+			// 		if (modalRes.confirm && pagePath) {
+			// 			// 使用 navigateTo 跳转
+			// 			uni.navigateTo({
+			// 				url: url,
+			// 				fail: (err) => {
+			// 					console.error('页面跳转失败:', err);
+			// 					uni.showToast({
+			// 						title: '页面跳转失败',
+			// 						icon: 'none'
+			// 					});
+			// 				}
+			// 			});
+			// 		}
+			// 	}
+			// });
+			// 使用 navigateTo 跳转
+			uni.navigateTo({
+				url: url,
+				fail: (err) => {
+					console.error('页面跳转失败:', err);
+				}
+			});
+
+			// 设置角标
+			let badgeNumber = message.aps && message.aps.badge ? message.aps.badge - 1 : false;
+			if (badgeNumber !== false) {
+				plus.runtime.setBadgeNumber(badgeNumber);
+			}
+		})
 
 		// 删除缓存
 		if (process.env.NODE_ENV == 'production') {
@@ -36,8 +92,8 @@ export default {
 	}
 }
 </script>
-<style lang="scss">
 
+<style lang="scss">
 	//没有scss变量方法的,主要引入 这样打包的时候就不会所有的组件都打包进去
 	@import './static/iconfont/iconfont.css';
 	@import './static/css/uni2.css';
@@ -70,5 +126,4 @@ export default {
 	/**开单-增加减少动画**/
 	.animation{animation:imgmove 0.3s 1;animation-iteration-count:1;}
 	@-webkit-keyframes imgmove{0%{transform: scale(0.7);}100%{transform: scale(1);}}
-
 </style>

+ 21 - 2
ghsApp/src/admin/home/login.vue

@@ -62,7 +62,7 @@ import { mapActions } from "vuex";
 import { getShopInfo} from "@/utils/auth";
 import {appLogin} from '@/api/common'
 import { getDictionaries,postWxCode } from '@/api/mini'
-//import { replaceClientId } from '@/api/admin'
+import { replaceClientId } from '@/api/admin'
 import { phoneLogin,wxMobileLogin } from "@/api/auth";
 export default {
 	name: "login",
@@ -263,6 +263,16 @@ export default {
 									getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
 									that.setUserShopAll()
 									uni.navigateBack()
+
+									// #ifdef APP-PLUS
+									//保存安卓的clientId
+									let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+									const clientInfo = plus.push.getClientInfo()
+									let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+									if(hasClientId == '' || hasClientId != currentClientId){
+										replaceClientId({id:currentClientId})
+									}
+									// #endif
 								}
 							})
 						},
@@ -336,9 +346,18 @@ export default {
 					getShopInfo(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
 					that.setUserShopAll()
 					uni.navigateBack()
+
+					// #ifdef APP-PLUS
+					//保存安卓的clientId
+					let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+					const clientInfo = plus.push.getClientInfo()
+					let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+					if(hasClientId == '' || hasClientId != currentClientId){
+						replaceClientId({id:currentClientId})
+					}
+					// #endif
 				}
 			})
-
 		}
 	}
 };

+ 96 - 7
ghsApp/src/manifest.json

@@ -27,7 +27,8 @@
             "OAuth" : {},
             "Share" : {},
             "Camera" : {},
-            "Barcode" : {}
+            "Barcode" : {},
+            "Push" : {}
         },
         /* 应用发布信息 */
         "distribute" : {
@@ -64,7 +65,8 @@
                     "entitlements" : {
                         "com.apple.developer.associated-domains" : [ "applinks:fronttg.wixhb.com" ]
                     }
-                }          
+                },
+                "dSYMs" : false
             },
             /* SDK配置 */
             "sdkConfigs" : {
@@ -84,6 +86,22 @@
                 "maps" : {},
                 "oauth" : {
                     "univerify" : {}
+                },
+                "push" : {
+                    "unipush" : {
+                        "version" : "2",
+                        "offline" : true,
+                        "hms" : {},
+                        "oppo" : {},
+                        "vivo" : {},
+                        "mi" : {},
+                        "honor" : {},
+                        "icons" : {
+                            "small" : {
+                                "xxhdpi" : "unpackage/res/icons/72x72.png"
+                            }
+                        }
+                    }
                 }
             },
             "orientation" : [ "portrait-primary" ],
@@ -166,6 +184,9 @@
                     "parameters" : {}
                 }
             }
+        },
+        "uniStatistics" : {
+            "enable" : true
         }
     },
     /* 快应用特有相关 */
@@ -174,7 +195,8 @@
     "mp-weixin" : {
         "appid" : "wx21b7c3ef12082099",
         "setting" : {
-            "urlCheck" : false
+            "urlCheck" : false,
+            "minified" : true
         },
         "usingComponents" : true,
         "permission" : {
@@ -185,16 +207,31 @@
         "optimization" : {
             "subPackages" : true
         },
-        "lazyCodeLoading":"requiredComponents"
+        "lazyCodeLoading" : "requiredComponents",
+        "uniStatistics" : {
+            "enable" : true
+        },
+        "unipush" : {
+            "enable" : true
+        }
     },
     "mp-alipay" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "mp-baidu" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "mp-toutiao" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "h5" : {
         "template" : "template.h5.html",
@@ -229,6 +266,58 @@
                     "key" : ""
                 }
             }
+        },
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "uniStatistics" : {
+        "enable" : true,
+        "version" : "2"
+    },
+    "app-harmony" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-harmony" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-jd" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-kuaishou" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-lark" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-qq" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-xhs" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "quickapp-webview-huawei" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "quickapp-webview-union" : {
+        "uniStatistics" : {
+            "enable" : true
         }
     }
 }

+ 6 - 6
ghsApp/uniCloud-aliyun/cloudfunctions/getMobileNumber/package.json

@@ -1,8 +1,8 @@
 {
-    "cloudfunction-config": {
-        "memorySize": 512,
-        "timeout": 5,
-        "triggers": [],
-        "path": "/getMobileNumber"
-    }
+  "cloudfunction-config": {
+    "memorySize": 512,
+    "timeout": 5,
+    "triggers": [],
+    "path": "/getMobileNumber"
+  }
 }

+ 10 - 0
hdApp/.hbuilderx/launch.json

@@ -13,12 +13,22 @@
             "default" : {
                 "launchtype" : "local"
             },
+            "h5" : {
+                "launchtype" : "local"
+            },
+            "mp-weixin" : {
+                "launchtype" : "local"
+            },
             "provider" : "aliyun",
             "type" : "uniCloud"
         },
         {
             "playground" : "custom",
             "type" : "uni-app:app-android"
+        },
+        {
+            "playground" : "custom",
+            "type" : "uni-app:app-ios"
         }
     ]
 }

+ 101 - 58
hdApp/src/App.vue

@@ -1,102 +1,145 @@
 <script>
-import store from '@/store'
-import { mapMutations, mapActions, mapGetters } from 'vuex'
-import { setTimeout } from 'timers'
-import { getDictionaries } from '@/api/mini'
-import util from "./utils/util"
-import priceSocket from "./mixins/priceSocket";
+import store from '@/store';
+import { mapActions } from 'vuex';
+import { getDictionaries } from '@/api/mini';
+import util from './utils/util';
+import priceSocket from './mixins/priceSocket';
 export default {
-	mixins:[priceSocket],
+  mixins: [priceSocket],
   // 全端,数据共享,还可以解决页面初始化模板访问不到值得
   // 有坑 分包里的页面访问不到
   globalData: {},
-  onLaunch () {
-			uni.removeStorageSync('suitInfoList');
-			uni.removeStorageSync('productInfoList');
-			uni.removeStorageSync('pxClassInfoList');
+  onLaunch() {
+    uni.removeStorageSync('suitInfoList');
+    uni.removeStorageSync('productInfoList');
+    uni.removeStorageSync('pxClassInfoList');
+
+    uni.onPushMessage((res) => {
+			console.log("收到推送消息:",res) //监听推送消息
+			let message = res.data;
+		  // 提取页面路径(支持 pagesOrder/detail 这样的格式)
+      let pagePath = message.payload && message.payload.page;
+			// 用户点击查看详情,跳转到指定页面
+			// 检查是否需要添加 / 前缀
+			let url = pagePath.startsWith('/') ? pagePath : `/${pagePath}`;
+			
+			// 如果有额外参数,拼接到URL
+			if (message.params || (message.payload && message.payload.params)) {
+				let params = message.params || message.payload.params;
+				let queryString = Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
+				url = `${url}?${queryString}`;
+			}
+			console.log('推送消息跳转页面:', url);
+			
+			// 使用 navigateTo 跳转
+			uni.navigateTo({
+				url: url,
+				fail: (err) => {
+					console.error('页面跳转失败:', err);
+				}
+			});
+
+			// 设置角标
+			let badgeNumber = message.aps && message.aps.badge ? message.aps.badge - 1 : false;
+			if (badgeNumber !== false) {
+				plus.runtime.setBadgeNumber(badgeNumber);
+			}
+		})
+    
     // #ifdef H5
     // H5开发环境无法微信授权,使用固定的用户 shish 2020.4.30
-    if (process.env.NODE_ENV == "development") {
-      uni.setStorageSync("token","eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6IjBfNTIifQ.eyJpc3MiOiJodHRwczpcL1wvYXBpLnNob3AuaHpnaGQuY29tIiwiYXVkIjoiaHR0cHM6XC9cL2FwaS5zaG9wLmh6Z2hkLmNvbSIsImp0aSI6IjBfNTIiLCJpYXQiOjE2MTYxNTc2NjQsIm5iZiI6MTYxNjE1NzY2NCwiZXhwIjoxNjI0Nzk3NjY0LCJ1bmlxdWVJZCI6IjUyIiwic291cmNlSWQiOjB9.VzSekbSwSczMWsfdPVdrm3gZ-v9o3p01NbMVNT4nGZ4")
-      uni.setStorageSync("account", "0")
-      getDictionaries({ token: uni.getStorageSync('token') }).then(res => {
+    if (process.env.NODE_ENV == 'development') {
+      uni.setStorageSync(
+        'token',
+        'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6IjBfNTIifQ.eyJpc3MiOiJodHRwczpcL1wvYXBpLnNob3AuaHpnaGQuY29tIiwiYXVkIjoiaHR0cHM6XC9cL2FwaS5zaG9wLmh6Z2hkLmNvbSIsImp0aSI6IjBfNTIiLCJpYXQiOjE2MTYxNTc2NjQsIm5iZiI6MTYxNjE1NzY2NCwiZXhwIjoxNjI0Nzk3NjY0LCJ1bmlxdWVJZCI6IjUyIiwic291cmNlSWQiOjB9.VzSekbSwSczMWsfdPVdrm3gZ-v9o3p01NbMVNT4nGZ4'
+      );
+      uni.setStorageSync('account', '0');
+      getDictionaries({ token: uni.getStorageSync('token') }).then((res) => {
         if (util.isEmpty(res)) {
-          return false
+          return false;
         }
         store.commit('setDictionariesInfo', {
           ...res.data.dict,
           ...res.data
-        })
-							store.commit('setMyShopInfo', {
-								...res.data.shop,
-								...res.data
-							})
-      })
+        });
+        store.commit('setMyShopInfo', {
+          ...res.data.shop,
+          ...res.data
+        });
+      });
     }
     // #endif
 
     // 删除缓存
     if (process.env.NODE_ENV == 'production') {
-      uni.removeStorageSync('shopUser')
+      uni.removeStorageSync('shopUser');
     }
     // #ifdef MP-WEIXIN
     // wxLoginFn()
     // uni.clearStorage()
-    const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
-    uni.setStorageSync('account', extConfig.account)
-
+    const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
+    uni.setStorageSync('account', extConfig.account);
     // #endif
-
   },
-  onLoad () {
+  onLoad() {
     // const pages = getCurrentPages();
     // const currentPage = pages[pages.length - 1];
     // const url = `/${currentPage.route}`;
     // console.log(1111,url)
   },
-  onShow (extraData) {
-  	if(extraData){
-  		uni.setStorageSync('extraData',extraData)
-			}
+  onShow(extraData) {
+    if (extraData) {
+      uni.setStorageSync('extraData', extraData);
+    }
   },
-  onHide () { },
-  onError (err) {
-    console.error(err, '错误捕获')
+  onHide() {},
+  onError(err) {
+    console.error(err, '错误捕获');
   },
   methods: {
     ...mapActions(['setUserShopAll'])
   }
-}
+};
 </script>
 
 <style lang="scss">
 //没有scss变量方法的,主要引入 这样打包的时候就不会所有的组件都打包进去
-@import "./static/iconfont/iconfont.css";
-@import "./static/css/uni2.css";
-@import "./static/css/base.scss";
-@import "./static/css/common.scss";
-@import "./static/css/reset.scss";
+@import './static/iconfont/iconfont.css';
+@import './static/css/uni2.css';
+@import './static/css/base.scss';
+@import './static/css/common.scss';
+@import './static/css/reset.scss';
 page {
   height: 100%;
 }
 /**开单-扎和支切换样式**/
-.switchover-unit{
-	position: fixed;
-	left: calc(170upx / 2 - 50upx);
-	bottom: 140upx;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	width: 100upx;
-	height: 100upx;
-	color: #FFFFFF;
-	background: #4b8cf4;
-	border-radius: 50%;
-	font-size: 42upx;
-	font-weight: 700;
-	z-index: 2;
+.switchover-unit {
+  position: fixed;
+  left: calc(170upx / 2 - 50upx);
+  bottom: 140upx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100upx;
+  height: 100upx;
+  color: #ffffff;
+  background: #4b8cf4;
+  border-radius: 50%;
+  font-size: 42upx;
+  font-weight: 700;
+  z-index: 2;
 }
 /**开单-增加减少动画**/
-.animation{animation:imgmove 0.3s 1;animation-iteration-count:1}
-@-webkit-keyframes imgmove{0%{transform: scale(0.7);}100%{transform: scale(1);}}
+.animation {
+  animation: imgmove 0.3s 1;
+  animation-iteration-count: 1;
+}
+@-webkit-keyframes imgmove {
+  0% {
+    transform: scale(0.7);
+  }
+  100% {
+    transform: scale(1);
+  }
+}
 </style>

+ 21 - 0
hdApp/src/admin/home/login.vue

@@ -308,6 +308,17 @@ export default {
 									prevPage.$vm.backAction = 'login'
 
 									uni.navigateBack()
+
+									// #ifdef APP-PLUS
+									//保存安卓的clientId
+									let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+									const clientInfo = plus.push.getClientInfo()
+									let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+									if(hasClientId == '' || hasClientId != currentClientId){
+										//replaceClientId({id:currentClientId})
+										console.log("clientId ---------- ", currentClientId)
+									}
+									// #endif
 								}
 							})
 						},
@@ -391,6 +402,16 @@ export default {
 					prevPage.$vm.backAction = 'login'
 
 					uni.navigateBack()
+					// #ifdef APP-PLUS
+					//保存安卓的clientId
+					let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+					const clientInfo = plus.push.getClientInfo()
+					let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+					if(hasClientId == '' || hasClientId != currentClientId){
+						//replaceClientId({id:currentClientId})
+						console.log("clientId ---------- ", currentClientId)
+					}
+					// #endif
 				}
 			})
 

+ 24 - 24
hdApp/src/androidPrivacy.json

@@ -1,27 +1,27 @@
 {
-  "version": "1",
-  "prompt": "template",
-  "title": "服务协议和隐私政策",
-  "message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"http://www.wixhb.com/main/hzg-register\">《服务协议》</a>和<a href=\"http://www.wixhb.com/main/hzg-privacy\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
-  "buttonAccept": "同意并接受",
-  "buttonRefuse": "暂不同意",
-  "second": {
-    "title": "确认提示",
-    "message": "  进入应用前,你需先同意<a href=\"http://www.wixhb.com/main/hzg-register\">《服务协议》</a>和<a href=\"http://www.wixhb.com/main/hzg-privacy\">《隐私政策》</a>,否则将退出应用。",
-    "buttonAccept": "同意并继续",
-    "buttonRefuse": "退出应用"
-  },
-  "styles": {
-    "backgroundColor": "#ffffff",
-    "borderRadius":"5px",
-    "title": {
-      "color": "#414141"
+    "version" : "1",
+    "prompt" : "template",
+    "title" : "服务协议和隐私政策",
+    "message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"http://www.wixhb.com/main/hzg-register\">《服务协议》</a>和<a href=\"http://www.wixhb.com/main/hzg-privacy\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
+    "buttonAccept" : "同意并接受",
+    "buttonRefuse" : "暂不同意",
+    "second" : {
+        "title" : "确认提示",
+        "message" : "  进入应用前,你需先同意<a href=\"http://www.wixhb.com/main/hzg-register\">《服务协议》</a>和<a href=\"http://www.wixhb.com/main/hzg-privacy\">《隐私政策》</a>,否则将退出应用。",
+        "buttonAccept" : "同意并继续",
+        "buttonRefuse" : "退出应用"
     },
-    "buttonAccept": {
-      "color": "#414141"
-    },
-    "buttonRefuse": {
-      "color": "#565656"
+    "styles" : {
+        "backgroundColor" : "#ffffff",
+        "borderRadius" : "5px",
+        "title" : {
+            "color" : "#414141"
+        },
+        "buttonAccept" : {
+            "color" : "#414141"
+        },
+        "buttonRefuse" : {
+            "color" : "#565656"
+        }
     }
-  }
-}
+}

+ 99 - 10
hdApp/src/manifest.json

@@ -27,7 +27,8 @@
             "OAuth" : {},
             "Share" : {},
             "Camera" : {},
-            "Barcode" : {}
+            "Barcode" : {},
+            "Push" : {}
         },
         /* 应用发布信息 */
         "distribute" : {
@@ -63,13 +64,12 @@
                     "entitlements" : {
                         "com.apple.developer.associated-domains" : [ "applinks:fronttg.wixhb.com" ]
                     }
-                }          
+                },
+                "dSYMs" : false
             },
             /* SDK配置 */
             "sdkConfigs" : {
-                "speech" : {
-                    
-                },
+                "speech" : {},
                 "ad" : {},
                 "oauth" : {
                     "univerify" : {}
@@ -79,6 +79,20 @@
                         "appid" : "wx64e8c9962761d972",
                         "UniversalLinks" : "https://fronttg.huahb.cn/uni-universallinks/__UNI__4079DC1/"
                     }
+                },
+                "push" : {
+                    "unipush" : {
+                        "version" : "2",
+                        "offline" : true,
+                        "vivo" : {},
+                        "honor" : {},
+                        "icons" : {
+                            "small" : {
+                                "xxhdpi" : "unpackage/res/icons/72x72.png"
+                            }
+                        },
+                        "hms" : {}
+                    }
                 }
             },
             "orientation" : [ "portrait-primary" ],
@@ -147,6 +161,14 @@
                     "parameters" : {}
                 }
             }
+        },
+        "uniStatistics" : {
+            "enable" : true
+        },
+        "uniCloud" : {
+            "provider" : "aliyun",
+            "spaceId" : "mp-09299f99-6ca7-41bb-94bd-c6fe650fb740",
+            "clientSecret" : "pC0+OYHrD6Ie0PK+7Zs5HA=="
         }
     },
     /* 快应用特有相关 */
@@ -160,22 +182,37 @@
         "usingComponents" : true,
         "permission" : {
             "scope.userLocation" : {
-                "desc" : "请点击确定"
+                "desc" : "获取用户位置,方便快递配送"
             }
         },
         "optimization" : {
             "subPackages" : true
         },
-        "lazyCodeLoading":"requiredComponents"
+        "lazyCodeLoading" : "requiredComponents",
+        "uniStatistics" : {
+            "enable" : true
+        },
+        "unipush" : {
+            "enable" : true
+        }
     },
     "mp-alipay" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "mp-baidu" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "mp-toutiao" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "h5" : {
         "template" : "template.h5.html",
@@ -210,6 +247,58 @@
                     "key" : ""
                 }
             }
+        },
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "uniStatistics" : {
+        "version" : "2",
+        "enable" : true
+    },
+    "app-harmony" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-harmony" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-jd" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-kuaishou" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-lark" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-qq" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-xhs" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "quickapp-webview-huawei" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "quickapp-webview-union" : {
+        "uniStatistics" : {
+            "enable" : true
         }
     }
 }

+ 12 - 0
hdApp/uniCloud-aliyun/database/JQL查询.jql

@@ -0,0 +1,12 @@
+// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理
+// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法
+// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码
+// 如果文档中存在多条JQL语句,只有最后一条语句生效
+// 如果混写了普通js,最后一条语句需是数据库操作语句
+// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission
+// 不支持clientDB的action
+// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#limit
+// 详细JQL语法,请参考:https://uniapp.dcloud.net.cn/uniCloud/jql.html
+
+// 下面示例查询uni-id-users表的所有数据
+db.collection('uni-id-users').get();

+ 15 - 0
mallApp/.hbuilderx/launch.json

@@ -0,0 +1,15 @@
+{
+    "version" : "1.0",
+    "configurations" : [
+        {
+            "default" : {
+                "launchtype" : "local"
+            },
+            "h5" : {
+                "launchtype" : "local"
+            },
+            "provider" : "aliyun",
+            "type" : "uniCloud"
+        }
+    ]
+}

+ 88 - 26
mallApp/src/manifest.json

@@ -39,15 +39,17 @@
                     "NSPhotoLibraryAddUsageDescription" : "该应用需要读取您的相册,以便支持您修改头像、门店图片或花材图片",
                     "NSCameraUsageDescription" : "该应用需要获取您的摄像头权限,以便支持您直接拍照上传头像、门店图片或花材图片"
                 },
-                "idfa" : false            
+                "idfa" : false
             },
             /* SDK配置 */
             "sdkConfigs" : {
-                "speech" : {
-                    
-                }
+                "speech" : {},
+                "push" : {}
             },
             "orientation" : [ "portrait-primary" ]
+        },
+        "uniStatistics" : {
+            "enable" : true
         }
     },
     /* 快应用特有相关 */
@@ -62,18 +64,29 @@
             "subPackages" : true
         },
         "usingComponents" : true,
-        "permission" : {
-        },
-        "lazyCodeLoading":"requiredComponents"
+        "permission" : {},
+        "lazyCodeLoading" : "requiredComponents",
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "mp-alipay" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "mp-baidu" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "mp-toutiao" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
     },
     "h5" : {
         "template" : "template.h5.html",
@@ -81,23 +94,23 @@
             // "mode" : "history",
             "base" : "/"
         },
-        "async": {
-            "timeout": 200000
+        "async" : {
+            "timeout" : 20000
         },
-        "optimization": {
-            "treeShaking": {
-                "enable": true
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : true
             }
         },
-        "devServer": {
-            "port": 81,
-            "proxy": {
-                "/api": {
-                    "target": "https://api.mall.huaml.com",
-                    "secure": false,
-                    "changeOrigin": true,
-                    "pathRewrite": {
-                        "^/api": ""
+        "devServer" : {
+            "port" : 81,
+            "proxy" : {
+                "/api" : {
+                    "target" : "https://api.mall.huaml.com",
+                    "secure" : false,
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "^/api" : ""
                     }
                 }
             }
@@ -109,8 +122,57 @@
                 }
             }
         },
-        "async" : {
-            "timeout" : 20000
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "uniStatistics" : {
+        "version" : "2",
+        "enable" : true
+    },
+    "app-harmony" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-harmony" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-jd" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-kuaishou" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-lark" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-qq" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-xhs" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "quickapp-webview-huawei" : {
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "quickapp-webview-union" : {
+        "uniStatistics" : {
+            "enable" : true
         }
     }
 }

+ 6 - 0
mallApp/src/uni_modules/uni-config-center/changelog.md

@@ -0,0 +1,6 @@
+## 0.0.3(2022-11-11)
+- 修复 config 方法获取根节点为数组格式配置时错误的转化为了对象的Bug
+## 0.0.2(2021-04-16)
+- 修改插件package信息
+## 0.0.1(2021-03-15)
+- 初始化项目

+ 81 - 0
mallApp/src/uni_modules/uni-config-center/package.json

@@ -0,0 +1,81 @@
+{
+  "id": "uni-config-center",
+  "displayName": "uni-config-center",
+  "version": "0.0.3",
+  "description": "uniCloud 配置中心",
+  "keywords": [
+    "配置",
+    "配置中心"
+],
+  "repository": "",
+  "engines": {
+    "HBuilderX": "^3.1.0"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "",
+    "type": "unicloud-template-function"
+  },
+  "directories": {
+    "example": "../../../scripts/dist"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "u",
+          "app-nvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "u",
+          "Android Browser": "u",
+          "微信浏览器(Android)": "u",
+          "QQ浏览器(Android)": "u"
+        },
+        "H5-pc": {
+          "Chrome": "u",
+          "IE": "u",
+          "Edge": "u",
+          "Firefox": "u",
+          "Safari": "u"
+        },
+        "小程序": {
+          "微信": "u",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "u",
+          "QQ": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "u"
+        }
+      }
+    }
+  }
+}

+ 93 - 0
mallApp/src/uni_modules/uni-config-center/readme.md

@@ -0,0 +1,93 @@
+# 为什么使用uni-config-center
+
+实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
+
+```bash
+cloudfunctions
+└─────common 公共模块
+        ├─plugin-a // 插件A对应的目录
+        │  ├─index.js
+        │  ├─config.json // plugin-a对应的配置文件
+        │  └─other-file.cert  // plugin-a依赖的其他文件
+        └─plugin-b // plugin-b对应的目录
+           ├─index.js
+           └─config.json // plugin-b对应的配置文件
+```
+
+假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
+
+uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下
+
+```bash
+cloudfunctions
+└─────common 公共模块
+        ├─plugin-a // 插件A对应的目录
+        │  └─index.js
+        ├─plugin-b // plugin-b对应的目录
+        │  └─index.js
+        └─uni-config-center
+           ├─index.js // config-center入口文件
+           ├─plugin-a
+           │  ├─config.json  // plugin-a对应的配置文件
+           │  └─other-file.cert  // plugin-a依赖的其他文件
+           └─plugin-b
+              └─config.json  // plugin-b对应的配置文件
+```
+
+使用uni-config-center后的优势
+
+- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
+- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持)
+
+# 用法
+
+在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
+
+```js
+const createConfig = require('uni-config-center')
+
+const uniIdConfig = createConfig({
+    pluginId: 'uni-id', // 插件id
+    defaultConfig: { // 默认配置
+        tokenExpiresIn: 7200,
+        tokenExpiresThreshold: 600,
+    },
+    customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
+        // defaudltConfig 默认配置
+        // userConfig 用户配置
+        return Object.assign(defaultConfig, userConfig)
+    }
+})
+
+
+// 以如下配置为例
+// {
+//   "tokenExpiresIn": 7200,
+//   "passwordErrorLimit": 6,
+//   "bindTokenToDevice": false,
+//   "passwordErrorRetryTime": 3600,
+//   "app-plus": {
+//     "tokenExpiresIn": 2592000
+//   },
+//   "service": {
+//     "sms": {
+//       "codeExpiresIn": 300
+//     }
+//   }
+// }
+
+// 获取配置
+uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象
+uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200
+uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300
+uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600
+
+// 获取文件绝对路径
+uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
+
+// 引用文件(require)
+uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。
+
+// 判断是否包含某文件
+uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在
+```

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
mallApp/src/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js


+ 13 - 0
mallApp/src/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/package.json

@@ -0,0 +1,13 @@
+{
+    "name": "uni-config-center",
+    "version": "0.0.3",
+    "description": "配置中心",
+    "main": "index.js",
+    "keywords": [],
+    "author": "DCloud",
+    "license": "Apache-2.0",
+    "origin-plugin-dev-name": "uni-config-center",
+    "origin-plugin-version": "0.0.3",
+    "plugin-dev-name": "uni-config-center",
+    "plugin-version": "0.0.3"
+}

+ 36 - 0
mallApp/src/uni_modules/uni-id-common/changelog.md

@@ -0,0 +1,36 @@
+## 1.0.18(2024-07-08)
+- checkToken时如果传入的token为空则返回uni-id-check-token-failed错误码以便uniIdRouter能正常跳转
+## 1.0.17(2024-04-26)
+- 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios)
+## 1.0.16(2023-04-25)
+- 新增maxTokenLength配置,用于限制数据库用户记录token数组的最大长度
+## 1.0.15(2023-04-06)
+- 修复部分语言国际化出错的Bug
+## 1.0.14(2023-03-07)
+- 修复 admin用户包含其他角色时未包含在token的Bug
+## 1.0.13(2022-07-21)
+- 修复 创建token时未传角色权限信息生成的token不正确的bug
+## 1.0.12(2022-07-15)
+- 提升与旧版本uni-id的兼容性(补充读取配置文件时回退平台app-plus、h5),但是仍推荐使用新平台名进行配置(app、web)
+## 1.0.11(2022-07-14)
+- 修复 部分情况下报`read property 'reduce' of undefined`的错误
+## 1.0.10(2022-07-11)
+- 将token存储在用户表的token字段内,与旧版本uni-id保持一致
+## 1.0.9(2022-07-01)
+- checkToken兼容token内未缓存角色权限的情况,此时将查库获取角色权限
+## 1.0.8(2022-07-01)
+- 修复clientDB默认依赖时部分情况下获取不到uni-id配置的Bug
+## 1.0.7(2022-06-30)
+- 修复config文件不合法时未抛出具体错误的Bug
+## 1.0.6(2022-06-28)
+- 移除插件内的数据表schema
+## 1.0.5(2022-06-27)
+- 修复使用多应用配置时报`Cannot read property 'appId' of undefined`的Bug
+## 1.0.4(2022-06-27)
+- 修复使用自定义token内容功能报错的Bug [详情](https://ask.dcloud.net.cn/question/147945)
+## 1.0.2(2022-06-23)
+- 对齐旧版本uni-id默认配置
+## 1.0.1(2022-06-22)
+- 补充对uni-config-center的依赖
+## 1.0.0(2022-06-21)
+- 提供uni-id token创建、校验、刷新接口,简化旧版uni-id公共模块

+ 84 - 0
mallApp/src/uni_modules/uni-id-common/package.json

@@ -0,0 +1,84 @@
+{
+	"id": "uni-id-common",
+	"displayName": "uni-id-common",
+	"version": "1.0.18",
+	"description": "包含uni-id token生成、校验、刷新功能的云函数公共模块",
+	"keywords": [
+        "uni-id-common",
+        "uniCloud",
+        "token",
+        "权限"
+    ],
+	"repository": "https://gitcode.net/dcloud/uni-id-common",
+    "engines": {
+	},
+    "dcloudext": {
+        "sale": {
+			"regular": {
+				"price": 0
+			},
+			"sourcecode": {
+				"price": 0
+			}
+		},
+		"contact": {
+			"qq": ""
+		},
+		"declaration": {
+			"ads": "无",
+			"data": "无",
+			"permissions": "无"
+		},
+        "npmurl": "",
+        "type": "unicloud-template-function"
+	},
+	"uni_modules": {
+		"dependencies": ["uni-config-center"],
+		"encrypt": [],
+		"platforms": {
+			"cloud": {
+				"tcb": "y",
+                "aliyun": "y",
+                "alipay": "n"
+			},
+			"client": {
+				"Vue": {
+					"vue2": "u",
+					"vue3": "u"
+				},
+				"App": {
+					"app-vue": "u",
+					"app-nvue": "u"
+				},
+				"H5-mobile": {
+					"Safari": "u",
+					"Android Browser": "u",
+					"微信浏览器(Android)": "u",
+					"QQ浏览器(Android)": "u"
+				},
+				"H5-pc": {
+					"Chrome": "u",
+					"IE": "u",
+					"Edge": "u",
+					"Firefox": "u",
+					"Safari": "u"
+				},
+				"小程序": {
+					"微信": "u",
+					"阿里": "u",
+					"百度": "u",
+					"字节跳动": "u",
+					"QQ": "u",
+					"钉钉": "u",
+					"快手": "u",
+					"飞书": "u",
+                    "京东": "u"
+				},
+				"快应用": {
+					"华为": "u",
+					"联盟": "u"
+				}
+			}
+		}
+	}
+}

+ 3 - 0
mallApp/src/uni_modules/uni-id-common/readme.md

@@ -0,0 +1,3 @@
+# uni-id-common
+
+文档请参考:[uni-id-common](https://uniapp.dcloud.net.cn/uniCloud/uni-id-common.html)

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
mallApp/src/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js


+ 20 - 0
mallApp/src/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/package.json

@@ -0,0 +1,20 @@
+{
+    "name": "uni-id-common",
+    "version": "1.0.18",
+    "description": "uni-id token生成、校验、刷新",
+    "main": "index.js",
+    "homepage": "https:\/\/uniapp.dcloud.io\/uniCloud\/uni-id-common.html",
+    "repository": {
+        "type": "git",
+        "url": "git+https:\/\/gitee.com\/dcloud\/uni-id-common.git"
+    },
+    "author": "DCloud",
+    "license": "Apache-2.0",
+    "dependencies": {
+        "uni-config-center": "file:..\/..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center"
+    },
+    "origin-plugin-dev-name": "uni-id-common",
+    "origin-plugin-version": "1.0.18",
+    "plugin-dev-name": "uni-id-common",
+    "plugin-version": "1.0.18"
+}

+ 12 - 0
mallApp/uniCloud-aliyun/database/JQL查询.jql

@@ -0,0 +1,12 @@
+// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理
+// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法
+// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码
+// 如果文档中存在多条JQL语句,只有最后一条语句生效
+// 如果混写了普通js,最后一条语句需是数据库操作语句
+// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission
+// 不支持clientDB的action
+// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#limit
+// 详细JQL语法,请参考:https://uniapp.dcloud.net.cn/uniCloud/jql.html
+
+// 下面示例查询uni-id-users表的所有数据
+db.collection('uni-id-users').get();

Некоторые файлы не были показаны из-за большого количества измененных файлов