From 1dcd8399c853ef724133d4d1ad0d700db0f293e7 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 12 二月 2026 18:19:50 +0800
Subject: [PATCH] 经销商管理pay

---
 mini-program/pagesA/pages/write-off/write-off.vue |  122 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 117 insertions(+), 5 deletions(-)

diff --git a/mini-program/pagesA/pages/write-off/write-off.vue b/mini-program/pagesA/pages/write-off/write-off.vue
index 0314a76..21fc787 100644
--- a/mini-program/pagesA/pages/write-off/write-off.vue
+++ b/mini-program/pagesA/pages/write-off/write-off.vue
@@ -2,22 +2,122 @@
 	<view class="box">
 		<view class="title">杈撳叆鑷彁鐮�</view>
 		<view class="input">
-			<input type="number" placeholder="璇疯緭鍏�6浣嶈嚜鎻愮爜" />
+			<input type="number" v-model="code" placeholder="璇疯緭鍏�6浣嶈嚜鎻愮爜" />
 		</view>
-		<view class="btn">纭</view>
-		<view class="footer">
-			<image src="/pagesA/images/ic_saoma@2x.png" mode="widthFix"></image>
+		<view class="btn" v-if="!loading" @click="confirmDo">纭</view>
+		<view class="btn1" v-if="loading" >姝e湪鏌ヨ</view>
+		<view class="footer" @click="scanCodeDo">
+			<image src="/pagesA/static/ic_saoma@2x.png" mode="widthFix"></image>
 			<text>鎵爜鏍搁攢</text>
 		</view>
+		<u-popup :show="show1" round="15" :safeAreaInsetBottom="false" mode="center">
+			<view class="tc">
+				<view class="tc-contemt">
+					<view class="tc-contemt-title">璁㈠崟鏌ヨ缁撴灉</view>
+					<view class="tc-contemt-nr">
+						璁㈠崟銆恵{info.code}}銆戜笉婊¤冻鏍搁攢鏉′欢锛�
+					</view>
+				</view>
+				<view class="tc-btn">
+					<view class="tc-btn-item" @click="show1=false ">纭</view>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
+	import QRCode from 'qrcode';
+	import { mapState } from 'vuex'
 	export default {
+		computed: {
+			...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
+		},
 		data() {
 			return {
-				
+				code:null,
+				show1:false,
+				loading:false,
+				id:null,
+				info:{}
 			};
+		},
+		onShow() {
+			this.loading =false
+			this.show1 =false
+			this.info={}
+			this.code =''
+			this.checkShopLogin()
+		},
+		onLoad(options) {
+		},
+		methods:{
+			scanCodeDo(){
+				this.code = ''
+				var that =this
+				uni.scanCode({
+				    success: function (res) {
+				        console.log('鏉$爜绫诲瀷锛�' + res.scanType);
+				        console.log('鏉$爜鍐呭锛�' + res.result);
+				        // 澶勭悊鎵弿缁撴灉
+						that.code = res.result
+						that.confirmDo()
+				    },
+				    fail: function (err) {
+						uni.showToast({
+							title:'鎵爜澶辫触',
+							icon:'error'
+						})
+				    }
+				});
+			},
+			async confirmDo(){
+				if(this.code ){
+					this.getShopDetail()
+				}
+			},
+			jumpWriteoffA(){
+				if(this.info && this.info.orderId){
+					uni.navigateTo({
+						url: '/pagesA/pages/write-off-a/write-off-a?id='+this.info.orderId
+					})
+				}
+			},
+			jumpBack(){
+				uni.navigateBack({delta:1})
+			}, 
+			 getShopDetail(){
+				if(this.loading){
+					return
+				}
+				this.loading =true
+				var that =this 
+				that.$u.api.getOrderDetailByCode({exchangeCode:this.code,tokenType:1  })
+				.then(res=>{
+					console.log(res)
+					if (res.code === 200) {
+						that.info = res.data 
+						if(res.data.orderStatus == 1 && res.data.receiveType ==1){
+							that.jumpWriteoffA()
+						}else{
+							this.show1 = !this.show1
+							this.loading =false
+						}
+					} 
+				}).catch(e=>{
+					this.loading =false
+				}).finally(e=>{
+					// this.loading =false
+				})
+			},
+			checkShopLogin(){
+				var that =this
+				if( this.shopInfo ==null || this.shopInfo.id==null ||  this.shopToken==null || this.shopToken==''){
+					uni.navigateTo({
+						url: '/pages/login/login'
+					})
+				} 
+			},
 		}
 	}
 </script>
@@ -55,6 +155,18 @@
 				text-align: center;
 			}
 		}
+		.btn1{
+			width: 630rpx;
+			height: 88rpx;
+			line-height: 88rpx;
+			text-align: center;
+			background: #666666;
+			border-radius: 44rpx;
+			font-weight: 600;
+			font-size: 32rpx;
+			color: #FFFFFF;
+			margin-top: 40rpx;
+		}
 		.btn {
 			width: 630rpx;
 			height: 88rpx;

--
Gitblit v1.9.3