Browse Source

首页跳转小程序/我的e家跳转小程序/活动图片长按跳转公众号

master
mk 2 years ago
parent
commit
d5ec958c89
  1. 25
      epdc-resident-mp-yushan/pages/index/index.js
  2. 3
      epdc-resident-mp-yushan/project.config.json
  3. 7
      epdc-resident-mp-yushan/project.private.config.json
  4. 29
      epdc-resident-mp-yushan/subpages/communityNews/pages/detail/detail.js
  5. 2
      epdc-resident-mp-yushan/subpages/communityNews/pages/detail/detail.wxml
  6. 9
      epdc-resident-mp-yushan/subpages/family/pages/index/index.js
  7. 2
      epdc-resident-mp-yushan/subpages/family/pages/index/index.wxml

25
epdc-resident-mp-yushan/pages/index/index.js

@ -35,6 +35,11 @@ Page({
module: 'house',
imgHeightFlag:true
},
{
icon:'../../images/home/jifen.png',
tip: '社区团购',
module: 'pointRank',
},
{
icon:
'https://epdc-yushan.elinkservice.cn/files-pro/20220324/118ea106d9ed40978f3e23cc51b43119.png',
@ -42,18 +47,15 @@ Page({
tip: '指尖榆山',
module: 'fingerYushan',
},
//志愿服务
{
icon:
'../../images/hswy.png',
tip: '红色物业',
tip: '矛调超市',
module: 'volunteerService',
},
{
icon:'../../images/home/jifen.png',
tip: '积分排名',
module: 'pointRank',
},
// {
// icon:
// 'https://epdc-yushan.elinkservice.cn/files-pro/20220324/1083316800d948b4a8a4206dcb857722.png',
@ -496,8 +498,15 @@ Page({
url: '/pages/mine/mine'
})
} else if (module === 'pointRank') {
wx.navigateTo({
url: '/subpages/integralCentre/pages/index/index'
// wx.navigateTo({
// url: '/subpages/integralCentre/pages/index/index'
// })
wx.navigateToMiniProgram({
appId: 'wxbfc90d907beb18a3',
extraData:{},
success(res) {
// 打开成功
}
})
}
},

3
epdc-resident-mp-yushan/project.config.json

@ -41,7 +41,8 @@
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true,
"useStaticServer": true,
"minifyWXML": true
"minifyWXML": true,
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.10.4",

7
epdc-resident-mp-yushan/project.private.config.json

@ -122,6 +122,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subpages/communityNews/pages/detail/detail",
"query": "",
"launchMode": "default",
"scene": null
}
]
}

29
epdc-resident-mp-yushan/subpages/communityNews/pages/detail/detail.js

@ -6,13 +6,19 @@ Page({
detailId: '',
detailObjContent: '',
residentValue: 0,
imgFlag:false
},
onLoad(option) {
if (option.id) {
console.log(option.id);
this.setData({
detailId: option.id
})
if(option.id =='7ae3b9b894fa66cb6261c84b09a28995'){
this.getOne()
}else{
this.getDetail()
}
this.getResidentConfig()
}
},
@ -74,5 +80,28 @@ Page({
}).catch(err => {
console.log(err)
})
},
getOne(){
// <p><img src=\"https://epdc-yushan.elinkservice.cn/files-pro/20230614/d31dedb304e64b57934e4d2a694549e3.png\"></p>写一个js方法截取出src=后面的内容到png截止
homeApi.contentDetail(this.data.detailId).then(res => {
const startIndex = res.data.noticeContent.indexOf("src=") + 5; // 获取src=的结束位置
const endIndex = res.data.noticeContent.indexOf(".png", startIndex) + 4; // 获取.png的结束位置
let src = res.data.noticeContent.substring(startIndex, endIndex);
console.log(src);
this.setData({
detailObj: res.data,
detailObjContent: res.data.noticeContent.replace(/\<img/gi, '<image style="max-width:100%;height:auto"'),
imgFlag:true
})
}).catch(err => {
console.log(err)
})
},
onQRCodeLongPress() {
//临时跳转
wx.navigateTo({
url: `/subpages/home/pages/webview/webview?url=${'https://epdc-jinshui-questionnaire.elinkservice.cn/s/36b2c54b9ace4c60b79aab53c4a7932d'}`
});
}
})

2
epdc-resident-mp-yushan/subpages/communityNews/pages/detail/detail.wxml

@ -16,6 +16,8 @@
</view>
<view class="richContent">
<rich-text nodes="{{detailObjContent}}"></rich-text>
<!-- show-menu-by-longpress="{{true}}" -->
<image wx:if="{{imgFlag}}" src="https://epdc-yushan.elinkservice.cn/files-pro/20230613/460f553812514259b457b3f7a1cffc16.jpg" mode="" class="qrcode-canvas" bindlongpress="onQRCodeLongPress" />
</view>
</view>
</view>

9
epdc-resident-mp-yushan/subpages/family/pages/index/index.js

@ -88,6 +88,15 @@ Page({
})
}
},
navToMiniprogram(){
wx.navigateToMiniProgram({
appId: 'wxbfc90d907beb18a3',
path: '/ec_shop/goods?productInstanceId=12109821544&vid=0',
success(res) {
// 打开成功
}
})
},
// 跳转新增页面
handleTo(){
if(this.data.selectedTabBar=='resiNew'){

2
epdc-resident-mp-yushan/subpages/family/pages/index/index.wxml

@ -39,7 +39,7 @@
<view class="type {{selectedTabBar === 'housePrice' ? 'selected-housePrice' : ''}}" data-type="housePrice" hover-class="hover-tabbar" hover-stay-time="300" bindtap="chooseTabBar">
房价涨了
</view>
<view class="type {{selectedTabBar === 'groupPrice' ? 'selected-groupPrice' : ''}}" data-type="groupPrice" hover-class="hover-tabbar" hover-stay-time="300" bindtap="chooseTabBar">
<view class="type {{selectedTabBar === 'groupPrice' ? 'selected-groupPrice' : ''}}" data-type="groupPrice" hover-class="hover-tabbar" hover-stay-time="300" bindtap="navToMiniprogram">
团购火了
</view>
<view class="type {{selectedTabBar === 'integral' ? 'selected-integral' : ''}}" data-type="integral" hover-class="hover-tabbar" hover-stay-time="300" bindtap="chooseTabBar">

Loading…
Cancel
Save