Преглед изворни кода

feat: NG-7: 解决部分input不能输入空格

Tyler пре 1 година
родитељ
комит
b00ca1a776
3 измењених фајлова са 314 додато и 313 уклоњено
  1. 249 248
      src/views/finance/recharge-list.vue
  2. 60 60
      src/views/profile/components/Account.vue
  3. 5 5
      src/views/shop/reconsume.vue

+ 249 - 248
src/views/finance/recharge-list.vue

@@ -1,274 +1,275 @@
 <template>
-	<div class="app-container" v-loading="listLoading">
-		<el-table :data="list" border fit highlight-current-row>
-			<el-table-column align="center" :label="$t('finance.createdTime')" prop="CREATED_AT" min-width="140px">
-				<template slot-scope="{row}">
-					<span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
-				</template>
-			</el-table-column>
-			<el-table-column align="center" min-width="160px" :label="$t('finance.rechargeAmount')" prop="AMOUNT">
-				<template slot-scope="{row}">
-					{{ row.AMOUNT | toThousandFilter }}
-				</template>
-			</el-table-column>
-			<el-table-column align="center" min-width="150px" :label="$t('finance.rechargeStatus')" prop="STATUS_NAME">
-				<template slot-scope="{row}">
-					<el-tag :type="row.AUDIT_STATUS | statusFilter">{{row.STATUS_NAME}}</el-tag>
-				</template>
-			</el-table-column>
-			<el-table-column align="center" min-width="180px" :label="$t('finance.bankName')" prop="OPEN_BANK_NAME"></el-table-column>
-			<el-table-column align="center" min-width="150px" :label="$t('finance.bankAccount')" prop="BANK_NO"></el-table-column>
-			<el-table-column align="center" min-width="150px" :label="$t('finance.printVoucher')">
-				<template slot-scope="{row}">
-					<el-button type="primary" size="mini" v-if="row.AUDIT_STATUS === '0'" @click="handleUpload(row.ID)">{{ $t('finance.uploadVoucher') }}</el-button>
-					<el-button type="success" size="mini" v-if="row.AUDIT_STATUS !== '0'" @click="handleView(row)">{{ $t('finance.viewVoucher') }}</el-button>
-				</template>
-			</el-table-column>
-		</el-table>
+  <div v-loading="listLoading" class="app-container">
+    <el-table :data="list" border fit highlight-current-row>
+      <el-table-column align="center" :label="$t('finance.createdTime')" prop="CREATED_AT" min-width="140px">
+        <template slot-scope="{row}">
+          <span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" min-width="160px" :label="$t('finance.rechargeAmount')" prop="AMOUNT">
+        <template slot-scope="{row}">
+          {{ row.AMOUNT | toThousandFilter }}
+        </template>
+      </el-table-column>
+      <el-table-column align="center" min-width="150px" :label="$t('finance.rechargeStatus')" prop="STATUS_NAME">
+        <template slot-scope="{row}">
+          <el-tag :type="row.AUDIT_STATUS | statusFilter">{{ row.STATUS_NAME }}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" min-width="180px" :label="$t('finance.bankName')" prop="OPEN_BANK_NAME" />
+      <el-table-column align="center" min-width="150px" :label="$t('finance.bankAccount')" prop="BANK_NO" />
+      <el-table-column align="center" min-width="150px" :label="$t('finance.printVoucher')">
+        <template slot-scope="{row}">
+          <el-button v-if="row.AUDIT_STATUS === '0'" type="primary" size="mini" @click="handleUpload(row.ID)">{{ $t('finance.uploadVoucher') }}</el-button>
+          <el-button v-if="row.AUDIT_STATUS !== '0'" type="success" size="mini" @click="handleView(row)">{{ $t('finance.viewVoucher') }}</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
 
-		<div class="white-box-footer" style="margin-top: 10px;">
-			<el-button size="small" type="primary" @click="dialog = true">{{ $t('finance.recharge') }}</el-button>
-			<pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
-		</div>
+    <div class="white-box-footer" style="margin-top: 10px;">
+      <el-button size="small" type="primary" @click="dialog = true">{{ $t('finance.recharge') }}</el-button>
+      <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
+    </div>
 
