unknown 5 months ago
parent
commit
aa95e346c0
43 changed files with 2283 additions and 618 deletions
  1. 18 14
      .hbuilderx/launch.json
  2. 5 0
      common/index.scss
  3. 17 7
      components/x-form.vue
  4. 10 3
      components/x-humiture.vue
  5. 60 7
      components/x-orderManagement.vue
  6. 65 25
      components/x-statistics.vue
  7. 22 4
      manifest.json
  8. 2 2
      pages/codeLogin.vue
  9. 58 55
      pages/home/index.vue
  10. 8 3
      pages/indexRouter.vue
  11. 2 2
      pages/login.vue
  12. 57 41
      pages/mine/index.vue
  13. 4 2
      pages/order/addWaybill.vue
  14. 168 4
      pages/order/delivery.vue
  15. 833 0
      pages/order/gprint/bluetoolth.js
  16. 13 0
      pages/order/gprint/printUtil-GBK.js
  17. 15 2
      pages/order/gprint/util.js
  18. 245 11
      pages/order/humiture.vue
  19. 48 35
      pages/order/index.vue
  20. 9 1
      pages/order/logisticsDetails.vue
  21. 7 4
      pages/order/orderDetails.vue
  22. 515 286
      pages/order/quantum.vue
  23. 1 1
      pages/register.vue
  24. BIN
      unpackage/cache/apk/__UNI__92DFF97_cm.apk
  25. 1 1
      unpackage/cache/apk/apkurl
  26. 0 0
      unpackage/cache/apk/cmManifestCache.json
  27. 0 0
      unpackage/cache/wgt/__UNI__92DFF97/app-service.js
  28. 0 0
      unpackage/cache/wgt/__UNI__92DFF97/app-view.js
  29. 0 0
      unpackage/cache/wgt/__UNI__92DFF97/manifest.json
  30. BIN
      unpackage/debug/android_debug.apk
  31. 0 0
      unpackage/dist/build/app-plus/app-service.js
  32. 0 0
      unpackage/dist/build/app-plus/app-view.js
  33. 0 0
      unpackage/dist/build/app-plus/manifest.json
  34. 0 0
      unpackage/dist/dev/app-plus/app-service.js
  35. 100 108
      unpackage/dist/dev/app-plus/app-view.js
  36. 0 0
      unpackage/dist/dev/app-plus/manifest.json
  37. BIN
      unpackage/release/apk/__UNI__92DFF97__20240823175431.apk
  38. BIN
      unpackage/release/apk/__UNI__92DFF97__20240826150409.apk
  39. BIN
      unpackage/release/apk/__UNI__92DFF97__20240827154258.apk
  40. BIN
      unpackage/release/apk/__UNI__92DFF97__20240911153716.apk
  41. BIN
      unpackage/release/apk/__UNI__92DFF97__20240914104310.apk
  42. BIN
      unpackage/release/apk/__UNI__92DFF97__20240924100029.apk
  43. BIN
      unpackage/release/apk/__UNI__92DFF97__20240926171517.apk

+ 18 - 14
.hbuilderx/launch.json

@@ -1,16 +1,20 @@
-{ // 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"
-     	},
-     	"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-plus" : {
+                "launchtype" : "local"
+            },
+            "default" : {
+                "launchtype" : "local"
+            },
+            "type" : "uniCloud"
+        },
+        {
+            "playground" : "custom",
+            "type" : "uni-app:app-android"
+        }
     ]
 }

+ 5 - 0
common/index.scss

@@ -111,4 +111,9 @@ page{
 	}
 .home_card_statist	.u-scroll-list__indicator{
 		margin-top: 0px !important;
+}
+.u-popup{
+	.u-fade-enter-active{
+		touch-action: none;
+	}
 }

+ 17 - 7
components/x-form.vue

@@ -31,7 +31,8 @@
 					v-else-if="item.type == 'selectkey' && getCooler()">
 					<view class="card_form_item_selectil frameil" @click="incubatorChange(item)">
 						<view class="title_input_selectil" :class="model[`${item.field}`] ? '' : 'hsColor'">
-							{{model[`${item.field + 'name'}`] || item.placeholder}} {{model[`${item.field}`]}}
+							{{model[`${item.field + 'name'}`] || item.placeholder}}
+							<!-- {{model[`${item.field}`] == 0? '' : model[`${item.field}`]}} -->
 						</view>
 						<u-icon name="arrow-down" size="18px"></u-icon>
 					</view>
@@ -45,18 +46,21 @@
 				</u-form-item>
 			</view>
 		</u-form>
-		<u-popup :show="incubatorShow" closeable @close="close" @open="open">
+		<u-popup :show="incubatorShow" closeable @close="close">
 			<view class="card_incubator">
 				<view class="head_place">选择保温箱</view>
 				<view class="card_search">
 					<u-search placeholder="请输入保温箱名称" v-model="keyword" :showAction="false"
 						@change="searchChange"></u-search>
 				</view>
-				<view style="display: flex;flex-direction: column;" v-if="incubatorData.length > 0">
+				<view class="incubator_roll" v-if="incubatorData.length > 0">
 					<view class="card_title_item" :class="item.name == model.coolerBoxIdname ? 'color_blue' : ''"
 						v-for="(item,index) in incubatorData" :key="index" @click="incubatorClick(item)">
 						{{item.name}}
 					</view>
+					<view class="center_in" style="margin-top: 30rpx;">
+						<u-divider style="width: 350rpx;" text="没有更多了"></u-divider>
+					</view>
 				</view>
 				<view style="margin-bottom: 20px;" v-else>
 					<u-empty mode="list" text="暂无保温箱" marginTop="50"></u-empty>
@@ -181,9 +185,6 @@
 			close() {
 				this.incubatorShow = false
 			},
-			open() {
-
-			},
 			//子组件校验,传递到父组件
 			async validateForm() {
 				let flag = null
@@ -244,7 +245,9 @@
 
 	.card_incubator {
 		min-height: 600rpx;
-		max-height: 900rpx;
+		// max-height: 900rpx;
+		// overflow-y: auto;
+		touch-action: none;
 	}
 
 	.head_place {
@@ -281,4 +284,11 @@
 		-webkit-transform: scaleY(0.5);
 		transform: scaleY(0.5);
 	}
+
+	.incubator_roll {
+		max-height: 700rpx;
+		display: flex;
+		flex-direction: column;
+		overflow-y: auto;
+	}
 </style>

+ 10 - 3
components/x-humiture.vue

@@ -15,6 +15,9 @@
 					<view class="title_item w_wsd">{{item.T_rh || ''}}</view>
 					<view class="title_item w_time">{{item.T_time || ''}}</view>
 				</view>
+				<view class="center_in" v-if="loadingMore">
+					<u-divider :text="loading"></u-divider>
+				</view>
 			</scroll-view>
 		</view>
 		<view v-else style="padding: 30rpx 0rpx;">
@@ -56,7 +59,7 @@
 				currentPage: 1,
 				tIds: [],
 				humitureData: [],
-				loading: ''
+				loading: '加载中',
 			}
 		},
 		mounted() {
@@ -64,7 +67,9 @@
 		},
 		methods: {
 			getlistil(num) {
+				this.loadingMore = true;
 				this.currentPage = 1
+				this.humitureData = []
 				this.getList(num)
 			},
 			getList(tIds) {
@@ -91,7 +96,7 @@
 						if (this.loadingMore == true && data) {
 							this.humitureData = this.humitureData.concat(data);
 						}
-						if (this.humitureData.length < this.pageSize) {
+						if (data.length < this.pageSize) {
 							this.loadingMore = true
 							this.loading = '没有更多了'
 						} else {
@@ -110,7 +115,9 @@
 			},
 			// 滚动加载更多
 			loadMore() {
-				this.getList(this.tIds[0]);
+				if (!this.loadingMore) {
+					this.getList(this.tIds[0]);
+				}
 			}
 		}
 	}

+ 60 - 7
components/x-orderManagement.vue

@@ -26,7 +26,8 @@
 			<view class="title_ordermang"><span>收货电话:</span>{{item.consigneeAddressPhone}}</view>
 			<view class="title_ordermang"><span>下单时间:</span>{{item.orderTime}}</view>
 			<view style="display: flex;">
-				<view class="btn_printil markd10" v-if="item.status == 1 || item.status == 2 || item.status == 3"
+				<view class="btn_printil markd10"
+					v-if="item.status == 1 || item.status == 2 || item.status == 3 || item.status == 9"
 					@click.stop="modifyOrder(item)">
 					<u-button size="small" type="warning" text="修改订单"></u-button>
 				</view>
@@ -37,7 +38,7 @@
 			<view style="display: flex;">
 				<view class="btn_printil markd10" v-if="item.status == 8 && userInfo.userType == 'sys'"
 					@click.stop="sendmail(item)">
-					<u-button size="small" type="primary" text="发送邮件"></u-button>
+					<u-button size="small" type="primary" text="发送温湿度记录PDF"></u-button>
 				</view>
 				<view class="btn_printil markd10" v-if="item.status == 8 && userInfo.userType == 'sys'"
 					@click.stop="humidityRecording(item)">
@@ -45,10 +46,17 @@
 				</view>
 			</view>
 		</view>
+		<u-popup :show="shareShow" mode="center" round="5" closeable @close="shareShow = false">
+			<view style="padding: 0rpx 30rpx 30rpx 30rpx;margin-top: 50rpx; width: 400rpx;">
+				<u-button style="margin: 20rpx 0rpx;" type="success" text="发送邮箱" @click="sendingMailbox"></u-button>
+				<u-button type="primary" text="分享微信好友" @click="shareWechatFriends"></u-button>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
+	const FileShare = uni.requireNativePlugin('life-FileShare');
 	export default {
 		name: 'xOrderManagement',
 		props: {
@@ -63,7 +71,10 @@
 			}
 		},
 		data() {
-			return {}
+			return {
+				shareShow: false,
+				optionList: {},
+			}
 		},
 		mounted() {
 			// console.log(this.userInfo, 26)
@@ -85,7 +96,47 @@
 			},
 			// 发送邮件
 			sendmail(value) {
-				this.$emit('sendmail', value)
+				this.shareShow = true
+				this.optionList = value
+			},
+			// 发送邮箱
+			sendingMailbox() {
+				this.shareShow = false
+				this.$emit('sendmail', this.optionList)
+			},
+			// 分享微信好友
+			shareWechatFriends() {
+				uni.showLoading({
+					title: '获取温湿度记录中,请稍等',
+					mask: true,
+				});
+				this.$api.post('/api/waybill/temperature-pdf-url', {
+					waybillNo: this.optionList.waybillNo,
+				}).then(res => {
+					if (res.code == 200) {
+						let arrData = res.data.split("/");
+						var dtask = plus.downloader.createDownload(res.data, {
+							filename: "_doc/pdf/" + arrData[3]
+						}, function(d, status) {
+							// 下载完成
+							if (status == 200) {
+								FileShare.render({
+									type: "WX", //QQ为QQ,微信为WX,系统默认是SYSTEM,不填写默认SYSTEM
+									filePath: plus.io.convertLocalFileSystemURL(d.filename),
+								}, result => {
+									uni.hideLoading()
+								});
+							} else {
+								console.log("Download failed: " + status);
+							}
+						});
+						dtask.start();
+					}
+					uni.hideLoading()
+				}).catch(()=>{
+					uni.hideLoading()
+				})
+				return
 			},
 			// 修改订单
 			modifyOrder(value) {
@@ -114,7 +165,9 @@
 							return '待装箱'
 						} else if (value == 10) {
 							return '已装箱'
-						} else {
+						} else if (value == 11) {
+							return '已出箱'
+						} else if (value == 7) {
 							return '已出库'
 						}
 					} else if (this.userInfo.type == 3) {
@@ -129,7 +182,7 @@
 							return '已装车'
 						} else if (value == 6) {
 							return '已下车'
-						} else {
+						} else if (value == 8) {
 							return '已签收'
 						}
 					}
@@ -138,7 +191,7 @@
 						return '未发货'
 					} else if (value == 4 || value == 5 || value == 6 || value == 7) {
 						return '已发货'
-					} else {
+					} else if (value == 8) {
 						return '已签收'
 					}
 				}

+ 65 - 25
components/x-statistics.vue

@@ -1,26 +1,29 @@
 <template>
 	<!-- 首页统计 -->
 	<view class="home_card_statist">
-		<u-scroll-list :indicator="list.length > 5 ? true : false" style="width: 100%;">
-			<view :class="list.length > 5 ? 'card_two_lines' : 'card_left_lines'">
-				<view class="card_item_home"
-					:style="{width:(list.length > 5? '300rpx' : 'calc(50% - 40rpx)'),margin:(list.length > 5? '0rpx 0rpx 20rpx 20rpx' : '20rpx 20rpx 0rpx 20rpx')}"
-					v-for="(item,index) in list" :key="index" @click="goOrder(index)">
-					<view class="home_head">
-						<view class="home_line" :style="{backgroundColor:item.color,}"></view>
-						<view class="home_item_title">{{item.value || 0}}</view>
-					</view>
-					<view class="item_subheading">{{item.title}}</view>
-					<view class="home_bottom_item">
-						<view class="home_right_icon center_in">
-							<u-icon name="arrow-right" size="15" color="#fff"></u-icon>
-						</view>
-						<span :style="{color: item.color}" class="iconfont home_icon_image" :class="item.icon"></span>
+		<!-- <u-scroll-list :indicator="list.length > 5 ? true : false" style="width: 100%;"> -->
+		<!-- :class="list.length > 5 ? 'card_two_lines' : 'card_left_lines'" -->
+		<view class="card_statistics_head">
+			<view class="card_item_home" :style="{width:(list.length > 5? '216rpx' : 'calc(50% - 40rpx)')}"
+				v-for="(item,index) in list" :key="index" @click="goOrder(index)">
+				<view class="home_head">
+					<view class="home_line" :style="{backgroundColor:item.color,}"></view>
+					<view class="home_item_title">{{item.value || 0}}</view>
+				</view>
+				<view class="item_subheading">{{item.title}}</view>
+				<view class="home_bottom_item">
+					<view class="home_right_icon center_in">
+						<u-icon name="arrow-right" size="14" color="#fff"></u-icon>
 					</view>
+					<span :style="{color: item.color}" class="iconfont home_icon_image" :class="item.icon"></span>
 				</view>
-				<view style="width: 20rpx;height: 100%;" v-if="list.length > 5"></view>
 			</view>
-		</u-scroll-list>
+			<view style="width: 216rpx;"></view>
+			<view style="width: 216rpx;"></view>
+			<view style="width: 216rpx;"></view>
+			<!-- <view style="width: 20rpx;height: 100%;" v-if="list.length > 5"></view> -->
+		</view>
+		<!-- </u-scroll-list> -->
 	</view>
 </template>
 
@@ -42,10 +45,10 @@
 				list: [],
 				list1: [{
 					sign: 0,
-					id: 'detailsil',
+					id: 'truck',
 					title: '全部',
 					icon: 'icon-cheliangxinxi',
-					color: '#4bc7fc',
+					color: '#fece56',
 					value: null,
 				}, {
 					sign: 9,
@@ -62,6 +65,13 @@
 					color: '#9ddd54',
 					value: null,
 				}, {
+					sign: 11,
+					id: 'signfor',
+					title: '已出箱',
+					icon: 'icon-boxed',
+					color: '#9ddd54',
+					value: null,
+				}, {
 					sign: 3,
 					id: 'truck',
 					title: '未入库',
@@ -82,8 +92,22 @@
 					icon: 'icon-yidaoda',
 					color: '#1cc723',
 					value: null,
+				}, {
+					sign: 8,
+					id: 'add',
+					title: '已签收',
+					icon: 'icon-qianshou_fill',
+					color: '#1cc723',
+					value: null,
 				}],
 				list2: [{
+					sign: 0,
+					id: 'truck',
+					title: '全部',
+					icon: 'icon-cheliangxinxi',
+					color: '#fece56',
+					value: null,
+				}, {
 					sign: 9,
 					id: 'truck',
 					title: '待装箱',
@@ -98,6 +122,13 @@
 					color: '#9ddd54',
 					value: null,
 				}, {
+					sign: 11,
+					id: 'signfor',
+					title: '已出箱',
+					icon: 'icon-boxed',
+					color: '#9ddd54',
+					value: null,
+				}, {
 					sign: 2,
 					id: 'truck',
 					title: '未装车',
@@ -191,9 +222,9 @@
 			goOrder(index) {
 				let num = index
 				// console.log(this.userType,123)
-				if (this.userType == 2) {
-					num = num + 1
-				}
+				// if (this.userType == 2) {
+				// 	num = num + 1
+				// }
 				if (this.token) {
 					uni.navigateTo({
 						url: '/pages/order/index?current=' + num
@@ -214,8 +245,15 @@
 		justify-content: space-evenly;
 	}
 
+	.card_statistics_head {
+		display: flex;
+		flex-direction: row;
+		flex-wrap: wrap;
+		justify-content: space-evenly;
+	}
+
 	.home_head {
-		margin-top: 30rpx;
+		margin-top: 20rpx;
 		display: flex;
 		align-items: center;
 	}
@@ -258,15 +296,17 @@
 
 	.card_item_home {
 		flex: none;
+		height: auto;
 		// margin: 0rpx 20rpx 20rpx 20rpx;
 		// width: calc(50% - 40rpx);
 		// width: 300rpx;
 		background-color: #fff;
 		border-radius: 20rpx;
+		margin-bottom: 20rpx;
 	}
 
 	.home_bottom_item {
-		margin: 30rpx;
+		margin: 20rpx;
 		display: flex;
 		justify-content: space-between;
 		align-items: baseline;
@@ -280,6 +320,6 @@
 	}
 
 	.home_icon_image {
-		font-size: 70rpx;
+		font-size: 56rpx;
 	}
 </style>

+ 22 - 4
manifest.json

@@ -2,8 +2,8 @@
     "name" : "冷链物流",
     "appid" : "__UNI__92DFF97",
     "description" : "",
-    "versionName" : "1.0.7",
-    "versionCode" : 107,
+    "versionName" : "1.1.3",
+    "versionCode" : 113,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
@@ -21,7 +21,8 @@
             "Maps" : {},
             "Bluetooth" : {},
             "Camera" : {},
-            "Barcode" : {}
+            "Barcode" : {},
+            "Share" : {}
         },
         /* 应用发布信息 */
         "distribute" : {
@@ -60,7 +61,8 @@
                         "appkey_android" : "042f12d3f6f07494669e8eef6ebd301a"
                     }
                 },
-                "ad" : {}
+                "ad" : {},
+                "share" : {}
             },
             "icons" : {
                 "android" : {
@@ -94,6 +96,22 @@
                     }
                 }
             }
+        },
+        "nativePlugins" : {
+            "life-FileShare" : {
+                "__plugin_info__" : {
+                    "name" : "安卓ios分享任意类型文件",
+                    "description" : "ios和安卓任意分享文件",
+                    "platforms" : "Android,iOS",
+                    "url" : "https://ext.dcloud.net.cn/plugin?id=2307",
+                    "android_package_name" : "uni.UNI92DFF97",
+                    "ios_bundle_id" : "",
+                    "isCloud" : true,
+                    "bought" : 1,
+                    "pid" : "2307",
+                    "parameters" : {}
+                }
+            }
         }
     },
     /* 快应用特有相关 */

+ 2 - 2
pages/codeLogin.vue

@@ -5,7 +5,7 @@
 		<view class="card_login">
 			<view class="card_head_logo">
 				<image class="mine_image" src="../static/logo.png" mode=""></image>
-				<view class="welcome_title">欢迎登录宝智达冷链运输</view>
+				<view class="welcome_title">欢迎登录茂坤冷链运输</view>
 			</view>
 			<u-form labelPosition="left" :model="formList" :rules="rules" ref="uForm">
 				<u-form-item label="手机号" prop="phone" labelWidth="80" borderBottom ref="item1">
@@ -34,7 +34,7 @@
 				</view>
 				<view class="agreement_title">我已阅读并同意<span class="protocol_title">《用户协议》</span>、<span
 						class="protocol_title">《隐私政策》</span>,
-					并授权宝智达冷链运输使用该宝智达冷链运输账号信息(如昵称、头像、收货地址)进行统一管理
+					并授权茂坤冷链运输使用该茂坤冷链运输账号信息(如昵称、头像、收货地址)进行统一管理
 				</view>
 			</view>
 			<view class="card_btn">

+ 58 - 55
pages/home/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<!-- 首页 -->
-	<view class="card_index_bgc">
+	<view class="card_index_bgc" :style="{paddingTop:height + 'px'}">
 		<view class="company_name" v-if="userInfo.dept">{{userInfo.dept.name || ''}}</view>
 		<x-statistics :userType="homeUserType" :orderStatistics="orderStatistics"></x-statistics>
 		<view class="card_operate">
@@ -17,6 +17,10 @@
 <script>
 	export default {
 		props: {
+			height: {
+				type: [String,Number],
+				default: () => '',
+			},
 			token: {
 				type: String,
 				default: () => '',
@@ -35,58 +39,57 @@
 				homeUserType: 1,
 				tableList: [],
 				partitionList: [{
-						id: 'detailsil',
-						title: '车辆信息',
-						icon: 'icon-cheliangxinxi',
-						color: '#4bc7fc',
-					}, {
-						id: 'truck',
-						title: '扫码装车',
-						icon: 'icon-truck',
-						color: '#fece56',
-					},
-					{
-						id: 'encasement',
-						title: '扫码装箱',
-						icon: 'icon-fankudengji',
-						color: '#fe880e',
-					},
-					{
-						id: 'signfor',
-						title: '扫码签收',
-						icon: 'icon-yidaoda',
-						color: '#9ddd54',
-					}, {
-						id: 'add',
-						title: '添加运单',
-						icon: 'icon-tianjiadingdan',
-						color: '#1cc723',
-					}
-				],
+					id: 'detailsil',
+					title: '车辆信息',
+					icon: 'icon-cheliangxinxi',
+					color: '#4bc7fc',
+				}, {
+					id: 'truck',
+					title: '扫码装车',
+					icon: 'icon-truck',
+					color: '#fece56',
+				}, {
+					id: 'encasement',
+					title: '扫码装箱',
+					icon: 'icon-fankudengji',
+					color: '#fe880e',
+				}, {
+					id: 'signfor',
+					title: '扫码签收',
+					icon: 'icon-yidaoda',
+					color: '#9ddd54',
+				}, {
+					id: 'add',
+					title: '添加运单',
+					icon: 'icon-tianjiadingdan',
+					color: '#1cc723',
+				}],
 				warehouseList: [{
-						id: 'details',
-						title: '仓库信息',
-						icon: 'icon-lenglianku',
-						color: '#4bc7fc',
-					}, {
-						id: 'put',
-						title: '扫码入库',
-						icon: 'icon-fankudengji',
-						color: '#9ddd54',
-					},
-					{
-						id: 'encasement',
-						title: '扫码装箱',
-						icon: 'icon-chukudan',
-						color: '#fece56',
-					},
-					{
-						id: 'add',
-						title: '添加运单',
-						icon: 'icon-tianjiadingdan',
-						color: '#1cc723',
-					}
-				],
+					id: 'details',
+					title: '仓库信息',
+					icon: 'icon-lenglianku',
+					color: '#4bc7fc',
+				}, {
+					id: 'put',
+					title: '扫码入库',
+					icon: 'icon-fankudengji',
+					color: '#9ddd54',
+				}, {
+					id: 'encasement',
+					title: '扫码装箱',
+					icon: 'icon-chukudan',
+					color: '#fece56',
+				}, {
+					id: 'signfor',
+					title: '扫码签收',
+					icon: 'icon-yidaoda',
+					color: '#9ddd54',
+				}, {
+					id: 'add',
+					title: '添加运单',
+					icon: 'icon-tianjiadingdan',
+					color: '#1cc723',
+				}],
 				userList: [{
 					id: 'add',
 					title: '添加运单',
@@ -141,14 +144,14 @@
 
 <style lang="scss">
 	.card_index_bgc {
-		padding-top: constant(safe-area-inset-top);
-		padding-top: env(safe-area-inset-top);
+		// padding-top: constant(safe-area-inset-top);
+		// padding-top: env(safe-area-inset-top);
 		background-image: linear-gradient(#a9e3f1, #f3f4f6);
 	}
 
 	.company_name {
 		font-size: 36rpx;
-		padding: 50rpx 30rpx 20rpx 30rpx;
+		padding: 30rpx 30rpx 20rpx 30rpx;
 		font-weight: 600;
 	}
 

+ 8 - 3
pages/indexRouter.vue

@@ -1,8 +1,8 @@
 <template>
 	<view>
-		<Home :token="token" :userInfo="userInfo" :orderStatistics="orderStatistics" v-if="nowchos === 0"
-			:key="Math.random()"></Home>
-		<Mine ref="mine" :token="token" :userInfo="userInfo" v-else-if="nowchos === 1"></Mine>
+		<Home :height="height" :token="token" :userInfo="userInfo" :orderStatistics="orderStatistics"
+			v-if="nowchos === 0" :key="Math.random()"></Home>
+		<Mine :height="height" ref="mine" :token="token" :userInfo="userInfo" v-else-if="nowchos === 1"></Mine>
 		<view class="bottomboxs">
 			<x-navbottom :nowchos='nowchos' @botomchos='botomchos'></x-navbottom>
 		</view>
@@ -25,8 +25,13 @@
 				token: '',
 				userInfo: {},
 				orderStatistics: {},
+				height: '',
 			}
 		},
+		mounted() {
+			const arr = uni.getSystemInfoSync().statusBarHeight
+			this.height = arr
+		},
 		onShow() {
 			var token = this.$cache.getToken()
 			this.token = token

+ 2 - 2
pages/login.vue

@@ -5,7 +5,7 @@
 		<view class="card_login">
 			<view class="card_head_logo">
 				<image class="mine_image" src="../static/logo.png" mode=""></image>
-				<view class="welcome_title">欢迎登录宝智达冷链运输</view>
+				<view class="welcome_title">欢迎登录茂坤冷链运输</view>
 			</view>
 			<u--form labelPosition="left" :model="formList" :rules="rules" ref="uForm">
 				<u-form-item label="账号" prop="username" labelWidth="50" borderBottom ref="item1">
@@ -41,7 +41,7 @@
 				</view>
 				<view class="agreement_title">我已阅读并同意<span class="protocol_title">《用户协议》</span>、<span
 						class="protocol_title">《隐私政策》</span>,
-					并授权宝智达冷链运输使用该宝智达冷链运输账号信息(如昵称、头像、收货地址)进行统一管理
+					并授权茂坤冷链运输使用该茂坤冷链运输账号信息(如昵称、头像、收货地址)进行统一管理
 				</view>
 			</view>
 			<view class="card_btn">

+ 57 - 41
pages/mine/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<!-- 我的 -->
-	<view class="safeDistance">
-		<view style="padding: 20rpx;">
+	<view class="safeDistance" :style="{paddingTop:height + 'px'}">
+		<view style="padding: 10rpx 20rpx 20rpx 20rpx;">
 			<view class="card_mine">
 				<view class="card_avatar" v-if="token != ''">
 					<image class="mine_image" src="../../static/portrait.png" mode=""></image>
@@ -92,6 +92,10 @@
 	const ENV = require('../../.env.js')
 	export default {
 		props: {
+			height: {
+				type: [String,Number],
+				default: () => '',
+			},
 			token: {
 				type: String,
 				default: () => '',
@@ -120,6 +124,11 @@
 					colorBg: '#9ddd54',
 					bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
 				}, {
+					title: '已出箱',
+					icon: 'icon-boxed',
+					colorBg: '#9ddd54',
+					bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
+				}, {
 					title: '未入库',
 					icon: 'icon-chukudan',
 					colorBg: '#fe880e',
@@ -134,46 +143,53 @@
 					icon: 'icon-yidaoda',
 					colorBg: '#9ddd54',
 					bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
+				}, {
+					title: '已签收',
+					icon: 'icon-qianshou_fill',
+					colorBg: '#1cc723',
+					bgColor: 'linear-gradient(to right, #54ef5a, #1cc723)',
 				}],
 				list1: [{
-						title: '全部',
-						icon: 'icon-dingdan',
-						colorBg: '#4bc7fc',
-						bgColor: 'linear-gradient(to right, #84d4f6, #4bc7fc)',
-					}, {
-						title: '待装箱',
-						icon: 'icon-bepacked',
-						colorBg: '#db8e3e',
-						bgColor: 'linear-gradient(to right, #f6d445, #fecb0e)',
-					}, {
-						title: '已装箱',
-						icon: 'icon-boxed',
-						colorBg: '#9ddd54',
-						bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
-					}, {
-						title: '未装车',
-						icon: 'icon-xiehuofei',
-						colorBg: '#fe880e',
-						bgColor: 'linear-gradient(to right, #f69f45, #fe880e)',
-					}, {
-						title: '已装车',
-						icon: 'icon-yizhuangche',
-						colorBg: '#fece56',
-						bgColor: 'linear-gradient(to right, #f3d485, #fece56)',
-					},
-					{
-						title: '已下车',
-						icon: 'icon-xiehuo',
-						colorBg: '#9ddd54',
-						bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
-					},
-					{
-						title: '已签收',
-						icon: 'icon-qianshou_fill',
-						colorBg: '#1cc723',
-						bgColor: 'linear-gradient(to right, #54ef5a, #1cc723)',
-					}
-				],
+					title: '全部',
+					icon: 'icon-dingdan',
+					colorBg: '#4bc7fc',
+					bgColor: 'linear-gradient(to right, #84d4f6, #4bc7fc)',
+				}, {
+					title: '待装箱',
+					icon: 'icon-bepacked',
+					colorBg: '#db8e3e',
+					bgColor: 'linear-gradient(to right, #f6d445, #fecb0e)',
+				}, {
+					title: '已装箱',
+					icon: 'icon-boxed',
+					colorBg: '#9ddd54',
+					bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
+				}, {
+					title: '已出箱',
+					icon: 'icon-boxed',
+					colorBg: '#9ddd54',
+					bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
+				}, {
+					title: '未装车',
+					icon: 'icon-xiehuofei',
+					colorBg: '#fe880e',
+					bgColor: 'linear-gradient(to right, #f69f45, #fe880e)',
+				}, {
+					title: '已装车',
+					icon: 'icon-yizhuangche',
+					colorBg: '#fece56',
+					bgColor: 'linear-gradient(to right, #f3d485, #fece56)',
+				}, {
+					title: '已下车',
+					icon: 'icon-xiehuo',
+					colorBg: '#9ddd54',
+					bgColor: 'linear-gradient(to right, #b9f377, #9ddd54)',
+				}, {
+					title: '已签收',
+					icon: 'icon-qianshou_fill',
+					colorBg: '#1cc723',
+					bgColor: 'linear-gradient(to right, #54ef5a, #1cc723)',
+				}],
 				list2: [{
 					title: '全部',
 					icon: 'icon-dingdan',
@@ -363,7 +379,7 @@
 	}
 
 	.card_mine {
-		margin-top: 30rpx;
+		margin-top: 10rpx;
 		padding: 0rpx 30rpx;
 		background-color: #fff;
 		border-radius: 20rpx;

+ 4 - 2
pages/order/addWaybill.vue

@@ -38,7 +38,7 @@
 				goodsModel: {
 					temperatureInterval: '',
 					deliveryCondition: '',
-					coolerBoxId: '',
+					coolerBoxId: 0,
 					coolerBoxIdname: '',
 					cargoType: '',
 					quantity: '',
@@ -122,6 +122,8 @@
 				this.goodsModel.remark = orderList.remark
 				this.goodsModel.customerName = orderList.customerName
 				this.goodsModel.id = orderList.id
+				this.goodsModel.coolerBoxId = orderList.coolerBox.id
+				this.goodsModel.coolerBoxIdname = orderList.coolerBox.name
 			}
 		},
 		mounted() {
@@ -129,7 +131,7 @@
 			this.userInfo = userInfo
 		},
 		methods: {
-			// tianjia运单
+			// 添加运单
 			async printWaybill() {
 				let flag = await this.$refs['sender'].validateForm();
 				let flag1 = await this.$refs['recipients'].validateForm();

+ 168 - 4
pages/order/delivery.vue

@@ -7,6 +7,15 @@
 				<view class="details_title">{{getTitle(navTitle)}} <span class="line_title">*</span></view>
 				<uni-datetime-picker type="datetime" :start="start" :end="end" v-model="valueTime" />
 			</view>
+			<view class="card_search" v-if="navTitle == '扫码装箱'">
+				<view class="details_title">保温箱 <span class="line_title">*</span></view>
+				<view class="card_form_item_selectil frameil" @click="incubatorChange">
+					<view class="title_input_selectil" :class="incubatorName ? '' : 'hsColor'">
+						{{incubatorName || '选择保温箱'}}
+					</view>
+					<u-icon name="arrow-down" size="18px"></u-icon>
+				</view>
+			</view>
 			<view class="card_search">
 				<view class="details_title">运单号 <span class="line_title">*</span></view>
 				<view class="card_input">
@@ -40,6 +49,7 @@
 				</view>
 			</view>
 			<view v-else>
+				<view style="color: #2979ff;font-size: 30rpx;" @click="examine">查看温湿度记录</view>
 				<view class="card_sign_in">
 					<view class="details_title1">运单签收图片 <span class="line_title">*</span></view>
 					<view>
@@ -68,6 +78,24 @@
 					@click="submit">提交</u-button>
 			</view>
 		</view>
+		<u-popup :show="incubatorShow" closeable @close="close">
+			<view class="card_incubator">
+				<view class="head_place">选择保温箱</view>
+				<view class="card_search_il">
+					<u-search placeholder="请输入保温箱名称" v-model="keyword" :showAction="false"
+						@change="searchChange"></u-search>
+				</view>
+				<view style="display: flex;flex-direction: column;" v-if="incubatorData.length > 0">
+					<view class="card_title_item" :class="item.name == incubatorName ? 'color_blue' : ''"
+						v-for="(item,index) in incubatorData" :key="index" @click="incubatorClick(item)">
+						{{item.name}}
+					</view>
+				</view>
+				<view style="margin-bottom: 20px;" v-else>
+					<u-empty mode="list" text="暂无保温箱" marginTop="50"></u-empty>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -88,6 +116,11 @@
 				fileList1: [],
 				fileList2: [],
 				fileList3: [],
+				keyword: '',
+				incubatorShow: false,
+				incubatorData: [],
+				incubator: null,
+				incubatorName: '',
 			}
 		},
 		computed: {
@@ -129,7 +162,11 @@
 							this.scanCodes('/api/waybill/car-in')
 						} else if (this.selectiveType == 'encasement') {
 							// 扫码装箱
-							this.scanCodes('/api/waybill/cooler-box-in')
+							if (this.incubator) {
+								this.scanCodes('/api/waybill/cooler-box-in')
+							} else {
+								uni.$u.toast('请选择保温箱')
+							}
 						} else if (this.selectiveType == 'unload') {
 							// 扫码下车
 							this.scanCodes('/api/waybill/car-out')
@@ -159,7 +196,8 @@
 				uni.showLoading();
 				this.$api.post(url, {
 					startTime: this.valueTime,
-					waybillNoList: this.list
+					waybillNoList: this.list,
+					coolerBoxId: this.incubator,
 				}).then(res => {
 					if (res.code == 200) {
 						this.frequencyCoding = ''
@@ -334,7 +372,45 @@
 					num = `0${num}`
 				}
 				return num
-			}
+			},
+			// 保温箱选择
+			incubatorChange() {
+				this.incubatorShow = true
+				this.$api.get('/api/cooler-box', {
+					page: 1,
+					pageSize: 999,
+					isBind: true,
+					name: this.keyword,
+				}).then(res => {
+					if (res.code == 200) {
+						this.incubatorData = res.data.list
+					}
+				})
+			},
+			// 选择保温箱
+			incubatorClick(event) {
+				this.incubator = event.id
+				this.incubatorName = event.name
+				this.incubatorShow = false
+			},
+			// 搜索
+			searchChange() {
+				this.incubatorData = []
+				this.incubatorChange()
+			},
+			// 查看温湿度记录
+			examine() {
+				if (this.frequencyCoding) {
+					uni.navigateTo({
+						url: '/pages/order/humiture?waybillNo=' + this.frequencyCoding
+					});
+				} else {
+					uni.$u.toast('请先扫描运单号')
+				}
+			},
+			close() {
+				this.incubatorShow = false
+			},
 		}
 	}
 </script>
@@ -349,15 +425,38 @@
 	}
 
 	.details_title {
+		position: relative;
+		width: 140rpx;
 		flex: none;
 		color: #333;
 		font-size: 32rpx;
 		font-weight: 500;
 		margin-bottom: 10rpx;
 		margin-right: 15rpx;
+		padding-left: 15rpx;
+	}
+
+	.card_form_item_selectil {
+		width: 100%;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-between;
+		padding: 6px 9px;
+		height: 52rpx;
+	}
+
+	.title_input_selectil {
+		font-size: 30rpx;
+		// width: 100%;
+	}
+
+	.hsColor {
+		color: rgb(192, 196, 204);
 	}
 
 	.details_title1 {
+		position: relative;
 		width: 140rpx;
 		text-align: center;
 		flex: none;
@@ -366,6 +465,7 @@
 		font-weight: 500;
 		margin-bottom: 10rpx;
 		margin-right: 15rpx;
+		padding-left: 15rpx;
 	}
 
 	.card_time {
@@ -401,10 +501,13 @@
 
 	.card_input {
 		width: 100%;
-		margin-left: 30rpx;
+		// margin-left: 30rpx;
 	}
 
 	.line_title {
+		position: absolute;
+		top: 0rpx;
+		left: 0rpx;
 		color: red;
 	}
 
@@ -492,4 +595,65 @@
 		border-color: #e5e5e5 !important;
 		border-style: solid;
 	}
