Переглянути джерело

滚动加载上移、打印条码重连

unknown 1 місяць тому
батько
коміт
b2d2f606ba

+ 1 - 1
.hbuilderx/launch.json

@@ -13,7 +13,7 @@
             "type" : "uniCloud"
         },
         {
-            "playground" : "custom",
+            "playground" : "standard",
             "type" : "uni-app:app-android"
         }
     ]

+ 13 - 1
components/x-bluetooth.vue

@@ -5,7 +5,9 @@
 				<u-icon name="wifi" color="#2979ff" size="26"></u-icon>
 				<view class="wifi_item_title">{{item.name}}</view>
 			</view>
-			<view>
+			<view style="display: flex;align-items: center;">
+				<u-button style="margin-right: 10px;" size="small" type="warning" text="重连"
+					@click="reconnection(item)" v-if="reconnectionFlag"></u-button>
 				<u-button size="small" :type="btnType" :text="text" @click="connect(item)"></u-button>
 			</view>
 		</view>
@@ -34,6 +36,13 @@
 					return 'primary'
 				}
 			},
+			// 重新连接显示
+			reconnectionFlag: {
+				type: Boolean,
+				default () {
+					return false
+				}
+			}
 		},
 		data() {
 			return {}
@@ -42,6 +51,9 @@
 		methods: {
 			connect(value) {
 				this.$emit('connect', value)
+			},
+			reconnection(event) {
+				this.$emit('reconnection',event)
 			}
 		}
 	}

+ 2 - 2
components/x-orderManagement.vue

@@ -133,7 +133,7 @@
 						dtask.start();
 					}
 					uni.hideLoading()
-				}).catch(()=>{
+				}).catch(() => {
 					uni.hideLoading()
 				})
 				return
@@ -240,7 +240,7 @@
 			},
 			// 打印运单
 			printbarCode(type) {
-				if (this.userInfo.userType === 'sys' && [2, 3, 9].includes(type)) {
+				if (this.userInfo.userType === 'sys' && [2, 3, 9, 10].includes(type)) {
 					return true
 				} else {
 					return false

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "冷链物流",
     "appid" : "__UNI__92DFF97",
     "description" : "",
-    "versionName" : "1.1.3",
-    "versionCode" : 113,
+    "versionName" : "1.1.4",
+    "versionCode" : 114,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 1 - 1
pages/order/gprint/bluetoolth.js

@@ -309,7 +309,7 @@ export function sendDataToDevice(options) {
 				} else {
 					num = 0
 					uni.showToast({
-						title: '打印失敗請檢查藍牙連接狀態或打印機狀態',
+						title: '打印失败请检查蓝牙连接状态或打印机状态',
 						icon: 'none',
 						duration: 2000
 					})

+ 17 - 3
pages/order/index.vue

@@ -7,8 +7,8 @@
 				@change="tabClick"></u-tabs>
 		</view>
 		<view class="card_order_mangement" v-if="orderList.length > 0">
-			<x-orderManagement :key="Math.random()" :orderList="orderList" :userInfo="userInfo"
-				@sendmail="sendmail"></x-orderManagement>
+			<x-orderManagement :orderList="orderList" :userInfo="userInfo" @sendmail="sendmail"
+				:key="keyId"></x-orderManagement>
 			<view style="width: 50%;">
 				<u-loadmore :status="loadStatus" />
 				<!-- <u-divider v-if="loadingMore" :text="loading"></u-divider> -->
@@ -35,6 +35,7 @@
 </template>
 
 <script>
+	import index from '../../uview-ui'
 	export default {
 		data() {
 			return {
@@ -113,7 +114,8 @@
 				humidityFlag: false,
 				waybillNo: '',
 				sendLoading: false,
-				loadStatus: 'loadmore' //loading 、nomore
+				loadStatus: 'loadmore', //loading 、nomore
+				keyId: 0,
 			}
 		},
 		onReachBottom() {
@@ -187,10 +189,14 @@
 						}
 						this.$forceUpdate()
 					}
+				}).catch(() => {
+					this.loadingMore = true
+					this.loadStatus = 'nomore'
 				})
 			},
 			// 获取用户订单列表
 			getUserList() {
+				this.loadStatus = 'loading'
 				this.loadingMore = true;
 				this.$api.get('/api/waybill/customer', {
 					page: this.currentPage,
@@ -205,17 +211,25 @@
 						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()
 					}
+				}).catch(() => {
+					this.loadingMore = true
+					this.loadStatus = 'nomore'
 				})
 			},
 			// tab订单
 			tabClick(row) {
+				this.loadStatus = 'loading'
+				this.keyId = row.index
+				this.loadingMore = true
 				this.currentPage = 1
 				this.orderList = []
 				if (this.userInfo.userType == 'sys') {

+ 15 - 7
pages/order/quantum.vue

@@ -37,7 +37,8 @@
 			<view class="card_bluetooth" v-if="pairedDeviceList.length > 0">
 				<view class="equipment_title">已配对设备</view>
 				<view class="card_equipment">
-					<x-bluetooth :list="pairedDeviceList" text="打印" btnType="success" @connect="getPrint"></x-bluetooth>
+					<x-bluetooth :reconnectionFlag="true" :list="pairedDeviceList" text="打印" btnType="success"
+						@connect="getPrint" @reconnection="reconnection"></x-bluetooth>
 				</view>
 			</view>
 			<view class="card_bluetooth">
@@ -96,7 +97,7 @@
 		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') {
@@ -118,7 +119,7 @@
 					that.searchType = false
 				} else {
 					that.BlueState = false
-					console.log('开始搜索')
+					// console.log('开始搜索')
 					that.searchTitle = '停止搜索'
 					that.nearbyTitle = '正通过蓝牙查找附近设备...'
 					that.searchType = true
@@ -194,11 +195,18 @@
 					}
 				});
 			},
