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

Merge branch 'test' of git.echepei.com:sailun/sailun-tbr-web into test

qukaidi 4 роки тому
батько
коміт
c657368886

+ 22 - 7
pages/home/Scan-code-in/index.vue

@@ -5,7 +5,7 @@
 			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">成功信息</view>
 			<u-table border-color="#f2f2f2">
 				<u-tr class="u-tr">
-					<u-td class="u-td" style="font-size: 24rpx;">{{successCount}}</u-td>
+					<u-td class="u-td">{{successCount}}</u-td>
 					<u-td class="u-td">成功入库轮胎</u-td>
 				</u-tr>
 			</u-table>
@@ -16,15 +16,15 @@
 					<u-th class="u-th">失败原因</u-th>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in notBelongStoreBrandTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非门店经营品牌</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in nonRegularTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非正规胎号</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in alreadyExistsTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">库存中已存在</u-td>
 				</u-tr>
 
@@ -93,6 +93,19 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			this.getDatalist()
 		},
 		methods: {
@@ -114,6 +127,7 @@
 							materialList: this.datalist
 						}
 					}).then(res => {
+						console.log(res)
 						this.dalist = res.data.data
 						for (let i = 0; i < this.dalist.length; i++) {
 							this.total += parseInt(this.dalist[i].rewardMoney)
@@ -122,6 +136,10 @@
 
 					}).catch(err => {
 						console.log(err)
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~'
+						})
 					}).finally(() => {
 						// Loading.close()
 					})
