sureorder.vue 12.4 KB
<template>
	<view class="content">
		<view class="sureordertop flextwo" @click="addaddress">
			<!-- @click="addaddress" -->
			<view class="sureordername" v-if="addressitem==''">请选择地址</view>
			<view class="addresstop" v-else>
				<view class="addressname flexone">
					<view class="sureordername">
						{{addressitem.name}}
					</view>
					<view class="sureorderphone">{{addressitem.phone}}</view>
				</view>
				<view class="addresstitle">
					{{addressitem.province_name}}{{addressitem.city_name}}{{addressitem.county_name}}{{addressitem.address}}
				</view>
			</view>
			<view class="yourowk">
				<image src="../../static/yourowk.png" mode=""></image>
			</view>
		</view>
		<view class="sureshop sureshopk">
			<!-- 店铺商品 -->
			<view class="bigbox">
				<view class="sureorderbox flexone">
					<view class="sureimg">
						<image src="../../static/nearshop.png" mode=""></image>
					</view>
					<view class="sureshopname">红大地面品厂</view>
				</view>
				<view class="boxbox">
					<view class="sureorderitem flex">
						<view class="sureorderitemleft">
							<image src="../../static/goodtailtop.png" mode=""></image>
						</view>
						<view class='shuright'>
							<view class="suregoodname">商品名称商品名称商品名称商
								品名称商品名称商品名称商品名称商品名称
							</view>
							<view class="surebot flextwo">
								<view class="saleprice">¥288</view>
								<view class="weightnumk flexone">
									<view class="weightnumkleft leftk">
										<image src="../../static/addimg.png" mode=""></image>
									</view>
									<view class="detailnum">1</view>
									<view class="weightnumkleft rightk">
										<image src="../../static/reduceimg.png" mode=""></image>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>

			</view>

			<div class="botbox" v-if="goodinfo.data1.flour_goods!=undefined"></div>
			<!-- 面坊商品 -->
			<view class="bigbox" v-if="goodinfo.data1.flour_goods!=undefined">
				<view class="sureorderbox flexone">
					<view class="sureimg">
						<image src="../../static/nearshop.png" mode=""></image>
					</view>
					<view class="sureshopname">面坊商品</view>
				</view>
				<view class="boxbox">
					<view class="sureorderitem flex" v-for="(item,index) in goodinfo.data1.flour_goods" :key="index">
						<view class="sureorderitemleft">
							<!-- <image :src="item.score_goods_spec.spec_image" mode=""></image> -->
						</view>
						<view class='shuright'>
							<view class="suregoodnamek">{{item.name}}
							</view>
							<view v-if="item.spec.length!=0">
								<view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
							</view>
							<view class="surebot flexone">
								<view class="saleprice">¥{{item.price}}</view>
								<view class="detailnum">x{{item.number}}</view>
							</view>
						</view>
					</view>
				</view>
				<view class="delivery flextwo">
					<view class="deliveryleft">配送服务</view>
					<view class="deliveryright flexone">
						<picker @change="bindmianChange" :value="mianindex" :range="servicearr" range-key="name">
							<view class="deliveryname">{{mianpeiname}}</view>
						</picker>

						<view class='yourow'>
							<image src="../../static/yourowk.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="delivery markcontent">
					<view class='markname'>店铺备注</view>
					<view class="marktext">
						<textarea value="" placeholder="选填,给商家留言" />
						</view>
				</view>
			<!-- 	<view class="delivery flextwo markcontent">
					<view class="deliveryleft flexone">
						<view class='jifen'>可用积分抵扣50</view>
						<view class="jifenimg">
							<image src="../../static/gantan.png" mode=""></image>
						</view>
					</view>
					<view class="deliveryname">请输入抵扣积分</view>
				</view> -->
				<view class="delivery flextwo markcontent" @click="selectcoupon">
					<view class="deliveryleft flexone">
						<view class='jifen'>优惠劵</view>
						<view class="jifenimg youimg">
							<image src="../../static/gantan.png" mode=""></image>
						</view>
					</view>
					<view class="deliveryname">{{couponname}}</view>
				</view>
			</view>
			<div class="botbox" v-if="goodinfo.data2.score_goods!=undefined"></div>
			<!-- 积分商品 -->
			<view class="bigbox jibox" v-if="goodinfo.data2.score_goods!=undefined">
				<view class="sureorderbox flexone">
					<view class="sureimg">
						<image src="../../static/nearshop.png" mode=""></image>
					</view>
					<view class="sureshopname">积分商品</view>
				</view>
				<view class="boxbox">
					<view class="sureorderitem flex" v-for="(item,index) in goodinfo.data2.score_goods" :key="index">
						<view class="sureorderitemleft">
							<image :src="item.score_goods_spec.spec_image" mode=""></image>
						</view>
						<view class='shuright'>
							<view class="suregoodnamek">{{item.name}}
							</view>
							<view v-if="item.spec.length!=0">
								<view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
							</view>
							<view class="surebot flexone">
								<view class="saleprice">¥{{item.price}}</view>
								<view class="weightnumk flexone">
									<view class="detailnum">x{{item.number}}</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			
			<view class="delivery flextwo">
				<view class="deliveryleft">配送服务</view>
				<view class="deliveryright flexone">
					<view class="deliveryname">快递配送</view>
					<view class='yourow'>
						<image src="../../static/yourowk.png" mode=""></image>
					</view>
				</view>
			</view>
			<view class="delivery markcontent">
				<view class='markname'>店铺备注</view>
				<view class="marktext">
					<textarea value="" placeholder="选填,给商家留言" />
					</view>
			</view>
			<view class="delivery flextwo markcontent">
				<view class="deliveryleft flexone">
					<view class='jifen'>可用积分抵扣50</view>
					<view class="jifenimg youimg">
						<image src="../../static/gantan.png" mode=""></image>
					</view>
				</view>
				<view class="deliveryname dikouname">
					<input type="text" value="" placeholder="请输入抵扣积分" placeholder-class="dikouinput" @input="enterjifen"/>
					</view>
			</view>
			<!-- <view class="delivery flextwo markcontent">
				<view class="deliveryleft flexone">
					<view class='jifen'>优惠劵</view>
					<view class="jifenimg">
						<image src="../../static/gantan.png" mode=""></image>
					</view>
				</view>
				<view class="deliveryname">满200减99优惠券</view>
			</view> -->
			</view>
		</view>
		
			<view class="delivery markcontent markcontentk peibox">
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>商品金额</view>
					<view class='deliveryitemname moneyright'>¥2600.00</view>
				</view>
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>积分抵扣</view>
					<view class='deliveryitemname moneyright'>¥2600.00</view>
				</view>
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>优惠券</view>
					<view class='deliveryitemname moneyright'>¥2600.00</view>
				</view>
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>运费</view>
					<view class='deliveryitemname moneyright'>¥2600.00</view>
				</view>
			</view>	
			<view class="delivery peidelivery markcontentk flextwo peiboxk">
				<view class="deliveryleft">配送服务</view>
				<view class="deliverymoney">¥2560.00</view>
			</view>
			
		
		
		
		<view class="huiyuanbot boxsizing">
			<view class="behuiyuanbtn">确认支付</view>
		</view>
		
		<!-- 购买弹层 -->
		<view class="register" @click="hidebuy" v-if="buyshow">
			<view class="buywrap boxsizing">
				<view class="buyname">订单总额</view>
				<view class="buymoney">3600</view>
				<view class='buybox'>
					<view class="buyitem boxsizing flextwo">
						<view class="buyitemleft flexone">
							<view class="buyleftimg">
								<image src="../../static/zhifubao.png" mode=""></image>
							</view>
							<view class="buyitemname">支付宝</view>
						</view>
						<view class="selimg">
							<image src="../../static/selactive.png" mode=""></image>
						</view>
					</view>
					<view class="buyitem boxsizing flextwo">
						<view class="buyitemleft flexone">
							<view class="buyleftimg">
								<image src="../../static/weixin.png" mode=""></image>
							</view>
							<view class="buyitemname">微信支付</view>
						</view>
						<view class="selimg">
							<image src="../../static/selactive.png" mode=""></image>
						</view>
					</view>
					<view class="buyitem boxsizing flextwo">
						<view class="buyitemleft flexone">
							<view class="buyleftimg">
								<image src="../../static/yue.png" mode=""></image>
							</view>
							<view class="buyitemname">余额支付</view>
						</view>
						<view class="selimg">
							<image src="../../static/selactive.png" mode=""></image>
						</view>
					</view>
					<view class="buyitem boxsizing flextwo">
						<view class="buyitemleft flexone">
							<view class="buyleftimg">
								<image src="../../static/baitiao.png" mode=""></image>
							</view>
							<view class="buyitemname">白条支付</view>
						</view>
						<view class="selimg">
							<image src="../../static/selactive.png" mode=""></image>
						</view>
					</view>
				</view>
				<view class="buybtn">确认支付(¥2560.00)</view>
			</view>
		</view>
		<!-- 优惠券使用规则 -->
		<view class='register' v-if="couponrule">
			<view class="couponrule">
				<view class='coupontitle'>优惠券使用规则</view>
				<view class="coupontext">
					Lorem ipsum dolor sit amet, consectetur adipiscing elit.
					 Aenean euismod bibendum laoreet. Proin gravida dolor
					  sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis
					 parturient penatibus et magnis dis parturient 
				</view>
				<view class="know" @click="know">我知道了</view>
			</view>
		</view>
	</view>
