作者 lihongjuan

1

@@ -121,9 +121,11 @@ @@ -121,9 +121,11 @@
121 width: 100%; 121 width: 100%;
122 height: 100%; 122 height: 100%;
123 } 123 }
  124 +
124 .spec { 125 .spec {
125 color: #3D454C; 126 color: #3D454C;
126 font-size: 28rpx; 127 font-size: 28rpx;
  128 + margin-right:10rpx;
127 } 129 }
128 130
129 /* 省份选择 */ 131 /* 省份选择 */
@@ -260,9 +260,6 @@ @@ -260,9 +260,6 @@
260 } 260 }
261 }); 261 });
262 }, 262 },
263 -  
264 -  
265 -  
266 // 获取购物车气泡 263 // 获取购物车气泡
267 getcartnum(){ 264 getcartnum(){
268 let that = this; 265 let that = this;
@@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
94 let id=e.currentTarget.dataset.id; 94 let id=e.currentTarget.dataset.id;
95 // type 1 面访商品 95 // type 1 面访商品
96 uni.navigateTo({ 96 uni.navigateTo({
97 - url:'/pages/nearshop/goodtail?id='+id+'&type='+1 97 + url:'/pages/nearshop/goodtail?id='+id+'&type='+3
98 }) 98 })
99 } 99 }
100 100
@@ -24,6 +24,9 @@ @@ -24,6 +24,9 @@
24 <view class='shuright'> 24 <view class='shuright'>
25 <view class="suregoodnamek">{{item.store_goods.name}} 25 <view class="suregoodnamek">{{item.store_goods.name}}
26 </view> 26 </view>
  27 + <view class="flexone" v-if="item.store_goods.spec.length!=0">
  28 + <view class="spec" v-for="(item,index) in item.store_goods.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  29 + </view>
27 <view class="surebot flextwo"> 30 <view class="surebot flextwo">
28 <view class="saleprice">¥{{item.store_goods.price}}</view> 31 <view class="saleprice">¥{{item.store_goods.price}}</view>
29 <view class="weightnumk flexone"> 32 <view class="weightnumk flexone">
@@ -64,7 +67,7 @@ @@ -64,7 +67,7 @@
64 {{item.flour_goods.name}} 67 {{item.flour_goods.name}}
65 </view> 68 </view>
66 <!-- 商品属性 --> 69 <!-- 商品属性 -->
67 - <view v-if="item.flour_goods.spec.length!=0"> 70 + <view class="shubox flexone" v-if="item.flour_goods.spec.length!=0">
68 <view class="spec" v-for="(item,index) in item.flour_goods.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view> 71 <view class="spec" v-for="(item,index) in item.flour_goods.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
69 </view> 72 </view>
70 73
@@ -109,7 +112,7 @@ @@ -109,7 +112,7 @@
109 <view class="suregoodnamek"> 112 <view class="suregoodnamek">
110 {{item.score_goods.name}} 113 {{item.score_goods.name}}
111 </view> 114 </view>
112 - <view v-if="item.score_goods.spec.length!=0"> 115 + <view class="flexone" v-if="item.score_goods.spec.length!=0">
113 <view class="spec" v-for="(item,index) in item.score_goods.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view> 116 <view class="spec" v-for="(item,index) in item.score_goods.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
114 </view> 117 </view>
115 118
@@ -742,6 +745,10 @@ @@ -742,6 +745,10 @@
742 page { 745 page {
743 background: #F8F6F9; 746 background: #F8F6F9;
744 } 747 }
  748 + .sureshop{
  749 + padding-bottom: 150rpx;
  750 + box-sizing: border-box;
  751 + }
