Ver Fonte

2020/06/01

yinchengnuo há 4 anos atrás
pai
commit
f8316301d3

+ 1 - 0
App.vue

@@ -9,6 +9,7 @@
 			choosedAddress: null
 		},
 		async onLaunch () {  //app 初始化
+			uni.loading = () => uni.showLoading({ mask: true, title: '加载中' })
 			if (!uni.getStorageSync('warn')) {
 				uni.setStorageSync('warn', 'false')
 			}

+ 10 - 1
api.js

@@ -40,4 +40,13 @@ export const api_getPerRecond = '/gift/per_record'  //获取代理公司兑换
 
 
 export const api_getTotalJoinNum = '/data/per_num'  //获取当前赛季总参赛人数
-export const api_getTeamJoinNum = '/data/team_num'  //获取团队参赛数量信息
+export const api_getTeamJoinNum = '/data/team_num'  //获取团队参赛数量信息
+
+export const api_Mychallenge_list = '/challenge/Mychallenge_list'  //获取我的挑战列表
+export const api_GuessingList = '/challenge/GuessingList'  //获取围观预测列表
+
+export const api_initiate_challenge = '/challenge/initiate_challenge'  //发起挑战
+export const api_getCrown = '/challenge/get_crown'  //获得参赛代理公司
+
+export const api_accept_challenge = '/challenge/accept_challenge'  //接受/拒绝应战
+export const api_challengeGuessing = '/challenge/guessing'  //竞猜

+ 1 - 1
common/js/ajax.js

@@ -1,7 +1,7 @@
 //自定义 request 方法
 const host = 'https://api.jiuweiyun.cn'
 // const host = 'https://zhengbasai.dake.club'
-// const host = 'http://192.168.0.14'
+// const host = 'http://192.168.0.4:8080'
 const baseURL = '/api'
 
 const testNetworkType = store => {

+ 3 - 0
components/custom-toast.vue

@@ -68,6 +68,9 @@
 	.top {
 		top: 20%;
 	}
+	.center {
+		top: 48%;
+	}
 	.bottom {
 		top: 80%;
 	}

+ 6 - 0
components/tel-verify.vue

@@ -118,6 +118,12 @@
 											}
 										}
 									})
+								} else {
+									uni.showModal({
+										title: '提示',
+										content: res.message,
+										showCancel: false
+									})
 								}
 							})
 						}

+ 1 - 1
main.js

@@ -14,7 +14,7 @@ Vue.prototype.$scrollViewHeight = function (className) {  //设置页面内 scro
 	this.$nextTick(() => {  //在 mounted 以后获取到 className 的高度,赋给 scroll view
 			const query = uni.createSelectorQuery().in(this)
 			query.select(className).boundingClientRect()
-			query.exec(res => this.scrollViewHeight = res[0].height )
+			query.exec(res => this.scrollViewHeight = res[0].height)
 	})
 }
 Vue.prototype.$hideLoading = function() {  //异步操作结束,停止 loading

+ 16 - 0
pages.json

@@ -113,6 +113,22 @@
             "path" : "pages/mygift/mygift",
             "style" : {}
         }
