|
|
@@ -24,16 +24,34 @@
|
|
|
<view class="tel flex">
|
|
|
<label>缴费类型:</label>
|
|
|
<radio-group @change="payChange">
|
|
|
- <radio value="1" :checked="payInfo.type!==2" style="margin-right: 30rpx;transform: scale(0.85);">金额</radio>
|
|
|
- <radio value="2" :checked="payInfo.type===2" style="transform: scale(0.85);">空置</radio>
|
|
|
+ <radio value="1" :checked="payInfo.type!=2" style="margin-right: 30rpx;transform: scale(0.85);">金额</radio>
|
|
|
+ <radio value="2" :checked="payInfo.type==2" style="transform: scale(0.85);">空置</radio>
|
|
|
</radio-group>
|
|
|
</view>
|
|
|
<view class="tel flex">
|
|
|
<label>缴费金额:</label>
|
|
|
<input type="text" class="card input" id="real_fee" v-model="payInfo.real_fee" disabled/>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ <view class="tel flex">
|
|
|
+ <label>订单状态:</label>
|
|
|
+ <input type="text" class="card input" id="status" :style="{color:statusColor[payInfo.status]}" v-model="statusObj[payInfo.status]" disabled/>
|
|
|
+ </view>
|
|
|
+ <view class="tel flex" v-if="payInfo.invoice_status > 0">
|
|
|
+ <label>发票抬头:</label>
|
|
|
+ <input type="text" class="card input" id="real_fee" v-model="payInfo.invoice" disabled/>
|
|
|
+ </view>
|
|
|
+ <view class="tel flex" v-if="payInfo.invoice_status > 0">
|
|
|
+ <label>发票备注:</label>
|
|
|
+ <input type="text" class="card input" id="real_fee" v-model="payInfo.invoice_remark" disabled/>
|
|
|
+ </view>
|
|
|
+ <view class="tel flex" v-if="payInfo.invoice_status > 0">
|
|
|
+ <label>发票状态:</label>
|
|
|
+ <input type="text" class="card input" id="real_fee" v-model="invoiceStatusStr" disabled/>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
- <button class="submit" @tap="paySubmit">{{payStatus ? '申请开票' : '缴费'}}</button>
|
|
|
+ <button class="submit" style="margin-bottom:20rpx" @tap="paySubmit" v-if="needPay">{{payStatusStr}}</button>
|
|
|
+ <button class="submit" style="margin-top:20rpx" @tap="openPopup" v-if="needInvoice">申请开票</button>
|
|
|
<uni-popup ref="popup" :mask-click="false">
|
|
|
<view class="popup-box">
|
|
|
<view>
|
|
|
@@ -41,10 +59,10 @@
|
|
|
<view class="popup-content-box">
|
|
|
<view class="popup-content">
|
|
|
<view class="popup-type">
|
|
|
- <view>开票抬头:</view><input type="text" value="" />
|
|
|
+ <view>开票抬头:</view><input type="text" v-model="invoiceName" />
|
|
|
</view>
|
|
|
<view class="popup-type">
|
|
|
- <view>备注:</view><input type="text" value="" />
|
|
|
+ <view>备注:</view><input type="text" v-model="invoiceRemark" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -64,7 +82,15 @@ export default {
|
|
|
payInfo: {
|
|
|
},
|
|
|
payStatus:0,
|
|
|
+ payStatusStr : '缴费',
|
|
|
+ needPay : 1,
|
|
|
+ needInvoice : 0,
|
|
|
+ invoiceStatusStr : "待开票",
|
|
|
pay_code : '',
|
|
|
+ statusObj:getApp().globalData.statusObj,
|
|
|
+ statusColor:getApp().globalData.statusColor,
|
|
|
+ invoiceName : '',
|
|
|
+ invoiceRemark : '',
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
@@ -73,21 +99,8 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getPayDetail(payId) {
|
|
|
- let md5Sign = md5(
|
|
|
- "method=" +
|
|
|
- "user" +
|
|
|
- "×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +
|
|
|
- "&secret=" +
|
|
|
- getApp().globalData.secret
|
|
|
- );
|
|
|
- let url =
|
|
|
- getApp().globalData.shareUrl +
|
|
|
- "api/api.php" +
|
|
|
- "?method=user&source=user&action=get_order_info×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +
|
|
|
- "&sign=" +
|
|
|
- md5Sign;
|
|
|
+
|
|
|
+ let url = getApp().makeApiUrl("user",'user','get_order_info');
|
|
|
let postData = {
|
|
|
code:payId,
|
|
|
openId: getApp().globalData.open_id,
|
|
|
@@ -102,7 +115,19 @@ export default {
|
|
|
success: (res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
this.payInfo = res.data.data;
|
|
|
- this.payInfo.address = this.payInfo.estate_name + this.payInfo.building_name + this.payInfo.unit + this.payInfo.room
|
|
|
+ this.payInfo.address = this.payInfo.estate_name + this.payInfo.building_name + this.payInfo.unit + this.payInfo.room;
|
|
|
+ if (this.payInfo.status > 0 && this.payInfo.invoice_status == 0){
|
|
|
+ this.needInvoice = 1;
|
|
|
+ }
|
|
|
+ if (this.payInfo.status == 2){
|
|
|
+ this.payStatusStr = '补充缴费';
|
|
|
+ }
|
|
|
+ if (this.payInfo.status == 1 || this.payInfo.status == 3){
|
|
|
+ this.needPay = 0;
|
|
|
+ }
|
|
|
+ if (this.payInfo.invoice_status == 2){
|
|
|
+ this.invoiceStatusStr = "已开票";
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: res.data.msg,
|
|
|
@@ -131,26 +156,8 @@ export default {
|
|
|
this.payInfo.type = e.detail.value;
|
|
|
},
|
|
|
paySubmit(){
|
|
|
- if(this.payStatus){
|
|
|
- this.open()
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
- let md5Sign = md5(
|
|
|
- "method=" +
|
|
|
- "user" +
|
|
|
- "×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +
|
|
|
- "&secret=" +
|
|
|
- getApp().globalData.secret
|
|
|
- );
|
|
|
- let url =
|
|
|
- getApp().globalData.shareUrl +
|
|
|
- "api/api.php" +
|
|
|
- "?method=user&source=user&action=prepay×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +
|
|
|
- "&sign=" +
|
|
|
- md5Sign;
|
|
|
+ let url = getApp().makeApiUrl("user",'user','prepay');
|
|
|
let postData = {
|
|
|
code:this.pay_code,
|
|
|
type : this.payInfo.type,
|
|
|
@@ -202,13 +209,48 @@ export default {
|
|
|
|
|
|
},
|
|
|
submitInvocie(){
|
|
|
- this.closePopup()
|
|
|
+
|
|
|
+ this.closePopup();
|
|
|
+
|
|
|
},
|
|
|
- open() {
|
|
|
- this.$refs.popup.open('center')
|
|
|
+ openPopup() {
|
|
|
+ this.$refs.popup.open('center');
|
|
|
},
|
|
|
closePopup() {
|
|
|
- this.$refs.popup.close()
|
|
|
+ this.$refs.popup.close();
|
|
|
+ let url = getApp().makeApiUrl("user",'user','invoice');
|
|
|
+ let postData = {
|
|
|
+ code:this.pay_code,
|
|
|
+ invoice : this.invoiceName,
|
|
|
+ remark : this.invoiceRemark,
|
|
|
+ openId: getApp().globalData.open_id,
|
|
|
+ };
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: postData,
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ icon: "none",
|
|
|
+ duration: 2500,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ icon: "none",
|
|
|
+ duration: 2500,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|