index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="page">
  3. <view class="sheet">
  4. <uv-list border>
  5. <uv-list-item
  6. border
  7. :title="item.title"
  8. clickable
  9. show-arrow
  10. @click="handleClickFaq(item)"
  11. :note="item.createTime"
  12. v-for="(item, index) in state.feedbackList" :key="index">
  13. <template #footer>
  14. <uv-tags text="已反馈" plain size="mini" type="warning"></uv-tags>
  15. </template>
  16. </uv-list-item>
  17. </uv-list>
  18. </view>
  19. <view
  20. class="flex-center flex-column contact mt-20"
  21. hover-class="hover-scale"
  22. @click="call"
  23. >
  24. <image
  25. class="width-96"
  26. mode="widthFix"
  27. src="/static/contact-customer.png"/>
  28. <view class="mt-16 color-666 fs-28">电话客服</view>
  29. </view>
  30. <view class="feedback-plus" @click="handleAddFeedback">
  31. <uv-icon name="plus" color="#fff"></uv-icon>
  32. </view>
  33. <add ref="add_ref"></add>
  34. <add ref="detail_ref"></add>
  35. </view>
  36. </template>
  37. <script setup lang="ts">
  38. import {onHide, onShow} from "@dcloudio/uni-app";
  39. import {reactive, ref} from "vue";
  40. import {body} from "@/utils/https"
  41. import add from '@/pages-user/feedback/add.vue';
  42. const add_ref = ref()
  43. const detail_ref = ref()
  44. const initState = () => ({
  45. feedbackList: [
  46. // {
  47. // title: '洗车扣费异常问题',
  48. // status: 1,
  49. // createTime: '2022-09-01 10:00:00',
  50. // },
  51. // {
  52. // title: '洗车扣费异常问题',
  53. // status: 1,
  54. // createTime: '2022-09-01 10:00:00',
  55. // }
  56. ] as any[],
  57. servicerPhone: "",
  58. })
  59. const state = reactive(initState())
  60. const call = () => {
  61. uni.makePhoneCall({
  62. phoneNumber: state.servicerPhone,
  63. });
  64. };
  65. const toggle = (index: number) => {
  66. state.feedbackList = state.feedbackList.map((item, i) => {
  67. return {
  68. ...item,
  69. open: item.open ? false : i === index,
  70. };
  71. });
  72. };
  73. onShow((options:any) => {
  74. let gd = getApp<any>().globalData;
  75. console.log(gd)
  76. if (options) {
  77. state.servicerPhone = options.servicePhone;
  78. }
  79. body(`/feedback/list`).then((res: any) => {
  80. state.feedbackList = res.list;
  81. })
  82. });
  83. onHide(() => {
  84. Object.assign(state, initState());
  85. })
  86. const handleClickFaq = (item: any) => {
  87. detail_ref.value?.open(item,'detail')
  88. }
  89. const handleAddFeedback = () => {
  90. add_ref.value?.open(null,'add');
  91. }
  92. </script>
  93. <style lang="scss">
  94. .page {
  95. min-height: 100vh;
  96. background: #f6f7fa;
  97. box-sizing: border-box;
  98. padding: 40rpx 32rpx;
  99. }
  100. .contact {
  101. height: 216rpx;
  102. border-radius: 24rpx;
  103. background: #fff;
  104. }
  105. .sheet {
  106. box-sizing: border-box;
  107. border-radius: 24rpx;
  108. background: #fff;
  109. overflow: hidden;
  110. &_bar {
  111. .head {
  112. padding: 0rpx 24rpx;
  113. box-sizing: border-box;
  114. & > view {
  115. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  116. }
  117. }
  118. .body {
  119. box-sizing: border-box;
  120. background-color: rgba(52, 125, 255, 0.06);
  121. transition: all 0.3s;
  122. padding: 0rpx 24rpx;
  123. }
  124. .body-hidden {
  125. height: 0px;
  126. overflow: hidden;
  127. }
  128. .body-open {
  129. height: auto;
  130. padding-top: 24rpx;
  131. padding-bottom: 24rpx;
  132. }
  133. &:last-child {
  134. .head {
  135. & > view {
  136. border-bottom: none;
  137. }
  138. }
  139. }
  140. }
  141. }
  142. .feedback-plus {
  143. position: fixed;
  144. bottom: 60rpx;
  145. right: 60rpx;
  146. width: 90rpx;
  147. height: 90rpx;
  148. background: $uni-color-primary;
  149. border-radius: 50%;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
  154. z-index: 9999;
  155. }
  156. </style>