瀏覽代碼

修改胎号查询

caojunjie 4 年之前
父節點
當前提交
9644152bfc
共有 6 個文件被更改,包括 162 次插入77 次删除
  1. 1 1
      manifest.json
  2. 1 1
      pages.json
  3. 3 3
      pages/home/Scan-code-in/index.vue
  4. 1 0
      pages/home/scancode/index.vue
  5. 6 2
      pages/me/index.vue
  6. 150 70
      pages/me/scancodequery/result.vue

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "耀灵全钢店管家",
     "appid" : "__UNI__0C3473D",
     "description" : "测试",
-    "versionName" : "0.0.0.0.0.6",
+    "versionName" : "0.0.0.0.0.7",
     "versionCode" : "100",
     "transformPx" : false,
     "app-plus" : {

+ 1 - 1
pages.json

@@ -231,7 +231,7 @@
 			{
 				"path": "scancodequery/result",
 				"style": {
-					"navigationBarTitleText": "查询结果"
+					"navigationBarTitleText": "胎号查询"
 				}
 			},
 			//入库明细

+ 3 - 3
pages/home/Scan-code-in/index.vue

@@ -29,11 +29,11 @@
 				</u-tr>
 
 			</u-table>
-			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">奖励明细</view>
+			<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">{{rewardMoney}}奖励</u-td>
-					<u-td class="u-td">{{rewardIntegral}}积分</u-td>
+					<u-td class="u-td">奖励:{{rewardMoney}}元</u-td>
+					<u-td class="u-td">积分:{{rewardIntegral}}个</u-td>
 				</u-tr>
 			</u-table>
 		</u-modal>

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

@@ -272,6 +272,7 @@
 								type: 'default',
 								position: 'bottom'
 							})
+							
 							const innerAudioContext = uni.createInnerAudioContext();
 							innerAudioContext.autoplay = true;
 							innerAudioContext.src = '../../../static/mp3/scanfailed.mp3';

+ 6 - 2
pages/me/index.vue

@@ -206,7 +206,10 @@
 </template>
 
 <script>
-	import {mapState,mapMutations} from 'vuex'
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex'
 	import {
 		request
 	} from '../../common/request/request'
@@ -246,7 +249,7 @@
 			this.getMyinfo()
 		},
 		onShow() {
-			if(this.undataStore){
+			if (this.undataStore) {
 				this.getMyinfo()
 			}
 		},
@@ -290,6 +293,7 @@
 				})
 			},
 			inresult() {
+				console.log("触发了")
 				this.$u.route({
 					url: 'pages/me/scancodequery/result',
 				})

+ 150 - 70
pages/me/scancodequery/result.vue

@@ -1,49 +1,44 @@
 <!-- 胎号查询成功页面 -->
 <template>
 	<view>
-		<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>{{text}}</view>
+		<view class="head">
+			<view class="tips" @click="scanning">
 				<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><text>点击扫码</text></view>
 				</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>{{tireNumber}}</view>
 				<view>
-					<view></view>
-					<view></view>
+					<view @click="show =! show">
+						<u-icon name="edit-pen"></u-icon>手动录入
+					</view>
+					<view class="lnput" v-if="show==false">
+						<input type="text" v-model="number" placeholder="请输入胎号" clearable="true" focus="true" />
+						<u-button type="primary" size="medium" @click="query">查询</u-button>
+					</view>
+					<view class="roll_s" v-else>
+						<view>{{datalist}}</view>
+					</view>
+				</view>
+				<view>
+					<view class="left"></view>
+					<view class="right"></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>{{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 class="Exhibition" v-if="show_s == false">
+					<view><text>轮胎胎号</text><text>{{Information.tireNumber}}</text></view>
+					<view><text>轮胎品牌</text><text>{{Information.brand}}</text></view>
+					<view><text>轮胎规格</text><text>{{Information.specification}}</text></view>
+					<view><text>操作类型</text><text>{{Information.mouldInType}}</text></view>
+					<view><text>操作时间</text><text>{{Information.mouldInTime}}</text></view>
+					<view><text>操作类型</text><text>{{Information.mouldOutType}}</text></view>
+					<view><text>操作时间</text><text>{{Information.mouldOutTime}}</text></view>
+				</view>
+				<view v-else style="margin-top: 100rpx;margin-bottom: 100rpx;">
+					<u-empty :text="text" mode="list"></u-empty>
 				</view>
 			</view>
-			<u-button type="primary" shape="circle" class="button" @click="scanning">继续查询</u-button>
 		</view>
 	</view>
 </template>
@@ -56,14 +51,20 @@
 	export default {
 		data() {
 			return {
-				datalist: '',
+				datalist: '请扫码查询或手动录入',
+				number:'',
 				empty: true,
-				tireNumber: "未查询",
-				mouldType: '未查询',
-				brand: '未查询',
-				specification: '未查询',
-				createTime: '未查询',
-				text:'查询失败'
+				mouldOutTime: '',
+				mouldOutType: '',
+				mouldInTime: '',
+				mouldInType: '',
+				tireNumber: "",
+				brand: '',
+				specification: '',
+				text: '请扫码或输入胎号',
+				show: true,
+				show_s:true,
+				Information:[]
 			}
 		},
 		onReady() {
@@ -80,9 +81,9 @@
 					}
 				}
 			});
-			setTimeout(() => {
-				this.scanning()
-			}, 100)
+			// uni.$on('update', data => {
+			// 	this.datalist = data.materialList
+			// })
 
 		},
 		methods: {
@@ -97,21 +98,20 @@
 						tireNumber: this.datalist,
 					}
 				}).then(res => {
+					this.Information = []
 					console.log(res.data)
-					if(res.data.code == 0){
+					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.show_s = false
+						this.Information = res.data.data
+					} else if (res.data.code == 500) {
 						this.empty = true
+						this.show_s = true
 						uni.showToast({
 							icon: 'none',
 							title: res.data.msg,
@@ -140,20 +140,99 @@
 						this_.rendering()
 					}
 				})
+			},
+			query() {
+				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.number,
+					}
+				}).then(res => {
+					this.Information = []
+					console.log(res.data)
+					if (res.data.code == 0) {
+						uni.showToast({
+							icon: 'none',
+							title: '查询成功',
+							position: "bottom"
+						})
+						this.empty = false
+						this.show_s = false
+						this.Information = res.data.data
+						
+					} else if (res.data.code == 500) {
+						this.empty = true
+						this.show_s = true
+						this.text = res.data.msg
+						uni.showToast({
+							icon: 'none',
+							title: res.data.msg,
+							position: "bottom"
+						})
+					}
+					this.text = res.data.msg
+				}).catch(err => {
+					console.log(err)
+					uni.showToast({
+						icon: 'none',
+						title: '出错了请联系管理员~',
+						position: "bottom"
+					})
+				}).finally(() => {
+					// Loading.close()
+				})
 			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
