Commit 33e06e5b by 李伟康

commit

1 parent 8cebad94
<template>
<van-overlay
:show="show"
z-index="9999999"
>
<van-overlay :show="show">
<!-- z-index="9999999" -->
<div
class="wrapper"
@click.stop
......@@ -43,40 +41,41 @@
export default {
name: 'Poster',
props: ['value', 'apiName', 'currentItem', 'activityData'],
data () {
data() {
return {
show: false,
img: null
}
},
mounted () {
},
mounted() {},
watch: {
'value' (n) {
value(n) {
this.show = n
},
}
},
methods: {
close () {
close() {
this.show = false
this.$emit('close')
},
save () {
save() {
this.showToast('请长按海报保存')
},
share () {
share() {
let { currentItem, apiName, activityData } = this
let flag = apiName != 'shopmallApi'
// if (currentItem.userId) {
// } else {
window.$wx.shareAppMessage({
imgUrl: flag ? currentItem.shareImgUrl : currentItem.goodsImage,
title: flag ? currentItem.name : currentItem.goodsName,
link: flag ? activityData.pagePath : activityData.url,
}).then(res => {
this.showToast('发送成功')
})
window.$wx
.shareAppMessage({
imgUrl: flag ? currentItem.shareImgUrl : currentItem.goodsImage,
title: flag ? currentItem.name : currentItem.goodsName,
link: flag ? activityData.pagePath : activityData.url
})
.then(res => {
this.showToast('发送成功')
})
// }
}
}
......@@ -84,6 +83,9 @@ export default {
</script>
<style scoped lang='scss'>
.van-overlay {
position: absolute;
}
.wrapper {
display: flex;
align-items: center;
......
<template>
<div class="share">
<van-share-sheet
v-model="showShare"
title="立即分享给好友"
:options="options"
@select="onSelect"
@cancel="cancel"
@click-overlay="cancel"
/>
<div
class="share-box"
v-show="showShare"
>
<div class="sheet">
<van-share-sheet
v-model="showShare"
title="立即分享给好友"
:options="options"
@select="onSelect"
@cancel="cancel"
@click-overlay="cancel"
/>
</div>
<poster
:value="showPoster"
@close="showPoster = false"
......@@ -78,6 +83,7 @@ export default {
return
}
if (apiName == 'shopmallApi') {
this.showLoading()
shopmallApi.getGoodsLink({ id }).then(data => {
console.log('商品链接', data)
shopmallApi.getGoodsPoster({ id }).then(res => {
......@@ -87,6 +93,7 @@ export default {
url: data
}
this.showShare = true
this.hideLoading()
})
})
}
......@@ -241,4 +248,16 @@ export default {
.van-share-sheet__option.disabled {
opacity: 0.5;
}
.sheet{
position: relative;
z-index: 1;
}
.share-box {
position: fixed;
width: 100%;
height: 100vh;
top: 0;
left: 0;
z-index: 100;
}
</style>
\ No newline at end of file
......@@ -9,7 +9,7 @@
>
<div class="box">
<div class="title flex">
{{data.packageName}}
<div class="name text-hide">{{data.packageName}}</div>
<div class="subtitle">内含{{data.couponsDetailList&&data.couponsDetailList.length}}项权益项目</div>
</div>
<div class="items">
......@@ -113,6 +113,9 @@ export default {
top: 0;
background-color: #fff;
z-index: 2;
.name{
max-width: 70%;
}
.subtitle {
font-size: 12px;
color: #3a3a3a;
......
......@@ -12,6 +12,7 @@
<div
:key="index"
class="item"
@click="choose(i)"
>
<div class="icon">
<img :src="i.goodsImage || ''">
......@@ -24,7 +25,6 @@
</div>
<div
class="sprite-icon icon-share"
@click="choose(i)"
></div>
</div>
</template>
......@@ -48,12 +48,11 @@ export default {
list: [],
flag: false,
total: 0,
WX: wxConfig
}
},
mounted() {
this.getList()
this.WX.init(['shareAppMessage'])
wxConfig.init(['shareAppMessage'])
},
methods: {
getList() {
......@@ -68,8 +67,8 @@ export default {
choose(e) {
let { id, goodsName, goodsImage } = e
shopmallApi.getGoodsLink({ id }).then(data => {
console.log(data)
this.WX.shareAppMessage({
console.log('链接_________',data)
wxConfig.shareAppMessage({
title: goodsName,
desc: '',
link: data,
......
......@@ -41,19 +41,18 @@
>分享给客户</div>
</template>
<template v-else>
<div class="icon">
<img :src="i.goodsImage || ''">
</div>
<div class="info">
<div class="name text-two-line">{{i.goodsName}}</div>
<template v-if="i.price">
<div class="price">¥{{i.price.toFixed(2)}}</div>
</template>
<div @click="showShareModel(i)">
<div class="icon">
<img :src="i.goodsImage || ''">
</div>
<div class="info">
<div class="name text-two-line">{{i.goodsName}}</div>
<template v-if="i.price">
<div class="price">¥{{i.price.toFixed(2)}}</div>
</template>
</div>
<div class="sprite-icon icon-share"></div>
</div>
<div
class="sprite-icon icon-share"
@click="showShareModel(i)"
></div>
</template>
</div>
</template>
......@@ -88,20 +87,17 @@ import { shopmallApi, equityApi } from '@/api'
export default {
name: '',
mixins: [shareMixin, pageMixin],
data () {
data() {
return {
showVip: false,
equity_id: null
}
},
mounted () {
},
activated () {
},
deactivated () {
},
mounted() {},
activated() {},
deactivated() {},
methods: {
getList_0 (pageNum) {
getList_0(pageNum) {
let { list } = this
equityApi.getEquityList({ pageNum }).then(res => {
this.flag = true
......@@ -110,7 +106,7 @@ export default {
this.hideLoading()
})
},
getList_1 (pageNum) {
getList_1(pageNum) {
let { list } = this
shopmallApi.getGoodsList({ currentPage: pageNum }).then(res => {
this.flag = true
......@@ -119,7 +115,7 @@ export default {
this.hideLoading()
})
},
showVipDialog (i) {
showVipDialog(i) {
this.showVip = true
this.equity_id = i.id
}
......@@ -154,7 +150,7 @@ export default {
display: flex;
justify-content: space-between;
flex-direction: column;
max-width:70%;
max-width: 70%;
.title {
font-weight: 500;
font-size: 14px;
......@@ -162,6 +158,7 @@ export default {
}
.decoration {
color: #b9babb;
width: 160px;
}
.btn {
color: #b1b1b3;
......@@ -178,6 +175,7 @@ export default {
}
.btn {
right: 10px;
z-index: 2;
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!