feedback.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <template>
  2. <view class="index tn-safe-area-inset-bottom">
  3. <tn-nav-bar customBack>
  4. <view slot="back" class='tn-custom-nav-bar__back' @click="goBack()">
  5. <text class='icon tn-icon-left'></text>
  6. </view>
  7. <view slot="default" style="display: flex;">
  8. <view style="flex:1;margin-left:25px">
  9. <text>我的反馈</text>
  10. </view>
  11. </view>
  12. </tn-nav-bar>
  13. <view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
  14. <!-- 图文信息 -->
  15. <block v-for="(item,index) in content" :key="index">
  16. <view class="blogger__item">
  17. <view class="blogger__author tn-flex tn-flex-row-between tn-flex-col-center">
  18. <view class="justify__author__info">
  19. <view class="tn-flex tn-flex-row-center">
  20. <view class="tn-flex tn-flex-row-center tn-flex-col-center">
  21. <!-- <view class="">
  22. <tn-avatar class="" shape="circle" :src="item.userAvatar" size="lg">
  23. </tn-avatar>
  24. </view> -->
  25. <view class="tn-padding-right tn-text-ellipsis">
  26. <view class="tn-padding-right tn-text-bold tn-text-lg">
  27. {{ item.type==1?'【汇报系统故障】':item.type==2?'【平台机制咨询】':item.type==3?'【投诉】':item.type==5?'【平台用户举报】':'【其他】' }}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view
  34. class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center">
  35. <text class="" v-if="item.status==1" style="background: #3F51B542;font-size: 12px;
  36. padding: 8px;
  37. color: red;
  38. border-radius: 24px;
  39. ">已处理</text><text class="" v-if="item.status==0" style="background: #3F51B542;font-size: 12px;
  40. padding: 8px;
  41. color: #333333;
  42. border-radius: 24px;
  43. ">未处理</text>
  44. </view>
  45. </view>
  46. <view
  47. class="blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left">
  48. <!-- <view v-for="(label_item,label_index) in item.label" :key="label_index"
  49. class="blogger__desc__label tn-float-left tn-margin-right">
  50. <text class="blogger__desc__label--prefix tn-icon-topics-fill"></text>
  51. <text class="tn-text-df">{{ label_item }}</text>
  52. </view> -->
  53. <!-- 不用限制长度了,因为发布的时候限制长度了-->
  54. <text
  55. class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df">{{ item.content }}</text>
  56. </view>
  57. <view v-if="item.ansowe"
  58. class="blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left">
  59. <!-- <view v-for="(label_item,label_index) in item.label" :key="label_index"
  60. class="blogger__desc__label tn-float-left tn-margin-right">
  61. <text class="blogger__desc__label--prefix tn-icon-topics-fill"></text>
  62. <text class="tn-text-df">{{ label_item }}</text>
  63. </view> -->
  64. <!-- 不用限制长度了,因为发布的时候限制长度了-->
  65. <text
  66. class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df" style="color:red">回复:{{ item.ansowe }}</text>
  67. </view>
  68. <!-- 内容太多疲劳了-->
  69. <!-- <view
  70. v-if="item.content"
  71. class="blogger__content"
  72. :id="`blogger__content--${index}`"
  73. >
  74. <view
  75. class="blogger__content__data clamp-text-2">
  76. {{ item.content }}
  77. </view>
  78. </view> -->
  79. <block v-if="item.imgList">
  80. <view v-if="[1,2,4].indexOf(item.imgList.length) != -1" class="tn-padding-top-xs"
  81. @click="tn('')">
  82. <image v-for="(image_item,image_index) in item.imgList" :key="image_index"
  83. class="blogger__main-image" :class="{
  84. 'blogger__main-image--1 tn-margin-bottom-sm': item.imgList.length === 1,
  85. 'blogger__main-image--2 tn-margin-right-sm tn-margin-bottom-sm': item.imgList.length === 2 || item.imgList.length === 4
  86. }" :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
  87. </view>
  88. <view v-else class="tn-padding-top-xs">
  89. <tn-grid hoverClass="none" :col="3">
  90. <block v-for="(image_item,image_index) in item.imgList" :key="image_index">
  91. <!-- #ifndef MP-WEIXIN -->
  92. <tn-grid-item style="width: 30%;margin: 10rpx;">
  93. <image class="blogger__main-image blogger__main-image--3"
  94. @click="showImg(item.imgList,image_index)" :src="image_item.ftpUrl"
  95. mode="aspectFill"></image>
  96. </tn-grid-item>
  97. <!-- #endif-->
  98. <!-- #ifdef MP-WEIXIN -->
  99. <tn-grid-item style="width: 30%;margin: 10rpx;">
  100. <image class="blogger__main-image blogger__main-image--3"
  101. @click="showImg(item.imgList,image_index)" :src="image_item.ftpUrl"
  102. mode="aspectFill"></image>
  103. </tn-grid-item>
  104. <!-- #endif-->
  105. </block>
  106. </tn-grid>
  107. </view>
  108. </block>
  109. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-top-xs">
  110. <view class="justify-content-item tn-color-gray tn-text-center">
  111. <view class="tn-padding-right tn-padding-top-xs tn-color-gray">
  112. {{ item.createTime|formatDate }}
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- 边距间隔 -->
  118. <view class="tn-strip-bottom" v-if="index != content.length - 1"></view>
  119. </block>
  120. <view v-if="showEmpty" style="margin-top: 32vh;">
  121. <tn-empty mode="data"></tn-empty>
  122. </view>
  123. </view>
  124. <view class="edit tnxuanfu" @tap="showLandscape">
  125. <view class="bg0 pa">
  126. <view class="bg1">
  127. <text class='icon tn-icon-edit-write-fill'></text>
  128. </view>
  129. </view>
  130. <view class="hx-box pa">
  131. <view class="pr">
  132. <view class="hx-k1 pa0">
  133. <view class="span"></view>
  134. </view>
  135. <view class="hx-k2 pa0">
  136. <view class="span"></view>
  137. </view>
  138. <view class="hx-k3 pa0">
  139. <view class="span"></view>
  140. </view>
  141. <view class="hx-k4 pa0">
  142. <view class="span"></view>
  143. </view>
  144. <view class="hx-k5 pa0">
  145. <view class="span"></view>
  146. </view>
  147. <view class="hx-k6 pa0">
  148. <view class="span"></view>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. </template>
  155. <script>
  156. import request from '../../utils/request'
  157. export default {
  158. data() {
  159. return {
  160. showHistory: false,
  161. content: [],
  162. showEmpty: false,
  163. }
  164. },
  165. filters: {
  166. formatDate(value) {
  167. if (!value) return '';
  168. const date = new Date(value);
  169. const today = new Date();
  170. const yesterday = new Date(today); // 昨天的日期
  171. yesterday.setDate(yesterday.getDate() - 1); // 将昨天的日期设置为前一天
  172. if (date.getFullYear() == today.getFullYear() && date.getMonth() == today.getMonth() && date.getDate() ==
  173. today.getDate()) {
  174. return '今天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  175. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  176. }
  177. if (date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date
  178. .getDate() == yesterday.getDate()) {
  179. return '昨天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  180. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  181. }
  182. return date.toLocaleDateString() + ' ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  183. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  184. },
  185. },
  186. created() {
  187. },
  188. methods: {
  189. onPullDownRefresh() {
  190. this.loadData();
  191. },
  192. showLandscape() {
  193. uni.navigateTo({
  194. url: '/pages/mine/addFeed'
  195. })
  196. },
  197. goBack() {
  198. uni.navigateBack();
  199. },
  200. isImage(fileName) {
  201. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  202. const extension = fileName.split('.').pop().toLowerCase();
  203. return imageExtensions.includes(extension);
  204. },
  205. loadData(pageIndex=1) {
  206. if(!uni.getStorageSync('userNo')){
  207. return false;
  208. }
  209. let that = this;
  210. that.showEmpty = false;
  211. request.post('/slbFeedback/query', {
  212. limit:10,
  213. index:pageIndex,
  214. userNo: uni.getStorageSync('userNo'),
  215. }).then(res => {
  216. console.warn(res);
  217. if (res && res.success) {
  218. let newList = res.list || [];
  219. for (let i = 0; i < newList.length; i++) {
  220. newList[i].imgList = [];
  221. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  222. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  223. newList[i].imgList.push(newList[i].fileDetailList[j]);
  224. }
  225. }
  226. }
  227. if(pageIndex==1){
  228. that.content = newList;
  229. }else{
  230. that.content = that.content.concat(newList || []);
  231. }
  232. if (newList.length == 0) {
  233. that.showEmpty = true;
  234. } else {
  235. that.showEmpty = false;
  236. }
  237. if(res.total>that.content.length&&res.total>pageIndex*10){
  238. that.loadData(pageIndex+1);
  239. }
  240. }
  241. uni.stopPullDownRefresh();
  242. })
  243. },
  244. showImg(items, index) {
  245. let urls = [];
  246. for (let i = 0; i < items.length; i++) {
  247. urls.push(items[i].ftpUrl);
  248. }
  249. // 预览图片
  250. uni.previewImage({
  251. urls: urls,
  252. current: index,
  253. });
  254. },
  255. },
  256. onLoad() {
  257. this.loadData();
  258. }
  259. }
  260. </script>
  261. <style lang="scss" scoped>
  262. /* 胶囊*/
  263. .tn-custom-nav-bar__back {
  264. width: 60%;
  265. height: 100%;
  266. position: relative;
  267. display: flex;
  268. justify-content: space-evenly;
  269. align-items: center;
  270. box-sizing: border-box;
  271. // background-color: rgba(0, 0, 0, 0.15);
  272. border-radius: 1000rpx;
  273. // border: 1rpx solid rgba(255, 255, 255, 0.5);
  274. // color: #FFFFFF;
  275. font-size: 18px;
  276. .icon {
  277. display: block;
  278. flex: 1;
  279. margin: auto;
  280. text-align: center;
  281. }
  282. &:before {
  283. content: " ";
  284. width: 1rpx;
  285. height: 110%;
  286. position: absolute;
  287. top: 22.5%;
  288. left: 0;
  289. right: 0;
  290. margin: auto;
  291. transform: scale(0.5);
  292. transform-origin: 0 0;
  293. pointer-events: none;
  294. box-sizing: border-box;
  295. opacity: 0.7;
  296. background-color: #FFFFFF;
  297. }
  298. }
  299. /* 文章内容 start*/
  300. .blogger {
  301. &__item {
  302. padding: 30rpx;
  303. }
  304. &__author {
  305. &__btn {
  306. margin-right: -12rpx;
  307. opacity: 0.5;
  308. }
  309. }
  310. &__desc {
  311. line-height: 30rpx;
  312. &__label {
  313. color: #1D2541;
  314. background-color: #F3F2F7;
  315. border-radius: 10rpx;
  316. font-size: 22rpx;
  317. padding: 5rpx 15rpx;
  318. margin: 5rpx 18rpx 0 0;
  319. &--prefix {
  320. font-size: 24rpx;
  321. color: #1D2541;
  322. padding-right: 10rpx;
  323. }
  324. }
  325. &__content {
  326. line-height: 50rpx;
  327. }
  328. }
  329. &__content {
  330. margin-top: 18rpx;
  331. padding-right: 18rpx;
  332. &__data {
  333. line-height: 46rpx;
  334. text-align: justify;
  335. overflow: hidden;
  336. transition: all 0.25s ease-in-out;
  337. }
  338. &__status {
  339. margin-top: 10rpx;
  340. font-size: 26rpx;
  341. color: #82B2FF;
  342. }
  343. }
  344. &__main-image {
  345. border: 1rpx solid #F8F7F8;
  346. border-radius: 16rpx;
  347. &--1 {
  348. max-width: 80%;
  349. max-height: 300rpx;
  350. }
  351. &--2 {
  352. max-width: 260rpx;
  353. max-height: 260rpx;
  354. }
  355. &--3 {
  356. height: 212rpx;
  357. width: 100%;
  358. }
  359. }
  360. &__count-icon {
  361. font-size: 40rpx;
  362. padding-right: 5rpx;
  363. }
  364. &__ad {
  365. width: 100%;
  366. height: 500rpx;
  367. transform: translate3d(0px, 0px, 0px) !important;
  368. ::v-deep .uni-swiper-slide-frame {
  369. transform: translate3d(0px, 0px, 0px) !important;
  370. }
  371. .uni-swiper-slide-frame {
  372. transform: translate3d(0px, 0px, 0px) !important;
  373. }
  374. &__item {
  375. position: absolute;
  376. width: 100%;
  377. height: 100%;
  378. transform-origin: left center;
  379. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  380. transition: transform 0.25s ease-in-out;
  381. z-index: 1;
  382. &--0 {
  383. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  384. z-index: 4;
  385. }
  386. &--1 {
  387. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  388. z-index: 3;
  389. }
  390. &--2 {
  391. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  392. z-index: 2;
  393. }
  394. }
  395. &__content {
  396. border-radius: 40rpx;
  397. width: 640rpx;
  398. height: 500rpx;
  399. overflow: hidden;
  400. }
  401. &__image {
  402. width: 100%;
  403. height: 100%;
  404. }
  405. }
  406. }
  407. /* 文章内容 end*/
  408. /* 间隔线 start*/
  409. .tn-strip-bottom {
  410. width: 100%;
  411. border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
  412. }
  413. /* 间隔线 end*/
  414. /* 悬浮 */
  415. .tnxuanfu {
  416. animation: suspension 3s ease-in-out infinite;
  417. }
  418. @keyframes suspension {
  419. 0%,
  420. 100% {
  421. transform: translateY(0);
  422. }
  423. 50% {
  424. transform: translateY(-0.8rem);
  425. }
  426. }
  427. /* 悬浮按钮 */
  428. .button-shop {
  429. width: 90rpx;
  430. height: 90rpx;
  431. display: flex;
  432. flex-direction: row;
  433. position: fixed;
  434. /* bottom:200rpx;
  435. right: 20rpx; */
  436. left: 5rpx;
  437. top: 5rpx;
  438. z-index: 1001;
  439. border-radius: 100px;
  440. opacity: 0.9;
  441. }
  442. /* 按钮 */
  443. .edit {
  444. bottom: 300rpx;
  445. right: 75rpx;
  446. position: fixed;
  447. z-index: 9999;
  448. }
  449. .pa,
  450. .pa0 {
  451. position: absolute
  452. }
  453. .pa0 {
  454. left: 0;
  455. top: 0
  456. }
  457. .bg0 {
  458. width: 100rpx;
  459. height: 100rpx;
  460. top: 50%;
  461. left: 50%;
  462. transform: translate(-50%, -50%);
  463. background: #2196F3;
  464. border-radius: 50%;
  465. font-size: 32px;
  466. color: #fff;
  467. text-align: center;
  468. line-height: 50px;
  469. }
  470. .bg1 {
  471. width: 100%;
  472. height: 100%;
  473. }
  474. .hx-box {
  475. top: 50%;
  476. left: 50%;
  477. width: 100rpx;
  478. height: 100rpx;
  479. transform-style: preserve-3d;
  480. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  481. }
  482. .hx-box .pr {
  483. width: 100rpx;
  484. height: 100rpx;
  485. transform-style: preserve-3d;
  486. animation: hxz 20s linear infinite;
  487. }
  488. @keyframes hxz {
  489. 0% {
  490. transform: rotateX(0deg);
  491. }
  492. 100% {
  493. transform: rotateX(-360deg);
  494. }
  495. }
  496. .hx-box .pr .pa0 {
  497. width: 100rpx;
  498. height: 100rpx;
  499. /* border: 4px solid #5ec0ff; */
  500. border-radius: 1000px;
  501. }
  502. @keyframes hx {
  503. to {
  504. transform: rotate(360deg);
  505. }
  506. }
  507. .hx-k1 {
  508. transform: rotateX(-60deg) rotateZ(-60deg)
  509. }
  510. .hx-k2 {
  511. transform: rotateX(-30deg) rotateZ(-30deg)
  512. }
  513. .hx-k3 {
  514. transform: rotateX(0deg) rotateZ(0deg)
  515. }
  516. .hx-k4 {
  517. transform: rotateX(30deg) rotateZ(30deg)
  518. }
  519. .hx-k5 {
  520. transform: rotateX(60deg) rotateZ(60deg)
  521. }
  522. .hx-k6 {
  523. transform: rotateX(90deg) rotateZ(90deg)
  524. }
  525. </style>