Ver código fonte

维修表单

chao 4 anos atrás
pai
commit
4e95624078

+ 33 - 6
src/main/resources/static/css/user-center/repair/form.css

@@ -5,6 +5,7 @@ li{list-style:none}
  */
 @media screen and (min-width:768px){
     /*个人中心右侧*/
+    /*
     .navLayout .right{float:right;width:968px}
     .container{width: 100%;height: auto;background-color: #ffffff;box-sizing: border-box;padding:32px 225px;}
     .container .formLine{width: 100%;float: left;}
@@ -23,7 +24,21 @@ li{list-style:none}
     .container .formLine .address.mark textarea{margin-top: 0;}
     .container .formLine .btn{width: 208px;height: 50px;display: block;font-size: 14px;color: #FFF;text-align: center;line-height: 50px; margin: 0 auto;background-color: #e15616;box-shadow: 0px 3px 6px 0px rgba(249, 75, 75, 0.17);border-radius: 2px;}
     .container .formLine .btn.disabled{background-color: #999999;}
-
+    */
+    .repair{width: 100%;height: auto;background-color: #ffffff;box-sizing: border-box;padding:32px 225px;}
+    .repair .title{height:42px;line-height:42px;font-weight:bold;font-size:32px;color:#22272e;text-align:center;padding:30px}
+    .repair form{width:498px;margin:0 auto}
+    .repair .fileInfo{font-size:14px;line-height:24px;color:#f94b4b}
+    .formLine .formLine-file {width: 92px;height: 92px;position: relative;}
+    .formLine .file {width: 92px;height: 92px;opacity: 0;position: absolute;top: 0;left: 0;z-index: 999;cursor: pointer;}
+    .mIcon.add{background: url(/img/account/add.png) no-repeat;height: 92px;display: block;background-size: 92px;}
+    .form-upload-image{width: 92px;height: 92px;position: relative;float: left;margin: 0px 10px 10px 0px;cursor: pointer;border-radius: 2px;border: solid 1px #b8bfca}
+    .uploadGoodsImages{overflow: hidden}
+    .uploadGoodsImages>div{display: inline-block}
+    .upload-img{width: 100%;height: 100%;}
+    .icon.del:before {width: 20px;height: 20px;background-position: -116px -138px;position: absolute;top: -3px;right: -3px;}
+    input::placeholder,textarea::placeholder{color: #9aa5b5}
+    .formLine p{color: #627386}
 
 
 }
@@ -32,11 +47,23 @@ li{list-style:none}
 * 移动端
 */
 @media screen and (max-width:768px){
-
-
-
-
+    footer{display:none}
+    body {background: #FFF;}
+    .repair{width:93.4vw;margin: 0 auto;}
+    .repair .title{height:6vw;line-height:6vw;font-weight:bold;font-size:4.2vw;color:#22272e;text-align:center;padding:5.2vw 0}
+    .repair form{width:100%;margin:0 auto}
+    .repair .fileInfo{font-size:3vw;line-height:5.2vw;color:#f94b4b}
+    .formLine p{color: #627386}
+    input::placeholder,textarea::placeholder{color: #9aa5b5}
+    .formLine select{color: #627386;}
+    .formLine .formLine-file {width: 25vw;height: 25vw;position: relative;}
+    .formLine input.file {width: 25vw;height: 25vw;opacity: 0;position: absolute;top: 0;left: 0;z-index: 999;cursor: pointer;}
+    .mIcon.add{background: url(/img/account/add.png) no-repeat;height: 25vw;display: block;    background-size: 25vw;}
+    .form-upload-image{width: 25vw;height: 25vw;position: relative;float: left;margin: 0px 2.7vw 2.7vw 0px;cursor: pointer;border-radius: .53vw;border: solid .27vw #b8bfca}
+    .uploadGoodsImages{overflow: hidden}
+    .uploadGoodsImages>div{display: inline-block}
+    .upload-img{width: 100%;height: 100%;}
+    .mIcon.del:before {width: 5.3vw;height: 5.3vw;background-position: -90vw -7.5vw;position: absolute;top: -.8vw;right: -.8vw}
 
 
 }
-

+ 0 - 12
src/main/resources/static/js/user-center/repair/repair.js

@@ -1,18 +1,6 @@
 var repairForm = new Vue({
     el: '#repairForm',
     data: {
-        // postData: {
-        //     userId:'',
-        //     question: '',
-        //     linkman: '',
-        //     userMobile: '',
-        //     userContact:'',
-        //     userAddress:'',
-        //     name: '',
-        //     shopName: '',
-        //     image: '',
-        //
-        // },
         postData:{
             userId:'',
             provinceName:'',

+ 26 - 31
src/main/resources/templates/user-center/repair/form-user.html

@@ -25,19 +25,20 @@
             <!--左侧导航-->
             <template th:replace="user-center/components/tableft"></template>
             <div class="right">
-                <div class="container clear">
+                <div class="repair">
+                    <h1 class="title">申请维修</h1>
                     <form>
                         <div class="formLine">
                             <p><em>*</em>联系人:</p>
-                            <input type="text" v-model.trim="form.userContact" placeholder="请输入联系人姓名" :rule="rule.name" maxlength="10" @blur="blurHandle($event)" needverify>
+                            <input type="text" v-model.trim="form.userContact" placeholder="请输入联系人姓名" :rule="rule.name" maxlength="50" @blur="blurHandle($event)" needverify>
                             <i class="checked icon mIcon"></i>
-                            <span class="errTips icon mIcon" tips="请输入联系人姓名"></span>
+                            <span class="errTips icon mIcon" tips="请输入正确的联系人姓名"></span>
                         </div>
                         <div class="formLine">
-                            <p><em>*</em>联系方式:</p>
-                            <input type="text" v-model.trim="form.userMobile" placeholder="请输入联系人手机号" :rule="rule.phone" maxlength="11" @blur="blurHandle($event)" needverify>
+                            <p><em>*</em>联系电话:</p>
+                            <input type="text" v-model.trim="form.userMobile" placeholder="请输入联系电话" :rule="rule.phone" maxlength="12" @blur="blurHandle($event)" needverify>
                             <i class="checked icon mIcon"></i>
-                            <span class="errTips icon mIcon" tips="请输入正确的手机号"></span>
+                            <span class="errTips icon mIcon" tips="请输入有效的联系电话"></span>
                         </div>
                         <div class="formLine">
                             <p><em>*</em>联系地址:</p>
@@ -54,7 +55,7 @@
                                     <option value="" >请选择</option>
                                     <option v-for="(item ,index) in townArray" :key="index" :value="item.townID"  >{{item.name}}</option>
                                 </select>
-                                <textarea placeholder="建议您如实填写详细地址,例如:街道名称,门牌号码,楼层和房间号等信息"  v-model="form.userAddress"></textarea>
+                                <textarea placeholder="建议您如实填写详细地址,例如:街道名称,门牌号码,楼层和房间号等信息"  v-model.trim="form.userAddress"></textarea>
                             </div>
                             <i class="checked icon mIcon"></i>
                             <span class="errTips icon mIcon" tips="请输入正确的联系地址"></span>
@@ -63,42 +64,36 @@
                             <p><em>*</em>仪器名称:</p>
                             <input type="text" v-model.trim="form.instrumentName" placeholder="请输入仪器名称" :rule="rule.name" maxlength="30" @blur="blurHandle($event)" needverify>
                             <i class="checked icon mIcon"></i>
-                            <span class="errTips icon mIcon" tips="请输入仪器名称"></span>
+                            <span class="errTips icon mIcon" tips="请输入正确的仪器名称"></span>
                         </div>
                         <div class="formLine">
                             <p>生产厂家:</p>
-                            <input type="text" v-model.trim="form.manufacturer" placeholder="请输入生产厂家"  maxlength="30">
+                            <input type="text" v-model.trim="form.manufacturer" placeholder="请输入生产厂家" maxlength="30">
+                            <i class="checked icon mIcon"></i>
+                            <span class="errTips icon mIcon" tips="请输入正确的公司名称"></span>
                         </div>
-                        <div class="formLine file">
-                            <p>上传仪器图片:</p>
-                            <div class="upload-image"  id="uploadGoodsImages">
-                                <div class="upload-file"  v-for="(item, index) in form.imagesList" :key="index">
-                                    <img :src="item" alt="" :data-image="item" :id="'uploadGoodsImages'+ index" class="upload-img" @click="showViewerImageFn(index)">
-                                    <i class="icon-del" @click="removeGoodsImagesFn(index)"></i>
+                        <div class="formLine">
+                            <p>上传图片:</p>
+                            <div class="uploadGoodsImages">
+                                <div class="form-upload-image"  v-for="(item, index) in form.imagesList" :key="index">
+                                    <img class="upload-img" :src="item" :data-image="item" :id="'uploadGoodsImages'+ index" @click="showViewerImageFn(index)">
+                                    <i class="icon mIcon del" @click="removeImagesFn(index)"></i>
                                 </div>
-                                <div class="upload-file" v-show="form.imagesList.length<5">
-                                    <div class="file-add">
-                                        <i class="icon mIcon"></i>
-                                        <p>添加图片</p>
-                                    </div>
-                                    <input ref="goodsImages" type="file" name="file" value="" class="input-file" accept="image/png,image/jpeg,image/gif,image/jpg"  @change="uploadGoodsImagesFn">
+                                <div class="formLine-file" v-show="form.imagesList.length<5">
+                                    <input ref="goodsImages" type="file" name="file" value="" class="input-file file" accept="image/png,image/jpeg,image/gif,image/jpg"  @change="uploadGoodsImagesFn">
+                                    <i class="icon mIcon add"></i>
                                 </div>
                             </div>
-                            <div class="upload-tips">
-                                <p>请尽量上传仪器全照或者仪器故障图片,方便您的维修事宜</p>
-                                <p>上传jpg/png格式照片,单个照片不能超过5M,最多不超过5张</p>
-                            </div>
+                            <p class="fileInfo">请尽量上传仪器全照或者仪器故障图片,方便您的维修事宜上传jpg/png格式照片,单个照片不能超过5M,最多不超过5张</p>
                         </div>
                         <div class="formLine">
                             <p><em>*</em>问题描述:</p>
-                            <div class="address mark">
-                                <textarea placeholder="建议您的问题描述..."  v-model="form.problemDescription"></textarea>
-                            </div>
+                            <textarea  v-model.trim="form.problemDescription" placeholder="请输入您的问题描述(不超过200字)…" maxlength="200" needverify></textarea>
                             <i class="checked icon mIcon"></i>
-                            <span class="errTips icon mIcon" tips="请输入正确的联系地址"></span>
+                            <span class="errTips icon mIcon" tips="请输入您的问题描述"></span>
                         </div>
-                        <div class="formLine">
-                            <a href="javascript: void(0);" @click="submitData" class="btn" :class="loginLoading ? 'disabled' : ''">提交</a>
+                        <div class="subLine">
+                            <button type="button" @click="submitData" class="btn" :class="loginLoading ? 'disabled' : ''">提交</button>
                         </div>
                     </form>
                 </div>