@@ -155,9 +173,6 @@
 					data: {
 						storeId:this.$store.state.storeInfo.storeId,
 						userId:this.$store.state.storeInfo.userId,
-						// scanAddress: '青岛市市北区橡胶谷-B栋',		//地址
-						// longitude: 120.3898355082192,		//纬度
-						// latitude: 36.14788760436011,		//经度
 						scanAddress: this.address,		//地址
 						longitude: this.longitude,		//纬度
 						latitude: this.latitude,		//经度

+ 4 - 4
pages/home/Scan-code-out/index.vue

@@ -5,7 +5,7 @@
 			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">成功信息</view>
 			<u-table border-color="#f2f2f2">
 				<u-tr class="u-tr">
-					<u-td class="u-td" style="font-size: 24rpx;">{{successCount}}</u-td>
+					<u-td class="u-td">{{successCount}}</u-td>
 					<u-td class="u-td">成功出库轮胎</u-td>
 				</u-tr>
 			</u-table>
@@ -16,15 +16,15 @@
 					<u-th class="u-th">失败原因</u-th>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in notBelongStoreBrandTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非门店经营品牌</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in nonRegularTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非正规胎号</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in notScanInTyres" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">未入库轮胎</u-td>
 				</u-tr>
 			</u-table>

+ 27 - 1
pages/home/scancode/index.vue

@@ -72,6 +72,19 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			const innerAudioContext = uni.createInnerAudioContext();
 			innerAudioContext.autoplay = true;
 			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
@@ -146,7 +159,7 @@
 						console.log(this.lisi)
 					}).catch(err => {
 						this.$refs.repeat.show({
-							title: "网络连接失败",
+							title: "无网络,请连接网络后再试~",
 							type: 'default',
 							position: 'bottom'
 						})
@@ -158,6 +171,19 @@
 			},
 			//获取扫码控件
 			getScanCode(val) {
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
 				console.log(val)
 				this.number = val
 				this.number_s = val

+ 27 - 0
pages/home/scancode/scancodeout.vue

@@ -72,6 +72,19 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			const innerAudioContext = uni.createInnerAudioContext();
 			innerAudioContext.autoplay = true;
 			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
@@ -152,6 +165,19 @@
 				console.log(val)
 				this.number = val
 				this.number_s = val
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
 				request({
 						url: '/storeScan/storeScanGetTyre',
 						method: 'Post',
@@ -161,6 +187,7 @@
 							tyreNum: this.number_s
 						}
 					}).then(res => {
+						console.log(res)
 						this.tips = "胎号"
 						for (let i = 0; i < this.lisi.length; i++) {
 							if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {

+ 114 - 18
pages/me/scancodequery/result.vue

@@ -1,49 +1,142 @@
 <!-- 胎号查询成功页面 -->
 <template>
 	<view>
-		<view class="head">
+		<view class="head" v-if="empty == true">
+			<view class="tips">
+				<br>
+				<br>
+				<u-empty icon-color="#FFFFFF" color="#FFFFFF" text="查询失败" mode="data"></u-empty>
+			</view>
+			<view class="stripe"></view>
+			<view class="roll">
+				<view>查询失败</view>
+				<view>
+					<view></view>
+					<view></view>
+					<u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
+				</view>
+				<view class="Exhibition">
+					<u-empty text="查询失败" mode="list"></u-empty>
+				</view>
+			</view>
+			<u-button type="primary" shape="circle" class="button" @click="scanning">立即查询</u-button>
+		</view>
+		
+		<view class="head" v-else>
 			<view class="tips">
 				<image src="../../../static/sailun/successful.png" mode=""></image>
 				<view>查询成功</view>
 			</view>
 			<view class="stripe"></view>
 			<view class="roll">
-				<view>232654561651</view>
+				<view>{{tireNumber}}</view>
 				<view>
 					<view></view>
 					<view></view>
 					<u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
 				</view>
 				<view class="Exhibition">
-					<view><text>轮胎胎号</text><text>232654561651</text></view>
-					<view><text>轮胎类型</text><text>扫码出库</text></view>
-					<view><text>轮胎品牌</text><text>赛轮轮胎</text></view>
-					<view><text>轮胎规格</text><text>12R22.5</text></view>
-					<view><text>创建时间</text><text>2020-02-22 10:22:23</text></view>
+					<view><text>轮胎胎号</text><text>{{tireNumber}}</text></view>
+					<view><text>轮胎类型</text><text>{{mouldType}}</text></view>
+					<view><text>轮胎品牌</text><text>{{brand}}</text></view>
+					<view><text>轮胎规格</text><text>{{specification}}</text></view>
+					<view><text>创建时间</text><text>{{createTime}}</text></view>
 				</view>
 			</view>
-			<u-button type="primary" shape="circle" class="button">继续查询</u-button>
+			<u-button type="primary" shape="circle" class="button" @click="scanning">继续查询</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
-				
-			};
+				datalist: '',
+				empty: true,
+				tireNumber: "未查询",
+				mouldType: '未查询',
+				brand: '未查询',
+				specification: '未查询',
+				createTime: '未查询'
+			}
 		},
-		created() {
-			this.add()
+		onReady() {
+			uni.getNetworkType({
+				success: function(res) {
+					let none = res.networkType
+					console.log(res.networkType);
+					if (none == 'none') {
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+				}
+			});
+			setTimeout(() => {
+				this.scanning()
+			}, 100)
+
 		},
 		methods: {
-			add(){
+			rendering() {
+				console.log(this.datalist)
+				request({
+					url: '/myapp/mouldSelect',
+					method: 'Post',
+					data: {
+						storeId: this.$store.state.storeInfo.storeId,
+						userId: this.$store.state.storeInfo.userId,
+						tireNumber: this.datalist,
+					}
+				}).then(res => {
+					console.log(res.data)
+					if(res.data.code == 0){
+						uni.showToast({
+							icon: 'none',
+							title: '查询成功',
+							position: "bottom"
+						})
+						this.empty = false
+						this.tireNumber = res.data.data.tireNumber
+						this.mouldType = res.data.data.mouldType
+						this.brand = res.data.data.brand
+						this.specification = res.data.data.specification
+						this.createTime = res.data.data.createTime
+					}else if (res.data.code == 500) {
+						this.empty = true
+						uni.showToast({
+							icon: 'none',
+							title: res.data.msg,
+							position: "bottom"
+						})
+					}
+				}).catch(err => {
+					console.log(err)
+					uni.showToast({
+						icon: 'none',
+						title: '出错了请联系管理员~',
+						position: "bottom"
+					})
+				}).finally(() => {
+					// Loading.close()
+				})
+			},
+			scanning() {
+				let this_ = this
 				uni.scanCode({
-				    success: function (res) {
-				        console.log('条码类型:' + res.scanType);
-				        console.log('条码内容:' + res.result);
-				    }
+					success: function(res) {
+						console.log('条码类型:' + res.scanType);
+						console.log('条码内容:' + res.result);
+						this_.datalist = res.result
+						this_.rendering()
+					}
 				})
 			}
 		}
@@ -122,6 +215,7 @@
 				margin-top: 60rpx;
 				width: 106rpx;
 				height: 112rpx;
+				margin-left: 10rpx;
 			}
 
 			view {
@@ -138,9 +232,11 @@
 		margin: 0 auto;
 		margin-top: 25rpx;
 	}
-	.Exhibition>view{
+
+	.Exhibition>view {
 		margin-bottom: 10rpx;
 	}
+
 	.Exhibition>view>text:nth-child(2) {
 		float: right;
 	}