forked from zhongyuanhaiju/uniapp
parent
e248b528c5
commit
3971527e60
|
|
@ -7,21 +7,6 @@
|
|||
<view class="help-meta">
|
||||
<text class="help-time">发表时间: {{ detail.create_time }}</text>
|
||||
</view>
|
||||
<!--用户信息 存在分享人则显示分享人信息,不存在则显示本人信息 -->
|
||||
<!-- <view class="user">-->
|
||||
<!-- <view class="avatar" @click="goToPage">-->
|
||||
<!-- <image class="avatar-image" :src="$util.img(member.headimg)"></image>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="info" @click="goToPage">-->
|
||||
<!-- <view class="nickname">{{ member.nickname }}</view>-->
|
||||
<!-- <view class="phone">{{ member.mobile }}</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="btn">-->
|
||||
<!-- <!–判断:当前用户存在推荐人且本人不是分销商-显示推荐人信息,不存在推荐人或者本人是分销商-显示本人信息; 当:本人不是分销商或者会员卡已过期-显示升级名片,本人是分销商且会员卡未过期-显示我要推广–>-->
|
||||
<!-- <view class="btn-item" v-if="member.show_type === 'upgrade'" @click="onUpgrade">升级名片</view>-->
|
||||
<!-- <view class="btn-item" v-else @click="share_panel = true">我要分享</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!--文章内容-->
|
||||
<view class="help-content">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
|
|
@ -35,7 +20,7 @@
|
|||
<van-icon v-else class="good-job-o" name="good-job-o" />
|
||||
赞 {{ detail.dianzan_num }}
|
||||
</view>
|
||||
<view class="share_panel" @click="share_panel = true"><image class="my-icon" src="./public/img/fenxiang.png"></image>分享</view>
|
||||
<!--<view class="share_panel" @click="share_panel = true"><image class="my-icon" :src="fenxiang"></image>分享</view>-->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 推荐阅读 -->
|
||||
|
|
@ -49,36 +34,33 @@
|
|||
</view>
|
||||
<!--推荐列表-->
|
||||
<view class="article">
|
||||
<van-list v-model="list_loading" :finished="finished" finished-text="" @load="getList">
|
||||
<view class="article-block" v-for="(item,index) in list" :key="index" @click="goToDetail(item.article_id)">
|
||||
|
||||
<view class="block-content">
|
||||
<view class="content-title">{{ item.article_title }}</view>
|
||||
<view class="content-abstract">{{ item.article_abstract }}</view>
|
||||
<view class="content-info">
|
||||
<view class="content-info-item">
|
||||
<image class="my-icon" src="./public/img/liulan.png"></image>
|
||||
{{ item.read_num }}
|
||||
</view>
|
||||
<view class="content-info-item">
|
||||
<image class="my-icon" src="./public/img/dianzan.png"></image>
|
||||
{{ item.dianzan_num }}
|
||||
</view>
|
||||
<view class="content-info-item" style="width: 160rpx">{{ item.create_time.split(" ")[0] }}</view>
|
||||
<view class="article-block" v-for="(item,index) in list" :key="index" @click="goToDetail(item.article_id)">
|
||||
<view class="block-content">
|
||||
<view class="content-title">{{ item.article_title }}</view>
|
||||
<view class="content-abstract">{{ item.article_abstract }}</view>
|
||||
<view class="content-info">
|
||||
<view class="content-info-item">
|
||||
<image class="my-icon" :src="liulan"></image>
|
||||
{{ item.read_num }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="img">
|
||||
<image class="image" :src="$util.img(item.cover_img)"></image>
|
||||
<view class="content-info-item">
|
||||
<image class="my-icon" :src="dianzan"></image>
|
||||
{{ item.dianzan_num }}
|
||||
</view>
|
||||
<view class="content-info-item" style="width: 160rpx">{{ item.create_time.split(" ")[0] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-list>
|
||||
<view class="img">
|
||||
<image class="image" :src="$util.img(item.cover_img)"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tabBar -->
|
||||
<view class="page-bottom"><diy-bottom-nav></diy-bottom-nav></view>
|
||||
<!--分享面板-->
|
||||
<share :show="share_panel" @close="share_panel = false" :share="share_info" :shareParams="share_params"></share>
|
||||
<!--分享面板 todo:微信小程序分享有兼容性问题 并且这里不需要分享 做隐藏操作 -->
|
||||
<!--<share :show="share_panel" @close="share_panel = false" :share="share_info" :shareParams="share_params"></share>-->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -91,6 +73,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
liulan: this.$util.img('public/picture/aijiu/liulan.png'),
|
||||
dianzan: this.$util.img('public/picture/aijiu/dianzan.png'),
|
||||
fenxiang: this.$util.img('public/picture/aijiu/fenxiang.png'),
|
||||
set_info: {},
|
||||
loading: true,
|
||||
articleId: 0,
|
||||
|
|
@ -125,6 +110,7 @@ export default {
|
|||
if (options.source_member) uni.setStorageSync('source_member', options.source_member);
|
||||
// 获取数据
|
||||
this.getData();
|
||||
this.getList();
|
||||
},
|
||||
onShow() {
|
||||
//记录分享关系
|
||||
|
|
@ -173,15 +159,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 点击升级名片
|
||||
onUpgrade(){
|
||||
if(this.member.level_expire_time > 0) this.$util.redirectTo('/pages_tool/member/card')
|
||||
else this.$util.redirectTo('/pages_tool/member/card_buy')
|
||||
},
|
||||
// 点击进入名片
|
||||
goToPage(){
|
||||
this.$util.redirectTo('/pages_promotion/card/homepage')
|
||||
},
|
||||
// 获取基本设置
|
||||
getSetting(){
|
||||
let _this = this;
|
||||
|
|
@ -402,6 +379,9 @@ export default {
|
|||
}
|
||||
}
|
||||
.recommend{
|
||||
// #ifdef MP-WEIXIN
|
||||
padding-bottom: 200rpx;
|
||||
// #endif
|
||||
.top{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@
|
|||
<view class="punish">
|
||||
<view class="punish-block">
|
||||
<view class="punish-title">违规次数</view>
|
||||
<view class="punish-num">{{ user.violation_num }}</view>
|
||||
<view class="punish-num">{{ user.violation_num || 0 }}</view>
|
||||
</view>
|
||||
<view class="punish-block" v-if="h > 0 || i > 0 || s > 0">
|
||||
<view class="punish-title">惩罚倒计时</view>
|
||||
<view class="punish-num">{{ h }}时{{ i }}分{{ s }}秒</view>
|
||||
</view>
|
||||
<view class="punish-block">
|
||||
<view class="punish-title">违规总次数</view>
|
||||
<view class="punish-num">{{ user.total_violation_num }}</view>
|
||||
</view>
|
||||
<view class="punish-block" v-if="user.punish_time > 0">
|
||||
<view class="punish-title">惩罚结束时间</view>
|
||||
<view class="punish-num">{{ $util.timeStampTurnTime(user.punish_time) }}</view>
|
||||
<view class="punish-num">{{ user.total_violation_num || 0 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--菜单列表-->
|
||||
|
|
@ -81,6 +81,13 @@ export default {
|
|||
// 用户信息
|
||||
info: {},
|
||||
user: {},
|
||||
// 倒计时
|
||||
end_time: 0,// 结束时间 时间戳
|
||||
diff_time: 0,
|
||||
h: '00',
|
||||
i: '00',
|
||||
s: '00',
|
||||
interval: '',
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
|
|
@ -101,10 +108,7 @@ export default {
|
|||
success: res => {
|
||||
if(parseInt(res.code) === 0){
|
||||
this.info = res.data;
|
||||
console.log(this.info);
|
||||
}
|
||||
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
|
|
@ -118,15 +122,32 @@ export default {
|
|||
success: res => {
|
||||
if(parseInt(res.code) === 0){
|
||||
this.user = res.data;
|
||||
this.end_time = this.user.punish_time || 0;
|
||||
// 开启倒计时
|
||||
this.countDown();
|
||||
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
},
|
||||
fail: res => {}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 惩罚时间倒计时
|
||||
countDown(){
|
||||
this.interval = setInterval(() => {
|
||||
// 获取距离结束时间的毫秒数
|
||||
let nowTime = Math.ceil((new Date()).getTime() / 1000);
|
||||
this.diff_time = this.end_time - nowTime;
|
||||
// 计算时间
|
||||
let result = this.$util.countDown(this.diff_time);
|
||||
this.h = (parseInt(result.d) * 24) + parseInt(result.h);
|
||||
this.i = parseInt(result.i);
|
||||
this.s = parseInt(result.s);
|
||||
if(parseInt(this.h) <= 0 && parseInt(this.i) <= 0 && parseInt(this.s) <= 0){
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
},
|
||||
onBackPress(options) {
|
||||
|
|
@ -195,7 +216,7 @@ export default {
|
|||
}
|
||||
}
|
||||
.menu-list{
|
||||
width: 100%;
|
||||
width: calc(100% - (30rpx * 2));
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
padding: 30rpx;
|
||||
|
|
@ -219,7 +240,7 @@ export default {
|
|||
background: #ef5452;
|
||||
}
|
||||
.menu-list-content{
|
||||
width: calc(100% - (30rpx * 2));
|
||||
width: 100%;
|
||||
|
||||
.menu-block{
|
||||
--block-size--: 150rpx;
|
||||
|
|
@ -289,13 +310,17 @@ export default {
|
|||
}
|
||||
.punish{
|
||||
display: inline-flex;
|
||||
width: 100%;
|
||||
width: calc(100% - (30rpx * 2));
|
||||
height: 150rpx;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
margin: 20rpx 0;
|
||||
margin: 20rpx 30rpx;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 4rpx 4rpx 6rpx #e9eaed;
|
||||
|
||||
.punish-title{
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ export default {
|
|||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
justify-content: flex-start;
|
||||
height: 50rpx;
|
||||
.left{
|
||||
line-height: 50rpx;
|
||||
|
|
@ -257,8 +257,9 @@ export default {
|
|||
height: 40rpx;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 10rpx;
|
||||
background: #de6758;
|
||||
background: #ff0000;
|
||||
color: #ffffff;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
.block-content{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
<view class="seckill-top">
|
||||
<image class="top-background-image" :src="$util.img('public/static/img/futures/seckill-bg.png')" mode="widthFix"></image>
|
||||
<view class="seckill-count-down" v-if="h > 0 || i > 0 || s > 0">
|
||||
距结束
|
||||
<text v-if="parseInt(activity_status) === 1">距开始</text>
|
||||
<text v-else>距结束</text>
|
||||
<text class="count-down-time">{{ h }}</text>时
|
||||
<text class="count-down-time">{{ i }}</text>分
|
||||
<text class="count-down-time">{{ s }}</text>秒
|
||||
|
|
@ -14,7 +15,8 @@
|
|||
<!--商品列表-->
|
||||
<mescroll-uni ref="mescroll" @getData="getList" top="240">
|
||||
<block slot="list">
|
||||
<view class="goods-list" v-if="list.length > 0">
|
||||
<!--活动正常进行中 商品列表-->
|
||||
<view class="goods-list" v-if="list.length > 0 && parseInt(activity_status) === 3">
|
||||
<view class="goods-block" v-for="(item,index) in list" :key="index">
|
||||
<view class="left">
|
||||
<image class="goods-image" :src="$util.img(item.goods_image)" mode="widthFix"></image>
|
||||
|
|
@ -39,8 +41,13 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<ns-empty :isIndex="false" :text="msg"></ns-empty>
|
||||
<!--秒杀活动未正常进行时的内容-->
|
||||
<view class="not-list" v-else>
|
||||
<image class="not-list-image" v-if="parseInt(activity_status) === 1" :src="$util.img('public/static/img/futures/futures_not_started.png')" mode="widthFix"></image>
|
||||
<image class="not-list-image" v-if="parseInt(activity_status) === 2" :src="$util.img('public/static/img/futures/futures_not_goods.png')" mode="widthFix"></image>
|
||||
<view class="back-buttons">
|
||||
<view class="back-buttons-btn" @click="$util.goBack();">返回</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
|
@ -56,7 +63,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
list: [],
|
||||
msg: '暂无秒杀商品!',
|
||||
activity_status: 1,// 活动状态:1=活动未开始,2=活动已开始无商品,3=活动正常进行中
|
||||
status_text: {
|
||||
1 : '库存',
|
||||
2 : '正在销售',
|
||||
|
|
@ -67,7 +74,7 @@ export default {
|
|||
7 : '捡漏',
|
||||
},
|
||||
// 倒计时
|
||||
end_time: 0,// 结束时间 时间戳
|
||||
setInterval_time: 0,// 倒计时计算时间
|
||||
diff_time: 0,
|
||||
h: '00',
|
||||
i: '00',
|
||||
|
|
@ -95,22 +102,27 @@ export default {
|
|||
},
|
||||
success: res => {
|
||||
if(parseInt(res.code) === 0){
|
||||
// 活动正常进行中
|
||||
mescroll.endSuccess(Object.keys(res.data.list).length);
|
||||
|
||||
//设置列表数据
|
||||
if (parseInt(mescroll.num) === 1){
|
||||
this.list = []; //如果是第一页需手动制空列表
|
||||
}
|
||||
|
||||
if (parseInt(mescroll.num) === 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(res.data.list); //追加新数据
|
||||
this.end_time = parseInt(res.data.end_time);
|
||||
// 开启倒计时
|
||||
this.countDown();
|
||||
}else {
|
||||
this.msg = res.message;
|
||||
this.setInterval_time = parseInt(res.data.end_time);
|
||||
// 判断状态
|
||||
this.activity_status = 3;// 正常进行中
|
||||
if(Object.keys(this.list).length <= 0) this.activity_status = 2;// 已开始无商品
|
||||
}else if(parseInt(res.code) === -801){
|
||||
// 未到秒杀时间 res.code:-801=未到秒杀时间
|
||||
mescroll.endSuccess(0);
|
||||
this.activity_status = 1;// 活动未开始
|
||||
this.setInterval_time = res.data.miaosha_start_time;
|
||||
}
|
||||
// 开启倒计时
|
||||
this.countDown();
|
||||
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
setTimeout(() => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}, 1000);
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
|
|
@ -123,7 +135,7 @@ export default {
|
|||
this.interval = setInterval(() => {
|
||||
// 获取距离结束时间的毫秒数
|
||||
let nowTime = Math.ceil((new Date()).getTime() / 1000);
|
||||
this.diff_time = this.end_time - nowTime;
|
||||
this.diff_time = this.setInterval_time - nowTime;
|
||||
// 计算时间
|
||||
let result = this.$util.countDown(this.diff_time);
|
||||
this.h = (parseInt(result.d) * 24) + parseInt(result.h);
|
||||
|
|
@ -131,8 +143,6 @@ export default {
|
|||
this.s = parseInt(result.s);
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') return false;
|
||||
|
|
@ -326,8 +336,40 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/ .empty{
|
||||
background: #fff;
|
||||
.not-list{
|
||||
width: 100%;
|
||||
padding-top: 200rpx;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.not-list-image{
|
||||
max-width: 60vw!important;
|
||||
max-height: 60vw!important;
|
||||
}
|
||||
.back-buttons{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 50rpx;
|
||||
.back-buttons-btn{
|
||||
background: linear-gradient(90deg, #f5877b, #e93e3d);
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-size: 34rpx;
|
||||
color: #fffefe;
|
||||
width: 300rpx;
|
||||
text-align: center;
|
||||
border-radius: 100rpx;
|
||||
letter-spacing: 6rpx;
|
||||
text-indent: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue