user-center1.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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 bgc-back pt0 ovh" style="padding-top:0;">
  18. <div id="app" v-cloak>
  19. <div class="ovh-x" ref="wrapper1">
  20. <van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="height:100%;">
  21. <div class="user-center-header">
  22. <div class="tr pt8" v-if="toptitleisshow">
  23. <div class="setting-btn dib" @click="gosetting"><img width="100%" src="./static/images/setting@3x.png"></div>
  24. </div>
  25. <div class="df pb16" v-cloak @click="userinfobtn">
  26. <div class="user-img" style="overflow:hidden;"><img :src="PublicLib.CachePicture({picUrl:userInfo.header,domid:'usercenterimg'})" id="usercenterimg" style="width:100%;height:100%;"></div>
  27. <div class="user-info cm">
  28. <div class="tl">
  29. <div class="f18 c333 b pb6"><span class="vm">创业帮001</span><img class="vm" :src="gradelist[userInfo.grade - 1]" alt=""></div>
  30. <div class="f12 cfff op7 c333">推荐码:K00000001</div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="block-padding pb0 pt16 pl16 pr16" v-cloak>
  36. <div class="user-card bgcfff">
  37. <div class="df van-hairline--bottom pb8 pr16 pl16">
  38. <div class="cf">
  39. <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>
  40. <div class="index-num-b f16 c333 b">{{isShow ? `¥0`: '****'}}</div>
  41. </div>
  42. <div class="flex1 tr bc333"></div>
  43. </div>
  44. <div class="tl pr16 pl16">
  45. <van-row>
  46. <van-col span="12">
  47. <div class="f12 c999">累计收益</div>
  48. <div class="index-num-b f16 c333 b">{{isShow ? `¥0` : '****'}}</div>
  49. </van-col>
  50. <van-col span="12">
  51. <div class="f12 c999">已提现金额</div>
  52. <div class="index-num-b f16 c333 b">{{isShow ? `¥0`: '****'}}</div>
  53. </van-col>
  54. </van-row>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="block-padding pt16 pl16 pr16" v-cloak>
  59. <div class="user-card bgcfff">
  60. <div class="van-hairline--bottom pb8 tl pl16"><strong class="db f16">常用工具</strong></div>
  61. <van-grid class="pt8" :border="false" :icon-size="40" v-cloak>
  62. <van-grid-item class="gridicon" v-for="item,index in usercentericonlist" :text="item.Title" @click="gousercentericonlist(item.Url)">
  63. <template v-slot:icon><img :src="PublicLib.CachePicture({picUrl:item.Icon,domid:'userIcon' + index})" :id="'userIcon' + index"></template>
  64. </van-grid-item>
  65. </van-grid>
  66. </div>
  67. </div>
  68. <div class="pb8 tc mt45"><img class="logo-bottom" src="./static/images/user-logo-gray.png" alt=""></div>
  69. </van-pull-refresh>
  70. </div>
  71. <van-tabbar v-model="active" active-color="#333" inactive-color="#999" v-cloak v-if="tabsisshow">
  72. <van-tabbar-item icon="home-o" @click="index">首页
  73. <template #icon="props"><img :src="props.active ? icon1.active : icon1.inactive"></template>
  74. </van-tabbar-item>
  75. <van-tabbar-item icon="search" @click="mall">商城
  76. <template #icon="props"><img :src="props.active ? icon2.active : icon2.inactive"></template>
  77. </van-tabbar-item>
  78. <van-tabbar-item icon="friends-o" @click="notice" :dot="isnotice">消息
  79. <template #icon="props"><img :src="props.active ? icon3.active : icon3.inactive"></template>
  80. </van-tabbar-item>
  81. <van-tabbar-item icon="setting-o">我的
  82. <template #icon="props"><img :src="props.active ? icon4.active : icon4.inactive"></template>
  83. </van-tabbar-item>
  84. </van-tabbar>
  85. </div>
  86. <script src="./static/js/klm-vv.min.js"></script>
  87. <script src="./static/js/appfunc.min.js"></script>
  88. <script src="./static/js/klm-axios-config.js"></script>
  89. <script src="./static/js/publicfn.js"></script>
  90. <script>
  91. function OnStart(){
  92. PublicLib.SetStatusBarBgColor({bgcolor:'FFD500'});
  93. PublicLib.SetStatusBarStyle({type:'default', isShow:1});
  94. app.getuserinfo();
  95. app.getuseraccount();
  96. app.verificationrealauth();
  97. };
  98. PublicLib.SetStatusBarBgColor({bgcolor:'FFD500'});
  99. PublicLib.SetStatusBarStyle({type:'default', isShow:1});
  100. // 通过 CDN 引入时不会自动注册 Lazyload 组件0
  101. // 可以通过下面的方式手动注册
  102. Vue.use(vant.Lazyload);
  103. // 在 #app 标签下渲染一个按钮组件
  104. let app = new Vue({
  105. el: '#app',
  106. data() {
  107. return {
  108. realauth:false,
  109. isnotice:false,
  110. toptitleisshow:true,
  111. active: 3,
  112. userInfo:{
  113. name:'',
  114. header: '',
  115. recommendcode:'',
  116. grade: '',
  117. experience: 0
  118. },
  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. this.verificationrealauth();
  166. },
  167. mounted(){
  168. this.$nextTick(() => {
  169. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight}px`;
  170. });
  171. },
  172. computed:{
  173. isnotice:function(){
  174. return PublicLib.getCookieInfo('noticeiscount') === "";
  175. }
  176. },
  177. methods: {
  178. async verificationrealauth(){
  179. const Id = PublicLib.getCookieInfo('userId');
  180. const userinfo = await getRequest('api/v1/users/personalinfo',JSON.stringify({Id}));
  181. //- 是否实名认证完毕
  182. if(userinfo.data.AuthFlag !== 1) {
  183. this.realauth = true;
  184. }else{
  185. this.realauth = false;
  186. };
  187. },
  188. async onRefresh(){
  189. await this.getusercentericonlist();
  190. await this.getuserinfo();
  191. await this.getuseraccount();
  192. //- await this.getuserrankinfo();
  193. this.isLoading = false;
  194. },
  195. //- 显示余额状态
  196. showMoney(){
  197. this.isShow = !this.isShow;
  198. },
  199. //- 获取常用工具列表
  200. async getusercentericonlist(){
  201. //- const res = await getRequest('api/v1/usercentericonlist/list',JSON.stringify({PageSize:8,PageNum:1}));
  202. //- TODO:
  203. //- if(res.status !== '1'){
  204. //- if(res.status === '1'){
  205. this.usercentericonlist = [
  206. {Icon:'./static/images/user-btn1@3x.png',Title:'收支明细',Url:'user-payment-list1'},
  207. //- {Icon:'./static/images/user-btn2@3x.png',Title:'提现记录',Url:'user-withdrawal-list'},
  208. //- {Icon:'./static/images/user-btn3@3x.png',Title:'排行版',Url:'user-ranking'},
  209. //- {Icon:'./static/images/user-btn4@3x.png',Title:'邀请好友',Url:'invite-frend'},
  210. {Icon:'./static/images/user-btn5@3x.png',Title:'服务中心',Url:'user-service-list1'},
  211. {Icon:'./static/images/user-btn6@3x.png',Title:'意见反馈',Url:'user-feedback1'},
  212. {Icon:'./static/images/user-btn7@3x.png',Title:'创客守则',Url:'user-maker-code'},
  213. //- {Icon:'./static/images/user-btn8@3x.png',Title:'授权证明',Url:'user-certificate-of-authorization'},
  214. ]
  215. //- }else{
  216. //- this.usercentericonlist = res.data;
  217. //- }
  218. },
  219. //- 获取用户个人信息
  220. async getuserinfo(){
  221. const userId = PublicLib.getCookieInfo('userId');
  222. const res = await getRequest('api/v1/users/personalinfo',JSON.stringify({Id:userId}));
  223. if(res.status === '1') {
  224. this.userInfo.name = res.data.RealName;
  225. this.userInfo.header = res.data.HeadPhoto;
  226. this.userInfo.recommendcode = res.data.MakerCode;
  227. //- this.userInfo.grade = res.data.UserLevel
  228. };
  229. },
  230. //- 获取用户账户信息
  231. async getuseraccount(){
  232. PublicLib.ShowLoading({Message:''});
  233. const UserId = PublicLib.getCookieInfo('userId');
  234. const res = await getRequest('api/v1/useraccount/myaccount',JSON.stringify({UserId}));
  235. if(res.status === '1') {
  236. PublicLib.HideLoading();
  237. this.balance = tofixed2(res.data.BalanceAmount);
  238. this.total = tofixed2(res.data.BalanceAmount);
  239. this.tocash = tofixed2(res.data.WithdrawAmount);
  240. };
  241. },
  242. //- //- 获取用户职级信息
  243. //- async getuserrankinfo(){
  244. //- const UserId = PublicLib.getCookieInfo('userId');
  245. //- const res = await getRequest('api/v1/userrank/detail',JSON.stringify({UserId}));
  246. //- if(res.status === '1') {
  247. //- this.exceedVal = res.data.ExceedVal;
  248. //- this.userInfo.grade = res.data.Rank;
  249. //- this.userInfo.experience = res.data.Percent;
  250. //- }else{
  251. //- this.userInfo.grade = 1;
  252. //- };
  253. //- },
  254. //- 跳转商城
  255. mall(){
  256. PublicLib.Goto({Url:'mall'});
  257. },
  258. //- 跳转主页
  259. index(){
  260. PublicLib.Goto({Url:'index'});
  261. },
  262. //- 跳转消息
  263. notice(){
  264. PublicLib.Goto({Url:'notice-center'});
  265. },
  266. withdrawal(){
  267. if(this.realauth){
  268. PublicLib.ShowDialog({
  269. Title:'暂未实名认证',
  270. Message:'是否去实名认证?',
  271. ConfirmText:'去实名',
  272. CancelText:'暂不实名',
  273. ConfirmAction:'app.goAuth()',
  274. CanelAction:''
  275. });
  276. return;
  277. }
  278. PublicLib.Goto({Url:'user-Withdrawal'});
  279. },
  280. gosetting(){
  281. PublicLib.Goto({Url:'user-setting1'});
  282. },
  283. async gousercentericonlist(Url){
  284. PublicLib.Goto({Url});
  285. },
  286. userinfobtn(){
  287. PublicLib.Goto({Url:'user-info1'});
  288. },
  289. myrank(){
  290. PublicLib.Goto({Url:'user-rank'});
  291. },
  292. goAuth(){
  293. PublicLib.Goto({Url:'user-realauth'});
  294. },
  295. }
  296. });
  297. </script>
  298. </body>
  299. </html>