diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js index 59199b2..3402473 100644 --- a/pages/heartNew/heartNew.js +++ b/pages/heartNew/heartNew.js @@ -374,12 +374,12 @@ Page({ getImgUrl: res.data[0] }) }) - // 2021.03.31 拼团购顺道捎移至首页 - // api.getImgUrl("5").then(function (res) { - // that.setData({ - // tabRightList: res.data - // }) - // }) + // 2021.05.08 + api.getImgUrl("5").then(function (res) { + that.setData({ + tabRightList: res.data + }) + }) }, /** * 页面上拉触底事件的处理函数 @@ -508,17 +508,17 @@ Page({ }, // 跳转 拼团购顺道捎 入口移至首页 - // toJumpPage (e) { - // if (e.currentTarget.dataset.code == 'ptg') { - // wx.navigateTo({ - // url: `/subpages/heart/pages/groupBuyList/groupBuyList?title=${e.currentTarget.dataset.title}` - // }) - // } else if (e.currentTarget.dataset.code == 'sds') { - // wx.navigateTo({ - // url: `/subpages/heart/pages/dropByList/dropByList?title=${e.currentTarget.dataset.title}` - // }) - // } - // }, + toJumpPage (e) { + if (e.currentTarget.dataset.code == 'ptg') { + wx.navigateTo({ + url: `/subpages/heart/pages/groupBuyList/groupBuyList?title=${e.currentTarget.dataset.title}` + }) + } else if (e.currentTarget.dataset.code == 'sds') { + wx.navigateTo({ + url: `/subpages/heart/pages/dropByList/dropByList?title=${e.currentTarget.dataset.title}` + }) + } + }, //选择志愿者标签筛选 changeTag (e) { if (this.data.isLoading) { @@ -571,29 +571,29 @@ Page({ //2021.04.07 志愿者独立小程序 indexNew indexNew (options) { this.getResidentConfig() - if (options.shareType) { - const para = { - shareType: options.shareType, - id: options.id, - detailId: options.detailId, - type: options.type ? options.type : "", - defaultGridId: options.defaultGridId ? options.defaultGridId : "", - } - wx.setStorageSync("shareObj", JSON.stringify(para)) - } - if (options.scene) { - if (options.scene == 'module_ma_code_zyzqn' || options.scene == 'module_ma_code_lbzx') { - this.setData({ - sceneFrom: options.scene - }) - } else { - this.setData({ - gridId: options.scene, - fromprogram: options.from, - gid: decodeURIComponent(options.scene) - }) - } - } + // if (options.shareType) { + // const para = { + // shareType: options.shareType, + // id: options.id, + // detailId: options.detailId, + // type: options.type ? options.type : "", + // defaultGridId: options.defaultGridId ? options.defaultGridId : "", + // } + // wx.setStorageSync("shareObj", JSON.stringify(para)) + // } + // if (options.scene) { + // if (options.scene == 'module_ma_code_zyzqn' || options.scene == 'module_ma_code_lbzx') { + // this.setData({ + // sceneFrom: options.scene + // }) + // } else { + // this.setData({ + // gridId: options.scene, + // fromprogram: options.from, + // gid: decodeURIComponent(options.scene) + // }) + // } + // } setTimeout(() => { this.getUserState() }, 700) diff --git a/pages/heartNew/heartNew.wxml b/pages/heartNew/heartNew.wxml index 914d7f9..4607d9c 100644 --- a/pages/heartNew/heartNew.wxml +++ b/pages/heartNew/heartNew.wxml @@ -54,12 +54,12 @@ - + diff --git a/pages/heartNew/heartNew.wxss b/pages/heartNew/heartNew.wxss index d134c78..98fa0fb 100644 --- a/pages/heartNew/heartNew.wxss +++ b/pages/heartNew/heartNew.wxss @@ -290,7 +290,7 @@ button:last-child { /* banner end */ -/* 拼团购/顺道捎 右侧按钮 +/* 拼团购/顺道捎 右侧按钮 */ .tab-right { position: fixed; right: 0; @@ -312,7 +312,7 @@ button:last-child { top: 26rpx; color: white; font-size: 34rpx; -} */ +} .tab-all { position: absolute; width: 100%; diff --git a/pages/toRegister/toRegister.js b/pages/toRegister/toRegister.js index 4dce318..17c5109 100644 --- a/pages/toRegister/toRegister.js +++ b/pages/toRegister/toRegister.js @@ -21,7 +21,7 @@ Page({ // } // }) let that = this - const versionNum = "1.0.0" + const versionNum = "1.0.1" api.getScanSwitch(versionNum).then(function (res) { // console.log(res.data.scanFlag) if (res.data) { diff --git a/subpages/heart/pages/dropByList/dropByList.js b/subpages/heart/pages/dropByList/dropByList.js index 3fd81b5..627ff36 100644 --- a/subpages/heart/pages/dropByList/dropByList.js +++ b/subpages/heart/pages/dropByList/dropByList.js @@ -206,7 +206,7 @@ Page({ toNoticeGuide () { console.log('操作指南') wx.navigateTo({ - url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?categorycode=sds_czzn&categoryname=操作指南` + url: `/subpages/heart/pages/noticeDetail/noticeDetail?categorycode=sds_czzn&categoryname=操作指南` }) } }) \ No newline at end of file diff --git a/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js b/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js index a40ba2d..e809786 100644 --- a/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js +++ b/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js @@ -21,6 +21,7 @@ Page({ dialogVisible: false, //提示框 dialogTitle: '', //提示内容 lock: false, + configPoint: 0, }, /** @@ -33,6 +34,7 @@ Page({ detailType: options.type || '', details: {} }) + this.getResidentConfig() this.getNoticeDetail() this.getEvaluationList() }, @@ -227,7 +229,7 @@ Page({ let _this = this let tip = '是否要取消报名?' if (status == 0) { - tip = '是否要报名?' + tip = `若您报名后,未购买当前商品,系统将会扣除您${this.data.configPoint}积分` } else { tip = '是否要取消报名?' } @@ -294,5 +296,22 @@ Page({ } else { return false } + }, + // 获取默认配置, 提示扣除积分 + getResidentConfig (){ + let that = this + api.getResidentConfig().then(res => { + if (res.code === 0 && res.msg === "success") { + res.data.forEach(item => { + if (item.residentType === "poins_config" && item.residentCode === "points_ptg_dishonest") { + that.setData({ + configPoint: parseInt(item.residentValue) + }) + } + }) + } + }).catch(err => { + console.log(err) + }) } }) \ No newline at end of file diff --git a/subpages/heart/pages/groupBuyList/groupBuyList.js b/subpages/heart/pages/groupBuyList/groupBuyList.js index 2423c7c..c96a166 100644 --- a/subpages/heart/pages/groupBuyList/groupBuyList.js +++ b/subpages/heart/pages/groupBuyList/groupBuyList.js @@ -189,7 +189,7 @@ Page({ toNoticeGuide () { console.log('操作指南') wx.navigateTo({ - url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?categorycode=ptg_czzn&categoryname=操作指南` + url: `/subpages/heart/pages/noticeDetail/noticeDetail?categorycode=ptg_czzn&categoryname=操作指南` }) } }) \ No newline at end of file diff --git a/subpages/heart/pages/noticeDetail/noticeDetail.js b/subpages/heart/pages/noticeDetail/noticeDetail.js index 11ec711..ccd07c7 100644 --- a/subpages/heart/pages/noticeDetail/noticeDetail.js +++ b/subpages/heart/pages/noticeDetail/noticeDetail.js @@ -1,14 +1,56 @@ -// const api = require('../../../../utils/home') -// import util from '../../../../utils/util' -// import { getTimestamp } from '../../../../utils/common' +const api = require('../../utils/api') +import util from '../../../../utils/util' Page({ data: { - noticeObj: {} + pageIndex:1, + pageSize:10, + categoryName:'', + nodata: false, + noticeId: '', + noticeObj: {}, + noticeObjContent: "", }, onLoad (options) { - this.data.noticeObj = {...options} this.setData({ - noticeObj:this.data.noticeObj + categoryName:options.categorycode }) - } + wx.setNavigationBarTitle({ + title: options.categoryname + }) + this.noticelist() + }, + noticelist () { + let that = this; + let params = { + pageIndex: 1, + pageSize: 10, + noticeCategory: that.data.categoryName + } + api.noticelist(params).then(function (res) { + if (res.data.length == 0) { + that.setData({ + nodata: true + }) + } else { + that.setData({ + nodata: false, + noticeId: res.data[0].id + }) + that.noticeDetail(res.data[0].id) + } + }).catch(err => { + console.log(err) + }) + }, + noticeDetail (noticeId){ + let that = this; + api.noticeDetail(noticeId).then(function (res) { + that.setData({ + noticeObj: res.data, + noticeObjContent: util.formatRichText(res.data.noticeContent) + }) + }).catch(err => { + console.log(err) + }) + }, }) \ No newline at end of file diff --git a/subpages/heart/pages/noticeDetail/noticeDetail.json b/subpages/heart/pages/noticeDetail/noticeDetail.json index 55ae250..0037cf2 100644 --- a/subpages/heart/pages/noticeDetail/noticeDetail.json +++ b/subpages/heart/pages/noticeDetail/noticeDetail.json @@ -1,6 +1,7 @@ { "usingComponents": { - "parser": "../../../../components/parser/parser" + "parser": "../../../../components/parser/parser", + "no-data": "../../../../components/nodata/nodata" }, "navigationBarTitleText": "通知详情" } \ No newline at end of file diff --git a/subpages/heart/pages/noticeDetail/noticeDetail.wxml b/subpages/heart/pages/noticeDetail/noticeDetail.wxml index c713640..3a306ff 100644 --- a/subpages/heart/pages/noticeDetail/noticeDetail.wxml +++ b/subpages/heart/pages/noticeDetail/noticeDetail.wxml @@ -1,23 +1,23 @@ - - {{noticeObj.title}} - + + - {{noticeObj.content}} - - + + - \ No newline at end of file + + diff --git a/subpages/heart/utils/api.js b/subpages/heart/utils/api.js index 5c3e425..13be61e 100644 --- a/subpages/heart/utils/api.js +++ b/subpages/heart/utils/api.js @@ -20,6 +20,9 @@ module.exports = { getGroupBuySignUpList, tradeConfirmation, signUpOrCancel, + getResidentConfig, + noticelist, + noticeDetail } //顺道捎-首页列表 @@ -140,4 +143,18 @@ function tradeConfirmation (para) { //拼团购-报名/取消报名 function signUpOrCancel (para) { return fly.post("custom/groupBuy/signUpOrCancel", para) +} + +// 获取居民端配置 +function getResidentConfig () { + return fly.get("residentConfig/getResidentConfig") +} + +// 通知列表(通) +function noticelist (params) { + return fly.get("news/v2/notice/list", params) +} +// 通知详情 +function noticeDetail (noticeId) { + return fly.get(`news/notice/detail/${noticeId}`) } \ No newline at end of file diff --git a/subpages/integralCentre/pages/index/index.js b/subpages/integralCentre/pages/index/index.js index 0bb0871..4ad93b3 100644 --- a/subpages/integralCentre/pages/index/index.js +++ b/subpages/integralCentre/pages/index/index.js @@ -267,7 +267,7 @@ Page({ bindtapIntegralRule() { console.log('获取积分规则') wx.navigateTo({ - url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?categorycode=notice_points_rule&categoryname=积分规则` + url: `/subpages/heart/pages/noticeDetail/noticeDetail?categorycode=notice_points_rule&categoryname=积分规则` }) }, // 积分兑换页面 diff --git a/utils/config.js b/utils/config.js index bb9cba6..2d49467 100644 --- a/utils/config.js +++ b/utils/config.js @@ -6,8 +6,8 @@ module.exports = { }; function BASEURL() { - return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境 - // return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址 + // return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境 + return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址 // return 'http://10.10.10.5:9094/epdc-api/api/' // return 'https://nei.netease.com/api/apimock-v2/068b11343b2a993a9292d11f4b3fa8a8/api/' }