745 752
746 .editcart { 753 .editcart {
747 color: #3D454C; 754 color: #3D454C;
@@ -773,10 +780,7 @@ @@ -773,10 +780,7 @@
773 /* padding-bottom: 120rpx; */ 780 /* padding-bottom: 120rpx; */
774 } 781 }
775 782
776 - .spec {  
777 - color: #3D454C;  
778 - font-size: 28rpx;  
779 - } 783 +
780 784
781 .cartselimg { 785 .cartselimg {
782 width: 30rpx; 786 width: 30rpx;
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
3 <view class="goodtailtop"> 3 <view class="goodtailtop">
4 <image :src="goodtail.image" mode=""></image> 4 <image :src="goodtail.image" mode=""></image>
5 </view> 5 </view>
  6 +
  7 + <!-- 面坊商品 -->
6 <view v-if="type==1"> 8 <view v-if="type==1">
7 9
8 <view class="tailbox boxsizing" v-if="goodtail.is_seckill==2"> 10 <view class="tailbox boxsizing" v-if="goodtail.is_seckill==2">
@@ -52,30 +54,30 @@ @@ -52,30 +54,30 @@
52 54
53 </view> 55 </view>
54 56
55 - 57 + <!-- 积分商品 -->
56 <view class="tailbox boxsizing" v-else-if="type==2"> 58 <view class="tailbox boxsizing" v-else-if="type==2">
57 <view class="tailname"> 59 <view class="tailname">
58 {{goodtail.name}} 60 {{goodtail.name}}
59 </view> 61 </view>
60 <view class="tailhezi flextwo"> 62 <view class="tailhezi flextwo">
61 <view class="tailhezileft flexone"> 63 <view class="tailhezileft flexone">
62 - <view class="saleprice">¥{{goodtail.score_goods_spec.goods_price}}</view> 64 + <view class="saleprice">¥{{score_goods_spec.goods_price}}</view>
63 <!-- <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view> --> 65 <!-- <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view> -->
64 </view> 66 </view>
65 <view class="heziright flexone"> 67 <view class="heziright flexone">
66 - <view class="heziprice stock">库存:{{goodtail.score_goods_spec.stock_num}}件</view> 68 + <view class="heziprice stock">库存:{{score_goods_spec.stock_num}}件</view>
67 <view class="heziprice">已售{{goodtail.sales}}件</view> 69 <view class="heziprice">已售{{goodtail.sales}}件</view>
68 </view> 70 </view>
69 </view> 71 </view>
70 </view> 72 </view>
71 - 73 + <!-- 店铺商品 -->
72 <view class="tailbox boxsizing" v-else-if="type==3"> 74 <view class="tailbox boxsizing" v-else-if="type==3">
73 <view class="tailname"> 75 <view class="tailname">
74 {{goodtail.name}} 76 {{goodtail.name}}
75 </view> 77 </view>
76 <view class="tailhezi flextwo"> 78 <view class="tailhezi flextwo">
77 <view class="tailhezileft flexone"> 79 <view class="tailhezileft flexone">
78 - <view class="saleprice">¥{{goodtail.goods_price}}</view> 80 + <view class="saleprice">¥{{goodtail.price}}</view>
79 <!-- <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view> --> 81 <!-- <view class="huiyuanprice">会员价:¥{{goodtail.vip_price}}</view> -->
80 </view> 82 </view>
81 <view class="heziright flexone"> 83 <view class="heziright flexone">
@@ -191,6 +193,10 @@ @@ -191,6 +193,10 @@
191 <view class="shusmallimg" v-if="type==2"> 193 <view class="shusmallimg" v-if="type==2">
192 <image :src="goodtail.score_goods_spec.spec_image" mode=""></image> 194 <image :src="goodtail.score_goods_spec.spec_image" mode=""></image>
193 </view> 195 </view>
  196 + <!-- 店铺商品 -->
  197 + <view class="shusmallimg" v-if="type==3">
  198 + <image :src="goodtail.store_goods_spec.spec_image" mode=""></image>
  199 + </view>
194 </view> 200 </view>
195 <view class='shuright'> 201 <view class='shuright'>
196 <view class="shutop flex"> 202 <view class="shutop flex">
@@ -204,6 +210,7 @@ @@ -204,6 +210,7 @@
204 <view class="saleprice" v-if="type==1">¥{{goodtail.price}}</view> 210 <view class="saleprice" v-if="type==1">¥{{goodtail.price}}</view>
205 <!-- 积分商品 --> 211 <!-- 积分商品 -->
206 <view class="saleprice" v-if="type==2">¥{{goodtail.score_goods_spec.goods_price}}</view> 212 <view class="saleprice" v-if="type==2">¥{{goodtail.score_goods_spec.goods_price}}</view>
  213 + <view class="saleprice" v-if="type==3">¥{{goodtail.store_goods_spec.goods_price}}</view>
207 </view> 214 </view>
208 </view> 215 </view>
209 <view v-for="(item,parindex) in specarr" :key="parindex"> 216 <view v-for="(item,parindex) in specarr" :key="parindex">
@@ -247,7 +254,7 @@ @@ -247,7 +254,7 @@
247 sel: 2, 254 sel: 2,
248 shuwrap: false, 255 shuwrap: false,
249 goodid: '', 256 goodid: '',
250 - type: "", //type 1 面访商城 2 积分商城 257 + type: "", //type 1 面访商城 2 积分商城 3店铺商品
251 goodtail: '', 258 goodtail: '',
252 tapnavactive: '', 259 tapnavactive: '',
253 selnav: 1, 260 selnav: 1,
@@ -267,22 +274,24 @@ @@ -267,22 +274,24 @@
267 total1:'', 274 total1:'',
268 total2:'', 275 total2:'',
269 total3:'', 276 total3:'',
270 - carttotal:'' 277 + carttotal:'',
  278 + score_goods_spec:''
271 279
272 } 280 }
273 }, 281 },
274 onLoad(options) { 282 onLoad(options) {
275 console.log(options) 283 console.log(options)
276 this.goodid = options.id, 284 this.goodid = options.id,
277 - this.type = options.type; 285 + this.type = options.type;
  286 + console.log('详情类型',this.type)
278 if (this.type == 1) { 287 if (this.type == 1) {
279 this.getgoodtail(); 288 this.getgoodtail();
280 } else if (this.type == 2) { 289 } else if (this.type == 2) {
281 this.getjifengoodtail(); 290 this.getjifengoodtail();
282 - } else { 291 + } else if(this.type==3) {
  292 + console.log(88877665)
283 this.getshopgoodtail() 293 this.getshopgoodtail()
284 } 294 }
285 -  
286 // 获取购物车气泡 295 // 获取购物车气泡
287 this.getcartnum() 296 this.getcartnum()
288 297
@@ -298,9 +307,7 @@ @@ -298,9 +307,7 @@
298 } 307 }
299 app.post(url, params).then((res) => { 308 app.post(url, params).then((res) => {
300 console.log(res); 309 console.log(res);
301 - this.carttotal=res.data.data.total  
302 -  
303 - 310 + this.carttotal=res.data.data.total;
304 311
305 }).catch((err) => { 312 }).catch((err) => {
306 313
@@ -384,7 +391,8 @@ @@ -384,7 +391,8 @@
384 } 391 }
385 app.post(url, params).then((res) => { 392 app.post(url, params).then((res) => {
386 console.log(res); 393 console.log(res);
387 - that.goodtail = res.data.data 394 + that.goodtail = res.data.data;
  395 +
388 396
389 }).catch((err) => { 397 }).catch((err) => {
390 398
@@ -400,7 +408,9 @@ @@ -400,7 +408,9 @@
400 console.log(params) 408 console.log(params)
401 app.post(url, params).then((res) => { 409 app.post(url, params).then((res) => {
402 console.log(res); 410 console.log(res);
403 - that.goodtail = res.data.data 411 + that.goodtail = res.data.data;
  412 + that.score_goods_spec=res.data.data.score_goods_spec
  413 + console.log(that.goodtail)
404 414
405 }).catch((err) => { 415 }).catch((err) => {
406 console.log(err) 416 console.log(err)
@@ -426,7 +436,16 @@ @@ -426,7 +436,16 @@
426 // 加入购物车 436 // 加入购物车
427 addcart() { 437 addcart() {
428 this.shuwrap = true; 438 this.shuwrap = true;
429 - this.getspecs(); 439 + //type 1店铺商品 2 积分商品 3 面坊商品
  440 +
  441 + if(this.type==3){
  442 + this.getshopsepc()
  443 + }else if(this.type==2){
  444 + this.getspecs();
  445 + }else if(this.type==1){
  446 + this.getmianfangspec()
  447 + }
  448 +
430 this.addtype = 1 449 this.addtype = 1
431 }, 450 },
432 // 立即购买 451 // 立即购买
@@ -435,7 +454,36 @@ @@ -435,7 +454,36 @@
435 this.getspecs(); 454 this.getspecs();
436 this.addtype = 2 455 this.addtype = 2
437 }, 456 },
438 - //获取商品规格 457 + // 获取店铺商品规格
  458 + getshopsepc(){
  459 + let that = this;
  460 + var url = 'store_goods/get_spec_sku1';
  461 + var params = {
  462 + store_goods_id: that.goodid,
  463 + }
  464 + console.log(params)
  465 + app.post(url, params).then((res) => {
  466 + console.log(res);
  467 + that.specarr = res.data.data;
  468 + that.specarr.forEach(function(value, index, array) {
  469 + value.selindex = 0;
  470 +
  471 + value.spec_value.forEach(function(valuek, indexk, arrayk) {
  472 + if (indexk == 0) {
  473 + value.selid = valuek.spec_value_id;
  474 + }
  475 + valuek.sel = false
  476 + })
  477 + })
  478 +
  479 + that.specarr = that.specarr;
  480 +
  481 + }).catch((err) => {
  482 + console.log(err)
  483 + })
  484 + },
  485 +
  486 + //获取积分商品规格
439 getspecs() { 487 getspecs() {
440 let that = this; 488 let that = this;
441 var url = 'score_goods/get_spec_sku1'; 489 var url = 'score_goods/get_spec_sku1';
@@ -451,7 +499,7 @@ @@ -451,7 +499,7 @@
451 499
452 value.spec_value.forEach(function(valuek, indexk, arrayk) { 500 value.spec_value.forEach(function(valuek, indexk, arrayk) {
453 if (indexk == 0) { 501 if (indexk == 0) {
454 - value.selid = valuek.id; 502 + value.selid = valuek.spec_value_id;
455 } 503 }
456 valuek.sel = false 504 valuek.sel = false
457 }) 505 })
@@ -463,22 +511,85 @@ @@ -463,22 +511,85 @@
463 console.log(err) 511 console.log(err)
464 }) 512 })
465 }, 513 },
  514 +
  515 + //获取面坊商品规格
  516 + getmianfangspec(){
  517 + let that = this;
  518 + var url = 'flour_goods/get_spec_sku1';
  519 + var params = {
  520 + flour_goods_id: that.goodid,
  521 + }
  522 + console.log(params)
  523 + app.post(url, params).then((res) => {
  524 + console.log(res);
  525 + that.specarr = res.data.data;
  526 + that.specarr.forEach(function(value, index, array) {
  527 + value.selindex = 0;
  528 + value.spec_value.forEach(function(valuek, indexk, arrayk) {
  529 + if (indexk == 0) {
  530 + value.selid = valuek.spec_value_id;
  531 + }
  532 + valuek.sel = false
  533 + })
  534 + })
  535 +
  536 + that.specarr = that.specarr;
  537 +
  538 + }).catch((err) => {
  539 + console.log(err)
  540 + })
  541 + },
466 // 选择商品规格 542 // 选择商品规格
467 selspec(parindex, childindex) { 543 selspec(parindex, childindex) {
468 let newspecarr = this.specarr; 544 let newspecarr = this.specarr;
469 -  
470 newspecarr[parindex].spec_value[childindex].sel = !newspecarr[parindex].spec_value[childindex].sel; 545 newspecarr[parindex].spec_value[childindex].sel = !newspecarr[parindex].spec_value[childindex].sel;
471 newspecarr[parindex].selindex = childindex; 546 newspecarr[parindex].selindex = childindex;
472 - newspecarr[parindex].selid = newspecarr[parindex].spec_value[childindex].id  
473 - this.arr.push(newspecarr[parindex].spec_value[childindex].id); 547 + newspecarr[parindex].selid = newspecarr[parindex].spec_value[childindex].spec_value_id
  548 + this.arr.push(newspecarr[parindex].spec_value[childindex].spec_value_id);
474 // console.log(this.spec_sku_id) 549 // console.log(this.spec_sku_id)
475 this.specarr = newspecarr; 550 this.specarr = newspecarr;
476 -  
477 // console.log(this.specarr[parindex].spec_value[childindex].sel) 551 // console.log(this.specarr[parindex].spec_value[childindex].sel)
478 console.log(JSON.stringify(this.specarr)) 552 console.log(JSON.stringify(this.specarr))
479 - this.changspec() 553 +
  554 + if(this.type==3){
  555 + this.changeshopsepc()
  556 + }else if(this.type==2){
  557 + this.changspec();
  558 + }else if(this.type==1){
  559 + this.changemianspec()
  560 + }
480 }, 561 },
481 - // 更换商品的图片和价格 562 +
  563 + // 更改店铺商品图片和图片规格
  564 + changeshopsepc(){
  565 + let that = this;
  566 + let newspec_sku_id = []
  567 +
  568 + that.specarr.forEach(function(value, index, array) {
  569 + newspec_sku_id.push(value.selid)
  570 + })
  571 + that.spec_sku_id = newspec_sku_id
  572 + var url = 'store_goods/get_spec_sku2';
  573 + var params = {
  574 + store_goods_id: that.goodid,
  575 + spec_sku_id: that.spec_sku_id.join("_")
  576 + }
  577 + console.log(params)
  578 + app.post(url, params).then((res) => {
  579 + console.log(res);
  580 + if (that.type == 1) {
  581 + that.goodtail.flour_goods_spec = res.data.data;
  582 + that.goodtail.price = res.data.data.price;
  583 + } else if (that.type == 2) {
  584 + that.goodtail.score_goods_spec = res.data.data
  585 + }
  586 + that.goodtail = that.goodtail;
  587 + }).catch((err) => {
  588 + console.log(err)
  589 +
  590 + })
  591 + },
  592 + // 更换积分商品商品的图片和价格
482 changspec() { 593 changspec() {
483 let that = this; 594 let that = this;
484 let newspec_sku_id = [] 595 let newspec_sku_id = []
@@ -507,6 +618,36 @@ @@ -507,6 +618,36 @@
507 618
508 }) 619 })
509 }, 620 },
  621 + //更换面坊商品商品的图片和价格
  622 + changemianspec(){
  623 + let that = this;
  624 + let newspec_sku_id = []
  625 +
  626 + that.specarr.forEach(function(value, index, array) {
  627 + newspec_sku_id.push(value.selid)
  628 + })
  629 + that.spec_sku_id = newspec_sku_id
  630 + var url = 'flour_goods/get_spec_sku2';
  631 + var params = {
  632 + flour_goods_id: that.goodid,
  633 + spec_sku_id: that.spec_sku_id.join("_")
  634 + }
  635 + console.log(params)
  636 + app.post(url, params).then((res) => {
  637 + console.log(res);
  638 + if (that.type == 1) {
  639 + that.goodtail.flour_goods_spec = res.data.data;
  640 + that.goodtail.price = res.data.data.price;
  641 + } else if (that.type == 2) {
  642 + that.goodtail.score_goods_spec = res.data.data
  643 + }
  644 + that.goodtail = that.goodtail;
  645 + }).catch((err) => {
  646 + console.log(err)
  647 +
  648 + })
  649 + },
  650 +
