Browse Source

配置打包以及调整收费员管理

杨再金 2 years ago
parent
commit
81cec2e89c

+ 140 - 93
App.vue

@@ -1,133 +1,180 @@
 <script>
-	import {
-		config
-	} from '@/common/config.js';
-	export default {
-		data() {
-			return {
-				downloadUrl: ''
-			}
-		},
-		onLaunch: function() {
-			console.log('App Launch')
-		},
-		onShow: function() {
-			console.log('App Show')
-			this.getDownloadUrl();
-		},
-		methods: {
-			/**
-			 * 通过参数设置获取最新版本信息
-			 */
-			getVersion() {
-				const _this = this
-				uni.$u.api.getParameterApi({
+import { config } from '@/common/config.js';
+export default {
+	data() {
+		return {
+			downloadUrl: ''
+		};
+	},
+	onLaunch: function() {
+		console.log('App Launch');
+	},
+	onShow: function() {
+		console.log('App Show');
+		this.getDownloadUrl();
+	},
+	methods: {
+		/**
+		 * 通过参数设置获取最新版本信息
+		 */
+		getVersion() {
+			const _this = this;
+			uni.$u.api
+				.getParameterApi({
 					key: 'parking.operation.version'
-				}).then(res => {
+				})
+				.then(res => {
 					if (res.code === 200) {
 						if (res.msg !== config.version) {
 							uni.getNetworkType({
-								success: function (res) {
+								success: function(res) {
 									if (res.networkType === 'wifi') {
 										uni.showModal({
 											title: '版本发布更新',
 											content: '发现新版本且您使用的是无限网络,是否进行更新?',
 											confirmText: '更新',
 											confirmColor: '#EE8F57',
-											success: (res) => {
+											success: res => {
 												if (res.confirm) {
-													_this.downloadAppFile()
+													// _this.downloadAppFile()
+													_this.downloadAppFileByBrowser();
 												}
 											}
-										})
+										});
 									} else {
 										uni.showModal({
 											title: '版本发布更新',
 											content: '发现新版本,是否继续消耗流量进行更新?',
 											confirmText: '更新',
 											confirmColor: '#EE8F57',
-											success: (res) => {
+											success: res => {
 												if (res.confirm) {
-													_this.downloadAppFile()
+													// _this.downloadAppFile()
+													_this.downloadAppFileByBrowser();
 												}
 											}
-										})
+										});
 									}
 								}
 							});
 						}
 					}
-				})
-			},
-			/**
-			 * 通过参数设置获取最新下载链接
-			 */
-			getDownloadUrl() {
-				uni.$u.api.getParameterApi({
+				});
+		},
+		/**
+		 * 通过参数设置获取最新下载链接
+		 */
+		getDownloadUrl() {
+			uni.$u.api
+				.getParameterApi({
 					key: 'parking.operation.package'
-				}).then(res => {
+				})
+				.then(res => {
 					if (res.code === 200) {
-						this.downloadUrl = res?.msg
+						this.downloadUrl = res?.msg;
 						this.getVersion();
 					}
-				})
-			},
-			/**
-			 * 下载文件
-			 */
-			downloadAppFile() {
-				const _this = this
-				uni.showLoading({
-					mask: true,
-					title: '下载中...'
-				})
-				let downloadTask = uni.downloadFile({ // 执行下载
-					url: _this.downloadUrl,
-					success: downloadResult => {
-						// 下载成功
-						if (downloadResult.statusCode === 200) {
-							uni.showModal({
-								title: '',
-								content: '下载成功,确定现在安装吗?',
-								confirmText: '安装',
-								confirmColor: '#EE8F57',
-								success: function(res) {
-									if (res.confirm) {
-										plus.runtime.install( // 安装
-											downloadResult.tempFilePath, {
-												force: true
-											},
-											function() {
-												plus.runtime.restart();
-												uni.navigateBack()
-											},
-											function(e) {
-												utils.showToast('安装失败');
-											}
-										);
-									}
-								}
-							});
-						}
-					},
-					complete: (res) => {
-						uni.hideLoading();
-					}
-				});
-				downloadTask.onProgressUpdate((res) => {
-					if (res.progress === 100) {
-						uni.hideLoading();
-					}
 				});
-			}
 		},
-		onHide: function() {
-			console.log('App Hide')
+		/**
+		 * 下载文件
+		 */
+		downloadAppFile() {
+			const _this = this
+			// uni.showLoading({
+			// 	mask: true,
+			// 	title: '下载中...'
+			// })
+			// let downloadTask = uni.downloadFile({ // 执行下载
+			// 	url: _this.downloadUrl,
+			// 	success: downloadResult => {
+			// 		// 下载成功
+			// 		if (downloadResult.statusCode === 200) {
+			// 			uni.showModal({
+			// 				title: '',
+			// 				content: '下载成功,确定现在安装吗?',
+			// 				confirmText: '安装',
+			// 				confirmColor: '#EE8F57',
+			// 				success: function(res) {
+			// 					if (res.confirm) {
+			// 						plus.runtime.install( // 安装
+			// 							downloadResult.tempFilePath, {
+			// 								force: true
+			// 							},
+			// 							function() {
+			// 								plus.runtime.restart();
+			// 								uni.navigateBack()
+			// 							},
+			// 							function(e) {
+			// 								utils.showToast('安装失败');
+			// 							}
+			// 						);
+			// 					}
+			// 				}
+			// 			});
+			// 		}
+			// 	},
+			// 	complete: (res) => {
+			// 		uni.hideLoading();
+			// 	}
+			// });
+			// downloadTask.onProgressUpdate((res) => {
+			// 	if (res.progress === 100) {
+			// 		uni.hideLoading();
+			// 	}
+			// });
+			// #ifdef APP-PLUS
+			const dtask = plus.downloader.createDownload(_this.downloadUrl, { force: true }, function(d, status) {
+				// 下载完成
+				if (status == 200) {
+					var path = d.filename; //文件安装路径
+					plus.runtime.install(
+						path,
+						{},
+						function() {
+							plus.nativeUI.closeWaiting(); //关闭系统等待对话框
+							if (name == 'wgt') {
+								console.log('安装wgt文件成功!');
+							} else {
+								console.log('安装apk文件成功!');
+							}
+							plus.nativeUI.alert('安装成功!', function() {
+								plus.runtime.restart();
+							});
+						},
+						function(e) {
+							plus.nativeUI.closeWaiting(); //关闭系统等待对话框
+							if (name == 'wgt') {
+								console.log('安装wgt文件失败[' + e.code + ']:' + e.message);
+								plus.nativeUI.alert('安装wgt文件失败[' + e.code + ']:' + e.message);
+							} else {
+								console.log('安装apk文件失败[' + e.code + ']:' + e.message);
+								plus.nativeUI.alert('安装apk文件失败[' + e.code + ']:' + e.message);
+							}
+						}
+					);
+				} else {
+					alert('下载失败:' + status);
+				}
+			});
+			// #endif
 		},
+		/**
+		 * 下载app通过浏览器
+		 */
+		downloadAppFileByBrowser() {
+			// #ifdef APP-PLUS
+			plus.runtime.openURL(this.downloadUrl);
+			// #endif
+		}
+	},
+	onHide: function() {
+		console.log('App Hide');
 	}
+};
 </script>
 
 <style lang="scss">
-	/*每个页面公共css */
-	@import "@/uni_modules/uview-ui/index.scss";
+/*每个页面公共css */
+@import '@/uni_modules/uview-ui/index.scss';
 </style>

+ 1 - 1
common/config.js

@@ -4,5 +4,5 @@ if (process.env.NODE_ENV === 'development') {
 }
 export const config = {
 	baseUrl,
-	version: '0.1.7'
+	version: '0.1.9'
 }

+ 3 - 0
manifest.json

@@ -7,6 +7,9 @@
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
+				"compatible": {
+					"ignoreVersion": true // true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
+				},
         "usingComponents" : true,
         "nvueStyleCompiler" : "uni-app",
         "compilerVersion" : 3,

+ 12 - 10
pages/collectorManagement/performanceRanking/performanceRanking.vue

@@ -10,7 +10,7 @@
 
 <template>
   <view class="performance-ranking">
-    <view class="performance-ranking-search">
+    <!-- <view class="performance-ranking-search">
       <view class="performance-ranking-search-item">
         <uni-datetime-picker v-model="dateRange" type="daterange" @change="dateChange" />
       </view>
@@ -31,11 +31,11 @@
         <u-button text="搜索" size="small" class="custom-btn" type="primary" @click="handleQuery"></u-button>
         <u-button text="重置" size="small" class="custom-btn" @click="handleReset"></u-button>
       </view>
-    </view>
+    </view> -->
     <view class="performance-ranking-content">
       <TableRanking
         :loading="tableData.loading"
-        :padding="'0'"
+        :padding="'2'"
         :tableTh="tableData.tableTh"
         :tableData="tableData.tableData"
         @pageChange="pageChange"
@@ -59,9 +59,11 @@ export default {
       payeeNoList: '',
       loadAcheve: false,
       params: {
-        payeeNoList: '',
-        beginTime: '',
-        endTime: '',
+        payeeNoList: undefined,
+        beginTime: undefined,
+        endTime: undefined,
+				sortField: 'realAmount',
+				sortOrder: 'desc',
         pageNum: 1,
         pageSize: 10
       },
@@ -90,7 +92,7 @@ export default {
     };
   },
   onShow() {
-    this.getCollectorList();
+    // this.getCollectorList();
     this.getList();
   },
   methods: {
@@ -133,9 +135,9 @@ export default {
     },
     handleReset() {
       this.params = {
-        payeeNoList: '',
-        beginTime: '',
-        endTime: '',
+        payeeNoList: undefined,
+        beginTime: undefined,
+        endTime: undefined,
         pageNum: 1,
         pageSize: 10
       };

+ 10 - 10
pages/dataOverview/operationalAnalysis/operationalAnalysis.vue

@@ -131,16 +131,16 @@
 							value: 4,
 							key: 'trafficFlow'
 						},
-						{
-							text: '收费员业绩排行',
-							value: 5,
-							key: 'tollCollectorPerformance'
-						},
-						{
-							text: '收费员业绩分析',
-							value: 6,
-							key: 'tollCollectorPerformance'
-						},
+						// {
+						// 	text: '收费员业绩排行',
+						// 	value: 5,
+						// 	key: 'tollCollectorPerformance'
+						// },
+						// {
+						// 	text: '收费员业绩分析',
+						// 	value: 6,
+						// 	key: 'tollCollectorPerformance'
+						// },
 						{
 							text: '路段分析',
 							value: 7,

+ 5 - 5
pages/dataOverview/statisticalReport/statisticalReport.vue

@@ -92,11 +92,11 @@
 				tabCur: 2,
 				typePicker: false,
 				typeList: [[
-					{
-						text: '收费员业绩统计',
-						value: 1,
-						key: 'tollCollectorPerformance'
-					},
+					// {
+					// 	text: '收费员业绩统计',
+					// 	value: 1,
+					// 	key: 'tollCollectorPerformance'
+					// },
 					{
 						text: '路段泊位统计',
 						value: 2,

+ 1 - 1
pages/index/index.scss

@@ -69,7 +69,7 @@
 				.menu {
 					display: flex;
 					flex-wrap: wrap;
-					padding: 15px 0;
+					padding: 15px 0 0;
 					&-item {
 						width: 25%;
 						margin-bottom: 24px;

+ 4 - 4
pages/index/index.vue

@@ -265,10 +265,10 @@
 			 */
 			jumpPage(url, params, flag) {
 				if (flag) {
-					this.$refs.uToast.show({
-						message: '功能未开发!',
-						type: 'info'
-					})
+					// this.$refs.uToast.show({
+					// 	message: '功能未开发!',
+					// 	type: 'info'
+					// })
 				} else {
 					uni.$u.route({
 						url,