Browse Source

eslint 校验

master
lihenian 5 years ago
parent
commit
143ae0df9f
  1. 3
      app.json
  2. 6
      components/activity/activity.js
  3. 2
      components/activity/activity.wxml
  4. BIN
      images/home/call.png
  5. 23
      pages/heartNew/heartNew.js
  6. 4
      pages/heartNew/heartNew.wxml
  7. 12
      pages/heartNew/heartNew.wxss
  8. 61
      pages/indexNew/indexNew.js
  9. 3
      pages/indexNew/indexNew.json
  10. 12
      pages/indexNew/indexNew.wxml
  11. 8
      pages/indexNew/indexNew.wxss
  12. 2
      pages/toRegister/toRegister.js
  13. 2
      project.config.json
  14. 57
      subpages/integralCentre/pages/index/index.js
  15. 8
      subpages/integralCentre/pages/index/index.wxml
  16. 11
      subpages/understandJs/pages/archives/archives.js
  17. 6
      subpages/understandJs/pages/archives/archives.wxml
  18. 14
      subpages/understandJs/pages/index/index.js
  19. 38
      utils/api.js

3
app.json

@ -67,7 +67,8 @@
"pages/gOfficialsList/gOfficialsList", "pages/gOfficialsList/gOfficialsList",
"pages/talklist/talklist", "pages/talklist/talklist",
"pages/eventlist/eventlist", "pages/eventlist/eventlist",
"pages/addTopic/addTopic" "pages/addTopic/addTopic",
"pages/guideInfo/guideInfo"
] ]
}, },
{ {

6
components/activity/activity.js

@ -1,8 +1,7 @@
var api = require("../../utils/activity.js") var api = require("../../utils/activity.js")
Component({ Component({
properties: { properties: {
state: Number state: Number,
}, },
data: { data: {
activityList: [], activityList: [],
@ -32,7 +31,7 @@ Component({
that.setData({ that.setData({
activityList: that.data.activityList.concat(res.data) activityList: that.data.activityList.concat(res.data)
}) })
console.log(res.data.length) //console.log(res.data.length)
//数据访问成功 //数据访问成功
var myEventDetail = { var myEventDetail = {
listLength: res.data.length listLength: res.data.length
@ -73,5 +72,4 @@ Component({
}) })
} }
} }
}) })

2
components/activity/activity.wxml

@ -25,7 +25,7 @@
<text>活动地点:{{item.actAddress}}</text> <text>活动地点:{{item.actAddress}}</text>
</view> </view>
</view> </view>
<view class="infos_nums"> <view class="infos_nums" wx:if="{{!(state==2&&item.actCurrentState=='4')}}">
<span wx:if="{{item.actQuotaCategory == 0}}" class="total">不限名额</span> <span wx:if="{{item.actQuotaCategory == 0}}" class="total">不限名额</span>
<span wx:else class="total">活动名额 {{item.actQuota}}人</span> <span wx:else class="total">活动名额 {{item.actQuota}}人</span>

BIN
images/home/call.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

23
pages/heartNew/heartNew.js

@ -277,7 +277,7 @@ Page({
let that = this let that = this
api.getImgUrl("0").then(function (res) { api.getImgUrl("0").then(function (res) {
that.setData({ that.setData({
getImgUrl: res.data[0].imgUrl getImgUrl: res.data[0]
}) })
}) })
}, },
@ -344,4 +344,25 @@ Page({
url: "/subpages/heart/pages/volunteer/volunteer" url: "/subpages/heart/pages/volunteer/volunteer"
}) })
}, },
//拨打电话
getPhone (e) {
// return false
wx.showModal({
title: "拨打电话",
content: "",
cancelColor: "#29B9A5",
confirmColor: "#29B9A5",
success: (res) => {
if (res.confirm) {
console.log("用户点击确定")
wx.makePhoneCall({
phoneNumber: e.currentTarget.dataset.number
})
} else if (res.cancel) {
console.log("用户点击取消")
}
}
})
}
}) })

4
pages/heartNew/heartNew.wxml

@ -14,8 +14,8 @@
<view class="belong-grid"> <view class="belong-grid">
<image class="belong-grid-bg" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7160-u6ATTx1AAEZrXGthow458.png" /> <image class="belong-grid-bg" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7160-u6ATTx1AAEZrXGthow458.png" />
<view class="newbelong-grid"> <view class="newbelong-grid">
<view class="grid"> <view class="grid" bindtap="getPhone" data-number="{{getImgUrl.remark}}">
<image src="{{getImgUrl}}" /> <image src="{{getImgUrl.imgUrl}}" />
</view> </view>
<view class="volunteer" bindtap="govolunteer"> <view class="volunteer" bindtap="govolunteer">
<image src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/09/rBAB717MhrKAB80nAAApr5c7VJQ292.png" /> <image src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/09/rBAB717MhrKAB80nAAApr5c7VJQ292.png" />

