index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view style="margin-top: 40rpx;">
  3. <scroll ref="pullScroll" :pullDown="pullDown" :pullUp="loadData">
  4. <view class="item" v-for="(item,index) in data" :key="index">
  5. <view class="left">
  6. <image :src="item.headImg" style="width: 100%;height: 100%;"></image>
  7. </view>
  8. <view class="right">
  9. <view style="width:100%;height:44rpx;display: flex;justify-content: space-between;">
  10. <view class="name">{{item.createBy}}</view>
  11. <view class="topBtn" v-if="item.state==2">已处理</view>
  12. <view v-else-if="item.state==1" class="topBtn" style="border:2rpx solid rgba(41,138,253,1);color:#298AFD;">未处理</view>
  13. </view>
  14. <view class="text">
  15. {{item.content}}
  16. </view>
  17. <view class="img" v-show="item.photosUrlList.length>0" >
  18. <image :src="img" style="width: 180rpx;height: 180rpx;padding-right: 10rpx;margin-bottom: 10rpx;"@tap="prew(item.photosUrlList,index1)" v-for="(img,index1) in item.photosUrlList"
  19. :key="index1"></image>
  20. </view>
  21. <!-- 回复信息 -->
  22. <view class="replay" v-if="item.reprList.length>0">
  23. <view style="width: 100%;margin: 20rpx 0rpx 20rpx 20rpx;" v-for="(rep,index3) in item.reprList" :key="index3">
  24. <view class="replayItem" v-if="rep.disposeState==2">
  25. <view class="replayName" style="padding-right: 15rpx;" >
  26. <text style="font-size: 28rpx;color: #333333;font-family:PingFang SC;font-weight:bold;margin-right:5rpx;">{{rep.maintainBy}}
  27. </text><text style="color: rgba(41, 138, 253, 1);"> 回复</text><text style="font-size: 28rpx;color: #333333;font-family:PingFang SC;font-weight:bold;margin-left: 5rpx;">{{item.createBy}}:</text>
  28. <text style="font-size: 25rpx;padding-left: 5rpx;">{{rep.disposeResult}}</text></view>
  29. <!-- <view class="replayContent">{{rep.disposeResult}}</view> -->
  30. </view>
  31. <view class="replayItem" v-else-if="rep.disposeState==3">
  32. <view class="replayName" style="padding-right: 15rpx;padding-top: 5rpx;">
  33. <uni-rate :value="rep.score" :disabled="true" ></uni-rate>
  34. </view>
  35. <view style="padding-top: 10rpx;">{{rep.disposeResult}}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 我要评论 -->
  40. <view class="bottomBtn" @tap="myTalk(item.adviceId)" v-show="item.userId==userId &&item.state==2 ">我的评价</view>
  41. <view class="date">{{(item.createTime).substr(0,16)}}</view>
  42. </view>
  43. </view>
  44. </scroll>
  45. <!-- 底部按钮 -->
  46. <button class="btnBox" @tap="myRepairs">
  47. 我要投诉
  48. </button>
  49. </view>
  50. </template>
  51. <script>
  52. import uniRate from '@/components/uni-rate/uni-rate.vue'
  53. export default {
  54. data() {
  55. return {
  56. userId:uni.getStorageSync('userId'),
  57. data: [],
  58. total: 0, //总条数
  59. pageNum: 1, //页数
  60. pageSize: 10, //每页显示多少条数
  61. }
  62. },
  63. onLoad() {
  64. this.refresh();
  65. },
  66. onUnload() {
  67. uni.switchTab({
  68. url:'../index/index'
  69. })
  70. },
  71. components: {
  72. uniRate
  73. },
  74. methods: {
  75. // 预览图片
  76. prew(item,index){
  77. uni.previewImage({
  78. current:item[index],
  79. urls:item,
  80. success:(res)=>{
  81. },
  82. })
  83. },
  84. // 刷新页面
  85. refresh() {
  86. this.$nextTick(() => {
  87. this.$refs.pullScroll.refresh();
  88. });
  89. },
  90. // 向下拉刷新
  91. pullDown(pullScroll) {
  92. setTimeout(() => {
  93. this.loadData(pullScroll);
  94. }, 200);
  95. },
  96. //获取加载数据
  97. loadData(pullScroll) {
  98. this.pageNum = pullScroll.page
  99. if(pullScroll.page==1){
  100. this.data=[]
  101. }
  102. setTimeout(() => {
  103. this.http.httpRequest('/wxapplet/owneradvice/list', 'get', {
  104. pageNum: pullScroll.page,
  105. pageSize: this.pageSize,
  106. userId: uni.getStorageSync("userId")
  107. }).then((res) => {
  108. if (res.code == 0) {
  109. //判断数据是否加载完
  110. if (this.data.length == res.data.total) {
  111. pullScroll.finish();
  112. } else {
  113. pullScroll.success();
  114. let data = res.data.rows
  115. console.log(this.data);
  116. console.log(data);
  117. this.data = this.data.concat(data);
  118. }
  119. } else {
  120. pullScroll.finish();
  121. uni.showToast({
  122. title: res.msg,
  123. "icon": 'none'
  124. })
  125. }
  126. }).catch(()=>{
  127. pullScroll.finish();
  128. })
  129. }, 500);
  130. },
  131. // 我的评价
  132. myTalk(item) {
  133. uni.navigateTo({
  134. url: "./evaluateCompalin?id=" + item
  135. })
  136. },
  137. // 我要投诉
  138. myRepairs() {
  139. uni.navigateTo({
  140. url: "./wantCompalin"
  141. })
  142. }
  143. }
  144. }
  145. </script>
  146. <style scoped>
  147. .leftBtn {
  148. width: 340rpx;
  149. height: 90rpx;
  150. background: rgba(102, 193, 143, 1);
  151. opacity: 1;
  152. border-radius: 18rpx;
  153. font-size: 32rpx;
  154. font-family: PingFang SC;
  155. font-weight: bold;
  156. color: rgba(255, 255, 255, 1);
  157. text-align: center;
  158. line-height: 90rpx;
  159. }
  160. .rightBtn {
  161. width: 340rpx;
  162. height: 90rpx;
  163. background: rgba(41, 138, 253, 1);
  164. opacity: 1;
  165. border-radius: 18rpx;
  166. font-size: 32rpx;
  167. font-family: PingFang SC;
  168. font-weight: bold;
  169. color: rgba(255, 255, 255, 1);
  170. text-align: center;
  171. line-height: 90rpx;
  172. }
  173. .btnBox {
  174. width: 702rpx;
  175. height: 90rpx;
  176. position: fixed;
  177. bottom: 56rpx;
  178. left: 24rpx;
  179. background: rgba(41, 138, 253, 1);
  180. opacity: 1;
  181. border-radius: 18rpx;
  182. font-size: 32rpx;
  183. font-family: PingFang SC;
  184. font-weight: bold;
  185. color: rgba(255, 255, 255, 1);
  186. text-align: center;
  187. line-height: 90rpx;
  188. z-index: 999;
  189. }
  190. .date {
  191. width: 230rpx;
  192. height: 34rpx;
  193. font-size: 24rpx;
  194. font-family: PingFang SC;
  195. font-weight: 400;
  196. color: rgba(204, 204, 204, 1);
  197. margin-top: 10rpx;
  198. margin-left: 356rpx;
  199. text-align: right;
  200. margin-bottom: 30rpx;
  201. }
  202. .bottomBtn {
  203. width: 140rpx;
  204. height: 42rpx;
  205. background: rgba(255, 255, 255, 1);
  206. border: 2rpx solid rgba(41, 138, 253, 1);
  207. opacity: 1;
  208. border-radius: 22rpx;
  209. font-size: 20rpx;
  210. font-family: PingFang SC;
  211. font-weight: 400;
  212. line-height: 42rpx;
  213. color: rgba(41, 138, 253, 1);
  214. text-align: center;
  215. margin-top: 40rpx;
  216. margin-left: 446rpx;
  217. }
  218. .replayItem {
  219. margin-top: 10rpx;
  220. }
  221. .replayContent {
  222. font-size: 24rpx;
  223. font-family: PingFang SC;
  224. font-weight: 400;
  225. color: rgba(51, 51, 51, 1);
  226. margin-top: 4rpx;
  227. }
  228. .replay {
  229. width: 586rpx;
  230. margin-top: 20rpx;
  231. background: rgba(247, 247, 247, 1);
  232. opacity: 1;
  233. border-radius: 8rpx;
  234. overflow: hidden;
  235. }
  236. .text {
  237. width: 100%;
  238. font-size: 32rpx;
  239. font-family: PingFang SC;
  240. font-weight: 400;
  241. color: rgba(51, 51, 51, 1);
  242. margin-top: 30rpx;
  243. }
  244. .img {
  245. width: 100%;
  246. margin-top: 10rpx;
  247. display: flex;
  248. flex-wrap: wrap;
  249. }
  250. .img image :nth-child(3n) {
  251. margin-right: none;
  252. }
  253. .name {
  254. font-size: 32rpx;
  255. font-family: PingFang SC;
  256. font-weight: bold;
  257. color: rgba(41, 138, 253, 1);
  258. }
  259. .topBtn {
  260. width: 120rpx;
  261. height: 42rpx;
  262. background: rgba(255, 255, 255, 1);
  263. border: 2rpx solid rgba(204, 204, 204, 1);
  264. opacity: 1;
  265. border-radius: 22rpx;
  266. font-size: 20rpx;
  267. font-family: PingFang SC;
  268. font-weight: 400;
  269. color: rgba(204, 204, 204, 1);
  270. text-align: center;
  271. line-height: 42rpx;
  272. }
  273. .item {
  274. width: 702rpx;
  275. margin: 0 auto;
  276. border-bottom: 2rpx solid rgba(247, 247, 247, 1);
  277. display: flex;
  278. margin-top: 35rpx;
  279. }
  280. .left {
  281. width: 86rpx;
  282. height: 86rpx;
  283. }
  284. .right {
  285. width: 586rpx;
  286. margin-left: 30rpx;
  287. }
  288. </style>