+			// 连接
 			async connect(value) {
 				const arr = await this.closeBLEConnectionil(this.connectBluetooth)
 				this.connectBluetooth = value
 				await this.createBLEConnectionil(value)
 			},
+			// 重连
+			async reconnection(event) {
+				const arr = await this.closeBLEConnectionil(this.connectBluetooth)
+				this.connectBluetooth = event
+				await this.createBLEConnectionil(event)
+			},
 			// item 是要连接的设备数据
 			createBLEConnectionil(item) {
 				let that = this;
@@ -238,9 +246,9 @@
 								that.pairedDeviceList = []
 								that.pairedDeviceList.push(item)
 								that.uniAsyncPromise(item, res).then(flag => {
-									console.log(flag, 24)
+									// console.log(flag, 24)
 									if (flag) {
-										console.log(that.matchingUnit, 326)
+										// console.log(that.matchingUnit, 326)
 										uni.hideLoading()
 										uni.showToast({
 											icon: 'success',
@@ -248,7 +256,7 @@
 											duration: 2000
 										});
 									} else {
-										console.log(3)
+										// console.log(3)
 										that.pairedDeviceList = []
 										uni.showToast({
 											icon: 'none',
@@ -323,7 +331,7 @@
 										writeId = arrList.characteristics[i].uuid;
 									}
 									if ((notify || indicate) && write) {
-										console.log(2)
+										// console.log(2)
 										/* 获取蓝牙特征值uuid */
 										let uuid = arrList.characteristics[i].uuid
 										that.matchingUnit.characteristicId = uuid

+ 1 - 1
unpackage/cache/wgt/__UNI__92DFF97/app-config-service.js

@@ -1,7 +1,7 @@
 
 var isReady=false;var onReadyCallbacks=[];
 var isServiceReady=false;var onServiceReadyCallbacks=[];
-var __uniConfig = {"pages":["pages/indexRouter","pages/login","pages/codeLogin","pages/register","pages/home/particulars","pages/order/index","pages/order/delivery","pages/order/orderDetails","pages/order/quantum","pages/order/addWaybill","pages/mine/password","pages/order/logisticsDetails","pages/order/humiture"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"冷链物流","compilerVersion":"4.24","entryPagePath":"pages/indexRouter","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
+var __uniConfig = {"pages":["pages/indexRouter","pages/login","pages/codeLogin","pages/register","pages/home/particulars","pages/order/index","pages/order/delivery","pages/order/orderDetails","pages/order/quantum","pages/order/addWaybill","pages/mine/password","pages/order/logisticsDetails","pages/order/humiture"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"冷链物流","compilerVersion":"4.29","entryPagePath":"pages/indexRouter","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
 var __uniRoutes = [{"path":"/pages/indexRouter","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/login","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/codeLogin","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/register","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/home/particulars","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/delivery","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/orderDetails","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/quantum","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/addWaybill","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/mine/password","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/logisticsDetails","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/humiture","meta":{},"window":{"navigationStyle":"custom"}}];
 __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
 __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/cache/wgt/__UNI__92DFF97/app-service.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/cache/wgt/__UNI__92DFF97/app-view.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/cache/wgt/__UNI__92DFF97/manifest.json


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/cache/wgt/__UNI__92DFF97/view.umd.min.js


+ 1 - 1
unpackage/dist/build/app-plus/app-config-service.js

@@ -1,7 +1,7 @@
 
 var isReady=false;var onReadyCallbacks=[];
 var isServiceReady=false;var onServiceReadyCallbacks=[];
-var __uniConfig = {"pages":["pages/indexRouter","pages/login","pages/codeLogin","pages/register","pages/home/particulars","pages/order/index","pages/order/delivery","pages/order/orderDetails","pages/order/quantum","pages/order/addWaybill","pages/mine/password","pages/order/logisticsDetails","pages/order/humiture"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"冷链物流","compilerVersion":"4.24","entryPagePath":"pages/indexRouter","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
+var __uniConfig = {"pages":["pages/indexRouter","pages/login","pages/codeLogin","pages/register","pages/home/particulars","pages/order/index","pages/order/delivery","pages/order/orderDetails","pages/order/quantum","pages/order/addWaybill","pages/mine/password","pages/order/logisticsDetails","pages/order/humiture"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"冷链物流","compilerVersion":"4.29","entryPagePath":"pages/indexRouter","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
 var __uniRoutes = [{"path":"/pages/indexRouter","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/login","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/codeLogin","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/register","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/home/particulars","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/delivery","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/orderDetails","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/quantum","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/addWaybill","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/mine/password","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/logisticsDetails","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/humiture","meta":{},"window":{"navigationStyle":"custom"}}];
 __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
 __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/dist/build/app-plus/manifest.json


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/dist/build/app-plus/view.umd.min.js


+ 1 - 1
unpackage/dist/dev/app-plus/app-config-service.js

@@ -1,7 +1,7 @@
 
 var isReady=false;var onReadyCallbacks=[];
 var isServiceReady=false;var onServiceReadyCallbacks=[];
-var __uniConfig = {"pages":["pages/indexRouter","pages/login","pages/codeLogin","pages/register","pages/home/particulars","pages/order/index","pages/order/delivery","pages/order/orderDetails","pages/order/quantum","pages/order/addWaybill","pages/mine/password","pages/order/logisticsDetails","pages/order/humiture"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"冷链物流","compilerVersion":"4.24","entryPagePath":"pages/indexRouter","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
+var __uniConfig = {"pages":["pages/indexRouter","pages/login","pages/codeLogin","pages/register","pages/home/particulars","pages/order/index","pages/order/delivery","pages/order/orderDetails","pages/order/quantum","pages/order/addWaybill","pages/mine/password","pages/order/logisticsDetails","pages/order/humiture"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"冷链物流","compilerVersion":"4.29","entryPagePath":"pages/indexRouter","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
 var __uniRoutes = [{"path":"/pages/indexRouter","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/login","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/codeLogin","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/register","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/home/particulars","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/delivery","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/orderDetails","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/quantum","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/addWaybill","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/mine/password","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/logisticsDetails","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/order/humiture","meta":{},"window":{"navigationStyle":"custom"}}];
 __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
 __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


Різницю між файлами не показано, бо вона завелика
+ 14 - 16
unpackage/dist/dev/app-plus/app-view.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
unpackage/dist/dev/app-plus/view.umd.min.js


Деякі файли не було показано, через те що забагато файлів було змінено