+
+
+	.card_incubator {
+		min-height: 600rpx;
+		max-height: 900rpx;
+	}
+
+	.head_place {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		padding: 20rpx;
+	}
+
+	.card_search_il {
+		margin: 20rpx;
+	}
+
+	.card_title_item {
+		position: relative;
+		padding: 30rpx;
+		// border-bottom: 1rpx solid #dadbde;
+	}
+
+	.color_blue {
+		color: #2979ff;
+	}
+
+	.card_title_item:before {
+		content: " ";
+		position: absolute;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		height: 1px;
+		border-top: 1px solid #e7e6e4;
+		-webkit-transform-origin: 0 0;
+		transform-origin: 0 0;
+		-webkit-transform: scaleY(0.5);
+		transform: scaleY(0.5);
+	}
+
+	// 伪元素1rpx边框
+	.frameil {
+		position: relative; //重要
+	}
+
+	.frameil::after {
+		position: absolute;
+		content: '';
+		border: 2rpx solid #dadbde;
+		width: 200%;
+		height: 200%;
+		top: 0;
+		left: 0;
+		transform: scale(0.5);
+		transform-origin: 0 0;
+		pointer-events: none;
+		border-radius: 20rpx;
+		/* 使伪元素不会阻止鼠标事件 */
+	}
 </style>

File diff suppressed because it is too large
+ 833 - 0
pages/order/gprint/bluetoolth.js


File diff suppressed because it is too large
+ 13 - 0
pages/order/gprint/printUtil-GBK.js


+ 15 - 2
pages/order/gprint/util.js

@@ -36,7 +36,8 @@ function convert4to1(res) {
 function convert8to1(arr) {
 	let data = [];
 	for (let k = 0; k < arr.length; k += 8) {
-		let temp = arr[k] * 128 + arr[k + 1] * 64 + arr[k + 2] * 32 + arr[k + 3] * 16 + arr[k + 4] * 8 + arr[k + 5] * 4 +
+		let temp = arr[k] * 128 + arr[k + 1] * 64 + arr[k + 2] * 32 + arr[k + 3] * 16 + arr[k + 4] * 8 + arr[k + 5] *
+			4 +
 			arr[k + 6] * 2 + arr[k + 7] * 1
 		data.push(temp);
 	}
@@ -58,9 +59,21 @@ function zip_image(res) {
 	let data = convert8to1(arr);
 	return data;
 }
+//汉字转码
+function hexStringToArrayBuffer(str) {
+	const buffer = new ArrayBuffer((str.length / 2) + 1)
+	const dataView = new DataView(buffer)
+	for (var i = 0; i < str.length / 2; i++) {
+		var temp = parseInt(str[i * 2] + str[i * 2 + 1], 16)
+		dataView.setUint8(i, temp)
+	}
+	dataView.setUint8((str.length / 2), 0x0a)
+	return buffer;
+}
 
 module.exports = {
+	hexStringToArrayBuffer: hexStringToArrayBuffer,
 	formatTime: formatTime,
 	toArrayBuffer: toArrayBuffer,
 	zip_image: zip_image,
-}
+}

+ 245 - 11
pages/order/humiture.vue

@@ -14,7 +14,10 @@
 			<view v-if="humitureList.length > 0">
 				<view class="card_particulars" v-for="(item,index) in humitureList" :key="index">
 					<view class="card_describe">
-						<view class="describe_title">{{item.title}}</view>
+						<view @click="selectChangeil(item)">
+							<x-checkbox :label="item.title" :isChecked="item.isChecked"></x-checkbox>
+						</view>
+						<!-- <view class="describe_title">{{item.title}}</view> -->
 						<!-- <view class="describe_time">{{item.startTime}}</view>
 						<view class="describe_time">{{item.endTime}}</view> -->
 					</view>
@@ -31,7 +34,7 @@
 					</view>
 					<view v-show="item.collapseil">
 						<x-humiture ref="humiture" :startTime="item.datetimeRange[0]" :endTime="item.datetimeRange[1]"
-							:taskId="item.id" :waybillNo="orderList.waybillNo" :current="item.presentNum"
+							:taskId="item.id" :waybillNo="waybillNo" :current="item.presentNum"
 							:probeList="item.deviceSensorList"></x-humiture>
 					</view>
 				</view>
@@ -40,13 +43,51 @@
 				<u-empty mode="data" text="当前没有温湿度记录"></u-empty>
 			</view>
 		</view>
+		<view style="width: 100%;height: 230rpx;"></view>
+		<view class="card_btn"
+			v-if="humitureList.length > 0 && waybillData.status != 1 || waybillData.status != 2 || waybillData.status != 3 || waybillData.status != 9">
+			<u-button style="margin-bottom: 20rpx;" type="primary"
+				@click="humidityRecording('send')">发送温湿度记录PDF</u-button>
+			<u-button style="margin-bottom: 20rpx;" type="success"
+				@click="humidityRecording('print')">打印温湿度记录</u-button>
+		</view>
+		<u-modal :show="show" confirmText="停止" showCancelButton :buttonReverse="true" @cancel="cancel"
+			@confirm="confirm">
+			<view class="slot-content">
+				<view>{{stoprecording}}</view>
+			</view>
+		</u-modal>
+		<u-popup :show="shareShow" mode="center" round="5" closeable @close="shareShow = false">
+			<view style="padding: 0rpx 30rpx 30rpx 30rpx;margin-top: 50rpx; width: 400rpx;">
+				<u-button style="margin: 20rpx 0rpx;" type="success" text="发送邮箱" @click="sendingMailbox"></u-button>
+				<u-button type="primary" text="分享微信好友" @click="shareWechatFriends"></u-button>
+			</view>
+		</u-popup>
+		<u-popup :show="emailShow" mode="center" round="5" closeable @close="emailShow = false">
+			<view style="padding: 30rpx;">
+				<view style="margin-top: 20rpx;width: 600rpx;">
+					<view class="email_title" style="margin-bottom: 10rpx;">运单号:{{waybillNo}}</view>
+					<view class="card_email">
+						<span class="email_title">邮箱地址:</span>
+						<view style="margin-top: 20rpx;">
+							<u--input v-model="email" placeholder="请输入邮箱" border="surround"></u--input>
+						</view>
+					</view>
+				</view>
+				<view style="margin-top: 20rpx;">
+					<u-button type="primary" :loading="sendLoading" text="发送" @click="confirmSend"></u-button>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
+	const FileShare = uni.requireNativePlugin('life-FileShare');
 	export default {
 		data() {
 			return {
+				show: false,
 				orderList: {},
 				humitureList: [],
 				userType: '',
@@ -135,8 +176,23 @@
 					},
 				},
 				datetimeRange: [],
+				waybillNo: '',
+				waybillData: [],
+				shareShow: false,
+				stoprecording: '打印前需停止记录,是否继续?',
+				humitureType: '',
+				checkboxValue: [],
+				emailShow: false,
+				email: '',
+				sendLoading: false,
+				humidityFlag: false,
 			}
 		},
