Browse Source

演示环境,消息列表清空

jw-featrue-zhanlibiao
mk 2 years ago
parent
commit
9e48536a89
  1. 7
      app.json
  2. 20
      pages/index/index.js
  3. 4
      pages/index/index.wxml
  4. 16
      pages/login/login.js
  5. 5
      pages/work/work.js
  6. 8
      pages/work/work.wxml
  7. 9
      pages/work/work.wxss
  8. 9
      subpages/addResi/pages/addResi/addResi.js
  9. 2
      subpages/addResi/pages/addResi/addResi.json
  10. 2
      subpages/gatherInformation/pages/gatherInformation/gatherInformation.wxml
  11. 5
      subpages/searchResult/pages/searchRecords/searchRecords.js
  12. 6
      utils/api.js
  13. 2
      utils/config.js

7
app.json

@ -64,12 +64,7 @@
"iconPath": "images/home/work.png", "iconPath": "images/home/work.png",
"selectedIconPath": "images/home/workSelected.png" "selectedIconPath": "images/home/workSelected.png"
}, },
{
"pagePath": "pages/information/information",
"text": "数据",
"iconPath": "images/home/information.png",
"selectedIconPath": "images/home/informationSelected.png"
},
{ {
"pagePath": "pages/mine/mine", "pagePath": "pages/mine/mine",
"text": "我的", "text": "我的",

20
pages/index/index.js

@ -1,7 +1,7 @@
// index.js // index.js
// 获取应用实例 // 获取应用实例
const app = getApp() const app = getApp()
import {getIntelligentMessage,getToken,getStaffbasicinfo} from "../../utils/api" import {getIntelligentMessage,getToken,getStaffbasicinfo,clearMessage} from "../../utils/api"
Page({ Page({
data: { data: {
selectList:['全部信息','居民信息采集','房屋信息采集','社区满意度自查'], selectList:['全部信息','居民信息采集','房屋信息采集','社区满意度自查'],
@ -26,7 +26,9 @@ Page({
await this.getIntelligentMessage() await this.getIntelligentMessage()
await this.getStaffbasicinfo() await this.getStaffbasicinfo()
}, },
onShow(){
this.getStaffbasicinfo()
},
onScrollToLower(e){ onScrollToLower(e){
if (this.data.loadMoreType === 'more') { if (this.data.loadMoreType === 'more') {
this.setData({ this.setData({
@ -44,7 +46,6 @@ onScrollToLower(e){
}) })
const parm = { const parm = {
type:this.data.selectValue == 0? null :this.data.selectValue - 1, type:this.data.selectValue == 0? null :this.data.selectValue - 1,
readFlag:0,
limit:this.data.pageSize, limit:this.data.pageSize,
page:this.data.pageNo page:this.data.pageNo
} }
@ -102,6 +103,9 @@ onScrollToLower(e){
app.globalData.user = res.data app.globalData.user = res.data
}).catch(err=>{ }).catch(err=>{
console.log(err); console.log(err);
wx.navigateTo({
url: '/pages/login/login',
})
}) })
}, },
handleChangeFilter(e){ handleChangeFilter(e){
@ -110,5 +114,15 @@ onScrollToLower(e){
tableData:[], tableData:[],
}) })
this.getIntelligentMessage() this.getIntelligentMessage()
},
handelClickClear(){
clearMessage().then(res=>{
this.setData({
tableData:[]
})
this.getIntelligentMessage()
}).catch(err=>{
console.log(err);
})
} }
}) })

4
pages/index/index.wxml

@ -14,12 +14,12 @@
<view >{{selectValue == 1?'居民信息采集':selectValue == 2?'房屋信息采集':selectValue == 3?'社区满意度自查':'全部信息'}}</view> <view >{{selectValue == 1?'居民信息采集':selectValue == 2?'房屋信息采集':selectValue == 3?'社区满意度自查':'全部信息'}}</view>
</picker> </picker>
<image src="../../images/select.png" mode=""/></view> <image src="../../images/select.png" mode=""/></view>
<view class="delete"> <image src="../../images/delete.png" mode=""/> 全部已读</view> <view class="delete" bind:tap="handelClickClear"> <image src="../../images/delete.png" mode="" /> 全部已读</view>
</view> </view>
<view class="content"> <view class="content">
<scroll-view class="scroll" scroll-y="{{true}}" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower"> <scroll-view class="scroll" scroll-y="{{true}}" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="card" wx:for="{{tableData}}" wx:key="index" > <view class="card" wx:for="{{tableData}}" wx:key="index" >
<view class="title {{item.delFlag == '1'?'gray':''}}" >{{item.content}}</view> <view class="title {{item.readFlag != '1'?'':'gray'}}" >{{item.content}}</view>
<view class="type"> <view class="type">
<image src="../../images/resi.png" wx:if="{{item.msgType == 'resident_base_info'}}" mode=""/> <image src="../../images/resi.png" wx:if="{{item.msgType == 'resident_base_info'}}" mode=""/>
<image src="../../images/house.png" wx:if="{{item.msgType == 'community_house'}}" mode=""/> <image src="../../images/house.png" wx:if="{{item.msgType == 'community_house'}}" mode=""/>

16
pages/login/login.js

@ -90,9 +90,6 @@ Page({
}) })
return return
} }
wx.showLoading({
title:"登录中..."
})
const parm = { const parm = {
wxCode :'', wxCode :'',
...this.data.formData ...this.data.formData
@ -102,22 +99,19 @@ Page({
parm.wxCode = res.code parm.wxCode = res.code
console.log(parm.wxCode); console.log(parm.wxCode);
userLoginlog(parm).then((res)=>{ userLoginlog(parm).then((res)=>{
wx.hideLoading()
console.log(res); console.log(res);
if(res.code == 0){ if(res.code == 0){
wx.switchTab({ wx.switchTab({
url: '/pages/index/index', url: '/pages/index/index',
}) })
wx.setStorageSync('token', res.data.token) wx.setStorageSync('token', res.data.token)
}else{
wx.showToast({
title: res.msg,
icon:'none',
duration:2000
})
} }
}).catch(err=>{ }).catch(err=>{
wx.hideLoading() wx.showToast({
title: res.msg,
icon:'none',
duration:3000
})
console.log(err); console.log(err);
}) })
}, },

5
pages/work/work.js

@ -138,5 +138,10 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '/subpages/searchResult/pages/searchRecords/searchRecords', url: '/subpages/searchResult/pages/searchRecords/searchRecords',
}) })
},
toGatherInformation(){
wx.navigateTo({
url: '/subpages/gatherInformation/pages/gatherInformation/gatherInformation',
})
} }
}) })