510 sure() { 651 sure() {
511 if (this.addtype == 1) { 652 if (this.addtype == 1) {
512 this.addcartk(); 653 this.addcartk();
@@ -537,7 +678,6 @@ @@ -537,7 +678,6 @@
537 title: "加入购物车成功", 678 title: "加入购物车成功",
538 icon: 'none' 679 icon: 'none'
539 }) 680 })
540 -  
541 setTimeout(function() { 681 setTimeout(function() {
542 uni.navigateTo({ 682 uni.navigateTo({
543 url: '/pages/nearshop/cartlist' 683 url: '/pages/nearshop/cartlist'
1 <template> 1 <template>
2 <view class="content"> 2 <view class="content">
3 - <view class="sureordertop flextwo" @click="addaddress">  
4 - <!-- @click="addaddress" -->  
5 - <view class="sureordername" v-if="addressitem==''">请选择地址</view>  
6 - <view class="addresstop" v-else>  
7 - <view class="addressname flexone">  
8 - <view class="sureordername">  
9 - {{addressitem.name}} 3 + <view class="ordercontent">
  4 + <view class="sureordertop flextwo" @click="addaddress" v-if="postage_type3==1||postage_type2==1||postage_type1==1">
  5 + <!-- @click="addaddress" -->
  6 + <view class="sureordername" v-if="addressitem==''">请选择地址</view>
  7 + <view class="addresstop" v-else>
  8 + <view class="addressname flexone">
  9 + <view class="sureordername">
  10 + {{addressitem.name}}
  11 + </view>
  12 + <view class="sureorderphone">{{addressitem.phone}}</view>
  13 + </view>
  14 + <view class="addresstitle">
  15 + {{addressitem.province_name}}{{addressitem.city_name}}{{addressitem.county_name}}{{addressitem.address}}
10 </view> 16 </view>
11 - <view class="sureorderphone">{{addressitem.phone}}</view>  
12 </view> 17 </view>
13 - <view class="addresstitle">  
14 - {{addressitem.province_name}}{{addressitem.city_name}}{{addressitem.county_name}}{{addressitem.address}} 18 + <view class="yourowk">
  19 + <image src="../../static/yourowk.png" mode=""></image>
15 </view> 20 </view>
16 </view> 21 </view>
17 - <view class="yourowk">  
18 - <image src="../../static/yourowk.png" mode=""></image>  
19 - </view>  
20 - </view>  
21 - <view class="sureshop sureshopk">  
22 - <!-- 店铺商品 -->  
23 - <view class="bigbox" v-if="goodinfo.data3.length!=0">  
24 - <view class="sureorderbox flexone">  
25 - <view class="sureimg">  
26 - <image src="../../static/nearshop.png" mode=""></image>  
27 - </view>  
28 - <view class="sureshopname">{{goodinfo.data3[0].name}}</view>  
29 - </view>  
30 - <view class="boxbox">  
31 - <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data3[0].goods" :key="index">  
32 - <view class="sureorderitemleft">  
33 - <image :src="item.store_goods_spec.spec_image" mode=""></image> 22 + <view class="sureshop sureshopk">
  23 + <!-- 店铺商品 -->
  24 + <view class="bigbox" v-if="goodinfo.data3.length!=0">
  25 + <view class="sureorderbox flexone">
  26 + <view class="sureimg">
  27 + <image src="../../static/nearshop.png" mode=""></image>
34 </view> 28 </view>
35 - <view class='shuright'>  
36 - <view class="suregoodnamek">{{item.name}}  
37 - </view>  
38 - <view v-if="item.spec.length!=0">  
39 - <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view> 29 + <view class="sureshopname">{{goodinfo.data3[0].name}}</view>
  30 + </view>
  31 + <view class="boxbox">
  32 + <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data3[0].goods" :key="index">
  33 + <view class="sureorderitemleft">
  34 + <image :src="item.store_goods_spec.spec_image" mode=""></image>
40 </view> 35 </view>
41 - <view class="surebot flexone">  
42 - <view class="saleprice">¥{{item.price}}</view>  
43 - <view class="detailnum">x{{item.number}}</view> 36 + <view class='shuright'>
  37 + <view class="suregoodnamek">{{item.name}}
  38 + </view>
  39 + <view v-if="item.spec.length!=0">
  40 + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  41 + </view>
  42 + <view class="surebot flexone">
  43 + <view class="saleprice">¥{{item.price}}</view>
  44 + <view class="detailnum">x{{item.number}}</view>
  45 + </view>
44 </view> 46 </view>
45 </view> 47 </view>
46 </view> 48 </view>
47 - </view>  
48 49
49 - <view class="delivery flextwo">  
50 - <view class="deliveryleft">配送服务</view>  
51 - <view class="deliveryright flexone">  
52 - <picker @change="bindgoodChange" :value="goodindex" :range="goodservicearr" range-key="name">  
53 - <view class="deliveryname">{{goodpeiname}}</view>  
54 - </picker> 50 + <view class="delivery flextwo">
  51 + <view class="deliveryleft">配送服务</view>
  52 + <view class="deliveryright flexone">
  53 + <picker @change="bindgoodChange" :value="goodindex" :range="goodservicearr" range-key="name">
  54 + <view class="deliveryname">{{goodpeiname}}</view>
  55 + </picker>
55 56
56 - <view class='yourow'>  
57 - <image src="../../static/yourowk.png" mode=""></image> 57 + <view class='yourow'>
  58 + <image src="../../static/yourowk.png" mode=""></image>
  59 + </view>
58 </view> 60 </view>
59 </view> 61 </view>
  62 + <view class="delivery markcontent">
  63 + <view class='markname'>店铺备注</view>
  64 + <view class="marktext">
  65 + <textarea value="" placeholder="选填,给商家留言" @input="entershopmessage" />
  66 + </view>
  67 + </view>
  68 + <view class="delivery markcontent markcontentk peibox">
  69 + <view class="deliveryitem flextwo">
  70 + <view class='deliveryitemname'>商品金额</view>
  71 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].goods_total}}</view>
  72 + </view>
  73 +
  74 +
  75 + <view class="deliveryitem flextwo">
  76 + <view class='deliveryitemname'>运费</view>
  77 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].postage_price}}</view>
  78 + </view>
  79 + </view>
  80 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  81 + <view class="deliveryleft">小计</view>
  82 + <view class="deliverymoney">¥{{goodinfo.data3[0].goods_total*100/100+goodinfo.data3[0].postage_price*100/100}}</view>
60 </view> 83 </view>
61 - <view class="delivery markcontent">  
62 - <view class='markname'>店铺备注</view>  
63 - <view class="marktext">  
64 - <textarea value="" placeholder="选填,给商家留言" @input="entershopmessage" />  
65 - </view>  
66 - </view>  
67 - <view class="delivery markcontent markcontentk peibox">  
68 - <view class="deliveryitem flextwo">  
69 - <view class='deliveryitemname'>商品金额</view>  
70 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].goods_total}}</view>  
71 - </view>  
72 -  
73 -  
74 - <view class="deliveryitem flextwo">  
75 - <view class='deliveryitemname'>运费</view>  
76 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].postage_price}}</view>  
77 </view> 84 </view>
78 - </view>  
79 - <view class="delivery peidelivery markcontentk flextwo peiboxk">  
80 - <view class="deliveryleft">小计</view>  
81 - <view class="deliverymoney">¥{{goodinfo.data3[0].goods_total*100/100+goodinfo.data3[0].postage_price*100/100}}</view>  
82 - </view>  
83 - </view>  
84 -  
85 - <div class="botbox" v-if="goodinfo.data1.flour_goods!=undefined"></div>  
86 - <!-- 面坊商品 -->  
87 - <view class="bigbox" v-if="goodinfo.data1.flour_goods!=undefined">  
88 - <view class="sureorderbox flexone">  
89 - <view class="sureimg">  
90 - <image src="../../static/nearshop.png" mode=""></image> 85 + <div class="botbox" v-if="goodinfo.data1.flour_goods!=undefined"></div>
  86 + <!-- 面坊商品 -->
  87 + <view class="bigbox" v-if="goodinfo.data1.flour_goods!=undefined">
  88 + <view class="sureorderbox flexone">
  89 + <view class="sureimg">
  90 + <image src="../../static/nearshop.png" mode=""></image>
  91 + </view>
  92 + <view class="sureshopname">面坊商品</view>
91 </view> 93 </view>
92 - <view class="sureshopname">面坊商品</view>  
93 - </view>  
94 - <view class="boxbox">  
95 - <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data1.flour_goods" :key="index">  
96 - <view class="sureorderitemleft">  
97 - <!-- <image :src="item.score_goods_spec.spec_image" mode=""></image> --> 94 + <view class="boxbox">
  95 + <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data1.flour_goods" :key="index">
  96 + <view class="sureorderitemleft">
  97 + <!-- <image :src="item.score_goods_spec.spec_image" mode=""></image> -->
  98 + </view>
  99 + <view class='shuright'>
  100 + <view class="suregoodnamek">{{item.name}}
  101 + </view>
  102 + <view v-if="item.spec.length!=0">
  103 + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  104 + </view>
  105 + <view class="surebot flexone">
  106 + <view class="saleprice">¥{{item.price}}</view>
  107 + <view class="detailnum">x{{item.number}}</view>
  108 + </view>
  109 + </view>
98 </view> 110 </view>
99 - <view class='shuright'>  
100 - <view class="suregoodnamek">{{item.name}} 111 + </view>
  112 + <view class="delivery flextwo">
  113 + <view class="deliveryleft">配送服务</view>
  114 + <view class="deliveryright flexone">
  115 + <picker @change="bindmianChange" :value="mianindex" :range="servicearr" range-key="name">
  116 + <view class="deliveryname">{{mianpeiname}}</view>
  117 + </picker>
  118 +
  119 + <view class='yourow'>
  120 + <image src="../../static/yourowk.png" mode=""></image>
101 </view> 121 </view>
102 - <view v-if="item.spec.length!=0">  
103 - <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view> 122 + </view>
  123 + </view>
  124 + <view class="delivery markcontent">
  125 + <view class='markname'>店铺备注</view>
  126 + <view class="marktext">
  127 + <textarea value="" placeholder="选填,给商家留言" @input="entermianfangrmark"/>
104 </view> 128 </view>
105 - <view class="surebot flexone">  
106 - <view class="saleprice">¥{{item.price}}</view>  
107 - <view class="detailnum">x{{item.number}}</view> 129 + </view>
  130 + <!-- <view class="delivery flextwo markcontent">
  131 + <view class="deliveryleft flexone">
  132 + <view class='jifen'>可用积分抵扣50</view>
  133 + <view class="jifenimg">
  134 + <image src="../../static/gantan.png" mode=""></image>
  135 + </view>
  136 + </view>
  137 + <view class="deliveryname">请输入抵扣积分</view>
  138 + </view> -->
  139 + <view class="delivery flextwo markcontent" @click="selectcoupon">
  140 + <view class="deliveryleft flexone">
  141 + <view class='jifen'>优惠劵</view>
  142 + <view class="jifenimg youimg">
  143 + <image src="../../static/gantan.png" mode=""></image>
108 </view> 144 </view>
109 </view> 145 </view>
  146 + <view class="deliveryname">{{couponname}}</view>
  147 + </view>
  148 +
  149 + <view class="delivery markcontent markcontentk peibox">
  150 + <view class="deliveryitem flextwo">
  151 + <view class='deliveryitemname'>商品金额</view>
  152 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.goods_total}}</view>
110 </view> 153 </view>
  154 + <!-- <view class="deliveryitem flextwo">
  155 + <view class='deliveryitemname'>积分抵扣</view>
  156 + <view class='deliveryitemname moneyright'>¥2600.00</view>
  157 + </view> -->
  158 + <view class="deliveryitem flextwo">
  159 + <view class='deliveryitemname'>优惠券</view>
  160 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.discounts}}</view>
  161 + </view>
  162 + <view class="deliveryitem flextwo">
  163 + <view class='deliveryitemname'>运费</view>
  164 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.postage_price}}</view>
  165 + </view>
  166 + </view>
  167 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  168 + <view class="deliveryleft">小计</view>
  169 + <view class="deliverymoney">¥{{goodinfo.data1.goods_total*100/100+goodinfo.data1.postage_price*100/100}}</view>
  170 + </view>
  171 +
  172 +
