bayi 1 year ago
parent
commit
2209a94c76
4 changed files with 128 additions and 106 deletions
  1. 45 36
      pages/activity/index.wxml
  2. 77 68
      pages/editUser/index.wxml
  3. 2 0
      pages/my/index.wxml
  4. 4 2
      project.miniapp.json

+ 45 - 36
pages/activity/index.wxml

@@ -10,49 +10,58 @@
                 <image src="/static/black.png" class="backIcon" />
             </view>
         </view>
+        <!-- #if MP -->
         <scroll-view class="scrollView" scroll-x="true" enhanced show-scrollbar="{{false}}">
-            <block wx:for="{{rankList}}" wx:key="id">
-                <view class="ranking-class-2 {{item.type=='2'?'yxb':item.type=='3'?'rbb':'pkb'}}">
-                    <view class="header">
-                        <view class="left">
-                            <image
-                                src="{{item.type=='2'?'/static/yxb.png':item.type=='3'?'/static/rbb.png':'/static/pkb.png'}}"
-                                class="icon" />
-                            <view class="title">{{item.title}}</view>
-                        </view>
-                        <view class="toAll" bindtap="activityEvent" data-info="{{item}}">查看全部
-                            <image src="/static/rbtn.png" class="backIcon" />
-                        </view>
-                    </view>
-                    <view class="body">
-                        <view class="row" wx:for="{{3}}" wx:key="index" wx:for-item='items' bindtap="jumpUserInfo"
-                            data-uid='{{item.userList[index].uid}}'>
+            <!-- #endif -->
+            <view class="scrollView">
+                <block wx:for="{{rankList}}" wx:key="id">
+                    <view class="ranking-class-2 {{item.type=='2'?'yxb':item.type=='3'?'rbb':'pkb'}}">
+                        <view class="header">
                             <view class="left">
-                                <image src="/static/{{index+1}}-1.png" class="stand" />
-                                <image src="{{item.userList[index].avatar||'/static/nullAvatar.png'}}" class="avatar" />
-                                <view class="nickName textOver">
-                                    {{item.userList[index].nickName||item.userList[index].eid||'等你来占位'}}
-                                </view>
-                            </view>
-                            <view class="right">
                                 <image
-                                    src="{{item.type=='2'?'/static/yx.png':item.type=='3'?'/static/play.png':'/static/win.png'}}"
-                                    class="playIcon" />
-                                <view class="num">{{item.userList[index].count}}</view>
+                                    src="{{item.type=='2'?'/static/yxb.png':item.type=='3'?'/static/rbb.png':'/static/pkb.png'}}"
+                                    class="icon" />
+                                <view class="title">{{item.title}}</view>
+                            </view>
+                            <view class="toAll" bindtap="activityEvent" data-info="{{item}}">查看全部
+                                <image src="/static/rbtn.png" class="backIcon" />
+                            </view>
+                        </view>
+                        <view class="body">
+                            <view class="row" wx:for="{{3}}" wx:key="index" wx:for-item='items' bindtap="jumpUserInfo"
+                                data-uid='{{item.userList[index].uid}}'>
+                                <view class="left">
+                                    <image src="/static/{{index+1}}-1.png" class="stand" />
+                                    <image src="{{item.userList[index].avatar||'/static/nullAvatar.png'}}"
+                                        class="avatar" />
+                                    <view class="nickName textOver">
+                                        {{item.userList[index].nickName||item.userList[index].eid||'等你来占位'}}
+                                    </view>
+                                </view>
+                                <view class="right">
+                                    <image
+                                        src="{{item.type=='2'?'/static/yx.png':item.type=='3'?'/static/play.png':'/static/win.png'}}"
+                                        class="playIcon" />
+                                    <view class="num">{{item.userList[index].count}}</view>
+                                </view>
                             </view>
                         </view>
                     </view>
-                </view>
-            </block>
-        </scroll-view>
-    </view>
-    <view class="activeyList">
-        <view class="headline">
-            <view class="left">
-                <image src="/static/huodong-3.png" class="logo" />
-                官方活动
+                </block>
             </view>
