user-center.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>我的-爽客邦</title>
  6. <meta name="keywords" content="我的-爽客邦">
  7. <meta name="description" content="我的-爽客邦">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="我的-爽客邦">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back">
  18. <div id="app" v-cloak>
  19. <van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="min-height:90vh;">
  20. <div class="user-center-header">
  21. <div class="tr pt8" v-if="toptitleisshow">
  22. <div class="setting-btn dib" @click="gosetting"><img width="100%" src="./static/images/setting@3x.png"></div>
  23. </div>
  24. <div class="df pb16" v-cloak @click="userinfobtn">
  25. <div class="user-img" style="overflow:hidden;"><img :src="PublicLib.CachePicture({picUrl:userInfo.header,domid:'usercenterimg'})" id="usercenterimg" style="width:100%;height:100%;"></div>
  26. <div class="user-info cm">
  27. <div class="tl">
  28. <div class="f18 cfff b pb6"><span class="vm">{{userInfo.name}}</span><img class="vm" :src="gradelist[userInfo.grade - 1]" alt=""></div>
  29. <div class="f12 cfff op7">推荐码:{{userInfo.recommendcode}}</div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="user-level rel">
  34. <div class="df"><img class="abs absimg" src="./static/images/user-center-topcard-bottom.png" alt="">
  35. <div class="f14 cfff z-index-on">我的职级</div>
  36. <div class="f12 c999 flex1 tr z-index-on"> 保持当前级别还差{{exceedVal}}的交易</div>
  37. </div>
  38. <van-row class="tc pb8">
  39. <van-col span="2">
  40. <van-tag round color="#000" text-color="#fff">K{{userInfo.grade}}</van-tag>
  41. </van-col>
  42. <van-col span="20">
  43. <van-progress :percentage="userInfo.experience" :show-pivot="false"></van-progress>
  44. </van-col>
  45. <van-col span="2">
  46. <van-tag round color="#000" text-color="#fff">K{{userInfo.grade === 9 ? userInfo.grade : userInfo.grade + 1}}</van-tag>
  47. </van-col>
  48. </van-row>
  49. </div>
  50. </div>
  51. <div class="block-padding pb0 pt16 pl16 pr16" v-cloak>
  52. <div class="user-card bgcfff">
  53. <div class="df van-hairline--bottom pb8 pr16 pl16">
  54. <div class="cf">
  55. <div class="f12 c999"><span class="vm">账户余额(元)</span><span class="dib" @click="showMoney"><img class="show-btn vm" :src="isShow ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></span></div>
  56. <div class="index-num-b f16 c333 b">{{isShow ? `¥${balance}`: '****'}}</div>
  57. </div>
  58. <div class="flex1 tr"></div>
  59. </div>
  60. <div class="tl pr16 pl16">
  61. <van-row>
  62. <van-col span="12">
  63. <div class="f12 c999">累计收益(元)</div>
  64. <div class="index-num-b f16 c333 b">{{isShow ? `¥${total}` : '****'}}</div>
  65. </van-col>
  66. <van-col span="12">
  67. <div class="f12 c999">已提现金额(元)</div>
  68. <div class="index-num-b f16 c333 b">{{isShow ? `¥${tocash}`: '****'}}</div>
  69. </van-col>
  70. </van-row>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="block-padding pt16 pl16 pr16" v-cloak>
  75. <div class="user-card bgcfff">
  76. <div class="van-hairline--bottom pb8 tl pl16"><strong class="db f16">常用工具</strong></div>
  77. <van-grid class="pt8" :border="false" :icon-size="40" v-cloak>
  78. <van-grid-item class="gridicon" v-for="item,index in usercentericonlist" :text="item.Title" @click="gousercentericonlist(item.Url)">
  79. <template v-slot:icon><img :icon="PublicLib.CachePicture({picUrl:item.Icon,domid:'userIcon' + index})" :id="'userIcon' + index"></template>
  80. </van-grid-item>
  81. </van-grid>
  82. </div>
  83. </div>
  84. <div class="pb8 tc mt45"><img class="logo-bottom" src="./static/images/user-logo-gray.png" alt=""></div>
  85. </van-pull-refresh>
  86. <van-tabbar v-model="active" active-color="#FF502A" v-cloak v-if="tabsisshow">
  87. <van-tabbar-item icon="home-o" @click="index">首页
  88. <template #icon="props"><img :src="props.active ? icon1.active : icon1.inactive"></template>
  89. </van-tabbar-item>
  90. <van-tabbar-item icon="friends-o" @click="notice" :dot="isnotice">消息
  91. <template #icon="props"><img :src="props.active ? icon3.active : icon3.inactive"></template>
  92. </van-tabbar-item>
  93. <van-tabbar-item icon="setting-o">我的
  94. <template #icon="props"><img :src="props.active ? icon4.active : icon4.inactive"></template>
  95. </van-tabbar-item>
  96. </van-tabbar>
  97. </div>
  98. <script src="./static/js/klm-vv.min.js"></script>
  99. <script src="./static/js/klm-axios-config.js"></script>
  100. <script>
  101. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  102. // 可以通过下面的方式手动注册
  103. Vue.use(vant.Lazyload);
  104. // 在 #app 标签下渲染一个按钮组件
  105. let app = new Vue({
  106. el: '#app',
  107. data() {
  108. return {
  109. toptitleisshow:true,
  110. active: 2,
  111. userInfo:{
  112. name:'',
  113. header: '',
  114. recommendcode:'',
  115. grade: '',
  116. experience: 0
  117. },
  118. dialogisshow:false,
  119. isShow: false,
  120. balance: '',
  121. total: '',
  122. tocash: '',
  123. icon1: {
  124. active: './static/images/tab-icon1-active.png',
  125. inactive: './static/images/tab-icon1-no.png',
  126. },
  127. icon2: {
  128. active: './static/images/tab-icon2-active.png',
  129. inactive: './static/images/tab-icon2-no.png',
  130. },
  131. icon3: {
  132. active: './static/images/tab-icon3-active.png',
  133. inactive: './static/images/tab-icon3-no.png',
  134. },
  135. icon4: {
  136. active: './static/images/tab-icon4-active.png',
  137. inactive: './static/images/tab-icon4-no.png',
  138. },
  139. gradelist:[
  140. './static/images/grade-k1.png',
  141. './static/images/grade-k2.png',
  142. './static/images/grade-k3.png',
  143. './static/images/grade-k4.png',
  144. './static/images/grade-k5.png',
  145. './static/images/grade-k6.png',
  146. './static/images/grade-k7.png',
  147. './static/images/grade-k8.png',
  148. './static/images/grade-k9.png',
  149. ],
  150. usercentericonlist:[],
  151. //- 超越值
  152. exceedVal:'',
  153. //- 当前交易额
  154. currentTradeAmt:0.00,
  155. tabsisshow:'',
  156. isLoading:false,
  157. };
  158. },
  159. created() {
  160. this.tabsisshow = bottomtabisshow;
  161. this.getusercentericonlist();
  162. this.getuserinfo();
  163. this.getuseraccount();
  164. this.getuserrankinfo();
  165. },
  166. computed:{
  167. isnotice:function(){
  168. return PublicLib.getCookieInfo('noticeiscount') !== "";
  169. }
  170. },
  171. methods: {
  172. async onRefresh(){
  173. await this.getusercentericonlist();
  174. await this.getuserinfo();
  175. await this.getuseraccount();
  176. await this.getuserrankinfo();
  177. this.isLoading = false;
  178. },
  179. //- 显示余额状态
  180. showMoney(){
  181. this.isShow = !this.isShow;
  182. },
  183. //- 获取常用工具列表
  184. async getusercentericonlist(){
  185. const res = await getRequest('/api/v1/usercentericonlist/list',JSON.stringify({PageSize:8,PageNum:1}));
  186. //- TODO:
  187. //- if(res.status !== '1'){
  188. if(res.status === '1'){
  189. this.usercentericonlist = [
  190. {Icon:'./static/images/user-btn1@3x.png',Title:'收支明细',Url:'user-payment-list'},
  191. {Icon:'./static/images/user-btn5@3x.png',Title:'服务中心',Url:'user-service-list'},
  192. {Icon:'./static/images/user-btn6@3x.png',Title:'意见反馈',Url:'user-feedback'},
  193. {Icon:'./static/images/user-btn7@3x.png',Title:'创客守则',Url:'user-maker-code'},
  194. ]
  195. }else{
  196. this.usercentericonlist = res.data;
  197. res.data.forEach(item=>{
  198. PublicLib.CachePicture({picUrl:item.Icon});
  199. });
  200. }
  201. },
  202. //- 获取用户个人信息
  203. async getuserinfo(){
  204. const userId = PublicLib.getCookieInfo('userId');
  205. const res = await getRequest('/api/v1/users/personalinfo',JSON.stringify({Id:userId}));
  206. if(res.status === '1') {
  207. this.userInfo.name = res.data.RealName;
  208. this.userInfo.header = res.data.HeadPhoto;
  209. this.userInfo.recommendcode = res.data.MakerCode;
  210. //- this.userInfo.grade = res.data.UserLevel
  211. }
  212. },
  213. //- 获取用户账户信息
  214. async getuseraccount(){
  215. PublicLib.ShowLoading({Message:''});
  216. const UserId = PublicLib.getCookieInfo('userId');
  217. const res = await getRequest('/api/v1/useraccount/myaccount',JSON.stringify({UserId}));
  218. if(res.status === '1') {
  219. PublicLib.HideLoading();
  220. this.balance = tofixed2(res.data.BalanceAmount);
  221. this.total = tofixed2(res.data.BalanceAmount);
  222. this.tocash = tofixed2(res.data.WithdrawAmount);
  223. }
  224. },
  225. //- 获取用户职级信息
  226. async getuserrankinfo(){
  227. const UserId = PublicLib.getCookieInfo('userId');
  228. const res = await getRequest('/api/v1/userrank/detail',JSON.stringify({UserId}));
  229. if(res.status === '1') {
  230. this.exceedVal = res.data.ExceedVal;
  231. this.userInfo.grade = res.data.Rank;
  232. this.userInfo.experience = res.data.Percent;
  233. }else{
  234. this.userInfo.grade = 1;
  235. }
  236. },
  237. //- 跳转商城
  238. mall(){
  239. PublicLib.Goto({Url:'mall'});
  240. },
  241. //- 跳转主页
  242. index(){
  243. PublicLib.Goto({Url:'index'});
  244. },
  245. //- 跳转消息
  246. notice(){
  247. PublicLib.Goto({Url:'notice-center'});
  248. },
  249. withdrawal(){
  250. PublicLib.Goto({Url:'user-Withdrawal'});
  251. },
  252. gosetting(){
  253. PublicLib.Goto({Url:'user-setting'});
  254. },
  255. async gousercentericonlist(Url){
  256. PublicLib.Goto({Url});
  257. },
  258. userinfobtn(){
  259. PublicLib.Goto({Url:'user-info'});
  260. },
  261. }
  262. });
  263. </script>
  264. </body>
  265. </html>