Просмотр исходного кода

义工时长所有活动都显示;bug修复

htc 1 день назад
Родитель
Сommit
c0a1ae5042

+ 46 - 82
src/views/modules/activity/add.vue

@@ -172,7 +172,7 @@
                   <el-form-item label="爱心值对应内容" v-if="moreForm.activityLimit==1">
                     <el-input v-model="moreForm.loveValueContent" style="width: 820px;" placeholder="请输入"></el-input>
                   </el-form-item>
-                  <el-form-item label="可获得义工时长"  prop="volunteerHours" v-if="basicForm.typeId==='1977564860095348737'">
+                  <el-form-item label="可获得义工时长"  prop="volunteerHours">
                     <div class="adfac">
                       <el-input min="1" type="number" v-model="moreForm.volunteerHours" style="width: 391px;" placeholder="请输入"></el-input>
                       <div class="f-text2">小时</div>
@@ -223,6 +223,47 @@ import moment from 'moment'
 import Cookies from 'js-cookie'
 import editorVue from '@/components/editor'
 import mixinRegionModule from '@/mixins/region-module.js'
+const getInitialBasicForm = () => ({
+  id: '',
+  typeId: '',
+  categoryId: '',
+  activityName: '',
+  signupStartEnd: [],
+  signupStartTime: '',
+  signupEndTime: '',
+  activityStartEnd: [],
+  activityStartTime: '',
+  activityEndTime: '',
+  provinceId: '',
+  cityId: '',
+  districtId: '',
+  address: '',
+  channelId: '',
+  organizerId: '',
+  coverFile: '',
+  imageFiles: '',
+  activityDetails: ''
+})
+const getInitialMoreForm = () => ({
+  joinMode: '',
+  recruitmentFlag: 1,
+  recruitmentMax: '',
+  recruitmentMin: '',
+  userLevelFlag: 1,
+  userLevel: 1,
+  userAgeFlag: 1,
+  userAgeMin: '',
+  userAgeMax: '',
+  activityLimit: 1,
+  valueLimit: '',
+  loveValueContent: '',
+  volunteerHours: 0,
+  timesLimit: '',
+  contact: '',
+  contactPhone: '',
+  state: false
+})
+
 export default {
   components: { editorVue },
   mixins: [mixinRegionModule],
@@ -242,27 +283,7 @@ export default {
       channelOptions: [],
       organizerOptions: [],
       tidx: 1,
-      basicForm: {
-        id: '',
-        typeId: '',
-        categoryId: '',
-        activityName: '',
-        signupStartEnd: [],
-        signupStartTime: '',
-        signupEndTime: '',
-        activityStartEnd: [],
-        activityStartTime: '',
-        activityEndTime: '',
-        provinceId: '',
-        cityId: '',
-        districtId: '',
-        address: '',
-        channelId: '',
-        organizerId: '',
-        coverFile: '',
-        imageFiles: '',
-        activityDetails: ''
-      },
+      basicForm: getInitialBasicForm(),
       activityDetailsTemp: '',
       basicRules: {
         typeId: [
@@ -299,25 +320,7 @@ export default {
       url: `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`,
       fileListCover: [],
       fileListBanner: [],
-      moreForm: {
-        joinMode: '',
-        recruitmentFlag: 1,
-        recruitmentMax: '',
-        recruitmentMin: '',
-        userLevelFlag: 1,
-        userLevel: 1,
-        userAgeFlag: 1,
-        userAgeMin: '',
-        userAgeMax: '',
-        activityLimit: 1,
-        valueLimit: '',
-        loveValueContent: '',
-        volunteerHours: 0,
-        timesLimit: '',
-        contact: '',
-        contactPhone: '',
-        state: false
-      },
+      moreForm: getInitialMoreForm(),
       moreForm2: {
         joinMode: ''
       },
@@ -524,47 +527,8 @@ export default {
       this.basicForm.imageFiles = this.fileListBanner.map(item => item.url).join(',')
     },
     handleBack () {
-      this.basicForm = {
-        id: '',
-        typeId: '',
-        categoryId: '',
-        activityName: '',
-        signupStartEnd: [],
-        signupStartTime: '',
-        signupEndTime: '',
-        activityStartEnd: [],
-        activityStartTime: '',
-        activityEndTime: '',
-        provinceId: '',
-        cityId: '',
-        districtId: '',
-        address: '',
-        channelId: '',
-        organizerId: '',
-        coverFile: '',
-        imageFiles: '',
-        activityDetails: ''
-      }
-      if (this.$refs.basicRef) this.$refs.basicRef.resetFields()
-      this.moreForm = {
-        joinMode: '',
-        recruitmentFlag: 1,
-        recruitmentMax: '',
-        recruitmentMin: '',
-        userLevelFlag: 1,
-        userLevel: 1,
-        userAgeFlag: 1,
-        userAgeMin: '',
-        userAgeMax: '',
-        activityLimit: 1,
-        valueLimit: '',
-        loveValueContent: '',
-        timesLimit: '',
-        contact: '',
-        contactPhone: '',
-        state: false
-      }
-      if (this.$refs.moreRef) this.$refs.moreRef.resetFields()
+      this.basicForm = getInitialBasicForm()
+      this.moreForm = getInitialMoreForm()
       this.tidx = 1
       this.$router.push('/activity-list')
     },

+ 1 - 1
src/views/modules/activity/detail.vue

@@ -93,7 +93,7 @@
                   <el-form-item label="爱心值对应内容" v-if="moreForm.activityLimit==1">
                     <div class="f-text adfac" style="height: 40px; margin-left: 0;">{{ moreForm.loveValueContent||'' }}</div>
                   </el-form-item>
-                  <el-form-item label="可获得义工时长"  prop="volunteerHours" v-if="basicForm.typeId==='1977564860095348737'">
+                  <el-form-item label="可获得义工时长"  prop="volunteerHours">
                     <div class="f-text adfac" style="height: 40px; margin-left: 0;">{{ moreForm.volunteerHours||0 }}小时</div>
                   </el-form-item>
                   <el-form-item label="报名次数限制">

+ 2 - 2
src/views/modules/member/detail.vue

@@ -236,12 +236,12 @@ export default {
     getDetail () {
       this.$http.get('/core/app/user/' + this.$route.query.id).then(({ data: res }) => {
         if (res.code !== 0) return this.$message.error(res.msg)
-        this.form = res.data
+        this.form = JSON.parse(JSON.stringify(res.data))
         this.form.totalInvoicedAmount = res.data.totalInvoicedAmount || 0
         this.form.welfareCount = res.data.welfareCount || 0
         this.form.userLevel = res.data.userLevel || 1
 
-        this.userInfo = res.data
+        this.userInfo = JSON.parse(JSON.stringify(res.data))
         this.userInfo.phoneCopy = this.userInfo.phone && this.userInfo.phone.replace(/(\d{3})\d*(\d{4})/, '$1****$2')
         this.userInfo.idCardCopy = this.userInfo.idCard && this.userInfo.idCard.replace(/^(\d{6})\d{8}(\w{4})$/, '$1********$2')
         this.userInfo.genderText = this.genderCfg[this.userInfo.gender]