py 1 год назад
Родитель
Сommit
e9c1d5ea65

+ 3 - 1
api/express.js

@@ -10,4 +10,6 @@ export const getExpressCoupon = (data) => request(newsUrl + 'coupon', 'post', {
 // 创建订单
 // 创建订单
 export const getExpressCreate = (data) => request(newsUrl + 'create', 'post', { ...data },false)
 export const getExpressCreate = (data) => request(newsUrl + 'create', 'post', { ...data },false)
 // 创建支付
 // 创建支付
-export const getExpressPay = (data) => request('/api/expressOrder/' + 'pay', 'post', { ...data },false)
+export const getExpressPay = (data) => request('/api/expressOrder/' + 'pay', 'post', { ...data },false)
+// 代取支付
+export const expressPayInfo = (data) => request('/api/expressOrder/' + 'pay_info', 'post', { ...data },false)

+ 2 - 0
api/groupOrder.js

@@ -10,6 +10,8 @@ export const groupInfo = (data) => request(newsUrl + 'info', 'post', { ...data }
 export const groupCreate = (data) => request(newsUrl + 'create', 'post', { ...data },false)
 export const groupCreate = (data) => request(newsUrl + 'create', 'post', { ...data },false)
 // 支付订单
 // 支付订单
 export const groupPay = (data) => request(newsUrlTwo + 'pay', 'post', { ...data },false)
 export const groupPay = (data) => request(newsUrlTwo + 'pay', 'post', { ...data },false)
+// 支付详情
+export const groupPayInfo = (data) => request(newsUrlTwo + 'pay_info', 'post', { ...data },false)
 // 获取订单列表
 // 获取订单列表
 export const groupOrderList = (data) => request(newsUrlTwo + 'list', 'post', { ...data },false)
 export const groupOrderList = (data) => request(newsUrlTwo + 'list', 'post', { ...data },false)
 // 获取订单详情
 // 获取订单详情

+ 1 - 1
pages-buy/group-goods-info.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
 	<view class="flex-common-css iPhone-bottom box-border-box">
 	<view class="flex-common-css iPhone-bottom box-border-box">
 		<Nav :title="shop_name" :bgckgroundBox='"transparent"' leftColor="#fff" titleColor="#fff"></Nav>
 		<Nav :title="shop_name" :bgckgroundBox='"transparent"' leftColor="#fff" titleColor="#fff"></Nav>
-		<image src="/pages-buy/static/bg-2.png" mode="" class="bg-img"></image>
+		<image src="https://sjz-school.oss-cn-chengdu.aliyuncs.com/webImages/bg-2.pngs" mode="" class="bg-img"></image>
 		<uni-popup ref="popup" type="top" border-radius="0 0 10px 10px">
 		<uni-popup ref="popup" type="top" border-radius="0 0 10px 10px">
 			<view class="pop-box bgc-f" :style="[{'padding-top': popTop + 'px'}]">
 			<view class="pop-box bgc-f" :style="[{'padding-top': popTop + 'px'}]">
 				<view class="p-24 box-border-box">
 				<view class="p-24 box-border-box">

+ 257 - 0
pages-buy/group-pay-page.vue

@@ -0,0 +1,257 @@
+<template>
+	<view class="flex-common-css iPhone-bottom flex-common-css box-border-box">
+		<Nav title="订单支付" bgckgroundBox='transparent'></Nav>
+		<scroll-view :scroll-y="true" class="box-sizing-border scroll-view-css plr-30 box-border-box">
+			<view class="fs-28 fc-121212 mb-20 p-t-40 text-align-center">
+				剩余时间 {{time.m}}:{{time.s}}
+			</view>
+			<view class="align-items-baseline flex-justify-center mb-40">
+				<view class="fs-40 fw-500 fc-FB3D03">
+					¥
+				</view>
+				<view class="fs-64 fw-500 fc-FB3D03">
+					{{Number(payData.pay_money).toFixed(2) || '0.00'}}
+				</view>
+			</view>
+			<view class="mb-40 text-align-center">
+				订单编号: {{payData.order_sn}}
+			</view>
+			<view class="fs-32 fw-500 fc-3 mb-22">
+				支付方式
+			</view>
+			<view class="plr-16 box-border-box b-rad-20 bgc-f">
+				<view class="align-items-center flex-justify-space p-26-0 b-t-F4" @click="setPayType(3)">
+					<view class="align-items-center">
+						<image class="icon-img mr-16" src="static/ye.png" mode=""></image>
+						<view class="fs-28 fc-333">
+							余额支付
+						</view>
+						<view class="fs-28 fc-707070">
+							(可用{{Number(payData.member_money).toFixed(2) || '0.00'}})
+						</view>
+					</view>
+					<image v-if="payType === 3" class="w-h-36 mr-10" src="@/static/img/common/y-select.png" mode="">
+					</image>
+					<image v-else class="w-h-36 mr-10" src="@/static/img/common/n-select.png" mode=""></image>
+				</view>
+				<view class="align-items-center flex-justify-space p-26-0 b-t-F4" @click="setPayType(1)">
+					<view class="align-items-center">
+						<image class="icon-img mr-16" src="@/static/img/common/wx-zf.png" mode="scaleToFill"></image>
+						<view class="fs-28 fc-333">
+							微信支付
+						</view>
+					</view>
+					<image v-if="payType === 1" class="w-h-36 mr-10" src="@/static/img/common/y-select.png" mode="">
+					</image>
+					<image v-else class="w-h-36 mr-10" src="@/static/img/common/n-select.png" mode=""></image>
+				</view>
+			</view>
+			<view class="fs-32 fw-500 fc-f text-align-center pay-but b-rad-200" @click="paySure"
+				:class="butType === 1?'bgc-4FB3EF':'bgc-9'">
+				立即支付¥{{Number(payData.pay_money).toFixed(2) || '0.00'}}
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import {
+		groupPay,
+		groupPayInfo
+	} from '@/api/groupOrder.js';
+	import tools from "@/service/tools.js"
+	export default {
+		data() {
+			return {
+				payType: 1,
+				order_id: 0,
+				isAJAX: false,
+				payData: {},
+				butType: 1,
+				time: {
+					day: '',
+					h: "",
+					m: '',
+					s: '',
+				},
+			}
+		},
+		onLoad(data) {
+			if (data) {
+				this.order_id = data.orderId
+				this.groupPayInfo()
+			}
+		},
+		mounted() {},
+		methods: {
+			groupPayInfo() {
+				groupPayInfo({
+					order_id: this.order_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.payData = res.data
+						let createDate = new Date(res.data.created_at); //格式化订单创建时候的时间
+						createDate.setMinutes(createDate.getMinutes() + 10)
+						this.setCountDown(createDate)
+					}
+				})
+			},
+			setCountDown(sTime) {
+				let end = new Date(sTime).getTime();
+				let now = new Date().getTime();
+				let msec = end - now;
+				this.time.day = parseInt(msec / 1000 / 60 / 60 / 24);
+				let h = parseInt(msec / 1000 / 60 / 60 % 24);
+				let m = parseInt(msec / 1000 / 60 % 60);
+				let s = parseInt(msec / 1000 % 60);
+				this.time.h = h > 9 ? h : '0' + h;
+				this.time.m = m > 9 ? m : '0' + m;
+				this.time.s = s > 9 ? s : '0' + s;
+				msec -= 1000;
+				if (this.time.day >= 1) {
+					this.showTime = true;
+				} else {
+					this.showTime = false;
+				};
+				if (msec >= 0) {
+					setTimeout(() => {
+						this.setCountDown(sTime);
+					}, 1000);
+				} else {
+					this.isTimeEnd = true;
+					this.bText = '活动结束';
+					this.time.h = '--';
+					this.time.m = '--';
+					this.time.s = '--';
+				};
+			},
+			setPayType(payType) {
+				this.payType = payType
+				if (payType === 3) {
+					if (Number(this.payData.member_money) < Number(this.payData.pay_money)) {
+						this.butType = 2
+					} else {
+						this.butType = 1
+					}
+				} else {
+					this.butType = 1
+				}
+			},
+			paySure() {
+				if (this.butType === 2) {
+					return
+				}
+				groupPay({
+					order_id: this.order_id,
+					pay_type: this.payType
+				}).then((ret) => {
+					if (ret.code === 1) {
+						// if (this.payType === 1) {}else if (this.payType === 3) {}
+						if (this.payType === 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) => {
+									this.isAJAX = false;
+									tools.success("支付成功");
+									uni.setStorageSync('orderPayType', 3)
+									setTimeout(() => {
+										uni.switchTab({
+											url: "/pages/order/index"
+										})
+									}, 1000)
+								},
+								fail: (err) => {
+									this.isAJAX = false;
+									tools.error("支付失败");
+									uni.setStorageSync('orderPayType', 3)
+									setTimeout(() => {
+										uni.switchTab({
+											url: "/pages/order/index"
+										})
+									}, 1000)
+								},
+							});
+						} else if (this.payType === 3) {
+							this.isAJAX = false;
+							tools.success("支付成功");
+							uni.setStorageSync('orderPayType', 3)
+							setTimeout(() => {
+								uni.switchTab({
+									url: "/pages/order/index"
+								})
+							}, 1000)
+						}
+					} else {
+						this.isAJAX = false;
+						tools.error("支付失败");
+						uni.setStorageSync('orderPayType', 3)
+						setTimeout(() => {
+							uni.switchTab({
+								url: "/pages/order/index"
+							})
+						}, 1000)
+					}
+				})
+			}
+		},
+	}
+</script>
+<style lang="scss" scoped>
+	.pop-box {
+		width: 80vw;
+		height: 30vh;
+	}
+
+	.p-t-40 {
+		padding: 40rpx 0 0;
+	}
+
+	.p-12-30 {
+		padding: 12rpx 30rpx;
+	}
+
+	.p-23-16 {
+		padding: 23rpx 16rpx;
+	}
+
+	.plr-16 {
+		padding: 0 16rpx;
+	}
+
+	.p-26-0 {
+		padding: 26rpx 0;
+	}
+
+	.icon-img {
+		width: 40rpx;
+		height: 40rpx;
+	}
+
+	.w-h-36 {
+		width: 36rpx;
+		height: 36rpx;
+	}
+
+	.pay-but {
+		width: 100%;
+		height: 80rpx;
+		line-height: 80rpx;
+		margin: 30rpx auto;
+	}
+
+	.pop-but {
+		width: 80%;
+		padding: 24rpx 0;
+		margin: auto;
+
+		.add-card {
+			width: 40rpx;
+			height: 40rpx;
+		}
+	}
+</style>

+ 46 - 43
pages-buy/group-pay.vue

@@ -110,49 +110,52 @@
 				this.fromData.school_id = uni.getStorageSync('school_id');
 				this.fromData.school_id = uni.getStorageSync('school_id');
 				groupCreate(this.fromData).then((res) => {
 				groupCreate(this.fromData).then((res) => {
 					if (res.code === 1) {
 					if (res.code === 1) {
-						groupPay({
-							order_id: res.data.order_id
-						}).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) => {
-										this.isAJAX = false;
-										tools.success("支付成功");
-										uni.setStorageSync('orderPayType', 3)
-										setTimeout(() => {
-											uni.switchTab({
-												url: "/pages/order/index"
-											})
-										}, 1000)
-									},
-									fail: (err) => {
-										this.isAJAX = false;
-										tools.error("支付失败");
-										uni.setStorageSync('orderPayType', 3)
-										setTimeout(() => {
-											uni.switchTab({
-												url: "/pages/order/index"
-											})
-										}, 1000)
-									},
-								});
-							} else {
-								this.isAJAX = false;
-								tools.error("支付失败");
-								uni.setStorageSync('orderPayType', 3)
-								setTimeout(() => {
-									uni.switchTab({
-										url: "/pages/order/index"
-									})
-								}, 1000)
-							}
-						})
+						uni.redirectTo({
+							url: `/pages-buy/group-pay-page?orderId=${res.data.order_id}`
+						});
+						// groupPay({
+						// 	order_id: res.data.order_id
+						// }).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) => {
+						// 				this.isAJAX = false;
+						// 				tools.success("支付成功");
+						// 				uni.setStorageSync('orderPayType', 3)
+						// 				setTimeout(() => {
+						// 					uni.switchTab({
+						// 						url: "/pages/order/index"
+						// 					})
+						// 				}, 1000)
+						// 			},
+						// 			fail: (err) => {
+						// 				this.isAJAX = false;
+						// 				tools.error("支付失败");
+						// 				uni.setStorageSync('orderPayType', 3)
+						// 				setTimeout(() => {
+						// 					uni.switchTab({
+						// 						url: "/pages/order/index"
+						// 					})
+						// 				}, 1000)
+						// 			},
+						// 		});
+						// 	} else {
+						// 		this.isAJAX = false;
+						// 		tools.error("支付失败");
+						// 		uni.setStorageSync('orderPayType', 3)
+						// 		setTimeout(() => {
+						// 			uni.switchTab({
+						// 				url: "/pages/order/index"
+						// 			})
+						// 		}, 1000)
+						// 	}
+						// })
 					} else {
 					} else {
 						this.isAJAX = false;
 						this.isAJAX = false;
 						tools.error(res.msg);
 						tools.error(res.msg);

BIN
pages-buy/static/bg-2.png


+ 55 - 52
pages-takeout/confirm-order.vue

@@ -75,15 +75,15 @@
 					<input v-model="fromData.note" class="flex-1 text-align-right fs-28" type="text"
 					<input v-model="fromData.note" class="flex-1 text-align-right fs-28" type="text"
 						placeholder="请填写你的备注">
 						placeholder="请填写你的备注">
 				</view>
 				</view>
-				<view class="p-b-20"></view>
+				<!-- <view class="p-b-20"></view> -->
 			</view>
 			</view>
-			<view class="box-card box-border-box mb-20 bgc-f flex-justify-space">
+<!-- 			<view class="box-card box-border-box mb-20 bgc-f flex-justify-space">
 				<view class="fs-28 fw-600 w158">支付方式</view>
 				<view class="fs-28 fw-600 w158">支付方式</view>
 				<view class="wx-box display-flex">
 				<view class="wx-box display-flex">
 					<image src="@/static/img/common/wx-zf.png" mode="scaleToFill"></image>
 					<image src="@/static/img/common/wx-zf.png" mode="scaleToFill"></image>
 					<view class="fs-28 fw-400 ml-10">微信支付</view>
 					<view class="fs-28 fw-400 ml-10">微信支付</view>
 				</view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		</view>
 		<view class="bottom-box box-border-box p-24">
 		<view class="bottom-box box-border-box p-24">
 			<view class="flex-justify-space">
 			<view class="flex-justify-space">
@@ -275,55 +275,58 @@
 				this.fromData.site_id = uni.getStorageSync('site_id');
 				this.fromData.site_id = uni.getStorageSync('site_id');
 				getExpressCreate(this.fromData).then((res) => {
 				getExpressCreate(this.fromData).then((res) => {
 					if (res.code === 1) {
 					if (res.code === 1) {
-						getExpressPay({
-							order_id: res.data.order_id
-						}).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) => {
-										uni.removeStorageSync('isConfirmAddressFlag')
-										tools.success("支付成功");
-										this.isAJAX = false;
-										setTimeout(() => {
-											uni.switchTab({
-												url: "/pages/order/index"
-											})
-											uni.setStorageSync('orderPayType', 2)
-											uni.setStorageSync('saveData', false)
-										}, 1000)
-									},
-									fail: (err) => {
-										uni.removeStorageSync('isConfirmAddressFlag')
-										this.isAJAX = false;
-										tools.error("支付失败");
-										setTimeout(() => {
-											uni.switchTab({
-												url: "/pages/order/index"
-											})
-											uni.setStorageSync('orderPayType', 2)
-											uni.setStorageSync('saveData', false)
-										}, 1000)
-									},
-								});
-							} else {
-								uni.removeStorageSync('isConfirmAddressFlag')
-								this.isAJAX = false;
-								tools.error("支付失败");
-								setTimeout(() => {
-									uni.switchTab({
-										url: "/pages/order/index"
-									})
-									uni.setStorageSync('orderPayType', 2)
-									uni.setStorageSync('saveData', false)
-								}, 1000)
-							}
-						})
+						uni.redirectTo({
+							url: `/pages-takeout/pick-up-pay?orderId=${res.data.order_id}`
+						});
+						// getExpressPay({
+						// 	order_id: res.data.order_id
+						// }).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) => {
+						// 				uni.removeStorageSync('isConfirmAddressFlag')
+						// 				tools.success("支付成功");
+						// 				this.isAJAX = false;
+						// 				setTimeout(() => {
+						// 					uni.switchTab({
+						// 						url: "/pages/order/index"
+						// 					})
+						// 					uni.setStorageSync('orderPayType', 2)
+						// 					uni.setStorageSync('saveData', false)
+						// 				}, 1000)
+						// 			},
+						// 			fail: (err) => {
+						// 				uni.removeStorageSync('isConfirmAddressFlag')
+						// 				this.isAJAX = false;
+						// 				tools.error("支付失败");
+						// 				setTimeout(() => {
+						// 					uni.switchTab({
+						// 						url: "/pages/order/index"
+						// 					})
+						// 					uni.setStorageSync('orderPayType', 2)
+						// 					uni.setStorageSync('saveData', false)
+						// 				}, 1000)
+						// 			},
+						// 		});
+						// 	} else {
+						// 		uni.removeStorageSync('isConfirmAddressFlag')
+						// 		this.isAJAX = false;
+						// 		tools.error("支付失败");
+						// 		setTimeout(() => {
+						// 			uni.switchTab({
+						// 				url: "/pages/order/index"
+						// 			})
+						// 			uni.setStorageSync('orderPayType', 2)
+						// 			uni.setStorageSync('saveData', false)
+						// 		}, 1000)
+						// 	}
+						// })
 					} else {
 					} else {
 						this.isAJAX = false;
 						this.isAJAX = false;
 						tools.error(res.msg);
 						tools.error(res.msg);

+ 264 - 0
pages-takeout/pick-up-pay.vue

@@ -0,0 +1,264 @@
+<template>
+	<view class="flex-common-css iPhone-bottom flex-common-css box-border-box">
+		<Nav title="订单支付" bgckgroundBox='transparent'></Nav>
+		<scroll-view :scroll-y="true" class="box-sizing-border scroll-view-css plr-30 box-border-box">
+			<view class="fs-28 fc-121212 mb-20 p-t-40 text-align-center">
+				剩余时间 {{time.m}}:{{time.s}}
+			</view>
+			<view class="align-items-baseline flex-justify-center mb-40">
+				<view class="fs-40 fw-500 fc-FB3D03">
+					¥
+				</view>
+				<view class="fs-64 fw-500 fc-FB3D03">
+					{{Number(payData.pay_money).toFixed(2) || '0.00'}}
+				</view>
+			</view>
+			<view class="mb-40 text-align-center">
+				订单编号: {{payData.order_sn}}
+			</view>
+			<view class="fs-32 fw-500 fc-3 mb-22">
+				支付方式
+			</view>
+			<view class="plr-16 box-border-box b-rad-20 bgc-f">
+				<view class="align-items-center flex-justify-space p-26-0 b-t-F4" @click="setPayType(3)">
+					<view class="align-items-center">
+						<image class="icon-img mr-16" src="static/ye.png" mode=""></image>
+						<view class="fs-28 fc-333">
+							余额支付
+						</view>
+						<view class="fs-28 fc-707070">
+							(可用{{Number(payData.member_money).toFixed(2) || '0.00'}})
+						</view>
+					</view>
+					<image v-if="payType === 3" class="w-h-36 mr-10" src="@/static/img/common/y-select.png" mode="">
+					</image>
+					<image v-else class="w-h-36 mr-10" src="@/static/img/common/n-select.png" mode=""></image>
+				</view>
+				<view class="align-items-center flex-justify-space p-26-0 b-t-F4" @click="setPayType(1)">
+					<view class="align-items-center">
+						<image class="icon-img mr-16" src="@/static/img/common/wx-zf.png" mode="scaleToFill"></image>
+						<view class="fs-28 fc-333">
+							微信支付
+						</view>
+					</view>
+					<image v-if="payType === 1" class="w-h-36 mr-10" src="@/static/img/common/y-select.png" mode="">
+					</image>
+					<image v-else class="w-h-36 mr-10" src="@/static/img/common/n-select.png" mode=""></image>
+				</view>
+			</view>
+			<view class="fs-32 fw-500 fc-f text-align-center pay-but b-rad-200" @click="paySure"
+				:class="butType === 1?'bgc-4FB3EF':'bgc-9'">
+				立即支付¥{{Number(payData.pay_money).toFixed(2) || '0.00'}}
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import {
+		getExpressPay,
+		expressPayInfo
+	} from '@/api/express.js';
+	import tools from "@/service/tools.js"
+	export default {
+		data() {
+			return {
+				payType: 1,
+				order_id: 0,
+				isAJAX: false,
+				payData: {},
+				butType: 1,
+				time: {
+					day: '',
+					h: "",
+					m: '',
+					s: '',
+				},
+			}
+		},
+		onLoad(data) {
+			if (data) {
+				this.order_id = data.orderId
+				this.expressPayInfo()
+			}
+		},
+		mounted() {},
+		methods: {
+			expressPayInfo() {
+				expressPayInfo({
+					order_id: this.order_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.payData = res.data
+						let createDate = new Date(res.data.created_at); //格式化订单创建时候的时间
+						createDate.setMinutes(createDate.getMinutes() + 10)
+						this.setCountDown(createDate)
+					}
+				})
+			},
+			setCountDown(sTime) {
+				let end = new Date(sTime).getTime();
+				let now = new Date().getTime();
+				let msec = end - now;
+				this.time.day = parseInt(msec / 1000 / 60 / 60 / 24);
+				let h = parseInt(msec / 1000 / 60 / 60 % 24);
+				let m = parseInt(msec / 1000 / 60 % 60);
+				let s = parseInt(msec / 1000 % 60);
+				this.time.h = h > 9 ? h : '0' + h;
+				this.time.m = m > 9 ? m : '0' + m;
+				this.time.s = s > 9 ? s : '0' + s;
+				msec -= 1000;
+				if (this.time.day >= 1) {
+					this.showTime = true;
+				} else {
+					this.showTime = false;
+				};
+				if (msec >= 0) {
+					setTimeout(() => {
+						this.setCountDown(sTime);
+					}, 1000);
+				} else {
+					this.isTimeEnd = true;
+					this.bText = '活动结束';
+					this.time.h = '--';
+					this.time.m = '--';
+					this.time.s = '--';
+				};
+			},
+			setPayType(payType) {
+				this.payType = payType
+				if (payType === 3) {
+					if (Number(this.payData.member_money) < Number(this.payData.pay_money)) {
+						this.butType = 2
+					} else {
+						this.butType = 1
+					}
+				} else {
+					this.butType = 1
+				}
+			},
+			paySure() {
+				if (this.butType === 2) {
+					return
+				}
+				getExpressPay({
+					order_id: this.order_id,
+					pay_type: this.payType
+				}).then((ret) => {
+					if (ret.code === 1) {
+						if (this.payType === 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) => {
+									uni.removeStorageSync('isConfirmAddressFlag')
+									tools.success("支付成功");
+									this.isAJAX = false;
+									setTimeout(() => {
+										uni.switchTab({
+											url: "/pages/order/index"
+										})
+										uni.setStorageSync('orderPayType', 2)
+										uni.setStorageSync('saveData', false)
+									}, 1000)
+								},
+								fail: (err) => {
+									uni.removeStorageSync('isConfirmAddressFlag')
+									this.isAJAX = false;
+									tools.error("支付失败");
+									setTimeout(() => {
+										uni.switchTab({
+											url: "/pages/order/index"
+										})
+										uni.setStorageSync('orderPayType', 2)
+										uni.setStorageSync('saveData', false)
+									}, 1000)
+								},
+							});
+						} else if (this.payType === 3) {
+							uni.removeStorageSync('isConfirmAddressFlag')
+							tools.success("支付成功");
+							this.isAJAX = false;
+							setTimeout(() => {
+								uni.switchTab({
+									url: "/pages/order/index"
+								})
+								uni.setStorageSync('orderPayType', 2)
+								uni.setStorageSync('saveData', false)
+							}, 1000)
+						}
+					} else {
+						uni.removeStorageSync('isConfirmAddressFlag')
+						this.isAJAX = false;
+						tools.error("支付失败");
+						setTimeout(() => {
+							uni.switchTab({
+								url: "/pages/order/index"
+							})
+							uni.setStorageSync('orderPayType', 2)
+							uni.setStorageSync('saveData', false)
+						}, 1000)
+					}
+				})
+			}
+		},
+	}
+</script>
+<style lang="scss" scoped>
+	.pop-box {
+		width: 80vw;
+		height: 30vh;
+	}
+
+	.p-t-40 {
+		padding: 40rpx 0 0;
+	}
+
+	.p-12-30 {
+		padding: 12rpx 30rpx;
+	}
+
+	.p-23-16 {
+		padding: 23rpx 16rpx;
+	}
+
+	.plr-16 {
+		padding: 0 16rpx;
+	}
+
+	.p-26-0 {
+		padding: 26rpx 0;
+	}
+
+	.icon-img {
+		width: 40rpx;
+		height: 40rpx;
+	}
+
+	.w-h-36 {
+		width: 36rpx;
+		height: 36rpx;
+	}
+
+	.pay-but {
+		width: 100%;
+		height: 80rpx;
+		line-height: 80rpx;
+		margin: 30rpx auto;
+	}
+
+	.pop-but {
+		width: 80%;
+		padding: 24rpx 0;
+		margin: auto;
+
+		.add-card {
+			width: 40rpx;
+			height: 40rpx;
+		}
+	}
+</style>

