小程序编译0.0.0

This commit is contained in:
魏啾
2024-11-13 09:25:34 +08:00
parent 1fbf346aec
commit 2147f86b93
65 changed files with 3745 additions and 852 deletions

View File

@@ -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 {

View File

@@ -1,5 +1,7 @@
<template>
<view class="content">
<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)">
个人
@@ -52,7 +54,8 @@
<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">
@@ -69,7 +72,12 @@
<script>
import _ from 'lodash'
import navseat from '@/components/navseat.vue'
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
export default {
components: {
navseat
},
data() {
return {
showtext: 0,
@@ -87,28 +95,61 @@
status_note: '', //原因备注
price: '',
},
queryParams: {
}
}
},
async onLoad(e) {
if (e.id) {
console.log(e)
this.form.id = e.id
this.form.open_id = e.open_id
await this.$onLaunched;
// e.id是从列表进的id
if (e.q) {
try {
if (e.q) {
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) => {
this.form.body = param.split('=')[1] ? param.split('=')[1] : '';
});
}
}
} catch (e) {}
} else {
this.form.body = e.id
}
// 获取开票抬头
// 这是H5
// #ifdef H5
this.getInvoiceList()
this.form.body = e.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
try {
let res = await this.api.szzpyfailccho({
id: this.form.id,
id: this.form.body,
view_type: this.form.view_type
})
try {
if (res.code == 1) {
this.form = res.data
}
} catch (e) {
//TODO handle the exception
if (res.code == 1) {
this.form = res.data
}
} else {
this.form.body = e.body
this.form.open_id = e.open_id
} catch (e) {
//TODO handle the exception
}
},
methods: {
@@ -134,35 +175,32 @@
this.subCategoryList = []
},
upload() {
uni.showLoading({
title: '上传中',
mask: true
})
uni.chooseImage({
success: (chooseImageRes) => {
uni.pro.showLoading({
title: '上传中',
mask: true
});
const tempFilePaths = chooseImageRes.tempFilePaths;
uni.uploadFile({
url: 'https://cashieradmin.sxczgkj.cn' + '/api/qiNiuContent',
filePath: tempFilePaths[0],
name: 'file',
formData: {
open_id: this.form.open_id,
},
success: (uploadFileRes) => {
count: 1, //默认9
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择,和摄像头功能,默认二者都有
success: res => {
var thisimgUrlcaca = res.tempFilePaths[0];
uploadImage(thisimgUrlcaca, 'merchantinformation/',
result => {
uni.showToast({
title: '上传成功',
icon: 'none',
})
uni.pro.hideLoading();
let data = JSON.parse(uploadFileRes.data)
this.form.img = data.data[0]
});
this.form.img = result
console.log(this.form)
},
fail: () => {
uni.pro.hideLoading();
}
});
uni.hideLoading()
}, result => {
uni.hideLoading()
uni.showToast({
title: result.message || result.msg,
icon: 'none',
});
})
}
});
},
@@ -211,11 +249,19 @@
title: res.msg,
icon: 'none'
});
// #ifdef MP-WEIXIN
uni.navigateTo({
url: '/pages/hindex/involist?typeshow=' + 1
})
// #endif
// #ifndef MP-WEIXIN
setTimeout(() => {
if (res.data.url) {
window.location.href = res.data.url
}
}, 1000);
// #endif
}
},

262
pages/hindex/invodetail.vue Normal file
View File

