Commit b02f838f authored by liumiss's avatar liumiss

7

parent e3afe2da
......@@ -55,6 +55,11 @@ export const allCategoryAndGoods = (shop_id) => request('/shop/goods/shop', { sh
// 商品相关-获取商品列表(查询)
export const search = param => request('shop/goods/index', param, 'get');
// 满减
export const fullReduction = (shop_id) => request('shop/member/discount/rule', {shop_id}, 'get');
/******* 订单相关 ******/
......@@ -95,6 +100,7 @@ export const getCoupons = (page, perPage) => request('coupons/self', {
}, 'get');
/******* 支付相关 ******/
export const weChatConfig = (url, js_api_list) => request('wechat/jsticket', {
......
......@@ -16,6 +16,9 @@
.text-light-primary{
color:$color-light-blue
}
.text-dark-grey{
color:#323232;
}
.text-light-grey{
color:$color-light-grey
}
......
......@@ -17,12 +17,27 @@
</div>
</li>
</ul>
<van-cell :value="'¥'+delivery_fee || 0">
<div slot="title" class="tags">
<van-tag color="#ecf0f3" size="10">配送费</van-tag>
</div>
</van-cell>
</div>
</template>
<script>
export default {
props: ["shopInfo", "goods_list"]
props: {
delivery_fee: {
default: 0
},
shopInfo: {
default: {}
},
goods_list: {
default: []
}
}
};
</script>
......@@ -36,10 +51,10 @@ export default {
header {
position: relative;
padding: 15px;
span{
span {
scw($fontsize-large, #3e3e3e, 600);
}
}
.van-cell {
......@@ -60,5 +75,10 @@ export default {
}
}
}
.van-tag {
color: #abb6bc;
border: 1px solid #d2d3d8;
}
}
</style>
\ No newline at end of file
......@@ -157,12 +157,12 @@ export default {
if (this.$route.name == "confirmOrder") {
this.$router.replace({
name: "orderDetails",
params: { id: this.order_no }
params: { order_no: this.order_no }
});
} else {
this.$router.push({
name: "orderDetails",
params: { id: this.order_no }
params: { order_no: this.order_no }
});
}
}, 1000);
......@@ -173,7 +173,7 @@ export default {
this.$emit("click");
this.$router.push({
name: "orderDetails",
params: { id: this.order_no }
params: { order_no: this.order_no }
});
},
// 检测当前运行环境
......
......@@ -29,10 +29,6 @@ export default {
visible: true
};
},
created() {
console.log(this.isFoodTab)
},
props: {
fullReduction: {
default() {
......@@ -71,14 +67,14 @@ export default {
shopId: {
type: String
},
// 是否添加transition 动画效果
isFoodTab: {
// type: Boolean,
default: 0
type: Boolean,
}
},
computed: {
fadeClass() {
return this.isFood==0 ? "fade" : "";
return this.isFoodTab? "fade" : "";
}
},
methods: {
......@@ -107,6 +103,6 @@ export default {
}
.fade-enter-active, .fade-leave-active {
transition: all 0.5s ease-in-out;
transition: all 0.28s ease-in-out;
}
</style>
......@@ -2,8 +2,8 @@
<div>
<section class="van-submit-bar">
<div v-show="totalCount>0&&tip!==''&&listFold" class="van-submit-bar__tip">{{tip}}</div>
<section class="van-submit-bar__bar" @click="toggleList">
<div style="flex:1">
<section class="van-submit-bar__bar">
<div style="flex:1" @click="toggleList">
<div
class="cart_icon_container"
:class="{cart_icon_activity: totalPrice > 0}"
......@@ -152,6 +152,9 @@ export default {
});
if (total == 0) return;
// 没有满减规则
if(!this.fullReduction.length)return '';
let r = this.fullReduction[0],
c = parseInt(r.condition), // 满减条件
a = parseInt(r.amount); // 满减金额
......@@ -343,8 +346,14 @@ export default {
left: 2%;
wh(56px, 56px);
&.cart_icon_activity .van-icon {
color: #1296fa !important;
&.cart_icon_activity {
.icon-box {
background: #3190e8;
}
.van-icon {
color: #fff !important;
}
}
.icon-box {
......
......@@ -26,7 +26,6 @@ const state = {
coupon:{},
remarkText: '',//输入备注内容
/* showCart:true, // 是否展示底部导航 */
}
export default new Vuex.Store({
state,
......
......@@ -151,8 +151,4 @@ export default {
REJECT_LOGIN(state){
state.rejectLogin = true;
},
/* SHOW_CART(state,info){
state.showCart = info;
console.log(info)
} */
}
\ No newline at end of file
......@@ -23,15 +23,11 @@
</div>
<section class="section">
<confirm-foods-list :shopInfo="shopInfo" :goods_list="checkoutData.goods_list"></confirm-foods-list>
<confirm-foods-list :shopInfo="shopInfo" :delivery_fee="checkoutData.delivery_fee" :goods_list="checkoutData.goods_list"></confirm-foods-list>
</section>
<van-row class="order-box">
<van-cell :value="'¥'+checkoutData.delivery_fee || 0">
<div slot="title">
<van-tag color="#1f9af8">配送费</van-tag>
</div>
</van-cell>
<van-cell title="门店优惠">
<span class="text-danger">¥{{checkoutData.delivery_fee || 0}}</span>
</van-cell>
......@@ -60,7 +56,7 @@
:loading="btnLoading"
:price="checkoutData.price_final*100"
:tip="submitBarTip"
button-text="提交订单"
button-text="确认支付"
@submit="onSubmit"
/>
<pay :order_no="order_no" :showActionSheet="showActionSheet" @click="payAction"></pay>
......@@ -244,14 +240,18 @@ export default {
}
}
.order-box .van-cell__value {
.order-box {
.van-cell__value {
scw($fontsize-medium, #3e3e3e, 600);
}
}
.word-one .van-cell__value {
text-overflow: ellipsis;
white-space: nowrap;
}
.text-danger{
color:#f44;}
.text-danger {
color: #f44;
}
</style>
......@@ -157,7 +157,7 @@ export default {
});
},
payEvent(shop_id,order_no) {
this.$router.push({ name: "orderDetails", params: { id: order_no,shopId:shop_id } });
this.$router.push({ name: "orderDetails", params: { order_no: order_no,shopId:shop_id } });
}
}
/* watch: {
......
<template>
<div class="scroll-list-wrap">
<cube-scroll ref="scroll">
<div class="content">
<h1 class="page-title">{{order.order_status |orderStatus}}</h1>
<section class="section">
<confirm-foods-list :shopInfo="shopInfo" :goods_list="order.goods"></confirm-foods-list>
<confirm-foods-list :shopInfo="shopInfo" delivery_fee="0" :goods_list="order.goods"></confirm-foods-list>
<van-cell class="total">
<span slot="title" class="text-primary" @click="callEvent">联系商家</span>
<span>
......@@ -41,10 +42,18 @@
<van-cell title="订单备注" value="暂无"></van-cell>
</div>
</van-panel>
</div>
</cube-scroll>
<div v-if="order.order_status=='unpaid'">
<van-submit-bar
:price="order.price_final*100"
button-text="去支付"
@submit="onSubmit"
/>
<pay :order_no="order.order_no" :showActionSheet="showActionSheet" @click="payAction"></pay>
</div>
</div>
</template>
<script>
......@@ -135,10 +144,10 @@ export default {
<style lang="stylus" scoped>
@import '~common/stylus/variable.styl';
.cube-scroll-list-wrapper {
background: transparent;
}
.content{
padding-bottom:60px;
}
.page-title {
padding: 20px 10px;
}
......
......@@ -47,8 +47,12 @@
</div>
</van-row>
<div v-else-if="keyword==''&& searchHistory.length==0" class="empty_tips">
<p>暂无搜索数据</p>
<div v-else-if="searchHistory.length==0" class="empty_tips">
<h4>暂无搜索数据</h4>
</div>
<div v-else-if="result.length==0" class="empty_tips">
<h4 class="text-medium text-dark-grey">暂无搜索数据</h4>
<p>换个关键词试试</p>
</div>
</cube-scroll>
</div>
......
......@@ -4,128 +4,149 @@
<div class="detail-wrapper clear-fix">
<div class="detail-main">
<h1 class="name">{{seller.name}}</h1>
<!-- <div class="star-wrapper">
<star :size="48" :score="seller.score"></star>
</div> -->
<section v-if="seller.discount" class="supports text-extra-small">
<div class="title">
<div class="text">优惠信息</div>
</div>
<ul v-if="seller.supports" class="supports">
<li class="support-item" v-for="(item,index) in seller.supports" :key="item.id">
<!-- <support-ico :size=2 :type="seller.supports[index].type"></support-ico> -->
<span class="text">{{seller.supports[index].description}}</span>
<ul class="tags">
<li>
<van-cell>
<span slot="title">
<van-tag color="#f44" plain size="10">满减</van-tag>
</span>
<span
v-for="tag in seller.discount"
:key="tag.id"
class="text"
>满{{parseInt(tag.condition) }}减{{parseInt(tag.amount)}},&nbsp;</span>
</van-cell>
</li>
</ul>
</section>
<div v-if="seller.bulletin" class="bulletin">
<div class="title">
<div class="text">商家公告</div>
</div>
<div class="bulletin">
<p class="content">{{seller.bulletin}}</p>
</div>
</div>
</div>
<div class="detail-close" @click="hide">
<i class="icon-close"></i>
<i class="cubeic-select"></i>
</div>
</div>
</transition>
</template>
<script>
import popupMixin from '../../../../common/mixins/popup'
// import SupportIco from '../../../../components/support-ico/support-ico'
export default {
name: 'header-detail',
import popupMixin from "../../../../common/mixins/popup";
export default {
name: "header-detail",
mixins: [popupMixin],
props: {
seller: {
type: Object,
default() {
return {}
return {};
}
}
},
components: {
// SupportIco
}
}
};
</script>
<style lang="stylus" scoped>
// @import "~common/stylus/mixin"
// @import "~common/stylus/variable"
.header-detail
position: fixed
z-index: 999
top: 0
left: 0
width: 100%
height: 100%
overflow: auto
backdrop-filter: blur(2px)
opacity: 1
// color: $color-white
background: $color-white
&.fade-enter-active, &.fade-leave-active
transition: all 0.5s
&.fade-enter, &.fade-leave-active
opacity: 0
background: $color-background
.detail-wrapper
display: inline-block
width: 100%
min-height: 100%
.detail-main
margin-top: 64px
padding-bottom: 64px
.name
line-height: 16px
text-align: center
font-size: $fontsize-large
font-weight: 700
.star-wrapper
margin-top: 18px
padding: 2px 0
text-align: center
.title
display: flex
width: 80%
margin: 28px auto 24px auto
.text
padding: 0 12px
font-weight: 700
font-size: $fontsize-medium
.supports
width: 80%
margin: 0 auto
.support-item
display: flex
align-items: center
padding: 0 12px
margin-bottom: 12px
&:last-child
margin-bottom: 0
.support-ico
margin-right: 6px
.text
line-height: 16px
font-size: $fontsize-small
.bulletin
width: 80%
margin: 0 auto
.content
padding: 0 12px
line-height: 24px
font-size: $fontsize-small
.detail-close
position: relative
width: 30px
height: 30px
margin: -64px auto 0 auto
clear: both
font-size: $fontsize-large-xxxx
.van-cell {
padding: 0;
background-color: transparent;
&__title {
flex: none;
}
&__value {
text-align: left;
color: #f5f5f5;
}
}
.header-detail {
position: fixed;
z-index: 999;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: auto;
backdrop-filter: blur(10px);
opacity: 1;
color: $color-white;
background: rgba(7, 17, 27, 0.8);
&.fade-enter-active, &.fade-leave-active {
transition: all 0.5s;
}
&.fade-enter, &.fade-leave-active {
opacity: 0;
background: $color-background;
}
.detail-wrapper {
display: inline-block;
width: 100%;
min-height: 100%;
.detail-main {
margin-top: 64px;
padding-bottom: 64px;
.name {
line-height: 16px;
text-align: center;
font-size: $fontsize-large-xx;
font-weight: 700;
}
.title {
display: flex;
margin: 16px 0;
.text {
font-weight: 700;
font-size: $fontsize-medium;
}
}
.supports {
width: 83%;
margin: 0 auto;
}
.bulletin {
width: 80%;
margin: 0 auto;
.content {
padding: 0 12px;
line-height: 24px;
font-size: $fontsize-small;
}
}
}
}
.detail-close {
position: relative;
width: 40px;
height: 40px;
margin: -64px auto 0 auto;
clear: both;
font-size: 32px;
}
}
</style>
......@@ -134,16 +134,18 @@ export default {
props: {
disable: {
default: true
},
isFoodTab:{
default: false
}
},
components: { cubeShopCart, scrollNav },
created() {
this.order_no = this.$route.query.order_no;
this.initData();
},
mounted() {
// this._showShopCartSticky();
this._showShopCartSticky();
},
methods: {
async initData() {
......@@ -214,12 +216,13 @@ export default {
this.shopCartStickyComp ||
this.$createShopCartSticky({
$props: {
fullReduction:this.shopInfo.discount,
fullReduction:this.shopInfo.discount,// 满减
selectFoods: "cartFoodList",
shopId: this.shopId.toString(),
deliveryPrice: this.seller.deliveryPrice,
minPrice: this.seller.minPrice,
deliveryPrice: this.seller.deliveryPrice,// 配送费
minPrice: this.seller.minPrice,// 起送价
fold: true,
isFoodTab:true, // 控制购物导航是否显示
toggle: this.seller.toggle // 是否主动展示购物列表
}
});
......@@ -285,6 +288,15 @@ export default {
if (!value.length) {
this.showCartList = false;
}
},
// 监听tab的切换,控制底部的是否显示
isFoodTab(newVal){
console.log(newVal)
if (!newVal) {
this._hideShopCartSticky();
} else {
this._showShopCartSticky();
}
}
}
};
......
<template>
<div class="scroll-list-wrap" :class="{'view-wrapper':!pageLoading}">
<div class="scroll-list-wrap" :style="bgStyle">
<cube-loading v-if="pageLoading" :size="40"></cube-loading>
<cube-sticky
:pos="scrollY"
:check-top="checkTop"
......@@ -22,7 +21,7 @@
</h1>
<p class="text-light-grey text-extra-small">评价4.2 月售 等描述</p>
<!-- 优惠内容 -->
<div class="tags" @click="showHeaderDetail">
<div v-if="shopInfo.discount.length" class="tags" @click="showHeaderDetail">
<van-tag
v-for="tag in shopInfo.discount"
:key="tag.id"
......@@ -72,7 +71,7 @@
<script>
import { allCategoryAndGoods, getShopInfo } from "../../common/serve";
import { allCategoryAndGoods, getShopInfo,fullReduction } from "../../common/serve";
import shopTab from "./children/shop";
import evaluate from "./children/rating/index";
import shopInfo from "./children/shopInfo";
......@@ -115,18 +114,21 @@ export default {
this.initData();
},
computed: {
component() {
return "shopTab";
},
// component() {
// return "shopTab";
// },
options() {
return { click: true, bounce: false };
},
contentH() {
return document.body.clientHeight - this.tabBarH + "px";
},
opacity() {
let opacity = 0;
return (opacity = this.scrollY / 30 > 1 ? 1 : this.scrollY / 30);
// 顶部背景图片样式
bgStyle() {
return !this.pageLoading?{
background: `url(${this.$globalUrlFile+this.shopInfo.icon}) no-repeat`,
backgroundSize: '100%'
}:''
}
},
watch: {
......@@ -137,37 +139,22 @@ export default {
} else {
this.disableFn();
}
}
},
methods: {
scrollHandler({ y }) {
this.scrollY = -y;
/* if (this.scrollY >= this.headerH) {
this.disable = false;
} else {
this.disable = true;
} */
},
changeHandler(label) {
this.currentTab = label;
this.isFoodTab = label == "点餐" ? true : false;
// this.$store.commit('SHOW_CART',this.isFoodTab);
console.log("changed to:", label);
},
// 当tab吸附在顶部时,开启内部的滑动
diffChangeHandler(diff) {
if (diff && diff >= 1) {
this.disable = false;
//pageLoading变化时说明组件已经获取初始化数据,在下一帧nextTick进行后续操作
pageLoading(value) {
if (!value) {
this.$nextTick(() => {
this.tabBarH = this.$refs.tabBar.offsetHeight; // tabbar 高度
});
}
}
},
scrollTop() {
this.disable = true;
},
methods: {
async initData() {
let p1 = allCategoryAndGoods(this.shopId); // 获取分类和商品数据
let p2 = getShopInfo(this.shopId); // 获取店铺信息
Promise.all([p1, p2])
let p3 = fullReduction(this.shopId);//满减
Promise.all([p1, p2,p3])
.then(result => {
let goodsMsg = result[0];
if (goodsMsg.code == 0) {
......@@ -178,7 +165,8 @@ export default {
let shopMsg = result[1];
if (shopMsg.code == 0) {
this.shopInfo = shopMsg.data;
this.shopInfo["discount"] = [
this.shopInfo["discount"]=[]
/* this.shopInfo["discount"] = [
{
rule_id: 4,
condition: "20.00",
......@@ -189,14 +177,40 @@ export default {
condition: "30.00",
amount: "5.00"
}
];
]; */
this.$store.commit("CURRENT_SHOPINFO", shopMsg.data);
}
let fullrMsg = result[2];
if(fullrMsg.code==0){
}
this.pageLoading = false;
})
.catch(error => {});
},
scrollHandler({ y }) {
this.scrollY = -y;
/* if (this.scrollY >= this.headerH) {
this.disable = false;
} else {
this.disable = true;
} */
},
scrollTop() {
this.disable = true;
},
changeHandler(label) {
this.currentTab = label;
this.isFoodTab = label == "点餐" ? true : false;
},
// 当tab吸附在顶部时,开启内部的滑动
diffChangeHandler(diff) {
if (diff && diff >= 1) {
this.disable = false;
}
},
enableFn() {
this.$refs.scroll.enable();
},
......@@ -205,34 +219,20 @@ export default {
},
showHeaderDetail() {
/* this.headerDetailComp =
this.headerDetailComp =
this.headerDetailComp ||
this.$createHeaderDetail({
$props: {
seller: "shopInfo"
}
});
this.headerDetailComp.show(); */
}
},
//pageLoading变化时说明组件已经获取初始化数据,在下一帧nextTick进行后续操作
pageLoading: function(value) {
if (!value) {
this.$nextTick(() => {
// this.headerH = this.$refs.header.offsetHeight; // 包含tabbar 在内的头部高度
this.tabBarH = this.$refs.tabBar.offsetHeight; // tabbar 高度
});
this.headerDetailComp.show();
}
}
};
</script>
<style lang="stylus">
.view-wrapper {
background: url('https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3340225592,2502432116&fm=26&gp=0.jpg') no-repeat; // ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3340225592,2502432116&fm=26&gp=0.jpg) no-repeat;
background-size: 100%;
}
.page-hd {
position: relative;
padding-top: 100px;
......@@ -287,7 +287,6 @@ export default {
&-slider {
width: 0px !important;
// transform: translateX(0px) translateZ(0px);
}
.cube-tab {
......@@ -308,30 +307,4 @@ export default {
.cube-tab-panel {
background-color: #f8f8f8;
}
/* .sticky-header {
z-index: 999;
.icons-box {
position: fixed;
left: 0;
text-align: right;
padding: 10px 10px 0;
right: 0;
z-index: -1;
.van-icon {
color: $color-white;
}
}
.van-search {
// opacity: 0;
z-index: 99;
&__content {
flex: auto;
}
}
} */
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment