瀏覽代碼

二手发布

zhengjinyi 4 年之前
父節點
當前提交
28742bc711

+ 2 - 2
src/main/resources/config/dev/application-dev.yml

@@ -53,8 +53,8 @@ logging:
 # 服务域名
 caimei:
   siteEnv: 0 #网站环境,(2:正式环境,1:测试环境,0:开发环境)
-  spiServer: https://spi-b.caimei365.com
-#  spiServer: http://192.168.2.75:8008
+#  spiServer: https://spi-b.caimei365.com
+  spiServer: http://192.168.2.67:8008
   coreServer: https://core-b.caimei365.com
 #  coreServer: http://192.168.2.75:18002
   imageDomain: https://img-b.caimei365.com

+ 6 - 0
src/main/resources/static/css/flea-market/form.css

@@ -28,7 +28,10 @@ body{background: #fff}
      .border-grey {width: 496px;height: 114px;background-color: #ffffff;border-radius: 2px;border: solid 1px #b8bfca;margin-top: 20px;resize: none;padding: 10px}
      #description {margin-top: 0;}
      .upload-file {position: relative;float: left;margin: 10px 10px 10px 0px;cursor: pointer;width: 80px;height: 80px;border-radius: 2px;border: solid 1px #b8bfca;}
+     .login-form input.upload-file-name{ width: 388px; }
      .input-file {width: 80px;height: 80px;opacity: 0;cursor: pointer;position: absolute;}
+     .input-file-btn {width: 90px;height: 36px;cursor: pointer;position: absolute;	background-color: #ffe6dc;border-radius: 2px;border: solid 1px #e15616;text-align: center;line-height: 36px;font-size: 14px;color: #e15616;position: relative;float: right;}
+     .input-file-btn input{width: 90px;height: 36px;opacity: 0;cursor: pointer;position: absolute;top: 0;left: 0;z-index: 999;}
      .upload-img {width: 100%;height: 100%;display: block;border-radius: 2px;}
      .add-text {font-size: 12px;color: #333330;opacity: 0.5;position: absolute;top: 60%;right: 13px}
      .release-main-container {overflow: hidden;}
@@ -112,7 +115,10 @@ body{background: #fff}
      .border-grey {width: 100%;height: 56.3vw;background-color: #ffffff;border-radius: .53vw;border: solid .27vw #b8bfca;margin-top: 5.3vw;resize: none;padding: 2.7vw;box-sizing: border-box}
      #description {margin-top: 0;}
      .upload-file {position: relative;float: left;margin: 2.7vw 2.7vw 2.7vw 0px;cursor: pointer;width: 21.3vw;height: 21.3vw;border-radius: .53vw;border: solid .27vw #b8bfca}
+     .login-form input.upload-file-name{ width: 55.7vw !important; padding: 0 2.7vw;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
      .input-file {width: 21.3vw;height: 21.3vw;opacity: 0;cursor: pointer;position: absolute;}
+     .input-file-btn {width: 33.6vw;height: 9.6vw;box-sizing: border-box; cursor: pointer;position: absolute;	background-color: #ffe6dc;border-radius: 2px;border: solid 1px #e15616;text-align: center;line-height: 9.6vw;font-size: 14px;color: #e15616;position: relative;float: right;}
+     .input-file-btn input{width: 33.6vw;height: 9.6vw;opacity: 0;cursor: pointer;position: absolute;top: 0;left: 0;z-index: 999;}
      .upload-img {width: 100%;height: 100%;display: block;border-radius: .53vw;}
      .add-text {font-size: 3.2vw;color: #333330;opacity: 0.5;position: absolute;top: 60%;right:3.3vw}
      .release-main-container {overflow: hidden;}

+ 45 - 6
src/main/resources/static/js/common/serviceapi/second.service.js

@@ -10,11 +10,28 @@ var SecondApi = {
                 callback(res);
             });
         },
-         uploadimg: function (params, callback) {//上传图片
-            Http.uploadImage({ url:'/formData/MultiPictareaddData',data:params},callback)
+        uploadimg: function (params, callback) {//上传图片
+            Http.uploadImage({
+                url:'/formData/MultiPictareaddData',
+                data:params
+            },callback)
+        },
+        uploadFile: function (params, callback) {//上传文件
+            Http.uploadImage({
+                url:'/file/upload',
+                data:params
+            },callback)
         },
         SeconHandProductList: function (params, callback) {//商品列表
-            Http.AjaxService({ url:'/commodity/second/list', type:'get', data:params, json:true, mask:true,replace:false, isHost:true})
+            Http.AjaxService({
+                url:'/commodity/second/list',
+                type:'get',
+                data:params,
+                json:true,
+                mask:true,
+                replace:false,
+                isHost:true
+            })
             .then(function(res){
                 callback(res);
             });
@@ -34,19 +51,41 @@ var SecondApi = {
             });
         },
         ProductCount: function (params, callback) {//浏览量
-            Http.AjaxService({ url:'/product/updateSecondHandProductCount', type:'get', data:params, json:true, mask:true,replace:false})
+            Http.AjaxService({
+                url:'/product/updateSecondHandProductCount',
+                type:'get',
+                data:params,
+                json:true,
+                mask:true,
+                replace:false
+            })
             .then(function(res){
                 callback(res);
             });
         },
         ProductDetail: function (params, callback) {//商品详情
-            Http.AjaxService({ url:'/commodity/second/detail', type:'get', data:params, json:true, mask:true,replace:false, isHost:true})
+            Http.AjaxService({
+                url:'/commodity/second/detail',
+                type:'get',
+                data:params,
+                json:true,
+                mask:true,
+                replace:false,
+                isHost:true
+            })
             .then(function(res){
                 callback(res);
             });
         },
          ProductRecommend: function (params, callback) {//商品详情/相关推荐
-            Http.AjaxService({ url:'/product/getSecondHandProductRecommend', type:'get', data:params, json:true, mask:true,replace:false})
+            Http.AjaxService({
+                url:'/product/getSecondHandProductRecommend',
+                type:'get',
+                data:params,
+                json:true,
+                mask:true,
+                replace:false
+            })
             .then(function(res){
                 callback(res);
             });

+ 148 - 105
src/main/resources/static/js/flea-market/form.js

@@ -21,7 +21,7 @@ var fleaMarketForm = new Vue({
         BrandList:[],
         isShow:false,
         includedTax:'',
-        GoodsImagesList:['https://img.caimei365.com/group1/M00/03/CB/Cmis2F_NkrqAfl7uAADETMOGKpQ791.png'],
+        GoodsImagesList:[],
         oldNum:0,
         secondType:0,
         vShow_GoodsImages:false,
@@ -47,12 +47,15 @@ var fleaMarketForm = new Vue({
             secondProductType:'',//
             townId:'',//县区地址
             address:'',//详细地址
-            image:'https://img.caimei365.com/group1/M00/03/CB/Cmis2F_NkrqAfl7uAADETMOGKpQ791.png',//图片
+            image:'',//图片
             productDetails:'',//商品详细信息
             source:1,
             dockingPeopleMobile:'',
-            dockingPeopleName:''
-
+            dockingPeopleName:'',
+            authenticationImage:'',//身份证照片
+            commitmentImage:'',//承诺函图片
+            fileName:'',//文件名称
+            ossName:'',//文件OSS名称
          },
         brandname:'请选择',
         checkbox:false,
@@ -142,31 +145,72 @@ var fleaMarketForm = new Vue({
         dragstart: function(value) {  // 记录初始信息
             this.oldNum = value;
         },
-         uploadGoodsImagesFn: function(event){//上传商品图片
+        uploadGoodsImagesFn: function(event){//上传商品图片
             var _this = this;
             var inputDOM = _this.$refs.goodsImages;
             var file = inputDOM.files;
             _this.formData.append('file', file[0]);
             SecondApi.uploadimg(_this.formData,function(response){
-               _this.GoodsImagesList.push(response.data);
-               _this.secondParams.image =_this.GoodsImagesList.toString()+',';
+                _this.GoodsImagesList.push(response.data);
+                _this.secondParams.image =_this.GoodsImagesList.toString()+',';
+                event.target.value = '';
+            });
+        },
+        uploadAuthenticationImagesFn: function(event){//上传身份验证照片
+            var _this = this;
+            var inputDOM = _this.$refs.AuthenticationImage;
+            var file = inputDOM.files;
+            _this.formData.append('file', file[0]);
+            SecondApi.uploadimg(_this.formData,function(response){
+                _this.secondParams.authenticationImage = response.data;
+                event.target.value = '';
+            });
+        },
+        uploadCommitmentImagesFn: function(event){//上传承诺函图片
+            var _this = this;
+            var inputDOM = _this.$refs.CommitmentImage;
+            var file = inputDOM.files;
+            _this.formData.append('file', file[0]);
+            SecondApi.uploadimg(_this.formData,function(response){
+                _this.secondParams.commitmentImage = response.data;
+                event.target.value = '';
+            });
+        },
+        uploadCommitmentFileFn : function(event){//上传承诺函文件
+            var _this = this;
+            var inputDOM = _this.$refs.CommitmentImagefile;
+            var file = inputDOM.files;
+            var formData = new FormData();
+            console.log(file[0])
+            formData.append('file', file[0]);
+            SecondApi.uploadFile(formData,function(response){
+                _this.secondParams.ossName = response.data.ossName;
+                _this.secondParams.fileName = response.data.fileName;
                 event.target.value = '';
             });
         },
-         removeGoodsImagesFn: function(index){//删除商品图片
+        removeGoodsImagesFn: function(index){//删除商品图片
             var _this = this;
             _this.GoodsImagesList.splice(index,1);
             _this.secondParams.image =_this.GoodsImagesList.toString()+',';
-         },
+        },
+        removeAuthenticationImagesFn:function(){
+            var _this = this;
+            _this.secondParams.authenticationImage = '';
+        },
+        removeCommitmentImagesFn:function(){
+            var _this = this;
+            _this.secondParams.commitmentImage = '';
+        },
         getProductType:function(item){
-        var _this = this;
-         _this.secondType=item;
-          _this.secondParams.secondProductType = item ;
+            var _this = this;
+            _this.secondType=item;
+            _this.secondParams.secondProductType = item ;
         },
         submitBtn:function () {
-         var _this = this;
-         var re = /^1\d{10}$/;
-          if(_this.secondParams.secondHandType == ''){
+            var _this = this;
+            var re = /^1\d{10}$/;
+            if(_this.secondParams.secondHandType == ''){
                 _this.vShow_secondHandType = true;
                 _this.fromMessage = '请选择分类';
                 _this.scrollIntoView();
@@ -186,7 +230,7 @@ var fleaMarketForm = new Vue({
                 return;
                 }
             }
-         if(_this.secondParams.brandID == ''){
+            if(_this.secondParams.brandID == ''){
                 _this.vShow_BrandID = true;
                 _this.fromMessage = '请选择商品品牌';
                 _this.scrollIntoView();
@@ -195,116 +239,115 @@ var fleaMarketForm = new Vue({
                 },2000);
                 return;
             }
-         if(_this.secondParams.name == ''){
-              _this.vShow_Name = true;
-              _this.fromMessage = '请输入商品名称';
-              _this.scrollIntoView();
+            if(_this.secondParams.name == ''){
+                _this.vShow_Name = true;
+                _this.fromMessage = '请输入商品名称';
+                _this.scrollIntoView();
                 setTimeout(function(){
                     _this.vShow_Name = false;
                 },2000);
                 return
          }
-         if(_this.secondParams.price == ''){
+             if(_this.secondParams.price == ''){
                   _this.vShow_Price = true;
                   _this.fromMessage = '请输入交易价';
+                  _this.scrollIntoView();
+                  setTimeout(function(){
+                      _this.vShow_Price = false;
+                  },2000);
+                    return
+             }
+             if(_this.secondParams.productQuality == ''){
+                  _this.vShow_shopColor = true;
+                  _this.fromMessage = '请输入商品成色';
                   _this.scrollIntoView();
                     setTimeout(function(){
-                        _this.vShow_Price = false;
+                        _this.vShow_shopColor = false;
+                    },2000);
+                    return
+             }
+             if(_this.secondParams.contactName == ''){
+                  _this.vShow_contactName = true;
+                  _this.fromMessage = '请输入联系人姓名';
+                  _this.scrollIntoView();
+                  setTimeout(function(){
+                      _this.vShow_contactName = false;
+                  },2000);
+                  return
+             }
+              if(_this.secondParams.contactMobile == ''){
+                  _this.vShow_contactMobile = true;
+                  _this.fromMessage = '请输入联系方式';
+                  _this.scrollIntoView();
+                  setTimeout(function(){
+                      _this.vShow_contactMobile = false;
+                  },2000);
+                  return
+             }
+             if(!re.test(_this.secondParams.contactMobile)){
+                  _this.vShow_contactMobile = true;
+                  _this.fromMessage = '联系方式格式不正确';
+                  _this.scrollIntoView();
+                  setTimeout(function(){
+                      _this.vShow_contactMobile = false;
+                  },2000);
+                  return
+              }
+              if(_this.secondParams.dockingPeopleMobile!='' && !re.test(_this.secondParams.dockingPeopleMobile)){
+                  _this.vShow_caimeiMobile = true;
+                  _this.fromMessage = '联系方式格式不正确';
+                  _this.scrollIntoView();
+                  setTimeout(function(){
+                      _this.vShow_caimeiMobile = false;
+                  },2000);
+                  return
+              }
+              if(_this.secondParams.townId == ''|| _this.secondParams.townId == undefined){
+                  _this.vShow_TownId = true;
+                  _this.fromMessage = '请完善联系地址';
+                  _this.scrollIntoView();
+                  setTimeout(function(){
+                      _this.vShow_TownId = false;
+                  },2000);
+                  return
+             }
+             if(_this.secondParams.address == ''){
+                  _this.vShow_Address = true;
+                  _this.fromMessage = '请填写详细地址';
+                  document.getElementById('Address').scrollIntoView({block: 'start', behavior: 'smooth'});
+                  setTimeout(function(){
+                        _this.vShow_Address = false;
                     },2000);
                     return
              }
-         if(_this.secondParams.productQuality == ''){
-              _this.vShow_shopColor = true;
-              _this.fromMessage = '请输入商品成色';
-              _this.scrollIntoView();
-                setTimeout(function(){
-                    _this.vShow_shopColor = false;
-                },2000);
-                return
-         }
-          if(_this.secondParams.contactName == ''){
-              _this.vShow_contactName = true;
-              _this.fromMessage = '请输入联系人姓名';
-              _this.scrollIntoView();
-                setTimeout(function(){
-                    _this.vShow_contactName = false;
-                },2000);
-                return
-         }
-          if(_this.secondParams.contactMobile == ''){
-              _this.vShow_contactMobile = true;
-              _this.fromMessage = '请输入联系方式';
-              _this.scrollIntoView();
-                setTimeout(function(){
-                    _this.vShow_contactMobile = false;
-                },2000);
-                return
-         }
-         if(!re.test(_this.secondParams.contactMobile)){
-              _this.vShow_contactMobile = true;
-              _this.fromMessage = '联系方式格式不正确';
-              _this.scrollIntoView();
-                setTimeout(function(){
-                    _this.vShow_contactMobile = false;
-                },2000);
-                 return
-          }
-          if(_this.secondParams.dockingPeopleMobile!='' && !re.test(_this.secondParams.dockingPeopleMobile)){
-              _this.vShow_caimeiMobile = true;
-              _this.fromMessage = '联系方式格式不正确';
-              _this.scrollIntoView();
-                setTimeout(function(){
-                    _this.vShow_caimeiMobile = false;
-                },2000);
-                 return
-          }
-          if(_this.secondParams.townId == ''|| _this.secondParams.townId == undefined){
-              _this.vShow_TownId = true;
-              _this.fromMessage = '请完善联系地址';
-              _this.scrollIntoView();
-                setTimeout(function(){
-                    _this.vShow_TownId = false;
-                },2000);
-                return
-         }
-           if(_this.secondParams.address == ''){
-              _this.vShow_Address = true;
-              _this.fromMessage = '请填写详细地址';
-               document.getElementById('Address').scrollIntoView({block: 'start', behavior: 'smooth'});
-                setTimeout(function(){
-                    _this.vShow_Address = false;
-                },2000);
-                return
-         }
             if(_this.GoodsImagesList ==''){
-               _this.vShow_GoodsImages = true;
-              _this.fromMessage = '请上传图片';
+                _this.vShow_GoodsImages = true;
+                _this.fromMessage = '请上传图片';
                 document.documentElement.scrollTop=900;
-              setTimeout(function(){
-                   _this.vShow_GoodsImages = false;
+                setTimeout(function(){
+                    _this.vShow_GoodsImages = false;
                 },2000);
                 return;
             }
-         if(_this.checkbox==false){
-               _this.vShow_checkBox = true;
-               _this.fromMessage='请勾选已阅读';
+            if(_this.checkbox==false){
+                _this.vShow_checkBox = true;
+                _this.fromMessage='请勾选已阅读';
                 setTimeout(function(){
-                   _this.vShow_checkBox = false;
+                    _this.vShow_checkBox = false;
                 },2000);
                 return
-         }
-         console.log(_this.secondParams)
-          SecondApi.SecondHandProduct(_this.secondParams,function (res) { //提交发布
-             if (res.code==0){
-                 console.log(res)
-               _this.vShow_secondBj = true;
-               _this.playid= res.data;
-             }else{
-                 CAIMEI.Alert(res.msg, '确定', false);
-                 _this.secondBj = false;
-                 return
              }
-         })
+            console.log(_this.secondParams)
+            SecondApi.SecondHandProduct(_this.secondParams,function (res) { //提交发布
+                if (res.code==0){
+                   _this.vShow_secondBj = true;
+                   _this.playid= res.data;
+                }else{
+                     CAIMEI.Alert(res.msg, '确定', false);
+                     _this.secondBj = false;
+                     return
+                }
+            })
         },
         quxiao:function(){
         var _this = this;

+ 43 - 3
src/main/resources/templates/flea-market/form.html

@@ -88,7 +88,23 @@
                         <input type="text"  v-model="secondParams.contactMobile"  oninput="value=value.replace(/[^\d]/g,'')"  id="phoneNum" maxlength="11" placeholder="请输入联系人手机号">
                         <span class="release-tips errTips icon mIcon" v-show="vShow_contactMobile">{{fromMessage}}</span>
                     </div>
-                     <div class="unlogin-item input-item shrink-spacing">
+                    <div class="release-main-container">
+                        <div class="release-from">
+                            <div class="release-label">身份验证照片<span style="color:#ffb496">(个人请上传身份证正面照片;机构请上传营业执照照片)</span>:</div>
+                            <div class="release-input upload image"  id="uploadAuthenticationImage">
+                                <div class="upload-file" v-if="secondParams.authenticationImage == ''">
+                                    <i class="icon mIcon add"></i>
+                                    <p class="add-text">验证照片</p>
+                                    <input ref="AuthenticationImage" type="file" name="file" value="" class="input-file" accept="image/png,image/jpeg,image/gif,image/jpg"  @change="uploadAuthenticationImagesFn">
+                                </div>
+                                <div class="upload-file" v-else>
+                                    <img :data-original='secondParams.authenticationImage' :src="secondParams.authenticationImage" :data-image="secondParams.authenticationImage" alt="" class="upload-img" >
+                                    <i class="icon mIcon del" @click="removeAuthenticationImagesFn"></i>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="unlogin-item input-item shrink-spacing">
                         <div class="unlogin-label spacing" style="letter-spacing: 1px;">采美对接人:</div>
                         <input type="text" maxlength="15" v-model="secondParams.dockingPeopleName"  placeholder="请输入采美对接人姓名,没有可不填">
                     </div>
@@ -144,8 +160,8 @@
                                     <div class="wen-tips">最多上传5张二手商品图片,请尽量全部上传,单张图片不能超过5M</div>
                                 </div>
                             </div>
-                    </div>
-                     <span class="release-tips errTips icon mIcon" v-show="vShow_GoodsImages">{{fromMessage}}</span>
+                        </div>
+                        <span class="release-tips errTips icon mIcon" v-show="vShow_GoodsImages">{{fromMessage}}</span>
                     </div>
                      <div class="unlogin-item">
                         <div class="unlogin-label spacing">商品详细信息:</div>
@@ -154,6 +170,30 @@
                             <span id="word-limit">不超过200字</span>
                         </div>
                     </div>
+                    <div class="unlogin-item input-item shrink-spacing">
+                        <div class="unlogin-label spacing">二手出让承诺函文件:<span style="color:#ffb496">(仅支持pdf文件)</span>:</div>
+                        <input class="upload-file-name" type="text" v-model="secondParams.fileName" disabled="disabled">
+                        <div class="input-file-btn">
+                            上传文件
+                            <input class="input-file-btn"  ref="CommitmentImagefile" type="file" name="file" value="" accept=".pdf"  @change="uploadCommitmentFileFn">
+                        </div>
+                    </div>
+                    <div class="release-main-container">
+                        <div class="release-from">
+                            <div class="release-label">二手出让承诺函图片<span style="color:#ffb496">(若不方便上传承诺函文件,可对承诺函进行拍照或者截图,再上传图片)</span>:</div>
+                            <div class="release-input upload image"  id="uploadCommitmentImage">
+                                <div class="upload-file" v-if="secondParams.commitmentImage == ''">
+                                    <i class="icon mIcon add"></i>
+                                    <p class="add-text">承诺函图片</p>
+                                    <input ref="CommitmentImage" type="file" name="file" value="" class="input-file" accept="image/png,image/jpeg,image/gif,image/jpg"  @change="uploadCommitmentImagesFn">
+                                </div>
+                                <div class="upload-file" v-else>
+                                    <img :data-original='secondParams.commitmentImage' :src="secondParams.commitmentImage" :data-image="secondParams.commitmentImage" alt="" class="upload-img" >
+                                    <i class="icon mIcon del" @click="removeCommitmentImagesFn"></i>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
                     <div class="unlogin-item">
                         <div class="unlogin-label spacing" ><span class="red-color">*</span>免责声明:</div>
                         <div class="textarea-wrapper" style="letter-spacing: 1.5px">