金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
6.9 KiB

  1. <template>
  2. <view id="distributionCenter">
  3. <view class="distributionCenterpage">
  4. <view class="distributionCenter-top" :style="'background: ' + config.mainConfig">
  5. <view class="current-title">当前可提现</view>
  6. <view class="current-money">
  7. <span class="cur-num"><span class="current"></span>{{list.balance}}</span>
  8. <span class="cur-topic" @tap="withdraw">提现</span>
  9. </view>
  10. </view>
  11. <view class="distributionCenter-profit">
  12. <view class="addUp">
  13. <view class="earnings">累计收益</view>
  14. <view class="earnings-num">{{list.earnings_commission}}</view>
  15. </view>
  16. <view class="outStanding">
  17. <view class="earnings">未到账收益</view>
  18. <view class="earnings-num">{{list.unearnings_commission}}</view>
  19. </view>
  20. </view>
  21. <view class="distributionCenter-handle">
  22. <view data-url="/pages/distribution/cash/cash" @tap="jumpItem">
  23. <span class="iconfont icon-woyaotixian"></span>
  24. <span>我要提现</span>
  25. </view>
  26. <view data-url="/pages/distribution/order/order" @tap="jumpItem">
  27. <span class="iconfont icon-fenxiaodingdan"></span>
  28. <span>分销订单</span>
  29. </view>
  30. <!-- <view data-url="/pages/wallet/bank/bank" bindtap="jumpItem">
  31. <span class="iconfont icon-shoukuanzhanghu"></span>
  32. <span>收款账户</span>
  33. </view>-->
  34. <view @tap="jumpsensus">
  35. <span class="iconfont icon-fenxiaotongji"></span>
  36. <span>分销统计</span>
  37. </view>
  38. <view @tap="jumpspread">
  39. <span class="iconfont icon-woyaotuiguang"></span>
  40. <span>我要推广</span>
  41. </view>
  42. <view @tap="jumpvip">
  43. <span class="iconfont icon-huiyuanguanli"></span>
  44. <span>会员管理</span>
  45. </view>
  46. <!-- <view data-url="/pages/distribution/coupon/coupon" @tap="jumpItem">
  47. <span class="iconfont icon-youhuiquan3"></span>
  48. <span>优惠券</span>
  49. </view> -->
  50. <view @tap="jumpPusher">
  51. <span class="iconfont icon-tuikeguanli"></span>
  52. <span>推客管理</span>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {pageLogin, getUrl,config,is} from '@/common/js/utils.js';
  60. export default {
  61. data() {
  62. return {
  63. show_confirm: false,
  64. show_title: '您暂未绑定支持提现的卡号或账户,是否现在进行绑定?',
  65. list: {},
  66. config: ''
  67. };
  68. },
  69. onShow() {
  70. this.getmoney();
  71. /* this.getBankAccount(); */
  72. if (config.BRAND.name == 'nuscents') {
  73. this.setData({
  74. show_title: '暂未绑定提现账户,现在去绑。'
  75. });
  76. }
  77. },
  78. onLoad() {
  79. // 第三方平台配置颜色
  80. var bgConfig = this.$cookieStorage.get('globalConfig') || '';
  81. this.setData({
  82. config: bgConfig
  83. });
  84. },
  85. components: {},
  86. props: {},
  87. methods: {
  88. jumpItem(e) {
  89. var url = e.currentTarget.dataset.url;
  90. wx.navigateTo({
  91. url: url
  92. });
  93. },
  94. withdraw() {
  95. wx.navigateTo({
  96. url: '/pages/distribution/cash/cash' //提现页面
  97. });
  98. return;
  99. if (this.data.info.type == 'customer_wechat') {} else {
  100. if (!this.data.info.hasAccount) {
  101. wx.showModal({
  102. content: this.data.show_title,
  103. showCancel: false,
  104. success: res => {
  105. if (res.confirm || !res.cancel && !res.confirm) {
  106. wx.navigateTo({
  107. url: '/pages/wallet/bank-add/bank-add' //进入银行卡添加页面
  108. });
  109. }
  110. }
  111. });
  112. } else {
  113. wx.navigateTo({
  114. url: '/pages/distribution/cash/cash' //进入提现页面
  115. });
  116. }
  117. }
  118. },
  119. getBankAccount() {
  120. var token = this.$cookieStorage.get('user_token');
  121. this.$http.get({
  122. api: 'api/users/BankAccount/show/number',
  123. header: {
  124. Authorization: token
  125. }
  126. }).then(res => {
  127. if (res.statusCode == 200) {
  128. res = res.data;
  129. if (res.status) {
  130. // this.setData({
  131. // info: res.data
  132. // });
  133. this.info=res.data;
  134. } else {
  135. wx.showModal({
  136. content: '请求失败,请稍后重试',
  137. showCancel: false
  138. });
  139. }
  140. } else {
  141. wx.showModal({
  142. content: '请求失败,请稍后重试',
  143. showCancel: false
  144. });
  145. }
  146. }).catch(rej => {
  147. wx.showModal({
  148. content: '请求失败,请稍后重试',
  149. showCancel: false
  150. });
  151. });
  152. },
  153. //获取提现数据
  154. getmoney(e) {
  155. var token = this.$cookieStorage.get('user_token');
  156. this.$http.get({
  157. api: 'api/distribution/balance',
  158. header: {
  159. Authorization: token
  160. }
  161. }).then(res => {
  162. if (res.statusCode == 200) {
  163. var res = res.data;
  164. if (res.status) {
  165. this.setData({
  166. list: res.data
  167. });
  168. } else {
  169. wx.showModal({
  170. content: '请求失败,请稍后重试',
  171. showCancel: false
  172. });
  173. }
  174. } else {
  175. wx.showModal({
  176. content: '请求失败,请稍后重试',
  177. showCancel: false
  178. });
  179. }
  180. }).catch(rej => {
  181. wx.showModal({
  182. content: '请求失败,请稍后重试',
  183. showCancel: false
  184. });
  185. });
  186. },
  187. //跳分销统计
  188. jumpsensus(e) {
  189. wx.navigateTo({
  190. url: '/pages/distribution/sensus/sensus'
  191. });
  192. },
  193. //跳我要推广
  194. jumpspread(e) {
  195. wx.navigateTo({
  196. url: '/pages/distribution/spread/spread'
  197. });
  198. },
  199. //跳vip管理
  200. jumpvip(e) {
  201. wx.navigateTo({
  202. url: '/pages/distribution/vipManage/vipManage'
  203. });
  204. },
  205. // 跳推客中心
  206. jumpPusher() {
  207. wx.navigateTo({
  208. url: '/pages/distribution/pusher/pusher'
  209. });
  210. },
  211. setData: function (obj) {
  212. let that = this;
  213. let keys = [];
  214. let val, data;
  215. Object.keys(obj).forEach(function (key) {
  216. keys = key.split('.');
  217. val = obj[key];
  218. data = that.$data;
  219. keys.forEach(function (key2, index) {
  220. if (index + 1 == keys.length) {
  221. that.$set(data, key2, val);
  222. } else {
  223. if (!data[key2]) {
  224. that.$set(data, key2, {});
  225. }
  226. }
  227. data = data[key2];
  228. });
  229. });
  230. }
  231. },
  232. computed: {},
  233. watch: {}
  234. };
  235. </script>
  236. <style rel="stylesheet/less" lang="less">
  237. @import "distributionCenter";
  238. </style>