Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

refund-information-add.vue 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="oderPage">
  3. <view class="from">
  4. <view>
  5. <view class="from_item">
  6. <text>开户人姓名:</text>
  7. <input type="text" name="" id="" placeholder="请输入开户人姓名" v-model="state.cusName">
  8. </view>
  9. <view class="from_item">
  10. <text>开户行:</text>
  11. <picker @change="bindPickerChange" :value="state.index" :range="bankData">
  12. <view class="uni-input">{{state.index==-1?"请选择":bankData[state.index]}}</view>
  13. </picker>
  14. </view>
  15. <view class="from_item">
  16. <text>开户行支行:</text>
  17. <input placeholder="开户行支行" v-model="state.branchName">
  18. </view>
  19. <view class="from_item">
  20. <text>银行卡号:</text>
  21. <input type="number" placeholder="请输入银行卡号" v-model="state.bankCardId" maxlength="18">
  22. </view>
  23. <view class="from_item">
  24. <text>开户行地址:</text>
  25. <picker mode="region" @change="choiceAddress">
  26. <view>{{state.addressShow}}</view>
  27. </picker>
  28. </view>
  29. </view>
  30. </view>
  31. <button class="submit" @click="sure()">确认</button>
  32. </view>
  33. </template>
  34. <script setup lang="ts">
  35. import { ref, reactive } from "vue";
  36. import { checkStr, msg } from "@/utils/utils";
  37. import { navTo } from "@/utils/utils";
  38. import { CancellationRefundInforAdd } from "@/utils/network/api.js";
  39. import { bankData } from "@/datas/bank.js";
  40. import { onLoad } from "@dcloudio/uni-app";
  41. import { request } from "@/utils/network/request.js";
  42. import { stringToJson } from "@/utils/network/encryption";
  43. import {
  44. getItem
  45. } from "@/utils/storage";
  46. const state = reactive({
  47. phone: "",
  48. bank: "",
  49. address: "", //地址
  50. addressShow: "请选择开户行地址", //展示的地址
  51. branchName: "", //开户行支行
  52. index: -1,
  53. bankCardId: "", //银行卡号
  54. cusName: "",
  55. customerIdNum: "",
  56. cusTel: "",
  57. cusType: ""
  58. });
  59. /*视图进入后操作*/
  60. onLoad((option) => {
  61. console.log("option", option)
  62. state.cusTel = option.mobile
  63. state.customerIdNum = option.customerIdnum
  64. state.cusType = option.userType
  65. });
  66. const sure = () => {
  67. if (!state.cusName) {
  68. msg("请输入开户人姓名");
  69. return;
  70. }
  71. console.log("state.index ", state.index)
  72. if (state.index == -1) {
  73. msg("请选择开户行!");
  74. return;
  75. }
  76. if (!state.branchName) {
  77. msg("请输入开户行支行!");
  78. return;
  79. }
  80. if (!state.bankCardId) {
  81. msg("请输入银行卡号!");
  82. return;
  83. }
  84. if (state.addressShow == "请选择开户行地址") {
  85. msg("请选择开户行地址!");
  86. return;
  87. }
  88. var data = {
  89. customerIdNum: state.customerIdNum, //身份证号
  90. bankType: Number(state.index) + 1, //开户行
  91. province: state.address[0], //开户行所在的省
  92. sell: state.address[1], //开户行所在的市
  93. cusName: state.cusName, //开户人名称
  94. bankCardId: state.bankCardId, //银行卡号
  95. cusTel: state.cusTel, //联系方式
  96. operateType: 1, //退款方式 1:银行卡 2现金
  97. branchName: state.branchName, //开户行支行名称
  98. cusType: state.cusType,//用户类型
  99. };
  100. const options = {
  101. type: 2,
  102. data: data,
  103. method: "POST",
  104. showLoading: true,
  105. };
  106. console.log("options", options)
  107. request(CancellationRefundInforAdd, options).then((res) => {
  108. const data = stringToJson(res.bizContent);
  109. console.log("data", data)
  110. uni.navigateBack({
  111. delta: 1
  112. })
  113. });
  114. }
  115. function choiceAddress(e) {
  116. console.log("e", e.detail.value)
  117. state.address = e.detail.value;
  118. state.addressShow = state.address[0] + "-" + state.address[1] + "-" + state.address[2]
  119. }
  120. function bindPickerChange(e) {
  121. state.index = e.detail.value
  122. }
  123. </script>
  124. <style>
  125. page {
  126. width: 100%;
  127. height: 100%;
  128. display: flex;
  129. flex-direction: column;
  130. background-color: #EEF7F7;
  131. }
  132. </style>
  133. <style lang="scss" scoped>
  134. ::v-deep .u-icon__icon {
  135. top: -4px !important;
  136. }
  137. .oderPage {
  138. flex: 1;
  139. width: 100%;
  140. .content {
  141. display: flex;
  142. flex-direction: column;
  143. align-items: center;
  144. width: 750rpx;
  145. background-color: #fff;
  146. margin-bottom: 30rpx;
  147. padding: 75rpx 0;
  148. .title {
  149. font-size: 28rpx;
  150. font-family: Microsoft YaHei UI;
  151. font-weight: 400;
  152. color: #717171;
  153. margin-bottom: 40rpx;
  154. }
  155. view {
  156. font-size: 40rpx;
  157. font-family: Microsoft YaHei UI;
  158. font-weight: 400;
  159. color: #2A2A2A;
  160. font-weight: bold;
  161. }
  162. }
  163. .from {
  164. background-color: #fff;
  165. padding: 0 30rpx;
  166. .from_item {
  167. display: flex;
  168. flex-wrap: nowrap;
  169. justify-content: space-between;
  170. padding: 20rpx 0;
  171. border-bottom: #DCDCDC 1px solid;
  172. align-items: center;
  173. font-size: 28rpx;
  174. font-family: Microsoft YaHei;
  175. font-weight: 400;
  176. color: #666666;
  177. input {
  178. text-align: right;
  179. }
  180. }
  181. }
  182. }
  183. .submit {
  184. background: linear-gradient(to left, #43A1E0 0%, #13E7C1 100%);
  185. width: 670rpx;
  186. height: 80rpx;
  187. line-height: 80rpx;
  188. font-size: 32rpx;
  189. color: #fff;
  190. border-radius: 100rpx;
  191. z-index: 999;
  192. // position: fixed;
  193. // bottom: 60rpx;
  194. // left: 50%;
  195. // transform: translate(-50%);
  196. margin: 30rpx auto;
  197. }
  198. ::v-deep .u-form-item--right__content__slot {
  199. display: flex;
  200. justify-content: space-between;
  201. .btn {
  202. flex: 1;
  203. background: transparent;
  204. font-size: 30rpx;
  205. color: #15E5C1;
  206. z-index: 999;
  207. }
  208. }
  209. .agreen {
  210. color: rgb(25, 190, 197);
  211. }
  212. ::v-deep .code>view {
  213. text-align: right !important;
  214. }
  215. ::v-deep .code {
  216. width: 100% !important;
  217. }
  218. </style>