WithdrawList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container member-withdraw-list">
  3. <view class="div common-header-wrap">
  4. <view class="status-holder"></view>
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="提现明细" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="scroll-view div pb-30" style="position:relative">
  14. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
  15. <view
  16. class="div list-wrapper"
  17. v-if="withdraw_list && withdraw_list.length"
  18. >
  19. <view
  20. class="div container"
  21. v-for="(item, index) in withdraw_list"
  22. :key="item.pdc_id"
  23. >
  24. <view class="div top-wrapper">
  25. <view class="div left-wrapper">
  26. <label class="status">{{item.pdc_payment_state_text}}</label>
  27. <label class="title">{{ item.pdc_bank_user }}:{{ item.pdc_bank_no }}</label>
  28. </view>
  29. <view class="div right-wrapper">
  30. <label class="price">¥{{ item.pdc_amount }}</label>
  31. <label class="subtitle">提现金额</label>
  32. </view>
  33. <view class="div top-line"></view>
  34. </view>
  35. <view class="div center-wrapper">
  36. <label class="desc">申请时间:{{ item.pdc_addtime_text }}</label>
  37. </view>
  38. </view>
  39. </view>
  40. <empty-record v-else-if="withdraw_list && !withdraw_list.length"></empty-record>
  41. </scroll-view>
  42. </view>
  43. <view class='common-add-btn-wrapper'><view class="div common-btn common-add-btn" @click="goAdd">新增</view></view>
  44. <!--身份验证-->
  45. <uni-popup background-color="#fff" ref="sendAuthCode" type="right" >
  46. <view :style="'width:'+screenWidth+'px'" class="common-popup-wrapper">
  47. <view class="div common-header-wrap">
  48. <view :style="'height:'+navHeight+'px'"></view>
  49. <view class="common-header-holder"></view>
  50. <view class="common-header-fixed">
  51. <title-header />
  52. <uni-nav-bar title="身份验证" class="common-header" left-icon="back" @clickLeft="hidePopup('sendAuthCode')">
  53. </uni-nav-bar>
  54. </view>
  55. </view>
  56. <view class="div common-popup-content">
  57. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" scroll-y="true">
  58. <common-send-code @checkSuccess="checkSuccess" />
  59. </scroll-view>
  60. </view>
  61. </view>
  62. </uni-popup>
  63. <!--申请提现-->
  64. <uni-popup background-color="#fff" ref="addWithdrawVisible" type="right" >
  65. <view :style="'width:'+screenWidth+'px'" class="common-popup-wrapper">
  66. <view class="div common-header-wrap">
  67. <view :style="'height:'+navHeight+'px'"></view>
  68. <view class="common-header-holder"></view>
  69. <view class="common-header-fixed">
  70. <title-header />
  71. <uni-nav-bar title="申请提现" class="common-header" left-icon="back" @clickLeft="hidePopup('addWithdrawVisible')">
  72. </uni-nav-bar>
  73. </view>
  74. </view>
  75. <view class="div common-popup-content">
  76. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" scroll-y="true">
  77. <view class="div main-content">
  78. <flex-line class="field-line menu-item" :show-border="true"><text class="span field-name">提现金额</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="amount" /></view></flex-line>
  79. <flex-line class="field-line menu-item" :show-border="true"><text class="span field-name">支付密码</text><view class="div field-line-right" slot="right"><input class="field-input" type="password" v-model="password" /></view></flex-line>
  80. <flex-line class="field-line menu-item" v-if="bank_length > 0" :show-border="true">
  81. <text class="span field-name">收款银行</text>
  82. <view class="div" slot="right">
  83. <radio-group @change="radioChange" class='radio-wrapper'>
  84. <view class='radio-item' v-for="(item, index) in memberbankOptions" :key="index">
  85. <radio :value="item.value" :checked="memberbank_id==item.value" />
  86. <text>{{item.label}}</text>
  87. </view>
  88. </radio-group>
  89. </view>
  90. </flex-line>
  91. <view class="div common-btn ds-button-large" @click="addWithdraw" v-if="bank_length > 0">提交</view>
  92. <view class="div common-btn ds-button-large" @click="goMemberbacklist" v-else>请先添加收款账号</view>
  93. </view>
  94. </scroll-view>
  95. </view>
  96. </view>
  97. </uni-popup>
  98. </view></member-base>
  99. </template>
  100. <script>
  101. import {getFontSize} from '@/util/common'
  102. import TitleHeader from '../../TitleHeader'
  103. import MemberBase from '../MemberBase'
  104. import { mapState } from 'vuex'
  105. import { getWithdrawList, addWithdraw } from '../../../api/memberWithdraw'
  106. import { getBankList } from '../../../api/memberBank'
  107. import EmptyRecord from '../../EmptyRecord'
  108. import CommonSendCode from '../common/CommonSendCode'
  109. import flexLine from '../../flexLine'
  110. export default {
  111. name: 'BalanceHistory',
  112. components:{
  113. TitleHeader,
  114. MemberBase,
  115. flexLine,
  116. EmptyRecord,
  117. CommonSendCode
  118. },
  119. data(){
  120. return {
  121. navHeight: 0,
  122. screenWidth:0,
  123. params: { 'page': 0, 'per_page': 10 },
  124. loading: false, // 是否加载更多
  125. isMore: true, // 是否有更多
  126. bank_length:0,
  127. amount: '',
  128. memberbankOptions: [],
  129. memberbank_id: '',
  130. password: '',
  131. wrapperHeight: 0,
  132. withdraw_list: false
  133. }
  134. },
  135. created () {
  136. getBankList().then(res => {
  137. let temp = res.result.bank_list
  138. this.bank_length = temp.length
  139. for (var i in temp) {
  140. let item = temp[i]
  141. if(item.memberbank_type=='alipay'){
  142. item.memberbank_name='支付宝'
  143. }else if(item.memberbank_type=='weixin'){
  144. item.memberbank_name='微信'
  145. }
  146. this.memberbankOptions.push({
  147. label: item.memberbank_name+item.memberbank_no,
  148. value: item.memberbank_id
  149. })
  150. }
  151. }).catch(function (error) {
  152. uni.showToast({icon:'none',title: error.message})
  153. })
  154. this.loadMore()
  155. },
  156. computed:{
  157. fontSize(){
  158. return getFontSize()
  159. },
  160. ...mapState({
  161. user: state => state.member.info
  162. })
  163. },
  164. mounted(){
  165. // #ifdef MP-WEIXIN
  166. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  167. // #endif
  168. this.screenWidth=uni.getSystemInfoSync().screenWidth
  169. this.wrapperHeight = uni.getSystemInfoSync().windowHeight - 130
  170. },
  171. methods:{
  172. radioChange(e){
  173. this.memberbank_id=e.detail.value
  174. },
  175. showPopup(id){
  176. this.$refs[id].open()
  177. },
  178. hidePopup(id){
  179. this.$refs[id].close()
  180. },
  181. addWithdraw () {
  182. addWithdraw(this.amount, this.memberbank_id, this.password).then(res => {
  183. uni.showToast({icon:'none',title: res.message})
  184. this.hidePopup('addWithdrawVisible')
  185. this.reload()
  186. }).catch(function (error) {
  187. uni.showToast({icon:'none',title: error.message})
  188. })
  189. },
  190. checkSuccess () {
  191. this.hidePopup('sendAuthCode')
  192. this.showPopup('addWithdrawVisible')
  193. },
  194. goAdd () {
  195. if (!this.user.member_mobilebind && !this.user.member_emailbind) {
  196. uni.showToast({icon:'none',title: '请先绑定手机或邮箱'})
  197. uni.navigateTo({url:'/pages/member/setting/AccountSet'})
  198. } else {
  199. this.showPopup('sendAuthCode')
  200. }
  201. },
  202. goBack () {
  203. uni.navigateBack({delta:1})
  204. },
  205. goMemberbacklist(){
  206. uni.navigateTo({url:'/pages/member/bank/BankList'})
  207. },
  208. loadMore () {
  209. this.loading = true
  210. this.params.page = ++this.params.page
  211. if (this.isMore) {
  212. this.loading = false
  213. this.getWithdrawList(true)
  214. }
  215. },
  216. reload () {
  217. // 重新加载数据
  218. this.params.page = 0
  219. this.isMore = true
  220. this.loading = false
  221. this.withdraw_list = false
  222. this.loadMore()
  223. },
  224. getWithdrawList () {
  225. uni.showLoading({ title: '加载中' })
  226. getWithdrawList(this.params).then(res => {
  227. uni.hideLoading()
  228. if (res.result.hasmore) {
  229. this.isMore = true
  230. } else {
  231. this.isMore = false
  232. }
  233. let temp = res.result.list
  234. if (temp) {
  235. if (!this.withdraw_list) {
  236. this.withdraw_list = temp
  237. } else {
  238. this.withdraw_list = this.withdraw_list.concat(temp)
  239. }
  240. }
  241. }).catch(function (error) {
  242. uni.hideLoading()
  243. uni.showToast({icon:'none',title: error.message})
  244. })
  245. }
  246. }
  247. }
  248. </script>
  249. <style lang="scss">
  250. .member-withdraw-list{
  251. .mint-radiolist {
  252. display: flex;
  253. .mint-cell {
  254. flex: 1;
  255. .mint-radio-input:checked + .mint-radio-core {
  256. background-color: $primaryColor !important;
  257. border-color: $primaryColor !important;
  258. }
  259. &:after{display: none}
  260. }
  261. }
  262. }
  263. </style>
  264. <style scoped lang="scss">
  265. .scroll-view-wrapper{display: flex;flex-direction: column;}
  266. .scroll-view{flex:1}
  267. .common-header{
  268. .btn{background: #000;color: #fff;box-shadow: 0px 2px 4px #d2d2d2;}
  269. }
  270. .main-content{background: #fff;padding:0 $pageSpace}
  271. .container {
  272. height: 100%;
  273. display: flex;
  274. position: relative;
  275. flex-direction: column;
  276. justify-content: flex-start;
  277. align-items: stretch;
  278. }
  279. .header {
  280. border-bottom: 1px solid #e8eaed;
  281. }
  282. .list-wrapper {
  283. .container {
  284. display: flex;
  285. flex-direction: column;
  286. justify-content: flex-start;
  287. align-items: stretch;
  288. background-color: #fff;
  289. }
  290. .top-wrapper {
  291. position: relative;
  292. display: flex;
  293. flex-direction: row;
  294. justify-content: flex-start;
  295. align-items: stretch;
  296. }
  297. .left-wrapper {
  298. flex: 1;
  299. display: flex;
  300. flex-direction: column;
  301. justify-content: flex-start;
  302. align-items: stretch;
  303. }
  304. .right-wrapper {
  305. display: flex;
  306. flex-direction: column;
  307. justify-content: flex-start;
  308. align-items: stretch;
  309. }
  310. .status {
  311. font-size:$subFontSize;
  312. color: #5296db;
  313. margin-left:0.75rem;
  314. margin-top:0.65rem;
  315. }
  316. .title {
  317. font-size:$fontSize;
  318. color: #666666;
  319. margin-left:0.75rem;
  320. margin-top:0.25rem;
  321. margin-right:0.5rem;
  322. margin-bottom:0.2rem;
  323. }
  324. .price {
  325. font-size:$h1;
  326. color:$primaryColor;
  327. margin-right:0.75rem;
  328. margin-top:0.5rem;
  329. text-align: right;
  330. }
  331. .subtitle {
  332. font-size:$fontSize;
  333. color: #999999;
  334. margin-right:0.75rem;
  335. margin-top:0.25rem;
  336. margin-bottom:0.5rem;
  337. text-align: right;
  338. }
  339. .top-line {
  340. position: absolute;
  341. left:0.75rem;
  342. bottom: 0;
  343. right: 0;
  344. height: 1px;
  345. background-color: #e8eaed;
  346. }
  347. .desc {
  348. color: #999999;
  349. font-size:$fontSize;
  350. margin-left:0.75rem;
  351. margin-top:0.25rem;
  352. }
  353. .center-wrapper {
  354. display: flex;
  355. flex-direction: column;
  356. justify-content: flex-start;
  357. align-items: stretch;
  358. border-bottom: 1px solid #e8eaed;
  359. padding-bottom:0.25rem;
  360. }
  361. }
  362. .radio-wrapper{
  363. display: block;
  364. padding: 0 $pageSpace;
  365. .radio-item{
  366. padding: .5rem 0;
  367. border-bottom: 1px dashed #f5f5f5;
  368. text{
  369. word-break: break-all;
  370. }
  371. }
  372. }
  373. </style>