zhuanyue.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view class="content">
  3. <!-- <uni-notice-bar single="true" text="实际到账98%"></uni-notice-bar> -->
  4. <view class="content-money">
  5. <view class="flex " style="width: 750rpx;justify-content: space-around;margin-left: 0;">
  6. <view class="buttom">
  7. <view class="icon">{{ money | getMoneyStyle }}</view>
  8. <text class="text">可转佣金</text>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="row-box">
  13. <view class="title">转换金额</view>
  14. <view class="row">
  15. <text class="tit">¥</text>
  16. <input class="input" type="number" v-model="withdrawal" placeholder="请输入佣金数量" placeholder-class="placeholder" />
  17. <view class="buttom" @click="withdrawal = money">全部转换</view>
  18. </view>
  19. </view>
  20. <!-- <view class="tip" v-if="withdrawal != 0">
  21. 实际到账 {{ real || "0"}}元
  22. </view> -->
  23. <!-- #ifndef MP-WEIXIN -->
  24. <view class="list" >
  25. <radio-group @change="tabRadio">
  26. </radio-group>
  27. </view>
  28. <!-- #endif -->
  29. <!-- <view class="row b-b" v-if="type == 'alipay'">
  30. <text class="tit">支付宝账号</text>
  31. <input class="input" type="text" v-model="alipay_code" placeholder="请输入支付宝账号" placeholder-class="placeholder" />
  32. </view>
  33. <view class="row b-b" v-if="type == 'alipay'">
  34. <text class="tit">支付宝姓名</text>
  35. <input class="input" type="text" v-model="alipay_name" placeholder="请输入支付宝姓名" placeholder-class="placeholder" />
  36. </view> -->
  37. <!-- <view class="row b-b" v-if="type == 'bank'">
  38. <text class="tit">银行卡号</text>
  39. <input class="input" type="text" v-model="bank_code" placeholder="请输入银行卡号" placeholder-class="placeholder" />
  40. </view>
  41. <view class="row b-b" v-if="type == 'bank'">
  42. <text class="tit">姓名</text>
  43. <input class="input" type="text" v-model="bank_people" placeholder="请输入银行卡姓名" placeholder-class="placeholder" />
  44. </view>
  45. <view class="row b-b" v-if="type == 'bank'">
  46. <text class="tit">所属银行</text>
  47. <input class="input" type="text" v-model="bank_name" placeholder="请输入所属银行" placeholder-class="placeholder" />
  48. </view> -->
  49. <button class="add-btn up" @click="confirm">提交申请</button>
  50. <!-- <button class="add-btn modified" v-if="!weichatBsrowser" @click="navTo('/pages/money/account')">账号管理</button> -->
  51. </view>
  52. </template>
  53. <script>
  54. // import { rechargeWechat, rechargeIndex } from '@/api/wallet.js';
  55. import { getMoneyStyle } from '@/utils/rocessor.js';
  56. import { extractCash, extractBank, aliInfo,rechargeWechat, bankInfo } from '@/api/wallet.js';
  57. import { orderData, getUserInfo } from '@/api/user.js';
  58. import { mapState, mapMutations } from 'vuex';
  59. import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
  60. export default {
  61. filters: {
  62. getMoneyStyle
  63. },
  64. components: {
  65. uniNoticeBar
  66. },
  67. computed: {
  68. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  69. real() {
  70. return (this.withdrawal-(this.withdrawal*this.sxf)).toFixed(2) * 1;
  71. }
  72. },
  73. data() {
  74. return {
  75. type: 'alipay', //提现方式
  76. money: '0.00', //可提现金额
  77. freeze: '0.0', //冻结金额
  78. withdrawal: '', //提现金额
  79. minPrice: '', //最少提现金额
  80. aliData: {},
  81. sxf:0,
  82. bankData: {},
  83. alipay_code: '',
  84. alipay_name: '',
  85. bank_code: '',
  86. bank_people: '',
  87. bank_name: '',
  88. // #ifdef H5
  89. weichatBsrowser: false
  90. // #endif
  91. };
  92. },
  93. onLoad(options) {
  94. // #ifdef H5
  95. this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
  96. // #endif
  97. //加载提现信息
  98. this.loadData();
  99. // // 加载提款账号信息
  100. // this.loadAli();
  101. // this.loadBank();
  102. },
  103. methods: {
  104. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  105. // 加载余额信息
  106. async loadData() {
  107. extractBank({}).then(({ data }) => {
  108. console.log(data,'data')
  109. this.sxf=data.sxf;
  110. this.money = data.brokerage_price
  111. this.minPrice = data.minPrice;
  112. });
  113. },
  114. // 跳转
  115. navTo(url) {
  116. uni.navigateTo({
  117. url: url
  118. });
  119. },
  120. // 切换选中对象
  121. tabRadio(e) {
  122. this.type = e.detail.value;
  123. console.log(this.type);
  124. },
  125. // 提交
  126. confirm() {
  127. // let data = {
  128. // extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
  129. // money: this.withdrawal, //金额
  130. // money_type: 0 //0佣金1余额
  131. // };
  132. // if (this.withdrawal < this.minPrice) {
  133. // uni.showToast({
  134. // title: '提现金额不可少于' + this.minPrice,
  135. // duration: 2000,
  136. // mask: false,
  137. // icon: 'none'
  138. // });
  139. // return;
  140. // }
  141. // if (this.type == 'alipay') {
  142. // console.log('alipay');
  143. // data.name = this.alipay_name;
  144. // data.alipay_code = this.alipay_code;
  145. // }
  146. // if (this.type == 'bank') {
  147. // // console.log(bank,'bank');
  148. // data.name = this.bank_people;
  149. // data.bankname = this.bank_name;
  150. // data.cardnum = this.bank_code;
  151. // }
  152. rechargeWechat({
  153. price:this.withdrawal,
  154. type: 1 ,
  155. }).then(e => {
  156. uni.showToast({
  157. title: '转换成功',
  158. duration: 2000,
  159. position: 'top',
  160. // success: function(e) {
  161. // uni.navigateBack()
  162. // }
  163. });
  164. this.loadData()
  165. })
  166. .catch(e => {
  167. console.log(e);
  168. });
  169. }
  170. }
  171. };
  172. </script>
  173. <style lang="scss">
  174. page {
  175. height: 100%;
  176. }
  177. .content-money {
  178. padding: 30rpx 0;
  179. background: #ffffff;
  180. }
  181. .flex {
  182. background-color: #ffffff;
  183. text-align: center;
  184. margin: 0 30rpx;
  185. border-radius: $border-radius-sm;
  186. .buttom {
  187. font-size: $font-lg;
  188. width: 50%;
  189. }
  190. .interval {
  191. width: 2px;
  192. height: 60rpx;
  193. background-color: #eeeeee;
  194. }
  195. .icon {
  196. background-size: 100%;
  197. font-size: 42rpx;
  198. color: $font-color-dark;
  199. font-weight: bold;
  200. background-repeat: no-repeat;
  201. background-position: center;
  202. }
  203. .text {
  204. color: $font-color-light;
  205. }
  206. }
  207. .row-box {
  208. margin-top: 30rpx;
  209. padding: 20rpx 30rpx;
  210. background: #fff;
  211. .title {
  212. font-size: $font-base + 2rpx;
  213. color: $font-color-dark;
  214. }
  215. .row {
  216. display: flex;
  217. align-items: center;
  218. position: relative;
  219. height: 80rpx;
  220. .tit {
  221. flex-shrink: 0;
  222. width: 40rpx;
  223. font-size: 30rpx;
  224. color: $font-color-dark;
  225. }
  226. .input {
  227. flex: 1;
  228. font-size: 30rpx;
  229. color: $font-color-dark;
  230. }
  231. .iconlocation {
  232. font-size: 36rpx;
  233. color: $font-color-light;
  234. }
  235. .buttom {
  236. color: #F8DABA;
  237. font-size: $font-base;
  238. }
  239. }
  240. }
  241. .add-btn {
  242. &.modified {
  243. color: $base-color;
  244. }
  245. &.up {
  246. background-color: #303030;
  247. color: #F8DABA;
  248. }
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. width: 690rpx;
  253. height: 80rpx;
  254. margin: 0 auto;
  255. margin-top: 30rpx;
  256. font-size: $font-lg;
  257. border-radius: 10rpx;
  258. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  259. }
  260. .list {
  261. padding-left: 30rpx;
  262. margin-top: 30rpx;
  263. background-color: #ffffff;
  264. .box {
  265. display: flex;
  266. align-items: center;
  267. width: 100%;
  268. height: 120rpx;
  269. border-bottom: 1px solid $border-color-light;
  270. .icon {
  271. font-size: 48rpx;
  272. padding-right: 20rpx;
  273. .icon-img {
  274. height: 50rpx;
  275. width: 50rpx;
  276. }
  277. }
  278. .iconweixin1 {
  279. color: #18bf16;
  280. }
  281. .iconzhifubao {
  282. color: #08aaec;
  283. }
  284. .title-box {
  285. flex-grow: 1;
  286. text-align: left;
  287. .title {
  288. font-size: $font-base + 2rpx;
  289. color: $font-color-base;
  290. }
  291. .node {
  292. font-size: $font-sm;
  293. color: $font-color-light;
  294. }
  295. }
  296. }
  297. }
  298. /deep/ .uni-radio-input {
  299. width: 45rpx;
  300. height: 45rpx;
  301. }
  302. .row {
  303. display: flex;
  304. align-items: center;
  305. position: relative;
  306. padding: 0 30upx;
  307. height: 110upx;
  308. background: #fff;
  309. .tit {
  310. flex-shrink: 0;
  311. width: 250upx;
  312. font-size: 30upx;
  313. color: $font-color-dark;
  314. }
  315. .input {
  316. flex: 1;
  317. font-size: 30upx;
  318. color: $font-color-dark;
  319. }
  320. .iconlocation {
  321. font-size: 36upx;
  322. color: $font-color-light;
  323. }
  324. }
  325. .tip {
  326. padding: 20rpx;
  327. color: #FD3B39;
  328. }
  329. </style>