usert.vue 6.9 KB

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