index.vue 10.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
<template>
	<view class="page">
		<view class="bgbg">
			<view class="loginOutIcon" @click="loginOut">
				<image src="@/static/switch.png"></image>
			</view>
			<view class="welcome">您好!
				{{memberInfo.name}}
				<br />欢迎使用中跆协会员管理系统
			</view>
			<view class="flexbox">
				<!-- userType 1:中跆协 2:省 3:市区 4:道馆-->
				<!-- 4 -->
				<view v-if="userType=='4'" @click="goAddVip">
					<image src="@/static/btn01.png" />
					添加会员
				</view>
				<view v-if="userType=='4'" @click="goPath('/pages/personalVip/payment')">
					<image src="@/static/btn02.png" />
					会员缴费
				</view>
				<!-- 3 2 1-->
				<view v-if="userType!='4'" @click="goPath('/pages/personalVip/audit')">
					<image src="@/static/btn03.png" />
					缴费审核
				</view>

				<!-- 都有 -->
				<view @click="goPath('/pages/personalVip/list')">
					<image src="@/static/btn04.png" />
					会员查询
				</view>
				<view v-if="userType!='4'" @click="goPath('/pages/group/list')">
					<image src="@/static/btn05.png" />团体会员
				</view>
			</view>

		</view>

		<view v-if="userType=='4'" class="girdBox">
			<view @click="goPath('/pages/personalVip/mobilize')">
				<image src="@/static/icon/1.png" />
				会员调动
			</view>
			<view @click="goPath('/pages/level/apply')">
				<image src="@/static/icon/3.png" />级位考试申请
			</view>
		</view>
		<view v-if="userType=='3'" class="girdBox">
			<view @click="goPath('/pages/group/apply/applyList')">
				<image src="@/static/icon/4.png" />团体会员审核
			</view>
			<view @click="goPath('/pages/level/approval')">
				<image src="@/static/icon/3.png" />级位考试审核
			</view>
		</view>
		<view v-if="userType=='2'" class="girdBox">
			<view @click="goPath('/pages/personalVip/mobilize')">
				<image src="@/static/icon/2.png" />
				会员调动审核
			</view>
			<view @click="goPath('/pages/personalVip/feeBill')">
				<image src="@/static/icon/6.png" />会员缴费单
			</view>
			<view @click="goPath('/pages/group/apply/applyList')">
				<image src="@/static/icon/4.png" />团体会员审核
			</view>
			<view @click="goPath('/pages/group/pay')">
				<image src="@/static/icon/9.png" />团体会员认证
			</view>

			<view @click="goPath('/pages/group/feeBill')">
				<image src="@/static/icon/17.png" />团体会员缴费单
			</view>
			<view @click="goPath('/pages/level/approval')">
				<image src="@/static/icon/3.png" />级位考试审核
			</view>
			<view @click="goPath('/pages/exam/payment?type=1')">
				<image src="@/static/icon/10.png" />级位考试缴费单
			</view>

			<view @click="goPath('/pages/index/more')">
				<image src="@/static/icon/m.png" />更多
			</view>
		</view>
		<view v-if="userType=='1'" class="girdBox">
			<view @click="goPath('/pages/personalVip/mobilize')">
				<image src="@/static/icon/2.png" />
				会员调动审核
			</view>
			<view @click="goPath('/pages/group/apply/applyList')">
				<image src="@/static/icon/4.png" />团体会员审核
			</view>
			<view @click="goPath('/pages/level/ztx/approval')">
				<image src="@/static/icon/2.png" />级位考试审核
			</view>
			<view @click="goPath('/pages/level/ztx/cert?type=1')">
				<image src="@/static/icon/18.png" />级位证书发布
			</view>
			<view @click="goPath('/pages/rank/approval?type=2')">
				<image src="@/static/icon/19.png" />段位考试审核
			</view>
			<view @click="goPath('/pages/rank/scoreApproval?type=2')">
				<image src="@/static/icon/19.png" />考段成绩审核
			</view>
			<view @click="goPath('/pages/level/ztx/cert?type=2')">
				<image src="@/static/icon/20.png" />考段证书发布
			</view>
			<view @click="goPath(`/pages/index/more?userType=${userType}`)">
				<image src="@/static/icon/m.png" />更多
			</view>
		</view>
		<uni-section title="待办提醒" padding>
			<template v-slot:right>
				<text @click="goMsgList" class="more">更多></text>
			</template>
			<view class="msglist">
				<view class="msgitem" v-for="n in messageList" @click="readMessage(n)">
					<text class="dot" :class="n.readFlag=='1'?'done':''"></text>
					<view class="tt esp">{{n.name}}</view>
					<view class="date">{{n.createTime}}</view>
				</view>
				<view class="nodata" v-if="messageList.length==0">
					<image mode="aspectFit" src="/static/nodata.png"></image>
					<text>暂无数据</text>
				</view>
			</view>
		</uni-section>
	</view>
</template>

