myAppeal.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div class="content">
  3. <div v-for="(otherAppeal, index) in otherAppealList" :key="index" style="border-bottom: 1rpx solid #e6e6e6;">
  4. <appealCard
  5. :otherAppeal="otherAppeal"
  6. @tap="toDetail(otherAppeal.id)" :isOther='false'></appealCard>
  7. </div>
  8. <image src="../../static/nodata.svg" mode="aspectFit" style="width: 100%;" v-if="otherAppealList.length === 0"></image>
  9. </div>
  10. </template>
  11. <script>
  12. import md5 from "@/common/md5.js";
  13. import appealCard from "./appealCard.vue";
  14. export default {
  15. components: {
  16. appealCard,
  17. },
  18. data() {
  19. return {
  20. otherAppealList: [
  21. {
  22. title: "航投大厦餐厅服务建议",
  23. state: 0,
  24. image: "/static/appeal/avator.png",
  25. msg: "正在处理中",
  26. },
  27. {
  28. title: "拉土车夜间噪音问题整改诉求",
  29. name: "市场服务与监督管理局",
  30. state: 1,
  31. msg: "尊敬的市民您好!收到您的留言,我们十分重视!正平大街开展拉土作业的车辆为西安(咸阳)机场三期扩建工程建设项目运输……",
  32. image: "/static/appeal/avator.png",
  33. },
  34. ],
  35. };
  36. },
  37. onLoad() {
  38. this.getMyList();
  39. },
  40. methods: {
  41. toDetail(infoId) {
  42. uni.navigateTo({
  43. url: "/pages/appeal/appeal_detail?id="+infoId,
  44. });
  45. },
  46. getMyList(){
  47. let md5Sign = md5(
  48. "method=" +
  49. "consult" +
  50. "&timestamp=" +
  51. getApp().globalData.globalTimestamp +
  52. "&secret=" +
  53. getApp().globalData.secret
  54. );
  55. let url =
  56. getApp().globalData.shareUrl +
  57. "api/api.php" +
  58. "?method=consult&source=consult&action=my_list&timestamp=" +
  59. getApp().globalData.globalTimestamp +
  60. "&sign=" +
  61. md5Sign;
  62. uni.request({
  63. url: url,
  64. method: "POST",
  65. header: {
  66. "content-type": "application/x-www-form-urlencoded",
  67. },
  68. data: {
  69. openId:getApp().globalData.open_id,
  70. },
  71. success: (res) => {
  72. if (res.data.code === 200) {
  73. this.otherAppealList = res.data.data.list
  74. console.log(res.data.data.list);
  75. }
  76. },
  77. fail: () => {
  78. console.log("连接失败");
  79. },
  80. });
  81. }
  82. },
  83. };
  84. </script>
  85. <style lang="scss" scoped>
  86. .content {
  87. width: 100%;
  88. height: 100vh;
  89. }
  90. </style>