transfer.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="container">
  3. <view class="goback-box" @click="toBack">
  4. <image class="goback" src="../../static/img/fanhui.png" mode=""></image>
  5. </view>
  6. <view class="header">转账</view>
  7. <view class="list-box">
  8. <view class="img">
  9. <image src="../../static/img/zhuanzhang-bg.png" mode=""></image>
  10. </view>
  11. <view class="list flex">
  12. <view class="flex_item list-item">
  13. <image :src="logo"></image>
  14. <view>{{ name }}</view>
  15. </view>
  16. <view class="flex_item list-tpl">
  17. <view class="content" @click="useOutClickSide"><selectss ref="easySelect" :options="moneyTypeList" :value="name" @selectOne="selectOne"></selectss></view>
  18. <image src="../../static/img/jiantou.png"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="from-box">
  23. <view class="from-title">对方账号</view>
  24. <input class="input-box" type="text" v-model="account" placeholder="请输入对方账号" />
  25. <view class="from-title">对方UID</view>
  26. <input class="input-box" type="text" v-model="UUID" placeholder="请输入对方UID" />
  27. <view class="from-title">交易密码</view>
  28. <input class="input-box" type="password" v-model="password" placeholder="请输入交易密码" />
  29. <view class="from-title">转账数量</view>
  30. <view class="flex input-tpl">
  31. <input class="input-box" type="number" v-model="num" placeholder="请输入数量" />
  32. <view class="all" @click="num = money">全部</view>
  33. </view>
  34. <view class="all-num">
  35. 可用
  36. <text>{{ money * 1 }}</text>
  37. {{ name }}
  38. </view>
  39. <view class="submit" @click="transfer">确定</view>
  40. <!-- <view class="tpl-box">转账数量10.0个起,手续费:0.0001FIL。</view> -->
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import { goPay, trade } from '@/api/finance.js';
  46. import selectss from '@/components/select.vue';
  47. export default {
  48. components: {
  49. selectss
  50. },
  51. data() {
  52. return {
  53. moneyTypeList: [],
  54. logo: '',
  55. name: '',
  56. code: '',
  57. money: '',
  58. account: '',
  59. UUID: '',
  60. num: '',
  61. password: ''
  62. };
  63. },
  64. onLoad(option) {
  65. if (option.name) {
  66. this.name = option.name;
  67. this.logo = option.logo;
  68. this.code = option.code;
  69. }
  70. this.moneyType();
  71. },
  72. onShow() {},
  73. methods: {
  74. // 所有币种
  75. async moneyType() {
  76. let obj = this;
  77. trade({}).then(({ data }) => {
  78. obj.moneyTypeList = data;
  79. if (obj.logo == '') {
  80. obj.logo = obj.moneyTypeList[0].LOGO;
  81. obj.name = obj.moneyTypeList[0].name;
  82. obj.code = obj.moneyTypeList[0].code;
  83. obj.money = obj.moneyTypeList[0].wallet.money;
  84. }
  85. });
  86. },
  87. transfer() {
  88. let obj = this;
  89. if (obj.code == '') {
  90. obj.$api.msg('请选择币种!');
  91. return;
  92. }
  93. if (obj.account == '') {
  94. obj.$api.msg('请输入对方账号!');
  95. return;
  96. }
  97. if (obj.UUID == '') {
  98. obj.$api.msg('请输入对方UUID!');
  99. return;
  100. }
  101. if (obj.password == '') {
  102. obj.$api.msg('请输入交易密码!');
  103. return;
  104. }
  105. if (obj.num == '') {
  106. obj.$api.msg('请输入转账数量!');
  107. return;
  108. }
  109. goPay({
  110. type: obj.code,
  111. num: obj.num,
  112. to_uid: obj.UUID,
  113. trade_psw: obj.password,
  114. to_user_account: obj.account
  115. }).then(data => {
  116. obj.num = '';
  117. obj.UUID = '';
  118. obj.password = '';
  119. obj.account = '';
  120. obj.$api.msg(data.msg);
  121. });
  122. },
  123. selectOne(options) {
  124. this.logo = options.LOGO;
  125. this.name = options.name;
  126. this.code = options.code;
  127. this.money = options.wallet.money;
  128. },
  129. useOutClickSide() {
  130. this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions();
  131. },
  132. toBack(){
  133. uni.navigateBack({
  134. delta: 1
  135. });
  136. }
  137. }
  138. };
  139. </script>
  140. <style lang="scss">
  141. page {
  142. min-height: 100%;
  143. background-color: #ffffff;
  144. .container {
  145. width: 100%;
  146. }
  147. }
  148. .list-box {
  149. padding: 104rpx 30rpx 60rpx;
  150. height: 350rpx;
  151. .img {
  152. position: absolute;
  153. top: 0;
  154. left: 0;
  155. right: 0;
  156. width: 100%;
  157. height: 440rpx;
  158. image {
  159. width: 100%;
  160. height: 100%;
  161. }
  162. }
  163. .list {
  164. position: relative;
  165. z-index: 10;
  166. background-color: #ffffff;
  167. border-radius: 15rpx;
  168. padding: 15rpx 23rpx;
  169. .list-item {
  170. font-size: 30rpx;
  171. font-weight: bold;
  172. color: #333333;
  173. image {
  174. width: 43rpx;
  175. height: 43rpx;
  176. margin-right: 15rpx;
  177. }
  178. }
  179. .list-tpl {
  180. image {
  181. width: 15rpx;
  182. height: 25rpx;
  183. margin-left: 20rpx;
  184. }
  185. }
  186. }
  187. }
  188. .from-box {
  189. margin: 74rpx 30rpx;
  190. padding: 44rpx 25rpx;
  191. background-color: #ffffff;
  192. border-radius: 15rpx;
  193. position: relative;
  194. top: -180rpx;
  195. .from-title {
  196. font-size: 24rpx;
  197. font-weight: bold;
  198. color: #333333;
  199. }
  200. .input-box {
  201. font-size: 26rpx;
  202. font-weight: 500;
  203. color: #666666;
  204. margin: 35rpx 0rpx;
  205. }
  206. .all {
  207. font-size: 30rpx;
  208. font-weight: 500;
  209. color: #44969d;
  210. }
  211. .all-num {
  212. font-size: 24rpx;
  213. font-weight: bold;
  214. color: #333333;
  215. text {
  216. font-size: 26rpx;
  217. padding: 0rpx 10rpx;
  218. color: #44969d;
  219. }
  220. }
  221. .submit {
  222. background: linear-gradient(90deg, #60BAB0, #60BAB0, #45969B);
  223. margin-top: 160rpx;
  224. color: #ffffff;
  225. text-align: center;
  226. padding: 26rpx 0rpx;
  227. border-radius: 15rpx;
  228. }
  229. .tpl-box {
  230. text-align: left;
  231. font-size: 28rpx;
  232. font-weight: 500;
  233. color: #fb3a2f;
  234. margin-top: 26rpx;
  235. }
  236. }
  237. .goback-box {
  238. position: absolute;
  239. left: 18rpx;
  240. top: 0;
  241. height: 80rpx;
  242. display: flex;
  243. align-items: center;
  244. }
  245. .goback {
  246. z-index: 100;
  247. width: 34rpx;
  248. height: 34rpx;
  249. }
  250. .header {
  251. color: #FFFFFF;
  252. position: absolute;
  253. left: 0;
  254. top: 0;
  255. width: 100%;
  256. height: 80rpx;
  257. font-size: 32rpx;
  258. font-weight: 700;
  259. z-index: 99;
  260. display: flex;
  261. justify-content: center;
  262. align-items: center;
  263. }
  264. </style>