111 </view> 173 </view>
  174 + <div class="botbox" v-if="goodinfo.data2.score_goods!=undefined"></div>
  175 + <!-- 积分商品 -->
  176 + <view class="bigbox jibox" v-if="goodinfo.data2.score_goods!=undefined">
  177 + <view class="sureorderbox flexone">
  178 + <view class="sureimg">
  179 + <image src="../../static/nearshop.png" mode=""></image>
  180 + </view>
  181 + <view class="sureshopname">积分商品</view>
  182 + </view>
  183 + <view class="boxbox">
  184 + <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data2.score_goods" :key="index">
  185 + <view class="sureorderitemleft">
  186 + <image :src="item.score_goods_spec.spec_image" mode=""></image>
  187 + </view>
  188 + <view class='shuright'>
  189 + <view class="suregoodnamek">{{item.name}}
  190 + </view>
  191 + <view v-if="item.spec.length!=0">
  192 + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  193 + </view>
  194 + <view class="surebot flexone">
  195 + <view class="saleprice">¥{{item.price}}</view>
  196 + <view class="weightnumk flexone">
  197 + <view class="detailnum">x{{item.number}}</view>
  198 + </view>
  199 + </view>
  200 + </view>
  201 + </view>
  202 + </view>
  203 +
112 <view class="delivery flextwo"> 204 <view class="delivery flextwo">
113 <view class="deliveryleft">配送服务</view> 205 <view class="deliveryleft">配送服务</view>
114 <view class="deliveryright flexone"> 206 <view class="deliveryright flexone">
115 - <picker @change="bindmianChange" :value="mianindex" :range="servicearr" range-key="name">  
116 - <view class="deliveryname">{{mianpeiname}}</view> 207 + <picker @change="bindjiChange" :value="jiindex" :range="jifenservicearr" range-key="name">
  208 + <view class="deliveryname">{{jifenpeiname}}</view>
117 </picker> 209 </picker>
118 -  
119 <view class='yourow'> 210 <view class='yourow'>
120 <image src="../../static/yourowk.png" mode=""></image> 211 <image src="../../static/yourowk.png" mode=""></image>
121 </view> 212 </view>
@@ -124,135 +215,45 @@ @@ -124,135 +215,45 @@
124 <view class="delivery markcontent"> 215 <view class="delivery markcontent">
125 <view class='markname'>店铺备注</view> 216 <view class='markname'>店铺备注</view>
126 <view class="marktext"> 217 <view class="marktext">
127 - <textarea value="" placeholder="选填,给商家留言" @input="entermianfangrmark"/> 218 + <textarea value="" placeholder="选填,给商家留言" @input="enterjifenremark"/>
128 </view> 219 </view>
129 </view> 220 </view>
130 - <!-- <view class="delivery flextwo markcontent"> 221 + <view class="delivery flextwo markcontent">
131 <view class="deliveryleft flexone"> 222 <view class="deliveryleft flexone">
132 - <view class='jifen'>可用积分抵扣50</view>  
133 - <view class="jifenimg">  
134 - <image src="../../static/gantan.png" mode=""></image>  
135 - </view>  
136 - </view>  
137 - <view class="deliveryname">请输入抵扣积分</view>  
138 - </view> -->  
139 - <view class="delivery flextwo markcontent" @click="selectcoupon">  
140 - <view class="deliveryleft flexone">  
141 - <view class='jifen'>优惠劵</view> 223 + <view class='jifen'>可用积分抵扣</view>
142 <view class="jifenimg youimg"> 224 <view class="jifenimg youimg">
143 <image src="../../static/gantan.png" mode=""></image> 225 <image src="../../static/gantan.png" mode=""></image>
144 </view> 226 </view>
145 </view> 227 </view>
146 - <view class="deliveryname">{{couponname}}</view>  
147 - </view>  
148 -  
149 - <view class="delivery markcontent markcontentk peibox">  
150 - <view class="deliveryitem flextwo">  
151 - <view class='deliveryitemname'>商品金额</view>  
152 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.goods_total}}</view>  
153 - </view>  
154 - <!-- <view class="deliveryitem flextwo">  
155 - <view class='deliveryitemname'>积分抵扣</view>  
156 - <view class='deliveryitemname moneyright'>¥2600.00</view>  
157 - </view> -->  
158 - <view class="deliveryitem flextwo">  
159 - <view class='deliveryitemname'>优惠券</view>  
160 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.discounts}}</view>  
161 - </view>  
162 - <view class="deliveryitem flextwo">  
163 - <view class='deliveryitemname'>运费</view>  
164 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.postage_price}}</view>  
165 - </view>  
166 - </view>  
167 - <view class="delivery peidelivery markcontentk flextwo peiboxk">  
168 - <view class="deliveryleft">小计</view>  
169 - <view class="deliverymoney">¥{{goodinfo.data1.goods_total*100/100+goodinfo.data1.postage_price*100/100}}</view>  
170 - </view>  
171 -  
172 -  
173 - </view>  
174 - <div class="botbox" v-if="goodinfo.data2.score_goods!=undefined"></div>  
175 - <!-- 积分商品 -->  
176 - <view class="bigbox jibox" v-if="goodinfo.data2.score_goods!=undefined">  
177 - <view class="sureorderbox flexone">  
178 - <view class="sureimg">  
179 - <image src="../../static/nearshop.png" mode=""></image>  
180 - </view>  
181 - <view class="sureshopname">积分商品</view>  
182 - </view>  
183 - <view class="boxbox">  
184 - <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data2.score_goods" :key="index">  
185 - <view class="sureorderitemleft">  
186 - <image :src="item.score_goods_spec.spec_image" mode=""></image>  
187 - </view>  
188 - <view class='shuright'>  
189 - <view class="suregoodnamek">{{item.name}}  
190 - </view>  
191 - <view v-if="item.spec.length!=0">  
192 - <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>  
193 - </view>  
194 - <view class="surebot flexone">  
195 - <view class="saleprice">¥{{item.price}}</view>  
196 - <view class="weightnumk flexone">  
197 - <view class="detailnum">x{{item.number}}</view>  
198 - </view>  
199 - </view> 228 + <view class="deliveryname dikouname">
  229 + <input type="number" value="" placeholder="请输入抵扣积分" placeholder-class="dikouinput" @input="enterjifen"/>
200 </view> 230 </view>
201 - </view>  
202 </view> 231 </view>
203 -  
204 - <view class="delivery flextwo">  
205 - <view class="deliveryleft">配送服务</view>  
206 - <view class="deliveryright flexone">  
207 - <picker @change="bindjiChange" :value="jiindex" :range="jifenservicearr" range-key="name">  
208 - <view class="deliveryname">{{jifenpeiname}}</view>  
209 - </picker>  
210 - <view class='yourow'>  
211 - <image src="../../static/yourowk.png" mode=""></image> 232 + <view class="delivery markcontent markcontentk peibox">
  233 + <view class="deliveryitem flextwo">
  234 + <view class='deliveryitemname'>商品金额</view>
  235 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.goods_total}}</view>
212 </view> 236 </view>
213 - </view>  
214 - </view>  
215 - <view class="delivery markcontent">  
216 - <view class='markname'>店铺备注</view>  
217 - <view class="marktext">  
218 - <textarea value="" placeholder="选填,给商家留言" @input="enterjifenremark"/>  
219 - </view>  
220 - </view>  
221 - <view class="delivery flextwo markcontent">  
222 - <view class="deliveryleft flexone">  
223 - <view class='jifen'>可用积分抵扣50</view>  
224 - <view class="jifenimg youimg">  
225 - <image src="../../static/gantan.png" mode=""></image> 237 + <view class="deliveryitem flextwo">
  238 + <view class='deliveryitemname'>积分抵扣</view>
  239 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.user_score}}</view>
226 </view> 240 </view>
227 - </view>  
228 - <view class="deliveryname dikouname">  
229 - <input type="text" value="" placeholder="请输入抵扣积分" placeholder-class="dikouinput" @input="enterjifen"/> 241 +
  242 + <view class="deliveryitem flextwo">
  243 + <view class='deliveryitemname'>运费</view>
  244 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.postage_price}}</view>
230 </view> 245 </view>
231 - </view>  
232 - <view class="delivery markcontent markcontentk peibox">  
233 - <view class="deliveryitem flextwo">  
234 - <view class='deliveryitemname'>商品金额</view>  
235 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.goods_total}}</view> 246 + </view>
  247 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  248 + <view class="deliveryleft">小计</view>
  249 + <view class="deliverymoney">¥{{goodinfo.data2.goods_total*100/100+goodinfo.data2.postage_price*100/100}}</view>
236 </view> 250 </view>
237 - <view class="deliveryitem flextwo">  
238 - <view class='deliveryitemname'>积分抵扣</view>  
239 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.user_score}}</view>  
240 - </view>  
241 -  
242 - <view class="deliveryitem flextwo">  
243 - <view class='deliveryitemname'>运费</view>  
244 - <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.postage_price}}</view> 251 +
245 </view> 252 </view>
246 - </view>  
247 - <view class="delivery peidelivery markcontentk flextwo peiboxk">  
248 - <view class="deliveryleft">小计</view>  
249 - <view class="deliverymoney">¥{{goodinfo.data2.postage_price*100/100+goodinfo.data2.postage_price*100/100}}</view>  
250 - </view>  
251 -  
252 </view> 253 </view>
253 </view> 254 </view>
254 -  
255 - <view class="huiyuanbot boxsizing flextwo"> 255 +
  256 + <view class="huiyuanbot boxsizing flextwo totalbtn">
