icssoa 6 年之前
父節點
當前提交
ec66b319ce

+ 5 - 1
admin-update/src/components/common/elx-upload.vue

@@ -6,12 +6,14 @@
 			:http-request="httpRequest"
 			:http-request="httpRequest"
 			:limit="limit"
 			:limit="limit"
 			:file-list="fileList"
 			:file-list="fileList"
+			:disabled="disabled"
 			:on-exceed="exceed"
 			:on-exceed="exceed"
 			:on-success="success"
 			:on-success="success"
 			:headers="{ token: token }"
 			:headers="{ token: token }"
 			:multiple="multiple"
 			:multiple="multiple"
 			:on-preview="handlePictureCardPreview"
 			:on-preview="handlePictureCardPreview"
 			:on-remove="handleRemove"
 			:on-remove="handleRemove"
+			:before-upload="beforeUpload"
 		>
 		>
 			<i class="el-icon-plus"></i>
 			<i class="el-icon-plus"></i>
 		</el-upload>
 		</el-upload>
@@ -36,7 +38,9 @@ export default {
 			type: Array,
 			type: Array,
 			default: []
 			default: []
 		},
 		},
-		value: [Array, String]
+		value: [Array, String],
+		beforeUpload: Function,
+		disabled: Boolean
 	},
 	},
 
 
 	data() {
 	data() {

+ 67 - 69
admin-update/src/pages/login/index.js

@@ -1,84 +1,82 @@
 // import Captcha from '@/components/common/captcha';
 // import Captcha from '@/components/common/captcha';
 
 
 export default {
 export default {
-    // components: {
-    // 	Captcha
-    // },
+	// components: {
+	// 	Captcha
+	// },
 
 
-    data() {
-        return {
-            form: {
-                mobile: null,
-                password: null,
-                // captchaId: '',
-                verifyCode: ''
-            },
-            saving: false,
-            loading: true
-        };
-    },
-    mounted() {
-        this.loading = false;
-        if (process.env.NODE_ENV === "development") {
-            this.form.mobile = '15280215347'
-            this.form.password = '123456'
-        }
-    },
+	data() {
+		return {
+			form: {
+				mobile: null,
+				password: null,
+				// captchaId: '',
+				verifyCode: ''
+			},
+			saving: false,
+			loading: true
+		};
+	},
+	mounted() {
+		this.loading = false;
+		if (process.env.NODE_ENV === 'development') {
+			this.form.mobile = '15280215347';
+			this.form.password = '123456';
+		}
+	},
 
 
-    methods: {
-        captchaChange() {
-            this.form.verifyCode = '';
-        },
+	methods: {
+		captchaChange() {
+			this.form.verifyCode = '';
+		},
 
 
-        async next() {
-            const {mobile, password} = this.form;
+		async next() {
+			const { mobile, password } = this.form;
 
 
-            if (!mobile) {
-                return this.$message.warning('用户名不能为空');
-            }
+			if (!mobile) {
+				return this.$message.warning('用户名不能为空');
+			}
 
 
-            if (!password) {
-                return this.$message.warning('密码不能为空');
-            }
+			if (!password) {
+				return this.$message.warning('密码不能为空');
+			}
 
 
-            this.saving = true;
+			this.saving = true;
 
 
-            try {
-                // 登录
-                await this.$store.dispatch('userLogin', this.form);
+			try {
+				// 登录
+				await this.$store.dispatch('userLogin', this.form);
 
 
-                if (this.$projectName == 'business') {
-                    // 用户信息
-                    await this.$store.dispatch('userInfo');
-                    // 商户信息
-                    await this.$store.dispatch('shopInfo');
-                } else {
-                    // 后台信息
-                    await this.$store.dispatch('adminInfo');
-                }
+				if (this.$projectName == 'business') {
+					// 用户信息
+					await this.$store.dispatch('userInfo');
+					// 商户信息
+					await this.$store.dispatch('shopInfo');
+				} else {
+					// 后台信息
+					await this.$store.dispatch('adminInfo');
+				}
 
 
-                // 权限菜单
-                const [first] = await this.$store.dispatch('permMenu');
+				// 权限菜单
+				const [first] = await this.$store.dispatch('permMenu');
 
 
-                this.saving = false;
+				this.saving = false;
 
 
-                if (!first) {
-                    this.$message.error('该账号没有权限');
-                } else {
-                    this.$nextTick(() => {
-                        if (this.$projectName == 'business') {
-                            this.$router.push('/');
-                        } else {
-                            this.$router.push('/');
-                        }
-                    });
-                }
-            } catch (err) {
-                // this.$refs.captcha.refresh();
-                this.saving = false;
-
-                this.$message.error(err);
-            }
-        }
-    }
+				if (!first) {
+					this.$message.error('该账号没有权限');
+				} else {
+					this.$nextTick(() => {
+						if (this.$projectName == 'business') {
+							this.$router.push('/');
+						} else {
+							this.$router.push('/');
+						}
+					});
+				}
+			} catch (err) {
+				// this.$refs.captcha.refresh();
+				this.saving = false;
+			}
+		}
+	}
 };
 };

+ 4 - 1
admin-update/src/store/modules/config.js

@@ -22,7 +22,10 @@ export default {
 		// 分类
 		// 分类
 		getCategory({ commit }) {
 		getCategory({ commit }) {
 			return this.$service.category.list().then(res => {
 			return this.$service.category.list().then(res => {
-				commit('SET_CATEGORY', res);
+				commit(
+					'SET_CATEGORY',
+					res.filter(e => e.status != '0')
+				);
 				return res;
 				return res;
 			});
 			});
 		},
 		},

+ 21 - 3
admin-update/src/views/goods/goods-add.vue

@@ -88,12 +88,16 @@
 						<elxUpload
 						<elxUpload
 							:limit="4"
 							:limit="4"
 							:fileList.sync="fileList_show"
 							:fileList.sync="fileList_show"
+							:disabled="ruleForm.categoryIdList.length == 0"
 							@success="fromToData"
 							@success="fromToData"
 							@handleRemove="fromToData"
 							@handleRemove="fromToData"
 						></elxUpload>
 						></elxUpload>
+						<p style="color: red" v-show="ruleForm.categoryIdList.length == 0">
+							请先选择分类
+						</p>
 					</div>
 					</div>
 					<div>
 					<div>
-						<el-button type="primary" size="small" @click="imgStoreModal = true"
+						<el-button type="primary" size="small" @click="openStore"
 							>从图库选择</el-button
 							>从图库选择</el-button
 						>
 						>
 					</div>
 					</div>
@@ -435,10 +439,18 @@ export default {
 		},
 		},
 		checkImage() {
 		checkImage() {
 			this.imgStoreModal = false;
 			this.imgStoreModal = false;
+
+			this.fileList_show = this.fileList_show.concat(
+				this.imgStoreArr.map(e => {
+					return {
+						url: e,
+						status: 'success'
+					};
+				})
+			);
 		},
 		},
 		setCheckImg(val) {
 		setCheckImg(val) {
 			this.$set(this.ruleForm, 'shopImg', this.ruleForm.shopImg.concat(val));
 			this.$set(this.ruleForm, 'shopImg', this.ruleForm.shopImg.concat(val));
-			console.log(this.ruleForm.shopImg, val);
 		},
 		},
 
 
 		// 编辑器
 		// 编辑器
@@ -466,13 +478,13 @@ export default {
 		},
 		},
 		// 款式选择弹窗
 		// 款式选择弹窗
 		styleDelFn(index) {
 		styleDelFn(index) {
-			this.actionOption = false;
 			let num = this.getStyleNum();
 			let num = this.getStyleNum();
 			console.log('num', num);
 			console.log('num', num);
 			if (num == 1) {
 			if (num == 1) {
 				this.$message.error('最少保留一个款式!');
 				this.$message.error('最少保留一个款式!');
 				return false;
 				return false;
 			}
 			}
+			this.actionOption = false;
 			if (this.styleStoreData[index].action == 'update') {
 			if (this.styleStoreData[index].action == 'update') {
 				// this.styleStoreData[index].action = 'delete';
 				// this.styleStoreData[index].action = 'delete';
 				this.$set(this.styleStoreData[index], 'action', 'delete');
 				this.$set(this.styleStoreData[index], 'action', 'delete');
@@ -490,6 +502,12 @@ export default {
 			}
 			}
 			let form = JSON.parse(JSON.stringify(this.styleForm));
 			let form = JSON.parse(JSON.stringify(this.styleForm));
 			this.styleStoreData.push(form);
 			this.styleStoreData.push(form);
+		},
+		openStore() {
+			if (this.ruleForm.categoryIdList.length == 0) {
+				return this.$message.error('请先选择分类');
+			}
+			this.imgStoreModal = true;
 		}
 		}
 	}
 	}
 };
 };

