Browse Source

一系列优化

master
Enzo 4 years ago
parent
commit
2927f9590f
  1. 8
      pages/discover/discover.vue
  2. 30
      pages/discover/discoverdetails.vue
  3. 42
      pages/discover/publish.vue
  4. 4
      pages/shop/seckillList.vue
  5. 2
      pages/user/my/center.vue

8
pages/discover/discover.vue

@ -33,16 +33,16 @@
</view> </view>
<view class="lf-m-t-30 lf-row-between lf-p-l-50 lf-p-r-50"> <view class="lf-m-t-30 lf-row-between lf-p-l-50 lf-p-r-50">
<view class="lf-row-center" @click.stop="addLike(item.id)"> <view class="lf-row-center" @click.stop="addLike(item.id)">
<text class="lf-iconfont icon-xihuanlike lf-color-price" v-if="item.is_like"></text>
<text class="lf-iconfont icon-xihuan" v-else></text>
<text class="lf-iconfont icon-xihuanlike lf-color-price lf-font-40" v-if="item.is_like"></text>
<text class="lf-iconfont icon-xihuan lf-font-40" v-else></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{item.likes_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{item.likes_count}}</text>
</view> </view>
<view class="lf-row-center"> <view class="lf-row-center">
<text class="lf-iconfont icon-chakan"></text>
<text class="lf-iconfont icon-chakan lf-font-40"></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{item.view_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{item.view_count}}</text>
</view> </view>
<view class="lf-row-center" @click="goDetails(item.id)"> <view class="lf-row-center" @click="goDetails(item.id)">
<text class="lf-iconfont icon-pinglun-"></text>
<text class="lf-iconfont icon-pinglun- lf-font-40"></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{item.comments_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{item.comments_count}}</text>
</view> </view>
</view> </view>

30
pages/discover/discoverdetails.vue

@ -24,16 +24,16 @@
</view> </view>
<view class="lf-m-t-30 lf-row-between lf-p-l-50 lf-p-r-50"> <view class="lf-m-t-30 lf-row-between lf-p-l-50 lf-p-r-50">
<view class="lf-row-center" @click="addLike(discover_details.id)"> <view class="lf-row-center" @click="addLike(discover_details.id)">
<text class="lf-iconfont icon-xihuanlike lf-color-price" v-if="discover_details.is_like"></text>
<text class="lf-iconfont icon-xihuan" v-else></text>
<text class="lf-iconfont icon-xihuanlike lf-color-price lf-font-40" v-if="discover_details.is_like"></text>
<text class="lf-iconfont icon-xihuan lf-font-40" v-else></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.likes_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.likes_count}}</text>
</view> </view>
<view class="lf-row-center"> <view class="lf-row-center">
<text class="lf-iconfont icon-chakan"></text>
<text class="lf-iconfont icon-chakan lf-font-40"></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.view_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.view_count}}</text>
</view> </view>
<view class="lf-row-center"> <view class="lf-row-center">
<text class="lf-iconfont icon-pinglun-"></text>
<text class="lf-iconfont icon-pinglun- lf-font-40"></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.comments_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.comments_count}}</text>
</view> </view>
</view> </view>
@ -59,8 +59,8 @@
</view> </view>
<view class="lf-m-l-32" style="position: absolute;right:33rpx;"> <view class="lf-m-l-32" style="position: absolute;right:33rpx;">
<view @click.stop="giveaLike(commentitem.id)"> <view @click.stop="giveaLike(commentitem.id)">
<text class="lf-iconfont icon-xihuanlike lf-color-price" v-if="commentitem.is_like"></text>
<text class="lf-iconfont icon-xihuan" v-else></text>
<text class="lf-iconfont icon-xihuanlike lf-color-price lf-font-36" v-if="commentitem.is_like"></text>
<text class="lf-iconfont icon-xihuan lf-font-36" v-else></text>
</view> </view>
<view class="lf-color-555 lf-font-24 lf-row-center">{{commentitem.likes_count}}</view> <view class="lf-color-555 lf-font-24 lf-row-center">{{commentitem.likes_count}}</view>
</view> </view>
@ -91,8 +91,8 @@
</view> </view>
<view class="lf-m-t-30" style="position: absolute;right:33rpx;"> <view class="lf-m-t-30" style="position: absolute;right:33rpx;">
<view @click.stop="giveaLike(subitem.id)"> <view @click.stop="giveaLike(subitem.id)">
<text class="lf-iconfont icon-xihuanlike lf-color-price" v-if="subitem.is_like"></text>
<text class="lf-iconfont icon-xihuan" v-else></text>
<text class="lf-iconfont icon-xihuanlike lf-color-price lf-font-36" v-if="subitem.is_like"></text>
<text class="lf-iconfont icon-xihuan lf-font-36" v-else></text>
</view> </view>
<view class="lf-color-555 lf-font-24 lf-row-center">{{subitem.likes_count}}</view> <view class="lf-color-555 lf-font-24 lf-row-center">{{subitem.likes_count}}</view>
</view> </view>
@ -110,17 +110,17 @@
<input class="rom-search" type="text" confirm-type="send" v-else @confirm="sendComment(discover_details.id)" :cursor-spacing="8" v-model="comment" placeholder="说点什么" /> <input class="rom-search" type="text" confirm-type="send" v-else @confirm="sendComment(discover_details.id)" :cursor-spacing="8" v-model="comment" placeholder="说点什么" />
</view> </view>
<view class="lf-row-center"> <view class="lf-row-center">
<view class="lf-row-center lf-m-r-35" style="align-items: center;" @click.stop="addLike(discover_details.id)">
<text class="lf-iconfont icon-xihuanlike lf-color-price lf-font-36" v-if="discover_details.is_like"></text>
<text class="lf-iconfont icon-xihuan lf-font-36" v-else></text>
<view class="lf-row-center lf-m-r-35" style="align-items: center;justify-content: center;" @click.stop="addLike(discover_details.id)">
<text class="lf-iconfont icon-xihuanlike lf-color-price lf-font-40" v-if="discover_details.is_like"></text>
<text class="lf-iconfont icon-xihuan lf-font-40" v-else></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.likes_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.likes_count}}</text>
</view> </view>
<view class="lf-row-center lf-m-r-35" style="align-items: center;">
<text class="lf-iconfont icon-chakan lf-font-44"></text>
<view class="lf-row-center lf-m-r-35" style="align-items: center;justify-content: center;">
<text class="lf-iconfont icon-chakan lf-font-40"></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.view_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.view_count}}</text>
</view> </view>
<view class="lf-row-center lf-m-r-35" style="align-items: center;">
<text class="lf-iconfont icon-pinglun- lf-font-36"></text>
<view class="lf-row-center lf-m-r-35" style="align-items: center;justify-content: center;">
<text class="lf-iconfont icon-pinglun- lf-font-40"></text>
<text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.comments_count}}</text> <text class="lf-font-24 lf-color-777 lf-m-l-10">{{discover_details.comments_count}}</text>
</view> </view>
</view> </view>

42
pages/discover/publish.vue

