comment 7.2

This commit is contained in:
ghusermoon 2020-07-24 19:48:57 +08:00
parent 4196f545fd
commit dd71a0f32a
23 changed files with 1630 additions and 350 deletions

View File

@ -259,7 +259,14 @@ export default {
}, },
getStoreInfo({id}){ getStoreInfo({id}){
return vm.$u.post('Store/getStoreInfo',{id}) return vm.$u.post('Store/getStoreInfo',{id})
} },
// 获取商品评论
getAllEvalue({ goods_id, page }) {
return vm.$u.post('Specialci/getAllEvalue', {
goods_id: goods_id,
page: page,
})
},
} }
} }

View File

@ -0,0 +1,100 @@
<template>
<view class="comment-item">
<view class="user">
<u-avatar :src="content.member_avatar" class="avatar" size="60"></u-avatar>
<text class="name">{{ content.geval_frommembername }}</text>
<u-rate v-if="reply" :disabled='true' count="count" v-model="rate" size="23" active-color="#FF780F" inactive-color="#F0EDF1" gutter="10"></u-rate>
</view>
<view class="content">
<view class="text">{{ content.geval_content }}</view>
</view>
<view class="reply" v-if="reply && content.geval_explain">
<view class="title">掌柜回复</view>
<view class="content u-line-4">{{ content.geval_explain }}</view>
</view>
<view class="time" v-if="reply">
<image src="/static/image/common/20.png"></image>
<view class="value">{{ content.geval_addtime }}</view>
</view>
</view>
</template>
<script>
/*
* @description 显示评价
* @property {Boolean} reply 是否显示回复/时间/评分
**/
export default {
data() {
return {
count: 5,
rate: 2,
}
},
props: {
content: Object,
reply: Boolean,
},
created() {
if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two;
}
};
</script>
<style lang="scss" scoped>
.comment-item {
background-color: #ffffff;
.user {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.name {
margin: 0 20rpx;
font-size: 26rpx;
color: rgba(153,153,153,1);
}
}
.content {
margin-bottom: 20rpx;
.text {
font-size: 26rpx;
color: rgba(51,51,51,1);
line-height: 40rpx;
margin-bottom: 20rpx;
}
> image {
width: 210rpx;
height: 210rpx;
border-radius: 10px;
&:not(:nth-child(3n)) {
margin-right: 30rpx;
}
}
}
.reply {
padding: 30rpx;
background: rgba(240,238,238,1);
border-radius: 10rpx;
font-size: 24rpx;
color: rgba(102,102,102,1);
margin-bottom: 20rpx;
.title {
margin-bottom: 16rpx;
}
.content {
line-height: 36rpx;
}
}
.time {
display: flex;
align-items: center;
> image {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
}
.value {
font-size: 24rpx;
color: rgba(153,153,153,1);
}
}
}
</style>

View File

@ -11,7 +11,7 @@
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i"> <swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
<!-- 最多显示3个 --> <!-- 最多显示3个 -->
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem> <sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length"></u-empty> <u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length" style="margin: 0 auto;"></u-empty>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
@ -24,16 +24,33 @@ export default {
sitem sitem
}, },
props: { props: {
groupList: Array,
classifyList: Array, classifyList: Array,
}, },
data(){ data(){
return { return {
current: 0, current: -1,
swiperCurrent: 0, swiperCurrent: 0,
groupList: [], //
} }
}, },
watch: {
current(value) {
this.getPinTuanList(this.classifyList[value].gc_id);
}
},
created() {
this.current = 0;
},
methods: { methods: {
//
getPinTuanList(id) {
this.$u.api.getPinTuanList({
page: 0,
gc_id: id,
}).then(res => {
this.groupList = res.data;
})
},
tabsChange(index) { tabsChange(index) {
this.swiperCurrent = index; this.swiperCurrent = index;
}, },
@ -52,7 +69,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.group{ .group{
.top{ background-color: #ffffff;
.top {
padding: 0 30rpx;
height: 90rpx; height: 90rpx;
width: 100%; width: 100%;
display: flex; display: flex;
@ -67,18 +86,11 @@ export default {
color: #999; color: #999;
} }
} }
// .label{ .list {
// display: flex; box-sizing: border-box;
// font-size: 24rpx; padding: 30rpx;
// color: #999;
// >text{
// margin-right: 34rpx;
// }
// }
.list{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 21rpx;
} }
} }
</style> </style>

View File

@ -16,19 +16,26 @@ export default {
}, },
methods: { methods: {
toDetailsPage() { toDetailsPage() {
this.$u.api.getPinTuanDetails({ // this.$u.api.getPinTuanDetails({
pintuan_id: this.info.pintuan_id, // pintuan_id: this.info.pintuan_id,
}).then(res => { // }).then(res => {
if(res.errCode == 0) { // if(res.errCode == 0) {
const goods = { // const goods = {
goods: res.data.data, // goods: res.data.data,
type: 2, // type: 2,
} // }
this.$store.commit('setGoodsDetails', goods); // this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.info.pintuan_id); // this.$store.commit('setGoodsId', this.info.pintuan_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
}) params: {
id: this.info.pintuan_id,
type: 2,
} }
}) })
} }

View File

@ -1,23 +1,19 @@
<template> <template>
<view class="list"> <view class="list">
<view class="top"> <view class="top">商品推荐</view>
商品推荐
</view>
<view> <view>
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper> <u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
</view> </view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}"> <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index"> <swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
<view class="goods-item"> <view class="goods-item">
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item> <item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
</view> </view>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty> <u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
<!-- </scroll-view> -->
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- 加载更多 --> <!-- 加载更多 -->
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20"></u-loadmore> <u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20"></u-loadmore>
<!-- <loadmore ref="loadmore" @callback="getGoodsRecommend" bgColor="#FFF" :page="page"></loadmore> --> <!-- <loadmore ref="loadmore" @callback="getGoodsRecommend" bgColor="#FFF" :page="page"></loadmore> -->
</view> </view>
</template> </template>
@ -124,29 +120,17 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.list{ .list{
.top{ background-color: #ffffff;
padding: 30rpx {
top: 0;
};
.top {
font-size: 30rpx; font-size: 30rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
text-align: center; text-align: center;
color: #333; color: #333;
} }
// .label{
// display: flex;
// color: #999;
// flex-wrap: wrap;
// >text{
// margin-right: 34rpx;
// margin-bottom: 10rpx;
// }
// }
// .item{
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
// margin-top: 20rpx;
// }
.goods-item { .goods-item {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

View File

@ -16,18 +16,25 @@ export default {
}, },
methods: { methods: {
toDetailsPage() { toDetailsPage() {
this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => { // this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
if (res.errCode == 0) { // if (res.errCode == 0) {
const goods = { // const goods = {
goods: res.data, // goods: res.data,
type: 1, // type: 1,
} // }
this.$store.commit('setGoodsDetails', goods); // this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.info.goods_id); // this.$store.commit('setGoodsId', this.info.goods_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// // console.log(this.goodsInfo.mobile_body);
// }
// })
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
}) params: {
// console.log(this.goodsInfo.mobile_body); id: this.info.goods_id,
type: 1,
} }
}) })
} }

View File

@ -32,7 +32,7 @@ export default {
props: ['recommendData', 'type'], props: ['recommendData', 'type'],
created() { created() {
this.info = this.recommendData; this.info = this.recommendData;
console.log(this.recommendData); // console.log(this.recommendData);
} }
} }
</script> </script>

View File

