home.vue 16 KB

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