256 <view class="surezhifu">总计:{{goodinfo.total}}</view> 257 <view class="surezhifu">总计:{{goodinfo.total}}</view>
257 <view class="behuiyuanbtn behuiyuanbtnk" @click="surepay">确认支付</view> 258 <view class="behuiyuanbtn behuiyuanbtnk" @click="surepay">确认支付</view>
258 </view> 259 </view>
@@ -316,11 +317,8 @@ @@ -316,11 +317,8 @@
316 </view> 317 </view>
317 </view> 318 </view>
318 </view> 319 </view>
319 -  
320 -  
321 <view class="buybtn btnk" @click="paynow">确认支付(¥{{goodinfo.total}})</view> 320 <view class="buybtn btnk" @click="paynow">确认支付(¥{{goodinfo.total}})</view>
322 321
323 -  
324 </view> 322 </view>
325 </view> 323 </view>
326 <!-- 优惠券使用规则 --> 324 <!-- 优惠券使用规则 -->
@@ -344,6 +342,8 @@ @@ -344,6 +342,8 @@
344 export default { 342 export default {
345 data() { 343 data() {
346 return { 344 return {
  345 + // 是否显示收货地址
  346 + addresstrue:true,
347 buyshow: false, 347 buyshow: false,
348 couponrule:false, 348 couponrule:false,
349 goodinfo:'', 349 goodinfo:'',
@@ -359,11 +359,11 @@ @@ -359,11 +359,11 @@
359 name:'上门自提' 359 name:'上门自提'
360 }, 360 },
361 ], 361 ],
362 - mianpeiname:'请选择配送方式', 362 + mianpeiname:'快递配送',
363 jifen:'', 363 jifen:'',
364 couponname:'请选择优惠券', 364 couponname:'请选择优惠券',
365 // 面坊的配送方式 365 // 面坊的配送方式
366 - postage_type1:'', 366 + postage_type1:1,
367 // 积分商品配送方式 367 // 积分商品配送方式
368 jifenservicearr:[{ 368 jifenservicearr:[{
369 id:1, 369 id:1,
@@ -375,8 +375,8 @@ @@ -375,8 +375,8 @@
375 }, 375 },
376 ], 376 ],
377 jiindex:-1, 377 jiindex:-1,
378 - postage_type2:'',  
379 - jifenpeiname:'请选择配送方式', 378 + postage_type2:1,
  379 + jifenpeiname:'快递配送',
380 380
381 //店铺商品 381 //店铺商品
382 382
@@ -389,12 +389,12 @@ @@ -389,12 +389,12 @@
389 id:2, 389 id:2,
390 name:'上门自提' 390 name:'上门自提'
391 }], 391 }],
392 - goodpeiname:'请选择配送方式', 392 + goodpeiname:'快递配送',
393 pay_type:-1, 393 pay_type:-1,
394 user_ticket_id:'', 394 user_ticket_id:'',
395 - order_id:''  
396 -  
397 - 395 + order_id:'',
  396 + //判断收货地址是否显示
  397 + postage_type3:''
398 // data1 面坊 data2 积分 data3 店铺 398 // data1 面坊 data2 积分 data3 店铺
399 } 399 }
400 }, 400 },
@@ -403,6 +403,13 @@ @@ -403,6 +403,13 @@
403 this.goodinfo=uni.getStorageSync("goodinfo"); 403 this.goodinfo=uni.getStorageSync("goodinfo");
404 404
405 this.seldata=JSON.parse(options.seldata) 405 this.seldata=JSON.parse(options.seldata)
  406 + this.seldata.forEach(function(value,index,array){
  407 + if(value.type==3){
  408 + value.postage_type=1;
  409 + }
  410 + })
  411 + this.seldata=this.seldata;
  412 +
406 console.log(this.goodinfo) 413 console.log(this.goodinfo)
407 }, 414 },
408 415
@@ -416,14 +423,17 @@ @@ -416,14 +423,17 @@
416 bindmianChange(e){ 423 bindmianChange(e){
417 this.mianpeiname=this.servicearr[e.target.value].name; 424 this.mianpeiname=this.servicearr[e.target.value].name;
418 this.mianindex=e.target.value; 425 this.mianindex=e.target.value;
419 - this.postage_type1=this.servicearr[e.target.value].id 426 + this.postage_type1=this.servicearr[e.target.value].id;
  427 +
  428 + this.changeorder();
420 }, 429 },
421 // 积分商品的配送方式 430 // 积分商品的配送方式
422 bindjiChange(e){ 431 bindjiChange(e){
423 this.jifenpeiname=this.servicearr[e.target.value].name; 432 this.jifenpeiname=this.servicearr[e.target.value].name;
424 433
425 this.jiindex=e.target.value; 434 this.jiindex=e.target.value;
426 - this.postage_type2=this.servicearr[e.target.value].id 435 + this.postage_type2=this.servicearr[e.target.value].id;
  436 + this.changeorder();
427 }, 437 },
428 // 店铺商品的配送方式 438 // 店铺商品的配送方式
429 bindgoodChange(e){ 439 bindgoodChange(e){
@@ -431,16 +441,32 @@ @@ -431,16 +441,32 @@
431 console.log(this.goodservicearr) 441 console.log(this.goodservicearr)
432 this.goodpeiname=this.goodservicearr[e.target.value].name; 442 this.goodpeiname=this.goodservicearr[e.target.value].name;
433 this.goodindex=e.target.value; 443 this.goodindex=e.target.value;
  444 + // 店铺商品选择配送方式
434 this.seldata.forEach(function(value,index,array){ 445 this.seldata.forEach(function(value,index,array){
435 if(value.type==3){ 446 if(value.type==3){
436 - value.postage_type=that.goodservicearr[e.target.value].id;  
437 - } 447 + value.postage_type=that.goodservicearr[e.target.value].id;
  448 + }
  449 + })
  450 +
  451 + this.changeorder();
  452 +
  453 + that.seldata.forEach(function(value,index,array){
  454 + if( value.postage_type==1){
  455 + that.postage_type3=1;
  456 + }
438 }) 457 })
439 458
440 }, 459 },
441 // 输入积分 460 // 输入积分
442 enterjifen(e){ 461 enterjifen(e){
443 - this.jifen=e.detail.vlaue 462 + console.log(222222);
  463 + console.log(e.detail.value)
  464 +
  465 +
  466 + this.jifen=e.detail.value;
  467 + console.log(this.jifen)
  468 + this.changeorder()
  469 +
444 }, 470 },
445 // 面坊商品备注 471 // 面坊商品备注
446 entermianfangrmark(e){ 472 entermianfangrmark(e){
@@ -479,34 +505,57 @@ @@ -479,34 +505,57 @@
479 know(){ 505 know(){
480 this.couponrule=false 506 this.couponrule=false
481 }, 507 },
482 - getordertail(){  
483 - let that = this;  
484 - if(that.data.length==0){  
485 - uni.showToast({  
486 - title:'请选择商品',  
487 - icon:'none'  
488 - })  
489 - return false  
490 - }  
491 - var url = 'order/confirm_order';  
492 - var params = {  
493 - data: JSON.stringify(that.data),  
494 -  
495 - }  
496 - console.log(params)  
497 - app.post(url, params,"post").then((res) => {  
498 - console.log(res);  
499 - uni.navigateTo({  
500 - url:'/pages/nearshop/sureorder'  
501 - })  
502 -  
503 - }).catch((err) => {  
504 - console.log(err)  
505 -  
506 - }) 508 + // 修改价格
  509 + changeorder(){
  510 + let that = this;
  511 + var url = 'order/confirm_order';
  512 + console.log('获取的参数', that.seldata)
  513 + var params = {
  514 + data: JSON.stringify(that.seldata),
  515 + postage_type1:that.postage_type1,
  516 + postage_type2:that.postage_type2,
  517 + score:that.jifen,
  518 + remark1:that.remark1,
  519 + remark2:that.remark2,
  520 + pay_type:that.pay_type,
  521 + user_address_id:that.addressitem.id,
  522 + }
  523 + console.log(params)
  524 + app.post(url, params, "post").then((res) => {
  525 + console.log(res);
  526 + console.log(res.data.data);
  527 + that.goodinfo=res.data.data
  528 + // let seldata = JSON.stringify(that.data)
  529 + // uni.setStorageSync("goodinfo", res.data.data);
  530 + // uni.navigateTo({
  531 + // url: '/pages/nearshop/sureorder?seldata=' + seldata
  532 + // })
  533 +
  534 + }).catch((err) => {
  535 + console.log(err)
  536 + uni.showToast({
  537 + title:err.msg,
  538 + icon:'none'
  539 + })
  540 +
  541 + })
507 }, 542 },
508 //确认支付 543 //确认支付
509 surepay(){ 544 surepay(){
  545 + let that=this;
  546 +
  547 + if(that.postage_type1==1||that.postage_type2==1||that.postage_type3==1){
  548 + if(that.addressitem.id==undefined){
  549 + uni.showToast({
  550 + title:'请选择收货地址',
  551 + icon:'none'
  552 + })
  553 + return false
  554 + }
  555 +
  556 + }else{
  557 + that.addressitem.id==''
  558 + }
510 this.buyshow=true 559 this.buyshow=true
511 }, 560 },
512 hidebuy(){ 561 hidebuy(){
@@ -515,13 +564,9 @@ @@ -515,13 +564,9 @@
515 // 确认支付 564 // 确认支付
516 paynow(){ 565 paynow(){
517 let that = this; 566 let that = this;
518 - // if(that.data.length==0){  
519 - // uni.showToast({  
520 - // title:'请选择商品',  
521 - // icon:'none'  
522 - // })  
523 - // return false  
524 - // } 567 + console.log(that.addressitem.id)
  568 +
  569 +
525 var url = 'order/create_order'; 570 var url = 'order/create_order';
526 var params = { 571 var params = {
527 data: JSON.stringify(that.seldata), 572 data: JSON.stringify(that.seldata),
@@ -534,7 +579,7 @@ @@ -534,7 +579,7 @@
534 pay_type:that.pay_type, 579 pay_type:that.pay_type,
535 user_address_id:that.addressitem.id 580 user_address_id:that.addressitem.id
536 } 581 }
537 - console.log(that.seldata) 582 + console.log(that.seldata);
538 console.log(params) 583 console.log(params)
539 app.post(url, params,"post").then((res) => { 584 app.post(url, params,"post").then((res) => {
540 console.log(res); 585 console.log(res);
@@ -546,6 +591,10 @@ @@ -546,6 +591,10 @@
546 591
547 }).catch((err) => { 592 }).catch((err) => {
548 console.log(err) 593 console.log(err)
  594 + uni.showToast({
  595 + title:err.msg,
  596 + icon:'none'
  597 + })
549 598
550 }) 599 })
551 }, 600 },
@@ -565,6 +614,11 @@ @@ -565,6 +614,11 @@
565 title:'支付成功', 614 title:'支付成功',
566 icon:'none' 615 icon:'none'
567 }) 616 })
  617 + setTimeout(function(){
  618 + uni.navigateTo({
  619 + url:'/pages/usercenter/myOrder'
  620 + })
  621 + },1500)
