123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <template>
- <!-- <navBar title="补办ETC卡"></navBar> -->
- <view class="oderPage">
- <u-form :model="form" ref="myForm" :error-type="errorType">
- <view class="from">
- <!-- <u-form-item prop="operation">
- <view class="from_item">
- <text><text style="color: red;">*</text>注销方式:</text>
- <u-radio-group v-model="form.operation">
- <u-radio :customStyle="{marginBottom: '8px'}" activeColor="#2CE242"
- v-for="(item, index) in radiolist1" :key="index" :label="item.name" :name="item.name"
- @change="radioChange">
- {{item.disabled}}
- </u-radio>
- </u-radio-group>
- </view>
- </u-form-item> -->
- <u-form-item prop="applyType">
- <view class="from_item">
- <text><text style="color: red;">*</text>申请类型:</text>
- <view style="display: flex;">
- <picker @change="bindPickerChange" :value="index" :range="columnsOld">
- <view class="uni-input">{{index>=0?columnsOld[index]:"请选择"}}</view>
- </picker>
- <u-icon name="arrow-right" style="margin-left: 10px;display: flex;"
- @click="showPicker"></u-icon>
- <!-- <u-input v-model="applyType" class="input" disabled placeholder="请选择" />
- <u-icon name="arrow-right" style="margin-left: 10px;display: flex;" ></u-icon> -->
- </view>
- </view>
- </u-form-item>
- </view>
- </u-form>
- <button class="submit" @click="submit">下一步</button>
- <!-- 自提网点弹窗 -->
- <view>
- <u-picker mode="selector" v-model="show" :range="columns" range-key="label" @confirm="confirm"></u-picker>
- </view>
- </view>
-
- </template>
-
- <script setup lang="ts">
- import {
- checkStr,
- navTo
- } from "@/utils/utils.ts"
-
- import {
- ref,
- reactive
- } from "vue";
- import {
- orderExchangeApply
- } from "@/utils/network/api.js"
- import {
- request
- } from "@/utils/network/request";
- import {
- stringToJson
- } from "@/utils/network/encryption";
- import {
- getItem,
- StorageKeys
- } from "@/utils/storage";
- import {
- onReady
- } from "@dcloudio/uni-app";
- import {
- onLoad
- } from "@dcloudio/uni-app";
-
- // 表单数据
- const form = reactive({
- orderId: '',
- applyType: '',
- operation: ''
-
- })
- //接受通过该id查询订单详情
- const oldId = ref('')
-
- const applyType = ref('')
- //选择器数据
- const index = ref('-1');
- const columnsOld = ["换货-换卡签"]
- const columns = [
- // {
- // label: '换货-换卡',
- // // 其他属性值
- // id: 'CARD'
- // },
- // {
- // label: '换货-换签',
- // // 其他属性值
- // id: 'OBU'
- // },
- {
- label: '换货-换卡签',
- // 其他属性值
- id: 'ALL'
- },
- // {
- // label: '换卡签-换卡',
- // // 其他属性值
- // id: 'EXCHANGE_CARD'
- // },
- // {
- // label: '换卡签-换签',
- // // 其他属性值
- // id: 'EXCHANGE_OBU'
- // },
- // {
- // label: '换卡签-换卡签',
- // // 其他属性值
- // id: 'EXCHANGE_ALL'
- // },
- ]
- const bindPickerChange = (e) => {
- console.log('picker发送选择改变,携带值为', e.detail.value)
- index.value = e.detail.value
- form.applyType = columns[e.detail.value].id
- applyType.value = columns[e.detail.value].label
- }
- // 验证规则
- const rules = {
-
- }
- // 验证提示类型(toast要版本为1.3.5才支持)
- const errorType = ['message', 'border-bottom', 'toast']
-
- // 设置验证规则
- const myForm = ref(null)
- onReady(() => {
- myForm.value.setRules(rules)
- })
-
- // 单选数据列表
- const radiolist1 = reactive([{
- name: 1,
- disabled: '有卡注销'
- },
- {
- name: 2,
- disabled: '无卡注销'
- },
- ])
-
- let show = ref(false)
-
- // 打开地区先择器
- const showPicker = function () {
- show.value = true
- }
- // 确定地区
- const confirm = (e) => {
- console.log(e, columns[e].id, columns[e].label);
- index.value = e
- form.applyType = columns[e].id
- applyType.value = columns[e].label
- }
-
- // 单选
- const radioChange = (n) => {
- console.log('radioChange', n);
- console.log(form);
- }
-
-
- // 提交
- const submit = () => {
- if (form.applyType) {
- console.log('验证通过', form);
- navTo(`/subpackage/orders/apply-ex-goods?orderId=${oldId.value}`) //测试用
- } else {
- uni.showToast({
- title: "请选择申请类型",
- icon: "none"
- })
- }
- }
-
- onLoad((option) => {
- form.orderId = option.orderId
- oldId.value = option.id
- console.log(form);
- });
- </script>
-
-
- <style>
- page {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- background-color: #F3F3F3;
- }
- </style>
- <style lang="scss" scoped>
- .oderPage {
- flex: 1;
- width: 100%;
-
- .from {
- background-color: #fff;
- margin-top: 20rpx;
-
- ::v-deep .u-form-item {
- padding: 0;
- line-height: normal;
-
- .u-form-item__message {
- margin-bottom: 12rpx
- }
- }
-
- .from_item {
- display: flex;
- flex-wrap: nowrap;
- justify-content: space-between;
- padding: 0 30rpx;
- // border-bottom: #DCDCDC 1px solid;
- align-items: center;
- height: 80rpx;
-
- ::v-deep .input {
- text-align: right;
- flex: 1;
- background: transparent;
-
- input {
- text-align: right;
- }
- }
- }
-
- .from_item1 {
- display: flex;
- flex-wrap: nowrap;
- flex-direction: column;
- justify-content: space-between;
- padding: 30rpx;
- border-bottom: #DCDCDC 1px solid;
-
- input {
- text-align: right;
- }
-
- .textarea {
- background-color: #F1F1F1;
- width: 100%;
- border-radius: 20rpx;
- margin-top: 10rpx;
- text-indent: 1rem;
- height: 180rpx;
- padding: 20rpx;
- box-sizing: border-box;
- }
- }
- }
- }
-
- .submit {
- background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
- width: 670rpx;
- height: 80rpx;
- color: #fff;
- border-radius: 100rpx;
- margin: 26px auto;
- font-size: 32rpx;
- }
- </style>
|