This commit is contained in:
魏啾
2024-05-31 11:48:07 +08:00
parent e6d878888c
commit 705b8cb0a8
10 changed files with 4758 additions and 474 deletions

View File

@@ -29,20 +29,38 @@
<image src="@/static/item8.png" mode="aspectFill"></image>
<text>审核开票</text>
</view>
<view class="content flex-colum" @click="jumpToMiniProgram" v-if="improveinformation">
<!-- <view class="content flex-colum" @click="jumpToMiniProgram" v-if="improveinformation">
<image src="@/static/item8.png" mode="aspectFill"></image>
<text>跳转小程序</text>
</view>
<wx-open-launch-weapp class="content flex-colum" id="launch-btn" @launch="handleLaunch" @error="handleError"
username="gh_fa9286427a5b" path="pages/index/index.html">
<script type="text/wxtag-template">
<style>
.btn { padding: 12px;opacity:0 }
</style>
<button class="btn">打开小程序</button>
</script>
</wx-open-launch-weapp> -->
</view>
<view class="setClipboardDataclass" @click="setClipboardData" v-if="infos.deviceType != 'pc'">
网页版地址:https://h5-invoice.sxczgkj.cn
</view>
<pdf style="width: 400px; height: 400px;"
src="https://dppt.shaanxi.chinatax.gov.cn:8443/kpfw/fpjfzz/v1/exportDzfpwjEwm?Wjgs=PDF&Jym=124C&Fphm=24612000000037614300&Kprq=20240430152603&Czsj=1714461964182">
</pdf>
</view>
</template>
<script>
import pdf from 'vue-pdf'
import wx from 'weixin-js-sdk';
export default {
components: {},
components: {
pdf
},
data() {
return {
improveinformation: false,
@@ -53,11 +71,13 @@
};
},
async onLoad(e) {
// alert(location.href.split('#')[0])
if (e.userId) {
// this.onLoaduserId = e.userId
// this.onLoadtype = e.type//295
uni.cache.set('userId', e.userId);
}
// this.jumpToMiniProgram()
let res = await this.api.storestorestatus({
store_id: uni.cache.get('userId')
})
@@ -96,10 +116,20 @@
});
},
// 监听跳转
handleLaunch() {
console.log('跳转');
},
// 监听错误
handleError() {
console.log('失败');
},
onShow() {},
methods: {
async jumpToMiniProgram() {
let res = await this.api.userttwechat()
let res = await this.api.userttwechat({
url: location.href.split('#')[0]
})
console.log(res)
// plus.share.getServices(function (res) {
// var sweixin = null;
@@ -117,23 +147,31 @@
// });
// }
// });
wx.config({
"debug": true,
"beta": false,
"jsApiList": ['wx-open-launch-weapp'],
openTagList: ['wx-open-launch-weapp'], // 跳转小程序时必填
"appId": res.data.wechat_mini.appId,
"nonceStr": res.data.wechat_mini.nonceStr,
"timestamp": res.data.wechat_mini.timestamp,
"url": res.data.wechat_mini.url,
"signature": res.data.wechat_mini.signature,
});
// wx.config({
// "debug": true,
// "beta": false,
// "jsApiList": ['wx-open-launch-weapp'],
// openTagList: ['wx-open-launch-weapp'], // 跳转小程序时必填
// "appId": res.data.wechat_mini.appId,
// "nonceStr": res.data.wechat_mini.nonceStr,
// "timestamp": res.data.wechat_mini.timestamp,
// "url": res.data.wechat_mini.url,
// "signature": res.data.wechat_mini.signature,
// });
wx.config(res.data.wechat_mini);
// res.data.wechat_mini
// 在wx.ready内调用
wx.ready(function() {
// 在这里调用 API
uni.navigateTo({
url: '/pages/index/index' // 跳转到的页面路径
wx.ready(res => {
console.log(res);
this.$nextTick(() => {
let btn = document.getElementById('launch-btn');
btn.addEventListener('launch', e => {
console.log('success');
});
btn.addEventListener('error', e => {
alert('小程序打开失败');
console.log('fail', e.detail);
});
});
});
wx.error(function(res) {