12
pages/heartNew/heartNew.wxss

@ -77,7 +77,7 @@ page {
.belong-grid .newbelong-grid { .belong-grid .newbelong-grid {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
/* align-items: center; */ align-items: flex-end;
justify-content: space-between; justify-content: space-between;
} }
@ -91,7 +91,7 @@ page {
} }
.belong-grid .newbelong-grid .grid { .belong-grid .newbelong-grid .grid {
margin-left: 21rpx; margin-left: 28rpx;
/* width: 90%; */ /* width: 90%; */
width: calc(100% - 234rpx); width: calc(100% - 234rpx);
height: 62rpx; height: 62rpx;
@ -102,14 +102,14 @@ page {
} }
.belong-grid .newbelong-grid .grid image { .belong-grid .newbelong-grid .grid image {
width: 100%; width: 532rpx;
height: 46rpx; height: 66rpx;
} }
.belong-grid .newbelong-grid .volunteer { .belong-grid .newbelong-grid .volunteer {
margin-right: 15rpx; margin-right: 15rpx;
width: 90rpx; width: 108rpx;
height: 62rpx; height: 68rpx;
position: relative; position: relative;
z-index: 100; z-index: 100;
display: flex; display: flex;

61
pages/indexNew/indexNew.js

@ -71,6 +71,9 @@ Page({
loadMoreType: "none", loadMoreType: "none",
loadMoreVisible: false, loadMoreVisible: false,
defaultGridId:"",//默认网格 defaultGridId:"",//默认网格
leaderGridId:"", //领导网格6.22
completeInfoDialogVisible: false, //完善信息
homePagePhone: {}
}, },
onShow: function () { onShow: function () {
if (wx.getStorageSync("token") != "" && wx.getStorageSync("token") != undefined && wx.getStorageSync("token") != null) { if (wx.getStorageSync("token") != "" && wx.getStorageSync("token") != undefined && wx.getStorageSync("token") != null) {
@ -126,6 +129,14 @@ Page({
// 获取默认网格 // 获取默认网格
this.getResidentConfig() this.getResidentConfig()
api.getHomePhone().then( res => {
if (res.code === 0 && res.msg === "success") {
this.data.homePagePhone = res.data[0]
this.setData({
homePagePhone: this.data.homePagePhone
})
}
})
}, },
// 获取默认网格 // 获取默认网格
getResidentConfig (){ getResidentConfig (){
@ -137,6 +148,10 @@ Page({
that.setData({ that.setData({
defaultGridId:item.residentValue defaultGridId:item.residentValue
}) })
} else if (item.residentType === "default_grid" && item.residentCode === "leader_grid") {
that.setData({
leaderGridId:item.residentValue
})
} }
}) })
} }
@ -415,6 +430,39 @@ Page({
}) })
} }
}, },
// 我有事阅 6.22
wysy () {
if(this.data.departmentId != this.data.leaderGridId){//领导网格处理
wx.showToast({
title: "无法使用该板块",
icon: "none",
duration: 3000
})
}else{
if (this.verifyCompleteInfo()) {
return false
}
api.getScrip().then(res => {
if (res.code === 0 && res.msg === "success") {
console.log("getScrip",res.data)
wx.navigateToMiniProgram({
appId: "wx3ea0a6fb71ddf659",
path: "pages/login/login?scrip="+res.data,
extraData: {
scrip: res.data
},
envVersion: "trial",//trial //develop
success (res) {
console.log(res)
},
fail (err) {
console.log(err)
}
})
}
})
}
},
dqhd () { dqhd () {
wx.navigateTo({ wx.navigateTo({
url: "../../subpages/associationNew/pages/associationlist/associationlist" url: "../../subpages/associationNew/pages/associationlist/associationlist"
@ -467,7 +515,7 @@ Page({
// return false // return false
wx.showModal({ wx.showModal({
title: "拨打电话", title: "拨打电话",
content: `您确定拨打${e.currentTarget.dataset.number}`, content: "",
cancelColor: "#29B9A5", cancelColor: "#29B9A5",
confirmColor: "#29B9A5", confirmColor: "#29B9A5",
success: (res) => { success: (res) => {
@ -481,5 +529,16 @@ Page({
} }
} }
}) })
},
// 检查 是否完善信息6.22
verifyCompleteInfo () {
if (app.globalData.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
})
return true
} else {
return false
}
} }
}) })

