瀏覽代碼

1.分享作品按钮2.调整tabbar位置

bayi 2 年之前
父節點
當前提交
ec8f596fe1
共有 5 個文件被更改,包括 15 次插入12 次删除
  1. 3 0
      components/uploadFile/index.wxml
  2. 8 8
      custom-tab-bar/index.js
  3. 1 1
      pages/my/index.js
  4. 2 2
      pages/personal/index.wxml
  5. 1 1
      pages/works/index.js

+ 3 - 0
components/uploadFile/index.wxml

@@ -1,4 +1,7 @@
 <view class="btn" bindtap="upload" wx:if="{{!uploadState}}">上传作品</view>
+<button class="resetBtn btn" open-type="share" wx:else>
+  分享作品
+</button>
 <view class="uploadBox" wx:if="{{uploadFlag}}">
   <view class="upload">
     <view class="speed">{{percent}}%</view>

+ 8 - 8
custom-tab-bar/index.js

@@ -15,20 +15,20 @@ Component({
     color: "#999999",
     selectedColor: "#32CA69",
     listTab: [{
-      "pagePath": "/pages/my/index",
-      "text": "我的",
-      "iconPath": "/static/my.png",
-      "selectedIconPath": "/static/my2.png"
+      "pagePath": "/pages/works/index",
+      "text": "作品",
+      "iconPath": "/static/zp.png",
+      "selectedIconPath": "/static/zp2.png"
     }, {
       "pagePath": "/pages/index/index",
       "text": "推荐",
       "iconPath": "/static/tj.png",
       "selectedIconPath": "/static/tj2.png"
     }, {
-      "pagePath": "/pages/works/index",
-      "text": "作品",
-      "iconPath": "/static/zp.png",
-      "selectedIconPath": "/static/zp2.png"
+      "pagePath": "/pages/my/index",
+      "text": "我的",
+      "iconPath": "/static/my.png",
+      "selectedIconPath": "/static/my2.png"
     }]
   },
 

+ 1 - 1
pages/my/index.js

@@ -25,7 +25,7 @@ Page({
   async onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 0
+        selected: 2
       })
     }
     let uid = wx.getStorageSync('uid') || ''

+ 2 - 2
pages/personal/index.wxml

@@ -50,7 +50,7 @@
   <view style="flex: 1;overflow: hidden;">
     <scroll-view class="worksList" scroll-y="true" enhanced show-scrollbar="{{false}}" scroll-top="{{scrollTop}}"
       bindscrolltolower='loadMore'>
-      <view class="worksBox" wx:for="{{list}}" wx:key="index">
+      <view class="worksBox" wx:for="{{list}}" wx:key="index" bindtap="toPkPage" data-id="{{item.userRead.id}}">
         <view class="left">
           <image src="{{item.userRead.coverImg}}" class="cover"
             wx:if="{{!item.userReadExtend||item.userReadExtend.resourcesType==0}}" />
@@ -77,7 +77,7 @@
             </view>
           </view>
         </view>
-        <view class="goRead" data-id="{{item.userRead.id}}" bindtap="toPkPage">
+        <view class="goRead">
           {{userInfo.user.profession=='官方'||userInfo.user.uid==uid?'去朗读':'挑战PK'}}
         </view>
       </view>

+ 1 - 1
pages/works/index.js

@@ -22,7 +22,7 @@ Page({
   onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 2
+        selected: 0
       })
     }
     let uid = wx.getStorageSync('uid')