Browse Source

获取图片配置接口优化;

master
ZhaoTongYao 4 years ago
parent
commit
b269acbe9c
  1. 58
      pages/heartNew/heartNew.js
  2. 17
      pages/heartNew/heartNew.wxml
  3. 23
      pages/heartNew/heartNew.wxss
  4. 8
      utils/activity.js

58
pages/heartNew/heartNew.js

@ -61,6 +61,8 @@ Page({
detailId: '', // 通过分享进入 团购详情的id
scanBtn: {}, // 扫码签到改为可配置
shouye: {},
applyBtn: {}, // 申请发单改为可配置
tabLeftList: [],
},
/**
@ -372,26 +374,33 @@ Page({
},
// 获取配置图片
getImgUrl:function (){//0:咨询热线
let that = this
api.getImgUrl("0").then(function (res) {
that.setData({
getImgUrl: res.data[0]
})
})
// 2021.05.08
api.getImgUrl("5").then(function (res) {
that.setData({
tabRightList: res.data
})
})
// 扫码签到按钮
api.getImgUrl("8").then(function (res) {
let params = {
imageTypes: '0, 5, 8, 9'
}
api.getImgUrlList(params).then(res => {
console.log(res.data)
if (res.data.length > 0) {
that.setData({
scanBtn: res.data[0]
})
}
this.data.tabRightList = []
res.data.forEach( item => {
if (item.imgType == '0') {
this.setData({
getImgUrl: item
})
} else if (item.imgType == '5') {
this.data.tabRightList.push(item)
this.setData({
tabRightList: this.data.tabRightList
})
} else if (item.imgType == '8') {
this.setData({
scanBtn: item
})
} else if (item.imgType == '9') {
this.data.tabLeftList[0] = item
this.setData({
tabLeftList: this.data.tabLeftList
})
}
})
})
},
/**
@ -530,6 +539,10 @@ Page({
wx.navigateTo({
url: `/subpages/heart/pages/dropByList/dropByList?title=${e.currentTarget.dataset.title}`
})
} else if (e.currentTarget.dataset.code == 'volunteer_sqfd') {
this.myApply()
} else if (e.currentTarget.dataset.code == 'shouye') {
this.toShouye()
}
},
//选择志愿者标签筛选
@ -772,10 +785,11 @@ Page({
api.moduleCategory(params).then(res => {
console.log('获取模块列表',res.data)
res.data.forEach( item => {
if (item.categoryCode == 'shouye') {
this.data.shouye = { ...item }
if (item.categoryCode == 'shouye') {
this.data.tabLeftList[1] = item
this.setData({
shouye: this.data.shouye
shouye: item,
tabLeftList: this.data.tabLeftList
})
}
})

17
pages/heartNew/heartNew.wxml

@ -54,6 +54,12 @@
</view>
</view>
</view>
<view class="tab-left">
<view class="tab" wx:for="{{tabLeftList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode||item.categoryCode}}" bindtap="toJumpPage">
<image src="{{item.imgUrl}}"/>
<view class="tab-text"></view>
</view>
</view>
<view class="tab-right">
<view class="tab" wx:for="{{tabRightList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode}}" bindtap="toJumpPage">
<image src="{{item.imgUrl}}"/>
@ -111,15 +117,16 @@
<view class="details-top" hidden="{{jingcai}}">
<activity bind:toActDetail="toActDetailDown" id="state-2" state="2"></activity>
</view>
<move-btn
<!-- <move-btn
wx:if="{{applyBtn.imgUrl}}"
area-top="120"
area-height="90%"
button-width="208"
button-height="122"
button-top="850"
button-left="520"
img-url="../../images/heart/apply-new.png"
bindmovebtnCallBack="myApply"></move-btn>
img-url="{{applyBtn.imgUrl}}"
bindmovebtnCallBack="myApply"></move-btn> -->
<move-btn
wx:if="{{scanBtn.imgUrl && btnTop!=0}}"
area-top="120"
@ -131,13 +138,13 @@
img-url="{{scanBtn.imgUrl}}"
bindmovebtnCallBack="scanCode"></move-btn>
<move-btn wx:if="{{shouye.id}}"
<!-- <move-btn wx:if="{{shouye.id}}"
area-top="120"
area-height="90%"
button-top="1080"
button-width="240"
button-height="140"
img-url="{{shouye.imgUrl}}"
bindmovebtnCallBack="toShouye"></move-btn>
bindmovebtnCallBack="toShouye"></move-btn> -->
<load-more loadMoreVisible="{{loadMoreVisible}}" loadMoreType="{{loadMoreType}}"></load-more>
<completeInfo-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></completeInfo-dialog>

23
pages/heartNew/heartNew.wxss

@ -290,6 +290,29 @@ button:last-child {
/* banner end */
/* 拼团购/顺道捎 左侧按钮 */
.tab-left {
position: fixed;
left: 0;
z-index: 997;
margin-top: 36rpx;
display: flex;
flex-direction: column;
}
.tab-left image {
width: 200rpx;
height: 88rpx;
}
.tab-left .tab {
position: relative;
}
.tab-left .tab .tab-text {
position: absolute;
left: 40rpx;
top: 26rpx;
color: white;
font-size: 34rpx;
}
/* 拼团购/顺道捎 右侧按钮 */
.tab-right {
position: fixed;

8
utils/activity.js

@ -12,7 +12,8 @@ module.exports = {
getTokenV2,
getVolunteerVerify,
getResidentConfig,
moduleCategory
moduleCategory,
getImgUrlList
}
function getActivityList (params) {
@ -82,3 +83,8 @@ function getResidentConfig () {
function moduleCategory(params) {
return fly.get('news/module/moduleCategory', params)
}
// 获取图片配置列表 优化
function getImgUrlList (params) {
return fly.get('imgConfig/getImgUrlList', params)
}
Loading…
Cancel
Save