Compare commits
No commits in common. "410a7850e64e4f9b763257ba9fa5dc255ab1cfac" and "03d10b1749ec9184c2c1d38861100a36373bbefb" have entirely different histories.
410a7850e6
...
03d10b1749
@ -77,10 +77,6 @@ export default {
|
||||
getGoodsClassifyList() {
|
||||
return vm.$u.post('Goods/getGoodsClassifyList');
|
||||
},
|
||||
// 商品推荐的分类
|
||||
getGoodsClassRecommend() {
|
||||
return vm.$u.post('Goods/getGoodsClassRecommend');
|
||||
},
|
||||
// 商品推荐
|
||||
getGoodsRecommend({page, gc_id}){
|
||||
return vm.$u.post('Goods/getGoodsRecommend', {
|
||||
@ -126,7 +122,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 订单步骤2:发起订单,返回订单信息
|
||||
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id }) {
|
||||
sendOrder({ ifcart, cart_id, address_id, buy_city_id }) {
|
||||
return vm.$u.post('buy/buy_step2', {
|
||||
ifcart: ifcart,
|
||||
cart_id: cart_id,
|
||||
@ -176,6 +172,11 @@ export default {
|
||||
id: id
|
||||
});
|
||||
},
|
||||
goodsInfo({id}){
|
||||
return vm.$u.post('goods/goodsInfo', {
|
||||
goods_id: id
|
||||
});
|
||||
},
|
||||
// 商品搜索
|
||||
ShopSearch({keyword,page = 1,order = 'goods_salenum'}){
|
||||
return vm.$u.post('ShopSearch/search',{
|
||||
@ -259,25 +260,7 @@ export default {
|
||||
},
|
||||
getStoreInfo({id}){
|
||||
return vm.$u.post('Store/getStoreInfo',{id})
|
||||
},
|
||||
// 评论标签+数量
|
||||
getEvaluateSpec({ id }) {
|
||||
return vm.$u.post('Specialci/getEvaluateSpec', {
|
||||
goods_id: id,
|
||||
})
|
||||
},
|
||||
// 获取商品评论
|
||||
getAllEvalue({ goods_id, page, type }) {
|
||||
return vm.$u.post('Specialci/getAllEvalue', {
|
||||
goods_id: goods_id,
|
||||
page: page,
|
||||
type: type,
|
||||
})
|
||||
},
|
||||
// 搜索发现列表
|
||||
searchwordlist() {
|
||||
return vm.$u.post('ShopSearch/searchwordlist')
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,14 +4,12 @@ Vue.use(Vuex)
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单 和 goodsDetails 的 type 相同
|
||||
orderType: '', // 订单类型 1 普通订单 2 购物车订单 3 拼团订单 4 秒杀订单
|
||||
orderInfo: {}, // 订单数据 订单步骤1:展示结算数据
|
||||
orderAddress: {}, // 下单时选择的地址
|
||||
goodsDetails: {}, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
goods_id: '', // 拼团商品 id
|
||||
pintuangroup_headid: '', // 拼团团长id 有为开团 无为参团
|
||||
groupbuyInfo: {}, // 秒杀详情
|
||||
loadmore: {}, // 下拉加载返回的数据
|
||||
},
|
||||
getters: {
|
||||
getOrderAddress(state) {
|
||||
@ -43,12 +41,6 @@ const store = new Vuex.Store({
|
||||
setGroupbuyInfo(state, info) {
|
||||
state.groupbuyInfo = info;
|
||||
},
|
||||
setGroupHeadId(state, id) {
|
||||
state.pintuangroup_headid = id;
|
||||
},
|
||||
setLoadMore(state, info) {
|
||||
state.loadmore = info;
|
||||
},
|
||||
}
|
||||
})
|
||||
export default store;
|
@ -1,115 +0,0 @@
|
||||
<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="image-container">
|
||||
<image :src="src" v-for="(src, index) in content.geval_image" :key="index"></image>
|
||||
</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;
|
||||
}
|
||||
}
|
||||
}
|
||||
.image-container {
|
||||
margin: 20rpx 0;
|
||||
> image {
|
||||
width: 210rpx;
|
||||
height: 210rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
&: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>
|
@ -1,61 +0,0 @@
|
||||
<template>
|
||||
<view class="loadmore">
|
||||
<u-loadmore :status="loadStatus" :bgColor="bgColor" margin-bottom="20"></u-loadmore>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
/*
|
||||
* @description 下拉加载
|
||||
* @property {String} bgColor 背景色
|
||||
* @property {Number} page 初始页码
|
||||
* @event {Function} callback 下拉刷新请求的接口
|
||||
**/
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loadStatus: 'loadmore',
|
||||
timer: true,
|
||||
tpage: Number,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
bgColor: String,
|
||||
page: Number,
|
||||
},
|
||||
created() {
|
||||
this.tpage = this.page;
|
||||
},
|
||||
methods: {
|
||||
reachBottom() {
|
||||
if(!this.timer) return false;
|
||||
this.loadStatus = "loading";
|
||||
this.tpage++;
|
||||
this.$emit('callback', { page: this.tpage });
|
||||
// this.$emit('callback', { page: this.tpage }).then(length => {
|
||||
// if(length == 0) {
|
||||
// this.tpage--;
|
||||
// this.status = 'nomore';
|
||||
// } else {
|
||||
// this.status = 'loading';
|
||||
// }
|
||||
// }).catch(() => {
|
||||
// this.loadStatus = "nomore";
|
||||
// this.tpage--;
|
||||
// })
|
||||
// this.$parent.callback({ page: this.tpage }).then(length => {
|
||||
// if(length == 0) {
|
||||
// this.tpage--;
|
||||
// this.status = 'nomore';
|
||||
// } else {
|
||||
// this.status = 'loading';
|
||||
// }
|
||||
// }).catch(() => {
|
||||
// this.loadStatus = "nomore";
|
||||
// this.tpage--;
|
||||
// })
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
@ -39,7 +39,6 @@ export default {
|
||||
goodsClass: Array,
|
||||
},
|
||||
created() {
|
||||
// console.log(this.goodsClass);
|
||||
// console.log(this.couponInfo);
|
||||
},
|
||||
filters: {
|
||||
@ -52,6 +51,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
exchange() {
|
||||
this.$emit('exchange', this.couponInfo.vouchertemplate_id);
|
||||
},
|
||||
use() {
|
||||
this.$emit('use', this.couponInfo);
|
||||
},
|
||||
@ -62,7 +64,6 @@ export default {
|
||||
.c-coupon {
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
margin-bottom: 30rpx;
|
||||
@mixin coupon-image($url) {
|
||||
width: 690rpx;
|
||||
height: 194rpx;
|
||||
|
@ -12,11 +12,9 @@
|
||||
<image :src="goods.goods_image"></image>
|
||||
<view class="goods-text">
|
||||
<view class="goods-name u-line-2">{{ goods.goods_name }}</view>
|
||||
<view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40 && goods.goods_spec">
|
||||
<text v-for="(spec, index) in goods.goods_spec" :key="index">{{ spec + ';' }}</text>
|
||||
</view>
|
||||
<view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">结束时间:{{ order.add_time * 1000 | date('yyyy-mm-dd hh:MM') }}</view>
|
||||
<view class="goods-price u-line-1" v-if="order.order_state == 20 || order.order_state == 40">总价:¥{{ goods.goods_price }},实付款¥{{ goods.goods_pay_price }}</view>
|
||||
<view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40">XL;红色条纹XL;红色条纹XL;红色条纹</view>
|
||||
<view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">距离结束:23:23:38</view>
|
||||
<view class="goods-price u-line-1" v-if="order.order_state == 20 || order.order_state == 40">总价:¥99.00,实付款¥99</view>
|
||||
<view class="goods-date" v-if="order.order_state == 20 || order.order_state == 40">
|
||||
<image src="@/pageE/static/mine/26.png"></image>
|
||||
<view>{{ order.add_time | date }}</view>
|
||||
@ -29,14 +27,13 @@
|
||||
<view class="logistics" v-if="order.order_state == 30" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="comment" v-if="order.order_state == 40 && order.evaluation_state == 0" @click="toOtherPage('Comment')">立即评价</view>
|
||||
<view class="calcel" v-if="order.order_state == 10" @click="cancelOrder">取消支付</view>
|
||||
<view class="payment" v-if="order.order_state == 10" @click="payNow(order.pay_sn, order.order_amount)">立即支付</view>
|
||||
<view class="payment" v-if="order.order_state == 10">立即支付</view>
|
||||
<view class="service" v-if="order.order_state == 20">联系官方客服</view>
|
||||
<view class="submit" v-if="order.order_state == 20">提交官方审核</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import common from '@/static/js/common.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -49,14 +46,6 @@ export default {
|
||||
created() {
|
||||
this.viewState();
|
||||
},
|
||||
filters: {
|
||||
// timeLine(timestamp) {
|
||||
// const timestamp = 0.5*60*60*1000;
|
||||
// const now = new Date().getTime();
|
||||
// let line = now - timestamp * 1000;
|
||||
// return common.getLineTime({ timestamp: line });
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
viewState() {
|
||||
let state;
|
||||
@ -103,12 +92,6 @@ export default {
|
||||
oid: this.order.order_id,
|
||||
});
|
||||
},
|
||||
payNow(pay_sn, order_amount) {
|
||||
this.$u.route('/pageC/cart/cashier', {
|
||||
pay_sn: pay_sn,
|
||||
price: order_amount,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -131,7 +114,6 @@ export default {
|
||||
height: 50rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
background-color: aquamarine;
|
||||
}
|
||||
.store-name {
|
||||
font-size: 26rpx;
|
||||
|
@ -8,10 +8,10 @@
|
||||
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 130px">
|
||||
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
|
||||
<swiper-item class="swiper-item" v-for="(_, i) in classifyList" :key="i">
|
||||
<!-- 最多显示3个 -->
|
||||
<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" style="margin: 0 auto;"></u-empty>
|
||||
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length"></u-empty>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@ -23,41 +23,17 @@ export default {
|
||||
components:{
|
||||
sitem
|
||||
},
|
||||
props: {
|
||||
groupList: Array,
|
||||
classifyList: Array,
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
current: -1,
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
groupList: [], // 拼团商品
|
||||
classifyList: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
this.getPinTuanList(this.classifyList[value].gc_id);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getGoodsClass();
|
||||
},
|
||||
methods: {
|
||||
// 获取优惠券拼团分类
|
||||
getGoodsClass() {
|
||||
this.$u.api.getGoodsClass().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.classifyList = res.data;
|
||||
this.current = 0;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拼团列表
|
||||
getPinTuanList(id) {
|
||||
this.$u.api.getPinTuanList({
|
||||
page: 0,
|
||||
gc_id: id,
|
||||
}).then(res => {
|
||||
this.groupList = res.data;
|
||||
})
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
@ -76,9 +52,7 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.group{
|
||||
background-color: #ffffff;
|
||||
.top{
|
||||
padding: 0 30rpx;
|
||||
height: 90rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@ -93,11 +67,19 @@ export default {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.label{
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
>text{
|
||||
margin-right: 34rpx;
|
||||
}
|
||||
}
|
||||
.list{
|
||||
box-sizing: border-box;
|
||||
padding: 0 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 21rpx;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -3,8 +3,8 @@
|
||||
<image class="head" :src="info.pintuan_image"></image>
|
||||
<text class="title u-line-1">{{ info.pintuan_goods_name }}</text>
|
||||
<view class="price">
|
||||
<view>¥{{ info.pintuan_goods_price }}</view>
|
||||
<view>立即拼团</view>
|
||||
<text>¥{{ info.pintuan_goods_price }}</text>
|
||||
<text>立即购买</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -16,26 +16,19 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
// this.$u.api.getPinTuanDetails({
|
||||
// pintuan_id: this.info.pintuan_id,
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.data,
|
||||
// type: 2,
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGoodsId', this.info.pintuan_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.api.getPinTuanDetails({
|
||||
pintuan_id: this.info.pintuan_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.data,
|
||||
type: 2,
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGoodsId', this.info.pintuan_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.info.pintuan_id,
|
||||
type: 2,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -45,33 +38,33 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.item{
|
||||
width: 210rpx;
|
||||
overflow: hidden;
|
||||
.head{
|
||||
width: 210rpx;
|
||||
height: 131rpx;
|
||||
border-radius: 6rpx;
|
||||
|
||||
}
|
||||
.title{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-top: 10rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.price{
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: space-between;
|
||||
margin-top: 10rpx;
|
||||
> view:first-child{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 19rpx;
|
||||
>text:first-child{
|
||||
font-size: 26rpx;
|
||||
color: #FF3131;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
> view:last-child{
|
||||
font-size: 22rpx;
|
||||
>text:last-child{
|
||||
color: #FDD360;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
@ -1,102 +1,67 @@
|
||||
<template>
|
||||
<view class="list">
|
||||
<view class="top">商品推荐</view>
|
||||
<view class="top">
|
||||
商品推荐
|
||||
</view>
|
||||
<!-- <view class="label">
|
||||
<text v-for="item in classifyList" :key="item.gc_id">{{ item.gc_name }}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
|
||||
</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>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" >
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
|
||||
<view class="goods-item">
|
||||
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
|
||||
<view class="item">
|
||||
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
|
||||
</view>
|
||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
|
||||
<!-- </scroll-view> -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 加载更多 -->
|
||||
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20"></u-loadmore>
|
||||
<!-- <loadmore ref="loadmore" @callback="getGoodsRecommend" bgColor="#FFF" :page="page"></loadmore> -->
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import item from "./item";
|
||||
import loadmore from "@/components/loadmore/index";
|
||||
import item from "./item"
|
||||
export default {
|
||||
name:"list",
|
||||
data() {
|
||||
return {
|
||||
current: -1,
|
||||
current: Number,
|
||||
swiperCurrent: 0,
|
||||
goodsList: [],
|
||||
classifyList: [],
|
||||
swiperHeight: '',
|
||||
page: 1, // 从 1 开始
|
||||
loadStatus: 'loadmore',
|
||||
timer: true,
|
||||
}
|
||||
},
|
||||
components:{
|
||||
item,
|
||||
loadmore
|
||||
item
|
||||
},
|
||||
props: {
|
||||
classifyList: Array
|
||||
},
|
||||
watch: {
|
||||
current(index) {
|
||||
const id = this.classifyList[index].gc_id;
|
||||
this.getGoodsRecommend({gc_id: id});
|
||||
this.getGoodsRecommend(id);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getGoodsClassRecommend();
|
||||
this.current = 0;
|
||||
console.log(this.classifyList);
|
||||
},
|
||||
methods: {
|
||||
loadMore(page) {
|
||||
if(!this.timer) return false;
|
||||
this.loadStatus = "loading";
|
||||
this.page++;
|
||||
this.getGoodsRecommend({
|
||||
gc_id: this.classifyList[this.current].gc_id,
|
||||
page: this.page,
|
||||
reload: false,
|
||||
}).then(length => {
|
||||
// console.log(length);
|
||||
if(length == 0) {
|
||||
this.page--;
|
||||
this.loadStatus = 'nomore';
|
||||
} else {
|
||||
this.loadStatus = 'loading';
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loadStatus = "nomore";
|
||||
this.page--;
|
||||
})
|
||||
// this.$refs.loadmore.reachBottom();
|
||||
// this.getGoodsRecommend(this.classifyList[this.current].gc_id);
|
||||
},
|
||||
getGoodsClassRecommend(gc_id) {
|
||||
this.$u.api.getGoodsClassRecommend().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
// 初始化 current
|
||||
this.current = 0;
|
||||
this.classifyList = res.data.gc_recommend;
|
||||
// this.getGoodsRecommend(this.classifyList[0].gc_id);
|
||||
}
|
||||
})
|
||||
},
|
||||
async getGoodsRecommend({ page = this.page, gc_id, reload = true } = {}) {
|
||||
const res = await this.$u.api.getGoodsRecommend({
|
||||
page: page,
|
||||
getGoodsRecommend(gc_id) {
|
||||
this.$u.api.getGoodsRecommend({
|
||||
page: 1,
|
||||
gc_id: gc_id,
|
||||
})
|
||||
}).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
if(reload) this.goodsList = res.data.goodsList;
|
||||
else this.goodsList.push(...res.data.goodsList);
|
||||
// console.log(this.goodsList);
|
||||
this.setSwiperHeight();
|
||||
this.goodsList = res.data.goodsList;
|
||||
console.log(this.goodsList);
|
||||
}
|
||||
return res.data.goodsList.length;
|
||||
},
|
||||
setSwiperHeight() {
|
||||
// height: 230px, margin-bottom: 13
|
||||
this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (230 + 13) + 'px';
|
||||
})
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
tabsChange(index) {
|
||||
@ -120,10 +85,6 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.list{
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx {
|
||||
top: 0;
|
||||
};
|
||||
.top{
|
||||
font-size: 30rpx;
|
||||
height: 90rpx;
|
||||
@ -131,11 +92,21 @@ export default {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
.goods-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
// .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;
|
||||
|
||||
// }
|
||||
}
|
||||
</style>
|
@ -4,7 +4,7 @@
|
||||
<view class="info">
|
||||
<text class="title u-line-1">{{ info.goods_name }}</text>
|
||||
<text class="jianjie u-line-2">{{ info.goods_advword }}</text>
|
||||
<text class="price">¥{{ info.goods_price }}</text>
|
||||
<text class="price">{{ info.goods_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -16,25 +16,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
// 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);
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.info.goods_id,
|
||||
type: 1,
|
||||
id: this.info.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -43,33 +28,31 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.item{
|
||||
|
||||
width: 330rpx;
|
||||
height: 460rpx;
|
||||
margin-bottom: 26rpx;
|
||||
height: 469rpx;
|
||||
margin-bottom: 27rpx;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 10rpx 10rpx 0rpx 0rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
.img{
|
||||
width: 330rpx;
|
||||
width: 100%;
|
||||
height: 272rpx;
|
||||
background: rgba(245,245,245,1);
|
||||
border-radius: 10rpx 10rpx 0rpx 0rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
}
|
||||
.info{
|
||||
width: 320rpx;
|
||||
padding: 0 12rpx 28rpx;
|
||||
padding: 0 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
.title{
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-bottom: 13rpx;
|
||||
}
|
||||
.jianjie{
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.price{
|
||||
color: #FF3131;
|
||||
|
@ -32,7 +32,7 @@ export default {
|
||||
props: ['recommendData', 'type'],
|
||||
created() {
|
||||
this.info = this.recommendData;
|
||||
// console.log(this.recommendData);
|
||||
console.log(this.recommendData);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -35,30 +35,23 @@ export default {
|
||||
props: ['recommendData', 'type'],
|
||||
created() {
|
||||
this.info = this.recommendData;
|
||||
// console.log(this.recommendData);
|
||||
console.log(this.recommendData);
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
// this.$u.api.getPinTuanDetails({
|
||||
// pintuan_id: this.recommendData.pintuan_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.data,
|
||||
// type: 2,
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.api.getPinTuanDetails({
|
||||
pintuan_id: this.recommendData.pintuan_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.data,
|
||||
type: 2,
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.recommendData.pintuan_id,
|
||||
type: 2,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -67,9 +60,6 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.recommend{
|
||||
margin-bottom: 20rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #ffffff;
|
||||
.top{
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
@ -85,7 +75,6 @@ export default {
|
||||
}
|
||||
}
|
||||
.connect{
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.user {
|
||||
|
@ -45,9 +45,6 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.seckill{
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.top{
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="item" @click="spikeGoods">
|
||||
<view class="item">
|
||||
<image class="head" :src="item.groupbuy_image1"></image>
|
||||
<text class="title u-line-2">{{ item.goods_name }}</text>
|
||||
<view class="price">
|
||||
<text>¥{{ item.groupbuy_price }}</text>
|
||||
<text class="origin">¥{{ item.goods_price }}</text>
|
||||
<text>¥{{ item.goods_price }}</text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>剩余{{ item.inventory | formatValue }}件</text>
|
||||
@ -22,34 +22,6 @@ export default {
|
||||
if(temp > 999) temp = '999+';
|
||||
return temp;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
spikeGoods() {
|
||||
// console.log(this.item.groupbuy_id);
|
||||
// this.$u.api.getSpikeInfo({
|
||||
// groupbuy_id: this.item.groupbuy_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.goodsInfo,
|
||||
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.item.groupbuy_id,
|
||||
type: 3,
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -36,57 +36,43 @@ export default {
|
||||
type: String,
|
||||
},
|
||||
created() {
|
||||
// console.log(this.item);
|
||||
// console.log(this.type);
|
||||
console.log(this.item);
|
||||
console.log(this.type);
|
||||
},
|
||||
methods: {
|
||||
spikeGoods() {
|
||||
// console.log(this.item.groupbuy_id);
|
||||
// this.$u.api.getSpikeInfo({
|
||||
// groupbuy_id: this.item.groupbuy_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.goodsInfo,
|
||||
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
console.log(this.item.groupbuy_id);
|
||||
this.$u.api.getSpikeInfo({
|
||||
groupbuy_id: this.item.groupbuy_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.goodsInfo,
|
||||
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||
this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.item.groupbuy_id,
|
||||
type: 3,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetailsPage() {
|
||||
// this.$u.api.getPinTuanDetails({
|
||||
// pintuan_id: this.item.pintuan_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.data,
|
||||
// type: 2,
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGoodsId', this.item.pintuan_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.api.getPinTuanDetails({
|
||||
pintuan_id: this.item.pintuan_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.data,
|
||||
type: 2,
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGoodsId', this.item.pintuan_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.item.pintuan_id,
|
||||
type: 2,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ export default {
|
||||
num = this.couponList.length
|
||||
? this.couponList.length > 4 ? 4 : this.couponList.length
|
||||
: 1
|
||||
this.swiperHeight = (97 + 10) * num + 'px';
|
||||
this.swiperHeight = (97 + 10) * num - 10 + 'px';
|
||||
},
|
||||
toCouponPage() {
|
||||
this.$u.route({
|
||||
@ -93,11 +93,8 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.coupon-swiper {
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 40rpx;
|
||||
.top {
|
||||
padding: 0 30rpx;
|
||||
height: 90rpx;
|
||||
padding-top: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@ -112,9 +109,11 @@ export default {
|
||||
}
|
||||
}
|
||||
.swiper-coupon-item {
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
// padding: 30rpx {
|
||||
// top: 0;
|
||||
// };
|
||||
.coupon-item {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
@ -1,100 +0,0 @@
|
||||
<template>
|
||||
<view class="comment">
|
||||
<view class="label-list">
|
||||
<view v-for="(label, index) in evaluateSpec" :key="index" :class="{'active': current == index}" @click="current=index">{{ index + '(' + label + '}' }}</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 {
|
||||
id: Number,
|
||||
current: '全部',
|
||||
page: 0,
|
||||
evalueList: [],
|
||||
evaluateSpec: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
comment
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id;
|
||||
// this.getAllEvalue();
|
||||
this.getEvaluateSpec();
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
this.getAllEvalue(value);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getEvaluateSpec() {
|
||||
this.$u.api.getEvaluateSpec({
|
||||
id: this.id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.evaluateSpec = res.data;
|
||||
this.getAllEvalue();
|
||||
}
|
||||
})
|
||||
},
|
||||
getAllEvalue(type) {
|
||||
let params = {
|
||||
goods_id: this.id,
|
||||
page: this.page,
|
||||
}
|
||||
if(type) Object.assign(params, { type: type });
|
||||
this.$u.api.getAllEvalue(params).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>
|
@ -57,7 +57,7 @@ export default {
|
||||
watch:{
|
||||
select(){
|
||||
// console.log(this.select)
|
||||
this.$emit("sel", this.select);
|
||||
this.$emit("sel",this.select)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 普通商品 tool -->
|
||||
<view class="tloos" v-if="type == 1">
|
||||
<view class="tloos">
|
||||
<view class="navs">
|
||||
<image src="/static/image/common/18.png"></image>
|
||||
店铺
|
||||
@ -10,32 +9,10 @@
|
||||
<image src="/static/image/common/19.png"></image>
|
||||
客服
|
||||
</view>
|
||||
<view class="button" style="background:rgba(253,211,96,0.6);" v-if="info.goods_try == 1">试穿试送</view>
|
||||
<view class="button" style="background:rgba(253,211,96,0.6);">试穿试送</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>
|
||||
<!-- 拼团 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">
|
||||
<scroll-view scroll-y="true" class="popup">
|
||||
<view>
|
||||
@ -51,9 +28,10 @@
|
||||
<text>购买数量</text>
|
||||
<u-number-box v-model="value" @change="valChange"></u-number-box>
|
||||
</view>
|
||||
<view style="height:100rpx"></view>
|
||||
<view style="height:180rpx"></view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
|
||||
</scroll-view>
|
||||
</u-popup>
|
||||
</view>
|
||||
@ -63,9 +41,9 @@
|
||||
import guige from "./guige"
|
||||
export default {
|
||||
name:"tloos",
|
||||
props: ['id', 'info', 'type'],
|
||||
props: ['id','info'],
|
||||
components:{
|
||||
guige,
|
||||
guige
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
@ -75,9 +53,6 @@ export default {
|
||||
quanxuan:false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.show = false;
|
||||
},
|
||||
methods: {
|
||||
buy(type){
|
||||
let that = this;
|
||||
@ -93,7 +68,7 @@ export default {
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.show = true;
|
||||
this.show = true
|
||||
}
|
||||
|
||||
},
|
||||
@ -112,6 +87,7 @@ export default {
|
||||
if(sel != 0){
|
||||
arr.push(sel)
|
||||
}
|
||||
|
||||
}
|
||||
// console.log(arr.length)
|
||||
if(arr.length == index){
|
||||
@ -123,76 +99,13 @@ export default {
|
||||
},
|
||||
watch:{
|
||||
sel(){
|
||||
console.log(this.sel)
|
||||
// console.log(this.sel)
|
||||
this.$emit('xuanze',this.sel)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<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{
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
|
@ -25,20 +25,9 @@
|
||||
</view>
|
||||
<view class="hr"></view>
|
||||
<!-- <navs :value="领券"></navs> -->
|
||||
<navs :value="'产品规格'" @click.native="showSpec=true"></navs>
|
||||
<!-- <navs :value="'产品颜色'"></navs> -->
|
||||
<!-- <navs :value="'选择尺码'"></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>
|
||||
<navs :value="'产品规格'"></navs>
|
||||
<navs :value="'产品颜色'"></navs>
|
||||
<navs :value="'选择尺码'"></navs>
|
||||
<view class="hr"></view>
|
||||
<view class="group-user" v-if="groupUser.length">
|
||||
<view class="top">
|
||||
@ -51,9 +40,9 @@
|
||||
<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>
|
||||
<image v-for="(user, i) in groupUser.slice(0, 3)" :src="user[0].member_avatar" :key="i"></image>
|
||||
</view>
|
||||
<view class="all" @click="showGroupUser=true">
|
||||
<view class="all">
|
||||
<text>查看全部</text>
|
||||
<image src="/static/image/common/1.png"></image>
|
||||
</view>
|
||||
@ -72,7 +61,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup v-model="showGroupUser" mode="center" z-index="10078">
|
||||
<u-popup v-model="showGroupUser" mode="center">
|
||||
<view class="launch-container">
|
||||
<view class="title u-line-1">正在拼团</view>
|
||||
<scroll-view class="launch-view">
|
||||
@ -81,7 +70,6 @@
|
||||
<image class="avatar" :src="user[0].member_avatar"></image>
|
||||
<view class="name u-line-1">{{ user[0].member_nickname }}</view>
|
||||
</view>
|
||||
<view class="pintuan-none" v-if="!groupUser.length">暂无拼团</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<image class="close" src="/static/image/common/17.png" @click="showGroupUser=false"></image>
|
||||
@ -96,7 +84,7 @@
|
||||
<view class="name u-line-1">{{ user.member_nickname }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="involvement-btn" @click="settlementOrder({ type: 'involvement' })">参与拼团</view>
|
||||
<view class="involvement-btn" @click="withImmediate('involvement')">参与拼团</view>
|
||||
<image class="close" src="/static/image/common/17.png" @click="showInvolvementUser=false"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
@ -107,48 +95,13 @@
|
||||
</view>
|
||||
<view class="rich">
|
||||
<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>
|
||||
<!-- 拼团 tool -->
|
||||
<view class="group-tool" v-if="type==2">
|
||||
<view class="launch" @click="settlementOrder">发起拼团</view>
|
||||
<view class="launch" @click="withImmediate">发起拼团</view>
|
||||
<view class="involvement" @click="showGroupUser=true">参与拼团</view>
|
||||
</view>
|
||||
<!-- 秒杀 tool -->
|
||||
<!-- 秒杀 -->
|
||||
<view class="spike-tool" v-if="type==3">
|
||||
<view class="left">
|
||||
<view>
|
||||
@ -160,237 +113,158 @@
|
||||
<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>
|
||||
<view class="btn" :class="{'cannot': groupbuyInfo.groupbuy_state == 32 || groupbuyInfo.inventory == groupbuyInfo.groupbuy_buy_quantity}">
|
||||
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <tloos @buy="buy" @xuanze="xuanze" :id="id" :info="goodsInfo" :type="type"></tloos> -->
|
||||
<!-- 普通商品 tool -->
|
||||
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="info" v-if="type==1"></tloos>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import comment from "@/components/comment/index";
|
||||
import navs from "../components/sdetails/navs";
|
||||
import guige from "../components/sdetails/guige"
|
||||
import tloos from "../components/sdetails/tloos";
|
||||
import navs from "../components/sdetails/navs"
|
||||
import tloos from "../components/sdetails/tloos"
|
||||
export default {
|
||||
name:"sdetails",
|
||||
data() {
|
||||
return {
|
||||
list: [], // 轮播图列表
|
||||
goodsInfo: {}, // 商品信息
|
||||
glist: [], // 规格列表
|
||||
id: 0, // 商品id/秒杀id/拼团 id
|
||||
goodsInfo: {},
|
||||
info:{},
|
||||
glist:[],
|
||||
id:0,
|
||||
type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
groupUser: [], // 拼团用户
|
||||
user_suc: [], // 拼团成功用户
|
||||
avatarWidth: '',
|
||||
showGroupUser: false, // 拼团
|
||||
showInvolvementUser: false, // 参团
|
||||
involvemenGroupInfo: [], // 参团的人
|
||||
groupbuyInfo: {}, // 秒杀详情
|
||||
spikeTime: '',
|
||||
timer: '', // 秒杀时间定时器
|
||||
spec_id: '', // 规格 id, 下单用的
|
||||
evaluate: {}, // 评价内容
|
||||
showSpec: false, // 是否显示选择规格
|
||||
goodsNumber: 1,
|
||||
sel: "", // 拼接的规格
|
||||
quanxuan: false, // 规格是否选择
|
||||
timer: '', // 时间定时器
|
||||
}
|
||||
},
|
||||
components:{
|
||||
comment,
|
||||
navs,
|
||||
tloos,
|
||||
guige,
|
||||
tloos
|
||||
},
|
||||
watch: {
|
||||
sel(value){
|
||||
this.xuanze(value);
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
// this.init();
|
||||
// console.log(option);
|
||||
this.type = Number(option.type);
|
||||
this.id = option.id;
|
||||
this.getGoodsDetails(this.id);
|
||||
this.setTitle();
|
||||
},
|
||||
onShow() {
|
||||
this.showSpec = false;
|
||||
this.showGroupUser = false;
|
||||
this.showInvolvementUser = false;
|
||||
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();
|
||||
// },
|
||||
setSwiperList(list) {
|
||||
let img = [];
|
||||
list.forEach(item => {
|
||||
init() {
|
||||
this.id = this.$store.state.goods_id;
|
||||
this.type = this.$store.getters.getGoodsType;
|
||||
const info = this.$store.getters.getGoodsInfo;
|
||||
if (this.type == 3) {
|
||||
this.groupbuyInfo = this.$store.state.groupbuyInfo;
|
||||
this.setSpikeTime();
|
||||
}
|
||||
// console.log(this.groupbuyInfo);
|
||||
if(this.type == 2) {
|
||||
this.groupUser = info.user;
|
||||
}
|
||||
this.goodsInfo = info.goods;
|
||||
// 设置轮播图
|
||||
let list = [];
|
||||
info.goods_image[0].forEach(item => {
|
||||
let temp = {
|
||||
image: item
|
||||
}
|
||||
img.push(temp);
|
||||
list.push(temp);
|
||||
})
|
||||
this.list = img;
|
||||
this.list = list;
|
||||
this.setTitle();
|
||||
},
|
||||
spikeGoods() {
|
||||
this.settlementOrder()
|
||||
},
|
||||
setSpikeTime(time) {
|
||||
// const time = this.groupbuyInfo.groupbuy_endtime;
|
||||
setSpikeTime() {
|
||||
const time = this.groupbuyInfo.groupbuy_endtime;
|
||||
// console.log(new Date(time*1000));
|
||||
// console.log(new Date());
|
||||
this.timer = setInterval(() => {
|
||||
let spikeTime = time * 1000 - new Date().getTime();
|
||||
// 计算天数
|
||||
const days = Math.floor(spikeTime/(24*3600*1000));
|
||||
let spikeTime = time * 1000 - new Date();
|
||||
//计算出小时数
|
||||
const leave1 = spikeTime % (24*3600*1000) //计算天数后剩余的毫秒数
|
||||
let hours = Math.floor(leave1/(3600*1000));
|
||||
const 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)
|
||||
},
|
||||
addCart() {
|
||||
buy(info){
|
||||
if(info.type == 2){
|
||||
this.$u.api.addCart({
|
||||
goods_id: this.id,
|
||||
quantity: this.goodsNumber,
|
||||
quantity: info.value,
|
||||
}).then(res => {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
title: res.errCode[1],
|
||||
type: res.errCode == 0 ? 'success' : 'warning',
|
||||
})
|
||||
})
|
||||
},
|
||||
purchase() {
|
||||
this.settlementOrder();
|
||||
},
|
||||
getGoodsDetails(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) {
|
||||
getGoodsDetails(id) {
|
||||
this.id = id;
|
||||
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.evaluate = res.data.goods_evaluate_info;
|
||||
this.goodsInfo = res.data.goods;
|
||||
this.setSwiperList(res.data.goods_image[0]);
|
||||
this.glist = res.data.spec_list;
|
||||
let list = [];
|
||||
res.data.goods_image[0].forEach(item => {
|
||||
let temp = {
|
||||
image: item
|
||||
}
|
||||
list.push(temp);
|
||||
})
|
||||
this.list = list;
|
||||
// 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;
|
||||
}
|
||||
this.$u.api.goodsInfo({id}).then((res)=>{
|
||||
// console.log(res)
|
||||
this.info = res.data.goods;
|
||||
this.glist = res.data.spec_list;
|
||||
})
|
||||
},
|
||||
// 秒杀
|
||||
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} num 数量
|
||||
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
|
||||
**/
|
||||
settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
|
||||
// 如果有pintuangroup_headid为参团不然为开团
|
||||
withImmediate(type) {
|
||||
let params = {
|
||||
ifcart: ifcart,
|
||||
cart_id: [this.goodsInfo.goods_id + '|' + num],
|
||||
}
|
||||
if(this.type == 2) {
|
||||
if(type == 'involvement') {
|
||||
Object.assign(params, {
|
||||
pintuan_id: this.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.id,
|
||||
})
|
||||
}
|
||||
// console.log(this.involvemenGroupInfo);
|
||||
if(type == 'involvement' && this.involvemenGroupInfo.length) {
|
||||
Object.assign(params, { pintuangroup_headid: this.involvemenGroupInfo[0].user_id });
|
||||
Object.assign(params, { pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id });
|
||||
}
|
||||
this.$u.api.settlementOrder(params).then(res => {
|
||||
// console.log(params);
|
||||
this.$u.api.withImmediate(params).then(res => {
|
||||
this.showGroupUser = false;
|
||||
this.showInvolvementUser = false;
|
||||
if(res.errCode == 0) {
|
||||
this.$store.commit('setOrderType', this.type);
|
||||
this.settlementOrder();
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
settlementOrder() {
|
||||
// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
|
||||
this.$u.api.settlementOrder({
|
||||
ifcart: 0,
|
||||
cart_id: [this.goodsInfo.goods_id + '|' + 1],
|
||||
pintuan_id: this.involvemenGroupInfo[0].user_id,
|
||||
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$store.commit('orderType', 3);
|
||||
this.$store.commit('updateOrderInfo', res.data)
|
||||
this.$u.route({
|
||||
url: '/pageC/cart/ConfirmOrder'
|
||||
@ -398,53 +272,27 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 参团
|
||||
involvemenGroup(user) {
|
||||
this.involvemenGroupInfo = user;
|
||||
this.showGroupUser = false;
|
||||
this.showInvolvementUser = true;
|
||||
// console.log(this.involvemenGroupInfo);
|
||||
},
|
||||
valChange(e) {
|
||||
// console.log(this.value)
|
||||
},
|
||||
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)
|
||||
}
|
||||
console.log(this.involvemenGroupInfo);
|
||||
},
|
||||
xuanze(id){
|
||||
// console.log(id)
|
||||
this.getGoodsDetails(this.glist[id])
|
||||
this.id = this.glist[id];
|
||||
},
|
||||
// 设置页面标题
|
||||
setTitle() {
|
||||
let title = '';
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
title = '商品详情';
|
||||
|
||||
break;
|
||||
case 2:
|
||||
title = '拼团商品详情';
|
||||
break;
|
||||
case 3:
|
||||
title = '秒杀商品详情';
|
||||
case 1:
|
||||
|
||||
break;
|
||||
case 1:
|
||||
|
||||
@ -456,14 +304,6 @@ export default {
|
||||
title: title
|
||||
});
|
||||
},
|
||||
viewComment() {
|
||||
this.$u.route({
|
||||
url: 'pageB/comment/index',
|
||||
params: {
|
||||
id: this.goodsInfo.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -471,7 +311,6 @@ export default {
|
||||
.sdetails {
|
||||
padding-bottom: 98rpx;
|
||||
position: relative;
|
||||
background-color: #EEEBEE;
|
||||
.spike-view {
|
||||
position: absolute;
|
||||
top: 396rpx;
|
||||
@ -501,7 +340,6 @@ export default {
|
||||
}
|
||||
.origin-price {
|
||||
font-size: 26rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
.num {
|
||||
@ -533,9 +371,7 @@ export default {
|
||||
}
|
||||
}
|
||||
.info {
|
||||
background:rgba(255,255,255,1);
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.title{
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 30rpx;
|
||||
@ -562,42 +398,12 @@ 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 {
|
||||
width: 100%;
|
||||
height: 20rpx;
|
||||
background-color: #ececec;
|
||||
}
|
||||
.group-user {
|
||||
background: rgba(255,255,255,1);
|
||||
padding: 30rpx;
|
||||
.top {
|
||||
margin-bottom: 28rpx;
|
||||
@ -748,11 +554,6 @@ export default {
|
||||
margin-right: 80rpx;
|
||||
}
|
||||
}
|
||||
.pintuan-none {
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
margin: 100rpx auto 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -858,7 +659,7 @@ export default {
|
||||
display: flex;
|
||||
font-size: 32rpx;
|
||||
color: rgba(255,255,255,1);
|
||||
z-index: 10076;
|
||||
z-index: 99;
|
||||
.launch {
|
||||
flex: 1;
|
||||
background: rgba(253,211,96,1);
|
||||
@ -879,7 +680,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 98rpx;
|
||||
display: flex;
|
||||
z-index: 10076;
|
||||
z-index: 99;
|
||||
.left {
|
||||
width: 190rpx;
|
||||
display: flex;
|
||||
@ -912,82 +713,5 @@ export default {
|
||||
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: 10076;
|
||||
.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>
|
@ -1,9 +1,19 @@
|
||||
<template>
|
||||
<view class="search">
|
||||
<view class="sosuo">
|
||||
<image></image>
|
||||
<u-search placeholder="搜索您需要的商品" v-model="keyword" height="60" :action-style="{
|
||||
'font-size':'32rpx',
|
||||
'color':'#FF780F',
|
||||
'overflow':'unset'
|
||||
}"
|
||||
@search="search"
|
||||
></u-search>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="title">搜索发现</view>
|
||||
<view class="label">
|
||||
<text v-for="(label, index) in searchwordlist" :key="index" @click="search(label.word)">{{ label.word }}</text>
|
||||
<text>这是标签</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -13,40 +23,17 @@ export default {
|
||||
name:"search",
|
||||
data(){
|
||||
return{
|
||||
keyword: "",
|
||||
searchwordlist: [],
|
||||
keyword:""
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWordList();
|
||||
},
|
||||
// 点击搜索按钮
|
||||
onNavigationBarButtonTap(e) {
|
||||
if(e.index == 0) this.search(this.keyword);
|
||||
},
|
||||
// 输入框文本变化
|
||||
onNavigationBarSearchInputChanged(e) {
|
||||
this.keyword = e.text;
|
||||
},
|
||||
// 点击键盘搜索按钮
|
||||
onNavigationBarSearchInputConfirmed(value) {
|
||||
this.search(this.keyword);
|
||||
},
|
||||
methods:{
|
||||
getWordList() {
|
||||
this.$u.api.searchwordlist().then(res => {
|
||||
this.searchwordlist = res.data;
|
||||
})
|
||||
},
|
||||
search(value){
|
||||
// console.log(value)
|
||||
if(!value) this.$u.toast('搜索内容不可为空');
|
||||
this.$u.route({
|
||||
url:"/pageB/search/out",
|
||||
params:{
|
||||
value: value,
|
||||
type: "shop",
|
||||
order: 'goods_salenum'
|
||||
value,
|
||||
type:"shop"
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -80,7 +67,6 @@ export default {
|
||||
}
|
||||
.label{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
>text{
|
||||
margin-top: 20rpx;
|
||||
margin-right: 30rpx;
|
||||
|
@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<view class="out">
|
||||
<view class="sosuo">
|
||||
<image></image>
|
||||
<u-search placeholder="搜索您需要的商品" v-model="keyword" height="60" :show-action="false"></u-search>
|
||||
</view>
|
||||
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32" active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0" height="88"></u-tabs-swiper>
|
||||
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
|
||||
<swiper-item>
|
||||
@ -12,7 +16,7 @@
|
||||
<swiper-item>
|
||||
<scroll-view :scroll-y="true" style="height:100%">
|
||||
<view class="list">
|
||||
<!-- <darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem> -->
|
||||
<darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
@ -34,6 +38,7 @@
|
||||
<scroll-view :scroll-y="true" style="height:100%">
|
||||
<view style="padding-top:30rpx">
|
||||
<shop v-for="(i,j) in shoplist[0]" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid" :image="i.goods_image"></shop>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
@ -51,6 +56,8 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
@ -155,11 +162,6 @@ export default {
|
||||
shoplist:[]
|
||||
}
|
||||
},
|
||||
onLoad(o){
|
||||
this.type = o.type
|
||||
this.keyword = o.value
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
@ -187,5 +189,10 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(o){
|
||||
this.type = o.type
|
||||
this.keyword = o.value
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
</script>
|
@ -33,10 +33,10 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<view @click="showCoupon({type: 2, store_id: item[0].store_id})" v-if="orderType == 1 || orderType == 5">
|
||||
<view @click="showCoupon({type: 2, store_id: item[0].store_id})">
|
||||
<view class="title">优惠券折扣</view>
|
||||
<view class="value">
|
||||
<view>-¥{{ storeCoupon[item[0].store_id] ? storeCoupon[item[0].store_id].voucher_price.toFixed(2) : '0.00' }}</view>
|
||||
<view>¥{{ item.coupon_price ? item.coupon_price : '0.00' }}</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -50,10 +50,10 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-active">
|
||||
<view @click="showCoupon({type: 1})" v-if="orderType == 1 || orderType == 5">
|
||||
<view @click="showCoupon({type: 1})">
|
||||
<view class="title">平台优惠券</view>
|
||||
<view class="value">
|
||||
<view>-¥{{ choiceCoupon.vouchertemplate_id ? choiceCoupon.voucher_price.toFixed(2) : '0.00' }}</view>
|
||||
<view>-¥{{ choiceCoupon.vouchertemplate_id ? choiceCoupon.voucher_price : '0.00' }}</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -66,17 +66,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<u-popup v-model="couponStatus" mode="bottom">
|
||||
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 1">
|
||||
<scroll-view class="coupon-choose" style="height: 800rpx;">
|
||||
<view class="title">优惠券详情</view>
|
||||
<view class="text">店铺优惠券</view>
|
||||
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_all_list" :key="index"></Coupon>
|
||||
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_all_list.length"></u-empty>
|
||||
</scroll-view>
|
||||
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 2">
|
||||
<view class="title">优惠券详情</view>
|
||||
<view class="text">平台优惠券</view>
|
||||
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_list[this.couponType.store_id]" :key="index"></Coupon>
|
||||
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_list[this.couponType.store_id].length"></u-empty>
|
||||
<view class="text">使用优惠券</view>
|
||||
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in couponList" :key="index"></Coupon>
|
||||
<u-empty text="无可用优惠券" mode="coupon" v-if="!couponList.length"></u-empty>
|
||||
</scroll-view>
|
||||
</u-popup>
|
||||
<view class="bottom">
|
||||
@ -86,7 +80,7 @@
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="num">共件{{ orderInfo.store_cart_list | setTotalNumber }}商品</view>
|
||||
<view class="btn" @click="intermediate">结算</view>
|
||||
<view class="btn" @click="sendOrder">结算</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet :list="deliveryList" @click="setDelivery" border-radius="10" v-model="showDelivery"></u-action-sheet>
|
||||
@ -116,12 +110,9 @@ export default {
|
||||
}, // 配送方式
|
||||
couponList: [],
|
||||
couponStatus: false,
|
||||
couponType: {}, // 选择的优惠券
|
||||
storeCoupon: {}, // 选中的店铺优惠券
|
||||
choiceCoupon: {}, // 使用的平台优惠券
|
||||
goodsClass: [],
|
||||
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
|
||||
|
||||
orderType: '', // 订单类型 1 普通订单 2 购物车订单 3 拼团订单 4 秒杀订单
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -147,9 +138,7 @@ export default {
|
||||
onLoad(option) {
|
||||
this.orderType = this.$store.state.orderType;
|
||||
this.orderInfo = this.$store.state.orderInfo;
|
||||
console.log(this.orderType);
|
||||
console.log(this.orderInfo);
|
||||
this.getGoodsClass();
|
||||
// console.log(this.orderInfo);
|
||||
},
|
||||
onShow() {
|
||||
// 判断是不是从选择地址页面返回
|
||||
@ -166,54 +155,10 @@ export default {
|
||||
'$store.state.orderAddress'(value) {
|
||||
this.addressInfo = value;
|
||||
this.getFreight();
|
||||
},
|
||||
// storeCoupon: {
|
||||
// deep: true,
|
||||
// handler() {
|
||||
// console.log(222);
|
||||
// this.setTotalPrice(); // 计算总价
|
||||
// }
|
||||
// },
|
||||
// choiceCoupon: {
|
||||
// deep: true,
|
||||
// handler() {
|
||||
// console.log(111);
|
||||
// this.setTotalPrice(); // 计算总价
|
||||
// }
|
||||
// },
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 如果有pintuangroup_headid为参团不然为开团
|
||||
async withImmediate(type) {
|
||||
let params = {
|
||||
pintuan_id: this.orderInfo.pintuan_id,
|
||||
}
|
||||
// console.log(this.involvemenGroupInfo);
|
||||
if(this.orderInfo.pintuangroup_id) {
|
||||
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
|
||||
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
||||
}
|
||||
// console.log(params);
|
||||
this.$u.api.withImmediate(params).then(res => {
|
||||
this.showGroupUser = false;
|
||||
this.showInvolvementUser = false;
|
||||
if(res.errCode == 0) {
|
||||
this.sendOrder(0);
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
intermediate() {
|
||||
if(this.orderType == 2) {
|
||||
this.withImmediate();
|
||||
} else if(this.orderType == 1) {
|
||||
this.sendOrder(0);
|
||||
}
|
||||
else this.sendOrder(1);
|
||||
},
|
||||
// @params {Number} ifcart 是否是购物车商品
|
||||
sendOrder(ifcart) {
|
||||
sendOrder() {
|
||||
// 拼接后端需要的数据形式
|
||||
let id = [], temp = '';
|
||||
const object = this.orderInfo.store_cart_list;
|
||||
@ -227,32 +172,15 @@ export default {
|
||||
})
|
||||
}
|
||||
}
|
||||
// 拼接优惠券
|
||||
let coupon = [];
|
||||
for (const key in this.storeCoupon) {
|
||||
if (this.storeCoupon.hasOwnProperty(key)) {
|
||||
const element = this.storeCoupon[key];
|
||||
temp = key + '|' + element.voucher_id;
|
||||
coupon.push(temp);
|
||||
temp = '';
|
||||
}
|
||||
}
|
||||
// 平台券store_id写0
|
||||
if(JSON.stringify(this.choiceCoupon) != '{}') {
|
||||
coupon.push(0 + '|' + this.choiceCoupon.voucher_id)
|
||||
}
|
||||
let params = {
|
||||
ifcart: ifcart,
|
||||
ifcart: 1,
|
||||
cart_id: id,
|
||||
address_id: this.addressInfo.address_id,
|
||||
buy_city_id: this.addressInfo.city_id,
|
||||
}
|
||||
if(coupon.length) Object.assign(params, { voucher_id: coupon });
|
||||
if(this.orderType == 2) {
|
||||
Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id });
|
||||
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
||||
}
|
||||
// console.log(params);
|
||||
// if(this.orderType == 3) {
|
||||
// Object.assign(params, { pintuan_id: })
|
||||
// }
|
||||
this.$u.api.sendOrder(params).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$u.route({
|
||||
@ -262,29 +190,39 @@ export default {
|
||||
price: res.data.order_total_amount,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
showCoupon({ type, store_id = -1 } = {}) {
|
||||
this.couponType = {
|
||||
async getCoupon({ type, store_id, status }) {
|
||||
const res = await this.$u.api.getMemberCouponList({
|
||||
type: type,
|
||||
store_id: store_id
|
||||
store_id: store_id,
|
||||
status: status,
|
||||
})
|
||||
return res;
|
||||
},
|
||||
showCoupon({ type, gc_id, store_id }) {
|
||||
// this.getCoupon({
|
||||
// type: type, // 优惠券类型: 1平台券, 2店铺券
|
||||
// store_id: store_id,
|
||||
// status: 1, // 代金券状态 1:未用 2:已用 3:过期 4:收回
|
||||
// }).then(res => {
|
||||
// this.couponStatus = true;
|
||||
// })
|
||||
let params = {
|
||||
type: type, // 优惠券类型: 1平台券, 2店铺券
|
||||
status: 1, // 代金券状态 1:未用 2:已用 3:过期 4:收回
|
||||
}
|
||||
if(store_id) Object.assign(params, 'store_id', store_id);
|
||||
if(gc_id) Object.assign(params, 'gc_id', gc_id);
|
||||
this.$u.api.getMemberCouponList(params).then(res => {
|
||||
this.couponList = res.data;
|
||||
this.couponStatus = true;
|
||||
})
|
||||
},
|
||||
useCoupon(coupon) {
|
||||
if(this.couponType.type == 1) this.choiceCoupon = coupon;
|
||||
if(this.couponType.type == 2) {
|
||||
Object.assign(this.storeCoupon, {
|
||||
[this.couponType.store_id]: coupon
|
||||
})
|
||||
}
|
||||
// console.log(this.choiceCoupon);
|
||||
// console.log(this.storeCoupon);
|
||||
this.choiceCoupon = coupon;
|
||||
this.couponStatus = false;
|
||||
this.setTotalPrice(); // 计算总价
|
||||
},
|
||||
getFreight() {
|
||||
this.$u.api.getFreight({
|
||||
@ -300,11 +238,10 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
setTotalPrice() {
|
||||
setTotalPrice(object) {
|
||||
const goods = this.orderInfo.store_goods_total;
|
||||
const freight = this.freight;
|
||||
let price = 0;
|
||||
// 商品价格加上运费
|
||||
[goods, freight].forEach(object => {
|
||||
for (const key in object) {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
@ -313,18 +250,6 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
// 减去优惠券
|
||||
// 平台
|
||||
if(JSON.stringify(this.choiceCoupon) != '{}') price -= Number(this.choiceCoupon.voucher_price);
|
||||
// 店铺
|
||||
if(JSON.stringify(this.storeCoupon) != '{}') {
|
||||
for (const key in this.storeCoupon) {
|
||||
if (this.storeCoupon.hasOwnProperty(key)) {
|
||||
const element = this.storeCoupon[key];
|
||||
price -= element.voucher_price;
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(price);
|
||||
this.totalPrice = price.toFixed(2);
|
||||
},
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
disabled: false,
|
||||
}
|
||||
],
|
||||
pay_way: 'wxpay_app',
|
||||
pay_way: '',
|
||||
pay_sn: '',
|
||||
price: '',
|
||||
}
|
||||
@ -54,10 +54,24 @@ export default {
|
||||
// getProvider() {
|
||||
// uni.getProvider({service: 'payment'})
|
||||
// },
|
||||
payOrder(provider, orderInfo) {
|
||||
// 支付宝支付
|
||||
payByAlipay (orderInfo) {
|
||||
uni.requestPayment({
|
||||
provider: provider,
|
||||
orderInfo: orderInfo, //订单数据
|
||||
provider: 'alipay',
|
||||
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) {
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
@ -72,15 +86,11 @@ export default {
|
||||
payment_code: this.pay_way,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
let orderInfo, provider;
|
||||
if(res.data.payment_code == 'wxpay_app') {
|
||||
provider = 'wxpay';
|
||||
orderInfo = JSON.parse(res.data.content);
|
||||
} else if(res.data.payment_code == 'alipay_app') {
|
||||
provider = 'alipay';
|
||||
orderInfo = res.data.content;
|
||||
}
|
||||
this.payOrder(provider, orderInfo);
|
||||
// this.$u.toast(res.message);
|
||||
// uni.navigateBack();
|
||||
const orderInfo = JSON.parse(res.data.content);
|
||||
console.log(orderInfo);
|
||||
this.pay_way == 'wxpay_app' ? this.payByWxpay(orderInfo) : this.payByAlipay(orderInfo);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ export default {
|
||||
// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
|
||||
this.$u.api.settlementOrder({ ifcart: 1, cart_id: id }).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$store.commit('setOrderType', 5);
|
||||
this.$store.commit('orderType', 2);
|
||||
this.$store.commit('updateOrderInfo', res.data);
|
||||
this.$u.route({
|
||||
url: '/pageC/cart/ConfirmOrder'
|
||||
|
@ -3,11 +3,10 @@
|
||||
<view>
|
||||
<u-tabs-swiper ref="uTabs" :list="tabList" name="gc_name" :current="current" @change="tabsChange" :is-scroll="true" active-color="#FF780F" swiperWidth="750" height="88" :show-bar="false"></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" >
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index">
|
||||
<scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
|
||||
<SpecialGoods v-for="(item, index) in pinTuanList" :key="index" :item="item" type='group'></SpecialGoods>
|
||||
<!-- <loadmore ref="loadmore" @callback="getPinTuanList" bgColor="#FFF"></loadmore> -->
|
||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList.length"></u-empty>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
@ -15,32 +14,27 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import loadmore from "@/components/loadmore/index";
|
||||
import SpecialGoods from "../../components/shop/special-shop/index";
|
||||
import SpecialGoods from "../../components/shop/special-shop/index"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabList: [],
|
||||
current: -1,
|
||||
current: Number,
|
||||
swiperCurrent: 0,
|
||||
page: 0,
|
||||
pinTuanList: [],
|
||||
swiperHeight: '',
|
||||
timer: '', // 限制下拉刷新
|
||||
}
|
||||
},
|
||||
components: {
|
||||
loadmore,
|
||||
SpecialGoods,
|
||||
SpecialGoods
|
||||
},
|
||||
onLoad() {
|
||||
this.getGoodsClass();
|
||||
this.setViewHeight();
|
||||
},
|
||||
watch: {
|
||||
current(index) {
|
||||
// console.log(this.tabList);
|
||||
this.getPinTuanList({id: this.tabList[index].gc_id });
|
||||
console.log(this.tabList);
|
||||
this.getPinTuanList(this.tabList[index].gc_id);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -54,13 +48,13 @@ export default {
|
||||
})
|
||||
},
|
||||
// 拼团列表
|
||||
async getPinTuanList({ id, page }) {
|
||||
const res = await this.$u.api.getPinTuanList({
|
||||
getPinTuanList(id) {
|
||||
this.$u.api.getPinTuanList({
|
||||
page: this.page,
|
||||
gc_id: id,
|
||||
})
|
||||
}).then(res => {
|
||||
this.pinTuanList = res.data;
|
||||
return res.data.length;
|
||||
})
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
tabsChange(index) {
|
||||
@ -75,31 +69,14 @@ export default {
|
||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
this.$refs.uTabs.setFinishCurrent(current);
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
// scroll-view到底部加载更多
|
||||
onreachBottom() {
|
||||
this.$$refs.loadmore.reachBottom();
|
||||
// if(!this.timer) return false;
|
||||
// this.loadStatus = "loading";
|
||||
// this.page++;
|
||||
// this.getPinTuanList().then(length => {
|
||||
// if(length == 0) {
|
||||
// this.page--;
|
||||
// this.status = 'nomore';
|
||||
// } else {
|
||||
// this.status = 'loading';
|
||||
// }
|
||||
// }).catch(() => {
|
||||
// this.loadStatus = "nomore";
|
||||
// this.page--;
|
||||
// })
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
this.swiperHeight = res.windowHeight - (88 / 2) + 'px';
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -117,7 +117,6 @@ export default {
|
||||
}).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.getUserInfo();
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -32,10 +32,10 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.concerns {
|
||||
// padding: 35rpx 30rpx 0;
|
||||
// .u-index-anchor {
|
||||
// background-color: #ffffff !important;
|
||||
// }
|
||||
padding: 35rpx 30rpx 0;
|
||||
.u-index-anchor {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
.list-cell {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
@ -43,7 +43,6 @@ export default {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin: 50rpx 0;
|
||||
padding: 0 30rpx;
|
||||
> image {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
|
@ -56,16 +56,16 @@ export default {
|
||||
},
|
||||
addOrderEvaluate() {
|
||||
if(!this.verifyParams()) return false;
|
||||
// console.log(this.logistics);
|
||||
// console.log(this.service);
|
||||
// console.log(this.describe);
|
||||
console.log(this.logistics);
|
||||
console.log(this.service);
|
||||
console.log(this.describe);
|
||||
this.$u.api.updateOrderEvaluate({
|
||||
id: this.orderId,
|
||||
content: this.content,
|
||||
scores_one: this.logistics,
|
||||
scores_two: this.service,
|
||||
scores_three: this.describe,
|
||||
file: '', // 只传文件名
|
||||
file: '',
|
||||
}).then(res => {
|
||||
|
||||
})
|
||||
|
@ -71,7 +71,7 @@
|
||||
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
||||
<view class="cancel" v-if="state == '6'" @click="cancelOrder">取消支付</view>
|
||||
<view class="payment" v-if="state == '6'" @click="payNow">立即支付</view>
|
||||
<view class="payment" v-if="state == '6'">立即支付</view>
|
||||
<view class="service" v-if="state == '7'">联系官方客服</view>
|
||||
<view class="submit" v-if="state == '7'">提交官方审核</view>
|
||||
</view>
|
||||
@ -186,12 +186,6 @@ export default {
|
||||
title: title
|
||||
});
|
||||
},
|
||||
payNow() {
|
||||
this.$u.route('/pageC/cart/cashier', {
|
||||
pay_sn: this.orderInfo.pay_sn,
|
||||
price: this.orderInfo.order_amount,
|
||||
});
|
||||
},
|
||||
toOtherPage(url) {
|
||||
this.$u.route('/pageE/order/' + url, {
|
||||
oid: this.orderInfo.order_id,
|
||||
|
62
pages.json
62
pages.json
@ -113,69 +113,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "comment/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品评价",
|
||||
"app-plus":{
|
||||
"titleNView":{
|
||||
"backgroundColor":"#ffffff"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "search/index",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"titleColor": "#333333",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"buttons": [
|
||||
{
|
||||
"type":"none",
|
||||
"text":"搜索",
|
||||
"float":"right",
|
||||
"fontSize":"16",
|
||||
"color": "#FF780F"
|
||||
}
|
||||
],
|
||||
"searchInput": {
|
||||
"align": "left",
|
||||
"borderRadius": "15px",
|
||||
"placeholder": "搜索您需要的商品",
|
||||
"backgroundColor": "rgb(236,236,236)",
|
||||
"disabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "search/out",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"titleColor": "#333333",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"buttons": [
|
||||
{
|
||||
"type":"none",
|
||||
"text":"搜索",
|
||||
"float":"right",
|
||||
"fontSize":"16",
|
||||
"color": "#FF780F"
|
||||
}
|
||||
],
|
||||
"searchInput": {
|
||||
"align": "left",
|
||||
"borderRadius": "15px",
|
||||
"placeholder": "搜索您需要的商品",
|
||||
"backgroundColor": "rgb(236,236,236)",
|
||||
"disabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -216,6 +167,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path": "cart/index",
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view class="shop" scroll-y @scrolltolower="onreachBottom">
|
||||
<view class="shop">
|
||||
<view class="top">
|
||||
<image src="/static/image/shop/1.png" class="local"></image>
|
||||
<view class="add" @click="chooseArea=true">
|
||||
@ -7,13 +7,11 @@
|
||||
<image src="/static/image/shop/2.png"></image>
|
||||
</view>
|
||||
<view @click="sousuo">
|
||||
<u-search placeholder="" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999" :disabled="true"></u-search>
|
||||
<u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999" :disabled="true"></u-search>
|
||||
</view>
|
||||
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
|
||||
</view>
|
||||
<view class="swiper-image">
|
||||
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
|
||||
</view>
|
||||
<view class="chengnuo">
|
||||
<view>
|
||||
<image src="/static/image/shop/4.png"></image>
|
||||
@ -35,31 +33,37 @@
|
||||
<view class="fenlei">
|
||||
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
|
||||
</view>
|
||||
<view class="hr" style="margin-top:80rpx"></view>
|
||||
<!-- 秒杀 -->
|
||||
<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>
|
||||
<view v-if="spikeList.length" class="hr" style="margin-top:40rpx"></view>
|
||||
<!-- 拼团推荐 -->
|
||||
<pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan>
|
||||
<view class="hr" style="margin-top:40rpx" v-if="JSON.stringify(pinTuanPush) != '{}'"></view>
|
||||
<!-- 拼团列表 -->
|
||||
<group></group>
|
||||
<group :groupList="pinTuanList" :classifyList="couponGroupList"></group>
|
||||
<image class="lingquan"></image>
|
||||
<youhq></youhq>
|
||||
<list ref="recommendGoods"></list>
|
||||
<view class="hr" style="margin-top:40rpx"></view>
|
||||
<list v-if="couponGroupList.length" :classifyList="couponGroupList"></list>
|
||||
<view class="cart" @click="toCartPage">
|
||||
<image src="/static/image/common/3.png"></image>
|
||||
</view>
|
||||
<u-picker mode="region" :params="areaParams" v-model="chooseArea" @confirm="setArea"></u-picker>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import shopitem from "@/components/shop/shop-item/index";
|
||||
import recommend from "@/components/shop/recommend/index";
|
||||
import pintuan from "@/components/shop/recommend/pintuan";
|
||||
import seckill from "@/components/shop/seckill/index";
|
||||
import group from "@/components/shop/group/index";
|
||||
import youhq from "@/components/shop/youhq/index";
|
||||
import list from "@/components/shop/list/index";
|
||||
import shopitem from "@/components/shop/shop-item/index"
|
||||
import recommend from "@/components/shop/recommend/index"
|
||||
import pintuan from "@/components/shop/recommend/pintuan"
|
||||
import seckill from "@/components/shop/seckill/index"
|
||||
import group from "@/components/shop/group/index"
|
||||
import youhq from "@/components/shop/youhq/index"
|
||||
import list from "../../components/shop/list/index"
|
||||
|
||||
export default {
|
||||
name:"shop",
|
||||
components:{
|
||||
@ -83,11 +87,12 @@ export default {
|
||||
keyword:"",
|
||||
list:[],
|
||||
goodsClassify: [], // 商品分类
|
||||
// classifyList: [],
|
||||
classifyList: [],
|
||||
recommendedSpike: {}, // 秒杀推荐
|
||||
spikeList: [], // 全部秒杀列表
|
||||
seckillTime: {}, // 秒杀时间
|
||||
// couponGroupList: [], // 优惠券拼团分类
|
||||
couponGroupList: [], // 优惠券拼团分类
|
||||
pinTuanList: [], // 拼团商品
|
||||
pinTuanPush: {}, // 拼团推荐
|
||||
}
|
||||
},
|
||||
@ -97,6 +102,7 @@ export default {
|
||||
onShow() {
|
||||
this.getRecommendedSpike();
|
||||
this.getSpikeList();
|
||||
this.getGoodsClass();
|
||||
this.getPinTuanPush();
|
||||
},
|
||||
methods: {
|
||||
@ -136,6 +142,15 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取优惠券拼团分类
|
||||
getGoodsClass() {
|
||||
this.$u.api.getGoodsClass().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponGroupList = res.data;
|
||||
this.getPinTuanList(this.couponGroupList[0].gc_id);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 全部秒杀
|
||||
getSpikeList() {
|
||||
this.$u.api.getSpikeList({ page: 0 }).then(res => {
|
||||
@ -148,13 +163,19 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拼团列表
|
||||
getPinTuanList(id) {
|
||||
this.$u.api.getPinTuanList({
|
||||
page: 0,
|
||||
gc_id: id,
|
||||
}).then(res => {
|
||||
this.pinTuanList = res.data;
|
||||
})
|
||||
},
|
||||
clickImage(index) {
|
||||
console.log(index);
|
||||
console.log(this.list[index]);
|
||||
},
|
||||
// 下拉加载更多推荐商品
|
||||
onreachBottom() {
|
||||
this.$refs.recommendGoods.loadMore();
|
||||
|
||||
},
|
||||
setArea(e) {
|
||||
// console.log(e);
|
||||
@ -175,12 +196,8 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.shop{
|
||||
height: calc(100vh - var(--window-top));
|
||||
box-sizing: border-box;
|
||||
background-color: #F0EDF1;
|
||||
padding: 0 33rpx;
|
||||
.top{
|
||||
padding: 0 30rpx;
|
||||
background-color: #ffffff;
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
@ -190,10 +207,6 @@ export default {
|
||||
height: 37rpx;
|
||||
}
|
||||
}
|
||||
.swiper-image {
|
||||
background-color: #ffffff;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.add{
|
||||
width: 115rpx;
|
||||
height: 25rpx;
|
||||
@ -213,17 +226,15 @@ export default {
|
||||
}
|
||||
}
|
||||
.mnue{
|
||||
background-color: #ffffff;
|
||||
width: 35rpx;
|
||||
height: 26rpx;
|
||||
margin-left: 36rpx;
|
||||
}
|
||||
.chengnuo{
|
||||
padding: 30rpx;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 24rpx;
|
||||
>view{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -239,11 +250,10 @@ export default {
|
||||
}
|
||||
}
|
||||
.fenlei{
|
||||
padding: 30rpx;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
// justify-content: space-between;
|
||||
margin-top: 30rpx;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 20rpx;
|
||||
> view {
|
||||
margin-bottom: 30rpx;
|
||||
&:not(:nth-child(5n)) {
|
||||
@ -251,6 +261,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.hr{
|
||||
width: 750rpx;
|
||||
margin-left: -33rpx;
|
||||
height: 20rpx;
|
||||
background-color: #ececec;
|
||||
}
|
||||
.lingquan{
|
||||
width: 750rpx;
|
||||
height: 177rpx;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB |
@ -43,29 +43,5 @@ const common = {
|
||||
});
|
||||
return promise;
|
||||
},
|
||||
/**
|
||||
* 将 php 时间戳转化为时分秒
|
||||
* @param { String } timestamp php 时间戳
|
||||
* @param { String } format 间隔符 默认 '26:14:25'
|
||||
* @return { String } 格式化时间
|
||||
*/
|
||||
getLineTime({ timestamp, format } = {}) {
|
||||
const days = Math.floor(timestamp / (24 * 3600 * 1000));
|
||||
//计算出小时数
|
||||
const leave1 = timestamp % (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;
|
||||
let result;
|
||||
if(format) result = hours + format + minutes + format + seconds;
|
||||
else result = hours + ':' + minutes + ':' + seconds;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
export default common
|
Loading…
x
Reference in New Issue
Block a user