feedback.vue 13 KB

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