-		<el-dialog :title="$t('finance.recharge')" :visible.sync="dialog" :width="screenWidth" style="margin-top: -70px;">
-			<el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" v-loading="loading" style="margin-top: -20px; margin-bottom: -30px;">
-				<el-row :gutter="20">
-					<el-col :xs="24" :sm="24" :lg="24">
-						<el-form-item :label="$t('finance.rechargeAmount')" prop="applyAmount" required>
-							<el-input-number v-model.number="form.applyAmount" :min="minAmount" :max="maxAmount" :step="10000" style="width: 100%" clearable></el-input-number>
-						</el-form-item>
-						<el-form-item :label="$t('finance.bankAccount')" prop="bankNo" required>
-							<el-input v-model.trim="form.bankNo" type="text" clearable style="width: 100%"></el-input>
-						</el-form-item>
-						<el-form-item :label="$t('finance.bankName')" prop="openBank" required>
-							<el-select v-model="form.openBank" clearable filterable style="width: 100%">
-								<el-option v-for="(item,key) in bankList" :key="key" :label="item.BANK_NAME" :value="item.BANK_CODE"></el-option>
-							</el-select>
-						</el-form-item>
-						<el-form-item>
-							<el-button type="warning" size="small" @click="onCancel">{{ $t('table.cancel') }}</el-button>
-							<el-button type="primary" size="small" @click="onSubmit">{{ $t('table.confirm') }}</el-button>
-						</el-form-item>
-					</el-col>
-				</el-row>
-			</el-form>
-		</el-dialog>
+    <el-dialog :title="$t('finance.recharge')" :visible.sync="dialog" :width="screenWidth" style="margin-top: -70px;">
+      <el-form ref="form" v-loading="loading" :model="form" :rules="rules" :label-position="labelPosition" style="margin-top: -20px; margin-bottom: -30px;">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="24" :lg="24">
+            <el-form-item :label="$t('finance.rechargeAmount')" prop="applyAmount" required>
+              <el-input-number v-model.number="form.applyAmount" :min="minAmount" :max="maxAmount" :step="10000" style="width: 100%" clearable />
+            </el-form-item>
+            <el-form-item :label="$t('finance.bankAccount')" prop="bankNo" required>
+              <el-input v-model="form.bankNo" type="text" clearable style="width: 100%" />
+            </el-form-item>
+            <el-form-item :label="$t('finance.bankName')" prop="openBank" required>
+              <el-select v-model="form.openBank" clearable filterable style="width: 100%">
+                <el-option v-for="(item,key) in bankList" :key="key" :label="item.BANK_NAME" :value="item.BANK_CODE" />
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="warning" size="small" @click="onCancel">{{ $t('table.cancel') }}</el-button>
+              <el-button type="primary" size="small" @click="onSubmit">{{ $t('table.confirm') }}</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </el-dialog>
 
-		<el-dialog :title="$t('finance.viewVoucher')" :visible.sync="viewVoucher" :width="screenWidth" style="margin-top: -70px;">
-			<div>
-				<img :src="voucher" alt="" style="height: 100%; width: 100%;" />
-			</div>
-			<div slot="footer" class="dialog-footer">
-				<el-button size="small" type="primary" @click="uploadAgain(auditId)">{{ $t('finance.uploadVoucher') }}</el-button>
-				<el-button size="small" type="normal"  @click="viewVoucher = false">{{ $t('common.close') }}</el-button>
-			</div>
-		</el-dialog>
+    <el-dialog :title="$t('finance.viewVoucher')" :visible.sync="viewVoucher" :width="screenWidth" style="margin-top: -70px;">
+      <div>
+        <img :src="voucher" alt="" style="height: 100%; width: 100%;">
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="small" type="primary" @click="uploadAgain(auditId)">{{ $t('finance.uploadVoucher') }}</el-button>
+        <el-button size="small" type="normal" @click="viewVoucher = false">{{ $t('common.close') }}</el-button>
+      </div>
+    </el-dialog>
 
