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

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