</template>

<script>
	import app from "../../App.vue";
	    export default {
	        data() {
	            return {
	                buyshow: false,
					couponrule:false,
					goodinfo:'',
					addressitem:'',
					addresssel:'请选择地址',
					mianindex:0,
					servicearr:[{
						id:1,
						name:'快递配送'
					},
					{
						id:2,
						name:'上门自提'
					},
					],
					mianpeiname:'请选择配送方式',
					jifen:'',
					couponname:'请选择优惠券',
					
					// data1  面坊  data2  积分  data3 店铺
	            }
	        },
	        onLoad(options) {
				console.log(38349403)
				this.goodinfo=uni.getStorageSync("goodinfo");
				
				console.log(this.goodinfo) 
	        },
			
	        methods: {
				// 面访商品配送方式
				bindmianChange(e){
					this.mianpeiname=this.servicearr[e.target.value].name;
					this.mianindex=e.target.value
				},
				// 输入积分
				enterjifen(e){
					this.jifen=e.detail.vlaue
				},
				// 选择优惠券
				selectcoupon(){
					uni.navigateTo({
						url:'/pages/nearshop/selectcoupon'
					})
				},
				// 添加地址
				addaddress(){
					console.log(334439090)
					uni.navigateTo({
						url:"/pages/usercenter/address"
					})
				},
	           know(){
				   this.couponrule=false
			   },
			   getordertail(){
				   let that = this;
				   if(that.data.length==0){
				   	uni.showToast({
				   		title:'请选择商品',
				   		icon:'none'
				   	})
				   	return false
				   }
				   var url = 'order/confirm_order';
				   var params = {
				   	data: JSON.stringify(that.data),
				   	
				   }
				   console.log(params)
				   app.post(url, params,"post").then((res) => {
				   	console.log(res);
				   	uni.navigateTo({
				   		url:'/pages/nearshop/sureorder'
				   	})
				   
				   }).catch((err) => {
				   	console.log(err)
				   
				   })
			   }
				   
	      
	        },
			onShow() {
				if(uni.getStorageSync("addressitem")!=''){
					this.addressitem = uni.getStorageSync("addressitem");
				}
				if(uni.getStorageSync("addressitem")!=''){
					let couponitem = uni.getStorageSync("couponitem");
					this.couponname=couponitem.name
				}
				
				console.log(this.addressitem)

			}
	
	    }
</script>

<style>
	@import url('../../base/nearshop');
	@import url('../../base/homepage');
	page{
		background: #F8F6F9;
	}
</style>