-		<el-dialog :title="$t('finance.uploadVoucher')" :visible.sync="uploadVoucher" :width="screenWidth" style="margin-top: -70px;">
-			<el-upload
-				class="avatar-uploader"
-				:action="uploadUrl"
-				:show-file-list="false"
-				:headers="uploaderHeaders"
-				:data="uploaderData"
-				:on-success="handleSuccess"
-				:before-upload="uploaderHandleBefore"
-				:on-error="handleError">
-				<img v-if="imageUrl" :src="imageUrl" class="avatar" alt="" />
-				<i v-else class="el-icon-plus avatar-uploader-icon"></i>
-			</el-upload>
-		</el-dialog>
-	</div>
+    <el-dialog :title="$t('finance.uploadVoucher')" :visible.sync="uploadVoucher" :width="screenWidth" style="margin-top: -70px;">
+      <el-upload
+        class="avatar-uploader"
+        :action="uploadUrl"
+        :show-file-list="false"
+        :headers="uploaderHeaders"
+        :data="uploaderData"
+        :on-success="handleSuccess"
+        :before-upload="uploaderHandleBefore"
+        :on-error="handleError"
+      >
+        <img v-if="imageUrl" :src="imageUrl" class="avatar" alt="">
+        <i v-else class="el-icon-plus avatar-uploader-icon" />
+      </el-upload>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-import {fetchApplyRecharge,fetchBankList, fetchRechargeList} from '@/api/finance'
-import {fetchToken} from "@/api/file"
+import { fetchApplyRecharge, fetchBankList, fetchRechargeList } from '@/api/finance'
+import { fetchToken } from '@/api/file'
 import waves from '@/directive/waves'
 import Pagination from '@/components/Pagination'