+ 63 - 32
pages-takeout/replace-take.vue

@@ -53,13 +53,11 @@
 								</view>
 								</view>
 								<view class="display-flex align-items-center">
 								<view class="display-flex align-items-center">
 									<image v-if="item.number > 0" class="wh44" src="@/static/img/takeout/j.png" mode=""
 									<image v-if="item.number > 0" class="wh44" src="@/static/img/takeout/j.png" mode=""
-										@click="redNumber(1,item)"></image>
-									<!-- <view v-if="item.number > 0" class="right-only-right-red fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="redNumber(1,item)">-</view> -->
+										@click="setShoppingSave(1,item, 2)"></image>
 									<view v-if="item.number > 0"
 									<view v-if="item.number > 0"
 										class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}</view>
 										class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}</view>
-									<!-- <view class="right-only-right-add fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="addNumber(1,item)">+</view> -->
 									<image class="wh44" src="@/static/img/takeout/add.png" mode=""
 									<image class="wh44" src="@/static/img/takeout/add.png" mode=""
-										@click="addNumber(1,item)"></image>
+										@click="setShoppingSave(1,item, 1)"></image>
 								</view>
 								</view>
 							</view>
 							</view>
 						</view>
 						</view>
@@ -124,13 +122,11 @@
 								</view>
 								</view>
 								<view class="display-flex align-items-center">
 								<view class="display-flex align-items-center">
 									<image class="wh44" src="@/static/img/takeout/j.png" mode=""
 									<image class="wh44" src="@/static/img/takeout/j.png" mode=""
