Jelajahi Sumber

二手商城配置

pengyh 1 tahun lalu
induk
melakukan
3ba76818fb

+ 87 - 0
src/views/setting/agreement/index.vue

@@ -5,6 +5,7 @@
       <el-tab-pane label="隐私声明" name="second"></el-tab-pane>
       <el-tab-pane label="服务协议" name="third"></el-tab-pane>
       <el-tab-pane label="以旧换新协议" name="fourth"></el-tab-pane>
+			<el-tab-pane label="二手商城购买须知" name="fiveth"></el-tab-pane>
     </el-tabs>
 
     <el-form v-show="activeName=='first'" ref="mainForm" label-width="80px" label-position="top">
@@ -106,6 +107,31 @@
 		    </el-row>
 		  </el-form-item>
 		</el-form>
+		
+		<el-form v-show="activeName=='fiveth'" ref="mainForm" label-width="80px" label-position="top">
+		  <el-form-item label="" prop="content5">
+		    <el-upload
+		      ref="imageListUpload5"
+		      class="avatar-uploader5"
+		      :action="baseURL + 'common/upload'"
+		      :headers="myHeaders"
+		      multiple
+		      name="file"
+		      :show-file-list="false"
+		      :on-success="uploadSuccess5"
+		      :on-error="uploadError5"
+		      :before-upload="beforeUpload5">
+		    </el-upload>
+		    <!--富文本编辑器组件-->
+		    <el-row v-loading="quillImgLoading5">
+		      <quill-editor
+		        v-model="mainForm.content5"
+		        ref="myQuillEditor5"
+		        :options="editorOption5">
+		      </quill-editor>
+		    </el-row>
+		  </el-form-item>
+		</el-form>
 
     <div class="page-footer">
       <div class="footer" :class="classObj">
@@ -155,6 +181,7 @@ export default {
       mainForm: {
         content1: '',
         content2: '',
+				content5: ''
       },
 
       quillImgLoading1: false, // 富文本上传图片loading
@@ -240,6 +267,27 @@ export default {
         }
       },
       editorImages4: [],
+			
+			quillImgLoading5: false, // 富文本上传图片loading
+			editorOption5: { // 富文本配置
+			  placeholder: '请输入公共内容',
+			  theme: 'snow',
+			  modules: {
+			    toolbar: {
+			      container: toolbarOptions,
+			      handlers: {
+			        'image': function (value) {
+			          if (value) {
+			            document.querySelector('.avatar-uploader5 input').click()
+			          } else {
+			            this.quill.format('image', false);
+			          }
+			        }
+			      }
+			    }
+			  }
+			},
+			editorImages5: [],
 
       formLoading: false,
     }
@@ -269,6 +317,7 @@ export default {
           content2: res.data.privacyStatementContent,
 		      content3: res.data.serviceContent,
 		      content4: res.data.tradeContent,
+					content5: res.data.esShopBuyRemarkContent,
         }
       })
     },
@@ -281,6 +330,7 @@ export default {
         privacyStatementContent: this.mainForm.content2,
 		    serviceContent: this.mainForm.content3,
         tradeContent: this.mainForm.content4,
+				esShopBuyRemarkContent: this.mainForm.content5,
       }).then(res => {
         this.formLoading = false;
         this.$successMsg('编辑成功');
@@ -448,6 +498,43 @@ export default {
       this.quillImgLoading4 = false;
       this.$errorMsg('图片插入失败');
     },
+		
+		// ----------
+		// 富文本图片上传前
+		beforeUpload5() {
+		  this.quillImgLoading5 = true;
+		},
+		
+		// 富文本图片上传成功
+		uploadSuccess5(res, file, fileList) {
+		  fileList.forEach(item => {
+		    if(this.editorImages5.indexOf(item.response.data.url) < 0) {
+		      this.editorImages5.push(item.response.data.url);
+		    }
+		  })
+		  this.showImage5()
+		  this.quillImgLoading5 = false;
+		},
+		
+		showImage5() {
+		  let quill = this.$refs.myQuillEditor5.quill;
+		  this.editorImages5.forEach(item => {
+		    // 获取光标所在位置
+		    let length = quill.getSelection().index;
+		    quill.insertEmbed(length, 'image', item);
+		    // this.$refs.imageListUpload2.clearFiles()
+		    // 调整光标到最后
+		    quill.setSelection(length + 1);
+		  })
+		  this.editorImages5 = [];
+		  this.$refs.imageListUpload5.clearFiles();
+		},
+		
+		// 富文本图片上传失败
+		uploadError5() {
+		  this.quillImgLoading5 = false;
+		  this.$errorMsg('图片插入失败');
+		},
   }
 }
 </script>

+ 23 - 23
src/views/userManagement/masterManagement/index.vue

@@ -36,7 +36,7 @@
       </div>
       <div v-if="~['examine', 'detail'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
         <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-          <zj-form-module :title="data.label" label-width="110px" :showPackUp="false" :form-data="formData"
+          <zj-form-module :title="data.label" label-width="170px" :showPackUp="false" :form-data="formData"
             :form-items="[...formItems,...imageList]">
           </zj-form-module>
         </zj-form-container>
@@ -206,27 +206,27 @@ export default {
           rules: []
         }
       },
-			// {
-			// 	md: 6,
-			// 	isShow: true,
-			// 	name: 'slot-component',
-			// 	attributes: {},
-			// 	formItemAttributes: {
-			// 		label: '二手商城发布',
-			// 		prop: 'isEs',
-			// 		rules: [...required]
-			// 	},
-			// 	render: (h, { props, onInput }) => {
-			// 		var { value } = props
-			// 		return (
-			// 			<el-radio-group v-model={this.formData.isEs}>
-			// 				<el-radio label={true}>是</el-radio>
-			// 				<el-radio label={false}>否</el-radio>
-			// 			</el-radio-group>
-			// 		)
-			// 	}
-			// }, 
-			{
+	  {
+	  	md: 6,
+	  	isShow: true,
+	  	name: 'slot-component',
+	  	attributes: {},
+	  	formItemAttributes: {
+	  		label: '是否允许二手商城发布',
+	  		prop: 'isEs',
+	  		rules: [...required]
+	  	},
+	  	render: (h, { props, onInput }) => {
+	  		var { value } = props
+	  		return (
+	  			<el-radio-group v-model={this.formData.isEs}>
+	  				<el-radio label={true}>是</el-radio>
+	  				<el-radio label={false}>否</el-radio>
+	  			</el-radio-group>
+	  		)
+	  	}
+	  }, 
+	  {
         md: 24,
         isShow: true,
         name: 'el-input',
@@ -469,7 +469,7 @@ export default {
 				  userId: this.formData.userId,
 				  websitId: this.formData.websitId,
 				  bankAccount: this.formData.bankAccount,
-					// isEs: this.formData.isEs,
+					isEs: this.formData.isEs,
 				  idCard: this.formData.idCard,
 				  idCardImg: this.formData.idCardImg[0].url,
 				  name: this.formData.nickName