LostandFoundtext.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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="foundTime" borderBottom ref="item1">
  14. <view class="flex align-center addboxs bg" style="padding: 0 30rpx; justify-content: space-between;" @click="openTime()">
  15. <view class="flex align-center">
  16. <image v-if="globalImages" :src="globalImages + 'imgs/static/upload/time.png'" style="width: 34rpx;height: 34rpx;"></image>
  17. <view class="add_tit margin-left-xs" v-if="!yuyueTime">选择预约时间</view>
  18. <view class="add_tit margin-left-xs" v-else>{{yuyueTime}}</view>
  19. </view>
  20. <view class="margin-left-xs">
  21. <image v-if="globalImages" :src="globalImages + 'imgs/static/image/right.png'" style="width: 12rpx;height: 20rpx;">
  22. </image>
  23. </view>
  24. </view>
  25. </u-form-item>
  26. <u-form-item label="其他信息" prop="description" borderBottom>
  27. <textarea placeholder="简要描述物品其他信息" v-model="model1.description"
  28. class="feedback-textare" />
  29. </u-form-item>
  30. </u-form>
  31. <u-picker v-model="Timeshow" mode="time" :params="params"
  32. @confirm="timeConfirm"></u-picker>
  33. <view class="">
  34. <view class="flex" style="justify-content: space-between;">
  35. <view>物品照片</view>
  36. <view>请上传丢失的物品照片</view>
  37. </view>
  38. <u-upload
  39. :action="uploadAction"
  40. :file-list="fileList"
  41. @on-success="handleUploadSuccess"
  42. @on-error="handleUploadError"
  43. :max-count="3"
  44. :multiple="false"
  45. ></u-upload>
  46. </view>
  47. <view class="pay_btns" @click="submit">联系平台</view>
  48. <u-popup v-model="show" mode="bottom" length="260rpx">
  49. <view class="pay_btns1">
  50. <image v-if="globalImages" :src="globalImages + 'images/my/chat2.png'" style="width: 26rpx;height: 26rpx; margin-right: 10rpx;" mode=""></image>
  51. 在线客服
  52. </view>
  53. <view class="pay_btns2">
  54. <image v-if="globalImages" :src="globalImages + 'images/my/phone2.png'" style="width: 26rpx;height: 26rpx; margin-right: 10rpx;" mode=""></image>
  55. 热线电话
  56. </view>
  57. </u-popup>
  58. </view>
  59. </template>
  60. <script>
  61. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  62. export default {
  63. data() {
  64. return {
  65. model1: {
  66. name: '',
  67. ordersId: '',
  68. phone: '',
  69. description: '',
  70. image: '',
  71. loss: 1,
  72. },
  73. action: 'http://www.example.com/upload',
  74. fileList: [],
  75. // 上传组件配置
  76. uploadAction: 'http://192.168.50.122:8179/sqx_fast/alioss/upload', // 上传接口地址
  77. fileList: [], // 已上传的文件列表
  78. show: false,
  79. globalImages: '',
  80. Timeshow: false,
  81. params: {
  82. year: true,
  83. month: true,
  84. day: true,
  85. hour: true,
  86. minute: true,
  87. second: false
  88. },
  89. yuyueTime: '',
  90. }
  91. },
  92. onLoad(options) {
  93. waitForGlobalImages().then((path) => {
  94. console.log('✅ 全局图片路径:', path)
  95. this.globalImages = path
  96. })
  97. if (options.data) {
  98. try {
  99. const item = JSON.parse(decodeURIComponent(options.data));
  100. this.model1 = { ...item }; // 填充表单数据
  101. this.yuyueTime = item.foundTime
  102. this.fileList = item.image ? [{ url: item.image, status: 'success', name: 'image' }] : [];
  103. } catch (e) {
  104. console.error('解析参数失败', e);
  105. }
  106. }
  107. },
  108. methods: {
  109. submit() {
  110. this.show = true
  111. },
  112. timeConfirm(e) {
  113. console.log(e, e.year);
  114. this.yuyueTime = e.year + '/' + e.month + '/' + e.day + '/' + '' + e.hour + ':' + e.minute
  115. },
  116. openTime() {
  117. this.Timeshow = true
  118. console.log('123123123');
  119. }
  120. }
  121. }
  122. </script>
  123. <style scoped>
  124. .feedback-textare {
  125. height: 200upx;
  126. font-size: 24upx;
  127. line-height: 50upx;
  128. width: 100%;
  129. box-sizing: border-box;
  130. padding: 20upx 20upx 0;
  131. border: #e4e7ed 1rpx solid;
  132. background: #fff;
  133. border-radius: 15rpx;
  134. /* margin-top: 20rpx; */
  135. }
  136. .pay_btns {
  137. width: calc(100% - 60rpx);
  138. margin: 0 auto 40rpx;
  139. text-align: center;
  140. background: #00c18a;
  141. height: 80rpx;
  142. border-radius: 16rpx;
  143. color: #ffffff;
  144. line-height: 80rpx;
  145. margin-top: 20rpx;
  146. position: fixed;
  147. bottom: 0rpx;
  148. }
  149. .pay_btns1 {
  150. width: calc(100% - 60rpx);
  151. margin: 0rpx auto 40rpx;
  152. text-align: center;
  153. background: #e8fbf6;
  154. height: 80rpx;
  155. border-radius: 16rpx;
  156. line-height: 80rpx;
  157. margin-top: 20rpx;
  158. position: absolute;
  159. top: 20rpx;
  160. left: 30rpx;
  161. }
  162. .pay_btns2 {
  163. width: calc(100% - 60rpx);
  164. margin: 0rpx auto 40rpx;
  165. text-align: center;
  166. background: #fee8d9;
  167. height: 80rpx;
  168. border-radius: 16rpx;
  169. line-height: 80rpx;
  170. margin-top: 20rpx;
  171. position: absolute;
  172. bottom: 0rpx;
  173. left: 30rpx;
  174. }
  175. /deep/ .u-flex {
  176. background: #fff !important;
  177. }
  178. </style>