withdraw.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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="addr" placeholder="请输入提币地址"/>
  21. <view class="from-title">数量</view>
  22. <view class="flex input-tpl">
  23. <input class="input-box" type="number" v-model="num" :placeholder="'最低数量 '+less+name"/>
  24. <view class="all" @click="num = money">全部</view>
  25. </view>
  26. <view class="all-num">可用<text>{{money *1 }}</text>{{name}}</view>
  27. <view class="submit" @click="cash">确定</view>
  28. <!-- <view class="jilv" @click="nav('/pages/finance/Tdetails')">
  29. 提币记录
  30. </view> -->
  31. <view class="tpl-box" v-show="showText == true">提币数量在{{less}}-10000.0个之间,认真核对提币地址;手续费:{{data.service}}{{data.service_type}}</view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { cash,cashmoney_type,calculator } from '@/api/finance.js';
  37. import selectss from '@/components/select.vue';
  38. export default {
  39. components: {
  40. selectss
  41. },
  42. data() {
  43. return {
  44. moneyTypeList: [],
  45. name: '',
  46. code: '',
  47. logo: '',
  48. money:'',
  49. less: '',
  50. addr: '',
  51. num: '',
  52. data:'',
  53. showText:false
  54. };
  55. },
  56. onLoad(option) {
  57. console.log(option)
  58. if (option.name) {
  59. this.name = option.name;
  60. this.logo = option.logo;
  61. this.code = option.code;
  62. this.money = option.money;
  63. this.less = option.less;
  64. }
  65. this.moneyType();
  66. },
  67. onShow() {
  68. },
  69. watch:{
  70. num(newVal, oldVal) {
  71. this.calculator();
  72. }
  73. },
  74. methods: {
  75. // 所有币种
  76. async moneyType() {
  77. let obj = this;
  78. cashmoney_type({}).then(({
  79. data
  80. }) => {
  81. obj.moneyTypeList = data;
  82. if (obj.logo == '') {
  83. obj.logo = obj.moneyTypeList[0].LOGO;
  84. obj.name = obj.moneyTypeList[0].name;
  85. obj.code = obj.moneyTypeList[0].code;
  86. obj.money = obj.moneyTypeList[0].wallet.money;
  87. obj.less = obj.moneyTypeList[0].less;
  88. }
  89. });
  90. },
  91. calculator(){
  92. let obj = this;
  93. calculator({
  94. money_type:obj.code,
  95. money:obj.num
  96. }).then(({data}) => {
  97. console.log(data);
  98. obj.data = data;
  99. obj.showText = true;
  100. });
  101. },
  102. cash(){
  103. let obj = this;
  104. if(obj.code == ''){
  105. obj.$api.msg('请选择币种!');
  106. return;
  107. }
  108. if(obj.addr == ''){
  109. obj.$api.msg('请输入提币地址!');
  110. return;
  111. }
  112. if(obj.num == ''){
  113. obj.$api.msg('请输入提币数量!');
  114. return;
  115. }
  116. if(obj.num < obj.less ){
  117. obj.$api.msg('最低数量不能低于'+obj.less + '!');
  118. return;
  119. }
  120. cash({
  121. money_type:obj.code,
  122. money:obj.num,
  123. address:obj.addr,
  124. }).then((data) => {
  125. obj.money = '';
  126. obj.address = '';
  127. obj.$api.msg(data.msg);
  128. });
  129. },
  130. selectOne(options) {
  131. this.logo = options.LOGO;
  132. this.name = options.name;
  133. this.code = options.code;
  134. this.money = options.wallet.money;
  135. this.less = options.less;
  136. },
  137. useOutClickSide() {
  138. this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions()
  139. },
  140. nav(url) {
  141. uni.navigateTo({
  142. url:url
  143. })
  144. }
  145. }
  146. };
  147. </script>
  148. <style lang="scss">
  149. page {
  150. min-height: 100%;
  151. background-color: #ffffff;
  152. .container {
  153. width: 100%;
  154. }
  155. }
  156. .list-box {
  157. padding: 60rpx 30rpx;
  158. height: 350rpx;
  159. background-color: #5771DF;
  160. .list {
  161. background-color: #FFFFFF;
  162. border-radius: 15rpx;
  163. padding: 15rpx 23rpx;
  164. .list-item {
  165. font-size: 30rpx;
  166. font-weight: bold;
  167. color: #333333;
  168. image {
  169. width: 43rpx;
  170. height: 43rpx;
  171. margin-right: 15rpx;
  172. }
  173. }
  174. .list-tpl {
  175. image {
  176. width: 15rpx;
  177. height: 25rpx;
  178. margin-left: 20rpx;
  179. }
  180. }
  181. }
  182. }
  183. .from-box{
  184. margin: 30rpx 30rpx;
  185. padding: 44rpx 25rpx;
  186. background-color: #FFFFFF;
  187. border-radius: 15rpx;
  188. position: relative;
  189. top: -180rpx;
  190. .from-title{
  191. font-size: 24rpx;
  192. font-weight: bold;
  193. color: #333333;
  194. }
  195. .input-box{
  196. font-size: 26rpx;
  197. font-weight: 500;
  198. color: #666666;
  199. margin: 35rpx 0rpx;
  200. }
  201. .all{
  202. font-size: 30rpx;
  203. font-weight: 500;
  204. color: #5771DF;
  205. }
  206. .all-num{
  207. font-size: 24rpx;
  208. font-weight: bold;
  209. color: #333333;
  210. }
  211. .submit {
  212. background-color: #5771DF;
  213. margin-top: 165rpx;
  214. color: #FFFFFF;
  215. text-align: center;
  216. padding: 26rpx 0rpx;
  217. border-radius: 15rpx;
  218. }
  219. .tpl-box {
  220. text-align: left;
  221. font-size: 28rpx;
  222. font-weight: 500;
  223. color: #FB3A2F;
  224. margin-top: 26rpx;
  225. }
  226. }
  227. .jilv {
  228. margin-top: 30rpx;
  229. text-align: center;
  230. color: #999999;
  231. font-size: 30rpx;
  232. }
  233. </style>