mobile.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. <template>
  2. <div class="wrapper" v-if="detail">
  3. <!--顶部tab-->
  4. <div class="switch-bar" :class="active===0?'switch-bar-brown':current===0?'switch-bar-blue':'switch-bar-green'">
  5. <div class="switch-item" :class="{'switch-item-active':active===0}" @click="handleSwitchClick(0)">
  6. <div class="switch-item-title">开发者会员</div>
  7. <div class="switch-item-border"/>
  8. </div>
  9. <div class="switch-item" :class="{'switch-item-active':active===1}" @click="handleSwitchClick(1)">
  10. <div class="switch-item-title">企业会员</div>
  11. <div class="switch-item-border"/>
  12. </div>
  13. </div>
  14. <!--名片-->
  15. <div class="banner-brown-wrapper" v-show="active===0">
  16. <div class="banner-brown">
  17. <div class="banner-content">
  18. <div class="avatar">
  19. <img :src="userInfo.icon_url" alt/>
  20. </div>
  21. <div class="name-wrapper">
  22. <div class="name">{{userInfo.nickname}}</div>
  23. <div class="validity">{{vipType === 2 ? endTimeCalc :'暂未开通'}}</div>
  24. </div>
  25. <div
  26. class="renew-btn"
  27. :class="vipColor"
  28. @click="clickPay('dev')"
  29. >{{vipType === 2 ? '续费' : '开通'}}
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. <!--企业会员信息-->
  35. <div v-swiper:mySwiper="swiperOption" v-show="active===1">
  36. <div class="swiper-wrapper">
  37. <div class="swiper-slide">
  38. <div class="banner-blue-wrapper">
  39. <div class="banner-blue">
  40. <div class="banner-content">
  41. <div class="avatar">
  42. <img :src="userInfo.icon_url" alt/>
  43. </div>
  44. <div class="name-wrapper">
  45. <div class="name">{{userInfo.nickname}}</div>
  46. <div class="validity">{{vipType ===1 ? endTimeCalc : '暂未开通'}}</div>
  47. </div>
  48. <div
  49. class="renew-btn"
  50. :class="vipColor"
  51. @click="clickPay('com')"
  52. >{{vipType === 1 ? '续费' : '开通'}}
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="swiper-slide">
  59. <div class="banner-green-wrapper">
  60. <div class="banner-green">
  61. <div class="banner-content">
  62. <div class="avatar">
  63. <img :src="userInfo.icon_url" alt/>
  64. </div>
  65. <div class="name-wrapper">
  66. <div class="name">{{userInfo.nickname}}</div>
  67. <div class="validity">{{vipType ===3 ? endTimeCalc : '暂未开通'}}</div>
  68. </div>
  69. <div
  70. class="renew-btn"
  71. :class="vipColor"
  72. @click="clickPay('pre')"
  73. >{{vipType === 3 ? '续费' : '开通'}}
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="swiper-pagination swiper-pagination-bullets"></div>
  81. </div>
  82. <div class="content" style="background: #f4f5f9">
  83. <div class="title-wrapper app__bg_w app__pl_10 app__pr_10 app__bd_b_eee" style="margin: 0;width:100vw">
  84. <div class="title">{{vipName}}</div>
  85. <div class="price-wrapper">
  86. <div class="monthly-price-wrapper">
  87. <div class="monthly-origin-price">原价¥{{detail.monthly_origin_price}}/月</div>
  88. <div class="monthly-discount-price">
  89. <span>¥{{detail.monthly_real_price}}</span>/月
  90. </div>
  91. </div>
  92. <div class="quarterly-price">
  93. 按季付费
  94. <span>¥{{detail.quarterly_real_price}}</span>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="app__f_r app__al_c app__fs_15 app__pd_10 app__pt_10 app__pb_10 app__bg_w app__h_50" @click="viewRateDetail()" v-if="active===0">
  99. <p class="app__ml_10 app_f_g_1">会员数据:</p>
  100. <span class="app__fc_999">优先派单:{{Number(vipInfo.jobCount || 0) + Number(vipInfo.projectCount || 0)}}</span>
  101. <span class="app__fc_999 app__mr_5 app__ml_10">收益提升:{{vipInfo.vipFee || 0}}元</span>
  102. </div>
  103. <div class="app__fs_14 app__lh_3 app__pl_20 app__pr_20 app__fc_666 app__fw_400 app__h_233 app__bg_w app__mt_10 app__f_c app__jf_c" v-if="active===0">
  104. <div class="app__f_r app__al_c">
  105. <p class="app_f_g_1">系统优先派单,提升综合接单率</p>
  106. <img src="@/assets/img/vip/icon_include_brown.png" style="width:16px;height:11px;">
  107. </div>
  108. <div class="app__f_r app__al_c">
  109. <p class="app_f_g_1">每天可ping5次,综合提升接单率</p>
  110. <img src="@/assets/img/vip/icon_include_brown.png" style="width:16px;height:11px;">
  111. </div>
  112. <div class="app__f_r app__al_c">
  113. <p class="app_f_g_1">程序员列表置顶</p>
  114. <img src="@/assets/img/vip/icon_include_brown.png" style="width:16px;height:11px;">
  115. </div>
  116. <div class="app__f_r app__al_c">
  117. <p class="app_f_g_1">每月不限接单上限,最多同时派2单</p>
  118. <img src="@/assets/img/vip/icon_include_brown.png" style="width:16px;height:11px;">
  119. </div>
  120. <div class="app__f_r app__al_c">
  121. <p class="app_f_g_1">减免1%平台服务费,资质认证低至2折</p>
  122. <img src="@/assets/img/vip/icon_include_brown.png" style="width:16px;height:11px;">
  123. </div>
  124. </div>
  125. <!-- <div class="list" v-show="active===0">
  126. <div class="item">
  127. <div class="item-title">· 整包项目-平台服务费(减免{{detail.project_reduction_rate}}%)</div>
  128. <div class="item-discount">{{detail.project_discount}}折</div>
  129. </div>
  130. <div class="item">
  131. <div class="item-title">· 云端工作-平台服务费(减免{{detail.job_reduction_rate}}%)</div>
  132. <div class="item-discount">{{detail.job_discount}}折</div>
  133. </div>
  134. <div class="item">
  135. <div class="item-title">· 认证的自由开发者可同时接2单</div>
  136. <img class="item-include" src="@/assets/img/vip/icon_include_brown.png" alt />
  137. </div>
  138. </div>-->
  139. <div class="list app__bg_w app__mt_10" v-show="active===1 && current===0">
  140. <div class="item">
  141. <div class="item-title">· 整包项目-平台服务费(减免{{detail.project_reduction_rate}}%)</div>
  142. <div class="item-discount">{{detail.project_discount}}折</div>
  143. </div>
  144. <div class="item">
  145. <div class="item-title">· 云端工作-平台服务费(减免{{detail.job_reduction_rate}}%)</div>
  146. <div class="item-discount">{{detail.job_discount}}折</div>
  147. </div>
  148. <div class="item">
  149. <div class="item-title">· 每天{{detail.chat_times}}次程序员聊天次数</div>
  150. <img class="item-include" src="@/assets/img/vip/icon_include_brown.png" alt/>
  151. </div>
  152. <div class="item">
  153. <div class="item-title">· 每天{{detail.hire_times}}次雇佣项目发布次数</div>
  154. <img class="item-include" src="@/assets/img/vip/icon_include_brown.png" alt/>
  155. </div>
  156. <div class="item">
  157. <div class="item-title">· 免费进行企业认证</div>
  158. <img class="item-include" src="@/assets/img/vip/icon_include_brown.png" alt/>
  159. </div>
  160. </div>
  161. <div class="list app__bg_w app__mt_10" v-show="active===1 && current===1">
  162. <div class="item">
  163. <div class="item-title">· 整包项目-平台服务费(减免{{detail.project_reduction_rate}}%)</div>
  164. <div class="item-discount">{{detail.project_discount}}折</div>
  165. </div>
  166. <div class="item">
  167. <div class="item-title">· 云端工作-平台服务费(减免{{detail.job_reduction_rate}}%)</div>
  168. <div class="item-discount">{{detail.job_discount}}折</div>
  169. </div>
  170. <div class="item">
  171. <div class="item-title">· 每天不限次程序员聊天次数</div>
  172. <img class="item-include" src="@/assets/img/vip/icon_include_brown.png" alt/>
  173. </div>
  174. <div class="item">
  175. <div class="item-title">· 每天{{detail.hire_times}}次雇佣项目发布次数</div>
  176. <img class="item-include" src="@/assets/img/vip/icon_include_brown.png" alt/>
  177. </div>
  178. <div class="item">
  179. <div class="item-title">· 免费进行企业认证</div>
  180. <img class="item-include" src="@/assets/img/vip/icon_include_brown.png" alt/>
  181. </div>
  182. </div>
  183. <!-- <h4 class="app__pl_20 app__pt_10">会员权益</h4>-->
  184. <div class="tips-wrapper">
  185. <div class="tips-title">会员说明</div>
  186. <div class="tips-content">
  187. <p>1.购买会员按季付费;</p>
  188. <p>2.开通会员即代表您已同意《程序员客栈会员服务条款》;</p>
  189. <p>3.如有任何问题,欢迎咨询在线客服,或拨打热线:0571-28120931 转1。</p>
  190. </div>
  191. </div>
  192. </div>
  193. <buy-dialog
  194. :handleClose="handleClose"
  195. :buyDialog="buyDialog"
  196. :gotoPay="gotoPay"
  197. :type="type"
  198. :item="detail"
  199. :vipDetail="vipDetail"
  200. :pricePrefix="pricePrefix"
  201. ></buy-dialog>
  202. </div>
  203. </template>
  204. <script>
  205. let touchX = 0;
  206. import getDeviceType from "@/mixins/getDeviceType";
  207. import qs from "qs";
  208. import buyDialog from "./buy-dialog";
  209. import bridge from '../../../plugins/bridge';
  210. export default {
  211. props: ["com", "dev", "pre", "vipDetail"],
  212. data() {
  213. const _this = this;
  214. return {
  215. active: 0,
  216. current: 0,
  217. swiperOption: {
  218. loop: false,
  219. slidesPerView: "auto",
  220. centeredSlides: true,
  221. spaceBetween: 30,
  222. pagination: {
  223. el: ".swiper-pagination",
  224. dynamicBullets: true,
  225. },
  226. on: {
  227. slideChange() {
  228. _this.current = this.realIndex;
  229. if (bridge.isInApp) {
  230. if (_this.active === 1 && _this.current === 0) {
  231. bridge.setNavigationBarColor('#308EFF');
  232. _this.currentType = 1;
  233. } else if (_this.active === 1 && _this.current === 1) {
  234. bridge.setNavigationBarColor('#00BF66');
  235. _this.currentType = 3;
  236. }
  237. }
  238. },
  239. },
  240. },
  241. buyDialog: false,
  242. type: "com", // com: 企业会员, dev: 开发者会员
  243. currentType: 2,
  244. vipInfo: {}
  245. };
  246. },
  247. components: {
  248. buyDialog,
  249. },
  250. mixins: [getDeviceType],
  251. computed: {
  252. endTimeCalc() {
  253. return "有效期至" + this.userInfo.vip_end_date;
  254. },
  255. detail() {
  256. if (this.active === 0) {
  257. return this.dev;
  258. } else if (this.active === 1) {
  259. if (this.current === 0) {
  260. return this.com;
  261. } else if (this.current === 1) {
  262. return this.pre;
  263. } else {
  264. return [];
  265. }
  266. }
  267. },
  268. vipType() {
  269. return this.userInfo.vip_type || 0;
  270. },
  271. userInfo() {
  272. return this.vipDetail.user_info || {};
  273. },
  274. pricePrefix() {
  275. return this.deviceType === "ios" ? "apple_" : "";
  276. },
  277. vipName() {
  278. if (this.active === 0) {
  279. return "开发者会员";
  280. } else if (this.active === 1) {
  281. if (this.current === 0) {
  282. return "初创版会员";
  283. } else if (this.current === 1) {
  284. return "企业版会员";
  285. }
  286. }
  287. },
  288. vipColor() {
  289. if (this.active === 0) {
  290. return "yellow";
  291. } else if (this.active === 1) {
  292. if (this.current === 0) {
  293. return "blue";
  294. } else if (this.current === 1) {
  295. return "green";
  296. }
  297. }
  298. },
  299. },
  300. mounted() {
  301. const activeName = this.$route.query.activeName;
  302. const current = this.$route.query.current;
  303. if (activeName === "enterprise") {
  304. this.active = 1;
  305. } else {
  306. this.active = 0;
  307. }
  308. if (current === "1") {
  309. this.current = 1;
  310. }
  311. if (bridge.isInApp) {
  312. if (this.active === 0) {
  313. bridge.setNavigationBarColor('#D89823');
  314. } else if (this.active === 1 && this.current === 0) {
  315. bridge.setNavigationBarColor('#308EFF');
  316. } else if (this.active === 1 && this.current === 1) {
  317. bridge.setNavigationBarColor('#00BF66');
  318. }
  319. }
  320. this.getVipInfo();
  321. },
  322. methods: {
  323. clickPay(type) {
  324. this.type = type;
  325. this.buyDialog = true;
  326. // location.href = `/vip/pay?product_id=${item.id}&number=3&next=/type/vip/`;
  327. },
  328. handleClose() {
  329. this.buyDialog = false;
  330. },
  331. async gotoPay(number) {
  332. const item = this[this.type];
  333. let query = {
  334. product_type: 11,
  335. number: number,
  336. product_id: item.id,
  337. };
  338. // if (this.deviceType === "ios") {
  339. // // alert('ios begin pay..');
  340. // let cookie = this.getSign();
  341. // let res = await this.$axios.$post("/api/vip/pay", {
  342. // product_type: 11,
  343. // number: number,
  344. // product_id: item.id,
  345. // channel: "apple",
  346. // needLogin: true,
  347. // ...cookie
  348. // });
  349. // if (res && res.data) {
  350. // query = Object.assign({}, query, res.data);
  351. // location.href = "proginn://pay?" + qs.stringify(query);
  352. // }
  353. // } else {
  354. location.href = "proginn://pay?" + qs.stringify(query);
  355. // }
  356. },
  357. /**
  358. * 手指右划
  359. */
  360. swipeRight() {
  361. this.currentCom = false;
  362. },
  363. /**
  364. * 手指左划
  365. */
  366. swipeLeft() {
  367. this.currentCom = true;
  368. },
  369. touchStart(e) {
  370. touchX = e.touches[0].clientX;
  371. },
  372. touchEnd(e) {
  373. var offsetX = e.changedTouches[0].clientX - touchX;
  374. if (offsetX < -50) this.swipeLeft();
  375. else if (offsetX > 50) this.swipeRight();
  376. },
  377. handleSwitchClick(index) {
  378. this.active = index;
  379. if (bridge.isInApp) {
  380. if (this.active === 0) {
  381. bridge.setNavigationBarColor('#D89823');
  382. } else if (this.active === 1 && this.current === 0) {
  383. bridge.setNavigationBarColor('#308EFF');
  384. } else if (this.active === 1 && this.current === 1) {
  385. bridge.setNavigationBarColor('#00BF66');
  386. }
  387. }
  388. },
  389. viewRateDetail() {
  390. location.href = "../type/vip/orderRateDetail";
  391. },
  392. async getVipInfo() {
  393. let _this = this;
  394. let res = await this.$axios.$post(`/api/user/getUserVipInfo`);
  395. if (Number(res.status) === 1) {
  396. console.log("6666", res);
  397. this.vipInfo = res.data;
  398. }
  399. },
  400. },
  401. };
  402. </script>
  403. <style scoped lang="scss">
  404. @import "../../../assets/css/scssCommon.scss";
  405. @import "../../../assets/css/public.css";
  406. .wrapper {
  407. overflow: hidden;
  408. margin-top: 0;
  409. width: 100%;
  410. background-color: #f4f5f9;
  411. }
  412. .switch-bar {
  413. display: flex;
  414. background-color: #d89823;
  415. }
  416. .switch-bar-brown {
  417. background-color: #d89823;
  418. }
  419. .switch-bar-blue {
  420. background-color: #308eff;
  421. }
  422. .switch-bar-green {
  423. background-color: #00bf66;
  424. }
  425. .switch-item {
  426. flex: 1;
  427. padding-top: remtovw(0.4);
  428. padding-bottom: remtovw(0.15);
  429. }
  430. .switch-item .switch-item-title {
  431. line-height: remtovw(0.42);
  432. text-align: center;
  433. font-size: remtovw(0.3);
  434. color: #ffffff;
  435. }
  436. .switch-item .switch-item-border {
  437. margin: remtovw(0.18) auto 0;
  438. width: remtovw(0.6);
  439. height: remtovw(0.06);
  440. background-color: transparent;
  441. }
  442. .switch-item-active .switch-item-title {
  443. font-weight: 600;
  444. }
  445. .switch-item-active .switch-item-border {
  446. background-color: #ffffff;
  447. }
  448. .banner-brown-wrapper {
  449. background-color: #d89823;
  450. }
  451. .banner-brown {
  452. overflow: hidden;
  453. margin: 0 auto;
  454. width: remtovw(7);
  455. height: remtovw(2.9);
  456. background-image: url("~@/assets/img/vip/banner_brown.png");
  457. background-size: 100%;
  458. background-repeat: no-repeat;
  459. }
  460. .banner-blue-wrapper {
  461. background-color: #308eff;
  462. }
  463. .banner-blue {
  464. overflow: hidden;
  465. margin: 0 auto;
  466. width: remtovw(7);
  467. height: remtovw(2.9);
  468. background-image: url("~@/assets/img/vip/banner_blue.png");
  469. background-size: 100%;
  470. background-repeat: no-repeat;
  471. }
  472. .banner-green-wrapper {
  473. background-color: #00bf66;
  474. }
  475. .banner-green {
  476. overflow: hidden;
  477. margin: 0 auto;
  478. width: remtovw(7);
  479. height: remtovw(2.9);
  480. background-image: url("~@/assets/img/vip/banner_green.png");
  481. background-size: 100%;
  482. background-repeat: no-repeat;
  483. }
  484. .banner-content {
  485. margin-top: remtovw(1.12);
  486. display: flex;
  487. align-items: center;
  488. }
  489. .avatar {
  490. position: relative;
  491. margin-left: remtovw(0.32);
  492. width: remtovw(1.1);
  493. height: remtovw(1.1);
  494. }
  495. .avatar img {
  496. width: 100%;
  497. height: 100%;
  498. border-radius: 50%;
  499. border: remtovw(0.03) solid #e1a83f;
  500. }
  501. .name-wrapper {
  502. flex: 1;
  503. margin-left: remtovw(0.23);
  504. }
  505. .name {
  506. line-height: remtovw(0.48);
  507. font-weight: 500;
  508. font-size: remtovw(0.34);
  509. color: #222222;
  510. }
  511. .validity {
  512. margin-top: remtovw(0.02);
  513. line-height: remtovw(0.3);
  514. font-size: remtovw(0.22);
  515. color: rgba(34, 34, 34, 0.6);
  516. }
  517. .renew-btn {
  518. margin-right: remtovw(0.3);
  519. width: remtovw(1.54);
  520. height: remtovw(0.64);
  521. border-radius: remtovw(0.32);
  522. background-color: #d89823;
  523. line-height: remtovw(0.64);
  524. font-weight: 600;
  525. text-align: center;
  526. font-size: remtovw(0.26);
  527. color: #ffffff;
  528. }
  529. .content {
  530. overflow: hidden;
  531. background-color: #ffffff;
  532. }
  533. .title-wrapper {
  534. margin: 0 auto;
  535. width: remtovw(7.1);
  536. padding-bottom: remtovw(0.2);
  537. display: flex;
  538. }
  539. .title {
  540. flex: 1;
  541. margin-top: remtovw(0.17);
  542. margin-left: remtovw(0.24);
  543. line-height: remtovw(0.75);
  544. font-weight: 600;
  545. font-size: remtovw(0.29);
  546. color: #222222;
  547. }
  548. .price-wrapper {
  549. margin-top: remtovw(0.23);
  550. text-align: right;
  551. }
  552. .monthly-price-wrapper {
  553. display: flex;
  554. }
  555. .monthly-origin-price {
  556. margin-top: remtovw(0.17);
  557. line-height: remtovw(0.3);
  558. font-size: remtovw(0.22);
  559. color: #919aa7;
  560. text-decoration: line-through;
  561. }
  562. .monthly-discount-price {
  563. margin-left: remtovw(0.07);
  564. line-height: remtovw(0.62);
  565. font-size: remtovw(0.24);
  566. color: #222222;
  567. }
  568. .monthly-discount-price span {
  569. font-weight: 600;
  570. font-size: remtovw(0.45);
  571. }
  572. .quarterly-price {
  573. margin-top: remtovw(0.01);
  574. margin-right: remtovw(0.05);
  575. line-height: remtovw(0.33);
  576. font-size: remtovw(0.24);
  577. color: #666666;
  578. }
  579. .quarterly-price span {
  580. color: #333333;
  581. }
  582. .list {
  583. padding-top: remtovw(0.3);
  584. padding-bottom: remtovw(0.33);
  585. }
  586. .item {
  587. margin: 0 auto;
  588. width: remtovw(7.1);
  589. display: flex;
  590. align-items: center;
  591. }
  592. .item-title {
  593. flex: 1;
  594. line-height: remtovw(0.74);
  595. font-size: remtovw(0.28);
  596. color: #1d2a3a;
  597. }
  598. .item-discount {
  599. width: remtovw(1.02);
  600. height: remtovw(0.44);
  601. background-image: url("~@/assets/img/vip/icon_discount_brown.png");
  602. background-size: 100%;
  603. background-repeat: no-repeat;
  604. line-height: remtovw(0.44);
  605. text-indent: remtovw(0.16);
  606. font-size: remtovw(0.22);
  607. color: #e1a83f;
  608. }
  609. .item-include {
  610. margin-right: remtovw(0.35);
  611. width: remtovw(0.3);
  612. height: remtovw(0.2);
  613. }
  614. .tips-wrapper {
  615. overflow: hidden;
  616. margin-top: 10px;
  617. padding-bottom: remtovw(0.39);
  618. background-color: #ffffff;
  619. }
  620. .tips-title {
  621. margin-top: remtovw(0.36);
  622. margin-left: remtovw(0.2);
  623. line-height: remtovw(0.4);
  624. font-weight: 600;
  625. font-size: remtovw(0.28);
  626. color: #666666;
  627. }
  628. .tips-content {
  629. margin-top: remtovw(0.18);
  630. margin-left: remtovw(0.2);
  631. width: remtovw(6.8);
  632. line-height: remtovw(0.56);
  633. font-size: remtovw(0.26);
  634. color: #999999;
  635. }
  636. .green {
  637. background-color: #00bf66;
  638. }
  639. .yellow {
  640. background-color: #d89823;
  641. }
  642. .blue {
  643. background-color: #308eff;
  644. }
  645. </style>