@ -39,19 +39,26 @@ export default {
}, },
methods: { methods: {
toDetailsPage() { toDetailsPage() {
this.$u.api.getPinTuanDetails({ // this.$u.api.getPinTuanDetails({
pintuan_id: this.recommendData.pintuan_id // pintuan_id: this.recommendData.pintuan_id
}).then(res => { // }).then(res => {
if(res.errCode == 0) { // if(res.errCode == 0) {
const goods = { // const goods = {
goods: res.data.data, // goods: res.data.data,
type: 2, // type: 2,
} // }
this.$store.commit('setGoodsDetails', goods); // this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.recommendData.pintuan_id); // this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
}) params: {
id: this.recommendData.pintuan_id,
type: 2,
} }
}) })
} }
@ -60,7 +67,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.recommend{ .recommend{
.top{ margin-bottom: 20rpx;
padding: 0 30rpx;
background-color: #ffffff;
.top {
height: 90rpx; height: 90rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -75,6 +85,7 @@ export default {
} }
} }
.connect{ .connect{
padding: 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.user { .user {

View File

@ -45,6 +45,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.seckill{ .seckill{
background-color: #fff;
padding: 30rpx;
margin-bottom: 20rpx;
.top{ .top{
height: 60rpx; height: 60rpx;
display: flex; display: flex;

View File

@ -26,20 +26,27 @@ export default {
methods: { methods: {
spikeGoods() { spikeGoods() {
// console.log(this.item.groupbuy_id); // console.log(this.item.groupbuy_id);
this.$u.api.getSpikeInfo({ // this.$u.api.getSpikeInfo({
groupbuy_id: this.item.groupbuy_id // groupbuy_id: this.item.groupbuy_id
}).then(res => { // }).then(res => {
if(res.errCode == 0) { // if(res.errCode == 0) {
const goods = { // const goods = {
goods: res.data.goodsInfo, // goods: res.data.goodsInfo,
type: 3, // 1 2 3 4 // type: 3, // 1 2 3 4
} // }
this.$store.commit('setGoodsDetails', goods); // this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo); // this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
this.$store.commit('setGoodsId', this.item.groupbuy_id); // this.$store.commit('setGoodsId', this.item.groupbuy_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
}) params: {
id: this.item.groupbuy_id,
type: 3,
} }
}) })
}, },

View File

@ -42,37 +42,51 @@ export default {
methods: { methods: {
spikeGoods() { spikeGoods() {
// console.log(this.item.groupbuy_id); // console.log(this.item.groupbuy_id);
this.$u.api.getSpikeInfo({ // this.$u.api.getSpikeInfo({
groupbuy_id: this.item.groupbuy_id // groupbuy_id: this.item.groupbuy_id
}).then(res => { // }).then(res => {
if(res.errCode == 0) { // if(res.errCode == 0) {
const goods = { // const goods = {
goods: res.data.goodsInfo, // goods: res.data.goodsInfo,
type: 3, // 1 2 3 4 // type: 3, // 1 2 3 4
} // }
this.$store.commit('setGoodsDetails', goods); // this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo); // this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
this.$store.commit('setGoodsId', this.item.groupbuy_id); // this.$store.commit('setGoodsId', this.item.groupbuy_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
}) params: {
id: this.item.groupbuy_id,
type: 3,
} }
}) })
}, },
toDetailsPage() { toDetailsPage() {
this.$u.api.getPinTuanDetails({ // this.$u.api.getPinTuanDetails({
pintuan_id: this.item.pintuan_id // pintuan_id: this.item.pintuan_id
}).then(res => { // }).then(res => {
if(res.errCode == 0) { // if(res.errCode == 0) {
const goods = { // const goods = {
goods: res.data.data, // goods: res.data.data,
type: 2, // type: 2,
} // }
this.$store.commit('setGoodsDetails', goods); // this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.item.pintuan_id); // this.$store.commit('setGoodsId', this.item.pintuan_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
}) params: {
id: this.item.pintuan_id,
type: 2,
} }
}) })
} }

View File

@ -78,7 +78,7 @@ export default {
num = this.couponList.length num = this.couponList.length
? this.couponList.length > 4 ? 4 : this.couponList.length ? this.couponList.length > 4 ? 4 : this.couponList.length
: 1 : 1
this.swiperHeight = (97 + 10) * num - 10 + 'px'; this.swiperHeight = (97 + 10) * num + 'px';
}, },
toCouponPage() { toCouponPage() {
this.$u.route({ this.$u.route({
@ -93,8 +93,11 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.coupon-swiper { .coupon-swiper {
background-color: #ffffff;
margin-bottom: 40rpx;
.top { .top {
padding-top: 30rpx; padding: 0 30rpx;
height: 90rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
@ -109,11 +112,9 @@ export default {
} }
} }
.swiper-coupon-item { .swiper-coupon-item {
padding: 0 30rpx;
box-sizing: border-box; box-sizing: border-box;
background-color: #ffffff; background-color: #ffffff;
// padding: 30rpx {
// top: 0;
// };
.coupon-item { .coupon-item {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }

79
pageB/comment/index.vue Normal file
View File

@ -0,0 +1,79 @@
<template>
<view class="comment">
<view class="label-list">
<view v-for="(label, index) in 5" :key="index" :class="{'active': current == index}" @click="current=index">{{ '全部(' + label * 389 + '}' }}</view>
</view>
<view class="comment-container">
<view v-for="(item, index) in evalueList" :key="index" class="itme">
<comment :reply="true" :content="item"></comment>
</view>
<u-empty text="暂无评论" mode="list" v-if="!evalueList.length" margin-top="120" color="#333"></u-empty>
</view>
</view>
</template>
<script>
import comment from "@/components/comment/index";
export default {
data() {
return {
current: 0,
page: 0,
evalueList: [],
}
},
components: {
comment
},
onLoad(option) {
this.getAllEvalue(option.id);
},
methods: {
getAllEvalue(id) {
this.$u.api.getAllEvalue({
goods_id: id,
page: this.page
}).then(res => {
if(res.errCode == 0) {
this.evalueList = res.data;
} else {
this.evalueList = [];
}
})
}
}
};
</script>
<style lang="scss" scoped>
.comment {
height: calc(100vh - var(--window-top));
background-color: #EEEBEE;
padding-bottom: 30rpx;
.label-list {
padding: 30rpx;
background-color: #ffffff;
margin-bottom: 14rpx;
display: flex;
flex-wrap: wrap;
> view {
box-sizing: content-box;
padding: 16rpx 20rpx;
border-radius: 30rpx;
margin: 0 20rpx 20rpx 0;
background: rgba(236,236,236,1);
font-size: 26rpx;
color: rgba(153,153,153,1);
}
.active {
background: rgba(255,120,15,1);
color: #ffffff;
}
}
.comment-container {
.itme {
padding: 30rpx;
background-color: #ffffff;
margin-bottom: 10rpx;
}
}
}
</style>

View File

@ -50,7 +50,7 @@ export default {
name:"guige", name:"guige",
data(){ data(){
return { return {
select:0 select: 0
} }
}, },
props:['item','title'], props:['item','title'],

View File

@ -1,6 +1,7 @@
<template> <template>
<view> <view>
<view class="tloos"> <!-- 普通商品 tool -->
<view class="tloos" v-if="type == 1">
<view class="navs"> <view class="navs">
<image src="/static/image/common/18.png"></image> <image src="/static/image/common/18.png"></image>
店铺 店铺
@ -13,6 +14,28 @@
<view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view> <view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view>
<view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view> <view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view>
</view> </view>
<!-- 拼团 tool -->
<view class="group-tool" v-if="type==2">
<view class="launch" @click="settlementOrder">发起拼团</view>
<view class="involvement" @click="showGroupUser=true">参与拼团</view>
</view>
<!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3">
<view class="left">
<view>
<image src="/static/image/common/18.png"></image>
<text>店铺</text>
</view>
<view>
<image src="/static/image/common/19.png"></image>
<text>客服</text>
</view>
</view>
<view class="btn" v-if="groupbuyInfo.groupbuy_state == 20 && groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity" @click="spikeGoods">立即秒杀</view>
<view class="btn" :class="{'cannot': groupbuyInfo.groupbuy_state == 32 || groupbuyInfo.inventory == groupbuyInfo.groupbuy_buy_quantity}" v-else>
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
</view>
</view>
<u-popup v-model="show" mode="bottom"> <u-popup v-model="show" mode="bottom">
<scroll-view scroll-y="true" class="popup"> <scroll-view scroll-y="true" class="popup">
<view> <view>
@ -40,9 +63,9 @@
import guige from "./guige" import guige from "./guige"
export default { export default {
name:"tloos", name:"tloos",
props: ['id', 'info'], props: ['id', 'info', 'type'],
components:{ components:{
guige guige,
}, },
data(){ data(){
return { return {
@ -107,6 +130,69 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.group-tool {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 98rpx;
display: flex;
font-size: 32rpx;
color: rgba(255,255,255,1);
z-index: 99;
.launch {
flex: 1;
background: rgba(253,211,96,1);
line-height: 98rpx;
text-align: center;
}
.involvement {
flex: 1;
background: rgba(255,120,15,1);
line-height: 98rpx;
text-align: center;
}
}
.spike-tool {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 98rpx;
display: flex;
z-index: 99;
.left {
width: 190rpx;
display: flex;
align-items: center;
justify-content: space-around;
> view {
text-align: center;
> image {
width: 35rpx;
height: 35rpx;
margin-bottom: 15rpx;
}
> text {
display: block;
font-size: 24rpx;
color: rgba(102,102,102,1);
}
}
}
.btn {
flex: 1;
height: 98rpx;
line-height: 98rpx;
text-align: center;
font-size: 32rpx;
color: rgba(255,255,255,1);
background: rgba(255,120,15,1);
}
.cannot {
background: rgba(221,221,221,1);
}
}
.tloos{ .tloos{
background-color: #fff; background-color: #fff;
display: flex; display: flex;
@ -143,7 +229,7 @@ export default {
} }
} }
.popup{ .popup{
padding: 30rpx; padding: 30rpx;
box-sizing: border-box; box-sizing: border-box;
max-height: 750rpx; max-height: 750rpx;
@ -184,5 +270,5 @@ export default {
color: #666; color: #666;
} }
} }
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="sdetails"> <view class="sdetails">
<u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper> <u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper>
<view class="spike-view" v-if="type==3"> <view class="spike-view" v-if="type == 3">
<view class="left"> <view class="left">
<view class="price"> <view class="price">
<view class="now-price">{{ groupbuyInfo.groupbuy_price }}</view> <view class="now-price">{{ groupbuyInfo.groupbuy_price }}</view>
@ -25,10 +25,20 @@
</view> </view>
<view class="hr"></view> <view class="hr"></view>
<!-- <navs :value="领券"></navs> --> <!-- <navs :value="领券"></navs> -->
<navs :value="'产品规格'"></navs> <navs :value="'产品规格'" @click.native="showSpec=true"></navs>
<!-- <navs :value="'产品颜色'"></navs> --> <!-- <navs :value="'产品颜色'"></navs> -->
<!-- <navs :value="'选择尺码'"></navs> --> <!-- <navs :value="'选择尺码'"></navs> -->
<!-- <navs v-for="(value, index) in goodsInfo.spec_name" :value="value" :key="index"></navs> --> <view class="comment">
<view class="title">
<view class="left">商品评价{{ evaluate.evaluate_num }}</view>
<view class="right" @click="viewComment">
<text>查看全部</text>
<image src="/static/image/common/1.png"></image>
</view>
</view>
<comment :reply="false" :content="evaluate" v-if="evaluate.evaluate_num"></comment>
<view class="comment-none">暂无评价</view>
</view>
<view class="hr"></view> <view class="hr"></view>
<view class="group-user" v-if="groupUser.length"> <view class="group-user" v-if="groupUser.length">
<view class="top"> <view class="top">
@ -96,13 +106,48 @@
</view> </view>
<view class="rich"> <view class="rich">
<rich-text :nodes="goodsInfo.mobile_body"></rich-text> <rich-text :nodes="goodsInfo.mobile_body"></rich-text>
</view>
<!-- 选择规格数量 -->
<u-popup v-model="showSpec" mode="bottom">
<scroll-view scroll-y="true" class="spec-popup">
<view>
<view class="head">
<image class="image" :src="goodsInfo.goods_image"></image>
<view class="info">
<text class="u-line-2">{{goodsInfo.goods_name}}</text>
<text>{{goodsInfo.goods_price}}</text>
</view>
</view>
<guige @sel="self" ref="guige" v-for="(item,index) in goodsInfo.spec_value" :key="index" :title="goodsInfo.spec_name[index]" :item="item"></guige>
<view class="num">
<text>购买数量</text>
<u-number-box v-model="goodsNumber" @change="valChange"></u-number-box>
</view>
<view style="height:100rpx"></view>
</view>
<u-toast ref="uToast" />
</scroll-view>
</u-popup>
<!-- 普通商品 tool -->
<view class="tloos" v-if="type == 1">
<view class="navs">
<image src="/static/image/common/18.png"></image>
店铺
</view>
<view class="navs" style="margin-right:30rpx">
<image src="/static/image/common/19.png"></image>
客服
</view>
<view class="button" style="background:rgba(253,211,96,0.6);" v-if="goodsInfo.goods_try == 1">试穿试送</view>
<view class="button" style="background:rgba(253,211,96,1);" @click="addCart">加入购物车</view>
<view class="button" style="background:rgba(255,120,15,1);" @click="settlementOrder">立即购买</view>
</view> </view>
<!-- 拼团 tool --> <!-- 拼团 tool -->
<view class="group-tool" v-if="type==2"> <view class="group-tool" v-if="type==2">
<view class="launch" @click="settlementOrder">发起拼团</view> <view class="launch" @click="settlementOrder">发起拼团</view>
<view class="involvement" @click="showGroupUser=true">参与拼团</view> <view class="involvement" @click="showGroupUser=true">参与拼团</view>
</view> </view>
<!-- 秒杀 --> <!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3"> <view class="spike-tool" v-if="type==3">
<view class="left"> <view class="left">
<view> <view>
@ -119,97 +164,111 @@
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }} {{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
</view> </view>
</view> </view>
<!-- 普通商品 tool --> <!-- <tloos @buy="buy" @xuanze="xuanze" :id="id" :info="goodsInfo" :type="type"></tloos> -->
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="goodsInfo" v-if="type==1"></tloos>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
/* import comment from "@/components/comment/index";
* 详情是请求完存在store的在这里从store取值 import navs from "../components/sdetails/navs";
**/ import guige from "../components/sdetails/guige"
import navs from "../components/sdetails/navs" import tloos from "../components/sdetails/tloos";
import tloos from "../components/sdetails/tloos"
export default { export default {
name:"sdetails", name: "sdetails",
data() { data() {
return { return {
list: [], // list: [], //
goodsInfo: {}, goodsInfo: {}, //
info:{}, glist: [], //
glist:[], id: 0, // id/id/ id
id:0, // id
type: '', // 1 2 3 4 type: '', // 1 2 3 4
groupUser: [], // groupUser: [], //
user_suc: [], // user_suc: [], //
avatarWidth: '',
pintuan_id: '', // id
showGroupUser: false, // showGroupUser: false, //
showInvolvementUser: false, // showInvolvementUser: false, //
involvemenGroupInfo: [], // involvemenGroupInfo: [], //
groupbuyInfo: {}, // groupbuyInfo: {}, //
spikeTime: '', spikeTime: '',
timer: '', // timer: '', //
spec_id: '', // id,
evaluate: {}, //
showSpec: false, //
goodsNumber: 1,
sel: "", //
quanxuan: false, //
} }
}, },
components:{ components: {
comment,
navs, navs,
tloos tloos,
guige,
},
watch: {
sel(value){
this.xuanze(value);
},
}, },
onShow() { onShow() {
// if(this.pintuan_id) { this.showSpec = false;
// this.$u.api.getPinTuanDetails({ this.showGroupUser = false;
// pintuan_id: this.pintuan_id this.showInvolvementUser = false;
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.data,
// type: 2,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.pintuan_id);
// }
// })
// }
}, },
onLoad() { onLoad(option) {
this.init(); // this.init();
// console.log(option);
this.type = Number(option.type);
this.id = option.id;
this.getGoodsDetails(this.id);
this.setTitle();
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer); clearInterval(this.timer);
}, },
methods: { methods: {
init() { // init() {
this.id = this.$store.state.goods_id; // this.id = this.$store.state.goods_id;
this.type = this.$store.getters.getGoodsType; // this.type = this.$store.getters.getGoodsType;
const info = this.$store.getters.getGoodsInfo; // const info = this.$store.getters.getGoodsInfo;
if(this.type == 2) { // //
this.user_suc = info.user_suc; // if(this.type == 2) {
this.groupUser = info.user; // this.user_suc = info.user_suc;
this.pintuan_id = info.pintuan_id; // this.groupUser = info.user;
} // this.pintuan_id = info.pintuan_id;
if (this.type == 3) { // }
this.groupbuyInfo = this.$store.state.groupbuyInfo; // //
this.setSpikeTime(); // if (this.type == 3) {
} // this.groupbuyInfo = this.$store.state.groupbuyInfo;
// console.log(this.groupbuyInfo); // this.setSpikeTime();
this.goodsInfo = info.goods; // }
// // // console.log(this.groupbuyInfo);
let list = []; // this.goodsInfo = info.goods;
info.goods_image[0].forEach(item => { // //
// let list = [];
// info.goods_image[0].forEach(item => {
// let temp = {
// image: item
// }
// list.push(temp);
// })
// this.list = list;
// this.setTitle();
// },
setSwiperList(list) {
let img = [];
list.forEach(item => {
let temp = { let temp = {
image: item image: item
} }
list.push(temp); img.push(temp);
}) })
this.list = list; this.list = img;
this.setTitle();
}, },
spikeGoods() { spikeGoods() {
this.settlementOrder() this.settlementOrder()
}, },
setSpikeTime() { setSpikeTime(time) {
const time = this.groupbuyInfo.groupbuy_endtime; // const time = this.groupbuyInfo.groupbuy_endtime;
this.timer = setInterval(() => { this.timer = setInterval(() => {
let spikeTime = time * 1000 - new Date().getTime(); let spikeTime = time * 1000 - new Date().getTime();
// //
@ -229,61 +288,102 @@ export default {
// console.log(this.spikeTime); // console.log(this.spikeTime);
}, 1000) }, 1000)
}, },
buy(info){ addCart() {
if(info.type == 2){ //
this.$u.api.addCart({ this.$u.api.addCart({
goods_id: this.id, goods_id: this.id,
quantity: info.value, quantity: this.goodsNumber,
}).then(res => { }).then(res => {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: res.message, title: res.message,
type: res.errCode == 0 ? 'success' : 'warning', type: res.errCode == 0 ? 'success' : 'warning',
}) })
}) })
} else if (info.type == 1) { // },
this.settlementOrder({num: info.value}); purchase() {
} this.settlementOrder();
}, },
getGoodsDetails(id) { getGoodsDetails(id) {
this.id = id; switch (this.type) {
case 1:
this.ordinaryDetails(id);
break;
case 2:
this.pinTuanDetails(id);
break;
case 3:
this.spikeGoodsDetails(id);
break;
case 4:
break;
default:
break;
}
},
//
ordinaryDetails(id) {
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{ this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
if (res.errCode == 0) { if (res.errCode == 0) {
this.evaluate = res.data.goods_evaluate_info;
this.goodsInfo = res.data.goods; this.goodsInfo = res.data.goods;
let list = []; this.setSwiperList(res.data.goods_image[0]);
res.data.goods_image[0].forEach(item => {
let temp = {
image: item
}
list.push(temp);
})
this.list = list;
this.info = res.data.goods;
this.glist = res.data.spec_list; this.glist = res.data.spec_list;
// console.log(this.goodsInfo.mobile_body); // console.log(this.goodsInfo.mobile_body);
} }
}) })
}, },
// //
pinTuanDetails(id) {
this.$u.api.getPinTuanDetails({
pintuan_id: id
}).then(res => {
if(res.errCode == 0) {
this.evaluate = res.data.data.goods_evaluate_info;
this.goodsInfo = res.data.data.goods;
this.setSwiperList(res.data.data.goods_image[0]);
this.glist = res.data.data.spec_list;
this.user_suc = res.data.data.user_suc;
this.groupUser =res.data.data.user;
}
})
},
//
spikeGoodsDetails(id) {
this.$u.api.getSpikeInfo({
groupbuy_id: id
}).then(res => {
if(res.errCode == 0) {
this.groupbuyInfo = res.data.groupbuyInfo;
this.evaluate = res.data.goodsInfo.goods_evaluate_info;
this.goodsInfo = res.data.goodsInfo.goods;
this.setSwiperList(res.data.goodsInfo.goods_image[0]);
this.setSpikeTime(res.data.groupbuyInfo.groupbuy_endtime);
}
})
},
/* /*
* @description 下单 订单步骤1展示结算数据
* @params {Number} type 拼团或者开团 * @params {Number} type 拼团或者开团
* @params {Number} num 数量
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算立即购买/拼团/秒杀
**/ **/
settlementOrder({type, num = 1} = {}) { settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
// ifcart 1: 0://
let params = { let params = {
ifcart: 0, ifcart: ifcart,
cart_id: [this.goodsInfo.goods_id + '|' + num], cart_id: [this.goodsInfo.goods_id + '|' + num],
} }
if(this.type == 2) { if(this.type == 2) {
if(type == 'involvement') { if(type == 'involvement') {
Object.assign(params, { Object.assign(params, {
pintuan_id: this.pintuan_id, pintuan_id: this.id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id
}) })
} else { } else {
const userId = uni.getStorageSync('user_info').member.member_id; const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', userId); this.$store.commit('setGroupHeadId', userId);
Object.assign(params, { Object.assign(params, {
pintuan_id: this.pintuan_id, pintuan_id: this.id,
}) })
} }
} }
@ -297,16 +397,42 @@ export default {
} }
}) })
}, },
//
involvemenGroup(user) { involvemenGroup(user) {
this.involvemenGroupInfo = user; this.involvemenGroupInfo = user;
this.showGroupUser = false; this.showGroupUser = false;
this.showInvolvementUser = true; this.showInvolvementUser = true;
// console.log(this.involvemenGroupInfo); // console.log(this.involvemenGroupInfo);
}, },
xuanze(id){ valChange(e) {
console.log(id) // console.log(this.value)
// this.getGoodsDetails(this.glist[id])
}, },
self(){
// console.log(this.$refs.guige)
let index = 0;
let arr = [];
for(let i in this.goodsInfo.spec_value){
// console.log(i)
// console.log(this.$refs.guige[index++].select)
// index++;
let sel = this.$refs.guige[index++].select
if(sel != 0){
arr.push(sel)
}
}
// console.log(arr.length)
if(arr.length == index){
this.sel = arr.join("|")
this.quanxuan = true
// console.log(this.sel)
}
},
xuanze(id){
// console.log(id)
this.getGoodsDetails(this.glist[id])
this.id = this.glist[id];
},
//
setTitle() { setTitle() {
let title = ''; let title = '';
switch (this.type) { switch (this.type) {
@ -329,6 +455,14 @@ export default {
title: title title: title
}); });
}, },
viewComment() {
this.$u.route({
url: 'pageB/comment/index',
params: {
id: this.goodsInfo.goods_id
}
})
}
}, },
} }
</script> </script>
@ -336,6 +470,7 @@ export default {
.sdetails { .sdetails {
padding-bottom: 98rpx; padding-bottom: 98rpx;
position: relative; position: relative;
background-color: #EEEBEE;
.spike-view { .spike-view {
position: absolute; position: absolute;
top: 396rpx; top: 396rpx;
@ -397,7 +532,9 @@ export default {
} }
} }
.info { .info {
background:rgba(255,255,255,1);
padding: 30rpx; padding: 30rpx;
margin-bottom: 20rpx;
.title{ .title{
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 30rpx; margin-bottom: 30rpx;
@ -424,12 +561,42 @@ export default {
} }
} }
} }
.comment {
margin-top: 20rpx;
background:rgba(255,255,255,1);
padding: 30rpx;
.title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
.left {
font-size: 30rpx;
color: rgba(51,51,51,1);
}
.right {
font-size: 24rpx;
color: rgba(153,153,153,1);
> image {
width: 8rpx;
height: 16rpx;
margin-left: 10rpx;
}
}
}
.comment-none {
font-size: 26rpx;
text-align: center;
margin-top: 30rpx;
}
}
.hr { .hr {
width: 100%; width: 100%;
height: 20rpx; height: 20rpx;
background-color: #ececec; background-color: #ececec;
} }
.group-user { .group-user {
background: rgba(255,255,255,1);
padding: 30rpx; padding: 30rpx;
.top { .top {
margin-bottom: 28rpx; margin-bottom: 28rpx;
@ -739,5 +906,82 @@ export default {
background: rgba(221,221,221,1); background: rgba(221,221,221,1);
} }
} }
.tloos{
background-color: #fff;
display: flex;
position: fixed;
height: 98rpx;
width: 100%;
bottom:0;
border-top: 1rpx solid #ececec;
z-index: 1000000;
.navs{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #666;
flex-shrink: 0;
margin-left: 30rpx;
>image{
width: 35rpx;
height: 35rpx;
margin-bottom: 15rpx;
}
}
.button{
width: 100%;
height: 100%;
line-height: 98rpx;
text-align: center;
color: #fff;
}
}
.spec-popup {
padding: 30rpx;
box-sizing: border-box;
max-height: 750rpx;
.head{
display: flex;
margin-bottom: 30rpx;
.image{
width: 195rpx;
height: 195rpx;
border-radius: 10rpx;
flex-shrink: 0;
}
.info{
display: flex;
padding: 21rpx 0;
justify-content: space-between;
margin-left: 27rpx;
flex-direction: column;
>text:first-child{
font-size: 28rpx;
color: #333;
}
>text:last-child{
font-size: 30rpx;
color: #ff3131;
}
}
}
.num{
height: 84rpx;
display: flex;
border-bottom: #ececec solid 2rpx;
justify-content: space-between;
align-items: center;
>text{
font-size: 26rpx;
color: #666;
}
}
}
} }
</style> </style>

723
pageB/sdetails/index1.vue Normal file
View File

@ -0,0 +1,723 @@
<template>
<view class="sdetails">
<u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper>
<view class="spike-view" v-if="type == 3">
<view class="left">
<view class="price">
<view class="now-price">{{ groupbuyInfo.groupbuy_price }}</view>
<view class="origin-price">{{ groupbuyInfo.goods_price }}</view>
</view>
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}</view>
</view>
<view class="right">
<view class="title">秒杀倒计时</view>
<view class="time">{{ spikeTime }}</view>
</view>
</view>
<view class="info">
<view class="title u-line-2">
<text>{{ goodsInfo.store_name }}</text>{{ goodsInfo.goods_name }}
</view>
<view class="pic">
<text>{{ goodsInfo.goods_price }}</text>
<s>{{ goodsInfo.goods_marketprice }}</s>
</view>
</view>
<view class="hr"></view>
<!-- <navs :value="领券"></navs> -->
<navs :value="'产品规格'"></navs>
<!-- <navs :value="'产品颜色'"></navs> -->
<!-- <navs :value="'选择尺码'"></navs> -->
<!-- <navs v-for="(value, index) in goodsInfo.spec_name" :value="value" :key="index"></navs> -->
<view class="comment">
<view class="title">
<view class="left">商品评价1234</view>
<view class="right" @click="viewComment">
<text>查看全部</text>
<image src="/static/image/common/1.png"></image>
</view>
</view>
<comment :reply="false"></comment>
</view>
<view class="hr"></view>
<view class="group-user" v-if="groupUser.length">
<view class="top">
<view class="title">{{ groupUser.length }}人正在拼团可直接参与</view>
<view class="view-more" @click="showGroupUser=true">
<text>查看全部</text>
<image src="/static/image/common/1.png"></image>
</view>
</view>
<view class="bottom">
<view class="left" @click="showGroupUser=true">
<view class="avatar">
<image v-for="(user, i) in user_suc" :src="user[0].member_avatar" :key="i"></image>
</view>
<view class="all" @click="showGroupUser=true">
<text>查看全部</text>
<image src="/static/image/common/1.png"></image>
</view>
</view>
<view class="right">
<view class="launch-user" @click="showGroupUser=true">
<image :src="groupUser[0][0].member_avatar"></image>
<text class="u-line-1">{{ groupUser[0][0].member_nickname }}</text>
</view>
<view class="involvement-user">
<view class="item" v-for="(user, i) in groupUser.slice(1, 5)" :key="i" @click="showGroupUser=true">
<image :src="user[0].member_avatar"></image>
<text class="u-line-1">{{ user[0].member_nickname }}</text>
</view>
</view>
</view>
</view>
</view>
<u-popup v-model="showGroupUser" mode="center">
<view class="launch-container">
<view class="title u-line-1">正在拼团</view>
<scroll-view class="launch-view">
<view class="launch-user">
<view class="item" v-for="(user, i) in groupUser" :src="user[0].member_avatar" :key="i" @click="involvemenGroup(user)">
<image class="avatar" :src="user[0].member_avatar"></image>
<view class="name u-line-1">{{ user[0].member_nickname }}</view>
</view>
</view>
</scroll-view>
<image class="close" src="/static/image/common/17.png" @click="showGroupUser=false"></image>
</view>
</u-popup>
<u-popup v-model="showInvolvementUser" mode="center">
<view class="involvement-container" v-if="involvemenGroupInfo.length">
<view class="title u-line-1">参与{{ involvemenGroupInfo[0].member_nickname }}的拼团</view>
<view class="involvement-view">
<view class="item" v-for="(user, i) in involvemenGroupInfo" :key="i">
<image class="avatar" :src="user.member_avatar"></image>
<view class="name u-line-1">{{ user.member_nickname }}</view>
</view>
</view>
<view class="involvement-btn" @click="settlementOrder({ type: 'involvement' })">参与拼团</view>
<image class="close" src="/static/image/common/17.png" @click="showInvolvementUser=false"></image>
</view>
</u-popup>
<view class="xiangqing">
<view class="heng"></view>
<view class="title">商品详情</view>
<view class="heng"></view>
</view>
<view class="rich">
<rich-text :nodes="goodsInfo.mobile_body"></rich-text>
</view>
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="goodsInfo" :type="type" v-if="type"></tloos>
<u-toast ref="uToast" />
</view>
</template>
<script>
/*
* 详情是请求完存在 store 在这里从 store 取值
**/
import comment from "@/components/comment/index";
import navs from "../components/sdetails/navs";
import tloos from "../components/sdetails/tloos";
export default {
name: "sdetails",
data() {
return {
list: [], //
goodsInfo: {},
info: {},
glist: [],
id: 0, // id
type: '', // 1 2 3 4
groupUser: [], //
user_suc: [], //
avatarWidth: '',
pintuan_id: '', // id
showGroupUser: false, //
showInvolvementUser: false, //
involvemenGroupInfo: [], //
groupbuyInfo: {}, //
spikeTime: '',
timer: '', //
}
},
components: {
comment,
navs,
tloos,
},
onLoad() {
this.init();
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
init() {
this.id = this.$store.state.goods_id;
this.type = this.$store.getters.getGoodsType;
const info = this.$store.getters.getGoodsInfo;
//
if(this.type == 2) {
this.user_suc = info.user_suc;
this.groupUser = info.user;
this.pintuan_id = info.pintuan_id;
}
//
if (this.type == 3) {
this.groupbuyInfo = this.$store.state.groupbuyInfo;
this.setSpikeTime();
}
// console.log(this.groupbuyInfo);
this.goodsInfo = info.goods;
//
let list = [];
info.goods_image[0].forEach(item => {
let temp = {
image: item
}
list.push(temp);
})
this.list = list;
this.setTitle();
},
spikeGoods() {
this.settlementOrder()
},
setSpikeTime() {
const time = this.groupbuyInfo.groupbuy_endtime;
this.timer = setInterval(() => {
let spikeTime = time * 1000 - new Date().getTime();
//
const days = Math.floor(spikeTime/(24*3600*1000));
//
const leave1 = spikeTime % (24*3600*1000) //
let hours = Math.floor(leave1/(3600*1000));
//
const leave2 = leave1 % (3600*1000) //
const minutes = Math.floor(leave2 / (60*1000))
//
const leave3 = leave2 % (60*1000) //
const seconds = Math.round(leave3 / 1000)
//
hours = days * 24 + hours;
this.spikeTime = hours + ':' + minutes + ':' + seconds;
// console.log(this.spikeTime);
}, 1000)
},
buy(info) {
if(info.type == 2){ //
this.$u.api.addCart({
goods_id: this.id,
quantity: info.value,
}).then(res => {
this.$refs.uToast.show({
title: res.message,
type: res.errCode == 0 ? 'success' : 'warning',
})
})
} else if (info.type == 1) { //
this.settlementOrder({num: info.value});
}
},
getGoodsDetails() {
switch (this.type) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
default:
break;
}
},
getGoodsDetails(id) {
this.id = id;
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
if (res.errCode == 0) {
this.goodsInfo = res.data.goods;
let list = [];
res.data.goods_image[0].forEach(item => {
let temp = {
image: item
}
list.push(temp);
})
this.list = list;
this.info = res.data.goods;
this.glist = res.data.spec_list;
// console.log(this.goodsInfo.mobile_body);
}
})
this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
if (res.errCode == 0) {
const goods = {
goods: res.data,
type: 1,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.info.goods_id);
this.$u.route({
url: 'pageB/sdetails/index',
})
// console.log(this.goodsInfo.mobile_body);
}
})
},
/*
* @description 下单 订单步骤1展示结算数据
* @params {Number} type 拼团或者开团
* @params {Number} num 数量
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算立即购买/拼团/秒杀
**/
settlementOrder({type, num = 1, ifcart = 0} = {}) {
let params = {
ifcart: ifcart,
cart_id: [this.goodsInfo.goods_id + '|' + num],
}
if(this.type == 2) {
if(type == 'involvement') {
Object.assign(params, {
pintuan_id: this.pintuan_id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id
})
} else {
const userId = uni.getStorageSync('user_info').member.member_id;
this.$store.commit('setGroupHeadId', userId);
Object.assign(params, {
pintuan_id: this.pintuan_id,
})
}
}
this.$u.api.settlementOrder(params).then(res => {
if(res.errCode == 0) {
this.$store.commit('setOrderType', this.type);
this.$store.commit('updateOrderInfo', res.data)
this.$u.route({
url: '/pageC/cart/ConfirmOrder'
})
}
})
},
//
involvemenGroup(user) {
this.involvemenGroupInfo = user;
this.showGroupUser = false;
this.showInvolvementUser = true;
// console.log(this.involvemenGroupInfo);
},
xuanze(id){
console.log(id)
// this.getGoodsDetails(this.glist[id])
},
//
setTitle() {
let title = '';
switch (this.type) {
case 1:
title = '商品详情';
break;
case 2:
title = '拼团商品详情';
break;
case 3:
title = '秒杀商品详情';
break;
case 1:
break;
default:
break;
}
uni.setNavigationBarTitle({
title: title
});
},
viewComment() {
this.$u.route({
url: 'pageB/comment/index',
})
}
},
}
</script>
<style lang="scss" scoped>
.sdetails {
padding-bottom: 98rpx;
position: relative;
background-color: #EEEBEE;
.spike-view {
position: absolute;
top: 396rpx;
left: 0;
width: 100%;
height: 104rpx;
background: rgba(255,120,15,1);
opacity: 0.96;
color:rgba(255,255,255,1);
display: flex;
align-items: center;
.left {
height: 104rpx;
flex: 1;
padding-left: 30rpx;
display: flex;
flex-direction: column;
justify-content: center;
.price {
margin-bottom: 22rpx;
display: flex;
align-items: center;
.now-price {
font-size: 32rpx;
font-weight: bold;
margin-right: 16rpx;
}
.origin-price {
font-size: 26rpx;
text-decoration: line-through;
}
}
.num {
font-size: 22rpx;
font-weight: 500;
}
}
.right {
height: 104rpx;
width: 232rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&::before {
position: absolute;
left: 0;
content: "";
width: 2rpx;
height: 104rpx;
background:rgba(255,255,255,1);
}
font-size: 26rpx;
font-weight: 500;
.title {
margin-bottom: 18rpx;
}
}
}
.info {
background:rgba(255,255,255,1);
padding: 30rpx;
margin-bottom: 20rpx;
.title{
flex-wrap: wrap;
margin-bottom: 30rpx;
>text{
padding: 13rpx;
font-size: 24rpx;
color:#fff;
margin-right: 13rpx;
background-color: #FF780F;
display: inline-block;
border-radius: 25rpx;
}
}
.pic{
>text{
font-size: 32rpx;
color: #FF3131;
}
>s{
font-size: 26rpx;
color: #999;
display: inline-block;
margin-left: 30rpx;
}
}
}
.comment {
margin-top: 20rpx;
background:rgba(255,255,255,1);
padding: 30rpx;
.title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
.left {
font-size: 30rpx;
color: rgba(51,51,51,1);
}
.right {
font-size: 24rpx;
color: rgba(153,153,153,1);
> image {
width: 8rpx;
height: 16rpx;
margin-left: 10rpx;
}
}
}
}
.hr {
width: 100%;
height: 20rpx;
background-color: #ececec;
}
.group-user {
padding: 30rpx;
.top {
margin-bottom: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 30rpx;
color: rgba(51,51,51,1);
}
.view-more {
font-size: 24rpx;
color: rgba(153,153,153,1);
> image {
margin-left: 10rpx;
width: 8rpx;
height: 16rpx;
}
}
}
.bottom {
display: flex;
align-items: center;
font-size: 22rpx;
color: rgba(153,153,153,1);
.left {
margin-right: 40rpx;
.avatar {
width: 120rpx;
height: 60rpx;
margin-bottom: 16rpx;
position: relative;
@mixin avatar($left, $index) {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
position: absolute;
top: 0;
left: $left;
z-index: $index;
}
> image {
&:first-child {
background-color: aliceblue;
@include avatar($left: 0rpx, $index: 7);
}
&:nth-child(2) {
background-color: aquamarine;
@include avatar($left: 30rpx, $index: 8);
}
&:nth-child(3) {
background-color: antiquewhite;
@include avatar($left: 60rpx, $index: 9);
}
}
}
.all {
> image {
margin-left: 10rpx;
width: 8rpx;
height: 16rpx;
}
}
}
.right {
display: flex;
image {
background-color: aquamarine;
width: 60rpx;
height: 60rpx;
margin-bottom: 15rpx;
border-radius: 50%;
}
.launch-user {
margin-right: 40rpx;
text-align: center;
> text {
width: 98rpx;
display: block;
}
}
.involvement-user {
display: flex;
align-items: center;
.item {
text-align: center;
> text {
display: block;
width: 72rpx;
}
&:not(:last-child) {
margin-right: 30rpx;
}
}
}
}
}
}
.launch-container {
width: 558rpx;
height: 655rpx;
background: rgba(255,255,255,1);
border-radius: 20rpx;
position: relative;
overflow: hidden;
.title {
text-align: center;
padding: 40rpx 0;
font-size: 32rpx;
color: rgba(51,51,51,1);
position: relative;
&::after {
content: '';
position: absolute;
width: 558rpx;
height: 2rpx;
background: rgba(234,234,234,1);
bottom: 0;
left: 0;
}
}
.launch-view {
height: 500rpx;
box-sizing: border-box;
padding: 30rpx 50rpx;
.launch-user {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
justify-content: flex-start;
.item {
width: 96rpx;
height: 96rpx;
text-align: center;
margin-bottom: 30rpx;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-bottom: 15rpx;
}
.name {
font-size: 22rpx;
color: rgba(153,153,153,1);
}
&:not(:nth-child(3n)) {
margin-right: 80rpx;
}
}
}
}
.close {
position: absolute;
width: 47rpx;
height: 47rpx;
top: 10rpx;
right: 20rpx;
border-radius: 50%;
}
}
.involvement-container {
width: 558rpx;
height: 486rpx;
background: rgba(255,255,255,1);
border-radius: 20rpx;
position: relative;
overflow: hidden;
.title {
text-align: center;
padding: 40rpx 0;
font-size: 32rpx;
color: rgba(51,51,51,1);
position: relative;
&::after {
content: '';
position: absolute;
width: 558rpx;
height: 2rpx;
background: rgba(234,234,234,1);
bottom: 0;
left: 0;
}
}
.involvement-view {
display: flex;
justify-content: center;
margin: 40rpx 0 70rpx;
.item {
width: 100rpx;
text-align: center;
margin-right: 10rpx;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-bottom: 15rpx;
}
.name {
font-size: 22rpx;
color: rgba(153,153,153,1);
}
}
}
.involvement-btn {
width: 400rpx;
height: 88rpx;
background: rgba(255,120,15,1);
border-radius: 44rpx;
font-size: 30rpx;
color:rgba(255,255,255,1);
text-align: center;
line-height: 88rpx;
margin: 0 auto;
}
.close {
position: absolute;
width: 47rpx;
height: 47rpx;
top: 10rpx;
right: 20rpx;
border-radius: 50%;
}
}
.xiangqing{
display: flex;
height: 85rpx;
background-color: #ececec;
align-items: center;
justify-content: center;
.heng{
width: 79rpx;
height: 2rpx;
background-color: #a9a9a9;
}
font-size: 28rpx;
color: #999;
.title{
margin: 0 20rpx;
}
}
.rich {
width: 100%;
}
}
</style>

