d84b4ef84ff1f7740a5f6ef96c73911889c18ce8.svn-base 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <div style="height:100vh">
  3. <div class="header row allAlignment" style="padding:.3rem .32rem;">
  4. <p class="logo">
  5. <span style="color:#f76649;font-size:.43rem">HX</span>
  6. <i style="color:#f4f4f2;font-size:.43rem;font-weight: bolder;">699</i>
  7. </p>
  8. <p class="switch">
  9. <img src="@/assets/st-imges/close.png" @click="personalShow()">
  10. <img style="margin-right:.1rem" src="@/assets/st-imges/kefu.png">
  11. </p>
  12. </div>
  13. <div class="Personal row center">
  14. <div class="Personal-index">
  15. <div class="Personal-top boxshow">
  16. <div class="PictureFrame row vertical-center">
  17. <!-- 头像 -->
  18. <div class="row vertical-center">
  19. <div class="HeadPortrait row center">
  20. <!-- 头像图片 -->
  21. <img src="@/assets/st-imges/touxiang.jpg">
  22. </div>
  23. </div>
  24. <!-- 用户名 -->
  25. <div class="row vertical-center">
  26. <span style="margin-top:2px;font-size:.26rem">{{name}}</span>
  27. </div>
  28. </div>
  29. <div class="AmountAccount row item-center">
  30. <div>
  31. <div class="mtb">
  32. <span style="color: #666666;font-size: .22rem;">账户余额(元)</span>
  33. <br>
  34. <!-- 账户余额 -->
  35. <span
  36. style="color:#666666;display: inline-block;font-size: .3rem;font-weight: normal;margin-top:.15rem;"
  37. >{{data.allMoney}}</span>
  38. </div>
  39. </div>
  40. <i></i>
  41. <div>
  42. <div class="mtb">
  43. <span style="color: #666666;font-size: .22rem;">盈利(元)</span>
  44. <br>
  45. <!-- 盈利 -->
  46. <span
  47. style="color:#1bd479;display: inline-block;font-size: .3rem;font-weight: normal;margin-top:.15rem;"
  48. >{{data.winMoney}}</span>
  49. </div>
  50. </div>
  51. <i></i>
  52. <div>
  53. <div class="mtb">
  54. <span style="color: #666666;font-size: .22rem;">亏损(元)</span>
  55. <br>
  56. <!-- 亏损 -->
  57. <span
  58. style="color:#f76649;display: inline-block;font-size: .3rem;font-weight: normal;margin-top:.15rem;"
  59. >{{data.loseMoney}}</span>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="Personal-main row average mt03 boxshow">
  65. <div @click="toRouter('/ProfitAndLossRecord')">
  66. <img src="@/assets/st-imges/Personalstatements.png">
  67. <p>盈亏记录</p>
  68. </div>
  69. <div @click="toRouter('/BettingRecord')">
  70. <img src="@/assets/st-imges/Thedetail.png">
  71. <p>投注记录</p>
  72. </div>
  73. <div @click="toRouter('/AccessRecords')">
  74. <img src="@/assets/st-imges/Thereport.png">
  75. <p>转账记录</p>
  76. </div>
  77. </div>
  78. <div class="Personal-bottom mt03 row allAlignment">
  79. <div @click="toRouter('/PersonInfo')">
  80. <div class="Personal-bottom-img">
  81. <img src="@/assets/st-imges/Thepersonaldata.png">
  82. </div>
  83. <div class="Personal-bottom-text">
  84. <p>个人资料</p>
  85. <span>个人信息绑定与查询</span>
  86. </div>
  87. </div>
  88. <!-- <div>-->
  89. <!-- <div class="Personal-bottom-img">-->
  90. <!-- <img src="@/assets/st-imges/Securitycenter.png">-->
  91. <!-- </div>-->
  92. <!-- <div class="Personal-bottom-text">-->
  93. <!-- <p>安全中心</p>-->
  94. <!-- <span>保护你的账户安全</span>-->
  95. <!-- </div>-->
  96. <!-- </div>-->
  97. <div @click="toRouter('/MessageCenter')">
  98. <div class="Personal-bottom-img">
  99. <img src="@/assets/st-imges/Themessage.png">
  100. </div>
  101. <div class="Personal-bottom-text">
  102. <p>我的消息</p>
  103. <span>查看历史消息内容</span>
  104. </div>
  105. </div>
  106. <!-- <div>-->
  107. <!-- <div class="Personal-bottom-img">-->
  108. <!-- <img src="@/assets/st-imges/Moreandmore.png">-->
  109. <!-- </div>-->
  110. <!-- <div class="Personal-bottom-text">-->
  111. <!-- <p>更多</p>-->
  112. <!-- <span>使用管理更多功能</span>-->
  113. <!-- </div>-->
  114. <!-- </div>-->
  115. </div>
  116. <yd-button size="large" type="danger" @click.native="logout()">退出登录</yd-button>
  117. </div>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import "@/css/index.css";
  123. export default {
  124. name: "PersonalCenter",
  125. data() {
  126. return {
  127. // 用户名
  128. name: "",
  129. userCodeShow: false, //头像侧边菜单显示开关
  130. data: "",
  131. timers:true,
  132. };
  133. },
  134. computed: {},
  135. watch: {},
  136. methods: {
  137. //判断登录是否过期
  138. getuserData() {
  139. if (localStorage.getItem("token")) {
  140. this.$http
  141. .post(this.$ports.login.getAgent, {
  142. token: localStorage.getItem("token")
  143. })
  144. .then(res => {
  145. if (res.data.status == -4001) {
  146. this.$store.dispatch("SET_TOKEN", "");
  147. this.$store.dispatch("GET_ISSHOW", false);
  148. this.$dialog.toast({
  149. mes: "对不起您的登录已过期,请您重新登录",
  150. timeout: 3000
  151. });
  152. this.$router.push('/')
  153. }
  154. });
  155. }
  156. },
  157. // 获取个人中心统计数据
  158. statistical() {
  159. this.$http
  160. .post(this.$ports.login.dataStatistics, {
  161. token: localStorage.getItem("token")
  162. })
  163. .then(res => {
  164. this.data = res.data.data;
  165. // console.log(res, "wwww");
  166. });
  167. },
  168. // 退出登录
  169. logout() {
  170. this.$dialog.confirm({
  171. title: "退出登录",
  172. mes: "您确定要退出登录吗?",
  173. opts: () => {
  174. this.$http
  175. .get(this.$ports.login.loginOut, {
  176. token: localStorage.getItem("token")
  177. })
  178. .then(res => {
  179. if (res) {
  180. this.$dialog.toast({
  181. mes: "退出登录成功,请前往登录",
  182. timeout: 1500
  183. });
  184. this.$public.setItem("token", "");
  185. this.$store.dispatch("SET_TOKEN", "");
  186. localStorage.setItem("name", "");
  187. this.$router.go(-1);
  188. }
  189. });
  190. }
  191. });
  192. },
  193. // 个人中心显示隐藏
  194. personalShow() {
  195. this.$router.go(-1);
  196. },
  197. // 路由
  198. toRouter(url) {
  199. this.$router.push({ path: url });
  200. },
  201. userCode() {
  202. this.userCodeShow = !this.userCodeShow;
  203. },
  204. userEsc() {
  205. this.userCodeShow = false;
  206. }
  207. },
  208. mounted() {
  209. if (localStorage.getItem("name")) {
  210. this.name = localStorage.getItem("name");
  211. }
  212. this.statistical();
  213. let _this = this;
  214. this.$public.ajaxTimerFun(function(timing) {
  215. if (_this.timers) {
  216. _this.getuserData();
  217. } else {
  218. clearInterval(timing);
  219. }
  220. }, 1000 * 60);
  221. },
  222. beforeDestroy() {
  223. this.timers = false;
  224. },
  225. };
  226. </script>
  227. <style scoped>
  228. *{touch-action: none;}
  229. .yd-btn-block {
  230. margin-top: 0.6rem;
  231. }
  232. .header {
  233. height: 1.8rem;
  234. background-image: linear-gradient(0deg, #565656 0%, #999999 100%);
  235. }
  236. .logo {
  237. font-weight: bolder;
  238. }
  239. .switch img {
  240. width: 0.3rem;
  241. height: 0.3rem;
  242. margin-left: 0.4rem;
  243. margin-top: 0.1rem;
  244. }
  245. .Personal {
  246. width: 100%;
  247. margin-top: -0.65rem;
  248. }
  249. .Personal-index {
  250. width: 7rem;
  251. height: 10rem;
  252. }
  253. .Personal-top {
  254. height: 2rem;
  255. background: #efefef;
  256. border-radius: 0.1rem;
  257. }
  258. .mt03 {
  259. margin-top: 0.5rem;
  260. }
  261. .Personal-main {
  262. height: 2.2rem;
  263. background: #efefef;
  264. border-radius: 0.1rem;
  265. }
  266. .Personal-main img {
  267. width: 1.1rem;
  268. height: 1.1rem;
  269. border-radius: 50%;
  270. }
  271. .Personal-main p {
  272. font-size: 0.26rem;
  273. color: #555555;
  274. margin-top: -0.1rem;
  275. }
  276. .Personal-main div {
  277. text-align: center;
  278. padding: 0.4rem 0;
  279. }
  280. .Personal-bottom {
  281. height: 4rem;
  282. flex-wrap: wrap;
  283. }
  284. .boxshow {
  285. box-shadow: -2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  286. 0px -2px 5px 1px rgba(0, 0, 0, 0.05), 2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  287. 0px 2px 5px 1px rgba(0, 0, 0, 0.05);
  288. }
  289. .Personal-bottom > div {
  290. width: 100%;
  291. height: 1.6rem;
  292. border-radius: 0.1rem;
  293. background: #efefef;
  294. box-shadow: -2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  295. 0px -2px 5px 1px rgba(0, 0, 0, 0.05), 2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  296. 0px 2px 5px 1px rgba(0, 0, 0, 0.05);
  297. }
  298. .AmountAccount {
  299. height: 1.2rem;
  300. }
  301. .AmountAccount > i {
  302. display: inline-block;
  303. width: 1px;
  304. height: 0.5rem;
  305. background: #cccccc;
  306. }
  307. .AmountAccount > div {
  308. width: 2.38rem;
  309. }
  310. .PictureFrame {
  311. height: 0.8rem;
  312. flex-wrap: wrap;
  313. }
  314. .PictureFrame > div {
  315. width: 100%;
  316. }
  317. .HeadPortrait {
  318. width: 1rem;
  319. height: 0.99rem;
  320. background: #efefef;
  321. border-radius: 50%;
  322. margin-top: -0.5rem;
  323. box-shadow: 0px 0rem 10px 2px rgba(0, 0, 0, 0.3);
  324. }
  325. .HeadPortrait > img {
  326. width: 0.94rem;
  327. height: 0.94rem;
  328. border-radius: 50%;
  329. }
  330. .mtb {
  331. text-align: center;
  332. line-height: 0.2rem;
  333. }
  334. .Personal-bottom-img {
  335. width: 0.94rem;
  336. height: 100%;
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. }
  341. .Personal-bottom-img > img {
  342. width: 0.56rem;
  343. height: 0.56rem;
  344. }
  345. .Personal-bottom > div {
  346. display: flex;
  347. }
  348. .Personal-bottom-text {
  349. height: 100%;
  350. padding: 0.35rem 0;
  351. }
  352. .Personal-bottom-text > p {
  353. margin-bottom: 0.1rem;
  354. color: #555555;
  355. font-size: 0.26rem;
  356. }
  357. .Personal-bottom-text > span {
  358. color: #999999;
  359. font-size: 0.22rem;
  360. }
  361. </style>