-										@click="redNumber(2,item)"></image>
-									<!-- <view class="right-only-right-red fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="redNumber(2,item)">-</view> -->
+										@click="setShoppingSave(2,item, 2)"></image>
 									<view class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}
 									<view class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}
 									</view>
 									</view>
-									<!-- <view class="right-only-right-add fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="addNumber(2,item)">+</view> -->
 									<image class="wh44" src="@/static/img/takeout/add.png" mode=""
 									<image class="wh44" src="@/static/img/takeout/add.png" mode=""
-										@click="addNumber(2,item)"></image>
+										@click="setShoppingSave(2,item,1)"></image>
 								</view>
 								</view>
 							</view>
 							</view>
 						</view>
 						</view>
@@ -165,6 +161,9 @@
 	import {
 	import {
 		getExpressServe
 		getExpressServe
 	} from '@/api/express.js';
 	} from '@/api/express.js';
+	import {
+		shoppingSave
+	} from "@/api/shopping.js"
 	import {
 	import {
 		setShopIngAdd,
 		setShopIngAdd,
 		setShopIngNumber,
 		setShopIngNumber,
@@ -208,7 +207,7 @@
 					total_num: 0,
 					total_num: 0,
 					total_price: 0,
 					total_price: 0,
 				},
 				},
-			this.schoolData.school_id = uni.getStorageSync('school_id');
+				this.schoolData.school_id = uni.getStorageSync('school_id');
 			this.schoolData.school_name = uni.getStorageSync('school_name');
 			this.schoolData.school_name = uni.getStorageSync('school_name');
 			this.addressData.site_id = uni.getStorageSync('site_id');
 			this.addressData.site_id = uni.getStorageSync('site_id');
 			this.addressData.site_name = uni.getStorageSync('site_name');
 			this.addressData.site_name = uni.getStorageSync('site_name');
