yjzz.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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. <view class="icon" v-if="type==2">{{ userInfo.tickets | getMoneyStyle }}</view>
  8. <text class="text">可转账余额</text>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="row-box">
  13. <view class="title">收款人UID</view>
  14. <view class="row"><input class="input" type="number" v-model="phone" placeholder="请输入收款人UID"
  15. placeholder-class="placeholder" /></view>
  16. </view>
  17. <view class="row-box">
  18. <view class="title">转账金额</view>
  19. <view class="row">
  20. <!-- <text class="tit">¥</text> -->
  21. <input class="input" type="number" v-model="withdrawal" placeholder="转入金额"
  22. placeholder-class="placeholder" />
  23. <view class="buttom" @click="withdrawal = userInfo.tickets*1" >全部转账</view>
  24. <!-- <view class="buttom" @click="withdrawal = userInfo.dynamic_integral" v-if="type== 2">全部转账</view> -->
  25. </view>
  26. </view>
  27. <button class="add-btn up" :class="{ action: loding }" @click="!loding ? confirm() : ''">转账</button>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. getMoneyStyle
  33. } from '@/utils/rocessor.js';
  34. import {
  35. getUserInfo,
  36. jfzz,
  37. ticketsRotation
  38. } from '@/api/user.js';
  39. import {
  40. mapMutations,
  41. mapState
  42. } from 'vuex';
  43. export default {
  44. filters: {
  45. getMoneyStyle
  46. },
  47. data() {
  48. return {
  49. phone: '',
  50. money: '0.00', //可提现金额
  51. withdrawal: '', //提现金额
  52. password: '', //支付密码
  53. card: '', //转账卡号
  54. name: '',
  55. // #ifdef H5
  56. weichatBsrowser: false,
  57. // #endif
  58. loding: false,
  59. type: 0
  60. };
  61. },
  62. onLoad(options) {
  63. // #ifdef H5
  64. this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
  65. // #endif
  66. this.dataUp();
  67. if (options.type) {
  68. this.type = options.type;
  69. console.log(this.type);
  70. if(this.type == 1) {
  71. uni.setNavigationBarTitle({
  72. title:'静态积分转账'
  73. })
  74. }else if(this.type == 2){
  75. uni.setNavigationBarTitle({
  76. title:'保单币转账'
  77. })
  78. }else if(this.type == 3){
  79. uni.setNavigationBarTitle({
  80. title:'余额转账'
  81. })
  82. }
  83. }
  84. },
  85. computed: {
  86. ...mapState('user', ['userInfo'])
  87. },
  88. methods: {
  89. ...mapMutations('user', ['setUserInfo', 'login']),
  90. // 更新数据
  91. dataUp() {
  92. let obj = this;
  93. getUserInfo({})
  94. .then(e => {
  95. obj.login();
  96. // 保存返回用户数据
  97. obj.setUserInfo(e.data);
  98. })
  99. .catch(e => {
  100. console.log(e);
  101. });
  102. },
  103. // 切换选中对象
  104. tabRadio(e) {
  105. this.type = e.detail.value;
  106. },
  107. // 提交
  108. confirm() {
  109. let obj = this;
  110. obj.loding = true;
  111. if (obj.withdrawal == 0) {
  112. obj.loding = false;
  113. uni.showModal({
  114. title: '提示',
  115. content: '转账金额不要为0'
  116. });
  117. return;
  118. }
  119. let data = {
  120. uid: obj.userInfo.uid,
  121. other_uid: obj.phone, //编号
  122. TransferMoney: obj.withdrawal ,//金额
  123. // type: obj.type
  124. };
  125. ticketsRotation(data)
  126. .then(e => {
  127. // 允许按钮点击
  128. obj.loding = false;
  129. // 初始化提现金额
  130. obj.withdrawal = '';
  131. uni.showToast({
  132. title: '转账成功',
  133. duration: 2000,
  134. position: 'top'
  135. });
  136. obj.dataUp();
  137. obj.cancel()
  138. })
  139. .catch(e => {
  140. obj.$api.msg(e.msg);
  141. obj.loding = false;
  142. console.log();
  143. });
  144. },
  145. boblack() {
  146. uni.navigateBack({
  147. fail() {
  148. uni.switchTab({
  149. url: '/pages/index/index'
  150. })
  151. }
  152. })
  153. },
  154. }
  155. };
  156. </script>
  157. <style lang="scss">
  158. page {
  159. height: 100%;
  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: #f21f5d;
  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: #F8DABA;
  238. background-color: #303030;
  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>