xtz 4 роки тому
батько
коміт
4b02c3be8e

+ 2 - 2
api/api.js

@@ -66,8 +66,8 @@ module.exports = {
     loadActivitydetails(d, cb) {
       post('/mActivity/searchActivityById', d).then(resolver(cb).done).catch(resolver(cb).fail)
     },
-    loadJoinin(d, cb) {
-      post('small/event_attend', d).then(resolver(cb).done).catch(resolver(cb).fail)
+    loadSaveApply(d, cb) {
+      post('/mActivity/saveApply', d).then(resolver(cb).done).catch(resolver(cb).fail)
     },
   },
   icommunity: {

+ 2 - 1
app.js

@@ -54,6 +54,7 @@ App({
   globalData: {
     userInfo: null,
     appid: 'wx4398d60942bc7710',
-    imgUrl: 'http://cdn.info666.com/'
+    imgUrl: 'https://zmbx.oss-cn-shanghai.aliyuncs.com/'
+    // imgUrl: 'http://cdn.info666.com/'
   }
 })

BIN
imgs/contest/ranking/home.png


+ 20 - 14
pages/activities/activityDetails/activityDetails.js

@@ -1,31 +1,37 @@
 import {
   iactivity
 } from '../../../api/api.js'
-const globalData = getApp().data
+const app = getApp()
 
 Page({
   data: {
-    status: {
-      ready: "即将开始",
-      registering: '马上参加'
-    },
-    curStatus: false
+    imgUrl: app.globalData.imgUrl,
+    activity: {}
   },
 
   clickBotbtn() {
-    if (this.data.curStatus == 'registering') {
-      wx.navigateTo({
-        url: '../register/register?id=' + this.data.activity.id
-      })
-    }
+    // let user = wx.getStorageSync('user')
+    // iactivity.loadSaveApply({
+    //   reqdata: {id: this.data.activity.id}
+    // }, r => {
+    //   wx.showToast({
+    //     title: '活动参加成功!',
+    //     icon: 'none'
+    //   })
+    //   wx.reLaunch({
+    //     url: '/pages/home/home',
+    //   })
+    // })
+    wx.navigateTo({
+      url: '../register/register?id=' + this.data.activity.id
+    })
   },
   onLoad(args) {
     iactivity.loadActivitydetails({
-      event_id: args.id
+      reqdata: {id: args.id}
     }, r => {
       this.setData({
-        activity: r.info,
-        curStatus: r.info.status_attend == '报名中' ? 'registering' : r.info.status_attend == '未开始' ? 'ready' : false
+        activity: r.object,
       })
     })
 

+ 4 - 3
pages/activities/activityDetails/activityDetails.wxml

@@ -1,5 +1,6 @@
+<wxs src="../../../utils/util.wxs" module="format" />
 <view class="wrp fg themebor">
-  <image mode="widthFix" src="{{activity.pic_show}}" class="fullx"></image>
+  <image mode="widthFix" src="{{imgUrl + activity.coverImage}}" class="fullx"></image>
 </view>
 <view class="title wrp fg">
   <text>{{activity.activityTitle}}</text>
@@ -8,7 +9,7 @@
 <view class="intop txtsub col fg">
   <view class="row crosscenter">
     <view class="posrel label txtanti">
-      <image src="../../../imgs/act-tag.png" mode="scaleToFill" class="full"></image>
+      <image src="../../../imgs/act-tag.png" mode="widthFix" class="full"></image>
       <text>活动时间</text>
     </view>
     <text class="acttime">{{activity.activityTime}}</text>
@@ -34,4 +35,4 @@
   </view>
 </view>
 
-<view class="btn {{curStatus}}" bindtap="clickBotbtn" wx:if="{{curStatus}}">{{status[curStatus]}}</view>
+<view class="btn" bindtap="{{format.valueOf(activity.applyEndTime)<format.valueOf()?'':format.valueOf(activity.applyStartTime)>format.valueOf()?'':'clickBotbtn'}}">{{format.valueOf(activity.applyEndTime)<format.valueOf()?'已结束':format.valueOf(activity.applyStartTime)>format.valueOf()?'未开始':'报名中'}}</view>

+ 3 - 5
pages/activities/activityDetails/activityDetails.wxss

@@ -55,9 +55,7 @@ page {
   left: 0;
   right: 0;
   bottom: 0;
-  z-index: 1
+  z-index: 1;
+  color: #000;
+  background-color: #fff;
 }
-
-.btn.registering, .btn.ready {
-  color: #fff
-}

+ 28 - 7
pages/activities/register/register.js

@@ -6,7 +6,7 @@ const app = getApp()
 
 Page({
   data: {
-    gender: '男',
+    gender: 1,
     age_range: ''
   },
   clickRegister() {
@@ -37,12 +37,33 @@ Page({
       })
     }
 
-    delete this.data.showAgegroup
-    delete this.data.__webviewId__
-    iactivity.loadJoinin(this.data, r => {
-      app.data.nav.joininActivityInfo = r.info
-      wx.navigateTo({
-        url: '../registerDone/registerDone'
+    // iactivity.loadJoinin(this.data, r => {
+    //   app.data.nav.joininActivityInfo = r.info
+    //   wx.navigateTo({
+    //     url: '../registerDone/registerDone'
+    //   })
+    // })
+    // console.log(this.data);
+    let {event_id,address,age_range,mobile,gender,realname} = this.data
+    iactivity.loadSaveApply({
+      reqdata: {
+        activityId: event_id-0,
+        address: address,
+        generation: age_range,
+        phone: mobile,
+        sex: gender,
+        userId: wx.getStorageSync('id'),
+        username: realname
+      }
+    }, r => {
+      wx.reLaunch({
+        url: '/pages/home/home',
+        success: () => {
+          wx.showToast({
+            title: '参加活动成功!',
+            icon: 'none'
+          })
+        }
       })
     })
 

+ 12 - 12
pages/activities/register/register.wxml

@@ -12,12 +12,12 @@
     <view class="borbot wrpy row crosscenter item">
       <view class="label">性别</view>
       <view class="radioGroup row">
-        <view class="radio row crosscenter" bindtap="clickRadio" data-v="">
-          <image src="../../../imgs/radio{{gender=='男'?'-checked':''}}.png" mode="aspectFit"></image>
+        <view class="radio row crosscenter" bindtap="clickRadio" data-v="{{1}}">
+          <image src="../../../imgs/radio{{gender==1?'-checked':''}}.png" mode="aspectFit"></image>
           <text>男</text>
         </view>
-        <view class="radio row crosscenter" bindtap="clickRadio" data-v="">
-          <image src="../../../imgs/radio{{gender=='女'?'-checked':''}}.png" mode="aspectFit"></image>
+        <view class="radio row crosscenter" bindtap="clickRadio" data-v="{{2}}">
+          <image src="../../../imgs/radio{{gender==2?'-checked':''}}.png" mode="aspectFit"></image>
           <text>女</text>
         </view>
       </view>
@@ -25,7 +25,7 @@
     <view class="borbot wrpy row crosscenter item">
       <view class="label">年龄</view>
       <view class="flexible row between crosscenter" bindtap="clickAgegroup">
-        <text class="{{!age_range&&'subtxt'}}">{{age_range||'请选择年龄段'}}</text>
+        <text class="{{!age_range&&'subtxt'}}">{{age_range?['','10-19','20-29','30-39','40-49','50-59','60-69','70-79'][age_range]:'请选择年龄段'}}</text>
         <text class="cuIcon-right"> </text>
       </view>
     </view>
@@ -55,13 +55,13 @@
       <view class="action text-blue" bindtap="clickAgegroupModalCancel">取消</view>
     </view>
     <view class="padding-xl txtcenter txtpro">
-      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="10-19">10-19</view>
-      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="20-29">20-29</view>
-      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="30-39">30-39</view>
-      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="40-49">40-49</view>
-      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="50-59">50-59</view>
-      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="60-69">60-69</view>
-      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="70-79">70-79</view>
+      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="{{1}}">10-19</view>
+      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="{{2}}">20-29</view>
+      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="{{3}}">30-39</view>
+      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="{{4}}">40-49</view>
+      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="{{5}}">50-59</view>
+      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="{{6}}">60-69</view>
+      <view class="wrpy borbot" bindtap="clickAgegroupItem" data-agegroup="{{7}}">70-79</view>
     </view>
   </view>
 </view>

+ 3 - 3
pages/community/articleDetails/articleDetails.js

@@ -17,8 +17,8 @@ Page({
   },
   clickPic(e) {
     wx.previewImage({
-      current: this.data.article.upload_url_list[e.currentTarget.dataset.i],
-      urls: this.data.article.upload_url_list
+      current: this.data.imgList[e.currentTarget.dataset.i],
+      urls: this.data.imgList
     })
   },
   clickFavor() {
@@ -107,7 +107,7 @@ Page({
     }, r => {
       console.log(r)
       this.setData({
-        imgList:r.object.filePath.split(','),
+        imgList:r.object.filePath&&r.object.filePath.split(','),
         article: r.object
       })
     })

+ 2 - 2
pages/community/articleDetails/articleDetails.wxml

@@ -2,11 +2,11 @@
   <view class="circle">
     <image src="{{article.avatar}}" mode="scaleToFill" class="avatar"></image>
   </view>
-  <text class="txtsub">{{article.nickname}}</text>
+  <text class="txtsub">{{article.nickname||''}}</text>
 </view>
 
 <view bindtap="hideComments" class="gaptop">
-  <swiper indicator-dots autoplay circular style="height:240px; background: #000">
+  <swiper indicator-dots autoplay circular style="height:240px; background: #fff">
     <swiper-item item-id="{{index}}" wx:for="{{imgList}}" wx:key bindtap="clickPic" data-i="{{index}}">
       <image class="fullx" src="{{imgUrl + item}}" mode="aspectFit" id="img{{index}}"></image>
       <view id="fake{{index}}"></view>

+ 4 - 0
pages/community/articleDetails/articleDetails.wxss

@@ -62,4 +62,8 @@ page {
 
 .comments.show {
   height: 400rpx
+}
+
+.fullx {
+  background: #fff;
 }

+ 2 - 1
pages/community/uploadPics/uploadPics.js

@@ -22,6 +22,7 @@ Page({
       })
     }
     let {article} = this.data
+    article.coverImage = article.imgs[0] && article.imgs[0].url
     article.filePath = article.imgs.map(i=>i.url).join(',')
     delete article.imgs
     icommunity.loadPubArticle({reqdata:article}, r => {
@@ -29,7 +30,7 @@ Page({
         mask: true,
         title: '提交成功',
         success() {
-          setTimeout(wx.navigateBack, 1800)
+          setTimeout(wx.navigateBack, 1300)
         }
       })
     })

+ 1 - 1
pages/community/videoDetails/videoDetails.js

@@ -107,7 +107,7 @@ Page({
       }
     }, r => {
       this.setData({
-        article: r.info
+        article: r.object
       })
     })
   },

+ 34 - 9
pages/contest/answer/answer.js

@@ -22,7 +22,8 @@ Page({
     questionList: [],
     questionTotal: [],
     chooseList: [],
-    time: 0
+    time: 0,
+    allAnswer: false
   },
 
   attendContest () {
@@ -30,15 +31,22 @@ Page({
       let {paperId,questions} = r.object
       this.setData({
         paperId,
-        questionTotal: questions,
-        questionList: questions.filter((item,index)=>index<10)
+        questionTotal: this.shuffle(questions).map(item => {
+          item.options = this.shuffle(item.options)
+          return item
+        })
+      }, () => {
+        this.setData({
+          questionList: this.data.questionTotal.filter((item,index)=>index<10)
+        })
       })
     })
   },
 
   showToggle(e) {
     this.setData({
-      show: !this.data.show
+      show: !this.data.show,
+      allAnswer: this.data.chooseList.every(item => item || item === 0)
     })
   },
 
@@ -82,11 +90,9 @@ Page({
   clickChoose (e) {
     let {questionindex,index} = e.currentTarget.dataset
     let {chooseList} = this.data
-    chooseList[questionindex] = index
+    chooseList[questionindex] = index-0
     this.setData({
       chooseList
-    }, () => {
-      console.log(chooseList);
     })
   },
 
@@ -95,9 +101,9 @@ Page({
     let paperScore = 0
     let questionWrong  = []
     questionTotal.forEach((item,index) => {
-      (chooseList[index]||chooseList[index]==0)&&item.options[chooseList[index]].optionAnswer
+      (chooseList[index]||chooseList[index]===0)&&item.options[chooseList[index]].optionAnswer
       ? paperScore += 2
-      : questionWrong.push({[item.id]: (chooseList[index]||chooseList[index]==0)?item.options[chooseList[index]].optionId:''})
+      : questionWrong.push({[item.id]: (chooseList[index]||chooseList[index]===0)?item.options[chooseList[index]].optionId:''})
     })
     answer.submitUserAnswer({reqdata:{
       paperId,
@@ -111,6 +117,18 @@ Page({
       })
     })
   },
+  // 数组乱序
+  shuffle(arr) {
+    let length = arr.length,
+        r      = length,
+        rand   = 0;
+
+    while (r) {
+        rand = Math.floor(Math.random() * r--);
+        [arr[r], arr[rand]] = [arr[rand], arr[r]];
+    }
+    return arr;
+  },
 
   /**
    * 生命周期函数--监听页面加载
@@ -122,6 +140,13 @@ Page({
         time: ++this.data.time
       })
     }, 1000)
+    let {chooseList} = this.data
+    for (let index = 0; index < 50; index++) {
+      chooseList[index] = null
+    }
+    this.setData({
+      chooseList
+    })
   },
 
   /**

+ 8 - 11
pages/contest/answer/answer.wxml

@@ -1,19 +1,16 @@
 <!--pages/contest/answer/answer.wxml-->
+<wxs src="../../../utils/util.wxs" module="format" />
 <view>
   <image mode="widthFix" src="../../../imgs/contest/answer/bg.png" class="bg"></image>
   <view class="page-title">参加竞赛</view>
   <view class="top">
-    <view class="top-title">您还有
+    <view class="top-title">您已回答
       <view class="time">
-        09:44
-      </view>秒答题
+        {{format.formatTime(time)}}
+      </view>秒!
     </view>
     <view class="top-nav">
-      <view class="{{pagination.page==1?'active':''}}" style="background-image: url({{pagination.page==1?'../../../imgs/contest/answer/nav-bg.png':''}});" bindtap="bindNavTagger" data-index="1">第1-10题</view>
-      <view class="{{pagination.page==2?'active':''}}" style="background-image: url({{pagination.page==2?'../../../imgs/contest/answer/nav-bg.png':''}});" bindtap="bindNavTagger" data-index="2">第11-20题</view>
-      <view class="{{pagination.page==3?'active':''}}" style="background-image: url({{pagination.page==3?'../../../imgs/contest/answer/nav-bg.png':''}});" bindtap="bindNavTagger" data-index="3">第21-30题</view>
-      <view class="{{pagination.page==4?'active':''}}" style="background-image: url({{pagination.page==4?'../../../imgs/contest/answer/nav-bg.png':''}});" bindtap="bindNavTagger" data-index="4">第31-40题</view>
-      <view class="{{pagination.page==5?'active':''}}" style="background-image: url({{pagination.page==5?'../../../imgs/contest/answer/nav-bg.png':''}});" bindtap="bindNavTagger" data-index="5">第41-50题</view>
+      <view class="{{pagination.page==item?'active':''}}" wx:for="{{[1,2,3,4,5]}}" bindtap="bindNavTagger" data-index="{{item}}">第{{(item-1)*10+1}}-{{item*10}}题</view>
     </view>
   </view>
   <view class="content">
@@ -48,10 +45,10 @@
     <image class="" mode="widthFix" src="../../../imgs/contest/answer/left{{pagination.page==1?'':'-active'}}.png" bindtap="{{pagination.page==1?'':'bindNavTagger'}}" data-index="{{pagination.page-1}}"></image>
     <image class="" mode="widthFix" src="../../../imgs/contest/answer/right{{pagination.page==5?'':'-active'}}.png" bindtap="{{pagination.page==5?'':'bindNavTagger'}}" data-index="{{pagination.page+1}}"></image>
   </view> -->
-  <view class="next-one" style="background-image: url('../../../imgs/contest/answer/confim-button-bg.png');" data-index="2" bindtap="{{isupdate?'showToggle':'bindNavTagger'}}" wx:if="{{!pattern&&pagination.page==1||isupdate}}">{{isupdate?'提交':'下一页'}}</view>
+  <view class="next-one" data-index="2" bindtap="{{isupdate?'showToggle':'bindNavTagger'}}" wx:if="{{!pattern&&pagination.page==1||isupdate}}">{{isupdate?'提交':'下一页'}}</view>
   <view class="button-group-R" wx:else>
     <view class="back" bindtap="{{pattern?'updateTagger':'bindNavTagger'}}" data-index="{{pagination.page-1}}">{{pattern?'修改':'上一页'}}</view>
-    <view class="next" style="background-image: url('../../../imgs/contest/answer/confim-button-bg-2.png');" bindtap="{{pagination.page==5?'showToggle':'bindNavTagger'}}" data-index="{{pagination.page+1}}">{{pagination.page==5?'提交':'下一页'}}</view>
+    <view class="next" bindtap="{{pagination.page==5?'showToggle':'bindNavTagger'}}" data-index="{{pagination.page+1}}">{{pagination.page==5?'提交':'下一页'}}</view>
   </view>
 
   <!-- 确认框 -->
@@ -61,7 +58,7 @@
     <image mode="widthFix" class="confirm-bg" src="../../../imgs/contest/answer/confirm-bg.png"></image>
     <view class="confirm-content">
       <image mode="widthFix" class="warning-icon" src="../../../imgs/contest/answer/warning.png"></image>
-      <view class="confim-title">{{isupdate?'您的答题已修改,确认提交吗?':'您未答完全部题,确认提交吗?'}}</view>
+      <view class="confim-title">{{allAnswer?'您已答完全部题,确认提交吗?':isupdate?'您的答题已修改,确认提交吗?':'您未答完全部题,确认提交吗?'}}</view>
       <view class="button-group" wx:if="{{!isupdate}}">
         <view bindtap="patternToggle">预览答题</view>
         <view bindtap="clickConfim">提交</view>

+ 18 - 22
pages/contest/answer/answer.wxss

@@ -56,15 +56,13 @@ page {
   margin: 0 10rpx;
 }
 .top-nav .active {
-  margin: 0!important;
-  font-size: 28rpx;
+  font-size: 24rpx;
   font-weight: 500;
   color: #59598D;
-  background-repeat:no-repeat;
-  background-size:100% 100%;
-  -moz-background-size:100% 100%;
-  height: 92rpx;
-  width: 188rpx;
+  background-color: #fff;
+  border-radius: 100rpx;
+  height: 52rpx;
+  width: 138rpx;
   display: flex;
   justify-content: center;
   align-items: center;
@@ -125,8 +123,8 @@ page {
   font-size: 28rpx;
   font-weight: 400;
   color: #353333;
-  line-height: 68rpx;
-  padding: 0 38rpx;
+  line-height: 34rpx;
+  padding: 17rpx 38rpx;
 }
 .active-R {
   color: #FD8011!important;
@@ -157,14 +155,13 @@ page {
   margin: 0 18rpx;
 }
 .next-one {
-  width: 656rpx;
-  height: 156rpx;
-  margin: auto;
-  background-repeat:no-repeat;
-  background-size:100% 100%;
-  -moz-background-size:100% 100%;
+  width: 600rpx;
+  height: 100rpx;
+  margin: 30rpx auto;
+  background-image: linear-gradient(to right, #57A8EF, #6247FF);
+  border-radius: 100rpx;
   text-align: center;
-  line-height: 156rpx;
+  line-height: 100rpx;
   font-size: 28rpx;
   font-weight: 600;
   color: #FFFFFF;
@@ -188,13 +185,12 @@ page {
   margin: 0 10rpx;
 }
 .next {
-  width: 340rpx;
-  height: 152rpx;
-  background-repeat:no-repeat;
-  background-size:100% 100%;
-  -moz-background-size:100% 100%;
+  width: 284rpx;
+  height: 96rpx;
+  background-image: linear-gradient(to right, #57A8EF, #6247FF);
+  border-radius: 96rpx;
   text-align: center;
-  line-height: 152rpx;
+  line-height: 96rpx;
   font-size: 28rpx;
   font-weight: 600;
   color: #FFFFFF;

+ 28 - 13
pages/contest/info/info.js

@@ -11,12 +11,20 @@ Page({
     sexList: [{label:'男',value:1},{label:'女',value:2}],
     form: {},
     areaList: [],
-    school: []
+    sortList: [
+      {name:'actualName',title:'姓名'},
+      {name:'sex',title:'性别'},
+      {name:'age',title:'年龄'},
+      {name:'area',title:'区域'},
+      {name:'school',title:'学校'},
+      {name:'grade',title:'年级'}
+    ],
+    jgList: [true,true,true,true,true,true]
   },
 
   changeInput (e) {
     const id = e.currentTarget.id;
-    const value = e.detail.value;
+    let value = (id === 'age' ? e.detail.value.replace(/\D/g, '')-0 : e.detail.value)
     this.setData({
       ['form.'+id]: value
     })
@@ -58,19 +66,29 @@ Page({
         id: this.data.form[id]
       }},r => {
         this.setData({
-          schoolList: r.list
+          schoolList: r.list,
+          ['form.school']: null
         })
       })
     })
   },
 
   submit (e) {
-    let {actualName,age,area,grade,other,school} = this.data.form
-    let id = wx.getStorageSync('id')
-    imine.updateUser({reqdata:{actualName,age,area,grade,other,school,id}},r => {
-      this.loadMyinformation()
-      wx.navigateTo({
-        url: '/pages/contest/answer/answer'
+    let {actualName,sex,age,area,grade,other,school} = this.data.form
+    let {sortList} = this.data
+    this.setData({
+      jgList: sortList.map(item => !!this.data.form[item.name])
+    }, () => {
+      if (!sortList.every(item => this.data.form[item.name])) {
+        console.log(this.data.jgList);
+        return
+      }
+      let id = wx.getStorageSync('id')
+      imine.updateUser({reqdata:{actualName,sex,age,area,grade,other,school,id}},r => {
+        this.loadMyinformation()
+        wx.navigateTo({
+          url: '/pages/contest/answer/answer'
+        })
       })
     })
   },
@@ -86,10 +104,7 @@ Page({
   loadMyinformation() {
     let id = wx.getStorageSync('id')
     imine.loadMyinformation({reqdata: {id}},r => {
-      wx.setStorage({
-        key: 'user',
-        data: r.object
-      })
+      wx.setStorageSync('user', r.object)
     })
   },
 

+ 28 - 3
pages/contest/info/info.wxml

@@ -10,6 +10,11 @@
         <input bindinput="changeInput" id="actualName" placeholder="请输入" placeholder-class="phcolor"></input>
       </view>
     </view>
+    
+    <view class="{{jgList[0]?'hidden':'warning'}}" wx:if="{{!jgList[0]}}">
+      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
+      <view class="warning-text">请填写学校完整名称</view>
+    </view>
 
     <view class="form-item">
       <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
@@ -26,14 +31,24 @@
       </view>
     </view>
 
+    <view class="{{jgList[1]?'hidden':'warning'}}" wx:if="{{!jgList[1]}}">
+      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
+      <view class="warning-text">请填写学校完整名称</view>
+    </view>
+
     <view class="form-item">
       <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
       <view class="content">
         <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">年龄</view>
-        <input bindinput="changeInput" id="age" placeholder="请输入" placeholder-class="phcolor"></input>
+        <input bindinput="changeInput" id="age" value="{{form.age}}" maxlength="{{2}}" placeholder="请输入" placeholder-class="phcolor"></input>
       </view>
     </view>
 
+    <view class="{{jgList[2]?'hidden':'warning'}}" wx:if="{{!jgList[2]}}">
+      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
+      <view class="warning-text">请填写学校完整名称</view>
+    </view>
+
     <view class="form-item">
       <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
       <view class="content">
@@ -49,6 +64,11 @@
       </view>
     </view>
 
+    <view class="{{jgList[3]?'hidden':'warning'}}" wx:if="{{!jgList[3]}}">
+      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
+      <view class="warning-text">请填写学校完整名称</view>
+    </view>
+
     <view class="form-item">
       <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
       <view class="content">
@@ -65,7 +85,7 @@
       </view>
     </view>
 
-    <view class="warning">
+    <view class="{{jgList[4]?'hidden':'warning'}}" wx:if="{{!jgList[4]}}">
       <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
       <view class="warning-text">请填写学校完整名称</view>
     </view>
@@ -78,6 +98,11 @@
       </view>
     </view>
 
+    <view class="{{jgList[5]?'hidden':'warning'}}" wx:if="{{!jgList[5]}}">
+      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
+      <view class="warning-text">请填写学校完整名称</view>
+    </view>
+
     <view class="form-item">
       <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
       <view class="content">
@@ -87,7 +112,7 @@
     </view>
   </view>
   <view class="button" bindtap="submit">
-    <image class="button-bg" mode="widthFix" src="../../../imgs/contest/button-bg.png"></image>
+    <!-- <image class="button-bg" mode="widthFix" src="../../../imgs/contest/button-bg.png"></image> -->
     <view class="button-text">Start Now !</view>
   </view>
 </view>

+ 10 - 2
pages/contest/info/info.wxss

@@ -82,17 +82,24 @@ input, .select {
   z-index: 0;
 }
 .button-text {
+  background-image: linear-gradient(to right, #57A8EF, #6247FF);
+  width: 656rpx;
+  height: 110rpx;
+  border-radius: 120rpx;
+  text-align: center;
   position: relative;
   z-index: 9;
   color: #FFFFFF;
   font-size: 48rpx;
-  line-height: 58rpx;
+  line-height: 110rpx;
 }
 
 .warning {
   display: flex;
   align-items: center;
   height: 55rpx;
+  position: relative;
+  z-index: 10;
 }
 .warning-icon {
   width: 36rpx;
@@ -102,4 +109,5 @@ input, .select {
   font-size: 28rpx;
   font-weight: 400;
   color: #59598D;
-}
+}
+

+ 13 - 6
pages/contest/ranking/ranking.js

@@ -9,9 +9,9 @@ Page({
    */
   data: {
     page: 1,
-    first: '',
-    second: '',
-    third: '',
+    first: {},
+    second: {},
+    third: {},
     dataList: []
   },
 
@@ -20,9 +20,9 @@ Page({
       type
     }},r => {
       this.setData({
-        first: r.list[0],
-        second: r.list[1],
-        third: r.list[2],
+        first: r.list[0]||{},
+        second: r.list[1]||{},
+        third: r.list[2]||{},
         dataList: r.list.filter((item,index) => index>2),
         page: type
       })
@@ -32,6 +32,13 @@ Page({
   togglePage(e) {
     this.getRankingList(e.currentTarget.dataset.index-0)
   },
+
+  goHome (e) {
+    wx.reLaunch({
+      url: '/pages/home/home',
+    })
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */

+ 7 - 3
pages/contest/ranking/ranking.wxml

@@ -1,6 +1,7 @@
 <!--pages/contest/ranking/ranking.wxml-->
 <view>
   <image src="../../../imgs/contest/ranking/bg.png" class="bg"></image>
+  <image src="../../../imgs/contest/ranking/home.png" class="home" bindtap="goHome"></image>
   <view class="page-title">排行榜</view>
   <view class="content">
     <view class="navList">
@@ -9,24 +10,27 @@
       <view class="{{page==3&&'active'}}" bindtap="togglePage" data-index="3">学校排名</view>
     </view>
     <view class="ranking-top">
-      <view class="second" wx:if="{{second}}">
+      <view class="second" wx:if="{{second.userId}}">
         <image src="{{second.avatar}}"></image>
         <view class="num">2</view>
         <view class="nickname">{{second.nickname}}</view>
         <view class="fraction">{{second.score}}分</view>
       </view>
-      <view class="first" wx:if="{{first}}">
+      <view class="second" wx:else></view><!-- 占位 -->
+      <view class="first" wx:if="{{first.userId}}">
         <image src="{{first.avatar}}"></image>
         <view class="num">1</view>
         <view class="nickname">{{first.nickname}}</view>
         <view class="fraction">{{first.score}}分</view>
       </view>
-      <view class="third" wx:if="{{third}}">
+      <view class="first" wx:else></view><!-- 占位 -->
+      <view class="third" wx:if="{{third.userId}}">
         <image src="{{third.avatar}}"></image>
         <view class="num">3</view>
         <view class="nickname">{{third.nickname}}</view>
         <view class="fraction">{{third.score}}分</view>
       </view>
+      <view class="third" wx:else></view><!-- 占位 -->
     </view>
     <view class="ranking-list">
       <view class="ranking-item" wx:for="{{dataList}}" wx:key="index">

+ 12 - 1
pages/contest/ranking/ranking.wxss

@@ -5,6 +5,14 @@
   position: fixed;
   z-index: 0;
 }
+.home {
+  width: 40rpx;
+  height: 40rpx;
+  position: fixed;
+  top: 70rpx;
+  left: 50rpx;
+  z-index: 99;
+}
 .page-title {
   position: relative;
   z-index: 1;
@@ -52,6 +60,7 @@
   flex-direction: column;
 }
 .second, .third {
+  width: 160rpx;
   margin-top: 60rpx;
 }
 .second > image, .third > image {
@@ -112,9 +121,11 @@
   height: 144rpx;
 }
 .order-num {
+  width: 40rpx;
   font-size: 32rpx;
   color: #FFFFFF;
-  margin: 0 48rpx 0 44rpx;
+  text-align: center;
+  margin: 0 38rpx 0 34rpx;
 }
 .ranking-item > image {
   width: 88rpx;

+ 6 - 3
pages/contest/score/score.js

@@ -76,13 +76,16 @@ Page({
     if (e.from === 'button') {
       console.log(e.target)
     }
-    let {userInfo}  = app.globalData
+    let {nickname}  = wx.getStorageSync('user')
     return {
-      title: `${userInfo.nickname||'我'}@你,赢得高分,等你挑战!`,
+      title: `${nickname||'我'}@你,赢得高分,等你挑战!`,
       path: 'pages/home/home',
       imageUrl: '../../../imgs/home/banner.png',
       success: function (res) {
-        console.log('成功', res)
+        wx.showToast({
+          title: '分享成功!',
+          icon: 'none'
+        })
       }
     }
   }

+ 14 - 9
pages/home/home.js

@@ -15,10 +15,7 @@ Page({
       this.setData({
         user: Object.assign(this.data.user, r.object)
       })
-      wx.setStorage({
-        key: 'user',
-        data: this.data.user
-      })
+      wx.setStorageSync('user', this.data.user)
     })
   },
   loadMyActivities() {
@@ -115,7 +112,7 @@ Page({
         rows: 10
       }
     },
-    isRegister: wx.getStorageSync('user')?wx.getStorageSync('user').isRegister:null
+    // isRegister: wx.getStorageSync('user')?wx.getStorageSync('user').isRegister:null
   },
   loadArticles() {
     icommunity.loadArticles(this.data.community.pagination, r => {
@@ -215,6 +212,11 @@ Page({
     })
   },
   clickActivity(e) {
+    if (!this.data.user || !this.data.user.id) {
+      return this.setData({
+        showAuthPanel: true
+      })
+    }
     app.data.nav.activityDetails = this.data.activity.list[e.currentTarget.dataset.i]
     wx.navigateTo({
       url: '../activities/activityDetails/activityDetails?id=' + e.currentTarget.dataset.id
@@ -265,7 +267,7 @@ Page({
     })
   },
   clickAddtidings() {
-    if (!this.data.user) {
+    if (!this.data.user || !this.data.user.id) {
       return this.setData({
         showAuthPanel: true
       })
@@ -384,6 +386,12 @@ Page({
       url: e.currentTarget.dataset.url,
     })
   },
+  clickStudy () {
+    wx.showToast({
+      title: '该功能尚未开放,敬请期待!',
+      icon: 'none'
+    })
+  },
   getUserInfo (e) {
     wx.login({
       success: r => {
@@ -401,9 +409,6 @@ Page({
               wx.setStorageSync('openId', r.object.openId)
               this.loadMyinformation()
               this.clickHideAuthPanel()
-              this.setData({
-                isRegister: r.object.isRegister
-              })
             })
           },
         })

+ 15 - 6
pages/home/home.wxml

@@ -1,4 +1,5 @@
 <!-- home -->
+<wxs src="../../utils/util.wxs" module="format" />
 <view class="home fg" wx:if="{{curNav == 0}}">
   <view style="overflow:hidden">
     <view class="swiperContainer">
@@ -13,7 +14,7 @@
   <view class="home-nav-list">
     <image src="../../imgs/home/nav-bg.png"></image>
     <view class="home-nav-select">
-      <view class="contest" bindtap="toLink" data-url="{{isRegister?'/pages/contest/answer/answer':'/pages/contest/info/info'}}">
+      <view class="contest" bindtap="toLink" data-url="{{user.isRegister?'/pages/contest/answer/answer':'/pages/contest/info/info'}}">
         <image mode="widthFix" src="../../imgs/home/contest.png"></image>
         <view>参加竞赛</view>
       </view>
@@ -22,7 +23,7 @@
         <view>排行榜</view>
       </view>
       <!-- <view class="study" bindtap="toLink" data-url="/pages/contest/answer/answer"> -->
-      <view class="study">
+      <view class="study" bindtap="clickStudy">
         <image mode="widthFix" src="../../imgs/home/study.png"></image>
         <view>在线学习</view>
       </view>
@@ -120,7 +121,11 @@
   <view class="activityContainer">
     <view class="activity" bindtap="clickActivity" wx:for="{{activity.list}}" wx:key data-i="{{index}}" data-id="{{item.id}}">
       <image src="{{imgUrl + item.coverImage}}"></image>
-      <view class="tag {{item.status_attend=='已结束'?'finished':item.status_attend=='未开始'?'ready':'signing'}}" wx:if="{{item.status_attend}}">{{item.status_attend}}</view>
+      <!-- <view class="tag {{item.status_attend=='已结束'?'finished':item.status_attend=='未开始'?'ready':'signing'}}" wx:if="{{item.status_attend}}">{{item.status_attend}}</view> -->
+       <view class="tag {{(format.valueOf(item.applyEndTime)<format.valueOf())?'finished':(format.valueOf(item.applyStartTime)>format.valueOf())?'ready':'signing'}}" wx:if="{{item}}">
+        <!-- {{format.valueOf(item.applyEndTime)<format.valueOf()?'已结束':format.valueOf(item.applyStartTime)>format.valueOf()?'报名中':'未开始'}} -->
+        {{(format.valueOf(item.applyEndTime)<format.valueOf())?'已结束':(format.valueOf(item.applyStartTime)>format.valueOf())?'未开始':'报名中'}}
+       </view>
       <view class="skiing">{{item.activityTitle}}</view>
     </view>
 
@@ -135,6 +140,7 @@
       <input focus wx:if="{{searchOn}}" bindblur="blurSearch" bindinput="inputSearch"></input>
       <text class="cuIcon-search" wx:if="{{!searchOn}}"> 请输入活动关键字查询</text>
     </view>
+    <button bindtap="clickAddtidings">发布</button>
   </view>
   <view class="bfc">
     <!-- item -->
@@ -155,7 +161,7 @@
                 <image src="{{item.avatar}}" class="full"></image>
               </view>
               <view class="flexible noscroll nowrap-ell">
-                <text>{{item.nickname}}</text>
+                <text>{{item.nickname||''}}</text>
               </view>
             </view>
             <view class="row crosscenter favor" catchtap="clickFavorite" data-i="{{index}}" data-id="{{item.id}}" data-isCollect="{{!!item.isCollect}}">
@@ -183,7 +189,7 @@
     </view>
     <view class="gapleft">
       <view class="txtbold txtlg imgsmr row bot gapbot">
-        <text>{{user.realname || user.nickname}}</text>
+        <text>{{user.realname || user.nickname || ''}}</text>
         <image src="../../imgs/{{user.sex==1?'male':'female'}}.png" style="margin-bottom: 6rpx" class="gapleft"></image>
       </view>
       <text class="txtsub subtxt">{{user.introduction||'这个家伙很懒,什么都没留下...'}}</text>
@@ -309,7 +315,10 @@
       <image src="../../imgs/nav/activity{{curNav==1? '-active':''}}.png"></image>
       <view>活动</view>
     </view>
-    <view class="release" bindtap="clickAddtidings" >
+    <!-- <view class="release" bindtap="clickAddtidings" >
+      <image mode="widthFix" src="../../imgs/nav/release.png"></image>
+    </view> -->
+    <view class="release" bindtap="toLink" data-url="{{user.isRegister?'/pages/contest/answer/answer':'/pages/contest/info/info'}}">
       <image mode="widthFix" src="../../imgs/nav/release.png"></image>
     </view>
     <view class="community" bindtap="clickNav" data-cur="2">

+ 34 - 12
pages/home/home.wxss

@@ -153,10 +153,20 @@ page {
   padding: var(--sizenor);
   color: var(--colorp);
   font-size: var(--txtsub);
+  display: flex;
+  justify-content: space-between;
+}
+.searchContainer > button {
+   flex: 1;
+   margin-left: 20rpx;
+   border-radius: 100rpx;
+   background-image: linear-gradient(to right, #57A8EF, #6247FF);
+   color: #fff;
+   font-size: 30rpx;
 }
-
 .search {
   padding: 0.5em 1em;
+  flex: 4;
   border-radius: 40rpx;
   background-color: #efefef;
   height: 45rpx;
@@ -494,36 +504,48 @@ page {
   z-index: 0;
 }
 .news-list .news-list-content .news-list-item .content {
-  padding: 56rpx 60rpx 68rpx 50rpx;
+  padding: 46rpx 60rpx 48rpx 50rpx;
   box-sizing: border-box;
   display: flex;
   position: relative;
   z-index: 9;
 }
 .news-list .news-list-content .news-list-item .content .left{
-  width: 292rpx;
-  height: 174rpx;
+  margin-top: 15rpx;
+  width: 232rpx;
+  height: 154rpx;
   margin-right: 34rpx;
   position: relative;
   z-index: 0;
 }
+.news-list .news-list-content .news-list-item .content .right {
+  display: flex;
+  justify-content: center;
+  flex-direction: column;
+}
 .news-list .news-list-content .news-list-item .content .right .title {
-  width: 312rpx;
-  height: 44rpx;
-  font-size: 32rpx;
+  width: 372rpx;
+  min-height: 44rpx;
+  font-size: 26rpx;
   font-weight: bold;
   color: #262626;
-  line-height: 44rpx;
-  margin-bottom: 14rpx;
+  line-height: 27rpx;
+  margin-bottom: 10rpx;
+  text-overflow: -o-ellipsis-lastline;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 4;
+  line-clamp: 4;
+  -webkit-box-orient: vertical;
 }
 .news-list .news-list-content .news-list-item .content .right .introduce {
-  width: 288rpx;
+  width: 372rpx;
   height: 68rpx;
   font-size: 24rpx;
   font-weight: bold;
   color: #868AA8;
-  line-height: 34rpx;
-  margin-bottom: 12rpx;
+  line-height: 24rpx;
   text-overflow: -o-ellipsis-lastline;
   overflow: hidden;
   text-overflow: ellipsis;

+ 26 - 16
pages/hotnews/hotnews/hotnews.wxss

@@ -3,7 +3,7 @@ page {
   min-height: 100.1vh
 }
 
-.article {
+/* .article {
   padding: var(--sizenor) 0;
   border-bottom: var(--themebor);
 }
@@ -49,13 +49,11 @@ page {
   display: -webkit-flex;
 }
 
-.hotNews {
-  padding: var(--sizenor);
-}
+
 
 .article .attr {
   align-items: center;
-}
+} */
 
 .news-list-content .news-list-item{
   position: relative;
@@ -67,36 +65,48 @@ page {
   z-index: 0;
 }
 .news-list-content .news-list-item .content {
-  padding: 56rpx 60rpx 68rpx 50rpx;
+  padding: 46rpx 60rpx 48rpx 50rpx;
   box-sizing: border-box;
   display: flex;
   position: relative;
   z-index: 9;
 }
 .news-list-content .news-list-item .content .left{
-  width: 292rpx;
-  height: 174rpx;
+  margin-top: 15rpx;
+  width: 232rpx;
+  height: 154rpx;
   margin-right: 34rpx;
   position: relative;
   z-index: 0;
 }
+.news-list-content .news-list-item .content .right {
+  display: flex;
+  justify-content: center;
+  flex-direction: column;
+}
 .news-list-content .news-list-item .content .right .title {
-  width: 312rpx;
-  height: 44rpx;
-  font-size: 32rpx;
+  width: 372rpx;
+  min-height: 44rpx;
+  font-size: 26rpx;
   font-weight: bold;
   color: #262626;
-  line-height: 44rpx;
-  margin-bottom: 14rpx;
+  line-height: 27rpx;
+  margin-bottom: 10rpx;
+  text-overflow: -o-ellipsis-lastline;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 4;
+  line-clamp: 4;
+  -webkit-box-orient: vertical;
 }
 .news-list-content .news-list-item .content .right .introduce {
-  width: 288rpx;
+  width: 372rpx;
   height: 68rpx;
   font-size: 24rpx;
   font-weight: bold;
   color: #868AA8;
-  line-height: 34rpx;
-  margin-bottom: 12rpx;
+  line-height: 24rpx;
   text-overflow: -o-ellipsis-lastline;
   overflow: hidden;
   text-overflow: ellipsis;

+ 7 - 4
pages/mine/myinfo/edit/edit.js

@@ -5,6 +5,7 @@ import {
 Page({
   data: {
     user: {},
+    inputText: '',
     modalKeys: {
       realname: '姓名',
       mobile: '联系方式',
@@ -21,13 +22,14 @@ Page({
   },
   changeBirthday(e) {
     this.data.user['birthday'] = e.detail.value
-    imine.loadEditMyinformation(this.data.user, r => {
+    imine.updateUser({reqdata: this.data.user}, r => {
       this.loadMyinformation()
     })
   },
   clickConfirm() {
+    console.log(this.data)
     this.data.user[this.data.modalKey] = this.data.inputInfo
-    imine.loadEditMyinformation(this.data.user, r => {
+    imine.updateUser({reqdata: this.data.user}, r => {
       this.setData({
         inputInfo: '',
         modalKey: ''
@@ -53,6 +55,7 @@ Page({
   },
   clickInfo(e) {
     let k = e.currentTarget.dataset.key
+    console.log(e)
     this.setData({
       modalKey: k,
       inputText: this.data.user[k],
@@ -60,7 +63,7 @@ Page({
     })
   },
   loadMyinformation() {
-    imine.loadMyinformation({reqdata:{id:1}},r => {
+    imine.loadMyinformation({reqdata:{id:wx.getStorageSync('id')}},r => {
       this.setData({
         user: Object.assign(this.data.user, r.userinfo)
       })
@@ -80,7 +83,7 @@ Page({
       },
     })
 
-    this.loadMyinformation()
+    // this.loadMyinformation()
     this.setData({
       endDate: new Date().format('yyyy-MM-dd'),
     })

+ 14 - 14
pages/mine/myinfo/edit/edit.wxml

@@ -2,13 +2,13 @@
   <view class="gapleft">
     <view class="borbot row crosscenter item">
       <text>姓名     </text>
-      <view class="subtxt flexible">{{user.realname||user.nickname}}</view>
-      <view class="cuIcon-right wrpy wrprlg" bindtap="clickInfo" data-key="realname"></view>
+      <view class="subtxt flexible">{{user.actualName ||user.nickname}}</view>
+      <view class="cuIcon-right wrpy wrprlg" bindtap="clickInfo" data-key="actualName"></view>
     </view>
     <view class="borbot row crosscenter item">
       <text>性别     </text>
-      <view class="subtxt flexible">{{user.gender}}</view>
-      <text class="cuIcon-right wrpy wrprlg" bindtap="clickInfo" data-key="gender"></text>
+      <view class="subtxt flexible">{{['','男','女'][user.sex]}}</view>
+      <text class="cuIcon-right wrpy wrprlg" bindtap="clickInfo" data-key="sex"></text>
     </view>
     <view class="wrpy wrprlg borbot row crosscenter item">
       <text>出生年月   </text>
@@ -21,13 +21,13 @@
     </view>
     <view class="borbot row crosscenter item">
       <text>联系方式   </text>
-      <view class="subtxt flexible">{{user.mobile||'-'}}</view>
-      <text class="wrpy wrprlg cuIcon-right" bindtap="clickInfo" data-key="mobile"></text>
+      <view class="subtxt flexible">{{user.phone||'-'}}</view>
+      <text class="wrpy wrprlg cuIcon-right" bindtap="clickInfo" data-key="phone"></text>
     </view>
     <view class="borbot row crosscenter item">
       <text>自我介绍   </text>
-      <view class="subtxt flexible">{{user.brief_intro||'介绍一下,让更多朋友认识你'}}</view>
-      <text class="wrpy wrprlg cuIcon-right" bindtap="clickInfo" data-key="brief_intro"></text>
+      <view class="subtxt flexible">{{user.introduction||'介绍一下,让更多朋友认识你'}}</view>
+      <text class="wrpy wrprlg cuIcon-right" bindtap="clickInfo" data-key="introduction"></text>
     </view>
   </view>
 </view>
@@ -41,17 +41,17 @@
       </view>
     </view>
     <view class="padding-xl">
-      <view class="radioGroup row maincenter" wx:if="{{modalKey=='gender'}}">
-        <view class="radio row crosscenter" bindtap="clickRadio" data-v="">
-          <image src="../../../../imgs/radio{{inputInfo=='男'?'-checked':''}}.png" mode="aspectFit"></image>
+      <view class="radioGroup row maincenter" wx:if="{{modalKey=='sex'}}">
+        <view class="radio row crosscenter" bindtap="clickRadio" data-v="{{1}}">
+          <image src="../../../../imgs/radio{{inputInfo==1?'-checked':''}}.png" mode="aspectFit"></image>
           <text>男</text>
         </view>
-        <view class="radio row crosscenter" bindtap="clickRadio" data-v="">
-          <image src="../../../../imgs/radio{{inputInfo=='女'?'-checked':''}}.png" mode="aspectFit"></image>
+        <view class="radio row crosscenter" bindtap="clickRadio" data-v="{{2}}">
+          <image src="../../../../imgs/radio{{inputInfo==2?'-checked':''}}.png" mode="aspectFit"></image>
           <text>女</text>
         </view>
       </view>
-      <input placeholder="{{placeholder[modalKey]}}" class="borbot" bindinput="inputInfo" value="{{inputText}}" wx:if="{{modalKey!='gender'}}" maxlength="{{modalKey=='mobile'?11:''}}"></input>
+      <input placeholder="{{placeholder[modalKey]}}" class="borbot" bindinput="inputInfo" value="{{inputText}}" wx:if="{{modalKey!='sex'}}" maxlength="{{modalKey=='phone'?11:100}}"></input>
     </view>
     <view class="cu-bar bg-white justify-end">
       <view class="action">

+ 25 - 3
project.config.json

@@ -27,12 +27,12 @@
 			"outputPath": ""
 		},
 		"useIsolateContext": true,
-		"useCompilerModule": false,
+		"useCompilerModule": true,
 		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.4.4",
-	"appid": "wx289928fedd0242a5",
+	"appid": "wx0883711d2af54d70",
 	"projectname": "iSnow2",
 	"debugOptions": {
 		"hidedInDevtools": []
@@ -49,13 +49,35 @@
 			"current": -1,
 			"list": []
 		},
+		"plugin": {
+			"current": -1,
+			"list": []
+		},
 		"game": {
 			"currentL": -1,
 			"list": []
 		},
-		"miniprogram": {
+		"gamePlugin": {
 			"current": -1,
 			"list": []
+		},
+		"miniprogram": {
+			"current": -1,
+			"list": [
+				{
+					"id": -1,
+					"name": "pages/contest/answer/answer",
+					"pathName": "pages/contest/answer/answer",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/contest/info/info",
+					"pathName": "pages/contest/info/info",
+					"scene": null
+				}
+			]
 		}
 	}
 }

+ 2 - 1
utils/http.js

@@ -7,7 +7,8 @@ const jheader = {
 }
 
 
-const url = 'http://118.24.176.28:8778'
+// const url = 'http://118.24.176.28:8778'
+const url = 'https://api.winwin-sport.com'
 
 let RQ = []
 function request(api, method, header, data, hideLoading) {

+ 31 - 0
utils/util.wxs

@@ -0,0 +1,31 @@
+
+function formatTime (time) {
+  var h = Math.floor(time / 60 /60)
+  var s = Math.floor(time / 60)
+  var t = time % 60 % 60
+  return (h>9?h:'0'+h)+':'+(s>9?s:'0'+s)+':'+(t>9?t:'0'+t)
+}
+
+function valueOf (time=null) {
+  var regexp = getRegExp('-','g');
+  var t = time ? (getDate(time).valueOf() || getDate(time.replace(regexp,'/')).valueOf()) : getDate().valueOf()
+  return t 
+}
+
+function shuffle(arr) {
+  for (var i=arr.length-1; i>=0; i--) {
+    var rIndex = Math.floor(Math.random()*(i+1));
+      // 打印交换值
+      // console.log(i, rIndex);
+      var temp = arr[rIndex];
+      arr[rIndex] = arr[i];
+      arr[i] = temp;
+  }
+  return arr;
+}
+
+module.exports = {
+  formatTime: formatTime,
+  valueOf: valueOf,
+  shuffle: shuffle
+}