diff --git a/ant-design-vue-jeecg/src/views/shopping/components/Order/placeOrder.vue b/ant-design-vue-jeecg/src/views/shopping/components/Order/placeOrder.vue index 05992e02..1598378b 100644 --- a/ant-design-vue-jeecg/src/views/shopping/components/Order/placeOrder.vue +++ b/ant-design-vue-jeecg/src/views/shopping/components/Order/placeOrder.vue @@ -13,70 +13,149 @@ 1 配送地址
- - - - - 送货上门 - - - 门店自提 - - - - --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -142,7 +221,7 @@ ¥35,500

-
立即购买
+
立即购买

说明

在线支付订单提交之后15分钟内未付款,订单将被系统自动取消,请您尽快完成支付以确保商品能及时送达,避免取消订单带来不必要的麻烦。

@@ -160,46 +239,62 @@ - - - - - 先生 - - - 女士 - - - - - + - - - - - - - - - - - - 保存该地址至地址簿 - - - + + + + 先生 + + + 女士 + + + + + + + + + + + + + + + + + + + + 保存该地址至地址簿 + + + + + 设置为默认地址 + + + +
@@ -207,62 +302,89 @@ export default { data() { return { - ModalText: 'Content of the modal', visible: false, - confirmLoading: false, formLayout: 'horizontal', delivery:'17719145652',//配送方式 visit:'0',//是否送货上门 phone:'17719145652',//电话 - userSex1:'',//性别1 - userSex2:'',//性别2 - userName:'',//姓名 - phone1:'',//电话1 - phone2:'',//电话2 addr:[ - // { - // id:1, - // name:'吴一', - // phone:'17777777777', - // province:'河南省', - // city:'驻马店市', - // area:'驿城区', - // detailed:'黄淮学院北区', - // flag:true,//是否是默认地址 - // },//地址一 - // { - // id:2, - // name:'吴二', - // phone:'17777777777', - // province:'河南省', - // city:'驻马店市', - // area:'驿城区', - // detailed:'黄淮学院北区', - // flag:false,//是否是默认地址 - // },//地址二 - // { - // id:3, - // name:'吴三', - // phone:'17777777777', - // province:'河南省', - // city:'驻马店市', - // area:'驿城区', - // detailed:'黄淮学院北区', - // flag:false,//是否是默认地址 - // },//地址三 + { + id:1, + name:'吴一', + sex:'1', + phone:'17777777777', + addr:'210521', + detailed:'黄淮学院北区', + flag:true,//是否是默认地址 + },//地址一 + { + id:2, + name:'吴二', + sex:'2', + phone:'17777777777', + addr:'210521', + detailed:'黄淮学院北区', + flag:false,//是否是默认地址 + },//地址二 + { + id:3, + name:'吴三', + sex:'1', + phone:'17777777777', + addr:'210521', + detailed:'黄淮学院北区', + flag:false,//是否是默认地址 + },//地址三 ],//地址列表 - addr1:'',//地址选择器1 - addr2:'',//地址选择器2 - detailed1:'',//详细地址1 - detailed2:'',//详细地址2 - save1:false,//是否保存到地址簿1 - save2:false,//是否保存到地址簿2 value: 1, paymentMode:'',//支付方式 bill:'',//是否需要电子发票 - chinaArea:[], num:1,//已选几件商品 - }; + form2:{ + userSex2:'',//性别2(弹窗) + userName2:'',//姓名2(弹窗) + phone2:'',//电话2(弹窗) + addr2:'',//地址选择器2(弹窗) + detailed2:'',//详细地址2(弹窗) + save2:true,//是否保存到地址簿2(弹窗) + }, + //弹窗数据 + form: { + id:'', + sex: undefined, + name: '', + addr: '', + detailed: '', + phone: '', + save: true, + flag:false//是否默认地址 + }, + //外部添加地址数据 + form1: { + visit:'', + sex: undefined, + name: '', + addr: '', + detailed: '', + phone: '', + save: true, + flag:false + }, + rules: { + name: [ + { required: true, message: '请输入姓名', trigger: 'blur' }, + ], + visit: [ + { required: true, message: '请选择您的配送方式', trigger: 'change' }, + ], + addr: [{ required: true, message: '请选择地址', trigger: 'blur' }], + detailed: [{ required: true, message: '请输入详细地址', trigger: 'blur' }], + phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' }, + ], + }, + addrList:[ + ] + } }, computed: { formItemLayout() { @@ -303,7 +425,7 @@ }, onChange1(e) { console.log(`checked = ${e.target.checked}`); - this.save1 = !this.save1 + this.form1.save = !this.form1.save }, onChange2(e) { console.log('radio checked', e.target.value); @@ -314,28 +436,90 @@ this.bill = e.target.checked }, onChange4(e) { - console.log('radio checked', e.target.value); - this.save2 = !this.save2 + console.log(`checked = ${e.target.checked}`); + this.form.save = !this.form.save }, + onChange5(e) { + console.log(`checked = ${e.target.checked}`); + + }, + // 新增 showModal() { this.visible = true; }, + // 编辑 + handleEdit(item){ + this.visible = true; + console.log(item) + // this.form.id = '' + this.form.sex = item.sex + this.form.name = item.name + this.form.addr = item.addr + this.form.phone = item.phone + this.form.detailed = item.detailed + this.form.flag = item.flag + }, handleOk(e) { - this.ModalText = 'The modal will be closed after two seconds'; - this.confirmLoading = true; - setTimeout(() => { - this.visible = false; - this.confirmLoading = false; - }, 2000); + //判断是添加地址还是修改地址 + let that = this + let newFlag = this.addr.some(function(item){ + return item.id == that.form.id + }) + this.$refs.ruleForm.validate(valid => { + if (valid) { + if(newFlag){//是修改 + // this.addr. + }else{//是新增 + this.addr.push(this.form) + console.log('this.addr') + console.log(this.addr) + } + this.visible = false; + } else { + } + }); }, handleCancel(e) { - console.log('Clicked cancel button'); this.visible = false; + this.$refs.ruleForm.resetFields(); + this.form.name = '' + this.form.sex = '' + this.form.name = '' + this.form.addr = '' + this.form.phone = '' + this.form.detailed = '' + this.form.flag = false }, + toBuy(){ + this.$refs.ruleForm1.validate(valid => { + if (valid) { + this.addrList.push(this.form1) + console.log(this.addrList) + } else { + } + }); + } }, };