user.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. <template>
  2. <view class="content">
  3. <view class="top" style="position: relative;">
  4. <view class="avater">
  5. <image :src="userInfo.avatar" class="avater-img" mode="" v-if="userInfo.avatar"></image>
  6. <image src="../../static/error/missing-face.png" mode="" v-else class="avater-img"></image>
  7. </view>
  8. <view class="name-box">
  9. <view class="name-top">
  10. {{userInfo.nickname || '游客'}}<text v-if="userInfo && userInfo.level_name && userInfo.level > 1">{{'('+ userInfo.level_name +')'}}</text>
  11. </view>
  12. </view>
  13. </view>
  14. <!-- <view class="joinus" @click="navTo('/pages/user/registerMember')">
  15. <image src="../../static/img/join-us.png" mode=""></image>
  16. <view class="left-tit">
  17. 注册企业会员 加入成为自媒体
  18. </view>
  19. <view class="join-btn">
  20. 注册会员
  21. </view>
  22. </view> -->
  23. <view class="btm-box flex" @click="downFile" style="margin-top: -20rpx;">
  24. <image src="../../static/icon/u-0.png" mode="widthFix" class="left-img"></image>
  25. <view class="">台企联入会申请</view>
  26. <image src="../../static/icon/goto.png" mode="widthFix" class="right-img"></image>
  27. </view>
  28. <view class="btm-box flex" @click="navTo('/pages/user/mydy')">
  29. <image src="../../static/icon/u-1.png" mode="widthFix" class="left-img"></image>
  30. <view class="">我的订阅</view>
  31. <image src="../../static/icon/goto.png" mode="widthFix" class="right-img"></image>
  32. </view>
  33. <view class="btm-box flex" @click="navTo('/pages/user/mypl')">
  34. <image src="../../static/icon/u-2.png" mode="widthFix" class="left-img"></image>
  35. <view class="">我的评论</view>
  36. <image src="../../static/icon/goto.png" mode="widthFix" class="right-img"></image>
  37. </view>
  38. <view class="btm-box flex" @click="navTo('/pages/user/mymsg')">
  39. <image src="../../static/icon/u-3.png" mode="widthFix" class="left-img"></image>
  40. <view class="">回复我的</view>
  41. <image src="../../static/icon/goto.png" mode="widthFix" class="right-img"></image>
  42. </view>
  43. <view class="btm-box flex" @click="openKf">
  44. <image src="../../static/icon/u-4.png" mode="widthFix" class="left-img"></image>
  45. <view class="">联系客服</view>
  46. <image src="../../static/icon/goto.png" mode="widthFix" class="right-img"></image>
  47. </view>
  48. <view class="btm-box flex" @click="navToQy()">
  49. <image src="../../static/icon/u-5.png" mode="widthFix" class="left-img"></image>
  50. <view class="" v-if="qyzc.state !=2">企业注册</view>
  51. <view class="" v-else>
  52. 企业设置
  53. </view>
  54. <image src="../../static/icon/goto.png" mode="widthFix" class="right-img"></image>
  55. </view>
  56. <view class="btm-box flex" @click="navTo('/pages/set/set')">
  57. <image src="../../static/icon/u-6.png" mode="widthFix" class="left-img"></image>
  58. <view class="">设置</view>
  59. <image src="../../static/icon/goto.png" mode="widthFix" class="right-img"></image>
  60. </view>
  61. <uni-popup ref="popupkf" type="center">
  62. <view class="popup-box">
  63. <view class="img">
  64. <image src="../../static/img/img009.png" mode=""></image>
  65. </view>
  66. <view class="mian">
  67. <view class="delivery">
  68. <view class="title">已经为您定制专属客服</view>
  69. <image src="../../static/img/img010.png" mode=""></image>
  70. </view>
  71. <view class="">
  72. </view>
  73. <view class="nocancel">会员部主任</view>
  74. <view class="nocancel">林飞:13957687556<text class="copy-phone" @click="comfirm('13957687556')">复制</text></view>
  75. <view class="nocancel">新华社</view>
  76. <view class="nocancel">彭芬 :13883824048<text class="copy-phone" @click="comfirm('13883824048')">复制</text></view>
  77. <view class="nocancel">技术人员</view>
  78. <view class="nocancel">陈志翱:15381835932<text class="copy-phone" @click="comfirm('15381835932')">复制</text></view>
  79. <!-- <view class="comfirm-box">
  80. <view class="cancel" @click="cancel">取消</view>
  81. <view class="comfirm" @click="comfirm(text)">复制微信</view>
  82. </view> -->
  83. </view>
  84. </view>
  85. </uni-popup>
  86. </view>
  87. </template>
  88. <script>
  89. import {
  90. mapState,
  91. mapMutations
  92. } from 'vuex';
  93. import {
  94. downFile
  95. } from '@/api/index.js';
  96. import {
  97. saveUrl,
  98. interceptor
  99. } from '@/utils/loginUtils.js';
  100. import {
  101. getUserInfo,
  102. logout,
  103. enterprise
  104. } from '@/api/user.js';
  105. // #ifdef H5
  106. import {
  107. weixindata
  108. } from '@/utils/wxAuthorized';
  109. // #endif
  110. export default {
  111. data() {
  112. return {
  113. name:'',
  114. signDate:'',
  115. id:0,
  116. is_over:0,
  117. newTime: 0,
  118. money: '',
  119. mid: '',
  120. text: 'fen57698762',//客服
  121. qyzc:{state:3},//企业注册
  122. }
  123. },
  124. filters: {
  125. time(val) {
  126. let str = '';
  127. // console.log(val)
  128. if (val) {
  129. let date = new Date(val * 1000);
  130. let Y = date.getFullYear();
  131. let M = date.getMonth() + 1 > 9 ? (date.getMonth()+1) : '0' + (date.getMonth()+1);
  132. let D = date.getDate() > 9 ? date.getDate() : '0' + date.getDate();
  133. str = Y + '年' + M + '月' + D + '日';
  134. }
  135. return str;
  136. },
  137. },
  138. onShow() {
  139. enterprise().then(res=>{
  140. if(res.msg == '未发起企业认证') {
  141. }else {
  142. this.qyzc = res.data
  143. }
  144. })
  145. console.log(this);
  146. let obj = this
  147. // 判断是否已经登录
  148. if (this.hasLogin) {
  149. this.loadBaseData();
  150. } else {
  151. saveUrl();
  152. uni.showModal({
  153. title: '登录',
  154. content: '您未登录,是否马上登陆?',
  155. success: e => {
  156. if (e.confirm) {
  157. interceptor();
  158. }
  159. },
  160. fail: e => {
  161. console.log(e);
  162. }
  163. });
  164. }
  165. },
  166. onReady() {
  167. console.log(99999)
  168. // detail_training({
  169. // id:this.id,
  170. // }).then(({data}) => {
  171. // console.log(999,data)
  172. // this.name = data.name
  173. // this.signDate = data.add_time
  174. // this.is_over = data.is_over
  175. // })
  176. },
  177. computed: {
  178. ...mapState('user', ['hasLogin', 'userInfo']),
  179. ...mapState(['weichatObj']),
  180. },
  181. methods: {
  182. ...mapMutations('user', ['setUserInfo','logout']),
  183. // 登出
  184. loginout() {
  185. let obj = this;
  186. uni.showModal({
  187. content: '确定要退出登录么',
  188. success: e => {
  189. if (e.confirm) {
  190. logout({}).then(e => {
  191. obj.logout();
  192. uni.switchTab({
  193. url: '/pages/index/index'
  194. })
  195. })
  196. .catch(e => {
  197. console.log(e);
  198. });
  199. }
  200. }
  201. });
  202. },
  203. loadBaseData() {
  204. getUserInfo({}).then(({
  205. data
  206. }) => {
  207. this.setUserInfo(data);
  208. });
  209. // #ifdef H5
  210. weixindata();
  211. // #endif
  212. },
  213. navTo(url) {
  214. console.log(url)
  215. uni.navigateTo({
  216. url: url
  217. })
  218. },
  219. navToQy(url){
  220. if(this.qyzc.state ==1){
  221. this.$api.msg('认证审核中')
  222. }else if(this.qyzc.state ==2){
  223. uni.navigateTo({
  224. url:'/pages/set/setinfo'
  225. })
  226. }else{
  227. uni.navigateTo({
  228. url:'/pages/user/registerMember'
  229. })
  230. }
  231. },
  232. // 文件下载
  233. downFile(){
  234. downFile().then(res=>{
  235. if(res.status==200){
  236. window.location.href=res.data[0].url
  237. }
  238. })
  239. },
  240. // 打开客服弹窗
  241. openKf() {
  242. this.$refs.popupkf.open()
  243. },
  244. cancel() {
  245. this.$refs.popupkf.close();
  246. },
  247. comfirm(text) {
  248. console.log(text);
  249. const result = this.uniCopy(text);
  250. if (result === false) {
  251. uni.showToast({
  252. title: '不支持'
  253. });
  254. } else {
  255. uni.showToast({
  256. title: '复制成功',
  257. icon: 'none'
  258. });
  259. }
  260. this.$refs.popupkf.close();
  261. },
  262. uniCopy(content) {
  263. /**
  264. * 小程序端 和 app端的复制逻辑
  265. */
  266. //#ifndef H5
  267. uni.setClipboardData({
  268. data: content,
  269. success: function() {
  270. console.log('success');
  271. return true;
  272. }
  273. });
  274. //#endif
  275. /**
  276. * H5端的复制逻辑
  277. */
  278. // #ifdef H5
  279. if (!document.queryCommandSupported('copy')) {
  280. //为了兼容有些浏览器 queryCommandSupported 的判断
  281. // 不支持
  282. return false;
  283. }
  284. let textarea = document.createElement('textarea');
  285. textarea.value = content;
  286. textarea.readOnly = 'readOnly';
  287. document.body.appendChild(textarea);
  288. textarea.select(); // 选择对象
  289. textarea.setSelectionRange(0, content.length); //核心
  290. let result = document.execCommand('copy'); // 执行浏览器复制命令
  291. textarea.remove();
  292. return result;
  293. // #endif
  294. },
  295. }
  296. }
  297. </script>
  298. <style lang="scss">
  299. page {
  300. min-height: 100%;
  301. height: auto;
  302. background: #fff;
  303. }
  304. .content {
  305. line-height: 1.5;
  306. background-color: #fff;
  307. height: 100%;
  308. .top {
  309. width: 750rpx;
  310. height: 524rpx;
  311. // background-color: #fa7e67;
  312. display: flex;
  313. flex-direction: column;
  314. align-items: center;
  315. // padding-left: 55rpx;
  316. align-items: center;
  317. justify-content: center;
  318. background-image: url(../../static/img/user-bg.png);
  319. background-size: 100% 100%;
  320. .avater {
  321. width: 150rpx;
  322. height: 150rpx;
  323. // margin-right: 28rpx;
  324. .avater-img {
  325. width: 100%;
  326. height: 100%;
  327. border-radius: 50%;
  328. }
  329. }
  330. .name-box {
  331. // flex: 1;
  332. padding-top: 25rpx;
  333. .name-top {
  334. font-size: 42rpx;
  335. font-weight: 400;
  336. margin-bottom: 15rpx;
  337. font-size: 32rpx;
  338. font-family: PingFang SC;
  339. font-weight: 500;
  340. color: #FFFFFF;
  341. text-align: center;
  342. }
  343. .name-bottom{
  344. margin-top: 16rpx;
  345. display: flex;
  346. align-items: center;
  347. // justify-content: center;
  348. .nameInfo{
  349. color: #FFFFFF;
  350. padding: 6rpx 16rpx;
  351. border: 1rpx solid #FFFFFF;
  352. border-radius: 12rpx;
  353. // background-color: pink;
  354. }
  355. }
  356. .name-footbox {
  357. .name-foot {
  358. text-align: center;
  359. font-size: 22rpx;
  360. font-weight: 400;
  361. color: #FFFFFF;
  362. background: rgba(255, 255, 255, 0.2);
  363. border: 1px solid #FFFFFF;
  364. border-radius: 20rpx;
  365. padding: 3rpx 13rpx;
  366. }
  367. }
  368. }
  369. }
  370. .center-box {
  371. width: 687rpx;
  372. // height: 235px;
  373. background: #FFE8E8;
  374. border-radius: 16rpx;
  375. margin: -90rpx auto 0;
  376. .center-top {
  377. width: 687rpx;
  378. height: 80rpx;
  379. background: #FFFFFF;
  380. border-radius: 16rpx 16rpx 0 0;
  381. display: flex;
  382. align-items: center;
  383. padding-left: 30rpx;
  384. .top-left {
  385. width: 126rpx;
  386. line-height: 32rpx;
  387. text-align: center;
  388. background: linear-gradient(0deg, #C90F1B, #F14D33);
  389. font-size: 22rpx;
  390. font-weight: 400;
  391. color: #FFFFFF;
  392. border-radius: 20rpx;
  393. margin-right: 10rpx;
  394. }
  395. .top-right {
  396. font-size: 22rpx;
  397. font-weight: 400;
  398. color: #CB151D;
  399. }
  400. }
  401. .center-foot {
  402. height: 155rpx;
  403. display: flex;
  404. .foot-list {
  405. flex: 1;
  406. text-align: center;
  407. padding-top: 20rpx;
  408. .list-top {
  409. font-size: 39rpx;
  410. font-weight: 400;
  411. color: #CB141D;
  412. line-height: 58rpx;
  413. }
  414. .list-foot {
  415. font-size: 39rpx;
  416. font-weight: 400;
  417. color: #666666;
  418. line-height: 58rpx;
  419. }
  420. }
  421. }
  422. }
  423. .tt {
  424. display: flex;
  425. flex-wrap: wrap;
  426. padding-left:32rpx;
  427. .tt-box {
  428. width: 206rpx;
  429. height: 206rpx;
  430. border-radius: 10rpx;
  431. display: flex;
  432. flex-direction: column;
  433. align-items: center;
  434. justify-content: center;
  435. margin-right: 35rpx;
  436. margin-bottom: 30rpx;
  437. image {
  438. width: 64rpx;
  439. height: 64rpx;
  440. }
  441. .tt-txt {
  442. font-size: 24rpx;
  443. font-family: PingFang SC;
  444. font-weight: bold;
  445. color: #5A5A74;
  446. padding-top: 35rpx;
  447. }
  448. }
  449. }
  450. }
  451. .nav-wrapper {
  452. width: 678rpx;
  453. // height: 560rpx;
  454. background: #FFFFFF;
  455. box-shadow: 0px 2rpx 24rpx 0rpx rgba(0, 0, 0, 0.06);
  456. border-radius: 20rpx;
  457. margin: 32rpx auto 0;
  458. color: #555555;
  459. .nav-item {
  460. height: 115rpx;
  461. border-bottom: 1rpx #F6F6F6 solid;
  462. &:last-of-type {
  463. border-bottom: none;
  464. }
  465. justify-content: space-between;
  466. align-items: center;
  467. padding: 0 36rpx 0 40rpx;
  468. .item-left {
  469. align-items: center;
  470. image {
  471. // background-color: red;
  472. }
  473. .img1 {
  474. width: 34rpx;
  475. height: 34rpx;
  476. margin-right: 21rpx;
  477. }
  478. .img2 {
  479. width: 36rpx;
  480. height: 32rpx;
  481. margin-right: 19rpx;
  482. }
  483. .img3 {
  484. width: 28rpx;
  485. height: 36rpx;
  486. margin-right: 25rpx;
  487. }
  488. .img4 {
  489. width: 36rpx;
  490. height: 28rpx;
  491. margin-right: 19rpx;
  492. }
  493. .title {
  494. font-size: 32rpx;
  495. font-family: PingFang SC;
  496. font-weight: 500;
  497. color: #555555;
  498. }
  499. }
  500. .item-right {
  501. line-height: 115rpx;
  502. }
  503. }
  504. }
  505. .sy-box {
  506. position: absolute;
  507. bottom: 80rpx;
  508. // bottom: 105rpx;
  509. // height: 148rpx;
  510. width: 750rpx;
  511. // background-color: #bfa;
  512. .sy-item {
  513. flex-grow: 1;
  514. text-align: center;
  515. font-size: 28rpx;
  516. font-family: PingFang SC;
  517. font-weight: 500;
  518. color: #FFFFFF;
  519. .sy-item-val {
  520. font-size: 50rpx;
  521. font-weight: bold;
  522. }
  523. }
  524. }
  525. .btm-box {
  526. align-items: center;
  527. width: 706rpx;
  528. height: 104rpx;
  529. background: #ffffff;
  530. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  531. border-radius: 28rpx;
  532. margin: 20rpx auto;
  533. position: relative;
  534. padding: 0 33rpx 0 24rpx;
  535. font-size: 29rpx;
  536. font-weight: bold;
  537. color: #5d5d5d;
  538. .left-img {
  539. width: 40rpx;
  540. }
  541. .right-img {
  542. width: 14rpx;
  543. }
  544. view {
  545. flex-grow: 1;
  546. padding-left: 12rpx;
  547. }
  548. }
  549. .joinus {
  550. width: 744rpx;
  551. height: 134rpx;
  552. position: relative;
  553. // margin: ;
  554. // background-color: red;
  555. margin: -134rpx auto 0;
  556. image {
  557. width: 744rpx;
  558. height: 134rpx;
  559. }
  560. .left-tit {
  561. width: 490rpx;
  562. height: 130rpx;
  563. line-height: 130rpx;
  564. position: absolute;
  565. padding-left: 50rpx;
  566. top:0;
  567. left: 0;
  568. font-size: 31rpx;
  569. font-weight: 400;
  570. color: #FFFBF3;
  571. }
  572. .join-btn {
  573. font-size: 22rpx;
  574. font-weight: bold;
  575. color: #784244;
  576. width: 170rpx;
  577. height: 60rpx;
  578. line-height: 60rpx;
  579. position: absolute;
  580. top: 35rpx;
  581. right: 58rpx;
  582. // background-color: #fff;
  583. border-radius: 30rpx;
  584. padding-left: 20rpx;
  585. }
  586. }
  587. .popup-box {
  588. width: 522rpx;
  589. height: 605rpx;
  590. background-color: #ffffff;
  591. border-radius: 20rpx;
  592. position: relative;
  593. .img {
  594. position: relative;
  595. top: -56rpx;
  596. left: 0;
  597. width: 522rpx;
  598. height: 132rpx;
  599. display: flex;
  600. justify-content: center;
  601. image {
  602. border-radius: 20rpx 20rpx 0 0;
  603. width: 450rpx;
  604. height: 132rpx;
  605. }
  606. }
  607. .mian {
  608. margin-top: -44rpx;
  609. display: flex;
  610. flex-direction: column;
  611. align-items: center;
  612. // padding: 32rpx 32rpx;
  613. background-color: #ffffff;
  614. border-radius: 0 0 20rpx 20rpx;
  615. text-align: center;
  616. .delivery {
  617. font-size: 40rpx;
  618. color: #333333;
  619. display: flex;
  620. align-items: center;
  621. flex-direction: column;
  622. .title {}
  623. image {
  624. margin-top: 48rpx;
  625. width: 172rpx;
  626. height: 160rpx;
  627. }
  628. }
  629. .nocancel {
  630. font-size: 32rpx;
  631. color: #333333;
  632. margin-top: 14rpx;
  633. .copy-phone {
  634. display: inline-block;
  635. padding: 0 10rpx;
  636. border: 1rpx solid #f1dba8;
  637. border-radius: 10rpx;
  638. color:#e4c77d;
  639. font-size: 24rpx;
  640. margin-left: 10rpx;
  641. }
  642. }
  643. .comfirm-box {
  644. margin-top: 10rpx;
  645. display: flex;
  646. // margin-bottom: 32rpx;
  647. // justify-content: space-around;
  648. .cancel {
  649. display: flex;
  650. align-items: center;
  651. justify-content: center;
  652. width: 197rpx;
  653. height: 74rpx;
  654. border: 1px solid #dcc786;
  655. border-radius: 38rpx;
  656. font-size: 32rpx;
  657. color: #605128;
  658. }
  659. .comfirm {
  660. margin-left: 32rpx;
  661. display: flex;
  662. align-items: center;
  663. justify-content: center;
  664. width: 197rpx;
  665. height: 74rpx;
  666. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  667. border-radius: 38px;
  668. font-size: 32rpx;
  669. color: #605128;
  670. }
  671. }
  672. }
  673. }
  674. </style>