3d3420c3d54bda040ae721b79d7370fc259cea9f.svn-base 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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. .yd-btn-block {
  229. margin-top: 0.6rem;
  230. }
  231. .header {
  232. height: 1.8rem;
  233. background-image: linear-gradient(0deg, #565656 0%, #999999 100%);
  234. }
  235. .logo {
  236. font-weight: bolder;
  237. }
  238. .switch img {
  239. width: 0.3rem;
  240. height: 0.3rem;
  241. margin-left: 0.4rem;
  242. margin-top: 0.1rem;
  243. }
  244. .Personal {
  245. width: 100%;
  246. margin-top: -0.65rem;
  247. }
  248. .Personal-index {
  249. width: 7rem;
  250. height: 10rem;
  251. }
  252. .Personal-top {
  253. height: 2rem;
  254. background: #efefef;
  255. border-radius: 0.1rem;
  256. }
  257. .mt03 {
  258. margin-top: 0.5rem;
  259. }
  260. .Personal-main {
  261. height: 2.2rem;
  262. background: #efefef;
  263. border-radius: 0.1rem;
  264. }
  265. .Personal-main img {
  266. width: 1.1rem;
  267. height: 1.1rem;
  268. border-radius: 50%;
  269. }
  270. .Personal-main p {
  271. font-size: 0.26rem;
  272. color: #555555;
  273. margin-top: -0.1rem;
  274. }
  275. .Personal-main div {
  276. text-align: center;
  277. padding: 0.4rem 0;
  278. }
  279. .Personal-bottom {
  280. height: 4rem;
  281. flex-wrap: wrap;
  282. }
  283. .boxshow {
  284. box-shadow: -2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  285. 0px -2px 5px 1px rgba(0, 0, 0, 0.05), 2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  286. 0px 2px 5px 1px rgba(0, 0, 0, 0.05);
  287. }
  288. .Personal-bottom > div {
  289. width: 100%;
  290. height: 1.6rem;
  291. border-radius: 0.1rem;
  292. background: #efefef;
  293. box-shadow: -2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  294. 0px -2px 5px 1px rgba(0, 0, 0, 0.05), 2px 0px 5px 1px rgba(0, 0, 0, 0.05),
  295. 0px 2px 5px 1px rgba(0, 0, 0, 0.05);
  296. }
  297. .AmountAccount {
  298. height: 1.2rem;
  299. }
  300. .AmountAccount > i {
  301. display: inline-block;
  302. width: 1px;
  303. height: 0.5rem;
  304. background: #cccccc;
  305. }
  306. .AmountAccount > div {
  307. width: 2.38rem;
  308. }
  309. .PictureFrame {
  310. height: 0.8rem;
  311. flex-wrap: wrap;
  312. }
  313. .PictureFrame > div {
  314. width: 100%;
  315. }
  316. .HeadPortrait {
  317. width: 1rem;
  318. height: 0.99rem;
  319. background: #efefef;
  320. border-radius: 50%;
  321. margin-top: -0.5rem;
  322. box-shadow: 0px 0rem 10px 2px rgba(0, 0, 0, 0.3);
  323. }
  324. .HeadPortrait > img {
  325. width: 0.94rem;
  326. height: 0.94rem;
  327. border-radius: 50%;
  328. }
  329. .mtb {
  330. text-align: center;
  331. line-height: 0.2rem;
  332. }
  333. .Personal-bottom-img {
  334. width: 0.94rem;
  335. height: 100%;
  336. display: flex;
  337. align-items: center;
  338. justify-content: center;
  339. }
  340. .Personal-bottom-img > img {
  341. width: 0.56rem;
  342. height: 0.56rem;
  343. }
  344. .Personal-bottom > div {
  345. display: flex;
  346. }
  347. .Personal-bottom-text {
  348. height: 100%;
  349. padding: 0.35rem 0;
  350. }
  351. .Personal-bottom-text > p {
  352. margin-bottom: 0.1rem;
  353. color: #555555;
  354. font-size: 0.26rem;
  355. }
  356. .Personal-bottom-text > span {
  357. color: #999999;
  358. font-size: 0.22rem;
  359. }
  360. </style>