invoiceForm.vue
3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
<view>
<!--<uni-notice-bar backgroundColor="#f2fded" color="#51c24e" single showIcon text="已发送电子邮箱"></uni-notice-bar>-->
<uni-list>
<uni-list-item title="发票预览" clickable showArrow @click="previewCell"/>
</uni-list>
<uni-list>
<view class="recordCon uni-list-cell-pd">
<text class="color-black">发票信息</text>
</view>
<view class="recordCon uni-list-cell-pd">
<text>电子邮箱:{{invoiceInfo.email}}</text>
</view>
</uni-list>
<view class="bg-white border-bottom-1 pos-rel" @click="recordClick">
<view class="recordCon uni-list-cell-pd">
<text class="color-black">发票包含内容</text>
</view>
<view class="recordCon uni-list-cell-pd">
<text>该发票包含{{len}}笔交易</text>
</view>
<view class="uni-icon pos-abs icon-arrowright uni-icon-arrowright">
</view>
</view>
<view class="margin-top-30">
<button type="primary" class="tel-btn" @click="sentEmail">重发邮件</button>
</view>
<view class="margin-top-30">
<button class="tel-btn" v-if="tel.length>0" type="primary" plain="true" @click="call">客服电话:{{tel}}</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
invoiceInfo: {
email: '',
number: 0
},
tel: '051086166660',
invoiceId:'',
invoiceUrl:'',
index:0,
len:0
}
},
onLoad(params){
var pages = getCurrentPages();//当前页
var beforePage = pages[pages.length - 2];//上个页面
console.log(beforePage.$vm.list)
console.log(params)
this.invoiceInfo.email = params.custEmail
this.invoiceId = params.invoiceId
this.index = params.index
this.invoiceUrl =beforePage.$vm.list[this.index].invoiceUrl
this.len = params.len
},
methods: {
call(){
var me = this;
uni.makePhoneCall({
phoneNumber: me.tel //仅为示例
});
},
previewCell() {
uni.navigateTo({
url: '../invoicePreview/invoicePreview?index='+this.index
});
// window.open(this.invoiceUrl)
},
recordClick() {
uni.navigateTo({
url: '../elecRecord/elecRecord?index='+this.index
});
},
sentEmail(){
var resendInvoiceMail = this.$common.resendInvoiceMail;
var jsondata = {
invoiceId:this.invoiceId,
orgId:this.$common.public_orgId
};
uni.request({
url: resendInvoiceMail,
data: JSON.stringify(this.$common.requestSign(jsondata)),
dataType: "json",
method: "POST",
success: (res) => {
console.log(res)
console.log(res.data)
console.log(res.code)
if (res.data.code == 0) {
uni.showToast({
icon:'none',
title: `邮件发送成功`
})
}
}
})
}
}
}
</script>
<style scoped>
.icon-arrowright {
color: #bbb;
font-size: 20px;
right: 15upx;
top: 60upx;
}
.tel-btn {
width: 90%;
margin: 30upx auto;
}
>>> .uni-list-cell__content-title {
margin-left: 0 !important;
}
</style>