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.7KB

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