Browse Source

feat: 添加渠道邀请码和设计师会员号的占位符提示

EvilDragon 3 months ago
parent
commit
b5db66bc3a
1 changed files with 13 additions and 0 deletions
  1. 13 0
      packages/app/src/pages/mine/authentication/index.vue

+ 13 - 0
packages/app/src/pages/mine/authentication/index.vue

@@ -100,6 +100,10 @@ const setReferrerExisting = (value: string) => {
     schema.value.referrer.existing = false
   } else {
     schema.value.referrer.existing = true
+    schema.value.referrer.props.placeholder = {
+      '1': '请填写渠道邀请码',
+      '2': '请填写设计师会员号',
+    }[value]
   }
 }
 const handleSubmit = async () => {
@@ -128,6 +132,15 @@ const handleSubmit = async () => {
       error(msg)
     }
   } else {
+    if (formData.value.channelSource !== '4') {
+      const { data, code: status } = await requestToast(() =>
+        validateReferrerCode({ code: formData.value.referrer }),
+      )
+      if (data === false || status !== 0) {
+        uni.showToast({ title: '推荐人编号不正确', icon: 'none' })
+        return
+      }
+    }
     const toBeUpdate = {
       ...omit(formData.value, ['spatialExpertiseType']),
       spatialExpertiseType: formData.value.spatialExpertiseType.join(','),