usert.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="content">
  3. <view class="top-box">
  4. <image src="../../static/img/usert-bg.png" mode="" class="box-bg"></image>
  5. <view class="box-data">
  6. <view class="data-item">
  7. <view class="val">
  8. {{userInfo.now_money*1 || '0'}}
  9. </view>
  10. <view class="name">
  11. 消费积分
  12. </view>
  13. </view>
  14. <view class="line">
  15. </view>
  16. <view class="data-item">
  17. <view class="val">
  18. {{userInfo.max_pool*1|| '0'}}
  19. </view>
  20. <view class="name">
  21. 分红额度
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="flex center-box ">
  27. <view class="flex center-item" @click="navto('/pages/user/xzdl?type=2')">
  28. <image src="../../static/icon/dh.png" mode=""></image>
  29. <view class="name">兑换</view>
  30. </view>
  31. <view class="line">
  32. </view>
  33. <view class="flex center-item" @click="navto('/pages/user/xzdl?type=1')">
  34. <image src="../../static/icon/hz.png" mode=""></image>
  35. <view class="name">互转</view>
  36. </view>
  37. <view class="line">
  38. </view>
  39. <view class="flex center-item" @click="toTx">
  40. <image src="../../static/icon/tx.png" mode=""></image>
  41. <view class="name">提现</view>
  42. </view>
  43. </view>
  44. <view class="tit">
  45. 我的资产
  46. </view>
  47. <view class="bottom-list" v-for="key in navList">
  48. <view class="flex list-item">
  49. <image :src="key.img" mode="" class="logo"></image>
  50. <view class="much">
  51. <view class="">
  52. {{key.name}}
  53. </view>
  54. <view class="val">
  55. 余额:{{userInfo[key.val]*1 || '0'}}
  56. </view>
  57. </view>
  58. <view class="btn" v-if="key.agent" @click="goft">
  59. 复投
  60. </view>
  61. <!-- #ifdef APP-PLUS -->
  62. <view class="btn" @click="navto('/pages/money/recharge')" v-if="key.cz">
  63. 充值
  64. </view>
  65. <!-- #endif -->
  66. <view class="more" @click="navto('/pages/user/sz?type=' + key.type)">
  67. 明细
  68. </view>
  69. <image src="../../static/icon/back.png" mode="" class="black"></image>
  70. </view>
  71. </view>
  72. <image src="../../static/img/xccg.gif" mode="" class="cg" @click="navto('/pages/user/xccg')"></image>
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. saveUrl,
  78. interceptor
  79. } from '@/utils/loginUtils.js';
  80. import {
  81. getUserInfo,
  82. userPool,
  83. goft
  84. } from '@/api/user.js';
  85. import {
  86. mapState,
  87. mapMutations
  88. } from 'vuex';
  89. export default {
  90. data() {
  91. return {
  92. navList: {
  93. ft: {
  94. name: '复投积分',
  95. val: 'resumption',
  96. type: 1,
  97. agent: true,
  98. img: '../../static/icon/xc1.png'
  99. },
  100. yj: {
  101. name: '佣金',
  102. val: 'brokerage_price',
  103. type: 2,
  104. agent: false,
  105. img: '../../static/icon/xc2.png'
  106. },
  107. fh: {
  108. name: '分红额度',
  109. val: 'max_pool',
  110. type: 3,
  111. agent: false,
  112. img: '../../static/icon/xc3.png'
  113. },
  114. xfjf: {
  115. name: '消费积分',
  116. val: 'now_money',
  117. type:4,
  118. cz: true,
  119. agent: false,
  120. img: '../../static/icon/xc4.png'
  121. }
  122. }
  123. }
  124. },
  125. onLoad() {
  126. },
  127. onShow() {
  128. this.loadBaseData()
  129. },
  130. computed: {
  131. ...mapState('user',['userInfo','hasLogin'])
  132. },
  133. onPullDownRefresh() {
  134. this.loadBaseData('down')
  135. },
  136. methods: {
  137. ...mapMutations('user',['setUserInfo']),
  138. toTx() {
  139. let that = this
  140. if (!that.hasLogin) {
  141. // 保存地址
  142. saveUrl();
  143. // 登录拦截
  144. interceptor();
  145. } else {
  146. // uni.navigateTo({
  147. // url,
  148. // fail() {
  149. // uni.switchTab({
  150. // url
  151. // })
  152. // }
  153. // })
  154. if(that.userInfo.is_real == 1) {
  155. uni.showModal({
  156. title: "提示",
  157. content: '您提交的实名资料正在审核中,请耐心等待审核',
  158. showCancel:false
  159. })
  160. }else if(that.userInfo.is_real == 0) {
  161. uni.showModal({
  162. title: "提示",
  163. content: '您的账号未完成实名认证,是否立即完成实名认证?',
  164. complete(res) {
  165. if(res.confirm) {
  166. that.navto('/pages/user/smrz')
  167. }
  168. }
  169. })
  170. }else {
  171. that.navto('/pages/user/withdrawal')
  172. }
  173. }
  174. },
  175. loadBaseData(tit) {
  176. const obj = this
  177. getUserInfo({})
  178. .then(({
  179. data
  180. }) => {
  181. obj.setUserInfo(data);
  182. if(tit == 'down') {
  183. uni.stopPullDownRefresh();
  184. }
  185. })
  186. .catch(e => {
  187. console.log(e);
  188. if(tit == 'down') {
  189. uni.stopPullDownRefresh();
  190. }
  191. });
  192. },
  193. navto(url) {
  194. if (!this.hasLogin) {
  195. // 保存地址
  196. saveUrl();
  197. // 登录拦截
  198. interceptor();
  199. } else {
  200. uni.navigateTo({
  201. url,
  202. fail() {
  203. uni.switchTab({
  204. url
  205. })
  206. }
  207. })
  208. }
  209. },
  210. goft() {
  211. let that = this
  212. if(this.ftLoading) {
  213. return
  214. }
  215. this.ftLoading = true
  216. goft().then(res => {
  217. console.log(res);
  218. that.loadBaseData()
  219. })
  220. }
  221. }
  222. }
  223. </script>
  224. <style lang="scss" scoped>
  225. page {
  226. background-color: #fff;
  227. min-height: 100%;
  228. height: auto;
  229. }
  230. .top-box {
  231. position: relative;
  232. .box-bg {
  233. width: 100%;
  234. height: 396rpx;
  235. }
  236. .box-data {
  237. width: 100%;
  238. height: 200rpx;
  239. position:absolute;
  240. top: 0;
  241. bottom: 0;
  242. margin: auto;
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. font-size: 37rpx;
  247. font-weight: bold;
  248. color: #fff;
  249. .data-item {
  250. flex-grow: 1;
  251. text-align: center;
  252. .val {
  253. font-size: 55rpx;
  254. font-weight: 800;
  255. padding-bottom: 15rpx;
  256. }
  257. }
  258. .line {
  259. width: 2rpx;
  260. height: 74rpx;
  261. background: #FFFFFF;
  262. opacity: 0.35;
  263. }
  264. }
  265. }
  266. .center-box {
  267. position: relative;
  268. width: 670rpx;
  269. height: 186rpx;
  270. background: #FFFFFF;
  271. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50,50,52,0.06);
  272. border-radius: 20rpx;
  273. margin:-98rpx auto 0;
  274. font-size: 30rpx;
  275. font-weight: bold;
  276. color: #333333;
  277. .center-item {
  278. flex-grow: 1;
  279. flex-direction: column;
  280. justify-content: center;
  281. align-items: center;
  282. image {
  283. width: 55rpx;
  284. height: 55rpx;
  285. }
  286. .name {
  287. padding-top: 10rpx;
  288. }
  289. }
  290. .line {
  291. width: 2rpx;
  292. height: 74rpx;
  293. background: #eff1f5;
  294. }
  295. }
  296. .bottom-list {
  297. .list-item {
  298. width: 670rpx;
  299. height: 127rpx;
  300. // background-color: red;
  301. border-bottom:1px solid #E8E8E8;
  302. margin: auto;
  303. .logo {
  304. width: 81rpx;
  305. height: 81rpx;
  306. }
  307. .much {
  308. padding-left: 14rpx;
  309. flex-grow: 1;
  310. font-size: 30rpx;
  311. font-weight: bold;
  312. color: #333333;
  313. .val {
  314. padding-top: 15rpx;
  315. font-size: 22rpx;
  316. font-weight: 500;
  317. color: #999999;
  318. }
  319. }
  320. .btn {
  321. width: 127rpx;
  322. height: 52rpx;
  323. border: 2px solid #ff5050;
  324. border-radius: 26rpx;
  325. display: flex;
  326. justify-content: center;
  327. align-items: center;
  328. font-size: 26rpx;
  329. font-weight: 500;
  330. color: #ff5050;
  331. margin-right: 24rpx;
  332. }
  333. .more {
  334. font-size: 24rpx;
  335. font-weight: 500;
  336. color: #999999;
  337. padding-right: 14rpx;
  338. }
  339. .black {
  340. width: 16rpx;
  341. height: 27rpx;
  342. }
  343. }
  344. }
  345. .cg {
  346. display: block;
  347. width: 706rpx;
  348. height: 193rpx;
  349. margin: 30rpx auto 0;
  350. }
  351. .tit {
  352. font-size: 36rpx;
  353. font-weight: bold;
  354. color: #333333;
  355. padding:46rpx 0;
  356. width: 750rpx-92rpx;
  357. margin: auto;
  358. }
  359. </style>