bayi 9 месяцев назад
Родитель
Сommit
e8f2930a01

+ 1 - 1
app.js

@@ -42,7 +42,7 @@ App({
             }
         } else {
             let userRes = await androidLogin({
-                extOpenId: '77777777',
+                extOpenId: '1111',
                 channel: '3016',
                 grade: 'PRIMARY_FIRST_GRADE'
             })

+ 1 - 0
components/worksList/index.js

@@ -111,6 +111,7 @@ Component({
             this.setData({
                 worksListCopy
             })
+            this.resetAudio()
         },
     },
 })

+ 11 - 25
pages/editUser/index.js

@@ -42,6 +42,13 @@ Page({
                 key: '六年级'
             },
         ],
+        genderList: [{
+            value: 0,
+            key: '女'
+        }, {
+            value: 1,
+            key: '男'
+        }, ]
     },
     onLoad(options) {
         // 手工绑定 
@@ -65,7 +72,7 @@ Page({
         this.setData({
             gradeIndex
         })
-
+    
     },
     // 调用清理函数
     onUnload() {
@@ -107,30 +114,9 @@ Page({
             nickName
         })
     },
-    selectProfession() {
-        wx.showActionSheet({
-            itemList: ['学生', '家长', '老师'],
-            success: (res) => {
-                if (['学生', '家长', '老师'][res.tapIndex] == this.data.userInfo.profession) {
-                    return
-                }
-                this.setUserInfo({
-                    profession: ['学生', '家长', '老师'][res.tapIndex]
-                })
-            },
-        })
-    },
-    selectGender() {
-        wx.showActionSheet({
-            itemList: ['女', '男'],
-            success: (res) => {
-                if (res.tapIndex == this.data.userInfo.gender) {
-                    return
-                }
-                this.setUserInfo({
-                    gender: res.tapIndex
-                })
-            },
+    selectGender(e) {
+        this.setUserInfo({
+            gender:e.detail.value
         })
     },
     bindDateChange(e) {

+ 7 - 0
pages/editUser/index.less

@@ -23,6 +23,8 @@
         .right {
             display: flex;
             align-items: center;
+            justify-content: flex-end;
+            flex: 1;
 
             .avatar {
                 width: 60rpx;
@@ -35,6 +37,11 @@
                 text-align: right;
             }
 
+            .name {
+                min-width: 400rpx;
+                text-align: end;
+            }
+
             .black {
                 width: 16rpx;
                 height: 30rpx;

+ 6 - 24
pages/editUser/index.wxml

@@ -1,22 +1,11 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="editBox">
-    <!-- #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">
@@ -25,12 +14,14 @@
             <image class='black' src='/static/black.png'></image>
         </view>
     </view>
-    <view class="editRow" bindtap="selectGender">
+    <view class="editRow">
         <view class="name">性别</view>
         <view class="right">
-            <view class="name">
-                {{userInfo.gender===0?'女':'男'}}
-            </view>
+            <picker value="{{userInfo.gender}}" range="{{genderList}}" range-key="key" bindchange="selectGender">
+                <view class="name">
+                    {{userInfo.gender===0?'女':'男'}}
+                </view>
+            </picker>
             <image class='black' src='/static/black.png'></image>
         </view>
     </view>
@@ -44,15 +35,6 @@
             <image class='black' src='/static/black.png'></image>
         </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>
-    </view>
     <view class="editRow">
         <view class="name">年级</view>
         <view class="right">

+ 6 - 0
pages/editUser/index.wxss

@@ -21,6 +21,8 @@
 .editBox .editRow .right {
   display: flex;
   align-items: center;
+  justify-content: flex-end;
+  flex: 1;
 }
 .editBox .editRow .right .avatar {
   width: 60rpx;
@@ -31,6 +33,10 @@
   width: 400rpx;
   text-align: right;
 }
+.editBox .editRow .right .name {
+  min-width: 400rpx;
+  text-align: end;
+}
 .editBox .editRow .right .black {
   width: 16rpx;
   height: 30rpx;

+ 2 - 2
pages/index/index.js

@@ -23,6 +23,8 @@ Page({
     },
     onLoad(options) {
         this.getLocUserInfo()
+    },
+    onShow() {
         if (Object.keys(this.data.userInfo).length > 0) {
             this.requestAgain()
         } else {
@@ -31,8 +33,6 @@ Page({
                 this.requestAgain()
             }
         }
-    },
-    onShow() {
         if (typeof this.getTabBar === 'function') {
             this.getTabBar().setData({
                 selected: 2

+ 0 - 1
pages/my/index.less

@@ -98,7 +98,6 @@
         .goodsList {
             margin-top: 40rpx;
             width: 100%;
-            height: 310rpx;
             white-space: nowrap;
             box-sizing: border-box;
 

+ 0 - 1
pages/my/index.wxss

@@ -83,7 +83,6 @@
 .container .scrollViewBox .goodsList {
   margin-top: 40rpx;
   width: 100%;
-  height: 310rpx;
   white-space: nowrap;
   box-sizing: border-box;
 }