From e9a7cddce776382916e975402986144a88899ac5 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 14 五月 2026 18:29:14 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/gtzxinglijicun

---
 small-program/shop/pages/write-off-a/write-off-a.vue |  180 ++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 140 insertions(+), 40 deletions(-)

diff --git a/small-program/shop/pages/write-off-a/write-off-a.vue b/small-program/shop/pages/write-off-a/write-off-a.vue
index 9aff9ff..db5cecf 100644
--- a/small-program/shop/pages/write-off-a/write-off-a.vue
+++ b/small-program/shop/pages/write-off-a/write-off-a.vue
@@ -103,7 +103,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="tips" v-if="info.overdueStatus !==0">
+			<view class="tips" v-if="info.overdueStatus !==0 &&info.overdueStatus !==2">
 				<image src="/static/icon/ic_waring@2x.png" mode="widthFix"></image>
 				<text  v-if="info.overdueStatus ===1">宸茶秴杩囧彇浠舵椂闂达紝宸蹭骇鐢熻秴鏃惰垂鐢細楼{{((info.overdueFee || 0)/100).toFixed(2)}}鍏�</text> 
 				<text  v-if="info.overdueStatus ===3">宸茶秴杩囧彇浠舵椂闂达紝绛夊緟瀹㈡埛鏀粯瓒呮椂璐圭敤锛毬{((info.overdueFee || 0)/100).toFixed(2)}}鍏�</text>
@@ -155,9 +155,10 @@
 		</view>
 		<view class="footer" >
 			<view class="footer-btns">
-				<view class="btn you"  v-if="info.status ===1 ||info.status ===4  "   @click="show0=true" >鏀朵欢鏍搁攢</view>
+				<view class="btn you"  v-if="info.status >0 || info.status <=7  "   @click="printerOrder1()" >鎵撳嵃鏍囩</view>
+				<view class="btn you"  v-if="info.status ===1 ||info.status ===4  "   @click="confirmWriteOff()"  >鏀朵欢鏍搁攢</view>
 				<view class="btn you" v-if="info.status ===5 &&(info.overdueStatus ==0 || info.overdueStatus == 1)"  @click="show2=true" >纭鍒板簵</view>
-				<view class="btn you" v-if="info.status ===5 && (info.overdueStatus == 4 || info.overdueStatus == 2)"  @click="show1=true"  >鍙栦欢鏍搁攢</view>
+				<view class="btn you" v-if="info.status ===5 && (info.overdueStatus == 4 || info.overdueStatus == 2)"  @click="confirmPickup()"  >鍙栦欢鏍搁攢</view>
 <!-- 				<view class="btn you" v-if="info.status ===4"  @click="show3=true"  >纭鏀朵欢</view>
  -->			</view>
 		</view>
@@ -166,7 +167,7 @@
 				<view class="tc-contemt">
 					<view class="tc-contemt-title" >纭鏀朵欢</view>
 					<view class="input-c">
-						<view class="input-label">鎷嶇収鏀朵欢<text style="color: red;">*</text><text style="color: #666666;">锛堟渶澶�3寮犵収鐗囷級</text></view>
+						<view class="input-label">鎷嶇収鏀朵欢<text style="color: red;" v-if="info.type === 1">*</text><text style="color: #666666;">锛堟渶澶�3寮犵収鐗囷級</text></view>
 						<view class="upload-row">
 							<view class="upload-box" @click="chooseAndUploadImage(3)">
 								<view class="upload-plus">+</view>
