作者 lihongjuan

1

... ... @@ -772,7 +772,13 @@
line-height: 88rpx;
border-radius: 10rpx;
}
.behuiyuanbtn{
width:486rpx;
}
.surezhifu{
color:#C29445;
font-size: 32rpx;
}
/* 优惠券使用规则 */
.couponrule {
width: 540rpx;
... ...
<template>
<view class="content">
<view class="editcart" @click="editcart">{{editsel==true?'编辑':'完成'}}</view>
<view class="editcart" @click="editcart">{{editsel==true?'编辑':'完成'}}</view>
<!-- <view class="editcart" @click="finishedit" v-else>完成</view> -->
<view class="sureshop">
<!-- 店铺商品-->
<view v-if="data1.length!=0">
... ... @@ -52,7 +52,7 @@
<view class='cartlist'>
<view class="sureorderitem flexone" v-for="(item,index) in data2" :key="index">
<view class="cartselimg" @click="selectcart(item,index)">
<image src="../../static/cartnosel.png" mode="" v-if="item.sel==false"></image>
<image src="../../static/cartsel.png" mode="" v-else></image>
</view>
... ... @@ -61,13 +61,13 @@
</view>
<view class='shuright'>
<view class="suregoodnamek">
{{item.flour_goods.name}}
{{item.flour_goods.name}}
</view>
<!-- 商品属性 -->
<view v-if="item.flour_goods.spec.length!=0">
<view class="spec" v-for="(item,index) in item.flour_goods.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
</view>
<view class="surebot flextwo">
<view class="saleprice">¥{{item.flour_goods.price}}</view>
<view class="weightnumk flexone">
... ... @@ -112,7 +112,7 @@
<view v-if="item.score_goods.spec.length!=0">
<view class="spec" v-for="(item,index) in item.score_goods.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view>
</view>
<view class="surebot flextwo">
<view class="saleprice">¥{{item.score_goods.price}}</view>
<view class="weightnumk flexone">
... ... @@ -140,7 +140,7 @@
</view>
<view class='jiesuan' @click="jiesuan">去结算({{arr.length}}件)</view>
</view>
<view class="cartbottom flextwo" v-else>
<view class="flexone">
<view class="cartselimg" @click="selshan">
... ... @@ -149,7 +149,7 @@
</view>
<view class="quanname">全选</view>
</view>
<view class="delgoodname" @click="delgood">删除商品</view>
</view>
</view>
... ... @@ -165,11 +165,11 @@
data3: [], //积分商品
selall: false,
total: 0,
arr:[],
data:[],
seldelall:false,
cartid:[],
editsel:true
arr: [],
data: [],
seldelall: false,
cartid: [],
editsel: true
}
},
onLoad() {
... ... @@ -178,84 +178,126 @@
console.log(uni.getStorageSync("token"))
},
methods: {
editcart(){
this.editsel=!this.editsel;
editcart() {
this.editsel = !this.editsel;
this.cartid = [];
this.arr = [],
this.data = [],
this.seldelall = false;
this.selall = false;
this.getcartlist()
},
// 删除商品
selshan(){
let that=this;
this.seldelall=!this.seldelall;
if(this.seldelall==true){
this.data3.forEach(function(value, index, array) {
selshan() {
let that = this;
let newcartid = [];
this.seldelall = !this.seldelall;
if (this.seldelall == true) {
this.data3.forEach(function(value, index, array) {
value.sel = true;
that.$forceUpdate()
newcartid.push(value.id)
newcartid.push(value.id);
that.cartid = newcartid
})
this.data2.forEach(function(value, index, array){
this.data2.forEach(function(value, index, array) {
value.sel = true;
that.$forceUpdate()
newcartid.push(value.id)
newcartid.push(value.id);
that.cartid = newcartid
})
this.data1[0].list.forEach(function(value, index, array){
this.data1[0].list.forEach(function(value, index, array) {
value.sel = true;
that.$forceUpdate()
newcartid.push(value.id)
newcartid.push(value.id);
that.cartid = newcartid
})
} else {
this.data3.forEach(function(value, index, array) {
value.sel = false;
})
this.data2.forEach(function(value, index, array){
value.sel =false
this.data2.forEach(function(value, index, array) {
value.sel = false
})
this.data1[0].list.forEach(function(value, index, array){
value.sel =false
this.data1[0].list.forEach(function(value, index, array) {
value.sel = false
})
newcartid=[];
newcartid = [];
}
that.cartid=newcartid;
that.cartid = newcartid;
console.log(that.cartid)
},
delgood(){
let that = this;
console.log(that.cartid)
delgood() {
let that = this;
console.log(that.cartid)
uni.showModal({
title: '提示',
content: '是否删除该商品',
success: function(res) {
if (res.confirm) {
var url = 'car/batch_delete';
var params = {
car_ids: that.cartid.join(",")
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title: '删除成功',
icon: "none"
})
that.getcartlist()
}).catch((err) => {
console.log(err)
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
delgood() {
let that = this;
console.log(that.cartid)
uni.showModal({
title: '提示',
content: '是否删除该商品',
success: function (res) {
if (res.confirm) {
var url = 'car/batch_delete';
var params = {
car_ids:that.cartid.join(",")
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title:'删除成功',
icon:"none"
title: '提示',
content: '是否删除该商品',
success: function(res) {
if (res.confirm) {
var url = 'car/batch_delete';
var params = {
car_ids: that.cartid.join(",")
}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title: '删除成功',
icon: "none"
})
that.getcartlist()
}).catch((err) => {
console.log(err)
})
that.getcartlist()
}).catch((err) => {
console.log(err)
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
// 积分商品
jifenshop() {
... ... @@ -274,211 +316,249 @@
getcartlist() {
let that = this;
var url = 'car/get_all';
var params = {
}
var params = {}
console.log(params)
app.post(url, params).then((res) => {
console.log(res);
that.data1 = res.data.data.data3;
that.data2 = res.data.data.data1;
that.data3 = res.data.data.data2;
let newlenarr = []
// 店铺商品
that.data1[0].list.forEach(function(value,index,array){
value.sel = false;
})
that.data1=that.data1;
if (that.data1.length != 0) {
that.data1[0].list.forEach(function(value, index, array) {
value.sel = false;
newlenarr.push(value)
})
that.data1 = that.data1;
}
// 面坊商品
that.data2.forEach(function(value, index, array) {
value.sel = false;
})
that.data2 = that.data2;
if (that.data2.length != 0) {
that.data2.forEach(function(value, index, array) {
value.sel = false;
newlenarr.push(value)
})
that.data2 = that.data2;
}
console.log('738932893', that.data2)
// 积分商品
that.data3.forEach(function(value, index, array) {
value.sel = false
})
that.data3 = that.data3;
if (that.data3.length != 0) {
that.data3.forEach(function(value, index, array) {
value.sel = false;
newlenarr.push(value)
})
that.data3 = that.data3;
}
this.lenarr = newlenarr
}).catch((err) => {
console.log(err)
})
},
//选择购物车
selectcart(item, index) {
console.log(item, index)
let that = this;
let newcartid=[]
let obj={}
if (item.type == 2) {
that.data3.forEach(function(value, index, array) {
if (value.id == item.id) {
value.sel = !value.sel;
that.$forceUpdate()
if (value.sel == true) {
that.arr.push(1)
that.total = that.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number;
newcartid.push(value.id);
console.log(3838944900)
console.log(newcartid);
that.cartid=newcartid
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
obj.number=item.number;
console.log('34898348',obj);
that.data.push(obj)
} else {
that.arr.splice(0,1)
that.total = that.total * 100 / 100 - value.score_goods.price * 100 / 100 * value.number;
that.data.forEach(function(value,index,array){
console.log(value.goods_id);
console.log(item.goods_id)
if(item.goods_id==value.goods_id){
console.log(34349349043)
that.data.splice(index,1)
//选择购物车
selectcart(item, index) {
console.log(item, index)
let that = this;
let newcartid=[]
let obj={}
if (item.type == 2) {
that.data3.forEach(function(value, index, array) {
if (value.id == item.id) {
value.sel = !value.sel;
that.$forceUpdate()
if (value.sel == true) {
that.arr.push(1)
that.total = that.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number;
newcartid.push(value.id);
console.log(3838944900)
console.log(newcartid);
that.cartid=newcartid
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
obj.number=item.number;
console.log('34898348',obj);
that.data.push(obj);
if(that.cartid.length==that.lenarr.length){
that.selall=true;
that.seldelall=true
}
} else {
that.arr.splice(0,1)
that.total = that.total * 100 / 100 - value.score_goods.price * 100 / 100 * value.number;
that.data.forEach(function(value,index,array){
console.log(value.goods_id);
console.log(item.goods_id)
if(item.goods_id==value.goods_id){
console.log(34349349043)
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
}
})
that.selall=false;
that.seldelall=false
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
}
})
}
that.data=that.data;
}
})
that.data3 = that.data3
} else if (item.type == 1) {
that.data2.forEach(function(value, index, array) {
if (value.id == item.id) {
value.sel = !value.sel;
that.data=that.data;
}
})
that.data3 = that.data3
} else if (item.type == 1) {
that.$forceUpdate()
if (value.sel == true) {
that.arr.push(1);
newcartid.push(value.id);
that.total = that.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
obj.number=item.number;
that.data.push(obj)
} else {
that.total = that.total * 100 / 100 - value.flour_goods.price * 100 / 100 * value.number;
that.arr.splice(0,1);
that.data.forEach(function(value,index,array){
if(item.goods_id==value.goods_id){
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
that.data2.forEach(function(value, index, array) {
if (value.id == item.id) {
value.sel = !value.sel;
that.$forceUpdate()
if (value.sel == true) {
that.arr.push(1);
newcartid.push(value.id);
that.cartid=newcartid
that.total = that.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
obj.number=item.number;
that.data.push(obj);
if(that.cartid.length==that.lenarr.length){
that.selall=true;
that.seldelall=true
}
} else {
that.total = that.total * 100 / 100 - value.flour_goods.price * 100 / 100 * value.number;
that.arr.splice(0,1);
that.data.forEach(function(value,index,array){
if(item.goods_id==value.goods_id){
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
}
})
that.selall=false;
that.seldelall=false
}
})
}
}
})
that.data2 = that.data2;
that.data=that.data;
console.log(that.data)
}else if(item.type==3){
console.log('999888',that.data1[0].list)
that.data1[0].list.forEach(function(value, index, array) {
if (value.id == item.id) {
console.log('383483',value.id)
}
})
that.data2 = that.data2;
that.data=that.data;
console.log(that.data)
}else if(item.type==3){
value.sel = !value.sel;
console.log('999888',that.data1[0].list)
that.data1[0].list.forEach(function(value, index, array) {
if (value.id == item.id) {
console.log('383483',value.id)
value.sel = !value.sel;
that.$forceUpdate()
console.log(value.sel)
if (value.sel == true) {
console.log(value.sel)
that.arr.push(1);
newcartid.push(item.id);
that.cartid=newcartid;
that.total = that.total * 100 / 100 + value.store_goods.price * 100 / 100 * value.number;
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
obj.number=item.number;
that.data.push(obj);
if(that.cartid.length==that.lenarr.length){
that.selall=true;
that.seldelall=true
}
that.$forceUpdate()
console.log(value.sel)
if (value.sel == true) {
console.log(value.sel)
that.arr.push(1);
newcartid.push(item.id);
that.total = that.total * 100 / 100 + value.store_goods.price * 100 / 100 * value.number;
obj.type=item.type;
obj.goods_id=item.goods_id;
obj.spec_sku_id=item.spec_sku_id;
obj.number=item.number;
that.data.push(obj)
} else {
that.total = that.total * 100 / 100 - value.store_goods.price * 100 / 100 * value.number;
that.arr.splice(0,1);
that.data.forEach(function(value,index,array){
if(item.goods_id==value.goods_id){
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
} else {
that.total = that.total * 100 / 100 - value.store_goods.price * 100 / 100 * value.number;
that.arr.splice(0,1);
that.data.forEach(function(value,index,array){
if(item.goods_id==value.goods_id){
that.data.splice(index,1)
}
})
newcartid.forEach(function(value,index,array){
if(value.id==item.id){
newcartid.splice(index,1)
}
})
that.selall=false;
that.seldelall=false
}
})
}
})
that.data1 = that.data1;
that.data=that.data;
that.cartid=newcartid;
if(that.cartid.length==that.lenarr.length){
that.selall=true;
that.seldelall=true
}
console.log(that.data);
console.log(that.cartid)
}
})
that.data1 = that.data1;
that.data=that.data;
that.cartid=newcartid;
console.log(that.data);
console.log(that.cartid)
}
},
},
// 选择全部购物车
selectall() {
let that=this;
let that = this;
this.selall = !this.selall;
let newarr=[];
let newtotal=0;
let newcartid=[]
let newarr = [];
let newtotal = 0;
let newcartid = []
if (this.selall == true) {
this.data3.forEach(function(value, index, array) {
value.sel = true;
newarr.push(1);
newtotal=newtotal+value.score_goods.price * 100 / 100 * value.number;
newtotal = newtotal + value.score_goods.price * 100 / 100 * value.number;
newcartid.push(value.id)
// this.total = this.total * 100 / 100 + value.score_goods.price * 100 / 100 * value.number
})
this.data2.forEach(function(value, index, array){
this.data2.forEach(function(value, index, array) {
value.sel = true;
newtotal=newtotal+value.flour_goods.price * 100 / 100 * value.number;
newtotal = newtotal + value.flour_goods.price * 100 / 100 * value.number;
newcartid.push(value.id)
// this.total = this.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
newarr.push(1)
})
this.data1[0].list.forEach(function(value, index, array){
this.data1[0].list.forEach(function(value, index, array) {
value.sel = true;
newtotal=newtotal+value.store_goods.price * 100 / 100 * value.number;
newtotal = newtotal + value.store_goods.price * 100 / 100 * value.number;
newcartid.push(value.id)
// this.total = this.total * 100 / 100 + value.flour_goods.price * 100 / 100 * value.number;
newarr.push(1)
})
} else {
this.data3.forEach(function(value, index, array) {
value.sel = false;
})
this.data2.forEach(function(value, index, array){
value.sel =false
this.data2.forEach(function(value, index, array) {
value.sel = false
})
this.data1[0].list.forEach(function(value, index, array){
value.sel =false
this.data1[0].list.forEach(function(value, index, array) {
value.sel = false
})
newarr=[];
newtotal=0;
newcartid=[];
newarr = [];
newtotal = 0;
newcartid = [];
}
this.data3 = this.data3;
this.total=newtotal;
this.arr=newarr;
this.cartid=newcartid;
this.total = newtotal;
this.arr = newarr;
this.cartid = newcartid;
},
//购物车增加
... ... @@ -507,9 +587,9 @@
})
that.data2 = that.data2;
}else if(item.type==3){
} else if (item.type == 3) {
that.data1[0].list.forEach(function(value, index, array) {
console.log('3787478',value)
console.log('3787478', value)
if (value.id == item.id) {
console.log(value.id);
console.log(item.id)
... ... @@ -572,7 +652,7 @@
if (item.sel == true) {
that.total = that.total * 100 / 100 - value.flour_goods.price * 100 / 100 * 1;
}
}else{
} else {
uni.showToast({
title: '不能再减少了~',
icon: 'none'
... ... @@ -581,7 +661,7 @@
}
})
that.data2 = that.data2;
}else if(item.type==3){
} else if (item.type == 3) {
that.data1[0].list.forEach(function(value, index, array) {
if (value.id == item.id) {
if (value.number > 1) {
... ... @@ -590,7 +670,7 @@
if (item.sel == true) {
that.total = that.total * 100 / 100 - value.store_goods.price * 100 / 100 * 1;
}
}else{
} else {
uni.showToast({
title: '不能再减少了~',
icon: 'none'
... ... @@ -618,34 +698,36 @@
})
},
// 去结算
jiesuan(){
jiesuan() {
let that = this;
if(that.data.length==0){
if (that.data.length == 0) {
uni.showToast({
title:'请选择商品',
icon:'none'
title: '请选择商品',
icon: 'none'
})
return false
}
uni.setStorageSync("addressitem","");
uni.setStorageSync("couponitem","")
var url = 'order/confirm_order';
console.log('获取的参数',that.data)
console.log('获取的参数', that.data)
var params = {
data: JSON.stringify(that.data),
}
console.log(params)
app.post(url, params,"post").then((res) => {
app.post(url, params, "post").then((res) => {
console.log(res);
console.log(res.data.data);
let seldata=JSON.stringify(that.data)
uni.setStorageSync("goodinfo",res.data.data);
let seldata = JSON.stringify(that.data)
uni.setStorageSync("goodinfo", res.data.data);
uni.navigateTo({
url:'/pages/nearshop/sureorder?seldata='+seldata
url: '/pages/nearshop/sureorder?seldata=' + seldata
})
}).catch((err) => {
console.log(err)
})
},
... ... @@ -660,25 +742,28 @@
page {
background: #F8F6F9;
}
.editcart{
color:#3D454C;
.editcart {
color: #3D454C;
font-size: 28rpx;
width:750rpx;
width: 750rpx;
background: #fff;
text-align: right;
padding: 0 32rpx;
box-sizing: border-box;
}
.quanname{
color:#3D454C;
.quanname {
color: #3D454C;
font-size: 28rpx;
}
.delgoodname{
width:280rpx;
height:88rpx;
background:rgba(194,148,69,1);
border-radius:16rpx;
color:#fff;
.delgoodname {
width: 280rpx;
height: 88rpx;
background: rgba(194, 148, 69, 1);
border-radius: 16rpx;
color: #fff;
font-size: 28rpx;
text-align: center;
line-height: 88rpx;
... ... @@ -687,10 +772,12 @@
.cartlist {
/* padding-bottom: 120rpx; */
}
.spec{
color:#3D454C;
.spec {
color: #3D454C;
font-size: 28rpx;
}
.cartselimg {
width: 30rpx;
height: 30rpx;
... ...
... ... @@ -20,7 +20,7 @@
</view>
<view class="sureshop sureshopk">
<!-- 店铺商品 -->
<view class="bigbox" v-if="goodinfo.data3[0].goods!=undefined">
<view class="bigbox" v-if="goodinfo.data3.length!=0">
<view class="sureorderbox flexone">
<view class="sureimg">
<image src="../../static/nearshop.png" mode=""></image>
... ... @@ -252,65 +252,74 @@
</view>
</view>
<view class="huiyuanbot boxsizing">
<view class="behuiyuanbtn">确认支付</view>
<view class="huiyuanbot boxsizing flextwo">
<view class="surezhifu">总计:{{goodinfo.total}}</view>
<view class="behuiyuanbtn behuiyuanbtnk" @click="surepay">确认支付</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="buymoney">{{goodinfo.total}}</view>
<view class='buybox'>
<view class="buyitem boxsizing flextwo">
<view class="buyitem boxsizing flextwo" @click.stop="paytype" :data-id="1">
<view class="buyitemleft flexone">
<view class="buyleftimg">
<image src="../../static/zhifubao.png" mode=""></image>
<view class="buyleftimg" >
<image src="../../static/weixin.png" mode=""></image>
</view>
<view class="buyitemname">支付宝</view>
<view class="buyitemname">微信支付</view>
</view>
<view class="selimg">
<image src="../../static/selactive.png" mode=""></image>
<view class="selimg" >
<image src="../../static/selactive.png" mode="" v-if="pay_type==1"></image>
<image src="../../static/active.png" mode="" v-else></image>
</view>
</view>
<view class="buyitem boxsizing flextwo">
<view class="buyitemleft flexone">
<view class="buyleftimg">
<image src="../../static/weixin.png" mode=""></image>
<image src="../../static/zhifubao.png" mode=""></image>
</view>
<view class="buyitemname">微信支付</view>
<view class="buyitemname">支付宝</view>
</view>
<view class="selimg">
<image src="../../static/selactive.png" mode=""></image>
<view class="selimg" @click.stop="paytype" :data-id="2">
<image src="../../static/selactive.png" mode="" v-if="pay_type==2"></image>
<image src="../../static/active.png" mode="" v-else></image>
</view>
</view>
<view class="buyitem boxsizing flextwo">
<view class="buyitem boxsizing flextwo" @click.stop="paytype" :data-id="3">
<view class="buyitemleft flexone">
<view class="buyleftimg">
<image src="../../static/yue.png" mode=""></image>
<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 class="selimg" >
<image src="../../static/selactive.png" mode="" v-if="pay_type==3"></image>
<image src="../../static/active.png" mode="" v-else></image>
</view>
</view>
<view class="buyitem boxsizing flextwo">
<view class="buyitem boxsizing flextwo" @click.stop="paytype" :data-id="4">
<view class="buyitemleft flexone">
<view class="buyleftimg">
<image src="../../static/baitiao.png" mode=""></image>
<image src="../../static/baitiao.png" mode="" ></image>
</view>
<view class="buyitemname">白条支付</view>
<view class="buyitemname">赊吧支付</view>
</view>
<view class="selimg">
<image src="../../static/selactive.png" mode=""></image>
<view class="selimg" >
<image src="../../static/selactive.png" mode="" v-if="pay_type==4"></image>
<image src="../../static/active.png" mode="" v-else></image>
</view>
</view>
</view>
<view class="flextwo">
<view class="totalmoney">{{goodinfo.total}}</view>
<view class="buybtn btnk">确认支付(¥2560.00)</view>
</view>
<view class="buybtn btnk" @click="paynow">确认支付(¥{{goodinfo.total}})</view>
</view>
</view>
... ... @@ -381,6 +390,8 @@
name:'上门自提'
}],
goodpeiname:'请选择配送方式',
pay_type:-1,
user_ticket_id:''
... ... @@ -398,6 +409,11 @@
},
methods: {
// 选择支付方式
paytype(e){
this.pay_type=e.currentTarget.dataset.id
},
// 面访商品配送方式
bindmianChange(e){
this.mianpeiname=this.servicearr[e.target.value].name;
... ... @@ -430,17 +446,21 @@
},
// 面坊商品备注
entermianfangrmark(){
this.remark1=e.detail.value
entermianfangrmark(e){
console.log(e)
this.remark1=e.detail.value;
console.log(this.remark1)
},
// 店铺商品备注
entershopmessage(e){
this.seldata.forEach(function(value,index,array){
if(value.type==3){
value.remark=e.detail.value
}
})
this.seldata=this.this.seldata;
console.log(this.seldata)
},
// 积分商品备注
enterjifenremark(){
... ... @@ -487,17 +507,63 @@
console.log(err)
})
},
//确认支付
surepay(){
this.buyshow=true
},
hidebuy(){
this.buyshow=false
},
// 确认支付
paynow(){
let that = this;
// if(that.data.length==0){
// uni.showToast({
// title:'请选择商品',
// icon:'none'
// })
// return false
// }
var url = 'order/create_order';
var params = {
data: JSON.stringify(that.seldata),
user_ticket_id:that.user_ticket_id,
postage_type1:that.postage_type1,
postage_type2:that.postage_type2,
score:that.jifen,
remark1:that.remark1,
remark2:that.remark2,
pay_type:that.pay_type
}
console.log(that.seldata)
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() {
console.log(uni.getStorageSync("addressitem"))
if(uni.getStorageSync("addressitem")!=''){
this.addressitem = uni.getStorageSync("addressitem");
}
if(uni.getStorageSync("addressitem")!=''){
if(uni.getStorageSync("couponitem")!=''){
let couponitem = uni.getStorageSync("couponitem");
this.couponname=couponitem.name
console.log(couponitem)
this.couponname=couponitem.name;
console.log(this.couponname)
this.user_ticket_id=couponitem.id
}
console.log(this.addressitem)
... ... @@ -519,6 +585,8 @@
}
.btnk{
width:200prx;
}
.buywrap{
z-index:999
}
</style>
... ...