View File

@ -205,9 +205,14 @@ export default {
}) })
}, },
intermediate() { intermediate() {
if(this.orderType == 2) this.withImmediate(); if(this.orderType == 2) {
this.withImmediate();
} else if(this.orderType == 1) {
this.sendOrder(0);
}
else this.sendOrder(1); else this.sendOrder(1);
}, },
// @params {Number} ifcart
sendOrder(ifcart) { sendOrder(ifcart) {
// //
let id = [], temp = ''; let id = [], temp = '';
@ -241,11 +246,11 @@ export default {
cart_id: id, cart_id: id,
address_id: this.addressInfo.address_id, address_id: this.addressInfo.address_id,
buy_city_id: this.addressInfo.city_id, buy_city_id: this.addressInfo.city_id,
voucher_id: coupon,
} }
if(coupon.length) Object.assign(params, { voucher_id: coupon });
if(this.orderType == 2) { if(this.orderType == 2) {
Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id }) Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id });
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id }) if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
} }
// console.log(params); // console.log(params);
this.$u.api.sendOrder(params).then(res => { this.$u.api.sendOrder(params).then(res => {

View File

@ -54,24 +54,10 @@ export default {
// getProvider() { // getProvider() {
// uni.getProvider({service: 'payment'}) // uni.getProvider({service: 'payment'})
// }, // },
// payOrder(provider, orderInfo) {
payByAlipay (orderInfo) {
uni.requestPayment({ uni.requestPayment({
provider: 'alipay', provider: provider,
orderInfo: orderInfo, // orderInfo: orderInfo, //
success: function (res) {
console.log('success:' + JSON.stringify(res));
},
fail: function (err) {
console.log('fail:' + JSON.stringify(err));
}
});
},
//
payByWxpay (orderInfo) {
uni.requestPayment({
provider: 'wxpay',
orderInfo: orderInfo, //
success: function (res) { success: function (res) {
console.log('success:' + JSON.stringify(res)); console.log('success:' + JSON.stringify(res));
}, },
@ -86,11 +72,15 @@ export default {
payment_code: this.pay_way, payment_code: this.pay_way,
}).then(res => { }).then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
// this.$u.toast(res.message); let orderInfo, provider;
// uni.navigateBack(); if(res.data.payment_code == 'wxpay_app') {
const orderInfo = JSON.parse(res.data.content); provider = 'wxpay';
console.log(orderInfo); orderInfo = JSON.parse(res.data.content);
this.pay_way == 'wxpay_app' ? this.payByWxpay(orderInfo) : this.payByAlipay(orderInfo); } else if(res.data.payment_code == 'alipay_app') {
provider = 'alipay';
orderInfo = res.data.content;
}
this.payOrder(provider, orderInfo);
} }
}) })
} }

