home.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <u-navbar bgColor="transparent">
  4. <view class="u-nav-slot" slot="left" style="display: flex;background-color: transparent;">
  5. <image :src="imgBase+'home_logo.png'" style="width: 200rpx;height: 54rpx;margin-left: 12rpx;"></image>
  6. </view>
  7. </u-navbar>
  8. <image class="topbg" :src="imgBase+'home_top_bg.png'" mode="widthFix"></image>
  9. <view class="lunbo">
  10. <u-swiper
  11. :list="bannarList"
  12. @change="e => current = e.current"
  13. :autoplay="true"
  14. height="368rpx"
  15. >
  16. <template #indicator>
  17. <view class="indicator adf">
  18. <view class="indicator__dot" v-for="(item, index) in bannarList" :key="index"
  19. :class="[index === current && 'indicator__dot--active']">
  20. </view>
  21. </view>
  22. </template>
  23. </u-swiper>
  24. </view>
  25. <view class="preill adfacjb">
  26. <view class="preill-box">
  27. <view class="preill-box-title">我的PREILL评估:<span>{{perillPJ.sum||0}}</span></view>
  28. <view class="preill-box-state adfacjb">
  29. <view class="preill-box-state-pre adfac grey">已完成:<span>{{perillPJ.completed||0}}</span></view>
  30. <view class="preill-box-state-pre adfac yellow">待完成:<span>{{perillPJ.uncompleted||0}}</span></view>
  31. </view>
  32. <view class="preill-box-progress">
  33. <view class="preill-box-progress-current pbp-yellow" :style="{'width':((perillPJ.completed||0)/(perillPJ.sum||9999)*100)+'%'}"></view>
  34. </view>
  35. </view>
  36. <view class="preill-box">
  37. <view class="preill-box-title">我的PREILL报告:<span>{{perillBG.sum||0}}</span></view>
  38. <view class="preill-box-state adfacjb">
  39. <view class="preill-box-state-pre adfac green">我收到:<span>{{perillBG.received||0}}</span></view>
  40. <view class="preill-box-state-pre adfac grey">我发送:<span>{{perillBG.sent||0}}</span></view>
  41. </view>
  42. <view class="preill-box-progress">
  43. <view class="preill-box-progress-current pbp-green" :style="{'width':(perillBG.received||0/(perillBG.sum||9999)*100)+'%'}"></view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="boxs adfacjb">
  48. <view class="boxs-pre bp1" @click="toTurn('/pages/dialog')">
  49. <view class="boxs-pre-title">AI督导对话</view>
  50. <view class="boxs-pre-tip adfac">点击开始<image :src="imgBase+'home_arrow_right.png'"></image></view>
  51. </view>
  52. <view class="boxs-pre bp2">
  53. <view class="boxs-pre-title">人工报告解读</view>
  54. <view class="boxs-pre-tip adfac">添加客服微信预约<image :src="imgBase+'home_arrow_right.png'"></image></view>
  55. </view>
  56. </view>
  57. <view class="common">
  58. <view class="common-title">常用功能</view>
  59. <view class="common-menu adf">
  60. <view class="common-menu-pre adffcac">
  61. <image :src="imgBase+'home_img_pinggu.png'" @click="toTurn('/pagesHome/questionnaire?type=receive')"></image>
  62. <text>PREILL评估</text>
  63. </view>
  64. <view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/report')">
  65. <image :src="imgBase+'home_img_baogao.png'"></image>
  66. <text>PREILL报告</text>
  67. </view>
  68. <view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/questionnaire?type=create')">
  69. <image :src="imgBase+'home_img_guanli.png'"></image>
  70. <text>问卷管理</text>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="new-user-free adffcacjc" v-if="newUserFreeShow">
  75. <view class="new-user-free-box1">
  76. <view class="new-user-free-box1-text">PERILL评估</view>
  77. <view class="new-user-free-box1-text" style="margin-top: 8rpx;">基础版免费体验1次</view>
  78. </view>
  79. <view class="new-user-free-box2 adffcac">
  80. <view class="new-user-free-box2-price adfacjb">
  81. <view class="new-user-free-box2-price-left adffc">
  82. <view class="new-user-free-box2-price-left-title">仅限个人创建使用</view>
  83. <view class="new-user-free-box2-price-left-tip">领取后1年有效</view>
  84. </view>
  85. <view class="new-user-free-box2-price-right adffcac">
  86. <view class="new-user-free-box2-price-right-top">1次</view>
  87. <view class="new-user-free-box2-price-right-bottom">原价99</view>
  88. </view>
  89. </view>
  90. <view class="new-user-free-box2-btn" @click="handleFree">免费体验</view>
  91. </view>
  92. <image class="new-user-free-close" :src="imgBase+'new_free_close.png'" @click="newUserFreeShow=false"></image>
  93. </view>
  94. <view class="kind-reminder adffcacjc" v-if="teamKindShow">
  95. <view class="kr-box adffcac">
  96. <image :src="imgBase+'remind_close.png'" @click="teamKindShow=false"></image>
  97. <view class="kr-title">温馨提示</view>
  98. <view class="kr-p" style="margin-top: 32rpx;">{{teamKindMsg}}</view>
  99. <view class="kr-btn" @click="teamKindShow=false">我知道了</view>
  100. </view>
  101. </view>
  102. <view class="kind-reminder adffcacjc" v-if="questionnaireKindShow">
  103. <view class="kr-box adffcac">
  104. <image :src="imgBase+'remind_close.png'" @click="questionnaireKindShow=false"></image>
  105. <view class="kr-title">温馨提示</view>
  106. <view class="kr-p" style="margin-top: 32rpx;">你有一份<span>“PERILL团队评估中级”</span>问卷待完成,请及时填写,</view>
  107. <view class="kr-p">以便我们为你提供精准分析</view>
  108. <view class="kr-btn" @click="handleToFill">去填写</view>
  109. </view>
  110. </view>
  111. <Tabbar :tabbarIndex="0"></Tabbar>
  112. </view>
  113. </template>
  114. <script>
  115. import Tabbar from '@/components/CusTabbar/index.vue'
  116. export default {
  117. components:{ Tabbar },
  118. data(){
  119. return {
  120. current:0,
  121. perillPJ:null,
  122. perillBG:null,
  123. bannarList:[
  124. this.$imgBase+'home_lb.png',
  125. this.$imgBase+'home_lb.png',
  126. this.$imgBase+'home_lb.png'
  127. ],
  128. newUserFreeShow:false,
  129. teamKindShow:false,
  130. teamKindMsg:'',
  131. questionnaireKindShow:false,
  132. }
  133. },
  134. onLoad(options) {
  135. if(options.q){
  136. try{
  137. const decodedUrl = decodeURIComponent(options.q);
  138. const codeMatch = decodedUrl.match(/type=([^&]+)/);
  139. const stationCode = codeMatch ? codeMatch[1] : null;
  140. if(stationCode) uni.setStorageSync('channelType',stationCode)
  141. }catch(e){
  142. console.log(e,'e');
  143. }
  144. }
  145. if(options.shareType) uni.setStorageSync('channelType',options.shareType)
  146. if(options.shareUserId) uni.setStorageSync('shareUserId',options.shareUserId)
  147. if(options.shareTQId) uni.setStorageSync('shareTQId',options.shareTQId)
  148. if(options.shareTQId||uni.getStorageSync('shareTQId')){
  149. // 邀请进来的并且已经登录的
  150. if(uni.getStorageSync('userInfo')){
  151. this.$api.get('/wx/queShareCheck',{
  152. channelType:uni.getStorageSync('channelType')||'',
  153. phone:JSON.parse(uni.getStorageSync('userInfo')).mobile||'',
  154. referrerId:uni.getStorageSync('shareUserId')||'',
  155. teamQuestionnaireId:uni.getStorageSync('shareTQId')||'',
  156. }).then(({data:res})=>{
  157. this.$showModal(JSON.stringify(res))
  158. if(res.code===0) return this.questionnaireKindShow = true;
  159. this.teamKindMsg = res.msg||'';
  160. this.teamKindShow = true;
  161. })
  162. }
  163. }
  164. if(uni.getStorageSync('token')){
  165. this.getPerillPJ();
  166. this.getPerillBG();
  167. }
  168. if(uni.getStorageSync('newUser')) this.newUserFreeShow = true;
  169. },
  170. methods:{
  171. toTurn(url){
  172. if(!url) return
  173. if(url!=='/pages/dialog'&&!this.isLogin()) return
  174. uni.navigateTo({
  175. url
  176. })
  177. },
  178. getPerillPJ(){
  179. this.$api.get('/core/teammember/que/questionnaireStats').then(res=>{
  180. if(res.data.code!==0) return
  181. this.perillPJ = res.data.data;
  182. this.perillPJ.sum = (this.perillPJ.completed||0)+(this.perillPJ.uncompleted||0);
  183. })
  184. },
  185. getPerillBG(){
  186. this.$api.get('/core/report/reportStats').then(res=>{
  187. if(res.data.code!==0) return
  188. this.perillBG = res.data.data;
  189. this.perillBG.sum = (this.perillBG.received||0)+(this.perillBG.sent||0);
  190. })
  191. },
  192. getWjList(){
  193. this.$api.get('/core/teammember/que/listByUser').then(res=>{
  194. if(res.data.code!==0) return
  195. this.wjDwc = res.data.data.filter(d=>d.status===0).length;
  196. this.wjYwc = res.data.data.filter(d=>d.status===1).length;
  197. })
  198. },
  199. getReportList(){
  200. this.$api.get('/core/report/member/personalReportList').then(res=>{
  201. if(res.data.code!==0) return
  202. this.reportCount = res.data.data.length;
  203. })
  204. },
  205. handleToFill(){
  206. this.questionnaireKindShow = false;
  207. uni.navigateTo({
  208. url:'/pagesHome/questionnaire?type=receive'
  209. })
  210. },
  211. handleFree(){
  212. uni.reLaunch({
  213. url:'/pages/publish'
  214. })
  215. }
  216. }
  217. }
  218. </script>
  219. <style scoped lang="scss">
  220. ::v-deep .indicator__dot{
  221. width: 12rpx;
  222. height: 12rpx;
  223. background: transparent;
  224. border: 2rpx solid #FFFFFF;
  225. border-radius: 6rpx;
  226. margin: 0 8rpx;
  227. }
  228. ::v-deep .indicator__dot--active{
  229. width: 12rpx;
  230. height: 12rpx;
  231. background: #FFFFFF;
  232. }
  233. .tabPage{
  234. background: #F7F7F7;
  235. .topbg{
  236. width: 100%;
  237. height: 720rpx;
  238. position: fixed;
  239. top: 0;
  240. left: 0;
  241. right: 0;
  242. }
  243. .lunbo{
  244. width: 100%;
  245. height: 368rpx;
  246. margin-top: 30rpx;
  247. position: relative;
  248. }
  249. .preill{
  250. margin-top: 30rpx;
  251. position: relative;
  252. &-box{
  253. width: calc(50% - 11rpx);
  254. background: #FFFFFF;
  255. border-radius: 24rpx;
  256. padding: 54rpx 24rpx 52rpx;
  257. box-sizing: border-box;
  258. &-title{
  259. font-family: PingFang-SC, PingFang-SC;
  260. font-weight: bold;
  261. font-size: 28rpx;
  262. color: #002846;
  263. line-height: 28rpx;
  264. span{
  265. font-size: 36rpx;
  266. }
  267. }
  268. &-num{
  269. font-family: PingFang-SC, PingFang-SC;
  270. font-weight: 800;
  271. font-size: 40rpx;
  272. color: #002846;
  273. line-height: 40rpx;
  274. margin-top: 24rpx;
  275. }
  276. &-state{
  277. margin-top: 46rpx;
  278. &-pre{
  279. padding-left: 16rpx;
  280. position: relative;
  281. font-family: PingFangSC, PingFang SC;
  282. font-weight: 400;
  283. font-size: 24rpx;
  284. color: #335368;
  285. line-height: 20rpx;
  286. span{
  287. color: #1D2129;
  288. }
  289. &::before{
  290. content: '';
  291. width: 10rpx;
  292. height: 10rpx;
  293. border-radius: 5rpx;
  294. position: absolute;
  295. left: 0;
  296. top: 50%;
  297. margin-top: -5rpx;
  298. }
  299. &.grey{
  300. &::before{
  301. background: #DDE0E6;
  302. }
  303. }
  304. &.yellow{
  305. &::before{
  306. background: #FFD750;
  307. }
  308. }
  309. &.green{
  310. &::before{
  311. background: #31D1D6;
  312. }
  313. }
  314. }
  315. }
  316. &-progress{
  317. margin-top: 24rpx;
  318. width: 100%;
  319. height: 10rpx;
  320. background: #DFE5EE;
  321. border-radius: 5rpx;
  322. position: relative;
  323. &-current{
  324. height: 10rpx;
  325. border-radius: 4rpx;
  326. position: absolute;
  327. left: 0;
  328. top: 0;
  329. }
  330. .pbp-yellow{
  331. background: #FFD750;
  332. }
  333. .pbp-green{
  334. background: #31D1D6;
  335. }
  336. }
  337. }
  338. }
  339. .boxs{
  340. margin-top: 20rpx;
  341. position: relative;
  342. &-pre{
  343. width: calc(50% - 11rpx);
  344. padding: 42rpx 0 0 20rpx;
  345. box-sizing: border-box;
  346. height: 184rpx;
  347. &-title{
  348. font-family: PingFang-SC, PingFang-SC;
  349. font-weight: bold;
  350. font-size: 32rpx;
  351. color: #E0EFEF;
  352. line-height: 45rpx;
  353. }
  354. &-tip{
  355. font-family: PingFangSC, PingFang SC;
  356. font-weight: 400;
  357. font-size: 24rpx;
  358. color: #E0EFEF;
  359. line-height: 33rpx;
  360. margin-top: 16rpx;
  361. image{
  362. width: 26rpx;
  363. height: 26rpx;
  364. margin-left: 12rpx;
  365. }
  366. }
  367. &.bp1{
  368. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg1.png') no-repeat;
  369. background-size: 100% 100%;
  370. }
  371. &.bp2{
  372. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg2.png') no-repeat;
  373. background-size: 100% 100%;
  374. }
  375. }
  376. }
  377. .common{
  378. margin-top: 20rpx;
  379. background: #FFFFFF;
  380. border-radius: 24rpx;
  381. padding: 40rpx 24rpx 48rpx;
  382. position: relative;
  383. &-title{
  384. font-family: PingFang-SC, PingFang-SC;
  385. font-weight: bold;
  386. font-size: 34rpx;
  387. color: #002846;
  388. line-height: 48rpx;
  389. }
  390. &-menu{
  391. margin-top: 45rpx;
  392. &-pre{
  393. width: calc(100% / 3);
  394. image{
  395. width: 62rpx;
  396. height: 62rpx;
  397. }
  398. text{
  399. font-family: PingFangSC, PingFang SC;
  400. font-weight: 400;
  401. font-size: 26rpx;
  402. color: #193D59;
  403. line-height: 26rpx;
  404. text-align: center;
  405. margin-top: 27rpx;
  406. }
  407. }
  408. }
  409. }
  410. .new-user-free{
  411. position: fixed;
  412. left: 0;
  413. right: 0;
  414. top: 0;
  415. bottom: 0;
  416. background: rgba(0, 0, 0, .6);
  417. z-index: 1000;
  418. &-box1{
  419. width: calc(100% - 180rpx);
  420. height: 280rpx;
  421. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_title.png') no-repeat;
  422. background-size: 100% 100%;
  423. padding-left: 53rpx;
  424. &-text{
  425. font-family: SourceHanSansCN, SourceHanSansCN;
  426. font-weight: bold;
  427. font-size: 36rpx;
  428. color: #874016;
  429. line-height: 54rpx;
  430. margin-top: 140rpx;
  431. }
  432. }
  433. &-box2{
  434. width: calc(100% - 140rpx);
  435. background: #FFFFFF;
  436. border-radius: 24rpx;
  437. padding: 45rpx 25rpx 42rpx;
  438. box-sizing: border-box;
  439. &-price{
  440. width: 100%;
  441. height: 132rpx;
  442. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_price.png') no-repeat;
  443. background-size: 100% 100%;
  444. padding: 27rpx 34rpx 27rpx 30rpx;
  445. box-sizing: border-box;
  446. &-left{
  447. &-title{
  448. font-family: PingFang-SC, PingFang-SC;
  449. font-weight: bold;
  450. font-size: 28rpx;
  451. color: #5E2E11;
  452. line-height: 36rpx;
  453. }
  454. &-tip{
  455. font-family: PingFangSC, PingFang SC;
  456. font-weight: 400;
  457. font-size: 24rpx;
  458. color: #808080;
  459. line-height: 32rpx;
  460. margin-top: 10rpx;
  461. }
  462. }
  463. &-right{
  464. &-top{
  465. font-family: PingFang-SC, PingFang-SC;
  466. font-weight: bold;
  467. font-size: 48rpx;
  468. color: #FF5A09;
  469. line-height: 67rpx;
  470. }
  471. &-bottom{
  472. font-family: PingFangSC, PingFang SC;
  473. font-weight: 400;
  474. font-size: 24rpx;
  475. color: #612D11;
  476. line-height: 33rpx;
  477. margin-top: 3rpx;
  478. text-decoration: line-through;
  479. }
  480. }
  481. }
  482. &-btn{
  483. width: calc(100% - 170rpx);
  484. height: 80rpx;
  485. border-radius: 40rpx;
  486. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_btn.png') no-repeat;
  487. background-size: 100% 100%;
  488. font-family: PingFang-SC, PingFang-SC;
  489. font-weight: bold;
  490. font-size: 32rpx;
  491. color: #5E2E11;
  492. line-height: 80rpx;
  493. text-align: center;
  494. letter-spacing: 2rpx;
  495. margin-top: 38rpx;
  496. }
  497. }
  498. &-close{
  499. width: 64rpx;
  500. height: 64rpx;
  501. margin-top: 48rpx;
  502. }
  503. }
  504. .kind-reminder{
  505. position: fixed;
  506. left: 0;
  507. right: 0;
  508. top: 0;
  509. bottom: 0;
  510. z-index: 1000;
  511. background: rgba(0, 0, 0, .6);
  512. .kr-box{
  513. width: calc(100% - 100rpx);
  514. padding: 54rpx 60rpx 48rpx;
  515. box-sizing: border-box;
  516. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/remind_bg.png') no-repeat;
  517. background-size: 100% 100%;
  518. position: relative;
  519. image{
  520. width: 48rpx;
  521. height: 48rpx;
  522. position: absolute;
  523. top: 40rpx;
  524. right: 30rpx;
  525. }
  526. .kr-title{
  527. font-family: PingFang-SC, PingFang-SC;
  528. font-weight: bold;
  529. font-size: 36rpx;
  530. color: #002846;
  531. line-height: 56rpx;
  532. text-align: center;
  533. }
  534. .kr-p{
  535. font-family: PingFangSC, PingFang SC;
  536. font-weight: 400;
  537. font-size: 30rpx;
  538. color: #002846;
  539. line-height: 48rpx;
  540. text-align: center;
  541. span{
  542. font-weight: bold;
  543. margin: 0 10rpx;
  544. }
  545. }
  546. .kr-btn{
  547. width: calc(100% - 80rpx);
  548. height: 88rpx;
  549. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  550. border-radius: 44rpx;
  551. font-family: PingFang-SC, PingFang-SC;
  552. font-weight: bold;
  553. font-size: 32rpx;
  554. color: #FFFFFF;
  555. line-height: 88rpx;
  556. text-align: center;
  557. letter-spacing: 2rpx;
  558. margin-top: 66rpx;
  559. }
  560. }
  561. }
  562. }
  563. </style>