|
@@ -58,7 +58,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="common-view-css bgc-f" style="overflow: hidden;">
|
|
<view class="common-view-css bgc-f" style="overflow: hidden;">
|
|
|
- <Menu style="height: 100%;" v-if="shopType === 1" :shop_id="shop_id"></Menu>
|
|
|
|
|
|
|
+ <Menu style="height: 100%;" v-if="shopType === 1" :shop_id="shop_id" @setCartData="setCartData" ref="goodsMenu"></Menu>
|
|
|
<Evaluate style="height: 100%;" :shopId='shop_id' :shopScore='shopsInfo.shop_score' v-else-if="shopType === 2"></Evaluate>
|
|
<Evaluate style="height: 100%;" :shopId='shop_id' :shopScore='shopsInfo.shop_score' v-else-if="shopType === 2"></Evaluate>
|
|
|
<ShopInfo style="height: 100%;" :shopId='shop_id' v-else-if="shopType === 3"></ShopInfo>
|
|
<ShopInfo style="height: 100%;" :shopId='shop_id' v-else-if="shopType === 3"></ShopInfo>
|
|
|
</view>
|
|
</view>
|
|
@@ -66,17 +66,17 @@
|
|
|
<view class="shop-buttom-money box-border-box" @click="openBuyCrad()">
|
|
<view class="shop-buttom-money box-border-box" @click="openBuyCrad()">
|
|
|
<view class="shop-buttom-money-1 flex-justify-space align-items-center">
|
|
<view class="shop-buttom-money-1 flex-justify-space align-items-center">
|
|
|
<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
|
|
<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
|
|
|
- <view class="shop-buttom-num fs-24 fc-f text-align-center">3</view>
|
|
|
|
|
- <view class="">
|
|
|
|
|
- <view class="">
|
|
|
|
|
- <span class="fw-600 fs-24 fc-f">¥</span>
|
|
|
|
|
- <span class="fw-600 fs-44 fc-f">19.26</span>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- <view class="fs-24 fc-ADADAD">免配送</view> -->
|
|
|
|
|
- <view class="fs-24 fc-ff3939">配送费¥10</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="fs-32 fw-600 fc-f mr-30">20元起送</view>
|
|
|
|
|
- <!-- <view class="shop-buttom-money-2 text-align-center fc-f fs-32 fw-600">去结算</view> -->
|
|
|
|
|
|
|
+ <view class="shop-buttom-num fs-24 fc-f text-align-center">{{cartData.total_num}}</view>
|
|
|
|
|
+ <view class="" v-if="cartData.is_place_order===1">
|
|
|
|
|
+ <view class="">
|
|
|
|
|
+ <span class="fw-600 fs-24 fc-f">¥</span>
|
|
|
|
|
+ <span class="fw-600 fs-44 fc-f">{{cartData.total_price}}</span>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="fs-24 fc-ADADAD" v-if="delivery_money<=0">免配送</view>
|
|
|
|
|
+ <view class="fs-24 fc-ff3939" v-else>配送费¥{{delivery_money}}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="fs-32 fw-600 fc-f mr-30" v-else>{{cartData.err_msg}}</view>
|
|
|
|
|
+ <view class="shop-buttom-money-2 text-align-center fc-f fs-32 fw-600">去结算</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -85,7 +85,7 @@
|
|
|
<view class="buy-card-top box-border-box plr-32 flex-justify-space align-items-center">
|
|
<view class="buy-card-top box-border-box plr-32 flex-justify-space align-items-center">
|
|
|
<view class="">
|
|
<view class="">
|
|
|
<span class="fs-32 fc-3 mr-12">已选商品</span>
|
|
<span class="fs-32 fc-3 mr-12">已选商品</span>
|
|
|
- <span class="fs-32 fc-9">(打包费<span class="fs-32 fc-FB3D03">8元</span>)</span>
|
|
|
|
|
|
|
+ <span class="fs-32 fc-9">(打包费<span class="fs-32 fc-FB3D03">{{cartData.pack_price}}元</span>)</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="fs-28 fw-400 fc-9 align-items-center">
|
|
<view class="fs-28 fw-400 fc-9 align-items-center">
|
|
|
<view class="">
|
|
<view class="">
|
|
@@ -95,41 +95,42 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="scroll-view-css box-border-box p-32">
|
|
<view class="scroll-view-css box-border-box p-32">
|
|
|
- <view class="buy-card-item display-flex" v-for="(item,i) in 5" :key="i">
|
|
|
|
|
- <image src="@/static/img/my/bg.png" mode="scaleToFill"></image>
|
|
|
|
|
|
|
+ <view class="buy-card-item display-flex" v-for="(goods,i) in cartData.goods_list" :key="i">
|
|
|
|
|
+ <image :src="goods.goods_image" mode="scaleToFill"></image>
|
|
|
<view class="flex-1">
|
|
<view class="flex-1">
|
|
|
<view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-12">
|
|
<view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-12">
|
|
|
- [畅销款]奥尔1良烤肉牛油拌饭拌饭[畅销款]奥尔1良烤肉牛油拌饭拌饭</view>
|
|
|
|
|
- <view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">不辣,加辣</view>
|
|
|
|
|
|
|
+ {{goods.goods_name}}</view>
|
|
|
|
|
+ <view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">{{goods.goods_attr}}</view>
|
|
|
|
|
|
|
|
<view class="flex-justify-space">
|
|
<view class="flex-justify-space">
|
|
|
<view class="">
|
|
<view class="">
|
|
|
<span class="fs-24 fc-FB3D03 fw-400">¥</span>
|
|
<span class="fs-24 fc-FB3D03 fw-400">¥</span>
|
|
|
- <span class="fs-40 fc-FB3D03 fw-b">3.99</span>
|
|
|
|
|
|
|
+ <span class="fs-40 fc-FB3D03 fw-b">{{goods.price}}</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="display-flex align-items-center">
|
|
<view class="display-flex align-items-center">
|
|
|
- <view class="right-only-right-red fw-500 text-align-center fs-36 fc-f">-</view>
|
|
|
|
|
- <view class="right-only-right-2 text-align-center fs-28 fw-400">1</view>
|
|
|
|
|
- <view class="right-only-right-add fw-500 text-align-center fs-36 fc-f">+</view>
|
|
|
|
|
|
|
+ <view class="right-only-right-red fw-500 text-align-center fs-36 fc-f" @click.stop="setShopIngNumber(goods,2)">-</view>
|
|
|
|
|
+ <view class="right-only-right-2 text-align-center fs-28 fw-400">{{goods.goods_number}}</view>
|
|
|
|
|
+ <view class="right-only-right-add fw-500 text-align-center fs-36 fc-f" @click.stop="setShopIngNumber(goods,1)">+</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <en-blank v-if="cartData.goods_list.length<=0" message="快去选购商品吧!~"></en-blank>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="shop-buttom-money box-border-box" @click="createOrder()">
|
|
<view class="shop-buttom-money box-border-box" @click="createOrder()">
|
|
|
<view class="shop-buttom-money-1 flex-justify-space align-items-center">
|
|
<view class="shop-buttom-money-1 flex-justify-space align-items-center">
|
|
|
<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
|
|
<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
|
|
|
- <view class="shop-buttom-num fs-24 fc-f text-align-center">3</view>
|
|
|
|
|
- <view class="">
|
|
|
|
|
|
|
+ <view class="shop-buttom-num fs-24 fc-f text-align-center">{{cartData.total_num}}</view>
|
|
|
|
|
+ <view class="" v-if="cartData.is_place_order===1">
|
|
|
<view class="">
|
|
<view class="">
|
|
|
<span class="fw-600 fs-24 fc-f">¥</span>
|
|
<span class="fw-600 fs-24 fc-f">¥</span>
|
|
|
- <span class="fw-600 fs-44 fc-f">19.26</span>
|
|
|
|
|
|
|
+ <span class="fw-600 fs-44 fc-f">{{cartData.total_price}}</span>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="fs-24 fc-ADADAD">免配送</view> -->
|
|
|
|
|
- <view class="fs-24 fc-ff3939">配送费¥10</view>
|
|
|
|
|
|
|
+ <view class="fs-24 fc-ADADAD" v-if="delivery_money<=0">免配送</view>
|
|
|
|
|
+ <view class="fs-24 fc-ff3939" v-else>配送费¥{{delivery_money}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="fs-32 fw-600 fc-f mr-30">20元起送</view> -->
|
|
|
|
|
|
|
+ <view class="fs-32 fw-600 fc-f mr-30" v-else>{{cartData.err_msg}}</view>
|
|
|
<view class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600" @click="toConfirmOrder()">
|
|
<view class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600" @click="toConfirmOrder()">
|
|
|
去结算</view>
|
|
去结算</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -197,6 +198,8 @@
|
|
|
shopInfo,
|
|
shopInfo,
|
|
|
shopCoupon
|
|
shopCoupon
|
|
|
} from "@/api/shop.js"
|
|
} from "@/api/shop.js"
|
|
|
|
|
+ import {getDeliveryMoney} from "@/api/common";
|
|
|
|
|
+ import {getShopIngList, setShopIngNumber} from "@/api/shopping";
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
Menu,
|
|
Menu,
|
|
@@ -225,6 +228,18 @@
|
|
|
couponData: [], // 可领优惠卷
|
|
couponData: [], // 可领优惠卷
|
|
|
goodsData: [], // 可领优惠卷
|
|
goodsData: [], // 可领优惠卷
|
|
|
categoryData: [], // 可领优惠卷
|
|
categoryData: [], // 可领优惠卷
|
|
|
|
|
+ delivery_money: 0, // 可领优惠卷
|
|
|
|
|
+ cartData: {
|
|
|
|
|
+ total_price:0,
|
|
|
|
|
+ total_num:0,
|
|
|
|
|
+ total_goods_money:0,
|
|
|
|
|
+ pack_price:0,
|
|
|
|
|
+ must_category:0,
|
|
|
|
|
+ is_place_order:0,
|
|
|
|
|
+ err_msg:0,
|
|
|
|
|
+ goods_list:[],
|
|
|
|
|
+ },
|
|
|
|
|
+ isAjax:false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
@@ -239,6 +254,51 @@
|
|
|
this.shopCoupon()
|
|
this.shopCoupon()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ setShopIngNumber(item,type){
|
|
|
|
|
+ if(this.isAjax){
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.isAjax=true
|
|
|
|
|
+ setShopIngNumber({
|
|
|
|
|
+ 'type':1,
|
|
|
|
|
+ 'goods_id':item.goods_id,
|
|
|
|
|
+ 'shop_id':this.shop_id,
|
|
|
|
|
+ 'category_id':item.category_id,
|
|
|
|
|
+ 'goods_spec_id':item.goods_spec_id,
|
|
|
|
|
+ 'operation':type===1?1:2,
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ this.isAjax=false
|
|
|
|
|
+ this.getShopIngList()
|
|
|
|
|
+ }).catch(()=>{
|
|
|
|
|
+ this.isAjax=false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getShopIngList(){
|
|
|
|
|
+ getShopIngList({
|
|
|
|
|
+ 'shop_id':this.shop_id,
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ if(res.code===1){
|
|
|
|
|
+ this.cartData=res.data
|
|
|
|
|
+ if(this.shopType===1){
|
|
|
|
|
+ this.$refs.goodsMenu.setShopIngList( this.cartData)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ setCartData(cartData){
|
|
|
|
|
+ this.cartData=cartData
|
|
|
|
|
+ this.getDeliveryMoney()
|
|
|
|
|
+ },
|
|
|
|
|
+ getDeliveryMoney(){
|
|
|
|
|
+ getDeliveryMoney({
|
|
|
|
|
+ 'school_id':this.operate_id,
|
|
|
|
|
+ 'shop_id':this.shop_id,
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ if(res.code===1){
|
|
|
|
|
+ this.delivery_money=res.data.delivery_money*1
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
receiveCode(item) {
|
|
receiveCode(item) {
|
|
|
receiveCoupon({grant_id: item.grant_id,coupon_id: item.coupon_id}).then((res) => {
|
|
receiveCoupon({grant_id: item.grant_id,coupon_id: item.coupon_id}).then((res) => {
|
|
|
if(res.code == 1) {
|
|
if(res.code == 1) {
|