creater-list.html 13 KB

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