12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367 |
- <template>
- <view class="index">
- <!-- <tel-verify v-if="showVerify"></tel-verify> -->
- <custom-warn v-if="showWarn"></custom-warn>
- <custom-toast ref='toast'></custom-toast>
- <view class="header-bg"></view>
- <!-- <view class="" @click="gotoyan">
- 预约报名入口
- </view> -->
- <!-- <view class="title" v-if="userServerInfo.season">大卫博士学位争霸赛第{{ userServerInfo.season | numToZh }}季</view> -->
- <view class="title" v-if="userServerInfo.season">大卫博士学位争霸赛第{{ userServerInfo.season}}季</view>
- <view class="user_info_new">
- <view class="userinfo">
- <view class="top" @tap="toself">
- <open-data class="user-pic" type="userAvatarUrl"></open-data>
- <image v-if="userServerInfo.score >= 300" class="hat" src="../../static/icon/hat.png" mode="scaleToFill"></image>
- <view class="user-info">
- <view class="name-grade-level">
- <open-data type="userNickName" class="name"></open-data>
- <view class="grade">{{ userServerInfo.grade === undefined ? '未验证' : userServerInfo.grade }}</view>
- <view class="level" v-if="userServerInfo.level_name">
- <image src="../../static/icon/level.png" mode="scaleToFill"></image>
- <text>{{ userServerInfo.level_name }}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="user-status" v-if="userStatus" :class="(userStatus === '报名截止' || userStatus === '暂未开赛') ? 'end' : ''" @tap="tapUserStatus"> {{userStatus}} </view>
- <view class="score-rank">
- <view class="score">学分:{{ userServerInfo.score ? userServerInfo.score : '0' }}</view>
- <view class="rank">排名:{{ userServerInfo.rank ? userServerInfo.rank : '0' }}</view>
- </view>
- </view>
- <view class="biye_tip" v-if="userServerInfo.signuped">
- <template v-if="userServerInfo.status === 1">
- <view>
- 你已连续参赛{{ userServerInfo.enrol_count }}季,你真棒!继续努力,加油!
- </view>
- </template>
- <template v-else>
- <view v-if="userServerInfo.score === userServerInfo.max_score">
- 您已达到历史最高学分,请继续加油!
- </view>
- <view v-else>
- 距离 {{ userServerInfo.score | willDeg(userServerInfo.max_score) }} 还差 {{ userServerInfo.score | lessScore(userServerInfo.max_score) }} 学分
- </view>
- </template>
- <view v-if="userServerInfo.score === userServerInfo.max_score">
- 你已连续参赛{{ userServerInfo.enrol_count }}季,你真棒!继续努力,加油!
- </view>
- <view v-else>
- 距离 {{ userServerInfo.score | willDeg(userServerInfo.max_score) }} 还差 {{ userServerInfo.score | lessScore(userServerInfo.max_score) }} 学分
- </view>
- </view>
- </view>
- <view v-if="timer" class="index_countdown">
- <text style="font-size: 30rpx;">距{{ timerStatus ? '结束' : '开始' }}仅剩:</text>
- <text class="spec bg1">{{ countDown[0] || '00' }}</text>
- <text class="small">天</text>
- <text class="spec bg2">{{ countDown[1] || '00' }}</text>
- <text class="small">时</text>
- <text class="spec bg3">{{ countDown[2] || '00' }}</text>
- <text class="small">分</text>
- <view class="spec bg4 animate_second" v-if="countDown[3] || countDown[3] === 0">
- <swiper
- :indicator-dots="false"
- :autoplay="false"
- :interval="10000"
- :duration="300"
- :circular="true"
- :vertical="true"
- :current="countA.findIndex(i => +i === Number(countDown[3]))"
- :disable-touch="true"
- class="animate_item"
- >
- <swiper-item v-for="n of countA" :key="n">
- <view class="swiper-item">{{ n }}</view>
- </swiper-item>
- </swiper>
- <swiper
- :indicator-dots="false"
- :autoplay="true"
- :interval="1000"
- :duration="300"
- :circular="true"
- :vertical="true"
- :disable-touch="true"
- :current="countB.findIndex(i => +i === Number(countDown[4]))"
- class="animate_item"
- @change="changeCountTime"
- >
- <swiper-item v-for="n in countB" :key="n">
- <view class="swiper-item">{{ n }}</view>
- </swiper-item>
- </swiper>
- </view>
- <text class="small">秒</text>
- </view>
- <view v-if="messageList.length > 0" class="swiper_parant">
- <view class="message_icon_box">
- <image src="../../static/new/message2.jpg" mode="" class="message_icon"></image>
- <text>恭喜</text>
- </view>
- <swiper class="swiper swiper_message" :indicator-dots="false" :autoplay="true" :circular="true" @animationfinish="changeMessageSwiper" interval="1500">
- <swiper-item
- v-for="(item, i) in messageList"
- :key="i"
- >
- <view class="swiper-item uni-bg-red">{{ item.data }}</view>
- </swiper-item>
- </swiper>
- </view>
- <view class="entrance">
- <!-- <view class="nav_container"> -->
- <view class="index-item item_bg1" @tap="toranking">
- <text class="name">销售排行</text>
- <view v-if="userServerInfo.rank" class="userranking">我的排名:{{ userServerInfo.rank ? userServerInfo.rank : '0' }}</view>
- <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg1.png" class="coverImg cv1">
- </view>
- <view class="index-item item_bg2" @tap="toupload">
- <text class="name">数据上传</text>
- <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg2.png" class="coverImg cv2">
- </view>
- <view class="index-item item_bg3" @tap="toChallenge()">
- <text class="name">挑战竞猜</text>
- <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg3.png" class="coverImg cv3">
- </view>
- <view class="index-item item_bg4" @tap="toOther">
- <text class="name">其他</text>
- <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/index_bg4.png" class="coverImg cv4">
- </view>
- <!-- </view> -->
- </view>
-
-
- <view class="rules" @tap="torules" @longpress="toLongTapIndex">查看赛季规则 <text class="cuIcon-question"></text></view>
-
- <!-- <button v-if="showGetUserInfoButton" class="getUserInfo" type="default" open-type="getUserInfo" @getuserinfo="getuserinfo"></button> -->
- <button class="getUserInfo" type="default" @click="getuserinfo">111</button>
-
- <!-- 学位弹窗 -->
- <page-toast :is-show="isXuefenToast && (userServerInfo.glory_popovers && userServerInfo.glory_popovers.type === 1)">
- <view class="toast_container xuewei_toast" @click="toToastDetail">
- <image class="bg" src="https://api.jiuweiyun.cn/public/uploads/icon/toast8.png"></image>
- <view class="text">{{ userServerInfo.score | userXueWei }}</view>
- </view>
- </page-toast>
- <!-- 学霸弹窗 -->
- <page-toast :is-show="isXuebaToast && (userServerInfo.max_popovers && userServerInfo.max_popovers.type === 10)">
- <view class="toast_container xueba_toast" @click="toToastXueBa">
- <image class="bg" src="https://api.jiuweiyun.cn/public/uploads/icon/toast7.png"></image>
- <view class="text">{{ userServerInfo.level_name }}学霸</view>
- </view>
- </page-toast>
- <!-- 挑战详情 -->
- <page-toast :is-show="isTiaoXhanToast && (userServerInfo.challenge_result && userServerInfo.challenge_result.type === 1)" :is-close="false" :before-close="resetTiaoZhanToast">
- <view class="challenge-num">
- <view class="challenage-num-top">
- <view class="challenage-num-body">
- <view class="challenge-num-item">
- <view>
- <text class="label">参加挑战:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.challenge_num || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- <view>
- <text class="label">参加竞猜:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.guessing_num || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- </view>
- <view class="challenge-num-item">
- <view>
- <text class="label">挑战成功:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.challenge_success || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- <view>
- <text class="label">挑战失败:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.challenge_fail || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- </view>
- <view class="challenge-num-item">
- <view>
- <text class="label">猜赢了:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.guessing_success || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- <view>
- <text class="label">猜输了:</text>
- <text class="spec">
- {{ userServerInfo.challenge_result.data.guessing_fail || 0 }}
- </text>
- <text class="label">场</text>
- </view>
- </view>
- </view>
- </view>
- <view class="challenge-num-btn" @click="toTiaoZhan">查看详情</view>
- </view>
- </page-toast>
- <!-- 发起挑战 -->
- <page-toast :is-show="userServerInfo.cha_nickname" :is-close="false">
- <view class="challenge-invite">
- <view class="challenge-user">
- <view class="user-avatar"></view>
- </view>
- <view class="challenge-title">
- “{{ userServerInfo.cha_nickname | getName }}”向你发起学分挑战 详情可在“我的挑战”列表中查看
- </view>
- <view class="challenage-btn" @click="toChallenge('0')">查看详情</view>
- </view>
- </page-toast>
- <!-- 课程提醒 -->
- <page-toast :is-show="userServerInfo.link && showLink" :before-close="closeCourseLink">
- <scroll-view class="courseDialog" scroll-y="true">
- <image
- :src="userServerInfo.link"
- mode="widthFix"
- class="courseImg"
- @click="toCourseList"
- />
- </scroll-view>
- </page-toast>
- </view>
- </template>
- <script>
- import telVerify from '../../components/tel-verify.vue'
- import customWarn from '../../components/custom-warn.vue'
- import { toast_sure, index_message, course_confim } from '../../api.js'
- import { setInterval, clearInterval } from 'timers'
- import { api_onLaunch } from '../../api.js'
- export default {
- onShareAppMessage () { //分享荣誉证书
- uni.showLoading({ title: '加载中', mask: true }) //显示loading
- return { //如果点击右上角分享按钮,则分享页面为小程序主页
- title: '大卫博士学位争霸赛',
- path: '/pages/index/index'
- }
- },
- onPullDownRefresh() {
- this.routing = false
- if ('wifi2g3g4g'.indexOf(this.networkType) !== -1) { //有网络连接时才进行下一步
- // this.$store.commit('HIDEVERIFY')
- uni.showLoading({ title: '加载中', mask: true }) //显示loading
- this.$store.dispatch('onLaunch').then(() => {
- this.showLink = true
- this.$refs.toast.hover('刷新成功')
- uni.stopPullDownRefresh()
- this.isTiaoXhanToast = true
- }).catch(e => { //触发初始化方法
- this.$refs.toast.hover('服务器繁忙,请下拉刷新试试', 'center')
- })
- } else {
- uni.showToast({ title: '似乎已经断开网络连接', icon: 'none' })
- }
- },
- components: {
- telVerify,
- customWarn
- },
- filters: {
- getName(name) {
- if (name) {
- return name.length > 6 ? name.slice(0, 6) + '...' : name
- }
- return ''
- }
- },
- data() {
- return {
- timer: null,
- now: null,
- isXuefenToast: true,
- isXuebaToast: true,
- filterUserScore: 20,
- isTiaoXhanToast: true,
- messageList: [],
- timerStatus: null,
- countA: [5,4,3,2,1,0],
- countB: [9,8,7,6,5,4,3,2,1,0],
- showLink: true
- }
- },
- computed: {
- showVerify () { //是否弹出手机验证框
- return this.$store.state.showVerify
- },
- showWarn () {
- return this.$store.state.showWarn
- },
- userWeixinInfo () { //用户微信信息
- return this.$store.state.userWeixinInfo
- },
- userServerInfo () { //用户服务器信息
- if(this.$store.state.userServerInfo.report_card && this.$store.state.userServerInfo.report_card.status === 1) {
- let _this = this
- uni.showModal({
- content: '查看成绩单',
- success: function (res) {
- let id = _this.$store.state.userServerInfo.report_card.id
- if (res.confirm) {
- _this.$ajax.get(`${toast_sure}?id=${id}`).then(([, { data: res }]) => {
- uni.navigateTo({ url: '../schoolReport/index' })
- })
- } else if (res.cancel) {
-
- }
- }
- })
- }
- return this.$store.state.userServerInfo
- },
- networkType () { //网络类型
- return this.$store.state.networkType
- },
- showGetUserInfoButton () { //是否显示获取用户信息的透明按钮
- return this.$store.state.showGetUserInfoButton
- },
- userStatus () { //根据赛季阶段和用户类型,显示不同可操作项
- if (this.$verified()) { //如果用户已经登录,进行下一步判断
- if (this.userServerInfo.status) { //如果赛季已经开赛
- if (this.userServerInfo.status === 1) { //如果赛季正处于报名阶段
- if (this.userServerInfo.signuped) { //如果用户已报名
- return '已报名'
- } else { //如果用户未报名,那么可能是 1 用户真没报名 2 批发商 3 客服
- if (this.userServerInfo.type === 1) {
- return '报名参赛'
- } else if (this.userServerInfo.type === 2) {
- return '报名参赛'
- } else if (this.userServerInfo.type === 3) {
- return ''
- }
- }
- } else if (this.userServerInfo.status === 2 || this.userServerInfo.status === 3 || this.userServerInfo.status === 5) { //如果赛季正处于比赛或兑奖阶段
- if (this.userServerInfo.signuped) { //如果用户已报名
- return '学分账单'
- } else { //如果用户未报名,那么可能是 1 用户真没报名 2 批发商 3 客服
- if (this.userServerInfo.type === 1) {
- return '报名截止'
- } else if (this.userServerInfo.type === 2) {
- return '学分账单'
- } else if (this.userServerInfo.type === 3) {
- return ''
- }
- }
- } else if (this.userServerInfo.status === 4) { // 如果赛季正处于报名结束的空档期
- if (this.userServerInfo.signuped) { //如果用户已报名
- return '已报名'
- } else { //如果用户未报名,那么可能是 1 用户真没报名 2 批发商 3 客服
- if (this.userServerInfo.type === 1) {
- return '报名截止'
- } else if (this.userServerInfo.type === 2) {
- return '学分账单'
- } else if (this.userServerInfo.type === 3) {
- return ''
- }
- }
- }
- } else { //如果赛季暂未开赛
- return '暂未开赛'
- }
- } else { //如果用户未登录
- return '绑定账号'
- }
- },
- countDown() {
- let time = this.timerStatus ? this.userServerInfo.end_time : this.userServerInfo.start_time
- const sec = Math.floor((time - this.now) / 1000)
- let day = Math.floor(sec / 86400)
- let hour = Math.floor((sec % 86400) / 3600)
- let minite = Math.floor((sec - 86400 * day - hour * 3600) / 60)
- let second = Math.floor(sec - 86400 * day - hour * 3600 - minite * 60)
- day = day >= 10 ? day : `0${day}`
- hour = hour >= 10 ? hour : `0${hour}`
- minite = minite >= 10 ? minite : `0${minite}`
- second = String(second)
- let arr = [day, hour, minite, second >= 10 ? second[0] : 0, second >= 10 ? second[1] : second]
- return arr
- }
- },
- 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) { //有网络连接时才进行下一步
- let _this = this
- this.$store.dispatch('onLaunch').then(() => {
- // if (this.showVerify === true) {
- // uni.navigateTo({
- // url:'../boundPhone/boundPhone'
- // })
- // }
- uni.stopPullDownRefresh()
- this.init()
- }).catch(e => { //触发初始化方法
- this.$refs.toast.hover('网络可能出了点问题,请下拉刷新试试')
- })
- } else {
- uni.showToast({ title: '似乎已经断开网络连接', icon: 'none' })
- }
- },
- onShow() { //每次展示首页时都初始化一次,达到实时更新数据的功能
- this.routing = false
- this.login()
- if ('wifi2g3g4g'.indexOf(this.networkType) !== -1) { //有网络连接时才进行下一步
- if (uni.fromUpload) {
- uni.fromUpload = false
- if (uni.toRank) {
- uni.toRank = false
- uni.navigateTo({ url: '../ranking/ranking' })
- }
- // this.$store.dispatch('onLaunch').then(() => {
- // uni.stopPullDownRefresh()
- // this.init()
- // }).catch(e => { //触发初始化方法
- // this.$refs.toast.hover('网络可能出了点问题,请下拉刷新试试')
- // })
- }
- } else {
- uni.showToast({ title: '似乎已经断开网络连接', icon: 'none' })
- }
- },
- methods: {
- login() {
- const state = this.$store.state
- uni.showLoading({ title: '加载中', mask: true }) //显示loading
- this.$ajax.get(`${api_onLaunch}?id=${state.id}&sex=${state.userWeixinInfo.gender}&latitude=${state.latitude}&longitude=${state.longitude}&code=${state.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
- this.$store.commit('GETUSERSERVERINFO', res.data)
- uni.hideLoading() //异步操作结束,停止 loading
- this.$ajax.get('/user/account_status').then(([ , { data: res }]) => {
- if(res.code === 200){
- this.init()
- if(res.data.status === 1) {
- uni.reLaunch({
- url:"../loginOutTip/loginOutTip"
- })
- return false
- }
- }
- resolve()
- }).catch(() => {
- resolve()
- })
- } else if (res.code === 300) { //当前微信用户没有绑定手机号,弹出验证码框 // 401 表示 code 过期/失效 openid 获取不到等
- uni.hideLoading() //异步操作结束,停止 loadin
- this.$store.commitcommit('SHOWVERIFY')
- uni.navigateTo({ url: '../boundPhone/boundPhone' })
- resolve()
- } else if (res.code === 401) {
- uni.hideLoading() // 异步操作结束,停止 loading
- reject(500)
- } else { //其他边界情况,提示用户下拉刷新
- uni.hideLoading() // 异步操作结束,停止 loading
- reject(500)
- }
- })
- },
- gotoyan() {
- uni.navigateTo({ url: '../makeApply/makeApply' })
- },
- closeCourseLink() {
- this.$ajax.get(`${course_confim}`).then(([, { data: res }]) => {
- this.showLink = false
- })
- },
- toCourseList() {
- this.$ajax.get(`${course_confim}`).then(([, { data: res }]) => {
- if(res.code === 200) {
- let { end_time, start_time } = this.userServerInfo
- let week = Math.ceil((end_time - start_time) / (7 * 24 * 60 * 60 * 1000))
- uni.navigateTo({
- url: '../course/list?week='+week
- })
- } else {
- uni.showModal({
- content: '课程确认失败',
- showCancel: false
- })
- }
- })
- },
- changeCountTime() {
- this.now = Date.now()
- },
- init() {
- let _this = this
- _this.now = Date.now()
- if(_this.userServerInfo.start_time && _this.userServerInfo.end_time) {
- let { start_time, end_time } = _this.userServerInfo
- if(_this.now > start_time - 5 * 24 * 3600 * 1000 && _this.now < start_time) {
- _this.timerStatus = false
- _this.timer = true
- // _this.timer = setInterval(() => {
- // _this.now = Date.now()
- // }, 1000 * 60)
- } else if (_this.now > start_time && _this.now < end_time) {
- _this.timerStatus = true
- _this.timer = true
- // _this.timer = setInterval(() => {
- // _this.now = Date.now()
- // }, 1000 * 1)
- // 活动期间 获取滚动卖货消息
- _this.index_message()
- } else {
- if (this.timer) {
- // clearInterval(_this.timer)
- _this.timer = null;
- }
- }
- } else {
- if (this.timer) {
- // clearInterval(_this.timer)
- _this.timer = null;
- }
- }
- uni.stopPullDownRefresh()
- },
- changeMessageSwiper({ detail }) {
- let current = detail.current;
- if(current >= this.messageList.length) {
- this.index_message();
- }
- },
- // 获取滚动消息
- index_message() {
- this.$ajax.get(`${index_message}`).then(([, { data: res }]) => {
- if(res.code === 200) {
- this.messageList = res.data.list
- }
- })
- },
- resetTiaoZhanToast() {
- this.isTiaoXhanToast = false
- },
- toTiaoZhan() {
- let toast_id = this.userServerInfo.challenge_result.id
- let _this = this
- this.$ajax.get(`${toast_sure}?id=${toast_id}`).then(([, { data: res }]) => {
- _this.isTiaoXhanToast = false
- _this.toChallenge()
- })
- },
- // 其他
- toOther() {
- uni.navigateTo({
- url:"../other/other"
- })
- },
- // 学霸弹窗
- toToastXueBa() {
- let toast_id = this.userServerInfo.max_popovers.id
- let _this = this
- this.$ajax.get(`${toast_sure}?id=${toast_id}`).then(([, { data: res }]) => {
- _this.isXuebaToast = false
- _this.toChallenge()
- })
- },
- toToastDetail() {
- let toast_id = this.userServerInfo.glory_popovers.id
- let _this = this
- this.$ajax.get(`${toast_sure}?id=${toast_id}`).then(([, { data: res }]) => {
- _this.isXuefenToast = false
- _this.tohonour()
- })
- },
- getuserinfo() { //获取用户信息
- // console.log(111)
- // uni.getUserProfile({
- // desc:'Wexin', // 这个参数是必须的
- // success:res=>{
- // this.$store.commit('HIDEGETUSERINFOBUTTON') //隐藏透明按钮
- // let _this = this
- // this.$store.dispatch('onLaunch').then(()=> {
- // _this.init()
- // }) //触发初始化方法
- // // console.log("用户信息",res.rawData)
- // }
- // })
- // uni.getUserInfo().then(([getUserWeixinInfoErr, userWeixinInfo]) => { //获取完成后
- // if (getUserWeixinInfoErr) {
- // return
- // }
- // this.$store.commit('HIDEGETUSERINFOBUTTON') //隐藏透明按钮
- // let _this = this
- // this.$store.dispatch('onLaunch').then(()=> {
- // _this.init()
- // }) //触发初始化方法
- // })
- },
- toself () { //点击用户信息
- if (this.$verified()) { //用户是否已登录
- 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}` }) //已登录跳转到用户中心
- }
- } else { //未登录弹出登录框
- // this.$store.commit('SHOWVERIFY')
- uni.navigateTo({ url: '../boundPhone/boundPhone' })
- }
- },
- tapUserStatus () { //点击用户状态
- if (this.userStatus === '绑定账号') {
- // this.$store.commit('SHOWVERIFY')
- uni.navigateTo({ url: '../boundPhone/boundPhone' })
- } else if (this.userStatus === '报名参赛') {
- if (this.routing) { return }
- this.routing = true
- uni.navigateTo({ url: '../signup/signup' })
- } else if (this.userStatus === '学分账单') {
- if (this.routing) { return }
- this.routing = true
- uni.navigateTo({ url: '../score/score' })
- } else if (this.userStatus === '报名截止') {
- this.$refs.toast.hover('报名时间已过,非常感谢您的关注。')
- } else if (this.userStatus === '暂未开赛') {
- this.$refs.toast.hover('暂未开赛,非常感谢您的关注。')
- } else if (this.userStatus === '已报名') {
- uni.navigateTo({
- url: "../certificate/notice"
- })
- }
- },
- toranking () { //点击排行榜
- // uni.navigateTo({ url: '../ranking/ranking' })
- if (this.$verified()) { //用户是否已登录
- if (this.userServerInfo.type === 1) { //判断用户类型,普通用户需要报名后才可以查看排行榜
- if (this.userServerInfo.signuped) { //如果用户已报名,就跳转
- if (this.routing) { return }
- this.routing = true
- uni.navigateTo({ url: '../ranking/ranking' })
-
- } else { ////如果用户已报名,就提示用户没有报名
- uni.showModal({
- content:"您还没有报名参赛",
- showCancel:false
- })
- }
- } else { //批发商和客服可以直接查看排行榜页
- if (this.routing) { return }
- this.routing = true
- uni.navigateTo({ url: '../ranking/ranking' })
- }
- } else { //未登录弹出登录框
- // this.$store.commit('SHOWVERIFY')
- uni.navigateTo({ url: '../boundPhone/boundPhone' })
- }
- },
- toupload () { //点击上传图片
-
- // uni.navigateTo({ url: '../upload/upload' })
- // return false
-
- if (this.$verified()) { //用户是否已登录
- if (this.userServerInfo.signuped) {
- if (this.userServerInfo.status === 1 || this.userServerInfo.status === 4) {
- this.$refs.toast.hover('比赛还没有开始')
- } else if (this.userServerInfo.status === 2) {
- if (this.routing) { return }
- this.routing = true
- uni.navigateTo({ url: '../upload/upload' })
- uni.fromUpload = true
- } else if (this.userServerInfo.status === 3 || this.userServerInfo.status === 5) {
- this.$refs.toast.hover('比赛已经结束了')
- }
- } else {
- this.$refs.toast.hover('您还没有报名参赛')
- }
- } else { //未登录弹出登录框
- // this.$store.commit('SHOWVERIFY')
- uni.navigateTo({ url: '../boundPhone/boundPhone' })
- }
- },
- toChallenge(active) { // 点击学分挑战
- // uni.navigateTo({ url: '../challengeList/challengeList'+(active ? `?active=${active}` : '') })
- // return false
- if (this.$verified()) { //用户是否已登录
- if (this.userServerInfo.signuped) { // 用户是否已经报名
- if (this.userServerInfo.level_name === '批发商' || this.userServerInfo.level_name === '经销商') { // 只有批发商能够参加学分竞赛
- if (this.routing) { return }
- this.routing = true
- this.closeChallenge()
- uni.navigateTo({ url: '../challengeList/challengeList'+(active ? `?active=${active}` : '') })
- } else { //批发商和客服不可参赛,所以提示无参赛记录
- this.$refs.toast.hover('只有批发商可以参与挑战')
- }
- } else {
- this.$refs.toast.hover('您还没有报名参赛')
- }
- } else { //未登录弹出登录框
- // this.$store.commit('SHOWVERIFY')
- uni.navigateTo({ url: '../boundPhone/boundPhone' })
- }
- },
- torules () { //点击赛季规则
- if (this.routing) { return }
- this.routing = true
- uni.navigateTo({ url: '../rules/rules' })
- },
- // 长按赛季规则跳转
- toLongTapIndex() {
- uni.navigateTo({ url: '../longTapIndex/longTapIndex' })
- },
- closeChallenge() {
- this.$store.commit('READCHALLENGE')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .challenge-num {
- display: flex;
- flex-direction: column;
- align-items: center;
- .challenage-num-top{
- width: 626rpx;
- height: 612rpx;
- background: url(http://picture.liuliwa.top/new_challenge_toast/7.png) center no-repeat;
- background-size: 100%;
- margin: 0 auto 94rpx auto;
- position: relative;
- .challenage-num-body {
- width: 570rpx;
- height: 385rpx;
- position: absolute;
- bottom: 28rpx;
- left: 28rpx;
- border-radius: 24rpx;
- padding: 84rpx 30rpx 44rpx 30rpx;
- display: flex;
- justify-content: space-between;
- flex-direction: column;
- .challenge-num-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .label {
- color: #5D330D;
- font-size: 32rpx;
- margin-right: 10rpx;
- }
- .spec {
- color: #DD372D;
- font-size: 48rpx;
- }
- }
- }
- }
- .challenge-num-btn {
- width: 502rpx;
- height: 96rpx;
- border-radius: 96rpx;
- background: linear-gradient(180deg, #FEEB71 0%, #F89018 100%);
- color: #984100;
- font-size: 32rpx;
- font-weight: bold;
- line-height: 96rpx;
- text-align: center;
- }
- }
- .challenge-invite {
- display: flex;
- flex-direction: column;
- align-items: center;
- .challenge-user {
- width: 426rpx;
- height: 334rpx;
- margin: 0 auto 48rpx auto;
- background: url(http://picture.liuliwa.top/new_challenge_toast/5.png) center no-repeat;
- background-size: 100%;
- position: relative;
- .user-avatar {
- width: 168rpx;
- height: 168rpx;
- border-radius: 50%;
- position: absolute;
- bottom: 8rpx;
- left: 50%;
- transform: translateX(-50%);
- background-position: center;
- background-repeat: no-repeat;
- background-size: 100%;
- background-color: #007AFF;
- }
- }
- .challenge-title {
- width: 456rpx;
- color: #FFF1AD;
- font-size: 32rpx;
- line-height: 50rpx;
- margin-bottom: 86rpx;
- font-weight: bold;
- }
- .challenage-btn{
- width: 502rpx;
- height: 96rpx;
- border-radius: 96rpx;
- background: linear-gradient(180deg, #FEEB71 0%, #F89018 100%);
- color: #984100;
- font-size: 32rpx;
- font-weight: bold;
- line-height: 96rpx;
- text-align: center;
- }
- }
- .index {
- width: 100%;
- height: 100%;
- position: relative;
- box-sizing: border-box;
- padding: 161rpx 30rpx 0;
- display: flex;
- flex-direction: column;
- .index_countdown {
- width: 100%;
- height: 140rpx;
- background-image: linear-gradient(#4CBA59, #6BE57D);
- color: #FFFFFF;
- border-radius: 6rpx;
- margin-top: 10rpx;
- line-height: 60rpx;
- text-align: center;
- letter-spacing: 4rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 36rpx;
- .bg1 {
- background-color: #FD715D;
- }
- .bg2 {
- background-color: #3397DB;
- }
- .bg3{
- background-color: #F39B11;
- }
- .bg4 {
- // background-color: #B933FF;
- }
- .animate_second {
- display: flex !important;
- justify-content: space-between;
- align-items: center;
- .animate_item {
- flex: 1;
- height: 70rpx;
- &:nth-of-type(1) {
- background-color: #e3abff;
- }
- &:nth-last-of-type(1) {
- background-color: #B933FF;
- }
- text-align: center;
- }
- }
- .spec {
- display: block;
- text-align: center;
- line-height: 70rpx;
- color: #FFFFFF;
- width: 70rpx;
- height: 70rpx;
- border-radius: 10rpx;
- overflow: hidden;
- }
- .small{
- font-size: 24rpx;
- margin: 0 8rpx;
- margin-top: 40rpx;
- }
- }
- .xuefen_toast {
- width: 600rpx;
- height: 760rpx;
-
- .text {
- position: absolute;
- width: 430rpx;
- bottom: 217rpx;
- left: 50%;
- margin-left: -215rpx;
- display: flex;
- justify-content: flex-start;
- flex-wrap: wrap;
- font-size: 28rpx;
- color: #333333;
-
- view {
- width: calc(50% - 10rpx);
- margin-bottom: 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- &:nth-last-child(1), &:nth-last-child(2) {
- margin-bottom: 0;
- }
- &:nth-child(2n) {
- text-align: right;
- margin-left: 20rpx;
- }
- }
- }
- }
-
- .yingzhan_toast {
- width: 574rpx;
- height: 596rpx;
- .text {
- left: 0;
- width: 100%;
- color: #F76454;
- font-size: 36rpx;
- position: absolute;
- text-align: center;
- top: 120rpx;
- }
- }
-
- .xiazhu_toast {
- width: 563rpx;
- height: 653rpx;
-
- .text {
- color: #712722;
- font-size: 28rpx;
- width: 402rpx;
- position: absolute;
- bottom: 188rpx;
- left: 50%;
- margin-left: -201rpx;
-
- text{
- display: block;
- margin-bottom: 20rpx;
- text-align: center;
- &:nth-last-child(1) {
- margin-bottom: 0;
- }
- }
- }
- }
-
- .tiaozhan_toast {
- width: 520rpx;
- height: 755rpx;
- .text {
- color: #712722;
- font-size: 28rpx;
- width: 390rpx;
- position: absolute;
- bottom: 160rpx;
- left: 50%;
- margin-left: -195rpx;
- line-height: 48rpx;
- text-align: center;
- }
- }
-
- .xuewei_toast {
- width: 712rpx;
- height: 750rpx;
-
- .text {
- font-size: 62rpx;
- color: #FFFFFF;
- position: absolute;
- width: 488rpx;
- text-align: center;
- height: 104rpx;
- line-height: 104rpx;
- left: 50%;
- margin-left: -244rpx;
- bottom: 138rpx;
- }
- }
-
- .xueba_toast {
- width: 662rpx;
- height: 685rpx;
-
- .text {
- width: 416rpx;
- text-align: center;
- height: 112rpx;
- line-height: 112rpx;
- color: #FFFFFF;
- font-size: 58rpx;
- position: absolute;
- left: 50%;
- margin-left: -208rpx;
- bottom: 226rpx;
- }
- }
-
- .getUserInfo {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 9999;
- background: rgba(1, 1, 1, 0);
- }
- .header-bg {
- position: absolute;
- z-index: -1;
- top: 0;
- left: 0;
- width: 100%;
- height: 286rpx;
- background: linear-gradient(-2deg, rgba(255,68,54,1) 0%, rgba(254,132,72,1) 100%);
- border-bottom-right-radius: 350rpx 30rpx;
- border-bottom-left-radius: 350rpx 30rpx;
- }
- .title {
- position: absolute;
- top: 70rpx;
- left: 30rpx;
- @include text(34rpx);
- color: #FFFFFF;
- }
- .user_info_new {
- background: linear-gradient(#FFCF82, #FF9C00);
- border-radius: 10rpx;
- .biye_tip {
- height: 64rpx;
- background: rgba(0,0,0,.4);
- color: #FFFFFF;
- font-size: 28rpx;
- padding: 0 22rpx;
- box-sizing: border-box;
- width: 100%;
- line-height: 64rpx;
- border-bottom-left-radius: 10rpx;
- border-bottom-right-radius: 10rpx;
- }
- }
- .userinfo {
- position: relative;
- width: 100%;
- height: 225rpx;
- box-shadow: 0rpx 1rpx 3rpx 0rpx rgba(0, 0, 0, 0.2);
- border-radius:10px;
- box-sizing: border-box;
- padding: 22rpx;
- .top {
- height: 98rpx;
- display: flex;
- align-items: center;
- position: relative;
- .user-pic {
- height: 100%;
- width: 98rpx;
- border-radius: 50%;
- overflow: hidden;
- }
- .hat {
- position: absolute;
- top: -40rpx;
- left: 0px;
- width: 80rpx;
- height: 69.873rpx;
- }
- .user-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- height: 100%;
- margin-left: 16rpx;
- overflow: hidden;
- .progress {
- font-size: 26rpx;
- color: #FFFFFF;
- }
- .name-grade-level {
- height: 100%;
- width: 100%;
- display: flex;
- align-items: center;
- .name {
- font-size: 32rpx;
- color: #FFFFFF;
- max-width: 38%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .grade {
- font-size: 26rpx;
- color: rgba(255,255,255,1);
- margin-left: 16rpx;
- vertical-align: baseline;
- }
- .level {
- margin-left: 18rpx;
- height: 30rpx;
- border-radius: 15rpx;
- font-size: 26rpx;
- background: #FFFFFF;
- color: rgba(250,99,66,1);
- text {
- float: right;
- line-height: 35rpx;
- margin: 0 12rpx;
- }
- image {
- width: 30rpx;
- height: 30rpx;
- float: left;
- }
- }
- }
- }
- }
- .user-status {
- position: absolute;
- width: 170rpx;
- height: 60rpx;
- top: 111rpx;
- right: 0;
- line-height: 62rpx;
- background: #FFFFFF;
- text-align: center;
- border-radius: 30rpx 0 0 30rpx;
- font-size: 32rpx;
- color: rgba(250,99,66,1);
- &.end {
- background: #999999;
- color: #FFFFFF;
- }
- }
- .countdown {
- position: absolute;
- right: 12rpx;
- top: 171rpx;
- display: flex;
- color: #FFFFFF;
- }
- .score, .rank {
- position: absolute;
- left: 32rpx;
- bottom: 35rpx;
- font-size: 32rpx;
- color: rgba(255,255,255,1);
- &.rank {
- left: 294rpx;
- }
- }
- }
- .entrance {
- flex: 1;
- z-index: 1;
- margin: 10rpx 0;
- position: relative;
- display: flex;
- justify-content: flex-start;
- flex-wrap: wrap;
- .nav_container {
- display: flex;
- justify-content: flex-start;
- flex-wrap: wrap;
- }
- .item_bg1 {
- // background-image: url(../../static/new/index_bg1.png);
- background-image: linear-gradient(#79a9fd, #929ef2);
- }
- .item_bg2 {
- // background-image: url(../../static/new/index_bg2.png);
- background-image: linear-gradient(#ff634c, #ff9587);
- }
- .item_bg3 {
- // background-image: url(../../static/new/index_bg3.png);
- background-image: linear-gradient(#fdad29, #ffcf4b);
- }
- .item_bg4 {
- // background-image: url(../../static/new/index_bg4.png);
- background-image: linear-gradient(#d486f9, #b063f8);
- }
- .index-item {
- width: calc(50% - 5rpx);
- position: relative;
- min-height: 285rpx;
- overflow: hidden;
- border-radius:10px;
- box-shadow:0rpx 1rpx 3rpx 0rpx rgba(0, 0, 0, 0.2);
- font-size: 30rpx;
- color: #FFFFFF;
- background-size: 100% 100%;
- background-repeat: no-repeat;
- margin-right: 5rpx;
- margin-bottom: 12rpx;
- &:nth-of-type(2n) {
- margin-right: 0;
- margin-left: 5rpx;
- }
- .name {
- z-index: 1;
- top: 38rpx;
- left: 30rpx;
- color: #FFFFFF;
- font-size: 40rpx;
- position: absolute;
- font-weight: 500;
- }
- view {
- position: absolute;
- left: 30rpx;
- top: 87rpx;
- font-size: 24rpx;
- color: #FFFFFF;
- }
- .coverImg {
- position: absolute;
- }
- .cv1 {
- width: 238rpx;
- height: 260rpx;
- right: 30rpx;
- bottom: 0;
- }
- .cv2 {
- width: 200rpx;
- height: 163rpx;
- right: 44rpx;
- bottom: 31rpx;
- }
- .cv3 {
- width: 275rpx;
- height: 275rpx;
- right: 10rpx;
- bottom: 33rpx;
- }
- .cv4 {
- width: 187rpx;
- height: 187rpx;
- right: 53rpx;
- bottom: 31rpx;
- }
- }
- }
- .rules {
- font-size: 24rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- font-weight: bold;
- color:rgba(243,67,54,1);
- text {
- margin-left: 9rpx;
- }
- }
- .swiper_parant {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background-color: #FF9C00;
- border-radius: 10rpx;
- height: 70rpx;
- margin: 5px 0;
- padding: 0 20rpx;
- box-sizing: border-box;
- // &::before{
- // content: "";
- // display: block;
- // width: 30rpx;
- // height: 30rpx;
- // background-image: url(../../static/new/message.png);
- // background-repeat: no-repeat;
- // background-size: 100% 100%;
- // margin-right: 10rpx;
- // }
- .message_icon_box {
- color: #FA6342;
- font-size: 32rpx;
- width: 135rpx;
- height: 54rpx;
- padding: 14rpx 12rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-right: 20rpx;
- background-color: #FFFFFF;
- border-radius: 8rpx;
- .message_icon {
- width: 32rpx;
- height: 26rpx;
- margin-right: 10rpx;
- }
- }
- }
- .swiper_message {
- flex: 1;
- height: 60rpx;
- box-sizing: border-box;
- line-height: 60rpx;
- color: #FFFFFF;
- font-size: 28rpx;
- }
- .hadChallenge {
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.3);
- @include flex(column);
- z-index: 2;
- .challenage {
- width: 574rpx;
- height: 596rpx;
- position: relative;
- image {
- width: 100%;
- height: 100%;
- }
- .challengeName {
- left: 0;
- width: 100%;
- top: 128rpx;
- color: #F76454;
- font-size: 36rpx;
- position: absolute;
- text-align: center;
- }
- }
- .closeChallenge {
- width: 62rpx;
- height: 62rpx;
- @include flex();
- font-size: 56rpx;
- margin-top: 30rpx;
- border-radius: 50%;
- background: #FFFFFF;
- }
- }
- }
- .courseDialog {
- width: 80%;
- margin: 0 auto;
- height: 700rpx;
- .courseImg {
- display: block;
- width: 100%;
- }
- }
- </style>
|