gxdh.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="content">
  3. <!-- <view class="tit" v-if="type == 3">
  4. 佣金兑换通证比例1:1,手续费{{pUser.to_pass*100}}%
  5. </view> -->
  6. <view class="content-money">
  7. <view class="flex">
  8. <view class="buttom">
  9. <view class="icon">{{ userInfo.contribute | getMoneyStyle }}</view>
  10. <text class="text">可转换贡献值</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="row-box">
  15. <view class="title">转换金额</view>
  16. <view class="row">
  17. <input class="input" type="number" v-model="withdrawal" placeholder="转换金额"
  18. placeholder-class="placeholder" />
  19. <view class="buttom" @click="withdrawal = userInfo.contribute*1">全部转换</view>
  20. </view>
  21. </view>
  22. <button class="add-btn up" :class="{ action: loding }" @click="!loding ? confirm() : ''">转换</button>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. getMoneyStyle
  28. } from '@/utils/rocessor.js';
  29. import {
  30. getUserInfo,
  31. jfzz,
  32. yjzye,
  33. rechargeWechat,
  34. gxdh
  35. } from '@/api/user.js';
  36. import { passUser } from '@/api/zero.js'
  37. import {
  38. mapMutations,
  39. mapState
  40. } from 'vuex';
  41. export default {
  42. filters: {
  43. getMoneyStyle
  44. },
  45. data() {
  46. return {
  47. pUser: '',
  48. phone: '',
  49. money: '0.00', //可提现金额
  50. withdrawal: '', //提现金额
  51. password: '', //支付密码
  52. card: '', //转账卡号
  53. name: '',
  54. // #ifdef H5
  55. weichatBsrowser: false,
  56. // #endif
  57. loding: false,
  58. type: 0
  59. };
  60. },
  61. onLoad(options) {
  62. // #ifdef H5
  63. this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
  64. // #endif
  65. this.dataUp();
  66. if (options.type) {
  67. this.type = options.type;
  68. if (this.type == 2) {
  69. uni.setNavigationBarTitle({
  70. title: '贡献值转佣金'
  71. })
  72. } else if (options.type == 1) {
  73. uni.setNavigationBarTitle({
  74. title: '贡献值转报单币'
  75. })
  76. }
  77. }
  78. },
  79. computed: {
  80. ...mapState('user', ['userInfo'])
  81. },
  82. methods: {
  83. ...mapMutations('user', ['setUserInfo', 'login']),
  84. // 更新数据
  85. dataUp() {
  86. let obj = this;
  87. getUserInfo({})
  88. .then(e => {
  89. obj.login();
  90. // 保存返回用户数据
  91. obj.setUserInfo(e.data);
  92. passUser().then(re => {
  93. this.pUser = re.data
  94. })
  95. })
  96. .catch(e => {
  97. console.log(e);
  98. });
  99. },
  100. // 切换选中对象
  101. tabRadio(e) {
  102. this.type = e.detail.value;
  103. },
  104. // 提交
  105. confirm() {
  106. let obj = this;
  107. obj.loding = true;
  108. if (obj.withdrawal == 0) {
  109. obj.loding = false;
  110. uni.showModal({
  111. title: '提示',
  112. content: '转换金额不要为0'
  113. });
  114. return;
  115. }
  116. let data = {
  117. num: obj.withdrawal, //金额
  118. type: obj.type == 1 ? 'money': (obj.type == 2 ? 'brokerage': ''),
  119. };
  120. gxdh(data)
  121. .then(e => {
  122. // 允许按钮点击
  123. obj.loding = false;
  124. // 初始化提现金额
  125. obj.withdrawal = '';
  126. uni.showToast({
  127. title: '转换成功',
  128. duration: 2000,
  129. position: 'top'
  130. });
  131. obj.dataUp();
  132. obj.cancel()
  133. })
  134. .catch(e => {
  135. obj.$api.msg(e.msg);
  136. obj.loding = false;
  137. console.log();
  138. });
  139. },
  140. boblack() {
  141. uni.navigateBack({
  142. fail() {
  143. uni.switchTab({
  144. url: '/pages/index/index'
  145. })
  146. }
  147. })
  148. },
  149. }
  150. };
  151. </script>
  152. <style lang="scss">
  153. page {
  154. height: 100%;
  155. }
  156. .tit {
  157. padding: 5rpx;
  158. background-color: #f2c3d1;
  159. color: #f21f5d;
  160. }
  161. .content-money {
  162. padding: 30rpx 0;
  163. background: #ffffff;
  164. }
  165. .item {
  166. padding: 0 $page-row-spacing;
  167. background-color: #ffffff;
  168. }
  169. .flex {
  170. background-color: #ffffff;
  171. text-align: center;
  172. margin: 0 30rpx;
  173. border-radius: $border-radius-sm;
  174. justify-content: center;
  175. .buttom {
  176. font-size: $font-lg;
  177. width: 50%;
  178. }
  179. .interval {
  180. width: 2px;
  181. height: 60rpx;
  182. background-color: #eeeeee;
  183. }
  184. .icon {
  185. background-size: 100%;
  186. font-size: 42rpx;
  187. color: $font-color-dark;
  188. font-weight: bold;
  189. background-repeat: no-repeat;
  190. background-position: center;
  191. }
  192. .text {
  193. color: $font-color-light;
  194. }
  195. }
  196. .row-box {
  197. margin-top: 30rpx;
  198. padding: 20rpx 30rpx;
  199. background: #fff;
  200. .title {
  201. font-size: $font-base + 2rpx;
  202. color: $font-color-dark;
  203. }
  204. .row {
  205. display: flex;
  206. align-items: center;
  207. position: relative;
  208. height: 80rpx;
  209. .tit {
  210. flex-shrink: 0;
  211. width: 40rpx;
  212. font-size: 30rpx;
  213. color: $font-color-dark;
  214. }
  215. .input {
  216. flex: 1;
  217. font-size: 30rpx;
  218. color: $font-color-dark;
  219. }
  220. .iconlocation {
  221. font-size: 36rpx;
  222. color: $font-color-light;
  223. }
  224. .buttom {
  225. color: $base-color;
  226. font-size: $font-base;
  227. }
  228. }
  229. }
  230. .add-btn {
  231. width: 520rpx;
  232. height: 80rpx;
  233. border-radius: 20rpx;
  234. margin: 140rpx auto 0;
  235. font-size: 36rpx;
  236. font-weight: bold;
  237. color: #fff;
  238. background-color: $base-color;
  239. }
  240. .back-btn {
  241. width: 520rpx;
  242. height: 80rpx;
  243. border-radius: 20rpx;
  244. margin: 40rpx auto;
  245. font-size: 36rpx;
  246. font-weight: bold;
  247. color: #303030;
  248. background-color: #F8DABA;
  249. }
  250. .name {
  251. background: #fff;
  252. padding: 30rpx;
  253. }
  254. .list {
  255. padding-left: 30rpx;
  256. margin-top: 30rpx;
  257. background-color: #ffffff;
  258. .box {
  259. display: flex;
  260. align-items: center;
  261. width: 100%;
  262. height: 120rpx;
  263. border-bottom: 1px solid $border-color-light;
  264. .icon {
  265. font-size: 48rpx;
  266. padding-right: 20rpx;
  267. .icon-img {
  268. height: 50rpx;
  269. width: 50rpx;
  270. }
  271. }
  272. .iconweixin1 {
  273. color: #18bf16;
  274. }
  275. .iconzhifubao {
  276. color: #08aaec;
  277. }
  278. .title-box {
  279. flex-grow: 1;
  280. text-align: left;
  281. .title {
  282. font-size: $font-base + 2rpx;
  283. color: $font-color-base;
  284. }
  285. .node {
  286. font-size: $font-sm;
  287. color: $font-color-light;
  288. }
  289. }
  290. }
  291. }
  292. .tip {
  293. padding: 20rpx;
  294. color: #ff0000;
  295. }
  296. /deep/ .uni-radio-input {
  297. width: 45rpx;
  298. height: 45rpx;
  299. }
  300. .psw-wrapper {
  301. width: 548rpx;
  302. height: 344rpx;
  303. background-color: #FFFFFF;
  304. border-radius: 15rpx 15rpx;
  305. .psw-title {
  306. width: 100%;
  307. font-size: 35rpx;
  308. padding: 43rpx 0 49rpx;
  309. text-align: center;
  310. font-weight: 800;
  311. }
  312. .psw-ipt {
  313. display: block;
  314. background-color: #dce3ed;
  315. height: 90rpx;
  316. width: 464rpx;
  317. padding-left: 30rpx;
  318. margin: 0 auto;
  319. font-size: 80rpx;
  320. }
  321. .psw-btn text {
  322. display: inline-block;
  323. text-align: center;
  324. width: 50%;
  325. padding-top: 29rpx;
  326. font-size: 35rpx;
  327. }
  328. .psw-qd {
  329. color: #5771DF;
  330. }
  331. }
  332. </style>