Feat(专题页):1、第一张图片点击领取优惠券;2、增加转发标题和图片
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
:src="topImage"
|
:src="topImage"
|
||||||
class="top-img"
|
class="top-img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
|
@click="topImageClick"
|
||||||
/>
|
/>
|
||||||
<view class="page-wrap">
|
<view class="page-wrap">
|
||||||
<view class="page-2">
|
<view class="page-2">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
:src="topImage"
|
:src="topImage"
|
||||||
class="top-img"
|
class="top-img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
|
@click="topImageClick"
|
||||||
/>
|
/>
|
||||||
<view class="page-wrap">
|
<view class="page-wrap">
|
||||||
<view class="page-2">
|
<view class="page-2">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
:src="topImage"
|
:src="topImage"
|
||||||
class="top-img"
|
class="top-img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
|
@click="topImageClick"
|
||||||
/>
|
/>
|
||||||
<!-- 第二页 -->
|
<!-- 第二页 -->
|
||||||
<view class="page-wrap">
|
<view class="page-wrap">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
:src="topImage"
|
:src="topImage"
|
||||||
class="top-img"
|
class="top-img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
|
@click="topImageClick"
|
||||||
/>
|
/>
|
||||||
<!-- 第二页 -->
|
<!-- 第二页 -->
|
||||||
<view class="page-wrap">
|
<view class="page-wrap">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { getCouponReceive } from '@/api/user'
|
||||||
export const themeTemplateMixins = {
|
export const themeTemplateMixins = {
|
||||||
props: {
|
props: {
|
||||||
topImage: {
|
topImage: {
|
||||||
@@ -12,6 +13,24 @@ export const themeTemplateMixins = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
topImageClick() {
|
||||||
|
if (this.templateProperties.page1CouponEnable === 1 && this.templateProperties.page1CouponId) {
|
||||||
|
getCouponReceive(this.templateProperties.page1CouponId).then(res => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '领取成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.data.msg + '',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
itemClick(item) {
|
itemClick(item) {
|
||||||
if (!item.available) return
|
if (!item.available) return
|
||||||
this.$emit('view', item)
|
this.$emit('view', item)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
:src="topImage"
|
:src="topImage"
|
||||||
class="top-img"
|
class="top-img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
|
@click="topImageClick"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
v-for="(content, cIndex) in contents"
|
v-for="(content, cIndex) in contents"
|
||||||
@@ -79,6 +80,7 @@
|
|||||||
* options.theme:best-尖货,''-节日
|
* options.theme:best-尖货,''-节日
|
||||||
*/
|
*/
|
||||||
import { getFestivalV2, getContentBest } from '@/api/product'
|
import { getFestivalV2, getContentBest } from '@/api/product'
|
||||||
|
import { getCouponReceive } from '@/api/user'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
import ThemePageTemplate1 from '../components/ThemePageTemplate1.vue'
|
import ThemePageTemplate1 from '../components/ThemePageTemplate1.vue'
|
||||||
import ThemePageTemplate2 from '../components/ThemePageTemplate2.vue'
|
import ThemePageTemplate2 from '../components/ThemePageTemplate2.vue'
|
||||||
@@ -96,6 +98,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isLoad: false,
|
isLoad: false,
|
||||||
|
theme: '',
|
||||||
|
pageData: {},
|
||||||
topImage: '',
|
topImage: '',
|
||||||
contents: [],
|
contents: [],
|
||||||
pageKeyId: '',
|
pageKeyId: '',
|
||||||
@@ -107,6 +111,7 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const theme = options.theme || ''
|
const theme = options.theme || ''
|
||||||
const id = options.id
|
const id = options.id
|
||||||
|
this.theme = theme
|
||||||
// 尖货
|
// 尖货
|
||||||
if (theme === 'best') {
|
if (theme === 'best') {
|
||||||
this.pageKeyId = `appContentBest_id_${id}`
|
this.pageKeyId = `appContentBest_id_${id}`
|
||||||
@@ -116,6 +121,34 @@ export default {
|
|||||||
this.getFestivalReq()
|
this.getFestivalReq()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
if (this.pageData.forwardTitle && this.pageData.forwardImage) {
|
||||||
|
return {
|
||||||
|
title: this.pageData.forwardTitle,
|
||||||
|
path: `/pkg_product/views/festival?id=${this.pageData.id}&from=index&theme=${this.theme}`,
|
||||||
|
imageUrl: this.pageData.forwardImage
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
title: this.share.title,
|
||||||
|
path: this.share.path,
|
||||||
|
imageUrl: this.share.imageUrl,
|
||||||
|
desc: this.share.desc,
|
||||||
|
content: this.share.content,
|
||||||
|
success(res){
|
||||||
|
uni.showToast({
|
||||||
|
title:'分享成功'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail(res){
|
||||||
|
uni.showToast({
|
||||||
|
title:'分享失败',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getFestivalReq() {
|
getFestivalReq() {
|
||||||
/*旧接口
|
/*旧接口
|
||||||
@@ -137,6 +170,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
renderTemplateData(data) {
|
renderTemplateData(data) {
|
||||||
|
this.pageData = data
|
||||||
const contents = []
|
const contents = []
|
||||||
if (data.templateProperties) {
|
if (data.templateProperties) {
|
||||||
const templateKey = data.templateKey
|
const templateKey = data.templateKey
|
||||||
@@ -156,15 +190,30 @@ export default {
|
|||||||
products: temp.page3Links
|
products: temp.page3Links
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 模板1
|
|
||||||
if (['template_1', 'template_2', 'template_3', 'template_4'].includes(templateKey)) {
|
|
||||||
this.templateProperties = temp
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
this.templateProperties = data.templateProperties || {}
|
||||||
this.templateKey = data.templateKey
|
this.templateKey = data.templateKey
|
||||||
this.contents = contents
|
this.contents = contents
|
||||||
this.isLoad = true
|
this.isLoad = true
|
||||||
},
|
},
|
||||||
|
topImageClick() {
|
||||||
|
if (this.templateProperties.page1CouponEnable === 1 && this.templateProperties.page1CouponId) {
|
||||||
|
getCouponReceive(this.templateProperties.page1CouponId).then(res => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '领取成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.data.msg + '',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
goGoodsOrShop(item) {
|
goGoodsOrShop(item) {
|
||||||
const id = item.linkId
|
const id = item.linkId
|
||||||
const type = item.type || 1
|
const type = item.type || 1
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
:src="topImage"
|
:src="topImage"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
class="top-img"
|
class="top-img"
|
||||||
|
@click="topImageClick"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
v-for="(content, cIndex) in contents"
|
v-for="(content, cIndex) in contents"
|
||||||
@@ -76,6 +77,7 @@
|
|||||||
<script>
|
<script>
|
||||||
// 民宿专题
|
// 民宿专题
|
||||||
import { getHomestayV2 } from '@/api/product'
|
import { getHomestayV2 } from '@/api/product'
|
||||||
|
import { getCouponReceive } from '@/api/user'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
import ThemePageTemplate1 from '../components/ThemePageTemplate1.vue'
|
import ThemePageTemplate1 from '../components/ThemePageTemplate1.vue'
|
||||||
import ThemePageTemplate2 from '../components/ThemePageTemplate2.vue'
|
import ThemePageTemplate2 from '../components/ThemePageTemplate2.vue'
|
||||||
@@ -93,6 +95,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isLoad: false,
|
isLoad: false,
|
||||||
|
pageData: {},
|
||||||
topImage: '',
|
topImage: '',
|
||||||
contents: [],
|
contents: [],
|
||||||
pageKeyId: '',
|
pageKeyId: '',
|
||||||
@@ -106,6 +109,34 @@ export default {
|
|||||||
this.pageKeyId = `appContentHomestay_id_${id}`
|
this.pageKeyId = `appContentHomestay_id_${id}`
|
||||||
this.getHomestayReq(id)
|
this.getHomestayReq(id)
|
||||||
},
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
if (this.pageData.forwardTitle && this.pageData.forwardImage) {
|
||||||
|
return {
|
||||||
|
title: this.pageData.forwardTitle,
|
||||||
|
path: `/pkg_product/views/homestay?id=${this.pageData.id}`,
|
||||||
|
imageUrl: this.pageData.forwardImage
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
title: this.share.title,
|
||||||
|
path: this.share.path,
|
||||||
|
imageUrl: this.share.imageUrl,
|
||||||
|
desc: this.share.desc,
|
||||||
|
content: this.share.content,
|
||||||
|
success(res){
|
||||||
|
uni.showToast({
|
||||||
|
title:'分享成功'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail(res){
|
||||||
|
uni.showToast({
|
||||||
|
title:'分享失败',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getHomestayReq(id) {
|
getHomestayReq(id) {
|
||||||
/*旧接口
|
/*旧接口
|
||||||
@@ -120,6 +151,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
renderTemplateData(data) {
|
renderTemplateData(data) {
|
||||||
|
this.pageData = data
|
||||||
const contents = []
|
const contents = []
|
||||||
if (data.templateProperties) {
|
if (data.templateProperties) {
|
||||||
const templateKey = data.templateKey
|
const templateKey = data.templateKey
|
||||||
@@ -144,15 +176,30 @@ export default {
|
|||||||
list: temp.page4Links
|
list: temp.page4Links
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 模板1
|
|
||||||
if (['template_1', 'template_2', 'template_3', 'template_4'].includes(templateKey)) {
|
|
||||||
this.templateProperties = temp
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
this.templateProperties = data.templateProperties || {}
|
||||||
this.templateKey = data.templateKey
|
this.templateKey = data.templateKey
|
||||||
this.contents = contents
|
this.contents = contents
|
||||||
this.isLoad = true
|
this.isLoad = true
|
||||||
},
|
},
|
||||||
|
topImageClick() {
|
||||||
|
if (this.templateProperties.page1CouponEnable === 1 && this.templateProperties.page1CouponId) {
|
||||||
|
getCouponReceive(this.templateProperties.page1CouponId).then(res => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '领取成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.data.msg + '',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
goGoodsOrShop(item) {
|
goGoodsOrShop(item) {
|
||||||
const id = item.linkId
|
const id = item.linkId
|
||||||
const type = item.type || 1
|
const type = item.type || 1
|
||||||
|
|||||||
Reference in New Issue
Block a user