LostandFoundtext.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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" @click="bindPhone(12312312312)">
  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. bindPhone(list) {
  87. if (list) {
  88. console.log(list, 'listlistlist');
  89. uni.makePhoneCall({
  90. phoneNumber: '114' //仅为示例
  91. });
  92. } else {
  93. this.$queue.showToast('手机号获取失败!');
  94. }
  95. }
  96. }
  97. }
  98. </script>
  99. <style scoped>
  100. .feedback-textare {
  101. height: 200upx;
  102. font-size: 24upx;
  103. line-height: 50upx;
  104. width: 100%;
  105. box-sizing: border-box;
  106. padding: 20upx 20upx 0;
  107. border: #e4e7ed 1rpx solid;
  108. background: #fff;
  109. border-radius: 15rpx;
  110. /* margin-top: 20rpx; */
  111. }
  112. .pay_btns {
  113. width: calc(100% - 60rpx);
  114. margin: 0 auto 40rpx;
  115. text-align: center;
  116. background: #fe6b01;
  117. height: 80rpx;
  118. border-radius: 16rpx;
  119. color: #ffffff;
  120. line-height: 80rpx;
  121. margin-top: 20rpx;
  122. position: fixed;
  123. bottom: 0rpx;
  124. }
  125. .pay_btns1 {
  126. width: calc(100% - 60rpx);
  127. margin: 0rpx auto 40rpx;
  128. text-align: center;
  129. background: #e8fbf6;
  130. height: 80rpx;
  131. border-radius: 16rpx;
  132. line-height: 80rpx;
  133. margin-top: 20rpx;
  134. position: absolute;
  135. top: 20rpx;
  136. left: 30rpx;
  137. }
  138. .pay_btns2 {
  139. width: calc(100% - 60rpx);
  140. margin: 0rpx auto 40rpx;
  141. text-align: center;
  142. background: #fee8d9;
  143. height: 80rpx;
  144. border-radius: 16rpx;
  145. line-height: 80rpx;
  146. margin-top: 20rpx;
  147. position: absolute;
  148. bottom: 0rpx;
  149. left: 30rpx;
  150. }
  151. /deep/ .u-flex {
  152. background: #fff !important;
  153. }
  154. </style>