提交 c0790075 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 355309ac
......@@ -10,7 +10,7 @@
src="https://webapp-pub.ezijing.com/highway/h5/form_minus.png"
class="btn_minus"
@click="handleMinus(formIndex)"
v-if="formIndex !== 0"
v-if="!isRemoveInfo(listIt)"
/>
<div class="formItemList_item" v-for="(item, index) in listIt" :key="index">
<!-- 输入框 -->
......@@ -24,7 +24,7 @@
:rules="[{ required: item.required, message: item.placeholder }]"
clearable
:border="true"
:disabled="formIndex === 0 && (item.key === 'mobile' || item.key === 'name')"
:disabled="!item.enable_edit"
/>
<div class="line"></div>
</div>
......@@ -143,6 +143,9 @@ export default {
},
mounted() {},
methods: {
isRemoveInfo(item) {
return !!item.find(f => f.enable_edit === false)
},
// 提交
onSubmit() {
console.log(this.data, '123')
......@@ -174,8 +177,12 @@ export default {
this.$emit('next', res.data)
}
} else {
console.log(res.data, 'rers')
this.$emit('next', res.data)
if (this.stepList[this.stepList.length - 1].num === this.data.num) {
// 完成步骤跳转
this.$router.push({ path: '/' })
} else {
this.$emit('next', res.data)
}
}
this.checkedPay = false
}
......@@ -190,6 +197,7 @@ export default {
const baseUserFields = this.data.user_fields[0].map(item => {
const copyItem = Object.assign({}, item)
copyItem.value = ''
copyItem.enable_edit = true
return copyItem
})
this.data.user_fields.push(baseUserFields)
......
......@@ -98,12 +98,18 @@ export default {
}
},
handlePay(item) {
console.log(item, 'item')
const payRecord = item.list[0].pay_record
const stepDetails = item.activity.details.find(d => d.id === payRecord.activity_detail_id)
stepDetails.list = item.list.map((list, index) => {
list.mobile === JSON.parse(window.localStorage.userInfo).mobile ? list.index = 0 : list.index = index + 1
return list
}).sort((a, b) => a.index - b.index)
delete item.activity.details
stepDetails.activityInfo = item.activity
stepDetails.join_rand = item.join_rand
window.localStorage.orderStepDetails = JSON.stringify([stepDetails])
this.$router.push({
path: '/SignMainPage',
query: {
id: item.activity.id
}
path: '/SignMainPage'
})
}
}
......
......@@ -43,6 +43,7 @@ export default {
components: { SignForm, ImgShow, OrderConfirm },
data() {
return {
userMobile: '',
title: '报名主页面',
stepIndex: 0,
isShowSkip: '',
......@@ -59,8 +60,12 @@ export default {
}
},
mounted() {
this.activity_detail_id = this.$route.query.activity_detail_id
this.getActivityDetail()
this.userMobile = JSON.parse(window.localStorage.userInfo).mobile
if (this.$route.query.id) {
this.getActivityDetail()
} else {
this.setData(JSON.parse(window.localStorage.orderStepDetails))
}
},
methods: {
// 获取活动详情
......@@ -106,10 +111,10 @@ export default {
// 判断有没有返回人员 没返回吧自己的信息push进去
if (data[fields].list.length) {
// list有可能不会返回自己的信息,不返回push进去
const findOwn = data[fields].list.find(info => info.mobile === data.info.mobile)
if (!findOwn) {
data[fields].list.push(data.info)
}
// const findOwn = data[fields].list.find(info => info.mobile === data.info.mobile)
// if (!findOwn) {
// data[fields].list.push(data.info)
// }
// 添加index用于用户排序
item.list = data[fields].list.map((item, index) => {
item.mobile === data.info.mobile ? (item.index = 0) : (item.index = index + 1)
......@@ -139,7 +144,7 @@ export default {
})
},
setData(data) {
// console.log(data, 'datas')
console.log(data, 'datas')
// 处理数据
this.stepList = data.reduce((a, b) => {
// type: 1 是展示不用处理
......@@ -163,8 +168,15 @@ export default {
allFormList.find(f => f.key === dd.key)
)
fData.value = d[dd.key]
// 判断当前form信息是不是登录人的 是的话给个标记(作为后面表单填写不可编辑的标识)
if (fData.key === 'mobile') {
if (fData.value === this.userMobile) {
fData.enable_edit = false
}
}
fields.push(fData)
})
// console.log(fields.find(f => !f.enable_edit), 'fields')
userFieldsStore.push(fields)
})
b.user_fields = userFieldsStore
......@@ -200,7 +212,7 @@ export default {
}
},
handleNext(data) {
if (this.setpItem.num !== this.stepList) {
if (this.setpItem.num !== this.stepList.length) {
this.stepIndex++
if (data) {
this.setpItem.payData = data
......
......@@ -40,6 +40,7 @@ const store = new Vuex.Store({
const isLogin = await getUser()
.then(response => {
if (response.code === 0) {
window.localStorage.userInfo = JSON.stringify(response.data)
commit('setUser', response.data)
return true
} else {
......
......@@ -15,6 +15,7 @@ const allFormList = [
key: 'gender',
required: true,
value: '0',
enable_edit: true,
optionList: [
{ id: '0', option: '未知' },
{ id: '1', option: '男' },
......@@ -140,7 +141,8 @@ const allFormList = [
value: '',
required: true,
optionList: ['有', '无'],
showPicker: false
showPicker: false,
enable_edit: true
},
{
type: 'select',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论