replacement.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="page">
  3. <view class="address p-3 mb-4" @click="stopMap">
  4. <view class="title">
  5. <u-icon name="map" color="#2c2a35" size="38"></u-icon>
  6. <text>救援位置</text>
  7. </view>
  8. <view class="dis j-s a-start mt-2">
  9. <text style="width: 80%;color: #000;">{{dataInfo.rescuePosition}}</text>
  10. <u-icon name="arrow-right" color="#b0afb7" size="30" style="margin-top: 5px;"></u-icon>
  11. </view>
  12. </view>
  13. <view class="address p-3 mb-4">
  14. <text class="title">填写详细信息</text>
  15. <view class="mt-2 dis j-s a-c">
  16. <text style="width: 35%;">车牌号</text>
  17. <u-input style="width: 40%;" v-model="dataInfo.licencePlate" type="text" placeholder="请输入车牌号" />
  18. <u-icon name="arrow-right" color="#b0afb7" size="30"></u-icon>
  19. </view>
  20. <view class="mt-2 dis j-s a-c">
  21. <text style="width: 35%;">救援联系人</text>
  22. <u-input style="width: 40%;" v-model="dataInfo.rescueUser" type="text" placeholder="请输入联系人姓名" />
  23. </view>
  24. <view class="mt-2 dis j-s a-c">
  25. <text style="width: 35%;">联系人手机号</text>
  26. <u-input style="width: 40%;" v-model="dataInfo.phoneNumber" type="text" placeholder="请输入联系人手机号" />
  27. </view>
  28. </view>
  29. <view class="footerFixed dis j-s a-end">
  30. <view class="price">
  31. <text>¥</text>
  32. <text>{{dataInfo.rescueSum}}</text>
  33. <text>.00</text>
  34. </view>
  35. <view class="order dis a-c j-c" @click="plaorder">
  36. <text>立即购买</text>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. dataInfo: {
  46. rescuePosition: "", //救援地址
  47. rescueSum: "168", //救援金额
  48. licencePlate: "", //车牌号
  49. rescueUser: "", //联系人
  50. phoneNumber: "", //电话
  51. serveCode: "203",
  52. }
  53. }
  54. },
  55. onShow() {
  56. },
  57. onLoad() {
  58. this.getCurrentLocation();
  59. },
  60. methods: {
  61. getCurrentLocation() {
  62. //获取当前的地理位置
  63. let vthis = this;
  64. uni.getLocation({
  65. type: 'gcj02',
  66. geocode: true,
  67. success: function(res) {
  68. let address = res.address.province + res.address.city + res.address.district + res
  69. .address.street + res.address.poiName;
  70. vthis.dataInfo.rescuePosition = address;
  71. }
  72. });
  73. },
  74. stopMap() {
  75. uni.navigateTo({
  76. url: "/pages/roadRescue/map"
  77. })
  78. },
  79. async plaorder() {
  80. let res = await this.$http.post('/ser/rescue/insert/rescueOrder', this.dataInfo);
  81. if (res.code == '200') {
  82. uni.showToast({
  83. title: '下单成功',
  84. duration: 2000,
  85. icon: "success"
  86. });
  87. }
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .page {
  94. height: 100%;
  95. background-color: #f5f6f8;
  96. padding: 20px;
  97. }
  98. .address {
  99. background-color: white;
  100. .title {
  101. font-size: 18px;
  102. font-weight: bold;
  103. text {
  104. margin-left: 8px;
  105. }
  106. }
  107. }
  108. .footerFixed {
  109. position: fixed;
  110. bottom: 0;
  111. left: 0;
  112. right: 0;
  113. width: 100%;
  114. height: 60px;
  115. background-color: white;
  116. padding-left: 20px;
  117. view:first-child {
  118. width: 65%;
  119. }
  120. .price {
  121. color: #3267eb;
  122. font-weight: bold;
  123. font-size: 18px;
  124. }
  125. text:nth-child(2) {
  126. font-size: 34px;
  127. line-height: 1.2;
  128. }
  129. .order {
  130. width: 35%;
  131. height: 100%;
  132. background-color: #3267eb;
  133. color: #f5f6f8;
  134. font-size: 18px;
  135. }
  136. }
  137. </style>