Browse Source

供应商发布商品

zhengjinyi 3 years ago
parent
commit
b2b0515a4c

+ 1 - 0
src/main/resources/static/css/product/detail.pc.css

@@ -137,6 +137,7 @@ input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appear
 .comment-right{float:right;color:#93979f}
 .tabCon .item div p{line-height: 26px;text-align: left;}
 .tabCon .item div p.tl{line-height: 40px;text-align: left; font-weight: bold;}
+.tabCon .item div p.tl .sm{line-height: 40px;text-align: left; font-weight: normal;}
 .noprice{color: #e15616;}
 .noprice .icon::before{width: 25px;height: 25px;background-position: -91px -545px;position: relative;top: 6px}
 .WeChat{float: right;font-size: 12px;cursor: pointer}

+ 8 - 0
src/main/resources/static/js/product/detail.js

@@ -32,8 +32,11 @@ var productDetail = new Vue({
         disabledText:'',
         isNoneDisabled:false,
         isServiceInfo:false,
+        isTrainingMethod:false,
         productTypeName:"",
         beautyActFlag:'',
+        trainingMethodText:'',
+        trainingType:''
     },
     computed: {},
     methods: {
@@ -81,6 +84,11 @@ var productDetail = new Vue({
                     if(product.productDetail.orderInfo!='' && product.productDetail.serviceInfo!=''){
                         _self.isServiceInfo = true;
                     }
+                    if(product.commodityType == 2){
+                        _self.isTrainingMethod = true;
+                        _self.trainingMethodText = product.trainingMethod == 1 ? '线上培训' : '线下培训';
+                        _self.trainingType = product.trainingType == 1 ? '¥'+product.trainingFee : '售价已包含';
+                    }
                     if(product.validFlag =='3' || product.validFlag =='9' || product.validFlag =='0' ||  product.validFlag =='10' || product.stock == 0 ){
                         _self.isNoneDisabled = true;
                     }else{

+ 38 - 2
src/main/resources/static/js/supplier-center/shop/release.js

@@ -55,8 +55,8 @@ var releaseContainer = new Vue({
             threeClassifyName:'',
             brandName:'',
             commodityType:1,
-            trainingMethod:1,// 线上培训方式
-            trainingType:1,// 售价包含培训费用
+            trainingMethod:0,// 线上培训方式
+            trainingType:0,// 售价包含培训费用
             trainingFee:''
         },
         params:{
@@ -134,6 +134,8 @@ var releaseContainer = new Vue({
         vShow_detailInfoEditor:true,
         vShow_orderInfoEditor:true,
         vShow_attribute:false,
+        vShow_trainingMethod:false,
+        vShow_trainingType:false,
     },
     computed: {
 
@@ -149,6 +151,9 @@ var releaseContainer = new Vue({
                     _this.releaseParams.name = data.name;
                     _this.releaseParams.aliasName = data.aliasName;
                     _this.releaseParams.productType = data.productType;
+                    _this.releaseParams.trainingMethod = data.trainingMethod;
+                    _this.releaseParams.trainingType = data.trainingType;
+                    _this.releaseParams.trainingFee = data.trainingFee;
                     _this.releaseParams.machineType = data.machineType;
                     _this.releaseParams.qualificationImg = data.qualificationImg;
                     _this.releaseParams.unit = data.unit;
@@ -694,6 +699,37 @@ var releaseContainer = new Vue({
                 },2000);
                 return;
             }
+            if(_this.releaseParams.commodityType == 2){
+                if(_this.releaseParams.trainingMethod == 0){
+                    _this.vShow_trainingMethod=true;
+                    _this.fromMessage = '请选择培训方式';
+                    _this.scrollIntoView();
+                    setTimeout(function(){
+                        _this.vShow_trainingMethod = false;
+                    },2000);
+                    return;
+                }
+                if(_this.releaseParams.trainingType == 0){
+                    _this.vShow_trainingType=true;
+                    _this.fromMessage = '请选择培训费用';
+                    _this.scrollIntoView();
+                    setTimeout(function(){
+                        _this.vShow_trainingType = false;
+                    },2000);
+                    return;
+                }
+                if(_this.releaseParams.trainingType == 1){
+                    if(_this.releaseParams.trainingFee == ''){
+                        _this.vShow_trainingType=true;
+                        _this.fromMessage = '请填写包含食宿,交通等各项费用的培训总金额';
+                        _this.scrollIntoView();
+                        setTimeout(function(){
+                            _this.vShow_trainingType = false;
+                        },2000);
+                        return;
+                    }
+                }
+            }
             if(_this.releaseParams.bigTypeId == ''){
                 _this.vShow_TinyTypeID = true;
                 _this.fromMessage = '请选择商品分类';

+ 3 - 5
src/main/resources/templates/product/detail.html

@@ -218,7 +218,7 @@
                 <span :class="tabsIndex == 0 ? 'on' : ''" @click="detailsClicktab(0)">商品详情</span>
                 <span :class="tabsIndex == 1 ? 'on' : ''" v-if="parameters.length>0 && !isNoneDisabled" @click="detailsClicktab(1)">相关参数</span>
                 <span :class="tabsIndex == 2 ? 'on' : ''" v-if="isServiceInfo && !isNoneDisabled" @click="detailsClicktab(2)">服务项目</span>
-                <span :class="tabsIndex == 3 ? 'on' : ''" v-if="isServiceInfo && !isNoneDisabled" @click="detailsClicktab(2)">培训方案</span>
+                <span :class="tabsIndex == 3 ? 'on' : ''" v-if="isTrainingMethod" @click="detailsClicktab(3)">培训方案</span>
                 <!--<span>评价</span>-->
             </div>
             <div class="tabCon">
@@ -245,10 +245,8 @@
                     <div th:utext="${product.serviceInfo}"></div>
                 </div>
                 <div class="item" v-if="tabsIndex == 3">
-                    <div><p class="tl">培训方式:</p></div>
-                    <div th:utext="${product.orderInfo}"></div>
-                    <div><p class="tl">培训费用:</p></div>
-                    <div th:utext="${product.serviceInfo}"></div>
+                    <div><p class="tl">培训方式: <span class="sm">{{ trainingMethodText }}</span></p></div>
+                    <div><p class="tl">培训费用: <span class="sm">{{ trainingType }}</span></p></div>
                 </div>
 <!--                <div class="item">-->
 <!--                <div style="text-align: left;margin: 10px 0">-->

+ 4 - 4
src/main/resources/templates/supplier-center/shop/release.html

@@ -72,7 +72,7 @@
                                     </div>
                                 <div class="release-tips" v-show="vShow_attribute">{{fromMessage}}</div>
                              </div>
-                            <div class="release-from clear">
+                            <div class="release-from clear" v-if="releaseParams.commodityType == 2">
                                  <div class="release-label"><span class="star">*</span>培训方式:</div>
                                     <div class="release-input">
                                         <div class="release-props">
@@ -80,9 +80,9 @@
                                             <label class="release-radio" @click="choiceTrain(2)"><input type="radio" name="trainingMethod" v-model="releaseParams.trainingMethod" value="2" checked><i class="icon mIcon">线下培训</i></label>
                                         </div>
                                     </div>
-                                <div class="release-tips" v-show="vShow_attribute">{{fromMessage}}</div>
+                                <div class="release-tips" v-show="vShow_trainingMethod">{{fromMessage}}</div>
                              </div>
-                            <div class="release-from clear">
+                            <div class="release-from clear" v-if="releaseParams.commodityType == 2">
                                  <div class="release-label"><span class="star">*</span>培训费用:</div>
                                     <div class="release-input">
                                         <div class="release-props">
@@ -94,7 +94,7 @@
                                         <span class="span">¥</span>
                                         <input class="input" v-model="releaseParams.trainingFee" maxlength="40" type="number" placeholder="请填写包含食宿,交通等各项费用的培训总金额">
                                     </div>
-                                <div class="release-tips" v-show="vShow_attribute">{{fromMessage}}</div>
+                                <div class="release-tips" v-show="vShow_trainingType">{{fromMessage}}</div>
                              </div>
                             <div class="release-from clear">
                                 <div class="release-label"><span class="star">*</span>商品分类:</div>