小程序编译0.0.0
This commit is contained in:
@@ -1,36 +1,42 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="Box flex-between">
|
||||
<view class="content flex-colum" @click="indexInvoicing" v-if="improveinformation">
|
||||
<image src="@/static/item3.png" mode="aspectFill"></image>
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='false' :title='"首页"' :titleshow='true' :iconshow='false' :heightshow='true'
|
||||
:namecolor='"#fff"' iconcolor='#fff'></navseat>
|
||||
<view class="topswiper" v-if="restype == 2">
|
||||
<u-swiper :list="swiperlist" height="166"></u-swiper>
|
||||
<view class="onetopswiper">
|
||||
发票服务
|
||||
</view>
|
||||
<view class="towtopswiper flex-between" @click="wodekaifapiao">
|
||||
<view class="flex-colum-start" style="color: #2b378a;">
|
||||
我的发票
|
||||
</view>
|
||||
<view class="towtopswipertow">
|
||||
票
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="Box flex-between" v-if="restype == 1 && improveinformation">
|
||||
<view class="content flex-colum" @click="merchantindex" v-if="store_status == 2">
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item3.png" mode="aspectFill">
|
||||
</image>
|
||||
<text>固定开票</text>
|
||||
</view>
|
||||
<view class="content flex-colum" @click="indexInvoicing" v-if="store_status == 1">
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item3.png" mode="aspectFill">
|
||||
</image>
|
||||
<text>极速开票</text>
|
||||
</view>
|
||||
<view class="content flex-colum" @click="webview" v-if="improveinformation">
|
||||
<image src="@/static/item2.png" mode="aspectFill"></image>
|
||||
<text>后台管理</text>
|
||||
</view>
|
||||
<view class="content flex-colum" @click="indexorder" v-if="improveinformation">
|
||||
<image src="@/static/item1.png" mode="aspectFill"></image>
|
||||
<text>开票记录</text>
|
||||
</view>
|
||||
<view class="content flex-colum" @click="notification" v-if="improveinformation">
|
||||
<image src="@/static/item6.png" mode="aspectFill"></image>
|
||||
<text>绑定通知</text>
|
||||
</view>
|
||||
<view class="content flex-colum" @click="drawer" v-if="improveinformation">
|
||||
<image src="@/static/item5.png" mode="aspectFill"></image>
|
||||
<text>开票员列表</text>
|
||||
</view>
|
||||
<view class="content flex-colum" @click="billingcode" v-if="improveinformation">
|
||||
<image src="@/static/item7.png" mode="aspectFill"></image>
|
||||
<text>开票码</text>
|
||||
</view>
|
||||
<view class="content flex-colum" @click="auditbilling" v-if="improveinformation">
|
||||
<image src="@/static/item8.png" mode="aspectFill"></image>
|
||||
<text>审核开票</text>
|
||||
|
||||
<view class="content flex-colum" v-for="(item,index) in list" @click="clickcontent(item)" :key="index"
|
||||
v-if="item.show">
|
||||
<image :src="item.imge" mode="aspectFill">
|
||||
</image>
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
<!-- <view class="content flex-colum" @click="jumpToMiniProgram" v-if="improveinformation">
|
||||
<image src="@/static/item8.png" mode="aspectFill"></image>
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item8.png" mode="aspectFill"></image>
|
||||
<text>跳转小程序</text>
|
||||
</view>
|
||||
<wx-open-launch-weapp class="content flex-colum" id="launch-btn" @launch="handleLaunch" @error="handleError"
|
||||
@@ -55,35 +61,114 @@
|
||||
</template>
|
||||
<script>
|
||||
import wx from 'weixin-js-sdk';
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
restype: 1,
|
||||
swiperlist: [
|
||||
'https://shuzu-download.oss-cn-shanghai.aliyuncs.com/advertise/2024-05-08-10-52-th-663ae8fc73220.png'
|
||||
],
|
||||
improveinformation: false,
|
||||
improveinformationlist: {},
|
||||
onLoaduserId: '',
|
||||
infos: uni.getSystemInfoSync()
|
||||
infos: uni.getSystemInfoSync(),
|
||||
store_status: uni.cache.get('store_status'),
|
||||
list: [{
|
||||
imge: 'https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item2.png',
|
||||
name: '后台管理',
|
||||
show: true,
|
||||
text: 'houtai',
|
||||
url: 'electric/index',
|
||||
type: 2 //1是内链 2是外链 类型
|
||||
},
|
||||
{
|
||||
imge: 'https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item1.png',
|
||||
name: '开票记录',
|
||||
show: true,
|
||||
text: 'jilu',
|
||||
url: 'electric/index',
|
||||
type: 1 //1是内链 2是外链 类型
|
||||
}, {
|
||||
imge: 'https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item6.png',
|
||||
name: '绑定通知',
|
||||
show: true,
|
||||
text: 'tongzhi',
|
||||
url: 'electric/index',
|
||||
type: 1 //1是内链 2是外链 类型
|
||||
}, {
|
||||
imge: 'https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item5.png',
|
||||
name: '开票员列表',
|
||||
show: true,
|
||||
text: 'kaipiaoyuan',
|
||||
url: 'electric/index',
|
||||
type: 1 //1是内链 2是外链 类型
|
||||
}, {
|
||||
imge: 'https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item7.png',
|
||||
name: '开票码',
|
||||
show: true,
|
||||
text: 'kaipiaoma',
|
||||
url: 'electric/index',
|
||||
type: 1 //1是内链 2是外链 类型
|
||||
}, {
|
||||
imge: 'https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item8.png',
|
||||
name: '审核开票',
|
||||
show: true,
|
||||
text: 'shenhe',
|
||||
url: 'electric/index',
|
||||
type: 1 //1是内链 2是外链 类型
|
||||
}, {
|
||||
imge: 'https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/item10.png',
|
||||
name: '退出登录',
|
||||
show: true,
|
||||
text: 'tuchu',
|
||||
url: 'electric/index',
|
||||
type: 3 //1是内链 2是外链 3退出 类型
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
async onLoad(e) {
|
||||
// await this.$onLaunched;
|
||||
|
||||
// alert(location.href.split('#')[0])
|
||||
if (e.userId) {
|
||||
// this.onLoaduserId = e.userId
|
||||
uni.cache.set('Type', e.type);
|
||||
uni.cache.set('userId', e.userId);
|
||||
await this.$onLaunched;
|
||||
// #ifdef MP-WEIXIN
|
||||
// 判断商家还是个体
|
||||
let restype = await this.api.judgeuseridentity({
|
||||
open_id: uni.cache.get('open_id') //临时登录凭证
|
||||
})
|
||||
console.log(restype.data)
|
||||
this.restype = restype.data.type
|
||||
if (this.restype == 1 && !uni.getStorageSync('logintoken')) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
try {
|
||||
if (e.userId) {
|
||||
uni.cache.set('Type', e.type);
|
||||
uni.cache.set('userId', e.userId);
|
||||
// 传参进来肯定是极速开票固然store_status=1
|
||||
uni.cache.set('store_status', 1);
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
// 总?
|
||||
let token = await this.api.h5encryption({
|
||||
store_id: uni.cache.get('userId')
|
||||
})
|
||||
if (token.code == 1) {
|
||||
uni.cache.set('token', token.data.token);
|
||||
}
|
||||
console.log(token)
|
||||
}
|
||||
let res = await this.api.storestorestatus({
|
||||
store_id: uni.cache.get('userId')
|
||||
})
|
||||
if (res.code == 1) {
|
||||
if (res.code == 1 && uni.cache.get('store_status') == 1) {
|
||||
this.improveinformationform = res.data.store
|
||||
uni.cache.set('form', this.improveinformationform);
|
||||
if (res.data.sz_status == 0) {
|
||||
@@ -93,7 +178,20 @@
|
||||
} else {
|
||||
this.improveinformation = true
|
||||
}
|
||||
} else {
|
||||
// 这是固定开票的判断
|
||||
if (res.data.status == 4) { //如果极速开票和固定开票共存的情况下 直接跳转到极速开票的上传信息
|
||||
this.improveinformation = true
|
||||
return false
|
||||
} else {
|
||||
if (res.data.status == -1 || res.data.status == 2 || res.data.status == 0) {
|
||||
uni.pro.navigateTo('merchant/information', res.data.store);
|
||||
} else {
|
||||
uni.pro.navigateTo('merchant/index');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
// 监听跳转
|
||||
handleLaunch() {
|
||||
@@ -103,7 +201,14 @@
|
||||
handleError() {
|
||||
console.log('失败');
|
||||
},
|
||||
onShow() {},
|
||||
async onShow() {
|
||||
try {
|
||||
let res = await this.api.getrulelist()
|
||||
this.list = res.data
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async jumpToMiniProgram() {
|
||||
let res = await this.api.userttwechat({
|
||||
@@ -174,12 +279,62 @@
|
||||
// // jumpToMiniProgram('小程序的appid', '小程序页面路径');
|
||||
// // #endif
|
||||
},
|
||||
async quit() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定退出开票系统吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
await this.api.userlogout()
|
||||
uni.removeStorageSync('logintoken');
|
||||
uni.removeStorageSync('token');
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
setClipboardData() {
|
||||
uni.setClipboardData({
|
||||
data: 'https://h5-invoice.sxczgkj.cn/?userId=' + uni.cache.get('userId'),
|
||||
success: function() {}
|
||||
});
|
||||
},
|
||||
// 跳转
|
||||
async clickcontent(item) {
|
||||
switch (item.type) {
|
||||
case 1:
|
||||
uni.pro.navigateTo(item.url);
|
||||
break;
|
||||
case 2:
|
||||
uni.navigateTo({
|
||||
url: '/pages/webview/webview?tape=' + 1
|
||||
})
|
||||
break;
|
||||
case 3:
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定退出开票系统吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
await this.api.userlogout()
|
||||
uni.removeStorageSync('logintoken');
|
||||
uni.removeStorageSync('token');
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
auditbilling() {
|
||||
uni.pro.navigateTo('index/auditbilling');
|
||||
},
|
||||
@@ -201,17 +356,23 @@
|
||||
indexInvoicing() {
|
||||
uni.pro.navigateTo('index/Invoicing');
|
||||
},
|
||||
merchantindex() {
|
||||
uni.pro.navigateTo('merchant/index');
|
||||
},
|
||||
wodekaifapiao() {
|
||||
uni.pro.navigateTo('hindex/involist');
|
||||
},
|
||||
async webview() {
|
||||
uni.pro.navigateTo('electric/index');
|
||||
// let res = await this.api.szzpyhurl({
|
||||
// store_id: uni.getStorageSync('userId')
|
||||
// })
|
||||
// if (res) {
|
||||
// uni.pro.navigateTo('webview/webview', {
|
||||
// url: res.data.url,
|
||||
// tape: 1
|
||||
// });
|
||||
// }
|
||||
// uni.pro.navigateTo('electric/index');
|
||||
let res = await this.api.szzpyhurl({
|
||||
store_id: uni.getStorageSync('userId')
|
||||
})
|
||||
if (res) {
|
||||
uni.pro.navigateTo('webview/webview', {
|
||||
url: res.data.url,
|
||||
tape: 1
|
||||
});
|
||||
}
|
||||
},
|
||||
indexorder() {
|
||||
uni.pro.navigateTo('index/order');
|
||||
@@ -235,6 +396,36 @@
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.topswiper {
|
||||
width: 100%;
|
||||
padding: 32rpx 32rpx 0 32rpx;
|
||||
|
||||
.onetopswiper {
|
||||
font-weight: bold;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.towtopswiper {
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
padding: 24rpx 32rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #d8eafe;
|
||||
|
||||
.towtopswipertow {
|
||||
padding: 24rpx;
|
||||
color: #fff;
|
||||
background: #2a3aa1;
|
||||
font-size: 40rpx;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
text-align: center;
|
||||
line-height: 45rpx;
|
||||
border-radius: 45rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.Box {
|
||||
|
||||
padding: 0rpx 28rpx;
|
||||
|
||||
Reference in New Issue
Block a user