Prechádzať zdrojové kódy

Merge branch 'master' of http://git.cc-lotus.info/service-platform/mobile-official

wuhongyu 4 rokov pred
rodič
commit
4e0376c217

+ 1 - 1
.env

@@ -1,2 +1,2 @@
 VUE_APP_AXIOS_BASE_URL = ''
-VUE_APP_ROUTER="/www"
+VUE_APP_ROUTER="/platmobile"

+ 0 - 1
.gitignore

@@ -1,6 +1,5 @@
 .DS_Store
 node_modules
-/dist
 
 # local env files
 .env.local

+ 9 - 2
src/router/index.js

@@ -5,6 +5,13 @@ import store from '@/store/index';
 Vue.use(VueRouter);
 
 const routes = [
+  // 绑定
+  {
+    path: '/bind',
+    name: 'bind',
+    meta: { title: '绑定', isleftarrow: false },
+    component: () => import('../views/bind.vue'),
+  },
   // 首页
   {
     path: '/home/index',
@@ -14,10 +21,10 @@ const routes = [
   },
   // 错误
   {
-    path: '/home/error',
+    path: '/error',
     name: '',
     meta: { title: '错误页面', isleftarrow: false },
-    component: () => import('../views/home/error.vue'),
+    component: () => import('../views/error.vue'),
   },
   // 直播大厅
   {

+ 5 - 0
src/store/user/auth-user.js

@@ -6,6 +6,7 @@ Vue.use(Vuex);
 const api = {
   interface: `/api/auth/user`,
   getMenu: `/api/auth/user/menus`,
+  bindInfo: `/api/auth/user/bind`,
 };
 const state = () => ({});
 const mutations = {};
@@ -34,6 +35,10 @@ const actions = {
     const res = await this.$axios.$delete(`${api.interface}/${payload}`);
     return res;
   },
+  async bind({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.bindInfo}`, payload);
+    return res;
+  },
 };
 
 export default {

+ 0 - 5
src/views/adminCenter/user/detail.vue

@@ -54,10 +54,7 @@ export default {
     async searchInfo() {
       if (this.role == '2' || this.role == '3' || this.role == '7') {
         let res = await this.fetch(this.id);
-        console.log(res.data);
-
         if (res.errcode === 0) {
-          console.log(res.data);
           this.$set(this, `form`, res.data);
         }
       } else if (this.role == '6') {
@@ -71,8 +68,6 @@ export default {
       if (data.role == '2' || data.role == '3' || data.role == '7') {
         let res;
         let msg;
-        console.log(data);
-
         if (data.id) {
           res = await this.update(data);
           this.$message({

+ 16 - 13
src/views/adminCenter/user/parts/userlist.vue

@@ -2,19 +2,21 @@
   <div id="auditList">
     <el-row>
       <el-col :span="24" class="info">
-        <el-col class="newuser"><van-button type="info" size="small" @click="usersubmit()">新建用户</van-button> </el-col>
+        <el-col :span="24" class="newuser"><van-button type="info" size="small" @click="usersubmit()">新建用户</van-button> </el-col>
         <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
           <p class="textOver">
-            <span>{{ item.name }}</span>
-            <span style="float:right"><van-button type="info" size="small" @click="submit(item)">审核</van-button> </span>
-            <span style="float:right"> <van-button type="info" size="small" @click="toDelete(item)">删除用户</van-button></span>
+            <span class="textOver">{{ item.name }}</span>
+            <span style="float:right"> <van-button type="danger" size="small" @click="toDelete(item)">删除</van-button></span>
+            <span style="float:right"
+              ><van-button type="info" size="small" @click="submit(item)">{{
+                item.status == '0' ? '审核' : item.status == '1' ? '查看' : '未识别'
+              }}</van-button>
+            </span>
           </p>
           <p>
-            <span class="ptwo"
-              ><span>电话:{{ item.phone || '暂无' }}</span></span
-            >
-            <span class="ptwo"
-              ><span>用户类型:</span>{{ item.role == '2' ? '个人用户' : item.role == '3' ? '企业用户' : item.role == '6' ? '专家用户' : '临时用户' }}</span
+            <span class="ptwo"><span>电话:</span>{{ item.phone || '暂无' }}</span>
+            <span class="ptwo">
+              <span>用户类型:</span>{{ item.role == '2' ? '个人用户' : item.role == '3' ? '企业用户' : item.role == '6' ? '专家用户' : '临时用户' }}</span
             >
           </p>
           <p class="newptwo">
@@ -67,11 +69,9 @@ export default {
     async submit(item) {
       this.$router.push({ path: './detail', query: { id: item.id, role: item.role } });
     },
-
     usersubmit() {
       this.$router.push({ path: './detail' });
     },
-
     async toDelete(item) {
       const res = await this.delete(item.id);
       if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) this.search();
@@ -91,12 +91,11 @@ export default {
 
 <style lang="less" scoped>
 .newuser {
-  float: right;
+  text-align: center;
   padding: 10px 0 10px 10px;
 }
 .info {
   border-top: 1px solid #f5f5f5;
-
   .list {
     background: #fff;
     padding: 0 10px;
@@ -108,6 +107,10 @@ export default {
     }
     p:first-child {
       font-size: 16px;
+      span:first-child {
+        width: 60%;
+        display: inline-block;
+      }
     }
     p:nth-child(2) .ptwo {
       display: inline-block;

+ 85 - 0
src/views/bind.vue

@@ -0,0 +1,85 @@
+<template>
+  <div id="bind">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-button @click="bindBtn()" type="primary">确认绑定</el-button>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: authUser } = createNamespacedHelpers('authUser');
+export default {
+  name: 'bind',
+  props: {},
+  components: {
+    NavBar,
+  },
+  data: () => ({
+    // 头部标题
+    title: '',
+    // meta为true
+    isleftarrow: '',
+    // 返回
+    navShow: true,
+  }),
+  created() {},
+  computed: {
+    uid() {
+      return this.$route.query.uid;
+    },
+    openid() {
+      return this.$route.query.openid;
+    },
+  },
+  methods: {
+    ...authUser(['bind']),
+    async bindBtn() {
+      let data = {};
+      data.uid = this.uid;
+      data.openid = this.openid;
+      console.log(data);
+      let res = await this.bind(data);
+      if (res.errcode == '0') {
+        this.$message({
+          message: '绑定成功',
+          type: 'success',
+        });
+      }
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+  padding: 150px;
+}
+.foot {
+  position: absolute;
+  bottom: 0;
+}
+</style>

src/views/home/error.vue → src/views/error.vue