You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

apply-ex-goods-step1.vue 4.6KB

2 年之前
11 月之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
11 月之前
10 月之前
1 年之前
2 年之前
11 月之前
2 年之前
11 月之前
2 年之前
2 年之前
1 年之前
2 年之前
2 年之前
1 年之前
2 年之前
11 月之前
2 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
11 月之前
2 年之前
1 年之前
2 年之前
2 年之前
11 月之前
2 年之前
2 年之前
1 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="oderPage">
  3. <u-form :model="form" :error-type="errorType">
  4. <view class="from">
  5. <u-form-item prop="applyType">
  6. <view class="from_item">
  7. <text><text style="color: red;">*</text>申请类型:</text>
  8. <view style="display: flex;">
  9. <picker @change="bindPickerChange" :value="index" :range="columnsOld">
  10. <view class="uni-input">{{index>=0?columnsOld[index]:"请选择"}}</view>
  11. </picker>
  12. <u-icon name="arrow-right" style="margin-left: 10px;display: flex;"
  13. @click="showPicker"></u-icon>
  14. </view>
  15. </view>
  16. </u-form-item>
  17. </view>
  18. </u-form>
  19. <view class="message">
  20. <view><text class="red">*</text>设备更换需将原设备寄回</view>
  21. <view>寄回信息:</view>
  22. <view>收件人:ETC售后 联系电话:18798751224(此电话仅用于ETC售后收取快递,如需咨询业务请致电4008008787)</view>
  23. <view>寄回地址:{{state.address}}</view>
  24. <view>补换订单审核时效:设备签收后的2个自然日完成审核,审核通过后请关注订单物流单号;</view>
  25. </view>
  26. <button class="submit" @click="submit">下一步</button>
  27. </view>
  28. </template>
  29. <script setup lang="ts">
  30. import {
  31. navTo
  32. } from "@/utils/utils.ts"
  33. import {
  34. ref,
  35. reactive
  36. } from "vue";
  37. import {
  38. onReady
  39. } from "@dcloudio/uni-app";
  40. import {
  41. onLoad
  42. } from "@dcloudio/uni-app";
  43. import {
  44. getMailingAddress
  45. } from "@/subpackage/orders/js/publicRequest";
  46. // 表单数据
  47. const form = reactive({
  48. orderId: '',
  49. applyType: '',
  50. operation: ''
  51. })
  52. const state = reactive({
  53. address: '',
  54. })
  55. //接受通过该id查询订单详情
  56. const oldId = ref('')
  57. const applyType = ref('')
  58. //选择器数据
  59. const index = ref('-1');
  60. const columnsOld = ["换货-换卡签"]
  61. const columns = [
  62. {
  63. label: '换货-换卡签',
  64. // 其他属性值
  65. id: 'ALL'
  66. },
  67. ]
  68. const bindPickerChange = (e) => {
  69. console.log('picker发送选择改变,携带值为', e.detail.value)
  70. index.value = e.detail.value
  71. form.applyType = columns[e.detail.value].id
  72. applyType.value = columns[e.detail.value].label
  73. }
  74. // 验证规则
  75. const rules = {
  76. }
  77. // 验证提示类型(toast要版本为1.3.5才支持)
  78. const errorType = ['message', 'border-bottom', 'toast']
  79. // 设置验证规则
  80. const myForm = ref(null)
  81. onReady(() => {
  82. // myForm.value.setRules(rules)
  83. })
  84. let show = ref(false)
  85. // 打开地区先择器
  86. const showPicker = function () {
  87. show.value = true
  88. }
  89. // 确定地区
  90. const confirm = (e) => {
  91. console.log(e, columns[e].id, columns[e].label);
  92. index.value = e
  93. form.applyType = columns[e].id
  94. applyType.value = columns[e].label
  95. }
  96. // 提交
  97. const submit = () => {
  98. if (form.applyType) {
  99. console.log('验证通过', form);
  100. navTo(`/subpackage/orders/apply-ex-goods?orderId=${oldId.value}&address=${state.address}`) //测试用
  101. } else {
  102. uni.showToast({
  103. title: "请选择申请类型",
  104. icon: "none"
  105. })
  106. }
  107. }
  108. onLoad((option) => {
  109. form.orderId = option.orderId
  110. oldId.value = option.id
  111. console.log(form);
  112. getMailingAddress(option.orderId).then((address) => {
  113. console.log("address",address)
  114. state.address=address
  115. })
  116. });
  117. </script>
  118. <style>
  119. page {
  120. width: 100%;
  121. height: 100%;
  122. display: flex;
  123. flex-direction: column;
  124. background-color: #F3F3F3;
  125. }
  126. </style>
  127. <style lang="scss" scoped>
  128. .oderPage {
  129. flex: 1;
  130. width: 100%;
  131. .from {
  132. background-color: #fff;
  133. margin-top: 20rpx;
  134. ::v-deep .u-form-item {
  135. padding: 0;
  136. line-height: normal;
  137. .u-form-item__message {
  138. margin-bottom: 12rpx
  139. }
  140. }
  141. .from_item {
  142. display: flex;
  143. flex-wrap: nowrap;
  144. justify-content: space-between;
  145. padding: 0 30rpx;
  146. align-items: center;
  147. height: 80rpx;
  148. ::v-deep .input {
  149. text-align: right;
  150. flex: 1;
  151. background: transparent;
  152. input {
  153. text-align: right;
  154. }
  155. }
  156. }
  157. .from_item1 {
  158. display: flex;
  159. flex-wrap: nowrap;
  160. flex-direction: column;
  161. justify-content: space-between;
  162. padding: 30rpx;
  163. border-bottom: #DCDCDC 1px solid;
  164. input {
  165. text-align: right;
  166. }
  167. .textarea {
  168. background-color: #F1F1F1;
  169. width: 100%;
  170. border-radius: 20rpx;
  171. margin-top: 10rpx;
  172. text-indent: 1rem;
  173. height: 180rpx;
  174. padding: 20rpx;
  175. box-sizing: border-box;
  176. }
  177. }
  178. }
  179. }
  180. .submit {
  181. background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
  182. width: 670rpx;
  183. height: 80rpx;
  184. color: #fff;
  185. border-radius: 100rpx;
  186. margin: 26px auto;
  187. font-size: 32rpx;
  188. }
  189. .red {
  190. color: red;
  191. margin-right: 10rpx;
  192. }
  193. .message {
  194. font-size: 30rpx;
  195. margin-top: 30rpx;
  196. padding: 0 20rpx;
  197. }
  198. </style>