bayi 2 년 전
부모
커밋
ca8e620ff3
11개의 변경된 파일90개의 추가작업 그리고 595개의 파일을 삭제
  1. 0 1
      app.json
  2. 0 88
      pages/commodity/index.js
  3. 0 5
      pages/commodity/index.json
  4. 0 196
      pages/commodity/index.less
  5. 0 53
      pages/commodity/index.wxml
  6. 0 167
      pages/commodity/index.wxss
  7. 1 0
      pages/my/index.js
  8. 34 33
      pages/my/index.less
  9. 19 13
      pages/my/index.wxml
  10. 35 39
      pages/my/index.wxss
  11. 1 0
      utils/filter.wxs

+ 0 - 1
app.json

@@ -23,7 +23,6 @@
     "pages/editUser/index",
     "pages/notice/index",
     "pages/friend/index",
-    "pages/commodity/index",
     "pages/searchFriend/index"
   ],
   "tabBar": {

+ 0 - 88
pages/commodity/index.js

@@ -1,88 +0,0 @@
-import {
-  buyVip,
-} from '~/api/user'
-import {
-  getProducts
-} from '~/api/global'
-Page({
-  data: {
-    products: [],
-    selected: {},
-    activationModal: false,
-  },
-  onLoad(options) {
-    this.getProducts()
-  },  
-  async getProducts() {
-    let products = await getProducts()
-    console.log(products);
-    this.setData({
-      products,
-      selected: products[0]
-    })
-  },
-  checked({
-    currentTarget
-  }) {
-    this.setData({
-      selected: currentTarget.dataset.product
-    })
-  },
-  closeModal() {
-    this.setData({
-      activationModal: false
-    })
-    wx.navigateBack()
-  },
-  async toBuy() {
-    wx.showLoading({
-      title: '提交中',
-      mask: true
-    })
-    let res = await buyVip({
-      productId: this.data.selected.id
-    }).finally(() => {
-      wx.hideLoading()
-    })
-    let {
-      timeStamp,
-      nonceStr,
-      signType,
-      paySign
-    } = res
-    // package保留字
-    wx.requestPayment({
-      timeStamp,
-      nonceStr,
-      package: res.package,
-      signType,
-      paySign,
-      success: (res) => {
-        console.log(res);
-        this.setData({
-          activationModal: true
-        })
-        /*   setTimeout(() => {
-            this.setUserInfo()
-          }, 1500) */
-      },
-      fail(res) {
-        wx.showToast({
-          title: "支付失败",
-          icon: "none",
-          duration: 3000
-        })
-      }
-    })
-  },
-  /* // 设置用户信息及vip状态
-  async setUserInfo() {
-    let userInfo = await getMyInfo()
-    let vipTime = await getVipInfo()
-    this.setUser(userInfo.user)
-    this.setData({
-      userInfo,
-      vipTime,
-    })
-  }, */
-})

+ 0 - 5
pages/commodity/index.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {},
-  "navigationBarTitleText": "学习卡",
-  "enablePullDownRefresh": false
-}

+ 0 - 196
pages/commodity/index.less

