index.vue 28 KB

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