转移到PC
This commit is contained in:
@@ -65,6 +65,13 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
showTabbar() {
|
showTabbar() {
|
||||||
const path = tabbar.map(tab => tab.path);
|
const path = tabbar.map(tab => tab.path);
|
||||||
|
const { name, query: { temple_id } } = this.$route;
|
||||||
|
|
||||||
|
// 等于寺庙功德箱时隐藏底部导航
|
||||||
|
if(name === 'merit-box' && temple_id !== '1'){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return path.includes(this.$route.path);
|
return path.includes(this.$route.path);
|
||||||
},
|
},
|
||||||
paddingBottom() {
|
paddingBottom() {
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -1,11 +1,12 @@
|
|||||||
let wechatInstance;
|
let wechatInstance;
|
||||||
|
|
||||||
function signToWechat(config, readFunction) {
|
function signToWechat(config, shareConfig) {
|
||||||
if (!wx) {
|
if (!wx) {
|
||||||
console.warn('请安装微信网页JS-SDK, url: https://res2.wx.qq.com/open/js/jweixin-1.6.0.js');
|
console.warn('请安装微信网页JS-SDK, url: https://res2.wx.qq.com/open/js/jweixin-1.6.0.js');
|
||||||
}
|
}
|
||||||
const defaultConfig = {
|
const defaultConfig = {
|
||||||
...config,
|
...config,
|
||||||
|
debug: false,
|
||||||
jsApiList: [
|
jsApiList: [
|
||||||
'onMenuShareTimeline',
|
'onMenuShareTimeline',
|
||||||
'onMenuShareAppMessage',
|
'onMenuShareAppMessage',
|
||||||
@@ -16,15 +17,63 @@ function signToWechat(config, readFunction) {
|
|||||||
'updateTimelineShareData'
|
'updateTimelineShareData'
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
return new Promise((resolve) => {
|
console.log('sign', wx);
|
||||||
console.log('defaultConfig', defaultConfig);
|
wx.config(defaultConfig);
|
||||||
wx.config(defaultConfig);
|
wx.ready(function() {
|
||||||
wx.ready(function() {
|
|
||||||
console.warn('wechat sdk config success');
|
console.log('wechat sdk config success');
|
||||||
wechatInstance = wx;
|
wechatInstance = wx;
|
||||||
resolve(wx);
|
|
||||||
readFunction && readFunction(wx)
|
wx.onMenuShareAppMessage({
|
||||||
|
title: shareConfig.title,
|
||||||
|
desc: shareConfig.desc,
|
||||||
|
link: shareConfig.link,
|
||||||
|
imgUrl: shareConfig.imgUrl,
|
||||||
|
complete: res => {
|
||||||
|
shareConfig.callback && shareConfig.callback({
|
||||||
|
key: 'updateAppMessageShareData',
|
||||||
|
...res
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// // 分享朋友圈
|
||||||
|
wx.onMenuShareTimeline({
|
||||||
|
title: shareConfig.title,
|
||||||
|
link: shareConfig.link,
|
||||||
|
imgUrl: shareConfig.imgUrl,
|
||||||
|
complete: res => {
|
||||||
|
shareConfig.callback && shareConfig.callback({
|
||||||
|
key: 'updateTimelineShareData',
|
||||||
|
...res
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// wx.updateAppMessageShareData({
|
||||||
|
// title: shareConfig.title,
|
||||||
|
// desc: shareConfig.desc,
|
||||||
|
// link: shareConfig.link,
|
||||||
|
// imgUrl: shareConfig.imgUrl,
|
||||||
|
// complete: res => {
|
||||||
|
// shareConfig.callback && shareConfig.callback({
|
||||||
|
// key: 'updateAppMessageShareData',
|
||||||
|
// ...res
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// // 分享朋友圈
|
||||||
|
// wx.updateTimelineShareData({
|
||||||
|
// title: shareConfig.title,
|
||||||
|
// link: shareConfig.link,
|
||||||
|
// imgUrl: shareConfig.imgUrl,
|
||||||
|
// complete: res => {
|
||||||
|
// shareConfig.callback && shareConfig.callback({
|
||||||
|
// key: 'updateTimelineShareData',
|
||||||
|
// ...res
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.red-packet{
|
.red-packet{
|
||||||
height: 60vh;
|
min-height: 60vh;
|
||||||
background: #e85042 url('~@/assets/img/red-packet.jpg') top center no-repeat;
|
background: #e85042 url('~@/assets/img/red-packet.jpg') top center no-repeat;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -208,6 +208,7 @@ export default {
|
|||||||
margin-top: .7rem;
|
margin-top: .7rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 .4rem;
|
padding: 0 .4rem;
|
||||||
|
margin-bottom: .5rem;
|
||||||
button{
|
button{
|
||||||
background: transparent;
|
background: transparent;
|
||||||
margin: 0 .2rem;
|
margin: 0 .2rem;
|
||||||
|
|||||||
+6
-30
@@ -32,42 +32,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
wechatReady(callback){
|
wechatReady(shareConfig){
|
||||||
getWechatSign(location.href).then(async res => {
|
console.log('wechatReady get share config', shareConfig)
|
||||||
await signToWechat(res, function(wx){
|
getWechatSign(location.href).then(res => {
|
||||||
console.log('wechat sign success', wx)
|
signToWechat(res, shareConfig);
|
||||||
callback && callback(wx);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
shareToWechat(wx, shareConfig){
|
shareToWechat(wx, shareConfig){
|
||||||
if(!shareConfig){
|
if(!shareConfig){
|
||||||
return console.error(`wechat share config error: ${shareConfig}`);
|
return console.error(`wechat share config error: ${shareConfig}`);
|
||||||
}
|
}
|
||||||
wx.updateAppMessageShareData({
|
console.log('share', wx, shareConfig)
|
||||||
title: shareConfig.title,
|
|
||||||
desc: shareConfig.desc,
|
|
||||||
link: shareConfig.link,
|
|
||||||
imgUrl: shareConfig.url,
|
|
||||||
complete: res => {
|
|
||||||
shareConfig.callback && shareConfig.callback({
|
|
||||||
key: 'updateAppMessageShareData',
|
|
||||||
...res
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
wx.updateTimelineShareData({
|
|
||||||
title: shareConfig.title,
|
|
||||||
desc: shareConfig.desc,
|
|
||||||
link: shareConfig.link,
|
|
||||||
imgUrl: shareConfig.imgUrl,
|
|
||||||
complete: res => {
|
|
||||||
shareConfig.callback && shareConfig.callback({
|
|
||||||
key: 'updateTimelineShareData',
|
|
||||||
...res
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
getHasFullScreen() {
|
getHasFullScreen() {
|
||||||
let result = false;
|
let result = false;
|
||||||
|
|||||||
@@ -63,8 +63,10 @@ export default {
|
|||||||
async getDynamicDetail(){
|
async getDynamicDetail(){
|
||||||
const data = await getDynamicDetail(this.$route.query.id);
|
const data = await getDynamicDetail(this.$route.query.id);
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.wechatReady((wx) => {
|
|
||||||
this.shareToWechat(wx, data.shareConfig)
|
this.wechatReady({
|
||||||
|
...data.shareConfig,
|
||||||
|
link: location.href,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,9 @@
|
|||||||
<van-nav-bar left-arrow v-if="$route.meta.showNavBar" :title="$route.meta.title" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
|
<van-nav-bar left-arrow v-if="$route.meta.showNavBar" :title="$route.meta.title" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
|
||||||
</div>
|
</div>
|
||||||
<swiper class="swiper-container" :options="swiperOption">
|
<swiper class="swiper-container" :options="swiperOption">
|
||||||
<swiper-slide>
|
<swiper-slide v-for="(picture, index) in data.pictures" :key="index">
|
||||||
<div style="height: 100vw;" class="picture">
|
<div style="height: 100vw;" class="picture">
|
||||||
<img src="https://img1.baidu.com/it/u=3715184423,1831753068&fm=26&fmt=auto" alt="">
|
<img :src="picture" alt="">
|
||||||
</div>
|
|
||||||
</swiper-slide>
|
|
||||||
<swiper-slide>
|
|
||||||
<div style="height: 100vw;" class="picture">
|
|
||||||
<img src="https://img1.baidu.com/it/u=3715184423,1831753068&fm=26&fmt=auto" alt="">
|
|
||||||
</div>
|
</div>
|
||||||
</swiper-slide>
|
</swiper-slide>
|
||||||
</swiper>
|
</swiper>
|
||||||
@@ -272,6 +267,10 @@ export default {
|
|||||||
this.priceUnit = Number(priceUnit) * Number(this.data.price)
|
this.priceUnit = Number(priceUnit) * Number(this.data.price)
|
||||||
this.priceUnitId = id;
|
this.priceUnitId = id;
|
||||||
}
|
}
|
||||||
|
this.wechatReady({
|
||||||
|
...this.data.shareConfig,
|
||||||
|
link: location.href
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async getDynamicDataByGoodsId(goods_id){
|
async getDynamicDataByGoodsId(goods_id){
|
||||||
const res = await getDynamicData(1, 1, goods_id);
|
const res = await getDynamicData(1, 1, goods_id);
|
||||||
|
|||||||
@@ -195,8 +195,9 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight()
|
this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight()
|
||||||
})
|
})
|
||||||
this.wechatReady((wx) => {
|
this.wechatReady({
|
||||||
this.shareToWechat(wx, this.data.shareConfig)
|
...this.data.shareConfig,
|
||||||
|
link: location.href
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取感恩功德
|
// 获取感恩功德
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="merit-button-group" :style="{bottom: tabHeight + 'px'}">
|
<div class="merit-button-group" :style="{bottom: tabHeight + 'px'}">
|
||||||
<button class="merit-button" @click="randVisible = true">随喜功德</button>
|
<button class="merit-button" @click="openBox">随喜功德</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<random-money :value.sync="randVisible" @change="onRandNext"></random-money>
|
<random-money :value.sync="randVisible" @change="onRandNext"></random-money>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMeritBox } from "@/api";
|
import { getMeritBox, getOrderCompare } from '@/api';
|
||||||
import { swiper, swiperSlide } from 'vue-awesome-swiper';
|
import { swiper, swiperSlide } from 'vue-awesome-swiper';
|
||||||
|
|
||||||
|
|
||||||
@@ -55,8 +55,9 @@ export default {
|
|||||||
},
|
},
|
||||||
inject: ['screenHeight', 'root'],
|
inject: ['screenHeight', 'root'],
|
||||||
data(){
|
data(){
|
||||||
|
const { query } = this.$route;
|
||||||
return {
|
return {
|
||||||
query: this.$route.query,
|
query,
|
||||||
width: 0,
|
width: 0,
|
||||||
randVisible: false,
|
randVisible: false,
|
||||||
type_id: 1,
|
type_id: 1,
|
||||||
@@ -93,8 +94,14 @@ export default {
|
|||||||
this.width = window.innerWidth;
|
this.width = window.innerWidth;
|
||||||
this.containerHeight = this.$refs.swiper.$el.offsetHeight;
|
this.containerHeight = this.$refs.swiper.$el.offsetHeight;
|
||||||
this.getMeritBox();
|
this.getMeritBox();
|
||||||
|
if(this.query.open_box){
|
||||||
|
this.openBox()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
openBox(){
|
||||||
|
this.randVisible = true
|
||||||
|
},
|
||||||
onSwiper(swiper){
|
onSwiper(swiper){
|
||||||
console.log('on swiper', swiper)
|
console.log('on swiper', swiper)
|
||||||
},
|
},
|
||||||
@@ -116,11 +123,19 @@ export default {
|
|||||||
if(!this.$route.query.temple_id){
|
if(!this.$route.query.temple_id){
|
||||||
history.pushState('', '', location.href + query)
|
history.pushState('', '', location.href + query)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.wechatReady({
|
||||||
|
title: `${this.info.unit_name} - 在线功德箱 | 已有 ${this.total} 人广种福田`,
|
||||||
|
desc: '随缘布施,广种福田,喜结善缘',
|
||||||
|
imgUrl: 'https://temple-h5.oss-cn-hangzhou.aliyuncs.com/uploads/common/merit_box.png',
|
||||||
|
link: location.href
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onListBy(n, index){
|
onListBy(n, index){
|
||||||
this.type_id = n.id;
|
this.type_id = n.id;
|
||||||
this.swiper.slideTo(index, 300, false)
|
this.swiper.slideTo(index, 300, false)
|
||||||
this.getMeritBox();
|
|
||||||
},
|
},
|
||||||
loadMore(){
|
loadMore(){
|
||||||
console.log('加载更多')
|
console.log('加载更多')
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
src(){
|
src(){
|
||||||
return `https://wdx-temple.oss-cn-hangzhou.aliyuncs.com/uploads/merit/certificate/${this.query.order_id}.jpg`
|
return `https://temple-h5.oss-cn-hangzhou.aliyuncs.com//uploads/merit/certificate/${this.query.order_id}.jpg`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -34,6 +34,11 @@ export default {
|
|||||||
this.$router.push('/user/order')
|
this.$router.push('/user/order')
|
||||||
},
|
},
|
||||||
onPayAgain(){
|
onPayAgain(){
|
||||||
|
// 功德箱订单再结善缘重新随喜
|
||||||
|
if(this.query.from === 'meritBox'){
|
||||||
|
this.$router.replace({ name: 'merit-box', query: { temple_id: this.query.temple_id , open_box: 1}})
|
||||||
|
return
|
||||||
|
}
|
||||||
const { goods_type, goods_id, temple_id, spec_ids } = this.query;
|
const { goods_type, goods_id, temple_id, spec_ids } = this.query;
|
||||||
this.onPushToGoodsDetail(goods_type, goods_id, temple_id, spec_ids)
|
this.onPushToGoodsDetail(goods_type, goods_id, temple_id, spec_ids)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<img class="banner" :src="data.picture" alt="">
|
<img class="banner" :src="data.picture" alt="">
|
||||||
<div class="authed border-bottom">
|
<div class="authed border-bottom">
|
||||||
<img src="@/assets/img/cert.jpg" alt="">
|
<img src="@/assets/img/cert.jpg" alt="">
|
||||||
<span>已通过 <b>寺院联盟</b> 认证,可放心访问</span>
|
<span>已通过 <b>自在福田</b> 认证,可放心访问</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="auth">
|
<div class="auth">
|
||||||
|
|||||||
@@ -123,6 +123,8 @@
|
|||||||
<span class="iconfont icon-arrow-left"></span>
|
<span class="iconfont icon-arrow-left"></span>
|
||||||
</p>
|
</p>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
|
<img src="@/assets/img/gongdexiang.png" class="gongdexiang" @click="openBox"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -143,6 +145,12 @@ export default {
|
|||||||
this.getUserData();
|
this.getUserData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
openBox(){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'merit-box',
|
||||||
|
query: { temple_id : this.query.temple_id, open_box: 1 }
|
||||||
|
})
|
||||||
|
},
|
||||||
locationTo(nav) {
|
locationTo(nav) {
|
||||||
// nav.type: 0外部链接,1日行一善商品,2添砖加瓦类商品,3通用商品,4功德箱,5进展动态
|
// nav.type: 0外部链接,1日行一善商品,2添砖加瓦类商品,3通用商品,4功德箱,5进展动态
|
||||||
if(nav.type === 0){
|
if(nav.type === 0){
|
||||||
@@ -160,7 +168,8 @@ export default {
|
|||||||
|
|
||||||
if(nav.type === 4){
|
if(nav.type === 4){
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'merit-box'
|
name: 'merit-box',
|
||||||
|
query: { temple_id : nav.temple_id }
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -217,6 +226,18 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.title = res.temple_data.unit_name;
|
document.title = res.temple_data.unit_name;
|
||||||
}, 30)
|
}, 30)
|
||||||
|
|
||||||
|
// this.wechatReady(wx => {
|
||||||
|
// // const { title, desc, link, imageUrl } = res.shareConfig;
|
||||||
|
// this.shareToWechat(wx, {
|
||||||
|
// ...res.shareConfig,
|
||||||
|
// link: location.href,
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
this.wechatReady({
|
||||||
|
...res.shareConfig,
|
||||||
|
link: location.href,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onTempleStation(){
|
onTempleStation(){
|
||||||
this.$router.push({ name: 'user-temple-station'})
|
this.$router.push({ name: 'user-temple-station'})
|
||||||
@@ -241,6 +262,16 @@ export default {
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
.temple-home-page{
|
.temple-home-page{
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
.gongdexiang{
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 4rem;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
.merit-scroll-container{
|
.merit-scroll-container{
|
||||||
height: 3.39rem;
|
height: 3.39rem;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
@@ -556,6 +587,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.temple-home-activity {
|
.temple-home-activity {
|
||||||
|
.buddha-process{
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
.process {
|
.process {
|
||||||
padding: .4rem 0;
|
padding: .4rem 0;
|
||||||
|
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user