diff --git a/components/activity/activity.wxml b/components/activity/activity.wxml
index e5debe5..00d56e1 100644
--- a/components/activity/activity.wxml
+++ b/components/activity/activity.wxml
@@ -14,7 +14,7 @@
已取消
- {{item.title}}
+ 置顶 {{item.title}}
时间:{{item.actStartTime}}至
diff --git a/components/activity/activity.wxss b/components/activity/activity.wxss
index 9dc234c..67167f0 100644
--- a/components/activity/activity.wxss
+++ b/components/activity/activity.wxss
@@ -84,6 +84,10 @@
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
+.infos .infos_title .top {
+ color: #ff0000;
+ font-size: 28rpx;
+}
.infos .infos-flex {
height: 100%;
display: flex;
diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js
index 9a6ebdc..30652fb 100644
--- a/pages/heartNew/heartNew.js
+++ b/pages/heartNew/heartNew.js
@@ -1,11 +1,12 @@
// pages/heartNew/heartNew.js
const app = getApp()
var api = require("../../utils/activity.js")
+var heartBehavior = require("../../utils/heartBehavior")
import {
getTimestamp
} from "../../utils/common"
Page({
-
+ behaviors: [heartBehavior],
/**
* 页面的初始数据
*/
@@ -15,32 +16,31 @@ Page({
selectedTab: "tab0",
// banner 相关
banner: [],
- indicatorDots: false, //指示点
- autoplay: true, //true false,//自动播放
- circular: true, //衔接滑动
- interval: 4000, //自动播放间隔时长(ms)
- duration: 500, //幻灯片切换时长(ms)
+ indicatorDots: false, // 指示点
+ autoplay: true, // true false,//自动播放
+ circular: true, // 衔接滑动
+ interval: 4000, // 自动播放间隔时长(ms)
+ duration: 500, // 幻灯片切换时长(ms)
currentSwiper: 0,
// banner 相关end
// 列表相关
- loadMoreVisible: false, //false
- loadMoreType: "none", //loading none
- dingdan: false,//判断订单列表隐藏
- jingcai: true,//判断精彩列表隐藏
+ loadMoreVisible: false, // false
+ loadMoreType: "none", // loading none
+ dingdan: false, // 判断订单列表隐藏
+ jingcai: true, // 判断精彩列表隐藏
indexPage: 1,
pageSize: 10,
- qkdat: false,//判断是否清空数据
- actId: "",//判断返回以后是否需要刷新列表
- volunteerlist:[],//志愿者列表
- volunteerCount: 0, //志愿者注册数
- listLength:0,//数据长度判断是否需要加载
- getImgUrl:"",
+ qkdat: false, // 判断是否清空数据
+ actId: "", // 判断返回以后是否需要刷新列表
+ volunteerlist:[],// 志愿者列表
+ volunteerCount: 0, // 志愿者注册数
+ listLength:0, // 数据长度判断是否需要加载
+ getImgUrl:"", // 顶部咨询电话图片
ifClickImage:false,//因为志友多多点击图片查看大图,会出现列表刷新的bug,所以加这个字段进行控制
tabFixed: false,
searchName: '',
infoCompleted: 0, //是否完善了用户信息
completeInfoDialogVisible: false,
- tabRightList: [], //拼团购和顺道捎
volunteerTagId: '',//志愿者标签id
tagList: [
{
@@ -53,18 +53,17 @@ Page({
btnLeft: 0,
shouye: {},
scanBtn: {}, // 扫码签到改为可配置
- applyBtn: {}, // 申请发单按钮改为可配置
- tabLeftList: [], // 首页配置按钮+申请发单按钮
+ // applyBtn: {}, // 申请发单按钮改为可配置,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
- this.getModuleList()
+ this.loadBehavior()
+
this.bannerListV2()
this.getVolunteerTags()
- this.getImgUrl()//获取配置图片
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
@@ -367,59 +366,6 @@ Page({
console.log(err)
})
},
- // 获取配置图片
- getImgUrl:function (){//0:咨询热线
- let params = {
- imageTypes: '0, 5, 8, 9'
- }
- api.getImgUrlList(params).then(res => {
- console.log(res.data)
- 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
- })
- }
- })
- })
- return
- let that = this
- api.getImgUrl("0").then(function (res) {
- that.setData({
- getImgUrl: res.data[0]
- })
- })
- // 2021.03.31 拼团购顺道捎移至首页
- // 2021.04.28 拼团购顺道捎移回...
- api.getImgUrl("5").then(function (res) {
- that.setData({
- tabRightList: res.data
- })
- })
- api.getImgUrl("8").then(function (res) {
- console.log(res.data)
- if (res.data.length > 0) {
- that.setData({
- scanBtn: res.data[0]
- })
- }
- })
- },
/**
* 页面上拉触底事件的处理函数
*/
@@ -634,28 +580,6 @@ Page({
}
})
},
- // 获取模块信息
- getModuleList: function () {
- let params = {
- pageIndex: 1,
- pageSize: 10,
- pid: '0'
- }
- api.moduleCategory(params).then(res => {
- console.log('获取模块列表',res.data)
- res.data.forEach( item => {
- if (item.categoryCode == 'shouye') {
- this.data.tabLeftList[1] = item
- this.setData({
- shouye: item,
- tabLeftList: this.data.tabLeftList
- })
- }
- })
- }).catch(err => {
- console.log(err)
- })
- },
//跳转到 页面
toShouye () {
//如果是 详情样式,直接跳转详情页面
diff --git a/pages/heartNew/heartNew.wxss b/pages/heartNew/heartNew.wxss
index 776f1fc..8d31d8e 100644
--- a/pages/heartNew/heartNew.wxss
+++ b/pages/heartNew/heartNew.wxss
@@ -300,8 +300,8 @@ button:last-child {
flex-direction: column;
}
.tab-left image {
- width: 200rpx;
- height: 88rpx;
+ width: 186rpx;
+ height: 102rpx;
}
.tab-left .tab {
position: relative;
@@ -318,12 +318,12 @@ button:last-child {
position: fixed;
right: 0;
z-index: 997;
- margin-top: 20rpx;
+ margin-top: 36rpx;
display: flex;
flex-direction: column;
}
.tab-right image {
- width: 160rpx;
+ width: 186rpx;
height: 102rpx;
}
.tab-right .tab {
diff --git a/pages/indexNew/indexNew.js b/pages/indexNew/indexNew.js
index 680a2ee..64036e0 100644
--- a/pages/indexNew/indexNew.js
+++ b/pages/indexNew/indexNew.js
@@ -165,8 +165,14 @@ Page({
}
})
api.getImgUrl("5").then(res => {
- this.setData({
- tabRightList: res.data
+ this.data.tabRightList = []
+ res.data.forEach(item => {
+ if (item.imgCode == 'ptg-sy' || item.imgCode == 'sds-sy') {
+ this.data.tabRightList.push(item)
+ this.setData({
+ tabRightList: this.data.tabRightList
+ })
+ }
})
})
},
@@ -803,11 +809,11 @@ Page({
},
//拼团购/顺道捎 跳转 2021.03.31
toJumpPage (e) {
- if (e.currentTarget.dataset.code == 'ptg') {
+ if (e.currentTarget.dataset.code == 'ptg-sy') {
wx.navigateTo({
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-sy') {
wx.navigateTo({
url: `/subpages/heart/pages/dropByList/dropByList?title=${e.currentTarget.dataset.title}`
})
diff --git a/pages/indexNew/indexNew.wxss b/pages/indexNew/indexNew.wxss
index e3eae19..3fa5da7 100644
--- a/pages/indexNew/indexNew.wxss
+++ b/pages/indexNew/indexNew.wxss
@@ -673,7 +673,7 @@ page {
flex-direction: column;
}
.tab-right image {
- width: 160rpx;
+ width: 186rpx;
height: 102rpx;
}
.tab-right .tab {
diff --git a/pages/toRegister/toRegister.js b/pages/toRegister/toRegister.js
index 78372a7..d3a2209 100644
--- a/pages/toRegister/toRegister.js
+++ b/pages/toRegister/toRegister.js
@@ -21,7 +21,7 @@ Page({
// }
// })
let that = this
- const versionNum = "1.6.40"
+ const versionNum = "1.6.41"
api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data)
let state = res.data.scanFlag
diff --git a/project.config.json b/project.config.json
index c5a11d8..b5fc503 100644
--- a/project.config.json
+++ b/project.config.json
@@ -35,7 +35,7 @@
"minifyWXSS": true
},
"compileType": "miniprogram",
- "libVersion": "2.8.2",
+ "libVersion": "2.9.2",
"appid": "wx6dcf544cdae7d4ec",
"projectname": "e%E9%94%A6%E6%B0%B4-%E5%B1%85%E6%B0%91%E7%AB%AF",
"cloudfunctionTemplateRoot": "",
diff --git a/utils/heartBehavior.js b/utils/heartBehavior.js
new file mode 100644
index 0000000..1d55407
--- /dev/null
+++ b/utils/heartBehavior.js
@@ -0,0 +1,101 @@
+// heartBehavior.js 用于更改e锦水小程序和志愿者小程序共同行为
+// 数组排序 按照 sort 属性
+function compare(property) {
+ return function (a, b) {
+ var value1 = a[property]
+ var value2 = b[property]
+ return value1 - value2
+ }
+}
+// 拆分数组
+function group(array, subGroupLength) {
+ let index = 0
+ let newArray = []
+ while(index < array.length) {
+ newArray.push(array.slice(index, index += subGroupLength))
+ }
+ return newArray
+}
+var api = require("activity.js")
+module.exports = Behavior ({
+ data: {
+ tabList: [],
+ tabRightList: [], //拼团购和顺道捎
+ tabLeftList: [], // 首页配置按钮+申请发单按钮
+ },
+ methods: {
+ // beheaviors 加载成功 基础库2.9.2
+ loadBehavior () {
+ console.log('load heartBehavior')
+ Promise.all([this.getModuleList(), this.getImgUrl()]).then( () => {
+ let newArr = group(this.data.tabList.sort(compare('sort')), 2)
+ this.setData({
+ tabLeftList: newArr[0],
+ tabRightList: newArr[1]
+ })
+ })
+ },
+ // 获取模块信息
+ getModuleList: function () {
+ return new Promise((resolve, reject) => {
+ let params = {
+ pageIndex: 1,
+ pageSize: 10,
+ pid: '0'
+ }
+ api.moduleCategory(params).then(res => {
+ console.log('获取模块列表',res.data)
+ res.data.forEach( item => {
+ if (item.categoryCode == 'shouye') {
+ this.data.tabList.push(item)
+ this.setData({
+ shouye: item,
+ tabList: this.data.tabList
+ })
+ }
+ })
+ resolve()
+ }).catch(err => {
+ console.log(err)
+ reject()
+ })
+ })
+
+ },
+ // 获取配置图片
+ getImgUrl:function (){
+ return new Promise((resolve, reject) => {
+ let params = {
+ imageTypes: '0, 5, 8, 9'
+ }
+ api.getImgUrlList(params).then(res => {
+ res.data.forEach( item => {
+ if (item.imgType == '0') {
+ this.setData({
+ getImgUrl: item
+ })
+ } else if (item.imgType == '5' && (item.imgCode == 'ptg' || item.imgCode == 'sds')) {
+ this.data.tabList.push(item)
+ this.setData({
+ tabList: this.data.tabList
+ })
+ } else if (item.imgType == '8') {
+ this.setData({
+ scanBtn: item
+ })
+ } else if (item.imgType == '9') {
+ this.data.tabList.push(item)
+ this.setData({
+ tabList: this.data.tabList
+ })
+ }
+ })
+ resolve()
+ }).catch(err => {
+ console.log(err)
+ reject()
+ })
+ })
+ }
+ }
+})
\ No newline at end of file