transfer.vue 4.8 KB

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