index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="appeal-main">
  3. <view v-for="item in list" :key="item.key" class="appeal-item">
  4. <view class="appeal-user-box">
  5. <view class="appeal-user">
  6. <up-avatar :src="item.avatar" shape="square"></up-avatar>
  7. <view class="user-name">{{ item.name }}</view>
  8. </view>
  9. </view>
  10. <view class="appeal-text">
  11. {{ item.value }}
  12. </view>
  13. <view class="appeal-image">
  14. <view class="appeal-image-item" v-for="(baseListItem, baseListIndex) in [{}, {}, {}, {}, {}, {}, {}, {}]" :key="baseListIndex">
  15. 1
  16. </view>
  17. </view>
  18. <view class="appeal-order">
  19. <view class="appeal-avatar">
  20. <up-avatar :src="item.avatar" shape="square"></up-avatar>
  21. </view>
  22. <view class="appeal-order-box">
  23. <view class="appeal-order-text">标题:订单</view>
  24. <view class="appeal-order-text">简介:订单详情撒大师大师的十大</view>
  25. <view class="appeal-order-text">价格:200</view>
  26. </view>
  27. </view>
  28. <view class="appeal-text-box">
  29. <view class="font-title">申诉内容</view>
  30. <up-textarea v-model="textareaValue" placeholder="请输入申述内容" count ></up-textarea>
  31. </view>
  32. <view class="appeal-text-box">
  33. <view class="upload-box">
  34. <view class="upload-img-item" v-for="(item, index) in fileList" :key="item.url">
  35. <view class="delete-icon" @click="deletePic(index)"><up-icon name="close-circle-fill"
  36. color="#f64a1f" size="18"></up-icon></view>
  37. <img class="upload-img" :src="item.url" :alt="item.fileName" srcset="">
  38. </view>
  39. <img src="/static/img/upload.png" alt="" class="upload-img" @click="uploadClick('img')"
  40. v-if="fileList.length < 10">
  41. </view>
  42. </view>
  43. <view class="appeal-btn-box">
  44. <up-button type="primary" text="提交申述" @click="onAppeal"></up-button>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script setup>
  50. import { ref } from 'vue';
  51. import { wxUploadFile } from '@/utils/wxRequest.js'
  52. const list = [
  53. {
  54. name: '张三',
  55. avatar: '/static/img/报事报修@6x.png',
  56. status: 1,
  57. key: 1,
  58. value: '浔阳江头夜送客,枫叶荻花秋瑟瑟。主人下马客在船,举酒欲饮无管弦。醉不成欢惨将别,别时茫茫江浸月。',
  59. }
  60. ]
  61. const fileList = ref([]);
  62. const textareaValue = ref('');
  63. const load = () => {
  64. }
  65. const onAppeal = () => {
  66. console.log('提交申述',textareaValue.value);
  67. }
  68. // 删除图片
  69. const deletePic = (index) => {
  70. fileList.value.splice(index, 1);
  71. };
  72. const uploadClick = async (type) => {
  73. const res = await wxUploadFile(type);
  74. fileList.value = [...fileList.value, ...res];
  75. console.log('xxxxres', res, fileList.value);
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .appeal-main {
  80. position: fixed;
  81. top: 0px;
  82. left: 0px;
  83. right: 0px;
  84. bottom: 0px;
  85. background: rgba(245, 245, 245, 1);
  86. padding: 12px;
  87. overflow: auto;
  88. .appeal-item {
  89. border-radius: 8px;
  90. background: rgba(255, 255, 255, 1);
  91. padding: 12px;
  92. margin-bottom: 12px;
  93. .appeal-user-box {
  94. display: flex;
  95. align-items: center;
  96. justify-content: space-between;
  97. .appeal-user {
  98. display: flex;
  99. align-items: center;
  100. }
  101. .user-name {
  102. margin-left: 8px;
  103. font-size: 18px;
  104. font-weight: 700;
  105. line-height: 21.09px;
  106. color: rgba(51, 51, 51, 1);
  107. margin-left: 12px;
  108. }
  109. .appeal-status {
  110. font-size: 14px;
  111. }
  112. }
  113. .appeal-text {
  114. font-size: 14px;
  115. font-weight: 500;
  116. line-height: 20.27px;
  117. color: rgba(51, 51, 51, 1);
  118. padding: 12px 0;
  119. }
  120. .appeal-image {
  121. margin: 12px 0;
  122. display: grid;
  123. grid-template-columns: repeat(3, 1fr); // 4列布局
  124. gap: 12px; // 网格间距
  125. .appeal-image-item {
  126. background: #f9f9f9;
  127. height: 80px;
  128. width: 100px;
  129. }
  130. }
  131. .appeal-order {
  132. border-radius: 8px;
  133. background: #f9f9f9;
  134. margin: 12px 0;
  135. padding: 12px;
  136. display: flex;
  137. align-content: center;
  138. .appeal-avatar {
  139. margin-right: 12px;
  140. }
  141. .appeal-order-box {
  142. flex: 1;
  143. .appeal-order-text {
  144. font-size: 14px;
  145. font-weight: 500;
  146. line-height: 20.27px;
  147. color: rgba(153, 153, 153, 1);
  148. }
  149. }
  150. }
  151. .appeal-text-box {
  152. margin: 12px 0;
  153. .font-title {
  154. margin-bottom: 12px;
  155. }
  156. }
  157. .appeal-btn-box {
  158. display: flex;
  159. align-items: center;
  160. justify-content: flex-end;
  161. .appeal-btn {
  162. color: rgba(255, 87, 4, 1);
  163. font-size: 14px;
  164. width: 100%;
  165. height: 45px;
  166. border-radius: 16px;
  167. border: 1px solid rgba(255, 87, 4, 1);
  168. }
  169. }
  170. }
  171. .upload-img {
  172. height: 68px;
  173. width: 68px;
  174. margin-right: 12px;
  175. margin-bottom: 12px;
  176. }
  177. .upload-box {
  178. display: flex;
  179. flex-wrap: wrap;
  180. .upload-img-item {
  181. position: relative;
  182. .delete-icon {
  183. position: absolute;
  184. top: -7px;
  185. right: 7px;
  186. z-index: 1;
  187. }
  188. }
  189. }
  190. }
  191. </style>