@@ -0,0 +1,262 @@
<template>
<view class="content">
<navseat :opacity='false' :title='"开票详情"' :titleshow='true' :namecolor='"#fff"' iconcolor='#fff'></navseat>
<view class="content_boxtop flex-between">
<view class="content_boxtopone">
{{ datalsit.type }}
</view>
<view class="content_boxtoptow" v-if="datalsit.status == 3 ||datalsit.status == 5||datalsit.status == 1"
style="color: #0c6ec8;">开票中</view>
<view class="content_boxtoptow" style="color: #3dc85e" v-if="datalsit.status == 2">开票成功</view>
<view class="content_boxtoptow" v-if="datalsit.status == 4">已作废</view>
</view>
<view class="content_boxt_one">
<view class="classvie_item flex-start">
<text class="classvie_itemone">{{ datalsit.user_type == 2 ? '公司名称' : '发票抬头' }}</text>
<text class="classvie_itemtow">{{ datalsit.user_name }}</text>
</view>
<view class="classvie_item flex-start" v-if="datalsit.user_type == 2 ">
<text class="classvie_itemone">公司税号</text>
<text class="classvie_itemtow">{{ datalsit.user_duty }}</text>
</view>
<view class="classvie_item flex-start">
<text class="classvie_itemone">发票金额</text>
<text class="classvie_itemtow" style="color: #ff6565">{{ datalsit.price }}</text>
</view>
<view class="classvie_item flex-start">
<text class="classvie_itemone">项目名称</text>
<text class="classvie_itemtow">{{ datalsit.article }}</text>
</view>
<view class="classvie_item flex-start">
<text class="classvie_itemone">开票时间</text>
<text class="classvie_itemtow">{{ datalsit.ktime }}</text>
</view>
</view>
<view style="margin-top:80rpx;text-align: center;color:#3088fd ;" v-if="datalsit.status != 2" @click="makePhoneCall(datalsit)">
联系商家
</view>
</view>
</template>
<script>
import uQRCode from '@/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js'; // npm install uqrcodejs
import navseat from '@/components/navseat.vue'
export default {
components: {
navseat
},
data() {
return {
text: 'uQRCode',
size: 240,
datalsit: {},
ID: '',
resurl: ''
};
},
onLoad(e) {
this.ID = e.id;
},
onReady() {
this.storeinvoicelist();
},
methods: {
async storeinvoicelist() {
let res = await this.api.userinvodetail({
id: this.ID,
open_id: uni.cache.get('open_id'),
})
if (res) {
this.datalsit = res.data;
// 获取uQRCode实例
var qr = new uQRCode();
// 设置二维码内容
qr.data = res.data.url;
// 设置二维码大小必须与canvas设置的宽高一致
qr.size = this.size;
// 调用制作二维码方法
qr.make();
// 获取canvas上下文
var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件this必须传入
// 设置uQRCode实例的canvas上下文
qr.canvasContext = canvasContext;
// 调用绘制方法将二维码图案绘制到canvas上
qr.drawCanvas();
}
},
makePhoneCall(e) {
uni.makePhoneCall({
phoneNumber: e.store_mobile //仅为示例
});
},
savealbum(e) {
uni.pro.navigateBack();
}
// savealbum(e) {
// // #ifdef APP
// uni.showLoading({
// //加载框
// title: '保存中...',
// mask: true
// });
// var pages = getCurrentPages();
// var page = pages[pages.length - 1];
// console.log('当前页' + pages.length - 1);
// var bitmap = null;
// var currentWebview = page.$getAppWebview();
// bitmap = new plus.nativeObj.Bitmap('amway_img');
// // 将webview内容绘制到Bitmap对象中
// currentWebview.draw(
// bitmap,
// function() {
// console.log('截屏绘制图片成功');
// bitmap.save(
// '_doc/a.jpg', {},
// function(i) {
// console.log('保存图片成功:' + JSON.stringify(i));
// uni.saveImageToPhotosAlbum({
// filePath: i.target,
// success: function() {
// bitmap.clear(); //销毁Bitmap图片
// uni.showToast({
// title: '保存图片成功',
// mask: false,
// duration: 1500
// });
// uni.hideLoading();
// }
// });
// },
// function(e) {
// console.log('保存图片失败:' + JSON.stringify(e));
// }
// );
// },
// function(e) {
// console.log('截屏绘制图片失败:' + JSON.stringify(e));
// }
// );
// // #endif
// },
}
};
</script>
<style lang="scss">
page {
background: #f9f9f9;
}
.content {
padding: 32rpx 28rpx;
.content_boxtop {
padding: 22rpx 16rpx;
background: #ffffff;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.content_boxtopone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.content_boxtoptow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
}
.content_boxt_one {
margin-top: 32rpx;
padding: 32rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
background: #ffffff;
.content_boxt_oneone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #ff6565;
}
.classvie_item {
margin-top: 16rpx;
.classvie_itemone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #666666;
font-style: normal;
text-transform: none;
}
.classvie_itemtow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #999999;
font-style: normal;
text-transform: none;
}
}
}
.content_boxt_tow {
margin: 32rpx 0;
width: 100%;
background: #ffffff;
border-radius: 18rpx 18rpx 18rpx 18rpx;
padding-bottom: 50rpx;
.content_boxt_towtext {
padding-top: 32rpx;
text-align: center;
width: 100%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #999999;
}
.content_boxt_towtexts {
margin: 50rpx auto 0 auto;
width: 558rpx;
height: 84rpx;
background: #288efb;
border-radius: 50rpx 50rpx 50rpx 50rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 36rpx;
color: #ffffff;
line-height: 84rpx;
text-align: center;
font-style: normal;
}
.content_boxt_towrelative {
position: relative;
width: 484rpx;
height: 484rpx;
margin: 32rpx auto;
.content_boxt_towabsolute {
position: absolute;
top: 50%;
left: 50%;
margin-top: -50rpx;
margin-left: -50rpx;
border-radius: 16rpx;
// transform: translate(-50% -50%);
width: 100rpx;
height: 100rpx;
}
}
}
}
</style>

