小程序编译0.0.0
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<view class="content" @click.stop="stopPropagation">
|
||||
<navseat :opacity='false' :title='"开票提交"' :titleshow='true' :iconshow='false' :heightshow='true'
|
||||
:namecolor='"#fff"' iconcolor='#fff'></navseat>
|
||||
<view class="content_top">
|
||||
<view :class="form.user_type == 1 ? 'content_topview' : ''" @click="clickakex(1)">个人</view>
|
||||
<view :class="form.user_type == 2 ? 'content_topview' : ''" @click="clickakex(2)">企业</view>
|
||||
@@ -79,7 +81,7 @@
|
||||
<image :src="form.img" style="width: 100%; height: 100%;" mode=""></image>
|
||||
</view>
|
||||
<view class="Box_boxtow" v-else>
|
||||
<image src="@/static/xj.png" style="width: 60rpx;height: 58rpx;" mode=""></image>
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/xj.png" style="width: 60rpx;height: 58rpx;" mode=""></image>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="preservation flex-colum">
|
||||
@@ -100,7 +102,11 @@
|
||||
// import jWeixin from 'jweixin-module'
|
||||
import wx from 'weixin-js-sdk';
|
||||
import _ from 'lodash';
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showtext: 0,
|
||||
@@ -116,16 +122,48 @@
|
||||
c_address: '',
|
||||
c_phone: '',
|
||||
c_bank_name: '',
|
||||
c_bank_account: ''
|
||||
c_bank_account: '',
|
||||
open_id: '',
|
||||
id: ''
|
||||
},
|
||||
showElse: false,
|
||||
showtitle: false
|
||||
};
|
||||
},
|
||||
async onLoad(e) {
|
||||
await this.$onLaunched;
|
||||
if (e.q) {
|
||||
try {
|
||||
const q = decodeURIComponent(e.q) // 获取到二维码原始链接内容
|
||||
// this.form.id = e.id
|
||||
let queryParams = {};
|
||||
let queryString = q.split('?')[1];
|
||||
if (queryString) {
|
||||
// 将查询字符串分割成单个参数
|
||||
let params = queryString.split('&');
|
||||
params.forEach((param) => {
|
||||
console.log(param)
|
||||
this.form.id = param.split('=')[1];
|
||||
queryParams[name] = value;
|
||||
});
|
||||
}
|
||||
} catch (e) {}
|
||||
} else {
|
||||
this.form.id = e.id
|
||||
}
|
||||
|
||||
// 获取开票抬头
|
||||
// 这是H5
|
||||
// #ifdef H5
|
||||
this.getInvoiceList()
|
||||
this.form.id = e.id;
|
||||
this.form.open_id = e.open_id;
|
||||
this.form.open_id = e.open_id
|
||||
// #endif
|
||||
// 这是微信
|
||||
// #ifdef MP-WEIXIN
|
||||
this.showtitle = true
|
||||
this.form.open_id = uni.cache.get('open_id')
|
||||
// #endif
|
||||
// 开票失败的回显
|
||||
if (e.view_type == 'fail') {
|
||||
this.form.view_type = e.view_type;
|
||||
let res = await this.api.szzpyfailccho({
|
||||
@@ -141,6 +179,7 @@
|
||||
//TODO handle the exception
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
stopPropagation() {
|
||||
@@ -178,6 +217,7 @@
|
||||
|
||||
},
|
||||
doReady() {
|
||||
// #ifndef MP-WEIXIN
|
||||
let _this = this
|
||||
wx.invoke('chooseInvoiceTitle', {
|
||||
"scene": "1"
|
||||
@@ -196,6 +236,30 @@
|
||||
_this.showElse = true
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
console.log(1111)
|
||||
uni.chooseInvoiceTitle({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
let infoJ = res
|
||||
this.form.user_name = infoJ.title ? infoJ.title : '' //发票抬头
|
||||
this.form.user_duty = infoJ.taxNumber ? infoJ.taxNumber : '' //税号
|
||||
this.form.c_address = infoJ.companyAddress ? infoJ.companyAddress : '' //公司地址
|
||||
this.form.c_phone = infoJ.telephone ? infoJ.telephone : '' //电话
|
||||
this.form.c_bank_account = infoJ.bankAccount ? infoJ.bankAccount : '' //开户银行
|
||||
this.form.c_bank_name = infoJ.bankName ? infoJ.bankName : '' // 银行账号
|
||||
this.form.user_type = infoJ.type == 0 ? 2 : 1 //发票抬头类型 微信返回0是企业 1是个人
|
||||
if (infoJ.type == 0) {
|
||||
this.showElse = true
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
console.log(res, 236)
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
},
|
||||
onInput(e) {
|
||||
if (this.form.user_type == 2) {
|
||||
@@ -301,17 +365,24 @@
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.usersubopeninvoice({
|
||||
id: this.form.id,
|
||||
open_id: this.form.open_id,
|
||||
...this.form
|
||||
});
|
||||
let res = await this.api.usersubopeninvoice(this.form);
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
console.log('t_type===', res.data.t_type);
|
||||
// #ifdef MP-WEIXIN
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/hindex/invodetail?id=' + this.form.id
|
||||
// })
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.navigateTo({
|
||||
url: '/pages/hindex/involist?typeshow=' + 1
|
||||
})
|
||||
// #endif
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
switch (res.data.t_type) {
|
||||
case '1':
|
||||
console.log(1);
|
||||
@@ -348,6 +419,7 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// #endif
|
||||
// window.location.href = "https://i.hangzhouyiyao.cn/activities?appKey=3f4ca8be626445e8b306c2badafd6f46&appEntrance=1&business=money"
|
||||
}
|
||||
|
||||
@@ -396,7 +468,7 @@
|
||||
.t {
|
||||
margin-right: 8upx;
|
||||
color: #808080;
|
||||
font-size: 32upx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
|
||||
Reference in New Issue
Block a user