|
@@ -1,391 +1,365 @@
|
|
|
|
|
|
- // const app = getApp()
|
|
|
- const app = {};
|
|
|
- import arrowIcon from '../../static/images/arrows.png';
|
|
|
- import { mapState } from 'vuex';
|
|
|
- // import MemberCacheTool from '@/utils/member-cache-tool.js';
|
|
|
- import uni from '@/utils/uniHooks';
|
|
|
- import { getUrlParams } from '@/utils/index.js';
|
|
|
- import { Dialog, Toast } from 'vant';
|
|
|
+// const app = getApp()
|
|
|
+const app = {};
|
|
|
+import arrowIcon from '../../static/images/arrows.png';
|
|
|
+import { mapState } from 'vuex';
|
|
|
+// import MemberCacheTool from '@/utils/member-cache-tool.js';
|
|
|
+import uni from '@/utils/uniHooks';
|
|
|
+import { getUrlParams } from '@/utils/index.js';
|
|
|
+import { Dialog, Toast } from 'vant';
|
|
|
|
|
|
- export default {
|
|
|
+export default {
|
|
|
data() {
|
|
|
- return {
|
|
|
- picUrl: this.$picUrl,
|
|
|
- globalData: app.globalData,
|
|
|
- arrowIcon: arrowIcon,
|
|
|
- isShow: false,
|
|
|
- isDefaultEMail: false,
|
|
|
- ids: [],
|
|
|
- condition: {
|
|
|
- // openid: this.openid,
|
|
|
- // groupId: this.groupId,
|
|
|
- // vipcode: this.member?.vipcode,
|
|
|
- invoiceName: '', // 否|发票名称
|
|
|
- invoiceCategory: 0, // 发票类型 0:停车缴费 1:活动
|
|
|
- invoiceType: 0, // 发票类型:0:增值税普通电子发票
|
|
|
- remark: '',
|
|
|
- invoiceTitleId: 0, // long|发票抬头id
|
|
|
- ids: [], // 被选中的缴费记录id
|
|
|
- isDefaultEmail: '1', // 是|邮箱是否默认 0:否 1:是
|
|
|
- mailbox: '',
|
|
|
-},
|
|
|
- headerInfo: {},
|
|
|
- // 总金额,单位分
|
|
|
- invoiceAmount: 0,
|
|
|
- orderInfo: {},
|
|
|
- type: '', // 当前是活动还是停车
|
|
|
- isSubmitFlag: true, // 发票提交申请的flag,
|
|
|
- pageOptions: null,
|
|
|
- preUrl: '',
|
|
|
- orderQuantity: 0,
|
|
|
- parkingOrder: null,
|
|
|
-};
|
|
|
-},
|
|
|
+ return {
|
|
|
+ picUrl: this.$picUrl,
|
|
|
+ globalData: app.globalData,
|
|
|
+ arrowIcon: arrowIcon,
|
|
|
+ isShow: false,
|
|
|
+ isDefaultEMail: false,
|
|
|
+ ids: [],
|
|
|
+ condition: {
|
|
|
+ // openid: this.openid,
|
|
|
+ // groupId: this.groupId,
|
|
|
+ // vipcode: this.member?.vipcode,
|
|
|
+ invoiceName: '', // 否|发票名称
|
|
|
+ invoiceCategory: 0, // 发票类型 0:停车缴费 1:活动
|
|
|
+ invoiceType: 0, // 发票类型:0:增值税普通电子发票
|
|
|
+ remark: '',
|
|
|
+ invoiceTitleId: 0, // long|发票抬头id
|
|
|
+ ids: [], // 被选中的缴费记录id
|
|
|
+ isDefaultEmail: '1', // 是|邮箱是否默认 0:否 1:是
|
|
|
+ mailbox: '',
|
|
|
+ },
|
|
|
+ headerInfo: {},
|
|
|
+ // 总金额,单位分
|
|
|
+ invoiceAmount: 0,
|
|
|
+ orderInfo: {},
|
|
|
+ type: '', // 当前是活动还是停车
|
|
|
+ isSubmitFlag: true, // 发票提交申请的flag,
|
|
|
+ pageOptions: null,
|
|
|
+ preUrl: '',
|
|
|
+ orderQuantity: 0,
|
|
|
+ parkingOrder: null,
|
|
|
+ };
|
|
|
+ },
|
|
|
created() {
|
|
|
- // const options = this.$route.query;
|
|
|
- // console.log('===>onLoad', options);
|
|
|
- // this.pageOptions = options;
|
|
|
- // 埋点本地化
|
|
|
- this.preUrl = uni.getStorageSync('previousUrl');
|
|
|
- uni.setStorageSync(
|
|
|
- 'previousUrl',
|
|
|
- '/pages/parkingFee/parkingReceipt/parkingApplication.vue'
|
|
|
- );
|
|
|
-},
|
|
|
+ // const options = this.$route.query;
|
|
|
+ // console.log('===>onLoad', options);
|
|
|
+ // this.pageOptions = options;
|
|
|
+ // 埋点本地化
|
|
|
+ this.preUrl = uni.getStorageSync('previousUrl');
|
|
|
+ uni.setStorageSync(
|
|
|
+ 'previousUrl',
|
|
|
+ '/pages/parkingFee/parkingReceipt/parkingApplication.vue'
|
|
|
+ );
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- // console.log(253, this.ids);
|
|
|
- setTimeout(() => {
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: '发票申请',
|
|
|
-});
|
|
|
-}, 300);
|
|
|
- // console.clear();
|
|
|
- const query = getUrlParams();
|
|
|
- // console.log('是否重新回到改页面', this.pageOptions);
|
|
|
- // console.log('是否重新回到改页面', query);
|
|
|
- // console.log(260, this.$route.query);
|
|
|
- this.pageOptions = query;
|
|
|
- if (this.pageOptions) {
|
|
|
- const options = this.pageOptions;
|
|
|
- // console.log('===>onShow', options);
|
|
|
- // console.log('===>onShow', options.ids);
|
|
|
+ // console.log(253, this.ids);
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '发票申请',
|
|
|
+ });
|
|
|
+ }, 300);
|
|
|
+ // console.clear();
|
|
|
+ const query = getUrlParams();
|
|
|
+ // console.log('是否重新回到改页面', this.pageOptions);
|
|
|
+ // console.log('是否重新回到改页面', query);
|
|
|
+ // console.log(260, this.$route.query);
|
|
|
+ this.pageOptions = query;
|
|
|
+ if (this.pageOptions) {
|
|
|
+ const options = this.pageOptions;
|
|
|
+ // console.log('===>onShow', options);
|
|
|
+ // console.log('===>onShow', options.ids);
|
|
|
|
|
|
- if (options.type && options.money) {
|
|
|
- this.type = options.type;
|
|
|
- this.invoiceAmount = options.money;
|
|
|
-}
|
|
|
- if (options.ids) {
|
|
|
- const ids = options.ids;
|
|
|
- if (ids.indexOf(',') > -1) {
|
|
|
- this.ids = ids.split(',');
|
|
|
-} else {
|
|
|
- this.ids =
|
|
|
- typeof ids === 'string'
|
|
|
- ? ids.indexOf('[') > -1
|
|
|
- ? JSON.parse(ids)
|
|
|
- : [ids]
|
|
|
- : ids;
|
|
|
-}
|
|
|
- this.orderQuantity = this.ids.length;
|
|
|
- // console.log('获取订单信息');
|
|
|
- this.getParkOrderInfo();
|
|
|
- this.getInvoiceEmailInfo();
|
|
|
-}
|
|
|
- if (options.header) {
|
|
|
- if (typeof options.header == 'string') {
|
|
|
- this.headerInfo = JSON.parse(options.header);
|
|
|
-} else if (typeof options.header == 'object') {
|
|
|
- this.headerInfo = options.header;
|
|
|
-}
|
|
|
-} else {
|
|
|
- this.getInvoiceTitle();
|
|
|
-}
|
|
|
-}
|
|
|
-},
|
|
|
+ if (options.type && options.money) {
|
|
|
+ this.type = options.type;
|
|
|
+ this.invoiceAmount = options.money;
|
|
|
+ }
|
|
|
+ if (options.ids) {
|
|
|
+ const ids = options.ids;
|
|
|
+ if (ids.indexOf(',') > -1) {
|
|
|
+ this.ids = ids.split(',');
|
|
|
+ } else {
|
|
|
+ this.ids =
|
|
|
+ typeof ids === 'string'
|
|
|
+ ? ids.indexOf('[') > -1
|
|
|
+ ? JSON.parse(ids)
|
|
|
+ : [ids]
|
|
|
+ : ids;
|
|
|
+ }
|
|
|
+ this.orderQuantity = this.ids.length;
|
|
|
+ // console.log('获取订单信息');
|
|
|
+ this.getParkOrderInfo();
|
|
|
+ this.getInvoiceEmailInfo();
|
|
|
+ }
|
|
|
+ if (options.header) {
|
|
|
+ if (typeof options.header == 'string') {
|
|
|
+ this.headerInfo = JSON.parse(options.header);
|
|
|
+ } else if (typeof options.header == 'object') {
|
|
|
+ this.headerInfo = options.header;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.getInvoiceTitle();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: {
|
|
|
- ...mapState({
|
|
|
- custTypeId: (state) => state.custTypeId,
|
|
|
- groupId: (state) => state.groupId,
|
|
|
- openid: (state) => state.openid,
|
|
|
- mallId: (state) => state.mallId,
|
|
|
- kipUserId: (state) => state.kipUserId,
|
|
|
- userInfo: (state) => state.userInfo,
|
|
|
- member: (state) => state.member,
|
|
|
-}),
|
|
|
-},
|
|
|
+ ...mapState({
|
|
|
+ custTypeId: (state) => state.custTypeId,
|
|
|
+ groupId: (state) => state.groupId,
|
|
|
+ openid: (state) => state.openid,
|
|
|
+ mallId: (state) => state.mallId,
|
|
|
+ kipUserId: (state) => state.kipUserId,
|
|
|
+ userInfo: (state) => state.userInfo,
|
|
|
+ member: (state) => state.member,
|
|
|
+ }),
|
|
|
+ },
|
|
|
methods: {
|
|
|
- changeShowMore() {
|
|
|
- this.isShow = !this.isShow;
|
|
|
-},
|
|
|
- changeDefaultEMail() {
|
|
|
- this.isDefaultEMail = !this.isDefaultEMail;
|
|
|
-},
|
|
|
- changeHeader() {
|
|
|
- this.$router.push({
|
|
|
- path: 'parkingChooseHeader?ids=' + this.ids,
|
|
|
-});
|
|
|
-},
|
|
|
- gotoDetail() {
|
|
|
- this.$store.commit('setTempParkingOrder', this.parkingOrder);
|
|
|
- this.$router.push({
|
|
|
- path: 'parkingOrderDetail?useParkingOrderCache=true',
|
|
|
-});
|
|
|
- // this.$router.push({
|
|
|
- // path:
|
|
|
- // '/pages/parkingFee/parkingFeeDetailSuccess?orderNo=' +
|
|
|
- // this.orderInfo.orderNo,
|
|
|
- // })
|
|
|
-},
|
|
|
- // 查询全部抬头列表信息
|
|
|
- getInvoiceTitle() {
|
|
|
- const self = this;
|
|
|
- const params = {
|
|
|
- vipcode: this.member?.vipcode,
|
|
|
-};
|
|
|
- self.$md(params);
|
|
|
- // console.log(265, '开票信息', params);
|
|
|
- // console.log(
|
|
|
- // 265,
|
|
|
- // '开票信息 path: ',
|
|
|
- // self.$baseURL + 'api/1.0/invoiceTitle/page'
|
|
|
- // );
|
|
|
- uni.request({
|
|
|
- url: self.$baseURL + 'api/1.0/invoiceTitle/page',
|
|
|
- method: 'GET',
|
|
|
- data: params,
|
|
|
- header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
- success: (res) => {
|
|
|
- // console.log('开票信息', res.data);
|
|
|
- if (res.data.code === 0) {
|
|
|
- const list = res.data.data;
|
|
|
- let currentIndex = 0;
|
|
|
- list.map((item, index) => {
|
|
|
- if (item.setDefault == 1) currentIndex = index;
|
|
|
-});
|
|
|
- const headerInfo = list[currentIndex] || {};
|
|
|
- self.headerInfo = headerInfo;
|
|
|
- // console.log('发票抬头--', self.headerInfo);
|
|
|
-} else {
|
|
|
- // uni.showToast({
|
|
|
- // title: res.data.msg,
|
|
|
- // duration: 2000,
|
|
|
- // icon: 'none',
|
|
|
- // });
|
|
|
- Toast({
|
|
|
- message: res.data.msg,
|
|
|
-});
|
|
|
-}
|
|
|
-},
|
|
|
- fail: () => {
|
|
|
- Toast({
|
|
|
- message: '服务器开小差了呢,请您稍后再试',
|
|
|
-});
|
|
|
- /* uni.showToast({
|
|
|
- title: '服务器开小差了呢,请您稍后再试',
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
-},
|
|
|
-});
|
|
|
-},
|
|
|
- // 根据选中的停车缴费记录id获取详情信息
|
|
|
- getParkOrderInfo() {
|
|
|
- // 如果当前是活动开票的话,则不差详情
|
|
|
- if (this.type) return;
|
|
|
- const self = this;
|
|
|
- // console.log('根据选中的停车缴费记录id获取详情信息', this.ids);
|
|
|
- self.$md(this.ids);
|
|
|
- // console.log(
|
|
|
- // 'getParkOrderInfo',
|
|
|
- // self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds'
|
|
|
- // );
|
|
|
- // return;
|
|
|
- uni.request({
|
|
|
- url: self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds',
|
|
|
- method: 'POST',
|
|
|
- data: typeof this.ids === 'string' ? [this.ids] : this.ids,
|
|
|
- header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
- success: (res) => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- const datas = res.data.data;
|
|
|
- console.log('387387387387387387387获取详情信息', datas);
|
|
|
- self.parkingOrder = datas;
|
|
|
- self.invoiceAmount = (datas.invoiceAmount / 100).toFixed(2);
|
|
|
- self.orderInfo = datas.list[0];
|
|
|
-} else {
|
|
|
- /* uni.showToast({
|
|
|
- title: res.data.msg,
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
- Toast({
|
|
|
- message: res.data.msg,
|
|
|
-});
|
|
|
-}
|
|
|
-},
|
|
|
- fail: () => {
|
|
|
- /* uni.showToast({
|
|
|
- title: '服务器开小差了呢,请您稍后再试',
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
- Toast({
|
|
|
- message: '服务器开小差了呢,请您稍后再试',
|
|
|
-});
|
|
|
-},
|
|
|
-});
|
|
|
-},
|
|
|
- // 获取用户邮箱信息
|
|
|
- getInvoiceEmailInfo() {
|
|
|
- const self = this;
|
|
|
- // const openId = MemberCacheTool.getOpenId(app);
|
|
|
- var data = {
|
|
|
- openid: this.openId,
|
|
|
- groupId: this.groupId,
|
|
|
- vipcode: this.member?.vipcode,
|
|
|
-};
|
|
|
- self.$md(data);
|
|
|
- // console.log(
|
|
|
- // '获取用户邮箱信息',
|
|
|
- // self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo'
|
|
|
- // );
|
|
|
- // console.log(421, data);
|
|
|
- uni.request({
|
|
|
- url: self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo',
|
|
|
- method: 'POST',
|
|
|
- data: data,
|
|
|
- header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
- success: (res) => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- console.log('获取用户邮箱信息', res.data);
|
|
|
- if (res.data.data) {
|
|
|
- this.isDefaultEMail = true;
|
|
|
- this.condition.mailbox = res.data.data;
|
|
|
-} else {
|
|
|
- this.isDefaultEMail = false;
|
|
|
- this.condition.mailbox = '';
|
|
|
-}
|
|
|
-} else {
|
|
|
- /* uni.showToast({
|
|
|
- title: res.data.msg,
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
- Toast({
|
|
|
- message: res.data.msg,
|
|
|
-});
|
|
|
-}
|
|
|
-},
|
|
|
- fail: () => {
|
|
|
- Toast({
|
|
|
- title: '服务器开小差了呢,请您稍后再试',
|
|
|
-});
|
|
|
- /* uni.showToast({
|
|
|
- title: '服务器开小差了呢,请您稍后再试',
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
-},
|
|
|
-});
|
|
|
-},
|
|
|
- submit() {
|
|
|
- const self = this;
|
|
|
- if (!self.condition.mailbox) {
|
|
|
- /* uni.showToast({
|
|
|
- title: '请输入电子邮箱地址',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
- Toast({
|
|
|
- message: '请输入电子邮箱地址',
|
|
|
-});
|
|
|
- return false;
|
|
|
-}
|
|
|
- // const re =
|
|
|
- // /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/;
|
|
|
- // if (re.test(self.condition.mailbox)) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '电子邮箱格式有误,请输入正确的电子邮箱',
|
|
|
- // duration: 2000,
|
|
|
- // icon: 'none',
|
|
|
- // });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- if (self.type && self.type == 'activity') {
|
|
|
- self.condition.invoiceCategory = 1;
|
|
|
-}
|
|
|
- const params = self.condition;
|
|
|
- params.ids = self.ids;
|
|
|
- params.isDefaultEmail = self.isDefaultEMail ? '1' : '0';
|
|
|
- params.invoiceTitleId = self.headerInfo.id;
|
|
|
+ changeShowMore() {
|
|
|
+ this.isShow = !this.isShow;
|
|
|
+ },
|
|
|
+ changeDefaultEMail() {
|
|
|
+ this.isDefaultEMail = !this.isDefaultEMail;
|
|
|
+ },
|
|
|
+ changeHeader() {
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingChooseHeader?ids=' + this.ids,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ gotoDetail() {
|
|
|
+ this.$store.commit('setTempParkingOrder', this.parkingOrder);
|
|
|
+ this.$router.push({
|
|
|
+ path: 'parkingOrderDetail?useParkingOrderCache=true',
|
|
|
+ });
|
|
|
+ // this.$router.push({
|
|
|
+ // path:
|
|
|
+ // '/pages/parkingFee/parkingFeeDetailSuccess?orderNo=' +
|
|
|
+ // this.orderInfo.orderNo,
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ // 查询全部抬头列表信息
|
|
|
+ getInvoiceTitle() {
|
|
|
+ const self = this;
|
|
|
+ const params = {
|
|
|
+ vipcode: this.member?.vipcode,
|
|
|
+ };
|
|
|
+ self.$md(params);
|
|
|
+ // console.log(265, '开票信息', params);
|
|
|
+ // console.log(
|
|
|
+ // 265,
|
|
|
+ // '开票信息 path: ',
|
|
|
+ // self.$baseURL + 'api/1.0/invoiceTitle/page'
|
|
|
+ // );
|
|
|
+ uni.request({
|
|
|
+ url: self.$baseURL + 'api/1.0/invoiceTitle/page',
|
|
|
+ method: 'GET',
|
|
|
+ data: params,
|
|
|
+ header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
+ success: (res) => {
|
|
|
+ // console.log('开票信息', res.data);
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ const list = res.data.data;
|
|
|
+ let currentIndex = 0;
|
|
|
+ list.map((item, index) => {
|
|
|
+ if (item.setDefault == 1) currentIndex = index;
|
|
|
+ });
|
|
|
+ const headerInfo = list[currentIndex] || {};
|
|
|
+ self.headerInfo = headerInfo;
|
|
|
+ // console.log('发票抬头--', self.headerInfo);
|
|
|
+ } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: res.data.msg,
|
|
|
+ // duration: 2000,
|
|
|
+ // icon: 'none',
|
|
|
+ // });
|
|
|
+ Toast({
|
|
|
+ message: res.data.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ Toast({
|
|
|
+ message: '服务器开小差了呢,请您稍后再试',
|
|
|
+ });
|
|
|
+ /* uni.showToast({
|
|
|
+ title: '服务器开小差了呢,请您稍后再试',
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 根据选中的停车缴费记录id获取详情信息
|
|
|
+ getParkOrderInfo() {
|
|
|
+ // 如果当前是活动开票的话,则不差详情
|
|
|
+ if (this.type) return;
|
|
|
+ const self = this;
|
|
|
+ // console.log('根据选中的停车缴费记录id获取详情信息', this.ids);
|
|
|
+ self.$md(this.ids);
|
|
|
+ // console.log(
|
|
|
+ // 'getParkOrderInfo',
|
|
|
+ // self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds'
|
|
|
+ // );
|
|
|
+ // return;
|
|
|
+ uni.request({
|
|
|
+ url: self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds',
|
|
|
+ method: 'POST',
|
|
|
+ data: typeof this.ids === 'string' ? [this.ids] : this.ids,
|
|
|
+ header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ const datas = res.data.data;
|
|
|
+ console.log('387387387387387387387获取详情信息', datas);
|
|
|
+ self.parkingOrder = datas;
|
|
|
+ self.invoiceAmount = (datas.invoiceAmount / 100).toFixed(2);
|
|
|
+ self.orderInfo = datas.list[0];
|
|
|
+ } else {
|
|
|
+ /* uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ Toast({
|
|
|
+ message: res.data.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ /* uni.showToast({
|
|
|
+ title: '服务器开小差了呢,请您稍后再试',
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ Toast({
|
|
|
+ message: '服务器开小差了呢,请您稍后再试',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取用户邮箱信息
|
|
|
+ getInvoiceEmailInfo() {
|
|
|
+ const self = this;
|
|
|
+ // const openId = MemberCacheTool.getOpenId(app);
|
|
|
+ var data = {
|
|
|
+ openid: this.openId,
|
|
|
+ groupId: this.groupId,
|
|
|
+ vipcode: this.member?.vipcode,
|
|
|
+ };
|
|
|
+ self.$md(data);
|
|
|
+ // console.log(
|
|
|
+ // '获取用户邮箱信息',
|
|
|
+ // self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo'
|
|
|
+ // );
|
|
|
+ // console.log(421, data);
|
|
|
+ uni.request({
|
|
|
+ url: self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo',
|
|
|
+ method: 'POST',
|
|
|
+ data: data,
|
|
|
+ header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ console.log('获取用户邮箱信息', res.data);
|
|
|
+ if (res.data.data) {
|
|
|
+ this.isDefaultEMail = true;
|
|
|
+ this.condition.mailbox = res.data.data;
|
|
|
+ } else {
|
|
|
+ this.isDefaultEMail = false;
|
|
|
+ this.condition.mailbox = '';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ /* uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ Toast({
|
|
|
+ message: res.data.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ Toast({
|
|
|
+ title: '服务器开小差了呢,请您稍后再试',
|
|
|
+ });
|
|
|
+ /* uni.showToast({
|
|
|
+ title: '服务器开小差了呢,请您稍后再试',
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ const self = this;
|
|
|
+ if (!self.condition.mailbox) {
|
|
|
+ /* uni.showToast({
|
|
|
+ title: '请输入电子邮箱地址',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ Toast({
|
|
|
+ message: '请输入电子邮箱地址',
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // const re =
|
|
|
+ // /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/;
|
|
|
+ // if (re.test(self.condition.mailbox)) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '电子邮箱格式有误,请输入正确的电子邮箱',
|
|
|
+ // duration: 2000,
|
|
|
+ // icon: 'none',
|
|
|
+ // });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ if (self.type && self.type == 'activity') {
|
|
|
+ self.condition.invoiceCategory = 1;
|
|
|
+ }
|
|
|
+ const params = self.condition;
|
|
|
+ params.ids = self.ids;
|
|
|
+ params.isDefaultEmail = self.isDefaultEMail ? '1' : '0';
|
|
|
+ params.invoiceTitleId = self.headerInfo.id;
|
|
|
|
|
|
- params.openid = this.openid;
|
|
|
- params.groupId = this.groupId;
|
|
|
- params.vipcode = this.member?.vipcode;
|
|
|
- // console.log('提交发票请求的入参', params);
|
|
|
- self.$md(params);
|
|
|
- if (self.isSubmitFlag) {
|
|
|
- // 勾选默认邮箱埋点
|
|
|
- if (self.isDefaultEMail) {
|
|
|
- self.sensorsClick('$SetDefaultEmail', {
|
|
|
- redirect_path: '',
|
|
|
- mailbox: self.condition.mailbox,
|
|
|
-});
|
|
|
-}
|
|
|
- self.isSubmitFlag = false;
|
|
|
- console.log(488, '前往开票', params);
|
|
|
- uni.request({
|
|
|
- url: self.$baseURL + 'api/1.0/invoice/addMyInvoiceInfo',
|
|
|
- method: 'POST',
|
|
|
- data: params,
|
|
|
- header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
- success: (res) => {
|
|
|
- console.log('提交发票请求', res.data);
|
|
|
- if (res.data.code === 0) {
|
|
|
- // 因为合并开票接口中无法判断是否是一个CO(一个发票id可以直接进发票详情)还是两个CO,所以统一返回到发票列表页面 ?
|
|
|
- this.$router.replace({
|
|
|
- path: 'parkingReceipt',
|
|
|
-});
|
|
|
-} else {
|
|
|
- /* uni.showToast({
|
|
|
- title: res.data.msg,
|
|
|
- duration: 2000,
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
- Toast({
|
|
|
- message: res.data.msg,
|
|
|
-});
|
|
|
-}
|
|
|
-},
|
|
|
- fail: () => {
|
|
|
- self.isSubmitFlag = true;
|
|
|
- /* uni.showToast({
|
|
|
- title: '服务器开小差了呢,请您稍后再试',
|
|
|
- icon: 'none',
|
|
|
- }); */
|
|
|
- oast({
|
|
|
- message: '服务器开小差了呢,请您稍后再试',
|
|
|
-});
|
|
|
-},
|
|
|
-});
|
|
|
-}
|
|
|
-},
|
|
|
- // 埋点方法
|
|
|
- sensorsClick(eventName, params) {
|
|
|
- let optionsQuery = uni.getStorageSync('options_query');
|
|
|
- let fixedParams = {
|
|
|
- cta_itemno: '',
|
|
|
- cta_name: '',
|
|
|
- previous_path: this.preUrl || '',
|
|
|
- $location: uni.getStorageSync('mallid'),
|
|
|
- $brand_id: uni.getStorageSync('groupId'),
|
|
|
- $channel: optionsQuery.channel || '',
|
|
|
- // $utm_lbs: this.optionsQuery.utm_lbs || '',
|
|
|
- $utm_channel: optionsQuery.utm_channel || '',
|
|
|
- $utm_method: optionsQuery.utm_method || '',
|
|
|
- $utm_source: optionsQuery.utm_source || '',
|
|
|
- $utm_function: optionsQuery.utm_function || '',
|
|
|
- $utm_user: optionsQuery.utm_user || '',
|
|
|
-},
|
|
|
- finalParams = Object.assign(fixedParams, params);
|
|
|
-},
|
|
|
-},
|
|
|
+ params.openid = this.openid;
|
|
|
+ params.groupId = this.groupId;
|
|
|
+ params.vipcode = this.member?.vipcode;
|
|
|
+ // console.log('提交发票请求的入参', params);
|
|
|
+ self.$md(params);
|
|
|
+ if (self.isSubmitFlag) {
|
|
|
+ self.isSubmitFlag = false;
|
|
|
+ console.log(488, '前往开票', params);
|
|
|
+ uni.request({
|
|
|
+ url: self.$baseURL + 'api/1.0/invoice/addMyInvoiceInfo',
|
|
|
+ method: 'POST',
|
|
|
+ data: params,
|
|
|
+ header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
+ success: (res) => {
|
|
|
+ console.log('提交发票请求', res.data);
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // 因为合并开票接口中无法判断是否是一个CO(一个发票id可以直接进发票详情)还是两个CO,所以统一返回到发票列表页面 ?
|
|
|
+ this.$router.replace({
|
|
|
+ path: 'parkingReceipt',
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ /* uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ Toast({
|
|
|
+ message: res.data.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ self.isSubmitFlag = true;
|
|
|
+ /* uni.showToast({
|
|
|
+ title: '服务器开小差了呢,请您稍后再试',
|
|
|
+ icon: 'none',
|
|
|
+ }); */
|
|
|
+ oast({
|
|
|
+ message: '服务器开小差了呢,请您稍后再试',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|