8
pages/work/work.wxml

@ -12,7 +12,7 @@
<view class="inout_box"> <view class="inout_box">
<image src="../../images/work/search.png" mode=""/> <image src="../../images/work/search.png" mode=""/>
<input type="text" placeholder="{{setlectVal == 'resi'?'姓名/手机/身份证/住址等任意组合关键词':'输入小区/楼栋/单元/门牌号/房主等任意组合关键词'}}" bindblur="handelBlurKeyWord" value="{{keyWord}}" /> <input type="text" placeholder="{{setlectVal == 'resi'?'姓名/手机/身份证/住址等任意组合关键词':'输入小区/楼栋/单元/门牌号/房主等任意组合关键词'}}" bindblur="handelBlurKeyWord" value="{{keyWord}}" />
<view class="btn_box" bind:tap="handelClickSearch">搜索</view> <view class="btn_box" bind:tap="handelClickSearch"><text>搜索</text></view>
</view> </view>
<view class="jump" wx:if="{{setlectVal == 'resi'}}"> <view class="jump" wx:if="{{setlectVal == 'resi'}}">
<image style="height: 50rpx;width: 50rpx; margin-right: 11rpx;" src="../../images/work/card.png" mode=""/> <image style="height: 50rpx;width: 50rpx; margin-right: 11rpx;" src="../../images/work/card.png" mode=""/>
@ -32,7 +32,7 @@
<view class="top"> <view class="top">
<view class="title"> <view class="title">
<view>信息采集</view> <view>信息采集</view>
<text>采集记录></text> <text bind:tap="toGatherInformation">采集记录 ></text>
</view> </view>
<view class="tip "> <view class="tip ">
<image src="../../images/work/tx.png" mode=""/><view >关注官方公众号,可接受重要消息提醒。</view> <image src="../../images/work/tx.png" mode=""/><view >关注官方公众号,可接受重要消息提醒。</view>
@ -57,7 +57,7 @@
<image src="../../images/work/center.png" mode="" class="center_image"/> <image src="../../images/work/center.png" mode="" class="center_image"/>
</view> </view>
</view> </view>
<view class="bto"> <!-- <view class="bto">
<view class="title"> <view class="title">
<view>满意度自查</view> <view>满意度自查</view>
<text>历史自查></text> <text>历史自查></text>
@ -96,5 +96,5 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>

