Przeglądaj źródła

增加轮播图

// 1 rok temu
rodzic
commit
77cab9b5a1
1 zmienionych plików z 85 dodań i 67 usunięć
  1. 85 67
      pages/index/index.wxml

+ 85 - 67
pages/index/index.wxml

@@ -2,91 +2,109 @@
 <!-- <StatusBar receiveData="{{statusbarobj}}" grade="{{grade}}" bindgradeTap="gradeTap" /> -->
 <mp-navigation-bar title="UI组件库"></mp-navigation-bar>
 <view class="gradeContainer" catchtouchmove='true' wx:if="{{isGradeShow}}">
-    <view class="gradeBox" bindtap="selectGrade">
-        <view class="title">年级选择</view>
-        <view class="content">
-            <view class="grade {{temporaryGrade=='PRESCHOOL'?'check':''}}" data-code="PRESCHOOL">学前班</view>
-            <view class="grade {{temporaryGrade=='PRIMARY_FIRST_GRADE'?'check':''}}" data-code="PRIMARY_FIRST_GRADE">一年级</view>
-        </view>
-        <view class="content">
-            <view class="grade {{temporaryGrade=='PRIMARY_SECOND_GRADE'?'check':''}}" data-code="PRIMARY_SECOND_GRADE">二年级</view>
-            <view class="grade {{temporaryGrade=='PRIMARY_THREE_GRADE'?'check':''}}" data-code="PRIMARY_THREE_GRADE">三年级</view>
-        </view>
-        <view class="content">
-            <view class="grade {{temporaryGrade=='PRIMARY_SENIOR_GRADE'?'check':''}}" data-code="PRIMARY_SENIOR_GRADE">四年级</view>
-        </view>
-        <view class="submitBox">
-            <button class="resetBtn submit" bindtap="changeGrade">登录</button>
-        </view>
+  <view class="gradeBox" bindtap="selectGrade">
+    <view class="title">年级选择</view>
+    <view class="content">
+      <view class="grade {{temporaryGrade=='PRESCHOOL'?'check':''}}" data-code="PRESCHOOL">学前班</view>
+      <view class="grade {{temporaryGrade=='PRIMARY_FIRST_GRADE'?'check':''}}" data-code="PRIMARY_FIRST_GRADE">一年级
+      </view>
     </view>
+    <view class="content">
+      <view class="grade {{temporaryGrade=='PRIMARY_SECOND_GRADE'?'check':''}}" data-code="PRIMARY_SECOND_GRADE">二年级
+      </view>
+      <view class="grade {{temporaryGrade=='PRIMARY_THREE_GRADE'?'check':''}}" data-code="PRIMARY_THREE_GRADE">三年级
+      </view>
+    </view>
+    <view class="content">
+      <view class="grade {{temporaryGrade=='PRIMARY_SENIOR_GRADE'?'check':''}}" data-code="PRIMARY_SENIOR_GRADE">四年级
+      </view>
+    </view>
+    <view class="submitBox">
+      <button class="resetBtn submit" bindtap="changeGrade">登录</button>
+    </view>
+  </view>
 </view>
 <view class="container">
-    <!-- 引入组件 -->
-    <!-- <import src="/component/my/my.wxml" /> -->
-    <import src="/templates/courses/courses.wxml" />
-    <!-- 顶部导航 -->
-    <view class="top-tab" wx:if="{{!isGradeShow}}">
-        <!-- <view class="tabbar {{3 == myIndex ? 'select':' '}}" bindtap="jumpMy">
+  <!-- 引入组件 -->
+  <!-- <import src="/component/my/my.wxml" /> -->
+  <import src="/templates/courses/courses.wxml" />
+  <!-- 顶部导航 -->
+  <view class="top-tab" wx:if="{{!isGradeShow}}">
+    <!-- <view class="tabbar {{3 == myIndex ? 'select':' '}}" bindtap="jumpMy">
             <text>我的</text>
         </view> -->
-        <view class="tabbar" bindtap="jumpMy">
-            <text>我的</text>
-        </view>
-        <view class="tabbar {{0 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="0">
-            <text>推荐</text>
-        </view>
-        <view class="tabbar {{1 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="1">
-            <text>关注</text>
-        </view>
-        <view class="tabbar {{2 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="2">
-            <text>资源</text>
-        </view>
+    <view class="tabbar" bindtap="jumpMy">
+      <text>我的</text>
+    </view>
+    <view class="tabbar {{0 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="0">
+      <text>推荐</text>
     </view>
-    <!-- <view hidden="{{gradeActivity === 'PRIMARY_SENIOR_GRADE' || gradeActivity === 'PRESCHOOL' || 0 != myIndex}}" class="activity-img" bindtap="goToActivity"> -->
-    <view hidden="{{0 != myIndex}}" class="activity-img" bindtap="goToActivity">
-        <image src="http://reader-wx.ai160.com/images/reader/activity/banner.jpg"></image>
+    <view class="tabbar {{1 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="1">
+      <text>关注</text>
     </view>