View File

@ -56,16 +56,16 @@ export default {
}, },
addOrderEvaluate() { addOrderEvaluate() {
if(!this.verifyParams()) return false; if(!this.verifyParams()) return false;
console.log(this.logistics); // console.log(this.logistics);
console.log(this.service); // console.log(this.service);
console.log(this.describe); // console.log(this.describe);
this.$u.api.updateOrderEvaluate({ this.$u.api.updateOrderEvaluate({
id: this.orderId, id: this.orderId,
content: this.content, content: this.content,
scores_one: this.logistics, scores_one: this.logistics,
scores_two: this.service, scores_two: this.service,
scores_three: this.describe, scores_three: this.describe,
file: '', file: '', //
}).then(res => { }).then(res => {
}) })

View File

@ -113,6 +113,17 @@
} }
} }
}, },
{
"path": "comment/index",
"style": {
"navigationBarTitleText": "商品评价",
"app-plus":{
"titleNView":{
"backgroundColor":"#ffffff"
}
}
}
},
{ {
"path": "search/index", "path": "search/index",
"style": { "style": {

View File

@ -11,7 +11,9 @@
</view> </view>
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image> <image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
</view> </view>
<view class="swiper-image">
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper> <u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
</view>
<view class="chengnuo"> <view class="chengnuo">
<view> <view>
<image src="/static/image/shop/4.png"></image> <image src="/static/image/shop/4.png"></image>
@ -33,21 +35,16 @@
<view class="fenlei"> <view class="fenlei">
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem> <shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
</view> </view>
<view class="hr" style="margin-top:80rpx"></view>
<!-- 秒杀 --> <!-- 秒杀 -->
<recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend> <recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend>
<view v-if="JSON.stringify(recommendedSpike) != '{}'" class="hr" style="margin-top:40rpx"></view>
<!-- 秒杀列表 --> <!-- 秒杀列表 -->
<seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill> <seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill>
<view v-if="spikeList.length" class="hr" style="margin-top:40rpx"></view>
<!-- 拼团推荐 --> <!-- 拼团推荐 -->
<pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan> <pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan>
<view class="hr" style="margin-top:40rpx" v-if="JSON.stringify(pinTuanPush) != '{}'"></view>
<!-- 拼团列表 --> <!-- 拼团列表 -->
<group :groupList="pinTuanList" :classifyList="couponGroupList"></group> <group :classifyList="couponGroupList"></group>
<image class="lingquan"></image> <image class="lingquan"></image>
<youhq></youhq> <youhq></youhq>
<view class="hr" style="margin-top:40rpx"></view>
<list ref="recommendGoods"></list> <list ref="recommendGoods"></list>
<view class="cart" @click="toCartPage"> <view class="cart" @click="toCartPage">
<image src="/static/image/common/3.png"></image> <image src="/static/image/common/3.png"></image>
@ -56,16 +53,16 @@
</scroll-view> </scroll-view>
</template> </template>
<script> <script>
import shopitem from "@/components/shop/shop-item/index" import shopitem from "@/components/shop/shop-item/index";
import recommend from "@/components/shop/recommend/index" import recommend from "@/components/shop/recommend/index";
import pintuan from "@/components/shop/recommend/pintuan" import pintuan from "@/components/shop/recommend/pintuan";
import seckill from "@/components/shop/seckill/index" import seckill from "@/components/shop/seckill/index";
import group from "@/components/shop/group/index" import group from "@/components/shop/group/index";
import youhq from "@/components/shop/youhq/index" import youhq from "@/components/shop/youhq/index";
import list from "../../components/shop/list/index" import list from "@/components/shop/list/index";
export default { export default {
name:"shop", name: "shop",
components:{ components: {
shopitem, shopitem,
recommend, recommend,
seckill, seckill,
@ -74,7 +71,7 @@ export default {
list, list,
pintuan pintuan
}, },
data(){ data() {
return { return {
area: "请选择", area: "请选择",
chooseArea: false, chooseArea: false,
@ -83,15 +80,14 @@ export default {
city: true, city: true,
area: false area: false
}, },
keyword:"", keyword: "",
list:[], list: [],
goodsClassify: [], // goodsClassify: [], //
classifyList: [], classifyList: [],
recommendedSpike: {}, // recommendedSpike: {}, //
spikeList: [], // spikeList: [], //
seckillTime: {}, // seckillTime: {}, //
couponGroupList: [], // couponGroupList: [], //
pinTuanList: [], //
pinTuanPush: {}, // pinTuanPush: {}, //
} }
}, },
@ -105,7 +101,7 @@ export default {
this.getPinTuanPush(); this.getPinTuanPush();
}, },
methods: { methods: {
sousuo(){ sousuo() {
// console.log(123) // console.log(123)
this.$u.route({ this.$u.route({
url:"pageB/search/index" url:"pageB/search/index"
@ -146,7 +142,6 @@ export default {
this.$u.api.getGoodsClass().then(res => { this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
this.couponGroupList = res.data; this.couponGroupList = res.data;
this.getPinTuanList(this.couponGroupList[0].gc_id);
} }
}) })
}, },
@ -162,15 +157,6 @@ export default {
} }
}) })
}, },
//
getPinTuanList(id) {
this.$u.api.getPinTuanList({
page: 0,
gc_id: id,
}).then(res => {
this.pinTuanList = res.data;
})
},
clickImage(index) { clickImage(index) {
console.log(index); console.log(index);
console.log(this.list[index]); console.log(this.list[index]);
@ -200,8 +186,10 @@ export default {
.shop { .shop {
height: calc(100vh - var(--window-top)); height: calc(100vh - var(--window-top));
box-sizing: border-box; box-sizing: border-box;
padding: 0 33rpx 100rpx; background-color: #F0EDF1;
.top{ .top {
padding: 0 30rpx;
background-color: #ffffff;
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
display: flex; display: flex;
@ -211,7 +199,11 @@ export default {
height: 37rpx; height: 37rpx;
} }
} }
.add{ .swiper-image {
background-color: #ffffff;
padding: 0 30rpx;
}
.add {
width: 115rpx; width: 115rpx;
height: 25rpx; height: 25rpx;
display: flex; display: flex;
@ -224,40 +216,43 @@ export default {
> text { > text {
width: 80rpx; width: 80rpx;
} }
>image{ > image {
width: 24rpx; width: 24rpx;
height: 15rpx; height: 15rpx;
} }
} }
.mnue{ .mnue {
background-color: #ffffff;
width: 35rpx; width: 35rpx;
height: 26rpx; height: 26rpx;
margin-left: 36rpx; margin-left: 36rpx;
} }
.chengnuo{ .chengnuo {
padding: 30rpx;
background-color: #ffffff;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 24rpx; > view {
>view{
display: flex; display: flex;
align-items: center; align-items: center;
>image{ > image {
width: 23rpx; width: 23rpx;
height: 23rpx; height: 23rpx;
} }
>text{ > text {
font-size: 22rpx; font-size: 22rpx;
color: #999; color: #999;
margin-left: 8rpx; margin-left: 8rpx;
} }
} }
} }
.fenlei{ .fenlei {
padding: 30rpx;
background-color: #ffffff;
display: flex; display: flex;
// justify-content: space-between;
margin-top: 30rpx;
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 20rpx;
> view { > view {
margin-bottom: 30rpx; margin-bottom: 30rpx;
&:not(:nth-child(5n)) { &:not(:nth-child(5n)) {
@ -265,13 +260,7 @@ export default {
} }
} }
} }
.hr{ .lingquan {
width: 750rpx;
margin-left: -33rpx;
height: 20rpx;
background-color: #ececec;
}
.lingquan{
width: 750rpx; width: 750rpx;
height: 177rpx; height: 177rpx;
margin-left: -33rpx; margin-left: -33rpx;

BIN
static/image/common/20.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB