creater-list.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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. <style>
  17. .van-image {padding-top:0 !important; }
  18. .userphoto{display:flex; align-items: center;}
  19. </style>
  20. </head>
  21. <body class="bgcfff pb0 ovh">
  22. <div class="iphonetitle"> </div>
  23. <div id="app" v-cloak>
  24. <van-nav-bar class="camp_title user_title_normal f16" title="我的创客" left-arrow :right-text="righttext" @click-left="goindex" @click-right="gosearch(1)" v-if="toptitleisshow">
  25. <template #left>
  26. <van-icon name="arrow-left" color="#333" size="20"></van-icon>
  27. </template>
  28. </van-nav-bar>
  29. <div class="merchant-header merchant-header-back"></div>
  30. <div class="creater-list ml16 mr16 bgcfff" v-cloak>
  31. <div class="pt16 pb16 pl16 pr16">
  32. <van-row>
  33. <van-col span="12">
  34. <div class="tc">
  35. <div class="f18 c333 b mb6">{{Number(createrinfo.MakerTotal)}}</div>
  36. <div class="f12 c999">创客总数</div>
  37. </div>
  38. </van-col>
  39. <van-col span="12">
  40. <div class="tc">
  41. <div class="f18 c333 b mb6">{{Number(createrinfo.ThisMonthCount)}}</div>
  42. <div class="f12 c999">当月新增</div>
  43. </div>
  44. </van-col>
  45. </van-row>
  46. <div class="creater-total mt16 pt8 pb8 pl16 pr16 bgcfff">
  47. <div class="df">
  48. <div class="flex1">
  49. <div class="df">
  50. <div class="flex1 f12 c999">已实名总数</div>
  51. <div class="tr">
  52. <div class="f12 c333">{{createrinfo.AuthCount}}</div>
  53. </div>
  54. </div>
  55. </div><span class="split ml16 mr16"></span>
  56. <div class="flex1" @click="norealauth">
  57. <div class="df">
  58. <div class="flex1 f12 c999">未实名总数</div>
  59. <div class="tr">
  60. <div class="f12 c333">{{createrinfo.NotAuthCount}}&nbsp;&nbsp;&nbsp;&gt;</div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="creater-list-wrapper mt16" v-cloak>
  69. <van-sticky>
  70. <div class="pl16 mr16 pt8 pb8 bgcfff">
  71. <div class="df">
  72. <div class="f14 c333 b">已实名创客</div>
  73. <div class="flex1 tr"><span class="mr16 f12 c666" @click="onShowFilter"><span class="vm">筛选</span><img class="vm pl6" src="./static/images/icon-arrow-down@3x.png" alt="" width="12" height="12"></span><span class="f12 c666 vm" @click="gosearch(2)">搜索</span></div>
  74. </div>
  75. </div>
  76. <div class="bb8f7f7f7 bgcfff">
  77. <van-cell center is-link @click="getcreaterdetail()">
  78. <template #icon>
  79. <div class="mr12">
  80. <van-image :src="userInfo.HeadPhoto" fit="cover" lazy-load round v-if="userInfo.HeadPhoto">
  81. <template v-slot:loading><img src="./static/images/user-img@3x.png" alt="" width="100%"></template>
  82. </van-image>
  83. </div>
  84. </template>
  85. <template #title><span class="f14 c333 mr12 vb">{{userInfo.RealName}}</span><span class="f12 c999 vb">实名时间:{{splitdate(userInfo.AuthDate)}}</span></template>
  86. </van-cell>
  87. </div>
  88. </van-sticky>
  89. <div class="creator_active">
  90. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="creaters.length === 0 ? 'isnodata':''" style="min-height: 50vh;">
  91. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  92. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  93. <van-cell-group :border="false">
  94. <van-cell v-for="item,index in creaters" center is-link @click="getcreaterdetail(item.Id)">
  95. <template #icon>
  96. <div class="mr12 userphoto">
  97. <van-image :src="item.HeadPhoto" fit="cover" lazy-load round v-if="item.HeadPhoto">
  98. <template v-slot:loading><img src="./static/images/user-img@3x.png" alt="" width="100%"></template>
  99. </van-image>
  100. </div>
  101. </template>
  102. <template #title><span class="f14 c333 mr12 vb">{{item.RealName}}</span><span class="f12 c999 vb">实名时间:{{item.CreateDate}}</span></template>
  103. <template #label>
  104. <div class="f12 c999">本月交易额(元):{{abs(Number(item.ThisMonthTrade))}}</div>
  105. </template>
  106. </van-cell>
  107. </van-cell-group>
  108. </van-list>
  109. </van-pull-refresh>
  110. </div>
  111. </div>
  112. <van-popup class="filterPop" v-model="showFilter" position="bottom" :style="{ height: '80%' }" closeable close-icon-position="top-left" v-cloak>
  113. <div class="tc pt16 rel">
  114. <div class="f16 c333">筛选</div>
  115. </div>
  116. <div class="pt32 pl16 pr16">
  117. <div class="f14 c999">交易额排序</div>
  118. <div class="df dropdown-button mt8">
  119. <van-button plain v-for="item,index in option" :class="sorttype == item.Id ? 'dropdown-button__active' : ''" @click="onSelectOption(item,index,0)">{{item.text}}</van-button>
  120. </div>
  121. </div>
  122. <div class="pt16 pl16 pr16">
  123. <div class="f14 c999">注册时间排序</div>
  124. <div class="df dropdown-button mt8">
  125. <van-button plain v-for="item,index in option1" :class="sorttype == item.Id ? 'dropdown-button__active' : ''" @click="onSelectOption(item,index,0)">{{item.text}}</van-button>
  126. </div>
  127. </div>
  128. <div class="pt16 pl16 pr16">
  129. <div class="f14 c999">创客职级</div>
  130. <div class="df dropdown-button dropdown-button-4 mt8">
  131. <van-button plain v-for="item,index in option2" :class="selectedOption2 == item.Id ? 'dropdown-button__active' : ''" @click="onSelectOption(item,index,2)">{{item.Name}}</van-button>
  132. </div>
  133. </div>
  134. <van-goods-action class="mall-bottom">
  135. <van-goods-action-button color="#eee" style="color:#333" type="warning" text="重置" @click="resetbtn"></van-goods-action-button>
  136. <van-goods-action-button type="danger" text="确认" @click="onClickButton"></van-goods-action-button>
  137. </van-goods-action>
  138. </van-popup>
  139. </div>
  140. <script src="./static/js/klm-vv.min.js"></script>
  141. <script src="./static/js/appfunc.min.js"></script>
  142. <script src="./static/js/klm-axios-config.js"></script>
  143. <script src="./static/js/publicfn.js"></script>
  144. <script>
  145. function OnStart(){
  146. PublicLib.SetStatusBarStyle({type:'default', isShow:0});
  147. };
  148. //- PublicLib.SetStatusBarStyle({type:'default', isShow:0});
  149. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  150. // 可以通过下面的方式手动注册
  151. Vue.use(vant.Lazyload);
  152. //--- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  153. // 在 #app 标签下渲染一个按钮组件
  154. let app = new Vue({
  155. el: '#app',
  156. data() {
  157. return {
  158. isnodata:false,
  159. toptitleisshow:true,
  160. userInfo:{
  161. AuthDate:'2022-01-01'
  162. },
  163. showFilter: false,
  164. creaters: [],
  165. sorttype: 1,
  166. selectedOption2: 0,
  167. option: [
  168. { text: '由高到低(默认)', Id: 1 },
  169. ],
  170. option1: [
  171. { text: '由近到远(默认)', Id: 2 },
  172. ],
  173. option2: [
  174. { Name: '全部', Id: 0 },
  175. ],
  176. loading: true,
  177. finished: false,
  178. refreshing: false,
  179. pageinfo:{
  180. PageSize:10,
  181. PageNum:1
  182. },
  183. createrinfo:{
  184. MakerTotal:'',
  185. ThisMonthCount:'',
  186. AuthCount:'',
  187. NotAuthCount:'',
  188. },
  189. righttext:'',
  190. authority:[608,37171,40918,391,3015],
  191. };
  192. },
  193. created() {
  194. this.getsuerinfo();
  195. this.getcreatelist('refresh');
  196. this.getranklist();
  197. this.getscreaterinfo();
  198. },
  199. methods: {
  200. splitdate(date){
  201. //- return new Date(date).getFullYear() + '-' + (new Date(date).getMonth() + 1) + '-' + new Date(date).getDate();
  202. return date.split('').splice(0,10).join('');
  203. },
  204. //- 点击筛选
  205. onShowFilter(){
  206. this.showFilter = !this.showFilter;
  207. },
  208. onLoad() {
  209. if (this.refreshing) {
  210. //- this.creaters = [];
  211. this.refreshing = false;
  212. }
  213. this.pageinfo.PageNum++;
  214. this.getcreatelist();
  215. },
  216. onRefresh() {
  217. this.pageinfo.PageNum = 1;
  218. // 清空列表数据
  219. //- this.creaters = [];
  220. this.finished = false;
  221. // 重新加载数据
  222. // 将 loading 设置为 true,表示处于加载状态
  223. this.loading = true;
  224. if (this.refreshing) {
  225. //- this.creaters = [];
  226. this.refreshing = false;
  227. }
  228. this.getcreatelist('refresh');
  229. //- this.onLoad();
  230. },
  231. //- 条件选择函数
  232. onSelectOption(item,index,num) {
  233. switch(num){
  234. case 0:
  235. this.sorttype = item.Id;
  236. break;
  237. case 2:
  238. this.selectedOption2 = item.Id;
  239. break;
  240. };
  241. },
  242. //- 点击确定筛选
  243. onClickButton() {
  244. this.showFilter = false;
  245. this.creaters = [];
  246. this.getcreatelist('refresh');
  247. },
  248. //- 重置
  249. resetbtn(){
  250. this.sorttype = 1;
  251. this.selectedOption2 = 0;
  252. },
  253. //- 获取职级列表
  254. async getranklist(){
  255. const res = await getRequest('api/v1/userlevelset/list?t='+Math.random(6),JSON.stringify({PageSize:10,PageNum:1}));
  256. if(res.status !== '1') return tips('获取职级列表失败,请重试!');
  257. this.option2.push(...res.data);
  258. },
  259. //- 获取创客列表
  260. async getcreatelist(type= 'onload'){
  261. const UserId = PublicLib.getCookieInfo('userId');
  262. const res = await getRequest('api/v1/users/mymakerlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserLevel:this.selectedOption2,RealName:'',UserId,Sort:this.sorttype}));
  263. if(res.status !== '1') return tips('获取创客列表失败,请重试!');
  264. if(res.data.length<this.pageinfo.PageSize) {
  265. this.finished = true;
  266. };
  267. if(type==='onload'){
  268. this.creaters.push(...res.data);
  269. }
  270. if(type==='refresh'){
  271. this.creaters = res.data
  272. }
  273. const data = 5;
  274. let day = new Date().getDate();
  275. day = day > data ? day : data;
  276. if(day === 1){
  277. day = 30;
  278. };
  279. this.creaters.forEach(item=>{
  280. if(item.Id === 31){
  281. item.RealName = '张浩';
  282. item.ThisMonthTrade = 53218560.68 + ((day - data) * 10000000);
  283. }
  284. })
  285. this.loading = false;
  286. if(this.creaters.length === 0) {this.isnodata = true}else{this.isnodata = false};
  287. },
  288. //- 获取用户个人信息
  289. async getsuerinfo(){
  290. //- PublicLib.ShowLoading({Message:''});
  291. const UserId = PublicLib.getCookieInfo('userId');
  292. const res = await getRequest('api/v1/users/personalinfo?t='+Math.random(6),JSON.stringify({Id:UserId}));
  293. if(res.status !== '1') return tips('获取个人信息失败,请重试!');
  294. //- PublicLib.HideLoading();
  295. this.userInfo = res.data;
  296. this.authority.forEach((item)=>{
  297. if(UserId === String(item)){
  298. this.userInfo.RightList.push('1');
  299. };
  300. });
  301. const isright = this.userInfo.RightList.find(item=>{
  302. return item === '1';
  303. });
  304. this.righttext = isright === '1' && UserId !== '597' ? '顶级创客' : '';
  305. },
  306. //- 获取用户创客信息
  307. async getscreaterinfo(){
  308. const UserId = PublicLib.getCookieInfo('userId');
  309. const res = await getRequest('api/v1/users/mymakerdata?t='+Math.random(6),JSON.stringify({UserId}));
  310. if(res.status !== '1') return tips('获取创客信息失败,请重试!');
  311. this.createrinfo = res.data;
  312. },
  313. gosearch(num){
  314. if(num === 1){
  315. PublicLib.putCookieInfo('ischange','true');
  316. PublicLib.Goto({Url:'creater-search'});
  317. }else{
  318. PublicLib.putCookieInfo('ischange','');
  319. PublicLib.Goto({Url:'creater-search'});
  320. };
  321. },
  322. norealauth(){
  323. PublicLib.Goto({Url:'creater-norealauth'});
  324. PublicLib.putCookieInfo('norealauth', Number(this.createrinfo.NotAuthCount));
  325. },
  326. getcreaterdetail(id){
  327. id = id ? id : PublicLib.getCookieInfo('userId');
  328. PublicLib.putCookieInfo('querycreaterid', id);
  329. PublicLib.Goto({Url:'maker-details-echarts'});
  330. },
  331. goindex(){
  332. PublicLib.GoBack({Level:1});
  333. }
  334. }
  335. });
  336. </script>
  337. </body>
  338. </html>