Browse Source

开发联调

bayi 1 year ago
parent
commit
28dc6d07f8

+ 0 - 58
components/vipModal/index.js

@@ -5,15 +5,8 @@ import {
     formatDate
 } from '~/utils/util'
 Component({
-    /**
-     * 组件的属性列表
-     */
-    properties: {
-
-    },
     data: {
         show: false,
-        type: '',
         vipTime: ''
     },
     methods: {
@@ -41,59 +34,8 @@ Component({
         async getVipInfo() {
             let vipTime = await getVipInfo()
             this.setData({
-                type: vipTime == '1' ? 'svip' : 'vip',
                 vipTime
             })
         },
-        creatShare() {
-            let type = this.data.type
-            let context = wx.createSelectorQuery();
-            context
-                .select('#vip')
-                .fields({
-                    node: true,
-                    size: true
-                }).exec((res) => {
-                    const canvas = res[0].node;
-                    const ctx = canvas.getContext('2d');
-                    const dpr = wx.getSystemInfoSync().pixelRatio;
-                    canvas.width = res[0].width * dpr;
-                    canvas.height = res[0].height * dpr;
-                    ctx.scale(dpr, dpr);
-                    ctx.font = '18px PingFang';
-                    let pic = canvas.createImage();
-                    pic.src = type == 'svip' ? 'http://reader-wx.ai160.com/images/reader/v3/learn/vip1.png' : 'http://reader-wx.ai160.com/images/reader/v3/learn/vip2.png'
-                    pic.onload = () => {
-                        ctx.drawImage(pic, 0, 0, 375, 201);
-                        if (type == 'svip') {
-                            ctx.fillStyle = "#D7E6FF";
-                            ctx.fillText('终身使用', 16, 184)
-                        } else {
-                            ctx.fillStyle = "#FFE6D2";
-                            ctx.fillText('有效期至:' + formatDate(this.data.vipTime, 5), 16, 184)
-                        }
-                        setTimeout(() => {
-                            wx.canvasToTempFilePath({
-                                canvas: canvas,
-                                success(res) {
-                                    wx.saveImageToPhotosAlbum({
-                                        filePath: res.tempFilePath,
-                                        success(res) {
-                                            wx.showToast({
-                                                title: '保存成功!',
-                                                icon: "none",
-                                                duration: 3000
-                                            })
-                                        }
-                                    })
-                                },
-                                fail(res) {
-                                    console.log('fail', res);
-                                }
-                            }, this)
-                        }, 500)
-                    }
-                })
-        },
     }
 })

+ 30 - 32
components/vipModal/index.less

@@ -1,6 +1,9 @@
 .activationModal {
     position: fixed;
     z-index: 12;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
     left: 0rpx;
     top: 0rpx;
     width: 100vw;
@@ -8,51 +11,46 @@
     background: rgba(0, 0, 0, 0.7);
 
     .vipModal {
-        position: relative;
-        left: 0;
-        right: 0;
+        margin-top: 400rpx;
         width: 600rpx;
         height: 506rpx;
-        top: 30%;
-        margin: auto;
+        background: linear-gradient(180deg, #FFEFE3 0%, #FFFFFF 100%);
         border-radius: 20rpx;
         text-align: center;
-    }
 
-    .bg1 {
-        background: url(http://reader-wx.ai160.com/images/reader/v3/learn/saveImage2.png);
-        background-size: cover;
-    }
+        .logo {
+            margin-top: -84rpx;
+            width: 232rpx;
+            height: 194rpx;
+        }
 
-    .bg2 {
-        background: url(http://reader-wx.ai160.com/images/reader/v3/learn/saveImage.png);
-        background-size: cover;
-    }
+        .headline {
+            margin: 44rpx 0 30rpx;
+            font-size: 38rpx;
+            font-weight: bold;
+            color: #EF5602;
+        }
 
-    .text {
-        position: absolute;
-        left: 86rpx;
-        top: 190rpx;
-        font-size: 26rpx;
-        color: #FFE6D2;
-    }
+        .text {
+            font-size: 28rpx;
+        }
 
-    .save {
-        position: absolute;
-        top: 390rpx;
-        left: 90rpx;
-        width: 410rpx;
-        height: 80rpx;
+        .know {
+            display: inline-block;
+            margin: 80rpx auto 0;
+            padding: 12rpx 80rpx;
+            background: #FF7E47;
+            box-shadow: 0rpx 12rpx 4rpx 0rpx #FCE7DB;
+            border-radius: 33rpx;
+            font-size: 33rpx;
+            font-weight: 500;
+            color: #FFFFFF;
+        }
     }
 
     .close {
-        position: absolute;
         padding: 40rpx;
         width: 54rpx;
         height: 54rpx;
-        left: 0;
-        right: 0;
-        bottom: -140rpx;
-        margin: auto;
     }
 }

+ 6 - 4
components/vipModal/index.wxml

@@ -1,8 +1,10 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="activationModal" wx:if="{{show}}">
-    <view class="vipModal {{type=='svip'?'bg2':'bg1'}}">
-        <view class="text" wx:if="{{type=='vip'}}">有效期至:{{filters.formatDate(vipTime,5)}}</view>
-        <view class="save" catchtap="creatShare"></view>
-        <image src="/static/lollipop.png" class="close" catchtap="closeModal" />
+    <view class="vipModal">
+        <image src="/static/vd.png" class="logo" />
+        <view class="headline">开通成功</view>
+        <view class="text">有效期至:{{filters.formatDate(vipTime,5)}}</view>
+        <view class="know" catchtap="closeModal" >我知道了</view>
     </view>
+    <image src="/static/lollipop.png" class="close" catchtap="closeModal" />
 </view>

+ 26 - 28
components/vipModal/index.wxss

@@ -1,6 +1,9 @@
 .activationModal {
   position: fixed;
   z-index: 12;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
   left: 0rpx;
   top: 0rpx;
   width: 100vw;
@@ -8,45 +11,40 @@
   background: rgba(0, 0, 0, 0.7);
 }
 .activationModal .vipModal {
-  position: relative;
-  left: 0;
-  right: 0;
+  margin-top: 400rpx;
   width: 600rpx;
   height: 506rpx;
-  top: 30%;
-  margin: auto;
+  background: linear-gradient(180deg, #FFEFE3 0%, #FFFFFF 100%);
   border-radius: 20rpx;
   text-align: center;
 }
-.activationModal .bg1 {
-  background: url(http://reader-wx.ai160.com/images/reader/v3/learn/saveImage2.png);
-  background-size: cover;
+.activationModal .vipModal .logo {
+  margin-top: -84rpx;
+  width: 232rpx;
+  height: 194rpx;
 }
-.activationModal .bg2 {
-  background: url(http://reader-wx.ai160.com/images/reader/v3/learn/saveImage.png);
-  background-size: cover;
+.activationModal .vipModal .headline {
+  margin: 44rpx 0 30rpx;
+  font-size: 38rpx;
+  font-weight: bold;
+  color: #EF5602;
 }
-.activationModal .text {
-  position: absolute;
-  left: 86rpx;
-  top: 190rpx;
-  font-size: 26rpx;
-  color: #FFE6D2;
+.activationModal .vipModal .text {
+  font-size: 28rpx;
 }
-.activationModal .save {
-  position: absolute;
-  top: 390rpx;
-  left: 90rpx;
-  width: 410rpx;
-  height: 80rpx;
+.activationModal .vipModal .know {
+  display: inline-block;
+  margin: 80rpx auto 0;
+  padding: 12rpx 80rpx;
+  background: #FF7E47;
+  box-shadow: 0rpx 12rpx 4rpx 0rpx #FCE7DB;
+  border-radius: 33rpx;
+  font-size: 33rpx;
+  font-weight: 500;
+  color: #FFFFFF;
 }
 .activationModal .close {
-  position: absolute;
   padding: 40rpx;
   width: 54rpx;
   height: 54rpx;
-  left: 0;
-  right: 0;
-  bottom: -140rpx;
-  margin: auto;
 }

+ 11 - 1
pages/invite/index.js

@@ -287,7 +287,7 @@ Page({
             top: 4924,
             left: 16
         }],
-        count: 61,
+        count: 0,
         state: false,
         modelInfo: {
             title: '',
@@ -303,6 +303,16 @@ Page({
             })
         }
     },
+    async onShow() {
+        let {
+            list
+        } = await getInviteList({
+            pageSize: 9999
+        })
+        this.setData({
+            count: list.length
+        })
+    },
     openTips({
         currentTarget
     }) {

+ 13 - 2
pages/inviteRanking/index.js

@@ -1,6 +1,9 @@
 import {
-    getRankingData
+    getRankingData,
 } from '~/api/global'
+import {
+    getInviteList
+} from '~/api/user'
 Page({
     /**
      * 页面的初始数据
@@ -15,7 +18,7 @@ Page({
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad(options) {
+    async onLoad(options) {
         wx.setNavigationBarColor({
             frontColor: '#ffffff',
             backgroundColor: '#2DCE66'
@@ -24,6 +27,14 @@ Page({
             userInfo: getApp().globalData.userInfo
         })
         this.getRankingData(2)
+        let {
+            list
+        } = await getInviteList({
+            pageSize: 9999
+        })
+        this.setData({
+            inviteList: list
+        })
     },
     async getRankingData(id) {
         let {

+ 0 - 1
pages/my/index.js

@@ -48,7 +48,6 @@ Page({
         } else {
             this.setUserInfo()
         }
-        this.selectComponent('#vipModal').open()
     },
     // 设置用户信息及vip状态
     async setUserInfo() {

+ 1 - 3
pages/reading/index.js

@@ -773,9 +773,7 @@ Page({
             paySign,
             success: (res) => {
                 this.selectComponent('#buyVip').closeModal()
-                this.selectComponent('#vipModal').open({
-                    type: detail.payType == 'LIFELONG' ? 'sip' : 'vip'
-                })
+                this.selectComponent('#vipModal').open()
                 this.setData({
                     isVip: true
                 })

BIN
static/vd.png


+ 3 - 0
utils/filter.wxs

@@ -10,6 +10,9 @@ function formatDate(time, flag) {
     if (!time) {
         return
     }
+    if (time == '1') {
+        return "终身使用"
+    }
     var time = time * 1
     var t = getDate(time);
     var tf = function (i) {