|
|
@@ -62,8 +62,11 @@
|
|
|
|
|
|
<view class="modal-header">
|
|
|
<text class="modal-title">{{ editId ? '编辑抬头' : '新增抬头' }}</text>
|
|
|
- <view class="modal-close" @click="closeForm">
|
|
|
- <uni-icons type="closeempty" size="20" color="rgba(0,0,0,0.4)"></uni-icons>
|
|
|
+ <view class="modal-header-right">
|
|
|
+ <text class="import-title-btn" @click="importWechatTitle">导入微信抬头</text>
|
|
|
+ <view class="modal-close" @click="closeForm">
|
|
|
+ <uni-icons type="closeempty" size="20" color="rgba(0,0,0,0.4)"></uni-icons>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -207,6 +210,25 @@ function playHint() {
|
|
|
setTimeout(() => { swipedIdx.value = -1; }, 250);
|
|
|
}, 1600);
|
|
|
}
|
|
|
+const importWechatTitle = () => {
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ wx.chooseInvoiceTitle({
|
|
|
+ success: (res: any) => {
|
|
|
+ editForm.invoiceType = res.type === '1' ? 'ORGANIZATION' : 'INDIVIDUAL';
|
|
|
+ editForm.invoiceTitle = res.title || '';
|
|
|
+ editForm.taxId = res.taxNumber || '';
|
|
|
+ editForm.address = res.companyAddress || '';
|
|
|
+ editForm.phone = res.telephone || '';
|
|
|
+ editForm.bankName = res.bankName || '';
|
|
|
+ editForm.bankAccount = res.bankAccount || '';
|
|
|
+ },
|
|
|
+ fail: (err: any) => {
|
|
|
+ console.log('取消选择微信抬头', err);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+};
|
|
|
+
|
|
|
const openForm = () => { resetForm(); showForm.value = true; calcModalHeight(); };
|
|
|
const closeForm = () => { if (!saving.value) showForm.value = false; };
|
|
|
const calcModalHeight = () => { maxModalHeight.value = (uni.getSystemInfoSync().windowHeight || 800) * 0.7; };
|
|
|
@@ -337,7 +359,9 @@ onShow(() => { loadList(); });
|
|
|
|
|
|
.modal-header { display: flex; align-items: center; justify-content: center; padding: 8rpx 30rpx 20rpx; position: relative; border-bottom: 1rpx solid rgba(0,0,0,0.05); }
|
|
|
.modal-title { font-size: 32rpx; font-weight: 600; color: #1a1a1a; }
|
|
|
-.modal-close { position: absolute; right: 30rpx; top: 50%; transform: translateY(-50%); padding: 12rpx; }
|
|
|
+.modal-header-right { position: absolute; right: 30rpx; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
|
|
|
+.import-title-btn { font-size: 24rpx; color: #419D95; padding: 8rpx 16rpx; border: 1rpx solid rgba(65, 157, 149, 0.4); border-radius: 16rpx; margin-right: 16rpx; }
|
|
|
+.modal-close { padding: 12rpx; }
|
|
|
|
|
|
.modal-body { padding: 8rpx 30rpx 0; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; }
|
|
|
|