568 622
569 }).catch((err) => { 623 }).catch((err) => {
570 console.log(err) 624 console.log(err)
@@ -600,6 +654,15 @@ @@ -600,6 +654,15 @@
600 page{ 654 page{
601 background: #F8F6F9; 655 background: #F8F6F9;
602 } 656 }
  657 + .ordercontent{
  658 + padding-bottom: 150rpx;
  659 + box-sizing: border-box;
  660 + }
  661 + .totalbtn{
  662 + position: fixed;
  663 + bottom:0;
  664 + left:0;
  665 + }
603 .totalmoney{ 666 .totalmoney{
604 color:#C29445; 667 color:#C29445;
605 font-size: 30rpx; 668 font-size: 30rpx;
@@ -15,7 +15,6 @@ @@ -15,7 +15,6 @@
15 </view> 15 </view>
16 <view class="navItem" :class="selindx==4?'navactive':''" @click="changeopt" :data-id="4"> 16 <view class="navItem" :class="selindx==4?'navactive':''" @click="changeopt" :data-id="4">
17 待评价 17 待评价
18 -  
19 </view> 18 </view>
20 </view> 19 </view>
21 <view class="list"> 20 <view class="list">
@@ -26,7 +25,6 @@ @@ -26,7 +25,6 @@
26 <text v-if="item.type==1">面坊商品</text> 25 <text v-if="item.type==1">面坊商品</text>
27 <text v-if="item.type==2">积分商品</text> 26 <text v-if="item.type==2">积分商品</text>
28 <text v-if="item.type==3">{{item.store.name}}</text> 27 <text v-if="item.type==3">{{item.store.name}}</text>
29 -  
30 </view> 28 </view>
31 <view class="rightT" v-if="item.status==1">待付款</view> 29 <view class="rightT" v-if="item.status==1">待付款</view>
32 <view class="rightT" v-if="item.status==2">待发货</view> 30 <view class="rightT" v-if="item.status==2">待发货</view>
@@ -36,20 +34,27 @@ @@ -36,20 +34,27 @@
36 <view class="rightT" v-if="item.status==-1">已取消</view> 34 <view class="rightT" v-if="item.status==-1">已取消</view>
37 </view> 35 </view>
38 <view class="infobox" v-for="(item,index) in item.order_info" :key="index"> 36 <view class="infobox" v-for="(item,index) in item.order_info" :key="index">
39 - <image src="../../static/cai.png" mode="widthFix" class="shop"></image> 37 + <image :src="item.image" mode="widthFix" class="shop"></image>
40 <view class="info"> 38 <view class="info">
41 <view class="word">{{item.goods_name}}</view> 39 <view class="word">{{item.goods_name}}</view>
42 - <view v-if="item.spec.length!=0"> 40 + <view class="flexone" v-if="item.spec.length!=0">
43 <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view> 41 <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
44 </view> 42 </view>
45 <view class="price">¥{{item.price}}</view> 43 <view class="price">¥{{item.price}}</view>
46 </view> 44 </view>
47 </view> 45 </view>
48 - <view class="btnbox">  
49 - <view class="btn" style="margin-right: 16rpx;">取消订单</view>  
50 - <view class="btn bactive">立即支付</view> 46 + <view class="btnbox" v-if="item.status==1">
  47 + <view class="btn" style="margin-right: 16rpx;" @click="cancelorder(item)">取消订单</view>
  48 + <view class="btn bactive" @click="payorder(item)">立即支付</view>
  49 + </view>
  50 + <view class="btnbox" v-if="item.status==3">
  51 + <view class="btn bactive">确认收货</view>
  52 + </view>
  53 + <view class="btnbox" v-if="item.status==4">
  54 + <view class="btn bactive">立即评价</view>
51 </view> 55 </view>
52 </view> 56 </view>
  57 +
53 <!-- <view class="item"> 58 <!-- <view class="item">
54 <view class="titlebox"> 59 <view class="titlebox">
55 <view class="leftT"> 60 <view class="leftT">
@@ -132,6 +137,10 @@ @@ -132,6 +137,10 @@
132 }, 137 },
133 onLoad(options) { 138 onLoad(options) {
134 this.selindx = options.id; 139 this.selindx = options.id;
  140 + if(options.id==''){
  141 + this.selindx=''
  142 + }
  143 +
135 console.log(this.selindx); 144 console.log(this.selindx);
136 this.getorder() 145 this.getorder()
137 }, 146 },
@@ -141,13 +150,65 @@ @@ -141,13 +150,65 @@
141 url: '/pages/usercenter/shopEvaluate' 150 url: '/pages/usercenter/shopEvaluate'
142 }) 151 })
143 }, 152 },
  153 +
  154 + // 取消订单
  155 + cancelorder(item){
  156 + let that=this;
  157 + uni.showModal({
  158 + title: '提示',
  159 + content: '是否取消该订单',
  160 + success: function (res) {
  161 + if (res.confirm) {
  162 + var url = 'order/cancel';
  163 + var params = {
  164 + order_detail_id:item.id
  165 + }
  166 + console.log('7766554', params)
  167 + app.post(url, params).then((res) => {
  168 + console.log(res);
  169 + uni.showToast({
  170 + title:'取消订单成功',
  171 + icon:'none'
  172 + })
  173 + that.page=1;
  174 + that.orderlist=[];
  175 + that.getorder();
  176 +
  177 + }).catch((err) => {
  178 + console.log(err)
  179 +
  180 + })
  181 + } else if (res.cancel) {
  182 + console.log('用户点击取消');
  183 + }
  184 + }
  185 + });
  186 + },
  187 + // 确认订单
  188 + payorder(item){
  189 + console.log(item)
  190 + let that = this;
  191 + var url = 'order/pay';
  192 + var params = {
  193 + // order_id: item.order_id,
  194 + order_detail_id:item.id
  195 +
  196 + }
  197 + console.log('7766554', params)
  198 + app.post(url, params).then((res) => {
  199 + console.log(res);
  200 +
  201 + }).catch((err) => {
  202 + console.log(err)
  203 +
  204 + })
  205 + },
