123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <template>
- <view class="oderPage">
- <view class="from">
- <view>
- <view class="from_item">
- <text>开户人姓名:</text>
- <input type="text" name="" id="" placeholder="请输入开户人姓名" v-model="state.cusName">
- </view>
- <view class="from_item">
- <text>开户行:</text>
- <picker @change="bindPickerChange" :value="state.index" :range="bankData">
- <view class="uni-input">{{state.index==-1?"请选择":bankData[state.index]}}</view>
- </picker>
- </view>
- <view class="from_item">
- <text>开户行支行:</text>
- <input placeholder="开户行支行" v-model="state.branchName">
- </view>
- <view class="from_item">
- <text>银行卡号:</text>
- <input type="number" placeholder="请输入银行卡号" v-model="state.bankCardId" maxlength="18">
- </view>
- <view class="from_item">
- <text>开户行地址:</text>
- <!-- <input v-model="state.addressShow" v-if="state.addressShow" /> -->
- <picker mode="region" @change="choiceAddress">
- <view>{{state.addressShow}}</view>
- </picker>
- </view>
- </view>
-
- </view>
- <view class="button-wrap">
- <button class="submit" @click="del()">删除</button>
- <button class="submit" @click="sure()">保存</button>
- </view>
- </view>
- </template>
-
- <script setup lang="ts">
- import { ref, reactive } from "vue";
- import { checkStr, msg } from "@/utils/utils";
- import { navTo } from "@/utils/utils";
- import { CancellationRefundInforEdit, CancellationRefundInforDel } from "@/utils/network/api.js";
- import { bankData } from "@/datas/bank.js";
- import { onLoad } from "@dcloudio/uni-app";
- import { request } from "@/utils/network/request.js";
- import { stringToJson } from "@/utils/network/encryption";
- import {
- getItem
- } from "@/utils/storage";
- const state = reactive({
- phone: "",
- bank: "",
- address: [], //地址
- addressShow: "请选择开户行地址", //展示的地址
- branchName: "", //开户行支行
- index: -1,
- bankCardId: "", //银行卡号
- cusName: "",
- customerIdNum: "",
- cusTel: "",
- cusType: "",
- bankDataName: "",//开户行名
- signId: ""
- });
-
- /*视图进入后操作*/
- onLoad((option) => {
- console.log("option", option)
- state.cusTel = option.mobile
- state.customerIdNum = option.customerIdnum
- state.cusType = option.userType
- let data = JSON.parse(decodeURIComponent(option.params))
- state.cusName = data.cusName
- state.signId = data.id
- state.bankCardId = data.bankCardId
- state.branchName = data.branchName
- state.addressShow = data.province + "-" + data.sell
- state.address.push(data.province)
- state.address.push(data.sell)
- state.index = data.bankType + 1
- console.log("data", data)
- });
-
- const sure = () => {
- if (!state.cusName) {
- msg("请输入开户人姓名");
- return;
- }
- console.log("state.index ", state.index)
- if (state.index == -1) {
- msg("请选择开户行!");
- return;
- }
- if (!state.branchName) {
- msg("请输入开户行支行!");
- return;
- }
- if (!state.bankCardId) {
- msg("请输入银行卡号!");
- return;
- }
- if (state.addressShow == "请选择开户行地址") {
- msg("请选择开户行地址!");
- return;
- }
- var data = {
- customerIdNum: state.customerIdNum, //身份证号
- bankType: Number(state.index) + 1, //开户行
- province: state.address[0], //开户行所在的省
- sell: state.address[1], //开户行所在的市
- cusName: state.cusName, //开户人名称
- bankCardId: state.bankCardId, //银行卡号
- cusTel: state.cusTel, //联系方式
- operateType: 1, //退款方式 1:银行卡 2现金
- branchName: state.branchName, //开户行支行名称
- cusType: state.cusType,//用户类型
- signId: state.signId
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
- console.log("options", options)
- request(CancellationRefundInforEdit, options).then((res) => {
-
- const data = stringToJson(res.bizContent);
- console.log("data", data)
- uni.navigateBack({
- delta: 1
- })
- });
-
- }
- const del = () => {
- var data = {
- signId: state.signId
- };
- const options = {
- type: 2,
- data: data,
- method: "POST",
- showLoading: true,
- };
- console.log("options", options)
- request(CancellationRefundInforDel, options).then((res) => {
-
- const data = stringToJson(res.bizContent);
- console.log("data", data)
- uni.navigateBack({
- delta: 1
- })
- });
- }
- function choiceAddress(e) {
- console.log("e", e.detail.value)
- state.address = e.detail.value;
- state.addressShow = state.address[0] + "-" + state.address[1] + "-" + state.address[2]
- }
-
- function bindPickerChange(e) {
- state.index = e.detail.value
- }
- </script>
-
-
- <style>
- page {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- background-color: #EEF7F7;
- }
- </style>
- <style lang="scss" scoped>
- ::v-deep .u-icon__icon {
- top: -4px !important;
- }
-
- .oderPage {
- flex: 1;
- width: 100%;
-
- .content {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 750rpx;
- background-color: #fff;
- margin-bottom: 30rpx;
- padding: 75rpx 0;
-
- .title {
- font-size: 28rpx;
- font-family: Microsoft YaHei UI;
- font-weight: 400;
- color: #717171;
- margin-bottom: 40rpx;
- }
-
- view {
- font-size: 40rpx;
- font-family: Microsoft YaHei UI;
- font-weight: 400;
- color: #2A2A2A;
- font-weight: bold;
- }
- }
-
- .from {
- background-color: #fff;
- padding: 0 30rpx;
-
- .from_item {
- display: flex;
- flex-wrap: nowrap;
- justify-content: space-between;
- padding: 20rpx 0;
- border-bottom: #DCDCDC 1px solid;
- align-items: center;
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
-
- input {
- text-align: right;
- }
- }
- }
- }
-
- .submit {
- background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
- width: 200rpx;
- height: 80rpx;
- line-height: 80rpx;
- font-size: 32rpx;
- color: #fff;
- border-radius: 100rpx;
- z-index: 999;
- margin: 30rpx auto;
- }
-
- ::v-deep .u-form-item--right__content__slot {
- display: flex;
- justify-content: space-between;
-
- .btn {
- flex: 1;
- background: transparent;
- font-size: 30rpx;
- color: #15E5C1;
- z-index: 999;
-
- }
- }
-
- .agreen {
- color: rgb(25, 190, 197);
- }
-
- ::v-deep .code>view {
- text-align: right !important;
- }
-
- ::v-deep .code {
- width: 100% !important;
- }
-
- .button-wrap {
- display: flex;
- justify-content: space-evenly;
- margin-top: 100rpx;
- }
- </style>
|