3
pages/indexNew/indexNew.json

@ -4,6 +4,7 @@
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"usingComponents": { "usingComponents": {
"nav-bar": "/components/navbar/index", "nav-bar": "/components/navbar/index",
"load-more": "../../components/loadMore/loadMore" "load-more": "../../components/loadMore/loadMore",
"complete-info-dialog": "../../components/completeInfoDialog/completeInfoDialog"
} }
} }

12
pages/indexNew/indexNew.wxml

@ -75,17 +75,21 @@
<view class="name" wx:else>0</view> <view class="name" wx:else>0</view>
</view> --> </view> -->
<!-- </view> --> <!-- </view> -->
<view class="newnotice" bindtap="getPhone" data-number="87875655"> <view class="newnotice" bindtap="getPhone" data-number="{{homePagePhone.remark}}">
<image class="image1" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/14/rBAB717t5zeAR7mBAAAe8_LOKr8883.png"></image> <image class="image1" src="{{homePagePhone.imgUrl}}"></image>
<image class="image-call" src="../../images/home/call.png"></image>
<!-- <image class="image2" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161AbyAfYVeAAAdNklNbvM579.png"></image> --> <!-- <image class="image2" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161AbyAfYVeAAAdNklNbvM579.png"></image> -->
<!-- <text></text> --> <!-- <text></text> -->
</view> </view>
<!-- 我有话说 --> <!-- 我有话说 -->
<view class="grid-all-new"> <view class="grid-all-new">
<button bindtap="wyss" class="weui-btn-left" form-type='submit' plain='true' hover-class="hover-btn"> <button bindtap="wyss" class="weui-btn-left" form-type='submit' plain='true' hover-class="hover-btn" wx:if="{{departmentId != leaderGridId}}">
<image src='https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161BRGARAefAAGNonPzguk041.png'></image> <image src='https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161BRGARAefAAGNonPzguk041.png'></image>
</button> </button>
<button bindtap="wysy" class="weui-btn-left" form-type='submit' plain='true' hover-class="hover-btn" wx:else>
<image src='https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/16/rBAB717xXhKATMiMAAAvjvVWdAA612.png'></image>
</button>
<view class="weui-btn-right"> <view class="weui-btn-right">
<button bindtap="goheart" class="weui-btn-top" form-type='submit' plain='true' hover-class="hover-btn"> <button bindtap="goheart" class="weui-btn-top" form-type='submit' plain='true' hover-class="hover-btn">
<image src='https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161BqiAGT25AADji64eXU8518.png'></image> <image src='https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161BqiAGT25AADji64eXU8518.png'></image>
@ -161,3 +165,5 @@
<!--加载更多提示--> <!--加载更多提示-->
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more> <load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
</view> </view>
<complete-info-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></complete-info-dialog>

8
pages/indexNew/indexNew.wxss