+        ,{
+            "path" : "pages/challengeList/challengeList",
+            "style" : {}
+        }
+        ,{
+            "path" : "pages/challenge/challenge",
+            "style" : {}
+        }
+        ,{
+            "path" : "pages/challengeChoose/challengeChoose",
+            "style" : {}
+        }
+        ,{
+            "path" : "pages/challenge-detail/challenge-detail",
+            "style" : {}
+        }
     ],
 	"globalStyle": {
 		"navigationStyle": "custom",

+ 0 - 1
pages/address/address.vue

@@ -2,7 +2,6 @@
 	<view class="address">
 		<custom-nav :title="pageTitle"></custom-nav>
 		<custom-toast ref='toast'></custom-toast>
-		
 		<view class="content">
 			<view class="default">
 				<view class="title">{{ list.length ? '当前选择的收件人信息' : '您还没有添加收货地址'}}</view>

+ 358 - 0
pages/challenge-detail/challenge-detail.vue

@@ -0,0 +1,358 @@
+<template>
+	<view class="challenge-detail">
+		<custom-nav :title="pageTitle"></custom-nav>
+		<custom-toast ref='toast'></custom-toast>
+		<view v-if="item.challenge_nickname" class="content">
+			<view class="challenge-item">
+				<view class="challenge-item-status" :class="{ end: item.status == 2 }">{{ item.status == 1 ? '对战中' : '已结束' }}</view>
+				<view class="title">{{ item.challenge_nickname | getName }}与 {{ item.accept_nickname | getName }}的PK</view>
+				<view class="detail">
+					<view class="detail-l">
+						<image v-if="item.status == 2 && item.challenge_id == item.successId" class="success" src="../../static/icon/pk-success.png" mode=""></image>
+						<view class="avatar">
+							<image :src="item.challenge_avatar" ></image>
+							<image class="border" src="../../static/icon/challenge-avatar1.png"></image>
+						</view>
+						<view class="nickname">{{ item.challenge_nickname }}</view>
+					</view>
+					<view class="detail-c">
+						<view class="long">
+							<view class="long-item">{{ item.day | getLong(0) }}</view>
+							<view class="long-item">{{ item.day | getLong(1) }}</view>
+						</view>
+						<view class="time">{{ item.time }}</view>
+						<view class="action">{{ item | getAction(self) }}</view>
+					</view>
+					<view class="detail-r">
+						<image v-if="item.status == 2 && item.accept_id == item.successId" class="success" src="../../static/icon/pk-success.png" mode=""></image>
+						<view class="avatar">
+							<image :src="item.accept_avatar" ></image>
+							<image class="border" src="../../static/icon/challenge-avatar2.png"></image>
+						</view>
+						<view class="nickname">{{ item.accept_nickname }}</view>
+					</view>
+				</view>
+			</view>
+			<view class="score">
+				<view class="title">【{{ item.challenge_nickname | getName }}VS{{ item.accept_nickname | getName }}】当前学分情况</view>
+				<view class="scores">
+					<view class="scores-item">
+						<text class="name">{{ item.challenge_nickname | getName }}</text>
+						<text class="score-num" style="color: #FFA231;">学分:{{ item.challenge_total }}</text>
+					</view>
+					<view class="scores-item">
+						<text class="name">{{ item.accept_nickname | getName }}</text>
+						<text class="score-num" style="color: #C55AAE;">学分:{{ item.accept_total }}</text>
+					</view>
+				</view>
+			</view>
+			<view class="until">截止时间:220.05.21</view>
+			<view class="actions">
+				<view class="percent">
+					<text style="color: #FFA231;">支持率 {{ Math.floor(item.challenge_num / (item.challenge_num + item.accept_num) * 100) }}%</text>
+					<text style="color: #C55AAE;">支持率 {{ Math.floor(item.accept_num / (item.challenge_num + item.accept_num) * 100) }}%</text>
+				</view>
+				<view class="progress">
+					<view class="left" :style="{ width: Math.floor(item.challenge_num / (item.challenge_num + item.accept_num) * 100) + '%' }"></view>
+					<view class="right" :style="{ width: Math.floor(item.accept_num / (item.challenge_num + item.accept_num) * 100) + '%' }"></view>
+				</view>
+				<view v-if="!self" class="actionss">
+					<view v-if="!item.guessing || (item.support_id && item.support_id == item.challenge_id)" class="actions-btn" style="color: #FFA231; border-color: #FFA231;" @click="action(item.challenge_nickname, item.challenge_id, 0)"><text v-if="item.support_id == item.challenge_id">已</text>预测他/她赢</view>
+					<view v-if="!item.guessing || (item.support_id && item.support_id == item.accept_id)" class="actions-btn float-right" style="color: #C55AAE; border-color: #C55AAE;" @click="action(item.accept_nickname, item.accept_id, 1)"><text v-if="item.support_id == item.accept_id">已</text>预测他/她赢</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { api_challengeGuessing } from '@/api.js'
+	export default {
+		data() {
+			return {
+				pageTitle: '挑战详情',
+				item: {},
+				self: true
+			}
+		},
+		filters: {
+			getAction(item, self) {
+				if (self) {
+					if (item.status == 1) {
+						return 'PK中'
+					} else {
+						return '已结束'
+					}
+				} else {
+					if (item.guessing) {
+						return '已围观'
+					} else {
+						return '围观预测'
+					}
+				}
+				return ''
+			},
+			getLong(long, index) {
+				return (Number(long) > 9 ? String(long) : '0' + long)[index]
+			},
+			getName(name) {
+				if (name) {
+					return name.length > 8 ? name.slice(0, 8) + '...' : name
+				}
+				return ''
+			},
+		},
+		onLoad({ from }) {
+			this.item = uni.temp1
+			console.log(this.item)
+			if (!from) {
+				this.self = false
+			}
+		},
+		methods: {
+			action(nickname, userid, type) {
+				if (!this.item.guessing) {
+					uni.showModal({ title: '提示', content: `确定要预测${nickname}赢?` }).then(([, { confirm }]) => {
+						if (confirm) {
+							uni.loading()
+							this.$ajax.get(`${api_challengeGuessing}?challenge_id=${this.item.id}&user_id=${userid}&type=${type}`).then(([, { data: { code, msg }}]) => {
+								uni.hideLoading()
+								if (code == 200) {
+									uni.fromUpload = true
+									this.item.guessing = true
+									this.item.support_id = userid
+									uni.$emit('Guesst', this.item.id)
+								} else {
+									this.$refs.toast.hover(msg)
+								}
+							})
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.challenge-detail {
+		@include page();
+		.content {
+			background: $custom-nav-borderbot-color;
+			.challenge-item {
+				height: 240rpx;
+				padding: 0 30rpx;
+				border-radius:6rpx;
+				position: relative;
+				background: #FFFFFF;
+				margin: 0 auto 12rpx;
+				@include flex(column);
+				box-sizing: border-box;
+				box-shadow:0px 6rpx 20rpx 4rpx rgba(241,164,164,0.1);
+				.challenge-item-status {
+					top: 0;
+					right: 0;
+					width:128rpx;
+					height:48rpx;
+					color: #FFFFFF;
+					@include flex();
+					font-size: 26rpx;
+					position: absolute;
+					padding-right: 19rpx;
+					box-sizing: border-box;
+					justify-content: flex-end;
+					background:rgba(247,100,84,1);
+					border-radius:0rpx 6rpx 0rpx 48rpx;
+					&.end {
+						background: #999999;
+					}
+				}
+				.title {
+					width: 100%;
+					height: 50rpx;
+					@include flex();
+					color: #666666;
+					font-size: 26rpx;
+				}
+				.detail {
+					flex: 1;
+					width: 100%;
+					padding: 14rpx;
+					@include flex();
+					box-sizing: border-box;
+					> view {
+						flex: 1;
+						height: 100%;
+						position: relative;
+						@include flex(column);
+						justify-content: space-between;
+						.avatar {
+							width: 92rpx;
+							height: 107rpx;
+							position: relative;
+							> image {
+								width: 100%;
+								height: 100%;
+								&.border {
+									top: 0;
+									left: 0;
+									position: absolute;
+								}
+							}
+						}
+						.nickname {
+							color: #333333;
+							font-size: 26rpx;
+							overflow: hidden;
+							white-space: nowrap;
+							text-overflow: ellipsis;
+						}
+						.success {
+							left: 50%;
+							z-index: 1;
+							top: -28rpx;
+							width: 145rpx;
+							height: 148rpx;
+							position: absolute;
+							transform: translateX(-50%);
+						}
+						&.detail-c {
+							.long {
+								width: 100rpx;
+								height: 64rpx;
+								@include flex();
+								justify-content: space-between;
+								.long-item {
+									width: 48rpx;
+									height: 100%;
+									@include flex();
+									color: #FFFFFF;
+									font-size: 54rpx;
+									background: #333333;
+								}
+							}
+							.time {
+								color: #666666;
+								font-size: 20rpx;
+							}
+							.action {
+								width:128rpx;
+								height:44rpx;
+								@include flex();
+								font-size: 24rpx;
+								border-radius:22rpx;
+								color: $app-base-color;
+								background:rgba(255,255,255,1);
+								border:1rpx solid rgba(250,99,66,1);
+								&.end {
+									color: #999999;
+									border-color: #999999;
+								}
+							}
+						}
+					}
+				}
+			}
+			.score {
+				height: 220rpx;
+				background: #FFFFFF;
+				margin-bottom: 12rpx;
+				@include flex(column);
+				box-sizing: border-box;
+				padding: 0 40rpx 36rpx;
+				.title {
+					width: 100%;
+					height: 76rpx;
+					@include flex();
+					justify-content: flex-start;
+					
+				}
+				.scores {
+					flex: 1;
+					width: 100%;
+					@include flex();
+					justify-content: space-between;
+					.scores-item {
+						width:320rpx;
+						height:108rpx;
+						border-radius:6rpx;
+						@include flex(column);
+						border:1rpx solid rgba(204, 204, 204, 1);
+						.name {
+							font-size: 24rpx;
+						}
+						.score-num {
+							font-size: 26rpx;
+							margin-top: 18rpx;
+						}
+					}
+				}
+			}
+			.actions {
+				height: 220rpx;
+				padding: 0 30rpx;
+				background: #FFFFFF;
+				box-sizing: border-box;
+				@include flex(column);
+				justify-content: flex-start;
+				.percent {
+					width: 100%;
+					font-size: 24rpx;
+					@include flex();
+					line-height: 3;
+					justify-content: space-between;
+				}
+				.progress {
+					width: 100%;
+					height: 20rpx;
+					position: relative;
+					.left {
+						top: 0;
+						left: 0;
+						z-index: 1;
+						height: 100%;
+						position: absolute;
+						background: #FFA231;
+					}
+					.right {
+						top: 0;
+						right: 0;
+						height: 100%;
+						position: absolute;
+						background: #C55AAE;
+					}
+					// .left::after {
+					// 	top: 0;
+					// 	content: "";
+					// 	width: 8rpx;
+					// 	height: 200%;
+					// 	right: -4rpx;
+					// 	position: absolute;
+					// 	background: #FFFFFF;
+					// 	transform-origin: center center;
+					// 	transform: translate(0, -25%) rotate(20deg);
+					// }
+				}
+				.actionss {
+					width: 640rpx;
+					height: 64rpx;
+					margin-top: 36rpx;
+					.actions-btn {
+						width:240rpx;
+						height:64rpx;
+						float: left;
+						@include flex();
+						font-size: 24rpx;
+						border-radius:32rpx;
+						background:rgba(254,250,249,1);
+						border:1rpx solid rgba(255,162,49,1);
+						&.float-right {
+							float: right;
+						}
+					}
+					
+				}
+			}
+		}
+	}
+</style>

+ 252 - 0
pages/challenge/challenge.vue

@@ -0,0 +1,252 @@
+<template>
+	<view class="new">
+		<custom-nav :title="pageTitle"></custom-nav>
+		<custom-toast ref='toast'></custom-toast>
+		<view class="content">
+			<image class="bg" src="../../static/icon/challenge-bg.png"></image>
+			<view class="person1">
+				<view class="con">
+					<view class="title">挑战者</view>
+					<image class="avatar" :src="pkInfo.challenge_avatar"></image>
+				</view>
+			</view>
+			<view class="person1Name">{{ pkInfo.challenge_nickname | getName }}</view>
+			<view class="person2" @click="choose">
+				<view class="con right">
+					<image class="avatar" :src="pkInfo.accept_avatar ? pkInfo.accept_avatar : '../../static/icon/choose.png'"></image>
+					<view class="title">应战者</view>
+				</view>
+			</view>
+			<view class="person2Name">{{ pkInfo.accept_nickname | getName }}</view>
+			<view class="centerTitle">挑战期限</view>
+			<view class="long nopicker">{{ chooseLong }} 天</view>
+			<view v-if="type == 2" class="submit reject" @click="reject">拒绝</view>
+			<view v-if="type == 0 || type == 2" class="submit" @click="submit">{{ type == 0 ? '确定' : '应战' }}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { api_initiate_challenge, api_accept_challenge } from '@/api.js'
+	export default {
+		data() {
+			return {
+				pageTitle: '发起挑战',
+				chooseLong: Math.abs(Number(this.$store.state.userServerInfo.day)),
+				type: 0,
+				pkInfo: {
+					challenge_id: this.$store.state.userServerInfo.id,
+					challenge_avatar: this.$store.state.userWeixinInfo.avatarUrl,
+					challenge_nickname: this.$store.state.userWeixinInfo.nickName,
+				}
+			};
+		},
+		filters: {
+			getName(name) {
+				if (name) {
+					return name.length > 8 ? name.slice(0, 8) + '...' : name
+				}
+				return '选择应战人'
+			},
+		},
+		onShow() {
+			if (uni.pkInfo) {
+				this.pkInfo = { ...this.pkInfo, ...uni.pkInfo }
+				uni.pkInfo = null
+				console.log(this.pkInfo)
+			}
+		},
+		onLoad({ type }) {
+			if (type == 1) { // 我的挑战
+				this.pageTitle = '我的挑战'
+				this.type = 1
+			}
+			if (type == 2) { // 接受挑战
+				this.pageTitle = '接受挑战'
+				this.type = 2
+			}
+		},
+		methods: {
+			choose() { // 点击选择用户
+				if (this.pageTitle === '发起挑战') {
+					uni.navigateTo({ url: '../challengeChoose/challengeChoose' })
+				}
+			},
+			reject() { // 拒绝挑战
+				uni.showModal({ title: '提示', content: `确定拒绝${this.pkInfo.challenge_nickname}的挑战?` }).then(([, { confirm }]) => {
+					if (confirm) {
+						uni.loading()
+						this.$ajax.get(`${api_accept_challenge}?id=${this.pkInfo.id}&type=1`).then(([, { data: { code, msg }}]) => {
+							uni.hideLoading()
+							if (code == 200) {
+								uni.navigateBack()
+								uni.$emit('RejectPK', this.pkInfo.id)
+							} else {
+								this.$refs.toast.hover(msg)
+							}
+						})
+					}
+				})
+			},
+			submit() { // 提交挑战
+				if (!this.pkInfo.accept_id) {
+					this.$refs.toast.hover('请选择挑战人', 3456, 'center')
+					return
+				}
+				if (!this.chooseLong) {
+					this.$refs.toast.hover('请选择挑战时长', 3456, 'center')
+					return
+				}
+				if (this.type == 0) {
+					uni.showModal({ title: '提示', content: `确定向${this.pkInfo.accept_nickname}发起挑战,期限${this.chooseLong}天?` }).then(([, { confirm }]) => {
+						if (confirm) {
+							uni.loading()
+							this.$ajax.get(`${api_initiate_challenge}?id=${this.pkInfo.accept_id}`).then(([, { data: { code, msg }}]) => {
+								uni.hideLoading()
+								if (code == 200) {
+									uni.navigateBack()
+								} else {
+									this.$refs.toast.hover(msg)
+								}
+							})
+						}
+					})
+				} else if (this.type == 1) {
+					console.log('放弃挑战')
+				} else if (this.type == 2) {
+					uni.showModal({ title: '提示', content: `确定接受${this.pkInfo.challenge_nickname}的挑战?` }).then(([, { confirm }]) => {
+						if (confirm) {
+							uni.loading()
+							this.$ajax.get(`${api_accept_challenge}?id=${this.pkInfo.id}&type=0`).then(([, { data: { code, msg }}]) => {
+								uni.hideLoading()
+								if (code == 200) {
+									uni.navigateBack()
+									uni.$emit('AcceptPK', this.pkInfo.id)
+								} else {
+									this.$refs.toast.hover(msg)
+								}
+							})
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.new {
+		@include page();
+		.content {
+			position: relative;
+			.bg {
+				width: 100%;
+				height: 100%;
+			}
+			.person1, .person2 {
+				left: 0;
+				top: 201rpx;
+				width:240rpx;
+				height:120rpx;
+				@include flex();
+				position: absolute;
+				justify-content: flex-start;
+				border-radius:0rpx 57rpx 57rpx 0rpx;
+				border:1rpx solid rgba(239,115,42,1);
+				&.person2 {
+					right: 0;
+					left: auto;
+					border-color: #C55AAE;
+					justify-content: flex-end;
+					border-radius:57rpx 0rpx 0rpx 57rpx;
+				}
+				.con {
+					width:235rpx;
+					height:110rpx;
+					@include flex();
+					background:rgba(239,115,42,1);
+					border-radius:0rpx 55rpx 55rpx 0rpx;
+					&.right {
+						background:#C55AAE;
+						border-radius:55rpx 0rpx 0rpx 55rpx;
+					}
+					.title {
+						flex: 1;
+						height: 100%;
+						@include flex();
+						color: #FFFFFF;
+						font-size: 36rpx;
+					}
+					.avatar {
+						margin: 6rpx;
+						width: 100rpx;
+						height: 100rpx;
+						border-radius: 50%;
+					}
+				}
+			}
+			.person1Name, .person2Name {
+				top: 331rpx;
+				position: absolute;
+				font-size: 32rpx;
+				&.person1Name {
+					left: 31rpx;
+					color: #EF732A;
+				}
+				&.person2Name {
+					right: 31rpx;
+					color: #C55AAE;
+				}
+			}
+			.centerTitle {
+				bottom: 660rpx;
+				left: 300rpx;
+				font-size:36rpx;
+				position: absolute;
+				color: rgba(239,115,42,1);
+				text-shadow: 0rpx 1rpx 0rpx rgba(173,74,16,0.75);
+			}
+			.long {
+				left: 256rpx;
+				opacity: 0.5;
+				width: 240rpx;
+				height: 98rpx;
+				bottom: 538rpx;
+				font-size: 54rpx;
+				font-weight:bold;
+				position: absolute;
+				color:rgba(239,115,42,1);
+				text-shadow:0rpx 1rpx 0rpx rgba(173,74,16,0.75);
+				background: linear-gradient(0deg,rgba(254,234,177,1));
+				box-shadow: 0rpx 15rpx 20rpx 0rpx rgba(230, 41, 126, 0.35), 3rpx 4rpx 0rpx 0rpx rgba(255,255,255,0.5), -3rpx -4rpx 0rpx 0rpx rgba(212,152,0,0.5);
+				&.nopicker {
+					@include flex();
+				}
+				.num {
+					width: 100%;
+					height: 98rpx;
+					@include flex();
+				}
+			}
+			.submit {
+				bottom: 214rpx;
+				left: 195rpx;
+				width:360rpx;
+				height:98rpx;
+				@include flex();
+				font-size:36rpx;
+				position: absolute;
+				border-radius:49rpx;
+				color:rgba(239,115,42,1);
+				text-shadow:0rpx 1rpx 0rpx rgba(173,74,16,0.75);
+				background:linear-gradient(0deg,rgba(254,234,177,1));
+				box-shadow:0rpx 15rpx 20rpx 0rpx rgba(230, 41, 126, 0.35), 3rpx 4rpx 0rpx 0rpx rgba(255,255,255,0.5), -3rpx -4rpx 0rpx 0rpx rgba(212,152,0,0.5);
+				&.reject {
+					bottom: 345rpx;
+					color:rgba(102,102,102,1);
+					text-shadow:0px 1px 0px rgba(173,74,16,0.75);
+				}
+			}
+		}
+	}
+</style>

+ 145 - 0
pages/challengeChoose/challengeChoose.vue

@@ -0,0 +1,145 @@
+<template>
+	<view class="challengeChoose">
+		<custom-nav :title="pageTitle"></custom-nav>
+		<custom-toast ref='toast'></custom-toast>
+		<view class="content">
+			<view class="search">
+				<input type="text" v-model="phone" placeholder="请输入代理昵称/代理手机号" />
+			</view>
+			<view class="list">
+				<scroll-view scroll-y="true" :style="{ height: scrollViewHeight + 'px' }">
+					<view class="item" v-for="(item, index) in showList" :key="index">
+						<image class="avatar" :src="item.avatar"></image>
+						<view class="info">
+							<text class="nickname">{{ item.nickname }}</text>
+							<text class="score">{{ item.integral }}学分</text>
+						</view>
+						<view class="choose" @click="choose(item)">挑战</view>
+					</view>
+					<view class="item">没有更多了</view>
+				</scroll-view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { api_getCrown } from '@/api.js'
+	export default {
+		data() {
+			return {
+				pageTitle: '选择代理',
+				scrollViewHeight: 0,
+				list: [],
+				phone: ''
+			};
+		},
+		computed: {
+			showList() {
+				if (this.phone) {
+					return this.list.filter(e => (e.nickname + e.up_phone).includes(this.phone))
+				}
+				return this.list
+			}
+		},
+		mounted() {
+			uni.loading()
+			this.$scrollViewHeight('.list')
+			this.$ajax.get(api_getCrown).then(([, { data: { data: { list }}}]) => {
+				uni.hideLoading()
+				this.list = list.sort((a, b) => b.integral - a.integral)
+			})
+		},
+		methods: {
+			choose({ id, nickname, avatar }) {
+				uni.pkInfo = {
+					accept_id: id,
+					accept_avatar: avatar,
+					accept_nickname: nickname,
+				}
+				uni.navigateBack()
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.challengeChoose {
+		@include page();
+		overflow: scroll;
+		.content {
+			@include flex(column);
+			background: $custom-nav-borderbot-color;
+			.search {
+				width: 100%;
+				height: 98rpx;
+				margin: 1px 0;
+				@include flex();
+				background: #FFFFFF;
+				box-sizing: border-box;
+				padding: 0 38rpx 0 45rpx;
+				input {
+					flex: 1;
+					height: 64rpx;
+					padding: 0 24rpx;
+					background: #F2F4F5;
+					margin-right: 24rpx;
+					border-radius: 78rpx;
+					border: 1rpx solid #EEEEEE;
+				}
+				.searchBTN {
+					width:168rpx;
+					height:64rpx;
+					color: #FFFFFF;
+					@include flex();
+					font-size: 32rpx;
+					border-radius:64rpx;
+					background:rgba(247,100,84,1);
+				}
+			}
+			.list {
+				flex: 1;
+				width: 100%;
+				.item {
+					@include flex();
+					height: 140rpx;
+					margin-bottom: 1rpx;
+					background: #FFFFFF;
+					box-sizing: border-box;
+					padding: 0 38rpx 0 45rpx;
+					.avatar {
+						width: 88rpx;
+						height: 88rpx;
+						border-radius: 50%;
+					}
+					.info {
+						flex: 1;
+						margin: 0 25rpx;
+						font-size: 26rpx;
+						@include flex(column);
+						align-items: flex-start;
+						.nickname {
+							width: 375rpx;
+							overflow: hidden;
+							white-space: nowrap;
+							text-overflow: ellipsis;
+						}
+						.score {
+							color: #C55AAE;
+							margin-top: 12rpx;
+						}
+					}
+					.choose {
+						width:168rpx;
+						height:64rpx;
+						color: #FFFFFF;
+						@include flex();
+						font-size: 32rpx;
+						border-radius:32rpx;
+						background:rgba(247,100,84,1);
+					}
+				}
+			}
+		}
+	}
+</style>

+ 338 - 0
pages/challengeList/challengeList.vue

@@ -0,0 +1,338 @@
+<template>
+	<view class="challengeList">
+		<custom-nav :title="pageTitle"></custom-nav>
+		<custom-toast ref='toast'></custom-toast>
+		<view class="content">
+			<image class="getChallenge" src="../../static/icon/getChallenge.png" @click="getChallenge"></image>
+			<!-- <view class="loading">
+				<image src="https://image.weilanwl.com/gif/loading-white.gif"></image>
+			</view> -->
+			<view class="nav">
+				<view class="nav-item" :class="{ active: active === 0 }" @click="active = 0">我的挑战</view>
+				<view class="nav-item" :class="{ active: active === 1 }" @click="active = 1">围观预测</view>
+			</view>
+			<view class="my-challenge">
+				<scroll-view 
+					v-if="showScrollView"
+					scroll-y 
+					:style="{ height: scrollViewHeight + 'px' }"
+					:refresher-enabled="true"
+					:refresher-triggered="requesting"
+					@refresherrefresh="refresherrefresh"
+					@scrolltolower="scrolltolower"
+				>
+					<view class="my-challenge-item" v-for="(item, index) in list" :key="index">
+						<view class="challenge-item-status" :class="{ end: item.status == 2 || item.status == 3 }">{{ item.status == 0 ? '未应战' : item.status == 1 ? '对战中' : '已结束' }}</view>
+						<view v-if="active == 0" class="title">{{ item.type == 0 ? ('向' + item.accept_nickname.slice(0, 6) + '发起挑战') : (item.challenge_nickname.slice(0, 6) + '向你发起挑战')  }}</view>
+						<view v-else class="title">{{ item.accept_nickname.slice(0, 6) + '与' + item.challenge_nickname.slice(0, 6) + '的PK'}}</view>
+						<view class="detail">
+							<view class="detail-l">
+								<image v-if="item.status == 2 && item.challenge_id == item.successId" class="success" src="../../static/icon/pk-success.png" mode=""></image>
+								<view class="avatar">
+									<image :src="item.challenge_avatar" ></image>
+									<image class="border" src="../../static/icon/challenge-avatar1.png"></image>
+								</view>
+								<view class="nickname">{{ item.challenge_nickname }}</view>
+							</view>
+							<view class="detail-c">
+								<view class="long">
+									<view class="long-item">{{ item.day | getLong(0) }}</view>
+									<view class="long-item">{{ item.day | getLong(1) }}</view>
+								</view>
+								<view class="time">{{ item.time }}</view>
+								<view class="action" :class="{ end: item.status == 3 || item.guessing }" @click="toDetail(item)">{{ item | getAction(nowActive) }}</view>
+							</view>
+							<view class="detail-r">
+								<image v-if="item.status == 2 && item.accept_id == item.successId" class="success" src="../../static/icon/pk-success.png" mode=""></image>
+								<view class="avatar">
+									<image :src="item.accept_avatar" ></image>
+									<image class="border" src="../../static/icon/challenge-avatar2.png"></image>
+								</view>
+								<view class="nickname">{{ item.accept_nickname }}</view>
+							</view>
+						</view>
+					</view>
+					<view class="my-challenge-item nomore">{{ page == 0 ? '暂无更多' : '加载中' }}</view>
+				</scroll-view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { api_Mychallenge_list, api_GuessingList } from '@/api.js'
+	export default {
+		data() {
+			return {
+				pageTitle: '学分挑战',
+				active: 0,
+				nowActive: 0,
+				list: [],
+				page: 1,
+				requesting: false,
+				scrollViewHeight: 0,
+				showScrollView: false
+			};
+		},
+		watch: {
+			active() {
+				this.refresherrefresh()
+			}
+		},
+		filters: {
+			getAction(item, nowActive) {
+				if (nowActive == 0) {
+					if (item.status == 1 || item.status == 2) {
+						return '挑战详情'
+					} else if (item.status == 0) {
+						if (item.type == 0) {
+							return '查看详情'
+						} else if (item.type == 1) {
+							return '应战'
+						}
+					} else if (item.status == 3) {
+						return '已拒绝'
+					}
+				} else {
+					if (item.guessing) {
+						return '已预测'
+					} else {
+						return '围观预测'
+					}
+				}
+				return ''
+			},
+			getLong(long, index) {
+				return (Number(long) > 9 ? String(long) : '0' + long)[index]
+			}
+		},
+		// onShow() {
+		// 	this.page = 1
+		// 	this.request(true)
+		// },
+		mounted() {
+			this.$scrollViewHeight('.my-challenge')
+			setTimeout(() => this.showScrollView = true, 567)
+			this.request(true)
+			uni.$on('RejectPK', id => this.list.find(e => e.id == id).status = 3)
+			uni.$on('AcceptPK', id => this.list.find(e => e.id == id).status = 1)
+			uni.$on('Guesst', id => this.list.find(e => e.id == id).guessing = true)
+		},
+		methods: {
+			scrolltolower() {
+				this.request()
+			},
+			refresherrefresh() {
+				this.page = 1
+				this.request(true)
+			},
+			request(refresh) {
+				if (!this.requesting && this.page > 0) {
+					this.requesting = true
+					uni.loading()
+					this.$ajax.get((this.active == 0 ? api_Mychallenge_list : api_GuessingList) + `?page=${this.page}`).then(([, { data: { data: { list, size }}}]) => {
+						list.length < size ? this.page = 0 : this.page ++
+						this.list = refresh ? list : [...this.list, ...list],
+						this.nowActive = this.active
+						uni.hideLoading()
+						this.requesting = false
+					})
+				}
+			},
+			getChallenge() { // 点击发起挑战
+				uni.navigateTo({ url: '../challenge/challenge' })
+			},
+			toDetail(item) {
+				const type = this.$options.filters.getAction(item, this.active)
+				if (type == '查看详情' || type == '应战') {
+					uni.pkInfo = {
+						challenge_id: item.challenge_id,
+						challenge_avatar: item.challenge_avatar,
+						challenge_nickname: item.challenge_nickname,
+						accept_id: item.accept_id,
+						accept_avatar: item.accept_avatar,
+						accept_nickname: item.accept_nickname,
+						id: item.id
+					}
+				}
+				if (type == '查看详情') {
+					uni.navigateTo({ url: '../challenge/challenge?type=1' })
+				} else if (type == '应战') {
+					uni.navigateTo({ url: '../challenge/challenge?type=2' })
+				} else if (type == '挑战详情' || type == '围观预测' || type == '已预测') {
+					uni.temp1 = item
+					uni.navigateTo({ url: '../challenge-detail/challenge-detail' + (type == '挑战详情' ? '?from=1' : '') })
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.challengeList {
+		@include page();
+		.content {
+			position: relative;
+			@include flex(column);
+			justify-content: flex-start;
+			background: $custom-nav-borderbot-color;
+			.getChallenge {
+				right: 0;
+				z-index: 1;
+				height: 80rpx;
+				width: 200rpx;
+				bottom: 200rpx;
+				position: fixed;
+			}
+			.nav {
+				z-index: 1;
+				width: 100%;
+				height: 80rpx;
+				@include flex();
+				background: #FFFFFF;
+				border-top: 1rpx solid #EEEEEE;
+				.nav-item {
+					flex: 1;
+					height: 100%;
+					@include flex();
+					font-size: 32rpx;
+					position: relative;
+					&.active {
+						color: $app-base-color;
+					}
+					&.active::after {
+						left: 50%;
+						bottom: 0;
+						content: "";
+						width: 128rpx;
+						height: 4rpx;
+						margin-left: -64rpx;
+						position: absolute;
+						background: $app-base-color;
+					}
+				}
+			}
+			.my-challenge {
+				flex: 1;
+				width: 100%;
+				margin-top: 16rpx;
+				.my-challenge-item {
+					width: 690rpx;
+					height: 240rpx;
+					border-radius:6rpx;
+					position: relative;
+					background: #FFFFFF;
+					margin: 0 auto 16rpx;
+					@include flex(column);
+					box-shadow:0px 6rpx 20rpx 4rpx rgba(241,164,164,0.1);
+					&.nomore {
+						height: 98rpx;
+					}
+					.challenge-item-status {
+						top: 0;
+						right: 0;
+						width:128rpx;
+						height:48rpx;
+						color: #FFFFFF;
+						@include flex();
+						font-size: 26rpx;
+						position: absolute;
+						padding-right: 19rpx;
+						box-sizing: border-box;
+						justify-content: flex-end;
+						background:rgba(247,100,84,1);
+						border-radius:0rpx 6rpx 0rpx 48rpx;
+						&.end {
+							background: #999999;
+						}
+					}
+					.title {
+						width: 100%;
+						height: 50rpx;
+						@include flex();
+						color: #666666;
+						font-size: 26rpx;
+					}
+					.detail {
+						flex: 1;
+						width: 100%;
+						padding: 14rpx;
+						@include flex();
+						box-sizing: border-box;
+						> view {
+							flex: 1;
+							height: 100%;
+							position: relative;
+							@include flex(column);
+							justify-content: space-between;
+							.avatar {
+								width: 92rpx;
+								height: 107rpx;
+								position: relative;
+								> image {
+									width: 100%;
+									height: 100%;
+									&.border {
+										top: 0;
+										left: 0;
+										position: absolute;
+									}
+								}
+							}
+							.nickname {
+								color: #333333;
+								font-size: 26rpx;
+								overflow: hidden;
+								white-space: nowrap;
+								text-overflow: ellipsis;
+							}
+							.success {
+								left: 50%;
+								z-index: 1;
+								top: -28rpx;
+								width: 145rpx;
+								height: 148rpx;
+								position: absolute;
+								transform: translateX(-50%);
+							}
+							&.detail-c {
+								.long {
+									width: 100rpx;
+									height: 64rpx;
+									@include flex();
+									justify-content: space-between;
+									.long-item {
+										width: 48rpx;
+										height: 100%;
+										@include flex();
+										color: #FFFFFF;
+										font-size: 54rpx;
+										background: #333333;
+									}
+								}
+								.time {
+									color: #666666;
+									font-size: 20rpx;
+								}
+								.action {
+									width:128rpx;
+									height:44rpx;
+									@include flex();
+									font-size: 24rpx;
+									border-radius:22rpx;
+									color: $app-base-color;
+									background:rgba(255,255,255,1);
+									border:1rpx solid rgba(250,99,66,1);
+									&.end {
+										color: #999999;
+										border-color: #999999;
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 1 - 1
pages/hishonour/hishonour.vue

@@ -160,7 +160,7 @@
 					if (err && (err.errMsg === "saveImageToPhotosAlbum:fail:auth denied" || err.errMsg === "saveImageToPhotosAlbum:fail auth deny")) {  //如果用户拒绝授权保存图片到相册
 						const that = this
 					    uni.showModal({
-					        title: '"大卫博士卖货争霸赛"需要保存图片或视频到你的相册',
+					        title: '"大卫博士学位争霸赛"需要保存图片或视频到你的相册',
 					        content: '',
 					        success (res) {
 					            if (res.confirm) {

+ 2 - 2
pages/honour/honour.vue

@@ -11,7 +11,7 @@
 			<view class="bot">
 				<view class="title">
 					<image src="../../static/icon/honour-icon.png" style="transform: rotateY(180deg);" mode="scaleToFill"></image>
-					<text>大卫博士卖货争霸赛</text>
+					<text>大卫博士学位争霸赛</text>
 					<image src="../../static/icon/honour-icon.png" mode="scaleToFill"></image>
 				</view>
 				<view class="text">要想赢,就一定不能怕输。不怕输,结果未必能赢。但是怕输,结果则一定是输。</view>
@@ -77,7 +77,7 @@
 					if (err && (err.errMsg === "saveImageToPhotosAlbum:fail:auth denied" || err.errMsg === "saveImageToPhotosAlbum:fail auth deny")) {  //如果用户拒绝授权保存图片到相册
 						const that = this
 					    uni.showModal({
-					        title: '"大卫博士卖货争霸赛"需要保存图片或视频到你的相册',
+					        title: '"大卫博士学位争霸赛"需要保存图片或视频到你的相册',
 					        content: '',
 					        success (res) {
 					            if (res.confirm) {

+ 96 - 59
pages/index/index.vue

@@ -42,9 +42,10 @@
 					<image class="index-ranking" src="../../static/icon/index-ranking.png" mode="aspectFit"></image>
 					<view v-if="userServerInfo.rank" class="userranking">我的排名:{{ userServerInfo.rank ? userServerInfo.rank : '0' }}</view>
 				</view>
-				<view class="left2 index-item" @tap="tohonour">
-					<text class="name">荣耀殿堂</text>
-					<image class="index-honour" src="../../static/icon/index-honour.png" mode="aspectFit"></image>
+				<view class="left2 index-item" @tap="toexchange">
+					<text class="name">礼品兑换</text>
+					<image class="index-exchange" src="../../static/icon/index-exchange.png" mode="aspectFit"></image>
+					<view v-if="userServerInfo.bonus" class="usermonkey">奖学金:{{ userServerInfo.bonus ? userServerInfo.bonus : '0' }}</view>
 				</view>
 				<view class="left3 index-item" @tap="tosetting">
 					<text class="name">设置</text>
@@ -56,15 +57,18 @@
 					<text class="name">图片上传</text>
 					<image class="index-upload" src="../../static/icon/index-upload.png" mode="aspectFit"></image>
 				</view>
-				<view class="right2 index-item" @tap="toexchange">
-					<text class="name">礼品兑换</text>
-					<image class="index-exchange" src="../../static/icon/index-exchange.png" mode="aspectFit"></image>
-					<view v-if="userServerInfo.bonus" class="usermonkey">奖学金:{{ userServerInfo.bonus ? userServerInfo.bonus : '0' }}</view>
+				<view class="right2 index-item" @tap="toChallenge">
+					<text class="name">学分挑战</text>
+					<image class="index-challenge" src="../../static/icon/index-challenge.png"></image>
 				</view>
 				<view class="right3 index-item" @tap="tostatistics">
 					<text class="name">数据统计</text>
 					<image class="index-statistics" src="../../static/icon/index-statistics.png" mode="aspectFit"></image>
 				</view>
+				<view class="right4 index-item" @tap="tohonour">
+					<text class="name">荣耀殿堂</text>
+					<image class="index-honour" src="../../static/icon/index-honour.png" mode="aspectFit"></image>
+				</view>
 			</view>
 		</view>
 		
@@ -134,7 +138,7 @@
 								if (this.userServerInfo.type === 1) {
 									return '报名参赛'
 								} else if (this.userServerInfo.type === 2) {
-									return '学分账单'
+									return '报名参赛'
 								} else if (this.userServerInfo.type === 3) {
 									return ''
 								}
@@ -172,6 +176,48 @@
 				}
 			}
 		},
+		created () {  //加载完成后开启监听全局 MESSAGE 事件
+			uni.$on('MESSAGE', (m, d, p) => {  //m 要提示的文字信息  d 文字信息出现的时常  p 文字信息出现的位置
+				this.$refs.toast.hover(m, d, p)
+			})
+			uni.$on('HIDEMESSAGE', () => {  // 隐藏 文字提示
+				this.$refs.toast.hide()
+			})
+			if ('wifi2g3g4g'.indexOf(this.networkType) !== -1) {  //有网络连接时才进行下一步
+				this.$store.dispatch('onLaunch').then(() => {
+					uni.stopPullDownRefresh()
+				}).catch(e => { //触发初始化方法
+					this.$refs.toast.hover('网络可能出了点问题,请下拉刷新试试')
+				})
+			} else {
+				uni.showToast({ title: '似乎已经断开网络连接', icon: 'none' })
+			}
+		},
+		onLoad() {
+			// uni.navigateTo({
+			// 	url: '../challengeList/challengeList'
+			// })
+		},
+		onShow() {  //每次展示首页时都初始化一次,达到实时更新数据的功能
+			this.routing = false
+			if ('wifi2g3g4g'.indexOf(this.networkType) !== -1) {  //有网络连接时才进行下一步
+				if (uni.fromUpload) {
+					uni.fromUpload = false
+					if (uni.toRank) {
+						uni.fromUpload = false
+						uni.navigateTo({ url: '../ranking/ranking' })
+					}
+					this.$store.dispatch('onLaunch').then(() => {
+						uni.stopPullDownRefresh()
+						
+					}).catch(e => { //触发初始化方法
+						this.$refs.toast.hover('网络可能出了点问题,请下拉刷新试试')
+					})
+				}
+			} else {
+				uni.showToast({ title: '似乎已经断开网络连接', icon: 'none' })
+			}
+		},
 		methods: {
 			getuserinfo () {  //获取用户信息
 				uni.getUserInfo().then(([getUserWeixinInfoErr, userWeixinInfo]) => {  //获取完成后
@@ -184,7 +230,7 @@
 			},
 			toself () {  //点击用户信息
 				if (this.$verified()) {  //用户是否已登录
-					if (this.userServerInfo.type === 1) {  //只有普通代理用户才能进入个人主页
+					if (this.userServerInfo.type === 1 || this.userServerInfo.type === 2) {  //只有普通代理和代理公司个人主页
 						if (this.routing) { return }
 						this.routing = true
 						uni.navigateTo({ url: `../self/self?from=index&id=${this.userServerInfo.id}` }) //已登录跳转到用户中心
@@ -236,7 +282,7 @@
 			},
 			tohonour () {  //点击荣誉殿堂
 				if (this.$verified()) {  //用户是否已登录
-					if (this.userServerInfo.type === 1) {  //普通用户直接跳转到荣誉殿堂页面
+					if (this.userServerInfo.type === 1 || this.userServerInfo.type === 2) {  //普通用户直接跳转到荣誉殿堂页面
 						if (this.routing) { return }
 						this.routing = true
 						uni.navigateTo({ url: '../honour/honour' })
@@ -267,6 +313,23 @@
 					this.$store.commit('SHOWVERIFY')
 				}
 			},
+			toChallenge() { // 点击学分挑战
+				if (this.$verified()) {  //用户是否已登录
+					if (this.userServerInfo.signuped) { // 用户是否已经报名
+						if (this.userServerInfo.type === 2) { // 只有代理公司能够参加学分竞赛
+							if (this.routing) { return }
+							this.routing = true
+							uni.navigateTo({ url: '../challengeList/challengeList' })
+						} else {  //代理公司和政委不可参赛,所以提示无参赛记录
+							this.$refs.toast.hover('只有代理公司可以参与挑战')
+						}
+					} else {
+						this.$refs.toast.hover('您还没有报名参赛')
+					}
+				} else {  //未登录弹出登录框
+					this.$store.commit('SHOWVERIFY')
+				}
+			},
 			toexchange () {  //点击兑换奖品
 				if (this.$verified()) {  //用户是否已登录
 					if (this.userServerInfo.status === 3) {
@@ -303,43 +366,6 @@
 			toLongTapIndex() {
 				uni.navigateTo({ url: '../longTapIndex/longTapIndex' })
 			}
-		},
-		created () {  //加载完成后开启监听全局 MESSAGE 事件
-			uni.$on('MESSAGE', (m, d, p) => {  //m 要提示的文字信息  d 文字信息出现的时常  p 文字信息出现的位置
-				this.$refs.toast.hover(m, d, p)
-			})
-			uni.$on('HIDEMESSAGE', () => {  // 隐藏 文字提示
-				this.$refs.toast.hide()
-			})
-			if ('wifi2g3g4g'.indexOf(this.networkType) !== -1) {  //有网络连接时才进行下一步
-				this.$store.dispatch('onLaunch').then(() => {
-					uni.stopPullDownRefresh()
-				}).catch(e => { //触发初始化方法
-					this.$refs.toast.hover('网络可能出了点问题,请下拉刷新试试')
-				})
-			} else {
-				uni.showToast({ title: '似乎已经断开网络连接', icon: 'none' })
-			}
-		},
-		onShow() {  //每次展示首页时都初始化一次,达到实时更新数据的功能
-			this.routing = false
-			if ('wifi2g3g4g'.indexOf(this.networkType) !== -1) {  //有网络连接时才进行下一步
-				if (uni.fromUpload) {
-					uni.fromUpload = false
-					if (uni.toRank) {
-						uni.fromUpload = false
-						uni.navigateTo({ url: '../ranking/ranking' })
-					}
-					this.$store.dispatch('onLaunch').then(() => {
-						uni.stopPullDownRefresh()
-						
-					}).catch(e => { //触发初始化方法
-						this.$refs.toast.hover('网络可能出了点问题,请下拉刷新试试')
-					})
-				}
-			} else {
-				uni.showToast({ title: '似乎已经断开网络连接', icon: 'none' })
-			}
 		}
 	}
 </script>
@@ -350,7 +376,7 @@
 		height: 100%;
 		position: relative;
 		box-sizing: border-box;
-		padding: 161rpx 50rpx 0;
+		padding: 161rpx 30rpx 0;
 		display: flex;
 		flex-direction: column;
 		.getUserInfo {
@@ -498,11 +524,11 @@
 			flex: 1;
 			z-index: 1;
 			display: flex;
-			margin: 26rpx 0;
+			margin: 10rpx 0;
 			position: relative;
 			justify-content: space-between;
 			view {
-				width: 310rpx;
+				width: 340rpx;
 				display: flex;
 				flex-direction: column;
 				justify-content: space-between;
@@ -515,11 +541,12 @@
 					font-size: 30rpx;
 					color: #FFFFFF;
 					.name {
-						position: absolute;
+						z-index: 1;
 						top: 38rpx;
 						left: 30rpx;
-						font-size: 40rpx;
 						color: #FFFFFF;
+						font-size: 40rpx;
+						position: absolute;
 					}
 					image {
 						position: absolute;
@@ -549,6 +576,12 @@
 							height: 123rpx;
 							right: 17rpx;
 						}
+						&.index-challenge {
+							width: 100%;
+							height: 100%;
+							left: 0;
+							top: 0;
+						}
 						&.index-statistics {
 							width: 134rpx;
 							height: 166rpx;
@@ -563,29 +596,33 @@
 						color: #FFFFFF;
 					}
 					&.left1 {
-						height: 46.2%;
+						height: 41.76904176904177%;
 						background:linear-gradient(0deg,rgba(121,169,253,1) 0%,rgba(146,158,242,1) 100%);
 					}
 					&.left2 {
-						height: 26.4%;
-						background:linear-gradient(0deg,rgba(255,99,76,1) 0%,rgba(255,149,135,1) 100%);
+						height: 36.855036855036855%;
+						background:linear-gradient(0deg,rgba(212,134,249,1) 0%,rgba(176,99,248,1) 100%);
 					}
 					&.left3 {
-						height: 19.8%;
+						height: 18.427518427518427%;
 						background:linear-gradient(0deg,rgba(255,255,255,1) 0%,rgba(255,156,0,1) 0%,rgba(255,207,131,1) 100%);
 					}
 					&.right1 {
-						height: 39.6%;
+						height: 36.855036855036855%;
 						background:linear-gradient(0deg,rgba(255,99,76,1) 0%,rgba(255,149,135,1) 100%);
 					}
 					&.right2 {
-						height: 26.4%;
+						height: 22.113022113022113%;
 						background:linear-gradient(0deg,rgba(253,173,41,1) 0%,rgba(255,207,75,1) 100%);
 					}
 					&.right3 {
-						height: 26.4%;
+						height: 18.427518427518427%;
 						background:linear-gradient(0deg,rgba(77,186,89,1) 0%,rgba(108,229,126,1) 100%);
 					}
+					&.right4 {
+						height: 18.427518427518427%;
+						background:linear-gradient(0deg,rgba(255,99,76,1) 0%,rgba(255,149,135,1) 100%);
+					}
 				}
 			}
 		}

+ 29 - 0
pages/new.vue

@@ -0,0 +1,29 @@
+<template>
+	<view class="new">
+		<custom-nav :title="pageTitle"></custom-nav>
+		<custom-toast ref='toast'></custom-toast>
+		<view class="content">
+			123123
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pageTitle: 'new'
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+	.new {
+		@include page();
+		.content {
+			background: $custom-nav-borderbot-color;
+			
+		}
+	}
+</style>

+ 2 - 2
pages/rules/rules.vue

@@ -2,7 +2,7 @@
 	<view class="rules">
 		<custom-nav :title="pageTitle"></custom-nav>
 		<view class="content">
-			<view class="title">大卫博士卖货争霸赛规则</view>
+			<view class="title">大卫博士学位争霸赛规则</view>
 			 
 			<view class="title1">【1】三周划分</view>
 			<view class="text">整个比赛时间是连续的21天(三周)</view>
@@ -29,7 +29,7 @@
 			 
 			<view class="title1">【5】其他</view>
 			 
-			 <view class="text">总学分大于30,退9.9元的学费</view>
+			 <view class="text">报名费赛季结束后不予退还</view>
 			
 		</view>
 	</view>

+ 11 - 11
pages/signup/signup.vue

@@ -18,12 +18,12 @@
 					</view>
 					<text class="cuIcon" :class="showDown ? 'cuIcon-fold' : 'cuIcon-unfold'"></text>
 				</view>
-				<view class="title">确认上级代理公司</view>
-				<view class="input">
+				<view v-if="userServerInfo.type == 1" class="title">确认上级代理公司</view>
+				<view v-if="userServerInfo.type == 1" class="input">
 					代理公司:<input placeholder="请输入代理公司信息" v-model="superInfo" class="super" disabled type="text"/>
 				</view>
 			</view>
-			<view class="pay" @tap="signup">缴纳¥9.9报名</view>
+			<view class="pay" @tap="signup">缴纳¥{{ userServerInfo.money }}报名</view>
 		</view>
 	</view>
 </template>
@@ -38,7 +38,7 @@
 				name: '',  //用户名
 				level: '',  //用户等级
 				superInfo: '',  //销售经理信息
-				levelList: ['销售经理', '销售主管'],  //点击下拉数组
+				levelList: ['代理公司', '销售经理', '销售主管'],  //点击下拉数组
 				showList: [],  //下拉选择框里显示的内容
 				loading: false
 			};
@@ -51,6 +51,11 @@
 				return this.$store.state.userServerInfo
 			}
 		},
+		created() {
+			this.name = this.userServerInfo.name,
+			this.level = this.userServerInfo.level_name
+			this.superInfo = this.userServerInfo.super_name
+		},
 		methods: {
 			down (e) {  //点击下拉效果
 				this.showList = []
@@ -102,11 +107,6 @@
 					})
 				}
 			}
-		},
-		created() {
-			this.name = this.userServerInfo.name,
-			this.level = this.userServerInfo.level_name
-			this.superInfo = this.userServerInfo.super_name
 		}
 	}
 </script>
@@ -205,12 +205,12 @@
 			height: 0;
 		}
 		100% {
-			height: 70rpx;
+			height: 140rpx;
 		}
 	}
 	@keyframes down-hide {
 		0% {
-			height: 70rpx;
+			height: 140rpx;
 		}
 		100% {
 			height: 0;

BIN
static/icon/challenge-avatar1.png


BIN
static/icon/challenge-avatar2.png


BIN
static/icon/challenge-bg.png


BIN
static/icon/choose.png


BIN
static/icon/getChallenge.png


BIN
static/icon/index-challenge.png


BIN
static/icon/pk-success.png


+ 8 - 2
store.js

@@ -37,7 +37,13 @@ const store = new Vuex.Store({
 				state.openid = payload.openid
 			}
 			console.log(payload)
-			// payload.signuped = true
+			
+			payload.signuped = true
+			payload.status = 1
+			payload.type = 2
+			// payload.level_name = '代理公司'
+			// payload.money = 1
+			
 			state.userServerInfo = payload //把获取到的用户服务器信息,保存到 vuex 中
 		},
 		HIDEVERIFY (state) { //关闭手机号码验证弹窗
@@ -88,7 +94,7 @@ const store = new Vuex.Store({
 					uni.hideLoading()  //取消loading
 					const login = () => {
 						uni.showLoading({ title: '加载中', mask: true })  //显示loading
-						this.$ajax.get(`${api_onLaunch}?id=${state.id}&sex=${state.userWeixinInfo.avatarUrl}&latitude=${latitude}&longitude=${longitude}&code=${CODE}&avatar=${state.userWeixinInfo.avatarUrl}&openid=${state.openid ? state.openid : '123'}&nickname=${state.userWeixinInfo.nickName}`).then(([ , { data: res }]) => {
+						this.$ajax.get(`${api_onLaunch}?id=${state.id}&sex=${state.userWeixinInfo.gender}&latitude=${latitude}&longitude=${longitude}&code=${CODE}&avatar=${state.userWeixinInfo.avatarUrl}&openid=${state.openid ? state.openid : '123'}&nickname=${state.userWeixinInfo.nickName}`).then(([ , { data: res }]) => {
 							if (res.code === 200) { //当前微信用户已经绑定手机号了
 								state.N401 = 0
 								commit('GETUSERSERVERINFO', res.data)

+ 1 - 1
uni.scss

@@ -6,9 +6,9 @@ $custom-nav-borderbot-height: 4rpx;
 
 @mixin page {
 	height: 100%;
+	overflow: hidden;
 	box-sizing: border-box;
 	border-top: $custom-nav-height solid #FFFFFF;
-	overflow: hidden;
 	.content {
 		height: 100%;
 		box-sizing: border-box;