order
This commit is contained in:
		
							parent
							
								
									58b02c7432
								
							
						
					
					
						commit
						700ae94f79
					
				@ -97,12 +97,29 @@ export default {
 | 
			
		||||
					quantity: quantity
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 订单结算数据
 | 
			
		||||
			settlementOrder({ cart_id }) {
 | 
			
		||||
			// 订单步骤1:展示结算数据
 | 
			
		||||
			settlementOrder({ ifcart, cart_id }) {
 | 
			
		||||
				return vm.$u.post('buy/buy_step1', {
 | 
			
		||||
					ifcart: ifcart,
 | 
			
		||||
					cart_id: cart_id,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 订单步骤2:发起订单,返回订单信息
 | 
			
		||||
			sendOrder({ ifcart, cart_id, address_id, buy_city_id }) {
 | 
			
		||||
				return vm.$u.post('buy/buy_step2', {
 | 
			
		||||
					ifcart: ifcart,
 | 
			
		||||
					cart_id: cart_id,
 | 
			
		||||
					address_id: address_id,
 | 
			
		||||
					buy_city_id: buy_city_id,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 订单步骤3:发起支付(第三方统一下单)
 | 
			
		||||
			sendPay({ pay_sn, payment_code }) {
 | 
			
		||||
				return vm.$u.post('Payment/real_order', {
 | 
			
		||||
					pay_sn: pay_sn,
 | 
			
		||||
					payment_code: payment_code,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 选择地区计算运费 
 | 
			
		||||
			getFreight({ freight_hash, city_id, area_id }) {
 | 
			
		||||
				return vm.$u.post('Buy/change_addr', {
 | 
			
		||||
 | 
			
		||||
@ -40,20 +40,29 @@
 | 
			
		||||
							<image src="../static/image/1.png"></image>
 | 
			
		||||
						</view>
 | 
			
		||||
					</view>
 | 
			
		||||
					<view>
 | 
			
		||||
						<view class="title">配送方式</view>
 | 
			
		||||
						<view class="value">
 | 
			
		||||
							<view>快递</view>
 | 
			
		||||
							<image src="../static/image/1.png"></image>
 | 
			
		||||
						</view>
 | 
			
		||||
					</view>
 | 
			
		||||
					<view>
 | 
			
		||||
					<!-- <view>
 | 
			
		||||
						<view class="title">支付方式</view>
 | 
			
		||||
						<view class="value">
 | 
			
		||||
							<view>微信</view>
 | 
			
		||||
							<image src="../static/image/1.png"></image>
 | 
			
		||||
						</view>
 | 
			
		||||
					</view>
 | 
			
		||||
					</view> -->
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="common-active">
 | 
			
		||||
			<view>
 | 
			
		||||
				<view class="title">平台优惠券</view>
 | 
			
		||||
				<view class="value">
 | 
			
		||||
					<view>-¥0.00</view>
 | 
			
		||||
					<image src="../static/image/1.png"></image>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view>
 | 
			
		||||
				<view class="title">配送方式</view>
 | 
			
		||||
				<view class="value">
 | 
			
		||||
					<view>快递</view>
 | 
			
		||||
					<image src="../static/image/1.png"></image>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
@ -63,7 +72,7 @@
 | 
			
		||||
				<view class="price">¥{{ orderInfo.store_goods_total | showTotalPrice }}</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="right">
 | 
			
		||||
				<view class="num">共1件商品</view>
 | 
			
		||||
				<view class="num">共件{{ orderInfo.store_cart_list | setTotalNumber }}商品</view>
 | 
			
		||||
				<view class="btn" @click="settlement">结算</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
@ -89,7 +98,18 @@ export default {
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return price.toFixed(2);
 | 
			
		||||
		}
 | 
			
		||||
		},
 | 
			
		||||
		setTotalNumber(data) {
 | 
			
		||||
			let num = 0;
 | 
			
		||||
			for (const key in data) {
 | 
			
		||||
				if (data.hasOwnProperty(key)) {
 | 
			
		||||
					const element = data[key][0];
 | 
			
		||||
					console.log(element);
 | 
			
		||||
					num += element.goods_num;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return num;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	onLoad(option) {
 | 
			
		||||
		console.log(JSON.parse(option.info));
 | 
			
		||||
@ -151,7 +171,9 @@ export default {
 | 
			
		||||
				font-size: 28rpx;
 | 
			
		||||
				color: rgba(51,51,51,1);
 | 
			
		||||
				margin-bottom: 20rpx;
 | 
			
		||||
				margin-right: 13rpx;
 | 
			
		||||
				> view:first-child {
 | 
			
		||||
					margin-right: 13rpx;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.address-text {
 | 
			
		||||
				font-size: 24rpx;
 | 
			
		||||
@ -167,7 +189,7 @@ export default {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	.main {
 | 
			
		||||
		margin-bottom: 100rpx;
 | 
			
		||||
		margin-bottom: 50rpx;
 | 
			
		||||
		> view {
 | 
			
		||||
			.goods-info {
 | 
			
		||||
				background-color: #ffffff;
 | 
			
		||||
@ -276,6 +298,34 @@ export default {
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	.common-active {
 | 
			
		||||
		padding-bottom: 200rpx;
 | 
			
		||||
		> view {
 | 
			
		||||
			height: 98rpx;
 | 
			
		||||
			background: rgba(255,255,255,1);
 | 
			
		||||
			padding: 35rpx 30rpx;
 | 
			
		||||
			display: flex;
 | 
			
		||||
			align-items: center;
 | 
			
		||||
			justify-content: space-between;
 | 
			
		||||
			margin-bottom: 2rpx;
 | 
			
		||||
			.title {
 | 
			
		||||
				font-size: 28rpx;
 | 
			
		||||
				color: rgba(102,102,102,1);
 | 
			
		||||
			}
 | 
			
		||||
			.value {
 | 
			
		||||
				display: flex;
 | 
			
		||||
				align-items: center;
 | 
			
		||||
				font-size: 30rpx;
 | 
			
		||||
				color:rgba(51,51,51,1);
 | 
			
		||||
				> image {
 | 
			
		||||
					width: 12rpx;
 | 
			
		||||
					height: 22rpx;
 | 
			
		||||
					flex-shrink: 0;
 | 
			
		||||
					margin-left: 20rpx;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	.bottom {
 | 
			
		||||
		padding: 35rpx 30rpx;
 | 
			
		||||
		position: fixed;
 | 
			
		||||
 | 
			
		||||
@ -93,8 +93,8 @@ export default {
 | 
			
		||||
				temp = '';
 | 
			
		||||
			})
 | 
			
		||||
			// console.log(id);
 | 
			
		||||
			
 | 
			
		||||
			this.$u.api.settlementOrder({ cart_id: id }).then(res => {
 | 
			
		||||
			// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
 | 
			
		||||
			this.$u.api.settlementOrder({ ifcart: 1, cart_id: id }).then(res => {
 | 
			
		||||
				if(res.errCode == 0) {
 | 
			
		||||
					this.$u.route({
 | 
			
		||||
						url: '/pageC/cart/ConfirmOrder',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user