sureorder.vue 16.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
<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" v-if="goodinfo.data3[0].goods!=undefined">
				<view class="sureorderbox flexone">
					<view class="sureimg">
						<image src="../../static/nearshop.png" mode=""></image>
					</view>
					<view class="sureshopname">{{goodinfo.data3[0].name}}</view>
				</view>
				<view class="boxbox">
					<view class="sureorderitem flex" v-for="(item,index) in goodinfo.data3[0].goods" :key="index">
						<view class="sureorderitemleft">
							<image :src="item.store_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="bindgoodChange" :value="goodindex" :range="goodservicearr" range-key="name">
							<view class="deliveryname">{{goodpeiname}}</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="选填,给商家留言" @input="entershopmessage" />
						</view>
				</view>
			<view class="delivery markcontent markcontentk peibox">
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>商品金额</view>
					<view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].goods_total}}</view>
				</view>
				
				
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>运费</view>
					<view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].postage_price}}</view>
				</view>
			</view>	
			<view class="delivery peidelivery markcontentk flextwo peiboxk">
				<view class="deliveryleft">小计</view>
				<view class="deliverymoney">¥{{goodinfo.data3[0].goods_total*100/100+goodinfo.data3[0].postage_price*100/100}}</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="选填,给商家留言" @input="entermianfangrmark"/>
						</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 class="delivery markcontent markcontentk peibox">
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>商品金额</view>
					<view class='deliveryitemname moneyright'>¥{{goodinfo.data1.goods_total}}</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'>¥{{goodinfo.data1.discounts}}</view>
				</view>
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>运费</view>
					<view class='deliveryitemname moneyright'>¥{{goodinfo.data1.postage_price}}</view>
				</view>
			</view>	
			<view class="delivery peidelivery markcontentk flextwo peiboxk">
				<view class="deliveryleft">小计</view>
				<view class="deliverymoney">¥{{goodinfo.data1.goods_total*100/100+goodinfo.data1.postage_price*100/100}}</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">
					<picker @change="bindjiChange" :value="jiindex" :range="jifenservicearr" range-key="name">
						<view class="deliveryname">{{jifenpeiname}}</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="选填,给商家留言" @input="enterjifenremark"/>
					</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 markcontent markcontentk peibox">
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>商品金额</view>
					<view class='deliveryitemname moneyright'>¥{{goodinfo.data2.goods_total}}</view>
				</view>
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>积分抵扣</view>
					<view class='deliveryitemname moneyright'>¥{{goodinfo.data2.user_score}}</view>
				</view>
				
				<view class="deliveryitem flextwo">
					<view class='deliveryitemname'>运费</view>
					<view class='deliveryitemname moneyright'>¥{{goodinfo.data2.postage_price}}</view>
				</view>
			</view>	
			<view class="delivery peidelivery markcontentk flextwo peiboxk">
				<view class="deliveryleft">小计</view>
				<view class="deliverymoney">¥{{goodinfo.data2.postage_price*100/100+goodinfo.data2.postage_price*100/100}}</view>
			</view>
					
			</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="flextwo">
					<view class="totalmoney">{{goodinfo.total}}</view>
					<view class="buybtn btnk">确认支付(¥2560.00)</view>
				</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:-1,
					servicearr:[{
						id:1,
						name:'快递配送'
					},
					{
						id:2,
						name:'上门自提'
					},
					],
					mianpeiname:'请选择配送方式',
					jifen:'',
					couponname:'请选择优惠券',
					// 面坊的配送方式
					postage_type1:'',
					// 积分商品配送方式
					jifenservicearr:[{
						id:1,
						name:'快递配送'
					},
					{
						id:2,
						name:'上门自提'
					},
					],
					jiindex:-1,
					postage_type2:'',
					jifenpeiname:'请选择配送方式',
					
					//店铺商品
					
					goodindex:-1,
					goodservicearr:[{
						id:1,
						name:'快递配送'
					},
					{
						id:2,
						name:'上门自提'
					}],
					goodpeiname:'请选择配送方式',
					
					
					
					
					
					// data1  面坊  data2  积分  data3 店铺
	            }
	        },
	        onLoad(options) {
				console.log(38349403)
				this.goodinfo=uni.getStorageSync("goodinfo");
				
				this.seldata=JSON.parse(options.seldata)
				console.log(this.goodinfo) 
	        },
			
	        methods: {
				// 面访商品配送方式
				bindmianChange(e){
					this.mianpeiname=this.servicearr[e.target.value].name;
					this.mianindex=e.target.value;
					this.postage_type1=this.servicearr[e.target.value].id
				},
				// 积分商品的配送方式
				bindjiChange(e){
					this.jifenpeiname=this.servicearr[e.target.value].name;
					
					this.jiindex=e.target.value;
					this.postage_type2=this.servicearr[e.target.value].id
				},
				// 店铺商品的配送方式
				bindgoodChange(e){
					let that=this;
					console.log(this.goodservicearr)
					this.goodpeiname=this.goodservicearr[e.target.value].name;
					this.goodindex=e.target.value;
					this.seldata.forEach(function(value,index,array){
						if(value.type==3){
						       value.postage_type=that.goodservicearr[e.target.value].id;
						      }
					})
					
				},
				// 输入积分
				enterjifen(e){
					this.jifen=e.detail.vlaue
				},
				
				// 面坊商品备注
				    entermianfangrmark(){
				     this.remark1=e.detail.value
				    },
					// 店铺商品备注
					entershopmessage(e){
						this.seldata.forEach(function(value,index,array){
						      if(value.type==3){
						       value.remark=e.detail.value
						      }
						     })
						  this.seldata=this.this.seldata;
					},
					// 积分商品备注
					enterjifenremark(){
						this.remark2=e.detail.value
					},
				// 选择优惠券
				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;
	}
	.totalmoney{
		color:#C29445;
		font-size: 30rpx;
	}
	.btnk{
		width:200prx;
		
	}
</style>