myfeedback.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view>
  3. <uni-section type="text">
  4. <view class="uni-padding-wrap uni-common-mt">
  5. <uni-segmented-control :current="status" :values="sublist" :active-color="activeColor"
  6. @clickItem="sectionChange" />
  7. </view>
  8. </uni-section>
  9. <!-- <view style="background-color: #fff; height:45px; width:100%;position: fixed;top: 0px;z-index: 99;">
  10. <view class="uniform">
  11. <a class="uniform-a-active"
  12. href="{php echo $this->createMobileUrl('myfeedback',array('status'=>0))}">待解决</a>
  13. </view>
  14. <view class="uniform">
  15. <a class="uniform-a-active"
  16. href="{php echo $this->createMobileUrl('myfeedback',array('status'=>1))}">已解决</a>
  17. </view>
  18. </view> -->
  19. <!-- <view style="height:47px;"></view> -->
  20. <view class="weui-cells__title">
  21. <text v-if="status==0">待解决反馈</text>
  22. <text v-if="status==1">已解决反馈</text>
  23. 共<b>{{total}}</b>个
  24. </view>
  25. <view v-if="total<=0" class="no-data-cont-change">
  26. <i class="icon iconfont iconwushuju no-data-icon"></i>
  27. <p>您暂时没有此条件下的反馈!</p>
  28. </view>
  29. <view class="partner-list" id="list" v-for="item in list" :id="item.id" :key="item.id">
  30. <view class="weui-panel">
  31. <view class="weui-panel__bd">
  32. <span href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
  33. <uni-card :is-shadow="false">
  34. <view class="weui-media-box__bd">
  35. <h4 class="weui-media-box__title">反馈编号:{{item.id}}</h4>
  36. <p class="weui-media-box__desc">反馈时间:{{formatDate(item.createtime)}}</p>
  37. <p class="weui-media-box__desc">问题简述:{{item.reason}}</p>
  38. <p class="weui-media-box__desc">问题详情:{{item.remark}}</p>
  39. <p v-if="item.status==1" class="weui-media-box__desc">解决方法:{{item.solution}}</p>
  40. <p class="weui-media-box__desc">回复内容:{{item.response}}</p>
  41. </view>
  42. </uni-card>
  43. </span>
  44. </view>
  45. </view>
  46. </view>
  47. <view v-if="total>psize" style="margin: 40px 0px; text-align: center;">
  48. <view class="show-more">
  49. <a href="javascript:void(0);" style="color: #000;" @click="loadPage()" id="pager">浏览更多</a>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. list: [],
  59. status: 0,
  60. total: 0,
  61. sublist: ['待解决', '已解决'],
  62. page: 1,
  63. psize: 5
  64. };
  65. },
  66. onLoad(option) {
  67. this.getMyFeedback(this.status)
  68. },
  69. methods: {
  70. sectionChange(e) {
  71. if (e.currentIndex == 0) {
  72. this.status = 0
  73. this.list= [],
  74. this.getMyFeedback(0)
  75. } else {
  76. this.status = 1
  77. this.list= [],
  78. this.getMyFeedback(1)
  79. }
  80. },
  81. getMyFeedback(status) {
  82. var _this = this
  83. uni.request({
  84. method: 'get',
  85. url: config.baseUrl +
  86. 'app/index.php?i=1&j=1&c=entry&debugSkip=true&m=wdl_shopping&do=myfeedback&isajax=1&status=' +
  87. status + '&page=' + _this.page,
  88. success(res) {
  89. //console.log('myfeedback??????>' + JSON.stringify(res));
  90. _this.total = res.data.total
  91. for (let item of res.data.list) {
  92. if(!_this.list.includes(item)){
  93. _this.list.push(item)
  94. }
  95. }
  96. _this.psize = res.data.psize
  97. },
  98. fail(res) {
  99. console.log(JSON.stringify(res))
  100. }
  101. })
  102. },
  103. loadPage() {
  104. this.page += 1;
  105. this.getMyFeedback(this.status);
  106. },
  107. formatDate(time) {
  108. let date = new Date(time*1000);
  109. let year = date.getUTCFullYear();
  110. let month = date.getUTCMonth() + 1;
  111. let day = date.getUTCDate();
  112. let hours = date.getUTCHours();
  113. let minutes = date.getUTCMinutes();
  114. let seconds = date.getUTCSeconds();
  115. // 为了使结果更加易读,可以对月、日、小时、分钟和秒进行补零操作
  116. month = month < 10 ? '0' + month : month;
  117. day = day < 10 ? '0' + day : day;
  118. hours = hours < 10 ? '0' + hours : hours;
  119. minutes = minutes < 10 ? '0' + minutes : minutes;
  120. seconds = seconds < 10 ? '0' + seconds : seconds;
  121. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  122. }
  123. },
  124. };
  125. </script>
  126. <link rel="stylesheet" href="@/static/css/weui.css">
  127. <style>
  128. a {
  129. text-decoration: none;
  130. color: #000;
  131. }
  132. a:hover,
  133. a:focus {
  134. text-decoration: none;
  135. color: #1390ea;
  136. }
  137. .uniform {
  138. float: left;
  139. width: 50%;
  140. text-align: center;
  141. height: 42px;
  142. }
  143. .uniform a {
  144. display: block;
  145. height: 100%;
  146. width: 100%;
  147. line-height: 40px;
  148. border-bottom: 2px solid #d7d3d3;
  149. }
  150. .uniform .uniform-a-active {
  151. color: #247aff;
  152. font-weight: bold;
  153. border-bottom: 2px solid #247aff;
  154. }
  155. .pay-type {
  156. float: left;
  157. font-size: 14px;
  158. }
  159. .weui-media-box__desc {
  160. color: #666d7f;
  161. font-size: 14px;
  162. padding-top: 4px;
  163. }
  164. .uni-padding-wrap {
  165. width: 750rpx;
  166. }
  167. /* body {
  168. background: url('{$curPath}/yuejilu/newbg2.png') no-repeat center;
  169. background-size: 100% 100%;
  170. background-position: center 100%;
  171. height: 100vh;
  172. width: 100vw;
  173. } */
  174. /* 暂无数据去掉背景色*/
  175. .no-data-cont-change {
  176. text-align: center;
  177. color: #d7d7d7;
  178. }
  179. </style>