@@ -1,196 +0,0 @@
-.commodity {
-  .cardBox {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    padding: 34rpx 21rpx;
-    background-color: white;
-
-    .vipBox {
-      position: relative;
-      width: 340rpx;
-      height: 198rpx;
-      background-size: cover;
-      border-radius: 22rpx;
-      -webkit-box-reflect: below 0rpx linear-gradient(top, rgba(255, 0, 0, 0), rgba(255, 0, 0, 0.24));
-      -webkit-box-reflect: below 4rpx -webkit-linear-gradient(top, rgba(255, 0, 0, 0), rgba(255, 0, 0, 0.24));
-    }
-
-    .bg1 {
-      background-image: url(http://reader-wx.ai160.com/images/reader/v3/learn/svip.png);
-    }
-
-    .bg2 {
-      background-image: url(http://reader-wx.ai160.com/images/reader/v3/learn/vip.png);
-    }
-
-    .bgBorder {
-      border: 4rpx solid #30C866;
-    }
-
-    .selectBtn {
-      position: absolute;
-      bottom: 10rpx;
-      right: 10rpx;
-      width: 48rpx;
-      height: 46rpx;
-    }
-
-    .checked {
-      background-color: #30C866;
-    }
-  }
-
-  .introduce {
-    margin: 20rpx 0;
-    position: relative;
-    z-index: 2;
-    width: 100%;
-    padding: 0rpx 20rpx 30rpx;
-    background-color: white;
-    box-shadow: 0 -31rpx 30rpx rgba(255, 255, 255, 1);
-
-    .title {
-      margin-bottom: 20rpx;
-      font-size: 32rpx;
-      font-weight: bold;
-    }
-
-    .price {
-      font-size: 34rpx;
-      font-weight: bold;
-      color: #FF3B00;
-    }
-  }
-
-  .entry {
-    margin-top: 10rpx;
-    padding: 36rpx 0rpx;
-    display: flex;
-    align-items: center;
-    background-color: white;
-    font-size: 30rpx;
-
-    .title {
-      width: 140rpx;
-      text-align: center;
-      color: #666666;
-    }
-
-    .detaild {
-      font-weight: bold;
-    }
-  }
-
-  .remind {
-    padding: 25rpx 36rpx;
-
-    .title {
-      font-weight: bold;
-      color: #212122;
-    }
-
-    .li {
-      margin-top: 20rpx;
-      font-size: 28rpx;
-      display: flex;
-      align-items: center;
-
-      .resetBtn {
-        margin-left: 30rpx;
-        border: none;
-      }
-
-      .img {
-        width: 70rpx;
-        height: 70rpx;
-      }
-    }
-  }
-
-  .payBox {
-    position: fixed;
-    width: 100%;
-    bottom: 0px;
-    left: 0;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    padding: 22rpx 36rpx 30rpx;
-    box-sizing: border-box;
-    background-color: white;
-    box-shadow: rgba(0, 0, 0, 0.35) 0px 30rpx 20rpx 20rpx;
-
-    .left {
-      font-size: 32rpx;
-
-      text {
-        font-size: 36rpx;
-        color: #FF3B00;
-      }
-    }
-
-    .buyBtn {
-      padding: 14rpx 100rpx;
-      background-color: #FF8E20;
-      border-radius: 50rpx;
-      color: white;
-      font-size: 36rpx;
-    }
-  }
-
-  .activationModal {
-    position: fixed;
-    z-index: 2;
-    left: 0rpx;
-    top: 0rpx;
-    width: 100vw;
-    height: 100vh;
-    background: rgba(0, 0, 0, 0.7);
-
-    .bg {
-      position: absolute;
-      width: 100%;
-      height: 200rpx;
-      z-index: -1;
-      border-radius: 0 0 100rpx 100rpx;
-      background-image: linear-gradient(132deg, #FFF4DB 14%, #FFF4DB 62%, #FEE5B5 100%);
-      font-size: 40rpx;
-      font-weight: bold;
-      padding-top: 60rpx;
-      box-sizing: border-box;
-      text-align: center;
-    }
-
-    .box {
-      position: absolute;
-      left: 0;
-      right: 0;
-      top: 30%;
-      margin: auto;
-      width: 660rpx;
-      height: 550rpx;
-      background-color: white;
-      border-radius: 20rpx;
-      text-align: center;
-
-
-      .sLcon {
-        margin-top: 164rpx;
-        width: 580rpx;
-        height: 326rpx;
-      }
-
-      .close {
-        position: absolute;
-        padding: 40rpx;
-        width: 54rpx;
-        height: 54rpx;
-        left: 0;
-        right: 0;
-        bottom: -140rpx;
-        margin: auto;
-      }
-    }
-  }
-}

+ 0 - 53
pages/commodity/index.wxml

@@ -1,53 +0,0 @@
-<wxs src="../../utils/filter.wxs" module="filters" />
-<view class="commodity">
-  <view class="cardBox">
-    <view wx:for="{{products}}" wx:key="id"
-      class="vipBox  {{selected.id==item.id?'bgBorder ':''}}{{item.payType=='LIFELONG'?'bg1':'bg2'}}" bindtap="checked"
-      data-product="{{item}}">
-      <image src="{{selected.id==item.id?'/static/ys.png':'/static/ns.png'}}" class="selectBtn" />
-    </view>
-  </view>
-  <view class="introduce">
-    <view class="title">{{selected.title}}</view>
-    <view class="price">¥{{filters.twoDecimal(selected.price)}}</view>
-  </view>
-  <view class="entry">
-    <view class="title">运费</view>
-    <view class="detaild">无需配送</view>
-  </view>
-  <view class="entry">
-    <view class="title">服务</view>
-    <view class="detaild">此商品不支持申请退款</view>
-  </view>
-  <view class="entry">
-    <view class="title">已选</view>
-    <view class="detaild">{{selected.title}}</view>
-  </view>
-  <view class="remind">
-    <view class="title">购买须知</view>
-    <view class="li">1、支付成功后将自动给您添加权限。同时会给您推送一张学习卡。</view>
-    <view class="li">2、查看使用权限,在“我的”会员栏目查看使用到期日。</view>
-    <view class="li">3、任何问题随时联系官方客服
-      <button class="resetBtn" open-type="contact" plain="true">
-        <image class="img" src="/static/contact.png" />
-      </button>
-    </view>
-  </view>
-  <view class="payBox">
-    <view class="left">
-      合计 <text>¥{{filters.twoDecimal(selected.price)}}</text>
-    </view>
-    <view class="buyBtn" bindtap="toBuy">
-      立即购买
-    </view>
-  </view>
-  <view class="activationModal" wx:if="{{activationModal}}" bindtap="closeModal">
-    <view class="box zoomIn">
-      <view class="bg">您已成功获取</view>
-      <image
-        src="{{selected.payType=='LIFELONG'?'http://reader-wx.ai160.com/images/reader/v3/learn/svip.png':'http://reader-wx.ai160.com/images/reader/v3/learn/vip.png'}}"
-        class="sLcon" />
-      <image src="/static/lollipop.png" class="close" catchtap="closeModal" />
-    </view>
-  </view>
-</view>

+ 0 - 167
pages/commodity/index.wxss

@@ -1,167 +0,0 @@
-.commodity .cardBox {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  padding: 34rpx 21rpx;
-  background-color: white;
-}
-.commodity .cardBox .vipBox {
-  position: relative;
-  width: 340rpx;
-  height: 198rpx;
-  background-size: cover;
-  border-radius: 22rpx;
-  -webkit-box-reflect: below 0rpx linear-gradient(top, rgba(255, 0, 0, 0), rgba(255, 0, 0, 0.24));
-  -webkit-box-reflect: below 4rpx -webkit-linear-gradient(top, rgba(255, 0, 0, 0), rgba(255, 0, 0, 0.24));
-}
-.commodity .cardBox .bg1 {
-  background-image: url(http://reader-wx.ai160.com/images/reader/v3/learn/svip.png);
-}
-.commodity .cardBox .bg2 {
-  background-image: url(http://reader-wx.ai160.com/images/reader/v3/learn/vip.png);
-}
-.commodity .cardBox .bgBorder {
-  border: 4rpx solid #30C866;
-}
-.commodity .cardBox .selectBtn {
-  position: absolute;
-  bottom: 10rpx;
-  right: 10rpx;
-  width: 48rpx;
-  height: 46rpx;
-}
-.commodity .cardBox .checked {
-  background-color: #30C866;
-}
-.commodity .introduce {
-  margin: 20rpx 0;
-  position: relative;
-  z-index: 2;
-  width: 100%;
-  padding: 0rpx 20rpx 30rpx;
-  background-color: white;
-  box-shadow: 0 -31rpx 30rpx #ffffff;
-}
-.commodity .introduce .title {
-  margin-bottom: 20rpx;
-  font-size: 32rpx;
-  font-weight: bold;
-}
-.commodity .introduce .price {
-  font-size: 34rpx;
-  font-weight: bold;
-  color: #FF3B00;
-}
-.commodity .entry {
-  margin-top: 10rpx;
-  padding: 36rpx 0rpx;
-  display: flex;
-  align-items: center;
-  background-color: white;
-  font-size: 30rpx;
-}
-.commodity .entry .title {
-  width: 140rpx;
-  text-align: center;
-  color: #666666;
-}
-.commodity .entry .detaild {
-  font-weight: bold;
-}
-.commodity .remind {
-  padding: 25rpx 36rpx;
-}
-.commodity .remind .title {
-  font-weight: bold;
-  color: #212122;
-}
-.commodity .remind .li {
-  margin-top: 20rpx;
-  font-size: 28rpx;
-  display: flex;
-  align-items: center;
-}
-.commodity .remind .li .resetBtn {
-  margin-left: 30rpx;
-  border: none;
-}
-.commodity .remind .li .img {
-  width: 70rpx;
-  height: 70rpx;
-}
-.commodity .payBox {
-  position: fixed;
-  width: 100%;
-  bottom: 0px;
-  left: 0;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  padding: 22rpx 36rpx 30rpx;
-  box-sizing: border-box;
-  background-color: white;
-  box-shadow: rgba(0, 0, 0, 0.35) 0px 30rpx 20rpx 20rpx;
-}
-.commodity .payBox .left {
-  font-size: 32rpx;
-}
-.commodity .payBox .left text {
-  font-size: 36rpx;
-  color: #FF3B00;
-}
-.commodity .payBox .buyBtn {
-  padding: 14rpx 100rpx;
-  background-color: #FF8E20;
-  border-radius: 50rpx;
-  color: white;
-  font-size: 36rpx;
-}
-.commodity .activationModal {
-  position: fixed;
-  z-index: 2;
-  left: 0rpx;
-  top: 0rpx;
-  width: 100vw;
-  height: 100vh;
-  background: rgba(0, 0, 0, 0.7);
-}
-.commodity .activationModal .bg {
-  position: absolute;
-  width: 100%;
-  height: 200rpx;
-  z-index: -1;
-  border-radius: 0 0 100rpx 100rpx;
-  background-image: linear-gradient(132deg, #FFF4DB 14%, #FFF4DB 62%, #FEE5B5 100%);
-  font-size: 40rpx;
-  font-weight: bold;
-  padding-top: 60rpx;
-  box-sizing: border-box;
-  text-align: center;
-}
-.commodity .activationModal .box {
-  position: absolute;
-  left: 0;
-  right: 0;
-  top: 30%;
-  margin: auto;
-  width: 660rpx;
-  height: 550rpx;
-  background-color: white;
-  border-radius: 20rpx;
-  text-align: center;
-}
-.commodity .activationModal .box .sLcon {
-  margin-top: 164rpx;
-  width: 580rpx;
-  height: 326rpx;
-}
-.commodity .activationModal .box .close {
-  position: absolute;
-  padding: 40rpx;
-  width: 54rpx;
-  height: 54rpx;
-  left: 0;
-  right: 0;
-  bottom: -140rpx;
-  margin: auto;
-}

+ 1 - 0
pages/my/index.js

@@ -53,6 +53,7 @@ Page({
   async setUserInfo() {
     let userInfo = await getMyInfo()
     let vipTime = await getVipInfo()
+    console.log(vipTime );
     this.setUser(userInfo.user)
     this.setData({
       userInfo,

+ 34 - 33
pages/my/index.less

@@ -1,5 +1,5 @@
 .container {
-  padding: 0rpx 20rpx 30rpx;
+  padding: 0rpx 20rpx 240rpx;
 
   .userBox {
     background-color: white;
@@ -258,8 +258,10 @@
     -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
 
     .buyBtn {
+      width: 254rpx;
+      text-align: center;
       position: absolute;
-      left: 168rpx;
+      left: 90rpx;
       top: 156rpx;
       color: #39029B;
       font-size: 26rpx;
@@ -269,45 +271,44 @@
   }
 
   .payBox2 {
-    margin-top: 70rpx;
     background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-2.png);
     background-size: cover;
   }
 
-  /*   .payBox {
-    position: relative;
-    margin-top: 36rpx;
-    width: 710rpx;
-    height: 184rpx;
-    border-radius: 20rpx;
-    background: url(http://reader-wx.ai160.com/images/reader/v3/learn/vip_center.png);
-    background-size: cover;
+  .renewBox {
+    margin-top: 40rpx;
+    padding: 0rpx 10rpx;
 
-    .copywriting {
-      position: absolute;
-      bottom: 70rpx;
-      left: 30rpx;
-      color: #FBF3CD;
-      font-size: 26rpx;
-      letter-spacing: 2rpx;
-
-      text {
-        margin: 0 6rpx;
-      }
+    .title {
+      font-size: 36rpx;
+      font-weight: bold;
     }
 
-    .goPay {
-      position: absolute;
-      top: 30rpx;
-      right: 28rpx;
+    .renew {
+      margin-top: 18rpx;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 19rpx 26rpx;
+      background-color: white;
       border-radius: 50rpx;
-      display: inline-block;
-      padding: 14rpx 36rpx;
-      color: #292020;
-      font-weight: bold;
-      letter-spacing: 2rpx;
-      background-image: linear-gradient(116deg, #FFF3DF 0%, #FEC98D 95%);
       font-size: 30rpx;
+
+      .left {
+        display: flex;
+        align-items: center;
+        color: #666666;
+
+        .money {
+          color: #FC614E;
+        }
+      }
+
+      .pay {
+        padding: 6rpx 50rpx;
+        border-radius: 50rpx;
+        background-image: linear-gradient(129deg, #F9D9BF 0%, #F6D0B2 45%, #F3C0A3 70%, #F1B998 100%);
+      }
     }
-  } */
+  }
 }

+ 19 - 13
pages/my/index.wxml

@@ -1,6 +1,6 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <navigationBar></navigationBar>
-<view class="container seat">
+<view class="container">
   <!-- 用户信息 -->
   <view class="userBox">
     <view class="above" bindtap="jump" data-url="/pages/editUser/index">
@@ -70,23 +70,29 @@
       <image src="/static/lollipop.png" class="close" catchtap="closeModal" />
     </view>
   </view>
-  <view class="payBox">
+  <view class="payBox" wx:if="{{!vipTime||vipTime=='1'}}">
     <view class="buyBtn" bindtap="toBuy" data-id="{{products[0].id}}">
-      立即开通
+      {{ !vipTime?'立即开通':'终身使用'}}
     </view>
   </view>
-  <view class="payBox payBox2">
-    <view class="buyBtn" bindtap="toBuy" data-id="{{products[1].id}}">
-      立即开通
+  <view class="payBox payBox2" wx:if="{{vipTime!='1'}}">
+    <view class="buyBtn" bindtap="toBuy" data-id="{{products[1].id}}" wx:if="{{!vipTime}}">立即开通
+    </view>
+    <view class="buyBtn" style="font-size: 22rpx;" wx:else>
+      有效期:{{filters.formatDate(vipTime,5)}}
     </view>
   </view>
-  <!--  <view class="payBox">
-    <view class="copywriting" wx:if="{{!vipTime}}">开通<text>SVIP</text>/<text>VIP</text> 会员权益</view>
-    <view class="copywriting" wx:if="{{vipTime}}">
-      {{vipTime==1?'终身使用':filters.formatDate(vipTime,4)}}
+  <view class="renewBox" wx:if="{{vipTime&&vipTime!='1'}}">
+    <view class="title">续费</view>
+    <view class="renew">
+      <view class="left">升级成svlp会员终身的 <view class="money">+200元</view>
+      </view>
+      <view class="pay">续费</view>
     </view>
-    <view wx:if="{{vipTime!='1'}}" class="goPay" bindtap='jump' data-url="/pages/commodity/index">
-      {{vipTime!=''?'立即续费':'立即开通'}}
+    <view class="renew">
+      <view class="left">升级成svlp会员终身的 <view class="money">+200元</view>
+      </view>
+      <view class="pay">续费</view>
     </view>
-  </view> -->
+  </view>
 </view>

+ 35 - 39
pages/my/index.wxss

@@ -1,41 +1,5 @@
 .container {
-  padding: 0rpx 20rpx 30rpx;
-  /*   .payBox {
-    position: relative;
-    margin-top: 36rpx;
-    width: 710rpx;
-    height: 184rpx;
-    border-radius: 20rpx;
-    background: url(http://reader-wx.ai160.com/images/reader/v3/learn/vip_center.png);
-    background-size: cover;
-
-    .copywriting {
-      position: absolute;
-      bottom: 70rpx;
-      left: 30rpx;
-      color: #FBF3CD;
-      font-size: 26rpx;
-      letter-spacing: 2rpx;
-
-      text {
-        margin: 0 6rpx;
-      }
-    }
-
-    .goPay {
-      position: absolute;
-      top: 30rpx;
-      right: 28rpx;
-      border-radius: 50rpx;
-      display: inline-block;
-      padding: 14rpx 36rpx;
-      color: #292020;
-      font-weight: bold;
-      letter-spacing: 2rpx;
-      background-image: linear-gradient(116deg, #FFF3DF 0%, #FEC98D 95%);
-      font-size: 30rpx;
-    }
-  } */
+  padding: 0rpx 20rpx 240rpx;
 }
 .container .userBox {
   background-color: white;
@@ -256,8 +220,10 @@
   -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
 }
 .container .payBox .buyBtn {
+  width: 254rpx;
+  text-align: center;
   position: absolute;
-  left: 168rpx;
+  left: 90rpx;
   top: 156rpx;
   color: #39029B;
   font-size: 26rpx;
@@ -265,7 +231,37 @@
   letter-spacing: 2rpx;
 }
 .container .payBox2 {
-  margin-top: 70rpx;
   background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-2.png);
   background-size: cover;
 }
+.container .renewBox {
+  margin-top: 40rpx;
+  padding: 0rpx 10rpx;
+}
+.container .renewBox .title {
+  font-size: 36rpx;
+  font-weight: bold;
+}
+.container .renewBox .renew {
+  margin-top: 18rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 19rpx 26rpx;
+  background-color: white;
+  border-radius: 50rpx;
+  font-size: 30rpx;
+}
+.container .renewBox .renew .left {
+  display: flex;
+  align-items: center;
+  color: #666666;
+}
+.container .renewBox .renew .left .money {
+  color: #FC614E;
+}
+.container .renewBox .renew .pay {
+  padding: 6rpx 50rpx;
+  border-radius: 50rpx;
+  background-image: linear-gradient(129deg, #F9D9BF 0%, #F6D0B2 45%, #F3C0A3 70%, #F1B998 100%);
+}

+ 1 - 0
utils/filter.wxs

@@ -7,6 +7,7 @@ var formatNumber = function (n) {
  */
 //时间戳转时间
 function formatDate(time, flag) {
+  console.log(time,'zz');
   if (!time) {
     return
   }