- + 开通会员 添加更多名片 @@ -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 + From 46a59484635ae0e9c3752c01d646de430325246b Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 9 Apr 2025 15:52:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/business/member.js | 15 ++++- pages/mine/mine-index.vue | 13 ++-- pages/mine/set/my-info.vue | 119 +++++++++++++++++++++++++++---------- 3 files changed, 105 insertions(+), 42 deletions(-) diff --git a/api/business/member.js b/api/business/member.js index 3501a95..bb1988d 100644 --- a/api/business/member.js +++ b/api/business/member.js @@ -3,10 +3,19 @@ import request from '@/utils/request' //------------------博主、通告主----------------------- //查询博主详情 -export function bloggerDetail(userId) { +export function queryDetail(params) { return request({ - url: '/member/member/bloggerDetail/' + userId, - method: 'get' + url: '/member/member/queryDetail', + method: 'get', + params:params + }) +} +//保存博主 +export function uniSaveMember(data) { + return request({ + url: '/member/member/uniSaveMember', + method: 'post', + data:data }) } diff --git a/pages/mine/mine-index.vue b/pages/mine/mine-index.vue index 97f5c4e..2ce0a52 100644 --- a/pages/mine/mine-index.vue +++ b/pages/mine/mine-index.vue @@ -182,7 +182,7 @@ getStrData } from '@/utils/auth.js' import { - bloggerDetail + queryDetail } from '@/api/business/member.js' export default { props: { @@ -215,7 +215,6 @@ popupImgUrl: "", } }, - mounted() {}, onShow() { }, @@ -225,7 +224,7 @@ mounted() { if (null != getJSONData(constant.userInfo)) { this.userInfo = getJSONData(constant.userInfo) - this.getBloggerDetail() + this.getDetail() } }, computed: { @@ -240,11 +239,12 @@ // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 this.$refs.popup.open(type) }, - getBloggerDetail() { - bloggerDetail(this.userInfo.userId).then(res => { + getDetail() { + queryDetail({userId:this.userInfo.userId,userType:this.localUserType}).then(res => { this.userInfo.tfansNum = res.data.tfansNum.toString() this.userInfo.pointsBalance = res.data.pointsBalance.toString() this.userInfo.report = res.data.report.toString() + this.userInfo.avatar = this.imageUrl+res.data.avatar }) }, /** @@ -254,6 +254,7 @@ changeUserType(type) this.localUserType = type this.$emit('update:nowUserType', this.localUserType) + this.getDetail() this.$forceUpdate() }, handleToInfo() { @@ -284,7 +285,7 @@ * 跳转编辑页 */ goEdit() { - this.$tab.navigateTo('/pages/mine/set/my-info') + this.$tab.navigateTo('/pages/mine/set/my-info?userType='+this.localUserType+'&userId='+this.userInfo.userId) }, viewNewPeople() { this.$tab.navigateTo( diff --git a/pages/mine/set/my-info.vue b/pages/mine/set/my-info.vue index 9b979d5..49d2a2f 100644 --- a/pages/mine/set/my-info.vue +++ b/pages/mine/set/my-info.vue @@ -5,7 +5,7 @@ - + @@ -18,15 +18,15 @@ - + - - + + - - + + @@ -38,17 +38,25 @@