+ 38 - 11
admin-update/src/views/member/list.vue

@@ -105,11 +105,12 @@
 						class="demo-form"
 						class="demo-form"
 					>
 					>
 						<el-form-item label="充值金额">
 						<el-form-item label="充值金额">
-							<el-input
+							<el-input-number
 								v-model="rechargeForm.rechargeAmount"
 								v-model="rechargeForm.rechargeAmount"
 								placeholder="充值金额"
 								placeholder="充值金额"
 								size="small"
 								size="small"
-							></el-input>
+								:min="0"
+							></el-input-number>
 						</el-form-item>
 						</el-form-item>
 						<el-form-item label="确认密码">
 						<el-form-item label="确认密码">
 							<el-input
 							<el-input
@@ -390,10 +391,21 @@ export default {
 									placeholder: '请填写手机号码'
 									placeholder: '请填写手机号码'
 								}
 								}
 							},
 							},
-							rules: {
-								required: true,
-								message: '请填写手机号码'
-							}
+							rules: [
+								{
+									required: true,
+									message: '请填写手机号码'
+								},
+								{
+									validator: (rule, value, callback) => {
+										if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value)) {
+											return callback(new Error('手机号码不正确'));
+										}
+
+										callback();
+									}
+								}
+							]
 						},
 						},
 						{
 						{
 							prop: 'confirmMobile',
 							prop: 'confirmMobile',
@@ -405,17 +417,32 @@ export default {
 									placeholder: '请填写确认手机号码'
 									placeholder: '请填写确认手机号码'
 								}
 								}
 							},
 							},
-							rules: {
-								required: true,
-								message: '请填写确认手机号码'
-							}
+							rules: [
+								{
+									required: true,
+									message: '请填写确认手机号码'
+								},
+								{
+									validator: (rule, value, callback) => {
+										if (app.getForm('mobile') != value) {
+											return callback(new Error('两次输入密码不一致'));
+										}
+
+										callback();
+									}
+								}
+							]
 						},
 						},
 						{
 						{
 							prop: 'balance',
 							prop: 'balance',
 							label: '余额',
 							label: '余额',
 							span: 24,
 							span: 24,
 							component: {
 							component: {
-								name: 'el-input',
+								name: 'el-input-number',
+								props: {
+									min: 0,
+									max: 10000000
+								},
 								attrs: {
 								attrs: {
 									placeholder: '请填写余额'
 									placeholder: '请填写余额'
 								}
 								}