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

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