hwq 2 years ago
parent
commit
144d39e395
2 changed files with 32 additions and 1 deletions
  1. 9 0
      api/order.js
  2. 23 1
      pages/user/djqQm.vue

+ 9 - 0
api/order.js

@@ -162,3 +162,12 @@ export function express_query(data, id) {
 		data
 	});
 }
+
+// 自主核销
+export function myselfhx(data, id) {
+	return request({
+		url: '/api/produce/write/' + id,
+		method: 'post',
+		data
+	});
+}

+ 23 - 1
pages/user/djqQm.vue

@@ -31,12 +31,13 @@
 				</view>
 			</swiper-item>
 		</swiper>
+		<view class="submit" @click="myself()">自主核销</view>
 	</view>
 </template>
 
 <script>
 import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
-import { view_order } from '@/api/order.js';
+import { view_order, myselfhx } from '@/api/order.js';
 import { getYhqDetail } from '@/api/user.js';
 export default {
 	components: {
@@ -108,6 +109,16 @@ export default {
 				obj.item = data.item;
 				console.log(obj.item, '123456');
 			});
+		},
+		myself() {
+			myselfhx({}, this.id).then(e => {
+				this.$api.msg('自主核销成功');
+				setTimeout(() => {
+					uni.navigateTo({
+						url: '/pages/user/myyhq'
+					});
+				}, 500);
+			});
 		}
 	}
 };
@@ -227,4 +238,15 @@ page {
 		}
 	}
 }
+.submit {
+	margin: 40rpx auto;
+	width: 560rpx;
+	background: linear-gradient(90deg, #fe6f61 0%, #ff4343 100%);
+	color: #ffffff;
+	text-align: center;
+	padding: 26rpx 0rpx;
+	font-size: 28rpx;
+	font-weight: 500;
+	border-radius: 10rpx;
+}
 </style>