home.vue 17 KB

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