@ -243,8 +243,13 @@ page {
align-items: center; align-items: center;
} }
.image-call {
width: 126rpx;
height: 72rpx;
margin-left: 70rpx;
}
.newnotice .image1 { .newnotice .image1 {
width: 599rpx; width: 456rpx;
height: 50rpx; height: 50rpx;
} }
@ -419,6 +424,7 @@ page {
width: calc(100% - 42rpx); width: calc(100% - 42rpx);
margin-top: 29rpx; margin-top: 29rpx;
margin-left: 21rpx; margin-left: 21rpx;
margin-bottom: 29rpx;
} }
.grid-all-new .weui-btn-left { .grid-all-new .weui-btn-left {

2
pages/toRegister/toRegister.js

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

2
project.config.json

@ -65,7 +65,7 @@
"id": 0, "id": 0,
"name": "带参数二维码", "name": "带参数二维码",
"pathName": "pages/index/index", "pathName": "pages/index/index",
"query": "scene=1215152928323555330&inviteUserId=12345", "query": "scene=1277169327606366209&inviteUserId=12345",
"scene": 1011 "scene": 1011
}, },
{ {

57
subpages/integralCentre/pages/index/index.js

@ -1,7 +1,8 @@
// subpages/integralCentre/pages/index/index.js // subpages/integralCentre/pages/index/index.js
import { import {
pointsRecordlist, pointsRecordlist,
userPointsRankinglist userPointsRankinglist,
gradeRankinglist
} from "../../../../utils/api" } from "../../../../utils/api"
import { import {
getTimestamp getTimestamp
@ -30,11 +31,16 @@ Page({
type: "1", type: "1",
name: "街道排名", name: "街道排名",
select: false select: false
},
{
type: "2",
name: "等级排名",
select: false
} }
], ],
timestamp: getTimestamp(), timestamp: getTimestamp(),
loadMoreType: "none", loadMoreType: "none",
loadMoreVisible: false, loadMoreVisible: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -87,8 +93,11 @@ Page({
loadMoreType: "loading", loadMoreType: "loading",
loadMoreVisible: true, loadMoreVisible: true,
}) })
if ( e.currentTarget.dataset.type == "2") {
that.gradeRankinglist()
} else {
that.pointsRankinglist() that.pointsRankinglist()
}
}, },
// 积分记录-积分排行接口 // 积分记录-积分排行接口
@ -172,6 +181,11 @@ Page({
}, },
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
@ -200,11 +214,9 @@ Page({
this.setData({ this.setData({
loadMoreVisible: true loadMoreVisible: true
}) })
if (this.data.selectTab == "tab1") { if (this.data.selectTab == "tab1") {
// this.pointsRankinglist(); //积分排行 // this.pointsRankinglist(); //积分排行
} else { } else {
if (this.data.loadMoreType === "loading") { if (this.data.loadMoreType === "loading") {
this.setData({ this.setData({
pageIndex: this.data.pageIndex + 1, pageIndex: this.data.pageIndex + 1,
@ -217,6 +229,41 @@ Page({
} }
}, },
//6.28 等级排行榜
gradeRankinglist () {
let that = this
const para = {
pageIndex: 1,
pageSize: 20,
timestamp: getTimestamp()
}
gradeRankinglist(para).then(res => {
that.setData({
pointsRankingUser: res.data.currentUser,
pointsRankinglist: that.data.pointsRankinglist.concat(res.data.rank),
})
if (that.data.pointsRankinglist.length > 0) {
that.setData({
nodatapointsRanking: false,
loadMoreType: "none",
})
} else {
that.setData({
nodatapointsRanking: true,
loadMoreType: "none",
loadMoreVisible: false,
})
}
}).catch(err => {
that.setData({
pointsRankinglist: [],
nodatapointsRanking: true,
loadMoreType: "none",
loadMoreVisible: false,
})
console.log(err)
})
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */

8
subpages/integralCentre/pages/index/index.wxml

@ -24,9 +24,9 @@
<view class="list-number_frist">{{pointsRankingUser.rank}}</view> <view class="list-number_frist">{{pointsRankingUser.rank}}</view>
</view> </view>
<!-- 名字 --> <!-- 名字 -->
<view class="list-name">{{pointsRankingUser.realName}}</view> <view class="list-name">{{pointsRankingUser.realName||pointsRankingUser.nickName}}</view>
</view> </view>
<view class="right">{{pointsRankingUser.points}}</view> <view class="right">{{pointsRankingUser.points||pointsRankingUser.grade}}</view>
</view> </view>
<view class="warning">注:该排行仅显示已完善信息用户</view> <view class="warning">注:该排行仅显示已完善信息用户</view>
<!-- <view class="marginTop"></view> --> <!-- <view class="marginTop"></view> -->
@ -43,9 +43,9 @@
<view class="{{index < 3 ? 'list-number_frist' : 'list-number_'}} {{index===0 ? 'color1_' : index===1 ? 'color2_' : index===2 ? 'color2_' : ''}}">{{item.rank}}</view> <view class="{{index < 3 ? 'list-number_frist' : 'list-number_'}} {{index===0 ? 'color1_' : index===1 ? 'color2_' : index===2 ? 'color2_' : ''}}">{{item.rank}}</view>
</view> </view>
<!-- 名字 --> <!-- 名字 -->
<view class="list-name">{{item.realName}}</view> <view class="list-name">{{item.realName||item.nickName}}</view>
</view> </view>
<view class="right">{{item.points}}</view> <view class="right">{{item.points||item.grade}}</view>
</view> </view>
<no-data isShow="{{nodatapointsRanking}}"></no-data> <no-data isShow="{{nodatapointsRanking}}"></no-data>

11
subpages/understandJs/pages/archives/archives.js

@ -11,6 +11,9 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function () {
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
@ -59,5 +62,13 @@ Page({
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
},
searchFile () {
wx.showToast({
title: "未查询到相关档案",
icon: "none",
duration: 2000
})
} }
}) })

6
subpages/understandJs/pages/archives/archives.wxml

@ -5,7 +5,7 @@
<image src="../../images/search.png"></image> <image src="../../images/search.png"></image>
<input placeholder-class="placeholder-style" placeholder="输入档案关键字"></input> <input placeholder-class="placeholder-style" placeholder="输入档案关键字"></input>
</view> </view>
<button class="item-right">搜索</button> <button class="item-right" bindtap="searchFile">搜索</button>
</view> </view>
</view> </view>
</view> </view>
@ -13,7 +13,7 @@
<view class="list-item"> <!-- <view class="list-item">
<view class="list-name">玫瑰街道医疗物质采购档案</view> <view class="list-name">玫瑰街道医疗物质采购档案</view>
<view class="list-position"> <view class="list-position">
<image src="../../images/wenjian.png"></image> <image src="../../images/wenjian.png"></image>
@ -26,4 +26,4 @@
<image src="../../images/wenjian.png"></image> <image src="../../images/wenjian.png"></image>
<view class="list-position-name">存放位置:玫瑰街道档案室</view> <view class="list-position-name">存放位置:玫瑰街道档案室</view>
</view> </view>
</view> </view> -->

14
subpages/understandJs/pages/index/index.js

@ -85,14 +85,14 @@ Page({
url: `../sclerotia/sclerotia?modulecode=${e.currentTarget.dataset.modulecode}` url: `../sclerotia/sclerotia?modulecode=${e.currentTarget.dataset.modulecode}`
}) })
} else if (e.currentTarget.dataset.modulecode == "module_file") {//档案 } else if (e.currentTarget.dataset.modulecode == "module_file") {//档案
wx.showToast({ // wx.showToast({
title: "敬请期待", // title: '敬请期待',
icon: "none", // icon: 'none',
duration: 1000 // duration: 1000
})
// wx.navigateTo({
// url: '../archives/archives'
// }) // })
wx.navigateTo({
url: "../archives/archives"
})
} }
} }
}) })