+		onLoad(option) {
+			this.waybillNo = option.waybillNo
+			// 获取运单详情
+			this.waybillDetails(option.waybillNo)
+		},
 		mounted() {
 			var userInfo = this.$cache.getCache('userInfo')
 			this.userType = userInfo.userType
@@ -151,16 +207,22 @@
 		methods: {
 			getList() {
 				this.$api.get('/api/waybill-task', {
-					waybillNo: this.orderList.waybillNo,
+					waybillNo: this.waybillNo,
 				}).then(res => {
 					if (res.code == 200) {
 						this.humitureList = JSON.parse(JSON.stringify(res.data.list))
 						this.humitureList.forEach((item, index) => {
+							this.checkboxValue.push(item.id)
+							item.isChecked = true
 							item.title = ''
 							item.collapseil = false
 							item.datetimeRange = []
 							item.datetimeRange.push(item.startTime)
-							item.datetimeRange.push(item.endTime)
+							if (item.endTime) {
+								item.datetimeRange.push(item.endTime)
+							} else {
+								item.datetimeRange.push(this.getDateTime(new Date()))
+							}
 							if (item.car.id) {
 								item.title = item.car.carNo
 							} else if (item.warehouse.id) {
@@ -172,6 +234,146 @@
 					}
 				})
 			},
+			// 获取运单详情
+			waybillDetails(waybillNo) {
+				this.$api.get('/api/waybill/' + waybillNo).then(res => {
+					if (res.code == 200) {
+						this.waybillData = res.data
+					}
+				})
+			},
+			// 发送邮箱
+			sendingMailbox() {
+				this.shareShow = false
+				this.emailShow = true
+			},
+			// 分享微信好友
+			shareWechatFriends() {
+				uni.showLoading({
+					title: '获取温湿度记录中,请稍等',
+					mask: true,
+				});
+				this.$api.post('/api/waybill/temperature-pdf-url', {
+					waybillNo: this.waybillNo,
+					waybillTaskIds: this.checkboxValue,
+				}).then(res => {
+					if (res.code == 200) {
+						let arrData = res.data.split("/");
+						var dtask = plus.downloader.createDownload(res.data, {
+							filename: "_doc/pdf/" + arrData[3]
+						}, function(d, status) {
+							// 下载完成
+							if (status == 200) {
+								FileShare.render({
+									type: "WX", //QQ为QQ,微信为WX,系统默认是SYSTEM,不填写默认SYSTEM
+									filePath: plus.io.convertLocalFileSystemURL(d.filename),
+								}, result => {
+									uni.hideLoading()
+								});
+							} else {
+								console.log("Download failed: " + status);
+							}
+						});
+						dtask.start();
+					}
+					uni.hideLoading()
+				}).catch(() => {
+					uni.hideLoading()
+				})
+				return
+			},
+			// 发送邮箱
+			confirmSend() {
+				if (this.email) {
+					let flag = validateEmail(this.email)
+					if (flag) {
+						if (!this.sendLoading) {
+							this.sendLoading = true
+							let arrTo = []
+							arrTo.push(this.email)
+							this.$api.post('/api/waybill/send-mail', {
+								waybillNo: this.waybillNo,
+								humidityShow: this.humidityFlag,
+								to: arrTo,
+								waybillTaskIds: this.checkboxValue,
+							}).then(res => {
+								if (res.code == 200) {
+									uni.$u.toast(res.msg)
+									this.email = ''
+									this.emailShow = false
+								}
+								this.sendLoading = false
+							}).catch(() => {
+								this.sendLoading = false
+							})
+						}
+					} else {
+						uni.$u.toast('邮箱格式错误')
+					}
+				} else {
+					uni.$u.toast('请输入邮箱')
+				}
+				// 如果邮箱格式正确,输出 true,否则输出 false
+				function validateEmail(email) {
+					const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
+					return emailRegex.test(email);
+				}
+			},
+			// 打印温湿度记录
+			humidityRecording(type) {
+				this.humitureType = type
+				if ([4, 5, 10].includes(this.waybillData.status)) {
+					if (type == 'send') {
+						this.stoprecording = '发送温湿度记录前需停止记录,是否继续?'
+					} else {
+						this.stoprecording = '打印前需停止记录,是否继续?'
+					}
+					this.show = true
+				} else {
+					if (type == 'send') {
+						this.shareShow = true
+					} else {
+						if (this.waybillData.id) {
+							this.$cache.setCache('commodity', JSON.stringify(this.waybillData))
+							uni.navigateTo({
+								url: '/pages/order/quantum?waybillNo=' + this.waybillData.waybillNo +
+									'&printType=record'
+							});
+						} else {
+							uni.$u.toast('暂无运单详情数据,无法打印!')
+						}
+					}
+				}
+			},
+			cancel() {
+				this.show = false
+			},
+			confirm() {
+				this.$api.post('/api/waybill/stop-record', {
+					waybillNo: this.waybillData.waybillNo,
+					startTime: this.getDateTime(new Date()),
+				}).then(res => {
+					if (res.code == 200) {
+						if (this.humitureType == 'send') {
+							this.show = false
+							this.shareShow = true
+						} else {
+							if (this.waybillData.id) {
+								this.$cache.setCache('commodity', JSON.stringify(this.waybillData))
+								uni.navigateTo({
+									url: '/pages/order/quantum?waybillNo=' + this.waybillData.waybillNo +
+										'&printType=record'
+								});
+							} else {
+								uni.$u.toast('暂无运单详情数据,无法打印!')
+							}
+						}
+					}
+					this.show = false
+				}).catch(() => {
+					this.show = false
+				})
+			},
 			// 折叠面板
 			foldingPanel(value) {
 				this.humitureList.forEach((item, index) => {
@@ -186,12 +388,6 @@
 				})
 				this.$forceUpdate()
 			},
-			open(e) {
-				// console.log('open', e)
-			},
-			close(e) {
-				// console.log('close', e)
-			},
 			change(e) {
 				if (e[0].status == 'open') {
 					this.humitureList.forEach((item, index) => {
@@ -201,7 +397,7 @@
 			},
 			getServerData() {
 				this.$api.post('/api/waybill-task/newest-locus', {
-					waybillNo: this.orderList.waybillNo,
+					waybillNo: this.waybillNo,
 				}).then((res) => {
 					if (res.code == 200) {
 						this.opts.title.name = res.data.T_t + '℃'
@@ -247,6 +443,31 @@
 					}
 				})
 			},
+			// 选择某段温湿度数据
+			selectChangeil(value) {
+				this.humitureList.forEach((item, index) => {
+					if (value.id == item.id) {
+						if (value.isChecked) {
+							item.isChecked = false
+						} else {
+							item.isChecked = true
+						}
+					}
+				})
+				this.selectChange(value.id)
+				this.$forceUpdate()
+			},
+			// 选择打印
+			selectChange(stingId) {
+				const result = this.checkboxValue
+				const index = result.indexOf(stingId)
+				if (index > -1) {
+					result.splice(index, 1)
+				} else {
+					result.push(stingId)
+				}
+				this.checkboxValue = result
+			},
 			// 时间范围选择
 			changeDatetime(value, item) {
 				this.humitureList.forEach((item1, index) => {
@@ -357,4 +578,17 @@
 	.dateTime_card ::v-deep .icon-calendar {
 		display: none;
 	}
+
+	.card_btn {
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		padding-left: 30rpx;
+		padding-right: 30rpx;
+		padding-top: 20rpx;
+		background-color: #fff;
+		padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
+		padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
+	}
 </style>

+ 48 - 35
pages/order/index.vue

@@ -7,25 +7,24 @@
 				@change="tabClick"></u-tabs>
 		</view>
 		<view class="card_order_mangement" v-if="orderList.length > 0">
-			<x-orderManagement :orderList="orderList" :userInfo="userInfo" @sendmail="sendmail"></x-orderManagement>
-			<view v-if="loadingMore" style="width: 50%;"><u-divider :text="loading"></u-divider></view>
+			<x-orderManagement :key="Math.random()" :orderList="orderList" :userInfo="userInfo"
+				@sendmail="sendmail"></x-orderManagement>
+			<view style="width: 50%;">
+				<u-loadmore :status="loadStatus" />
+				<!-- <u-divider v-if="loadingMore" :text="loading"></u-divider> -->
+			</view>
 		</view>
 		<u-empty mode="order" marginTop="50" v-else></u-empty>
 		<u-popup :show="emailShow" mode="center" round="5" closeable @close="close">
 			<view style="padding: 30rpx;">
 				<view style="margin-top: 20rpx;width: 600rpx;">
+					<view class="email_title" style="margin-bottom: 10rpx;">运单号:{{waybillNo}}</view>
 					<view class="card_email">
 						<span class="email_title">邮箱地址:</span>
 						<view style="margin-top: 20rpx;">
 							<u--input v-model="email" placeholder="请输入邮箱" border="surround"></u--input>
 						</view>
 					</view>
-					<!-- <view class="card_email">
-						<span class="email_title">湿度展示:</span>
-						<view style="margin-top: 20rpx;">
-							<u-switch v-model="humidityFlag" inactiveColor="#fa3534" size="20"></u-switch>
-						</view>
-					</view> -->
 				</view>
 				<view style="margin-top: 20rpx;">
 					<u-button type="primary" :loading="sendLoading" text="发送" @click="confirm"></u-button>
@@ -49,6 +48,9 @@
 					id: 10,
 					name: '已装箱',
 				}, {
+					id: 11,
+					name: '已出箱',
+				}, {
 					id: 3,
 					name: '未入库',
 				}, {
@@ -57,31 +59,34 @@
 				}, {
 					id: 7,
 					name: '已出库'
+				}, {
+					id: 8,
+					name: '已签收'
 				}],
 				list1: [{
-						name: '全部',
-					}, {
-						id: 9,
-						name: '待装箱',
-					}, {
-						id: 10,
-						name: '已装箱',
-					}, {
-						id: 2,
-						name: '未装车',
-					}, {
-						id: 4,
-						name: '已装车'
-					},
-					{
-						id: 6,
-						name: '已下车'
-					},
-					{
-						id: 8,
-						name: '已签收'
-					}
-				],
+					name: '全部',
+				}, {
+					id: 9,
+					name: '待装箱',
+				}, {
+					id: 10,
+					name: '已装箱',
+				}, {
+					id: 11,
+					name: '已出箱',
+				}, {
+					id: 2,
+					name: '未装车',
+				}, {
+					id: 4,
+					name: '已装车'
+				}, {
+					id: 6,
+					name: '已下车'
+				}, {
+					id: 8,
+					name: '已签收'
+				}],
 				list2: [{
 					name: '全部',
 				}, {
@@ -108,6 +113,7 @@
 				humidityFlag: false,
 				waybillNo: '',
 				sendLoading: false,
+				loadStatus: 'loadmore' //loading 、nomore
 			}
 		},
 		onReachBottom() {
@@ -157,6 +163,7 @@
 		methods: {
 			// 获取司机和仓管订单列表
 			getList() {
+				this.loadStatus = 'loading'
 				this.loadingMore = true;
 				this.$api.get('/api/waybill/applet', {
 					page: this.currentPage,
@@ -168,14 +175,17 @@
 						if (this.loadingMore == true && data) {
 							this.orderList = this.orderList.concat(data);
 						}
-						if (this.orderList.length < this.pageSize) {
+						if (data.length < this.pageSize) {
 							this.loadingMore = true
 							this.loading = '没有更多了'
+							this.loadStatus = 'nomore'
 						} else {
 							this.loading = '加载中'
+							this.loadStatus = 'loading'
 							this.loadingMore = false
 							this.currentPage++
 						}
+						this.$forceUpdate()
 					}
 				})
 			},
@@ -192,7 +202,7 @@
 						if (this.loadingMore == true && data) {
 							this.orderList = this.orderList.concat(data);
 						}
-						if (this.orderList.length < this.pageSize) {
+						if (data.length < this.pageSize) {
 							this.loadingMore = true
 							this.loading = '没有更多了'
 						} else {
@@ -200,6 +210,7 @@
 							this.loadingMore = false
 							this.currentPage++
 						}
+						this.$forceUpdate()
 					}
 				})
 			},
@@ -217,7 +228,6 @@
 			},
 			// 发送邮件
 			sendmail(value) {
-				console.log(value, 25)
 				this.emailShow = true
 				this.waybillNo = value.waybillNo
 			},
@@ -236,9 +246,12 @@
 							}).then(res => {
 								if (res.code == 200) {
 									uni.$u.toast(res.msg)
-									this.sendLoading = false
+									this.email = ''
 									this.emailShow = false
 								}
+								this.sendLoading = false
+							}).catch(() => {
+								this.sendLoading = false
 							})
 						}
 					} else {

+ 9 - 1
pages/order/logisticsDetails.vue

@@ -59,6 +59,15 @@
 				}, {
 					id: 8,
 					title: '已签收',
+				}, {
+					id: 9,
+					title: '待装箱',
+				}, {
+					id: 10,
+					title: '已装箱',
+				}, {
+					id: 11,
+					title: '已出箱',
 				}],
 				polylineList: [],
 				markersList: [],
@@ -96,7 +105,6 @@
 								phone = item.warehouse.user.phone
 							} else if (item.coolerBox.id) {
 								yonTitle = item.coolerBox.name
-								phone = item.coolerBox.user.phone
 							}
 							// const trapeze = await this.reverseGeocode(item.lng, item.lat)
 							item.phone = phone

+ 7 - 4
pages/order/orderDetails.vue

@@ -118,8 +118,9 @@
 			},
 			// 温湿度记录
 			goHumiture() {
+				var orderList = this.$cache.getCache('orderDetails')
 				uni.navigateTo({
-					url: '/pages/order/humiture'
+					url: '/pages/order/humiture?waybillNo=' + orderList.waybillNo
 				});
 			},
 			// 订单状态
@@ -133,9 +134,11 @@
 							return '待装箱'
 						} else if (value == 10) {
 							return '已装箱'
+						} else if (value == 11) {
+							return '已出箱'
 						} else if (value == 5) {
 							return '已入库'
-						} else {
+						} else if (value == 7) {
 							return '已出库'
 						}
 					} else if (this.userInfo.type == 3) {
@@ -150,7 +153,7 @@
 							return '已装车'
 						} else if (value == 6) {
 							return '已下车'
-						} else {
+						} else if (value == 8) {
 							return '已签收'
 						}
 					}
@@ -159,7 +162,7 @@
 						return '未发货'
 					} else if (value == 4 || value == 5 || value == 6 || value == 7) {
 						return '已发货'
-					} else {
+					} else if (value == 8) {
 						return '已签收'
 					}
 				}

+ 515 - 286
pages/order/quantum.vue

@@ -13,7 +13,8 @@
 			</view>
 			<view class="space_between">
 				<view class="waybill_num">运单号: {{waybillNo}}</view>
-				<view style="font-size: 28rpx;margin-top: 20rpx;">x{{waybillList.quantity}}</view>
+				<view style="font-size: 28rpx;margin-top: 20rpx;" v-if="printType == 'barCode'">
+					x{{waybillList.quantity}}</view>
 			</view>
 			<view class="waybill_numil" v-if="printType == 'record'">请选择运单温湿度时间段</view>
 			<view class="card_waybill" v-for="(item,index) in timeQuantumList" :key="index" @click="selectChange(item)">