9
pages/work/work.wxss

@ -111,12 +111,17 @@ page {
} }
.header .content .inout_box .btn_box{ .header .content .inout_box .btn_box{
width: 69rpx; width: 69rpx;
height: 30rpx; height: 50rpx;
line-height: 30rpx;
position: absolute; position: absolute;
top: 24rpx; top: 24rpx;
right:30rpx; right:30rpx;
}
.header .content .inout_box .btn_box text{
width: 69rpx;
height: 30rpx;
line-height: 30rpx;
font-size: 28rpx; font-size: 28rpx;
box-sizing: border-box;
color:#3A80E7; color:#3A80E7;
padding-left: 15rpx; padding-left: 15rpx;
border-left:2rpx #3A80E7 solid ; border-left:2rpx #3A80E7 solid ;

9
subpages/addResi/pages/addResi/addResi.js

@ -386,7 +386,14 @@ Page({
if (this.data.isFirstLoadGrid) { if (this.data.isFirstLoadGrid) {
// 编辑回填逻辑 // 编辑回填逻辑
const id = this.data.form.gridId; const id = this.data.form.gridId;
const gridName = this.data.gridList.filter(item => item.value == id)[0].label; const temp = this.data.gridList.filter(item => item.value == id);
const gridName = ''
if(temp.length != 0){
gridName = temp[0].label
}else{
this.showToast('网格信息有误')
return
}
this.setData({ this.setData({
'form.gridName': gridName, 'form.gridName': gridName,
"form.gridId": id "form.gridId": id

2
subpages/addResi/pages/addResi/addResi.json

@ -1,7 +1,5 @@
{ {
"usingComponents": { "usingComponents": {
"wux-cell-group": "../../../../components/dist/cell-group",
"wux-cell": "../../../../components/dist/cell",
"wux-select": "../../../../components/dist/select" "wux-select": "../../../../components/dist/select"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"

2
subpages/gatherInformation/pages/gatherInformation/gatherInformation.wxml

@ -11,7 +11,7 @@
<text wx:else>请选择时间</text> <text wx:else>请选择时间</text>
</view> </view>
<image src="../images/down.png" mode="" wx:if="{{!form.collectEndDate}}"/> <image src="../images/down.png" mode="" wx:if="{{!form.collectEndDate}}"/>
<image src="../images/del.png" bind:tap="handelDel" style="width: 35rpx;height: 35rpx;" mode="" wx:else /> <image src="../images/del.png" catch:tap="handelDel" style="width: 35rpx;height: 35rpx;" mode="" wx:else />
</view> </view>
</view> </view>
<view class="btn" bind:tap="handleClickfilter">筛选</view> <view class="btn" bind:tap="handleClickfilter">筛选</view>

5
subpages/searchResult/pages/searchRecords/searchRecords.js

@ -113,5 +113,10 @@ Page({
this.setData({ this.setData({
SearchRecordsList:[] SearchRecordsList:[]
}) })
},
back(){
wx.navigateBack({
delta: 1
})
} }
}) })

6
utils/api.js

@ -26,12 +26,16 @@ module.exports = {
saveCommunityHouse, saveCommunityHouse,
updateCommunityHouse, updateCommunityHouse,
getClearHouseDeatilById, getClearHouseDeatilById,
getCollect getCollect,
clearMessage
} }
// 消息列表 // 消息列表
function getIntelligentMessage(param){ function getIntelligentMessage(param){
return fly.get(`message/intelligentMessage/page`,param) return fly.get(`message/intelligentMessage/page`,param)
} }
function clearMessage () {
return fly.post('message/intelligentMessage/msg/clear')
}
/** /**
*小程序用户登录 *小程序用户登录
*/ */

2
utils/config.js

@ -7,7 +7,7 @@ module.exports = {
function BASEURL() { function BASEURL() {
// return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 正式环境 // return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 正式环境
return 'http://192.168.1.144/api/' // 测试环境 return 'https://epmet-preview.elinkservice.cn/api/' // 测试环境
} }
function WEBROOT() { function WEBROOT() {

Loading…
Cancel
Save