Commit bc534b47 authored by 吴春's avatar 吴春

提交小程序评价标签以及规格日期选择

parent 050875fa
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==1"> <!-- <view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==1">
<view class="sku-title">{{ x.attr_group_name }} </view> <view class="sku-title">{{ x.attr_group_name }} </view>
<view> <view>
<view class="sku-chi" :style="{ <view class="sku-chi" :style="{
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
<!--x.isdateformat=1 改成日历模式 --> <!--x.isdateformat=1 改成日历模式 -->
<view class="sku-title">{{ x.attr_group_name }} </view> <view class="sku-title">{{ x.attr_group_name }} </view>
<view> <view>
<calendar @finish="chosenDateResult" :defaultDate="x.attr_list[0].attr_name" :immediately="true" :priceList="x.attr_list"></calendar> <calendar @finish="chosenDateResult" :defaultDate="getDefaultDate(x.attr_list[0].attr_name)" :immediately="true"
:priceList="x.attr_list"></calendar>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -245,6 +246,16 @@ ...@@ -245,6 +246,16 @@
); );
}, },
methods: { methods: {
getDefaultDate(item) {
var result = item;
if (this.skuObj && this.skuObj.attr_list && this.skuObj.attr_list.length > 0 &&this.g.mall_id==19&&this.g.mch_id==29) {
var tempItem = this.skuObj.attr_list[0];
if (tempItem && tempItem.attr_name) {
result = tempItem.attr_name;
}
}
return result;
},
chosenDateResult(result) { chosenDateResult(result) {
for (let index = 0; index < this.g.attr_groups.length; index++) { for (let index = 0; index < this.g.attr_groups.length; index++) {
for (let j = 0; j < this.g.attr_groups[index].attr_list.length; j++) { for (let j = 0; j < this.g.attr_groups[index].attr_list.length; j++) {
...@@ -486,13 +497,12 @@ ...@@ -486,13 +497,12 @@
} }
}); });
} }
if (this.g.attr_groups && this.g.attr_groups.length > 0) { if (this.g.attr_groups && this.g.attr_groups.length > 0) {
this.g.attr_groups.forEach((x, index) => { this.g.attr_groups.forEach((x, index) => {
if (x.isdateformat == 1) { if (x.isdateformat == 1) {
if (x.attr_list && x.attr_list.length > 0) { if (x.attr_list && x.attr_list.length > 0) {
x.attr_list.forEach((subItem, subIndex) => { x.attr_list.forEach((subItem, subIndex) => {
var newSign = (subIndex + 1) + ":" + priceSign; var newSign = subItem.attr_id + ":" + priceSign;
if (this.g.attr && this.g.attr.length) { if (this.g.attr && this.g.attr.length) {
this.g.attr.forEach(y => { this.g.attr.forEach(y => {
if (y.sign_id == newSign) { if (y.sign_id == newSign) {
...@@ -506,7 +516,7 @@ ...@@ -506,7 +516,7 @@
} }
}); });
} }
console.log("this.g.attr_groups", this.g.attr_groups)
if (this.g.attr && this.g.attr.length) { if (this.g.attr && this.g.attr.length) {
this.g.attr.forEach(x => { this.g.attr.forEach(x => {
if (x.sign_id == sign) { if (x.sign_id == sign) {
......
...@@ -6,9 +6,16 @@ ...@@ -6,9 +6,16 @@
<view v-for="(item,index) in d" class="fontw100" :class="[active==item.Id?'active':'']" :style="{'color':active==item.Id?mainColor:''}" <view v-for="(item,index) in d" class="fontw100" :class="[active==item.Id?'active':'']" :style="{'color':active==item.Id?mainColor:''}"
@click="changeHandler(item.Id)"> @click="changeHandler(item.Id)">
<view>{{item.Name}}</view> <view>{{item.Name}}</view>
<text class="fontw100" :style="{'color':mainColor}">¥{{item.minprices}} <template v-if="item.minprices">
<text></text> <text class="fontw100" :style="{'color':mainColor}">¥{{item.minprices}}
</text> <text></text>
</text>
</template>
<template v-else>
<text class="fontw100" :style="{'color':mainColor}">
<text>暂无团期</text>
</text>
</template>
<view class="tabsLine" :style="{'background':active==item.Id?mainColor:''}"></view> <view class="tabsLine" :style="{'background':active==item.Id?mainColor:''}"></view>
</view> </view>
</view> </view>
...@@ -218,6 +225,7 @@ ...@@ -218,6 +225,7 @@
watch: { watch: {
defaultDate(newVal) { defaultDate(newVal) {
console.log("newVal",newVal)
this.userDefaultDate = newVal; this.userDefaultDate = newVal;
if (this.userDefaultDate != "") { if (this.userDefaultDate != "") {
this.start = this.setDefaultDate(this.userDefaultDate); this.start = this.setDefaultDate(this.userDefaultDate);
...@@ -271,19 +279,19 @@ ...@@ -271,19 +279,19 @@
} }
}, },
methods: { methods: {
getMinPrice(){ getMinPrice() {
this.d.forEach(x=>{ this.d.forEach(x => {
x.prices = [] x.prices = []
}) })
for (let i = 0; i < this.priceList.length; i++) { for (let i = 0; i < this.priceList.length; i++) {
let datas = this.priceList[i].attr_name.split('-') let datas = this.priceList[i].attr_name.split('-')
for (let j = 0; j < this.d.length; j++) { for (let j = 0; j < this.d.length; j++) {
let m = this.d[j].Month > 9 ? this.d[j].Month : '0' + this.d[j].Month let m = this.d[j].Month > 9 ? this.d[j].Month : '0' + this.d[j].Month
if (datas[1] == m) { if (datas[1] == m) {
this.d[j].prices.push(this.priceList[i].newPrice) this.d[j].prices.push(this.priceList[i].newPrice)
}
} }
} }
}
this.d.forEach(x => { this.d.forEach(x => {
x.minprices = Math.min.apply(null, x.prices) x.minprices = Math.min.apply(null, x.prices)
}) })
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
background: bgColor background: bgColor
}"> }">
<scroll-view scroll-x class="u-scroll-view" :scroll-left="scrollLeft" scroll-with-animation> <scroll-view scroll-x class="u-scroll-view" :scroll-left="scrollLeft" scroll-with-animation>
<view class="u-scroll-box" :class="{'u-tabs-scorll-flex': !isScroll}"> <view class="u-scroll-box" :class="{'u-tabs-scorll-flex': !isScroll,'u-tabs-scorll-flexWrap': isWrap}">
<view class="u-tab-item" :id="'u-tab-item-' + index" v-for="(item, index) in list" :key="index" @tap="clickTab(index)" <view class="u-tab-item" :id="'u-tab-item-' + index" v-for="(item, index) in list" :key="index" @tap="clickTab(index)"
:style="[tabItemStyle(index)]"> :style="[tabItemStyle(index)]">
{{ item[name] || item['name']}} {{ item[name] || item['name']}}
</view> </view>
<view v-if="showBar" class="u-tab-bar" :style="[tabBarStyle]"></view> <view v-if="showBar&&!isWrap" class="u-tab-bar" :style="[tabBarStyle]"></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
export default { export default {
name: "u-tabs", name: "u-tabs",
props: { props: {
// 是否换行
isWrap: {
type: Boolean,
default: false
},
// 导航菜单是否需要滚动,如只有2或者3个的时候,就不需要滚动了,此时使用flex平分tab的宽度 // 导航菜单是否需要滚动,如只有2或者3个的时候,就不需要滚动了,此时使用flex平分tab的宽度
isScroll: { isScroll: {
type: Boolean, type: Boolean,
...@@ -193,7 +198,7 @@ ...@@ -193,7 +198,7 @@
return (index) => { return (index) => {
let style = { let style = {
height: this.height + 'rpx', height: this.height + 'rpx',
'line-height': this.height + 'rpx', // 'line-height': this.height + 'rpx',
fontSize: this.fontSize + 'rpx', fontSize: this.fontSize + 'rpx',
'transition-duration': `${this.duration}s`, 'transition-duration': `${this.duration}s`,
padding: this.isScroll ? `0 ${this.gutter}rpx` : '', padding: this.isScroll ? `0 ${this.gutter}rpx` : '',
...@@ -335,4 +340,7 @@ ...@@ -335,4 +340,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.u-tabs-scorll-flexWrap{
flex-wrap: wrap;
}
</style> </style>
<template> <template>
<view class="comment-list" > <view class="comment-list">
<u-tabs <u-tabs name="name" :list="list" :is-scroll="false" :is-wrap="true" :active-color="mc" :current="current"
name="name" :item-style="activeItemStyle" :height="60" @change="tabsChange"></u-tabs>
:list="list" <view class="comment-details" style="heigh: calc(100% - 40px);" v-if="comments.length>0">
:is-scroll="false" <scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true"
:active-color="mc" style="height: 100%; padding-bottom: 0px;">
:current="current" <view class="comment">
@change="tabsChange" <view class="content" v-for="(x, i) in comments" :key="i">
></u-tabs> <view class="u-box">
<view class="comment-details" style="heigh: calc(100% - 40px);" v-if="comments.length>0"> <view class="user">
<scroll-view <u-avatar :src="x.UserPhotoPath" :size="50"></u-avatar>
:scroll-y="true" <text
@scrolltolower="lower" style="margin:0 10px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;max-width: 130px;">{{ x.UserName }}</text>
:enable-back-to-top="true" <u-rate :current="x.CommentScore" active-color="#FA3534" inactive-color="#b2b2b2"
:enable-flex="true" active-icon="star" inactive-icon="star-o" size="20" :disabled="true"></u-rate>
style="height: 100%; padding-bottom: 0px;" </view>
> <view class="timer">{{ x.CreateDate }}</view>
<view class="comment"> </view>
<view class="content" v-for="(x, i) in comments" :key="i"> <view class="ucontent">{{ x.Content }}</view>
<view class="u-box"> <view class="imagebox" v-for="(y, yi) in x.formatPic" :key="yi">
<view class="user"> <view class="item" v-for="(z, zi) in y" :key="zi"
<u-avatar :src="x.UserPhotoPath" :size="50"></u-avatar> :style="{ 'max-width': yi == 0 ? 'unset' : '31.9%' }">
<text style="margin:0 10px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;max-width: 130px;">{{ x.UserName }}</text> <view class="scal" @click="previewImage(zi,yi,x.CommentImgList)">
<u-rate <image :src="z" mode="aspectFill" class="image" />
:current="x.CommentScore" <view class="more" v-if="
active-color="#FA3534"
inactive-color="#b2b2b2"
active-icon="star"
inactive-icon="star-o"
size="20"
:disabled="true"
></u-rate>
</view>
<view class="timer">{{ x.CreateDate }}</view>
</view>
<view class="ucontent">{{ x.Content }}</view>
<view class="imagebox" v-for="(y, yi) in x.formatPic" :key="yi">
<view
class="item"
v-for="(z, zi) in y"
:key="zi"
:style="{ 'max-width': yi == 0 ? 'unset' : '31.9%' }"
>
<view class="scal" @click="previewImage(zi,yi,x.CommentImgList)">
<image :src="z" mode="aspectFill" class="image" />
<view
class="more"
v-if="
x.pic_url.length > 4 && x.pic_url.length > 4 &&
(yi + 1) * (zi + 1) == x.pic_url.length (yi + 1) * (zi + 1) == x.pic_url.length
" ">
> <view style="width: 100%;">
<view style="width: 100%;"> <view class="big">5图</view>\n\r
<view class="big">5图</view>\n\r <view class="small">查看全部</view>
<view class="small">查看全部</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="reply" v-if="x.Reply!=''">
<view class="reply" v-if="x.Reply!=''"> <view style="font-size: 12px;color: #121212;">回复:</view>
<view style="font-size: 12px;color: #121212;">回复:</view> <view style="font-size: 12px;color: #9A9A9A;margin-top: 3px;">{{x.Reply}}</view>
<view style="font-size: 12px;color: #9A9A9A;margin-top: 3px;">{{x.Reply}}</view> </view>
</view> </view>
</view> </view>
</view> <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20"
<u-loadmore bg-color="#fff" />
:status="status" </scroll-view>
:load-text="loadText" </view>
:font-size="24" <u-empty text="没有找到相关评论" mode="news" v-else></u-empty>
:margin-top="20" </view>
:margin-bottom="20"
bg-color="#fff"
/>
</scroll-view>
</view>
<u-empty
text="没有找到相关评论"
mode="news"
v-else
></u-empty>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
current: 0, // tabs组件的current值,表示当前活动的tab选项 current: 0, // tabs组件的current值,表示当前活动的tab选项
page: 1, page: 1,
pageCount: 0, pageCount: 0,
id: 0, id: 0,
comments: [], comments: [],
commentCount: [], commentCount: [],
loading: false, loading: false,
mc: "", mc: "",
pageTitle: "全部评论", pageTitle: "全部评论",
status: "loadmore", status: "loadmore",
isover: false, isover: false,
list:[], list: [],
loadText: { loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多评论了", nomore: "没有更多评论了",
}, },
msg:{ msg: {
pageIndex:1, pageIndex: 1,
pageSize:20, pageSize: 20,
GoodsId:0, GoodsId: 0,
CommentGrade:0 CommentGrade: 0,
} CommentLabelId: 0,
};
}, },
onLoad(option) { activeItemStyle:{
uni.showNavigationBarLoading(); 'flex-wrap': 'wrap',
this.id = option.id || 46942; }
this.mc = this.$uiConfig.mainColor; };
},
this.initPage(); onLoad(option) {
this.getCommentStatistics() uni.showNavigationBarLoading();
}, this.id = option.id || 46942;
methods: { this.mc = this.$uiConfig.mainColor;
previewImage(i,i2,images) {
let current = (i2)*3 + i this.initPage();
uni.previewImage({ this.getCommentStatistics()
urls: images, },
current: current, methods: {
longPressActions: { previewImage(i, i2, images) {
itemList: ["发送给朋友", "保存图片", "收藏"], let current = (i2) * 3 + i
success: function (data) { uni.previewImage({
console.log( urls: images,
"选中了第" + current: current,
(data.tapIndex + 1) + longPressActions: {
"个按钮,第" + itemList: ["发送给朋友", "保存图片", "收藏"],
(data.index + 1) + success: function(data) {
"张图片" console.log(
); "选中了第" +
}, (data.tapIndex + 1) +
fail: function (err) { "个按钮,第" +
console.log(err.errMsg); (data.index + 1) +
}, "张图片"
}, );
}); },
}, fail: function(err) {
initPage() { console.log(err.errMsg);
let currentPages = getCurrentPages(); },
let u = "/" + currentPages[currentPages.length - 1].route; },
let pages = uni.getStorageSync("basedata") });
? uni.getStorageSync("basedata").bar_title },
: []; initPage() {
pages.forEach((x) => { let currentPages = getCurrentPages();
if (x.value == u) { let u = "/" + currentPages[currentPages.length - 1].route;
this.pageTitle = x.new_name ? x.new_name : x.name; let pages = uni.getStorageSync("basedata") ?
} uni.getStorageSync("basedata").bar_title : [];
}); pages.forEach((x) => {
uni.setNavigationBarTitle({ if (x.value == u) {
title: this.pageTitle, this.pageTitle = x.new_name ? x.new_name : x.name;
}); }
}, });
getCommentStatistics(){ uni.setNavigationBarTitle({
this.request2( title: this.pageTitle,
{ });
url: "/api/AppletOrder/GetAppletGoodsCommentStatistics", },
data: { getCommentStatistics() {
GoodsId:this.id this.request2({
url: "/api/AppletOrder/GetAppletGoodsCommentStatistics",
data: {
GoodsId: this.id
},
},
(res) => {
let data = res.data.List
data.forEach(x => {
x.name = x.Name + '(' + x.Count + ')'
})
data.unshift({
name: '全部',
Id: 0
})
this.list = data
this.msg.CommentGrade = data[0].Id
this.msg.CommentLabelId = 0
this.init();
}
);
},
init() {
this.isover = false;
this.loading = true;
this.showLoading = this.page != 1;
this.msg.GoodsId = this.id;
this.request2({
url: "/api/AppletOrder/GetAppletGoodsCommentPageList",
data: this.msg,
},
(res) => {
this.comments = res.data.pageData;
this.comments.forEach((x) => {
x.formatPic = this.formatPic(x.CommentImgList);
});
//TODO 缺陷待处理
// this.commentCount = res.data.comment_count;
this.commentCount = res.data.pageData;
this.pageCount = Math.ceil(
// parseFloat(this.commentCount[0].count) / 10.0
parseFloat(res.data.count) / 10.0
);
this.commentCount.forEach((x) => {
x.name = x.UserName + "(" + x.Content + ")";
});
this.showLoading = true;
if (this.pageCount == 1) {
this.isover = true;
this.status = "nomore";
} else {
this.status = "loadmore";
}
this.loading = false;
uni.hideNavigationBarLoading();
}
);
},
formatPic(pics) {
let arr = [];
let temp = [];
pics.forEach((x, i) => {
temp.push(x);
if (i == 2) {
arr.push(temp);
temp = [];
} else if (i == 5) {
arr.push(temp);
temp = [];
} else if (i == pics.length - 1) {
arr.push(temp);
}
});
return arr;
}, },
}, tabsChange(index) {
(res) => { this.current = index;
this.msg.pageIndex = 1;
let data = res.data.List if (this.list[index].Type == 1) {
data.forEach(x=>{ this.msg.CommentGrade = this.list[index].Id
x.name = x.Name+'(' + x.Count + ')' this.msg.CommentLabelId = 0
})
data.unshift({name:'全部',Id:0}) } else if (this.list[index].Type == 2) {
this.list = data this.msg.CommentLabelId = this.list[index].Id
this.msg.CommentGrade = data[0].Id this.msg.CommentGrade = 0
this.init(); }
}
); this.init()
}, this.page = 1
init() { },
this.isover = false; lower(e) {
this.loading = true; if (this.page < this.pageCount) {
this.showLoading = this.page != 1; if (!this.loading) {
this.msg.GoodsId=this.id; this.status = "loading";
this.request2( this.page++;
{ this.init();
url: "/api/AppletOrder/GetAppletGoodsCommentPageList", }
data: this.msg, } else {
}, this.isover = true;
(res) => { this.status = "nomore";
this.comments = res.data.pageData; }
this.comments.forEach((x) => { },
x.formatPic = this.formatPic(x.CommentImgList); },
}); };
//TODO 缺陷待处理
// this.commentCount = res.data.comment_count;
this.commentCount = res.data.pageData;
this.pageCount = Math.ceil(
// parseFloat(this.commentCount[0].count) / 10.0
parseFloat(res.data.count) / 10.0
);
this.commentCount.forEach((x) => {
x.name = x.UserName + "(" + x.Content + ")";
});
this.showLoading = true;
if (this.pageCount == 1) {
this.isover = true;
this.status = "nomore";
} else {
this.status = "loadmore";
}
this.loading = false;
uni.hideNavigationBarLoading();
}
);
},
formatPic(pics) {
let arr = [];
let temp = [];
pics.forEach((x, i) => {
temp.push(x);
if (i == 2) {
arr.push(temp);
temp = [];
} else if (i == 5) {
arr.push(temp);
temp = [];
} else if (i == pics.length - 1) {
arr.push(temp);
}
});
return arr;
},
tabsChange(index) {
this.current = index;
this.msg.pageIndex = 1;
this.msg.CommentGrade = this.list[index].Id
this.init()
this.page=1
},
lower(e) {
if (this.page < this.pageCount) {
if (!this.loading) {
this.status = "loading";
this.page++;
this.init();
}
} else {
this.isover = true;
this.status = "nomore";
}
},
},
};
</script> </script>
<style> <style>
.comment-list { .comment-list {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
font-family: aa; font-family: aa;
} }
.comment-list .comment-details {
height: calc(100% - 40px); .comment-list .comment-details {
padding: 10px 0 0 0; height: calc(100% - 40px);
} padding: 10px 0 0 0;
.comment-list .comment-details .comment { }
/* margin: 10px 0;
.comment-list .comment-details .comment {
/* margin: 10px 0;
background: #fff; background: #fff;
padding: 10px; */ padding: 10px; */
} }
.comment-list .comment-details .comment .chead {
padding-bottom: 10px; .comment-list .comment-details .comment .chead {
border-bottom: 1px solid #f1f1f1; padding-bottom: 10px;
} border-bottom: 1px solid #f1f1f1;
.comment-list .comment-details .comment .content { }
display: flex;
flex-direction: column; .comment-list .comment-details .comment .content {
margin-bottom: 10px; display: flex;
padding: 10px; flex-direction: column;
background: #fff; margin-bottom: 10px;
} padding: 10px;
.comment-list .comment-details .comment .content .u-box { background: #fff;
display: flex; }
margin-bottom: 10px;
flex-direction: row; .comment-list .comment-details .comment .content .u-box {
justify-content: space-between; display: flex;
align-items: center; margin-bottom: 10px;
flex-direction: row;
} justify-content: space-between;
.comment-list .comment-details .comment .content .u-box .user { align-items: center;
flex: 1;
font-size: 12px; }
color: gray;
align-items: center; .comment-list .comment-details .comment .content .u-box .user {
display: flex; flex: 1;
} font-size: 12px;
.comment-list .comment-details .comment .content .u-box .timer { color: gray;
font-size: 12px; align-items: center;
color: gray; display: flex;
text-align: right; }
flex: 1;
} .comment-list .comment-details .comment .content .u-box .timer {
.comment-list .comment-details .comment .content .u-box .ucontent { font-size: 12px;
font-size: 12px; color: gray;
color: #000; text-align: right;
margin-top: 10px; flex: 1;
} }
.comment-list .comment-details .comment .content .imagebox {
display: flex; .comment-list .comment-details .comment .content .u-box .ucontent {
/* justify-content:space-evenly; */ font-size: 12px;
margin-right: -5px; color: #000;
margin-bottom: -5px; margin-top: 10px;
margin-top: 5px; }
/* flex-wrap: wrap; */
} .comment-list .comment-details .comment .content .imagebox {
.comment-list .comment-details .comment .content .imagebox .item { display: flex;
flex: 1; /* justify-content:space-evenly; */
max-width: 70vw; margin-right: -5px;
margin-right: 5px; margin-bottom: -5px;
margin-bottom: 5px; margin-top: 5px;
min-width: 31.9%; /* flex-wrap: wrap; */
} }
.comment-list .comment-details .comment .content .imagebox .item .scal {
width: 100%; .comment-list .comment-details .comment .content .imagebox .item {
padding-bottom: 100%; flex: 1;
height: 0; max-width: 70vw;
position: relative; margin-right: 5px;
overflow: hidden; margin-bottom: 5px;
} min-width: 31.9%;
.comment-list .comment-details .comment .content .imagebox .item .scal .image { }
position: absolute;
top: 0; .comment-list .comment-details .comment .content .imagebox .item .scal {
left: 0; width: 100%;
width: 100%; padding-bottom: 100%;
z-index: 1; height: 0;
height: 100%; position: relative;
} overflow: hidden;
.comment-list }
.comment-details
.comment .comment-list .comment-details .comment .content .imagebox .item .scal .image {
.content position: absolute;
.imagebox top: 0;
.item:first-child left: 0;
.scal { width: 100%;
border-top-left-radius: 5px; z-index: 1;
border-bottom-left-radius: 5px; height: 100%;
} }
.comment-list
.comment-details .comment-list .comment-details .comment .content .imagebox .item:first-child .scal {
.comment border-top-left-radius: 5px;
.content border-bottom-left-radius: 5px;
.imagebox }
.item:last-child
.scal { .comment-list .comment-details .comment .content .imagebox .item:last-child .scal {
border-top-right-radius: 5px; border-top-right-radius: 5px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 5px;
} }
.comment-list .comment-details .comment .content .imagebox .item .scal .more {
position: absolute; .comment-list .comment-details .comment .content .imagebox .item .scal .more {
top: 0; position: absolute;
left: 0; top: 0;
width: 100%; left: 0;
z-index: 2; width: 100%;
height: 100%; z-index: 2;
background: rgba(0, 0, 0, 0.5); height: 100%;
color: #fff; background: rgba(0, 0, 0, 0.5);
display: flex; color: #fff;
align-items: center; display: flex;
} align-items: center;
.comment-list }
.comment-details
.comment .comment-list .comment-details .comment .content .imagebox .item .scal .more .big {
.content font-size: 18px;
.imagebox font-weight: 500;
.item text-align: center;
.scal margin-bottom: 5px;
.more }
.big {
font-size: 18px; .comment-list .comment-details .comment .content .imagebox .item .scal .more .small {
font-weight: 500; font-size: 14px;
text-align: center; text-align: center;
margin-bottom: 5px; }
}
.comment-list .comment-list .reply {
.comment-details width: 100%;
.comment padding: 10px;
.content background: #F5F6F7;
.imagebox border-radius: 3px;
.item margin-top: 10px;
.scal
.more }
.small {
font-size: 14px; /deep/ .comment-list .u-tab-item {
text-align: center; margin: 5px;
} padding: 5px 10px;
.comment-list .reply{ background-color: #f5f5f5;
width: 100%; border: 1px solid #ddd;
padding: 10px; border-radius: 50px;
background: #F5F6F7; font-size: 12px;
border-radius: 3px; color: #666;
margin-top: 10px; height:32px;
line-height:20px;
} }
</style> </style>
\ No newline at end of file
...@@ -306,7 +306,10 @@ ...@@ -306,7 +306,10 @@
<view class="label">选择</view> <view class="label">选择</view>
<view class="content"> <view class="content">
<view class="sku-chosen" @click="chosenSku"> <view class="sku-chosen" @click="chosenSku">
<view class="sku">{{ currentSku.attr_list.length > 0 ? '已' : '请' }}选择 {{ sku }}</view> <view class="sku">
<template v-if="currentSku&&currentSku.attr_list && currentSku.attr_list.length > 0">已选择 {{ sku }}</template>
<template v-else>请选择 {{ sku }}</template>
</view>
<view class="arrow"> <view class="arrow">
<u-icon name="arrow" :size="32" color="#111"></u-icon> <u-icon name="arrow" :size="32" color="#111"></u-icon>
</view> </view>
...@@ -613,16 +616,7 @@ ...@@ -613,16 +616,7 @@
let basedata = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata") : ''; let basedata = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata") : '';
this.AppletID = basedata.home_pages.id ? basedata.home_pages.id : 0; this.AppletID = basedata.home_pages.id ? basedata.home_pages.id : 0;
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
// if (!this.u) {
// this.u = {
// nickName: "未登录",
// avatarUrl: "",
// };
// this.showAuth = true;
// } else {
// this.init();
// this.initPage();
// }
this.initPage(); this.initPage();
this.getVipId(); this.getVipId();
...@@ -701,9 +695,7 @@ ...@@ -701,9 +695,7 @@
this.init(); this.init();
}, },
methods: { methods: {
// counter() {
// document.querySelector("#productId");
// },
// tob切换 // tob切换
change(index) { change(index) {
this.current = index; this.current = index;
...@@ -712,26 +704,7 @@ ...@@ -712,26 +704,7 @@
console.log(e); console.log(e);
}, },
initImages() { initImages() {
// let that = this;
// let info = uni.createSelectorQuery().in(this);
// info
// .select(".goods")
// .boundingClientRect((data) => {
// console.log("得到布局位置信息" + JSON.stringify(data));
// })
// .exec();
// info
// .boundingClientRect(function (data) {
// console.log(data)
// })
// .exec();
// wx.createSelectorQuery()
// .selectAll("#goodpic")
// .fields({ rect: true })
// .exec(res => {
// console.log(res);
// });
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
...@@ -772,7 +745,6 @@ ...@@ -772,7 +745,6 @@
if (res.data) { if (res.data) {
this.vipState = res.data.VIPModel; this.vipState = res.data.VIPModel;
} }
// this.initRecommend();
} }
); );
}, },
...@@ -795,20 +767,21 @@ ...@@ -795,20 +767,21 @@
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.g = res.data.goods; this.g = res.data.goods;
// 报名限制数组 // 报名限制数组
res.data.goods.edu_data && res.data.goods.edu_data.ClassCondition && res.data.goods.edu_data.ClassCondition.forEach( res.data.goods.edu_data && res.data.goods.edu_data.ClassCondition && res.data.goods
item2 => { .edu_data.ClassCondition.forEach(
if (item2.ItemType == 1) { item2 => {
this.ItemType1.push(item2) if (item2.ItemType == 1) {
} else if (item2.ItemType == 2) { this.ItemType1.push(item2)
this.ItemType2.push(item2) } else if (item2.ItemType == 2) {
} else if (item2.ItemType == 3) { this.ItemType2.push(item2)
this.ItemType3.push(item2) } else if (item2.ItemType == 3) {
} else if (item2.ItemType == 4) { this.ItemType3.push(item2)
this.ItemType4.push(item2) } else if (item2.ItemType == 4) {
} else if (item2.ItemType == 5) { this.ItemType4.push(item2)
this.ItemType5.push(item2) } else if (item2.ItemType == 5) {
} this.ItemType5.push(item2)
}) }
})
// 报名限制数组结束 // 报名限制数组结束
this.g.totalStock = 0; this.g.totalStock = 0;
this.g.attr.forEach((x) => { this.g.attr.forEach((x) => {
...@@ -909,8 +882,8 @@ ...@@ -909,8 +882,8 @@
}, },
(res) => { (res) => {
this.comments = res.data.pageData; this.comments = res.data.pageData;
console.log("1111", this.comments)
// this.initRecommend();
}, },
(err) => { (err) => {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
...@@ -1273,7 +1246,7 @@ ...@@ -1273,7 +1246,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
/* -webkit-line-clamp: 2; /* -webkit-line-clamp: 2;
-webkit-box-orient: vertical; */ -webkit-box-orient: vertical; */
font-size: 16px; font-size: 16px;
/* height: 45px; */ /* height: 45px; */
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="title-box">输入评价内容</view> <view class="title-box">输入评价内容</view>
<view class="classifyBigBox">
<view class="oneClassify flex" :class="{selectActive:selected[item.Id]==true}" v-for="(item,i) in LabelIdList"
@click="onSelectClassify(item.Id)">
{{item.Name}}
</view>
</view>
<view class="editor-box"> <view class="editor-box">
<view class="editor-icon"> <view class="editor-icon">
<u-icon name="edit" size="36"></u-icon> <u-icon name="edit" size="36"></u-icon>
...@@ -54,13 +60,17 @@ ...@@ -54,13 +60,17 @@
Content: "", Content: "",
OrderDetailId: 0, OrderDetailId: 0,
CommentImgList: [], CommentImgList: [],
CommentScore: 5 CommentScore: 5,
LabelIds:'',
}, },
submitStatus: false, submitStatus: false,
goodsName: "", goodsName: "",
goodsPic: "", goodsPic: "",
action: this.host2 + "/api/File/UploadTencent", action: this.host2 + "/api/File/UploadTencent",
fileList: [], fileList: [],
LabelIdList: [],
selected: [],
selectedLabelId: [],
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -71,6 +81,7 @@ ...@@ -71,6 +81,7 @@
this.goodsName = param.GoodsName; this.goodsName = param.GoodsName;
this.goodsPic = param.CoverImage; this.goodsPic = param.CoverImage;
} }
this.GetCommentLabel()
}, },
mounted() { mounted() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -78,10 +89,21 @@ ...@@ -78,10 +89,21 @@
}); });
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1; let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo")
.MallBaseId : 1;
this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
}, },
methods: { methods: {
onSelectClassify(id) {
this.$set(this.selected, id, !this.selected[id]) //动态更新视图数据
let index = this.selectedLabelId.findIndex(item => item == id)
if (index == -1) {
this.selectedLabelId.push(id)
} else {
this.selectedLabelId = this.selectedLabelId.filter(item => item !== id);
}
},
uploadSuccessHandler(data, index, lists) { uploadSuccessHandler(data, index, lists) {
let r = JSON.parse(data); let r = JSON.parse(data);
this.msg.CommentImgList.push(r.data); this.msg.CommentImgList.push(r.data);
...@@ -89,8 +111,21 @@ ...@@ -89,8 +111,21 @@
change(val) { change(val) {
this.msg.CommentScore = val this.msg.CommentScore = val
}, },
GetCommentLabel() {
this.request2({
url: "/api/order/GetCommentLabelList",
data: {},
},
(res) => {
this.LabelIdList = res.data;
}
);
},
submitForm() { submitForm() {
this.submitStatus = true; this.submitStatus = true;
if(this.selectedLabelId){
this.msg.LabelIds=this.selectedLabelId.join(',')
}
if (this.msg.CommentScore > 0) { if (this.msg.CommentScore > 0) {
this.request2({ this.request2({
url: "/api/AppletOrder/SetGoodsCommentInfo", url: "/api/AppletOrder/SetGoodsCommentInfo",
...@@ -134,6 +169,52 @@ ...@@ -134,6 +169,52 @@
</script> </script>
<style> <style>
.commit-detail .classifyBigBox {
margin: 27rpx 0;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 30rpx;
font-size: 10px;
}
.commit-detail .oneClassify {
display: flex;
align-items: center;
padding: 17rpx;
justify-content: center;
background: F7F7F7;
border-radius: 13rpx;
background: #F5F5F5;
color: #696969;
border: 2rpx solid #dedede;
}
.commit-detail .selectActive {
background: #ff547b;
color: #FFFFFF;
}
.commit-detail .tl-btn-120 {
width: 180rpx;
padding: 17rpx;
background: F7F7F7;
color: #999;
border-radius: 13rpx;
border: 2rpx solid #dedede;
text-align: center;
}
.commit-detail .onConfirmFiltrate {
width: 180rpx;
padding: 17rpx;
background: #2851F3;
color: #FFFFFF;
border-radius: 13rpx;
text-align: center;
margin-left: 20rpx;
}
.commit-detail { .commit-detail {
background: #faf8f9; background: #faf8f9;
height: 100vh; height: 100vh;
......
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