lhl пре 2 година
родитељ
комит
af9d66e390
4 измењених фајлова са 114 додато и 41 уклоњено
  1. 9 0
      api/index.js
  2. 105 41
      pages/home/user.vue
  3. BIN
      static/icon/close.png
  4. BIN
      static/image/hxbg.png

+ 9 - 0
api/index.js

@@ -76,4 +76,13 @@ export function getStoreList(data) {
 		method: 'get',
 		data
 	})
+}
+
+//普通商品核销
+export function orderVerific(data) {
+	return request({
+		url: '/api/order/order_verific',
+		method: 'post',
+		data
+	});
 }

+ 105 - 41
pages/home/user.vue

@@ -156,6 +156,27 @@
 				</view>
 			</view>
 		</view>
+		<!-- 核销弹窗 -->
+		<uni-popup ref="popuphx" class="agree-wrapper">
+			<view class="hx-wrapper">
+				<view class="hx-img">
+					<image src="../../static/image/hxbg.png" mode=""></image>
+				</view>
+				<view class="hx-body">
+					<!-- <view class="hx-title">
+						核销码
+					</view> -->
+					<input type="text" v-model="code" placeholder="请输入核销码" placeholder-class="hx-placeholder" />
+					<!-- <image src="../../static/icon/scend.png" mode=""></image> -->
+					<view class="hx-btn" @click="qhx">
+						立即核销
+					</view>
+				</view>
+				<view class="hx-close" @click="close">
+					<image src="../../static/icon/close.png" mode=""></image>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 <script>
@@ -177,9 +198,6 @@
 		adminStatistics
 	} from '@/api/water.js';
 	import {
-		articleList,
-		notify,
-		rentVerific,
 		orderVerific
 	} from '@/api/index.js';
 	import {
@@ -227,7 +245,7 @@
 				if (that.code == '') {
 					return that.$api.msg('请输入核销码')
 				}
-				if (that.hxtype == 0) {
+
 					that.hxLoading = true
 					orderVerific({
 						verify_code: that.code,
@@ -243,25 +261,7 @@
 					}).catch(err => [
 						that.hxLoading = false
 					])
-				} else {
-					if (that.dcode == '') {
-						return that.$api.msg('请输入电池编号')
-					}
-					that.hxLoading = false
-					rentVerific({
-						verify_code: that.code,
-						battery_number: that.dcode,
-						is_confirm: 1
-					}).then(res => {
-						uni.showToast({
-							title: '核销成功',
-							mask: true,
-							duration: 1500
-						});
-						that.close()
-						that.hxLoading = false
-					})
-				}
+				
 			},
 			openHx() {
 				this.$refs.popuphx.open()
@@ -281,15 +281,7 @@
 						scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
 						success: function(res) {
 							var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
-							let arr = result.split('&');
-							if (arr.length > 1) {
-								that.code = arr[0];
-								that.dcode = arr[1] || '';
-								that.hxtype = 1;
-							} else {
-								that.code = arr[0];
-								that.hxtype = 0;
-							}
+							that.code = result
 							that.openHx();
 							// 判断是否为电池核销
 
@@ -305,15 +297,7 @@
 				uni.scanCode({
 					success: (res) => {
 						let result = res.result
-						let arr = result.split('&')
-						if (arr.length > 1) {
-							that.code = arr[0];
-							that.dcode = arr[1] || '';
-							that.hxtype = 1;
-						} else {
-							that.code = arr[0];
-							that.hxtype = 0;
-						}
+						that.code = result
 						that.openHx();
 					}
 				})
@@ -563,4 +547,84 @@
 			}
 		}
 	}
+	.hx-wrapper {
+		width: 536rpx;
+		// height: 630rpx;
+		position: relative;
+		padding-bottom: 40rpx;
+		background-color: #fff;
+		border-radius: 20rpx;
+	
+		.hx-img {
+			width: 536rpx;
+			height: 281rpx;
+	
+			image {
+				width: 536rpx;
+				height: 281rpx;
+			}
+		}
+	
+		.hx-close {
+			position: absolute;
+			left: 243rpx;
+			bottom: -80rpx;
+			width: 52rpx;
+			height: 52rpx;
+	
+			image {
+				width: 52rpx;
+				height: 52rpx;
+			}
+		}
+	
+		.hx-body {
+			width: 536rpx;
+			// min-height: 349rpx;
+			background-color: #fff;
+			border-radius: 0 0 10rpx 10rpx;
+			padding-top: 40rpx;
+	
+			.hx-title {
+				width: 536rpx;
+				font-size: 36rpx;
+				font-weight: 500;
+				color: #333333;
+				line-height: 1;
+				padding-top: 42rpx;
+				text-align: center;
+				padding-bottom: 10rpx;
+			}
+	
+			input {
+				width: 439rpx;
+				height: 68rpx;
+				background: #f1faf6;
+				border-radius: 10rpx;
+				margin: 0 auto 40rpx;
+				padding-left: 26rpx;
+	
+				.hx-placeholder {
+					font-size: 26rpx;
+					font-weight: 500;
+					color: $base-color;
+				}
+			}
+	
+			.hx-btn {
+				margin: 44rpx auto 0;
+				width: 353rpx;
+				height: 71rpx;
+				background: $base-color;
+				border-radius: 34rpx;
+				font-size: 36rpx;
+				font-weight: 500;
+				color: #F8F9F9;
+				line-height: 71rpx;
+				text-align: center;
+			}
+	
+	
+		}
+	}
 </style>

BIN
static/icon/close.png


BIN
static/image/hxbg.png