@@ -257,28 +256,28 @@
 								}
 								}
 							}
 							}
 							// 初始设置code 输入框数量
 							// 初始设置code 输入框数量
-              console.log(this.pickup_code.length,this.cardData.total_num)
-              console.log(this.pickup_code.length<this.cardData.total_num)
-              if(this.pickup_code.length<this.cardData.total_num){
-                let maxNum = this.cardData.total_num-this.pickup_code.length
-                console.log(maxNum)
-                console.log('易安居完成asssssssssssssssssssss')
-                for (let i = 0; i < maxNum; i++) {
-                  let obj = {
-                    code: ''
-                  };
-                  this.pickup_code.push(obj);
-                  console.log( '---------------易安居完成'+i )
-                }
-                console.log( this.pickup_code)
-              }
-              // let saveData = uni.getStorageSync('saveData')
-              // if (saveData) {
-              //   return
-              // } else {
-              //   this.pickup_code = [];
-              //
-              // }
+							console.log(this.pickup_code.length, this.cardData.total_num)
+							console.log(this.pickup_code.length < this.cardData.total_num)
+							if (this.pickup_code.length < this.cardData.total_num) {
+								let maxNum = this.cardData.total_num - this.pickup_code.length
+								console.log(maxNum)
+								console.log('易安居完成asssssssssssssssssssss')
+								for (let i = 0; i < maxNum; i++) {
+									let obj = {
+										code: ''
+									};
+									this.pickup_code.push(obj);
+									console.log('---------------易安居完成' + i)
+								}
+								console.log(this.pickup_code)
+							}
+							// let saveData = uni.getStorageSync('saveData')
+							// if (saveData) {
+							//   return
+							// } else {
+							//   this.pickup_code = [];
+							//
+							// }
 						} else {
 						} else {
 							this.list.forEach(t => {
 							this.list.forEach(t => {
 								t.number = 0;
 								t.number = 0;
@@ -341,6 +340,38 @@
 					url: 'pages-takeout/confirm-order?pickup_code=' + pickup_code + '&type=2'
 					url: 'pages-takeout/confirm-order?pickup_code=' + pickup_code + '&type=2'
 				})
 				})
 			},
 			},
