py 2 éve
szülő
commit
9450e4ceed

+ 1 - 0
api/common.js

@@ -27,4 +27,5 @@ export const setRiderApply = (data) => request('/api/system/' + 'riderApply', 'p
 export const getCommonText = (data) => request(commonUrl + 'text', 'post', { ...data })
 // 获取实习岗位二维码
 export const commonPracticeCode = (data) => request(commonUrl + 'practice_code', 'post', { ...data })
+// 获取外卖配送费
 export const getDeliveryMoney = (data) => request(commonUrl + 'delivery_money', 'post', { ...data },false)

+ 4 - 0
api/order.js

@@ -11,3 +11,7 @@ export const orderCancel = (data) => request(newsUrl + 'cancel', 'post', { ...da
 export const orderStatus = (data) => request(newsUrl + 'status', 'post', { ...data },false)
 // 支付订单
 export const orderPay = (data) => request(newsUrl + 'pay', 'post', { ...data },false)
+// 获取预约送达时间
+export const orderTime = (data) => request(newsUrl + 'time', 'post', { ...data },false)
+// 外卖订单创建
+export const orderCreate = (data) => request(newsUrl + 'create', 'post', { ...data },false)

+ 104 - 66
pages-takeout/confirm-mod/coupon.vue

@@ -6,13 +6,15 @@
 					选择优惠券
 					<uni-icons @click="closeCoupon" class="box-close" type="closeempty" size="20"></uni-icons>
 				</view>
-				
+
 				<view class="flex-justify-around">
-					<view @click="setType(1)" class="fs-28 fw-600 mb-24" :class="type == 1?'fc-41ABF5':''">可用优惠券({{expressCouponData.coupon.length}})</view>
-					<view @click="setType(2)" class="fs-28 fw-600 mb-24" :class="type == 2?'fc-41ABF5':''">可领优惠券({{expressCouponData.receive.length}})</view>
+					<view @click="setType(1)" class="fs-28 fw-600 mb-24" :class="type == 1?'fc-41ABF5':''">
+						可用优惠券({{expressCouponData.coupon.length}})</view>
+					<view @click="setType(2)" class="fs-28 fw-600 mb-24" :class="type == 2?'fc-41ABF5':''">
+						可领优惠券({{expressCouponData.receive.length}})</view>
 				</view>
-				
-				
+
+
 				<view class="scroll-view-css" v-if="type == 1">
 					<view v-if="expressCouponData.coupon.length === 0" class="scroll-view-css">
 						<EnBlank :customSrc='true'>
@@ -22,7 +24,8 @@
 						</EnBlank>
 					</view>
 					<scroll-view v-else :scroll-y="true" class="scroll-view-css">
-						<view class="item-box display-flex mb-20" v-for="(item,i) in expressCouponData.coupon" :key="i" @click="setFun(item)">
+						<view class="item-box display-flex mb-20" v-for="(item,i) in expressCouponData.coupon" :key="i"
+							@click="setFun(item)">
 							<view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
 								<view class="align-items-center">
 									<view class="fs-30 fw-600 fc-FB3D03">¥</view>
@@ -43,13 +46,14 @@
 									{{item.start_time}} - {{item.end_time}}
 								</view>
 							</view>
-							
-							<image v-if="coupon_id==item.id" class="s-icon" src="@/static/img/common/y-select.png" mode=""></image>
-							<image v-else class="s-icon"src="@/static/img/common/n-select.png" mode=""></image>
+
+							<image v-if="coupon_id==item.id" class="s-icon" src="@/static/img/common/y-select.png"
+								mode=""></image>
+							<image v-else class="s-icon" src="@/static/img/common/n-select.png" mode=""></image>
 						</view>
 					</scroll-view>
 				</view>
-				
+
 				<view class="scroll-view-css" v-else>
 					<view v-if="expressCouponData.receive.length === 0" class="scroll-view-css">
 						<EnBlank :customSrc='true'>
@@ -96,91 +100,117 @@
 
 <script>
 	import EnBlank from "@/components/en-utils/en-blank/en-blank";
-	import {getExpressCoupon} from '@/api/express.js';
-	import {receiveCoupon} from '@/api/coupon.js';
+	import {
+		getExpressCoupon
+	} from '@/api/express.js';
+	import {
+		receiveCoupon
+	} from '@/api/coupon.js';
 	import tools from "@/service/tools";
-	
+	import {
+		shopOrderCoupon
+	} from '@/api/shop.js'
 	export default {
-		components:{EnBlank},
-		data(){
-			return{
-				type:1,//1可用类型 2可领类型
-				coupon_id:1,
-				dataType:'',//1外卖 2代取 3干洗
-				isAJAX:false,
-				
+		components: {
+			EnBlank
+		},
+		data() {
+			return {
+				type: 1, //1可用类型 2可领类型
+				coupon_id: 1,
+				dataType: '', //1外卖 2代取 3干洗
+				isAJAX: false,
+
 				// 代取优惠券
-				expressCouponData:{
-					coupon:[],//可用
-					receive:[],//可领
+				expressCouponData: {
+					coupon: [], //可用
+					receive: [], //可领
 				},
 			}
 		},
-		methods:{
-			getList(e,id){
-				if(id){
+		methods: {
+			getList(e, id, shop_id) {
+				console.log(e, id);
+				if (id) {
 					this.coupon_id = id;
-				}else{
+				} else {
 					this.coupon_id = '';
 				}
 				this.dataType = Number(e)
-				if(e == 1){
-					
-				}else if(e == 2){
+				if (e == 1) {
+					this.shopOrderCoupon(shop_id)
+				} else if (e == 2) {
 					this.getExpressCoupon()
 				}
 			},
-			
+
 			// 代取 获取优惠券
-			getExpressCoupon(){
+			getExpressCoupon() {
 				let operate_id = uni.getStorageSync('operate_id');
-				getExpressCoupon({operate_id:operate_id}).then((res)=>{
-					if(res.code === 1){
+				getExpressCoupon({
+					operate_id: operate_id
+				}).then((res) => {
+					if (res.code === 1) {
 						this.expressCouponData = res.data;
 						this.openPop();
 					}
 				})
 			},
-			
-			
-			setType(type){
-				if(type != this.type){
+			shopOrderCoupon(shop_id) {
+				// 下单是获取优惠卷
+				let operate_id = uni.getStorageSync('operate_id');
+				shopOrderCoupon({
+					operate_id: operate_id,
+					shop_id: shop_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.expressCouponData = res.data;
+						this.openPop();
+					}
+				})
+			},
+
+			setType(type) {
+				if (type != this.type) {
 					this.type = type
 				}
 			},
-			openPop(){
+			openPop() {
 				this.$refs.popupCoupon.open();
 			},
-			closeCoupon(){
+			closeCoupon() {
 				this.$refs.popupCoupon.close();
 			},
-			
-			setFun(item){
-				this.$emit('giveCouPon',item);
+
+			setFun(item) {
+				this.$emit('giveCouPon', item);
 				this.closeCoupon();
 			},
-			
-			getFun(item){
-				if(this.isAJAX){
+
+			getFun(item) {
+				if (this.isAJAX) {
 					return
 				}
 				this.isAJAX = true;
-				receiveCoupon({grant_id:item.grant_id,coupon_id:item.coupon_id}).then((res)=>{
-					if(res.code === 1){
+				receiveCoupon({
+					grant_id: item.grant_id,
+					coupon_id: item.coupon_id
+				}).then((res) => {
+					if (res.code === 1) {
 						this.isAJAX = false;
 						tools.success('领取成功');
 						this.resetList();
-					}else{
+					} else {
 						this.isAJAX = false;
 						tools.success('领取失败');
 					}
 				})
 			},
-			
-			resetList(){
-				if(this.dataType == 1){
-					
-				}else if(this.dataType == 2){
+
+			resetList() {
+				if (this.dataType == 1) {
+
+				} else if (this.dataType == 2) {
 					this.getExpressCoupon()
 				}
 			},
@@ -189,12 +219,14 @@
 </script>
 
 <style scoped lang="scss">
-	.w382{
+	.w382 {
 		width: 382rpx;
 	}
-	.item-box{
+
+	.item-box {
 		position: relative;
-		.s-icon{
+
+		.s-icon {
 			width: 32rpx;
 			height: 32rpx;
 			position: absolute;
@@ -202,9 +234,9 @@
 			right: 24rpx;
 		}
 	}
-	
-	
-	.pop-coupon{
+
+
+	.pop-coupon {
 		width: 100%;
 		height: 70vh;
 		background-color: #F5F4F9;
@@ -212,31 +244,35 @@
 		padding-top: 32rpx !important;
 		display: flex;
 		flex-direction: column;
-		.box-title{
+
+		.box-title {
 			position: relative;
-			.box-close{
+
+			.box-close {
 				position: absolute;
 				right: 22rpx;
 			}
 		}
+
 		.item-right {
 			padding: 24rpx;
 			box-sizing: border-box;
 			border-radius: 20rpx 0 0 20rpx;
 			position: relative;
 		}
+
 		.item-hr {
 			width: 0px;
 			height: auto;
 			border-right: 1rpx dashed #FB7850;
 		}
-		
+
 		.item-hr-two {
 			width: 0px;
 			height: auto;
 			border-right: 1rpx dashed #999;
 		}
-		
+
 		.item-left {
 			width: 200rpx;
 			height: auto;
@@ -245,6 +281,7 @@
 			position: relative;
 			border-radius: 0 20rpx 20rpx 0;
 		}
+
 		.but-box {
 			width: 152rpx;
 			height: 52rpx;
@@ -253,6 +290,7 @@
 			background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
 			border-radius: 200rpx;
 		}
+
 		.ball {
 			width: 24rpx;
 			height: 24rpx;
@@ -263,7 +301,7 @@
 			background: #F5F5F5;
 			z-index: 2;
 		}
-		
+
 		.ball-two {
 			width: 24rpx;
 			height: 24rpx;

+ 66 - 52
pages-takeout/confirm-mod/time.vue

@@ -1,80 +1,90 @@
 <template>
 	<view>
 		<uni-popup ref="popupTime" type="bottom">
-			<view class="pop-address box-border-box p-24">
+			<view class="pop-address box-border-box">
 				<view class="text-align-center fs-36 fw-600 box-title mb-32">
 					选择预计送达时间
 					<uni-icons @click="closeCoupon" class="box-close" type="closeempty" size="20"></uni-icons>
 				</view>
-				
 				<view class="scroll-view-css flex-justify-space">
 					<view class="time-left">
-						<view class="item-box" :class="type == item.type?'bgc-f':''"
-						v-for="(item,i) in list" :key="i" @click="select(1,item)">
+						<view class="item-box" :class="type == item.type?'bgc-f':''" v-for="(item,i) in list" :key="i"
+							@click="select(1,item)">
 							{{item.name}}
 						</view>
 					</view>
-					<view class="time-right flex-1">
-						<view class="item-box b-b-F9F9F9" :class="time == item.name?'fc-41ABF5':''"
-						v-for="(item,i) in timeList" :key="i" @click="select(2,item)">
-							{{item.name}}
+					<view class="time-right flex-1" v-if="timeList.length>0">
+						<view class="item-box b-b-F9F9F9" :class="time == item?'fc-41ABF5':''"
+							v-for="(item,i) in timeList" :key="i" @click="select(2,item)">
+							{{item}}
 						</view>
 					</view>
+					<view class="flex-1 align-items-center flex-justify-center" v-else>
+						暂无可选时间
+					</view>
 				</view>
-				
+
 			</view>
 		</uni-popup>
 	</view>
 </template>
 
 <script>
+	import {
+		orderTime
+	} from '@/api/order.js'
 	export default {
-		data(){
-			return{
-				list:[
-					{
-						type:1,
-						name:'今日',
-						timeList:[
-							{name:'10:30'},{name:'11:00'},{name:'11:30'},{name:'12:00'},
-							{name:'12:30'},{name:'13:00'},{name:'13:30'},{name:'14:00'},
-							{name:'14:30'},{name:'15:00'},{name:'15:30'},{name:'16:00'},
-						]
-					},
-					{
-						type:2,
-						name:'明日',
-						timeList:[
-							{name:'10:00'},{name:'10:30'},{name:'11:00'},{name:'11:30'},{name:'12:00'},
-						]
-					}
-				],
-				timeList:[],
-				type:'',
-				time:'',
+		data() {
+			return {
+				list: [],
+				timeList: [],
+				type: '',
+				time: '',
 			}
 		},
-		methods:{
-			getList(){
+		methods: {
+			getList(id) {
+				let school_id = uni.getStorageSync('school_id');
+				orderTime({
+					shop_id: id,
+					school_id: school_id
+				}).then((res) => {
+					if (res.code == 1) {
+						this.list = res.data
+						this.timeList = this.list[0].timeList;
+						this.time = this.timeList[0];
+						this.type = this.list[0].type;
+					}
+				})
+				console.log(this.list, '&&&&&&&&&&&&&&&&&&');
+				// if (this.list[0].timeList.length > 0) {
+				// 	this.timeList = this.list[0].timeList;
+				// 	this.time = this.timeList[0];
+				// }
+				// this.type = this.list[0].type;
 				this.openPop();
-				this.timeList = this.list[0].timeList;
-				this.type = this.list[0].type;
-				this.time = this.timeList[0].name;
 			},
-			openPop(){
+			openPop() {
 				this.$refs.popupTime.open();
 			},
-			closeCoupon(){
+			closeCoupon() {
 				this.$refs.popupTime.close();
 			},
-			select(type,item){
-				if(type === 1){
-					if(this.type != item.type){
+			select(type, item) {
+				if (type === 1) {
+					if (this.type != item.type) {
 						this.type = item.type;
 						this.time = '';
+						if(this.type == 2) {
+							this.timeList = this.list[1].timeList;
+						}else {
+							this.timeList = this.list[0].timeList;
+						}
 					}
-				}else{
-					this.time = item.name
+				} else {
+					this.time = item
+					this.closeCoupon()
+					this.$emit('timeAndType', this.type, this.time)
 				}
 			}
 		},
@@ -82,7 +92,7 @@
 </script>
 
 <style scoped lang="scss">
-	.pop-address{
+	.pop-address {
 		width: 100%;
 		height: 50vh;
 		background-color: #fff;
@@ -90,30 +100,34 @@
 		padding-top: 32rpx !important;
 		display: flex;
 		flex-direction: column;
-		.box-title{
+
+		.box-title {
 			position: relative;
-			.box-close{
+
+			.box-close {
 				position: absolute;
 				right: 22rpx;
 			}
 		}
-		
-		.time-left{
+
+		.time-left {
 			width: 240rpx;
 			height: auto;
 			background-color: #F7F8FA;
 		}
-		.time-right{
+
+		.time-right {
 			overflow-y: scroll;
 		}
-		.item-box{
+
+		.item-box {
 			width: 100%;
 			height: 104rpx;
 			line-height: 104rpx;
 			font-size: 28rpx;
 			font-weight: 400;
 			text-align: center;
-			
+
 		}
 	}
 </style>

+ 486 - 0
pages-takeout/goods-order.vue

@@ -0,0 +1,486 @@
+<template>
+	<view class="confirm-order-box iPhone-bottom flex-common-css box-border-box">
+		<view class="bg-box"></view>
+		<Nav title='提交订单' bgckgroundBox='transparent'></Nav>
+		<view class="scroll-view-css box-border-box p-24">
+			<view class="box-card box-border-box mb-20 bgc-f">
+				<view class="box-input box-border-box p-b-20 mb-20" @click="selectFun(2)">
+					<view class="flex-justify-space mb-12">
+						<view v-if="addressData.id" class="fs-36 fw-600 text-overflow-ellipsis w570">
+							{{addressData.address||''}}{{addressData.school_name||''}}{{addressData.dorm_name||''}}
+						</view>
+						<view v-else class="fs-36 fw-600 text-overflow-ellipsis w570">请选择地址</view>
+						<image class="right-icon" src="@/static/img/toRight.png" mode=""></image>
+					</view>
+					<view class="" v-if="addressData.id">
+						<span class="mr-24 fs-28 fc-9">{{addressData.consignee||''}}</span><span
+							class="fs-28 fc-9">{{addressData.phone||''}}</span>
+					</view>
+				</view>
+				<view class="box-input flex-justify-space align-items-center box-border-box p-b-20 mb-20"
+					@click="selectFun(3)">
+					<view class="fs-28 fw-600">预计送达</view>
+					<view class="align-items-center">
+						<view class="fs-28 fw-400 fc-41ABF5"> {{deliverText?'预计'+ deliverText+ '送达':'选择送达时间'}} </view>
+						<image class="right-icon" src="@/static/img/toRight.png" mode=""></image>
+					</view>
+				</view>
+				<view class="box-input flex-justify-space box-border-box p-b-20 mb-20">
+					<view class="fs-28 fw-600">配送方式</view>
+					<view class="fs-24 fw-400 sd-box fc-FB3D03">送达宿舍</view>
+				</view>
+			</view>
+
+
+			<view class="box-card box-border-box bgc-f mb-20">
+				<view class="mb-32 b-b-F9F9F9">
+					<!-- <view class="fs-28 fw-600 mb-24">宋氏重庆鸡公煲(重工业店)宋氏重庆鸡公煲(重工业店)宋氏重庆鸡公煲(重工业店)</view> -->
+					<view class="flex-justify-space mb-28" v-for="(item,i) in cardData.goods_list" :key="i">
+						<image class="goods-img" :src="item.goods_image" mode="aspectFill"></image>
+						<view class="w376">
+							<view class="fs-28 fw-400 mb-4">
+								{{item.goods_name}}
+							</view>
+							<view class="fs-24 fc-9 mb-4">{{item.goods_desc}}</view>
+							<view class="fs-24 fc-9">x{{item.goods_number}}</view>
+						</view>
+						<view class="fs-32 fw-600">¥{{item.goods_money}}</view>
+					</view>
+				</view>
+				<view class="flex-justify-space mb-24">
+					<view class="fs-28 fw-400">打包费</view>
+					<view class="fs-32 fw-600">¥{{cardData.pack_price}}</view>
+				</view>
+				<view class="flex-justify-space mb-24">
+					<view class="fs-28 fw-400">配送费</view>
+					<view class="fs-32 fw-600">¥{{delivery_money}}</view>
+				</view>
+				<view class="flex-justify-space mb-24 p-b-20 b-b-F9F9F9" @click="selectFun(1)">
+					<view class="align-items-center">
+						<image class="yhq-icons" src="@/static/img/order/yhq.png" mode=""></image>
+						<view class="fs-28 fw-400">优惠券</view>
+					</view>
+					<view class="align-items-center">
+						<view :class="fromData.coupon_id?'fc-FB3D03 fw-600 fs-32':'fw-400 fs-28'">
+							{{fromData.coupon_id?'-¥'+ quanMoney:'请选择优惠券'}}
+						</view>
+						<image class="right-icon" src="@/static/img/toRight.png" mode=""></image>
+					</view>
+				</view>
+				<view class="text-align-right p-b-20">
+					<span class="fc-9 fs-28">共{{cardData.total_num||0}}件,</span>
+					<span class="fw-400 fc-0 fs-28">合计¥</span>
+					<span
+						class="fw-600 fc-0 fs-44">{{(total_price - quanMoney) < 0?'0':(total_price - quanMoney)||0}}</span>
+				</view>
+			</view>
+
+
+			<view class="box-card box-border-box bgc-f mb-20">
+				<view class="flex-justify-space b-b-F9F9F9">
+					<view class="fs-28 fw-600 w158 mr-12">备注</view>
+					<input class="flex-1 text-align-right fs-28" type="text" placeholder="请填写你的备注">
+				</view>
+				<!-- <view class="fs-28 fw-600 mb-16">平台将通过服务通知向你推送最新动态</view>
+				<view class="p-16 bgc-F3F4F6 b-rad-12 tz-an-f">
+					<view class="fc-0 fw-400 fs-24 mb-4">是否电话通知</view>
+					<view class="fc-9 fw-400 fs-24">若开启,则订单送达系统自动曝光(电话)通知</view>
+					<view class="tz-an">
+						<view class="r-right" @click="fromData.is_default == 1?fromData.is_default=0:fromData.is_default=1"
+						:class="fromData.is_default == 0?'n-r':'s-r'">
+							<view class="r-y"></view>
+						</view>
+					</view>
+				</view> -->
+				<view class="p-b-20"></view>
+			</view>
+
+
+
+			<view class="box-card box-border-box mb-20 bgc-f flex-justify-space">
+				<view class="fs-28 fw-600 w158">支付方式</view>
+				<view class="wx-box display-flex">
+					<image src="@/static/img/common/wx-zf.png" mode="scaleToFill"></image>
+					<view class="fs-28 fw-400 ml-10">微信支付</view>
+				</view>
+			</view>
+		</view>
+
+		<view class="bottom-box box-border-box p-24">
+			<view class="flex-justify-space">
+				<view class="align-items-flex-end box-1">
+					<span class="fs-28 fc-f fw-600">¥</span>
+					<span
+						class="fs-44 fc-f fw-600">{{(total_price - quanMoney) < 0?'0':(total_price - quanMoney)||0}}</span>
+				</view>
+				<view class="text-align-center box-2 fs-32 fc-f fw-600" @click="toSave()">立即支付</view>
+			</view>
+		</view>
+
+
+		<Coupon ref="coupon" @giveCouPon='giveCouPon'></Coupon>
+		<SelectAddress ref="selectAddress" @giveAddress='giveAddress'></SelectAddress>
+		<Time ref="selectTime" @giveTime='giveTime' @timeAndType='timeAndType'></Time>
+		<EditCode ref='editCode' v-model="fromData.pickup_code"></EditCode>
+	</view>
+</template>
+
+<script>
+	import {
+		getExpressCoupon,
+		getExpressCreate,
+		getExpressPay
+	} from '@/api/express.js';
+	import {
+		getAddressDefault
+	} from '@/api/member.js'
+	import {
+		getShopIngList
+	} from '@/api/shopping.js'
+	import {
+		getDeliveryMoney
+	} from '@/api/common.js'
+	import {
+		orderCreate,
+		orderPay
+	} from '@/api/order.js'
+	import tools from "@/service/tools";
+	import Coupon from './confirm-mod/coupon.vue';
+	import SelectAddress from './confirm-mod/select-address.vue';
+	import Time from './confirm-mod/time.vue';
+	import EditCode from './confirm-mod/edit-code.vue';
+
+	export default {
+		components: {
+			Coupon,
+			SelectAddress,
+			Time,
+			EditCode
+		},
+		data() {
+			return {
+				type: 1, //1外卖 2代取 3干洗
+				fromData: {
+					school_id: '',
+					shop_id: '',
+					// site_id:'',
+					type: '',
+					time: '',
+					address_id: '',
+					coupon_id: '',
+					note: '',
+					// is_default:0,
+					// pickup_code:[],
+				},
+				addressData: {},
+				deliverText: '',
+				cardData: {
+					goods_list: [],
+				},
+				delivery_money: '',
+				quanMoney: "",
+				total_price: '',
+				isAJAX: false,
+			}
+		},
+		onLoad(e) {
+			if (e) {
+				this.fromData.shop_id = e.shop_id
+				this.getCard(e.shop_id)
+				// this.getDeliveryMoney(e.shop_id)
+			}
+			this.getAddressDefault();
+		},
+		onShow() {
+			let isConfirmAddressFlag = uni.getStorageSync('isConfirmAddressFlag');
+			if (isConfirmAddressFlag) {
+				this.selectFun(2);
+			}
+		},
+		methods: {
+			getDeliveryMoney(shop_id) {
+				// 获取外卖配送费
+				this.fromData.school_id = uni.getStorageSync('school_id');
+				getDeliveryMoney({
+					shop_id: shop_id,
+					school_id: this.fromData.school_id
+				}).then((res) => {
+					if (res.code == 1) {
+						this.delivery_money = res.data.delivery_money
+						this.total_price = Number(this.total_price) + Number(this.delivery_money)
+					}
+				})
+			},
+			// 获取购物车
+			getCard(shop_id) {
+				getShopIngList({
+					shop_id: shop_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.cardData = res.data;
+						this.total_price = res.data.total_price
+						this.getDeliveryMoney(shop_id)
+					}
+				})
+			},
+			// 获取默认地址
+			getAddressDefault() {
+				getAddressDefault().then((res) => {
+					if (res.code === 1) {
+						this.addressData = res.data
+						if (this.addressData.id) {
+							this.fromData.address_id = this.addressData.id;
+						}
+					}
+				})
+			},
+
+			selectFun(type) {
+				if (type === 1) {
+					// 选择优惠券
+					this.$refs.coupon.getList(this.type, this.fromData.coupon_id, this.fromData.shop_id);
+				} else if (type === 2) {
+					// 选择地址
+					if (this.addressData.id) {
+						this.$refs.selectAddress.id = this.addressData.id;
+					}
+					this.$refs.selectAddress.getList();
+				} else if (type === 3) {
+					// 选择时间
+					this.$refs.selectTime.getList(this.fromData.shop_id);
+				} else if (type === 4) {
+					// 编辑code
+					this.$refs.editCode.getList();
+				}
+			},
+			giveCouPon(e) {
+				this.quanMoney = Number(e.money);
+				this.fromData.coupon_id = e.id;
+			},
+			timeAndType(type, time) {
+				// 时间选择
+				this.fromData.type = type
+				this.fromData.time = time
+				if (type == 1) {
+					this.deliverText = '今天' + time
+				} else {
+					this.deliverText = '明天' + time
+				}
+				console.log(type, time, '&&&&&&&&&&&&&&&&&&&&&&&&');
+			},
+			giveAddress(e) {
+				this.addressData = e;
+				this.fromData.address_id = this.addressData.id;
+			},
+			giveTime(e) {
+				console.log(e);
+			},
+			toSave() {
+				if (!this.fromData.address_id) {
+					return tools.error('请先选择地址')
+				}
+				if (this.isAJAX) {
+					return
+				}
+				this.isAJAX = true;
+				this.fromData.school_id = uni.getStorageSync('school_id');
+				// this.fromData.site_id = uni.getStorageSync('site_id');
+				orderCreate(this.fromData).then((res) => {
+					if (res.code === 1) {
+						orderPay({
+							order_id: res.data.order_id,
+							pay_type: 1
+						}).then((ret) => {
+							if (ret.code === 1) {
+								uni.requestPayment({
+									provider: "wxpay", //支付类型-固定值
+									timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
+									nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
+									package: ret.data.wx_pay.package, // 固定值
+									signType: ret.data.wx_pay.signType, //固定值
+									paySign: ret.data.wx_pay.paySign, //签名
+									success: (ren) => {
+										tools.success("支付成功");
+										this.isAJAX = false;
+										setTimeout(() => {
+											uni.switchTab({
+												url: "/pages/order/index"
+											})
+										}, 1500)
+									},
+									fail: (err) => {
+										this.isAJAX = false;
+										tools.error("支付失败");
+									},
+								});
+							} else {
+								this.isAJAX = false;
+								tools.error("支付失败");
+							}
+						})
+					} else {
+						this.isAJAX = false;
+						tools.error(res.msg);
+					}
+				})
+			},
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	.yhq-icons {
+		width: 32rpx;
+		height: 32rpx;
+		margin: 0 6rpx 0 0;
+	}
+
+	.code-box {
+		min-height: 100rpx;
+		background-color: #F3F4F6;
+		border-radius: 12rpx;
+		padding: 24rpx 24rpx 0 24rpx;
+
+		.code-item {
+			width: 156rpx;
+			margin-right: 52rpx;
+			margin-bottom: 16rpx;
+		}
+
+		.code-item:nth-child(3n) {
+			margin-right: 0 !important;
+		}
+	}
+
+	.tz-an-f {
+		position: relative;
+
+		.tz-an {
+			position: absolute;
+			right: 16rpx;
+			top: 0;
+		}
+	}
+
+	.r-right {
+		margin-top: 24rpx;
+		width: 88rpx;
+		height: 52rpx;
+		border-radius: 200rpx;
+		position: relative;
+
+		.r-y {
+			width: 44rpx;
+			height: 44rpx;
+			background: #FFFFFF;
+			border-radius: 200rpx;
+			position: absolute;
+			top: 4rpx;
+		}
+	}
+
+	.s-r {
+		background-color: #41ABF5;
+		transition: all 1s;
+
+		.r-y {
+			right: 4rpx !important;
+			transition: all 1s;
+		}
+	}
+
+	.n-r {
+		background-color: #ccc;
+		transition: all 1s;
+
+		.r-y {
+			left: 4rpx !important;
+			transition: all 1s;
+		}
+	}
+
+	.goods-img {
+		width: 108rpx;
+		height: 108rpx;
+		border-radius: 8rpx;
+		margin-right: 16rpx;
+	}
+
+	.right-icon {
+		width: 32rpx;
+		height: 32rpx;
+	}
+
+	.w376 {
+		width: 376rpx;
+	}
+
+	.w570 {
+		width: 570rpx;
+	}
+
+	.sd-box {
+		padding: 3rpx 16rpx;
+		height: 40rpx;
+		line-height: 40rpx;
+		background: rgba(251, 61, 3, 0.1);
+		border-radius: 8rpx 8rpx 8rpx 8rpx;
+	}
+
+	.confirm-order-box {
+		position: relative;
+
+		.bg-box {
+			width: 100%;
+			height: 448rpx;
+			filter: blur(80rpx);
+			background: linear-gradient(to right, rgba(176, 252, 250, 0.6), rgba(249, 246, 224, 0.87), rgba(249, 246, 224, 0.87));
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: -1;
+		}
+
+		.bottom-box {
+			background-color: #fff;
+
+			.box-1 {
+				flex: 1;
+				height: 100rpx;
+				background: #333;
+				border-radius: 200rpx 0rpx 0rpx 200rpx;
+				box-sizing: border-box;
+				padding-left: 32rpx;
+				padding-bottom: 20rpx;
+			}
+
+			.box-2 {
+				width: 200rpx;
+				height: 100rpx;
+				line-height: 100rpx;
+				background: #41ABF5;
+				border-radius: 0rpx 200rpx 200rpx 0rpx;
+				text-align: center;
+			}
+		}
+
+		.box-card {
+			width: 100%;
+			min-height: 88rpx;
+			border-radius: 20rpx;
+			padding: 24rpx 24rpx 0 24rpx;
+		}
+
+		.wx-box {
+			image {
+				width: 40rpx;
+				height: 40rpx;
+			}
+		}
+
+		.box-input {
+			border-bottom: 2rpx solid #F9F9F9;
+
+		}
+	}
+</style>

+ 139 - 120
pages-takeout/shop.vue

@@ -58,8 +58,10 @@
 
 
 		<view class="common-view-css bgc-f" style="overflow: hidden;">
-			<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>
+			<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>
 			<ShopInfo style="height: 100%;" :shopId='shop_id' v-else-if="shopType === 3"></ShopInfo>
 		</view>
 
@@ -67,16 +69,16 @@
 			<view class="shop-buttom-money-1 flex-justify-space align-items-center">
 				<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
 				<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 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" @click.stop="toConfirmOrder()">去结算</view>
 			</view>
 		</view>
 
@@ -85,7 +87,8 @@
 				<view class="buy-card-top box-border-box plr-32 flex-justify-space align-items-center">
 					<view class="">
 						<span class="fs-32 fc-3 mr-12">已选商品</span>
-						<span class="fs-32 fc-9">(打包费<span class="fs-32 fc-FB3D03">{{cartData.pack_price}}元</span>)</span>
+						<span class="fs-32 fc-9">(打包费<span
+								class="fs-32 fc-FB3D03">{{cartData.pack_price}}元</span>)</span>
 					</view>
 					<view class="fs-28 fw-400 fc-9 align-items-center">
 						<view class="">
@@ -99,8 +102,10 @@
 						<image :src="goods.goods_image" mode="scaleToFill"></image>
 						<view class="flex-1">
 							<view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-12">
-                {{goods.goods_name}}</view>
-							<view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">{{goods.goods_attr}}</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="">
@@ -108,14 +113,17 @@
 									<span class="fs-40 fc-FB3D03 fw-b">{{goods.price}}</span>
 								</view>
 								<view class="display-flex align-items-center">
-									<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 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>
-          <en-blank v-if="cartData.goods_list.length<=0" message="快去选购商品吧!~"></en-blank>
+					<en-blank v-if="cartData.goods_list.length<=0" message="快去选购商品吧!~"></en-blank>
 				</view>
 
 				<view class="shop-buttom-money box-border-box" @click="createOrder()">
@@ -127,11 +135,11 @@
 								<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-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 fs-32 fc-f fw-600" @click="toConfirmOrder()">
+						<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">
 							去结算</view>
 					</view>
 				</view>
@@ -148,7 +156,7 @@
 					<view v-if="couponData<= 0" class="blank-text fs-32 fc-6 text-align-center">
 						暂无优惠券
 					</view>
-<!-- 					<EnBlank :customSrc='true' v-if="couponData<= 0">
+					<!-- 					<EnBlank :customSrc='true' v-if="couponData<= 0">
 						<template v-slot:blankImg>
 							<image class="black-img" src="@/static/img/common/no-order.png" mode=""></image>
 						</template>
@@ -198,8 +206,14 @@
 		shopInfo,
 		shopCoupon
 	} from "@/api/shop.js"
-  import {getDeliveryMoney} from "@/api/common";
-  import {getShopIngList, setShopIngDel, setShopIngNumber} from "@/api/shopping";
+	import {
+		getDeliveryMoney
+	} from "@/api/common";
+	import {
+		getShopIngList,
+		setShopIngDel,
+		setShopIngNumber
+	} from "@/api/shopping";
 	export default {
 		components: {
 			Menu,
@@ -223,29 +237,29 @@
 				shopType: 1, //组件类型
 				shopTypeBsLeft: 12,
 				shop_id: '',
-        operate_id: '',
+				operate_id: '',
 				shopsInfo: {},
 				couponData: [], // 可领优惠卷
 				goodsData: [], // 可领优惠卷
-        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
+				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) {
 			if (e) {
 				this.shop_id = e.shop_id
-        this.operate_id = uni.getStorageSync('operate_id')
+				this.operate_id = uni.getStorageSync('operate_id')
 				this.shopInfo()
 			}
 		},
@@ -254,81 +268,84 @@
 			this.shopCoupon()
 		},
 		methods: {
-      setShopIngDel(){
-        uni.showModal({
-          title: '提示',
-          content: '是否清除购物车商品?',
-          success: (res) => {
-            console.log(res)
-            if (res.confirm) {
-
-              setShopIngDel({
-                'shop_id': this.shop_id,
-                'type': 1,
-              }).then((res) => {
-                if (res.code === 1) {
-                 tools.success(res.msg)
-                  this.getShopIngList()
-                } else {
-                  tools.error(res.msg)
-                }
-              })
-            }
-          }
-        });
-      },
-      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
-          }
-        })
-      },
+			setShopIngDel() {
+				uni.showModal({
+					title: '提示',
+					content: '是否清除购物车商品?',
+					success: (res) => {
+						console.log(res)
+						if (res.confirm) {
+
+							setShopIngDel({
+								'shop_id': this.shop_id,
+								'type': 1,
+							}).then((res) => {
+								if (res.code === 1) {
+									tools.success(res.msg)
+									this.getShopIngList()
+								} else {
+									tools.error(res.msg)
+								}
+							})
+						}
+					}
+				});
+			},
+			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) {
-				receiveCoupon({grant_id: item.grant_id,coupon_id: item.coupon_id}).then((res) => {
-					if(res.code == 1) {
+				receiveCoupon({
+					grant_id: item.grant_id,
+					coupon_id: item.coupon_id
+				}).then((res) => {
+					if (res.code == 1) {
 						tools.success(res.msg)
 						this.couponData = []
 						this.shopCoupon()
-					}else {
+					} else {
 						tools.error(res.msg)
 					}
 				})
@@ -373,7 +390,7 @@
 			},
 			toConfirmOrder() {
 				uni.navigateTo({
-					url: '/pages-takeout/confirm-order'
+					url: '/pages-takeout/goods-order?shop_id=' + this.shop_id
 				})
 			},
 			shopInfo() {
@@ -384,10 +401,10 @@
 				}).then((res) => {
 					if (res.code == 1) {
 						this.shopsInfo = res.data
-					}else {
-            tools.error(res.msg)
-            tools.leftClick()
-          }
+					} else {
+						tools.error(res.msg)
+						tools.leftClick()
+					}
 				})
 			},
 			shopCoupon() {
@@ -396,10 +413,10 @@
 					shop_id: this.shop_id
 				}).then((res) => {
 					if (res.code == 1) {
-						if(res.data.length>0) {
+						if (res.data.length > 0) {
 							this.domHeigjt = 224
 							this.couponData = res.data
-						}else {
+						} else {
 							this.domHeigjt = 156
 							// console.log(this.domHeigjt, '1111111111111111111');
 						}
@@ -411,9 +428,10 @@
 </script>
 
 <style scoped lang="scss">
-	.blank-text{
+	.blank-text {
 		line-height: 32vh;
 	}
+
 	.pop-coupon {
 		width: 100%;
 		height: 42vh;
@@ -529,7 +547,8 @@
 			height: 280rpx;
 			z-index: -1;
 		}
-		.mb-box{
+
+		.mb-box {
 			position: absolute;
 			top: 0;
 			left: 0;

+ 6 - 2
pages.json

@@ -194,18 +194,22 @@
 					}
 				},
 				{
-
 					"path": "aptitude",
 					"style": {
 						"navigationBarTitleText": "资质"
 					}
 				},
 				{
-
 					"path": "confirm-order",
 					"style": {
 						"navigationBarTitleText": "提交订单"
 					}
+				},
+				{
+					"path": "goods-order",
+					"style": {
+						"navigationBarTitleText": "商品提交订单"
+					}
 				}
 			]
 		},

+ 1 - 1
pages/index/index.vue

@@ -349,7 +349,6 @@
 		},
 		mounted() {
 			this.couponHome()
-			uni.hideTabBar()
 		},
 		methods: {
 			couponHome() {
@@ -359,6 +358,7 @@
 				}).then((res) => {
 					if (res.code == 1) {
 						if (res.data.length > 0) {
+							uni.hideTabBar()
 							this.couponData = res.data
 							this.$refs.popup.open()
 						}