home.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  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;">你尚未加入<span>(问卷ID:{{87999}})</span>的团队</view>
  99. <view class="kr-p">因此无法填写此问卷</view>
  100. <view class="kr-p">请联系问卷创建者<span>{{'刘怡然'}}</span>将你加入团队</view>
  101. <view class="kr-btn" @click="teamKindShow=false">我知道了</view>
  102. </view>
  103. </view>
  104. <view class="kind-reminder adffcacjc" v-if="questionnaireKindShow">
  105. <view class="kr-box adffcac">
  106. <image :src="imgBase+'remind_close.png'" @click="questionnaireKindShow=false"></image>
  107. <view class="kr-title">温馨提示</view>
  108. <view class="kr-p" style="margin-top: 32rpx;">你有一份<span>“PERILL团队评估初级”</span>问卷待完成,请及时填写,</view>
  109. <view class="kr-p">以便我们为你提供精准分析</view>
  110. <view class="kr-btn" @click="handleToFill">去填写</view>
  111. </view>
  112. </view>
  113. <Tabbar :tabbarIndex="0"></Tabbar>
  114. </view>
  115. </template>
  116. <script>
  117. import Tabbar from '@/components/CusTabbar/index.vue'
  118. export default {
  119. components:{ Tabbar },
  120. data(){
  121. return {
  122. current:0,
  123. perillPJ:null,
  124. perillBG:null,
  125. bannarList:[
  126. this.$imgBase+'home_lb.png',
  127. this.$imgBase+'home_lb.png',
  128. this.$imgBase+'home_lb.png'
  129. ],
  130. newUserFreeShow:false,
  131. teamKindShow:false,
  132. questionnaireKindShow:false,
  133. }
  134. },
  135. onLoad(options) {
  136. if(options.q){
  137. try{
  138. const decodedUrl = decodeURIComponent(options.q);
  139. const codeMatch = decodedUrl.match(/type=([^&]+)/);
  140. const stationCode = codeMatch ? codeMatch[1] : null;
  141. if(stationCode) uni.setStorageSync('channelType',stationCode)
  142. }catch(e){
  143. console.log(e,'e');
  144. }
  145. }
  146. if(options.shareTQId) uni.setStorageSync('shareTQId',options.shareTQId)
  147. if(options.shareUserId) uni.setStorageSync('shareUserId',options.shareUserId)
  148. if(uni.getStorageSync('token')){
  149. this.getPerillPJ();
  150. this.getPerillBG();
  151. }
  152. if(uni.getStorageSync('newUser')) this.newUserFreeShow = true;
  153. },
  154. methods:{
  155. toTurn(url){
  156. if(!url) return
  157. if(url!=='/pages/dialog'&&!this.isLogin()) return
  158. uni.navigateTo({
  159. url
  160. })
  161. },
  162. getPerillPJ(){
  163. this.$api.get('/core/teammember/que/questionnaireStats').then(res=>{
  164. if(res.data.code!==0) return
  165. this.perillPJ = res.data.data;
  166. this.perillPJ.sum = (this.perillPJ.completed||0)+(this.perillPJ.uncompleted||0);
  167. })
  168. },
  169. getPerillBG(){
  170. this.$api.get('/core/report/reportStats').then(res=>{
  171. if(res.data.code!==0) return
  172. this.perillBG = res.data.data;
  173. this.perillBG.sum = (this.perillBG.received||0)+(this.perillBG.sent||0);
  174. })
  175. },
  176. getWjList(){
  177. this.$api.get('/core/teammember/que/listByUser').then(res=>{
  178. if(res.data.code!==0) return
  179. this.wjDwc = res.data.data.filter(d=>d.status===0).length;
  180. this.wjYwc = res.data.data.filter(d=>d.status===1).length;
  181. })
  182. },
  183. getReportList(){
  184. this.$api.get('/core/report/member/personalReportList').then(res=>{
  185. if(res.data.code!==0) return
  186. this.reportCount = res.data.data.length;
  187. })
  188. },
  189. handleToFill(){
  190. this.questionnaireKindShow = false;
  191. },
  192. handleFree(){
  193. uni.reLaunch({
  194. url:'/pages/publish'
  195. })
  196. }
  197. }
  198. }
  199. </script>
  200. <style scoped lang="scss">
  201. ::v-deep .indicator__dot{
  202. width: 12rpx;
  203. height: 12rpx;
  204. background: transparent;
  205. border: 2rpx solid #FFFFFF;
  206. border-radius: 6rpx;
  207. margin: 0 8rpx;
  208. }
  209. ::v-deep .indicator__dot--active{
  210. width: 12rpx;
  211. height: 12rpx;
  212. background: #FFFFFF;
  213. }
  214. .tabPage{
  215. background: #F7F7F7;
  216. .topbg{
  217. width: 100%;
  218. height: 720rpx;
  219. position: fixed;
  220. top: 0;
  221. left: 0;
  222. right: 0;
  223. }
  224. .lunbo{
  225. width: 100%;
  226. height: 368rpx;
  227. margin-top: 30rpx;
  228. position: relative;
  229. }
  230. .preill{
  231. margin-top: 30rpx;
  232. position: relative;
  233. &-box{
  234. width: calc(50% - 11rpx);
  235. background: #FFFFFF;
  236. border-radius: 24rpx;
  237. padding: 54rpx 24rpx 52rpx;
  238. box-sizing: border-box;
  239. &-title{
  240. font-family: PingFang-SC, PingFang-SC;
  241. font-weight: bold;
  242. font-size: 28rpx;
  243. color: #002846;
  244. line-height: 28rpx;
  245. span{
  246. font-size: 36rpx;
  247. }
  248. }
  249. &-num{
  250. font-family: PingFang-SC, PingFang-SC;
  251. font-weight: 800;
  252. font-size: 40rpx;
  253. color: #002846;
  254. line-height: 40rpx;
  255. margin-top: 24rpx;
  256. }
  257. &-state{
  258. margin-top: 46rpx;
  259. &-pre{
  260. padding-left: 16rpx;
  261. position: relative;
  262. font-family: PingFangSC, PingFang SC;
  263. font-weight: 400;
  264. font-size: 24rpx;
  265. color: #335368;
  266. line-height: 20rpx;
  267. span{
  268. color: #1D2129;
  269. }
  270. &::before{
  271. content: '';
  272. width: 10rpx;
  273. height: 10rpx;
  274. border-radius: 5rpx;
  275. position: absolute;
  276. left: 0;
  277. top: 50%;
  278. margin-top: -5rpx;
  279. }
  280. &.grey{
  281. &::before{
  282. background: #DDE0E6;
  283. }
  284. }
  285. &.yellow{
  286. &::before{
  287. background: #FFD750;
  288. }
  289. }
  290. &.green{
  291. &::before{
  292. background: #31D1D6;
  293. }
  294. }
  295. }
  296. }
  297. &-progress{
  298. margin-top: 24rpx;
  299. width: 100%;
  300. height: 10rpx;
  301. background: #DFE5EE;
  302. border-radius: 5rpx;
  303. position: relative;
  304. &-current{
  305. height: 10rpx;
  306. border-radius: 4rpx;
  307. position: absolute;
  308. left: 0;
  309. top: 0;
  310. }
  311. .pbp-yellow{
  312. background: #FFD750;
  313. }
  314. .pbp-green{
  315. background: #31D1D6;
  316. }
  317. }
  318. }
  319. }
  320. .boxs{
  321. margin-top: 20rpx;
  322. position: relative;
  323. &-pre{
  324. width: calc(50% - 11rpx);
  325. padding: 42rpx 0 0 20rpx;
  326. box-sizing: border-box;
  327. height: 184rpx;
  328. &-title{
  329. font-family: PingFang-SC, PingFang-SC;
  330. font-weight: bold;
  331. font-size: 32rpx;
  332. color: #E0EFEF;
  333. line-height: 45rpx;
  334. }
  335. &-tip{
  336. font-family: PingFangSC, PingFang SC;
  337. font-weight: 400;
  338. font-size: 24rpx;
  339. color: #E0EFEF;
  340. line-height: 33rpx;
  341. margin-top: 16rpx;
  342. image{
  343. width: 26rpx;
  344. height: 26rpx;
  345. margin-left: 12rpx;
  346. }
  347. }
  348. &.bp1{
  349. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg1.png') no-repeat;
  350. background-size: 100% 100%;
  351. }
  352. &.bp2{
  353. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg2.png') no-repeat;
  354. background-size: 100% 100%;
  355. }
  356. }
  357. }
  358. .common{
  359. margin-top: 20rpx;
  360. background: #FFFFFF;
  361. border-radius: 24rpx;
  362. padding: 40rpx 24rpx 48rpx;
  363. position: relative;
  364. &-title{
  365. font-family: PingFang-SC, PingFang-SC;
  366. font-weight: bold;
  367. font-size: 34rpx;
  368. color: #002846;
  369. line-height: 48rpx;
  370. }
  371. &-menu{
  372. margin-top: 45rpx;
  373. &-pre{
  374. width: calc(100% / 3);
  375. image{
  376. width: 62rpx;
  377. height: 62rpx;
  378. }
  379. text{
  380. font-family: PingFangSC, PingFang SC;
  381. font-weight: 400;
  382. font-size: 26rpx;
  383. color: #193D59;
  384. line-height: 26rpx;
  385. text-align: center;
  386. margin-top: 27rpx;
  387. }
  388. }
  389. }
  390. }
  391. .new-user-free{
  392. position: fixed;
  393. left: 0;
  394. right: 0;
  395. top: 0;
  396. bottom: 0;
  397. background: rgba(0, 0, 0, .6);
  398. z-index: 1000;
  399. &-box1{
  400. width: calc(100% - 180rpx);
  401. height: 280rpx;
  402. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_title.png') no-repeat;
  403. background-size: 100% 100%;
  404. padding-left: 53rpx;
  405. &-text{
  406. font-family: SourceHanSansCN, SourceHanSansCN;
  407. font-weight: bold;
  408. font-size: 36rpx;
  409. color: #874016;
  410. line-height: 54rpx;
  411. margin-top: 140rpx;
  412. }
  413. }
  414. &-box2{
  415. width: calc(100% - 140rpx);
  416. background: #FFFFFF;
  417. border-radius: 24rpx;
  418. padding: 45rpx 25rpx 42rpx;
  419. box-sizing: border-box;
  420. &-price{
  421. width: 100%;
  422. height: 132rpx;
  423. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_price.png') no-repeat;
  424. background-size: 100% 100%;
  425. padding: 27rpx 34rpx 27rpx 30rpx;
  426. box-sizing: border-box;
  427. &-left{
  428. &-title{
  429. font-family: PingFang-SC, PingFang-SC;
  430. font-weight: bold;
  431. font-size: 28rpx;
  432. color: #5E2E11;
  433. line-height: 36rpx;
  434. }
  435. &-tip{
  436. font-family: PingFangSC, PingFang SC;
  437. font-weight: 400;
  438. font-size: 24rpx;
  439. color: #808080;
  440. line-height: 32rpx;
  441. margin-top: 10rpx;
  442. }
  443. }
  444. &-right{
  445. &-top{
  446. font-family: PingFang-SC, PingFang-SC;
  447. font-weight: bold;
  448. font-size: 48rpx;
  449. color: #FF5A09;
  450. line-height: 67rpx;
  451. }
  452. &-bottom{
  453. font-family: PingFangSC, PingFang SC;
  454. font-weight: 400;
  455. font-size: 24rpx;
  456. color: #612D11;
  457. line-height: 33rpx;
  458. margin-top: 3rpx;
  459. text-decoration: line-through;
  460. }
  461. }
  462. }
  463. &-btn{
  464. width: calc(100% - 170rpx);
  465. height: 80rpx;
  466. border-radius: 40rpx;
  467. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_btn.png') no-repeat;
  468. background-size: 100% 100%;
  469. font-family: PingFang-SC, PingFang-SC;
  470. font-weight: bold;
  471. font-size: 32rpx;
  472. color: #5E2E11;
  473. line-height: 80rpx;
  474. text-align: center;
  475. letter-spacing: 2rpx;
  476. margin-top: 38rpx;
  477. }
  478. }
  479. &-close{
  480. width: 64rpx;
  481. height: 64rpx;
  482. margin-top: 48rpx;
  483. }
  484. }
  485. .kind-reminder{
  486. position: fixed;
  487. left: 0;
  488. right: 0;
  489. top: 0;
  490. bottom: 0;
  491. z-index: 1000;
  492. background: rgba(0, 0, 0, .6);
  493. .kr-box{
  494. width: calc(100% - 100rpx);
  495. padding: 54rpx 60rpx 48rpx;
  496. box-sizing: border-box;
  497. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/remind_bg.png') no-repeat;
  498. background-size: 100% 100%;
  499. position: relative;
  500. image{
  501. width: 48rpx;
  502. height: 48rpx;
  503. position: absolute;
  504. top: 40rpx;
  505. right: 30rpx;
  506. }
  507. .kr-title{
  508. font-family: PingFang-SC, PingFang-SC;
  509. font-weight: bold;
  510. font-size: 36rpx;
  511. color: #002846;
  512. line-height: 56rpx;
  513. text-align: center;
  514. }
  515. .kr-p{
  516. font-family: PingFangSC, PingFang SC;
  517. font-weight: 400;
  518. font-size: 30rpx;
  519. color: #002846;
  520. line-height: 48rpx;
  521. text-align: center;
  522. span{
  523. font-weight: bold;
  524. margin: 0 10rpx;
  525. }
  526. }
  527. .kr-btn{
  528. width: calc(100% - 80rpx);
  529. height: 88rpx;
  530. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  531. border-radius: 44rpx;
  532. font-family: PingFang-SC, PingFang-SC;
  533. font-weight: bold;
  534. font-size: 32rpx;
  535. color: #FFFFFF;
  536. line-height: 88rpx;
  537. text-align: center;
  538. letter-spacing: 2rpx;
  539. margin-top: 66rpx;
  540. }
  541. }
  542. }
  543. }
  544. </style>