+			setShoppingSave(type, item, num) {
+				if (num === 1) {
+					item.number = item.number + 1
+					let obj = {
+						code: ''
+					};
+					this.pickup_code.push(obj);
+				} else {
+					item.number -= 1
+					this.pickup_code.pop();
+				}
+				if (this.isAJAX) {
+					return
+				}
+				this.isAJAX = true;
+				let id = type == 1 ? item.id : item.goods_id;
+				shoppingSave({
+					type: 2,
+					goods_id: id,
+					number: item.number
+				}).then((res) => {
+					if (res.code === 1) {
+						this.isAJAX = false;
+						this.$forceUpdate();
+						this.isInitial = false;
+						this.getCard();
+					} else {
+						this.isAJAX = false;
+						tools.error('添加操作失败')
+					}
+				})
+			},
 			// 增加
 			// 增加
 			addNumber(type, item) {
 			addNumber(type, item) {
 				if (this.isAJAX) {
 				if (this.isAJAX) {
@@ -637,4 +668,4 @@
 		}
 		}
 
 
 	}
 	}
-</style>
+</style>

BIN
pages-takeout/static/qp.png


BIN
pages-takeout/static/ye.png


+ 12 - 0
pages.json

@@ -120,6 +120,12 @@
 						"navigationBarTitleText": "团购支付订单"
 						"navigationBarTitleText": "团购支付订单"
 					}
 					}
 				},
 				},
