feedback.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  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?'【投诉】':'【错误】' }}
  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() {
  192. let that = this;
  193. that.showEmpty = false;
  194. request.post('/slbFeedback/query', {
  195. userNo: uni.getStorageSync('userNo'),
  196. }).then(res => {
  197. console.warn(res);
  198. if (res && res.success) {
  199. let newList = res.list || [];
  200. for (let i = 0; i < newList.length; i++) {
  201. newList[i].imgList = [];
  202. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  203. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  204. newList[i].imgList.push(newList[i].fileDetailList[j]);
  205. }
  206. }
  207. }
  208. that.content = newList;
  209. if (newList.length == 0) {
  210. that.showEmpty = true;
  211. } else {
  212. that.showEmpty = false;
  213. }
  214. }
  215. uni.stopPullDownRefresh();
  216. })
  217. },
  218. showImg(items, index) {
  219. let urls = [];
  220. for (let i = 0; i < items.length; i++) {
  221. urls.push(items[i].ftpUrl);
  222. }
  223. // 预览图片
  224. uni.previewImage({
  225. urls: urls,
  226. current: index,
  227. });
  228. },
  229. },
  230. onLoad() {
  231. this.loadData();
  232. }
  233. }
  234. </script>
  235. <style lang="scss" scoped>
  236. /* 胶囊*/
  237. .tn-custom-nav-bar__back {
  238. width: 60%;
  239. height: 100%;
  240. position: relative;
  241. display: flex;
  242. justify-content: space-evenly;
  243. align-items: center;
  244. box-sizing: border-box;
  245. // background-color: rgba(0, 0, 0, 0.15);
  246. border-radius: 1000rpx;
  247. // border: 1rpx solid rgba(255, 255, 255, 0.5);
  248. // color: #FFFFFF;
  249. font-size: 18px;
  250. .icon {
  251. display: block;
  252. flex: 1;
  253. margin: auto;
  254. text-align: center;
  255. }
  256. &:before {
  257. content: " ";
  258. width: 1rpx;
  259. height: 110%;
  260. position: absolute;
  261. top: 22.5%;
  262. left: 0;
  263. right: 0;
  264. margin: auto;
  265. transform: scale(0.5);
  266. transform-origin: 0 0;
  267. pointer-events: none;
  268. box-sizing: border-box;
  269. opacity: 0.7;
  270. background-color: #FFFFFF;
  271. }
  272. }
  273. /* 文章内容 start*/
  274. .blogger {
  275. &__item {
  276. padding: 30rpx;
  277. }
  278. &__author {
  279. &__btn {
  280. margin-right: -12rpx;
  281. opacity: 0.5;
  282. }
  283. }
  284. &__desc {
  285. line-height: 30rpx;
  286. &__label {
  287. color: #1D2541;
  288. background-color: #F3F2F7;
  289. border-radius: 10rpx;
  290. font-size: 22rpx;
  291. padding: 5rpx 15rpx;
  292. margin: 5rpx 18rpx 0 0;
  293. &--prefix {
  294. font-size: 24rpx;
  295. color: #1D2541;
  296. padding-right: 10rpx;
  297. }
  298. }
  299. &__content {
  300. line-height: 50rpx;
  301. }
  302. }
  303. &__content {
  304. margin-top: 18rpx;
  305. padding-right: 18rpx;
  306. &__data {
  307. line-height: 46rpx;
  308. text-align: justify;
  309. overflow: hidden;
  310. transition: all 0.25s ease-in-out;
  311. }
  312. &__status {
  313. margin-top: 10rpx;
  314. font-size: 26rpx;
  315. color: #82B2FF;
  316. }
  317. }
  318. &__main-image {
  319. border: 1rpx solid #F8F7F8;
  320. border-radius: 16rpx;
  321. &--1 {
  322. max-width: 80%;
  323. max-height: 300rpx;
  324. }
  325. &--2 {
  326. max-width: 260rpx;
  327. max-height: 260rpx;
  328. }
  329. &--3 {
  330. height: 212rpx;
  331. width: 100%;
  332. }
  333. }
  334. &__count-icon {
  335. font-size: 40rpx;
  336. padding-right: 5rpx;
  337. }
  338. &__ad {
  339. width: 100%;
  340. height: 500rpx;
  341. transform: translate3d(0px, 0px, 0px) !important;
  342. ::v-deep .uni-swiper-slide-frame {
  343. transform: translate3d(0px, 0px, 0px) !important;
  344. }
  345. .uni-swiper-slide-frame {
  346. transform: translate3d(0px, 0px, 0px) !important;
  347. }
  348. &__item {
  349. position: absolute;
  350. width: 100%;
  351. height: 100%;
  352. transform-origin: left center;
  353. transform: translate3d(100%, 0px, 0px) scale(1) !important;
  354. transition: transform 0.25s ease-in-out;
  355. z-index: 1;
  356. &--0 {
  357. transform: translate3d(0%, 0px, 0px) scale(1) !important;
  358. z-index: 4;
  359. }
  360. &--1 {
  361. transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
  362. z-index: 3;
  363. }
  364. &--2 {
  365. transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
  366. z-index: 2;
  367. }
  368. }
  369. &__content {
  370. border-radius: 40rpx;
  371. width: 640rpx;
  372. height: 500rpx;
  373. overflow: hidden;
  374. }
  375. &__image {
  376. width: 100%;
  377. height: 100%;
  378. }
  379. }
  380. }
  381. /* 文章内容 end*/
  382. /* 间隔线 start*/
  383. .tn-strip-bottom {
  384. width: 100%;
  385. border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
  386. }
  387. /* 间隔线 end*/
  388. /* 悬浮 */
  389. .tnxuanfu {
  390. animation: suspension 3s ease-in-out infinite;
  391. }
  392. @keyframes suspension {
  393. 0%,
  394. 100% {
  395. transform: translateY(0);
  396. }
  397. 50% {
  398. transform: translateY(-0.8rem);
  399. }
  400. }
  401. /* 悬浮按钮 */
  402. .button-shop {
  403. width: 90rpx;
  404. height: 90rpx;
  405. display: flex;
  406. flex-direction: row;
  407. position: fixed;
  408. /* bottom:200rpx;
  409. right: 20rpx; */
  410. left: 5rpx;
  411. top: 5rpx;
  412. z-index: 1001;
  413. border-radius: 100px;
  414. opacity: 0.9;
  415. }
  416. /* 按钮 */
  417. .edit {
  418. bottom: 300rpx;
  419. right: 75rpx;
  420. position: fixed;
  421. z-index: 9999;
  422. }
  423. .pa,
  424. .pa0 {
  425. position: absolute
  426. }
  427. .pa0 {
  428. left: 0;
  429. top: 0
  430. }
  431. .bg0 {
  432. width: 100rpx;
  433. height: 100rpx;
  434. top: 50%;
  435. left: 50%;
  436. transform: translate(-50%, -50%);
  437. background: #2196F3;
  438. border-radius: 50%;
  439. font-size: 32px;
  440. color: #fff;
  441. text-align: center;
  442. line-height: 50px;
  443. }
  444. .bg1 {
  445. width: 100%;
  446. height: 100%;
  447. }
  448. .hx-box {
  449. top: 50%;
  450. left: 50%;
  451. width: 100rpx;
  452. height: 100rpx;
  453. transform-style: preserve-3d;
  454. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  455. }
  456. .hx-box .pr {
  457. width: 100rpx;
  458. height: 100rpx;
  459. transform-style: preserve-3d;
  460. animation: hxz 20s linear infinite;
  461. }
  462. @keyframes hxz {
  463. 0% {
  464. transform: rotateX(0deg);
  465. }
  466. 100% {
  467. transform: rotateX(-360deg);
  468. }
  469. }
  470. .hx-box .pr .pa0 {
  471. width: 100rpx;
  472. height: 100rpx;
  473. /* border: 4px solid #5ec0ff; */
  474. border-radius: 1000px;
  475. }
  476. @keyframes hx {
  477. to {
  478. transform: rotate(360deg);
  479. }
  480. }
  481. .hx-k1 {
  482. transform: rotateX(-60deg) rotateZ(-60deg)
  483. }
  484. .hx-k2 {
  485. transform: rotateX(-30deg) rotateZ(-30deg)
  486. }
  487. .hx-k3 {
  488. transform: rotateX(0deg) rotateZ(0deg)
  489. }
  490. .hx-k4 {
  491. transform: rotateX(30deg) rotateZ(30deg)
  492. }
  493. .hx-k5 {
  494. transform: rotateX(60deg) rotateZ(60deg)
  495. }
  496. .hx-k6 {
  497. transform: rotateX(90deg) rotateZ(90deg)
  498. }
  499. </style>