index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div class="personalCenter">
  3. <div class="personalCenter-top flex flex-col">
  4. <div class="px-4 flex justify-between items-center avatarSection">
  5. <div class="flex items-center">
  6. <div
  7. class="bg-[#fff] text-[#333] flex items-center justify-center profilePicture"
  8. >
  9. <TranslationComponent :openId="userInfo.userInfo.name" />
  10. </div>
  11. <div class="ml-8 profilePicture-text">
  12. <TranslationComponent :openId="userInfo.userInfo.name" /> <br />
  13. <div class="jobIdEtc">工号:{{ userInfo.userInfo.jobNumber }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="flex-1 overflow-y-auto personalCenter-content">
  19. <div class="flex flex-row items-center justify-between">
  20. <div class="list-tile flex">
  21. <img src="../../../assets/image/dqbb.png" alt="" />
  22. <div class="list-tile-text">当前版本</div>
  23. </div>
  24. <div class="list-text">{{ ['', '专业版本', '旗舰版本'][userInfo.userInfo?.company?.versionControl] }}</div>
  25. </div>
  26. <div class="flex flex-row items-center justify-between" v-if="userInfo.userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin">
  27. <div class="list-tile flex">
  28. <img src="../../../assets/image/dqbb.png" alt="" />
  29. <div class="list-tile-text">{{ `绑定${isCorpWX ? '企业' : ''}微信` }}</div>
  30. </div>
  31. <div class="list-text">
  32. (
  33. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid == null) || (isWX && userInfo.userInfo.wxOpenid == null)">未绑定</span>
  34. <span v-if="(isCorpWX && userInfo.userInfo.corpwxUserid != null) || (isWX && userInfo.userInfo.wxOpenid != null)">已绑定</span>
  35. )
  36. </div>
  37. </div>
  38. <div class="flex flex-row items-center justify-between mt-3">
  39. <div class="list-tile flex">
  40. <img src="../../../assets/image/gsmc.png" alt="" />
  41. <div class="list-tile-text">公司名称</div>
  42. </div>
  43. <div class="list-text">{{ userInfo.userInfo?.company?.companyName }}</div>
  44. </div>
  45. <div class="flex flex-row items-center justify-between mt-3">
  46. <div class="list-tile flex">
  47. <img src="../../../assets/image/dqzh.png" alt="" />
  48. <div class="list-tile-text">账号角色</div>
  49. </div>
  50. <div class="list-text">{{ userInfo.userInfo?.roleName }}</div>
  51. </div>
  52. <div class="flex flex-row items-center justify-between mt-3">
  53. <div class="list-tile flex">
  54. <img src="../../../assets/image/yxrq.png" alt="" />
  55. <div class="list-tile-text">有效日期</div>
  56. </div>
  57. <div class="list-text">{{ userInfo.userInfo?.company?.expirationDate }}</div>
  58. </div>
  59. <div class="flex flex-row items-center justify-between mt-3" @click="instructions()">
  60. <div class="list-tile flex">
  61. <img src="../../../assets/image/sysm.png" alt="" />
  62. <div class="list-tile-text">使用说明</div>
  63. </div>
  64. <img src="../../../assets/image/rightArrow.png" class="list-text-img"></img>
  65. </div>
  66. <div class="flex flex-row items-center justify-between mt-3" @click="applicationMarket()">
  67. <div class="list-tile flex">
  68. <img src="../../../assets/image/yysc.png" alt="" />
  69. <div class="list-tile-text">应用市场</div>
  70. </div>
  71. <img src="../../../assets/image/rightArrow.png" class="list-text-img"></img>
  72. </div>
  73. </div>
  74. <div><Footer /></div>
  75. </div>
  76. </template>
  77. <script setup>
  78. import { ref } from "vue";
  79. import { useLifecycle } from "@hooks/useCommon.js";
  80. import useRouterStore from "@store/useRouterStore.js";
  81. import useInfoStore from "@store/useInfoStore.js";
  82. import Footer from "@components/page/footer.vue";
  83. const router = useRouterStore();
  84. const userInfo = useInfoStore();
  85. const isCorpWX = ref(false);
  86. const isWX = ref(false);
  87. function instructions() {
  88. router.navigateTo({
  89. pathName: "pdfPreview",
  90. });
  91. }
  92. function bindWeiXin() {
  93. //企业微信
  94. if (isCorpWX.value && userInfo.userInfo.corpwxUserid != null) {
  95. return;
  96. }
  97. //微信
  98. else if (isWX.value && userInfo.userInfo.wxOpenid != null) {
  99. return;
  100. }
  101. var appId = "wx1c1d8fc81bc073a8"; //智能客户管家公众号
  102. var url =
  103. "https://mobcrm.ttkuaiban.com/api/wechat/bindWeiXin2?userId=" +
  104. userInfo.userInfo.id; //工时管家公众号授权回调页面
  105. if (isCorpWX.value) {
  106. appId = "ww4e237fd6abb635af"; //企业微信第三方的SUIT ID
  107. url =
  108. "https://crm.ttkuaiban.com/api/wxcorp/bindCorpWeiXin?userId=" +
  109. userInfo.userInfo.id; //授权回调页面
  110. }
  111. var weixinUrl =
  112. "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
  113. appId +
  114. "&redirect_uri=" +
  115. encodeURI(url) +
  116. "&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
  117. window.location.href = weixinUrl;
  118. }
  119. function signOut() {
  120. router.redirectTo({
  121. pathName: "login",
  122. success: () => {
  123. localStorage.clear();
  124. sessionStorage.clear();
  125. window.location.reload();
  126. },
  127. });
  128. }
  129. function judgingTheEnvironment() {
  130. const currentEnvironment = navigator.userAgent.toLowerCase();
  131. isCorpWX.value = currentEnvironment.indexOf("wxwork") > 0 ? true : false;
  132. isWX.value = currentEnvironment.indexOf("micromessenger") > 0 ? true : false;
  133. }
  134. const applicationMarket = () => {
  135. window.location.href = "https://www.ttkuaiban.com/appMarket.html";
  136. // window.open('https://www.ttkuaiban.com/appMarket.html', '_blank');
  137. };
  138. useLifecycle({
  139. load: () => {
  140. judgingTheEnvironment();
  141. },
  142. });
  143. </script>
  144. <style lang="scss" scoped>
  145. .profilePicture {
  146. width: 70px;
  147. height: 70px;
  148. border-radius: 50%;
  149. font-size: 16px;
  150. font-weight: bold;
  151. }
  152. .profilePicture-text {
  153. font-size: 18px;
  154. color: #fff;
  155. }
  156. .profilePicture-img {
  157. width: 24px;
  158. }
  159. .list-imgs {
  160. width: 14px;
  161. }
  162. .personalCenter {
  163. width: 100%;
  164. height: 100vh;
  165. display: flex;
  166. flex-direction: column;
  167. background-color: #fff;
  168. }
  169. .personalCenter-top {
  170. width: 100%;
  171. height: 180px;
  172. background-image: url("../../../assets/image/grzxbjs.png");
  173. background-size: cover;
  174. }
  175. .avatarSection {
  176. padding: 52px 30px 0 30px;
  177. }
  178. .jobIdEtc {
  179. font-size: 13px;
  180. color: #92bdee;
  181. margin-top: 4px;
  182. }
  183. .personalCenter-content {
  184. width: 100%;
  185. border-top-left-radius: 15px;
  186. border-top-right-radius: 15px;
  187. background-color: #fff;
  188. position: relative;
  189. padding: 20px 26px 0 26px;
  190. top: -18px;
  191. }
  192. .list-text {
  193. color: #A6A6A6;
  194. font-weight: medium;
  195. font-size: 12px;
  196. line-height: normal;
  197. position: relative;
  198. top: -3px;
  199. }
  200. .list-tile {
  201. color: #000000;
  202. font-weight: medium;
  203. font-size: 12px;
  204. line-height: normal;
  205. }
  206. .list-tile img {
  207. width: 28px;
  208. }
  209. .list-tile-text{
  210. position: relative;
  211. top: 2px;
  212. margin-left: 10px;
  213. }
  214. .list-text-img {
  215. width: 16px;
  216. position: relative;
  217. top: -3px;
  218. }
  219. </style>