tanyanfei 4 年 前
コミット
faf697f391

BIN
pages/images/ewm.png


+ 10 - 5
pages/index/index.js

@@ -36,7 +36,8 @@ Page({
     casci_list:[],
     page_csi:1,
     total_csi: 0,
-    yestoday:''
+    yestoday:'',
+    top_csi:0
   },
 
 
@@ -87,7 +88,8 @@ Page({
       select:id,
       page_csi:1,
       total_csi:0,
-      casci_list:[]
+      casci_list:[],
+      top_csi: 0
     })
     this.getcasci()
   },
@@ -106,7 +108,8 @@ Page({
       show_month:0,
       page_csi: 1,
       total_csi: 0,
-      casci_list: []
+      casci_list: [],
+      top_csi: 0
     })
     this.getcasci()
   },
@@ -127,7 +130,8 @@ Page({
       yestoday: e.detail.value,
       page_csi: 1,
       total_csi: 0,
-      casci_list: []
+      casci_list: [],
+      top_csi: 0
     })
     this.getcasci()
   },
@@ -137,7 +141,8 @@ Page({
       sub_value: e.detail.value,
       page_csi: 1,
       total_csi: 0,
-      casci_list: []
+      casci_list: [],
+      top_csi: 0
     })
     this.getcasci()
   },

+ 1 - 1
pages/index/index.wxml

@@ -118,7 +118,7 @@
                 value="{{month}}">{{month}}</picker>
               </view>
         </view>
-        <scroll-view scroll-y="true" bindscrolltolower='next_csi' style="height: calc(100vh - 660rpx);">
+        <scroll-view scroll-y="true" scroll-top='{{top_csi}}' bindscrolltolower='next_csi' style="height: calc(100vh - 660rpx);">
             <navigator url="../number/number?id={{item.journal_id}}" class="num_list" wx:for='{{casci_list}}'>
               <view class="order" wx:if='{{index <= 2}}'>
                 <image src="{{'../images/t'+(index+1)+'.png'}}"></image>

+ 24 - 2
pages/number/number.js

@@ -18,7 +18,8 @@ Page({
     page:0,
     casci:0,
     act:0,
-    list:[]
+    list:[],
+    show:0
   },
 
   /**
@@ -211,7 +212,28 @@ Page({
       return chart;
     });
   },
-
+  weixin: function () {
+    if (this.data.info.qrcode || this.data.info.wxcode) {
+      this.setData({
+        show: true
+      })
+    } else {
+      wx.showToast({
+        title: '该期刊暂无公众号',
+      })
+    }
+  },
+  close: function () {
+    this.setData({
+      show: false
+    })
+  },
+  view: function () {
+    wx.previewImage({
+      urls: [this.data.info.qrcode],
+      current: this.data.info.qrcode
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 27 - 1
pages/number/number.wxml

@@ -1,6 +1,6 @@
 <view wx:if='{{info.name}}'>
   <view class="top">
-      <image mode="widthFix" src="{{info.img}}"></image>
+      <image class="fm" mode="widthFix" src="{{info.img}}"></image>
       <view>
           <view class="name">《{{info.name}}》</view>
           <text class="code"> 微信号:{{info.wxcode}}</text>
@@ -10,6 +10,7 @@
               <text data-id='2' bindtap="checkpage" class="{{act==2?'active':''}}">资源</text>
           </view>
       </view>
+      <image bindtap="weixin"  class="ewm" src="../images/ewm.png"></image>
   </view>
 
     <view wx:if='{{act==0}}'>
@@ -114,4 +115,29 @@
         </navigator>
         <view wx:if='{{list.length<=0}}' style="color:#999;margin:100rpx 0;text-align:center;">暂无资源!</view>
     </view>
+</view>
+
+
+
+
+<view wx:if='{{show}}' class="_ewm">
+    <view  class="bg" bindtap="close"></view>
+    <view class="ww">
+        <view class="t">
+            <image src="{{info.img}}"></image>
+            <view>
+              <view>{{info.name}}</view>
+              <view style="color:#999;">微信号:{{info.wxcode}}</view>
+            </view>
+        </view>
+        <image wx:if='{{info.qrcode}}' bindtap="view" class="m" mode="widthFix" src="{{info.qrcode}}"></image>
+        <image wx:else class="m" mode="widthFix" src="../images/no.png"></image>
+        <view class="b" wx:if='{{info.qrcode}}'>
+            <text>1.扫描二维码,关注期刊公众号</text>
+            <text>2.点击图片放大后长按可保存</text>
+        </view>
+        <view class="b" wx:else>
+            <text>抱歉,本公众号暂未上传二维码</text>
+        </view>
+    </view>
 </view>

+ 64 - 1
pages/number/number.wxss

@@ -8,10 +8,17 @@ page{
   padding: 40rpx;
   background: -webkit-linear-gradient(bottom, #F1F4F6, #73BFFF);
 }
-.top>image{
+.top .fm{
   width: 30%;
   margin-right: 30rpx;
 }
+.top .ewm{
+  position: absolute;
+  width: 60rpx;
+  height: 60rpx;
+  right: 20rpx;
+  top: 20rpx;
+}
 .name{
   color: #fff;
   font-size: 36rpx;
@@ -202,4 +209,60 @@ swiper{
 }
 .ly view text{
   font-size: 18rpx;
+}
+
+
+.bg{
+  position: fixed;
+  width: 100%;
+  height: 100vh;
+  top: 0;
+  left: 0;
+  z-index: 9;
+  background: rgba(0,0,0,.5);
+}
+._ewm{
+  position: fixed;
+  width: 100%;
+  height: 100vh;
+  top: 0;
+  left: 0;
+  z-index: 99999;
+}
+._ewm>.ww{
+  background: #fff;
+  border-radius: 18rpx;
+  padding: 100rpx;
+  display: block;
+  position: absolute;
+  width: 90%;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  margin: auto;
+  height: 80vh;
+  z-index: 99;
+}
+
+.t image{
+  width: 100rpx;
+  height: 100rpx;
+  border-radius: 8rpx;
+}
+.t>view{
+  display: inline-block;
+  vertical-align: top;
+  margin-left: 20rpx;
+  width: 73%;
+}
+.m{
+  display: block;
+  width: 100%;
+  margin: 50rpx auto;
+}
+.b text{
+  display: block;
+  text-align: center;
+  color: #999;
 }