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.

refund-information-edit.vue 6.4KB

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