選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

apply-ex-goods-step1.vue 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. <!-- 自提网点弹窗 -->
  28. <view>
  29. <u-picker mode="selector" v-model="show" :range="columns" range-key="label" @confirm="confirm"></u-picker>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup lang="ts">
  34. import {
  35. navTo
  36. } from "@/utils/utils.ts"
  37. import {
  38. ref,
  39. reactive
  40. } from "vue";
  41. import {
  42. onReady
  43. } from "@dcloudio/uni-app";
  44. import {
  45. onLoad
  46. } from "@dcloudio/uni-app";
  47. import {
  48. getMailingAddress
  49. } from "@/subpackage/orders/js/publicRequest";
  50. // 表单数据
  51. const form = reactive({
  52. orderId: '',
  53. applyType: '',
  54. operation: ''
  55. })
  56. const state = reactive({
  57. address: '',
  58. })
  59. //接受通过该id查询订单详情
  60. const oldId = ref('')
  61. const applyType = ref('')
  62. //选择器数据
  63. const index = ref('-1');
  64. const columnsOld = ["换货-换卡签"]
  65. const columns = [
  66. {
  67. label: '换货-换卡签',
  68. // 其他属性值
  69. id: 'ALL'
  70. },
  71. ]
  72. const bindPickerChange = (e) => {
  73. console.log('picker发送选择改变,携带值为', e.detail.value)
  74. index.value = e.detail.value
  75. form.applyType = columns[e.detail.value].id
  76. applyType.value = columns[e.detail.value].label
  77. }
  78. // 验证规则
  79. const rules = {
  80. }
  81. // 验证提示类型(toast要版本为1.3.5才支持)
  82. const errorType = ['message', 'border-bottom', 'toast']
  83. // 设置验证规则
  84. const myForm = ref(null)
  85. onReady(() => {
  86. // myForm.value.setRules(rules)
  87. })
  88. let show = ref(false)
  89. // 打开地区先择器
  90. const showPicker = function () {
  91. show.value = true
  92. }
  93. // 确定地区
  94. const confirm = (e) => {
  95. console.log(e, columns[e].id, columns[e].label);
  96. index.value = e
  97. form.applyType = columns[e].id
  98. applyType.value = columns[e].label
  99. }
  100. // 单选
  101. const radioChange = (n) => {
  102. console.log('radioChange', n);
  103. console.log(form);
  104. }
  105. // 提交
  106. const submit = () => {
  107. if (form.applyType) {
  108. console.log('验证通过', form);
  109. navTo(`/subpackage/orders/apply-ex-goods?orderId=${oldId.value}&address=${state.address}`) //测试用
  110. } else {
  111. uni.showToast({
  112. title: "请选择申请类型",
  113. icon: "none"
  114. })
  115. }
  116. }
  117. onLoad((option) => {
  118. form.orderId = option.orderId
  119. oldId.value = option.id
  120. console.log(form);
  121. getMailingAddress(option.orderId).then((address) => {
  122. console.log("address",address)
  123. state.address=address
  124. })
  125. });
  126. </script>
  127. <style>
  128. page {
  129. width: 100%;
  130. height: 100%;
  131. display: flex;
  132. flex-direction: column;
  133. background-color: #F3F3F3;
  134. }
  135. </style>
  136. <style lang="scss" scoped>
  137. .oderPage {
  138. flex: 1;
  139. width: 100%;
  140. .from {
  141. background-color: #fff;
  142. margin-top: 20rpx;
  143. ::v-deep .u-form-item {
  144. padding: 0;
  145. line-height: normal;
  146. .u-form-item__message {
  147. margin-bottom: 12rpx
  148. }
  149. }
  150. .from_item {
  151. display: flex;
  152. flex-wrap: nowrap;
  153. justify-content: space-between;
  154. padding: 0 30rpx;
  155. align-items: center;
  156. height: 80rpx;
  157. ::v-deep .input {
  158. text-align: right;
  159. flex: 1;
  160. background: transparent;
  161. input {
  162. text-align: right;
  163. }
  164. }
  165. }
  166. .from_item1 {
  167. display: flex;
  168. flex-wrap: nowrap;
  169. flex-direction: column;
  170. justify-content: space-between;
  171. padding: 30rpx;
  172. border-bottom: #DCDCDC 1px solid;
  173. input {
  174. text-align: right;
  175. }
  176. .textarea {
  177. background-color: #F1F1F1;
  178. width: 100%;
  179. border-radius: 20rpx;
  180. margin-top: 10rpx;
  181. text-indent: 1rem;
  182. height: 180rpx;
  183. padding: 20rpx;
  184. box-sizing: border-box;
  185. }
  186. }
  187. }
  188. }
  189. .submit {
  190. background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
  191. width: 670rpx;
  192. height: 80rpx;
  193. color: #fff;
  194. border-radius: 100rpx;
  195. margin: 26px auto;
  196. font-size: 32rpx;
  197. }
  198. .red {
  199. color: red;
  200. margin-right: 10rpx;
  201. }
  202. .message {
  203. font-size: 30rpx;
  204. margin-top: 30rpx;
  205. padding: 0 20rpx;
  206. }
  207. </style>