hmp před 4 roky
rodič
revize
870878293b

+ 10 - 11
assets/http/global.js

@@ -1,11 +1,10 @@
 let global = {}
 
-// global.baseUrl='http://192.168.1.244:1888/api/'
-// global.baseUrl='https://ldt.guosen-fumao.cn/api/'
-
-global.baseUrl = 'http://192.168.1.168:2366/'
 
+// global.baseUrl = 'https://ldt.guosen-fumao.cn/api/'
 // global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
+
+global.baseUrl = 'http://192.168.1.168:2366/'
 global.WebSocketUrl = 'ws://192.168.1.8:2366/websocket/'
 
 global.tokenUrl = global.baseUrl +
@@ -17,17 +16,17 @@ global.socket_prefix_SHOP = 'SHOP:'
 
 global.cart_prefix = 'cart:'
 
-global.platform={
-	SHOP:"SHOP",
-	MALL:"MALL"
+global.platform = {
+	SHOP: "SHOP",
+	MALL: "MALL"
 }
 
 global.userType = {
 	USER: "普通用户",
 	CHANNEL: "渠道代理",
 	CITY: "城市代理",
-	SHOP:"商户",
-	MALL:"商场",
+	SHOP: "商户",
+	MALL: "商场",
 }
 
 // global.agenterTypeId='1423464045809364994'
@@ -52,9 +51,9 @@ global.orderType = {
 global.takeType = {
 	dine_in: '店内堂食',
 	package: '到店自取',
-	delivery:'商家配送'
+	delivery: '商家配送'
 }
-global.takeTypeList = ['店内堂食','到店自取','商家配送']
+global.takeTypeList = ['店内堂食', '到店自取', '商家配送']
 
 global.payStatus = {
 	IS_WAIT: '0',

+ 13 - 5
pages/consume/comps/card1.vue

@@ -14,9 +14,16 @@
 				<view class="left">
 					<image :src="item.cover" mode=""></image>
 				</view>
-				<view class="right">
-					<view class="title text-cut-1">
-						<text class="">{{item.name}}</text>
+				<view class="right" style="width: 100%;">
+					<view class="title   flex justify-between" >
+						<view class="text-cut-1" style="width: 70%;">
+							<text class="">{{item.name}}</text>
+						</view>
+						<view @click.stop="$jump(`/pagesD/pages/menu/menu?shopId=${item.id}`)" class="text-base center" style="font-size: 28rpx;font-weight: normal;text-decoration: underline;">
+							<image class="" style="width: 36rpx;height: 36rpx;margin-right: 4rpx;" src="@/static/icon/order.png" mode=""></image>
+							<text>去点餐</text>
+						</view>
+						
 					</view>
 					<view class="data">
 						<view class="">
@@ -32,7 +39,7 @@
 						</view>
 						<view>
 							<u-icon name="map-fill" color="#FF9447"></u-icon>
-							<text class="margin-left-10">{{distance(item.latitude,item.longitude)}} </text>
+							<text class="margin-left-10">{{distance(item.latitude,item.longitude)}} km</text>
 						</view>
 					</view>
 					<view class="text-cut-2" style="width: 100%;height: 32rpx;margin-top: 14rpx;">
@@ -134,7 +141,7 @@
 			color: #fd5d4a;
 	
 			.title {
-				color: fd5d4a;
+				width: 100%;
 			}
 	
 			.tag {
@@ -173,6 +180,7 @@
 				flex-direction: column;
 	
 				.title {
+					
 					font-size: 30rpx;
 					font-weight: 800;
 					margin-bottom: 30rpx;

+ 1 - 1
pages/consume/comps/card2.vue

@@ -15,7 +15,7 @@
 					<view class="bottom">
 						<view class="">
 							<image src="@/static/icon/map1.png" mode=""></image>
-							<text>距离 {{distance(item.address)}} </text>
+							<text>距离 {{distance(item.address)}} km</text>
 						</view>
 						<view class="" @click.stop="checkLine(item)">
 							<image style="width: 40rpx;height: 40rpx;" src="@/static/icon/lx.png" mode=""></image>

+ 0 - 1
pages/mine/mine.vue

@@ -19,7 +19,6 @@
 						</view>
 					</view>
 				</view>
-				
 				<view class="info" v-else>
 					<view class="flex">
 						<image class="avatar" src="/static/icon/avatar.png"></image>

+ 5 - 2
pagesC/pages/checkstand/index.vue

@@ -67,7 +67,7 @@
 				this.shopId = params[0]
 				this.orderAmount = params[1]
 			} else {
-				this.shopId = options.id
+				this.shopId = options.id || '1440871712886366210'
 			}
 
 			// #ifdef  MP-WEIXIN
@@ -231,10 +231,13 @@
 					payStatus: this.$global.payStatus.IS_WAIT
 				}
 				let res = await this.$api.pay.payOrder(obj)
+				console.log(res,"res****");
 				let prePayTn = JSON.parse(res.data.prePayTn)
-				this.$mpi.requestPayment(prePayTn).then(() => {
+				this.$mpi.requestPayment(prePayTn).then((res) => {
+					console.log(res,"res");
 					this.handelResult(true)
 				}).catch(err => {
+					console.log(err,"err");
 					this.handelResult(false)
 				})
 			},

+ 0 - 1
pagesD/comps/h-time-alert.vue

@@ -402,7 +402,6 @@ export default {
 	background-color: rgba(0, 0, 0, 0.5);
 	z-index: -9999;
 	opacity: 0;
-	transition: opacity 0.3s;
 }
 .aMShow {
 	z-index: 999;

+ 243 - 221
pagesD/pages/menu/menu.vue

@@ -1,100 +1,107 @@
 <template>
-	<view class="u-wrap">
-		<login ref="login"  @signIn="signIn"></login>
-		<view class="u-search-box">
-			<view class="nav" >
-				<view class="header">
-					<view class="left overflow-hidden">
-						<view class="flex align-center overflow-hidden" v-if="takeType == takeTypeGlobal.delivery">
-							<image src="/pagesD/static/icon/location1.png" style="width: 30rpx; height: 30rpx;"
-								class="margin-right-10">
-							</image>
-							<text v-if="$isEmpty(vuex_userId)" @tap="showLogin">去登录</text>
-							<view class="" v-else @click="$jump('/pagesD/pages/address/address')">
-								<text  v-if="$isEmpty(address)">请完善地址信息</text>
-								<view style="margin-right: 20rpx;"  v-else  >
-									<text class="text-cut-1">{{address.address}}</text>
+	<view class="u-wrap" :style="$isEmpty(goods)?'background-color: #FFFFFF;':''">
+		<view class="goods_empty" v-if="$isEmpty(goods)">
+			<image src="/pagesD/static/icon/goods_empty.png" mode=""></image>
+			<text style="font-weight: 400;">该商铺还未上架商品</text>
+		</view>
+		
+		<view class="" v-else>
+			<login ref="login"  @signIn="signIn"></login>
+			<view class="u-search-box">
+				<view class="nav" >
+					<view class="header">
+						<view class="left overflow-hidden">
+							<view class="flex align-center overflow-hidden" v-if="takeType == takeTypeGlobal.delivery">
+								<image src="/pagesD/static/icon/location1.png" style="width: 30rpx; height: 30rpx;"
+									class="margin-right-10">
+								</image>
+								<text v-if="$isEmpty(vuex_userId)" @tap="showLogin">去登录</text>
+								<view class="" v-else @click="$jump('/pagesD/pages/address/address')">
+									<text  v-if="$isEmpty(address)">请完善地址信息</text>
+									<view style="margin-right: 20rpx;"  v-else  >
+										<text class="text-cut-1">{{address.address}}</text>
+									</view>
 								</view>
 							</view>
+							<view class="flex align-center overflow-hidden" v-else>
+								<image src="/pagesD/static/icon/shop2.png" style="width: 30rpx; height: 30rpx;"
+									class="margin-right-10">
+								</image>
+								<text style="font-size: 36rpx;font-weight: 800;">杨国福麻辣烫</text>
+							</view>
 						</view>
-						<view class="flex align-center overflow-hidden" v-else>
-							<image src="/pagesD/static/icon/shop2.png" style="width: 30rpx; height: 30rpx;"
-								class="margin-right-10">
-							</image>
-							<text style="font-size: 36rpx;font-weight: 800;">杨国福麻辣烫</text>
+						<view @click="modalCheckedShow" class="cu-btn round bg-red sm" style="font-size: 24rpx;">
+							<text class="center">{{takeType.substring(2,4)}}</text>
+							<text class="cuIcon-order center text-bold" style="transform: rotate(90deg);margin-left: 6rpx;"></text>
 						</view>
 					</view>
-					<view @click="modalCheckedShow" class="cu-btn round bg-red sm" style="font-size: 24rpx;">
-						<text class="center">{{takeType.substring(2,4)}}</text>
-						<text class="cuIcon-order center text-bold" style="transform: rotate(90deg);margin-left: 6rpx;"></text>
+					<view class="bg-white">
+						<u-notice-bar mode="horizontal" :list="appProperties.shopNotice"></u-notice-bar>
 					</view>
 				</view>
-				<view class="bg-white">
-					<u-notice-bar mode="horizontal" :list="appProperties.shopNotice"></u-notice-bar>
-				</view>
 			</view>
-		</view>
-		<view class="u-menu-wrap">
-			<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
-				:scroll-into-view="itemId">
-				<view  v-for="(item,index) in goods" :key="index" class="u-tab-item"
-					:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
-					<text class="u-line-1">{{item.goodsCategoryName}}</text>
-				</view>
-			</scroll-view>
-			<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box"
-				@scroll="rightScroll">
-				<view class="page-view">
-					<view  class="class-item" :id="'item' + index" v-for="(item , index) in goods" :key="index">
-						<view class="item-title" >
-							<text>{{item.goodsCategoryName}}</text>
-						</view>
-						<view class="item-container" >
-							<view class="thumb-box" v-for="(goods, index1) in item.goodsList" :key="index1">
-								<image class="item-menu-image" :src="goods.image" mode=""></image>
-								<view class="item-content" >
-									<view class="name">{{goods.name}}</view>
-									<view class="tips">
-										{{ goods.description && goods.description != '' ? goods.description : goods.name }}
-									</view>
-									<view class="price_and_action">
-										<text class="price">¥{{ goods.defaultPrice / 100 }}</text>
-										<!-- 商品没有下架 -->
-										<view v-if="goods.isSell">
-											<!-- 要选商品规格详细信息 -->
-											<view class="btn-group"
-												v-if="goods.goodsPropertyVos && goods.goodsPropertyVos.length">
-												<button type="primary" class="btn property_btn" hover-class="none"
-													size="mini" @tap="showGoodDetailModal(goods)">
-													选规格
-												</button>
-												<view class="dot" v-show="goodsCartNum(goods.id)">
-													{{ goodsCartNum(goods.id) }}
+			<view class="u-menu-wrap">
+				<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
+					:scroll-into-view="itemId">
+					<view  v-for="(item,index) in goods" :key="index" class="u-tab-item"
+						:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
+						<text class="u-line-1">{{item.goodsCategoryName}}</text>
+					</view>
+				</scroll-view>
+				<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box"
+					@scroll="rightScroll">
+					<view class="page-view">
+						<view  class="class-item" :id="'item' + index" v-for="(item , index) in goods" :key="index">
+							<view class="item-title" >
+								<text>{{item.goodsCategoryName}}</text>
+							</view>
+							<view class="item-container" >
+								<view class="thumb-box" v-for="(goods, index1) in item.goodsList" :key="index1">
+									<image class="item-menu-image" :src="goods.image" mode=""></image>
+									<view class="item-content" >
+										<view class="name">{{goods.name}}</view>
+										<view class="tips">
+											{{ goods.description && goods.description != '' ? goods.description : goods.name }}
+										</view>
+										<view class="price_and_action">
+											<text class="price">¥{{ goods.defaultPrice / 100 }}</text>
+											<!-- 商品没有下架 -->
+											<view v-if="goods.isSell">
+												<!-- 要选商品规格详细信息 -->
+												<view class="btn-group"
+													v-if="goods.goodsPropertyVos && goods.goodsPropertyVos.length">
+													<button type="primary" class="btn property_btn" hover-class="none"
+														size="mini" @tap="showGoodDetailModal(goods)">
+														选规格
+													</button>
+													<view class="dot" v-show="goodsCartNum(goods.id)">
+														{{ goodsCartNum(goods.id) }}
+													</view>
 												</view>
-											</view>
-											<!-- 可以直接添加,不用选择商品属性 -->
-											<view class="btn-group" v-else>
-												<button type="default" v-show="goodsCartNum(goods.id)" plain
-													class="btn reduce_btn" size="mini" hover-class="none"
-													@tap="handleReduceFromCart(goods)">
-													<view class="iconfont iconsami-select"></view>
-												</button>
-												<view class="number" v-show="goodsCartNum(goods.id)">
-													{{ goodsCartNum(goods.id) }}
+												<!-- 可以直接添加,不用选择商品属性 -->
+												<view class="btn-group" v-else>
+													<button type="default" v-show="goodsCartNum(goods.id)" plain
+														class="btn reduce_btn" size="mini" hover-class="none"
+														@tap="handleReduceFromCart(goods)">
+														<view class="iconfont iconsami-select"></view>
+													</button>
+													<view class="number" v-show="goodsCartNum(goods.id)">
+														{{ goodsCartNum(goods.id) }}
+													</view>
+													<button type="primary" class="btn add_btn" size="min" hover-class="none"
+														@tap="handleAddToCart(goods)">
+														<view class="iconfont iconadd-select"></view>
+													</button>
 												</view>
-												<button type="primary" class="btn add_btn" size="min" hover-class="none"
-													@tap="handleAddToCart(goods)">
-													<view class="iconfont iconadd-select"></view>
-												</button>
 											</view>
-										</view>
-										<!-- 已经下架了 -->
-										<view v-else>
-											<view class="btn-group">
-												<button type="primary" disabled class="btn property_btn"
-													style="text-decoration: line-through;background-color: rgba(255, 148, 71,.6);" size="mini">
-													已售空
-												</button>
+											<!-- 已经下架了 -->
+											<view v-else>
+												<view class="btn-group">
+													<button type="primary" disabled class="btn property_btn"
+														style="text-decoration: line-through;background-color: rgba(255, 148, 71,.6);" size="mini">
+														已售空
+													</button>
+												</view>
 											</view>
 										</view>
 									</view>
@@ -102,152 +109,152 @@
 							</view>
 						</view>
 					</view>
-				</view>
-			</scroll-view>
-		
-		
-		<view class="">
-			<!-- 购物车栏 begin -->
-			<view class="cart-box" v-if="cart && cart.length">
-				<view class="mark" @tap="cartPopupVisible = !cartPopupVisible">
-					<image src="/pagesD/static/icon/cart1.png" class="cart-img"></image>
-					<view class="tag">{{ getCartGoodsNumber }}</view>
-				</view>
-				<view class="price" @tap="cartPopupVisible = !cartPopupVisible">¥{{ getCartGoodsPrice / 100 }}</view>
-				<view v-if="!appProperties.shopStatus"><button type="primary" class="pay-btn" disabled>商家休息中</button>
-				</view>
-				<view v-else-if="isBusinessTime">
-					<button :style="!disabledPay?'background-color: #FF9447;':''"  type="primary" class="pay-btn" @tap="toPay()"
-						:disabled="disabledPay">{{ disabledPay ? `差${spread / 100}元起送` : '去结算' }}</button>
-				</view>
-				<view v-else><button type="primary" class="pay-btn" disabled>未在营业时段</button></view>
-			</view>
-			<!-- 购物车栏 end -->
+				</scroll-view>
 			
-			<!-- 商品详情模态框 begin -->
-			<modal :show="goodDetailModalVisible" class="good-detail-modal" color="#5A5B5C" width="90%" custom
-				padding="0rpx" radius="12rpx">
-				<view class="cover">
-					<image v-if="currentGoods.image" :src="currentGoods.image" class="image"></image>
-					<view class="btn-group">
-						<image src="/pagesD/static/icon/close.png" @tap="closeGoodDetailModal"></image>
+			
+			<view class="">
+				<!-- 购物车栏 begin -->
+				<view class="cart-box" v-if="cart && cart.length">
+					<view class="mark" @tap="cartPopupVisible = !cartPopupVisible">
+						<image src="/pagesD/static/icon/cart1.png" class="cart-img"></image>
+						<view class="tag">{{ getCartGoodsNumber }}</view>
+					</view>
+					<view class="price" @tap="cartPopupVisible = !cartPopupVisible">¥{{ getCartGoodsPrice / 100 }}</view>
+					<view v-if="!appProperties.shopStatus"><button type="primary" class="pay-btn" disabled>商家休息中</button>
+					</view>
+					<view v-else-if="isBusinessTime">
+						<button :style="!disabledPay?'background-color: #FF9447;':''"  type="primary" class="pay-btn" @tap="toPay()"
+							:disabled="disabledPay">{{ disabledPay ? `差${spread / 100}元起送` : '去结算' }}</button>
 					</view>
+					<view v-else><button type="primary" class="pay-btn" disabled>未在营业时段</button></view>
 				</view>
-				<scroll-view class="detail" scroll-y style="padding-bottom: 100px;">
-					<view class="wrapper">
-						<view class="basic">
-							<view class="name">{{ currentGoods.name }}</view>
-							<view class="tips">{{ currentGoods.description }}</view>
+				<!-- 购物车栏 end -->
+				
+				<!-- 商品详情模态框 begin -->
+				<modal :show="goodDetailModalVisible" class="good-detail-modal" color="#5A5B5C" width="90%" custom
+					padding="0rpx" radius="12rpx">
+					<view class="cover">
+						<image v-if="currentGoods.image" :src="currentGoods.image" class="image"></image>
+						<view class="btn-group">
+							<image src="/pagesD/static/icon/close.png" @tap="closeGoodDetailModal"></image>
 						</view>
-						<!-- 商品的额外属性 -->
-						<view class="properties"
-							v-if="currentGoods.goodsPropertyVos && currentGoods.goodsPropertyVos.length">
-							<view class="property" v-for="(goodsPropertyVo, index) in currentGoods.goodsPropertyVos"
-								:key="index">
-								<view class="title">
-									<text class="name">
-										<text v-if="goodsPropertyVo.required" style="color: red">*</text>
-										{{ goodsPropertyVo.category }}
-									</text>
-								</view>
-								<view class="values">
-									<view class="value" v-for="(property, index2) in goodsPropertyVo.propertyList"
-										:key="index2" :class="{ default: property.isDefault }"
-										@tap="changePropertyDefault(index, index2)">
-										{{ property.propertyOption }}
-										{{ property.rebasePrice && property.rebasePrice >=0 ? '¥' + property.rebasePrice / 100 : property.extraPrice / 100 ? '¥' + property.extraPrice / 100 : '' }}
+					</view>
+					<scroll-view class="detail" scroll-y style="padding-bottom: 100px;">
+						<view class="wrapper">
+							<view class="basic">
+								<view class="name">{{ currentGoods.name }}</view>
+								<view class="tips">{{ currentGoods.description }}</view>
+							</view>
+							<!-- 商品的额外属性 -->
+							<view class="properties"
+								v-if="currentGoods.goodsPropertyVos && currentGoods.goodsPropertyVos.length">
+								<view class="property" v-for="(goodsPropertyVo, index) in currentGoods.goodsPropertyVos"
+									:key="index">
+									<view class="title">
+										<text class="name">
+											<text v-if="goodsPropertyVo.required" style="color: red">*</text>
+											{{ goodsPropertyVo.category }}
+										</text>
+									</view>
+									<view class="values">
+										<view class="value" v-for="(property, index2) in goodsPropertyVo.propertyList"
+											:key="index2" :class="{ default: property.isDefault }"
+											@tap="changePropertyDefault(index, index2)">
+											{{ property.propertyOption }}
+											{{ property.rebasePrice && property.rebasePrice >=0 ? '¥' + property.rebasePrice / 100 : property.extraPrice / 100 ? '¥' + property.extraPrice / 100 : '' }}
+										</view>
 									</view>
 								</view>
 							</view>
 						</view>
-					</view>
-				</scroll-view>
-				<view class="action">
-					<!-- 价格和属性 -->
-					<view class="left">
-						<view class="price">¥{{ currentGoods.realPrice / 100 }}</view>
-						<view class="props" v-if="getGoodSelectedProps(currentGoods)">
-							{{ getGoodSelectedProps(currentGoods) }}
+					</scroll-view>
+					<view class="action">
+						<!-- 价格和属性 -->
+						<view class="left">
+							<view class="price">¥{{ currentGoods.realPrice / 100 }}</view>
+							<view class="props" v-if="getGoodSelectedProps(currentGoods)">
+								{{ getGoodSelectedProps(currentGoods) }}
+							</view>
+						</view>
+						<!-- 模态窗里面增减商品 -->
+						<view class="btn-group">
+							<button type="default" plain class="btn" size="mini" hover-class="none"
+								@tap="changeCurrentGoodsNumber(-1)">
+								<view class="iconfont iconsami-select"></view>
+							</button>
+							<view class="number">{{ currentGoods.number }}</view>
+							<button type="primary" class="btn" size="min" hover-class="none" @tap="changeCurrentGoodsNumber(1)">
+								<view class="iconfont iconadd-select"></view>
+							</button>
 						</view>
 					</view>
-					<!-- 模态窗里面增减商品 -->
-					<view class="btn-group">
-						<button type="default" plain class="btn" size="mini" hover-class="none"
-							@tap="changeCurrentGoodsNumber(-1)">
-							<view class="iconfont iconsami-select"></view>
-						</button>
-						<view class="number">{{ currentGoods.number }}</view>
-						<button type="primary" class="btn" size="min" hover-class="none" @tap="changeCurrentGoodsNumber(1)">
-							<view class="iconfont iconadd-select"></view>
-						</button>
+					<view class="add-to-cart-btn" @tap="addCurrentGoodsToCart()">
+						<view>确认</view>
 					</view>
-				</view>
-				<view class="add-to-cart-btn" @tap="addCurrentGoodsToCart()">
-					<view>确认</view>
-				</view>
-			</modal>
-			<!-- 商品详情模态框 end -->
-			
-			<!-- 购物车详情popup -->
-			
-			<u-popup z-index="99" v-model="cartPopupVisible" mode="bottom">
-				<view class="cart-popup">
-					<view class="top"><text @tap="handleCartClear">清空</text></view>
-					<scroll-view class="cart-list" scroll-y>
-						<view class="wrapper">
-							<view class="item" v-for="(goods, index) in cart" :key="index">
-								<view class="left">
-									<view class="name">{{ goods.name }}</view>
-									<view class="props">{{ getGoodSelectedProps(goods) }}</view>
-								</view>
-								<view class="center">
-									<text>¥{{ goods.realPrice / 100 }}</text>
-								</view>
-								<view class="right">
-									<!-- 购物车里添加数量 -->
-									<button type="default" plain size="mini" class="btn" hover-class="none"
-										@tap="handleCartItemReduce(index)">
-										<view class="iconfont iconsami-select"></view>
-									</button>
-									<view class="number">{{ goods.number }}</view>
-									<!-- 购物车里减少数量 -->
-									<button type="primary" class="btn" size="min" hover-class="none"
-										@tap="handleCartItemAdd(index)">
-										<view class="iconfont iconadd-select"></view>
-									</button>
-								</view>
-							</view>
-							<view class="item" v-if="takeType == takeTypeGlobal.package">
-								<view class="left">
-									<view class="name">包装费</view>
-								</view>
-								<view class="center">
-									<text>¥{{ appProperties.packingPrice / 100 }}</text>
-								</view>
-							</view>
-							<view class="item" v-if="takeType == takeTypeGlobal.delivery">
-								<view class="left">
-									<view class="name">包装费</view>
-								</view>
-								<view class="center">
-									<text>¥{{ appProperties.packingPrice / 100 }}</text>
+				</modal>
+				<!-- 商品详情模态框 end -->
+				
+				<!-- 购物车详情popup -->
+				
+				<u-popup z-index="99" v-model="cartPopupVisible" mode="bottom">
+					<view class="cart-popup">
+						<view class="top"><text @tap="handleCartClear">清空</text></view>
+						<scroll-view class="cart-list" scroll-y>
+							<view class="wrapper">
+								<view class="item" v-for="(goods, index) in cart" :key="index">
+									<view class="left">
+										<view class="name">{{ goods.name }}</view>
+										<view class="props">{{ getGoodSelectedProps(goods) }}</view>
+									</view>
+									<view class="center">
+										<text>¥{{ goods.realPrice / 100 }}</text>
+									</view>
+									<view class="right">
+										<!-- 购物车里添加数量 -->
+										<button type="default" plain size="mini" class="btn" hover-class="none"
+											@tap="handleCartItemReduce(index)">
+											<view class="iconfont iconsami-select"></view>
+										</button>
+										<view class="number">{{ goods.number }}</view>
+										<!-- 购物车里减少数量 -->
+										<button type="primary" class="btn" size="min" hover-class="none"
+											@tap="handleCartItemAdd(index)">
+											<view class="iconfont iconadd-select"></view>
+										</button>
+									</view>
 								</view>
-								<view class="left">
-									<view class="name">配送费</view>
+								<view class="item" v-if="takeType == takeTypeGlobal.package">
+									<view class="left">
+										<view class="name">包装费</view>
+									</view>
+									<view class="center">
+										<text>¥{{ appProperties.packingPrice / 100 }}</text>
+									</view>
 								</view>
-								<view class="center">
-									<text>¥{{ appProperties.sendingPrice / 100 }}</text>
+								<view class="item" v-if="takeType == takeTypeGlobal.delivery">
+									<view class="left">
+										<view class="name">包装费</view>
+									</view>
+									<view class="center">
+										<text>¥{{ appProperties.packingPrice / 100 }}</text>
+									</view>
+									<view class="left">
+										<view class="name">配送费</view>
+									</view>
+									<view class="center">
+										<text>¥{{ appProperties.sendingPrice / 100 }}</text>
+									</view>
 								</view>
 							</view>
-						</view>
-					</scroll-view>
-				</view>
-			</u-popup>
-			<!-- 购物车详情popup -->
-			
-			<modal-checked @confirm="modalConfirm" ref="modalChecked" :list="checkList"></modal-checked>
-			<login ref="login"  @signIn="signIn"></login>
-		</view>
+						</scroll-view>
+					</view>
+				</u-popup>
+				<!-- 购物车详情popup -->
+				
+				<modal-checked @confirm="modalConfirm" ref="modalChecked" :list="checkList"></modal-checked>
+				<login ref="login"  @signIn="signIn"></login>
+			</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -314,10 +321,6 @@
 					{
 						name:global.takeType.package,
 						icon:"/pagesD/static/icon/pickup.png",
-					},
-					{
-						name:global.takeType.delivery,
-						icon:"/pagesD/static/icon/delivery2.png",
 					}
 				]
 			}
@@ -827,6 +830,25 @@
 </script>
 
 <style lang="scss" scoped>
+	.goods_empty{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-direction: column;
+		margin-top: 300rpx;
+		
+		image{
+			width: 270rpx;
+			height: 160rpx;
+			margin-bottom: 50rpx;
+		}
+		
+		text:{
+			font-weight: 400;
+			color: #DDDDDD;
+		}
+	}
+	
 	.nav {
 		width: 100%;
 		flex-shrink: 0;
@@ -1477,7 +1499,7 @@
 	}
 
 	.page-view {
-		margin-bottom: 150rpx;
+		margin-bottom: 80rpx;
 		background-color: #FFFFFF;
 		padding: 16rpx;
 	}

+ 127 - 12
pagesD/pages/pay/pay.vue

@@ -60,11 +60,18 @@
 						<view class='cu-tag light sm round margin-left-10 bg-orange'>可预约</view>
 					</view>
 					<view class="">
-						<text >请选择自取时间</text>
+						<text >{{takeTime?takeTime:'请选择自取时间'}}</text>
 						<text class="cuIcon-right"></text>
 					</view>
 				</view>
-				<view class="card text-df" style="border: none;">
+				<view v-if="takeType==tykeTypeGloabl.dine_in" class="card text-df center" style="padding-top: 15rpx;padding-bottom: 15rpx;">
+					<text class="text-gray">取餐座位</text>
+					<view class="flex justify-end" style="width: 50%;">
+						<u-input v-model="seatNum" input-align="right" style="width: 62%;" placeholder="请输入取餐座号" class="center"></u-input>
+						<text class="cuIcon-right center"></text>
+					</view>
+				</view>
+				<view v-if="takeType==tykeTypeGloabl.package" class="card text-df" style="border: none;">
 					<text class="text-gray">联系电话</text>
 					<view class="">
 						<text >{{vuex_phone}}</text>
@@ -94,18 +101,18 @@
 				<block v-if="takeType==tykeTypeGloabl.delivery">
 					<view class="card text-df">
 						<text class="text-gray">包装费</text>
-						<text class="text-price">1</text>
+						<text class="text-price">{{vuex_orderInfo.store.packingPrice / 100}}</text>
 					</view>
 					<view class="card text-df">
 						<text class="text-gray">配送费</text>
-						<text class="text-price">1</text>
+						<text class="text-price">{{vuex_orderInfo.store.sendingPrice / 100}}</text>
 					</view>
 				</block>
 				<!-- 到店自取 -->
 				<block v-if="takeType==tykeTypeGloabl.package">
 					<view class="card text-df">
 						<text class="text-gray">包装费</text>
-						<text class="text-price">1</text>
+						<text class="text-price">{{vuex_orderInfo.store.packingPrice / 100}}</text>
 					</view>
 				</block>
 				
@@ -137,7 +144,7 @@
 				<text>总计:</text>
 				<text class="text-price text-bold text-xl">{{total / 100}}</text>
 			</view>
-			<view class="bg-base center text-lg" style="width: 25%;">
+			<view @click="order" class="bg-base center text-lg" style="width: 25%;">
 				付款
 			</view>
 		</view>
@@ -170,18 +177,39 @@ export default {
 	data() {
 		return {
 			shopId:'',
+			//购物车
 			cartKey:'',
 			cart:[],
+			//商品备注
 			remark:'',
+			//商品总数
+			totalNum:0,
+			// 座位号
+			seatNum:'',
 			//取餐方式
 			takeType:'',
 			tykeTypeGloabl:global.takeType,
-			takeTypeList:[],
+			takeTypeList:['店内堂食','到店自取'],
 			takeTypeShow:false,
 			//自取时间
 			timeShow:false,
+			takeTime:'',
 			//配送地址
-			address:{}
+			address:{},
+			//支付参数
+			payParams:{},
+			successParams:{},
+			//支付结果
+			payResult:{
+				isSuccess: false,
+				msg: "交易失败",
+				//总价
+				totalPrice: 0,
+				//消耗积分值
+				pointsNum:0,
+				//消耗现金值
+				amountNum:0,
+			}
 		};
 	},
 	onLoad() {
@@ -197,7 +225,9 @@ export default {
 	},
 	computed:{
 		total() {
+			this.totalNum=0
 			const sum = this.cart.reduce((pre, item) => {
+				this.totalNum+=item.number
 			    return pre + item.number * item.realPrice
 			}, 0)
 			//商家配送
@@ -216,7 +246,6 @@ export default {
 		init(){
 			this.address=this.vuex_orderInfo.address
 			this.takeType=this.vuex_orderInfo.takeType
-			this.takeTypeList=this.$global.takeTypeList
 			this.cart = this.vuex_orderInfo.cart
 			this.shopId=this.vuex_orderInfo.shopId
 			this.cartKey=this.$global.cart_prefix + this.vuex_shopId
@@ -228,12 +257,98 @@ export default {
 		},
 		pickConfirm(e){
 			let index=e[0]
-			this.takeType=this.takeTypeList[index]
+			let takeType=this.takeTypeList[index]
+			if (takeType==this.$global.takeType.delivery&& this.total<this.vuex_orderInfo.store.sendingNeedLeastPrice) {
+				//商家配送,总价格低于配送费
+				this.modalShow=true
+				return
+			}else{
+				this.takeType=takeType
+			}
 		},
 		handelClose(data) {
 			this.timeShow = false;
-			console.log(data); 
-		}
+			if (this.$isNotEmpty(data)) {
+				this.takeTime=this.$dateTime.format(new Date(data.date))
+			}
+		},
+		async order(){
+			let params={
+				receiveId:this.shopId,
+				payId:this.vuex_userId,
+				takeType: this.takeType,
+				goodsPreview:JSON.stringify(this.cart),
+				goodsTotalNum:this.totalNum,
+				totalPrice:this.total,
+				extraInfo:this.remark,
+				expireTime:this.$dateTime.getExpireTime(),
+				userPhone:this.vuex_phone,
+				appId: this.$global.wxParams.APPID,
+			}
+			if (this.takeType==this.$global.takeType.dine_in) {
+				//店内堂食
+				params.seatNum=this.seatNum
+			}
+			if (this.takeType==this.$global.takeType.package) {
+				//到店自取,包装费
+				params.packingPrice=this.vuex_orderInfo.store.packingPrice
+			}
+			
+			if (this.takeType==this.$global.takeType.package) {
+				if (this.$isEmpty(this.address)) {
+					this.$u.toast('请选择配送地址')
+					return
+				}
+				//商家配送,包装费,配送费
+				params.packingPrice=this.vuex_orderInfo.store.packingPrice
+				params.sendingPrice=this.vuex_orderInfo.store.sendingPrice
+				params.userPhone=address.phone
+				params.receiver=address.consignee
+				params.addressDetail=this.address.provinceName+'-'+this.address.cityName+'-'+this.address.areaName+' '+this.address.address
+			}
+			let res=await this.$api.goods.order(params)
+			this.payParams=res.data
+			this.successParams=this.payParams.successParams
+			if (this.successParams.status=='付款成功') {
+				this.handelResult(true)
+			}else if (this.successParams.status=='待付款') {
+				this.doWxPay(this.successParams.bills.id)
+			}else{
+				this.handelResult(false)
+			}
+		},
+		async doWxPay(orderId){
+			let obj = {
+				orderType: this.$global.orderType.USER_PAY,
+				orderId,
+				payStatus: this.$global.payStatus.IS_WAIT
+			}
+			let res = await this.$api.pay.payOrder(obj)
+			let prePayTn = JSON.parse(res.data.prePayTn)
+			this.$mpi.requestPayment(prePayTn).then(() => {
+				this.handelResult(true)
+			}).catch(err => {
+				this.handelResult(false)
+			})
+		},
+		handelResult(flag){
+			if (flag) {
+				this.payResult={
+					isSuccess: true,
+					msg: "交易成功",
+					totalPrice:this.successParams.totalPrice,
+					amountNum: this.successParams.bills.price,
+					pointsNum: this.$digital.floatSub(this.successParams.totalPrice,this.successParams.bills.price),
+				}
+			}else{
+				this.payResult.msg='交易失败'
+				this.payResult.isSuccess=false
+			}
+			uni.navigateTo({
+				url:"/pagesC/pages/checkstand/pay-result?payResult="+JSON.stringify(this.payResult)
+			})
+		},
+		
 	}
 };
 </script>

+ 7 - 0
pagesD/pages/pay/remark.vue

@@ -42,12 +42,19 @@ export default {
 	},
 	onLoad(options) {
 		this.remark=options.data || ''
+		if (this.$isNotEmpty(this.remark)) {
+			this.remark=this.remark+','
+		}
 	},
 	methods:{
 		tagClick(item){
 			this.remark=this.remark + item +","
 		},
 		confirm(){
+			if (this.$isNotEmpty(this.remark)) {
+				//去掉最后一个逗号
+				this.remark=this.remark.substring(0,this.remark.length-1)
+			}
 			uni.$emit('REMARK',this.remark)
 			this.$back()
 		}

binární
pagesD/static/icon/empty2.png


binární
pagesD/static/icon/goods_empty.png


binární
static/icon/order.png


+ 3 - 2
utils/util.js

@@ -29,11 +29,12 @@ util.calculateDistance=(lat1, lng1, lat2, lng2)=> {
 	  var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
 			 Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
 	  s = s * 6378.137;
-	  s = Math.round(s * 10000) / 10;//单位米
-	  return s  
+	  s = Math.round(s * 10000) / 10000;//单位km
+	  return Math.floor(s * 100) / 100
 },
 
 
+
 util.showModal=(content,title='提示')=>{
     return new Promise((resolve,reject)=>{
         uni.showModal({