usert.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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/cg.png" 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. methods: {
  128. ...mapMutations('user',['setUserInfo']),
  129. toTx() {
  130. let that = this
  131. if (!that.hasLogin) {
  132. // 保存地址
  133. saveUrl();
  134. // 登录拦截
  135. interceptor();
  136. } else {
  137. // uni.navigateTo({
  138. // url,
  139. // fail() {
  140. // uni.switchTab({
  141. // url
  142. // })
  143. // }
  144. // })
  145. if(that.userInfo.is_real == 1) {
  146. uni.showModal({
  147. title: "提示",
  148. content: '您提交的实名资料正在审核中,请耐心等待审核',
  149. showCancel:false
  150. })
  151. }else if(that.userInfo.is_real == 0) {
  152. uni.showModal({
  153. title: "提示",
  154. content: '您的账号未完成实名认证,是否立即完成实名认证?',
  155. complete(res) {
  156. if(res.confirm) {
  157. that.navto('/pages/user/smrz')
  158. }
  159. }
  160. })
  161. }else {
  162. that.navto('/pages/user/withdrawal')
  163. }
  164. }
  165. },
  166. loadBaseData() {
  167. const obj = this
  168. getUserInfo({})
  169. .then(({
  170. data
  171. }) => {
  172. obj.setUserInfo(data);
  173. })
  174. .catch(e => {
  175. console.log(e);
  176. });
  177. },
  178. navto(url) {
  179. if (!this.hasLogin) {
  180. // 保存地址
  181. saveUrl();
  182. // 登录拦截
  183. interceptor();
  184. } else {
  185. uni.navigateTo({
  186. url,
  187. fail() {
  188. uni.switchTab({
  189. url
  190. })
  191. }
  192. })
  193. }
  194. },
  195. goft() {
  196. if(this.ftLoading) {
  197. return
  198. }
  199. this.ftLoading = true
  200. goft().then(res => {
  201. console.log(res);
  202. })
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="scss" scoped>
  208. page {
  209. background-color: #fff;
  210. min-height: 100%;
  211. height: auto;
  212. }
  213. .top-box {
  214. position: relative;
  215. .box-bg {
  216. width: 100%;
  217. height: 396rpx;
  218. }
  219. .box-data {
  220. width: 100%;
  221. height: 200rpx;
  222. position:absolute;
  223. top: 0;
  224. bottom: 0;
  225. margin: auto;
  226. display: flex;
  227. justify-content: center;
  228. align-items: center;
  229. font-size: 37rpx;
  230. font-weight: bold;
  231. color: #fff;
  232. .data-item {
  233. flex-grow: 1;
  234. text-align: center;
  235. .val {
  236. font-size: 55rpx;
  237. font-weight: 800;
  238. padding-bottom: 15rpx;
  239. }
  240. }
  241. .line {
  242. width: 2rpx;
  243. height: 74rpx;
  244. background: #FFFFFF;
  245. opacity: 0.35;
  246. }
  247. }
  248. }
  249. .center-box {
  250. position: relative;
  251. width: 670rpx;
  252. height: 186rpx;
  253. background: #FFFFFF;
  254. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50,50,52,0.06);
  255. border-radius: 20rpx;
  256. margin:-98rpx auto 0;
  257. font-size: 30rpx;
  258. font-weight: bold;
  259. color: #333333;
  260. .center-item {
  261. flex-grow: 1;
  262. flex-direction: column;
  263. justify-content: center;
  264. align-items: center;
  265. image {
  266. width: 55rpx;
  267. height: 55rpx;
  268. }
  269. .name {
  270. padding-top: 10rpx;
  271. }
  272. }
  273. .line {
  274. width: 2rpx;
  275. height: 74rpx;
  276. background: #eff1f5;
  277. }
  278. }
  279. .bottom-list {
  280. .list-item {
  281. width: 670rpx;
  282. height: 127rpx;
  283. // background-color: red;
  284. border-bottom:1px solid #E8E8E8;
  285. margin: auto;
  286. .logo {
  287. width: 81rpx;
  288. height: 81rpx;
  289. }
  290. .much {
  291. padding-left: 14rpx;
  292. flex-grow: 1;
  293. font-size: 30rpx;
  294. font-weight: bold;
  295. color: #333333;
  296. .val {
  297. padding-top: 15rpx;
  298. font-size: 22rpx;
  299. font-weight: 500;
  300. color: #999999;
  301. }
  302. }
  303. .btn {
  304. width: 127rpx;
  305. height: 52rpx;
  306. border: 2px solid #ff5050;
  307. border-radius: 26rpx;
  308. display: flex;
  309. justify-content: center;
  310. align-items: center;
  311. font-size: 26rpx;
  312. font-weight: 500;
  313. color: #ff5050;
  314. margin-right: 24rpx;
  315. }
  316. .more {
  317. font-size: 24rpx;
  318. font-weight: 500;
  319. color: #999999;
  320. padding-right: 14rpx;
  321. }
  322. .black {
  323. width: 16rpx;
  324. height: 27rpx;
  325. }
  326. }
  327. }
  328. .cg {
  329. display: block;
  330. width: 706rpx;
  331. height: 193rpx;
  332. margin: 30rpx auto 0;
  333. }
  334. .tit {
  335. font-size: 36rpx;
  336. font-weight: bold;
  337. color: #333333;
  338. padding:46rpx 0;
  339. width: 750rpx-92rpx;
  340. margin: auto;
  341. }
  342. </style>