|
|
@ -84,7 +84,7 @@ |
|
|
<view class="checkList-box"> |
|
|
<view class="checkList-box"> |
|
|
{{item.name}} |
|
|
{{item.name}} |
|
|
</view> |
|
|
</view> |
|
|
<uni-number-box v-model="item.productCount" @change="temporaryChange" /> |
|
|
<uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" /> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-bottom" v-for="item in temporaryList"> |
|
|
<view class="popup-bottom" v-for="item in temporaryList"> |
|
|
@ -104,8 +104,10 @@ |
|
|
<!-- 省市区选择 show:是否显示 @sureSelectArea:确认事件 @hideShow:隐藏事件--> |
|
|
<!-- 省市区选择 show:是否显示 @sureSelectArea:确认事件 @hideShow:隐藏事件--> |
|
|
<cc-selectDity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></cc-selectDity> |
|
|
<cc-selectDity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></cc-selectDity> |
|
|
<view class="popup-pay-content"> |
|
|
<view class="popup-pay-content"> |
|
|
|
|
|
<view class="popup-pay-title"> |
|
|
|
|
|
填写信息 |
|
|
|
|
|
</view> |
|
|
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px"> |
|
|
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px"> |
|
|
|
|
|
|
|
|
<uni-forms-item label="姓名" name="consigneeName"> |
|
|
<uni-forms-item label="姓名" name="consigneeName"> |
|
|
<uni-easyinput type="text" v-model="formData.consigneeName" placeholder="请输入人员姓名" /> |
|
|
<uni-easyinput type="text" v-model="formData.consigneeName" placeholder="请输入人员姓名" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
@ -121,7 +123,7 @@ |
|
|
<uni-easyinput type="textarea" v-model="formData.address" /> |
|
|
<uni-easyinput type="textarea" v-model="formData.address" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
</uni-forms> |
|
|
</uni-forms> |
|
|
<view @tap="backPrevPage">开单</view> |
|
|
<view class="address-btn" @tap="backPrevPage">开单</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
<!-- 购物车弹出层 --> |
|
|
<!-- 购物车弹出层 --> |
|
|
@ -153,7 +155,7 @@ |
|
|
<view class="checkList-box"> |
|
|
<view class="checkList-box"> |
|
|
{{items.name}} |
|
|
{{items.name}} |
|
|
</view> |
|
|
</view> |
|
|
<uni-number-box v-model="items.productCount" @change="change" /> |
|
|
<uni-number-box max="100000" v-model="items.productCount" @change="change" /> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -191,15 +193,15 @@ |
|
|
carList: [], |
|
|
carList: [], |
|
|
columns: [], |
|
|
columns: [], |
|
|
keyList: [], |
|
|
keyList: [], |
|
|
specsList:[], |
|
|
specsList: [], |
|
|
evalue:[], |
|
|
evalue: [], |
|
|
attributeList:[], |
|
|
attributeList: [], |
|
|
zNum:0, |
|
|
zNum: 0, |
|
|
addressObj:{}, |
|
|
addressObj: {}, |
|
|
show:false, |
|
|
show: false, |
|
|
zPrice:0, |
|
|
zPrice: 0, |
|
|
carType:0, |
|
|
carType: 0, |
|
|
carNum:0, |
|
|
carNum: 0, |
|
|
formData: { |
|
|
formData: { |
|
|
consigneeMobile: '', |
|
|
consigneeMobile: '', |
|
|
consigneeName: '', |
|
|
consigneeName: '', |
|
|
@ -215,13 +217,7 @@ |
|
|
rules: [{ |
|
|
rules: [{ |
|
|
required: true, |
|
|
required: true, |
|
|
errorMessage: '请输入姓名', |
|
|
errorMessage: '请输入姓名', |
|
|
}, |
|
|
}] |
|
|
{ |
|
|
|
|
|
minLength: 2, |
|
|
|
|
|
maxLength: 5, |
|
|
|
|
|
errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符', |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
}, |
|
|
consigneeMobile: { |
|
|
consigneeMobile: { |
|
|
rules: [{ |
|
|
rules: [{ |
|
|
@ -287,13 +283,13 @@ |
|
|
this.attributeList = { |
|
|
this.attributeList = { |
|
|
attributeList: JSON.stringify(obj), |
|
|
attributeList: JSON.stringify(obj), |
|
|
productCount: this.temporaryNum, |
|
|
productCount: this.temporaryNum, |
|
|
name:name, |
|
|
name: name, |
|
|
price:this.purchasePrice |
|
|
price: this.purchasePrice |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for(let i=0;i<this.goodsDetail.attributeList.length;i++){ |
|
|
for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { |
|
|
this.goodsDetail.attributeList[i].isChecked = false; |
|
|
this.goodsDetail.attributeList[i].isChecked = false; |
|
|
for (let m=0;m<this.goodsDetail.attributeList[i].value.length;m++) { |
|
|
for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { |
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false |
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -305,7 +301,7 @@ |
|
|
this.temporaryList[i] = this.attributeList |
|
|
this.temporaryList[i] = this.attributeList |
|
|
return |
|
|
return |
|
|
} else { |
|
|
} else { |
|
|
if (this.temporaryList.length == (i+1)) { |
|
|
if (this.temporaryList.length == (i + 1)) { |
|
|
this.temporaryList.push(this.attributeList); |
|
|
this.temporaryList.push(this.attributeList); |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
@ -316,7 +312,7 @@ |
|
|
}, |
|
|
}, |
|
|
temporaryChange(val) { |
|
|
temporaryChange(val) { |
|
|
this.zNum = 0 |
|
|
this.zNum = 0 |
|
|
for (var i=0;i<this.temporaryList.length;i++) { |
|
|
for (var i = 0; i < this.temporaryList.length; i++) { |
|
|
this.zNum += this.temporaryList[i].productCount |
|
|
this.zNum += this.temporaryList[i].productCount |
|
|
} |
|
|
} |
|
|
this.zPrice = this.zNum * this.purchasePrice |
|
|
this.zPrice = this.zNum * this.purchasePrice |
|
|
@ -336,7 +332,7 @@ |
|
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
|
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
|
|
if (type == 'carPopup') { |
|
|
if (type == 'carPopup') { |
|
|
this.$refs.carPopup.open('bottom') |
|
|
this.$refs.carPopup.open('bottom') |
|
|
for (let i=0;i<this.carList.length;i++) { |
|
|
for (let i = 0; i < this.carList.length; i++) { |
|
|
this.carNum += this.carList[i].num |
|
|
this.carNum += this.carList[i].num |
|
|
} |
|
|
} |
|
|
this.carType = this.carList.length |
|
|
this.carType = this.carList.length |
|
|
@ -400,18 +396,18 @@ |
|
|
productSn: this.goodsDetail.productSn, |
|
|
productSn: this.goodsDetail.productSn, |
|
|
productPicture: this.goodsDetail.productPicture, |
|
|
productPicture: this.goodsDetail.productPicture, |
|
|
supplierName: this.goodsDetail.supplierName, |
|
|
supplierName: this.goodsDetail.supplierName, |
|
|
stockLogList1:this.temporaryList, |
|
|
stockLogList1: this.temporaryList, |
|
|
wholesalePrice:this.goodsDetail.wholesalePrice, |
|
|
wholesalePrice: this.goodsDetail.wholesalePrice, |
|
|
lsprice:this.goodsDetail.price |
|
|
lsprice: this.goodsDetail.price |
|
|
} |
|
|
} |
|
|
this.carList.push(data) |
|
|
this.carList.push(data) |
|
|
this.temporaryList = [] |
|
|
this.temporaryList = [] |
|
|
this.purchasePrice = '' |
|
|
this.purchasePrice = '' |
|
|
this.zPrice = '' |
|
|
this.zPrice = '' |
|
|
this.zNum = '' |
|
|
this.zNum = '' |
|
|
for(let i=0;i<this.goodsDetail.attributeList.length;i++){ |
|
|
for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { |
|
|
this.goodsDetail.attributeList[i].isChecked = false; |
|
|
this.goodsDetail.attributeList[i].isChecked = false; |
|
|
for (let m=0;m<this.goodsDetail.attributeList[i].value.length;m++) { |
|
|
for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { |
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false |
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -419,35 +415,35 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
//删除整条商品 |
|
|
//删除整条商品 |
|
|
delShop(id){ |
|
|
delShop(id) { |
|
|
var that = this; |
|
|
var that = this; |
|
|
console.log(this.carList) |
|
|
console.log(this.carList) |
|
|
for (let i=0;i<this.carList.length;i++) { |
|
|
for (let i = 0; i < this.carList.length; i++) { |
|
|
if(this.carList[i].id == id){ |
|
|
if (this.carList[i].id == id) { |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: "提示", |
|
|
title: "提示", |
|
|
content: "确定删除此条商品吗?", |
|
|
content: "确定删除此条商品吗?", |
|
|
success: function(res) { |
|
|
success: function(res) { |
|
|
that.carList.splice(i,1) |
|
|
that.carList.splice(i, 1) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//删除商品下的某一个规格 |
|
|
//删除商品下的某一个规格 |
|
|
delShopSpec(name){ |
|
|
delShopSpec(name) { |
|
|
var that = this; |
|
|
var that = this; |
|
|
console.log(this.carList) |
|
|
console.log(this.carList) |
|
|
for (let i=0;i<this.carList.length;i++) { |
|
|
for (let i = 0; i < this.carList.length; i++) { |
|
|
for (let m=0;m<this.carList[i].stockLogList1.length;m++) { |
|
|
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) { |
|
|
if(this.carList[i].stockLogList1[m].name == name){ |
|
|
if (this.carList[i].stockLogList1[m].name == name) { |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: "提示", |
|
|
title: "提示", |
|
|
content: "确定删除此条商品吗?", |
|
|
content: "确定删除此条商品吗?", |
|
|
success: function(res) { |
|
|
success: function(res) { |
|
|
that.carList[i].stockLogList1.splice(m,1) |
|
|
that.carList[i].stockLogList1.splice(m, 1) |
|
|
if(that.carList[i].stockLogList1.length == 0){ |
|
|
if (that.carList[i].stockLogList1.length == 0) { |
|
|
that.carList.splice(i,1) |
|
|
that.carList.splice(i, 1) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -456,27 +452,31 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//点击底部下单按钮 |
|
|
//点击底部下单按钮 |
|
|
backPrevPage(){ |
|
|
backPrevPage() { |
|
|
let that = this; |
|
|
let that = this; |
|
|
this.$refs.form.validate().then(res => { |
|
|
this.$refs.form.validate().then(res => { |
|
|
let obj = { |
|
|
let obj = { |
|
|
mobile:that.formData.consigneeMobile, |
|
|
mobile: that.formData.consigneeMobile, |
|
|
username:that.formData.consigneeName, |
|
|
username: that.formData.consigneeName, |
|
|
sale: { |
|
|
sale: { |
|
|
area: this.addressObj.area, |
|
|
area: this.addressObj.area, |
|
|
city: this.addressObj.city, |
|
|
city: this.addressObj.city, |
|
|
province: this.addressObj.province, |
|
|
province: this.addressObj.province, |
|
|
receiveAddress: that.formData.address, |
|
|
receiveAddress: that.formData.address, |
|
|
totalAmount: that.zPrice ,//应付金额 |
|
|
totalAmount: that.zPrice, //应付金额 |
|
|
shopId:this.shopId |
|
|
shopId: this.shopId |
|
|
}, |
|
|
}, |
|
|
saleDetailList: this.carList |
|
|
saleDetailList: this.carList |
|
|
} |
|
|
} |
|
|
this.tui.request("/app/sale/savePresale", "post", obj, false, false).then((res) => { |
|
|
this.tui.request("/app/sale/savePresale", "post", obj, false, false).then((res) => { |
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
|
|
|
this.tui.toast("下单成功,待商家配货") |
|
|
|
|
|
setTimeout(() => { |
|
|
}else{ |
|
|
uni.reLaunch({ |
|
|
|
|
|
url:`/pages/login/login` |
|
|
|
|
|
}) |
|
|
|
|
|
},2000) |
|
|
|
|
|
} else { |
|
|
this.tui.toast(res.message) |
|
|
this.tui.toast(res.message) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -511,8 +511,8 @@ |
|
|
//点击分类获取商品列表 |
|
|
//点击分类获取商品列表 |
|
|
getShareList(id) { |
|
|
getShareList(id) { |
|
|
this.tui.request("/app/productShare/getShareList", "POST", { |
|
|
this.tui.request("/app/productShare/getShareList", "POST", { |
|
|
keywords:this.keywords, |
|
|
keywords: this.keywords, |
|
|
id:id, |
|
|
id: id, |
|
|
// id:'1717828137930330112', |
|
|
// id:'1717828137930330112', |
|
|
pageNum: this.pageNum, |
|
|
pageNum: this.pageNum, |
|
|
pageSize: '10' |
|
|
pageSize: '10' |
|
|
@ -550,6 +550,17 @@ |
|
|
border-radius: 15px; |
|
|
border-radius: 15px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.address-btn { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 80rpx; |
|
|
|
|
|
background: #088FEB; |
|
|
|
|
|
color: #fff; |
|
|
|
|
|
font-size: 36rpx; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
line-height: 80rpx; |
|
|
|
|
|
border-radius: 10px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.popup-content { |
|
|
.popup-content { |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
@ -597,17 +608,27 @@ |
|
|
color: #646566; |
|
|
color: #646566; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.popup-pay-title { |
|
|
|
|
|
height: 100rpx; |
|
|
|
|
|
line-height: 100rpx; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
font-weight: bold; |
|
|
|
|
|
font-size: 32rpx; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.title-box { |
|
|
.title-box { |
|
|
background: #fff; |
|
|
background: #fff; |
|
|
} |
|
|
} |
|
|
.popup-pay-content{ |
|
|
|
|
|
|
|
|
.popup-pay-content { |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
padding: 15px; |
|
|
padding: 0 15px 15px 15px; |
|
|
width: 500rpx; |
|
|
width: 500rpx; |
|
|
height: auto; |
|
|
height: auto; |
|
|
background-color: #fff; |
|
|
background-color: #fff; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.bottom-box { |
|
|
.bottom-box { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
|