From b574291c99bba5819fe2d69405ffa10e9d47d994 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 03 二月 2026 18:05:44 +0800
Subject: [PATCH] 代码初始化

---
 web/pages/index/index.vue |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/web/pages/index/index.vue b/web/pages/index/index.vue
index d8411ae..3f023c0 100644
--- a/web/pages/index/index.vue
+++ b/web/pages/index/index.vue
@@ -53,10 +53,12 @@
 					money: '',
 					remark: '',
 					userId:''
-				}
+				},
+				loading:false
 			}
 		},
 		mounted() {
+			this.loading=false
 			this.form.userId = this.fetchParams("userId",window.location.href)
 		},
 		methods: {
@@ -75,17 +77,23 @@
 				return decodeURIComponent(results[2].replace(/\+/g, ' '));
 			},
 			async sendSave() {
+				if(this.loading){
+					return
+				}
+				this.loading=true
 				var that = this
 				if(!this.form.name){
 					uni.showToast({
 						'title': '璇疯緭鍏ュ鍚�',icon:'none'
 					})
+					this.loading=false
 					return
 				}
 				if(!this.form.phone){
 					uni.showToast({
 						'title': '璇疯緭鍏ユ墜鏈哄彿',icon:'none'
 					})
+					this.loading=false
 					return
 				}
 				if(!this.form.money || this.form.money < 0.01){
@@ -95,21 +103,15 @@
 					return
 				}
 				let res = await this.$u.api.orderCreate(this.form)
-				if (res.code === 200) {
+				if (res && res.code === 200) {
 					 const url = res.data.url
-					 // axios.post('https://third-party-website.com/api/submit', this.formData, {
-					 //   headers: { 'Content-Type': 'application/json' } // 鏍规嵁闇�瑕佹坊鍔犲叾浠栧ご閮ㄤ俊鎭紝濡傝璇佷护鐗岀瓑銆�
-					 // })
-					 // axios.post(res.data.url, res.data.params);
-					// const resolve = this.$router.push(url,params);
-					// window.open(resolve.href, "_blank")
-					 console.log(res)
 					 const elements = document.querySelectorAll('form');
 					 if(elements&& elements.length){
 						 elements.forEach(element => {
 						     element.remove();
 						 })
 					 }
+					 uni.showToast({title:'鍙戣捣鏀粯涓�'})
 					 var demo_form = document.createElement("form");
 					   demo_form.action = url;
 					   demo_form.id = "tempFromId";
@@ -128,13 +130,11 @@
 						   }
 					   }
 					   document.body.appendChild(demo_form)
-					   uni.showToast({
-					   	'title': '鐗规寫鍓�',icon:'none'
-					   })
 					   demo_form.submit() 
 					   
 					// this.toSuccess()
 				}
+				this.loading=false
 			},
 		}
 	}

--
Gitblit v1.9.3