parent
dcae130b4a
commit
b1da35a040
26
api/api.js
26
api/api.js
|
|
@ -47,32 +47,6 @@ export function getCoupons(data){
|
||||||
return request.get('coupons',data,{noAuth:true})
|
return request.get('coupons',data,{noAuth:true})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 我的优惠券
|
|
||||||
* @param int types 0全部 1未使用 2已使用
|
|
||||||
*/
|
|
||||||
export function getUserCoupons(data){
|
|
||||||
return request.get('coupon/list',data)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章列表
|
|
||||||
* @param int cid
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getArticleList(cid,data){
|
|
||||||
return request.get('article/list/' + cid, data,{noAuth:true})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章详情
|
|
||||||
* @param int id
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getArticleDetails(id){
|
|
||||||
return request.get('article/info',id,{noAuth:true});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号+验证码登录接口
|
* 手机号+验证码登录接口
|
||||||
* @param object data
|
* @param object data
|
||||||
|
|
|
||||||
|
|
@ -20,3 +20,12 @@ export function getArticlePage(data) {
|
||||||
noAuth: true // TODO 芋艿:后续要做调整
|
noAuth: true // TODO 芋艿:后续要做调整
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得文章
|
||||||
|
export function getArticle(id) {
|
||||||
|
return request.get("app-api/promotion/article/get", {
|
||||||
|
id
|
||||||
|
}, {
|
||||||
|
noAuth: true // TODO 芋艿:后续要做调整
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<view v-if="shareInfoStatus" class="poster-first">
|
<view v-if="shareInfoStatus" class="poster-first">
|
||||||
<view class="mask-share">
|
<view class="mask-share">
|
||||||
<image src="/static/images/share-info.png" @click="shareInfoClose" @touchmove.stop.prevent="false"></image>
|
<image src="/static/images/share-info.png" @click="shareInfoClose" @touchmove.stop.prevent="false" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
shareInfoStatus: {
|
shareInfoStatus: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default:false,
|
default:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {};
|
return {};
|
||||||
|
|
@ -25,9 +23,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.poster-first {
|
.poster-first {
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,34 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class='newsDetail'>
|
<view class='newsDetail'>
|
||||||
<view class='title'>{{articleInfo.title}}</view>
|
<view class='title'>{{ articleInfo.title }}</view>
|
||||||
<view class='list acea-row row-middle'>
|
<view class='list acea-row row-middle'>
|
||||||
<view class='label'>{{articleInfo.author}}</view>
|
<view class='label'>{{ articleInfo.author }}</view>
|
||||||
<view class='item'>{{articleInfo.createTime}}</view>
|
<view class='item'>{{ formatDate(articleInfo.createTime) }}</view>
|
||||||
<view class='item'><text class='iconfont icon-liulan'></text>{{articleInfo.visit}}</view>
|
<view class='item'><text class='iconfont icon-liulan'></text>{{ articleInfo.browseCount }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='conters'>
|
<view class='conters'>
|
||||||
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
|
<jyf-parser :html="content" ref="article" :tag-style="tagStyle" />
|
||||||
</view>
|
</view>
|
||||||
<view class="picTxt acea-row row-between-wrapper" v-if="store_info.id">
|
<view class="picTxt acea-row row-between-wrapper" v-if="store_info.id">
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
<image :src="store_info.image"></image>
|
<image :src="store_info.picUrl" />
|
||||||
</view>
|
</view>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<view class="name line1">{{store_info.storeName}}</view>
|
<view class="name line1">{{ store_info.storeName }}</view>
|
||||||
<view class="money font-color">
|
<view class="money font-color">
|
||||||
¥<text class="num">{{store_info.price}}</text>
|
¥<text class="num">{{ fen2yuan(store_info.price) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="y_money">¥{{store_info.otPrice}}</view>
|
<view class="y_money">¥{{ fen2yuan(store_info.marketPrice) }}</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator :url="'/pages/goods_details/index?id='+store_info.id" hover-class="none" class="label">
|
<navigator :url="'/pages/goods_details/index?id=' + store_info.id" hover-class="none" class="label">
|
||||||
<text class="span">查看商品</text>
|
<text class="span">查看商品</text>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">和好友一起分享</button>
|
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">
|
||||||
|
和好友一起分享
|
||||||
|
</button>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
<button class="bnt bg-color" open-type="share" hover-class='none'>和好友一起分享</button>
|
<button class="bnt bg-color" open-type="share" hover-class='none'>和好友一起分享</button>
|
||||||
|
|
@ -36,18 +38,15 @@
|
||||||
<home></home>
|
<home></home>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
|
||||||
getArticleDetails
|
|
||||||
} from '@/api/api.js';
|
|
||||||
import {
|
|
||||||
getProductDetail
|
|
||||||
} from '@/api/store.js';
|
|
||||||
import shareInfo from '@/components/shareInfo';
|
import shareInfo from '@/components/shareInfo';
|
||||||
import home from '@/components/home';
|
import home from '@/components/home';
|
||||||
import parser from "@/components/jyf-parser/jyf-parser";
|
import parser from "@/components/jyf-parser/jyf-parser";
|
||||||
export default {
|
import * as ArticleApi from '@/api/promotion/article.js';
|
||||||
|
import * as ProductSpuApi from '@/api/product/spu.js';
|
||||||
|
import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
||||||
|
import * as Util from '@/utils/util.js';
|
||||||
|
export default {
|
||||||
components: {
|
components: {
|
||||||
shareInfo,
|
shareInfo,
|
||||||
home,
|
home,
|
||||||
|
|
@ -59,12 +58,12 @@
|
||||||
articleInfo: [],
|
articleInfo: [],
|
||||||
store_info: {},
|
store_info: {},
|
||||||
content:'',
|
content:'',
|
||||||
shareInfoStatus:false,
|
|
||||||
tagStyle: {
|
tagStyle: {
|
||||||
img: 'width:100%;'
|
img: 'width:100%;'
|
||||||
},
|
},
|
||||||
productId: 0
|
productId: 0,
|
||||||
};
|
shareInfoStatus: false,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
|
|
@ -98,50 +97,58 @@
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
methods: {
|
methods: {
|
||||||
getArticleOne:function(){
|
getArticleOne: function() {
|
||||||
let that = this;
|
ArticleApi.getArticle(this.id).then(res => {
|
||||||
getArticleDetails({id:that.id}).then(res=>{
|
uni.setNavigationBarTitle({
|
||||||
uni.setNavigationBarTitle({
|
title: res.data.title.substring(0,7) + "..."
|
||||||
title:res.data.title.substring(0,7) + "..."
|
});
|
||||||
});
|
this.$set(this, 'articleInfo', res.data);
|
||||||
that.$set(that,'articleInfo',res.data);
|
this.$set(this, 'productId', res.data.productId);
|
||||||
that.$set(that,'productId',res.data.productId);
|
if (res.data.spuId) {
|
||||||
if(res.data.productId){
|
this.goodInfo(res.data.spuId);
|
||||||
that.goodInfo(res.data.productId);
|
}
|
||||||
}
|
this.content = res.data.description;
|
||||||
that.content = res.data.content;
|
// #ifdef H5
|
||||||
// #ifdef H5
|
if (this.$wechat.isWeixin()) {
|
||||||
if (this.$wechat.isWeixin()) {
|
this.setShareInfo();
|
||||||
this.setShareInfo();
|
}
|
||||||
}
|
// #endif
|
||||||
// #endif
|
});
|
||||||
});
|
},
|
||||||
},
|
goodInfo(id) {
|
||||||
goodInfo(id){
|
ProductSpuApi.getSpuDetail(id).then(res=>{
|
||||||
getProductDetail(id).then(res=>{
|
this.$set(this, 'store_info', res.data);
|
||||||
this.$set(this,'store_info',res.data.storeInfo?res.data.storeInfo:{});
|
})
|
||||||
})
|
},
|
||||||
},
|
listenerActionSheet() {
|
||||||
listenerActionSheet(){
|
this.shareInfoStatus = true
|
||||||
this.shareInfoStatus = true
|
},
|
||||||
},
|
setShareInfoStatus() {
|
||||||
setShareInfoStatus(){
|
this.shareInfoStatus = false
|
||||||
this.shareInfoStatus = false
|
},
|
||||||
},
|
setShareInfo: function() {
|
||||||
setShareInfo: function() {
|
let href = location.href;
|
||||||
let href = location.href;
|
let configAppMessage = {
|
||||||
let configAppMessage = {
|
title: this.articleInfo.title,
|
||||||
desc: this.articleInfo.synopsis,
|
desc: this.articleInfo.introduction,
|
||||||
title: this.articleInfo.title,
|
link: href,
|
||||||
link: href,
|
imgUrl: this.articleInfo.picUrl
|
||||||
imgUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : ""
|
};
|
||||||
};
|
this.$wechat.wechatEvevt([
|
||||||
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
|
"updateAppMessageShareData",
|
||||||
}
|
"updateTimelineShareData"
|
||||||
|
], configAppMessage);
|
||||||
|
},
|
||||||
|
|
||||||
|
fen2yuan(price) {
|
||||||
|
return Util.fen2yuan(price)
|
||||||
|
},
|
||||||
|
formatDate: function(date) {
|
||||||
|
return dayjs(date).format("YYYY-MM-DD");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
page {
|
page {
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue