Browse Source

增加拼团购顺道捎

master
ZhaoTongYao 4 years ago
parent
commit
942b1b529e
  1. 80
      pages/heartNew/heartNew.js
  2. 4
      pages/heartNew/heartNew.wxml
  3. 4
      pages/heartNew/heartNew.wxss
  4. 2
      pages/toRegister/toRegister.js
  5. 2
      subpages/heart/pages/dropByList/dropByList.js
  6. 21
      subpages/heart/pages/groupBuyDetail/groupBuyDetail.js
  7. 2
      subpages/heart/pages/groupBuyList/groupBuyList.js
  8. 54
      subpages/heart/pages/noticeDetail/noticeDetail.js
  9. 3
      subpages/heart/pages/noticeDetail/noticeDetail.json
  10. 14
      subpages/heart/pages/noticeDetail/noticeDetail.wxml
  11. 17
      subpages/heart/utils/api.js
  12. 2
      subpages/integralCentre/pages/index/index.js
  13. 4
      utils/config.js

80
pages/heartNew/heartNew.js

@ -374,12 +374,12 @@ Page({
getImgUrl: res.data[0] getImgUrl: res.data[0]
}) })
}) })
// 2021.03.31 拼团购顺道捎移至首页 // 2021.05.08
// api.getImgUrl("5").then(function (res) { api.getImgUrl("5").then(function (res) {
// that.setData({ that.setData({
// tabRightList: res.data tabRightList: res.data
// }) })
// }) })
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
@ -508,17 +508,17 @@ Page({
}, },
// 跳转 拼团购顺道捎 入口移至首页 // 跳转 拼团购顺道捎 入口移至首页
// toJumpPage (e) { toJumpPage (e) {
// if (e.currentTarget.dataset.code == 'ptg') { if (e.currentTarget.dataset.code == 'ptg') {
// wx.navigateTo({ wx.navigateTo({
// url: `/subpages/heart/pages/groupBuyList/groupBuyList?title=${e.currentTarget.dataset.title}` url: `/subpages/heart/pages/groupBuyList/groupBuyList?title=${e.currentTarget.dataset.title}`
// }) })
// } else if (e.currentTarget.dataset.code == 'sds') { } else if (e.currentTarget.dataset.code == 'sds') {
// wx.navigateTo({ wx.navigateTo({
// url: `/subpages/heart/pages/dropByList/dropByList?title=${e.currentTarget.dataset.title}` url: `/subpages/heart/pages/dropByList/dropByList?title=${e.currentTarget.dataset.title}`
// }) })
// } }
// }, },
//选择志愿者标签筛选 //选择志愿者标签筛选
changeTag (e) { changeTag (e) {
if (this.data.isLoading) { if (this.data.isLoading) {
@ -571,29 +571,29 @@ Page({
//2021.04.07 志愿者独立小程序 indexNew //2021.04.07 志愿者独立小程序 indexNew
indexNew (options) { indexNew (options) {
this.getResidentConfig() this.getResidentConfig()
if (options.shareType) { // if (options.shareType) {
const para = { // const para = {
shareType: options.shareType, // shareType: options.shareType,
id: options.id, // id: options.id,
detailId: options.detailId, // detailId: options.detailId,
type: options.type ? options.type : "", // type: options.type ? options.type : "",
defaultGridId: options.defaultGridId ? options.defaultGridId : "", // defaultGridId: options.defaultGridId ? options.defaultGridId : "",
} // }
wx.setStorageSync("shareObj", JSON.stringify(para)) // wx.setStorageSync("shareObj", JSON.stringify(para))
} // }
if (options.scene) { // if (options.scene) {
if (options.scene == 'module_ma_code_zyzqn' || options.scene == 'module_ma_code_lbzx') { // if (options.scene == 'module_ma_code_zyzqn' || options.scene == 'module_ma_code_lbzx') {
this.setData({ // this.setData({
sceneFrom: options.scene // sceneFrom: options.scene
}) // })
} else { // } else {
this.setData({ // this.setData({
gridId: options.scene, // gridId: options.scene,
fromprogram: options.from, // fromprogram: options.from,
gid: decodeURIComponent(options.scene) // gid: decodeURIComponent(options.scene)
}) // })
} // }
} // }
setTimeout(() => { setTimeout(() => {
this.getUserState() this.getUserState()
}, 700) }, 700)

4
pages/heartNew/heartNew.wxml

@ -54,12 +54,12 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="tab-right"> <view class="tab-right">
<view class="tab" wx:for="{{tabRightList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode}}" bindtap="toJumpPage"> <view class="tab" wx:for="{{tabRightList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode}}" bindtap="toJumpPage">
<image src="{{item.imgUrl}}"/> <image src="{{item.imgUrl}}"/>
<view class="tab-text"></view> <view class="tab-text"></view>
</view> </view>
</view> --> </view>
<view class="tab-all"> <view class="tab-all">
<view class="tab-bar {{tabFixed ? 'tab-bar-fixed' : ''}}" style="margin-top: {{tabFixed ? statusHeight + navigationHeight : '278r'}}px"> <view class="tab-bar {{tabFixed ? 'tab-bar-fixed' : ''}}" style="margin-top: {{tabFixed ? statusHeight + navigationHeight : '278r'}}px">
<view class="tab tab0 {{selectedTab === 'tab0' ? 'select' : ''}}" data-tab="tab0" bindtap="tabBarChange"> <view class="tab tab0 {{selectedTab === 'tab0' ? 'select' : ''}}" data-tab="tab0" bindtap="tabBarChange">

4
pages/heartNew/heartNew.wxss

@ -290,7 +290,7 @@ button:last-child {
/* banner end */ /* banner end */
/* 拼团购/顺道捎 右侧按钮 /* 拼团购/顺道捎 右侧按钮 */
.tab-right { .tab-right {
position: fixed; position: fixed;
right: 0; right: 0;
@ -312,7 +312,7 @@ button:last-child {
top: 26rpx; top: 26rpx;
color: white; color: white;
font-size: 34rpx; font-size: 34rpx;
} */ }
.tab-all { .tab-all {
position: absolute; position: absolute;
width: 100%; width: 100%;

2
pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
// } // }
// }) // })
let that = this let that = this
const versionNum = "1.0.0" const versionNum = "1.0.1"
api.getScanSwitch(versionNum).then(function (res) { api.getScanSwitch(versionNum).then(function (res) {
// console.log(res.data.scanFlag) // console.log(res.data.scanFlag)
if (res.data) { if (res.data) {

2
subpages/heart/pages/dropByList/dropByList.js

@ -206,7 +206,7 @@ Page({
toNoticeGuide () { toNoticeGuide () {
console.log('操作指南') console.log('操作指南')
wx.navigateTo({ wx.navigateTo({
url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?categorycode=sds_czzn&categoryname=操作指南` url: `/subpages/heart/pages/noticeDetail/noticeDetail?categorycode=sds_czzn&categoryname=操作指南`
}) })
} }
}) })

21
subpages/heart/pages/groupBuyDetail/groupBuyDetail.js

@ -21,6 +21,7 @@ Page({
dialogVisible: false, //提示框 dialogVisible: false, //提示框
dialogTitle: '', //提示内容 dialogTitle: '', //提示内容
lock: false, lock: false,
configPoint: 0,
}, },
/** /**
@ -33,6 +34,7 @@ Page({
detailType: options.type || '', detailType: options.type || '',
details: {} details: {}
}) })
this.getResidentConfig()
this.getNoticeDetail() this.getNoticeDetail()
this.getEvaluationList() this.getEvaluationList()
}, },
@ -227,7 +229,7 @@ Page({
let _this = this let _this = this
let tip = '是否要取消报名?' let tip = '是否要取消报名?'
if (status == 0) { if (status == 0) {
tip = '是否要报名?' tip = `若您报名后,未购买当前商品,系统将会扣除您${this.data.configPoint}积分`
} else { } else {
tip = '是否要取消报名?' tip = '是否要取消报名?'
} }
@ -294,5 +296,22 @@ Page({
} else { } else {
return false 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)
})
} }
}) })

2
subpages/heart/pages/groupBuyList/groupBuyList.js

@ -189,7 +189,7 @@ Page({
toNoticeGuide () { toNoticeGuide () {
console.log('操作指南') console.log('操作指南')
wx.navigateTo({ wx.navigateTo({
url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?categorycode=ptg_czzn&categoryname=操作指南` url: `/subpages/heart/pages/noticeDetail/noticeDetail?categorycode=ptg_czzn&categoryname=操作指南`
}) })
} }
}) })

54
subpages/heart/pages/noticeDetail/noticeDetail.js

@ -1,14 +1,56 @@
// const api = require('../../../../utils/home') const api = require('../../utils/api')
// import util from '../../../../utils/util' import util from '../../../../utils/util'
// import { getTimestamp } from '../../../../utils/common'
Page({ Page({
data: { data: {
noticeObj: {} pageIndex:1,
pageSize:10,
categoryName:'',
nodata: false,
noticeId: '',
noticeObj: {},
noticeObjContent: "",
}, },
onLoad (options) { onLoad (options) {
this.data.noticeObj = {...options}
this.setData({ 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)
})
},
}) })

3
subpages/heart/pages/noticeDetail/noticeDetail.json

@ -1,6 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"parser": "../../../../components/parser/parser" "parser": "../../../../components/parser/parser",
"no-data": "../../../../components/nodata/nodata"
}, },
"navigationBarTitleText": "通知详情" "navigationBarTitleText": "通知详情"
} }

14
subpages/heart/pages/noticeDetail/noticeDetail.wxml

@ -1,8 +1,8 @@
<!-- <wxs module="filter" src="../../../../utils/filter.wxs"></wxs> --> <!-- <wxs module="filter" src="../../../../utils/filter.wxs"></wxs> -->
<view class="notice-detail"> <view class="notice-detail">
<view class="selfContent"> <view class="selfContent" wx:if="{{!nodata}}">
<view class="detail-title">{{noticeObj.title}}</view> <view class="detail-title">{{noticeObj.noticeTitle}}</view>
<!-- <view class="detail-subtitle"> <view class="detail-subtitle">
<view class="left"> <view class="left">
<span>{{noticeObj.deptName}}</span> <span>{{noticeObj.deptName}}</span>
<span>{{filter.formatTime(noticeObj.noticeTime, 'yyyy-MM-dd')}}</span> <span>{{filter.formatTime(noticeObj.noticeTime, 'yyyy-MM-dd')}}</span>
@ -13,11 +13,11 @@
</view> </view>
<view class="num">{{noticeObj.readingAmount}}</view> <view class="num">{{noticeObj.readingAmount}}</view>
</view> </view>
</view> --> </view>
<view class="richContent"> <view class="richContent">
<view class="content">{{noticeObj.content}}</view> <!-- <rich-text space="nbsp" nodes="{{noticeObjContent}}"></rich-text> -->
<!-- <rich-text nodes="{{noticeObjContent}}"></rich-text> --> <parser html="{{noticeObjContent}}"></parser>
<!-- <parser html="{{noticeObjContent}}"></parser> -->
</view> </view>
</view> </view>
<no-data isShow="{{nodata}}"></no-data>
</view> </view>

17
subpages/heart/utils/api.js

@ -20,6 +20,9 @@ module.exports = {
getGroupBuySignUpList, getGroupBuySignUpList,
tradeConfirmation, tradeConfirmation,
signUpOrCancel, signUpOrCancel,
getResidentConfig,
noticelist,
noticeDetail
} }
//顺道捎-首页列表 //顺道捎-首页列表
@ -141,3 +144,17 @@ function tradeConfirmation (para) {
function signUpOrCancel (para) { function signUpOrCancel (para) {
return fly.post("custom/groupBuy/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}`)
}

2
subpages/integralCentre/pages/index/index.js

@ -267,7 +267,7 @@ Page({
bindtapIntegralRule() { bindtapIntegralRule() {
console.log('获取积分规则') console.log('获取积分规则')
wx.navigateTo({ wx.navigateTo({
url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?categorycode=notice_points_rule&categoryname=积分规则` url: `/subpages/heart/pages/noticeDetail/noticeDetail?categorycode=notice_points_rule&categoryname=积分规则`
}) })
}, },
// 积分兑换页面 // 积分兑换页面

4
utils/config.js

@ -6,8 +6,8 @@ module.exports = {
}; };
function BASEURL() { function BASEURL() {
return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境 // return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境
// return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址 return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://10.10.10.5:9094/epdc-api/api/' // return 'http://10.10.10.5:9094/epdc-api/api/'
// return 'https://nei.netease.com/api/apimock-v2/068b11343b2a993a9292d11f4b3fa8a8/api/' // return 'https://nei.netease.com/api/apimock-v2/068b11343b2a993a9292d11f4b3fa8a8/api/'
} }

Loading…
Cancel
Save