lilei 8 mēneši atpakaļ
vecāks
revīzija
e10aae1f30

+ 18 - 8
components/skline/sklineHeader.vue

@@ -1,12 +1,12 @@
 <template>
 	<view class="scrollPage-header">
 		<view :style="{height:statusBarHeight+'px'}"></view>
-		<view class="header-title">
+		<view class="header-title-box">
 			<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>
+				<uni-icons type="arrowleft" size="16"></uni-icons>
+				<text>{{isShare?'首页':'返回'}}</text>
 			</view>
-			<view class="header-title"><text class="ellipsis-one" overflow="ellipsis">{{title}}</text></view>
+			<view class="header-title"><text :max-lines="1" overflow="ellipsis">{{title}}</text></view>
 			<view class="header-right">
 			</view>
 		</view>
@@ -21,6 +21,10 @@
 				type: String,
 				default: '标题'
 			},
+			isShare: {
+				type: Boolean,
+				default: false
+			}
 		},
 		data() {
 			return {
@@ -32,7 +36,13 @@
 		},
 		methods: {
 			goBack() {
-				uni.navigateBack();
+				if(this.isShare){
+					uni.reLaunch({
+						url: '/pages/index/index'
+					})
+				}else{
+					uni.navigateBack()
+				}
 			},
 		}
 	}
@@ -41,14 +51,14 @@
 <style lang="less">
 	.scrollPage-header{
 		z-index: 1;
-		.header-title{
+		.header-title-box{
 			display: flex;
 			align-items: center;
 			justify-content: space-between;
 			padding: 0 10px;
 			height: 44px;
 			background-color: #FFFFFF;
-			box-shadow: 0px 1px 0px 0px #E6E6E6;
+			border-bottom: 1px solid #e8e8e8;
 			.header-title{
 				font-size: 16px;
 				color: #333333;
@@ -60,7 +70,7 @@
 				text{
 					font-size: 14px;
 					color: #333333;
-					margin-left: 5px;
+					margin-left: 2px;
 				}
 			}
 			.header-right{

+ 9 - 45
pagesB/cart/index.vue

@@ -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;

+ 3 - 40
pagesB/promoProduct.vue

@@ -1,17 +1,7 @@
 <template>
 	<view class="scrollPage">
 		<!-- 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 :max-lines="1" overflow="ellipsis">{{title}}</text></view>
-				<view class="header-right"></view>
-			</view>
-		</view>
+		<sklineHeader :title="title"></sklineHeader>
 		<!-- body -->
 		<scroll-view 
 		class="scrollPage-body" 
@@ -53,9 +43,11 @@
 	} from 'vuex'
 	import { queryPromoProductByPage } from '@/api/video.js'
 	import productItem from '@/pagesB/components/productItemSkline.vue'
+	import sklineHeader from '@/components/skline/sklineHeader.vue'
 	export default {
 		components:{
 			productItem,
+			sklineHeader
 		},
 		data() {
 			return {
@@ -205,35 +197,6 @@
 			margin-top: 10px;
 		}
 	}
-	.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;
-			}
-		}
-	}
 	.scrollPage-body{
 		height: 100%;
 		.search-head{

+ 1 - 1
pagesB/shopiing/productDetail.vue

@@ -5,7 +5,7 @@
 			<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>
+					<uni-icons type="arrowleft" size="16"></uni-icons>
 					<text>{{isShare?'首页':'返回'}}</text>
 				</view>
 				<view class="header-right"></view>

+ 5 - 42
pagesB/shopiing/searchProduct.vue

@@ -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">{{title}}</text></view>
-				<view class="header-right"></view>
-			</view>
-		</view>
+		<sklineHeader :title="title"></sklineHeader>
 		<!-- body -->
 		<scroll-view 
 		class="scrollPage-body" 
@@ -69,11 +59,13 @@
 	    mapState,
 	    mapMutations,
 	} from 'vuex'
+	import sklineHeader from '@/components/skline/sklineHeader.vue'
 	import chooseProductItem from '@/pagesB/components/chooseProductItemSkline.vue'
 	import { getShopProductList } from '@/api/shop.js'
 	export default {
 		components:{
-			chooseProductItem
+			chooseProductItem,
+			sklineHeader
 		},
 		data() {
 			return {
@@ -121,7 +113,7 @@
 			this.clzId = opts.clzId
 			// 搜索商品
 			if(opts.clzId==''){
-				this.title = '商城商品搜索'
+				this.title = '商品搜索'
 				this.focus = true
 			} 
 			// 搜索历史
@@ -278,35 +270,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;
-			}
-		}
-	}
 	.scrollPage-body{
 		width:100%;
 		.uni-searchbar{

+ 22 - 17
pagesB/shopiing/shopProduct.vue

@@ -3,16 +3,18 @@
 		<!-- head -->
 		<view class="scrollPage-header">
 			<view :style="{height:statusBarHeight+'px'}"></view>
-			<view class="header-title">
+			<view class="header-title-box">
 				<view class="header-left" @click="goBack">
-					<image style="width: 16px; height: 16px;margin-right:3px;" mode="aspectFit" src="../static/arrow-left.png"></image>
+					<uni-icons type="arrowleft" size="16"></uni-icons>
 					<text>返回</text>
 				</view>
-				<view class="header-title"><text class="ellipsis-one" overflow="ellipsis">{{title}}</text></view>
-				<view class="header-right"></view>
+				<view class="search-head" @click="goSearch">
+					<uni-search-bar readonly radius="100" placeholder="请输入商品名称/产品编码/原厂编码" textColor="#666" clearButton="auto" cancelButton="none" />
+				</view>
+				<view></view>
 			</view>
-			<view class="search-head" @click="goSearch">
-				<uni-search-bar readonly v-model="queryWord" :focus="focus" radius="100" placeholder="请输入商品名称/产品编码/原厂编码" textColor="#666" clearButton="auto" cancelButton="none" />
+			<view class="header-title">
+				<text :max-lines="1" overflow="ellipsis">{{title}}</text>
 			</view>
 		</view>
 		<view class="search-result">
@@ -306,18 +308,21 @@
 	flex-direction: column;
 	.scrollPage-header{
 		z-index: 1;
-		.header-title{
+		.header-title-box{
 			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%;
+			border-bottom: 1px solid #e8e8e8;
+			.search-head{
+				flex-grow: 1;
+				/deep/ .uni-searchbar{
+					padding: 0 6px;
+				}
+				/deep/ .uni-searchbar .uni-searchbar__box{
+					height: 30px;
+				}
 			}
 			.header-left{
 				display: flex;
@@ -333,11 +338,11 @@
 			}
 		}
 	}
-	.search-head{
+	.header-title{
 		background-color: #FFFFFF;
-		/deep/ .uni-searchbar{
-			padding: 5px 6px;
-		}
+		color: #333333;
+		padding: 10px;
+		text-align: center;
 	}
 	.search-result{
 		flex-grow: 1;

BIN
static/icon_delete@3x.png


BIN
static/kongCart.png