+            <!-- #if MP -->
+    </view>
+    <!-- #endif -->
+</view>
+<!-- #if MP -->
+<view class="activeyList">
+    <view class="headline">
+        <view class="left">
+            <image src="/static/huodong-3.png" class="logo" />
+            官方活动
         </view>
-        <activityList classify='3' dataList="{{activityList}}" />
     </view>
+    <activityList classify='3' dataList="{{activityList}}" />
+</view>
+<!-- #endif -->
 </view>

+ 77 - 68
pages/editUser/index.wxml

@@ -1,79 +1,88 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="editBox">
-  <button class="resetBtn editRow" open-type="chooseAvatar" bind:chooseavatar="changeAvatar">
-    <view class="name">头像</view>
-    <view class="right">
-      <image class='avatar' src='{{ userInfo.avatar}}'></image>
-      <image class='black' src='/static/black.png'></image>
-    </view>
-  </button>
-  <view class="editRow">
-    <view class="name">昵称</view>
-    <view class="right">
-      <input name='nickName' type="nickname" placeholder="请输入昵称" class='nickName' maxlength="9"
-        value='{{userInfo.nickName}}' bindblur='saveNickName'></input>
-      <image class='black' src='/static/black.png'></image>
-    </view>
-  </view>
-  <view class="editRow" bindtap="selectGender">
-    <view class="name">性别</view>
-    <view class="right">
-      <view class="name">
-        {{userInfo.gender===0?'女':'男'}}
-      </view>
-      <image class='black' src='/static/black.png'></image>
+    <!-- #if MP -->
+    <button class="resetBtn editRow" open-type="chooseAvatar" bind:chooseavatar="changeAvatar">
+        <view class="name">头像</view>
+        <view class="right">
+            <image class='avatar' src='{{ userInfo.avatar}}'></image>
+            <image class='black' src='/static/black.png'></image>
+        </view>
+    </button>
+    <!-- #elif ANDROID -->
+    <button class="resetBtn editRow">
+        <view class="name">头像</view>
+        <view class="right">
+            <image class='avatar' src='{{ userInfo.avatar}}'></image>
+            <image class='black' src='/static/black.png'></image>
+        </view>
+    </button>
+    <!-- #endif -->
+    <view class="editRow">
+        <view class="name">昵称</view>
+        <view class="right">
+            <input name='nickName' type="nickname" placeholder="请输入昵称" class='nickName' maxlength="9"
+                value='{{userInfo.nickName}}' bindblur='saveNickName'></input>
+            <image class='black' src='/static/black.png'></image>
+        </view>
     </view>
-  </view>
-  <view class="editRow">
-    <view class="name">生日</view>
-    <view class="right">
-      <picker mode="date" value="{{filters.formatDate( userInfo.birthday, 2)  }}" bindchange="bindDateChange"
-        end="2022-01-01">
-        <view class="name">{{userInfo.birthday?filters.formatDate(userInfo.birthday,2):'请选择生日' }}</view>
-      </picker>
-      <image class='black' src='/static/black.png'></image>
+    <view class="editRow" bindtap="selectGender">
+        <view class="name">性别</view>
+        <view class="right">
+            <view class="name">
+                {{userInfo.gender===0?'女':'男'}}
+            </view>
+            <image class='black' src='/static/black.png'></image>
+        </view>
     </view>
-  </view>
-  <view class="editRow mt40" bindtap="selectProfession">
-    <view class="name">身份</view>
-    <view class="right">
-      <view class="name">
-        {{userInfo.profession}}
-      </view>
-      <image class='black' src='/static/black.png'></image>
+    <view class="editRow">
+        <view class="name">生日</view>
+        <view class="right">
+            <picker mode="date" value="{{filters.formatDate( userInfo.birthday, 2)  }}" bindchange="bindDateChange"
+                end="2022-01-01">
+                <view class="name">{{userInfo.birthday?filters.formatDate(userInfo.birthday,2):'请选择生日' }}</view>
+            </picker>
+            <image class='black' src='/static/black.png'></image>
+        </view>
     </view>
