model.vue 18 KB

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