Commit 6313ff3d authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 8889a254
...@@ -28,13 +28,13 @@ ...@@ -28,13 +28,13 @@
<view style="display: flex;flex-direction: column;align-items: center;margin-bottom: 20rpx;"> <view style="display: flex;flex-direction: column;align-items: center;margin-bottom: 20rpx;">
<view style="font-size: 38rpx;color: black;">{{titleText}}</view> <view style="font-size: 38rpx;color: black;">{{titleText}}</view>
<view class="flex"> <view class="flex">
<view v-if="point>0" style="display: flex;flex-direction: row;margin-top: 10rpx;"> <!-- <view v-if="point>0" style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">解锁本集:</view> <view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">解锁本集:</view>
<view style="font-size: 42rpx;color: red;font-weight: 777;">{{point}}</view> <view style="font-size: 42rpx;color: red;font-weight: 777;">{{point}}</view>
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;margin-left: 6rpx;"> <view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;margin-left: 6rpx;">
书豆 书豆
</view> </view>
</view> </view> -->
<view v-if="point>0" style="width: 60rpx;"></view> <view v-if="point>0" style="width: 60rpx;"></view>
<view style="display: flex;flex-direction: row;margin-top: 10rpx;"> <view style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">账户余额:</view> <view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">账户余额:</view>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<view class="section"> <view class="section">
<view class="pack-box"> <view class="pack-box">
<view class="pack-item" <view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'" :style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f5f5f5;'"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList' :class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList'
:key='index' @click="choosePack(item, index)"> :key='index' @click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;"> <view style="display: flex;flex-direction: column;align-items: center;">
......
...@@ -6,40 +6,13 @@ ...@@ -6,40 +6,13 @@
:style="'display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;margin-top:'+10+'px;'"> :style="'display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;margin-top:'+10+'px;'">
<image class="avatar" src="@/static/logo-about.png"></image> <image class="avatar" src="@/static/logo-about.png"></image>
<view> <view>
<view style="font-size: 32rpx;color: black;margin-left: 20rpx;">用户ID:{{userBean.idcode}}</view> <view style="font-size: 34rpx;color: black;margin-left: 30rpx;">用户ID:{{userBean.idcode}}</view>
<view style="font-size: 26rpx;color: #b5b5b5;margin-left: 30rpx;margin-top: 10rpx;">书中自有颜如玉,书中自有黄金屋,书中自有千钟黍</view>
</view> </view>
<!-- <button text="微信用户一键登录" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">123123</button> -->
</view>
<view v-if="userBean.showVipInner "
style="display: flex;flex-direction: row;background: #f5ca86;margin: 20rpx;padding: 40rpx;border-radius:20rpx;align-items: center;justify-content:space-between;">
<view style="display: flex;flex-direction: column;justify-content: center;">
<view style="font-size: 36rpx;color: #5b1500;font-weight: 777;">
{{userBean.expireTime<=0 ? '开通VIP会员' : 'VIP会员'}}
</view>
<view v-if="userBean.expireTime<=0" style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;">
解锁全部小说
</view>
<view v-else style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;">
到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}
</view>
<view v-if="userBean.expireTime<=0" @click="handleCoinPay"
style="width: 210rpx;height: 60rpx;background-color: #5b1500;border-radius:30rpx;color: white;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;margin-top: 30rpx;">
立即开通
</view>
<view v-else style="width: 210rpx;height: 60rpx;padding-bottom: 4rpx;margin-top: 30rpx;">
</view>
</view>
<image style="border-radius:10rpx; width: 130rpx;height: 100rpx;margin-right: 20rpx;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/bg_my_vip.png" mode="scaleToFill"></image>
</view> </view>
<view <view
style="display: flex;height: 200rpx;margin: 20rpx;background: #f5ca86;border-radius: 20rpx;"> style="display: flex;height: 200rpx;margin:30rpx 20rpx;background: #263358;border-radius: 20rpx;">
<view style="flex-grow: 2; margin-left: 20rpx;"> <view style="flex-grow: 2; margin-left: 20rpx;">
<view <view
style="width: 100%;height: 100%;display: flex;flex-direction: column;justify-content: center;"> style="width: 100%;height: 100%;display: flex;flex-direction: column;justify-content: center;">
...@@ -47,18 +20,19 @@ ...@@ -47,18 +20,19 @@
<image <image
style="width: 50rpx;height: 50rpx;display: flex;align-items: right;margin-right: 10rpx;" style="width: 50rpx;height: 50rpx;display: flex;align-items: right;margin-right: 10rpx;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_my_coin.png"></image> src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_my_coin.png"></image>
<view style="font-size: 36rpx;font-weight: 777;">书豆充值</view> <view style="font-size: 36rpx;font-weight: 777;color: white;">我的书豆 {{userBean.point}}</view>
</view> </view>
<view style="font-size: 28rpx;color: #5b1500;margin-top: 20rpx;">海量书豆狂洒中,小说等你来解锁</view>
<view v-if="userBean.expireTime<=0" style="font-size: 28rpx;color: #b5b5b5;margin-top: 20rpx;">开通会员畅读VIP享更多福利</view>
<view v-else style="font-size: 28rpx;color: #b5b5b5;margin-top: 20rpx;">到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}</view>
</view> </view>
</view> </view>
<view style="width: 220rpx;"> <view style="width: 220rpx;">
<view <view
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;"> style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<view style="font-size: 30rpx;color: #5b1500;margin-bottom: 20rpx;">{{userBean.point}}</view>
<view @click="handleCoinPay" <view @click="handleCoinPay"
style="width: 160rpx;height: 60rpx;background-color: #5b1500;border-radius:30rpx;color: white;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;"> style="width: 160rpx;height: 60rpx;background-color: #fff;border-radius:30rpx;color: 263358;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;">
充值 开通
</view> </view>
</view> </view>
</view> </view>
...@@ -262,4 +236,68 @@ ...@@ -262,4 +236,68 @@
overflow: hidden; overflow: hidden;
//box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) //box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
} }
.vip-item {
width: 100%;
padding: 10rpx 40rpx;
.content {
width: 90%;
margin: auto;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 20rpx 40rpx;
background: #263358;
color: #fff;
border-radius: 18rpx;
}
.item {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
margin-right: 20rpx;
}
.item:last-child {
margin-right: 0;
}
.row {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 15rpx;
}
.row:last-child {
margin-bottom: 0;
}
.title {
font-size: 38rpx;
font-weight: 700;
font-style: italic;
}
.desc {
font-size: 26rpx;
color: #b5b5b5;
}
.button {
height: 40rpx;
line-height: 70rpx;
border-radius: 35rpx;
width: 160rpx;
background: #fff;
color: #263358;
text-align: center;
font-size: 30rpx;
font-weight: 700;
font-style: italic;
}
}
</style> </style>
\ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</view> </view>
<view v-if="userBean.expireTime<=0" style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;"> <view v-if="userBean.expireTime<=0" style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;">
解锁全部短剧 解锁全部小说
</view> </view>
<view v-else style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;"> <view v-else style="font-size: 30rpx;color: #5b1500;margin-top: 12rpx;">
到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}} 到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
src="../../static/home_collect_img_1.png"></image> src="../../static/home_collect_img_1.png"></image>
<view <view
style="font-size: 22rpx;color: gray;margin-top: 10rpx;display: flex;justify-content: center;"> style="font-size: 22rpx;color: gray;margin-top: 10rpx;display: flex;justify-content: center;">
追剧</view> 小说</view>
</view> </view>
</view> </view>
</view> </view>
......
export default class ReadCount {
constructor(param) {
const {
count
} = param || {}
this.count = count;
let result = initWithCount(count);
const {
hour,
minute,
second
} = result;
this.hour = hour;
this.minute = minute;
this.second = second;
}
}
function initWithCount(count) {
if (!count) return {};
let second = parseInt(count / 1000); // 秒数
let minute = parseInt(second / 60); // 分钟数
second = second % 60; // 更新秒数
let hour = parseInt(minute / 60); // 小时数
minute = minute % 60; // 更新分钟数
return {
hour,
minute,
second
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment