index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. <template>
  2. <div
  3. :class="mobile ? 'mobileMain' : ''"
  4. :style="{
  5. marginTop: mainMarginTop,
  6. marginBottom: mobile ? '0px' : '30px !important'
  7. }"
  8. >
  9. <div class="developer-container" v-if="!mobile">
  10. <div class="developer-left">
  11. <!-- 接单流程:start -->
  12. <section class="developer-process block" v-if="!is_freework_level || !isSign ">
  13. <h3 class="title">接单流程</h3>
  14. <div class="developer-process-list">
  15. <article class="developer-process-item cur">
  16. <div class="developer-process-step line">
  17. <div class="developer-process-step-icon icon-1"></div>
  18. <div class="developer-process-step-content">注册</div>
  19. </div>
  20. <div class="developer-process-tips">成为客栈注册用户</div>
  21. </article>
  22. <article
  23. class="developer-process-item"
  24. :class="{
  25. cur: isSign
  26. }"
  27. >
  28. <div class="developer-process-step normal line">
  29. <div class="developer-process-step-icon icon-2"></div>
  30. <div class="developer-process-step-content">签约开发者</div>
  31. </div>
  32. <div class="developer-process-tips">
  33. <p v-if="!isSign">
  34. 尚未签约
  35. <a
  36. @click="cnzz('开发者首页', '立即签约', '')"
  37. href="/sign/new_v2"
  38. >立即签约</a
  39. >
  40. </p>
  41. <p v-else>已签约</p>
  42. </div>
  43. </article>
  44. <article
  45. class="developer-process-item"
  46. :class="is_freework_level ? 'cur' : ''"
  47. >
  48. <div class="developer-process-step normal line">
  49. <div
  50. class="developer-process-step-icon icon-3"
  51. :class="is_freework_level ? 'icon-1' : 'icon-2'"
  52. ></div>
  53. <div class="developer-process-step-content">技术等级认证</div>
  54. </div>
  55. <div class="developer-process-tips">
  56. <p>
  57. 派单第一优先,认证永久保留!
  58. <a
  59. v-if="!is_freework_level"
  60. @click="cnzz('开发者首页', '立即认证', '')"
  61. href="/frontend/skill_cert/profile"
  62. >立即认证</a
  63. >
  64. </p>
  65. </div>
  66. </article>
  67. <article class="developer-process-item" :class="isSign ? '' : ''">
  68. <div class="developer-process-step normal">
  69. <div class="developer-process-step-icon icon-4"></div>
  70. <div class="developer-process-step-content">开始接单</div>
  71. </div>
  72. <!-- <div class="developer-process-tips">内容已通过</div>-->
  73. </article>
  74. </div>
  75. </section>
  76. <!-- 接单流程:end -->
  77. <!-- 新人如何接单:start -->
  78. <section class="developer-order block">
  79. <h3 class="title">新人如何接单</h3>
  80. <p class="tips">
  81. 客栈接单采用智能对接池匹配原则,权重越高优先匹配。当前在对接池的<span
  82. style="color: #308eff;font-weight: bold;"
  83. >排名{{ userInfo.rand_score || "100+" }}</span
  84. >,影响对接池的因素有以下几点:
  85. </p>
  86. <div class="developer-order-list">
  87. <article class="developer-order-item developer-order-item-activity">
  88. <div class="developer-order-title-area">
  89. <div class="developer-order-title-area-wrap">
  90. <div class="developer-order-icon icon-2"></div>
  91. <h5 class="developer-order-title">
  92. <span>开通开发者会员</span>
  93. </h5>
  94. </div>
  95. <div class="developer-order-link">
  96. <a
  97. @click="cnzz('开发者首页', '会员介绍', '')"
  98. href="/type/vip/developer"
  99. >会员介绍</a
  100. >
  101. </div>
  102. </div>
  103. <p class="developer-order-tips">
  104. 开通会员提高权重,享受更多权益!
  105. </p>
  106. </article>
  107. <article class="developer-order-item">
  108. <div class="developer-order-title-area">
  109. <div class="developer-order-title-area-wrap">
  110. <div class="developer-order-icon icon-4"></div>
  111. <h5 class="developer-order-title">协作认证</h5>
  112. </div>
  113. <div class="developer-order-link">
  114. <a
  115. @click="cnzz('开发者首页', '立即认证', '')"
  116. href="/credit/professional"
  117. >立即认证</a
  118. >
  119. </div>
  120. </div>
  121. <p class="developer-order-tips">
  122. 项目经理、协作开发者、全职自由工作者等
  123. </p>
  124. </article>
  125. <!-- <article class="developer-order-item">
  126. <div class="developer-order-title-area">
  127. <div class="developer-order-title-area-wrap">
  128. <div class="developer-order-icon icon-1"></div>
  129. <h5 class="developer-order-title">完善个人资料<span v-if="userGrade">({{userGrade}})</span></h5>
  130. </div>
  131. <div class="developer-order-link">
  132. <a :click="this.cnzz('开发者首页','立即完善','')" :href="'/wo/'+userinfo.uid">立即完善</a>
  133. </div>
  134. </div>
  135. <p class="developer-order-tips">
  136. 账号信息完善度(个人信息+简历+作品)越高,客户信任感更高,也更容易为您精准匹配。
  137. </p>
  138. </article> -->
  139. <article class="developer-order-item">
  140. <div class="developer-order-title-area">
  141. <div class="developer-order-title-area-wrap">
  142. <div class="developer-order-icon icon-1"></div>
  143. <h5 class="developer-order-title">添加作品</h5>
  144. </div>
  145. <div class="developer-order-link">
  146. <a
  147. @click="cnzz('开发者首页', '去添加', '')"
  148. href="/otherpage/works/create"
  149. >去添加</a
  150. >
  151. </div>
  152. </div>
  153. <p class="developer-order-tips">
  154. 添加更多作品,增加对接池权重
  155. </p>
  156. </article>
  157. <div class="developer-activity-tips">100%派单</div>
  158. </div>
  159. </section>
  160. <!-- 新人如何接单:end -->
  161. <!-- 推荐tab:start -->
  162. <section class="developer-tab block">
  163. <div class="developer-tab-title-list">
  164. <div class="left_box">
  165. <span
  166. v-for="typeItem in typeList"
  167. :key="typeItem.typeId"
  168. @click="reset(typeItem.typeId)"
  169. :data-typeid="typeItem.typeId"
  170. :class="tid == typeItem.typeId ? 'cur' : ''"
  171. class="developer-tab-title-item"
  172. >
  173. {{ typeItem.name }}
  174. </span>
  175. </div>
  176. <a target="_blank" href="https://jishuin.proginn.com/" class="more developer-tab-title-item">
  177. 更多
  178. </a>
  179. </div>
  180. <div class="developer-tab-main">
  181. <p class="developer-tab-tips">
  182. PC端圈子发布功能尚未上线,可下载APP体验哦~
  183. </p>
  184. <ul class="developer-dynamic-list" v-if="list.length > 0">
  185. <li
  186. v-for="dynamic in list"
  187. :key="dynamic.dynamicId"
  188. class="developer-dynamic-item"
  189. >
  190. <div class="dynamic-user">
  191. <a
  192. :href="
  193. 'https://jishuin.proginn.com/u/' + dynamic.user_info.uid
  194. "
  195. class="dynamic-user-avatar"
  196. >
  197. <img :src="dynamic.user_info.icon_url" />
  198. <a
  199. v-if="dynamic.user_info.is_vip == 1"
  200. href="/type/vip/developer"
  201. target="view_window"
  202. class="dynamic-user-avatar-vip-icon"
  203. ></a>
  204. </a>
  205. <div class="dynamic-user-info">
  206. <p class="dynamic-user-nickname text-line-1">
  207. <span>{{ dynamic.user_info.nickname }}</span
  208. ><a
  209. href="/frontend/skill_cert/profile"
  210. target="view_window"
  211. v-if="dynamic.user_info.freework_level > 0"
  212. class="dynamic-level"
  213. >T{{ dynamic.user_info.freework_level }}</a
  214. >
  215. </p>
  216. <p class="dynamic-job">
  217. {{ dynamic.user_info.tag[0].name }} ·
  218. {{ dynamic.user_info.tag[1].name }}
  219. </p>
  220. </div>
  221. </div>
  222. <div
  223. class="dynamic-title dynamic-margin"
  224. v-html="dynamic.title_web"
  225. ></div>
  226. <div class="dynamic-type-list dynamic-margin">
  227. <span class="dynamic-type-item">{{ dynamic.type_text }}</span>
  228. </div>
  229. <div
  230. class="dynamic-img-area dynamic-margin"
  231. v-if="dynamic.img && dynamic.img.length > 0"
  232. >
  233. <div
  234. class="dynamic-img-item"
  235. v-for="d_img in dynamic.img"
  236. :key="d_img.img"
  237. >
  238. <!-- <img :src="d_img.img" /> -->
  239. <el-image
  240. style="width:90px;height:90px"
  241. fit="cover"
  242. :src="d_img.img"
  243. :preview-src-list="dynamic.imgList"
  244. >
  245. </el-image>
  246. </div>
  247. </div>
  248. <div
  249. class="dynamic-link-area dynamic-margin"
  250. @click.capture.stop="clickResource(dynamic.resources)"
  251. v-if="dynamic.resources.resources_exist == 1"
  252. >
  253. <div class="dynamic-link-img-area">
  254. <img :src="dynamic.resources.resources_img" />
  255. </div>
  256. <div class="dynamic-link-content text-line-1">
  257. <span :href="dynamic.resources.resources_url">{{
  258. dynamic.resources.resources_title
  259. }}</span>
  260. </div>
  261. </div>
  262. <div class="dynamic-control">
  263. <div class="dynamic-control-item" @click="gotoAppTips">
  264. <span class="dynamic-icon icon-share"></span>分享
  265. </div>
  266. <div class="dynamic-control-item" @click="gotoAppTips">
  267. <span class="dynamic-icon icon-comment"></span>评论
  268. </div>
  269. <div class="dynamic-control-item" @click="gotoAppTips">
  270. <span class="dynamic-icon icon-like"></span>赞
  271. </div>
  272. </div>
  273. </li>
  274. </ul>
  275. <div class="dynamic-empty" v-else>
  276. <Empty></Empty>
  277. <p>暂无动态</p>
  278. </div>
  279. </div>
  280. </section>
  281. <!-- 推荐tab:start -->
  282. </div>
  283. <div class="developer-right">
  284. <!-- 工作台:start -->
  285. <section class="developer-workbench block">
  286. <div
  287. class="developer-workbench-user"
  288. @click="linkToUser"
  289. :class="isLogin ? 'developer-workbench-user-logined' : ''"
  290. >
  291. <div class="developer-user-avatar">
  292. <img :src="userInfo.icon_url || personalIcon" />
  293. <template v-if="isLogin">
  294. <span
  295. class="developer-flag"
  296. :class="
  297. isDeveloperVip
  298. ? 'developer-vip-flag'
  299. : 'developer-notvip-flag'
  300. "
  301. ></span>
  302. </template>
  303. </div>
  304. <div class="developer-user-info">
  305. <div v-if="isLogin" class="developer-user-name text-line-1">
  306. {{ userInfo.nickname }}
  307. </div>
  308. <div
  309. @click="login"
  310. v-else
  311. class="developer-user-name nologin text-line-1"
  312. >
  313. 登录/注册
  314. </div>
  315. <div v-if="isLogin" class="developer-user-level">
  316. <span>uid:{{ userinfo.uid }}</span>
  317. </div>
  318. <div
  319. class="developer-user-level"
  320. @click.stop="levelIntroduceVisible = true"
  321. >
  322. <span class="arrow_icon"
  323. >当前等级Lv.{{ userInfo.dynamic_rand || 0 }}
  324. </span>
  325. </div>
  326. </div>
  327. <div class="developer-use-vip">
  328. <a
  329. class="developer-vip-btn-area"
  330. @click.stop=""
  331. href="/type/vip/developer"
  332. target="view_window"
  333. :class="
  334. isDeveloperVip
  335. ? 'developer-vip-renewal-btn'
  336. : 'developer-vip-apply-btn'
  337. "
  338. >
  339. </a>
  340. <!-- 如果已登录 并且 是vip ,显示会员日期 -->
  341. <div v-if="isVipMode" class="developer-vip-end-date">
  342. {{ userinfo.vip_end_date }} 到期
  343. </div>
  344. </div>
  345. </div>
  346. <h5 class="user-title">工作台</h5>
  347. <div class="developer-work-list">
  348. <div
  349. class="developer-work-item"
  350. @click="goto('/wo/work_todo', '工作台')"
  351. >
  352. <div class="developer-work-count">
  353. {{ workPlatInfo.pendingNumber || 0 }}
  354. </div>
  355. <div class="developer-work-tips">待办</div>
  356. </div>
  357. <div class="developer-work-item" @click="gotoAppTips">
  358. <div class="developer-work-count">
  359. {{ workPlatInfo.recruitDeveloperCount || 0 }}
  360. </div>
  361. <div class="developer-work-tips">沟通</div>
  362. </div>
  363. <div
  364. class="developer-work-item"
  365. @click="goto('/wo/work_hire', '工作')"
  366. >
  367. <div class="developer-work-count">
  368. {{ workPlatInfo.developerWorkNumber || 0 }}
  369. </div>
  370. <div class="developer-work-tips">工作</div>
  371. </div>
  372. <div
  373. class="developer-work-item"
  374. @click="goto('/wo/work_platform', '整包')"
  375. >
  376. <div class="developer-work-count">
  377. {{ workPlatInfo.developerProjectNumber || 0 }}
  378. </div>
  379. <div class="developer-work-tips">整包</div>
  380. </div>
  381. </div>
  382. <div class="developer-setting-area">
  383. <div
  384. class="developer-setting-item"
  385. @click="goto('/setting/work', '接单设置')"
  386. >
  387. <div class="developer-setting-icon setting-icon"></div>
  388. <div class="developer-setting-tips ">接单设置</div>
  389. </div>
  390. <div class="developer-setting-item">
  391. <div class="developer-setting-icon ping-icon"></div>
  392. <div class="developer-setting-tips" @click="ping(2)">Ping</div>
  393. </div>
  394. <div class="developer-setting-line"></div>
  395. </div>
  396. </section>
  397. <!-- 工作台:end -->
  398. <!-- 收入:start -->
  399. <section
  400. @click.stop="goto('/wo/account', '总收入')"
  401. class="developer-reward block"
  402. v-if="init"
  403. >
  404. <div class="developer-reward-title">
  405. <p>总收入 (元) <span class="arrow_icon"></span></p>
  406. <div
  407. @click.stop="toggleBanlace"
  408. class="developer-reward-show-setting"
  409. :class="isShowBablance ? 'show' : 'hide'"
  410. ></div>
  411. </div>
  412. <div v-if="isLogin" class="developer-reward-count">
  413. {{ isShowBablance ? balanceInfo.historyTotalBalance : "****" }}
  414. </div>
  415. <div v-else class="developer-reward-count">
  416. {{ isShowBablance ? 0 : "****" }}
  417. </div>
  418. <div class="developer-reward-detail">
  419. <div class="developer-reward-item">
  420. <span>账户余额:</span>
  421. <span v-if="isLogin" class="num">{{
  422. isShowBablance ? balanceInfo.totalBalance : "****"
  423. }}</span>
  424. <span v-else class="num">{{ isShowBablance ? 0 : "****" }}</span>
  425. </div>
  426. <div class="developer-reward-item">
  427. <span>薪资余额:</span>
  428. <span v-if="isLogin" class="num">{{
  429. isShowBablance ? balanceInfo.gongMallBalance : "****"
  430. }}</span>
  431. <span v-else class="num">{{ isShowBablance ? 0 : "****" }}</span>
  432. </div>
  433. <div class="developer-reward-item">
  434. <span>冻结余额:</span>
  435. <span v-if="isLogin" class="num">{{
  436. isShowBablance ? balanceInfo.frozenBalance : "****"
  437. }}</span>
  438. <span v-else class="num">{{ isShowBablance ? 0 : "****" }}</span>
  439. </div>
  440. </div>
  441. </section>
  442. <Ad-List location="developer_safe"></Ad-List>
  443. <!-- </div> -->
  444. </div>
  445. </div>
  446. <el-dialog
  447. title=""
  448. custom-class="ma-level-dialog"
  449. width="880px"
  450. :visible.sync="levelIntroduceVisible"
  451. >
  452. <Level-Introduce
  453. :show="levelIntroduceVisible"
  454. :level-info="levelInfo"
  455. ></Level-Introduce>
  456. </el-dialog>
  457. <BindWeChatArticle ref="bindWeChat"></BindWeChatArticle>
  458. </div>
  459. </template>
  460. <script>
  461. import { mapState } from "vuex";
  462. import qs from "qs";
  463. import DeveloperSeoData from "./developData";
  464. import Empty from "./empty";
  465. import personalIcon from "@/assets/img/account/personal.png";
  466. import LevelIntroduce from "./component/level-introduce.vue";
  467. import AdList from "@/components/ad.vue";
  468. import BindWeChatArticle from "@/components/bind_wechat_article";
  469. export default {
  470. name: "SeoLearnList",
  471. components: {
  472. Empty,
  473. LevelIntroduce,
  474. AdList,
  475. BindWeChatArticle
  476. },
  477. data() {
  478. return {
  479. baseUrl: "",
  480. mobile: false,
  481. // firstLoad: true,
  482. isWeixinApp: true,
  483. isShowBablance: 1,
  484. init: false,
  485. tid: "",
  486. page: 1,
  487. pageSize: 10,
  488. list: [],
  489. isMore: true,
  490. pageLoading: false,
  491. personalIcon,
  492. levelIntroduceVisible: false,
  493. userGrade: ""
  494. };
  495. },
  496. head() {
  497. const {
  498. title = "程序员客栈-领先的程序员自由远程工作平台",
  499. keyword = "软件开发,网站系统,APP小程序,UI设计,web前端,原型产品经理,程序员兼职,程序员招聘",
  500. description = "程序员客栈是领先的程序员自由远程工作平台,未来互联网企业用人方式。提供优秀程序员为您进行网站建设制作、测试运维服务、人工智能AI、大数据区块链、软件开发等优质服务。",
  501. h1 = "",
  502. canonical = "",
  503. metaLocation
  504. } = this.head || {};
  505. let obj = {
  506. title: title,
  507. meta: [
  508. {
  509. name: "keywords",
  510. content: keyword
  511. },
  512. {
  513. name: "description",
  514. content: description
  515. },
  516. {
  517. name: "h1",
  518. content: h1
  519. }
  520. ],
  521. link: [
  522. {
  523. rel: "canonical",
  524. href: canonical
  525. }
  526. ]
  527. };
  528. if (metaLocation) {
  529. obj.meta.push({
  530. name: "location",
  531. content: metaLocation
  532. });
  533. }
  534. return obj;
  535. },
  536. computed: {
  537. ...mapState(["deviceType"]),
  538. showWxHeader() {
  539. return (
  540. !this.deviceType.app &&
  541. !this.isWeixinApp &&
  542. (this.deviceType.android || this.deviceType.ios)
  543. );
  544. },
  545. mainMarginTop() {
  546. if (this.mobile && this.showWxHeader) {
  547. return "64px !important";
  548. } else if (this.mobile) {
  549. return "0px !important";
  550. } else {
  551. return "20px !important";
  552. }
  553. },
  554. // 是否实名
  555. isRealName() {
  556. return this.userInfo["realname_verify_status"] == 2 ? true : false;
  557. // return false
  558. },
  559. // 是否签约
  560. isSign() {
  561. return this.userInfo["realname_re"] == 2 ? true : false;
  562. // return false
  563. },
  564. // 是否技术认证
  565. is_freework_level() {
  566. return this.userInfo["freework_level"] > 0 ? true : false;
  567. // return false
  568. },
  569. dynamicTranlate() {
  570. return;
  571. let typeList = this.typeList;
  572. let total = 680;
  573. let block = parseInt(total / typeList.length);
  574. let half = parseInt(block / 2);
  575. let line = 24 / 2;
  576. let curIndex = this.typeList.findIndex(item => {
  577. return item.typeId == this.tid;
  578. });
  579. curIndex = curIndex ? curIndex : 0;
  580. let result = curIndex * block + half - line;
  581. return result;
  582. },
  583. isLogin() {
  584. return this.$store.getters.isLogin;
  585. },
  586. isVipMode() {
  587. if (!this.isLogin) {
  588. return false;
  589. }
  590. const { is_vip } = this.$store.state.userinfo || {};
  591. return !!is_vip;
  592. },
  593. isDeveloperVip() {
  594. const { vip_type_id } = this.$store.state.userinfo || {};
  595. if (!this.isVipMode) {
  596. return false;
  597. }
  598. // 1 初创会员
  599. // 2 开发者会员
  600. // 3 企业版会员
  601. if (vip_type_id == 2) {
  602. return true;
  603. }
  604. return false;
  605. }
  606. },
  607. async asyncData({ ...params }) {
  608. let dealDataObj = new DeveloperSeoData(params);
  609. let ans = await dealDataObj.dealData();
  610. return {
  611. ...ans
  612. };
  613. },
  614. created() {},
  615. mounted() {
  616. let isShowBablance = window.localStorage.getItem("banlanceShow");
  617. if (isShowBablance === null || isShowBablance === undefined) {
  618. isShowBablance = 1;
  619. }
  620. this.isShowBablance = Number(isShowBablance);
  621. this.init = true;
  622. this.baseUrl = this.$store.state.domainConfig.siteUrl;
  623. this.isWeixinApp = navigator.userAgent.indexOf("miniProgram") > -1;
  624. this.tid = this.firstType.typeId;
  625. this.list = [...this.dynamicList];
  626. this.$nextTick(() => {
  627. this.listenToEnd();
  628. });
  629. this.fetchUserGrade();
  630. },
  631. destroy: function() {
  632. window.onscroll = null;
  633. },
  634. methods: {
  635. gotoApp() {
  636. this.checkLogin(true);
  637. this.$message("请前往APP完成实名");
  638. },
  639. gotoAppTips() {
  640. this.checkLogin(true);
  641. this.$message("请前往APP查看");
  642. },
  643. goto(url, title = "") {
  644. this.cnzz("开发者首页", title, "");
  645. location.href = url;
  646. },
  647. async ping(type = "") {
  648. this.cnzz("开发者首页", "ping" + type, "");
  649. let res = await this.$axios.$post("/api/remote/ping");
  650. if (res.status == 1) {
  651. this.$message.success("操作成功");
  652. }
  653. },
  654. toggleBanlace() {
  655. if (this.isShowBablance) {
  656. this.hideBanlance();
  657. } else {
  658. this.showBanlance();
  659. }
  660. },
  661. hideBanlance() {
  662. this.isShowBablance = 0;
  663. window.localStorage.setItem("banlanceShow", 0);
  664. },
  665. showBanlance() {
  666. this.isShowBablance = 1;
  667. window.localStorage.setItem("banlanceShow", 1);
  668. },
  669. listenToEnd() {
  670. let that = this;
  671. window.onscroll = function() {
  672. var scrollTop =
  673. document.documentElement.scrollTop || document.body.scrollTop;
  674. var windowHeight =
  675. document.documentElement.clientHeight || document.body.clientHeight;
  676. var scrollHeight =
  677. document.documentElement.scrollHeight || document.body.scrollHeight;
  678. if (scrollHeight - scrollTop - windowHeight < 400) {
  679. that.fetchDynamicData();
  680. }
  681. };
  682. },
  683. reset(type_id) {
  684. if (this.pageLoading) return;
  685. this.page = 0;
  686. this.isMore = true;
  687. this.tid = type_id;
  688. this.list = [];
  689. this.pageLoading = false;
  690. this.fetchDynamicData();
  691. },
  692. async fetchDynamicData() {
  693. if (this.pageLoading || !this.isMore) return;
  694. this.pageLoading = true;
  695. let page = this.page + 1;
  696. let type_id = this.tid;
  697. let res = await this.$axios.$post("/uapi/dynamic/get_dynamic_detail", {
  698. type_id: type_id,
  699. page: page,
  700. pagesize: this.pageSize
  701. });
  702. setTimeout(() => {
  703. this.pageLoading = false;
  704. }, 100);
  705. if (Number(res.status) === 1) {
  706. // if (type_id != this.tid) {
  707. // return
  708. // }
  709. let info = res.data.list;
  710. info = info.map(item => {
  711. let imgList = item.img;
  712. imgList = imgList.map(item => {
  713. return item.img;
  714. });
  715. return {
  716. ...item,
  717. imgList
  718. };
  719. });
  720. this.page = page;
  721. this.list = [...this.list, ...info];
  722. this.isMore = info.length < this.pageSize ? false : true;
  723. } else if (Number(res.status) === 40001) {
  724. this.isExist = false;
  725. }
  726. },
  727. clickResource(resources) {
  728. if (resources.resources_status != 1) {
  729. this.$message.info(resources.resources_text);
  730. } else {
  731. location.href = resources.resources_url;
  732. }
  733. },
  734. login() {
  735. this.goLogin();
  736. },
  737. linkToUser() {
  738. if (this.isLogin) {
  739. location.href = "https://jishuin.proginn.com/u/" + this.userinfo.uid;
  740. }
  741. },
  742. async fetchUserGrade() {
  743. let res = await this.$axios.$post("/api/userGrade/userGrade", {
  744. uid: this.userinfo.uid
  745. });
  746. if (Number(res.status) === 1) {
  747. this.userGrade = res.data.perfect;
  748. }
  749. },
  750. callBindWeChat() {
  751. this.$refs["bindWeChat"].show({
  752. name: this.userInfo.nickname,
  753. uid: this.userinfo.uid,
  754. avatar: this.userInfo.icon_url
  755. });
  756. }
  757. }
  758. };
  759. </script>
  760. <style lang="scss">
  761. @import "@/assets/css/developer/index.scss";
  762. .no-padding {
  763. padding: 0;
  764. }
  765. .dynamic-user-avatar-vip {
  766. position: relative;
  767. }
  768. .developer-tab-title-list{
  769. justify-content: space-between;
  770. .left_box{
  771. width: 600px;
  772. overflow-x: auto;
  773. white-space: nowrap;
  774. }
  775. .left_box::-webkit-scrollbar {
  776. height: 1px;
  777. }
  778. }
  779. </style>