mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 16:17:21 +08:00
Merge branch 'dev' into 'master'
uniapp【新增】:发票页面新增从微信获取发票数据 See merge request jianweie/coreshoppro!98
This commit is contained in:
@@ -60,32 +60,29 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.btn-box {
|
.btn-box {
|
||||||
padding:20rpx;
|
width: 100%;
|
||||||
width: calc(100% - 40rpx);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
.btn {
|
||||||
.no {
|
flex: 1;
|
||||||
width: 48%;
|
margin: 20rpx;
|
||||||
background-color: #333;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 27rpx;
|
font-size: 27rpx;
|
||||||
height: 90prx;
|
height: 90prx;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
border-radius: 15rpx;
|
border-radius: 15rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.no {
|
||||||
|
background-color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ok {
|
.ok {
|
||||||
width: 48%;
|
|
||||||
background-color: #d33123;
|
background-color: #d33123;
|
||||||
color: #fff;
|
}
|
||||||
font-size: 27rpx;
|
.choose {
|
||||||
height: 90prx;
|
background-color: #54bd63;
|
||||||
line-height: 90rpx;
|
|
||||||
border-radius: 15rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,11 @@
|
|||||||
<!-- 底部按钮 -->
|
<!-- 底部按钮 -->
|
||||||
<view class="goods-detail-bottom-tabbar">
|
<view class="goods-detail-bottom-tabbar">
|
||||||
<view class="btn-box">
|
<view class="btn-box">
|
||||||
<view class="no" @click="handleNotUseInvoices"> 本次不开具发票 </view>
|
<view class="btn no" @click="handleNotUseInvoices"> 本次不开具发票 </view>
|
||||||
<view class="ok" @click="handleSaveInvoice"> 保存发票 </view>
|
<view class="btn ok" @click="handleSaveInvoice"> 保存发票 </view>
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<view class="btn choose" @click="handleChooseInvoice"> 获取用户发票 </view>
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -140,6 +143,24 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoiceTitle.html
|
||||||
|
* 在微信小程序中,当前小程序必须关联一个公众号,且这个公众号是完成了微信认证的,才能调用 chooseInvoiceTitle。
|
||||||
|
*/
|
||||||
|
const handleChooseInvoice = () => {
|
||||||
|
uni.chooseInvoiceTitle({
|
||||||
|
success(res : any) {
|
||||||
|
if (res.errMsg == "chooseInvoiceTitle:ok") {
|
||||||
|
state.model.name = res.title;
|
||||||
|
state.model.code = res.taxNumber;
|
||||||
|
state.model.type = res.type == "0" ? InvoiceEnum.company : InvoiceEnum.personal;
|
||||||
|
state.model.typeName = res.type == "0" ? state.radioItems[1].name : state.radioItems[0].name;
|
||||||
|
} else {
|
||||||
|
handleShowToast(res.errMsg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
/** 保存发票 */
|
/** 保存发票 */
|
||||||
const handleSaveInvoice = () => {
|
const handleSaveInvoice = () => {
|
||||||
if (state.model.type === InvoiceEnum.no) {
|
if (state.model.type === InvoiceEnum.no) {
|
||||||
|
|||||||
Reference in New Issue
Block a user