From 419469f8ac6336e6f7a8b23eba37f7611469aa63 Mon Sep 17 00:00:00 2001 From: "tianyi@bogon" Date: Sun, 12 Nov 2023 15:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=B8=B8=E5=AE=A2=E6=88=B7=E4=B8=8B?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/billing/addUser.vue | 3 +- pages/index/downStearmList.vue | 267 ++++++++++++++++++++++----------- 2 files changed, 179 insertions(+), 91 deletions(-) diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue index 5a411d8..75a99cc 100644 --- a/pages/billing/addUser.vue +++ b/pages/billing/addUser.vue @@ -5,8 +5,7 @@ - + diff --git a/pages/index/downStearmList.vue b/pages/index/downStearmList.vue index 1708a66..29372f0 100644 --- a/pages/index/downStearmList.vue +++ b/pages/index/downStearmList.vue @@ -14,22 +14,22 @@ {{item.productName}} {{item.productSn}} - + {{item.price}} 零售价 - + @@ -45,7 +45,7 @@ class="uni-tab__dot">{{carList.length}} - 开单 + 开单 @@ -66,10 +66,6 @@ - - 采购价 - -
  • @@ -104,9 +100,29 @@ - - + + + + + + + + + + + + + + + + + + + + + + 开单 + @@ -144,7 +160,7 @@ - 2 款 9 件 + {{carType}} 款 {{carNum}} 件 选好了 @@ -177,7 +193,59 @@ keyList: [], specsList:[], evalue:[], - attributeList:[], + attributeList:[], + zNum:0, + addressObj:{}, + show:false, + zPrice:0, + carType:0, + carNum:0, + formData: { + consigneeMobile: '', + consigneeName: '', + address1: '', + address: '', + province: '', + city: '', + area: '', + id: '' + }, + rules: { + consigneeName: { + rules: [{ + required: true, + errorMessage: '请输入姓名', + }, + { + minLength: 2, + maxLength: 5, + errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符', + } + ] + }, + consigneeMobile: { + rules: [{ + required: true, + errorMessage: '请输入手机号', + }, { + minLength: 11, + maxLength: 11, + errorMessage: '手机号为11个字符', + }] + }, + address1: { + rules: [{ + required: true, + errorMessage: '请选择地址', + }] + }, + address: { + rules: [{ + required: true, + errorMessage: '请输入详细地址', + }] + }, + }, } }, created() { @@ -196,13 +264,12 @@ this.goodsDetail.attributeList[index].value[index1].isChecked = true; var name = '', evalue = [], - obj = {}, - specsList = [] + obj = {} for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) { if (Ien[m].isChecked == true) { evalue.push(Ien[m].value) - name += Ien[m].value + name += Ien[m].value + '/' } } } @@ -223,6 +290,13 @@ name:name, price:this.purchasePrice } + + for(let i=0;i { - this.attributeList[index] = { - attributeList: JSON.stringify(item), - productCount: this.carList[index].num - } - }) - for (var i=0;i { - if (res.code == 200) { - - - }else{ - this.tui.toast(res.message) + let that = this; + this.$refs.form.validate().then(res => { + let obj = { + sale: { + area: this.addressObj.area, + city: this.addressObj.city, + province: this.addressObj.province, + receiveAddress: that.formData.address, + totalAmount: that.zPrice, //应付金额 + username:that.formData.consigneeName, + mobile:that.formData.consigneeMobile + }, + saleDetailList: this.carList } + this.tui.request("/app/sale/savePresale", "post", obj, false, false).then((res) => { + if (res.code == 200) { + + + }else{ + this.tui.toast(res.message) + } + }) + }).catch(err => { + console.log('表单错误信息:', err); }) + }, + openPicker() { + console.log('执行打开地址选择器') + this.show = true + }, + + onhideShow() { + this.show = false + console.log('执行了关闭地址选择器') + }, + //选中省市区 + onsetCity(e) { + let data = e.detail.target.dataset; + let address = data.province + data.city + data.area; + this.show = false + this.formData.address1 = address; + this.addressObj = { + province: data.province, + city: data.city, + area: data.area, + } + + console.log(this.formData, this.addressObj); }, //点击分类获取商品列表 getShareList(id) { @@ -517,7 +599,14 @@ .title-box { background: #fff; } - + .popup-pay-content{ + align-items: center; + justify-content: center; + padding: 15px; + width: 500rpx; + height: auto; + background-color: #fff; + } .bottom-box { width: 100%; position: fixed; @@ -651,7 +740,7 @@ .price-box { flex: 1; - text-align: center; + text-align: left; display: flex; flex-direction: column; margin-right: 20rpx;