<script setup>
	import * as api from '@/common/api.js';
	import * as loginServer from '@/common/login.js';
	import {
		onLoad,
		onShow,
		onReady,
		onPullDownRefresh
	} from '@dcloudio/uni-app';
	import {
		ref,
		getCurrentInstance
	} from 'vue';


	const {
		proxy
	} = getCurrentInstance()
	const app = getApp();
	const userType = ref('1')
	const memberInfo = ref({})

	let proId;
	const svId = ref(null);

	const messageList = ref([])
	onShow(() => {
		if (app.globalData.isLogin) {
			init()
		} else {
			app.firstLoadCallback = () => {
				init()
			};
		}
	})
	onLoad(option => {
		if (option.scene) {
			proId = decodeURIComponent(option.scene);
		} else {
			proId = option.proId;
		}
	});

	function loginOut() {
		uni.showModal({
			content: `确认退出吗?`,
			success: function(res) {
				if (res.confirm) {
					let path = '/pages/index/login';
					uni.reLaunch({
						url: path
					});
				}
			}
		})


	}

	function goPath(path) {
		uni.navigateTo({
			url: path
		});
	}

	function gologin() {
		let path = '/pages/index/login';
		uni.navigateTo({
			url: path
		});
	}

	function goCenter() {
		let path = '/pages/usercenter/usercenter';
		uni.navigateTo({
			url: path
		});

	}

	function goAddVip() {
		let path = '/pages/personalVip/addVip';
		uni.navigateTo({
			url: path
		});
	}

	function goRenew() {
		let path = '/pages/personalVip/renew';
		uni.navigateTo({
			url: path
		});
	}

	function init() {
		uni.showLoading({
			title: '加载中'
		});
		loginServer.getMyOwnMemberInfo().then(res => {
			userType.value = app.globalData.userType
			memberInfo.value = app.globalData.memberInfo
			console.log(userType.value, app.globalData.authenticationStatus)
			if (userType.value != '1' && app.globalData.authenticationStatus != '2' && app.globalData
				.authenticationStatus !=
				'4') {
				// 注册引导
				// uni.navigateTo({
				// 	url: '/pages/index/perfect'
				// });
			} else {
				getMes()
			}
			uni.hideLoading();
		})


	}

	function getMes() {
		uni.showLoading({
			title: '加载中'
		});
		api.getMessage({
			pageNum: 1,
			pageSize: 10
		}).then(res => {
			if (res.rows && res.rows.length > 0)
				for (var d of res.rows) {
					switch (d.type) {
						case 30001:
							d.name = '你有一条会员缴费等待审批,点击去处理!'
							d.path = '/pages/personalVip/audit'
							break
						case 30002:
							d.name = '你有一条级位考试等待审批,点击去处理!'
							d.path = '/pages/level/approval'
							break
						case 30003:
							d.name = '你有一条段位考试等待审批,点击去处理!'
							d.path = '/pages/rank/approval'
							break
						case 30004:
							d.name = '你有一条会员调动等待审批,点击去处理!'
							d.path = '/pages/personalVip/mobillize'
							break
						case 30005:
							d.name = '你有一条团体会员认证等待审批,点击去处理!'
							d.path = '/pages/group/pay'
							break
						case 30006:
							d.name = '你有一条段位成绩等待审批,点击去处理!'
							d.path = '/pages/rank/scoreApproval'
							break
						case 40001:
							d.name = '你有一条级位申请待提交,点击去处理!'
							d.path = `/pages/level/apply?id=${d.eventId}`
							break
						case 40002:
							d.name = '你有一条段位申请待提交,点击去处理!'
							d.path = `/pages/rank/apply?id=${d.eventId}`
							break
						case 40003:
							d.name = '你有一条成绩维护的数据待提交,点击去处理!'
							d.path = `/pages/rank/score/modify?id=${d.eventId}`
							break
						case 50001:
							d.name = '你有一条新的个人会员申请,点击去处理!'
							d.path = '/pages/personalVip/list'
							break
					}
				}
			messageList.value = res.rows
			uni.hideLoading();
		})
	}

	function readMessage(item) {
		uni.navigateTo({
			url: item.path
		});
		api.reader({
			id: item.id
		}).then(res => {
			item.readFlag = '1'
		})
	}

	function goMsgList() {
		let path = '/pages/index/msgList';
		uni.navigateTo({
			url: path
		});
	}

	function goItem(item) {
		if (item.path) {
			let path = item.path
			// if (checkUserPhone(path)) {
			uni.navigateTo({
				url: item.path
			});
			// }
		} else {
			uni.showToast({
				title: `暂未开放`,
				icon: 'none'
			});
		}

	}
</script>
<style scope lang="scss">
	.loginOutIcon {
		position: absolute;
		right: 30rpx;
		top: 30rpx;

		image {
			width: 50rpx;
			height: 50rpx;
		}
	}

	.welcome {
		padding: 55rpx;
		line-height: 55rpx;
		font-size: 36rpx;
	}

	.flexbox {
		display: flex;
		justify-content: space-around;
		text-align: center;

		image {
			width: 90rpx;
			height: 90rpx;
			display: block;
			margin: auto;
		}
	}

	.image {
		width: 25px;
		height: 25px;
	}

	.grid-item-box {
		flex: 1;
		// position: relative;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.grid-item-box-row {
		flex: 1;
		// position: relative;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.grid-dot {
		position: absolute;
		top: 5px;
		right: 15px;
	}

	:deep(.uni-section) {
		background-color: transparent;
	}

	:deep(.uni-section .uni-section-header__content) {
		font-size: 44rpx;
		font-weight: bold;
		color: #29343C;
	}
	:deep(.uni-section .uni-section-header){
		padding: 0 30rpx;
	}
	
</style>