| | |
| | | // app.ts |
| | | App({ |
| | | globalData: { |
| | | url:'https://qyqjzdd.cdqingyang.gov.cn/qyjz', |
| | | // url:'http://192.168.3.220:8080', |
| | | // url:'https://qyqjzdd.cdqingyang.gov.cn/qyjz', |
| | | url:'http://192.168.3.220:8080', |
| | | // url:'http://221.237.182.28:8443/api', |
| | | imageUrl:'https://qyqjzdd.cdqingyang.gov.cn/minio' |
| | | // imageUrl:'http://192.168.3.220:8080/minio' |
| | |
| | | } |
| | | }, |
| | | allPick() { |
| | | wx.request( |
| | | { |
| | | url: groupBanSpeech.globalData.url + "/wx/group/member/allBanSpeech", |
| | | method: "GET", |
| | | data: { |
| | | id: this.data.groupId |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | wx.showToast({ |
| | | icon: "none", |
| | | title: '禁言成功!', |
| | | }) |
| | | |
| | | this.setData({ |
| | | checkedAll : !this.data.checkedAll |
| | | }) |
| | | console.log(this.data.checkedAll); |
| | | |
| | | wx.request( |
| | | { |
| | | url: groupBanSpeech.globalData.url + "/wx/group/member", |
| | | method: "GET", |
| | | data: { |
| | | id: this.data.groupId |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | for (let index = 0; index < res.data.data.memberList.length; index++) { |
| | | if (res.data.data.memberList[index].pic != null) { |
| | | res.data.data.memberList[index].pic = groupBanSpeech.globalData.imageUrl + "/img/" + res.data.data.memberList[index].pic; |
| | | } |
| | | } |
| | | this.setData({ |
| | | memberList: res.data.data.memberList, |
| | | managerList: res.data.data.managerMemberList, |
| | | memberConut: res.data.data.memberCount, |
| | | managerCount: res.data.data.managerMemberCount |
| | | }) |
| | | console.log(this.data.memberList) |
| | | } |
| | | if (this.data.checkedAll) { |
| | | wx.request( |
| | | { |
| | | url: groupBanSpeech.globalData.url + "/group/banSpeechRemark?id="+this.data.groupId, |
| | | method: "PUT", |
| | | // data: { |
| | | // id: this.data.groupId |
| | | // }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | wx.showToast({ |
| | | icon: "none", |
| | | title: '允许发言!', |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.setData({ |
| | | checkedAll : !this.data.checkedAll |
| | | }) |
| | | console.log(this.data.checkedAll); |
| | | |
| | | wx.request( |
| | | { |
| | | url: groupBanSpeech.globalData.url + "/wx/group/member", |
| | | method: "GET", |
| | | data: { |
| | | id: this.data.groupId |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | for (let index = 0; index < res.data.data.memberList.length; index++) { |
| | | if (res.data.data.memberList[index].pic != null) { |
| | | res.data.data.memberList[index].pic = groupBanSpeech.globalData.imageUrl + "/img/" + res.data.data.memberList[index].pic; |
| | | } |
| | | } |
| | | this.setData({ |
| | | memberList: res.data.data.memberList, |
| | | managerList: res.data.data.managerMemberList, |
| | | memberConut: res.data.data.memberCount, |
| | | managerCount: res.data.data.managerMemberCount |
| | | }) |
| | | console.log(this.data.memberList) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | wx.request( |
| | | { |
| | | url: groupBanSpeech.globalData.url + "/wx/group/member/allBanSpeech", |
| | | |
| | | method: "GET", |
| | | data: { |
| | | id: this.data.groupId |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | wx.showToast({ |
| | | icon: "none", |
| | | title: '禁言成功!', |
| | | }) |
| | | |
| | | this.setData({ |
| | | checkedAll : !this.data.checkedAll |
| | | }) |
| | | console.log(this.data.checkedAll); |
| | | |
| | | wx.request( |
| | | { |
| | | url: groupBanSpeech.globalData.url + "/wx/group/member", |
| | | method: "GET", |
| | | data: { |
| | | id: this.data.groupId |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | for (let index = 0; index < res.data.data.memberList.length; index++) { |
| | | if (res.data.data.memberList[index].pic != null) { |
| | | res.data.data.memberList[index].pic = groupBanSpeech.globalData.imageUrl + "/img/" + res.data.data.memberList[index].pic; |
| | | } |
| | | } |
| | | this.setData({ |
| | | memberList: res.data.data.memberList, |
| | | managerList: res.data.data.managerMemberList, |
| | | memberConut: res.data.data.memberCount, |
| | | managerCount: res.data.data.managerMemberCount |
| | | }) |
| | | console.log(this.data.memberList) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | pick(e) { |
| | | console.log(e); |
| | |
| | | </view> |
| | | </view> --> |
| | | <view class="manager"> |
| | | <view> |
| | | <view class="wenzi">群成员 ({{memberConut}})人</view> |
| | | <view class="title"> |
| | | <view >群成员 ({{memberConut}})人</view> |
| | | <van-checkbox value="{{ checkedAll }}" bind:change="allPick" class="radio">全选</van-checkbox> |
| | | <!-- <radio bindtap="allPick" color="red" class="radio">全选</radio> --> |
| | | </view> |
| | |
| | | background-color: #F5F5F9; |
| | | height: 40px; |
| | | } |
| | | .radio{ |
| | | float: right; |
| | | margin-top: -8%; |
| | | .title{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding: 0 0.5rem; |
| | | height: 40px; |
| | | background-color: #F5F5F9; |
| | | align-items: center; |
| | | } |
| | | .name{ |
| | | font-size: 14px; |
| | |
| | | // index.ts |
| | | // 获取应用实例 |
| | | const groupPublicty = getApp() |
| | | |
| | | import Dialog from '@vant/weapp/dialog/dialog'; |
| | | Page({ |
| | | data: { |
| | | groId:'', |
| | | value:'', |
| | | show: false, |
| | | causeList:[], |
| | | isShow:false |
| | | }, |
| | | causeListAdd(){ |
| | | ondel(event) { |
| | | console.log(event); |
| | | |
| | | let that=this |
| | | const { position, instance } = event.detail; |
| | | switch (position) { |
| | | case 'left': |
| | | case 'cell': |
| | | instance.close(); |
| | | break; |
| | | case 'right': |
| | | Dialog.confirm({ |
| | | message: '确定删除吗?', |
| | | }).then(() => { |
| | | that.delCalist(event) |
| | | instance.close(); |
| | | }).catch(() => { |
| | | instance.close(); |
| | | }); |
| | | break; |
| | | } |
| | | }, |
| | | delCalist(e){ |
| | | wx.request( |
| | | { |
| | | url:groupPublicty.globalData.url+"/wx/announcement/delete?id="+e.target.dataset.id.id, |
| | | method:"DELETE", |
| | | // data:{ |
| | | // announcement:this.data.value, |
| | | // groupId:Number(this.data.groId) |
| | | |
| | | // }, |
| | | header:{'token':wx.getStorageSync('token')}, |
| | | success:(res)=>{ |
| | | console.log(res) |
| | | this.getList() |
| | | } |
| | | }) |
| | | }, |
| | | getUserInfo(event) { |
| | | console.log(event.detail); |
| | | wx.request( |
| | | { |
| | | url:groupPublicty.globalData.url+"/wx/announcement/add?announcement="+this.data.value+"&groupId="+this.data.groId, |
| | | method:"POST", |
| | | // data:{ |
| | | // announcement:this.data.value, |
| | | // groupId:Number(this.data.groId) |
| | | |
| | | // }, |
| | | header:{'token':wx.getStorageSync('token')}, |
| | | success:(res)=>{ |
| | | console.log(res) |
| | | this.setData({ |
| | | value:'' |
| | | }) |
| | | this.getList() |
| | | } |
| | | }) |
| | | }, |
| | | onChange(event) { |
| | | // event.detail 为当前输入的值 |
| | | console.log(event.detail); |
| | | this.setData({ |
| | | value:event.detail |
| | | }) |
| | | }, |
| | | onClose() { |
| | | this.setData({ show: false , |
| | | value:''}); |
| | | }, |
| | | addCause(){ |
| | | this.setData({ show: true }); |
| | | }, |
| | | getList(){ |
| | | wx.request( |
| | | { |
| | | url:groupPublicty.globalData.url+"/group/getAllNotice", |
| | | method:"GET", |
| | | data:{ |
| | | id:this.data.groId |
| | | }, |
| | | header:{'token':wx.getStorageSync('token')}, |
| | | success:(res)=>{ |
| | | console.log(res) |
| | | this.setData({ |
| | | causeList:res.data.data |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 事件处理函数 |
| | | onLoad(e) { |
| | | console.log(e); |
| | | this.setData({ |
| | | groId:e.id |
| | | }) |
| | | wx.request( |
| | | { |
| | | url:groupPublicty.globalData.url+"/group/getAllNotice", |
| | |
| | | <view class="content"> |
| | | <van-dialog id="van-dialog" /> |
| | | <van-empty class="empty" description="暂无数据" wx:if="{{causeList.length === 0}}"></van-empty> |
| | | <view class="foot"> <button class="button" bindtap="addCause">新 增 群 公 告</button></view> |
| | | <van-dialog use-slot title="群公告" show="{{ show }}" show-cancel-button bind:close="onClose" bind:confirm="getUserInfo"> |
| | | <van-field value="{{ value }}" placeholder="请输入群公告" border="{{ false }}" bind:change="onChange" /> |
| | | </van-dialog> |
| | | <view class="lists" wx:for="{{causeList}}" wx:key="id"> |
| | | <van-swipe-cell class="list-swipe" id="swipe-cell" right-width="{{ 65 }}" async-close bind:close="ondel" data-id="{{item}}"> |
| | | <view class="item2"> |
| | | <image class="icon" src="../../../../icon/notice.png"></image> |
| | | <span class="content">群公告</span> |
| | | <view class="item">{{item.ctime}}</view> |
| | | </view> |
| | | |
| | | <view class="item3">{{item.text}}</view> |
| | | |
| | | <!-- <van-button type="info" bind:click="causeListAdd">添加</van-button> --> |
| | | <image class="icon" src="../../../../icon/notice.png"></image> |
| | | <span class="content">群公告</span> |
| | | <view class="item">{{item.ctime}}</view> |
| | | </view> |
| | | |
| | | <view class="item3">{{item.text}}</view> |
| | | <view slot="right">删除</view> |
| | | </van-swipe-cell> |
| | | |
| | | |
| | | <!-- <van-button type="info" bind:click="causeListAdd">添加</van-button> --> |
| | | </view> |
| | | </view> |
| | |
| | | font-size: 14px; |
| | | margin-bottom: 2%; |
| | | } |
| | | .foot{ |
| | | position: absolute; |
| | | bottom: 1rem; |
| | | width: 90%; |
| | | padding: 1rem; |
| | | } |
| | | .button{ |
| | | /* margin-top: 60%; */ |
| | | font-size: 13px; |
| | | color: #fff; |
| | | background-color: #6699ff; |
| | | border: 1px solid #6699ff; |
| | | } |
| | | .van-swipe-cell__right{ |
| | | padding: 0.7rem; |
| | | width: 100%; |
| | | background-color: red; |
| | | color: #FFF; |
| | | } |