-import tool from "@/utils/tool"
-import {formatAmount, getScreenWidth} from "@/utils"
-import {integer, range, required} from "@/utils/rules"
-import LeoUploader from "@/components/Upload/Uploader"
+import tool from '@/utils/tool'
+import { formatAmount, getScreenWidth } from '@/utils'
+import { integer, range, required } from '@/utils/rules'
+import LeoUploader from '@/components/Upload/Uploader'
 
 export default {
-	name: 'RechargeDetails',
-	components: { Pagination,LeoUploader },
-	directives: { waves },
-	filters: {
-		statusFilter(status) {
-			const statusEnums = {
-				'0': 'info',
-				'1': 'primary',
-				'2': 'success',
-				'3': 'danger',
-			}
-			return statusEnums[status] || 'warning'
-		},
-	},
-	data() {
-		return {
-			tool: tool,
-			list: [],
-			total: 0,
-			listLoading: true,
-			listQuery: {
-				page: 1,
-				pageSize: 5,
-			},
+  name: 'RechargeDetails',
+  components: { Pagination, LeoUploader },
+  directives: { waves },
+  filters: {
+    statusFilter(status) {
+      const statusEnums = {
+        '0': 'info',
+        '1': 'primary',
+        '2': 'success',
+        '3': 'danger'
+      }
+      return statusEnums[status] || 'warning'
+    }
+  },
+  data() {
+    return {
+      tool: tool,
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 5
+      },
 
-			dialog: false,
-			loading: false,
-			form: {
-				applyAmount: 0,
-				bankNo: '',
-				openBank: '',
-				bankAddress: '',
-			},
-			minAmount: 1,
-			maxAmount: 10000000000,
-			rules: {
-				applyAmount: [required, integer, range(this.minAmount, this.maxAmount)],
-				bankNo: [{ required: true, message: this.$t('finance.bankAccount') + this.$t('common.require'), trigger: 'blur' }],
-				openBank: [{ required: true, message: this.$t('finance.bankName') + this.$t('common.require'), trigger: 'blur' }],
-			},
-			bankList: [],
+      dialog: false,
+      loading: false,
+      form: {
+        applyAmount: 0,
+        bankNo: '',
+        openBank: '',
+        bankAddress: ''
+      },
+      minAmount: 1,
+      maxAmount: 10000000000,
+      rules: {
+        applyAmount: [required, integer, range(this.minAmount, this.maxAmount)],
+        bankNo: [{ required: true, message: this.$t('finance.bankAccount') + this.$t('common.require'), trigger: 'blur' }],
+        openBank: [{ required: true, message: this.$t('finance.bankName') + this.$t('common.require'), trigger: 'blur' }]
+      },
+      bankList: [],
 
-			screenWidth: getScreenWidth() > 600 ? '500px' : getScreenWidth() + 'px',
-			labelPosition: getScreenWidth() > 600 ? 'right' : 'top',
+      screenWidth: getScreenWidth() > 600 ? '500px' : getScreenWidth() + 'px',
+      labelPosition: getScreenWidth() > 600 ? 'right' : 'top',
 
-			viewVoucher: false,
-			voucher: '',
-			auditId: null,
+      viewVoucher: false,
+      voucher: '',
+      auditId: null,
 
-			voucherLoading: false,
-			uploadVoucher: false,
-			imageUrl: '',
-			uploadUrl: '',
-			uploaderData: {
-				uploadToken: '',
-			},
-			uploaderHeaders: {
-				'Device-Type': 'pc',
-				'Suppress-Response-Code': '1',
-				'Authorization': '',
-			},
-		}
-	},
-	created() {
-		this.getList()
-	},
-	mounted() {
-		this.fetchBankList()
-	},
-	methods: {
-		getList() {
-			this.listLoading = true
-			fetchRechargeList(this.listQuery).then(response => {
-				this.list = response.data.list
-				this.total = response.data.totalCount
+      voucherLoading: false,
+      uploadVoucher: false,
+      imageUrl: '',
+      uploadUrl: '',
+      uploaderData: {
+        uploadToken: ''
+      },
+      uploaderHeaders: {
+        'Device-Type': 'pc',
+        'Suppress-Response-Code': '1',
+        'Authorization': ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  mounted() {
+    this.fetchBankList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      fetchRechargeList(this.listQuery).then(response => {
+        this.list = response.data.list
+        this.total = response.data.totalCount
 
-				setTimeout(() => {
-					this.listLoading = false
-				}, 0.5 * 1000)
-			})
-		},
-		fetchBankList() {
-			fetchBankList().then(response => {
-				this.bankList = response.data.allOpenBank
-			})
-		},
-		onSubmit() {
-			this.$refs['form'].validate((valid) => {
-				if (valid) {
-					this.loading = true
-					fetchApplyRecharge(this.form).then(response => {
-						this.$message({
-							message: response.data,
-							type: 'success',
-							duration: 1.5 * 1000
-						})
+        setTimeout(() => {
+          this.listLoading = false
+        }, 0.5 * 1000)
+      })
+    },
+    fetchBankList() {
+      fetchBankList().then(response => {
+        this.bankList = response.data.allOpenBank
+      })
+    },
+    onSubmit() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          this.loading = true
+          fetchApplyRecharge(this.form).then(response => {
+            this.$message({
+              message: response.data,
+              type: 'success',
+              duration: 1.5 * 1000
+            })
 
-						this.$refs['form'].resetFields()
-						this.dialog = false
-						this.loading = false
+            this.$refs['form'].resetFields()
+            this.dialog = false
+            this.loading = false
 
-						this.getList()
-					}).catch((err) => {
-						this.$message({
-							message: err,
-							type: 'error',
-							duration: 3 * 1000
-						})
+            this.getList()
+          }).catch((err) => {
+            this.$message({
+              message: err,
+              type: 'error',
+              duration: 3 * 1000
+            })
 
-						this.loading = false
-					})
-				} else {
-					return false;
-				}
-			});
-		},
-		onCancel() {
-			this.dialog = false
-			this.$refs['form'].resetFields()
-		},
-		handleView(row) {
-			this.voucher = tool.getArImage(row.BANK_PROVE, 'files/')
-			this.auditId = row.ID
-			this.viewVoucher = true
-		},
-		uploadAgain(id) {
-			this.viewVoucher = false
-			this.auditId = id
-			this.uploadUrl = `${process.env.VUE_APP_BASE_API}/v1/finance/prove-add?id=${this.auditId}`
-			this.uploadVoucher = true
-		},
-		handleUpload(id) {
-			setTimeout(() => {
-				this.auditId = id
-				this.uploadUrl = `${process.env.VUE_APP_BASE_API}/v1/finance/prove-add?id=${this.auditId}`
-				this.uploadVoucher = true
-			}, 0.5 * 1000)
-		},
-		async uploaderHandleBefore() {
-			this.$message({
-				message: this.$t('common.uploadHints'),
-				type: 'warning',
-				duration: 500,
-			})
+            this.loading = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    onCancel() {
+      this.dialog = false
+      this.$refs['form'].resetFields()
+    },
+    handleView(row) {
+      this.voucher = tool.getArImage(row.BANK_PROVE, 'files/')
+      this.auditId = row.ID
+      this.viewVoucher = true
+    },
+    uploadAgain(id) {
+      this.viewVoucher = false
+      this.auditId = id
+      this.uploadUrl = `${process.env.VUE_APP_BASE_API}/v1/finance/prove-add?id=${this.auditId}`
+      this.uploadVoucher = true
+    },
+    handleUpload(id) {
+      setTimeout(() => {
+        this.auditId = id
+        this.uploadUrl = `${process.env.VUE_APP_BASE_API}/v1/finance/prove-add?id=${this.auditId}`
+        this.uploadVoucher = true
+      }, 0.5 * 1000)
+    },
+    async uploaderHandleBefore() {
+      this.$message({
+        message: this.$t('common.uploadHints'),
+        type: 'warning',
+        duration: 500
+      })
 
-			await fetchToken().then(response => {
-				this.uploaderHeaders.Authorization = process.env.VUE_APP_ACCESS_TOKEN_PREFIX + response.data
-				this.uploaderData.uploadToken = response.data
-			})
-		},
-		handleSuccess(res, file) {
-			this.imageUrl = URL.createObjectURL(file.raw)
+      await fetchToken().then(response => {
+        this.uploaderHeaders.Authorization = process.env.VUE_APP_ACCESS_TOKEN_PREFIX + response.data
+        this.uploaderData.uploadToken = response.data
+      })
+    },
+    handleSuccess(res, file) {
+      this.imageUrl = URL.createObjectURL(file.raw)
 
-			setTimeout(() => {
-				this.uploadVoucher = false
-				this.getList()
-			}, 2 * 1000)
-		},
-		beforeUpload(file) {
-			const typeAllowed = ['image/jpeg', 'image/jpg', 'image/png']
-			const isLt2M = file.size / 1024 / 1024 < 2
-			if (!typeAllowed.includes(file.type)) {
-				this.$message.error('图片只能是 JPG/JPEG/PNG 格式!')
-				return false
-			}
-			if (!isLt2M) {
-				this.$message.error('图片大小不能超过 2MB!')
-				return false
-			}
+      setTimeout(() => {
+        this.uploadVoucher = false
+        this.getList()
+      }, 2 * 1000)
+    },
+    beforeUpload(file) {
+      const typeAllowed = ['image/jpeg', 'image/jpg', 'image/png']
+      const isLt2M = file.size / 1024 / 1024 < 2
+      if (!typeAllowed.includes(file.type)) {
+        this.$message.error('图片只能是 JPG/JPEG/PNG 格式!')
+        return false
+      }
+      if (!isLt2M) {
+        this.$message.error('图片大小不能超过 2MB!')
+        return false
+      }
 
-			return true
-		},
-		handleError(err, file) {
-			console.log(err, file)
-		},
-	}
+      return true
+    },
+    handleError(err, file) {
+      console.log(err, file)
+    }
+  }
 }
 </script>
 

+ 60 - 60
src/views/profile/components/Account.vue

@@ -1,27 +1,27 @@
 <template>
-	<el-card style="margin: 2px 1px;">
-		<div slot="header" class="clearfix">
-			<span>{{ $t('profile.personalInformation') }}</span>
-		</div>
+  <el-card style="margin: 2px 1px;">
+    <div slot="header" class="clearfix">
+      <span>{{ $t('profile.personalInformation') }}</span>
+    </div>
 
-		<el-form wi v-loading="loading">
-			<el-form-item :label="$t('shop.memberCode')">
-				<el-input size="medium" v-model.trim="user.name" prefix-icon="el-icon-user-solid" readonly />
-			</el-form-item>
-			<el-form-item :label="$t('shop.memberName')">
-				<el-input size="medium" v-model.trim="user.realName" prefix-icon="el-icon-user" readonly />
-			</el-form-item>
-			<el-form-item :label="$t('shop.phoneNumber')">
-				<el-input size="medium" v-model.trim="user.mobile" prefix-icon="el-icon-phone-outline" readonly />
-			</el-form-item>
-			<el-form-item :label="$t('user.email')">
-				<el-input size="medium" v-model.trim="user.email" prefix-icon="el-icon-s-comment" />
-			</el-form-item>
-			<el-form-item>
-				<el-button type="primary" size="small" @click="submit">{{ $t('common.save') }}</el-button>
-			</el-form-item>
-		</el-form>
-	</el-card>
+    <el-form v-loading="loading" wi>
+      <el-form-item :label="$t('shop.memberCode')">
+        <el-input v-model="user.name" size="medium" prefix-icon="el-icon-user-solid" readonly />
+      </el-form-item>
+      <el-form-item :label="$t('shop.memberName')">
+        <el-input v-model="user.realName" size="medium" prefix-icon="el-icon-user" readonly />
+      </el-form-item>
+      <el-form-item :label="$t('shop.phoneNumber')">
+        <el-input v-model.trim="user.mobile" size="medium" prefix-icon="el-icon-phone-outline" readonly />
+      </el-form-item>
+      <el-form-item :label="$t('user.email')">
+        <el-input v-model.trim="user.email" size="medium" prefix-icon="el-icon-s-comment" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" size="small" @click="submit">{{ $t('common.save') }}</el-button>
+      </el-form-item>
+    </el-form>
+  </el-card>
 </template>
 
 <script>
@@ -36,51 +36,51 @@ export default {
         return {
           name: '',
           email: '',
-					mobile: '',
-					realName: '',
+          mobile: '',
+          realName: ''
         }
       }
     }
   },
-	data() {
-		return {
-			loading: false,
-		}
-	},
+  data() {
+    return {
+      loading: false
+    }
+  },
   methods: {
     submit() {
-			const data = {
-				bankNo: '1',
-				bankAddress: '1',
-				email: this.user.email,
-				mobile: this.user.mobile,
-				nation: '',
-				openBank: '',
-				realName: this.user.realName,
-			}
+      const data = {
+        bankNo: '1',
+        bankAddress: '1',
+        email: this.user.email,
+        mobile: this.user.mobile,
+        nation: '',
+        openBank: '',
+        realName: this.user.realName
+      }
 
-			this.loading = true
-			updateInfo(data).then(() => {
-				setTimeout(() => {
-					this.loading = false
-				}, 1.5 * 1000)
-				this.$message({
-					message: 'User information has been updated successfully.',
-					type: 'success',
-					duration: 5 * 1000
-				})
-				// 覆盖localStorage
-				usersInfo.userEmail(this.user.email)
-				// 页面重载
-				location.reload()
-			}).catch((err) => {
-				this.$message({
-					message: err,
-					type: 'error',
-					duration: 5 * 1000
-				})
-				this.loading = false
-			})
+      this.loading = true
+      updateInfo(data).then(() => {
+        setTimeout(() => {
+          this.loading = false
+        }, 1.5 * 1000)
+        this.$message({
+          message: 'User information has been updated successfully.',
+          type: 'success',
+          duration: 5 * 1000
+        })
+        // 覆盖localStorage
+        usersInfo.userEmail(this.user.email)
+        // 页面重载
+        location.reload()
+      }).catch((err) => {
+        this.$message({
+          message: err,
+          type: 'error',
+          duration: 5 * 1000
+        })
+        this.loading = false
+      })
     }
   }
 }