-    <!--  <view wx:if="{{isIos ||  isVip}}" class="activity-buy" bindtap="myPlase">
-        <image src="http://reader-wx.ai160.com/images/reader/pay/vip_icon.png"></image>
-    </view> -->
-    <!-- 调用组件 -->
-    <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}" data="{{myData: myData,coursesData:coursesData,noMoreWork:noMoreWork}}"></template>
-    <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" noMoreWork="{{noMoreWork}}" ifHeadTap="{{true}}" bindopenShare="openShare" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindcollectTap="collectTap" bindlikeTap="likeTap" binddelHideMyWork="delHideMyWork" bindaddShareAmount="addShareAmount" bindchange="videoChange">
-    </VideoSwiper>
-    <view class="comment_section" catchtouchmove="touchMove" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
-        <view class="comment_close" data-type='blank'>
-            ×
-        </view>
-       <Comment data-type="list" commentId="{{commentId}}" commentNum="{{commentNum}}" inputValue="{{inputValue}}" bindsendReply="sendReply" />
+    <view class="tabbar {{2 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="2">
+      <text>资源</text>
     </view>
-    <view class="no_follow" wx:if="{{myIndex === 1 && videoList.length <= 0 && noFollow}}">
-        <image class="no_follow_icon" src="../../static/index/no_follow.png" />
-        <text>赶快去关注优秀作者吧,</text>
-        <text>这里将会发生欣喜的变化。</text>
+  </view>
+  <swiper class="activity-img" autoplay circular indicator-dots indicator-active-color="#FFFFFF"
+    hidden="{{0 != myIndex}}">
+    <swiper-item>
+      <image src=" http://reader-wx.ai160.com/images/reader/activity/banner.jpg" bindtap="goToActivity">
+      </image>
+    </swiper-item>
+    <swiper-item>
+      <image src="https://reader-wx.ai160.com/images/reader/activity/guide.jpg"></image>
+    </swiper-item>
+  </swiper>
+
+  <!-- 调用组件 -->
+  <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}"
+    data="{{myData: myData,coursesData:coursesData,noMoreWork:noMoreWork}}"></template>
+  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}"
+    nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" noMoreWork="{{noMoreWork}}" ifHeadTap="{{true}}"
+    bindopenShare="openShare" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading"
+    bindcollectTap="collectTap" bindlikeTap="likeTap" binddelHideMyWork="delHideMyWork"
+    bindaddShareAmount="addShareAmount" bindchange="videoChange">
+  </VideoSwiper>
+  <view class="comment_section" catchtouchmove="touchMove" catchtap="commentTap" data-type="blank"
+    wx:if="{{commentShow}}">
+    <view class="comment_close" data-type='blank'>
+      ×
     </view>
+    <Comment data-type="list" commentId="{{commentId}}" commentNum="{{commentNum}}" inputValue="{{inputValue}}"
+      bindsendReply="sendReply" />
+  </view>
+  <view class="no_follow" wx:if="{{myIndex === 1 && videoList.length <= 0 && noFollow}}">
+    <image class="no_follow_icon" src="../../static/index/no_follow.png" />
+    <text>赶快去关注优秀作者吧,</text>
+    <text>这里将会发生欣喜的变化。</text>
+  </view>
 </view>
 <!--弹窗-->
 <view class="help-pay" hidden="{{helpPayHide}}">
-    <view class="help-pay-main" style="{{tipsType === 'tips' && 'top: 35%'}}">
-        <view wx:if="{{ tipsType === 'helpPay'}}" bindtap="payAndHelp">
-            <view class="pay-price" wx:if="{{payPrice}}">{{payPrice}}<text>元</text></view>
-            <image class="help-pay-icon" src="{{helpPayImg}}"></image>
-        </view>
-        <image wx:else class="tips-icon" src="{{tipsImg}}" bindtap="tips"></image>
-        <image class="help-close" bindtap="helpPayHideEvent" src="../../static/image/close.png"></image>
+  <view class="help-pay-main" style="{{tipsType === 'tips' && 'top: 35%'}}">
+    <view wx:if="{{ tipsType === 'helpPay'}}" bindtap="payAndHelp">
+      <view class="pay-price" wx:if="{{payPrice}}">{{payPrice}}<text>元</text></view>
+      <image class="help-pay-icon" src="{{helpPayImg}}"></image>
     </view>
+    <image wx:else class="tips-icon" src="{{tipsImg}}" bindtap="tips"></image>
+    <image class="help-close" bindtap="helpPayHideEvent" src="../../static/image/close.png"></image>
+  </view>
 </view>
 <!-- <MyToast /> -->
 <view hidden="{{hide}}">
-    <Dialog bindmyevent="jurisdiction" />
+  <Dialog bindmyevent="jurisdiction" />
 </view>
 <!-- <view class="upgrade" hidden="{{gradeActivity === 'PRIMARY_SENIOR_GRADE' || gradeActivity === 'PRESCHOOL' || upgradeHide}}"> -->
 <view class="upgrade" hidden="{{upgradeHide}}" bindtap="hideUpgrade">
-    <view class="upgrade-main">
-        <image class="upgrade-icon" src="http://reader-wx.ai160.com/images/reader/activity/activity_dialog.png" catchtap="goToActivity"></image>
-        <image class="close" catchtap="hideUpgrade" src="../../static/image/close.png"></image>
-    </view>
+  <view class="upgrade-main">
+    <image class="upgrade-icon" src="http://reader-wx.ai160.com/images/reader/activity/activity_dialog.png"
+      catchtap="goToActivity"></image>
+    <image class="close" catchtap="hideUpgrade" src="../../static/image/close.png"></image>
+  </view>
 </view>
-<shareDialog id="share-dialog" shareType='works' bindaddShareAmount="addShareAmount" bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
-<canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+<shareDialog id="share-dialog" shareType='works' bindaddShareAmount="addShareAmount"
+  bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
+<canvas canvas-id="myCanvas"
+  style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <canvas id='share' type="2d"> </canvas>