LostandFoundtext.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="padding">
  3. <u-form labelPosition="top" :model="model1" :rules="rules" ref="uForm">
  4. <u-form-item label="订单号码" prop="ordersId" borderBottom ref="item1">
  5. <u-input v-model="model1.ordersId" border="none"></u-input>
  6. </u-form-item>
  7. <u-form-item label="联系人" prop="name" borderBottom ref="item1">
  8. <u-input v-model="model1.name" border="none"></u-input>
  9. </u-form-item>
  10. <u-form-item label="联系方式" prop="phone" borderBottom ref="item1">
  11. <u-input v-model="model1.phone" border="none"></u-input>
  12. </u-form-item>
  13. <u-form-item label="其他信息" prop="description" borderBottom>
  14. <textarea placeholder="简要描述物品其他信息" v-model="model1.description"
  15. class="feedback-textare" />
  16. </u-form-item>
  17. </u-form>
  18. <view class="">
  19. <view class="flex" style="justify-content: space-between;">
  20. <view>物品照片</view>
  21. <view>请上传丢失的物品照片</view>
  22. </view>
  23. <u-upload
  24. :action="uploadAction"
  25. :file-list="fileList"
  26. @on-success="handleUploadSuccess"
  27. @on-error="handleUploadError"
  28. :max-count="3"
  29. :multiple="false"
  30. ></u-upload>
  31. </view>
  32. <view class="pay_btns" @click="submit">联系平台</view>
  33. <u-popup v-model="show" mode="bottom" length="260rpx">
  34. <view class="pay_btns1">
  35. <image v-if="globalImages" :src="globalImages + 'images/my/chat2.png'" style="width: 26rpx;height: 26rpx; margin-right: 10rpx;" mode=""></image>
  36. 在线客服
  37. </view>
  38. <view class="pay_btns2">
  39. <image v-if="globalImages" :src="globalImages + 'images/my/phone2.png'" style="width: 26rpx;height: 26rpx; margin-right: 10rpx;" mode=""></image>
  40. 热线电话
  41. </view>
  42. </u-popup>
  43. </view>
  44. </template>
  45. <script>
  46. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  47. export default {
  48. data() {
  49. return {
  50. model1: {
  51. name: '',
  52. ordersId: '',
  53. phone: '',
  54. description: '',
  55. image: '',
  56. loss: 1,
  57. },
  58. action: 'http://www.example.com/upload',
  59. fileList: [],
  60. // 上传组件配置
  61. uploadAction: 'http://192.168.50.122:8179/sqx_fast/alioss/upload', // 上传接口地址
  62. fileList: [], // 已上传的文件列表
  63. show: false,
  64. globalImages: ''
  65. }
  66. },
  67. onLoad(options) {
  68. waitForGlobalImages().then((path) => {
  69. console.log('✅ 全局图片路径:', path)
  70. this.globalImages = path
  71. })
  72. if (options.data) {
  73. try {
  74. const item = JSON.parse(decodeURIComponent(options.data));
  75. this.model1 = { ...item }; // 填充表单数据
  76. this.fileList = item.image ? [{ url: item.image, status: 'success', name: 'image' }] : [];
  77. } catch (e) {
  78. console.error('解析参数失败', e);
  79. }
  80. }
  81. },
  82. methods: {
  83. submit() {
  84. this.show = true
  85. }
  86. }
  87. }
  88. </script>
  89. <style scoped>
  90. .feedback-textare {
  91. height: 200upx;
  92. font-size: 24upx;
  93. line-height: 50upx;
  94. width: 100%;
  95. box-sizing: border-box;
  96. padding: 20upx 20upx 0;
  97. border: #e4e7ed 1rpx solid;
  98. background: #fff;
  99. border-radius: 15rpx;
  100. /* margin-top: 20rpx; */
  101. }
  102. .pay_btns {
  103. width: calc(100% - 60rpx);
  104. margin: 0 auto 40rpx;
  105. text-align: center;
  106. background: #fe6b01;
  107. height: 80rpx;
  108. border-radius: 16rpx;
  109. color: #ffffff;
  110. line-height: 80rpx;
  111. margin-top: 20rpx;
  112. position: fixed;
  113. bottom: 0rpx;
  114. }
  115. .pay_btns1 {
  116. width: calc(100% - 60rpx);
  117. margin: 0rpx auto 40rpx;
  118. text-align: center;
  119. background: #e8fbf6;
  120. height: 80rpx;
  121. border-radius: 16rpx;
  122. line-height: 80rpx;
  123. margin-top: 20rpx;
  124. position: absolute;
  125. top: 20rpx;
  126. left: 30rpx;
  127. }
  128. .pay_btns2 {
  129. width: calc(100% - 60rpx);
  130. margin: 0rpx auto 40rpx;
  131. text-align: center;
  132. background: #fee8d9;
  133. height: 80rpx;
  134. border-radius: 16rpx;
  135. line-height: 80rpx;
  136. margin-top: 20rpx;
  137. position: absolute;
  138. bottom: 0rpx;
  139. left: 30rpx;
  140. }
  141. /deep/ .u-flex {
  142. background: #fff !important;
  143. }
  144. </style>