205
pages/hindex/involist.vue Normal file
View File

@@ -0,0 +1,205 @@
<template>
<view class="content">
<navseat :opacity='false' :title='"开票记录"' :titleshow='true' :iconshow='iconshow' :namecolor='"#fff"'
iconcolor='#fff'></navseat>
<view class="content_item" v-for="(item,index) in list" :key="index" @click="clickoange(item)">
<view class="content_item_top flex-between">
<view class="content_item_topone flex-start">
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/sz.png" mode="aspectFill">
</image>
<text>{{item.createtime}}</text>
</view>
<view class="content_item_toptow flex-start">
<text class="content_item_toptowtext">¥{{item.price}}</text>
<u-icon name="arrow-right" color="#9d9d9d" size="10"></u-icon>
</view>
</view>
<view class="content_item_bottom" style="background: #318AFE;" v-if="item.status == 0">
未提交开票信息
</view>
<view class="content_item_bottom" style="background:#8B8B8B;" v-if="item.status == 1 || item.status == 3">
开票中
</view>
<view class="content_item_bottom" v-if="item.status == 2">
已开票
</view>
<view class="content_item_bottom" style="background:#e4b9c0;" v-if="item.status == -1">
待商家审核
</view>
<view class="content_item_bottom" style="background: #ffbb76;" v-if="item.status == 4">
已作废
</view>
<view class="content_item_bottom" style="background: #fdc539;" v-if="item.status == 6">
商家拒绝
</view>
</view>
<view class="empty-wrap">
<u-loadmore :status="form.status" fontSize="16" color="#999" iconSize="16" />
</view>
</view>
</template>
<script>
import navseat from '@/components/navseat.vue'
export default {
components: {
navseat
},
data() {
return {
list: [],
form: {
page: 1,
status: 'loadmore',
},
iconshow: true,
off_openid: '',
type: '1',
};
},
async onLoad(e) {
await this.$onLaunched;
if (e.off_openid) {
this.off_openid = e.off_openid
this.iconshow = false
} else {
this.iconshow = true
}
// 内链跳转进来 返回按钮判断
try {
if (e.typeshow == 1) {
this.iconshow = true
}
} catch (e) {
//TODO handle the exception
}
//判断微信扫码进来
if (this.type == 1) {
this.initial()
}
},
onShow() {
if (this.type == 2) {
this.initial()
}
},
onReachBottom() {
if (this.form.status != 'nomore') {
this.form.page = ++this.form.page;
this.storeinvoicelist()
}
},
methods: {
initial() {
this.form = {
page: 1,
status: 'loadmore',
},
this.storeinvoicelist()
},
clickoange(e) {
if (e.status == -1) {
return false;
}
uni.navigateTo({
url: e.t_url
})
},
async storeinvoicelist() {
this.form.status = 'loading';
this.type = 2
let res = await this.api.useroauthcallback({
open_id: uni.cache.get('open_id'),
page: this.form.page,
off_openid: this.off_openid
})
if (this.form.page == 1 && res.data.invo.length == 0) {
this.form.status = 'nomore'
this.list = []
return false;
} else {
setTimeout(() => {
if (this.form.page == 1) {
this.list = res.data.invo
} else {
this.list = [...this.list, ...res.data.invo];
}
if (res.data.invo.length < 10) {
this.form.status = 'nomore';
} else {
this.form.status = 'loadmore';
}
}, 500)
}
console.log(this.list)
},
}
}
</script>
<style lang="scss">
page {
background: #F9F9F9;
}
.content {
padding: 6px 28rpx;
.content_item {
margin-top: 32rpx;
width: 100%;
background: #FFFFFF;
border-radius: 30rpx 30rpx 30rpx 30rpx;
.content_item_top {
padding: 34rpx 16rpx 30rpx 42rpx;
.content_item_topone {
image {
width: 37.11rpx;
height: 37.11rpx;
}
text {
margin-left: 28rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #666666;
text-align: center;
font-style: normal;
text-transform: none;
}
}
.content_item_toptow {
.content_item_toptowtext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #666666;
text-align: center;
font-style: normal;
text-transform: none;
}
}
}
.content_item_bottom {
padding: 16rpx 0 16rpx 108rpx;
background: rgba(85, 159, 255, 0.74);
box-shadow: 0px 3rpx 6rpx 1px rgba(0, 0, 0, 0.16);
border-radius: 0rpx 0rpx 30rpx 30rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
font-style: normal;
text-transform: none;
}
}
}
</style>