index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <Page title="我的" styleReset="backNone">
  3. <template v-slot:body>
  4. <div class="w-full h-full flex flex-col">
  5. <div class="px-4 py-6 flex justify-between items-center">
  6. <div class="flex items-center">
  7. <div class="bg-[#065985] text-[#fff] flex items-center justify-center profilePicture">
  8. <TranslationComponent :openId="userInfo.userInfo.name" />
  9. </div>
  10. <div class="ml-8 profilePicture-text">
  11. <TranslationComponent :openId="userInfo.userInfo.name" />
  12. </div>
  13. </div>
  14. <div class="profilePicture-img">
  15. <!-- <img src="/src/assets/image/rightArrow.png"> -->
  16. </div>
  17. </div>
  18. <!-- 列表 -->
  19. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  20. <div>当前版本</div>
  21. <div class="text-[#999]">{{ ['', '专业版本', '旗舰版本'][userInfo.userInfo?.company?.versionControl] }}</div>
  22. </div>
  23. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  24. <div>公司名称</div>
  25. <div class="text-[#999]">{{ userInfo.userInfo?.company?.companyName }}</div>
  26. </div>
  27. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  28. <div>账号角色</div>
  29. <div class="text-[#999]">{{ userInfo.userInfo?.roleName }}</div>
  30. </div>
  31. <div class="bg-white flex justify-between px-6 py-2 mb-1" v-if="userInfo.userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin">
  32. <div>{{ `绑定${isCorpWX ? '企业' : ''}微信` }}</div>
  33. <div class="text-[#999]">
  34. (
  35. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid == null) || (isWX && userInfo.userInfo.wxOpenid == null)">未绑定</span>
  36. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid != null) || (isWX && userInfo.userInfo.wxOpenid != null)">已绑定</span>
  37. )
  38. </div>
  39. </div>
  40. <div class="bg-white flex justify-between px-6 py-2 mb-1">
  41. <div>有效日期</div>
  42. <div class="text-[#999]">{{ userInfo.userInfo?.company?.expirationDate }}</div>
  43. </div>
  44. <div class="bg-white flex justify-between px-6 py-2 mb-1" @click="instructions()">
  45. <div>使用说明</div>
  46. <div class="list-imgs">
  47. <img src="/src/assets/image/rightArrow.png">
  48. </div>
  49. </div>
  50. <!-- <div class="bg-white flex justify-between px-6 py-2 mb-1">
  51. <div>在线客服</div>
  52. <div class="list-imgs">
  53. <img src="/src/assets/image/rightArrow.png">
  54. </div>
  55. </div> -->
  56. <div class="bg-white flex justify-between px-6 py-2 mb-1" @click="applicationMarket()">
  57. <div>应用市场</div>
  58. <div class="list-imgs">
  59. <img src="/src/assets/image/rightArrow.png">
  60. </div>
  61. </div>
  62. <!-- 退出登录 -->
  63. <div class="w-full mb-40 px-24 mt-20" v-if="!isCorpWX">
  64. <van-button type="primary" @click="signOut" class="w-full">退出登录</van-button>
  65. </div>
  66. </div>
  67. </template>
  68. <template v-slot:footer>
  69. <Footer />
  70. </template>
  71. </Page>
  72. </template>
  73. <script setup>
  74. import { ref } from "vue";
  75. import { useLifecycle } from "@hooks/useCommon.js";
  76. import useRouterStore from "@store/useRouterStore.js";
  77. import useInfoStore from "@store/useInfoStore.js";
  78. import Footer from "@components/page/footer.vue";
  79. const router = useRouterStore()
  80. const userInfo = useInfoStore()
  81. const isCorpWX = ref(false)
  82. const isWX = ref(false)
  83. function instructions() {
  84. router.navigateTo({
  85. pathName: 'pdfPreview',
  86. })
  87. }
  88. function bindWeiXin() {
  89. //企业微信
  90. if (isCorpWX.value && userInfo.userInfo.corpwxUserid != null) {
  91. return;
  92. }
  93. //微信
  94. else if (isWX.value && userInfo.userInfo.wxOpenid != null) {
  95. return;
  96. }
  97. var appId = "wx1c1d8fc81bc073a8";//智能客户管家公众号
  98. var url = "https://mobcrm.ttkuaiban.com/api/wechat/bindWeiXin2?userId=" + userInfo.userInfo.id;//工时管家公众号授权回调页面
  99. if (isCorpWX.value) {
  100. appId = "ww4e237fd6abb635af"; //企业微信第三方的SUIT ID
  101. url = "https://crm.ttkuaiban.com/api/wxcorp/bindCorpWeiXin?userId=" + userInfo.userInfo.id;//授权回调页面
  102. }
  103. var weixinUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appId + "&redirect_uri=" + encodeURI(url) + "&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
  104. window.location.href = weixinUrl;
  105. }
  106. function signOut() {
  107. router.redirectTo({
  108. pathName: 'login',
  109. success: () => {
  110. localStorage.clear()
  111. sessionStorage.clear()
  112. window.location.reload();
  113. }
  114. })
  115. }
  116. function judgingTheEnvironment() {
  117. const currentEnvironment = navigator.userAgent.toLowerCase();
  118. isCorpWX.value = currentEnvironment.indexOf("wxwork") > 0 ? true : false
  119. isWX.value = currentEnvironment.indexOf("micromessenger") > 0 ? true : false
  120. }
  121. const applicationMarket = () => {
  122. window.location.href = 'https://www.ttkuaiban.com/appMarket.html'
  123. // window.open('https://www.ttkuaiban.com/appMarket.html', '_blank');
  124. }
  125. useLifecycle({
  126. load: () => {
  127. judgingTheEnvironment()
  128. }
  129. });
  130. </script>
  131. <style lang="scss" scoped>
  132. .backNone {
  133. background: linear-gradient(to bottom, #E0EFFF, #F8F8F8 30%) !important;
  134. :deep(.van-nav-bar) {
  135. background: none;
  136. }
  137. }
  138. .headPortrait {
  139. width: 80px;
  140. height: 80px;
  141. border-radius: 50%;
  142. position: relative;
  143. margin-top: 20px;
  144. margin-bottom: 10px;
  145. &::after {
  146. content: "";
  147. width: 24px;
  148. height: 24px;
  149. background-image: url('@/assets/image/camera.png');
  150. background-size: cover;
  151. position: absolute;
  152. bottom: 0;
  153. right: 0;
  154. }
  155. }
  156. .xinming {
  157. color: #000000;
  158. font-family: PingFang SC;
  159. font-weight: semibold;
  160. font-size: 18px;
  161. line-height: normal;
  162. letter-spacing: 0px;
  163. text-align: left;
  164. margin-bottom: 6px;
  165. text-align: center;
  166. }
  167. .profilePicture {
  168. width: 60px;
  169. height: 60px;
  170. border-radius: 50%;
  171. font-size: 16px;
  172. }
  173. .profilePicture-text {
  174. font-size: 16px;
  175. color: #065985;
  176. font-weight: bold;
  177. }
  178. .profilePicture-img {
  179. width: 24px;
  180. }
  181. .list-imgs {
  182. width: 14px;
  183. }
  184. </style>