-  </view>
-  <view class="editRow">
-    <view class="name">年级</view>
-    <view class="right">
-      <picker value="{{gradeIndex}}" range="{{gradeArray}}" range-key="key" bindchange="bindGradeChange">
-        <view class="name">
-          {{filters.gradeFilter(userInfo.grade)}}
+    <view class="editRow mt40" bindtap="selectProfession">
+        <view class="name">身份</view>
+        <view class="right">
+            <view class="name">
+                {{userInfo.profession}}
+            </view>
+            <image class='black' src='/static/black.png'></image>
         </view>
-      </picker>
-      <image class='black' src='/static/black.png'></image>
     </view>
-  </view>
-  <view class="editRow">
-    <view class="name">学校</view>
-    <view class="right">
-      <input placeholder="请输入学校" class='nickName' maxlength="18" value='{{userInfo.schoolName}}'
-        bindblur='saveSchool'></input>
-      <image class='black' src='/static/black.png'></image>
+    <view class="editRow">
+        <view class="name">年级</view>
+        <view class="right">
+            <picker value="{{gradeIndex}}" range="{{gradeArray}}" range-key="key" bindchange="bindGradeChange">
+                <view class="name">
+                    {{filters.gradeFilter(userInfo.grade)}}
+                </view>
+            </picker>
+            <image class='black' src='/static/black.png'></image>
+        </view>
     </view>
-  </view>
-  <view class="editRow">
-    <view class="name">手机号</view>
-    <view class="right" wx:if="{{!userInfo.mobile}}">
-      <button class="resetBtn" style="font-size: 30rpx;" open-type="getPhoneNumber"
-        bindgetphonenumber="getPhoneNumber">立即绑定</button>
-      <image class='black' src='/static/black.png'></image>
+    <view class="editRow">
+        <view class="name">学校</view>
+        <view class="right">
+            <input placeholder="请输入学校" class='nickName' maxlength="18" value='{{userInfo.schoolName}}'
+                bindblur='saveSchool'></input>
+            <image class='black' src='/static/black.png'></image>
+        </view>
     </view>
-    <view class="right" wx:if="{{userInfo.mobile}}">
-      {{userInfo.mobile}}
+    <!-- #if MP -->
+    <view class="editRow">
+        <view class="name">手机号</view>
+        <view class="right" wx:if="{{!userInfo.mobile}}">
+            <button class="resetBtn" style="font-size: 30rpx;" open-type="getPhoneNumber"
+                bindgetphonenumber="getPhoneNumber">立即绑定</button>
+            <image class='black' src='/static/black.png'></image>
+        </view>
+        <view class="right" wx:if="{{userInfo.mobile}}">
+            {{userInfo.mobile}}
+        </view>
     </view>
-  </view>
-  <!--    <view class="switchAccount mt40">
-        切换账号
-    </view> -->
+    <!-- #endif -->
 </view>

+ 2 - 0
pages/my/index.wxml

@@ -13,9 +13,11 @@
                     <view class="uRtopleft">
                         <view class="nickName textOver">{{userInfo.user.nickName||'请输入昵称' }}</view>
                         <view class="gradeText textOver" catchtap="clipboar">学号:{{userInfo.user.eid}}</view>
+                        <!-- #if MP -->
                         <view class="validity" wx:if="{{isPreferential&&!isIos}}">
                             {{vipTime=='1'?'会员使用至:终身使用':!vipTime?'会员已过期':'会员使用至:'+filters.formatDate(vipTime,5)}}
                         </view>
+                        <!-- #endif -->
                     </view>
                     <view class="uRtopRight">
                         <image class="edit" src="/static/edit_new.png" mode="" />

+ 4 - 2
project.miniapp.json

@@ -29,7 +29,9 @@
       "template": "miniapp-privacy.json"
     },
     "privateDescriptions": {
-      "RECORD_AUDIO": "用于录制音频"
+      "RECORD_AUDIO": "用于录制音频",
+      "READ_EXTERNAL_STORAGE": "用于上传头像",
+      "WRITE_EXTERNAL_STORAGE": "用于上传头像"
     }
   },
   "mini-ios": {
@@ -39,7 +41,7 @@
       "WeAppOpenFuns": true,
       "WeAppNetwork": false,
       "WeAppBluetooth": false,
-      "WeAppMedia": false,
+      "WeAppMedia": true,
       "WeAppLBS": false,
       "WeAppOthers": false
     },