xianyu-js-sdk.vue
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!--
* @description:
* @fileName: xianyu-js-sdk.vue
* @author: huzhiming
* @date: 2019-11-04 18:02:07
* @后台人员:
* @version: V1.0.5
* @path: 页面访问路径及参数说明
!-->
<template>
<div class="xianyu-js-sdk-wrap">
<h2>我是一个测试页面</h2>
<ul>
<li @click="share()">点击拉出分享弹窗</li>
</ul>
{{ searchWord }}
</div>
</template>
<script>
import { createNamespacedHelpers } from 'vuex'
const { mapState, mapActions } = createNamespacedHelpers('list')
export default {
// head() {
// return {
// title: '',
// meta: [{ hid: 'keywords', name: 'keywords', content: '' },{ hid: 'hid', name: 'description', content: '' }],
// // link: [{ rel: 'stylesheet', href: '' }],
// // script: [{ src: '' }]
// }
// },
asyncData({store, router}) {
return store.dispatch('list/fetchSearchWords');
},
props: {},
data() {
return {}
},
created() {},
mounted() {
// this.fetchSearchWords()
this.$nextTick(async ()=>{
await this.$xianyu.setNavigatorRightItem();
})
},
destroyed() {},
methods: {
...mapActions([
'fetchSearchWords'
]),
share() {
this.$xianyu.setXianyuShare({
shareType: 'activity', // 类型,默认activity
image: 'http://gw.alicdn.com/tps/i1/TB1Nep5FVXXXXXDaXXXE799_VXX-800-800.jpg',
url: 'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable', // 分享链接
link: 'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable', // 和url保持
title: '下载闲鱼App', // 分享标题
text: '你可记得家里堆积的闲置物,你可知他们正在黯然神伤。让他们来闲鱼卖身吧,即可' // 分享描述
})
}
},
computed: {
...mapState([
'filterVisible',
'searchWord'
])
},
watch: {},
components: {}
};
</script>
/* 定义局部样式,添加外围容器,scss嵌套尽量不要超过三层,会影响查找器性能 */
<style rel='stylesheet/scss' lang='scss' scoped>
// .xianyu-js-sdk-wrap {}
// @import "./style.scss";
</style>