home.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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. if(res.code===0) return this.questionnaireKindShow = true;
  158. this.teamKindMsg = res.msg||'';
  159. this.teamKindShow = true;
  160. })
  161. }
  162. }
  163. if(uni.getStorageSync('token')){
  164. this.getPerillPJ();
  165. this.getPerillBG();
  166. }
  167. if(uni.getStorageSync('newUser')) this.newUserFreeShow = true;
  168. },
  169. methods:{
  170. toTurn(url){
  171. if(!url) return
  172. if(url!=='/pages/dialog'&&!this.isLogin()) return
  173. uni.navigateTo({
  174. url
  175. })
  176. },
  177. getPerillPJ(){
  178. this.$api.get('/core/teammember/que/questionnaireStats').then(res=>{
  179. if(res.data.code!==0) return
  180. this.perillPJ = res.data.data;
  181. this.perillPJ.sum = (this.perillPJ.completed||0)+(this.perillPJ.uncompleted||0);
  182. })
  183. },
  184. getPerillBG(){
  185. this.$api.get('/core/report/reportStats').then(res=>{
  186. if(res.data.code!==0) return
  187. this.perillBG = res.data.data;
  188. this.perillBG.sum = (this.perillBG.received||0)+(this.perillBG.sent||0);
  189. })
  190. },
  191. getWjList(){
  192. this.$api.get('/core/teammember/que/listByUser').then(res=>{
  193. if(res.data.code!==0) return
  194. this.wjDwc = res.data.data.filter(d=>d.status===0).length;
  195. this.wjYwc = res.data.data.filter(d=>d.status===1).length;
  196. })
  197. },
  198. getReportList(){
  199. this.$api.get('/core/report/member/personalReportList').then(res=>{
  200. if(res.data.code!==0) return
  201. this.reportCount = res.data.data.length;
  202. })
  203. },
  204. handleToFill(){
  205. this.questionnaireKindShow = false;
  206. uni.navigateTo({
  207. url:'/pagesHome/questionnaire?type=receive'
  208. })
  209. },
  210. handleFree(){
  211. uni.reLaunch({
  212. url:'/pages/publish'
  213. })
  214. }
  215. }
  216. }
  217. </script>
  218. <style scoped lang="scss">
  219. ::v-deep .indicator__dot{
  220. width: 12rpx;
  221. height: 12rpx;
  222. background: transparent;
  223. border: 2rpx solid #FFFFFF;
  224. border-radius: 6rpx;
  225. margin: 0 8rpx;
  226. }
  227. ::v-deep .indicator__dot--active{
  228. width: 12rpx;
  229. height: 12rpx;
  230. background: #FFFFFF;
  231. }
  232. .tabPage{
  233. background: #F7F7F7;
  234. .topbg{
  235. width: 100%;
  236. height: 720rpx;
  237. position: fixed;
  238. top: 0;
  239. left: 0;
  240. right: 0;
  241. }
  242. .lunbo{
  243. width: 100%;
  244. height: 368rpx;
  245. margin-top: 30rpx;
  246. position: relative;
  247. }
  248. .preill{
  249. margin-top: 30rpx;
  250. position: relative;
  251. &-box{
  252. width: calc(50% - 11rpx);
  253. background: #FFFFFF;
  254. border-radius: 24rpx;
  255. padding: 54rpx 24rpx 52rpx;
  256. box-sizing: border-box;
  257. &-title{
  258. font-family: PingFang-SC, PingFang-SC;
  259. font-weight: bold;
  260. font-size: 28rpx;
  261. color: #002846;
  262. line-height: 28rpx;
  263. span{
  264. font-size: 36rpx;
  265. }
  266. }
  267. &-num{
  268. font-family: PingFang-SC, PingFang-SC;
  269. font-weight: 800;
  270. font-size: 40rpx;
  271. color: #002846;
  272. line-height: 40rpx;
  273. margin-top: 24rpx;
  274. }
  275. &-state{
  276. margin-top: 46rpx;
  277. &-pre{
  278. padding-left: 16rpx;
  279. position: relative;
  280. font-family: PingFangSC, PingFang SC;
  281. font-weight: 400;
  282. font-size: 24rpx;
  283. color: #335368;
  284. line-height: 20rpx;
  285. span{
  286. color: #1D2129;
  287. }
  288. &::before{
  289. content: '';
  290. width: 10rpx;
  291. height: 10rpx;
  292. border-radius: 5rpx;
  293. position: absolute;
  294. left: 0;
  295. top: 50%;
  296. margin-top: -5rpx;
  297. }
  298. &.grey{
  299. &::before{
  300. background: #DDE0E6;
  301. }
  302. }
  303. &.yellow{
  304. &::before{
  305. background: #FFD750;
  306. }
  307. }
  308. &.green{
  309. &::before{
  310. background: #31D1D6;
  311. }
  312. }
  313. }
  314. }
  315. &-progress{
  316. margin-top: 24rpx;
  317. width: 100%;
  318. height: 10rpx;
  319. background: #DFE5EE;
  320. border-radius: 5rpx;
  321. position: relative;
  322. &-current{
  323. height: 10rpx;
  324. border-radius: 4rpx;
  325. position: absolute;
  326. left: 0;
  327. top: 0;
  328. }
  329. .pbp-yellow{
  330. background: #FFD750;
  331. }
  332. .pbp-green{
  333. background: #31D1D6;
  334. }
  335. }
  336. }
  337. }
  338. .boxs{
  339. margin-top: 20rpx;
  340. position: relative;
  341. &-pre{
  342. width: calc(50% - 11rpx);
  343. padding: 42rpx 0 0 20rpx;
  344. box-sizing: border-box;
  345. height: 184rpx;
  346. &-title{
  347. font-family: PingFang-SC, PingFang-SC;
  348. font-weight: bold;
  349. font-size: 32rpx;
  350. color: #E0EFEF;
  351. line-height: 45rpx;
  352. }
  353. &-tip{
  354. font-family: PingFangSC, PingFang SC;
  355. font-weight: 400;
  356. font-size: 24rpx;
  357. color: #E0EFEF;
  358. line-height: 33rpx;
  359. margin-top: 16rpx;
  360. image{
  361. width: 26rpx;
  362. height: 26rpx;
  363. margin-left: 12rpx;
  364. }
  365. }
  366. &.bp1{
  367. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg1.png') no-repeat;
  368. background-size: 100% 100%;
  369. }
  370. &.bp2{
  371. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg2.png') no-repeat;
  372. background-size: 100% 100%;
  373. }
  374. }
  375. }
  376. .common{
  377. margin-top: 20rpx;
  378. background: #FFFFFF;
  379. border-radius: 24rpx;
  380. padding: 40rpx 24rpx 48rpx;
  381. position: relative;
  382. &-title{
  383. font-family: PingFang-SC, PingFang-SC;
  384. font-weight: bold;
  385. font-size: 34rpx;
  386. color: #002846;
  387. line-height: 48rpx;
  388. }
  389. &-menu{
  390. margin-top: 45rpx;
  391. &-pre{
  392. width: calc(100% / 3);
  393. image{
  394. width: 62rpx;
  395. height: 62rpx;
  396. }
  397. text{
  398. font-family: PingFangSC, PingFang SC;
  399. font-weight: 400;
  400. font-size: 26rpx;
  401. color: #193D59;
  402. line-height: 26rpx;
  403. text-align: center;
  404. margin-top: 27rpx;
  405. }
  406. }
  407. }
  408. }
  409. .new-user-free{
  410. position: fixed;
  411. left: 0;
  412. right: 0;
  413. top: 0;
  414. bottom: 0;
  415. background: rgba(0, 0, 0, .6);
  416. z-index: 1000;
  417. &-box1{
  418. width: calc(100% - 180rpx);
  419. height: 280rpx;
  420. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_title.png') no-repeat;
  421. background-size: 100% 100%;
  422. padding-left: 53rpx;
  423. &-text{
  424. font-family: SourceHanSansCN, SourceHanSansCN;
  425. font-weight: bold;
  426. font-size: 36rpx;
  427. color: #874016;
  428. line-height: 54rpx;
  429. margin-top: 140rpx;
  430. }
  431. }
  432. &-box2{
  433. width: calc(100% - 140rpx);
  434. background: #FFFFFF;
  435. border-radius: 24rpx;
  436. padding: 45rpx 25rpx 42rpx;
  437. box-sizing: border-box;
  438. &-price{
  439. width: 100%;
  440. height: 132rpx;
  441. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_price.png') no-repeat;
  442. background-size: 100% 100%;
  443. padding: 27rpx 34rpx 27rpx 30rpx;
  444. box-sizing: border-box;
  445. &-left{
  446. &-title{
  447. font-family: PingFang-SC, PingFang-SC;
  448. font-weight: bold;
  449. font-size: 28rpx;
  450. color: #5E2E11;
  451. line-height: 36rpx;
  452. }
  453. &-tip{
  454. font-family: PingFangSC, PingFang SC;
  455. font-weight: 400;
  456. font-size: 24rpx;
  457. color: #808080;
  458. line-height: 32rpx;
  459. margin-top: 10rpx;
  460. }
  461. }
  462. &-right{
  463. &-top{
  464. font-family: PingFang-SC, PingFang-SC;
  465. font-weight: bold;
  466. font-size: 48rpx;
  467. color: #FF5A09;
  468. line-height: 67rpx;
  469. }
  470. &-bottom{
  471. font-family: PingFangSC, PingFang SC;
  472. font-weight: 400;
  473. font-size: 24rpx;
  474. color: #612D11;
  475. line-height: 33rpx;
  476. margin-top: 3rpx;
  477. text-decoration: line-through;
  478. }
  479. }
  480. }
  481. &-btn{
  482. width: calc(100% - 170rpx);
  483. height: 80rpx;
  484. border-radius: 40rpx;
  485. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_btn.png') no-repeat;
  486. background-size: 100% 100%;
  487. font-family: PingFang-SC, PingFang-SC;
  488. font-weight: bold;
  489. font-size: 32rpx;
  490. color: #5E2E11;
  491. line-height: 80rpx;
  492. text-align: center;
  493. letter-spacing: 2rpx;
  494. margin-top: 38rpx;
  495. }
  496. }
  497. &-close{
  498. width: 64rpx;
  499. height: 64rpx;
  500. margin-top: 48rpx;
  501. }
  502. }
  503. .kind-reminder{
  504. position: fixed;
  505. left: 0;
  506. right: 0;
  507. top: 0;
  508. bottom: 0;
  509. z-index: 1000;
  510. background: rgba(0, 0, 0, .6);
  511. .kr-box{
  512. width: calc(100% - 100rpx);
  513. padding: 54rpx 60rpx 48rpx;
  514. box-sizing: border-box;
  515. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/remind_bg.png') no-repeat;
  516. background-size: 100% 100%;
  517. position: relative;
  518. image{
  519. width: 48rpx;
  520. height: 48rpx;
  521. position: absolute;
  522. top: 40rpx;
  523. right: 30rpx;
  524. }
  525. .kr-title{
  526. font-family: PingFang-SC, PingFang-SC;
  527. font-weight: bold;
  528. font-size: 36rpx;
  529. color: #002846;
  530. line-height: 56rpx;
  531. text-align: center;
  532. }
  533. .kr-p{
  534. font-family: PingFangSC, PingFang SC;
  535. font-weight: 400;
  536. font-size: 30rpx;
  537. color: #002846;
  538. line-height: 48rpx;
  539. text-align: center;
  540. span{
  541. font-weight: bold;
  542. margin: 0 10rpx;
  543. }
  544. }
  545. .kr-btn{
  546. width: calc(100% - 80rpx);
  547. height: 88rpx;
  548. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  549. border-radius: 44rpx;
  550. font-family: PingFang-SC, PingFang-SC;
  551. font-weight: bold;
  552. font-size: 32rpx;
  553. color: #FFFFFF;
  554. line-height: 88rpx;
  555. text-align: center;
  556. letter-spacing: 2rpx;
  557. margin-top: 66rpx;
  558. }
  559. }
  560. }
  561. }
  562. </style>