|
@@ -21,7 +21,7 @@
|
|
|
<img src="/images/mobile/@2x/share/weChat@2x.png" alt="">
|
|
<img src="/images/mobile/@2x/share/weChat@2x.png" alt="">
|
|
|
<span>微信</span>
|
|
<span>微信</span>
|
|
|
</li>
|
|
</li>
|
|
|
- <li class="share-item">
|
|
|
|
|
|
|
+ <li class="share-item" @click="shareQQ">
|
|
|
<img src="/images/mobile/@2x/share/QQ@2x.png" alt="">
|
|
<img src="/images/mobile/@2x/share/QQ@2x.png" alt="">
|
|
|
<span>QQ</span>
|
|
<span>QQ</span>
|
|
|
</li>
|
|
</li>
|
|
@@ -29,19 +29,20 @@
|
|
|
<img src="/images/mobile/@2x/share/sina@2x.png" alt="">
|
|
<img src="/images/mobile/@2x/share/sina@2x.png" alt="">
|
|
|
<span>微博</span>
|
|
<span>微博</span>
|
|
|
</li>
|
|
</li>
|
|
|
- <li class="share-item">
|
|
|
|
|
|
|
+ <li class="share-item" @click="shareMessage">
|
|
|
<img src="/images/mobile/@2x/share/message@2x.png" alt="">
|
|
<img src="/images/mobile/@2x/share/message@2x.png" alt="">
|
|
|
<span>短信</span>
|
|
<span>短信</span>
|
|
|
</li>
|
|
</li>
|
|
|
- <li class="share-item">
|
|
|
|
|
|
|
+ <li class="share-item" @click="shareEmail">
|
|
|
<img src="/images/mobile/@2x/share/email@2x.png" alt="">
|
|
<img src="/images/mobile/@2x/share/email@2x.png" alt="">
|
|
|
<span>邮件</span>
|
|
<span>邮件</span>
|
|
|
|
|
+ <a href="mailto:yangc@usoftchina.com" class="hide" id="share-mail"></a>
|
|
|
</li>
|
|
</li>
|
|
|
- <li class="share-item">
|
|
|
|
|
|
|
+ <li class="share-item" @click="flash">
|
|
|
<img src="/images/mobile/@2x/share/flash@2x.png" alt="">
|
|
<img src="/images/mobile/@2x/share/flash@2x.png" alt="">
|
|
|
<span>刷新</span>
|
|
<span>刷新</span>
|
|
|
</li>
|
|
</li>
|
|
|
- <li class="share-item">
|
|
|
|
|
|
|
+ <li class="share-item" @click="copyLink" id="copyLink" :data-clipboard-text="url">
|
|
|
<img src="/images/mobile/@2x/share/copylink@2x.png" alt="">
|
|
<img src="/images/mobile/@2x/share/copylink@2x.png" alt="">
|
|
|
<span>复制链接</span>
|
|
<span>复制链接</span>
|
|
|
</li>
|
|
</li>
|
|
@@ -59,13 +60,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import Clipboard from 'clipboard'
|
|
|
export default {
|
|
export default {
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
showStoreInfo: false,
|
|
showStoreInfo: false,
|
|
|
showShare: false,
|
|
showShare: false,
|
|
|
rightIcon: 'share',
|
|
rightIcon: 'share',
|
|
|
- showDefaultAddr: true
|
|
|
|
|
|
|
+ showDefaultAddr: true,
|
|
|
|
|
+ url: '',
|
|
|
|
|
+ clipboard: {}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -82,6 +86,19 @@
|
|
|
return this.$store.state.componentDetail.detail.data
|
|
return this.$store.state.componentDetail.detail.data
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted () {
|
|
|
|
|
+ let _this = this
|
|
|
|
|
+ _this.url = window.location.href
|
|
|
|
|
+ _this.clipboard = new Clipboard('#copyLink')
|
|
|
|
|
+ _this.clipboard.on('success', e => {
|
|
|
|
|
+ _this.clipboard.destroy()
|
|
|
|
|
+ _this.showShare = false
|
|
|
|
|
+ })
|
|
|
|
|
+ _this.clipboard.on('error', e => {
|
|
|
|
|
+ alert('浏览器不支持自动复制,请手动复制')
|
|
|
|
|
+ _this.clipboard.destroy()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
goLastPage: function () {
|
|
goLastPage: function () {
|
|
|
window.history.back(-1)
|
|
window.history.back(-1)
|
|
@@ -137,7 +154,33 @@
|
|
|
_shareUrl += '&sourceUrl=' + encodeURIComponent('')
|
|
_shareUrl += '&sourceUrl=' + encodeURIComponent('')
|
|
|
_shareUrl += '&content=' + 'utf-8' // 参数content设置页面编码gb2312|utf-8,可选参数
|
|
_shareUrl += '&content=' + 'utf-8' // 参数content设置页面编码gb2312|utf-8,可选参数
|
|
|
_shareUrl += '&pic=' + encodeURIComponent('') // 参数pic设置图片链接|默认为空,可选参数
|
|
_shareUrl += '&pic=' + encodeURIComponent('') // 参数pic设置图片链接|默认为空,可选参数
|
|
|
- window.open(_shareUrl, '_blank', 'width=' + 300 + ',height=' + 300 + ',top=' + 300 + ',left=' + 300 + ',toolbar=no,menubar=no,scrollbars=no, resizable=1,location=no,status=0')
|
|
|
|
|
|
|
+ window.open(_shareUrl)
|
|
|
|
|
+ this.showShare = false
|
|
|
|
|
+ },
|
|
|
|
|
+ shareWeChat: function () {
|
|
|
|
|
+ },
|
|
|
|
|
+ shareQQ: function () {
|
|
|
|
|
+ let url = encodeURIComponent(document.location)
|
|
|
|
|
+ let title = encodeURIComponent(document.title)
|
|
|
|
|
+ let source = encodeURIComponent('')
|
|
|
|
|
+ let desc = '优软商城'
|
|
|
|
|
+ let pics = 'http://dfs.ubtob.com/group1/M00/4F/C3/CgpkyFnxWjOAMy5DAAlh1PrLlc8684.png'
|
|
|
|
|
+ window.open('http://connect.qq.com/widget/shareqq/index.html?url=' +
|
|
|
|
|
+ url + '&title=' + title + '&source=' + source + '&desc=' + desc + '&pics=' + pics)
|
|
|
|
|
+ this.showShare = false
|
|
|
|
|
+ },
|
|
|
|
|
+ shareMessage: function () {
|
|
|
|
|
+ },
|
|
|
|
|
+ shareEmail: function () {
|
|
|
|
|
+ document.getElementById('share-mail').click()
|
|
|
|
|
+ },
|
|
|
|
|
+ flash: function () {
|
|
|
|
|
+ window.location.reload()
|
|
|
|
|
+ },
|
|
|
|
|
+ copyLink: function () {
|
|
|
|
|
+ let _this = this
|
|
|
|
|
+ _this.url = window.location.href
|
|
|
|
|
+ _this.clipboard = new Clipboard('#copyLink')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -171,4 +214,7 @@
|
|
|
.mobile-header i{
|
|
.mobile-header i{
|
|
|
font-size:.4rem;
|
|
font-size:.4rem;
|
|
|
}
|
|
}
|
|
|
|
|
+ .hide {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|