| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568 |
- <template>
- <view class="content">
- <view class="self-inf">
- <view class="antu-box">
- <view class="img-name-box">
- <image :src="userHeadImg" class="heade-img" mode="aspectFill"></image>
- <p class="nickname">{{userNickName}}</p>
- <p class="nickname">{{userPhone}}</p>
- </view>
- <view class="org-info-box" v-for="(item,index) in userPosList" :key="index">
- <view class="org-info">{{item.name || '-'}}</view>
- <!-- <view class="org-line"></view> -->
- <view class="org-info">{{item.position}}</view>
- </view>
- </view>
- <!-- <view class="img-name-box" v-if="!isAuth" style="height: 180rpx;">
- <image src="/static/auth-icon.png" class="heade-img" mode="aspectFill" style="margin-left: 80rpx;"></image>
- <button @click="goAuthPage()" class="auth-btn">授权登录</button>
- </view> -->
- </view>
-
- <view>
- <view class="active-title-box">
- <picker :range="arrayYear" :value="dateYear" @change="bindDateChange" class="picker-class" style="margin-left: 2%; width: 15%;">
- <view class="uni-input display-between items-center">
- <view>{{dateYear}}<text v-if="dateYear!=='全部'">年</text></view>
- <image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image>
- </view>
- </picker>
- <picker :range="arrayMonth" :value="dateMonth" @change="bindDateMonthChange" class="picker-class" style="margin-left: 2%; width: 10%;">
- <view class="uni-input display-between items-center" style="color: #707070;">
- <view>{{dateMonth}}<text v-if="dateMonth!=='全部'">月</text></view>
- <image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image>
- </view>
- </picker>
- <picker @change="bindPickerChange" :value="branchValue" :range="branchArray" :range-key="'name'">
- <view class="uni-input">{{branchValue}}</view>
- <image src="/static/arrow_down.svg" mode="aspectFit"></image>
- </picker>
- <button @click="publish()">+发布活动</button>
- </view>
-
- <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
- <view class="active-box" v-for="(item,index) in activiList" :key="index" @click="goList(item.id)">
- <view class="active-type" :class="{'bg-yellow':item.type == '组织建设' ,'bg-red':item.type == '学习培训','bg-blue':item.type == '参政议政','bg-gray':item.type == '社会活动'}" >
- <view style="width: 55%;">{{item.type}}</view>
- </view>
- <view class="active-content-box">
- <view class="active-content">
- <view class="active-name">{{item.name}}</view>
- </view>
- <view class="active-content" >
- <view style="margin-right:10rpx;">{{item.branch}}</view>
- <view class="author-box">{{item.author}}</view>
- <view style="margin-left:10rpx;">记录数:({{item.process_count}}/
- <text :class="{fontRed:item.process_unread_count!=0}">{{item.process_unread_count}}</text>)</view>
- </view>
- <view class="active-content" style="justify-content: space-between;">
- <view class="active-date">{{item.start_time}}</view>
- <view class="edit-icon-box">
- <image src="/static/edit-icon.png" mode="aspectFit" v-show="item.edit_auth" @click.stop="goEditPage(item.id)" style="margin-right: 10rpx;"></image>
- <image src="/static/del-icon.png" mode="aspectFit" v-show="item.del_auth" @click.stop="delActive(item.id)"></image>
- </view>
- </view>
- </view>
- <!-- <view class="edit-icon-box">
- <image src="/static/edit-icon.png" mode="aspectFit" v-show="item.edit_auth" @click.stop="goEditPage(item.id)" style="margin-right: 20rpx;"></image>
- <image src="/static/del-icon.png" mode="aspectFit" v-show="item.del_auth" @click.stop="delActive(item.id)"></image>
- </view> -->
- </view>
- </mescroll-body>
-
- </view>
- </view>
- </template>
- <script>
- import md5 from "@/common/md5.js";
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- components: {
- },
- mixins: [MescrollMixin], // 使用mixin
- data() {
- return {
- dateYear:'全部',
- arrayYear:[],
- dateMonth:'全部',
- arrayMonth:['全部',"1","2","3","4","5","6","7","8","9","10","11","12"],
- userHeadImg: getApp().globalData.user_headUrl,
- userNickName:getApp().globalData.user_name,
- userPhone:getApp().globalData.user_phone.substr(0, 3) + '****' + getApp().globalData.user_phone.substr(7),
- userPosList:[],
- branchArray: [],
- branchValue:'全部',
- branchId:'0',
- page:1,
- pageSize:10,
- activiList:[]
- };
- },
- onShow() {
- // this.getActiveList(this.branchId)
- },
- onLoad(option) {
- this.getUserInfoBranch()
- this.getActiveInfoBranch()
- this.makeYearArr()
- },
- methods: {
- makeYearArr(){
- let nowYear = new Date().getFullYear(),yearList = ['全部'];
- for(let i = 0; i < 10 ; i ++){
- yearList.push(nowYear--)
- }
- this.arrayYear = yearList;
- },
- pageRefresh(object) {
- if (object) {
- this.getActiveList(this.branchId)
- } else {
- return
- }
- },
- getUserInfoBranch() {
- let md5Sign = md5(
- "method=" + "member" +"×tamp=" + getApp().globalData.globalTimestamp +"&secret=" +getApp().globalData.secret
- );
- let url =
- getApp().globalData.shareUrl + "api/api.php" + "?method=member&action=my_branch×tamp=" + getApp().globalData.globalTimestamp +
- "&sign=" + md5Sign;
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: {
- openid:getApp().globalData.open_id,
- },
- success: (res) => {
- if (res.data.code === 200) {
- this.userPosList = res.data.data;
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- goEditPage(id){
- uni.navigateTo({
- url:'edit_page?id=' + id
- })
- },
- delActiveRequeset(delId){
- let md5Sign = md5(
- "method=" +"activity" + "×tamp=" + getApp().globalData.globalTimestamp +
- "&secret=" + getApp().globalData.secret
- );
- let url = getApp().globalData.shareUrl +"api/api.php" +
- "?method=activity&action=del×tamp=" +
- getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: {
- openid: getApp().globalData.open_id,
- id:delId
- },
- success: (res) => {
- if (res.data.code === 200) {
- uni.showToast({
- title: "删除成功",
- icon: "none",
- duration: 2500,
- success:()=>{
- this.getActiveList(this.branchId)
- }
- });
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- delActive(id){
- let that = this;
- uni.showModal({
- title: "确定删除此活动吗?",
- success(res) {
- if (res.confirm) {
- that.delActiveRequeset(id);
- } else if (res.cancel) {
- console.log("用户点击取消");
- }
- },
- });
- },
- getActiveInfoBranch() {
- let md5Sign = md5("method=" + "activity" +"×tamp=" + getApp().globalData.globalTimestamp +"&secret=" +getApp().globalData.secret);
- let url =
- getApp().globalData.shareUrl + "api/api.php" + "?method=activity&action=list_branch×tamp=" + getApp().globalData.globalTimestamp +
- "&sign=" + md5Sign;
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: {
- openid:getApp().globalData.open_id,
- },
- success: (res) => {
- if (res.data.code === 200) {
- let obj = {
- name:'全部',
- id:'0'
- }
- let arr = res.data.data;
- arr.unshift(obj);
- this.branchArray = arr;
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- bindDateChange(e){
- this.dateYear = this.arrayYear[e.target.value];
- this.getActiveList(this.branchId)
- },
- bindDateMonthChange(e){
- this.dateMonth = this.arrayMonth[e.target.value];
- this.getActiveList(this.branchId)
- },
- bindPickerChange: function(e) {
- this.branchValue = this.branchArray[e.target.value].name;
- this.branchId = this.branchArray[e.target.value].id;
- this.getActiveList(this.branchId)
- },
- getActiveList(bId){
- let md5Sign = md5(
- "method=" +"activity" + "×tamp=" + getApp().globalData.globalTimestamp +
- "&secret=" + getApp().globalData.secret
- );
- let url = getApp().globalData.shareUrl +"api/api.php" +
- "?method=activity&action=list×tamp=" +
- getApp().globalData.globalTimestamp +
- "&sign=" +
- md5Sign;
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: {
- openid: getApp().globalData.open_id,
- year:this.dateYear,
- month:this.dateMonth,
- s:'',
- branch_id:bId,
- page:this.page,
- page_size:this.pageSize
- },
- success: (res) => {
- if (res.data.code === 200) {
- this.activiList=res.data.data.list;
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- upCallback(page) {
- console.log(666)
- let pageNum = page.num; // 页码, 默认从1开始
- let pageSize = page.size; // 页长, 默认每页10条
- let md5Sign = md5(
- "method=" +"activity" + "×tamp=" + getApp().globalData.globalTimestamp +
- "&secret=" + getApp().globalData.secret
- );
- let url = getApp().globalData.shareUrl +"api/api.php" +
- "?method=activity&action=list×tamp=" +
- getApp().globalData.globalTimestamp +
- "&sign=" +
- md5Sign;
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: {
- openid: getApp().globalData.open_id,
- year:this.dateYear,
- month:this.dateMonth,
- s:'',
- branch_id:this.branchId,
- page:pageNum,
- page_size:pageSize
- },
- success: (res) => {
- if (res.data.code === 200) {
- // 接口返回的当前页数据列表 (数组)
- let curPageData = res.data.data.list;
- // 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
- let curPageLen = curPageData.length;
- // 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
- let totalPage = res.data.data.page_count;
- // 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
- let totalSize = res.data.data.count;
- // // 接口返回的是否有下一页 (true/false)
- // let hasNext = data.xxx;
- if(page.num == 1) this.activiList = []; //如果是第一页需手动制空列表
- // let list = res.data.data.list;
- // list.forEach((item)=>{
- // item.pic_url = this.shareUrl + item.pic_url;
- // item.pic_url_resize = this.shareUrl + item.pic_url_resize;
- // })
- this.activiList=this.activiList.concat(res.data.data.list); //追加新数据
- this.mescroll.endByPage(curPageLen || 0, totalPage);
- }
- },
- fail: () => {
- console.log("连接失败");
- this.mescroll.endErr();
- },
- });
- },
- getPublishBranch() {
- let md5Sign = md5(
- "method=" +"activity" + "×tamp=" + getApp().globalData.globalTimestamp +
- "&secret=" +getApp().globalData.secret
- );
- let url = getApp().globalData.shareUrl +"api/api.php" +
- "?method=activity&action=activity_branch×tamp=" +
- getApp().globalData.globalTimestamp +"&sign=" + md5Sign;
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: {
- openid:getApp().globalData.open_id,
- },
- success: (res) => {
- if (res.data.code === 200) {
- let publishList = res.data.data;
- if(publishList.length >= 2){
- uni.navigateTo({
- url:'./create1?list=' + JSON.stringify(publishList)
- })
- }else {
- uni.navigateTo({
- url:'./create2?list=' + JSON.stringify(publishList)
- })
- }
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- publish(){
- this.getPublishBranch()
- },
- goList(ids){
- uni.navigateTo({
- url:'./list?id='+ ids
- })
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- .content {
- display: flex;
- flex-direction: column;
- .self-inf {
- // border-radius: 0rpx 0rpx 100% 100%;
- .img-name-box {
- height: 150rpx;
- margin-top: 20rpx;
- margin-bottom: 20rpx;
- display: flex;
- align-items: center;
- width: 85%;
- .auth-btn {
- margin-left: 30rpx;
- margin-top: 20rpx;
- font-size: 28rpx;
- background-color: #02a7f0;
- color: #fff;
- }
- .heade-img {
- z-index: 1;
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- // margin-left: 80rpx;
- }
- }
- .nickname {
- font-weight: 600;
- font-size: 28rpx;
- margin-left: 30rpx;
- margin-top: 20rpx;
- color: #555;
- letter-spacing: 1rpx;
- }
- }
- }
- .antu-box {
- display: flex;
- flex-direction: column;
- align-items: center;
- background: #fff;
- margin-left: 5%;
- margin-top: 50rpx;
- border-radius: 10rpx;
- width: 90%;
- color: #555;
- box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.2);
- }
- .org-info-box {
- display: flex;
- justify-content: space-evenly;
- height: 80rpx;
- align-items: center;
- width: 100%;
- border-top: 1px solid #d4d4d4;
- color: #555;
- font-size: 28rpx;
- background: #fff;
- }
- .org-info {
- width: 50%;
- padding-left: 10%;
- }
- .org-line {
- width: 1px;
- height: 82rpx;
- background: #d4d4d4;
- }
- .active-title-box {
- display: flex;
- align-items: center;
- margin-top: 10rpx;
- font-size: 26rpx;
- height: 100rpx;
- border-bottom: 1px solid #d7d7d7;
- margin-top: 10rpx;
- .time-select-box {
- width: 32%;
- margin-left: 5%;
- }
- picker {
- width: 29%;
- border: 1px solid #d7d7d7;
- height: 60rpx;
- line-height: 60rpx;
- border-radius: 10rpx;
- margin-left: 20rpx;
- padding: 0 10rpx;
- position: relative;
- image {
- width: 20rpx;
- height: 20rpx;
- position: absolute;
- top: 11px;
- right: 5px;
- }
- }
- button {
- width: 25%;
- font-size: 25rpx;
- background: #4988fd;
- color: #fff;
- margin-left: 20rpx;
- margin-right: 20rpx;
- }
- }
- .active-box {
- display: flex;
- align-items: flex-start;
- position: relative;
- font-size: 28rpx;
- padding: 20rpx;
- border-bottom: 1px solid #d7d7d7;
- .active-type {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- background-color: aquamarine;
- text-align: center;
- display: flex;
- align-items: center;
- font-size: 26rpx;
- color: #fff;
- justify-content: center;
- }
- .active-content-box {
- width:83%;
- // height: 120rpx;
- display: flex;
- flex-direction: column;
- margin-left: 20rpx;
- justify-content: space-around;
- }
- .active-content {
- display: flex;
- align-items: center;
- // height: 45rpx;
- font-size: 26rpx;
- .author-box {
- border-left: 1px solid #d7d7d7;
- border-right: 1px solid #d7d7d7;
- padding: 0 30rpx 0 30rpx;
- margin: 0 20rpx 0 20rpx;
- }
- .active-name {
- font-size: 30rpx;
- margin-right: 10rpx;
- }
- .active-date {
- font-size: 24rpx;
- color: #ccc;
- }
- }
- .edit-icon-box {
- // position: absolute;
- // right: 10px;
- // top: 10px;
- // margin-top: 10rpx;
- image {
- width: 30rpx;
- height: 30rpx;
- }
- }
- .bg-yellow {
- background-color: #ffdd40;
- }
- .bg-gray {
- background-color: darkgrey;
- }
- .bg-red {
- background-color: #ec808d;
- }
- .bg-blue {
- background-color: #81d3f8;
- }
- .fontRed {
- color: red;
- }
- }
- </style>
|