model.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. <template>
  2. <view class="content" :class="mtype==1?'mone':'mbase'" v-if="baseURL">
  3. <view class="m-top">
  4. <image :src="baseURL + '/resource/icon/model1/top-base.png'" mode="" class="top-bg"></image>
  5. <image :src="baseURL + '/resource/icon/model1/resume.png'" mode="" class="readme"></image>
  6. <view class="top-user flex">
  7. <image :src="cardInfo.avatar" mode="" class="user-logo"></image>
  8. <image :src="baseURL + '/resource/icon/model1/jpfw.png'" mode="" class="gp"></image>
  9. </view>
  10. <view class="user-name">
  11. {{cardInfo.name || '詹继红'}}
  12. </view>
  13. <!-- <button type="default" class="fx-btn">
  14. <image :src="baseURL + '/resource/icon/model1/fx.png'" mode=""></image>
  15. </button> -->
  16. </view>
  17. <view class="m-body gr">
  18. <!-- 个人信息 -->
  19. <view class="hua2">
  20. <view class="m-card">
  21. <image :src="baseURL + '/resource/icon/model1/card-bg.png'" mode="" class="card-bg"></image>
  22. <view class="card-tit flex">
  23. <image :src="baseURL + '/resource/icon/model1/m1.png'" mode="" class="tit-logo"></image>个人信息
  24. </view>
  25. <view class="card-content">
  26. <view class="user-info flex">
  27. <view class="info-item-b">
  28. 年<text class="qianger"></text>龄: {{cardInfo.age|| '暂无'}}
  29. </view>
  30. <view class="info-item-b">
  31. 属<text class="qianger"></text>相: {{cardInfo.twelve|| '暂无'}}
  32. </view>
  33. <view class="info-item-b">
  34. 从<text class="qianger"></text>业: {{(cardInfo.work_year + '年')|| '暂无'}}
  35. </view>
  36. <view class="info-item-b">
  37. 星<text class="qianger"></text>座: {{cardInfo.constellation || '暂无'}}
  38. </view>
  39. <view class="info-item-b">
  40. 籍<text class="qianger"></text>贯: {{cardInfo.ancestral_place || '暂无'}}
  41. </view>
  42. <view class="info-item-b">
  43. 民<text class="qianger"></text>族: {{cardInfo.minority || '暂无'}}
  44. </view>
  45. <view class="info-item-b">
  46. 学<text class="qianger"></text>历: {{cardInfo.education || '暂无'}}
  47. </view>
  48. <!-- <view class="info-item-b">
  49. 综 <text class="laner"></text> 合<text class="laner"></text>分: 50
  50. </view> -->
  51. <view class="info-item-q flex" style="align-items: flex-start;">
  52. <text style="flex-shrink: 0;">服务地区:</text>
  53. <view class="fwdz flex">
  54. <view v-for="(fwitem,fwindex) in cardInfo.service_area_all">
  55. {{fwitem}}{{fwindex ==(cardInfo.service_area_all.length -1) ?'': '、' }}</view>
  56. </view>
  57. </view>
  58. <view class="info-item-q flex" style="align-items: flex-start;">
  59. <text style="flex-shrink: 0;">服务价格: </text>
  60. <view class="gzt">
  61. <image :src="baseURL + '/resource/icon/model1/tiao.png'" mode=""></image>
  62. <view class="gzt-price">
  63. <text>{{cardInfo.service_min_price}}</text>元/{{cardInfo.service_time_type_title.replace('每','')}}
  64. </view>
  65. <view class=" gzt-price-b">
  66. <text>{{cardInfo.service_max_price}}</text>元/{{cardInfo.service_time_type_title.replace('每','')}}
  67. </view>
  68. </view>
  69. <image :src="baseURL + '/resource/icon/model1/yrz.png'" mode="" class="rz"></image>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="" style="height: 80rpx;"></view>
  74. </view>
  75. </view>
  76. <!-- 自我评价 -->
  77. <view class="hua4">
  78. <view class="hua3">
  79. <view class="m-card">
  80. <image :src="baseURL + '/resource/icon/model1/card-bg.png'" mode="" class="card-bg"></image>
  81. <view class="card-tit flex">
  82. <image :src="baseURL + '/resource/icon/model1/m2.png'" mode="" class="tit-logo"></image>自我评价
  83. </view>
  84. <view class="card-content">
  85. {{cardInfo.service_intro_content}}
  86. </view>
  87. <view class="img-list flex" style="padding-top: 0;">
  88. <image :src="siiitem" mode="" v-for="siiitem in cardInfo.service_intro_imgs"></image>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- 我的证书 -->
  94. <view class="hua5" v-if="cardInfo.service_audit_imgs && cardInfo.service_audit_imgs.length > 0">
  95. <view class="m-card">
  96. <image :src="baseURL + '/resource/icon/model1/card-bg.png'" mode="" class="card-bg"></image>
  97. <view class="card-tit flex">
  98. <image :src="baseURL + '/resource/icon/model1/m3.png'" mode="" class="tit-logo"></image>我的证书
  99. </view>
  100. <view class="img-list flex">
  101. <image :src="saiitem" mode="" v-for="saiitem in cardInfo.service_audit_imgs"></image>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- 服务内容 -->
  106. <view class="hua6">
  107. <view class="m-card">
  108. <image :src="baseURL + '/resource/icon/model1/card-bg.png'" mode="" class="card-bg"></image>
  109. <view class="card-tit flex">
  110. <image :src="baseURL + '/resource/icon/model1/m4.png'" mode="" class="tit-logo"></image>服务内容
  111. </view>
  112. <view class="card-content">
  113. <view class="fw" v-for="spaitem in cardInfo.service_project_ar">
  114. <view class="fw-tit">
  115. <text class="yg"></text>{{spaitem.title}}
  116. </view>
  117. <view class="fw-content">
  118. {{spaitem.content}}
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <!-- 服务照片 -->
  125. <view class="m-card" v-if="cardInfo.service_imgs && cardInfo.service_imgs.length > 0">
  126. <image :src="baseURL + '/resource/icon/model1/card-bg.png'" mode="" class="card-bg"></image>
  127. <view class="card-tit flex">
  128. <image :src="baseURL + '/resource/icon/model1/m5.png'" mode="" class="tit-logo"></image>服务照片
  129. </view>
  130. <view class="img-list flex">
  131. <image :src="siitem" mode="" v-for="siitem in cardInfo.service_imgs"></image>
  132. </view>
  133. </view>
  134. <!-- 底部图片 -->
  135. <image :src="baseURL + '/resource/icon/model1/m-btm.png'" mode="" class="m-btm"></image>
  136. </view>
  137. <view class="create-model-ts">
  138. </view>
  139. <button type="default" class="fxmp" open-type="share" v-if="!shareId && modelInfo.is_use== 1">
  140. <view class="">
  141. 分享名片
  142. </view>
  143. </button>
  144. <view class="create-model flex" v-if="!shareId && modelInfo.is_use== 0">
  145. <view class="price-show">
  146. 模板费用:<text>{{modelInfo.price*1}}</text>
  147. </view>
  148. <view class="to-show">
  149. 模板预览
  150. </view>
  151. <view class="by-now" @click="gobuy">
  152. 购买使用
  153. </view>
  154. </view>
  155. </view>
  156. </template>
  157. <script>
  158. import {
  159. mapState,
  160. mapMutations
  161. } from 'vuex';
  162. import {
  163. getUserCardInfo,
  164. getCommonUserCardInfo,
  165. getShowTemplateItem
  166. } from '@/api/model.js'
  167. export default {
  168. data() {
  169. return {
  170. mtype: 1,
  171. shareId: '',
  172. cardInfo: {},
  173. modelInfo: {}
  174. }
  175. },
  176. computed: {
  177. ...mapState(['baseURL']),
  178. ...mapState('user',['userInfo'])
  179. },
  180. onLoad(opt) {
  181. // this.getUserCardInfo()
  182. opt.mtype = opt.mtype
  183. if(opt.uid) {
  184. this.shareId = opt.uid
  185. this.getCommonUserCardInfo(opt.uid)
  186. }else {
  187. this.getUserCardInfo()
  188. this.getShowTemplateItem()
  189. }
  190. },
  191. onShow() {
  192. },
  193. onShareAppMessage(options) {
  194. // 设置菜单中的转发按钮触发转发事件时的转发内容
  195. let pages = getCurrentPages(); //获取加载的页面
  196. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  197. let url = currentPage.route; //当前页面url
  198. let item = currentPage.options; //如果要获取url中所带的参数可以查看options
  199. let shareObj = {}
  200. shareObj = {
  201. title: '母婴界', // 默认是小程序的名称(可以写slogan等)
  202. path: url + '?uid=' + this.userInfo.uid + '&mtype=' + this.mtype, // 默认是当前页面,必须是以‘/’开头的完整路径
  203. imageUrl: '',
  204. success: function(res) {
  205. // 转发成功之后的回调
  206. if (res.errMsg == 'shareAppMessage:ok') {}
  207. },
  208. fail: function() {
  209. // 转发失败之后的回调
  210. if (res.errMsg == 'shareAppMessage:fail cancel') {
  211. // 用户取消转发
  212. } else if (res.errMsg == 'shareAppMessage:fail') {
  213. // 转发失败,其中 detail message 为详细失败信息
  214. }
  215. }
  216. };
  217. console.log(shareObj)
  218. return shareObj;
  219. },
  220. methods: {
  221. gobuy() {
  222. let that = this
  223. subShowTemplateOrder({
  224. id: that.mtype,
  225. pay_type: 'wxpay'
  226. }).then(res => {
  227. })
  228. },
  229. getShowTemplateItem() {
  230. let that = this
  231. getShowTemplateItem({
  232. id: that.mtype
  233. }).then(res=> {
  234. that.modelInfo = res.data
  235. })
  236. },
  237. getCommonUserCardInfo(uid) {
  238. let that = this
  239. getCommonUserCardInfo({
  240. uid:uid
  241. }).then(res => {
  242. let arr = []
  243. let basearr = res.data.service_area_all
  244. basearr.forEach(item => {
  245. arr.push(item[0].name + item[1].name + item[2].name)
  246. })
  247. res.data.service_area_all = arr
  248. that.cardInfo = res.data
  249. })
  250. },
  251. getUserCardInfo() {
  252. let that = this
  253. getUserCardInfo().then(res => {
  254. console.log(res)
  255. let arr = []
  256. let basearr = res.data.service_area_all
  257. basearr.forEach(item => {
  258. arr.push(item[0].name + item[1].name + item[2].name)
  259. })
  260. res.data.service_area_all = arr
  261. that.cardInfo = res.data
  262. })
  263. }
  264. }
  265. }
  266. </script>
  267. <style lang="scss">
  268. .mone {
  269. background-color: #f8e1df;
  270. .m-top {
  271. width: 750rpx;
  272. position: relative;
  273. width: 750rpx;
  274. height: 370rpx;
  275. .top-bg {
  276. position: relative;
  277. width: 750rpx;
  278. height: 370rpx;
  279. }
  280. .readme {
  281. width: 534rpx;
  282. height: 83rpx;
  283. position: absolute;
  284. top: 172rpx;
  285. left: 0;
  286. right: 0;
  287. margin: auto;
  288. }
  289. .top-user {
  290. width: 222rpx;
  291. height: 222rpx;
  292. background: #FEFEFE;
  293. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  294. border-radius: 50%;
  295. position: absolute;
  296. left: 0;
  297. right: 0;
  298. top: 80rpx;
  299. justify-content: center;
  300. align-items: center;
  301. margin: auto;
  302. .user-logo {
  303. width: 200rpx;
  304. height: 200rpx;
  305. border-radius: 50%;
  306. background-color: #fff;
  307. }
  308. .gp {
  309. width: 133rpx;
  310. height: 38rpx;
  311. position: absolute;
  312. bottom: 0;
  313. left: 0;
  314. right: 0;
  315. margin: auto;
  316. }
  317. }
  318. .user-name {
  319. width: 750rpx;
  320. font-size: 38rpx;
  321. font-weight: bold;
  322. color: #000000;
  323. text-align: center;
  324. position: absolute;
  325. top: 318rpx;
  326. }
  327. .fx-btn {
  328. width: 150rpx;
  329. height: 48rpx;
  330. padding: 0;
  331. &::after {
  332. border: none;
  333. }
  334. position: absolute;
  335. top: 70rpx;
  336. right: 0;
  337. border-radius: 24rpx 0 0 24rpx;
  338. image {
  339. width: 150rpx;
  340. height: 48rpx;
  341. display: block;
  342. }
  343. }
  344. }
  345. }
  346. .m-body {
  347. width: 705rpx;
  348. margin: auto;
  349. margin-top: 20rpx;
  350. background-color: #fff;
  351. border-left: 8rpx solid #efa0ab;
  352. border-right: 8rpx solid #efa0ab;
  353. padding: 45rpx 0;
  354. }
  355. .gr {
  356. position: relative;
  357. &::before {
  358. content: '';
  359. position: absolute;
  360. // left: 75px;
  361. right: 0;
  362. top: -30rpx;
  363. width: 120px;
  364. height: 174px;
  365. background: url('https://api.myjie.cn/resource/icon/model1/hua1.png') no-repeat;
  366. background-size: 100% 100%;
  367. }
  368. }
  369. .m-card {
  370. width: 640rpx;
  371. background: #fcf4f1;
  372. border-radius: 20rpx;
  373. position: relative;
  374. // min-height: 270rpx;
  375. margin: 0 auto 46rpx;
  376. .card-tit {
  377. width: 219rpx;
  378. height: 57rpx;
  379. background: #F46C85;
  380. border-radius: 20rpx 28rpx 29rpx 0rpx;
  381. justify-content: flex-start;
  382. align-items: center;
  383. padding: 0 20rpx;
  384. font-size: 32rpx;
  385. font-weight: bold;
  386. color: #FFFFFF;
  387. .tit-logo {
  388. width: 32rpx;
  389. height: 32rpx;
  390. margin-right: 18rpx;
  391. }
  392. }
  393. .card-bg {
  394. width: 100%;
  395. height: 270rpx;
  396. position: absolute;
  397. bottom: 0rpx;
  398. }
  399. .card-content {
  400. padding: 25rpx 35rpx;
  401. font-size: 26rpx;
  402. font-weight: 500;
  403. color: #2C2E35;
  404. position: relative;
  405. }
  406. .img-list {
  407. justify-content: space-between;
  408. flex-wrap: wrap;
  409. margin: auto;
  410. padding: 30rpx 30rpx 0;
  411. position: relative;
  412. image {
  413. width: 270rpx;
  414. height: 270rpx;
  415. background-color: #fff;
  416. margin-bottom: 30rpx;
  417. }
  418. }
  419. .fw {
  420. font-size: 26rpx;
  421. font-weight: 500;
  422. color: #2C2E35;
  423. padding: 10rpx 0;
  424. .fw-tit {
  425. color: #F46C85;
  426. display: flex;
  427. align-items: center;
  428. .yg {
  429. background-color: #F46C85;
  430. display: inline-block;
  431. width: 10rpx;
  432. height: 10rpx;
  433. border-radius: 50%;
  434. margin-right: 10rpx;
  435. }
  436. }
  437. .fw-content {
  438. padding-top: 10rpx;
  439. padding-left: 18rpx;
  440. text-align: justify;
  441. }
  442. }
  443. .user-info {
  444. flex-wrap: wrap;
  445. font-size: 26rpx;
  446. font-weight: 500;
  447. color: #000000;
  448. position: relative;
  449. .info-item-b,
  450. .info-item-q {
  451. padding: 10rpx 0;
  452. color: #000000;
  453. position: relative;
  454. padding-left: 20rpx;
  455. &::before {
  456. display: inline-block;
  457. content: '';
  458. width: 10rpx;
  459. height: 10rpx;
  460. border-radius: 50%;
  461. background-color: #F46C85;
  462. position: absolute;
  463. top: 22rpx;
  464. left: 0;
  465. }
  466. .qianger {
  467. width: 2em;
  468. display: inline-block;
  469. }
  470. .laner {
  471. width: 0.5em;
  472. display: inline-block;
  473. }
  474. }
  475. .info-item-b {
  476. width: 50%;
  477. }
  478. .info-item-q {
  479. width: 100%;
  480. display: flex;
  481. align-items: flex-start;
  482. justify-content: start;
  483. .fwdz {
  484. flex-direction: column;
  485. align-items: flex-start;
  486. }
  487. .gzt {
  488. width: 312rpx;
  489. height: 24rpx;
  490. padding-top: 10rpx;
  491. position: relative;
  492. image {
  493. width: 312rpx;
  494. height: 24rpx;
  495. position: relative;
  496. }
  497. .gzt-price,
  498. .gzt-price-b {
  499. width: 200rpx;
  500. text-align: center;
  501. position: absolute;
  502. padding-top: 20rpx;
  503. &::after {
  504. content: '';
  505. width: 0px;
  506. height: 0rpx;
  507. // background: #FEB8C6;
  508. border: 14rpx solid;
  509. border-color: transparent transparent #FEB8C6;
  510. // border-top:transparent;
  511. // border-left: transparent;
  512. // border-right: transparent;
  513. position: absolute;
  514. top: -14rpx;
  515. left: 0;
  516. right: 0;
  517. margin: auto;
  518. }
  519. text {
  520. color: #F46C85;
  521. }
  522. }
  523. .gzt-price {
  524. left: -100rpx;
  525. }
  526. .gzt-price-b {
  527. right: -100rpx;
  528. }
  529. }
  530. .rz {
  531. margin-top: 10rpx;
  532. margin-left: 10rpx;
  533. width: 87rpx;
  534. height: 26rpx;
  535. }
  536. }
  537. }
  538. }
  539. .m-btm {
  540. width: 660rpx;
  541. height: 384rpx;
  542. }
  543. .hua2 {
  544. position: relative;
  545. &::before {
  546. content: '';
  547. width: 199rpx;
  548. height: 298rpx;
  549. background: url('https://api.myjie.cn/resource/icon/model1/hua2.png') no-repeat;
  550. position: absolute;
  551. bottom: -100rpx;
  552. right: 0;
  553. background-size: 100% 100%;
  554. }
  555. }
  556. .hua3 {
  557. position: relative;
  558. &::before {
  559. content: '';
  560. width: 192rpx;
  561. height: 223rpx;
  562. background: url('https://api.myjie.cn/resource/icon/model1/hua3.png') no-repeat;
  563. position: absolute;
  564. top: 0;
  565. bottom: 0;
  566. left: 0;
  567. margin: auto;
  568. background-size: 100% 100%;
  569. }
  570. }
  571. .hua4 {
  572. position: relative;
  573. &::before {
  574. content: '';
  575. width: 128rpx;
  576. height: 145rpx;
  577. background: url('https://api.myjie.cn/resource/icon/model1/hua4.png') no-repeat;
  578. position: absolute;
  579. bottom: -70rpx;
  580. right: 0;
  581. background-size: 100% 100%;
  582. }
  583. }
  584. .hua5 {
  585. position: relative;
  586. &::before {
  587. content: '';
  588. width: 199rpx;
  589. height: 298rpx;
  590. background: url('https://api.myjie.cn/resource/icon/model1/hua2.png') no-repeat;
  591. position: absolute;
  592. bottom: -100rpx;
  593. left: 0;
  594. background-size: 100% 100%;
  595. transform: rotateY(180deg);
  596. }
  597. }
  598. .hua6 {
  599. position: relative;
  600. &::before {
  601. content: '';
  602. width: 192rpx;
  603. height: 223rpx;
  604. background: url('https://api.myjie.cn/resource/icon/model1/hua3.png') no-repeat;
  605. position: absolute;
  606. bottom: -110rpx;
  607. right: 0;
  608. background-size: 100% 100%;
  609. transform: rotateY(180deg);
  610. }
  611. }
  612. .create-model-ts {
  613. width: 750rpx;
  614. height: 30rpx;
  615. }
  616. .fxmp {
  617. padding: 0;
  618. &::after {
  619. border: none;
  620. }
  621. }
  622. .fxmp {
  623. position: fixed;
  624. width: 750rpx;
  625. height: 78rpx;
  626. bottom: 0;
  627. padding: 0;
  628. view {
  629. background: #f65486;
  630. border-radius: 5rpx;
  631. font-size: 30rpx;
  632. font-weight: 500;
  633. color: #FFFFFF;
  634. text-align: center;
  635. line-height: 78rpx;
  636. }
  637. }
  638. .create-model {
  639. position: fixed;
  640. width: 750rpx;
  641. bottom: 0;
  642. border-radius: 5rpx;
  643. font-size: 32rpx;
  644. font-weight: 500;
  645. text-align: center;
  646. line-height: 98rpx;
  647. .price-show {
  648. font-size: 32rpx;
  649. font-weight: 500;
  650. color: #333333;
  651. background-color: #fff;
  652. flex-grow: 1;
  653. text {
  654. font-size: 48rpx;
  655. font-weight: 500;
  656. color: #FC6F6D;
  657. }
  658. }
  659. .to-show, .by-now{
  660. width: 223rpx;
  661. height: 98rpx;
  662. background: #fa98b6;
  663. flex-shrink: 0;
  664. font-size: 34rpx;
  665. color: #fff;
  666. }
  667. .by-now {
  668. background:#f65486;
  669. }
  670. }
  671. </style>