home.vue 18 KB

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