guojy 1 سال پیش
والد
کامیت
aab971c62b

+ 2 - 0
src/permission.js

@@ -59,6 +59,8 @@ router.beforeEach((to, from, next) => {
         })
       }
     }
+  }else if((to.path == '/verify' || to.path == '/accountVf' || path == '/iosIntercept') && localStorage.getItem('a-token-temp')){
+    next()
   } else {
     if (!window.$routes_map[to.name].need_login) { // 在免登录白名单,直接进入
       if (typeof (window.$routes_map[to.name]) != 'undefined') {

+ 7 - 0
src/router/index.js

@@ -91,6 +91,13 @@ let routes = [
     label: '账号信息',
     need_login: true
   },
+  {
+    path: '/iosIntercept',
+    name: 'iosIntercept',
+    component: () => import('@/view/user/iosIntercept'),
+    label: '公道云',
+    need_login: true
+  },
   {
     path: '/verify',
     name: 'verify',

+ 13 - 5
src/utils/axiosUser.js

@@ -33,9 +33,9 @@ var bool = true; //五秒执行一次变量
 service.interceptors.request.use(
   config => {
     url = config.url;
-    if (getToken()) {
-      config.headers['A-Token'] = getToken()
-    }
+    // if (getToken()) {
+    //   config.headers['A-Token'] = getToken()
+    // }
     return config
   },
   error => {
@@ -141,7 +141,7 @@ service.interceptors.response.use(
 // 接口再次封装
 var CancelToken = axios.CancelToken; //中断请求
 Vue.$httpRequestList = [];
-export default (type, url, data, heaStr) => {
+export default (type, url, data, heaStr,isToken) => {
   var Accept='application/json, text/plain, */*', Token = '';
   switch (heaStr) {
     case '':
@@ -157,12 +157,20 @@ export default (type, url, data, heaStr) => {
       Accept = 'application/vnd.test.v4+json'
       break;
   }
+  if (getToken()) {
+    Token = getToken();
+  }
+  if (isToken) {
+    console.log(isToken)
+    Token = isToken
+  }
   return new Promise((resolve, reject) => { //封装ajax
     var aa = {
       method: type,
       url: url,
       headers: {
-        'Accept': Accept
+        'Accept': Accept,
+        'A-Token': Token,
       },
       cancelToken: new CancelToken(c => { //强行中断请求要用到的
         Vue.$httpRequestList.push(c);

+ 6 - 37
src/view/user/accountSet.vue

@@ -10,15 +10,6 @@
     <van-cell-group>
       <van-cell title="修改密码" to="change_pwd" is-link />
     </van-cell-group>
-    <van-dialog v-model="show" show-cancel-button @confirm="verify">
-       <div class="text">
-         <div style="color: red;font-size: .3rem;">操作前需要验证你的登录密码</div>
-         <div style="padding: 0 0.2rem;color: #333;margin-top: 0.2rem;">如果忘了原密码,请退出登录,点击"忘记密码",使用短信验证码重新登录后设置新密码。</div>
-       </div>
-       <van-cell-group>
-         <van-field v-model="password" label="原密码" placeholder="请输入原密码" type="password"  />
-       </van-cell-group>
-    </van-dialog>
   </div>
 </template>
 
@@ -26,48 +17,26 @@
 import Vue from 'vue'
 import { Cell, CellGroup, DropdownMenu, DropdownItem} from 'vant'
 
-import {returnJSEncrypt} from '@/utils/auth'
 Vue.use(Cell).use(CellGroup).use(DropdownMenu).use(DropdownItem)
 
 export default {
   name: 'accountSet',
   data () {
     return {
-      account_info: this.$store.getters.account_info,
       option: [{ text: '账号注销', value: 1 }],
-      show: false,
-      password: ''
     }
   },
   methods: {
     plus_menu (val) {
       if (val) {
-        this.password = ''
-        this.show = true
+        this.$router.push({
+          path:'/verify',
+          query:{
+            type:2
+          }
+        })
       }
     },
-    verify () {
-      if (!this.password) {
-        this.$toast('请输入密码')
-        return false
-      }
-      this.$toast.loading({
-        mask: true,
-        message: '正在验证...'
-      })
-      let data = {
-        tel: this.account_info.tel,
-        password: this.password,
-        custom_prompt: '密码错误'
-      }
-      this.$axiosUser('post', '/api/pro/login',{data:returnJSEncrypt(data)},'v2').then(res => {
-        if (res.data.code == 1) {
-          this.$router.push({name: 'verify'})
-        }
-      }).finally(e => {
-        this.$toast.clear()
-      })
-    }
   }
 }
 </script>

+ 29 - 38
src/view/user/create_company.vue

@@ -1,6 +1,12 @@
 <template>
   <div>
-    <van-nav-bar title="创建企业" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
+    <van-nav-bar title="创建企业" left-text="返回" @click-left="$route_back" left-arrow>
+      <template slot="right" class="department_right_nav">
+        <van-dropdown-menu  duration="0.3" text="text"  class="head_dropdown_menu">
+          <van-dropdown-item title="•••"  @change="plus_menu" :options="option" />
+        </van-dropdown-menu>
+      </template>
+    </van-nav-bar>
     <div class="body_com has_header">
       <div class="body_com_bg"></div>
       <van-cell-group>
@@ -26,40 +32,27 @@
       <div class="submit_btn_box login_butto">
         <van-button hairline plain v-show="false" type="info" size="small" round block @click="$router.push({ name: 'scanqr' })">加入已有组织</van-button>
       </div>
-      <!-- <div style="position: absolute;bottom: .3rem;right: .2rem;cursor: pointer;font-size: .26rem;" @click="show = true">
-        <span>注销账号</span>
-      </div> -->
     </div>
     <van-popup v-model="industry_columns_show" position="bottom"><van-picker :columns="industry_columns" @confirm="onIndustryChange" show-toolbar /></van-popup>
     <van-popup v-model="scale_columns_show" position="bottom">
       <van-picker :columns="scale_columns" @confirm="onScaleChange" show-toolbar @cancel="scale_columns_show = false" />
     </van-popup>
-    <van-dialog v-model="show" show-cancel-button @confirm="verify">
-       <div class="text">
-         <div style="color: red;font-size: .3rem;">操作前需要验证你的登录密码</div>
-         <div style="padding: 0 0.2rem;color: #333;margin-top: 0.2rem;">如果忘了原密码,请退出登录,点击"忘记密码",使用短信验证码重新登录后设置新密码。</div>
-       </div>
-       <van-cell-group>
-         <van-field v-model="password" label="原密码" placeholder="请输入原密码" type="password"  />
-       </van-cell-group>
-    </van-dialog>
   </div>
 </template>
 
 <script>
 import Vue from 'vue';
 import { setToken } from '@/utils/auth';
-import { Picker } from 'vant';
 import {returnJSEncrypt} from '@/utils/auth'
+import { Picker,DropdownMenu,DropdownItem } from 'vant';
+
+Vue.use(Picker).use(DropdownMenu).use(DropdownItem);
 
-Vue.use(Picker);
 export default {
   name: 'create_company',
   data() {
     return {
-      account_info: this.$store.getters.account_info,
-      password:'',
-      show:false,
+      option: [{ text: '账号注销', value: 1 }],
       submit_loading: false,
       formdata: {
         tel: '',
@@ -97,27 +90,10 @@ export default {
     );
   },
   methods: {
-    verify () {
-      if (!this.password) {
-        this.$toast('请输入密码')
-        return false
-      }
-      this.$toast.loading({
-        mask: true,
-        message: '正在验证...'
-      })
-      let data = {
-        tel: this.account_info.tel,
-        password: this.password,
-        st: new Date().getTime()
+    plus_menu (val) {
+      if (val) {
+        this.$router.push('/verify')
       }
-      this.$axiosUser('post', '/api/destruction',{data:returnJSEncrypt(data)},'v2').then(res => {
-        if (res.data.code == 1) {
-          this.$router.push({name: 'login'})
-        }
-      }).finally(e => {
-        this.$toast.clear()
-      })
     },
     get_company_info(id) {
       let self = this;
@@ -292,4 +268,19 @@ export default {
   border: 0.02rem solid #238dfa;
   border-radius: 0.04rem;
 }
+.text{
+  text-align: center;
+  color: #969799;
+  font-size: 0.28rem;
+  padding: 0.2rem 0;
+}
+/deep/ .van-dropdown-menu__bar {
+  background-color: transparent;
+}
+/deep/ .van-dropdown-menu__title{
+  color: #FFF;
+}
+/deep/ .van-dropdown-menu__title::after{
+  display: none;
+}
 </style>

+ 201 - 0
src/view/user/iosIntercept.vue

@@ -0,0 +1,201 @@
+<template>
+  <div class="page">
+    <van-nav-bar class="left-text-bold" left-text="欢迎使用公道云">
+      <template slot="right" class="department_right_nav">
+        <van-dropdown-menu
+          duration="0.3"
+          text="text"
+          class="head_dropdown_menu"
+        >
+          <van-dropdown-item
+            title="•••"
+            @change="plus_menu"
+            :options="option"
+          />
+        </van-dropdown-menu>
+      </template>
+    </van-nav-bar>
+    <div class="pageContent">
+      <scroller>
+        <van-tabs v-model="active" swipeable animated>
+          <van-tab v-for="(item, index) in options" :key="index" :title="item">
+            <img :src="returnImg(index)" @click="buyPopupPage = true" />
+          </van-tab>
+        </van-tabs>
+      </scroller>
+    </div>
+    <div class="pageBtm">
+      <van-button
+        type="primary"
+        color="#26A2FF"
+        style="padding: 0 .6rem;"
+        @click="buyPopupPage = true"
+        >预约演示</van-button
+      >
+      <a href="tel:400-6877-880" class='a_btn'>立即咨询</a>
+    </div>
+    <van-popup
+      v-model="buyPopupPage"
+      style="border-radius: 0.15rem; background: #fff0;overflow: visible;"
+      @closed="getItemBuyPopupPage"
+    >
+      <div class="buyPopupBody">
+        <div class="buyPopupContent">
+          <div class="buyPopupTitle">预约演示</div>
+          <p class="buyPopupTxt">
+            欢迎使用功道云,我们有专属顾问免费给您一对一同屏讲解系统软件,如需演示请点击【立即预约】,或拨打电话
+          </p>
+          <a class="buyPopupTel" href="tel:400-6877-880">400-6877-880</a>
+          <van-row gutter="20" style="margin-top: 0.32rem;">
+            <van-col span="12"
+              ><van-button block type="info" @click="applyButton"
+                >立即预约</van-button
+              ></van-col
+            >
+            <van-col span="12"
+              ><van-button block type="default" @click="getItemBuyPopupPage"
+                >我知道了</van-button
+              ></van-col
+            >
+          </van-row>
+        </div>
+      </div>
+    </van-popup>
+  </div>
+</template>
+
+<script>
+import Vue from "vue";
+import { DropdownMenu, DropdownItem } from "vant";
+Vue.use(DropdownMenu).use(DropdownItem);
+export default {
+  name: "iosIntercept",
+  components: {},
+  data() {
+    return {
+      active: 0,
+      options: ["积分", "目标", "绩效", "巡检"],
+      option: [{ text: "账号注销", value: 1 }],
+      buyPopupPage: false
+    };
+  },
+  created() {},
+  methods: {
+    returnImg(index) {
+      let arr = [
+        "static/images/s-jifen.jpg",
+        "static/images/s-mubiao.jpg",
+        "static/images/s-jixiao.jpg",
+        "static/images/s-xunjian.jpg"
+      ];
+      return arr[index];
+    },
+    plus_menu(val) {
+      if (val) {
+        this.$router.push({
+          path: "/verify"
+        });
+      }
+    },
+    // end元素拖拽
+    getItemBuyPopupPage() {
+      this.buyPopupPage = false;
+    },
+    applyButton() {
+      let self = this;
+      let data = {
+        account_id: this.$store.getters.account_info.id,
+        source_type: 1,
+        apply_type: 2
+      };
+      this.$axiosUser("post", "/api/pro/intentions/addbuy", data)
+        .then(res => {
+          this.$toast({
+            message: "预约成功,专属顾问“孙小姐”将在24小时内与您联系",
+            duration: 5000
+          });
+        })
+        .finally(() => {
+          this.buyPopupPage = false;
+        });
+    }
+  }
+};
+</script>
+<style scoped lang="scss">
+* {
+  padding: 0;
+  margin: 0;
+}
+img {
+  width: 100%;
+}
+.page {
+  background-color: #fff;
+  .pageContent {
+    height: calc(100vh - 2.92rem);
+    position: relative;
+  }
+  .pageBtm {
+    width: 100%;
+    height: 2rem;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    .a_btn{
+        color: #fff;
+        background-color: #26A2FF;
+        display: block;
+        line-height: .88rem;
+        padding: 0 0.6rem;
+        border-radius: 0.1rem;
+    }
+  }
+  .buyPopupBody {
+    width: 85vw;
+    .buyPopupContent {
+      position: relative;
+      background: white;
+      padding: 0 5vw 5vw 5vw;
+      border-radius: 0.15rem;
+      .buyPopupTitle {
+        background: #1a89fa;
+        position: absolute;
+        left: 0.6rem;
+        right: 0.6rem;
+        top: -0.3rem;
+        text-align: center;
+        border-radius: 0.1rem;
+        line-height: 2;
+        font-weight: normal;
+        font-size: 0.36rem;
+        color: #fff;
+      }
+      .buyPopupTxt {
+        font-size: 0.32rem;
+        line-height: 1.8;
+        padding-top: 0.8rem;
+      }
+      .buyPopupTel {
+        color: #1a89fa;
+        font-weight: bold;
+      }
+    }
+  }
+}
+/deep/ .van-tabs__wrap {
+  width: 60%;
+}
+/deep/ .van-dropdown-menu__bar {
+  background-color: transparent;
+}
+/deep/ .van-dropdown-menu__title {
+  color: #fff;
+}
+/deep/ .van-dropdown-menu__title::after {
+  display: none;
+}
+/deep/ .van-tabs__line {
+  z-index: 0;
+}
+</style>

+ 3 - 0
src/view/user/login.vue

@@ -318,6 +318,9 @@
                   localStorage.setItem('a-token-temp', res.data.token); // 保存平台账号登录的token
                   if(window.plus){
                     let deviceInfo = window.plus.os.name;
+                    if(deviceInfo === 'IOS'&&res.data.account_site.length > 0){
+                      console.log('苹果软件用户有创建公司')
+                    }
                     if(deviceInfo === 'IOS'&&res.data.account_site.length == 0){
                       console.log('苹果软件用户没有创建公司')
                     }

+ 36 - 4
src/view/user/login_company_list.vue

@@ -1,6 +1,12 @@
 <template>
   <div>
-    <van-nav-bar title="我的组织" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
+    <van-nav-bar title="我的组织" left-text="返回" @click-left="$route_back" left-arrow>
+      <template slot="right" class="department_right_nav">
+        <van-dropdown-menu  duration="0.3" text="text"  class="head_dropdown_menu">
+          <van-dropdown-item title="•••"  @change="plus_menu" :options="option" />
+        </van-dropdown-menu>
+      </template>
+    </van-nav-bar>
     <div class="body_com has_header">
       <scroller>
         <div v-for="(item, index) in list" :key="index" style="padding-top:0.2rem; padding-left:0.2rem; padding-right:0.2rem;">
@@ -21,16 +27,17 @@
 import { getToken, setToken } from '@/utils/auth';
 import Vue from 'vue';
 import moment from 'moment';
-import { Panel } from 'vant';
+import { Panel,DropdownMenu,DropdownItem } from 'vant';
 
-Vue.use(Panel);
+Vue.use(Panel).use(DropdownMenu).use(DropdownItem);
 
 export default {
   name: 'login_company_list',
   data() {
     return {
       page: 0,
-      list: []
+      list: [],
+      option: [{ text: '账号注销', value: 1 }],
     };
   },
   filters: {
@@ -42,6 +49,16 @@ export default {
     this.get_site_list();
   },
   methods: {
+    plus_menu (val) {
+      if (val) {
+        this.$router.push({
+          path:'/verify',
+          query:{
+            type:2
+          }
+        })
+      }
+    },
     get_site_list() {
       this.$toast.loading({
         mask: false,
@@ -90,4 +107,19 @@ export default {
   color: #1c1c1c;
   font-weight: bold;
 }
+.text{
+  text-align: center;
+  color: #969799;
+  font-size: 0.28rem;
+  padding: 0.2rem 0;
+}
+/deep/ .van-dropdown-menu__bar {
+  background-color: transparent;
+}
+/deep/ .van-dropdown-menu__title{
+  color: #FFF;
+}
+/deep/ .van-dropdown-menu__title::after{
+  display: none;
+}
 </style>

+ 2 - 1
src/view/user/verify.vue

@@ -13,7 +13,8 @@
           所有数据将被抹除且不可恢复,请谨慎操作!
         </div>
       </div>
-      <van-button @click="verify" type="primary" style="background-color: #F25542;border:1px solid #F25542;border-radius: 3px;" block >注销</van-button>
+      <van-button v-if="$route.query.type == 2" @click="$router.go(-1)" style="background-color: #26A2FF;border:1px solid #26A2FF;border-radius: 3px;color: #FFF;" block >我知道了</van-button>
+      <van-button v-else @click="verify" style="background-color: #26A2FF;border:1px solid #26A2FF;border-radius: 3px;color: #FFF;" block >注销</van-button>
     </div>
   </div>
 </template>