@ -30,7 +30,9 @@
image_count: 6, image_count: 6,
content: '', content: '',
backInquiry: false, backInquiry: false,
uploadImg: []
uploadImg: [],
p_list: [],
tempFilesList: []
} }
}, },
watch: { watch: {
@ -51,15 +53,26 @@
this.$msg('请输入文字内容!'); this.$msg('请输入文字内容!');
return return
} }
if(this.uploadImg.length == 0) {
if(this.tempFilesList.length == 0) {
this.$msg('请上传图片!'); this.$msg('请上传图片!');
return return
} }
let p_list = [];
this.tempFilesList.forEach((item,index) => {
p_list.push(this.uploadDiscover(item.path))
})
this.p_list = p_list;
Promise.all(this.p_list).then(result => {
this.$http this.$http
.post({ .post({
api: 'api/discover/create', api: 'api/discover/create',
data: { data: {
images: this.uploadImg,
images: result,
content: this.content content: this.content
}, },
header: { header: {
@ -69,6 +82,8 @@
.then(res => { .then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.status) { if (res.data.status) {
this.content = '';
this.image_list = [];
this.$msg('发布成功',{duration: 2500}).then(() => { this.$msg('发布成功',{duration: 2500}).then(() => {
this.$toBack(); this.$toBack();
}) })
@ -93,8 +108,11 @@
showCancel: false showCancel: false
}); });
}); });
})
}, },
uploadDiscover(img) { uploadDiscover(img) {
console.log('=========',img)
return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
header: { header: {
Authorization: this.$cookieStorage.get('user_token') Authorization: this.$cookieStorage.get('user_token')
@ -105,13 +123,14 @@
name: 'image', name: 'image',
success: res => { success: res => {
var result = JSON.parse(res.data).data.url; var result = JSON.parse(res.data).data.url;
this.uploadImg.push(result)
console.log('上传后的图片路径',this.uploadImg)
resolve(result);
}, },
fail: err => { fail: err => {
console.log(err) console.log(err)
reject(err)
} }
}) })
})
}, },
// //
uploadImage(){ uploadImage(){
@ -142,9 +161,7 @@
}) })
} }
this.image_list.push(...image_list); this.image_list.push(...image_list);
this.uploadDiscover(tempFiles[0].path)
console.log('当前选择的图片列表',this.image_list);
this.tempFilesList.push(...tempFiles);
} }
}) })
}, },
@ -160,9 +177,16 @@
}, },
// //
removeInage(current){ removeInage(current){
uni.showModal({
title: '提示',
content: '即将取消上传这张图片,请确认?',
success: e => {
if (!e.confirm) return;
this.image_list.splice(current, 1); this.image_list.splice(current, 1);
this.uploadImg.splice(current, 1); this.uploadImg.splice(current, 1);
console.log('删除的图片列表',this.uploadImg);
this.tempFilesList.splice(current, 1);
}
});
} }
} }
} }

4
pages/shop/seckillList.vue

@ -20,7 +20,7 @@
{{item.seckill.end_left_time[0]}}{{item.seckill.end_left_time[1]}}{{item.seckill.end_left_time[2]}}{{item.seckill.end_left_time[3]}} {{item.seckill.end_left_time[0]}}{{item.seckill.end_left_time[1]}}{{item.seckill.end_left_time[2]}}{{item.seckill.end_left_time[3]}}
</view> --> </view> -->
<view class="desc" v-if="item.ifStart">距离结束还剩余 <view class="desc" v-if="item.ifStart">距离结束还剩余
<countdown-timer :time="item.countTime" :autoStart="true" @finish="dateFinish">
<countdown-timer :time="item.countTime" :autoStart="true" @finish="dateFinish" v-if="item.countTime">
<template v-slot="{day,hour,minute, second}"> <template v-slot="{day,hour,minute, second}">
<view class="lf-flex"> <view class="lf-flex">
<view class="lf-font-24">{{ day >= 10 ? day : "0" + day }}</view> <view class="lf-font-24">{{ day >= 10 ? day : "0" + day }}</view>
@ -36,7 +36,7 @@
</countdown-timer> </countdown-timer>
</view> </view>
<view class="desc" v-else>距离开始还剩余 <view class="desc" v-else>距离开始还剩余
<countdown-timer :time="item.countTime" :autoStart="true" @finish="dateFinish">
<countdown-timer :time="item.countTime" :autoStart="true" @finish="dateFinish" v-if="item.countTime">
<template v-slot="{day,hour,minute, second}"> <template v-slot="{day,hour,minute, second}">
<view class="lf-flex"> <view class="lf-flex">
<view class="lf-font-24">{{ day >= 10 ? day : "0" + day }}</view> <view class="lf-font-24">{{ day >= 10 ? day : "0" + day }}</view>

2
pages/user/my/center.vue

@ -31,7 +31,7 @@
<view class="lf-font-24 lf-color-white">余额()</view> <view class="lf-font-24 lf-color-white">余额()</view>
</view> </view>
<view class="lf-row-center lf-flex-column" @click="$url('/pages/coupon/index/index')"> <view class="lf-row-center lf-flex-column" @click="$url('/pages/coupon/index/index')">
<view class="lf-font-36 lf-color-white">{{centerInfo.coupon || 0}}</view>
<view class="lf-font-36 lf-color-white">{{centerInfo.couponCount || 0}}</view>
<view class="lf-font-24 lf-color-white">优惠券</view> <view class="lf-font-24 lf-color-white">优惠券</view>
</view> </view>
</view> </view>

Loading…
Cancel
Save