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>
This diff is collapsed.
...@@ -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