feedback.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. <template>
  2. <view class="index tn-safe-area-inset-bottom" style="background-color: #f7f7f7;min-height: 100vh;">
  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 :style="{fontSize:(wxFontSize)+'px'}">我的反馈</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" style="border-radius: 12px;margin: 12px 16px 12px 16px; background-color: #fff;">
  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="tn-padding-right tn-text-ellipsis">
  22. <view class="tn-padding-right tn-text-bold tn-text-lg" :style="{fontSize:(wxFontSize)+'px'}">
  23. {{ item.type==1?'【汇报系统故障】':item.type==2?'【平台机制咨询】':item.type==3?'【投诉】':item.type==5?'【平台用户举报】':'【其他】' }}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view
  30. class="blogger__author__btn justify-content-item tn-flex-col-center tn-flex-row-center" >
  31. <text class="" v-if="item.status==1" style="background: #fce9e9;font-size: 12px;
  32. padding: 8px;
  33. color: #EF2121;
  34. border-radius: 24px;
  35. " :style="{fontSize:(wxFontSize-6)+'px'}">已处理</text><text class="" v-if="item.status==0" style="background: #e6e6e6;font-size: 12px;
  36. padding: 8px;
  37. color: #999;
  38. border-radius: 24px;
  39. " :style="{fontSize:(wxFontSize-6)+'px'}">未处理</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. <text
  45. class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df" :style="{fontSize:(wxFontSize-1)+'px'}">{{ item.content }}</text>
  46. </view>
  47. <view v-if="item.ansowe"
  48. class="blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left">
  49. <text
  50. class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df" style="color:red" :style="{fontSize:(wxFontSize-2)+'px'}">回复:{{ item.ansowe }}</text>
  51. </view>
  52. <block v-if="item.imgList">
  53. <view v-if="[1,2,4].indexOf(item.imgList.length) != -1" class="tn-padding-top-xs"
  54. @click="tn('')">
  55. <image v-for="(image_item,image_index) in item.imgList" :key="image_index"
  56. class="blogger__main-image" :class="{
  57. 'blogger__main-image--1 tn-margin-bottom-sm': item.imgList.length === 1,
  58. 'blogger__main-image--2 tn-margin-right-sm tn-margin-bottom-sm': item.imgList.length === 2 || item.imgList.length === 4
  59. }" :src="image_item.ftpUrl" mode="aspectFill" @click="showImg(item.imgList,image_index)"></image>
  60. </view>
  61. <view v-else class="tn-padding-top-xs">
  62. <tn-grid hoverClass="none" :col="3">
  63. <block v-for="(image_item,image_index) in item.imgList" :key="image_index">
  64. <!-- #ifndef MP-WEIXIN -->
  65. <tn-grid-item style="width: 30%;margin: 10rpx;">
  66. <image class="blogger__main-image blogger__main-image--3"
  67. @click="showImg(item.imgList,image_index)" :src="image_item.ftpUrl"
  68. mode="aspectFill"></image>
  69. </tn-grid-item>
  70. <!-- #endif-->
  71. <!-- #ifdef MP-WEIXIN -->
  72. <tn-grid-item style="width: 30%;margin: 10rpx;">
  73. <image class="blogger__main-image blogger__main-image--3"
  74. @click="showImg(item.imgList,image_index)" :src="image_item.ftpUrl"
  75. mode="aspectFill"></image>
  76. </tn-grid-item>
  77. <!-- #endif-->
  78. </block>
  79. </tn-grid>
  80. </view>
  81. </block>
  82. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-top-xs">
  83. <view class="justify-content-item tn-color-gray tn-text-center">
  84. <view class="tn-padding-right tn-padding-top-xs tn-color-gray" :style="{fontSize:(wxFontSize-3)+'px'}">
  85. {{ item.createTime|formatDate }}
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </block>
  91. <view v-if="showEmpty" style="margin-top: 32vh;">
  92. <tn-empty mode="data"></tn-empty>
  93. </view>
  94. </view>
  95. <view class="edit tnxuanfu" @tap="showLandscape">
  96. <view class="bg0 pa">
  97. <view class="bg1">
  98. <text class='icon tn-icon-edit-write-fill'></text>
  99. </view>
  100. </view>
  101. <view class="hx-box pa">
  102. <view class="pr">
  103. <view class="hx-k1 pa0">
  104. <view class="span"></view>
  105. </view>
  106. <view class="hx-k2 pa0">
  107. <view class="span"></view>
  108. </view>
  109. <view class="hx-k3 pa0">
  110. <view class="span"></view>
  111. </view>
  112. <view class="hx-k4 pa0">
  113. <view class="span"></view>
  114. </view>
  115. <view class="hx-k5 pa0">
  116. <view class="span"></view>
  117. </view>
  118. <view class="hx-k6 pa0">
  119. <view class="span"></view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </template>
  126. <script>
  127. import request from '../../utils/request'
  128. export default {
  129. data() {
  130. return {
  131. showHistory: false,
  132. content: [],
  133. showEmpty: false,
  134. wxFontSize:17
  135. }
  136. },
  137. filters: {
  138. formatDate(value) {
  139. if (!value) return '';
  140. const date = new Date(value);
  141. const today = new Date();
  142. const yesterday = new Date(today); // 昨天的日期
  143. yesterday.setDate(yesterday.getDate() - 1); // 将昨天的日期设置为前一天
  144. if (date.getFullYear() == today.getFullYear() && date.getMonth() == today.getMonth() && date.getDate() ==
  145. today.getDate()) {
  146. return '今天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  147. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  148. }
  149. if (date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date
  150. .getDate() == yesterday.getDate()) {
  151. return '昨天 ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  152. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  153. }
  154. return date.toLocaleDateString() + ' ' + (date.getHours() > 9 ? '' : '0') + date.getHours() + ':' + (date
  155. .getMinutes() > 9 ? '' : '0') + date.getMinutes(); // 根据需要格式化日期
  156. },
  157. },
  158. created() {
  159. },
  160. methods: {
  161. onPullDownRefresh() {
  162. this.loadData();
  163. },
  164. showLandscape() {
  165. uni.navigateTo({
  166. url: '/pages/mine/addFeed'
  167. })
  168. },
  169. goBack() {
  170. uni.navigateBack();
  171. },
  172. isImage(fileName) {
  173. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  174. const extension = fileName.split('.').pop().toLowerCase();
  175. return imageExtensions.includes(extension);
  176. },
  177. loadData(pageIndex=1) {
  178. if(!uni.getStorageSync('userNo')){
  179. return false;
  180. }
  181. let that = this;
  182. that.showEmpty = false;
  183. request.post('/slbFeedback/query', {
  184. limit:10,
  185. index:pageIndex,
  186. userNo: uni.getStorageSync('userNo'),
  187. }).then(res => {
  188. console.warn(res);
  189. if (res && res.success) {
  190. let newList = res.list || [];
  191. for (let i = 0; i < newList.length; i++) {
  192. newList[i].imgList = [];
  193. for (let j = 0; j < newList[i].fileDetailList.length; j++) {
  194. if (that.isImage(newList[i].fileDetailList[j].fileName)) {
  195. newList[i].imgList.push(newList[i].fileDetailList[j]);
  196. }
  197. }
  198. }
  199. if(pageIndex==1){
  200. that.content = newList;
  201. }else{
  202. that.content = that.content.concat(newList || []);
  203. }
  204. if (newList.length == 0) {
  205. that.showEmpty = true;
  206. } else {
  207. that.showEmpty = false;
  208. }
  209. if(res.total>that.content.length&&res.total>pageIndex*10){
  210. that.loadData(pageIndex+1);
  211. }
  212. }
  213. uni.stopPullDownRefresh();
  214. })
  215. },
  216. showImg(items, index) {
  217. let urls = [];
  218. for (let i = 0; i < items.length; i++) {
  219. urls.push(items[i].ftpUrl);
  220. }
  221. // 预览图片
  222. uni.previewImage({
  223. urls: urls,
  224. current: index,
  225. });
  226. },
  227. },
  228. onLoad() {
  229. const appBaseInfo = wx.getAppBaseInfo();
  230. this.wxFontSize = uni.getStorageSync('fontSize')||appBaseInfo.fontSizeSetting||17;
  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. /* 悬浮 */
  383. .tnxuanfu {
  384. animation: suspension 3s ease-in-out infinite;
  385. }
  386. @keyframes suspension {
  387. 0%,
  388. 100% {
  389. transform: translateY(0);
  390. }
  391. 50% {
  392. transform: translateY(-0.8rem);
  393. }
  394. }
  395. /* 悬浮按钮 */
  396. .button-shop {
  397. width: 90rpx;
  398. height: 90rpx;
  399. display: flex;
  400. flex-direction: row;
  401. position: fixed;
  402. /* bottom:200rpx;
  403. right: 20rpx; */
  404. left: 5rpx;
  405. top: 5rpx;
  406. z-index: 1001;
  407. border-radius: 100px;
  408. opacity: 0.9;
  409. }
  410. /* 按钮 */
  411. .edit {
  412. bottom: 300rpx;
  413. right: 75rpx;
  414. position: fixed;
  415. z-index: 9999;
  416. }
  417. .pa,
  418. .pa0 {
  419. position: absolute
  420. }
  421. .pa0 {
  422. left: 0;
  423. top: 0
  424. }
  425. .bg0 {
  426. width: 100rpx;
  427. height: 100rpx;
  428. top: 50%;
  429. left: 50%;
  430. transform: translate(-50%, -50%);
  431. background: #2196F3;
  432. border-radius: 50%;
  433. font-size: 32px;
  434. color: #fff;
  435. text-align: center;
  436. line-height: 50px;
  437. }
  438. .bg1 {
  439. width: 100%;
  440. height: 100%;
  441. }
  442. .hx-box {
  443. top: 50%;
  444. left: 50%;
  445. width: 100rpx;
  446. height: 100rpx;
  447. transform-style: preserve-3d;
  448. transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
  449. }
  450. .hx-box .pr {
  451. width: 100rpx;
  452. height: 100rpx;
  453. transform-style: preserve-3d;
  454. animation: hxz 20s linear infinite;
  455. }
  456. @keyframes hxz {
  457. 0% {
  458. transform: rotateX(0deg);
  459. }
  460. 100% {
  461. transform: rotateX(-360deg);
  462. }
  463. }
  464. .hx-box .pr .pa0 {
  465. width: 100rpx;
  466. height: 100rpx;
  467. /* border: 4px solid #5ec0ff; */
  468. border-radius: 1000px;
  469. }
  470. @keyframes hx {
  471. to {
  472. transform: rotate(360deg);
  473. }
  474. }
  475. .hx-k1 {
  476. transform: rotateX(-60deg) rotateZ(-60deg)
  477. }
  478. .hx-k2 {
  479. transform: rotateX(-30deg) rotateZ(-30deg)
  480. }
  481. .hx-k3 {
  482. transform: rotateX(0deg) rotateZ(0deg)
  483. }
  484. .hx-k4 {
  485. transform: rotateX(30deg) rotateZ(30deg)
  486. }
  487. .hx-k5 {
  488. transform: rotateX(60deg) rotateZ(60deg)
  489. }
  490. .hx-k6 {
  491. transform: rotateX(90deg) rotateZ(90deg)
  492. }
  493. </style>