- + 开通会员 添加更多名片 @@ -23,7 +24,7 @@ - + 添加更多名片 @@ -36,23 +37,23 @@ - - 小红书博主 + + {{item.platformName+'博主'}} - 小王同学 + {{item.accountName}} - 粉丝 {{ formatNumberWithUnits(100000) }} + 粉丝 {{ formatNumberWithUnits(item.fansNum) }} - + 切换 @@ -65,12 +66,10 @@ 注意:为了您的信息安全,平台不建议填写您的银行卡号、身份证号、密码等隐私信息。 - - - - - - + + + @@ -78,21 +77,21 @@ - - - + + + - + 收件地址 - 中国 山东省 济南市 历城区 - 财富中心1007A - 朱春运 - 17862909999 + {{userAddr.cityName}} + {{userAddr.detail}} + {{userAddr.name}} + {{userAddr.tel}} 切换 @@ -116,22 +115,69 @@ formatNumberWithUnits } from '@/utils/common.js' import navigationBarVue from '@/components/navigation/navigationBar.vue'; + import { + getSignCard + } from '@/api/business/signCard.js' + import { + getNoticeDetail + } from '@/api/business/notice'; + import { + hasRights + } from '@/utils/common.js' + import rightsCode from '@/utils/rightsCode.js' + import { + getUserAddress + } from '@/api/business/member.js' export default { components: { navigationBarVue }, data() { return { - //使用的会员卡数组 - cardList: ['', ''], - // 基础表单数据 - baseFormData: { - name: '', - age: '' + signRules: { + // 对联系方式字段进行必填验证 + tel: { + // tel 字段的校验规则 + rules: [ + // 校验 tel 不能为空 + { + required: true, + errorMessage: '请填写联系方式', + } + ] + } }, + noticeId: null, + //使用的会员卡数组 + cardList: [], + // 基础表单数据 // 联系方式表单 - telFormData: { - tel: "" + signFormData: { + tel: null, + customForm: [] + }, + //通告详情 + noticeDetail: { + id: "", + title: "", + endDate: null, + feeDown: null, + feeUp: null, + needNum: null, + userId: null, + brand: null, + fansDown: null, + fansUp: null, + city: null, + bloggerTypes: null, + updateTime: null, + approvalStatus: '0', + viewNum: 0, + detail: null, + platformCode: "", + platformName: "", + //通告产品图 + imageArray: [] }, // 校验规则 rules: { @@ -151,9 +197,47 @@ }] } }, + rightInfo: { + manyCardReport: false, + superReport: false + }, + userAddr: null } }, + onShow() { + this.getRightsCode() + }, + onLoad(params) { + this.noticeId = params.noticeId + if (this.noticeId) { + this.getDetail() + } + this.getCard() + this.userAddress() + let that = this + uni.$on('updateCard', function(data) { + that.updateCard(data) + }) + + }, methods: { + userAddress() { + getUserAddress().then(res => { + if (res.data && res.data.length > 0) { + this.userAddr = res.data[0] + } + }) + }, + updateCard(data) { + console.log(data, 211); + this.cardList = data + }, + /** + * 跳转名片列表 + */ + goMyCard() { + this.$tab.navigateTo('/pages/mine/card/my-card?ifChoose=true¬iceId=' + this.noticeId) + }, /** * 数值单位转换 * @param {Object} number @@ -161,8 +245,66 @@ formatNumberWithUnits(number) { return formatNumberWithUnits(number) }, + getRightsCode() { + let info = hasRights(rightsCode.manyCardReport) + if (!info) { + this.rightInfo.manyCardReport = false + } else { + this.rightInfo.manyCardReport = true + } + }, + goSignCard() { + this.$tab.navigateTo('/pages/mine/card/my-card') + }, + goMemberCard() { + this.$tab.navigateTo('/pages/mine/member/member-card') + }, + getDetail() { + getNoticeDetail({ + noticeId: this.noticeId + }).then(res => { + if (res.code == 200) { + this.noticeDetail = res.data.noticeDetail + if (this.noticeDetail.customForm.length > 0) { + this.noticeDetail.customForm.forEach(it => { + this.signFormData.customForm.push({ + label: it, + value: '' + }) + }) + } + } + console.log(this.signFormData, 269); + }).catch((e) => { + this.isTriggered = false + uni.showToast({ + icon: 'error', + duration: 2000, + title: e + }); + }) + }, + /** + * 报名 + */ + getCard() { + getSignCard({ + noticeId: this.noticeId + }).then(res => { + if (this.cardList.length == 0) { + this.cardList.push(res.data.list[0]) + } + + }).catch((e) => { + uni.showToast({ + icon: 'error', + duration: 2000, + title: e + }); + }) + }, submit() { - this.$refs.baseForm.validate().then(res => { + this.$refs.signForm.validate().then(res => { console.log('success', res); uni.showToast({ title: `校验通过` @@ -613,4 +755,4 @@ } } } - \ No newline at end of file +