home.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  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: 375rpx;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. @click="bannerClick"
  14. :autoplay="true"
  15. :interval="2000"
  16. :duration="200"
  17. :circular="true"
  18. imgMode="scaleToFill"
  19. height="368rpx"
  20. >
  21. <template #indicator>
  22. <view class="indicator adf">
  23. <view class="indicator__dot" v-for="(item, index) in bannarList" :key="index"
  24. :class="[index === current && 'indicator__dot--active']">
  25. </view>
  26. </view>
  27. </template>
  28. </u-swiper>
  29. </view>
  30. <view class="preill adfacjb">
  31. <view class="preill-box" @click="toTurn('/pagesHome/questionnaire?type=receive')">
  32. <view class="preill-box-title">我的PREILL评估:<span>{{perillPJ.sum||0}}</span></view>
  33. <view class="preill-box-state adfacjb">
  34. <view class="preill-box-state-pre adfac grey">我收到:<span>{{perillPJ.completed||0}}</span></view>
  35. <view class="preill-box-state-pre adfac yellow">我创建:<span>{{perillPJ.uncompleted||0}}</span></view>
  36. </view>
  37. <view class="preill-box-progress">
  38. <view class="preill-box-progress-current pbp-yellow" :style="{'width':((perillPJ.completed||0)/(perillPJ.sum||9999)*100)+'%'}"></view>
  39. </view>
  40. </view>
  41. <view class="preill-box" @click="toTurn('/pagesHome/report')">
  42. <view class="preill-box-title">我的PREILL报告:<span>{{perillBG.sum||0}}</span></view>
  43. <view class="preill-box-state adfacjb">
  44. <view class="preill-box-state-pre adfac green">我收到:<span>{{perillBG.received||0}}</span></view>
  45. <view class="preill-box-state-pre adfac grey">我发送:<span>{{perillBG.sent||0}}</span></view>
  46. </view>
  47. <view class="preill-box-progress">
  48. <view class="preill-box-progress-current pbp-green" :style="{'width':(perillBG.received||0/(perillBG.sum||9999)*100)+'%'}"></view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="boxs adfacjb">
  53. <view class="boxs-pre bp1" @click="toTurn('/pages/dialog')">
  54. <view class="boxs-pre-title">AI教练对话</view>
  55. <view class="boxs-pre-tip adfac">点击开始<image :src="imgBase+'home_arrow_right.png'"></image></view>
  56. </view>
  57. <view class="boxs-pre bp2" @click="toTurn('/pages/support')">
  58. <view class="boxs-pre-title">专业支持</view>
  59. <view class="boxs-pre-tip adfac">添加客服微信预约<image :src="imgBase+'home_arrow_right.png'"></image></view>
  60. </view>
  61. </view>
  62. <view class="common">
  63. <view class="common-title">常用功能</view>
  64. <view class="common-menu adf">
  65. <view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/questionnaire?type=receive')">
  66. <image :src="imgBase+'home_img_pinggu.png'"></image>
  67. <text>PERILL团队发展动态评估</text>
  68. </view>
  69. <view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/report')">
  70. <image :src="imgBase+'home_img_baogao.png'"></image>
  71. <text>PERILL团队发展动态评估报告</text>
  72. </view>
  73. <view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/questionnaire?type=create')">
  74. <image :src="imgBase+'home_img_guanli.png'"></image>
  75. <text>问卷管理</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="new-user-free adffcacjc" v-if="newUserFreeShow">
  80. <view class="new-user-free-box1">
  81. <view class="new-user-free-box1-text">PERILL团队发展动态评估</view>
  82. <view class="new-user-free-box1-text" style="margin-top: 8rpx;">基础版免费体验1次</view>
  83. </view>
  84. <view class="new-user-free-box2 adffcac">
  85. <view class="new-user-free-box2-price adfacjb">
  86. <view class="new-user-free-box2-price-left adffc">
  87. <view class="new-user-free-box2-price-left-title">仅限个人创建使用</view>
  88. <view class="new-user-free-box2-price-left-tip">领取后1年有效</view>
  89. </view>
  90. <view class="new-user-free-box2-price-right adffcac">
  91. <view class="new-user-free-box2-price-right-top">1次</view>
  92. <view class="new-user-free-box2-price-right-bottom">原价99</view>
  93. </view>
  94. </view>
  95. <view class="new-user-free-box2-btn" @click="handleFree">免费体验</view>
  96. </view>
  97. <image class="new-user-free-close" :src="imgBase+'new_free_close.png'" @click="newUserFreeShow=false"></image>
  98. </view>
  99. <view class="kind-reminder adffcacjc" v-if="teamKindShow">
  100. <view class="kr-box adffcac">
  101. <image :src="imgBase+'remind_close.png'" @click="teamKindShow=false"></image>
  102. <view class="kr-title">温馨提示</view>
  103. <view class="kr-p" style="margin-top: 32rpx;">{{teamKindMsg}}</view>
  104. <view class="kr-btn" @click="teamKindShow=false">我知道了</view>
  105. </view>
  106. </view>
  107. <view class="kind-reminder adffcacjc" v-if="questionnaireKindShow">
  108. <view class="kr-box adffcac">
  109. <image :src="imgBase+'remind_close.png'" @click="questionnaireKindShow=false"></image>
  110. <view class="kr-title">温馨提示</view>
  111. <view class="kr-p" style="margin-top: 32rpx;">你有一份<span>“PERILL团队发展动态评估(专业版)”</span>问卷待完成,请及时作答,</view>
  112. <view class="kr-p">以便我们为您提供精准分析。</view>
  113. <view class="kr-btn" @click="handleToFill">去填写</view>
  114. </view>
  115. </view>
  116. <Tabbar :tabbarIndex="0"></Tabbar>
  117. </view>
  118. </template>
  119. <script>
  120. import Tabbar from '@/components/CusTabbar/index.vue'
  121. export default {
  122. components:{ Tabbar },
  123. data(){
  124. return {
  125. current:0,
  126. perillPJ:null,
  127. perillBG:null,
  128. defaultBanner:this.$imgBase+'home_lb.png',
  129. bannerOrigin:[],
  130. bannarList:[],
  131. newUserFreeShow:false,
  132. teamKindShow:false,
  133. teamKindMsg:'',
  134. questionnaireKindShow:false,
  135. }
  136. },
  137. onLoad(options) {
  138. this.getBannerList();
  139. if(options.q){
  140. try{
  141. const decodedUrl = decodeURIComponent(options.q);
  142. const codeMatch = decodedUrl.match(/type=([^&]+)/);
  143. const codeMatchId = decodedUrl.match(/shareUserId=([^&]+)/);
  144. const stationCode = codeMatch ? codeMatch[1] : null;
  145. const stationCodeId = codeMatchId ? codeMatchId[1] : null;
  146. if(stationCode) uni.setStorageSync('channelType',stationCode)
  147. if(stationCodeId){
  148. uni.setStorageSync('shareUserId',stationCodeId)
  149. uni.setStorageSync('channelType','Forward')
  150. }
  151. }catch(e){
  152. console.log(e,'e');
  153. }
  154. }
  155. if(options.shareType) uni.setStorageSync('channelType',options.shareType)
  156. if(options.shareUserId) uni.setStorageSync('shareUserId',options.shareUserId)
  157. if(options.shareTQId) uni.setStorageSync('shareTQId',options.shareTQId)
  158. if(options.shareTQId||uni.getStorageSync('shareTQId')){
  159. // if(uni.getStorageSync('userInfo')&&uni.getStorageSync('shareUserId')==JSON.parse(uni.getStorageSync('userInfo')).id) return
  160. // 邀请进来的并且已经登录的
  161. if(uni.getStorageSync('userInfo')){
  162. this.$api.get('/wx/queShareCheck',{
  163. channelType:uni.getStorageSync('channelType')||'',
  164. phone:JSON.parse(uni.getStorageSync('userInfo')).mobile||'',
  165. referrerId:uni.getStorageSync('shareUserId')||'',
  166. teamQuestionnaireId:uni.getStorageSync('shareTQId')||'',
  167. }).then(({data:res})=>{
  168. this.$showModal(`queShareCheck接口入参channelType:${uni.getStorageSync('channelType')},
  169. referrerId:${uni.getStorageSync('shareUserId')},teamQuestionnaireId:${uni.getStorageSync('shareTQId')}
  170. ------返回数据res:${JSON.stringify(res)}`)
  171. if(res.code!==0){
  172. this.teamKindMsg = res.msg||'';
  173. this.teamKindShow = true;
  174. }else if(res.code===0&&res.data==1) this.questionnaireKindShow = true;
  175. })
  176. }
  177. }
  178. if(uni.getStorageSync('token')){
  179. this.getPerillPJ();
  180. this.getPerillBG();
  181. }
  182. if(uni.getStorageSync('newUser')) this.newUserFreeShow = true;
  183. },
  184. methods:{
  185. getBannerList(){
  186. //space 广告位置: 1首页 2发布问卷
  187. //type 类型: 1 banner区 2弹框
  188. this.$api.get('//core/advertisement/manage/page',{
  189. space:1,
  190. type:1
  191. }).then(({data:res})=>{
  192. if(res.code!==0) return this.$showToast(res.msg)
  193. if(res.data&&res.data.length){
  194. const list = res.data.filter(l=>l.enable==1);
  195. this.bannerOrigin = list;
  196. this.bannarList = list.map(d=>d.fileUrl);
  197. } else this.bannarList = [this.defaultBanner]
  198. })
  199. },
  200. bannerClick(e){
  201. let banner = this.bannerOrigin[e];
  202. if(banner&&banner?.redirect){
  203. if(banner?.redirectType==1){//微信公众号
  204. uni.navigateTo({
  205. url:'/pages/webView?src='+banner?.redirect
  206. })
  207. }else if(banner?.redirectType==2){//微信小程序
  208. uni.navigateToMiniProgram({
  209. appId:banner?.redirect
  210. })
  211. }
  212. }
  213. },
  214. toTurn(url){
  215. if(!url) return
  216. if(url!=='/pages/dialog'&&!this.isLogin()) return
  217. uni.navigateTo({
  218. url
  219. })
  220. },
  221. getPerillPJ(){
  222. this.$api.get('/core/teammember/que/questionnaireStats').then(res=>{
  223. if(res.data.code!==0) return
  224. this.perillPJ = res.data.data||{};
  225. this.perillPJ.sum = (this.perillPJ?.completed||0)+(this.perillPJ?.uncompleted||0);
  226. })
  227. },
  228. getPerillBG(){
  229. this.$api.get('/core/report/reportStats').then(res=>{
  230. if(res.data.code!==0) return
  231. this.perillBG = res.data.data||{};
  232. this.perillBG.sum = (this.perillBG?.received||0)+(this.perillBG?.sent||0);
  233. })
  234. },
  235. getWjList(){
  236. this.$api.get('/core/teammember/que/listByUser').then(res=>{
  237. if(res.data.code!==0) return
  238. this.wjDwc = res.data.data.filter(d=>d.status===0).length;
  239. this.wjYwc = res.data.data.filter(d=>d.status===1).length;
  240. })
  241. },
  242. getReportList(){
  243. this.$api.get('/core/report/member/personalReportList').then(res=>{
  244. if(res.data.code!==0) return
  245. this.reportCount = res.data.data.length;
  246. })
  247. },
  248. handleToFill(){
  249. this.questionnaireKindShow = false;
  250. uni.navigateTo({
  251. url:'/pagesHome/questionnaire?type=receive'
  252. })
  253. },
  254. handleFree(){
  255. uni.reLaunch({
  256. url:'/pages/publish'
  257. })
  258. }
  259. }
  260. }
  261. </script>
  262. <style scoped lang="scss">
  263. ::v-deep .u-swiper{
  264. border-radius: 24rpx !important;
  265. }
  266. ::v-deep .indicator__dot{
  267. width: 12rpx;
  268. height: 12rpx;
  269. background: transparent;
  270. border: 2rpx solid #FFFFFF;
  271. border-radius: 6rpx;
  272. margin: 0 8rpx;
  273. }
  274. ::v-deep .indicator__dot--active{
  275. width: 12rpx;
  276. height: 12rpx;
  277. background: #FFFFFF;
  278. }
  279. .tabPage{
  280. background: #F7F7F7;
  281. .topbg{
  282. width: 100%;
  283. height: 720rpx;
  284. position: fixed;
  285. top: 0;
  286. left: 0;
  287. right: 0;
  288. }
  289. .lunbo{
  290. width: 100%;
  291. height: 368rpx;
  292. margin-top: 30rpx;
  293. position: relative;
  294. }
  295. .preill{
  296. margin-top: 30rpx;
  297. position: relative;
  298. &-box{
  299. width: calc(50% - 11rpx);
  300. background: #FFFFFF;
  301. border-radius: 24rpx;
  302. padding: 54rpx 24rpx 52rpx;
  303. box-sizing: border-box;
  304. &-title{
  305. font-family: PingFang-SC, PingFang-SC;
  306. font-weight: bold;
  307. font-size: 28rpx;
  308. color: #002846;
  309. line-height: 28rpx;
  310. span{
  311. font-size: 36rpx;
  312. }
  313. }
  314. &-num{
  315. font-family: PingFang-SC, PingFang-SC;
  316. font-weight: 800;
  317. font-size: 40rpx;
  318. color: #002846;
  319. line-height: 40rpx;
  320. margin-top: 24rpx;
  321. }
  322. &-state{
  323. margin-top: 46rpx;
  324. &-pre{
  325. padding-left: 16rpx;
  326. position: relative;
  327. font-family: PingFangSC, PingFang SC;
  328. font-weight: 400;
  329. font-size: 24rpx;
  330. color: #335368;
  331. line-height: 20rpx;
  332. span{
  333. color: #1D2129;
  334. }
  335. &::before{
  336. content: '';
  337. width: 10rpx;
  338. height: 10rpx;
  339. border-radius: 5rpx;
  340. position: absolute;
  341. left: 0;
  342. top: 50%;
  343. margin-top: -5rpx;
  344. }
  345. &.grey{
  346. &::before{
  347. background: #DDE0E6;
  348. }
  349. }
  350. &.yellow{
  351. &::before{
  352. background: #FFD750;
  353. }
  354. }
  355. &.green{
  356. &::before{
  357. background: #31D1D6;
  358. }
  359. }
  360. }
  361. }
  362. &-progress{
  363. margin-top: 24rpx;
  364. width: 100%;
  365. height: 10rpx;
  366. background: #DFE5EE;
  367. border-radius: 5rpx;
  368. position: relative;
  369. &-current{
  370. height: 10rpx;
  371. border-radius: 4rpx;
  372. position: absolute;
  373. left: 0;
  374. top: 0;
  375. }
  376. .pbp-yellow{
  377. background: #FFD750;
  378. }
  379. .pbp-green{
  380. background: #31D1D6;
  381. }
  382. }
  383. }
  384. }
  385. .boxs{
  386. margin-top: 20rpx;
  387. position: relative;
  388. &-pre{
  389. width: calc(50% - 11rpx);
  390. padding: 42rpx 0 0 20rpx;
  391. box-sizing: border-box;
  392. height: 184rpx;
  393. &-title{
  394. font-family: PingFang-SC, PingFang-SC;
  395. font-weight: bold;
  396. font-size: 32rpx;
  397. color: #E0EFEF;
  398. line-height: 45rpx;
  399. }
  400. &-tip{
  401. font-family: PingFangSC, PingFang SC;
  402. font-weight: 400;
  403. font-size: 24rpx;
  404. color: #E0EFEF;
  405. line-height: 33rpx;
  406. margin-top: 16rpx;
  407. image{
  408. width: 26rpx;
  409. height: 26rpx;
  410. margin-left: 12rpx;
  411. }
  412. }
  413. &.bp1{
  414. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg1.png') no-repeat;
  415. background-size: 100% 100%;
  416. }
  417. &.bp2{
  418. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg2.png') no-repeat;
  419. background-size: 100% 100%;
  420. }
  421. }
  422. }
  423. .common{
  424. margin-top: 20rpx;
  425. background: #FFFFFF;
  426. border-radius: 24rpx;
  427. padding: 40rpx 24rpx 48rpx;
  428. position: relative;
  429. &-title{
  430. font-family: PingFang-SC, PingFang-SC;
  431. font-weight: bold;
  432. font-size: 34rpx;
  433. color: #002846;
  434. line-height: 48rpx;
  435. }
  436. &-menu{
  437. width: calc(100% + 48rpx);
  438. margin-left: -24rpx;
  439. margin-top: 45rpx;
  440. &-pre{
  441. width: calc(100% / 3);
  442. image{
  443. width: 64rpx;
  444. height: 64rpx;
  445. }
  446. text{
  447. font-family: PingFangSC, PingFang SC;
  448. font-weight: 400;
  449. font-size: 24rpx;
  450. color: #193D59;
  451. line-height: 32rpx;
  452. text-align: center;
  453. margin-top: 24rpx;
  454. padding: 0 24rpx;
  455. }
  456. }
  457. }
  458. }
  459. .new-user-free{
  460. position: fixed;
  461. left: 0;
  462. right: 0;
  463. top: 0;
  464. bottom: 0;
  465. background: rgba(0, 0, 0, .6);
  466. z-index: 1000;
  467. &-box1{
  468. width: calc(100% - 180rpx);
  469. height: 280rpx;
  470. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_title.png') no-repeat;
  471. background-size: 100% 100%;
  472. padding-left: 53rpx;
  473. &-text{
  474. font-family: SourceHanSansCN, SourceHanSansCN;
  475. font-weight: bold;
  476. font-size: 36rpx;
  477. color: #874016;
  478. line-height: 54rpx;
  479. margin-top: 140rpx;
  480. }
  481. }
  482. &-box2{
  483. width: calc(100% - 140rpx);
  484. background: #FFFFFF;
  485. border-radius: 24rpx;
  486. padding: 45rpx 25rpx 42rpx;
  487. box-sizing: border-box;
  488. &-price{
  489. width: 100%;
  490. height: 132rpx;
  491. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_price.png') no-repeat;
  492. background-size: 100% 100%;
  493. padding: 27rpx 34rpx 27rpx 30rpx;
  494. box-sizing: border-box;
  495. &-left{
  496. &-title{
  497. font-family: PingFang-SC, PingFang-SC;
  498. font-weight: bold;
  499. font-size: 28rpx;
  500. color: #5E2E11;
  501. line-height: 36rpx;
  502. }
  503. &-tip{
  504. font-family: PingFangSC, PingFang SC;
  505. font-weight: 400;
  506. font-size: 24rpx;
  507. color: #808080;
  508. line-height: 32rpx;
  509. margin-top: 10rpx;
  510. }
  511. }
  512. &-right{
  513. &-top{
  514. font-family: PingFang-SC, PingFang-SC;
  515. font-weight: bold;
  516. font-size: 48rpx;
  517. color: #FF5A09;
  518. line-height: 67rpx;
  519. }
  520. &-bottom{
  521. font-family: PingFangSC, PingFang SC;
  522. font-weight: 400;
  523. font-size: 24rpx;
  524. color: #612D11;
  525. line-height: 33rpx;
  526. margin-top: 3rpx;
  527. text-decoration: line-through;
  528. }
  529. }
  530. }
  531. &-btn{
  532. width: calc(100% - 170rpx);
  533. height: 80rpx;
  534. border-radius: 40rpx;
  535. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_btn.png') no-repeat;
  536. background-size: 100% 100%;
  537. font-family: PingFang-SC, PingFang-SC;
  538. font-weight: bold;
  539. font-size: 32rpx;
  540. color: #5E2E11;
  541. line-height: 80rpx;
  542. text-align: center;
  543. letter-spacing: 2rpx;
  544. margin-top: 38rpx;
  545. }
  546. }
  547. &-close{
  548. width: 64rpx;
  549. height: 64rpx;
  550. margin-top: 48rpx;
  551. }
  552. }
  553. .kind-reminder{
  554. position: fixed;
  555. left: 0;
  556. right: 0;
  557. top: 0;
  558. bottom: 0;
  559. z-index: 1000;
  560. background: rgba(0, 0, 0, .6);
  561. .kr-box{
  562. width: calc(100% - 100rpx);
  563. padding: 54rpx 60rpx 48rpx;
  564. box-sizing: border-box;
  565. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/remind_bg.png') no-repeat;
  566. background-size: 100% 100%;
  567. position: relative;
  568. image{
  569. width: 48rpx;
  570. height: 48rpx;
  571. position: absolute;
  572. top: 40rpx;
  573. right: 30rpx;
  574. }
  575. .kr-title{
  576. font-family: PingFang-SC, PingFang-SC;
  577. font-weight: bold;
  578. font-size: 36rpx;
  579. color: #002846;
  580. line-height: 56rpx;
  581. text-align: center;
  582. }
  583. .kr-p{
  584. font-family: PingFangSC, PingFang SC;
  585. font-weight: 400;
  586. font-size: 30rpx;
  587. color: #002846;
  588. line-height: 48rpx;
  589. text-align: center;
  590. span{
  591. font-weight: bold;
  592. margin: 0 10rpx;
  593. }
  594. }
  595. .kr-btn{
  596. width: calc(100% - 80rpx);
  597. height: 88rpx;
  598. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  599. border-radius: 44rpx;
  600. font-family: PingFang-SC, PingFang-SC;
  601. font-weight: bold;
  602. font-size: 32rpx;
  603. color: #FFFFFF;
  604. line-height: 88rpx;
  605. text-align: center;
  606. letter-spacing: 2rpx;
  607. margin-top: 66rpx;
  608. }
  609. }
  610. }
  611. }
  612. </style>