c18acc6e by lttnew
2 parents 3915c951 9a38e7d0
...@@ -1780,7 +1780,7 @@ export function cancelPay(id) { ...@@ -1780,7 +1780,7 @@ export function cancelPay(id) {
1780 1780
1781 export const outputInvoiceNo = (data) => { 1781 export const outputInvoiceNo = (data) => {
1782 return request({ 1782 return request({
1783 url: `/common/order/outputInvoiceNo/${data.id}`, 1783 url: `/common/order/outputInvoiceNo/${data.id}?taxno=${data.taxno}&phone=${data.phone}&name=${data.name}&invoiceType=${data.invoiceType}&amount=${data.amount}`,
1784 method: 'post', 1784 method: 'post',
1785 params: data 1785 params: data
1786 }) 1786 })
......
1 // dev 1 // dev
2 // const baseUrl_api = 'http://192.168.1.125:8787' 2 // const baseUrl_api = 'http://192.168.1.125:8787'
3 const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/' 3 const baseUrl_api = 'http://47.98.186.233:8787'
4 // const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/'
4 const loginImage_api = 'https://tk001.wxjylt.com/stage-api' 5 const loginImage_api = 'https://tk001.wxjylt.com/stage-api'
5 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' 6 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
6 7
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
6 <text class="label">发票类型</text> 6 <text class="label">发票类型</text>
7 <view class="type-select"> 7 <view class="type-select">
8 <view 8 <view
9 :class="{ active: form.invoiceType === '2' }"
9 class="type-option" 10 class="type-option"
10 :class="{ active: form.invoiceType === '1' }" 11 @click="form.invoiceType = '2'"
11 @click="form.invoiceType = '1'"
12 > 12 >
13 <view class="type-icon"></view> 13 <view class="type-icon"></view>
14 <view class="type-info"> 14 <view class="type-info">
...@@ -17,9 +17,10 @@ ...@@ -17,9 +17,10 @@
17 </view> 17 </view>
18 </view> 18 </view>
19 <view 19 <view
20 v-if="type==0"
21 :class="{ active: form.invoiceType === '1' }"
20 class="type-option" 22 class="type-option"
21 :class="{ active: form.invoiceType === '2' }" 23 @click="form.invoiceType = '1'"
22 @click="form.invoiceType = '2'"
23 > 24 >
24 <view class="type-icon enterprise"></view> 25 <view class="type-icon enterprise"></view>
25 <view class="type-info"> 26 <view class="type-info">
...@@ -29,30 +30,30 @@ ...@@ -29,30 +30,30 @@
29 </view> 30 </view>
30 </view> 31 </view>
31 </view> 32 </view>
32 33
33 <!-- 发票抬头 --> 34 <!-- 发票抬头 -->
34 <view class="form-item column"> 35 <view class="form-item column">
35 <text class="label">发票抬头</text> 36 <text class="label">发票抬头</text>
36 <input 37 <input
37 class="input"
38 v-model="form.name" 38 v-model="form.name"
39 class="input"
39 placeholder="请输入公司全称或个人姓名" 40 placeholder="请输入公司全称或个人姓名"
40 /> 41 />
41 <text class="hint">请确保发票抬头与公司营业执照或个人身份证上的名称一致。</text> 42 <text class="hint">请确保发票抬头与公司营业执照或个人身份证上的名称一致。</text>
42 </view> 43 </view>
43 44
44 <!-- 纳税人识别号(企业才显示) --> 45 <!-- 纳税人识别号(企业才显示) -->
45 <view class="form-item column" v-if="form.invoiceType === '2'"> 46 <view v-if="form.invoiceType === '1'" class="form-item column">
46 <text class="label">纳税人识别号</text> 47 <text class="label">纳税人识别号</text>
47 <input 48 <input
48 class="input"
49 v-model="form.taxno" 49 v-model="form.taxno"
50 placeholder="请输入纳税人识别号" 50 class="input"
51 maxlength="20" 51 maxlength="20"
52 placeholder="请输入纳税人识别号"
52 /> 53 />
53 <text class="hint">企业税务登记证上的号码,一般为 15、18 或 20 位</text> 54 <text class="hint">企业税务登记证上的号码,一般为 15、18 或 20 位</text>
54 </view> 55 </view>
55 56
56 <!-- 接收方式 --> 57 <!-- 接收方式 -->
57 <view class="form-item"> 58 <view class="form-item">
58 <text class="label">接收方式</text> 59 <text class="label">接收方式</text>
...@@ -67,29 +68,29 @@ ...@@ -67,29 +68,29 @@
67 </view> 68 </view>
68 </view> 69 </view>
69 </view> 70 </view>
70 71
71 <!-- 开票金额 --> 72 <!-- 开票金额 -->
72 <!-- <view class="form-item"> 73 <!-- <view class="form-item">
73 <text class="label">开票金额</text> 74 <text class="label">开票金额</text>
74 <text class="amount">¥ {{ (Number(form.amount)).toFixed(2) }}</text> 75 <text class="amount">¥ {{ (Number(form.amount)).toFixed(2) }}</text>
75 </view> --> 76 </view> -->
76 77
77 <!-- 接收邮箱 --> 78 <!-- 接收邮箱 -->
78 <view class="form-item column"> 79 <view class="form-item column">
79 <text class="label">接收邮箱号码</text> 80 <text class="label">接收邮箱号码</text>
80 <input 81 <input
81 class="input"
82 v-model="form.phone" 82 v-model="form.phone"
83 class="input"
83 placeholder="请输入接收发票的邮箱号码" 84 placeholder="请输入接收发票的邮箱号码"
84 type="text" 85 type="text"
85 /> 86 />
86 <text class="hint">电子发票将在 3-5 个工作日内发送至该邮箱</text> 87 <text class="hint">电子发票将在 3-5 个工作日内发送至该邮箱</text>
87 </view> 88 </view>
88 </view> 89 </view>
89 90
90 <!-- 提交按钮 --> 91 <!-- 提交按钮 -->
91 <view class="btn-wrap"> 92 <view class="btn-wrap">
92 <view class="submit-btn" :class="{ loading: submitting }" @click="handleSubmit"> 93 <view :class="{ loading: submitting }" class="submit-btn" @click="handleSubmit">
93 {{ submitting ? '提交中...' : '提交申请' }} 94 {{ submitting ? '提交中...' : '提交申请' }}
94 </view> 95 </view>
95 </view> 96 </view>
...@@ -97,15 +98,15 @@ ...@@ -97,15 +98,15 @@
97 </template> 98 </template>
98 99
99 <script setup> 100 <script setup>
100 import { ref, reactive } from 'vue'; 101 import {ref, reactive} from 'vue';
101 import { onLoad } from '@dcloudio/uni-app'; 102 import {onLoad} from '@dcloudio/uni-app';
102 import { outputInvoiceNo } from '@/common/api.js'; 103 import {outputInvoiceNo} from '@/common/api.js';
103 104
104 const submitting = ref(false); 105 const submitting = ref(false);
105 106 const type = ref(0) //1个人订单只开普票
106 // 表单数据(与PC端字段完全对齐) 107 // 表单数据(与PC端字段完全对齐)
107 const form = reactive({ 108 const form = reactive({
108 invoiceType: '1', // 1=个人 2=企业 109 invoiceType: '2', // 1=企业 2=个人
109 deliveryMethod: '1', // 接收方式:1=电子发票 110 deliveryMethod: '1', // 接收方式:1=电子发票
110 name: '', // 发票抬头 111 name: '', // 发票抬头
111 taxno: '', // 纳税人识别号 112 taxno: '', // 纳税人识别号
...@@ -123,46 +124,48 @@ onLoad((options) => { ...@@ -123,46 +124,48 @@ onLoad((options) => {
123 if (options.invoiceType) { 124 if (options.invoiceType) {
124 form.invoiceType = options.invoiceType; 125 form.invoiceType = options.invoiceType;
125 } 126 }
127 type.value = options.type ?? 0
128 console.log(options)
126 }); 129 });
127 130
128 // 表单验证 131 // 表单验证
129 const validateForm = () => { 132 const validateForm = () => {
130 // 发票抬头校验 133 // 发票抬头校验
131 if (!form.name) { 134 if (!form.name) {
132 uni.showToast({ title: '请输入发票抬头', icon: 'none' }); 135 uni.showToast({title: '请输入发票抬头', icon: 'none'});
133 return false; 136 return false;
134 } 137 }
135 if (form.name.length < 2 || form.name.length > 100) { 138 if (form.name.length < 2 || form.name.length > 100) {
136 uni.showToast({ title: '发票抬头长度在2-100个字符之间', icon: 'none' }); 139 uni.showToast({title: '发票抬头长度在2-100个字符之间', icon: 'none'});
137 return false; 140 return false;
138 } 141 }
139 142
140 // 企业必须填纳税人识别号 143 // 企业必须填纳税人识别号
141 if (form.invoiceType === '2' && !form.taxno) { 144 if (form.invoiceType === '1' && !form.taxno) {
142 uni.showToast({ title: '请输入纳税人识别号', icon: 'none' }); 145 uni.showToast({title: '请输入纳税人识别号', icon: 'none'});
143 return false; 146 return false;
144 } 147 }
145 148
146 // 纳税人识别号格式校验(同PC) 149 // 纳税人识别号格式校验(同PC)
147 if (form.invoiceType === '2') { 150 if (form.invoiceType === '1') {
148 const taxReg = /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/; 151 const taxReg = /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/;
149 if (!taxReg.test(form.taxno)) { 152 if (!taxReg.test(form.taxno)) {
150 uni.showToast({ title: '纳税人识别号格式不正确', icon: 'none' }); 153 uni.showToast({title: '纳税人识别号格式不正确', icon: 'none'});
151 return false; 154 return false;
152 } 155 }
153 } 156 }
154 157
155 // 邮箱校验 158 // 邮箱校验
156 if (!form.phone) { 159 if (!form.phone) {
157 uni.showToast({ title: '请输入接收邮箱', icon: 'none' }); 160 uni.showToast({title: '请输入接收邮箱', icon: 'none'});
158 return false; 161 return false;
159 } 162 }
160 const phoneReg = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; 163 const phoneReg = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
161 if (!phoneReg.test(form.phone)) { 164 if (!phoneReg.test(form.phone)) {
162 uni.showToast({ title: '请输入正确的邮箱地址', icon: 'none' }); 165 uni.showToast({title: '请输入正确的邮箱地址', icon: 'none'});
163 return false; 166 return false;
164 } 167 }
165 168
166 return true; 169 return true;
167 }; 170 };
168 171
...@@ -170,7 +173,7 @@ const validateForm = () => { ...@@ -170,7 +173,7 @@ const validateForm = () => {
170 const handleSubmit = async () => { 173 const handleSubmit = async () => {
171 if (submitting.value) return; 174 if (submitting.value) return;
172 if (!validateForm()) return; 175 if (!validateForm()) return;
173 176
174 submitting.value = true; 177 submitting.value = true;
175 console.log('提交表单数据:', form); 178 console.log('提交表单数据:', form);
176 try { 179 try {
...@@ -183,6 +186,7 @@ const handleSubmit = async () => { ...@@ -183,6 +186,7 @@ const handleSubmit = async () => {
183 uni.navigateBack(); 186 uni.navigateBack();
184 }, 1500); 187 }, 1500);
185 } catch (error) { 188 } catch (error) {
189 console.log(error)
186 submitting.value = false; 190 submitting.value = false;
187 // 错误已由 request.js 处理 191 // 错误已由 request.js 处理
188 } finally { 192 } finally {
...@@ -206,19 +210,19 @@ const handleSubmit = async () => { ...@@ -206,19 +210,19 @@ const handleSubmit = async () => {
206 padding: 24rpx; 210 padding: 24rpx;
207 margin-bottom: 20rpx; 211 margin-bottom: 20rpx;
208 border-radius: 16rpx; 212 border-radius: 16rpx;
209 213
210 &.column { 214 &.column {
211 display: flex; 215 display: flex;
212 flex-direction: column; 216 flex-direction: column;
213 } 217 }
214 218
215 .label { 219 .label {
216 font-size: 28rpx; 220 font-size: 28rpx;
217 color: #333; 221 color: #333;
218 font-weight: 500; 222 font-weight: 500;
219 margin-bottom: 16rpx; 223 margin-bottom: 16rpx;
220 } 224 }
221 225
222 .input { 226 .input {
223 width: 100%; 227 width: 100%;
224 font-size: 28rpx; 228 font-size: 28rpx;
...@@ -239,18 +243,18 @@ const handleSubmit = async () => { ...@@ -239,18 +243,18 @@ const handleSubmit = async () => {
239 line-height: 80rpx; 243 line-height: 80rpx;
240 } 244 }
241 } 245 }
242 246
243 .form-item.column .input { 247 .form-item.column .input {
244 width: 100%; 248 width: 100%;
245 display: block; 249 display: block;
246 } 250 }
247 251
248 .hint { 252 .hint {
249 font-size: 24rpx; 253 font-size: 24rpx;
250 color: #909399; 254 color: #909399;
251 margin-top: 8rpx; 255 margin-top: 8rpx;
252 } 256 }
253 257
254 .amount { 258 .amount {
255 font-size: 32rpx; 259 font-size: 32rpx;
256 color: #AD181F; 260 color: #AD181F;
...@@ -273,12 +277,12 @@ const handleSubmit = async () => { ...@@ -273,12 +277,12 @@ const handleSubmit = async () => {
273 border: 2rpx solid #e4e7ed; 277 border: 2rpx solid #e4e7ed;
274 border-radius: 12rpx; 278 border-radius: 12rpx;
275 background: #fafafa; 279 background: #fafafa;
276 280
277 &.active { 281 &.active {
278 border-color: #AD181F; 282 border-color: #AD181F;
279 background: #FFF5F5; 283 background: #FFF5F5;
280 } 284 }
281 285
282 .type-icon { 286 .type-icon {
283 width: 60rpx; 287 width: 60rpx;
284 height: 60rpx; 288 height: 60rpx;
...@@ -291,28 +295,28 @@ const handleSubmit = async () => { ...@@ -291,28 +295,28 @@ const handleSubmit = async () => {
291 color: #409eff; 295 color: #409eff;
292 font-weight: 600; 296 font-weight: 600;
293 margin-right: 16rpx; 297 margin-right: 16rpx;
294 298
295 &.enterprise { 299 &.enterprise {
296 background: #f0f6ff; 300 background: #f0f6ff;
297 color: #1561CB; 301 color: #1561CB;
298 } 302 }
299 } 303 }
300 304
301 &.active .type-icon { 305 &.active .type-icon {
302 background: #AD181F; 306 background: #AD181F;
303 color: #fff; 307 color: #fff;
304 } 308 }
305 309
306 .type-info { 310 .type-info {
307 display: flex; 311 display: flex;
308 flex-direction: column; 312 flex-direction: column;
309 313
310 .type-name { 314 .type-name {
311 font-size: 28rpx; 315 font-size: 28rpx;
312 font-weight: 600; 316 font-weight: 600;
313 color: #303133; 317 color: #303133;
314 } 318 }
315 319
316 .type-desc { 320 .type-desc {
317 font-size: 22rpx; 321 font-size: 22rpx;
318 color: #909399; 322 color: #909399;
...@@ -333,12 +337,12 @@ const handleSubmit = async () => { ...@@ -333,12 +337,12 @@ const handleSubmit = async () => {
333 border: 2rpx solid #e4e7ed; 337 border: 2rpx solid #e4e7ed;
334 border-radius: 12rpx; 338 border-radius: 12rpx;
335 background: #fafafa; 339 background: #fafafa;
336 340
337 &.active { 341 &.active {
338 border-color: #AD181F; 342 border-color: #AD181F;
339 background: #FFF5F5; 343 background: #FFF5F5;
340 } 344 }
341 345
342 .method-icon { 346 .method-icon {
343 width: 60rpx; 347 width: 60rpx;
344 height: 60rpx; 348 height: 60rpx;
...@@ -352,30 +356,30 @@ const handleSubmit = async () => { ...@@ -352,30 +356,30 @@ const handleSubmit = async () => {
352 font-weight: 600; 356 font-weight: 600;
353 margin-right: 16rpx; 357 margin-right: 16rpx;
354 } 358 }
355 359
356 &.active .method-icon { 360 &.active .method-icon {
357 background: #AD181F; 361 background: #AD181F;
358 color: #fff; 362 color: #fff;
359 } 363 }
360 364
361 .method-info { 365 .method-info {
362 flex: 1; 366 flex: 1;
363 display: flex; 367 display: flex;
364 flex-direction: column; 368 flex-direction: column;
365 369
366 .method-name { 370 .method-name {
367 font-size: 28rpx; 371 font-size: 28rpx;
368 font-weight: 600; 372 font-weight: 600;
369 color: #303133; 373 color: #303133;
370 } 374 }
371 375
372 .method-desc { 376 .method-desc {
373 font-size: 22rpx; 377 font-size: 22rpx;
374 color: #909399; 378 color: #909399;
375 margin-top: 4rpx; 379 margin-top: 4rpx;
376 } 380 }
377 } 381 }
378 382
379 .method-tag { 383 .method-tag {
380 font-size: 20rpx; 384 font-size: 20rpx;
381 color: #67C23A; 385 color: #67C23A;
...@@ -407,7 +411,7 @@ const handleSubmit = async () => { ...@@ -407,7 +411,7 @@ const handleSubmit = async () => {
407 font-size: 32rpx; 411 font-size: 32rpx;
408 text-align: center; 412 text-align: center;
409 font-weight: 500; 413 font-weight: 500;
410 414
411 &.loading { 415 &.loading {
412 background: #c0c4cc; 416 background: #c0c4cc;
413 } 417 }
......
...@@ -141,6 +141,7 @@ const queryParams = reactive({ ...@@ -141,6 +141,7 @@ const queryParams = reactive({
141 pageNum: 1, 141 pageNum: 1,
142 pageSize: 10, 142 pageSize: 10,
143 type: '0', // 0表示个人会员 143 type: '0', // 0表示个人会员
144 subType: '1', //0道馆 1个人
144 // queryType: '1', 145 // queryType: '1',
145 // payStatus: '', 146 // payStatus: '',
146 perId: '' 147 perId: ''
...@@ -269,7 +270,7 @@ const handlePay = async (item) => { ...@@ -269,7 +270,7 @@ const handlePay = async (item) => {
269 270
270 // 申请开票 271 // 申请开票
271 const makeInvoiceFN = (item) => { 272 const makeInvoiceFN = (item) => {
272 uni.navigateTo({url: `/pages/invoice/apply?orderId=${item.id}amount=${item.price}`}); 273 uni.navigateTo({url: `/pages/invoice/apply?orderId=${item.id}&amount=${item.price}&type=1`});
273 }; 274 };
274 275
275 // 取消订单 276 // 取消订单
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!