+				{
+					"path": "group-pay-page",
+					"style": {
+						"navigationBarTitleText": "团购支付"
+					}
+				},
 				{
 				{
 					"path": "group-refund",
 					"path": "group-refund",
 					"style": {
 					"style": {
@@ -218,6 +224,12 @@
 						"navigationBarTitleText": "提交订单"
 						"navigationBarTitleText": "提交订单"
 					}
 					}
 				},
 				},
+				{
+					"path": "pick-up-pay",
+					"style": {
+						"navigationBarTitleText": "代取支付"
+					}
+				},
 				{
 				{
 					"path": "goods-order",
 					"path": "goods-order",
 					"style": {
 					"style": {

+ 2 - 2
pages/index/index.vue

@@ -486,8 +486,8 @@
 			uni.removeStorageSync('orderInfoType')
 			uni.removeStorageSync('orderInfoType')
 		},
 		},
 		onLoad(data) {
 		onLoad(data) {
-			if (data.inviteCode !== undefined) {
-				uni.setStorageSync('inviteCode', data.inviteCode)
+			if (data.iCode !== undefined) {
+				uni.setStorageSync('inviteCode', data.iCode)
 			}
 			}
 			this.page = 1;
 			this.page = 1;
 			this.goodsList = [];
 			this.goodsList = [];

+ 104 - 96
pages/order/index.vue

@@ -808,108 +808,116 @@
 					url: `/pages-takeout/pay-page?orderId=${id}`
 					url: `/pages-takeout/pay-page?orderId=${id}`
 				});
 				});
 				return
 				return
