home.vue 16 KB

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