lrf402788946 hace 4 años
padre
commit
49ba2b9b46
Se han modificado 3 ficheros con 14 adiciones y 4 borrados
  1. 1 1
      src/router/index.js
  2. 1 0
      src/views/error.vue
  3. 12 3
      src/views/followbind.vue

+ 1 - 1
src/router/index.js

@@ -31,7 +31,7 @@ const routes = [
     path: '/error',
     name: '',
     meta: { title: '绑定授权', isleftarrow: false },
-    component: () => import('../views/error.vue'),
+    component: () => import('../views/followbind.vue'),
   },
   // 直播大厅
   {

+ 1 - 0
src/views/error.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="error">
+    <!-- 此页面没用 -->
     <el-row>
       <el-col :span="24" class="style">
         <el-image :src="error" class="image"></el-image>

+ 12 - 3
src/views/followbind.vue

@@ -6,7 +6,8 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <el-input v-model="phone"></el-input>
+          <el-input v-model="info.phone"></el-input>
+          <el-input v-model="info.passwd" password></el-input>
           <el-button @click="bindBtn()" type="primary">确认绑定</el-button>
         </el-col>
       </el-col>
@@ -45,8 +46,16 @@ export default {
     },
   },
   methods: {
-    bindBtn() {
-      console.log(this.phone);
+    ...authUser(['create']),
+    async bindBtn() {
+      let obj = { ...JSON.parse(JSON.stringify(this.info)), role: '4', openid: this.openid };
+      let res = await this.create(obj);
+      if (res.errcode == '0') {
+        this.$message.success('注册成功');
+        WeixinJSBridge.call('closeWindow');
+      } else {
+        this.$message.error(res.errmsg);
+      }
     },
   },
   mounted() {