刘忠健 %!s(int64=2) %!d(string=hai) anos
pai
achega
d3df9d24d0

+ 34 - 31
uniapp_cli/package.json

@@ -42,51 +42,54 @@
     "test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
   },
   "dependencies": {
-    "@dcloudio/uni-app-plus": "2.0.1-32920211122003",
-    "@dcloudio/uni-h5": "2.0.1-32920211122003",
+    "@dcloudio/uni-app-plus": "2.0.1-35320220729002",
+    "@dcloudio/uni-h5": "2.0.1-35320220729002",
     "@dcloudio/uni-helper-json": "*",
-    "@dcloudio/uni-i18n": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-360": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-alipay": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-baidu": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-kuaishou": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-lark": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-qq": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-toutiao": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-vue": "2.0.1-32920211122003",
-    "@dcloudio/uni-mp-weixin": "2.0.1-32920211122003",
-    "@dcloudio/uni-quickapp-native": "2.0.1-32920211122003",
-    "@dcloudio/uni-quickapp-webview": "2.0.1-32920211122003",
-    "@dcloudio/uni-stat": "2.0.1-32920211122003",
-    "@vue/shared": "^3.2.26",
+    "@dcloudio/uni-i18n": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-360": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-alipay": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-baidu": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-jd": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-kuaishou": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-lark": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-qq": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-toutiao": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-vue": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-weixin": "2.0.1-35320220729002",
+    "@dcloudio/uni-mp-xhs": "2.0.1-35320220729002",
+    "@dcloudio/uni-quickapp-native": "2.0.1-35320220729002",
+    "@dcloudio/uni-quickapp-webview": "2.0.1-35320220729002",
+    "@dcloudio/uni-stacktracey": "2.0.1-35320220729002",
+    "@dcloudio/uni-stat": "2.0.1-35320220729002",
+    "@vue/shared": "^3.0.0",
     "await-to-js": "^3.0.0",
     "core-js": "^3.20.1",
     "dayjs": "^1.10.7",
-    "flyio": "^0.6.14",
+    "flyio": "^0.6.2",
     "js-md5": "^0.7.3",
     "regenerator-runtime": "^0.12.1",
     "uview-ui": "^1.8.5",
     "vue": "^2.6.14",
-    "vuex": "^3.6.2"
+    "vuex": "^3.2.0"
   },
   "devDependencies": {
     "@babel/runtime": "~7.12.18",
     "@dcloudio/types": "*",
-    "@dcloudio/uni-automator": "2.0.1-32920211122003",
-    "@dcloudio/uni-cli-i18n": "2.0.1-32920211122003",
-    "@dcloudio/uni-cli-shared": "2.0.1-32920211122003",
-    "@dcloudio/uni-migration": "2.0.1-32920211122003",
-    "@dcloudio/uni-template-compiler": "2.0.1-32920211122003",
-    "@dcloudio/vue-cli-plugin-hbuilderx": "2.0.1-32920211122003",
-    "@dcloudio/vue-cli-plugin-uni": "2.0.1-32920211122003",
-    "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.1-32920211122003",
-    "@dcloudio/webpack-uni-mp-loader": "2.0.1-32920211122003",
-    "@dcloudio/webpack-uni-pages-loader": "2.0.1-32920211122003",
+    "@dcloudio/uni-automator": "2.0.1-35320220729002",
+    "@dcloudio/uni-cli-i18n": "2.0.1-35320220729002",
+    "@dcloudio/uni-cli-shared": "2.0.1-35320220729002",
+    "@dcloudio/uni-migration": "2.0.1-35320220729002",
+    "@dcloudio/uni-template-compiler": "2.0.1-35320220729002",
+    "@dcloudio/vue-cli-plugin-hbuilderx": "2.0.1-35320220729002",
+    "@dcloudio/vue-cli-plugin-uni": "2.0.1-35320220729002",
+    "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.1-35320220729002",
+    "@dcloudio/webpack-uni-mp-loader": "2.0.1-35320220729002",
+    "@dcloudio/webpack-uni-pages-loader": "2.0.1-35320220729002",
     "@vue/cli-plugin-babel": "~4.5.15",
     "@vue/cli-service": "~4.5.15",
-    "babel-plugin-import": "^1.13.3",
-    "cross-env": "^7.0.3",
-    "jest": "^25.5.4",
+    "babel-plugin-import": "^1.11.0",
+    "cross-env": "^7.0.2",
+    "jest": "^25.4.0",
     "less": "^4.1.2",
     "less-loader": "7.*",
     "mini-types": "*",

+ 163 - 0
uniapp_cli/src/libs/util/UniHelper.js

@@ -0,0 +1,163 @@
+
+import MapHelper from "./map_helper";
+import to from 'await-to-js';
+const UniHelper = {
+
+    copyText(data) {
+        return new Promise((resolve, reject) => {
+            uni.setClipboardData({
+                data: data,
+                success: function () {
+                    console.log('success');
+                    resolve(true);
+                }
+            });
+        })
+    },
+    previewImage(images, current = 0) {
+        console.log("previewImage", images)
+        uni.previewImage({
+            urls: images,
+            current: current,
+            longPressActions: {
+                itemList: ['发送给朋友', '保存图片', '收藏'],
+                success: function (data) {
+                    console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+                },
+                fail: function (err) {
+                    console.log(err.errMsg);
+                }
+            }
+        });
+    },
+    ///========消息=============
+    toast(title, duration = 2000, icon = "none") {
+        return new Promise((resolve, reject) => {
+            uni.showToast({
+                title: title,
+                duration: duration,
+                icon: icon,
+                success: function () {
+                    resolve(true);
+                }
+            });
+        });
+
+    },
+    /**
+     * 加载中
+     * @param {*} title 
+     */
+    loading(title = "加载中...") {
+        uni.showLoading({
+            title: title,
+            mask: true,
+        });
+    },
+    /**
+     *  隐藏 loading 提示框
+     */
+    hideLoading() {
+        uni.hideLoading();
+    },
+    /**
+     * 消息提示,有确认按钮
+     * @param {*} msg 
+     */
+    alert(msg) {
+        return new Promise((resolve, reject) => {
+            uni.showModal({
+                content: msg,
+                showCancel: false,
+                success: function () {
+                    resolve(true);
+                }
+            });
+        });
+
+    },
+    /**
+     * 消息二次确认
+     * @param {*} title 
+     * @param {*} content 
+     * @returns 
+     */
+    async confirm(title, content) {
+
+        return new Promise((resolve, reject) => {
+            uni.showModal({
+                title: title,
+                content: content,
+                success: function (res) {
+                    if (res.confirm) {
+                        console.log('用户点击确定');
+                        resolve(true);
+                    } else if (res.cancel) {
+                        console.log('用户点击取消');
+                        resolve(false);
+                    }
+                }
+            });
+        });
+    },
+    ////////==========上传============//////////////////////////
+    /**
+     * 选1张图片
+     * @returns 
+     */
+    async simpleChooseImage() {
+        let [err, res] = await to(this.chooseImage(1));
+        console.log("simpleChooseImage", err, res);
+        return res.tempFilePaths[0];
+    },
+    /**
+     * 选图片,改promise
+     * @param {*} count 
+     * @param {*} sizeType 
+     * @param {*} sourceType 
+     * @returns 
+     */
+    chooseImage(count = 9, sizeType = ['compressed'], sourceType = ['album', 'camera ']) {
+        return new Promise((resolve, reject) => {
+            uni.chooseImage({
+                count, //默认9
+                sizeType,//: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+                sourceType: ['album'], //从相册选择
+                success: function (res) {
+                    console.log(JSON.stringify(res.tempFilePaths));
+                    resolve(res);
+                }
+            });
+        });
+    },
+    getLocation(type = "gcj02") {
+        return new Promise((resolve, reject) => {
+            uni.getLocation({
+                geocode: true,
+                success: async function (res) {
+
+                    console.log("当前位置: res", res);
+                    console.log("当前位置的经度:" + res.longitude);
+                    console.log("当前位置的纬度:" + res.latitude);
+                    let res1 = MapHelper.wgs84togcj02(res.latitude, res.longitude);
+                    res.latitude = res1.lat;
+                    res.longitude = res1.lon;
+                    res.lat = res1.lat;
+                    res.lng = res1.lon;
+                    resolve(res);
+                    // uni.showModal({
+                    //     content: "当前位置的经度:" + res.longitude + "当前位置的纬度:" + res.latitude + "," + JSON.stringify(res1)
+                    // })
+
+                },
+                fail: function (res) {
+                    resolve(false);
+                }
+            });
+        });
+    }
+
+}
+
+
+export default UniHelper

+ 36 - 32
uniapp_cli/src/manifest.json

@@ -1,11 +1,12 @@
 {
 	"name": "",
-	"appid": "",
+	"appid": "__UNI__7ED4F00",
 	"description": "",
-	"versionName": "1.0.0",
-	"versionCode": "100",
+	"versionName": "1.0.3",
+	"versionCode": "103",
 	"transformPx": false,
-	"app-plus": { /* 5+App特有相关 */
+	"app-plus": {
+		/* 5+App特有相关 */
 		"usingComponents": true,
 		"splashscreen": {
 			"alwaysShowBeforeRender": true,
@@ -13,12 +14,17 @@
 			"autoclose": true,
 			"delay": 0
 		},
-		"modules": { /* 模块配置 */
-
+		"compatible": {
+			"ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持  
 		},
-		"distribute": { /* 应用发布信息 */
-			"android": { /* android打包配置 */
-				"permissions": ["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+		"modules": {},
+		/* 模块配置 */
+		"distribute": {
+			/* 应用发布信息 */
+			"android": {
+				/* android打包配置 */
+				"permissions": [
+					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
 					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
 					"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
 					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -42,34 +48,32 @@
 					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
 				]
 			},
-			"ios": { /* ios打包配置 */
-
-			},
-			"sdkConfigs": { /* SDK配置 */
-
-			}
+			"ios": {},
+			/* ios打包配置 */
+			"sdkConfigs": {}
 		}
 	},
-	"quickapp": { /* 快应用特有相关 */
-
-	},
-	"mp-weixin": { /* 微信小程序特有相关 */
+	/* SDK配置 */
+	"quickapp": {},
+	/* 快应用特有相关 */
+	"mp-weixin": {
+		/* 微信小程序特有相关 */
 		"appid": "",
 		"setting": {
 			"urlCheck": false
 		},
 		"usingComponents": true
 	},
-	"mp-alipay" : {
-        "usingComponents" : true
-    },
-    "mp-baidu" : {
-        "usingComponents" : true
-    },
-    "mp-toutiao" : {
-        "usingComponents" : true
-    },
-    "mp-qq" : {
-        "usingComponents" : true
-    }
-}
+	"mp-alipay": {
+		"usingComponents": true
+	},
+	"mp-baidu": {
+		"usingComponents": true
+	},
+	"mp-toutiao": {
+		"usingComponents": true
+	},
+	"mp-qq": {
+		"usingComponents": true
+	}
+}

+ 1 - 1
uniapp_cli/src/pages/manager/index.vue

@@ -8,7 +8,7 @@
 		<view class="p20 pt0 common_width">
 			<u-divider text="时间记录" class="mt0"></u-divider>
 			<view class="time_list">
-				<view class="item" v-for="(item, index) in recordList" @click="navigateTo('edit?id=' + item.id)">
+				<view class="item" v-for="(item, index) in recordList" :key="index" @click="navigateTo('edit?id=' + item.id)">
 					<view class="content">
 						<view class="type" :style="{ background: item.type.color }">{{ item.type.name }}</view>
 						<view class="info">