yjzz.vue 6.8 KB

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