-				if (this.isAJAX) {
-					return
-				}
-				this.isAJAX = true;
-				orderPay({
-					order_id: id
-				}).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;
-								this.page = 1;
-								this.list = [];
-								this.orderList()
-							},
-							fail: (err) => {
-								this.isAJAX = false;
-								tools.error("支付失败");
-							},
-						});
-					} else {
-						this.isAJAX = false;
-						tools.error("支付失败");
-					}
-				})
+				// if (this.isAJAX) {
+				// 	return
+				// }
+				// this.isAJAX = true;
+				// orderPay({
+				// 	order_id: id
+				// }).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;
+				// 				this.page = 1;
+				// 				this.list = [];
+				// 				this.orderList()
+				// 			},
+				// 			fail: (err) => {
+				// 				this.isAJAX = false;
+				// 				tools.error("支付失败");
+				// 			},
+				// 		});
+				// 	} else {
+				// 		this.isAJAX = false;
+				// 		tools.error("支付失败");
+				// 	}
+				// })
 			},
 			},
 			getExpressPay(id) {
 			getExpressPay(id) {
 				// 代取支付
 				// 代取支付
-				if (this.isAJAX) {
-					return
-				}
-				this.isAJAX = true;
-				getExpressPay({
-					order_id: id
-				}).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;
-								this.page = 1;
-								this.list = [];
-								this.expressOrderList()
-							},
-							fail: (err) => {
-								this.isAJAX = false;
-								tools.error("支付失败");
-							},
-						});
-					} else {
-						this.isAJAX = false;
-						tools.error("支付失败");
-					}
-				})
+				uni.redirectTo({
+					url: `/pages-takeout/pick-up-pay?orderId=${id}`
+				});
+				return
+				// if (this.isAJAX) {
+				// 	return
+				// }
+				// this.isAJAX = true;
+				// getExpressPay({
+				// 	order_id: id
+				// }).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;
+				// 				this.page = 1;
+				// 				this.list = [];
+				// 				this.expressOrderList()
+				// 			},
+				// 			fail: (err) => {
+				// 				this.isAJAX = false;
+				// 				tools.error("支付失败");
+				// 			},
+				// 		});
+				// 	} else {
+				// 		this.isAJAX = false;
+				// 		tools.error("支付失败");
+				// 	}
+				// })
 			},
 			},
 			groupPay(id) {
 			groupPay(id) {
 				// 团购支付
 				// 团购支付
-				if (this.isAJAX) {
-					return
-				}
-				this.isAJAX = true;
-				groupPay({
-					order_id: id
-				}).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;
-								this.page = 1;
-								this.list = [];
-								this.groupOrderList()
-							},
-							fail: (err) => {
-								this.isAJAX = false;
-								tools.error("支付失败");
-							},
-						});
-					} else {
-						this.isAJAX = false;
-						tools.error("支付失败");
-					}
-				})
+				uni.redirectTo({
+					url: `/pages-buy/group-pay-page?orderId=${id}`
+				});
+				return
+				// if (this.isAJAX) {
+				// 	return
+				// }
+				// this.isAJAX = true;
+				// groupPay({
+				// 	order_id: id
+				// }).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;
+				// 				this.page = 1;
+				// 				this.list = [];
+				// 				this.groupOrderList()
+				// 			},
+				// 			fail: (err) => {
+				// 				this.isAJAX = false;
+				// 				tools.error("支付失败");
+				// 			},
+				// 		});
+				// 	} else {
+				// 		this.isAJAX = false;
+				// 		tools.error("支付失败");
+				// 	}
+				// })
 			},
 			},
 			ticketPay(id) {
 			ticketPay(id) {
 				// 票务支付
 				// 票务支付