yjzye.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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. tabRadio(e) {
  90. this.type = e.detail.value;
  91. },
  92. // 提交
  93. confirm() {
  94. let obj = this;
  95. obj.loding = true;
  96. if (obj.withdrawal == 0) {
  97. obj.loding = false;
  98. uni.showModal({
  99. title: '提示',
  100. content: '转换金额不要为0'
  101. });
  102. return;
  103. }
  104. let data = {
  105. // phone: obj.phone, //编号
  106. price: obj.withdrawal ,//金额
  107. // type: obj.type
  108. };
  109. yjzye(data)
  110. .then(e => {
  111. // 允许按钮点击
  112. obj.loding = false;
  113. // 初始化提现金额
  114. obj.withdrawal = '';
  115. uni.showToast({
  116. title: '转换成功',
  117. duration: 2000,
  118. position: 'top'
  119. });
  120. obj.dataUp();
  121. obj.cancel()
  122. })
  123. .catch(e => {
  124. obj.$api.msg(e.msg);
  125. obj.loding = false;
  126. console.log();
  127. });
  128. },
  129. boblack() {
  130. uni.navigateBack({
  131. fail() {
  132. uni.switchTab({
  133. url: '/pages/index/index'
  134. })
  135. }
  136. })
  137. },
  138. }
  139. };
  140. </script>
  141. <style lang="scss">
  142. page {
  143. height: 100%;
  144. }
  145. .content-money {
  146. padding: 30rpx 0;
  147. background: #ffffff;
  148. }
  149. .item {
  150. padding: 0 $page-row-spacing;
  151. background-color: #ffffff;
  152. }
  153. .flex {
  154. background-color: #ffffff;
  155. text-align: center;
  156. margin: 0 30rpx;
  157. border-radius: $border-radius-sm;
  158. justify-content: center;
  159. .buttom {
  160. font-size: $font-lg;
  161. width: 50%;
  162. }
  163. .interval {
  164. width: 2px;
  165. height: 60rpx;
  166. background-color: #eeeeee;
  167. }
  168. .icon {
  169. background-size: 100%;
  170. font-size: 42rpx;
  171. color: $font-color-dark;
  172. font-weight: bold;
  173. background-repeat: no-repeat;
  174. background-position: center;
  175. }
  176. .text {
  177. color: $font-color-light;
  178. }
  179. }
  180. .row-box {
  181. margin-top: 30rpx;
  182. padding: 20rpx 30rpx;
  183. background: #fff;
  184. .title {
  185. font-size: $font-base + 2rpx;
  186. color: $font-color-dark;
  187. }
  188. .row {
  189. display: flex;
  190. align-items: center;
  191. position: relative;
  192. height: 80rpx;
  193. .tit {
  194. flex-shrink: 0;
  195. width: 40rpx;
  196. font-size: 30rpx;
  197. color: $font-color-dark;
  198. }
  199. .input {
  200. flex: 1;
  201. font-size: 30rpx;
  202. color: $font-color-dark;
  203. }
  204. .iconlocation {
  205. font-size: 36rpx;
  206. color: $font-color-light;
  207. }
  208. .buttom {
  209. color: #f21f5d;
  210. font-size: $font-base;
  211. }
  212. }
  213. }
  214. .add-btn {
  215. width: 520rpx;
  216. height: 80rpx;
  217. border-radius: 20rpx;
  218. margin: 140rpx auto 0;
  219. font-size: 36rpx;
  220. font-weight: bold;
  221. color: #F8DABA;
  222. background-color: #303030;
  223. }
  224. .back-btn {
  225. width: 520rpx;
  226. height: 80rpx;
  227. border-radius: 20rpx;
  228. margin: 40rpx auto;
  229. font-size: 36rpx;
  230. font-weight: bold;
  231. color: #303030;
  232. background-color: #F8DABA;
  233. }
  234. .name {
  235. background: #fff;
  236. padding: 30rpx;
  237. }
  238. .list {
  239. padding-left: 30rpx;
  240. margin-top: 30rpx;
  241. background-color: #ffffff;
  242. .box {
  243. display: flex;
  244. align-items: center;
  245. width: 100%;
  246. height: 120rpx;
  247. border-bottom: 1px solid $border-color-light;
  248. .icon {
  249. font-size: 48rpx;
  250. padding-right: 20rpx;
  251. .icon-img {
  252. height: 50rpx;
  253. width: 50rpx;
  254. }
  255. }
  256. .iconweixin1 {
  257. color: #18bf16;
  258. }
  259. .iconzhifubao {
  260. color: #08aaec;
  261. }
  262. .title-box {
  263. flex-grow: 1;
  264. text-align: left;
  265. .title {
  266. font-size: $font-base + 2rpx;
  267. color: $font-color-base;
  268. }
  269. .node {
  270. font-size: $font-sm;
  271. color: $font-color-light;
  272. }
  273. }
  274. }
  275. }
  276. .tip {
  277. padding: 20rpx;
  278. color: #ff0000;
  279. }
  280. /deep/ .uni-radio-input {
  281. width: 45rpx;
  282. height: 45rpx;
  283. }
  284. .psw-wrapper {
  285. width: 548rpx;
  286. height: 344rpx;
  287. background-color: #FFFFFF;
  288. border-radius: 15rpx 15rpx;
  289. .psw-title {
  290. width: 100%;
  291. font-size: 35rpx;
  292. padding: 43rpx 0 49rpx;
  293. text-align: center;
  294. font-weight: 800;
  295. }
  296. .psw-ipt {
  297. display: block;
  298. background-color: #dce3ed;
  299. height: 90rpx;
  300. width: 464rpx;
  301. padding-left: 30rpx;
  302. margin: 0 auto;
  303. font-size: 80rpx;
  304. }
  305. .psw-btn text {
  306. display: inline-block;
  307. text-align: center;
  308. width: 50%;
  309. padding-top: 29rpx;
  310. font-size: 35rpx;
  311. }
  312. .psw-qd {
  313. color: #5771DF;
  314. }
  315. }
  316. </style>