+	.roll>view:nth-child(1)>view:nth-child(1) {
+		width: 200rpx;
+		color: #0094FE;
+		position: relative;
+		top: -40rpx;
+		left: 400rpx;
+		font-size: 32rpx;
+		text-align: center;
+	}
+
+	.lnput>input {
+		background-color: none;
+		width: 50%;
+		font-size: 42rpx;
+		float: left;
+		margin-top: 10rpx;
+		margin-left: 20rpx;
+		margin-right: 20rpx;
+		font-weight: bold;
+		color: #0192FD;
+	}
+
+	.lnput>u-button {
+		margin-left: 10rpx;
+	}
+
 	.button {
 		width: 90%;
 		margin-top: 200rpx;
 	}
 
+	.roll_s {
+		font-size: 42rpx;
+		font-weight: bold;
+		color: #0192FD;
+		margin-bottom: 50rpx;
+		text-align: center;
+	}
+
 	.head {
 		width: 750rpx;
-		height: 440rpx;
+		height: 650rpx;
 		background-color: #0095FF;
 
 		.stripe {
@@ -165,14 +244,6 @@
 			margin-top: 40rpx;
 		}
 
-		.roll>view:nth-child(1) {
-			font-size: 42rpx;
-			font-weight: bold;
-			color: #0192FD;
-			text-align: center;
-			margin-bottom: 50rpx;
-		}
-
 		.roll {
 			width: 600rpx;
 			height: auto;
@@ -189,8 +260,7 @@
 				width: 100%;
 				height: auto;
 
-				view:nth-child(1),
-					{
+				.left {
 					width: 50rpx;
 					height: 50rpx;
 					background-color: #F4F4F4;
@@ -199,7 +269,7 @@
 					margin-left: -30rpx;
 				}
 
-				view:nth-child(2) {
+				.right {
 					width: 50rpx;
 					height: 50rpx;
 					background-color: #F4F4F4;
@@ -212,19 +282,29 @@
 
 		.tips {
 			text-align: center;
-
-			image {
-				margin-top: 60rpx;
-				width: 106rpx;
-				height: 112rpx;
-				margin-left: 10rpx;
-			}
+			height: 500rpx;
 
 			view {
-				margin-top: 50rpx;
+				width: 500rpx;
+				height: 500rpx;
+				background-color: rgba(255, 255, 255, 0.1);
+				border-radius: 20rpx;
+				margin: 0 auto;
 				color: #FFFFFF;
 				font-size: 32rpx;
 				font-weight: bold;
+				padding-top: 2%;
+
+				view {
+					width: 92%;
+					height: 96%;
+					background-color: #000000;
+					padding-top: 41%;
+
+					text {
+						font-size: 42rpx;
+					}
+				}
 			}
 		}
 	}