提交 cd94c4b3 编写于 作者: tao.wu's avatar tao.wu

微信分享调试

上级 61fdef56
......@@ -122,6 +122,7 @@
position: fixed;
left: 0;
bottom: 0;
z-index: 10;
background: #fff;
div{
width: 345px;
......
<template>
<div class="smo-share-mask" @click="close">
<div class="mask-tips" >
<img src="../assets/img/icon-yd.png" @click.stop="">
<div class="tips-txt" @click.stop="">点击右上角分享给其他好友</div>
</div>
</div>
</template>
<script>
export default {
methods: {
close() {
this.$emit('closeShare', false)
}
}
}
</script>
<style lang="less">
.smo-share-mask{
width: 375px;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 1000;
background: rgba(0,0,0,.8);
.mask-tips{
position: absolute;
right: 15px;
top: 13px;
text-align: right;
img{
display: inline;
width: 27px;
height: 32px;
}
.tips-txt{
width: 210px;
height: 35px;
line-height: 35px;
margin-top: 6px;
border-radius:2px;
text-align: center;
color: #FFFFFF;
font-size: 16px;
border:1px dashed rgba(255,255,255,.5);
}
}
}
</style>
\ No newline at end of file
......@@ -6283,8 +6283,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
......@@ -6305,14 +6304,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -6327,20 +6324,17 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -6457,8 +6451,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
......@@ -6470,7 +6463,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -6485,7 +6477,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -6493,14 +6484,12 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -6519,7 +6508,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -6600,8 +6588,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
......@@ -6613,7 +6600,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -6735,7 +6721,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -6755,7 +6740,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -6799,8 +6783,7 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.3",
......@@ -8553,7 +8536,8 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -8706,12 +8690,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -8730,6 +8716,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -8823,6 +8810,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -9687,6 +9675,39 @@
"resolved": "http://192.168.110.93:4873/pica-jsbridge/-/pica-jsbridge-1.0.1.tgz",
"integrity": "sha512-gwtKq3QWbXMQpdHf7tFKQWYvknQBU+qJUFxLxskHL10mChguSkyl7CxFND1mafVApTH6N1qgAOKKQLILgaJhTw=="
},
"pica-wx-share": {
"version": "1.0.17",
"resolved": "http://192.168.110.93:4873/pica-wx-share/-/pica-wx-share-1.0.17.tgz",
"integrity": "sha512-4ZKE5z2nWuZgu3ubL4hshcEZ80Y4DxyWVKx6Uu76c7MmikWQj7Lzfg4ywqtmmcwLUvBEHkOHICV1322gvkja8Q==",
"requires": {
"axios": "^0.18.0",
"weixin-js-sdk": "^1.4.0-test"
},
"dependencies": {
"axios": {
"version": "0.18.1",
"resolved": "http://192.168.110.93:4873/axios/-/axios-0.18.1.tgz",
"integrity": "sha1-/z8N4ue10YDnV62YAA8Qgbh7zqM=",
"requires": {
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "http://192.168.110.93:4873/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
}
},
"is-buffer": {
"version": "2.0.4",
"resolved": "http://192.168.110.93:4873/is-buffer/-/is-buffer-2.0.4.tgz",
"integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A=="
}
}
},
"picomatch": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz",
......@@ -13544,7 +13565,6 @@
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -13691,15 +13711,13 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"optional": true
"bundled": true
},
"minipass": {
"version": "2.3.5",
......@@ -13792,8 +13810,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"object-assign": {
"version": "4.1.1",
......@@ -14267,6 +14284,11 @@
"wrap-ansi": "^5.1.0"
}
},
"weixin-js-sdk": {
"version": "1.4.0-test",
"resolved": "http://192.168.110.93:4873/weixin-js-sdk/-/weixin-js-sdk-1.4.0-test.tgz",
"integrity": "sha1-YSu6/Ml62E9a/m3IRwFTTMWfw8o="
},
"whatwg-encoding": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz",
......
......@@ -52,6 +52,10 @@
</div>
<img class="bird" src="../assets/img/bird.png">
</div>
<share-container
v-if="showWxMask"
@closeShare="showWxMask=false"
/>
<div class="abs-btn">
<img @click="ruleLink" src="../assets/img/btn_rules.png">
</div>
......@@ -64,6 +68,9 @@
import { Toast } from 'vant';
import { remind, getRemindStatus, checkHospitalStatus, getCnt } from '@/service';
import h5header from '@/components/h5header';
import shareContainer from '@/components/share-container';
import { BASE_URL } from '@/utils/enumerate';
export default {
head() {
......@@ -72,10 +79,12 @@ export default {
};
},
components: {
h5header
h5header,
shareContainer
},
data() {
return {
showWxMask: false,
showFixed: false,
remindStatus: false,
doctorIdCnt: '',
......@@ -96,9 +105,9 @@ export default {
mounted() {
this.shareObj = {
shareUrl: window.location.href,
title1: '年终活动-标题',
title2: '年终活动-文字描述',
shareImageUrl: 'https://test-file.yunqueyi.com/png/2019/11/18/1574046505000_48x48.png'
title1: '云鹊奖活动在即,火速开启提醒',
title2: '边学习边获益,最高20万元奖品等你瓜分!',
shareImageUrl: '../assets/img/share.png'
}
this.isWeb = this.$rocNative.isWeb;
this.$rocNative.getToken().then(res => {
......@@ -107,7 +116,36 @@ export default {
this.remindStatus = res.data;
});
});
// 滚动交互
this.scrollHandle();
// 微信分享
this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com',
authUrl: window.location.href,
isDebug: false,
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
},(wx)=>{
// 分享给朋友
wx.onMenuShareAppMessage({
title: this.shareObj.title1,
desc: this.shareObj.title2,
link: window.location.href,
imgUrl: this.shareObj.shareImageUrl,
});
// 分享到朋友圈
wx.onMenuShareTimeline({
title: this.shareObj.title1,
desc: this.shareObj.title2,
link: window.location.href,
imgUrl: this.shareObj.shareImageUrl,
});
})
},
methods: {
// 处理滚动按钮悬浮事件
......@@ -210,7 +248,11 @@ export default {
this.$sendBuriedData({
component_tag: `301#301005`
});
if(this.isWeb){
this.showWxMask = true;
}else{
this.$rocNative.shareWechat(this.shareObj);
}
},
// 活动规则
ruleLink() {
......
import Vue from 'vue'
import { BASE_URL } from '@/utils/enumerate';
import PicaWxShare from 'pica-wx-share';
Vue.prototype.$picaWxShare = PicaWxShare;
import PicaH5Login from 'pica-h5-login';
import { Dialog, Toast, Checkbox,Popup ,CheckboxGroup ,RadioGroup, Radio, Progress,ImagePreview ,Uploader,Overlay,Loading } from 'vant';
import WebBuriedPoint, { sendBuriedData } from 'web-buried-point';
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册