You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.2 KiB

4 years ago
// pages/user/invoice/make_invoice/make_invoice.js
import {http} from "../../../../utils/util"
Page({
/**
* 页面的初始数据
*/
data: {
4 years ago
},
_nav(){
wx.navigateTo({
url: '/pages/user/invoice/invoice_edit/invoice_edit_newMake',
})
4 years ago
},
_confirm:function(){
let data1 =this.data.invoice_info
4 years ago
if (data1.is_company == 0 ){
data1 = {
is_company:data1.is_company,
invoice_title: data1.invoice_title,
email:data1.email,
order_no:data1.order_no
}
}
4 years ago
wx.showModal({
content: '是否确认开票',
confirmColor:"#FF333",
4 years ago
success (res) {
if (res.confirm) {
http("/api/v1/invoice-add","post",data1).then(res=>{
wx.navigateBack()
var pages = getCurrentPages();//获取页面栈
if (pages.length > 1) {
//上一个页面实例对象
var prePage = pages[pages.length - 2];
//调用上一个页面的onShow方法
4 years ago
prePage.onLoad({})
4 years ago
}
4 years ago
wx.showToast({
title: '开票成功',
icon: 'success',
duration: 2000
})
})
} else if (res.cancel) {
// console.log('用户点击取消')
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let order_no =options.order_no
http("/api/v1/invoice-title","post").then(res=>{
res.order_no=order_no
this.setData({invoice_info:res})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})