yjzye.vue 6.5 KB

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