Ver código fonte

添加默认地址功能

sunlupeng 1 ano atrás
pai
commit
b6ca09bd67
2 arquivos alterados com 23 adições e 19 exclusões
  1. 4 4
      src/views/HomeView/PointsMall.vue
  2. 19 15
      src/views/HomeView/RedeemView.vue

+ 4 - 4
src/views/HomeView/PointsMall.vue

@@ -475,10 +475,10 @@ button {
 }
 
 .prize-card .img-container .prize-img {
-    width: 100%;
-    height: 100%;
-    /* max-height: 159px;
-    max-width: 223px; */
+    /* width: 100%;
+    height: 100%; */
+    max-height: 120px;
+    max-width: 120px;
 }
 
 .prize-card .content {

+ 19 - 15
src/views/HomeView/RedeemView.vue

@@ -38,7 +38,7 @@
                                 <span @click="handleClickAddress" role="button" class="btn">修改</span>
                             </div>
                             <p class="phone">{{ phone }}</p>
-                            <p class="address">{{ address }}{{ email }}</p>
+                            <p class="address">{{ address }}</p>
                         </div>
                     </div>
                     <div v-else @click="handleClickAddress">
@@ -165,13 +165,10 @@
                     <el-input size="medium" v-model="dataForm.phone" placeholder="请输入11位手机号码"></el-input>
                 </el-form-item>
 
-                <el-form-item v-if="data.productAttribute == 1 && data.deliveryType == 1" label="联系地址"
+                <el-form-item label="联系地址"
                     :label-width="formLabelWidth" prop="address">
                     <el-input size="medium" v-model="dataForm.address" placeholder="请输入详细联系地址"></el-input>
                 </el-form-item>
-                <el-form-item v-else label="联系邮箱" :label-width="formLabelWidth" prop="email">
-                    <el-input size="medium" v-model="dataForm.email" placeholder="请输入联系邮箱"></el-input>
-                </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer" style="text-align: center;">
                 <el-button class="addButton-address" type="primary" @click="submitForm('dataForm')">提交</el-button>
@@ -253,10 +250,10 @@ export default {
             }
         };
         return {
+            contactInfo:{},
             activeName: this.$route.query.activeName,
             name: '',
             phone: '',
-            email: '',
             address: '',
             disabled: true,
             skuCount: 1,
@@ -268,7 +265,6 @@ export default {
             dataForm: {
                 name: '',
                 phone: '',
-                email: '',
                 address: '',
             },
             rules: {
@@ -279,9 +275,6 @@ export default {
                 phone: [
                     { required: true, validator: validPhone, trigger: 'blur' }
                 ],
-                email: [
-                    { required: true, message: '请输入联系邮箱', trigger: 'blur' },
-                ],
                 address: [
                     { required: true, message: '请输入联系地址', trigger: 'blur' },
                     { min: 1, max: 120, message: '长度在 1 到 120 个字符', trigger: 'blur' }
@@ -314,6 +307,15 @@ export default {
             if (activeName == 'goodsNotice') {
                 integralInfo({ skuId: skuId }).then(response => {
                     this.data = response.data.data;
+                    this.contactInfo = response.data.data.contactInfo;
+                    if(this.contactInfo){
+                        this.name = this.contactInfo.contact;
+                        this.phone = this.contactInfo.contactPhone;
+                        this.address = this.contactInfo.contactAddr;
+                        this.addressDetail = true;
+                        this.disabled = false;
+                    }
+                    
                     this.total = response.data.data.price;
                     if (this.data.deliveryType != 1) {
                         this.disabled = false;
@@ -334,6 +336,10 @@ export default {
         },
         handleClickAddress() {
             this.dialogFormVisible = true;
+            this.dataForm.name = this.name;
+            this.dataForm.phone = this.phone;
+            this.dataForm.address = this.address;
+
         },
         submitForm(formName) {
             this.$refs[formName].validate((valid) => {
@@ -341,7 +347,6 @@ export default {
                     // alert('submit!');
                     this.name = this.dataForm.name,
                         this.phone = this.dataForm.phone,
-                        this.email = this.dataForm.email,
                         this.address = this.dataForm.address,
                         this.addressDetail = true;
                     this.dialogFormVisible = false;
@@ -360,10 +365,9 @@ export default {
                 total: this.total,
                 price: this.data.price,
                 skuType: this.data.skuType,
-                contact: this.dataForm.name,
-                contactPhone: this.dataForm.phone,
-                contactAddr: this.dataForm.address,
-                contactEmail: this.dataForm.email,
+                contact: this.name,
+                contactPhone: this.phone,
+                contactAddr: this.address,
                 welfareId: this.data.welfareId,
             }
             if (this.activeName == 'goodsNotice') {