@@ -27,6 +28,12 @@
 						@change="changeDatetime($event,item)" />
 				</view>
 			</view>
+			<view class="card_waybill" style="margin-top: 20rpx;">
+				<u-radio-group v-model="printerValue" placement="row">
+					<u-radio name="default" label="默认打印机设备"></u-radio>
+					<u-radio name="zicox" style="margin-left: 30rpx;" label="芝柯打印机设备"></u-radio>
+				</u-radio-group>
+			</view>
 			<view class="card_bluetooth" v-if="pairedDeviceList.length > 0">
 				<view class="equipment_title">已配对设备</view>
 				<view class="card_equipment">
@@ -52,6 +59,8 @@
 	import util from './gprint/util.js'
 	import drawQrcode from './gprint/weapp.qrcode.esm.js'
 	import getCode128 from './gprint/code128'
+	import * as blesdk from './gprint/bluetoolth.js'
+	import gbk from './gprint/printUtil-GBK.js'
 	export default {
 		data() {
 			return {
@@ -76,12 +85,18 @@
 				checkboxValue: [],
 				userInfo: {},
 				disqualification: true,
+				connectBluetooth: {},
+				breakTime: null,
+				printerValue: 'default',
 			}
 		},
+		beforeDestroy() {
+			this.closeBLEConnectionil(this.connectBluetooth)
+		},
 		onLoad(value) {
 			const arr = this.$cache.getCache('commodity')
 			this.waybillList = JSON.parse(arr)
-			// console.log(this.waybillList, 14)
+			console.log(this.waybillList, 14)
 			var userInfo = this.$cache.getCache('userInfo')
 			this.userInfo = userInfo
 			if (value.printType == 'barCode') {
@@ -179,12 +194,13 @@
 					}
 				});
 			},
