xq-csg-weapp_uni-ts
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

555 行
13KB

  1. <template>
  2. <view>
  3. <!-- <custom-nav-bar left-text="政企通" /> -->
  4. <!-- <van-nav-bar left-text="返回" left-arrow /> -->
  5. <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
  6. <block v-for="(item, index) in imageList" :key="index">
  7. <swiper-item>
  8. <image :src="item.pic" mode="aspectFill"></image>
  9. </swiper-item>
  10. </block>
  11. </swiper>
  12. <view class="enterprise-appeal">
  13. <view class="enterprise-appeal-item" @click="myAppeal">
  14. <image class="enterprise-appeal-icon" src="/static/images/enterprise/icon-1.png"></image>
  15. <view class="enterprise-title">我的诉求</view>
  16. </view>
  17. <view class="enterprise-appeal-item" @click="crateAppeal">
  18. <image class="enterprise-appeal-icon" src="/static/images/enterprise/icon.png"></image>
  19. <view class="enterprise-title">发布诉求</view>
  20. </view>
  21. </view>
  22. <view class="life-section">
  23. <view class="second-block" :style="item.cssStyle" v-for="(item, index) in recursionList" :key="index">
  24. <view class="title flex">
  25. <text class="title-name">{{ item.name }}</text>
  26. </view>
  27. <view class="second-model flex flex-v-center flex-between">
  28. <view :class="'second-line flex flex-col ' + (idx === 0 ? 'line1' : '')" :style="itemName.cssStyle"
  29. v-for="(itemName, idx) in item.children" :key="idx">
  30. <navigator v-if="itemName.clickUrl" class="line-navigator" :url="updateQuery(itemName.clickUrl,itemName)" hover-class="none">
  31. </navigator>
  32. <image class="line-bg" :src="itemName.icon"></image>
  33. <view class="line-title">{{ itemName.name }}</view>
  34. <view v-if="itemName.remark" class="line-msg">{{ itemName.remark }}</view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="good-reply">
  40. <view class="title flex">
  41. <text class="title-name">优质回复</text>
  42. </view>
  43. <!-- 内容部分 -->
  44. <view v-if="'dataList.length > 0'">
  45. <view class="good-reply-conent" @click="details" :data-item="item" v-for="(item, index) in dataList" :key="index">
  46. <view class="good-reply-flex">
  47. <view>
  48. <image :src="item.avatar" mode="aspectFill" />
  49. <text class="good-reply-conent-title uniline">{{ item.name || item.nickName || '暂无名称' }}</text>
  50. </view>
  51. <view>
  52. <text class="good-reply-conent-block">{{ getDateTime(item.createTime, 2) }}</text>
  53. <block v-for="(state, index1) in typeList" :key="index1">
  54. <text v-if="item.appealType + '' === state.value" class="good-reply-conent-bg good-reply-conent-block"
  55. :style="'background-color: ' + state.cssClass + ';'">
  56. {{ state.label }}
  57. </text>
  58. </block>
  59. </view>
  60. </view>
  61. <view class="good-reply-title mt-21 uniline">{{ item.appealTitle }}</view>
  62. <view class="good-reply-subheading">
  63. <rich-text :nodes="item.appealContent"></rich-text>
  64. </view>
  65. <view class="good-reply-imgage">
  66. <image :src="key" mode="aspectFill" v-for="(key, index1) in item.appealEnclosure" :key="index1"></image>
  67. </view>
  68. <view class="good-reply-conent-block mt-21 uniline" v-if="item.appealCurrentLocation">
  69. {{ item.appealCurrentLocation }}
  70. </view>
  71. <view class="good-reply-bg" v-if="item.appealReply">
  72. <view>
  73. <view>
  74. <image src="/static/images/ic-success.png" mode="aspectFill"></image>
  75. <text>{{ item.replyCreator }}</text>
  76. </view>
  77. <view class="good-reply-conent-block">{{ getDateTime(item.replyTime, 2) }}</view>
  78. </view>
  79. <view class="good-reply-bg-conent">
  80. <rich-text :nodes="item.appealReply"></rich-text>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <van-empty v-if="dataList.length === 0" description="暂无数据" />
  86. </view>
  87. <view style="height:150rpx"></view>
  88. </view>
  89. </template>
  90. <script>
  91. import utils from '@/utils/util.map.js'
  92. import * as publicApi from '@/api/publicApi.js'; // 公共 API
  93. import * as enterprise from '@/api/enterprise'; // 企业
  94. export default {
  95. data() {
  96. return {
  97. isLogin: uni.getStorageSync('isLogin'),
  98. userInfo: null,
  99. userInfoCount: null,
  100. indicatorDots: false,
  101. vertical: false,
  102. autoplay: true,
  103. duration: 500,
  104. page: {
  105. pageNo: 1,
  106. pageSize: 15,
  107. type: 3
  108. },
  109. imageList: [],
  110. interval: 2000,
  111. params: {
  112. pageNo: 1,
  113. pageSize: 15
  114. },
  115. dataList: [],
  116. recursionList: [],
  117. typeList: '',
  118. state: {
  119. value: '',
  120. cssClass: '',
  121. label: ''
  122. }
  123. };
  124. },
  125. onLoad() {
  126. this.getpublicApiList();
  127. this.getType();
  128. this.recursionApi();
  129. },
  130. onShow() {
  131. this.isLogin = uni.getStorageSync('isLogin')
  132. this.userInfo = uni.getStorageSync('userInfoData')
  133. this.userInfoCount = uni.getStorageSync('userInfoCount')
  134. if (this.isLogin) {
  135. this.getPerfectReply();
  136. }
  137. },
  138. methods: {
  139. getDateTime(replyTime, key) {
  140. return utils.getDateTime(replyTime, key)
  141. },
  142. updateQuery(url, name) {
  143. console.log(name)
  144. return utils.updateQuery(url, name);
  145. },
  146. // 获取企业轮播图
  147. async getpublicApiList() {
  148. const res = await publicApi.getBannerApi(this.page);
  149. if (res.data) {
  150. this.imageList = res.data.list
  151. this.interval = res.data.list[0].rotationTime
  152. }
  153. },
  154. async recursionApi() {
  155. const res = await publicApi.recursionApi({
  156. bannerType: 3
  157. });
  158. if (res.data) {
  159. this.recursionList = res.data
  160. }
  161. },
  162. // 优质回复
  163. async getPerfectReply() {
  164. const res = await enterprise.getPerfectReplyApi(this.params);
  165. if (res.data) {
  166. res.data.list.forEach((item) => {
  167. if (item.name !== null) {
  168. item.name = item.name.substring(0, 1) + new Array(item.name.length).join('*');
  169. }
  170. });
  171. this.dataList = res.data.list
  172. }
  173. },
  174. // 详情页跳转
  175. details(event) {
  176. const {
  177. item
  178. } = event.currentTarget.dataset;
  179. uni.navigateTo({
  180. url: `/packages/enterprise/pages/details/details?id=${item.id}`
  181. });
  182. },
  183. async getType() {
  184. const res = await publicApi.getDictDataApi({
  185. dictType: 'appeal_type'
  186. });
  187. if (res.data) {
  188. this.typeList = res.data.list
  189. }
  190. },
  191. myAppeal() {
  192. const {
  193. userInfoCount,
  194. isLogin
  195. } = this;
  196. if (!isLogin) {
  197. uni.navigateTo({
  198. url: '/pages/phone/index'
  199. });
  200. return false;
  201. }
  202. // 暂时去除实名认证
  203. // else if (userInfoCount.realNameAuthFlag === 0) {
  204. // wx.navigateTo({
  205. // url: '/packages/enterprise/pages/enterprise-certification/enterprise-certification',
  206. // })
  207. // return false
  208. // } else if (userInfoCount.realNameAuthFlag === 3) {
  209. // wx.showToast({
  210. // title: '身份审核中...',
  211. // icon: 'none'
  212. // })
  213. // return false
  214. // }
  215. else {
  216. uni.navigateTo({
  217. url: '/packages/enterprise/pages/my-appeal/my-appeal'
  218. });
  219. }
  220. },
  221. crateAppeal() {
  222. const {
  223. userInfoCount,
  224. isLogin
  225. } = this;
  226. if (!isLogin) {
  227. uni.navigateTo({
  228. url: '/pages/phone/index'
  229. });
  230. return false;
  231. }
  232. // 去除实名认证
  233. // else if (userInfoCount.realNameAuthFlag === 0) {
  234. // wx.navigateTo({
  235. // url: '/packages/enterprise/pages/enterprise-certification/enterprise-certification',
  236. // })
  237. // return false
  238. // } else if (userInfoCount.realNameAuthFlag === 3) {
  239. // wx.showToast({
  240. // title: '身份审核中...',
  241. // icon: 'none'
  242. // })
  243. // return false
  244. // }
  245. else {
  246. uni.navigateTo({
  247. url: '/packages/enterprise/pages/issue-appeal/issue-appeal'
  248. });
  249. }
  250. }
  251. }
  252. };
  253. </script>
  254. <style lang="less">
  255. page {
  256. --nav-bar-background-color: transparent;
  257. --nav-bar-text-color: #ffffff; // 导航栏左侧文案样式
  258. background-color: #fff;
  259. }
  260. .mt-20 {
  261. margin-top: 40rpx;
  262. }
  263. .mt-21 {
  264. margin-top: 21rpx;
  265. }
  266. .enterprise-title {
  267. font-size: 32r;
  268. font-weight: 400;
  269. color: #000000;
  270. }
  271. .line-navigator {
  272. width: 100%;
  273. height: 100%;
  274. position: absolute;
  275. z-index: 10;
  276. top: 0;
  277. left: 0;
  278. }
  279. swiper,
  280. swiper-item {
  281. width: 100%;
  282. height: 400rpx;
  283. image {
  284. width: 100%;
  285. height: 100%;
  286. }
  287. }
  288. .enterprise-appeal {
  289. display: flex;
  290. align-items: center;
  291. justify-content: space-between;
  292. padding: 30rpx 24rpx 0 24rpx;
  293. .enterprise-appeal-item {
  294. width: 340rpx;
  295. height: 122rpx;
  296. display: flex;
  297. align-items: center;
  298. border-radius: 16rpx;
  299. padding: 0 24rpx;
  300. background-color: #fef9f5;
  301. position: relative;
  302. .enterprise-appeal-icon {
  303. width: 120rpx;
  304. height: 80rpx;
  305. border-radius: 46rpx;
  306. margin-right: 24rpx;
  307. }
  308. &:nth-child(2n) {
  309. background-color: #fef6f6;
  310. }
  311. }
  312. }
  313. .good-reply {
  314. padding: 40rpx 24rpx;
  315. }
  316. .good-reply-conent {
  317. margin-top: 37rpx;
  318. .good-reply-flex {
  319. display: flex;
  320. align-items: center;
  321. justify-content: space-between;
  322. view {
  323. display: flex;
  324. align-items: center;
  325. justify-content: space-between;
  326. image {
  327. width: 44rpx;
  328. height: 44rpx;
  329. border-radius: 50%;
  330. margin-right: 24rpx;
  331. }
  332. .good-reply-conent-title {
  333. font-size: 32rpx;
  334. font-weight: 400;
  335. color: #fe3b53;
  336. }
  337. .good-reply-conent-bg {
  338. width: 100rpx;
  339. height: 38rpx;
  340. text-align: center;
  341. color: #fff;
  342. line-height: 38rpx;
  343. background: #fe3b53;
  344. box-shadow: 2px 2px 2px 0px rgba(254, 61, 85, 0.1);
  345. border-radius: 500rpx;
  346. margin-left: 39rpx;
  347. }
  348. }
  349. }
  350. .good-reply-conent-block {
  351. font-size: 24rp;
  352. font-weight: 400;
  353. color: #999999;
  354. }
  355. .good-reply-title {
  356. font-size: 32rpx;
  357. font-weight: 500;
  358. color: #000000;
  359. }
  360. .good-reply-subheading {
  361. font-size: 28rp;
  362. font-weight: 400;
  363. color: #333333;
  364. margin-top: 24rpx;
  365. }
  366. .good-reply-imgage {
  367. margin-top: 24rpx;
  368. display: grid;
  369. grid-template-columns: 1fr 1fr 1fr;
  370. image {
  371. width: 222rpx;
  372. height: 150rpx;
  373. border-radius: 10rpx;
  374. margin-bottom: 20rpx;
  375. }
  376. }
  377. .good-reply-bg {
  378. width: 678rpx;
  379. // height: 232rpx;
  380. background: #f7f7f7;
  381. border-radius: 8px;
  382. margin-top: 32rpx;
  383. padding: 28rpx 20rpx;
  384. view {
  385. display: flex;
  386. align-items: center;
  387. justify-content: space-between;
  388. image {
  389. width: 32rpx;
  390. height: 32rpx;
  391. margin-right: 8rpx;
  392. }
  393. text {
  394. font-size: 28rpx;
  395. font-weight: 400;
  396. color: #fe3b53;
  397. }
  398. }
  399. .good-reply-bg-conent {
  400. padding: 16rpx 0 0 40rpx;
  401. font-size: 28rpx;
  402. font-weight: 400;
  403. color: #333333;
  404. }
  405. }
  406. }
  407. // 模块配置样式 start
  408. .title {
  409. font-size: 36rpx;
  410. font-weight: 500;
  411. color: #000000;
  412. line-height: 36rpx;
  413. padding-left: 6rpx;
  414. .title-name {
  415. position: relative;
  416. font-size: 36rpx;
  417. font-weight: 500;
  418. color: #333333;
  419. &::after {
  420. content: '';
  421. position: absolute;
  422. left: -6rpx;
  423. bottom: 0;
  424. z-index: -1;
  425. // width: 175rpx;
  426. width: 115%;
  427. height: 10rpx;
  428. background: var(--title-guides-color);
  429. border-radius: 2rpx;
  430. }
  431. }
  432. }
  433. .life-section {
  434. padding: 0 24rpx;
  435. }
  436. .second-block,
  437. .third-block,
  438. .fourth-block {
  439. margin-top: 50rpx;
  440. .second-model {
  441. margin-top: 40rpx;
  442. flex-wrap: wrap;
  443. .second-line {
  444. width: 343rpx;
  445. height: 110rpx;
  446. justify-content: center;
  447. padding-left: 39rpx;
  448. position: relative;
  449. &:not(:first-child) {
  450. margin-top: 16rpx;
  451. }
  452. .line-bg {
  453. width: 100%;
  454. height: 100%;
  455. position: absolute;
  456. // z-index: -1;
  457. top: 0;
  458. left: 0;
  459. }
  460. .line-title {
  461. position: absolute;
  462. font-size: 40rpx;
  463. font-weight: 500;
  464. line-height: 32rpx;
  465. }
  466. .line-msg {
  467. position: absolute;
  468. margin-top: 100rpx;
  469. font-size: 26rpx;
  470. font-weight: 400;
  471. color: #666666;
  472. line-height: 26rpx;
  473. }
  474. }
  475. .line1 {
  476. width: 100%;
  477. height: 171rpx;
  478. .line-title {
  479. font-size: 40rpx;
  480. font-weight: 500;
  481. line-height: 40rpx;
  482. }
  483. }
  484. }
  485. }
  486. // 模块配置样式 end
  487. </style>