刘翔宇-旅管家 2 years ago
parent a7a8e7c106
commit df0411056a

@ -1,85 +1,85 @@
<script>
const jwx = require('jweixin-module')
export default {
onLaunch: function() {
this.$nextTick(() => {
let link = window.location.href;
if (/code=/.test(link) || link.indexOf("code") > -1) {
let temp = decodeURIComponent((new RegExp('[?|&]' + 'code' + '=' + '([^&;]+?)(&|#|;|$)').exec(link) ||
[, ''])[1].replace(/\+/g, '%20')) || null
let lifeData = uni.getStorageSync('lifeData')
if (!lifeData.vuex_token || !lifeData.vuex_user) {
this.$u.api.login({
code: temp
}).then(res => {
this.$u.vuex('vuex_token', res.token)
this.$u.api.user().then(res => {
this.$u.vuex('vuex_user', res)
let url = 'https://vr.langye.net/h5hssnx'
this.$u.api.share({
url
}).then(res => {
jwx.config({
debug: false, // , api alert pc log pc
appId: res.appId,
jsApiList: res.jsApiList,
nonceStr: res.nonceStr,
signature: res.signature,
timestamp: res.timestamp,
})
jwx.ready(() => {
jwx.updateAppMessageShareData({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.updateTimelineShareData({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.onMenuShareAppMessage({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.onMenuShareTimeline({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
})
})
})
})
}
} else {
this.$u.api.getAppId().then(res => {
let redirect = encodeURIComponent(link.replace(/#\//, ""))
window.location.href =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.appid}&redirect_uri=${redirect}&response_type=code&scope=snsapi_base#wechat_redirect`
})
}
})
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import "uview-ui/index.scss";
</style>
<script>
const jwx = require('jweixin-module')
export default {
onLaunch: function() {
this.$nextTick(() => {
let link = window.location.href;
if (/code=/.test(link) || link.indexOf("code") > -1) {
let temp = decodeURIComponent((new RegExp('[?|&]' + 'code' + '=' + '([^&;]+?)(&|#|;|$)')
.exec(link) || [, ''])[1].replace(/\+/g, '%20')) || null
let lifeData = uni.getStorageSync('lifeData')
if (!lifeData.vuex_token || !lifeData.vuex_user) {
this.$u.api.login({
code: temp
}).then(res => {
this.$u.vuex('vuex_token', res.token)
this.$u.api.user().then(res => {
this.$u.vuex('vuex_user', res)
let url = 'https://vr.langye.net/h5hssnx'
this.$u.api.share({
url
}).then(res => {
jwx.config({
debug: false, // , api alert pc log pc
appId: res.appId,
jsApiList: res.jsApiList,
nonceStr: res.nonceStr,
signature: res.signature,
timestamp: res.timestamp,
})
jwx.ready(() => {
jwx.updateAppMessageShareData({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.updateTimelineShareData({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.onMenuShareAppMessage({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.onMenuShareTimeline({
title: '我是党史记录人——红色少年行 未成年人研学', //
desc: '我是党史记录人——红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
})
})
})
})
}
} else {
this.$u.api.getAppId().then(res => {
let redirect = encodeURIComponent(link.replace(/#\//, ""))
window.location.href =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.appid}&redirect_uri=${redirect}&response_type=code&scope=snsapi_base#wechat_redirect`
})
}
})
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import "uview-ui/index.scss";
</style>

@ -1,7 +1,7 @@
<template>
<div style="background: #FAEDCD;">
<div class="top">
<u-image mode="scaleToFill" width="100%" height="100%" :src="require('@/static/map-title-bkg.png')"></u-image>
<img mode="scaleToFill" width="100%" height="100%" src="//cdn.langye.net/h5hssnx/map-title-bkg.png"></img>
</div>
<div class="container" id="img-container">
<img ref="image"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 995 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 873 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 75 KiB

@ -13,7 +13,7 @@
<title>“我是党史记录人——红色少年行”</title>
<script src="skin/default/js/jquery-3.6.3.min.js" type="text/javascript"></script>
<link href="skin/default/css/animate.min.css" type="text/css" rel="stylesheet">
<link href="skin/default/css/css.css?v=1.1" rel="stylesheet" type="text/css">
<link href="skin/default/css/css.css?v=1.1.1" rel="stylesheet" type="text/css">
<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询media queries功能 -->
<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
<!--[if lt IE 9]>

@ -120,7 +120,7 @@ textarea::-webkit-input-placeholder{ color:#aaa; }
.header{
text-align: center;
padding-top: 4rem;
height: 10.45rem;
height: 12.3rem;
background-image: url(../images/headbg.jpg);
background-repeat: no-repeat;
background-position: center top;
@ -397,7 +397,7 @@ textarea::-webkit-input-placeholder{ color:#aaa; }
background: url(../images/answerbg.png) no-repeat center top;
background-size: 100% auto;
padding-top: 15%;
padding-left: 31.5%;
padding-left: 28%;
padding-right: 4.8%;
box-sizing: border-box;
-webkit-box-sizing: border-box;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 KiB

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Loading…
Cancel
Save