-			connect(value) {
-				// console.log(value, 66)
-				this.createBLEConnection(value)
+			async connect(value) {
+				const arr = await this.closeBLEConnectionil(this.connectBluetooth)
+				this.connectBluetooth = value
+				await this.createBLEConnectionil(value)
 			},
 			// item 是要连接的设备数据
-			createBLEConnection(item) {
+			createBLEConnectionil(item) {
 				let that = this;
 				that.matchingUnit.deviceId = item.deviceId
 				uni.showLoading({
@@ -196,8 +212,8 @@
 					success(res) {
 						that.stopFindBule(); // 停止搜索蓝牙
 						setTimeout(function() {
-							that.getBLEDeviceServices(item); // 获取蓝牙的服务
-						}, 2000)
+							that.getBLEDeviceServicesil(item); // 获取蓝牙的服务
+						}, 1000)
 					},
 					fail(res) {
 						uni.showToast({
@@ -208,62 +224,142 @@
 					}
 				});
 			},
-			getBLEDeviceServices(item) {
+			getBLEDeviceServicesil(item) {
 				const that = this
 				setTimeout(() => {
 					uni.getBLEDeviceServices({
 						// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
 						deviceId: item.deviceId,
 						complete(res) {
-							let serviceId = ""
+							console.log(res, '获取服务成功')
+							// let serviceId = ""
 							if (res.services.length > 0) {
-								for (var s = 0; s < res.services.length; s++) {
-									let serviceId = res.services[s].uuid
-									that.matchingUnit.serviceId = serviceId
-									uni.getBLEDeviceCharacteristics({ //获取蓝牙设备某个服务中所有特征值(characteristic)
-										// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
-										deviceId: item.deviceId,
-										// 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
-										serviceId: serviceId,
-										success(res) {
-											// console.log('获取服务成功')
-											that.pairedDeviceList = []
-											that.pairedDeviceList.push(item)
-											var re = JSON.parse(JSON.stringify(res))
-											for (var c = 0; c < re.characteristics.length; c++) {
-												if (re.characteristics[c].properties.write ==
-													true) {
-													let uuid = re.characteristics[c].uuid
-													that.matchingUnit.characteristicId = uuid
-													break
-												}
-											}
-											uni.hideLoading()
-										}
-									})
-								}
+								let finished = false;
+								that.pairedDeviceList = []
+								that.pairedDeviceList.push(item)
+								that.uniAsyncPromise(item, res).then(flag => {
+									console.log(flag, 24)
+									if (flag) {
+										console.log(that.matchingUnit, 326)
+										uni.hideLoading()
+										uni.showToast({
+											icon: 'success',
+											title: '连接成功',
+											duration: 2000
+										});
+									} else {
+										console.log(3)
+										that.pairedDeviceList = []
+										uni.showToast({
+											icon: 'none',
+											title: '获取特征值失败!请重新连接',
+											duration: 2000
+										});
+										uni.hideLoading()
+									}
+								})
+								// const serviceId = res.services.shift().uuid;
 							} else {
+								uni.showToast({
+									icon: 'none',
+									title: '连接失败!请重新连接',
+									duration: 2000
+								});
 								uni.hideLoading()
+								console.log(item, '没有服务')
+								setTimeout(() => {
+									that.closeBLEConnectionil(item)
+								}, 1000)
 							}
 						},
 						fail(res) {
 							console.log(res)
 						},
 					})
+				}, 1000);
+			},
+			uniAsyncPromise(item, arr) {
+				const that = this
+				return new Promise(async (resolve, reject) => {
+					for (var s = 0; s < arr.services.length; s++) {
+						let serviceId = arr.services[s].uuid
+						await uni.getBLEDeviceCharacteristics({ //获取蓝牙设备某个服务中所有特征值(characteristic)
+							// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
+							deviceId: item.deviceId,
+							// 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
+							serviceId: serviceId,
+							success(res) {
+								let write = false;
+								let notify = false;
+								let indicate = false;
+								var readId;
+								var writeId;
+								console.log(res, serviceId, '获取特征值成功')
+								// that.pairedDeviceList = []
+								// that.pairedDeviceList.push(item)
+								var arrList = JSON.parse(JSON.stringify(res))
+								for (var i = 0; i < arrList.characteristics
+									.length; i++) {
+									if (!notify) {
+										notify = arrList.characteristics[i]
+											.properties
+											.notify;
+										if (notify) readId = arrList
+											.characteristics[i]
+											.uuid;
+									}
+									if (!indicate) {
+										indicate = arrList.characteristics[i]
+											.properties
+											.indicate;
+										if (indicate) readId = arrList
+											.characteristics[
+												i].uuid;
+									}
+									if (!write) {
+										write = arrList.characteristics[i]
+											.properties
+											.write;
+										writeId = arrList.characteristics[i].uuid;
+									}
+									if ((notify || indicate) && write) {
+										console.log(2)
+										/* 获取蓝牙特征值uuid */
+										let uuid = arrList.characteristics[i].uuid
+										that.matchingUnit.characteristicId = uuid
+										that.matchingUnit.serviceId = serviceId
+										resolve(true);
+										break;
+									}
+								}
+							}
+						})
+					}
 				});
 			},
 			// 断开连接
-			closeBLEConnection(item) {
-				uni.closeBLEConnection({
-					deviceId: item.deviceId,
-					success: (res) => {
-						// res.characteristics 特征值列表
-						// 读写都需要用到特征值
-					},
-					fail: (res) => {
-						console.log(res);
-					},
-				})
+			async closeBLEConnectionil(event) {
+				if (event.deviceId) {
+					let that = this
+					return new Promise((resolve, reject) => {
+						uni.closeBLEConnection({
+							deviceId: event.deviceId,
+							success: (res) => {
+								console.log(res, '断开连接')
+								if (that.breakTime) {
+									clearTimeout(that.breakTime)
+								}
+								that.breakTime = setTimeout(() => {
+									resolve(true)
+								}, 1000)
+							},
+							fail: (res) => {
+								console.log(res, '断开失败')
+								reject(false)
+							},
+						})
+					})
+				}
 			},
 			// 配对设备打印
 			async getPrint(value) {
@@ -300,186 +396,301 @@
 					const ENV = require('../../.env.js')
 					let logistics = ENV.APP_LINK_URL + '/WaybillInquiry?waybillNo=' + codeValue
 					let code128 = getCode128(codeValue);
-					let numArr = []
-					for (var i = 0; i < this.waybillList.quantity; i++) {
-						let numa = i + 1
-						numArr.push(numa)
+					if (this.printerValue == 'zicox') {
+						let strCmd = blesdk.CreatCPCLPage(384, 820 * this.waybillList.quantity, 1, 0);
+						for (var i = 0; i < this.waybillList.quantity; i++) {
+							let numa = i + 1
+							let name = showFirstName(this.waybillList.senderAddressName)
+							let phone = this.waybillList.senderAddressPhone.substr(0, 3) + "****" + this
+								.waybillList
+								.senderAddressPhone.substr(7)
+							let name1 = showFirstName(this.waybillList.consigneeAddressName)
+							let phone1 = this.waybillList.consigneeAddressPhone.substr(0, 3) + "****" + this
+								.waybillList
+								.consigneeAddressPhone.substr(7)
+							strCmd += blesdk.addCPCLLocation(0);
+							strCmd += blesdk.addCPCLSETMAG(0, 0);
+							strCmd += blesdk.addCPCLText(0, 0 + 820 * i, '24', '0', 0, `#${this.userInfo.dept.name}`);
+							strCmd += blesdk.addCPCLText(0, 30 + 820 * i, '24', '0', 0, numa + '/' + this.waybillList
+								.quantity);
+							strCmd += blesdk.addCPCLLocation(2);
+							strCmd += blesdk.addCPCLBarCode(0, 50 + 820 * i, '128', 80, 0, 1, 1, '202405131452870423');
+							strCmd += blesdk.addCPCLText(0, 130 + 820 * i, '7', '2', 0, '202405131452870423');
+							strCmd += blesdk.addCPCLLocation(0);
+							strCmd += blesdk.addCPCLSETMAG(2, 2);
+							strCmd += blesdk.addCPCLText(0, 160 + 820 * i, '24', '0', 0, '收:');
+							strCmd += blesdk.addCPCLSETMAG(0, 0);
+							strCmd += blesdk.addCPCLText(90, 180 + 820 * i, '24', '0', 0, `${name}`);
+							strCmd += blesdk.addCPCLText(150, 180 + 820 * i, '24', '0', 0, `${phone}`);
+							strCmd += blesdk.addCPCLTextil(0, 210 + 820 * i, '24', '0', 0, this.waybillList
+								.senderAddressDetails);
+							strCmd += blesdk.addCPCLSETMAG(2, 2);
+							strCmd += blesdk.addCPCLText(0, 270 + 820 * i, '24', '0', 0, '寄:');
+							strCmd += blesdk.addCPCLSETMAG(0, 0);
+							strCmd += blesdk.addCPCLText(90, 290 + 820 * i, '24', '0', 0, `${name1}`);
+							strCmd += blesdk.addCPCLText(150, 290 + 820 * i, '24', '0', 0, `${phone1}`);
+							strCmd += blesdk.addCPCLTextil(0, 320 + 820 * i, '24', '0', 0, this.waybillList
+								.consigneeAddressDetails);
+							// strCmd += blesdk.addCPCLLine(0, 380, 384, 380, 1);
+							strCmd += blesdk.addCPCLText(0, 390 + 820 * i, '3', '0', 0, '下单时间:' + this.waybillList
+								.orderTime);
+							strCmd += blesdk.addCPCLText(0, 420 + 820 * i, '3', '0', 0, '备注:货物类型:' + this.waybillList
+								.cargoType);
+							strCmd += blesdk.addCPCLText(60, 450 + 820 * i, '3', '0', 0, '温度需求:' + this.waybillList
+								.temperatureInterval);
+							strCmd += blesdk.addCPCLText(60, 480 + 820 * i, '3', '0', 0, '配送要求:' + this.waybillList
+								.deliveryCondition);
+							strCmd += blesdk.addCPCLLocation(2);
+							strCmd += blesdk.addCPCLQRCode(0, 510 + 820 * i, 'M', 3, 5, `${logistics}`);
+							strCmd += blesdk.addCPCLText(0, 700 + 820 * i, '24', '0', 0, '扫码查询物流温湿度信息');
+						}
+						strCmd += blesdk.addCPCLPrint();
+						uni.hideLoading()
+						let buffer = gbk.strToGBKByte(strCmd)
+						// this.printbuffs(buffer);
+						let opt = {
+							deviceId: this.deviceId,
+							serviceId: this.serviceId,
+							characteristicId: this.characteristicId,
+							value: buffer,
+							onceLength: 20
+						}
+						blesdk.sendDataToDevice(opt);
+					} else {
+						let numArr = []
+						for (var i = 0; i < this.waybillList.quantity; i++) {
+							let numa = i + 1
+							numArr.push(numa)
+						}
+						numArr.forEach((numitem, indexnum) => {
+							printerJobs
+								.setSize(1, 1)
+								.setAlign('LT')
+								.print('#' + this.userInfo.dept.name)
+								.print(numitem + '/' + this.waybillList.quantity)
+								.setAlign('CT')
+								.printBarcode(code128)
+								.setSize(1, 1)
+								.setAlign('LT')
+								// .text('  ')
+								// .text(codeValue + ' \n')
+								// .print(printerUtil.fillLine())
+								.setAlign('LT')
+								.setSize(1, 2)
+								.setSize(2, 1)
+								.setBold()
+								.text('收:')
+								.setSize(1, 1)
+								.setBold(false)
+								.text(' ' + showFirstName(this.waybillList.senderAddressName))
+								.text(' ' + this.waybillList.senderAddressPhone.substr(0, 3) + "****" + this
+									.waybillList
+									.senderAddressPhone.substr(7) + ' \n')
+								.print(shippingAddress(this.waybillList.senderAddressDetails))
+								.setSize(1, 2)
+								.setSize(2, 1)
+								.setBold()
+								.text('寄:')
+								.setSize(1, 1)
+								.setBold(false)
+								.text(' ' + showFirstName(this.waybillList.consigneeAddressName))
+								.text(' ' + this.waybillList.consigneeAddressPhone.substr(0, 3) + "****" + this
+									.waybillList
+									.consigneeAddressPhone.substr(7) + ' \n')
+								.print(shippingAddress(this.waybillList.consigneeAddressDetails))
+								.print(printerUtil.fillLine())
+								.print('下单时间:' + this.waybillList.orderTime)
+								// .print(printerUtil.fillLine())
+								.text('备注:')
+								.text('货物类型:' + this.waybillList.cargoType + ' \n')
+								.print('     温度需求:' + this.waybillList.temperatureInterval)
+								.print('     配送要求:' + this.waybillList.deliveryCondition)
+								.setAlign('CT')
+								.printQrcode(logistics)
+								.print('扫码查询物流温湿度信息 \n')
+								.println()
+						})
+						let buffer = printerJobs.buffer();
+						// this.printbuffs(buffer);
+						let opt = {
+							deviceId: this.deviceId,
+							serviceId: this.serviceId,
+							characteristicId: this.characteristicId,
+							value: buffer,
+							onceLength: 20
+						}
+						blesdk.sendDataToDevice(opt);
 					}
-					numArr.forEach((numitem, indexnum) => {
+				} else {
+					var flag = true;
+					for (let i = 0, len = this.humitureData.length; i < len; i++) {
+						if (!this.humitureData[i].belowStandard) {
+							flag = false;
+							uni.$u.toast('数据不合格,无法打印!')
+							return false;
+						}
+					}
+					// 选择项全部合格
+					if (flag) {
+						// if (this.printerValue == 'zicox') {
+						// 	let strHum = blesdk.CreatCPCLPage(384, 300, 1, 0);
+						// 	strHum += blesdk.addCPCLText(0, 0, '24', '0', 0, `#${this.userInfo.dept.name}`);
+						// 	strHum += blesdk.addCPCLText(0, 0, '24', '0', 0, `运单号:${this.waybillList.waybillNo}`);
+						// 	strHum += blesdk.addCPCLText(0, 0, '24', '0', 0, `货物类型:${this.waybillList.cargoType}`);
+						// 	strHum += blesdk.addCPCLText(0, 0, '24', '0', 0, `温度需求:${this.waybillList.temperatureInterval}`);
+						// 	strHum += blesdk.addCPCLText(0, 0, '24', '0', 0, `配送要求:${this.waybillList.deliveryCondition}`);
+						// 	strHum += blesdk.addCPCLText(0, 0, '24', '0', 0, `寄件人:${this.waybillList.senderAddressName}`);
+						// 	strHum += blesdk.addCPCLText(0, 0, '24', '0', 0, `收件人:${this.waybillList.consigneeAddressName}`);
+						// } else {
+
+						// }
+						let printerJobs = new PrinterJobs();
 						printerJobs
 							.setSize(1, 1)
-							.setAlign('LT')
+							.setAlign('lt')
 							.print('#' + this.userInfo.dept.name)
-							.print(numitem + '/' + this.waybillList.quantity)
-							.setAlign('CT')
-							.printBarcode(code128)
-							.setSize(1, 1)
-							.setAlign('LT')
-							// .text('  ')
-							// .text(codeValue + ' \n')
-							// .print(printerUtil.fillLine())
-
-							.setAlign('LT')
-							.setSize(1, 2)
-							.setSize(2, 1)
-							.setBold()
-							.text('收:')
-							.setSize(1, 1)
-							.setBold(false)
-							.text(' ' + showFirstName(this.waybillList.senderAddressName))
-							.text(' ' + this.waybillList.senderAddressPhone.substr(0, 3) + "****" + this
-								.waybillList
-								.senderAddressPhone.substr(7) + ' \n')
-							.print(shippingAddress(this.waybillList.senderAddressDetails))
-							.setSize(1, 2)
-							.setSize(2, 1)
-							.setBold()
-							.text('寄:')
-							.setSize(1, 1)
-							.setBold(false)
-							.text(' ' + showFirstName(this.waybillList.consigneeAddressName))
-							.text(' ' + this.waybillList.consigneeAddressPhone.substr(0, 3) + "****" + this
-								.waybillList
-								.consigneeAddressPhone.substr(7) + ' \n')
-							.print(shippingAddress(this.waybillList.consigneeAddressDetails))
+							.print('运单号:' + this.waybillList.waybillNo)
+							.print('货物类型:' + this.waybillList.cargoType)
+							.print('温度需求:' + this.waybillList.temperatureInterval)
+							.print('配送要求:' + this.waybillList.deliveryCondition)
+							.print('寄件人:' + this.waybillList.senderAddressName)
+							.print('收件人:' + this.waybillList.consigneeAddressName)
 							.print(printerUtil.fillLine())
-							.print('下单时间:' + this.waybillList.orderTime)
-							// .print(printerUtil.fillLine())
-							.text('备注:')
-							.text('货物类型:' + this.waybillList.cargoType + ' \n')
-							.print('     温度需求:' + this.waybillList.temperatureInterval)
-							.print('     配送要求:' + this.waybillList.deliveryCondition)
-							.setAlign('CT')
-							.printQrcode(logistics)
-							.print('扫码查询物流温湿度信息 \n')
-							.println()
-					})
-					let buffer = printerJobs.buffer();
-					this.printbuffs(buffer);
-				} else {
-					let printerJobs = new PrinterJobs();
-					printerJobs
-						.setSize(1, 1)
-						.setAlign('lt')
-						.print('#' + this.userInfo.dept.name)
-						.print('运单号:' + this.waybillNo)
-						.print('货物类型:' + this.waybillList.cargoType)
-						.print('温度需求:' + this.waybillList.temperatureInterval)
-						.print('配送要求:' + this.waybillList.deliveryCondition)
-						.print('寄件人:' + this.waybillList.senderAddressName)
-						.print('收件人:' + this.waybillList.consigneeAddressName)
-						.print(printerUtil.fillLine())
-					this.humitureData.forEach((item, index) => {
-						// console.log(item,123)
-						const exists = this.checkboxValue.some(Tid => Tid === item.id);
-						if (item.isChecked) {
-							// printerJobs
-							// .print('设备号:' + item.sn)
-							// .print('标识名:' + item.title)
-							// .print('开始时间:' + item.startTime)
-							// .print('结束时间:' + item.endTime)
-							// .print(printerUtil.fillLine())
-							item.arr.forEach((item1, index1) => {
-								if (item1.arrNum < 2) {
-									printerJobs
-										.print('日期:' + item1.time + '单位℃ ')
-										.text('时间 ')
-										.text('|')
-										.text(' ')
-										.text('T1  ')
-										.text(' ')
-										.text('|')
-										.text(' ')
-										.text('T2  ')
-										.text(' ')
-										.text('|')
-										.text(' ')
-										.text('T3  ')
-										.text(' ')
-										.text('|')
-										.text(' ')
-										.text('T4  \n')
-									item1.arr.forEach((item2, index2) => {
+						this.humitureData.forEach((item, index) => {
+							// console.log(item,123)
+							const exists = this.checkboxValue.some(Tid => Tid === item.id);
+							if (item.isChecked) {
+								// printerJobs
+								// .print('设备号:' + item.sn)
+								// .print('标识名:' + item.title)
+								// .print('开始时间:' + item.startTime)
+								// .print('结束时间:' + item.endTime)
+								// .print(printerUtil.fillLine())
+								item.arr.forEach((item1, index1) => {
+									if (item1.arrNum < 2) {
 										printerJobs
-											.text(`${item2[0].time}`)
+											.print('日期:' + item1.time + '单位℃ ')
+											.text('时间 ')
 											.text('|')
 											.text(' ')
-											.text(
-												`${item2[0] == '---' ? '----' : character(item2[0].T_t) }`
-											)
+											.text('T1  ')
 											.text(' ')
 											.text('|')
 											.text(' ')
-											.text(
-												`${item2[1] == '---' ? '----' : character(item2[1].T_t) }`
-											)
+											.text('T2  ')
 											.text(' ')
 											.text('|')
 											.text(' ')
-											.text(
-												`${item2[2] == '---' ? '----' : character(item2[2].T_t) }`
-											)
+											.text('T3  ')
 											.text(' ')
 											.text('|')
 											.text(' ')
-											.text(
-												`${item2[3] == '---' ? '----' : character(item2[3].T_t) }`
-											)
+											.text('T4  \n')
+										item1.arr.forEach((item2, index2) => {
+											printerJobs
+												.text(`${item2[0].time}`)
+												.text('|')
+												.text(' ')
+												.text(
+													`${item2[0] == '---' ? '----' : character(item2[0].T_t) }`
+												)
+												.text(' ')
+												.text('|')
+												.text(' ')
+												.text(
+													`${item2[1] == '---' ? '----' : character(item2[1].T_t) }`
+												)
+												.text(' ')
+												.text('|')
+												.text(' ')
+												.text(
+													`${item2[2] == '---' ? '----' : character(item2[2].T_t) }`
+												)
+												.text(' ')
+												.text('|')
+												.text(' ')
+												.text(
+													`${item2[3] == '---' ? '----' : character(item2[3].T_t) }`
+												)
 
-										function character(value) {
-											var arr = value.toFixed(1)
-											if (arr.length == 3) {
-												var arr1 = arr + ' '
-												return arr1
-											} else {
-												return arr
+											function character(value) {
+												var arr = value.toFixed(1)
+												if (arr.length == 3) {
+													var arr1 = arr + ' '
+													return arr1
+												} else {
+													return arr
+												}
 											}
-										}
-									})
-								} else {
-									printerJobs
-										.print('日期:' + item1.time + '单位℃ ')
-										.text('时间')
-										.text('|')
-										.text('温度(℃)')
-										.text('   ')
-										.text('时间')
-										.text('|')
-										.text('温度(℃)  \n')
-									item1.arr.forEach((item2, index2) => {
+										})
+									} else {
 										printerJobs
-											.text(`${item2[0].time}`)
+											.print('日期:' + item1.time + '单位℃ ')
+											.text('时间')
 											.text('|')
-											.text(
-												`${item2[0] == '---' ? '----' : character(item2[0].T_t) }`
-											)
+											.text('温度(℃)')
+											.text('   ')
+											.text('时间')
 											.text('|')
-											.text(
-												`${item2[1] == '---' ? '----' : character(item2[1].T_t) }`
-											)
-											.text(' ')
+											.text('温度(℃)  \n')
+										item1.arr.forEach((item2, index2) => {
+											printerJobs
+												.text(`${item2[0].time}`)
+												.text('|')
+												.text(
+													`${item2[0] == '---' ? '----' : character(item2[0].T_t) }`
+												)
+												.text('|')
+												.text(
+													`${item2[1] == '---' ? '----' : character(item2[1].T_t) }`
+												)
+												.text(' ')
+											if (isEven(index2 + 1)) {
+												printerJobs.text(' \n')
+											}
+
+											function isEven(num) {
+												return num % 2 === 0;
+											}
 
-										function character(value) {
-											var arr = value.toFixed(1)
-											if (arr.length == 3) {
-												var arr1 = arr + ' '
-												return arr1
-											} else {
-												return arr
+											function character(value) {
+												var arr = value.toFixed(1)
+												if (arr.length == 3) {
+													var arr1 = arr + ' '
+													return arr1
+												} else {
+													return arr
+												}
 											}
+										})
+
+										function isLengthOdd(array) {
+											return array.length % 2 === 1;
 										}
-									})
-								}
-							})
-							// printerJobs.println()
+										if (isLengthOdd(item1.arr)) {
+											printerJobs.text(' \n')
+										}
+									}
+								})
+								// printerJobs.println()
+							}
+						})
+						printerJobs.println()
+						let buffer = printerJobs.buffer();
+						// this.printbuffs(buffer);
+						let opt = {
+							deviceId: this.deviceId,
+							serviceId: this.serviceId,
+							characteristicId: this.characteristicId,
+							value: buffer,
+							onceLength: 20
 						}
-					})
-					printerJobs.println()
-					let buffer = printerJobs.buffer();
-					this.printbuffs(buffer);
+						blesdk.sendDataToDevice(opt);
+					}
 				}
 			},
-			printbuffs(buffer) {
+			async printbuffs(buffer) {
+				uni.hideLoading()
 				// 1.并行调用多次会存在写失败的可能性
 				// 2.建议每次写入不超过20字节
 				// 分包处理,延时调用
@@ -487,7 +698,7 @@
 				const delay = 20;
 				for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j++) {
 					let subPackage = buffer.slice(i, i + maxChunk <= length ? (i + maxChunk) : length);
-					setTimeout(this.printbuff, j * delay, subPackage);
+					setTimeout(await this.printbuff, j * delay, subPackage);
 				}
 			},
 			printbuff(buffer) {
@@ -573,8 +784,6 @@
 			},
 			// 获取温湿度信息
 			humitureInfo(value) {
-				// console.log(printList(), 2666)
-				// console.log(value, 25)
 				let arrData = value
 				let arrData1 = printList()
 				arrData.forEach((item, index) => {
@@ -588,96 +797,112 @@
 						waybillNo: this.waybillNo,
 						page: 1,
 						pageSize: 9999,
+						startTime: item.startTime,
+						endTime: item.endTime,
 					}
-					// console.log(item,999)
 					item.arr = []
 					this.getWaybillTask(params).then(res => {
-						const arrL = JSON.parse(JSON.stringify(res))
-						const timeList = JSON.parse(JSON.stringify(res))
-						const arrLil = res
-						for (let i = 0; i < arrLil.length; i++) {
-							for (let j = i + 1; j < arrLil.length; j++) {
-								if (arrLil[i].T_time == arrLil[j].T_time) {
-									arrLil.splice(j, 1);
-									j--;
+						if (!res) {
+							item.belowStandard = false
+						} else {
+							item.belowStandard = true
+							const arrL = JSON.parse(JSON.stringify(res))
+							const timeList = JSON.parse(JSON.stringify(res))
+							const arrLil = res
+							for (let i = 0; i < arrLil.length; i++) {
+								for (let j = i + 1; j < arrLil.length; j++) {
+									if (arrLil[i].T_time == arrLil[j].T_time) {
+										arrLil.splice(j, 1);
+										j--;
+									}
 								}
 							}
-						}
-						var resultArr = arrLil
-						let list1 = []
-						resultArr.forEach(k => {
-							let arr1 = {
-								T_sn: k.T_sn,
-								time: k.T_time,
-								arr: [],
-							}
-							list1.push(arr1)
-						})
-						this.maxData = list1
-						for (let i = 0; i < timeList.length; i++) {
-							for (let j = i + 1; j < timeList.length; j++) {
-								if (timeList[i].time == timeList[j].time) {
-									timeList.splice(j, 1);
-									j--;
+							var resultArr = arrLil
+							let list1 = []
+							resultArr.forEach(k => {
+								let arr1 = {
+									T_sn: k.T_sn,
+									time: k.T_time,
+									arr: [],
+								}
+								list1.push(arr1)
+							})
+							this.maxData = list1
+							for (let i = 0; i < timeList.length; i++) {
+								for (let j = i + 1; j < timeList.length; j++) {
+									if (timeList[i].time == timeList[j].time) {
+										timeList.splice(j, 1);
+										j--;
+									}
 								}
 							}
-						}
-						this.maxData.forEach((item3, index3) => {
-							timeList.forEach((item2, index2) => {
-								const result1 = arrL.find(fruit => fruit.T_id === 1 &&
-									fruit.time === item2.time && fruit.T_time === item3
-									.time)
-								const result2 = arrL.find(fruit => fruit.T_id === 2 &&
-									fruit.time === item2.time && fruit.T_time === item3
-									.time)
-								const result3 = arrL.find(fruit => fruit.T_id === 3 &&
-									fruit.time === item2.time && fruit.T_time === item3
-									.time)
-								const result4 = arrL.find(fruit => fruit.T_id === 4 &&
-									fruit.time === item2.time && fruit.T_time === item3
-									.time)
+							this.maxData.forEach((item3, index3) => {
+								timeList.forEach((item2, index2) => {
+									const result1 = arrL.find(fruit => fruit.T_id === 1 &&
+										fruit.time === item2.time && fruit.T_time ===
+										item3
+										.time)
+									const result2 = arrL.find(fruit => fruit.T_id === 2 &&
+										fruit.time === item2.time && fruit.T_time ===
+										item3
+										.time)
+									const result3 = arrL.find(fruit => fruit.T_id === 3 &&
+										fruit.time === item2.time && fruit.T_time ===
+										item3
+										.time)
+									const result4 = arrL.find(fruit => fruit.T_id === 4 &&
+										fruit.time === item2.time && fruit.T_time ===
+										item3
+										.time)
 
-								const flag = areAllUndefined(result1, result2, result3,
-									result4)
-								if (!flag) {
-									function countFalseObjects(objects) {
-										let count = 0;
-										for (let i = 0; i < objects.length; i++) {
-											if (objects[i] === undefined) {
-												count++;
+									const flag = areAllUndefined(result1, result2, result3,
+										result4)
+									if (!flag) {
+										function countFalseObjects(objects) {
+											let count = 0;
+											for (let i = 0; i < objects.length; i++) {
+												if (objects[i] === undefined) {
+													count++;
+												}
 											}
+											return count;
 										}
-										return count;
-									}
-									const arrNum = countFalseObjects([result1, result2,
-										result3, result4
-									])
-									let list2 = []
-									if (arrNum < 2) {
-										list2.push(result1 == undefined ? '---' : result1)
-										list2.push(result2 == undefined ? '---' : result2)
-										list2.push(result3 == undefined ? '---' : result3)
-										list2.push(result4 == undefined ? '---' : result4)
-									} else {
-										list2.push(result1 == undefined ? '---' : result1)
-										list2.push(result2 == undefined ? '---' : result2)
+										const arrNum = countFalseObjects([result1, result2,
+											result3, result4
+										])
+										let list2 = []
+										if (arrNum < 2) {
+											list2.push(result1 == undefined ? '---' :
+												result1)
+											list2.push(result2 == undefined ? '---' :
+												result2)
+											list2.push(result3 == undefined ? '---' :
+												result3)
+											list2.push(result4 == undefined ? '---' :
+												result4)
+										} else {
+											list2.push(result1 == undefined ? '---' :
+												result1)
+											list2.push(result2 == undefined ? '---' :
+												result2)
+										}
+										// let list2 = [
+										// 	result1 == undefined ? '---' : result1,
+										// 	result2 == undefined ? '---' : result2,
+										// 	result3 == undefined ? '---' : result3,
+										// 	result4 == undefined ? '---' : result4,
+										// ]
+										item3.arrNum = arrNum
+										item3.arr.push(list2)
 									}
-									// let list2 = [
-									// 	result1 == undefined ? '---' : result1,
-									// 	result2 == undefined ? '---' : result2,
-									// 	result3 == undefined ? '---' : result3,
-									// 	result4 == undefined ? '---' : result4,
-									// ]
-									item3.arrNum = arrNum
-									item3.arr.push(list2)
-								}
 
-								function areAllUndefined(...args) {
-									return args.every(arg => arg === undefined);
-								}
+									function areAllUndefined(...args) {
+										return args.every(arg => arg === undefined);
+									}
+								})
 							})
-						})
-						item.arr = this.maxData
+							item.arr = this.maxData
+						}
 					})
 				})
 				this.humitureData = arrData
@@ -709,22 +934,26 @@
 								})
 								resolve(arr2)
 							}
-						} else {
-							this.disqualification = false
-							let arr2 = []
-							resolve(arr2)
+							this.disqualification = true
+						} else if (res.code == 5000) {
+							// this.disqualification = false
+							// let arr2 = []
+							// resolve(arr2)
+							resolve(false)
 						}
 					})
 				});
 			},
-			changeDatetime(value, item) {
-				console.log(value, item, 24)
+			changeDatetime(value, data) {
 				this.timeQuantumList.forEach((item, index) => {
-					if (value.id == item.id) {
-						console.log(item, 23)
+					if (data.id == item.id) {
 						item.datetimeRange = value
+						item.startTime = value[0]
+						item.endTime = value[1]
 					}
 				})
+				this.humitureData = []
+				this.humitureInfo(this.timeQuantumList)
 			}
 		}
 	}

+ 1 - 1
pages/register.vue

@@ -4,7 +4,7 @@
 		<view class="card_login">
 			<view class="card_head_logo">
 				<image class="mine_image" src="../static/logo.png" mode=""></image>
-				<view class="welcome_title">欢迎注册宝智达冷链运输</view>
+				<view class="welcome_title">欢迎注册茂坤冷链运输</view>
 			</view>
 			<u-form labelPosition="left" :model="formList" :rules="rules" ref="uForm">
 				<u-form-item label="类型" prop="type" labelWidth="80" borderBottom ref="item1">

BIN
unpackage/cache/apk/__UNI__92DFF97_cm.apk


+ 1 - 1
unpackage/cache/apk/apkurl

@@ -1 +1 @@
-https://app.liuyingyong.cn/build/download/b19a4420-6135-11ef-8013-ef66f32192bf
+https://app.liuyingyong.cn/build/download/d8be2410-7be7-11ef-b1fe-f3063893c1d8

File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/apk/cmManifestCache.json


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__92DFF97/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__92DFF97/app-view.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__92DFF97/manifest.json


BIN
unpackage/debug/android_debug.apk


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/manifest.json


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


File diff suppressed because it is too large
+ 100 - 108
unpackage/dist/dev/app-plus/app-view.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


BIN
unpackage/release/apk/__UNI__92DFF97__20240823175431.apk


BIN
unpackage/release/apk/__UNI__92DFF97__20240826150409.apk


BIN
unpackage/release/apk/__UNI__92DFF97__20240827154258.apk


BIN
unpackage/release/apk/__UNI__92DFF97__20240911153716.apk


BIN
unpackage/release/apk/__UNI__92DFF97__20240914104310.apk


BIN
unpackage/release/apk/__UNI__92DFF97__20240924100029.apk


BIN
unpackage/release/apk/__UNI__92DFF97__20240926171517.apk


Some files were not shown because too many files changed in this diff