|
@@ -1,17 +1,7 @@
|
|
|
<template>
|
|
|
<view class="pages">
|
|
|
<!-- head -->
|
|
|
- <view class="scrollPage-header">
|
|
|
- <view :style="{height:statusBarHeight+'px'}"></view>
|
|
|
- <view class="header-title">
|
|
|
- <view class="header-left" @click="goBack">
|
|
|
- <image style="width: 16px; height: 16px;margin-right:3px;" mode="aspectFit" src="../static/arrow-left.png"></image>
|
|
|
- <text>返回</text>
|
|
|
- </view>
|
|
|
- <view class="header-title"><text class="ellipsis-one" overflow="ellipsis">购物车</text></view>
|
|
|
- <view class="header-right"></view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <sklineHeader title="购物车"></sklineHeader>
|
|
|
<view class="cart-body">
|
|
|
<!-- 内容 -->
|
|
|
<scroll-view
|
|
@@ -41,7 +31,7 @@
|
|
|
</productItem>
|
|
|
<!-- loading -->
|
|
|
<view class="loading-bar" v-if="total>0 && status!='loading'">{{noDataText}}</view>
|
|
|
- <view class="empty-bar" v-if="total==0 && status!='loading'">
|
|
|
+ <view class="empty-bar" v-if="total==0 && status!='loading'" @click="goBack">
|
|
|
<image mode="aspectFit" :src="empty.imgUrl"></image>
|
|
|
<view>{{empty.tip}}</view>
|
|
|
</view>
|
|
@@ -67,7 +57,7 @@
|
|
|
<text>合计:</text>
|
|
|
</view>
|
|
|
<view class="cart-footer-left-price-num">
|
|
|
- ¥<text>{{Number(totalAmount).toFixed(2)}}</text>
|
|
|
+ ¥<text>{{Number(totalAmount).toFixed(2).toString().split('.')[0]}}</text>.{{Number(totalAmount).toFixed(2).toString().split('.')[1]}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex align_center">
|
|
@@ -96,11 +86,13 @@
|
|
|
mapMutations,
|
|
|
} from 'vuex'
|
|
|
import productItem from '@/pagesB/cart/productitem.vue'
|
|
|
+ import sklineHeader from '../../components/skline/sklineHeader.vue'
|
|
|
import { getCartList, updateCart, deleteCart } from '@/api/cart.js'
|
|
|
import { purchaseSave, purchaseCheck } from '@/api/purchase.js'
|
|
|
export default {
|
|
|
components:{
|
|
|
- productItem
|
|
|
+ productItem,
|
|
|
+ sklineHeader
|
|
|
},
|
|
|
onLoad() {
|
|
|
// 计算区域高度
|
|
@@ -117,8 +109,8 @@
|
|
|
status: 'loading',
|
|
|
noDataText: '暂无产品',
|
|
|
empty: {
|
|
|
- tip: '暂无产品',
|
|
|
- imgUrl: '/static/nodata.png'
|
|
|
+ tip: '购物车空空的,去挑选商品吧',
|
|
|
+ imgUrl: '/static/kongCart.png'
|
|
|
},
|
|
|
// 查询条件
|
|
|
pageNo: 1,
|
|
@@ -533,35 +525,6 @@
|
|
|
height: 100vh;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- .scrollPage-header{
|
|
|
- z-index: 1;
|
|
|
- .header-title{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 0 10px;
|
|
|
- height: 44px;
|
|
|
- background-color: #FFFFFF;
|
|
|
- box-shadow: 0px 1px 0px 0px #E6E6E6;
|
|
|
- .header-title{
|
|
|
- font-size: 16px;
|
|
|
- color: #333333;
|
|
|
- max-width: 70%;
|
|
|
- }
|
|
|
- .header-left{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- text{
|
|
|
- font-size: 14px;
|
|
|
- color: #333333;
|
|
|
- margin-left: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
- .header-right{
|
|
|
- width: 50px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
.cart-body{
|
|
|
position: relative;
|
|
|
flex-grow: 1;
|
|
@@ -616,6 +579,7 @@
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
padding: 20px 0;
|
|
|
+ margin-top: 20vh;
|
|
|
image{
|
|
|
width: 100px;
|
|
|
height: 100px;
|