Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx

This commit is contained in:
2020-08-13 10:09:49 +08:00
17 changed files with 280 additions and 135 deletions

View File

@@ -66,7 +66,7 @@
<!-- 评论box -->
<u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx">
<view class="edit-box">
<input type="text" focus :placeholder="edit_text_other" @focus="focus" v-model="send_value">
<input type="text" :focus="is_focus" :placeholder="edit_text_other" @focus="focus" v-model="send_value">
<text @click="sendComment">发送</text>
</view>
</u-popup>
@@ -419,7 +419,7 @@ export default {
edit_text: "有爱评论,说点好听的 ~",
edit_text_other: "有爱评论,说点好听的 ~",
commentList: [], // 评论
allList: [], // 全部子评论
allList: {}, // 全部子评论
status: 'loadmore',
iconType: 'circle',
loadText: {
@@ -433,6 +433,7 @@ export default {
onLoad(option){
this.article_id = option.id;
this.articleInfo(this.article_id);
this.allList = {};
},
// 监听返回按钮
onBackPress() {
@@ -491,18 +492,28 @@ export default {
this.commentList = this.commentList.concat(res.data);
}
this.page++;
let list = this.commentList;
// list.forEach((item,index) => {
// console.log(item);
// })
}
})
},
// 打开评论输入
openKeyInput(data,index) {
// console.log(data);
let me = this;
console.log(data);
this.is_edit = true;
setTimeout(() => {
this.is_focus = true;
}, 200)
uni.onKeyboardHeightChange(function(res){
if (res.height == 0) {
me.is_focus = false;
}
})
this.comment_id = index;
if (data.id) {
if (data.content) {
this.edit_text_other = "回复@" + data.member_nickname;
this.pid = data.id;
this.reply_id = data.member_id;
@@ -525,15 +536,19 @@ export default {
pid: this.pid,
reply_id: this.reply_id,
}).then(res => {
// console.log(res.data.data);
// console.log(res.data);
if (res.errCode == 0) {
this.send_value = "";
this.comment_num = res.data.num;
// console.log(this.comment_num);
this.is_edit = false;
if (res.data.data.pid) {
console.log(res.data.data.reply_id);
if (res.data.data.reply_id) {
console.log(this.allList);
this.commentList[this.comment_id].reply_count = true;
this.allList[this.comment_id].unshift(res.data.data);
this.allList[this.comment_id] = [];
this.allList[this.comment_id].push(res.data.data);
console.log(this.allList);
} else {
this.commentList.unshift(res.data.data);
}
@@ -544,14 +559,14 @@ export default {
},
// 发现回复列表
getReplyList(id) {
this.page_[id] = 0;
if (!this.page_[id] === 0) {
}
console.log(this.page_[id]);
this.$u.post("article/articleReplyList", {id: id, page: this.page_[id]}).then(res => {
console.log(this.page_);
console.log(res);
if (res.errCode == 0) {
this.page_[id]++;
console.log(this.page_[id]);
this.allList[id] = res.data;
}
})
@@ -583,7 +598,7 @@ export default {
delta: 1
})
},
focus() {
focus(e) {
setTimeout(function(){
uni.showSoftKeybord;
}, 200)

View File

@@ -23,10 +23,13 @@
<text class="goods-name">{{ goodsInfo.goods_name }}</text>
</view>
<view class="price-collect">
<view class="pic" v-if="type != 3">
<view class="pic" v-if="type == 2">
<text>{{ goodsInfo.pintuan_price || '0.00' }}</text>
<s>{{ goodsInfo.goods_price || '0.00' }}</s>
</view>
<view class="pic" v-else-if="type == 1">
<text>{{ goodsInfo.goods_price || '0.00' }}</text>
</view>
<view class="collect" @click="switchCollect(goodsInfo.is_collect)">
<u-icon name="star" color="#474747" size="28" v-if="goodsInfo.is_collect == 0"></u-icon>
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
@@ -485,7 +488,7 @@ export default {
* @params {Number} num 数量
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
**/
settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
async settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
if(type != 'involvement') {
if(!this.showSpec) {
this.showSpec = true;
@@ -514,14 +517,14 @@ export default {
if(this.type == 2) {
if(type == 'involvement') {
// 验证能否拼团
let status = this.pintuanVerify({
const whether = await this.pintuanVerify({
pintuan_id: this.pintuan_id,
pintuangroup_headid: this.involvemenGroupInfo[0].user_id
}).then(status => {
if(status != 0) return true;
else return false;
})
// console.log(status);
if(status) return false;
if(whether) return false;
this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id);
Object.assign(params, {
pintuan_id: this.pintuan_id,

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view class="container">
<video id="videoId" :style="videoSize" :src="src" autoplay="true" :show-fullscreen-btn="false" @play="playing"
@pause="pausing" @ended="videoEnd" @timeupdate="timeupdate" :show-play-btn="false" controls="false" @click="stoping"
:enable-progress-gesture="false" :show-center-play-btn="false"></video>
@@ -29,18 +29,18 @@
</view>
</cover-view>
<!-- 单个商品 -->
<cover-view class="good-one" v-if="cart_len == 1">
<view class="one-list" v-for="(item,index) in list.goods" :key="index">
<cover-view class="good-one" :style="{ bottom: fixTop - 100 }" v-if="cart_len == 1 && cart_type">
<view class="one-list" v-for="(item,index) in list.goods" :key="index" @click="goGoodInfo(item.goods_id)">
<image class="one-image" :src="item.goods_image" mode=""></image>
<view class="one-box">
<view class="title-one">{{ item.goods_advword }}</view>
<view class="content-one">{{ item.goods_name }}</view>
<view class="good-price">¥{{ item.goods_promotion_price }}</view>
<text class="title-one">{{ item.goods_advword }}</text>
<text class="content-one">{{ item.goods_name }}</text>
<text class="good-price">¥{{ item.goods_promotion_price }}</text>
</view>
</view>
</cover-view>
<!-- 遮罩层 -->
<cover-view class="mask" @click.stop="stopClick" :style="videoSize" v-if="is_comment || cart_type">
<cover-view class="mask" @click.stop="stopClick" :style="videoSize" v-if="is_edit || is_comment || cart_type && cart_len >= 2">
<!-- 评论 -->
<cover-view class="content-box" v-if="is_comment" ref="contentBox">
<view class="content-title">
@@ -57,14 +57,15 @@
<text class="comment-time">{{ item.create_time }}</text>
</view>
</view>
<text class="reply">回复</text>
<text class="reply" @click="openKeyInput(item,index)">回复</text>
</view>
<view class="content-main">
<text class="content-style">{{ item.content }}</text>
</view>
</view>
<view class="send-box">
<input class="send-val" type="text" value="" />
<input class="send-val" type="text" :placeholder="edit_text" placeholder-class="placeholder-class"
disabled="true" @blur="blue" @click="openKeyInput" value="" />
<text class="btn-send">发送</text>
</view>
<loading class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
@@ -73,6 +74,15 @@
</loading>
</scroller>
</cover-view>
<!-- 评论框 -->
<cover-view class="edit-box" :style="videoSize" v-if="is_edit">
<view class="input-main" :style="{ bottom: editTop }">
<input class="edit-input" type="text" value="" :focus="is_focus" :placeholder=" edit_text_other ? edit_text_other : edit_text"
placeholder-class="placeholder-class" v-model="send_value" />
<text class="btn-send" @click="sendComment">发送</text>
</view>
<view></view>
</cover-view>
<!-- 购物车 -->
<cover-view class="cart-box" v-if="cart_type">
<view class="cart-title">
@@ -89,7 +99,7 @@
</view>
</view>
</view>
<loading class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
<loading v-if="0" class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
<loading-indicator class="indicator"></loading-indicator>
<text class="indicator-text">努力加载中</text>
</loading>
@@ -117,12 +127,22 @@
return {
videoSize: {},
fixTop: 0,
editTop: 0,
list: {},
labelLen: [],
cart_len: 0, // 购物车个数
cart_type: false, // 显示购物车
is_comment: false, // 显示评论
is_edit: false, // 显示输入
is_focus: false, //
comment_num: 0, // 评论数
edit_text: "有爱评论,说点好听的 ~",
edit_text_other: "有爱评论,说点好听的 ~",
pid: 0, // 主键
reply_id: 0, // 回复id
page: 0,
comment_id: 0,
send_value: "", // 评论
commentList: [], // 评论列表
src: "",
is_play: true,
@@ -170,6 +190,7 @@
this.list = res.data.data.info;
this.src = res.data.data.info.video_path;
this.cart_len = res.data.data.info.goods.length;
console.log(this.cart_len);
let item = res.data.data.info.label;
let arr = [];
item.forEach(data => {
@@ -217,11 +238,27 @@
pid: this.pid,
reply_id: this.reply_id,
},
header: {
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
},
success: (res) => {
this.is_edit = false;
if (res.data.errCode == 0) {
this.send_value = "";
this.comment_num = res.data.num;
console.log(res.data);
if (res.data.data.data.reply_id) {
// this.commentList[this.comment_id].reply_count = true;
// this.allList[this.comment_id].unshift(res.data.data);
// console.log(this.allList, 111);
} else {
this.commentList.unshift(res.data.data.data);
}
console.log(this.commentList);
} else if (res.data.errCode == 401) {
uni.showToast({
title: "您还没有登录,请先登录!",
icon: "none"
})
} else {
uni.showToast({
title: res.data.message,
@@ -288,6 +325,9 @@
// 打开弹窗
openPopup(data) {
// console.log(data);
if (this.cart_len >= 2) {
}
this.cart_type = data.cart;
this.is_comment = data.comment;
if (this.is_comment) {
@@ -296,9 +336,41 @@
// this.is_play = true;
}
},
// 打开评论输入
openKeyInput(data, index) {
let me = this;
this.is_focus = true;
setTimeout(() => {
this.is_edit = true;
}, 500)
uni.onKeyboardHeightChange(function(res) {
console.log(res);
if (res.height == 0) {
me.is_focus = false;
me.is_edit = false;
} else {
me.editTop = res.height;
}
})
this.comment_id = index;
if (data.id) {
this.edit_text_other = "回复@" + data.member_nickname;
this.pid = data.id;
this.reply_id = data.member_id;
} else {
this.edit_text_other = "有爱评论,说点好听的 ~";
this.pid = "";
this.reply_id = "";
}
// console.log(this.pid, this.edit_text_other);
},
blue() {
this.is_focus = false;
},
// 关闭评论
closeComment() {
this.is_comment = false;
this.is_edit = false;
// console.log(this.is_comment,this.is_play);
// if (!this.is_comment && this.is_play) {
// console.log(1);
@@ -316,7 +388,7 @@
// 跳转
goGoodInfo(id) {
uni.navigateTo({
url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
})
},
// stop
@@ -333,6 +405,10 @@
</script>
<style>
.container {
position: relative;
}
/* 关闭 */
.close {
position: fixed;
@@ -376,44 +452,46 @@
border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6);
}
.good-one {
position: absolute;
bottom: 300rpx;
right: 100rpx;
width: 450rpx;
position: fixed;
right: 160rpx;
width: 420rpx;
padding: 20rpx;
border-radius: 10rpx;
background-color: rgba(0,0,0,0.6);
background-color: rgba(0, 0, 0, 0.6);
}
.one-list {
flex-direction: row;
}
.one-image {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
border-radius: 4rpx;
}
.one-box {
justify-content: space-between;
justify-content: space-around;
color: #333;
}
.title-one {
width: 100rpx;
width: 200rpx;
font-size: 28rpx;
color: #fff;
lines: 1;
text-overflow: ellipsis;
}
.content-one {
width: 100rpx;
width: 200rpx;
font-size: 24rpx;
color: #fff;
lines: 2;
text-overflow: ellipsis;
}
.mask {
@@ -431,6 +509,7 @@
left: 0;
width: 750rpx;
height: 700rpx;
padding-bottom: 50rpx;
margin-bottom: 88rpx;
background-color: #fff;
}
@@ -518,8 +597,8 @@
}
.btn-send {
font-size: 30rpx;
color: #303133;
font-size: 28rpx;
color: #666;
}
.close-down {
@@ -529,6 +608,38 @@
color: #333;
}
.edit-box {
z-index: 1000;
position: fixed;
bottom: 0;
left: 0;
width: 750rpx;
background-color: rgba(0, 0, 0, 0.8);
}
.input-main {
position: fixed;
left: 0;
/* #ifdef H5 */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 750rpx;
padding: 0 20rpx;
line-height: 80rpx;
background-color: #fff;
}
.edit-input {
width: 600rpx;
height: 80rpx;
padding: 0 10rpx;
font-size: 24rpx;
color: #333;
}
.cart-box {
z-index: 99;
position: fixed;
@@ -549,33 +660,35 @@
border-bottom-width: 1rpx;
background-color: #fff;
}
.cart-list {
}
.cart-list {}
.cart-list-header {
padding: 20rpx;
flex-direction: row;
border-bottom-width: 1rpx;
border-bottom-color: #ececec;
}
.goods-img {
width: 160rpx;
height: 160rpx;
margin-right: 10rpx;
border-radius: 10rpx;
margin-right: 20rpx;
}
.goods-info {
justify-content: space-around;
}
.good-title {
width: 500rpx;
color: #333;
font-size: 30rpx;
lines: 2;
text-overflow: ellipsis;
}
.good-price {
font-size: 28rpx;
color: #FF3131;
@@ -624,7 +737,6 @@
}
.label {
lines: 3;
width: 100rpx;
height: 40rpx;
padding: 4rpx 10rpx;
@@ -632,6 +744,7 @@
margin-bottom: 10rpx;
font-size: 26rpx;
text-align: center;
line-height: 38rpx;
color: #666666;
border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6);
@@ -655,4 +768,9 @@
height: 30rpx;
color: #999;
}
.placeholder-class {
font-size: 13px;
color: #666;
}
</style>