38
utils/api.js

@ -52,7 +52,10 @@ module.exports = {
completePartyInfoV2: completePartyInfoV2, completePartyInfoV2: completePartyInfoV2,
userPointsRankinglist:userPointsRankinglist, userPointsRankinglist:userPointsRankinglist,
getDefaultGridInfo:getDefaultGridInfo, getDefaultGridInfo:getDefaultGridInfo,
getResidentConfig:getResidentConfig getResidentConfig:getResidentConfig,
getScrip:getScrip,
getHomePhone:getHomePhone,
gradeRankinglist:gradeRankinglist
} }
function getToken (wxCode) { function getToken (wxCode) {
@ -169,7 +172,7 @@ function changeGrid (gridId) {
* @param {*} param0 * @param {*} param0
*/ */
// function getUserInfo() { // function getUserInfo() {
// return fly.get("/app-user/user/getInfoById") // return fly.get('/app-user/user/getInfoById')
// } // }
function getUserInfo () { function getUserInfo () {
return fly.get("app-user/user/getInfoById") return fly.get("app-user/user/getInfoById")
@ -383,7 +386,7 @@ function clock (data) {
// * 志愿者认证 // * 志愿者认证
// */ // */
// function authenticate(data) { // function authenticate(data) {
// return fly.post("app-user/volunteer/authenticate", data) // return fly.post('app-user/volunteer/authenticate', data)
// } // }
/** /**
@ -485,3 +488,32 @@ function getDefaultGridInfo () {
function getResidentConfig () { function getResidentConfig () {
return fly.get("residentConfig/getResidentConfig") return fly.get("residentConfig/getResidentConfig")
} }
// *****************************获取临时凭证接口****6.22***************end
// 获取临时凭证用于跳转到数据端
function getScrip () {
return fly.post("admin/getScrip")
}
// 获取首页电话
function getHomePhone () {
return fly.get("imgConfig/getImgUrl/3")
}
/**
* 积分记录-等级排行接口 6.28
* timestamp String 第一页查询发起时的时间
* pageIndex Number 页码
* pageSize Number 页容量
*/
function gradeRankinglist ({
timestamp,
pageIndex,
pageSize
}) {
return fly.get("app-user/user/gradeRanking/list", {
timestamp,
pageIndex,
pageSize
})
}
Loading…
Cancel
Save