+ 5 - 5
src/views/shop/reconsume.vue

@@ -113,14 +113,14 @@
                   <el-col :xs="24" :sm="24" :lg="15">
                     <span>{{ $t('shop.reconsumeUserCode') }}</span>
                   </el-col>
-                  <el-input v-model.trim="newOrder.userName" @change="handleChkRecUser" />
+                  <el-input v-model="newOrder.userName" @change="handleChkRecUser" />
                   <span style="margin-left: 10px">【{{ newOrder.recRealName }}】</span>
                 </el-form-item>
                 <el-form-item>
                   <el-col :xs="24" :sm="24" :lg="15">
                     <span>{{ $t('shop.recipientName') }}</span>
                   </el-col>
-                  <el-input v-model.trim="newOrder.consignee" />
+                  <el-input v-model="newOrder.consignee" />
                 </el-form-item>
                 <el-form-item>
                   <el-col :xs="24" :sm="24" :lg="15">
@@ -138,19 +138,19 @@
                   <el-col :xs="24" :sm="24" :lg="15">
                     <span>{{ $t('shop.lgaName') }}</span>
                   </el-col>
-                  <el-input v-model.trim="newOrder.lgaName" />
+                  <el-input v-model="newOrder.lgaName" />
                 </el-form-item>
                 <el-form-item>
                   <el-col :xs="24" :sm="24" :lg="15">
                     <span>{{ $t('shop.cityName') }}</span>
                   </el-col>
-                  <el-input v-model.trim="newOrder.cityName" />
+                  <el-input v-model="newOrder.cityName" />
                 </el-form-item>
                 <el-form-item>
                   <el-col :xs="24" :sm="24" :lg="15">
                     <span>{{ $t('shop.address') }}</span>
                   </el-col>
-                  <el-input v-model.trim="newOrder.address" />
+                  <el-input v-model="newOrder.address" />
                 </el-form-item>
 
               </el-form>