@@ -283,18 +284,20 @@
 
 	export default {
 		computed: {
-			...mapState(['navHeight', 'statusbarHeight'])
+			...mapState(['navHeight', 'statusbarHeight', 'latitude', 'longitude'])
 		},
 		data() {
 			return {
 				id:null,
 				show1:false,
 				show0:false,
+				loading:false,
 				show3:false,
 				show2:false,
 				info:{},
-				latitude: null,
-				longitude: null,
+				inRadius: false,
+				// latitude: null,
+				// longitude: null,
 				photoList:[],
 				photoList1:[],
 				photoList3:[],
@@ -318,6 +321,7 @@
 		onLoad(options) {
 			this.info={} 
 			this.show2=false
+			this.loading=false
 			this.show1=false
 			this.show0=false
 			this.show3=false
@@ -342,26 +346,75 @@
 				orderId: this.id,
 				images:[]
 			}
-			this.positioning()
-			this.getOrderDetail0() 
+			this.checkRadiusAndGetDetail()
 		},
 		methods:{
-			// 瀹氫綅
-			positioning() {
-				var that = this;
+			confirmPickup() {
+				if (!this.inRadius) {
+					uni.showToast({
+						title: '鎮ㄥ綋鍓嶄綅缃笌鏀惰揣鍦板潃璺濈瓒呭嚭鑼冨洿锛岃鍦ㄥ湴鍧�闄勮繎閲嶆柊鎷嶇収',
+						icon: 'none'
+					})
+					return
+				}
+				this.show1 = true
+			},
+			// 纭鏀朵欢鏍搁攢
+			confirmWriteOff() {
+				if (!this.inRadius) {
+					uni.showToast({
+						title: '鎮ㄥ綋鍓嶄綅缃笌鏀惰揣鍦板潃璺濈瓒呭嚭鑼冨洿锛岃鍦ㄥ湴鍧�闄勮繎閲嶆柊鎷嶇収',
+						icon: 'none'
+					})
+					return
+				}
+				this.show0 = true
+			},
+			async checkRadiusAndGetDetail() {
 				uni.getLocation({
 					type: 'gcj02',
-					highAccuracyExpireTime: 3000,
-					isHighAccuracy: true,
-					success: function (addr) {
-						if(!addr){
-							return
+					success: async (res) => {
+						const radiusRes = await this.$u.api.checkShopOperationRadius({
+							lat: res.latitude,
+							lng: res.longitude,
+							orderId: this.id
+						})
+						if (radiusRes.code === 200) {
+							if (!radiusRes.data) {
+								uni.showToast({
+									title: '鎮ㄥ綋鍓嶄綅缃笌鏀惰揣鍦板潃璺濈瓒呭嚭鑼冨洿锛岃鍦ㄥ湴鍧�闄勮繎閲嶆柊鎷嶇収',
+									icon: 'none'
+								})
+							}
+							this.inRadius = radiusRes.data
 						}
-						that.latitude=addr.latitude
-						that.longitude=addr.longitude
+						this.getOrderDetail0()
+					},
+					fail: () => {
+						uni.showToast({
+							title: '璇峰厛鎵撳紑浣嶇疆鏈嶅姟',
+							icon: 'none'
+						})
+						this.getOrderDetail0()
 					}
-				});
+				})
 			},
+			// // 瀹氫綅
+			// positioning() {
+			// 	var that = this;
+			// 	uni.getLocation({
+			// 		type: 'gcj02',
+			// 		highAccuracyExpireTime: 3000,
+			// 		isHighAccuracy: true,
+			// 		success: function (addr) {
+			// 			if(!addr){
+			// 				return
+			// 			}
+			// 			that.latitude=addr.latitude
+			// 			that.longitude=addr.longitude
+			// 		}
+			// 	});
+			// },
 			async chooseAndUploadImage(maxCount = 3) {
 				const currentCount = this.form.images.length
 				const remainingCount = maxCount - currentCount
@@ -551,19 +604,24 @@
 				let res = await that.$u.api.confirmArrivedOrder(this.form);
 				if (res.code === 200 ) { 
 					uni.showToast({
-						title: `鎿嶄綔鎴愬姛`,
+						title: '鎿嶄綔鎴愬姛',
 						icon: 'success'
 					})
 					uni.$emit('updateOrder',{info:this.info,delete:0})
-					that.getOrderDetail()
-					// uni.navigateBack({delta:-1})
+					setTimeout(function(){
+						 that.getOrderDetail()
+					},1000) 
 				} 
 			}, 
 			async storeOutOrderDo(){
+				uni.showToast({
+					title: '鎿嶄綔鎴愬姛',
+					icon: 'success'
+				})
 				var that =this
 				if (!this.form1.images || this.form1.images.length == 0) {
 					uni.showToast({
-						title: `璇蜂笂浼犲彇浠跺浘鐗嘸,
+						title:'璇蜂笂浼犲彇浠跺浘鐗�',
 						icon: 'warn'
 					})
 					return
@@ -571,30 +629,66 @@
 				let res = await that.$u.api.storeOutOrder(this.form1);
 				if (res.code === 200 ) { 
 					uni.showToast({
-						title: `鏍搁獙鎴愬姛`,
+						title: '鏍搁獙鎴愬姛',
 						icon: 'success'
 					})
-					uni.$emit('updateOrder',{info:this.info,delete:0})
-					that.getOrderDetail()
+					// uni.$emit('updateOrder',{info:this.info,delete:0})
+					setTimeout(function(){
+						 that.getOrderDetail()
+					},1000) 
 				} 
 			}, 
+			async printerOrder(){
+				try{
+					var that =this
+					 that.$u.api.printOrderLabel({ orderId: this.id }).then(res=>{})
+				}catch(e){
+				} 
+				
+			},
+			async printerOrder1(){
+				if(this.loading){
+					return
+				}
+				this.loading =true
+				try{
+					var that =this
+					 that.$u.api.printOrderLabel({ orderId: this.id }).then(res=>{
+						 if (res.code === 200 ) {
+							 uni.showToast({
+							 	title:'鍙戣捣鎵撳嵃璇锋眰鎴愬姛',
+								icon:'none'
+							 })
+						 } 
+						 that.loading =false
+					 })
+				}catch(e){
+					this.loading =false
+				} 
+				
+			},
 			async shopVerifyOrderDo(){
 				var that =this
-				if (!this.form.images || this.form.images.length == 0) {
-					uni.showToast({
-						title: `璇蜂笂浼犳敹浠跺浘鐗嘸,
-						icon: 'warn'
-					})
-					return
+				if (this.info.type === 1) {
+					if (!this.form.images || this.form.images.length == 0) {
+						uni.showToast({
+							title: '璇蜂笂浼犳敹浠跺浘鐗�',
+							icon: 'warn'
+						})
+						return
+					}
 				}
 				let res = await that.$u.api.shopVerifyOrder(this.form);
 				if (res.code === 200 ) { 
 					uni.showToast({
-						title: `鏍搁獙鎴愬姛`,
+						title:'鏍搁獙鎴愬姛',
 						icon: 'success'
 					})
-					uni.$emit('updateOrder',{info:this.info,delete:0})
-					that.getOrderDetail()
+					  uni.$emit('updateOrder',{info:this.info,delete:0})
+					  that.printerOrder()
+					 setTimeout(function(){
+						 that.getOrderDetail()
+					 },1000) 
 				} 
 			}, 
 			async  getOrderDetail(){
@@ -615,16 +709,22 @@
 				let res = await this.$u.api.shopOrderDetail( {orderId:this.id} )
 				if (res.code === 200) { 
 					this.info = res.data 
-					if(res.data.status === 1 ){
+					if(res.data.status === 1 ||res.data.status === 4 ){
 						that.actionType = 0
-						that.show0 = true
+						if (this.inRadius) {
+							that.show0 = true
+						}
 						//info.overdueStatus ==0 || info.overdueStatus == 1
 					}else if(res.data.status === 5 && (res.data.overdueStatus ==4 || res.data.overdueStatus == 2)){
 						that.actionType = 1
-						that.show1 = true
+						if (this.inRadius) {
+							that.show1 = true
+						}
 					}else if(res.data.status === 5 && (res.data.overdueStatus ==0 || res.data.overdueStatus == 1)){
 						that.actionType = 1
-						that.show2 = true
+						if (this.inRadius) {
+							that.show2 = true
+						}
 					}else{
 						/* uni.showToast({
 							title:'璁㈠崟鐘舵�佸凡娴佽浆锛屽綋鍓嶆棤娉曟牳楠岋紒',

--
Gitblit v1.9.3