144 //切换选项 206 //切换选项
145 changeopt(e) { 207 changeopt(e) {
146 this.selindx = e.currentTarget.dataset.id; 208 this.selindx = e.currentTarget.dataset.id;
147 this.page=1; 209 this.page=1;
148 this.orderlist=[]; 210 this.orderlist=[];
149 this.getorder() 211 this.getorder()
150 -  
151 }, 212 },
152 // 获取订单列表 213 // 获取订单列表
153 getorder() { 214 getorder() {
@@ -246,7 +307,7 @@ @@ -246,7 +307,7 @@
246 } 307 }
247 308
248 .infobox { 309 .infobox {
249 - height: 204rpx; 310 + /* height: 204rpx; */
250 display: flex; 311 display: flex;
251 align-items: center; 312 align-items: center;
252 justify-content: space-between; 313 justify-content: space-between;
@@ -258,7 +319,7 @@ @@ -258,7 +319,7 @@
258 319
259 .info { 320 .info {
260 width: 530rpx; 321 width: 530rpx;
261 - padding: 32rpx 0; 322 + padding: 22rpx 0;
262 border-bottom: 1px solid #EEEEEE; 323 border-bottom: 1px solid #EEEEEE;
263 box-sizing: border-box; 324 box-sizing: border-box;
264 } 325 }
@@ -282,7 +343,7 @@ @@ -282,7 +343,7 @@
282 font-family: PingFangSC-Medium, PingFang SC; 343 font-family: PingFangSC-Medium, PingFang SC;
283 font-weight: 500; 344 font-weight: 500;
284 color: rgba(255, 91, 78, 1); 345 color: rgba(255, 91, 78, 1);
285 - margin-top: 20rpx; 346 + margin-top: 2rpx;
286 } 347 }
287 348
288 .btnbox { 349 .btnbox {
  1 +<template>
  2 + <view class="content">
  3 + <view class="ordercontent">
  4 + <view class="sureordertop flextwo" @click="addaddress" v-if="postage_type3==1||postage_type2==1||postage_type1==1">
  5 + <!-- @click="addaddress" -->
  6 + <view class="sureordername" v-if="addressitem==''">请选择地址</view>
  7 + <view class="addresstop" v-else>
  8 + <view class="addressname flexone">
  9 + <view class="sureordername">
  10 + {{addressitem.name}}
  11 + </view>
  12 + <view class="sureorderphone">{{addressitem.phone}}</view>
  13 + </view>
  14 + <view class="addresstitle">
  15 + {{addressitem.province_name}}{{addressitem.city_name}}{{addressitem.county_name}}{{addressitem.address}}
  16 + </view>
  17 + </view>
  18 + <view class="yourowk">
  19 + <image src="../../static/yourowk.png" mode=""></image>
  20 + </view>
  21 + </view>
  22 + <view class="sureshop sureshopk">
  23 + <!-- 店铺商品 -->
  24 + <view class="bigbox" v-if="goodinfo.data3.length!=0">
  25 + <view class="sureorderbox flexone">
  26 + <view class="sureimg">
  27 + <image src="../../static/nearshop.png" mode=""></image>
  28 + </view>
  29 + <view class="sureshopname">{{goodinfo.data3[0].name}}</view>
  30 + </view>
  31 + <view class="boxbox">
  32 + <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data3[0].goods" :key="index">
  33 + <view class="sureorderitemleft">
  34 + <image :src="item.store_goods_spec.spec_image" mode=""></image>
  35 + </view>
  36 + <view class='shuright'>
  37 + <view class="suregoodnamek">{{item.name}}
  38 + </view>
  39 + <view v-if="item.spec.length!=0">
  40 + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  41 + </view>
  42 + <view class="surebot flexone">
  43 + <view class="saleprice">¥{{item.price}}</view>
  44 + <view class="detailnum">x{{item.number}}</view>
  45 + </view>
  46 + </view>
  47 + </view>
  48 + </view>
  49 +
  50 + <view class="delivery flextwo">
  51 + <view class="deliveryleft">配送服务</view>
  52 + <view class="deliveryright flexone">
  53 + <picker @change="bindgoodChange" :value="goodindex" :range="goodservicearr" range-key="name">
  54 + <view class="deliveryname">{{goodpeiname}}</view>
  55 + </picker>
  56 +
  57 + <view class='yourow'>
  58 + <image src="../../static/yourowk.png" mode=""></image>
  59 + </view>
  60 + </view>
  61 + </view>
  62 + <view class="delivery markcontent">
  63 + <view class='markname'>店铺备注</view>
  64 + <view class="marktext">
  65 + <textarea value="" placeholder="选填,给商家留言" @input="entershopmessage" />
  66 + </view>
  67 + </view>
  68 + <view class="delivery markcontent markcontentk peibox">
  69 + <view class="deliveryitem flextwo">
  70 + <view class='deliveryitemname'>商品金额</view>
  71 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].goods_total}}</view>
  72 + </view>
  73 +
  74 +
  75 + <view class="deliveryitem flextwo">
  76 + <view class='deliveryitemname'>运费</view>
  77 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data3[0].postage_price}}</view>
  78 + </view>
  79 + </view>
  80 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  81 + <view class="deliveryleft">小计</view>
  82 + <view class="deliverymoney">¥{{goodinfo.data3[0].goods_total*100/100+goodinfo.data3[0].postage_price*100/100}}</view>
  83 + </view>
  84 + </view>
  85 + <div class="botbox" v-if="goodinfo.data1.flour_goods!=undefined"></div>
  86 + <!-- 面坊商品 -->
  87 + <view class="bigbox" v-if="goodinfo.data1.flour_goods!=undefined">
  88 + <view class="sureorderbox flexone">
  89 + <view class="sureimg">
  90 + <image src="../../static/nearshop.png" mode=""></image>
  91 + </view>
  92 + <view class="sureshopname">面坊商品</view>
  93 + </view>
  94 + <view class="boxbox">
  95 + <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data1.flour_goods" :key="index">
  96 + <view class="sureorderitemleft">
  97 + <!-- <image :src="item.score_goods_spec.spec_image" mode=""></image> -->
  98 + </view>
  99 + <view class='shuright'>
  100 + <view class="suregoodnamek">{{item.name}}
  101 + </view>
  102 + <view v-if="item.spec.length!=0">
  103 + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  104 + </view>
  105 + <view class="surebot flexone">
  106 + <view class="saleprice">¥{{item.price}}</view>
  107 + <view class="detailnum">x{{item.number}}</view>
  108 + </view>
  109 + </view>
  110 + </view>
  111 + </view>
  112 + <view class="delivery flextwo">
  113 + <view class="deliveryleft">配送服务</view>
  114 + <view class="deliveryright flexone">
  115 + <picker @change="bindmianChange" :value="mianindex" :range="servicearr" range-key="name">
  116 + <view class="deliveryname">{{mianpeiname}}</view>
  117 + </picker>
  118 +
  119 + <view class='yourow'>
  120 + <image src="../../static/yourowk.png" mode=""></image>
  121 + </view>
  122 + </view>
  123 + </view>
  124 + <view class="delivery markcontent">
  125 + <view class='markname'>店铺备注</view>
  126 + <view class="marktext">
  127 + <textarea value="" placeholder="选填,给商家留言" @input="entermianfangrmark"/>
  128 + </view>
  129 + </view>
  130 + <!-- <view class="delivery flextwo markcontent">
  131 + <view class="deliveryleft flexone">
  132 + <view class='jifen'>可用积分抵扣50</view>
  133 + <view class="jifenimg">
  134 + <image src="../../static/gantan.png" mode=""></image>
  135 + </view>
  136 + </view>
  137 + <view class="deliveryname">请输入抵扣积分</view>
  138 + </view> -->
  139 + <view class="delivery flextwo markcontent" @click="selectcoupon">
  140 + <view class="deliveryleft flexone">
  141 + <view class='jifen'>优惠劵</view>
  142 + <view class="jifenimg youimg">
  143 + <image src="../../static/gantan.png" mode=""></image>
  144 + </view>
  145 + </view>
  146 + <view class="deliveryname">{{couponname}}</view>
  147 + </view>
  148 +
  149 + <view class="delivery markcontent markcontentk peibox">
  150 + <view class="deliveryitem flextwo">
  151 + <view class='deliveryitemname'>商品金额</view>
  152 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.goods_total}}</view>
  153 + </view>
  154 + <!-- <view class="deliveryitem flextwo">
  155 + <view class='deliveryitemname'>积分抵扣</view>
  156 + <view class='deliveryitemname moneyright'>¥2600.00</view>
  157 + </view> -->
  158 + <view class="deliveryitem flextwo">
  159 + <view class='deliveryitemname'>优惠券</view>
  160 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.discounts}}</view>
  161 + </view>
  162 + <view class="deliveryitem flextwo">
  163 + <view class='deliveryitemname'>运费</view>
  164 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data1.postage_price}}</view>
  165 + </view>
  166 + </view>
  167 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  168 + <view class="deliveryleft">小计</view>
  169 + <view class="deliverymoney">¥{{goodinfo.data1.goods_total*100/100+goodinfo.data1.postage_price*100/100}}</view>
  170 + </view>
  171 +
  172 +
  173 + </view>
  174 + <div class="botbox" v-if="goodinfo.data2.score_goods!=undefined"></div>
  175 + <!-- 积分商品 -->
  176 + <view class="bigbox jibox" v-if="goodinfo.data2.score_goods!=undefined">
  177 + <view class="sureorderbox flexone">
  178 + <view class="sureimg">
  179 + <image src="../../static/nearshop.png" mode=""></image>
  180 + </view>
  181 + <view class="sureshopname">积分商品</view>
  182 + </view>
  183 + <view class="boxbox">
  184 + <view class="sureorderitem flex" v-for="(item,index) in goodinfo.data2.score_goods" :key="index">
  185 + <view class="sureorderitemleft">
  186 + <image :src="item.score_goods_spec.spec_image" mode=""></image>
  187 + </view>
  188 + <view class='shuright'>
  189 + <view class="suregoodnamek">{{item.name}}
  190 + </view>
  191 + <view v-if="item.spec.length!=0">
  192 + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  193 + </view>
  194 + <view class="surebot flexone">
  195 + <view class="saleprice">¥{{item.price}}</view>
  196 + <view class="weightnumk flexone">
  197 + <view class="detailnum">x{{item.number}}</view>
  198 + </view>
  199 + </view>
  200 + </view>
  201 + </view>
  202 + </view>
  203 +
  204 + <view class="delivery flextwo">
  205 + <view class="deliveryleft">配送服务</view>
  206 + <view class="deliveryright flexone">
  207 + <picker @change="bindjiChange" :value="jiindex" :range="jifenservicearr" range-key="name">
  208 + <view class="deliveryname">{{jifenpeiname}}</view>
  209 + </picker>
  210 + <view class='yourow'>
  211 + <image src="../../static/yourowk.png" mode=""></image>
  212 + </view>
  213 + </view>
  214 + </view>
  215 + <view class="delivery markcontent">
  216 + <view class='markname'>店铺备注</view>
  217 + <view class="marktext">
  218 + <textarea value="" placeholder="选填,给商家留言" @input="enterjifenremark"/>
  219 + </view>
  220 + </view>
  221 + <view class="delivery flextwo markcontent">
  222 + <view class="deliveryleft flexone">
  223 + <view class='jifen'>可用积分抵扣</view>
  224 + <view class="jifenimg youimg">
  225 + <image src="../../static/gantan.png" mode=""></image>
  226 + </view>
  227 + </view>
  228 + <view class="deliveryname dikouname">
  229 + <input type="number" value="" placeholder="请输入抵扣积分" placeholder-class="dikouinput" @input="enterjifen"/>
  230 + </view>
  231 + </view>
  232 + <view class="delivery markcontent markcontentk peibox">
  233 + <view class="deliveryitem flextwo">
  234 + <view class='deliveryitemname'>商品金额</view>
  235 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.goods_total}}</view>
  236 + </view>
  237 + <view class="deliveryitem flextwo">
  238 + <view class='deliveryitemname'>积分抵扣</view>
  239 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.user_score}}</view>
  240 + </view>
  241 +
  242 + <view class="deliveryitem flextwo">
  243 + <view class='deliveryitemname'>运费</view>
  244 + <view class='deliveryitemname moneyright'>¥{{goodinfo.data2.postage_price}}</view>
  245 + </view>
  246 + </view>
  247 + <view class="delivery peidelivery markcontentk flextwo peiboxk">
  248 + <view class="deliveryleft">小计</view>
  249 + <view class="deliverymoney">¥{{goodinfo.data2.goods_total*100/100+goodinfo.data2.postage_price*100/100}}</view>
  250 + </view>
  251 +
  252 + </view>
  253 + </view>
  254 + </view>
  255 +
  256 + <view class="huiyuanbot boxsizing flextwo totalbtn">
  257 + <view class="surezhifu">总计:{{goodinfo.total}}</view>
  258 + <view class="behuiyuanbtn behuiyuanbtnk" @click="surepay">确认支付</view>
  259 + </view>
  260 +
  261 + <!-- 购买弹层 -->
  262 + <view class="register" @click="hidebuy" v-if="buyshow">
  263 + <view class="buywrap boxsizing">
  264 + <view class="buyname">订单总额</view>
  265 + <view class="buymoney">{{goodinfo.total}}</view>
  266 + <view class='buybox'>
  267 + <view class="buyitem boxsizing flextwo" @click.stop="paytype" :data-id="1">
  268 + <view class="buyitemleft flexone">
  269 + <view class="buyleftimg" >
  270 +
  271 + <image src="../../static/weixin.png" mode=""></image>
  272 + </view>
  273 + <view class="buyitemname">微信支付</view>
  274 + </view>
  275 + <view class="selimg" >
  276 + <image src="../../static/selright.png" mode="" v-if="pay_type==1"></image>
  277 + <image src="../../static/meisel.png" mode="" v-else></image>
  278 + </view>
  279 + </view>
  280 + <view class="buyitem boxsizing flextwo">
  281 + <view class="buyitemleft flexone">
  282 + <view class="buyleftimg">
  283 +
  284 + <image src="../../static/zhifubao.png" mode=""></image>
  285 + </view>
  286 + <view class="buyitemname">支付宝</view>
  287 + </view>
  288 + <view class="selimg" @click.stop="paytype" :data-id="2">
  289 + <image src="../../static/selright.png" mode="" v-if="pay_type==2"></image>
  290 + <image src="../../static/meisel.png" mode="" v-else></image>
  291 + </view>
  292 + </view>
  293 +
  294 + <view class="buyitem boxsizing flextwo" @click.stop="paytype" :data-id="3">
  295 + <view class="buyitemleft flexone">
  296 + <view class="buyleftimg" >
  297 + <image src="../../static/yue.png" mode="" ></image>
  298 + </view>
  299 + <view class="buyitemname">余额支付</view>
  300 + </view>
  301 + <view class="selimg" >
  302 + <image src="../../static/selright.png" mode="" v-if="pay_type==3"></image>
  303 + <image src="../../static/meisel.png" mode="" v-else></image>
  304 + </view>
  305 + </view>
  306 + <view class="buyitem boxsizing flextwo" @click.stop="paytype" :data-id="4">
  307 + <view class="buyitemleft flexone">
  308 + <view class="buyleftimg">
  309 +
  310 + <image src="../../static/baitiao.png" mode="" ></image>
  311 + </view>
  312 + <view class="buyitemname">赊吧支付</view>
  313 + </view>
  314 + <view class="selimg" >
  315 + <image src="../../static/selright.png" mode="" v-if="pay_type==4"></image>
  316 + <image src="../../static/meisel.png" mode="" v-else></image>
  317 + </view>
  318 + </view>
  319 + </view>
  320 + <view class="buybtn btnk" @click="paynow">确认支付(¥{{goodinfo.total}})</view>
  321 +
  322 + </view>
  323 + </view>
  324 + <!-- 优惠券使用规则 -->
  325 + <view class='register' v-if="couponrule">
  326 + <view class="couponrule">
  327 + <view class='coupontitle'>优惠券使用规则</view>
  328 + <view class="coupontext">
  329 + Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  330 + Aenean euismod bibendum laoreet. Proin gravida dolor
  331 + sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis
  332 + parturient penatibus et magnis dis parturient
  333 + </view>
  334 + <view class="know" @click="know">我知道了</view>
  335 + </view>
  336 + </view>
  337 + </view>
  338 +</template>
  339 +
  340 +<script>
  341 + import app from "../../App.vue";
  342 + export default {
  343 + data() {
  344 + return {
  345 + // 是否显示收货地址
  346 + addresstrue:true,
  347 + buyshow: false,
  348 + couponrule:false,
  349 + goodinfo:'',
  350 + addressitem:'',
  351 + addresssel:'请选择地址',
  352 + mianindex:-1,
  353 + servicearr:[{
  354 + id:1,
  355 + name:'快递配送'
  356 + },
  357 + {
  358 + id:2,
  359 + name:'上门自提'
  360 + },
  361 + ],
  362 + mianpeiname:'快递配送',
  363 + jifen:'',
  364 + couponname:'请选择优惠券',
  365 + // 面坊的配送方式
  366 + postage_type1:1,
  367 + // 积分商品配送方式
  368 + jifenservicearr:[{
  369 + id:1,
  370 + name:'快递配送'
  371 + },
  372 + {
  373 + id:2,
  374 + name:'上门自提'
  375 + },
  376 + ],
  377 + jiindex:-1,
  378 + postage_type2:1,
  379 + jifenpeiname:'快递配送',
  380 +
  381 + //店铺商品
  382 +
  383 + goodindex:-1,
  384 + goodservicearr:[{
  385 + id:1,
  386 + name:'快递配送'
  387 + },
  388 + {
  389 + id:2,
  390 + name:'上门自提'
  391 + }],
  392 + goodpeiname:'快递配送',
  393 + pay_type:-1,
  394 + user_ticket_id:'',
  395 + order_id:'',
  396 + //判断收货地址是否显示
  397 + postage_type3:''
  398 + // data1 面坊 data2 积分 data3 店铺
  399 + }
  400 + },
  401 + onLoad(options) {
  402 + console.log(38349403)
  403 + this.goodinfo=uni.getStorageSync("goodinfo");
  404 +
  405 + this.seldata=JSON.parse(options.seldata)
  406 + this.seldata.forEach(function(value,index,array){
  407 + if(value.type==3){
  408 + value.postage_type=1;
  409 + }
  410 + })
  411 + this.seldata=this.seldata;
  412 +
  413 + console.log(this.goodinfo)
  414 + },
  415 +
  416 + methods: {
  417 +
  418 + // 选择支付方式
  419 + paytype(e){
  420 + this.pay_type=e.currentTarget.dataset.id
  421 + },
  422 + // 面访商品配送方式
  423 + bindmianChange(e){
  424 + this.mianpeiname=this.servicearr[e.target.value].name;
  425 + this.mianindex=e.target.value;
  426 + this.postage_type1=this.servicearr[e.target.value].id;
  427 +
  428 + this.changeorder();
  429 + },
  430 + // 积分商品的配送方式
  431 + bindjiChange(e){
  432 + this.jifenpeiname=this.servicearr[e.target.value].name;
  433 +
  434 + this.jiindex=e.target.value;
  435 + this.postage_type2=this.servicearr[e.target.value].id;
  436 + this.changeorder();
  437 + },
  438 + // 店铺商品的配送方式
  439 + bindgoodChange(e){
  440 + let that=this;
  441 + console.log(this.goodservicearr)
  442 + this.goodpeiname=this.goodservicearr[e.target.value].name;
  443 + this.goodindex=e.target.value;
  444 + // 店铺商品选择配送方式
  445 + this.seldata.forEach(function(value,index,array){
  446 + if(value.type==3){
  447 + value.postage_type=that.goodservicearr[e.target.value].id;
  448 + }
  449 + })
  450 +
  451 + this.changeorder();
  452 +
  453 + that.seldata.forEach(function(value,index,array){
  454 + if( value.postage_type==1){
  455 + that.postage_type3=1;
  456 + }
  457 + })
  458 +
  459 + },
  460 + // 输入积分
  461 + enterjifen(e){
  462 + console.log(222222);
  463 + console.log(e.detail.value)
  464 +
  465 +
  466 + this.jifen=e.detail.value;
  467 + console.log(this.jifen)
  468 + this.changeorder()
  469 +
  470 + },
  471 + // 面坊商品备注
  472 + entermianfangrmark(e){
  473 + console.log(e)
  474 + this.remark1=e.detail.value;
  475 + console.log(this.remark1)
  476 + },
  477 + // 店铺商品备注
  478 + entershopmessage(e){
  479 +
  480 + this.seldata.forEach(function(value,index,array){
  481 + if(value.type==3){
  482 + value.remark=e.detail.value
  483 + }
  484 + })
  485 + this.seldata=this.this.seldata;
  486 + console.log(this.seldata)
  487 + },
  488 + // 积分商品备注
  489 + enterjifenremark(){
  490 + this.remark2=e.detail.value
  491 + },
  492 + // 选择优惠券
  493 + selectcoupon(){
  494 + uni.navigateTo({
  495 + url:'/pages/nearshop/selectcoupon'
  496 + })
  497 + },
  498 + // 添加地址
  499 + addaddress(){
  500 + console.log(334439090)
  501 + uni.navigateTo({
  502 + url:"/pages/usercenter/address"
  503 + })
  504 + },
  505 + know(){
  506 + this.couponrule=false
  507 + },
  508 + // 修改价格
  509 + changeorder(){
  510 + let that = this;
  511 + var url = 'order/confirm_order';
  512 + console.log('获取的参数', that.seldata)
  513 + var params = {
  514 + data: JSON.stringify(that.seldata),
  515 + postage_type1:that.postage_type1,
  516 + postage_type2:that.postage_type2,
  517 + score:that.jifen,
  518 + remark1:that.remark1,
  519 + remark2:that.remark2,
  520 + pay_type:that.pay_type,
  521 + user_address_id:that.addressitem.id,
  522 + }
  523 + console.log(params)
  524 + app.post(url, params, "post").then((res) => {
  525 + console.log(res);
  526 + console.log(res.data.data);
  527 + that.goodinfo=res.data.data
  528 + // let seldata = JSON.stringify(that.data)
  529 + // uni.setStorageSync("goodinfo", res.data.data);
  530 + // uni.navigateTo({
  531 + // url: '/pages/nearshop/sureorder?seldata=' + seldata
  532 + // })
  533 +
  534 + }).catch((err) => {
  535 + console.log(err)
  536 + uni.showToast({
  537 + title:err.msg,
  538 + icon:'none'
  539 + })
  540 +
  541 + })
  542 + },
  543 + //确认支付
  544 + surepay(){
  545 + let that=this;
  546 +
  547 + if(that.postage_type1==1||that.postage_type2==1||that.postage_type3==1){
  548 + if(that.addressitem.id==undefined){
  549 + uni.showToast({
  550 + title:'请选择收货地址',
  551 + icon:'none'
  552 + })
  553 + return false
  554 + }
  555 +
  556 + }else{
  557 + that.addressitem.id==''
  558 + }
  559 + this.buyshow=true
  560 + },
  561 + hidebuy(){
  562 + this.buyshow=false
  563 + },
  564 + // 确认支付
  565 + paynow(){
  566 + let that = this;
  567 + console.log(that.addressitem.id)
  568 +
  569 +
  570 + var url = 'order/create_order';
  571 + var params = {
  572 + data: JSON.stringify(that.seldata),
  573 + user_ticket_id:that.user_ticket_id,
  574 + postage_type1:that.postage_type1,
  575 + postage_type2:that.postage_type2,
  576 + score:that.jifen,
  577 + remark1:that.remark1,
  578 + remark2:that.remark2,
  579 + pay_type:that.pay_type,
  580 + user_address_id:that.addressitem.id
  581 + }
  582 + console.log(that.seldata);
  583 + console.log(params)
  584 + app.post(url, params,"post").then((res) => {
  585 + console.log(res);
  586 + that.order_id=res.data.data.order_id;
  587 + that.paymoney()
  588 + // uni.navigateTo({
  589 + // url:'/pages/nearshop/sureorder'
  590 + // })
  591 +
  592 + }).catch((err) => {
  593 + console.log(err)
  594 + uni.showToast({
  595 + title:err.msg,
  596 + icon:'none'
  597 + })
  598 +
  599 + })
  600 + },
  601 + // 支付接口
  602 + paymoney(){
  603 + let that = this;
  604 +
  605 + var url = 'order/pay';
  606 + var params = {
  607 + order_id:that.order_id
  608 + }
  609 +
  610 + console.log(params)
  611 + app.post(url, params,"post").then((res) => {
  612 + console.log(res);
  613 + uni.showToast({
  614 + title:'支付成功',
  615 + icon:'none'
  616 + })
  617 + setTimeout(function(){
  618 + uni.navigateTo({
  619 + url:'/pages/usercenter/myOrder'
  620 + })
  621 + },1500)
  622 +
  623 + }).catch((err) => {
  624 + console.log(err)
  625 +
  626 + })
  627 + },
  628 +
  629 +
  630 + },
  631 + onShow() {
  632 + console.log(uni.getStorageSync("addressitem"))
  633 + if(uni.getStorageSync("addressitem")!=''){
  634 + this.addressitem = uni.getStorageSync("addressitem");
  635 + }
  636 + if(uni.getStorageSync("couponitem")!=''){
  637 + let couponitem = uni.getStorageSync("couponitem");
  638 + console.log(couponitem)
  639 + this.couponname=couponitem.name;
  640 + console.log(this.couponname)
  641 + this.user_ticket_id=couponitem.id
  642 + }
  643 +
  644 + console.log(this.addressitem)
  645 +
  646 + }
  647 +
  648 + }
  649 +</script>
  650 +
  651 +<style>
  652 + @import url('../../base/nearshop');
  653 + @import url('../../base/homepage');
  654 + page{
  655 + background: #F8F6F9;
  656 + }
  657 + .ordercontent{
  658 + padding-bottom: 150rpx;
  659 + box-sizing: border-box;
  660 + }
  661 + .totalbtn{
  662 + position: fixed;
  663 + bottom:0;
  664 + left:0;
  665 + }
  666 + .totalmoney{
  667 + color:#C29445;
  668 + font-size: 30rpx;
  669 + }
  670 + .btnk{
  671 + width:200prx;
  672 + }
  673 + .buywrap{
  674 + z-index:999
  675 + }
  676 +</style>