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

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