Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

apply-ex-goods-step1.vue 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <!-- <navBar title="补办ETC卡"></navBar> -->
  3. <view class="oderPage">
  4. <u-form :model="form" ref="myForm" :error-type="errorType">
  5. <view class="from">
  6. <!-- <u-form-item prop="operation">
  7. <view class="from_item">
  8. <text><text style="color: red;">*</text>注销方式:</text>
  9. <u-radio-group v-model="form.operation">
  10. <u-radio :customStyle="{marginBottom: '8px'}" activeColor="#2CE242"
  11. v-for="(item, index) in radiolist1" :key="index" :label="item.name" :name="item.name"
  12. @change="radioChange">
  13. {{item.disabled}}
  14. </u-radio>
  15. </u-radio-group>
  16. </view>
  17. </u-form-item> -->
  18. <u-form-item prop="applyType">
  19. <view class="from_item">
  20. <text><text style="color: red;">*</text>申请类型:</text>
  21. <view style="display: flex;">
  22. <picker @change="bindPickerChange" :value="index" :range="columnsOld">
  23. <view class="uni-input">{{index>=0?columnsOld[index]:"请选择"}}</view>
  24. </picker>
  25. <u-icon name="arrow-right" style="margin-left: 10px;display: flex;"
  26. @click="showPicker"></u-icon>
  27. <!-- <u-input v-model="applyType" class="input" disabled placeholder="请选择" />
  28. <u-icon name="arrow-right" style="margin-left: 10px;display: flex;" ></u-icon> -->
  29. </view>
  30. </view>
  31. </u-form-item>
  32. </view>
  33. </u-form>
  34. <button class="submit" @click="submit">下一步</button>
  35. <!-- 自提网点弹窗 -->
  36. <view>
  37. <u-picker mode="selector" v-model="show" :range="columns" range-key="label" @confirm="confirm"></u-picker>
  38. </view>
  39. </view>
  40. </template>
  41. <script setup lang="ts">
  42. import {
  43. checkStr,
  44. navTo
  45. } from "@/utils/utils.ts"
  46. import {
  47. ref,
  48. reactive
  49. } from "vue";
  50. import {
  51. orderExchangeApply
  52. } from "@/utils/network/api.js"
  53. import {
  54. request
  55. } from "@/utils/network/request";
  56. import {
  57. stringToJson
  58. } from "@/utils/network/encryption";
  59. import {
  60. getItem,
  61. StorageKeys
  62. } from "@/utils/storage";
  63. import {
  64. onReady
  65. } from "@dcloudio/uni-app";
  66. import {
  67. onLoad
  68. } from "@dcloudio/uni-app";
  69. // 表单数据
  70. const form = reactive({
  71. orderId: '',
  72. applyType: '',
  73. operation: ''
  74. })
  75. //接受通过该id查询订单详情
  76. const oldId = ref('')
  77. const applyType = ref('')
  78. //选择器数据
  79. const index = ref('-1');
  80. const columnsOld = ["换货-换卡签"]
  81. const columns = [
  82. // {
  83. // label: '换货-换卡',
  84. // // 其他属性值
  85. // id: 'CARD'
  86. // },
  87. // {
  88. // label: '换货-换签',
  89. // // 其他属性值
  90. // id: 'OBU'
  91. // },
  92. {
  93. label: '换货-换卡签',
  94. // 其他属性值
  95. id: 'ALL'
  96. },
  97. // {
  98. // label: '换卡签-换卡',
  99. // // 其他属性值
  100. // id: 'EXCHANGE_CARD'
  101. // },
  102. // {
  103. // label: '换卡签-换签',
  104. // // 其他属性值
  105. // id: 'EXCHANGE_OBU'
  106. // },
  107. // {
  108. // label: '换卡签-换卡签',
  109. // // 其他属性值
  110. // id: 'EXCHANGE_ALL'
  111. // },
  112. ]
  113. const bindPickerChange = (e) => {
  114. console.log('picker发送选择改变,携带值为', e.detail.value)
  115. index.value = e.detail.value
  116. form.applyType = columns[e.detail.value].id
  117. applyType.value = columns[e.detail.value].label
  118. }
  119. // 验证规则
  120. const rules = {
  121. }
  122. // 验证提示类型(toast要版本为1.3.5才支持)
  123. const errorType = ['message', 'border-bottom', 'toast']
  124. // 设置验证规则
  125. const myForm = ref(null)
  126. onReady(() => {
  127. myForm.value.setRules(rules)
  128. })
  129. // 单选数据列表
  130. const radiolist1 = reactive([{
  131. name: 1,
  132. disabled: '有卡注销'
  133. },
  134. {
  135. name: 2,
  136. disabled: '无卡注销'
  137. },
  138. ])
  139. let show = ref(false)
  140. // 打开地区先择器
  141. const showPicker = function () {
  142. show.value = true
  143. }
  144. // 确定地区
  145. const confirm = (e) => {
  146. console.log(e, columns[e].id, columns[e].label);
  147. index.value = e
  148. form.applyType = columns[e].id
  149. applyType.value = columns[e].label
  150. }
  151. // 单选
  152. const radioChange = (n) => {
  153. console.log('radioChange', n);
  154. console.log(form);
  155. }
  156. // 提交
  157. const submit = () => {
  158. if (form.applyType) {
  159. console.log('验证通过', form);
  160. navTo(`/subpackage/orders/apply-ex-goods?orderId=${oldId.value}`) //测试用
  161. } else {
  162. uni.showToast({
  163. title: "请选择申请类型",
  164. icon: "none"
  165. })
  166. }
  167. }
  168. onLoad((option) => {
  169. form.orderId = option.orderId
  170. oldId.value = option.id
  171. console.log(form);
  172. });
  173. </script>
  174. <style>
  175. page {
  176. width: 100%;
  177. height: 100%;
  178. display: flex;
  179. flex-direction: column;
  180. background-color: #F3F3F3;
  181. }
  182. </style>
  183. <style lang="scss" scoped>
  184. .oderPage {
  185. flex: 1;
  186. width: 100%;
  187. .from {
  188. background-color: #fff;
  189. margin-top: 20rpx;
  190. ::v-deep .u-form-item {
  191. padding: 0;
  192. line-height: normal;
  193. .u-form-item__message {
  194. margin-bottom: 12rpx
  195. }
  196. }
  197. .from_item {
  198. display: flex;
  199. flex-wrap: nowrap;
  200. justify-content: space-between;
  201. padding: 0 30rpx;
  202. // border-bottom: #DCDCDC 1px solid;
  203. align-items: center;
  204. height: 80rpx;
  205. ::v-deep .input {
  206. text-align: right;
  207. flex: 1;
  208. background: transparent;
  209. input {
  210. text-align: right;
  211. }
  212. }
  213. }
  214. .from_item1 {
  215. display: flex;
  216. flex-wrap: nowrap;
  217. flex-direction: column;
  218. justify-content: space-between;
  219. padding: 30rpx;
  220. border-bottom: #DCDCDC 1px solid;
  221. input {
  222. text-align: right;
  223. }
  224. .textarea {
  225. background-color: #F1F1F1;
  226. width: 100%;
  227. border-radius: 20rpx;
  228. margin-top: 10rpx;
  229. text-indent: 1rem;
  230. height: 180rpx;
  231. padding: 20rpx;
  232. box-sizing: border-box;
  233. }
  234. }
  235. }
  236. }
  237. .submit {
  238. background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
  239. width: 670rpx;
  240. height: 80rpx;
  241. color: #fff;
  242. border-radius: 100rpx;
  243. margin: 26px auto;
  244. font-size: 32rpx;
  245. }
  246. </style>