服务分享 保留前3

h5
fanfan 7 months ago
parent 5dc97b08e0
commit 003ecbd781
  1. 20
      pages/activity/ranking.vue
  2. 36
      pages/news/recycling/detail.vue

@ -109,7 +109,8 @@
styleIndex: { styleIndex: {
immediate: true, immediate: true,
handler() { handler() {
this.background.background = `url(https://www.royaum.com.cn/static/rank/rank-bg${this.styleIndex}.png) center top no-repeat`; this.background.background =
`url(https://www.royaum.com.cn/static/rank/rank-bg${this.styleIndex}.png) center top no-repeat`;
}, },
}, },
}, },
@ -150,7 +151,7 @@
item1.goods_price_min = Number(item1.goods_price_min); item1.goods_price_min = Number(item1.goods_price_min);
}) })
}); });
app.jingList = result.data; app.jingList = result.data.length > 0 ? result.data.slice(0, 3) : [];
}) })
.finally(() => app.isLoading = false) .finally(() => app.isLoading = false)
}, },
@ -205,6 +206,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import './rankingStyle.scss'; @import './rankingStyle.scss';
.newGoods { .newGoods {
width: 100%; width: 100%;
position: relative; position: relative;
@ -212,9 +214,10 @@
padding-bottom: 30rpx; padding-bottom: 30rpx;
background: #F34A40 url(https://www.royaum.com.cn/static/rank/rank1.png) center 132rpx no-repeat; background: #F34A40 url(https://www.royaum.com.cn/static/rank/rank1.png) center 132rpx no-repeat;
background-size: 100% auto; background-size: 100% auto;
::v-deep { ::v-deep {
.u-navbar-inner { .u-navbar-inner {
height: 80rpx!important; height: 80rpx !important;
} }
} }
@ -266,6 +269,8 @@
.menuItem { .menuItem {
display: inline-block; display: inline-block;
margin-right: 62rpx; margin-right: 62rpx;
position: relative;
height: 60rpx;
.menuName { .menuName {
@ -283,7 +288,11 @@
background: #FFE4C3; background: #FFE4C3;
border-radius: 72rpx 72rpx 72rpx 72rpx; border-radius: 72rpx 72rpx 72rpx 72rpx;
opacity: 1; opacity: 1;
margin-top: 8rpx; position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
} }
} }
} }
@ -430,7 +439,8 @@
border-radius: 70rpx; border-radius: 70rpx;
opacity: 1; opacity: 1;
margin-top: 26rpx; margin-top: 26rpx;
padding: 0 8rpx; padding: 0 8rpx;
.hotTitle1 { .hotTitle1 {
margin-right: 8rpx; margin-right: 8rpx;
width: 68rpx; width: 68rpx;

@ -132,7 +132,8 @@
} }
}, },
onLoad(o) { onLoad(o) {
let info = uni.getStorageSync("getInfo"); console.log(o.info)
let info = o.info ? JSON.parse(o.info) : uni.getStorageSync("getInfo");
if (info.content) { if (info.content) {
info.content = info.content.replace(/<img src=/g, '<img style="width: 100%; display:block" src=') info.content = info.content.replace(/<img src=/g, '<img style="width: 100%; display:block" src=')
console.log(info.content) console.log(info.content)
@ -141,7 +142,7 @@
this.type = o.type; this.type = o.type;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: o.type == 1 ? "服务详情" : '旧物回收' title: o.type == 1 ? "服务详情" : '旧物回收'
}) })
}, },
onShow() { onShow() {
if (uni.getStorageSync("userInfo").user_id) { if (uni.getStorageSync("userInfo").user_id) {
@ -156,6 +157,34 @@
uni.removeStorageSync("yuyueTime") uni.removeStorageSync("yuyueTime")
}, },
/**
* 分享当前页面
*/
onShareAppMessage() {
const app = this
//
uni.setStorageSync("getInfo", app.info)
return {
title: app.type == 2 ? app.info.recovery_name : app.info.server_name,
imageUrl: app.type == 2 ? app.info.recovery_image : app.info.server_image,
path: '/pages/news/recycling/detail?type=' + app.type + '&info=' + JSON.stringify(app.info),
}
},
/**
* 分享到朋友圈
* 本接口为 Beta 版本暂只在 Android 平台支持详见分享到朋友圈 (Beta)
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
*/
onShareTimeline() {
const app = this
uni.setStorageSync("getInfo", app.info)
return {
title: app.type == 2 ? app.info.recovery_name : app.info.server_name,
imageUrl: app.type == 2 ? app.info.recovery_image : app.info.server_image,
path: '/pages/news/recycling/detail?type=' + app.type + '&info=' + JSON.stringify(app.info),
}
},
methods: { methods: {
// //
getCarouselList(type) { getCarouselList(type) {
@ -164,7 +193,7 @@
type: 'recycling_services' type: 'recycling_services'
}) })
.then(result => { .then(result => {
let content = result.data.detail?result.data.detail.content:''; let content = result.data.detail ? result.data.detail.content : '';
if (content) { if (content) {
content = content.replace(/style=""/g, '').replace(/<img src=/g, content = content.replace(/style=""/g, '').replace(/<img src=/g,
'<img style="width: 100%; display:block" src=') '<img style="width: 100%; display:block" src=')
@ -272,6 +301,7 @@
overflow: hidden; overflow: hidden;
padding-bottom: 30rpx; padding-bottom: 30rpx;
&-hd { &-hd {
padding: 30rpx 60rpx; padding: 30rpx 60rpx;
position: relative; position: relative;

Loading…
Cancel
Save