home.vue 17 KB

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