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
......
1 <template> 1 <template>
2 <view class="order-page" :class="{ 'no-scroll': isPopupOpen }"> 2 <view :class="{ 'no-scroll': isPopupOpen }" class="order-page">
3 <!-- 顶部标签栏 --> 3 <!-- 顶部标签栏 -->
4 <view class="tab-bar"> 4 <view class="tab-bar">
5 <view 5 <view
6 v-for="(tab, index) in tabs" 6 v-for="(tab, index) in tabs"
7 :key="index" 7 :key="index"
8 class="tab-item"
9 :class="{ active: currentTab === tab.type }" 8 :class="{ active: currentTab === tab.type }"
9 class="tab-item"
10 @click="switchTab(tab.type)" 10 @click="switchTab(tab.type)"
11 > 11 >
12 {{ tab.name }} 12 {{ tab.name }}
13 </view> 13 </view>
14 </view> 14 </view>
15 15
16 <!-- 订单列表 --> 16 <!-- 订单列表 -->
17 <scroll-view 17 <scroll-view
18 scroll-y
19 class="order-list-scroll"
20 :show-scrollbar="false"
21 :scroll-enabled="!isPopupOpen" 18 :scroll-enabled="!isPopupOpen"
22 @scrolltolower="loadMore" 19 :show-scrollbar="false"
20 class="order-list-scroll"
23 lower-threshold="200" 21 lower-threshold="200"
22 scroll-y
23 @scrolltolower="loadMore"
24 > 24 >
25 <view class="order-list"> 25 <view class="order-list">
26 <!-- 有数据才循环 --> 26 <!-- 有数据才循环 -->
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
36 <view class="date"> 36 <view class="date">
37 <!-- <image :src="config.baseUrl_api + '/fs/static/calendar@2x.png'" mode="widthFix" style="width:30rpx;height:30rpx;"/> --> 37 <!-- <image :src="config.baseUrl_api + '/fs/static/calendar@2x.png'" mode="widthFix" style="width:30rpx;height:30rpx;"/> -->
38 <!-- --> 38 <!-- -->
39 <text class="value text-primary" >{{ item.wfCode || '——' }}</text> 39 <text class="value text-primary">{{ item.wfCode || '——' }}</text>
40 </view> 40 </view>
41 <view class="status-tags"> 41 <view class="status-tags">
42 <!-- <view 42 <!-- <view
...@@ -50,25 +50,25 @@ ...@@ -50,25 +50,25 @@
50 {{ getStatusText(item.payStatus) }} 50 {{ getStatusText(item.payStatus) }}
51 </view> --> 51 </view> -->
52 <view 52 <view
53 class="status-tag ml-10"
54 :class="{ 53 :class="{
55 'status-wait': item.auditStatus == 0, 54 'status-wait': item.auditStatus == 0,
56 'status-pending': item.auditStatus == 1, 55 'status-pending': item.auditStatus == 1,
57 'status-success': item.auditStatus == 2, 56 'status-success': item.auditStatus == 2,
58 'status-danger': item.auditStatus == 3 57 'status-danger': item.auditStatus == 3
59 }" 58 }"
59 class="status-tag ml-10"
60 > 60 >
61 {{ getAuditStatusText(item.auditStatus) }} 61 {{ getAuditStatusText(item.auditStatus) }}
62 </view> 62 </view>
63 </view> 63 </view>
64 </view> 64 </view>
65 65
66 <!-- 订单编号、缴费编号 --> 66 <!-- 订单编号、缴费编号 -->
67 <view class="info-row"> 67 <view class="info-row">
68 <text class="label">订单编号:</text> 68 <text class="label">订单编号:</text>
69 <text class="value">{{ item.tradeNo || '——' }}</text> 69 <text class="value">{{ item.tradeNo || '——' }}</text>
70 </view> 70 </view>
71 <view class="info-row" v-if="item.orderName"> 71 <view v-if="item.orderName" class="info-row">
72 <text class="label">缴费名称:</text> 72 <text class="label">缴费名称:</text>
73 <text class="value">{{ item.orderName || '' }}</text> 73 <text class="value">{{ item.orderName || '' }}</text>
74 </view> 74 </view>
...@@ -76,29 +76,29 @@ ...@@ -76,29 +76,29 @@
76 <text class="label">缴费编号:</text> 76 <text class="label">缴费编号:</text>
77 77
78 </view> --> 78 </view> -->
79 79
80 <!-- 核心:前2tab仅展示缴费年限,后2tab仅展示人数合计 --> 80 <!-- 核心:前2tab仅展示缴费年限,后2tab仅展示人数合计 -->
81 <view class="info-section flex f-j-s" v-if="item.content"> 81 <view v-if="item.content" class="info-section flex f-j-s">
82 <!-- 个人/单位会员(仅缴费年限) --> 82 <!-- 个人/单位会员(仅缴费年限) -->
83 <view v-if="currentTab === '0' || currentTab === '1'" class="single-info"> 83 <view v-if="currentTab === '0' || currentTab === '1'" class="single-info">
84 <view class="label">缴费年限:</view> 84 <view class="label">缴费年限:</view>
85 <view class="value">{{ item.content.yearCount || 0 }}</view> 85 <view class="value">{{ item.content.yearCount || 0 }}</view>
86 </view> 86 </view>
87 <view class="line" v-if="currentTab === '0' || currentTab === '1'"></view> 87 <view v-if="currentTab === '0' || currentTab === '1'" class="line"></view>
88 <!-- 级位/段位考试(仅人数合计) --> 88 <!-- 级位/段位考试(仅人数合计) -->
89 <view v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'" class="single-info"> 89 <view v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'" class="single-info">
90 <view class="label">人数合计</view> 90 <view class="label">人数合计</view>
91 <view class="value">{{ item.content.personCount || 0 }}</view> 91 <view class="value">{{ item.content.personCount || 0 }}</view>
92 </view> 92 </view>
93 <view class="line" v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'"></view> 93 <view v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'" class="line"></view>
94 <view class="single-info"> 94 <view class="single-info">
95 <view class="label">订单状态</view> 95 <view class="label">订单状态</view>
96 <view class="value" :class="item.effect == 1 ? 'text-success' : 'text-warning'"> 96 <view :class="item.effect == 1 ? 'text-success' : 'text-warning'" class="value">
97 {{ item.effect == 1 ? '已生效' : '未生效' }} 97 {{ item.effect == 1 ? '已生效' : '未生效' }}
98 </view> 98 </view>
99 </view> 99 </view>
100 </view> 100 </view>
101 101
102 <!-- 费用合计 + 缴费方式 --> 102 <!-- 费用合计 + 缴费方式 -->
103 <view class="price-section"> 103 <view class="price-section">
104 <view class="price-row"> 104 <view class="price-row">
...@@ -110,13 +110,13 @@ ...@@ -110,13 +110,13 @@
110 <text class="price-value">民生付</text> 110 <text class="price-value">民生付</text>
111 </view> 111 </view>
112 </view> 112 </view>
113 113
114 <!-- 按钮组:靠右紧凑展示 --> 114 <!-- 按钮组:靠右紧凑展示 -->
115 <view class="btn-group"> 115 <view class="btn-group">
116 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> 116 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) -->
117 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2"> 117 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2">
118 <button class="btn btn-view-invoice" @click="makeInvoiceFN(item)" :disabled="item.invoiceStatus === 1"> 118 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice" @click="makeInvoiceFN(item)">
119 开票 119 开票
120 </button> 120 </button>
121 </template> 121 </template>
122 <!-- 已开票:查看发票 --> 122 <!-- 已开票:查看发票 -->
...@@ -131,19 +131,19 @@ ...@@ -131,19 +131,19 @@
131 </view> 131 </view>
132 </view> 132 </view>
133 </view> 133 </view>
134 134
135 <!-- 空状态 --> 135 <!-- 空状态 -->
136 <view v-else class="empty"> 136 <view v-else class="empty">
137 <image class="empty-img" mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image> 137 <image :src="config.baseUrl_api + '/fs/static/nodata.png'" class="empty-img" mode="aspectFit"></image>
138 <text class="empty-text">暂无订单记录</text> 138 <text class="empty-text">暂无订单记录</text>
139 </view> 139 </view>
140 140
141 <!-- 加载/无更多提示 --> 141 <!-- 加载/无更多提示 -->
142 <view class="loading-tip" v-if="loading">加载中...</view> 142 <view v-if="loading" class="loading-tip">加载中...</view>
143 <view class="no-more" v-if="!loading && !hasMore && list.length">没有更多了</view> 143 <view v-if="!loading && !hasMore && list.length" class="no-more">没有更多了</view>
144 </view> 144 </view>
145 </scroll-view> 145 </scroll-view>
146 146
147 <!-- 发票查看弹窗 --> 147 <!-- 发票查看弹窗 -->
148 <view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup"> 148 <view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup">
149 <view class="invoice-popup-content" @click.stop> 149 <view class="invoice-popup-content" @click.stop>
...@@ -153,19 +153,19 @@ ...@@ -153,19 +153,19 @@
153 </view> 153 </view>
154 <view class="invoice-popup-body"> 154 <view class="invoice-popup-body">
155 155
156 156
157 <view class="invoice-info-list"> 157 <view class="invoice-info-list">
158 <view class="invoice-info-row"> 158 <view class="invoice-info-row">
159 <view class="invoice-info-label">发票类型</view> 159 <view class="invoice-info-label">发票类型</view>
160 <view class="invoice-type-badge" :class="{ 'vat-type': invoiceData.invoiceType == 2 }"> 160 <view :class="{ 'vat-type': invoiceData.invoiceType == 2 }" class="invoice-type-badge">
161 {{ invoiceData.invoiceType == 1 ? '普通发票' : '增值税专用发票' }} 161 {{ invoiceData.invoiceType == 1 ? '普通发票' : '增值税专用发票' }}
162 </view> 162 </view>
163 </view> 163 </view>
164 <view class="invoice-info-row"> 164 <view class="invoice-info-row">
165 <text class="invoice-info-label">发票抬头</text> 165 <text class="invoice-info-label">发票抬头</text>
166 <text class="invoice-info-value">{{ invoiceData.invoiceBuyerName || '—' }}</text> 166 <text class="invoice-info-value">{{ invoiceData.invoiceBuyerName || '—' }}</text>
167 </view> 167 </view>
168 <view class="invoice-info-row" v-if="invoiceData.invoiceBuyerTaxno"> 168 <view v-if="invoiceData.invoiceBuyerTaxno" class="invoice-info-row">
169 <text class="invoice-info-label">纳税人识别号</text> 169 <text class="invoice-info-label">纳税人识别号</text>
170 <text class="invoice-info-value">{{ invoiceData.invoiceBuyerTaxno }}</text> 170 <text class="invoice-info-value">{{ invoiceData.invoiceBuyerTaxno }}</text>
171 </view> 171 </view>
...@@ -173,11 +173,19 @@ ...@@ -173,11 +173,19 @@
173 <text class="invoice-info-label">接收邮箱</text> 173 <text class="invoice-info-label">接收邮箱</text>
174 <text class="invoice-info-value">{{ invoiceData.invoicePushPhone || '—' }}</text> 174 <text class="invoice-info-value">{{ invoiceData.invoicePushPhone || '—' }}</text>
175 </view> 175 </view>
176 <view class="invoice-info-row">
177 <text class="invoice-info-label">开票时间</text>
178 <text class="invoice-info-value">{{ invoiceData.invoiceTime || '—' }}</text>
179 </view>
180 <view class="invoice-info-row">
181 <text class="invoice-info-label">开票金额</text>
182 <text class="invoice-info-value">¥{{ invoiceData.price || '—' }}</text>
183 </view>
176 </view> 184 </view>
177 </view> 185 </view>
178 </view> 186 </view>
179 </view> 187 </view>
180 188
181 <!-- 自定义删除确认弹窗 --> 189 <!-- 自定义删除确认弹窗 -->
182 <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup"> 190 <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup">
183 <view class="custom-modal" @click.stop> 191 <view class="custom-modal" @click.stop>
...@@ -189,7 +197,7 @@ ...@@ -189,7 +197,7 @@
189 </view> 197 </view>
190 </view> 198 </view>
191 </view> 199 </view>
192 200
193 <!-- 自定义取消订单确认弹窗 --> 201 <!-- 自定义取消订单确认弹窗 -->
194 <view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup"> 202 <view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup">
195 <view class="custom-modal" @click.stop> 203 <view class="custom-modal" @click.stop>
...@@ -205,17 +213,17 @@ ...@@ -205,17 +213,17 @@
205 </template> 213 </template>
206 214
207 <script setup> 215 <script setup>
208 import { ref, reactive, onMounted, computed } from 'vue'; 216 import {ref, reactive, onMounted, computed} from 'vue';
209 import { 217 import {
210 onShow, 218 onShow,
211 onLoad 219 onLoad
212 } from '@dcloudio/uni-app' 220 } from '@dcloudio/uni-app'
213 import * as api from '@/common/api.js' 221 import * as api from '@/common/api.js'
214 import config from '@/config.js' 222 import config from '@/config.js'
215 // 获取deptType值(初始值为0,在onMounted中设置实际值) 223 // 获取deptType值(初始值为0,在onMounted中设置实际值)
216 const deptType = ref(0); 224 const deptType = ref(0);
217 const goToDetail = (item) => { 225 const goToDetail = (item) => {
218 uni.navigateTo({ url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${queryParams.type}` }); 226 uni.navigateTo({url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${queryParams.type}`});
219 } 227 }
220 228
221 // 标签栏配置(根据deptType动态生成) 229 // 标签栏配置(根据deptType动态生成)
...@@ -226,25 +234,25 @@ const tabs = computed(() => { ...@@ -226,25 +234,25 @@ const tabs = computed(() => {
226 if (dt === 6) { 234 if (dt === 6) {
227 console.log('返回3个tab: 个人会员、单位会员、级位考试'); 235 console.log('返回3个tab: 个人会员、单位会员、级位考试');
228 return [ 236 return [
229 { name: '个人会员', type: '0' }, 237 {name: '个人会员', type: '0'},
230 { name: '单位会员', type: '1' }, 238 {name: '单位会员', type: '1'},
231 { name: '级位考试', type: '2' } 239 {name: '级位考试', type: '2'}
232 ]; 240 ];
233 } else if (dt === 2) { 241 } else if (dt === 2) {
234 console.log('返回3个tab: 单位会员、段位考试、越段考试'); 242 console.log('返回3个tab: 单位会员、段位考试、越段考试');
235 return [ 243 return [
236 // { name: '单位会员', type: '1' }, 244 // { name: '单位会员', type: '1' },
237 { name: '段位考试', type: '3' }, 245 {name: '段位考试', type: '3'},
238 { name: '越段考试', type: '4' } 246 {name: '越段考试', type: '4'}
239 ]; 247 ];
240 } else { 248 } else {
241 console.log('返回默认5个tab, dt值为:', dt); 249 console.log('返回默认5个tab, dt值为:', dt);
242 return [ 250 return [
243 { name: '个人会员', type: '0' }, 251 {name: '个人会员', type: '0'},
244 { name: '单位会员', type: '1' }, 252 {name: '单位会员', type: '1'},
245 { name: '级位考试', type: '2' }, 253 {name: '级位考试', type: '2'},
246 { name: '段位考试', type: '3' }, 254 {name: '段位考试', type: '3'},
247 { name: '越段考试', type: '4' } 255 {name: '越段考试', type: '4'}
248 ]; 256 ];
249 } 257 }
250 }); 258 });
...@@ -287,7 +295,7 @@ onLoad((option) => { ...@@ -287,7 +295,7 @@ onLoad((option) => {
287 deptType.value = Number(app.globalData?.deptType || 0); 295 deptType.value = Number(app.globalData?.deptType || 0);
288 const firstType = tabs.value[0]?.type ?? '0'; 296 const firstType = tabs.value[0]?.type ?? '0';
289 currentTab.value = option.type || firstType; 297 currentTab.value = option.type || firstType;
290 queryParams.type = option.type ||firstType; 298 queryParams.type = option.type || firstType;
291 initData(); 299 initData();
292 }); 300 });
293 301
...@@ -349,11 +357,11 @@ const getAuditStatusText = (status) => { ...@@ -349,11 +357,11 @@ const getAuditStatusText = (status) => {
349 const initData = async () => { 357 const initData = async () => {
350 loading.value = true; 358 loading.value = true;
351 queryParams.pageNum = pageNum.value; 359 queryParams.pageNum = pageNum.value;
352 360
353 try { 361 try {
354 const res = await api.orderList(queryParams); 362 const res = await api.orderList(queryParams);
355 console.log("接口返回:", res); 363 console.log("接口返回:", res);
356 364
357 if (!res || !res.rows || res.rows.length === 0) { 365 if (!res || !res.rows || res.rows.length === 0) {
358 hasMore.value = false; 366 hasMore.value = false;
359 loading.value = false; 367 loading.value = false;
...@@ -379,7 +387,7 @@ const initData = async () => { ...@@ -379,7 +387,7 @@ const initData = async () => {
379 hasMore.value = res.rows.length === pageSize.value; 387 hasMore.value = res.rows.length === pageSize.value;
380 } catch (e) { 388 } catch (e) {
381 console.error('订单加载异常:', e); 389 console.error('订单加载异常:', e);
382 uni.showToast({ title: '加载失败', icon: 'none' }); 390 uni.showToast({title: '加载失败', icon: 'none'});
383 hasMore.value = false; 391 hasMore.value = false;
384 } finally { 392 } finally {
385 loading.value = false; 393 loading.value = false;
...@@ -399,13 +407,13 @@ const confirmDel = async () => { ...@@ -399,13 +407,13 @@ const confirmDel = async () => {
399 if (!currentOrder.value) return; 407 if (!currentOrder.value) return;
400 try { 408 try {
401 await api.deleteOrder(currentOrder.value.id); 409 await api.deleteOrder(currentOrder.value.id);
402 uni.showToast({ title: '删除成功', icon: 'success' }); 410 uni.showToast({title: '删除成功', icon: 'success'});
403 pageNum.value = 1; 411 pageNum.value = 1;
404 list.value = []; 412 list.value = [];
405 initData(); 413 initData();
406 closeDelPopup(); 414 closeDelPopup();
407 } catch (e) { 415 } catch (e) {
408 uni.showToast({ title: '删除失败', icon: 'error' }); 416 uni.showToast({title: '删除失败', icon: 'error'});
409 } 417 }
410 }; 418 };
411 419
...@@ -420,10 +428,10 @@ const closeDelPopup = () => { ...@@ -420,10 +428,10 @@ const closeDelPopup = () => {
420 const handlePay = async (item) => { 428 const handlePay = async (item) => {
421 if (item.payStatus !== 0) return; 429 if (item.payStatus !== 0) return;
422 try { 430 try {
423 await api.goPay({ id: item.id }); 431 await api.goPay({id: item.id});
424 uni.navigateTo({ url: `/pages/pay/pay?orderId=${item.id}` }); 432 uni.navigateTo({url: `/pages/pay/pay?orderId=${item.id}`});
425 } catch (e) { 433 } catch (e) {
426 uni.showToast({ title: '发起支付失败', icon: 'none' }); 434 uni.showToast({title: '发起支付失败', icon: 'none'});
427 } 435 }
428 }; 436 };
429 437
...@@ -447,7 +455,9 @@ const viewInvoice = (item) => { ...@@ -447,7 +455,9 @@ const viewInvoice = (item) => {
447 invoiceType: item.invoiceType || 1, 455 invoiceType: item.invoiceType || 1,
448 invoiceBuyerName: item.invoiceTitle || item.invoiceBuyerName || '—', 456 invoiceBuyerName: item.invoiceTitle || item.invoiceBuyerName || '—',
449 invoiceBuyerTaxno: item.invoiceTaxno || item.invoiceBuyerTaxno || '', 457 invoiceBuyerTaxno: item.invoiceTaxno || item.invoiceBuyerTaxno || '',
450 invoicePushPhone: item.invoiceEmail || item.invoicePushPhone || '—' 458 invoicePushPhone: item.invoiceEmail || item.invoicePushPhone || '—',
459 price: item.price || '-',
460 invoiceTime: item.invoiceTime || '—'
451 }; 461 };
452 showInvoicePopup.value = true; 462 showInvoicePopup.value = true;
453 isPopupOpen.value = true; 463 isPopupOpen.value = true;
...@@ -472,13 +482,13 @@ const confirmCancel = async () => { ...@@ -472,13 +482,13 @@ const confirmCancel = async () => {
472 if (!currentOrder.value) return; 482 if (!currentOrder.value) return;
473 try { 483 try {
474 await api.cancelPay(currentOrder.value.id); 484 await api.cancelPay(currentOrder.value.id);
475 uni.showToast({ title: '取消成功', icon: 'success' }); 485 uni.showToast({title: '取消成功', icon: 'success'});
476 pageNum.value = 1; 486 pageNum.value = 1;
477 list.value = []; 487 list.value = [];
478 initData(); 488 initData();
479 closeCancelPopup(); 489 closeCancelPopup();
480 } catch (e) { 490 } catch (e) {
481 uni.showToast({ title: '取消失败', icon: 'error' }); 491 uni.showToast({title: '取消失败', icon: 'error'});
482 } 492 }
483 }; 493 };
484 494
...@@ -496,7 +506,7 @@ const closeCancelPopup = () => { ...@@ -496,7 +506,7 @@ const closeCancelPopup = () => {
496 height: 100vh; 506 height: 100vh;
497 display: flex; 507 display: flex;
498 flex-direction: column; 508 flex-direction: column;
499 509
500 &.no-scroll { 510 &.no-scroll {
501 overflow: hidden; 511 overflow: hidden;
502 height: 100vh; 512 height: 100vh;
...@@ -571,65 +581,65 @@ const closeCancelPopup = () => { ...@@ -571,65 +581,65 @@ const closeCancelPopup = () => {
571 padding-bottom: 20rpx; 581 padding-bottom: 20rpx;
572 // margin-bottom: 20rpx; 582 // margin-bottom: 20rpx;
573 // border-bottom: 1rpx dashed #eee; 583 // border-bottom: 1rpx dashed #eee;
574 584
575 .date { 585 .date {
576 display: flex; 586 display: flex;
577 align-items: center; 587 align-items: center;
578 gap: 8rpx; 588 gap: 8rpx;
579 font-size: 26rpx; 589 font-size: 26rpx;
580 590
581 .date-text { 591 .date-text {
582 color: #666; 592 color: #666;
583 } 593 }
584 } 594 }
585 595
586 .status-tags { 596 .status-tags {
587 display: flex; 597 display: flex;
588 gap: 10rpx; 598 gap: 10rpx;
589 } 599 }
590 600
591 .status-tag { 601 .status-tag {
592 font-size: 22rpx; 602 font-size: 22rpx;
593 padding: 6rpx 16rpx; 603 padding: 6rpx 16rpx;
594 border-radius: 20rpx; 604 border-radius: 20rpx;
595 605
596 &.success { 606 &.success {
597 background: #e6f7ef; 607 background: #e6f7ef;
598 color: #52c41a; 608 color: #52c41a;
599 } 609 }
600 610
601 &.danger { 611 &.danger {
602 background: #fff1f0; 612 background: #fff1f0;
603 color: #ff4d4f; 613 color: #ff4d4f;
604 } 614 }
605 615
606 &.pending { 616 &.pending {
607 background: #f5f5f5; 617 background: #f5f5f5;
608 color: #999; 618 color: #999;
609 } 619 }
610 620
611 &.ml-10 { 621 &.ml-10 {
612 margin-left: 10rpx; 622 margin-left: 10rpx;
613 } 623 }
614 624
615 &.status-wait { 625 &.status-wait {
616 background: #f0f5ff; 626 background: #f0f5ff;
617 color: #597ef7; 627 color: #597ef7;
618 border: 1rpx solid rgba(89, 126, 247, 0.3); 628 border: 1rpx solid rgba(89, 126, 247, 0.3);
619 } 629 }
620 630
621 &.status-pending { 631 &.status-pending {
622 background: #fff7e6; 632 background: #fff7e6;
623 color: #faad14; 633 color: #faad14;
624 border: 1rpx solid rgba(250, 173, 20, 0.3); 634 border: 1rpx solid rgba(250, 173, 20, 0.3);
625 } 635 }
626 636
627 &.status-success { 637 &.status-success {
628 background: #e6f7ef; 638 background: #e6f7ef;
629 color: #52c41a; 639 color: #52c41a;
630 border: 1rpx solid rgba(82, 196, 26, 0.3); 640 border: 1rpx solid rgba(82, 196, 26, 0.3);
631 } 641 }
632 642
633 &.status-danger { 643 &.status-danger {
634 background: #fff1f0; 644 background: #fff1f0;
635 color: #ff4d4f; 645 color: #ff4d4f;
...@@ -665,11 +675,13 @@ const closeCancelPopup = () => { ...@@ -665,11 +675,13 @@ const closeCancelPopup = () => {
665 justify-content: space-around; 675 justify-content: space-around;
666 margin: 20rpx 0; 676 margin: 20rpx 0;
667 } 677 }
668 .line{ 678
679 .line {
669 width: 1rpx; 680 width: 1rpx;
670 height: 90%; 681 height: 90%;
671 background: #eee; 682 background: #eee;
672 } 683 }
684
673 .single-info { 685 .single-info {
674 padding: 16rpx 20rpx; 686 padding: 16rpx 20rpx;
675 border-radius: 8rpx; 687 border-radius: 8rpx;
...@@ -679,17 +691,17 @@ const closeCancelPopup = () => { ...@@ -679,17 +691,17 @@ const closeCancelPopup = () => {
679 color: #999; 691 color: #999;
680 text-align: center; 692 text-align: center;
681 } 693 }
682 694
683 .value { 695 .value {
684 color: #333; 696 color: #333;
685 font-weight: 500; 697 font-weight: 500;
686 text-align: center; 698 text-align: center;
687 margin-top: 10rpx; 699 margin-top: 10rpx;
688 700
689 &.text-success { 701 &.text-success {
690 color: #52c41a; 702 color: #52c41a;
691 } 703 }
692 704
693 &.text-warning { 705 &.text-warning {
694 color: #faad14; 706 color: #faad14;
695 } 707 }
...@@ -701,26 +713,26 @@ const closeCancelPopup = () => { ...@@ -701,26 +713,26 @@ const closeCancelPopup = () => {
701 // border-top: 1rpx dashed #eee; 713 // border-top: 1rpx dashed #eee;
702 // padding-top: 16rpx; 714 // padding-top: 16rpx;
703 margin-top: 8rpx; 715 margin-top: 8rpx;
704 716
705 .price-row { 717 .price-row {
706 display: flex; 718 display: flex;
707 justify-content: space-between; 719 justify-content: space-between;
708 align-items: center; 720 align-items: center;
709 padding: 8rpx 0; 721 padding: 8rpx 0;
710 722
711 .price-label { 723 .price-label {
712 font-size: 26rpx; 724 font-size: 26rpx;
713 color: #333; 725 color: #333;
714 } 726 }
715 727
716 .price-value { 728 .price-value {
717 font-size: 26rpx; 729 font-size: 26rpx;
718 color: #666; 730 color: #666;
719 731
720 &.text-success { 732 &.text-success {
721 color: #52c41a; 733 color: #52c41a;
722 } 734 }
723 735
724 &.text-warning { 736 &.text-warning {
725 color: #faad14; 737 color: #faad14;
726 } 738 }
...@@ -731,12 +743,12 @@ const closeCancelPopup = () => { ...@@ -731,12 +743,12 @@ const closeCancelPopup = () => {
731 // 按钮组 743 // 按钮组
732 .btn-group { 744 .btn-group {
733 display: flex; 745 display: flex;
734 justify-content: flex-end; 746 justify-content: flex-end;
735 align-items: center; 747 align-items: center;
736 gap: 16rpx; 748 gap: 16rpx;
737 width: 100%; 749 width: 100%;
738 margin-top: 20rpx; 750 margin-top: 20rpx;
739 751
740 .btn { 752 .btn {
741 // 固定宽度,所有按钮一样大 753 // 固定宽度,所有按钮一样大
742 width: 160rpx; 754 width: 160rpx;
...@@ -750,10 +762,12 @@ const closeCancelPopup = () => { ...@@ -750,10 +762,12 @@ const closeCancelPopup = () => {
750 background: transparent; 762 background: transparent;
751 text-align: center; 763 text-align: center;
752 margin: 0; 764 margin: 0;
753 &::after { 765
766 &::after {
754 border: none; 767 border: none;
755 display: none; // 关键:隐藏伪元素 768 display: none; // 关键:隐藏伪元素
756 } 769 }
770
757 &.btn-delete { 771 &.btn-delete {
758 background: #fff; 772 background: #fff;
759 color: #e4393c; 773 color: #e4393c;
...@@ -765,7 +779,7 @@ const closeCancelPopup = () => { ...@@ -765,7 +779,7 @@ const closeCancelPopup = () => {
765 color: #e4393c; 779 color: #e4393c;
766 border: 1rpx solid #e4393c; 780 border: 1rpx solid #e4393c;
767 } 781 }
768 782
769 &.btn-view-invoice { 783 &.btn-view-invoice {
770 background: linear-gradient(90deg, #FF755A, #F51722); 784 background: linear-gradient(90deg, #FF755A, #F51722);
771 color: #fff; 785 color: #fff;
...@@ -879,11 +893,12 @@ const closeCancelPopup = () => { ...@@ -879,11 +893,12 @@ const closeCancelPopup = () => {
879 border: none; 893 border: none;
880 } 894 }
881 } 895 }
896
882 .code-text { 897 .code-text {
883 font-size: 28rpx; 898 font-size: 28rpx;
884 font-weight: 600; 899 font-weight: 600;
885 color: #e8341d; 900 color: #e8341d;
886 letter-spacing: 1rpx; 901 letter-spacing: 1rpx;
887 } 902 }
888 903
889 // 发票弹窗样式 904 // 发票弹窗样式
...@@ -914,13 +929,13 @@ const closeCancelPopup = () => { ...@@ -914,13 +929,13 @@ const closeCancelPopup = () => {
914 align-items: center; 929 align-items: center;
915 padding: 30rpx; 930 padding: 30rpx;
916 background: linear-gradient(135deg, #AD181F 0%, #E4393C 100%); 931 background: linear-gradient(135deg, #AD181F 0%, #E4393C 100%);
917 932
918 .invoice-popup-title { 933 .invoice-popup-title {
919 font-size: 32rpx; 934 font-size: 32rpx;
920 font-weight: 600; 935 font-weight: 600;
921 color: #fff; 936 color: #fff;
922 } 937 }
923 938
924 .invoice-popup-close { 939 .invoice-popup-close {
925 width: 44rpx; 940 width: 44rpx;
926 height: 44rpx; 941 height: 44rpx;
...@@ -945,7 +960,7 @@ const closeCancelPopup = () => { ...@@ -945,7 +960,7 @@ const closeCancelPopup = () => {
945 border-radius: 30rpx; 960 border-radius: 30rpx;
946 font-size: 24rpx; 961 font-size: 24rpx;
947 font-weight: 500; 962 font-weight: 500;
948 963
949 &.vat-type { 964 &.vat-type {
950 background: linear-gradient(135deg, #6aaaf2 0%, #178cd7 100%); 965 background: linear-gradient(135deg, #6aaaf2 0%, #178cd7 100%);
951 } 966 }
...@@ -958,17 +973,17 @@ const closeCancelPopup = () => { ...@@ -958,17 +973,17 @@ const closeCancelPopup = () => {
958 align-items: flex-start; 973 align-items: flex-start;
959 padding: 24rpx 0; 974 padding: 24rpx 0;
960 border-bottom: 1rpx dashed #eee; 975 border-bottom: 1rpx dashed #eee;
961 976
962 &:last-child { 977 &:last-child {
963 border-bottom: none; 978 border-bottom: none;
964 } 979 }
965 980
966 .invoice-info-label { 981 .invoice-info-label {
967 font-size: 26rpx; 982 font-size: 26rpx;
968 color: #999; 983 color: #999;
969 flex-shrink: 0; 984 flex-shrink: 0;
970 } 985 }
971 986
972 .invoice-info-value { 987 .invoice-info-value {
973 font-size: 26rpx; 988 font-size: 26rpx;
974 color: #333; 989 color: #333;
...@@ -978,4 +993,4 @@ const closeCancelPopup = () => { ...@@ -978,4 +993,4 @@ const closeCancelPopup = () => {
978 } 993 }
979 } 994 }
980 } 995 }
981 </style>
...\ No newline at end of file ...\ No newline at end of file
996 </style>
......
...@@ -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 }
......
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 <view class="content"> 3 <view class="content">
4 <view class="card"> 4 <view class="card">
5 <view class="yearRow"> 5 <view class="yearRow">
6 <view class="label">缴费年限</view> 6 <view class="label">缴费年限</view>
7 <view class="control"> 7 <view class="control">
8 <image class="icon" @click="minusYear" :src="config.baseUrl_api + '/fs/static/dd_02.png'" mode="widthFix" 8 <image v-if="form.payYear > 1" :src="config.baseUrl_api + '/fs/static/dd_02.png'" class="icon"
9 v-if="form.payYear > 1"></image> 9 mode="widthFix"
10 <image class="icon" :src="config.baseUrl_api + '/fs/static/dd_02_g.png'" mode="widthFix" v-else></image> 10 @click="minusYear"></image>
11 <text class="num">{{ form.payYear }}</text> 11 <image v-else :src="config.baseUrl_api + '/fs/static/dd_02_g.png'" class="icon" mode="widthFix"></image>
12 <image class="icon" :src="config.baseUrl_api + '/fs/static/btn_03.png'" mode="widthFix" @click="plusYear" 12 <text class="num">{{ form.payYear }}</text>
13 v-if="form.payYear < 5"></image> 13 <image v-if="form.payYear < 5" :src="config.baseUrl_api + '/fs/static/btn_03.png'" class="icon"
14 <image class="icon" :src="config.baseUrl_api + '/fs/static/btn_03_g.png'" mode="widthFix" v-else></image> 14 mode="widthFix"
15 </view> 15 @click="plusYear"></image>
16 </view> 16 <image v-else :src="config.baseUrl_api + '/fs/static/btn_03_g.png'" class="icon" mode="widthFix"></image>
17 </view> 17 </view>
18 18 </view>
19 <view class="card "> 19 </view>
20 <view class="row "> 20
21 <text class="label">费用合计</text> 21 <view class="card ">
22 <text class="value red">{{ form.payYear * memberFee }}</text> 22 <view class="row ">
23 </view> 23 <text class="label">费用合计</text>
24 24 <text class="value red">{{ form.payYear * memberFee }}</text>
25 </view> 25 </view>
26 26
27 <view class="payRow "> 27 </view>
28 <radio-group @change="onPayTypeChange"> 28
29 <label class="radioItem"> 29 <view class="payRow ">
30 <radio value="1" :checked="payType === '1'" class="custom-radio" /> 30 <radio-group @change="onPayTypeChange">
31 <view class="payInfo"> 31 <label class="radioItem">
32 <image class="icon" :src="config.baseUrl_api + '/fs/static/min.png'" mode="widthFix"></image> 32 <radio :checked="payType === '1'" class="custom-radio" value="1"/>
33 <text>民生付</text> 33 <view class="payInfo">
34 </view> 34 <image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon" mode="widthFix"></image>
35 </label> 35 <text>民生付</text>
36 </radio-group> 36 </view>
37 </view> 37 </label>
38 38 </radio-group>
39 <view class="totalRow "> 39 </view>
40 <text class="label">支付费用合计</text> 40
41 <text class="value redBig">{{ memberTotalFee }}</text> 41 <view class="totalRow ">
42 </view> 42 <text class="label">支付费用合计</text>
43 43 <text class="value redBig">{{ memberTotalFee }}</text>
44 </view> 44 </view>
45 45
46 <view class="bottomBtn"> 46 </view>
47 <button class="payBtn" @click="handelPay" :loading="isPaying">立即支付 ¥{{ memberTotalFee }}</button> 47
48 </view> 48 <view class="bottomBtn">
49 49 <button :loading="isPaying" class="payBtn" @click="handelPay">立即支付 ¥{{ memberTotalFee }}</button>
50 </view> 50 </view>
51
52 </view>
51 </template> 53 </template>
52 54
53 <script setup> 55 <script setup>
54 import { 56 import {
55 ref, 57 ref,
56 computed, 58 computed,
57 onMounted 59 onMounted
58 } from 'vue' 60 } from 'vue'
59 import { 61 import {
60 onLoad 62 onLoad
61 } from '@dcloudio/uni-app'; 63 } from '@dcloudio/uni-app';
62 import to from 'await-to-js' 64 import to from 'await-to-js'
63 import * as api from '@/common/api.js' 65 import * as api from '@/common/api.js'
64 import { 66 import {
65 minShengPay 67 minShengPay
66 } from '@/common/pay.js' 68 } from '@/common/pay.js'
67 import config from '@/config.js' 69 import config from '@/config.js'
68 const form = ref({ 70
69 payYear: 1 71 const form = ref({
70 }) 72 payYear: 1
71 73 })
72 // 支付方式 74
73 const payType = ref('1') 75 // 支付方式
74 const isPaying = ref(false) 76 const payType = ref('1')
75 77 const isPaying = ref(false)
76 // 费用与优惠 78
77 const memberFee = ref(0) 79 // 费用与优惠
78 const memberTotalFee = computed(() => { 80 const memberFee = ref(0)
79 return memberFee.value * form.value.payYear 81 const memberTotalFee = computed(() => {
80 82 return memberFee.value * form.value.payYear
81 }) 83
82 onLoad((options) => { 84 })
83 if (options.baseFormData) { 85 onLoad((options) => {
84 const data = JSON.parse(decodeURIComponent(options.baseFormData)) 86 if (options.baseFormData) {
85 form.value = { 87 const data = JSON.parse(decodeURIComponent(options.baseFormData))
86 ...data, 88 form.value = {
87 payYear: 1 // 年限默认1 89 ...data,
88 } 90 payYear: 1 // 年限默认1
89 } 91 }
90 // 初始化接口 92 }
91 getMyMemberCertUnitFeeApi() 93 // 初始化接口
92 }) 94 getMyMemberCertUnitFeeApi()
93 95 })
94 96
95 97
96 // 减年限 98 // 减年限
97 const minusYear = () => { 99 const minusYear = () => {
98 if (form.value.payYear > 1) { 100 if (form.value.payYear > 1) {
99 form.value.payYear-- 101 form.value.payYear--
100 } 102 }
101 } 103 }
102 104
103 // 加年限(最大 5 年) 105 // 加年限(最大 5 年)
104 const plusYear = () => { 106 const plusYear = () => {
105 if (form.value.payYear < 5) { 107 if (form.value.payYear < 5) {
106 form.value.payYear++ 108 form.value.payYear++
107 } 109 }
108 } 110 }
109 111
110 // 支付方式切换 112 // 支付方式切换
111 const onPayTypeChange = (e) => { 113 const onPayTypeChange = (e) => {
112 payType.value = e.detail.value 114 payType.value = e.detail.value
113 } 115 }
114 116
115 const handelPay = async () => { 117 const handelPay = async () => {
116 if (memberTotalFee.value <= 0) { 118 if (memberTotalFee.value <= 0) {
117 uni.showToast({ 119 uni.showToast({
118 title: '支付金额异常', 120 title: '支付金额异常',
119 icon: 'none' 121 icon: 'none'
120 }) 122 })
121 return 123 return
122 } 124 }
123 125
124 // 显示 loading 126 // 显示 loading
125 uni.showLoading({ 127 uni.showLoading({
126 title: '创建订单...', 128 title: '创建订单...',
127 mask: true 129 mask: true
128 }) 130 })
129 isPaying.value = true 131 isPaying.value = true
130 132 form.value.validityDate = undefined
131 // 拼接完整参数 133 // 拼接完整参数
132 const postData = { 134 const postData = {
133 ...form.value, 135 ...form.value,
134 payYear: form.value.payYear, 136 payYear: form.value.payYear,
135 payType: payType.value, 137 payType: payType.value,
136 totalFee: memberTotalFee.value 138 totalFee: memberTotalFee.value,
137 } 139 }
138 140
139 // 创建订单 141 // 创建订单
140 const [orderErr, orderRes] = await to(api.insertSinglePay(postData)) 142 const [orderErr, orderRes] = await to(api.insertSinglePay(postData))
141 uni.hideLoading() 143 uni.hideLoading()
142 144
143 if (orderErr) { 145 if (orderErr) {
144 isPaying.value = false 146 isPaying.value = false
145 // uni.showToast({ 147 // uni.showToast({
146 // title: '创建订单失败', 148 // title: '创建订单失败',
147 // icon: 'none' 149 // icon: 'none'
148 // }) 150 // })
149 return 151 return
150 } 152 }
151 153
152 if (!orderRes.data?.orderId) { 154 if (!orderRes.data?.orderId) {
153 isPaying.value = false 155 isPaying.value = false
154 uni.showToast({ 156 uni.showToast({
155 title: '订单创建异常', 157 title: '订单创建异常',
156 icon: 'none' 158 icon: 'none'
157 }) 159 })
158 return 160 return
159 } 161 }
160 162
161 // 调起支付 163 // 调起支付
162 const [payErr] = await to(minShengPay(orderRes.data.orderId, orderRes.data.payResult.encryptedData)) 164 const [payErr] = await to(minShengPay(orderRes.data.orderId, orderRes.data.payResult.encryptedData))
163 165
164 isPaying.value = false 166 isPaying.value = false
165 167
166 // 支付失败不跳转 168 // 支付失败不跳转
167 if (payErr) { 169 if (payErr) {
168 return 170 return
169 } 171 }
170 172
171 // 支付成功,跳转页面 173 // 支付成功,跳转页面
172 uni.redirectTo({ 174 uni.redirectTo({
173 url: `/personal/sucPay?orderId=${orderRes.data.orderId}` 175 url: `/personal/sucPay?orderId=${orderRes.data.orderId}`
174 }) 176 })
175 } 177 }
176 178
177 179
178 180 // 获取会员费
179 // 获取会员费 181 async function getMyMemberCertUnitFeeApi() {
180 async function getMyMemberCertUnitFeeApi() { 182 const res = await api.getZtxFeeConfig()
181 const res = await api.getZtxFeeConfig() 183 memberFee.value = Number(res.data.personMemberFee || 1500)
182 memberFee.value = Number(res.data.personMemberFee || 1500) 184 }
183 }
184 </script> 185 </script>
185 186
186 <style scoped> 187 <style scoped>
187 .container {
188 min-height: 100vh;
189 background-color: #f7f7f7;
190 }
191
192 .content {
193 padding: 20rpx 20rpx 120rpx;
194 }
195
196 .card {
197 background: #fff;
198 border-radius: 8rpx;
199 padding: 25rpx 20rpx;
200 margin-bottom: 20rpx;
201 }
202
203 .yearRow {
204 display: flex;
205 align-items: center;
206 justify-content: space-between;
207 margin-bottom: 20rpx;
208 }
209
210 .yearRow .label {
211 font-size: 28rpx;
212 color: #333;
213 }
214
215 .yearRow .control {
216 display: flex;
217 align-items: center;
218 }
219
220 .control image {
221 width: 50rpx;
222 height: 50rpx;
223 }
224
225 .yearRow .num {
226 font-size: 28rpx;
227 color: #333;
228 min-width: 80rpx;
229 text-align: center;
230 margin: 0 10rpx;
231 }
232
233 .row {
234 display: flex;
235 justify-content: space-between;
236 align-items: center;
237 }
238
239 .row .label {
240 font-size: 28rpx;
241 color: #333;
242 }
243
244 .row .value {
245 font-size: 30rpx;
246 color: #C4121B;
247 font-weight: 500;
248 }
249
250 .hintRow {
251 display: flex;
252 align-items: flex-start;
253 font-size: 24rpx;
254 line-height: 1.4;
255 }
256
257 .hintRow .hintText {
258 color: #FF8124;
259 flex: 1;
260 margin-top: 10rpx;
261 }
262
263 .deductRow {
264 background: #fff;
265 padding: 20rpx 20rpx;
266 display: flex;
267 justify-content: space-between;
268 align-items: center;
269 margin-bottom: 10rpx;
270 border-radius: 8rpx;
271 }
272
273 .deductRow .label {
274 font-size: 28rpx;
275 color: #333;
276 }
277
278 .deductRow .value {
279 font-size: 30rpx;
280 color: #C4121B;
281 }
282
283 .payRow {
284 background: #fff;
285 border-radius: 8rpx;
286 padding: 20rpx 20rpx;
287 margin-bottom: 20rpx;
288 }
289
290 .radioItem {
291 display: flex;
292 align-items: center;
293 }
294
295 .payInfo {
296 display: flex;
297 align-items: center;
298 margin-left: 15rpx;
299 }
300
301 .payInfo .icon {
302 width: 40rpx;
303 height: 40rpx;
304 margin-right: 10rpx;
305 }
306
307 .payInfo text {
308 font-size: 28rpx;
309 color: #333;
310 }
311
312 .totalRow {
313 background: #fff;
314 border-radius: 8rpx;
315 padding: 20rpx 20rpx;
316 display: flex;
317 justify-content: space-between;
318 align-items: center;
319 margin-top: 10rpx;
320 }
321
322 .totalRow .label {
323 font-size: 28rpx;
324 color: #333;
325 }
326
327 .redBig {
328 font-size: 32rpx;
329 color: #C4121B;
330 font-weight: bold;
331 }
332
333 .bottomBtn {
334 position: fixed;
335 bottom: 0;
336 left: 0;
337 right: 0;
338 padding: 20rpx 20rpx;
339 background: #fff;
340 border-top: 1rpx solid #eee;
341 }
342
343 .payBtn {
344 width: 100%;
345 height: 88rpx;
346 line-height: 88rpx;
347 background-color: #C4121B;
348 color: #fff;
349 border-radius: 8rpx;
350 font-size: 32rpx;
351 text-align: center;
352 border: none;
353 }
354
355 .payBtn[disabled] {
356 background-color: #ccc;
357 color: #999;
358 }
359
360 .red {
361 color: #C4121B;
362 }
363
364 .icon {
365 width: 30px;
366 }
367
368 ::v-deep .custom-radio .wx-radio-input {
369 width: 30rpx;
370 height: 30rpx;
371 border-radius: 50%;
372 border: 2rpx solid #ccc;
373 }
374
375 ::v-deep .custom-radio .wx-radio-input.wx-radio-input-checked {
376 border-color: #C4121B !important;
377 background: #C4121B !important;
378 }
379 </style>
...\ No newline at end of file ...\ No newline at end of file
188 .container {
189 min-height: 100vh;
190 background-color: #f7f7f7;
191 }
192
193 .content {
194 padding: 20rpx 20rpx 120rpx;
195 }
196
197 .card {
198 background: #fff;
199 border-radius: 8rpx;
200 padding: 25rpx 20rpx;
201 margin-bottom: 20rpx;
202 }
203
204 .yearRow {
205 display: flex;
206 align-items: center;
207 justify-content: space-between;
208 margin-bottom: 20rpx;
209 }
210
211 .yearRow .label {
212 font-size: 28rpx;
213 color: #333;
214 }
215
216 .yearRow .control {
217 display: flex;
218 align-items: center;
219 }
220
221 .control image {
222 width: 50rpx;
223 height: 50rpx;
224 }
225
226 .yearRow .num {
227 font-size: 28rpx;
228 color: #333;
229 min-width: 80rpx;
230 text-align: center;
231 margin: 0 10rpx;
232 }
233
234 .row {
235 display: flex;
236 justify-content: space-between;
237 align-items: center;
238 }
239
240 .row .label {
241 font-size: 28rpx;
242 color: #333;
243 }
244
245 .row .value {
246 font-size: 30rpx;
247 color: #C4121B;
248 font-weight: 500;
249 }
250
251 .hintRow {
252 display: flex;
253 align-items: flex-start;
254 font-size: 24rpx;
255 line-height: 1.4;
256 }
257
258 .hintRow .hintText {
259 color: #FF8124;
260 flex: 1;
261 margin-top: 10rpx;
262 }
263
264 .deductRow {
265 background: #fff;
266 padding: 20rpx 20rpx;
267 display: flex;
268 justify-content: space-between;
269 align-items: center;
270 margin-bottom: 10rpx;
271 border-radius: 8rpx;
272 }
273
274 .deductRow .label {
275 font-size: 28rpx;
276 color: #333;
277 }
278
279 .deductRow .value {
280 font-size: 30rpx;
281 color: #C4121B;
282 }
283
284 .payRow {
285 background: #fff;
286 border-radius: 8rpx;
287 padding: 20rpx 20rpx;
288 margin-bottom: 20rpx;
289 }
290
291 .radioItem {
292 display: flex;
293 align-items: center;
294 }
295
296 .payInfo {
297 display: flex;
298 align-items: center;
299 margin-left: 15rpx;
300 }
301
302 .payInfo .icon {
303 width: 40rpx;
304 height: 40rpx;
305 margin-right: 10rpx;
306 }
307
308 .payInfo text {
309 font-size: 28rpx;
310 color: #333;
311 }
312
313 .totalRow {
314 background: #fff;
315 border-radius: 8rpx;
316 padding: 20rpx 20rpx;
317 display: flex;
318 justify-content: space-between;
319 align-items: center;
320 margin-top: 10rpx;
321 }
322
323 .totalRow .label {
324 font-size: 28rpx;
325 color: #333;
326 }
327
328 .redBig {
329 font-size: 32rpx;
330 color: #C4121B;
331 font-weight: bold;
332 }
333
334 .bottomBtn {
335 position: fixed;
336 bottom: 0;
337 left: 0;
338 right: 0;
339 padding: 20rpx 20rpx;
340 background: #fff;
341 border-top: 1rpx solid #eee;
342 }
343
344 .payBtn {
345 width: 100%;
346 height: 88rpx;
347 line-height: 88rpx;
348 background-color: #C4121B;
349 color: #fff;
350 border-radius: 8rpx;
351 font-size: 32rpx;
352 text-align: center;
353 border: none;
354 }
355
356 .payBtn[disabled] {
357 background-color: #ccc;
358 color: #999;
359 }
360
361 .red {
362 color: #C4121B;
363 }
364
365 .icon {
366 width: 30px;
367 }
368
369 ::v-deep .custom-radio .wx-radio-input {
370 width: 30rpx;
371 height: 30rpx;
372 border-radius: 50%;
373 border: 2rpx solid #ccc;
374 }
375
376 ::v-deep .custom-radio .wx-radio-input.wx-radio-input-checked {
377 border-color: #C4121B !important;
378 background: #C4121B !important;
379 }
380 </style>
......
...@@ -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!