瀏覽代碼

更新

体验版取消邀请码机制
RegMs If 4 年之前
父節點
當前提交
de7dd232ca

+ 27 - 27
cloudfunctions/createPublisher/index.js

@@ -10,23 +10,23 @@ exports.main = async (event, context) => {
     OPENID
   } = cloud.getWXContext()
 
-  const code_check = await db.collection('invite')
-    .where({
-      code: event.code
-    })
-    .get()
-  if (code_check.data.length === 0) {
-    return {
-      errMsg: '邀请码不存在',
-      status: 'ERR'
-    }
-  }
-  if (code_check.data[0].pub_id !== '') {
-    return {
-      errMsg: '邀请码已被使用',
-      status: 'ERR'
-    }
-  }
+  // const code_check = await db.collection('invite')
+  //   .where({
+  //     code: event.code
+  //   })
+  //   .get()
+  // if (code_check.data.length === 0) {
+  //   return {
+  //     errMsg: '邀请码不存在',
+  //     status: 'ERR'
+  //   }
+  // }
+  // if (code_check.data[0].pub_id !== '') {
+  //   return {
+  //     errMsg: '邀请码已被使用',
+  //     status: 'ERR'
+  //   }
+  // }
 
   const name_check = await db.collection('publisher')
     .where({
@@ -56,16 +56,16 @@ exports.main = async (event, context) => {
       }
     })
 
-  await db.collection('invite')
-    .where({
-      code: event.code
-    })
-    .update({
-      data: {
-        pub_id: publisher._id,
-        use_time: new Date()
-      }
-    })
+  // await db.collection('invite')
+  //   .where({
+  //     code: event.code
+  //   })
+  //   .update({
+  //     data: {
+  //       pub_id: publisher._id,
+  //       use_time: new Date()
+  //     }
+  //   })
 
   await db.collection('manager')
     .add({

+ 2 - 1
miniprogram/pages/publisherLogin/publisherLogin.js

@@ -50,7 +50,8 @@ Page({
       value.level = '校级'
     }
 
-    if (value.code === '' || value.name === '' || value.level === '' || value.intro === '' || value.avatar.length === 0) {
+    // if (value.code === '' || value.name === '' || value.level === '' || value.intro === '' || value.avatar.length === 0) {
+    if (value.name === '' || value.level === '' || value.intro === '' || value.avatar.length === 0) {
       wx.showToast({
         title: '请确认信息填写完整',
         icon: 'none'

+ 3 - 3
miniprogram/pages/publisherLogin/publisherLogin.wxml

@@ -38,7 +38,7 @@
   <form bindsubmit="switch5">
     <view class="block" style="margin-bottom: 20rpx;">
       <view class="cate">邀请码<span style="color: #FF0000">*</span></view>
-      <input class="input" placeholder="请填写" name="code" />
+      <input class="input" placeholder="请填写(体验版可不填)" name="code" />
     </view>
     <view class="block">
       <view class="cate">组织名称<span style="color: #FF0000">*</span></view>
@@ -85,7 +85,7 @@
   <form bindsubmit="switch5">
     <view class="block" style="margin-bottom: 20rpx;">
       <view class="cate">邀请码<span style="color: #FF0000">*</span></view>
-      <input class="input" placeholder="请填写" name="code" />
+      <input class="input" placeholder="请填写(体验版可不填)" name="code" />
     </view>
     <view class="block">
       <view class="cate">社团名称<span style="color: #FF0000">*</span></view>
@@ -132,7 +132,7 @@
   <form bindsubmit="switch5">
     <view class="block" style="margin-bottom: 20rpx;">
       <view class="cate">邀请码<span style="color: #FF0000">*</span></view>
-      <input class="input" placeholder="请填写" name="code" />
+      <input class="input" placeholder="请填写(体验版可不填)" name="code" />
     </view>
     <view class="block">
       <view class="cate">部门名称<span style="color: #FF0000">*</span></view>