index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view :style="viewColor">
  3. <view class='my-account'>
  4. <view class='wrapper'>
  5. <view class='header'>
  6. <view class='headerCon'>
  7. <view class='account acea-row row-top row-between'>
  8. <view class='assets'>
  9. <view>总资产(元)</view>
  10. <view class='money'>{{userInfo.now_money || 0}}</view>
  11. </view>
  12. <!-- #ifdef APP-PLUS || H5 -->
  13. <navigator v-if="recharge_switch == 1" url="/pages/users/user_payment/index" hover-class="none" class='recharge t-color'>充值</navigator>
  14. <!-- #endif -->
  15. <!-- #ifdef MP -->
  16. <view v-if="recharge_switch == 1" @click="openSubscribe('/pages/users/user_payment/index')" class='recharge t-color'>充值</view>
  17. <!-- #endif -->
  18. </view>
  19. <view class='cumulative acea-row row-top'>
  20. <!-- v-if="balance_func_status == 1" -->
  21. <view class='item' >
  22. <view>累计充值(元)</view>
  23. <view class='money'>{{userInfo.total_recharge || 0}}</view>
  24. </view>
  25. <view class='item'>
  26. <view>累计消费(元)</view>
  27. <view class='money'>{{userInfo.total_consume || 0}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class='nav acea-row row-middle'>
  33. <navigator class='item' hover-class='none' url='/pages/users/user_bill/index'>
  34. <view class='pictrue'>
  35. <image :src="domain+'/static/diy/record1'+keyColor+'.png'"></image>
  36. </view>
  37. <view>账单记录</view>
  38. </navigator>
  39. <navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=1'>
  40. <view class='pictrue'>
  41. <image :src="domain+'/static/diy/record2'+keyColor+'.png'"></image>
  42. </view>
  43. <view>消费记录</view>
  44. </navigator>
  45. <navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=2'>
  46. <view class='pictrue'>
  47. <image :src="domain+'/static/diy/record3'+keyColor+'.png'"></image>
  48. </view>
  49. <view>充值记录</view>
  50. </navigator>
  51. </view>
  52. </view>
  53. <recommend v-if="recommend_switch == 1" :hostProduct="hostProduct" :isLogin="isLogin"></recommend>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. // +----------------------------------------------------------------------
  59. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  60. // +----------------------------------------------------------------------
  61. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  62. // +----------------------------------------------------------------------
  63. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  64. // +----------------------------------------------------------------------
  65. // | Author: CRMEB Team <admin@crmeb.com>
  66. // +----------------------------------------------------------------------
  67. let app = getApp();
  68. import { getProductHot } from '@/api/store.js';
  69. import { openRechargeSubscribe } from '@/utils/SubscribeMessage.js';
  70. import { getUserInfo } from '@/api/user.js';
  71. import { mapGetters } from "vuex";
  72. import recommend from '@/components/recommend/index';
  73. import { configMap } from '@/utils';
  74. import { HTTP_REQUEST_URL } from '@/config/app';
  75. import { toLogin } from '@/libs/login.js';
  76. export default {
  77. components: {
  78. recommend,
  79. },
  80. data() {
  81. return {
  82. domain: HTTP_REQUEST_URL,
  83. userInfo: {},
  84. hostProduct: [],
  85. isClose: false,
  86. activity: {},
  87. hotScroll:false,
  88. hotPage:1,
  89. hotLimit:10
  90. };
  91. },
  92. computed: configMap(['recharge_switch','balance_func_status','recommend_switch'], mapGetters(['isLogin','viewColor','keyColor'])),
  93. onLoad() {
  94. if (this.isLogin) {
  95. this.getUserInfo()
  96. this.get_host_product();
  97. } else {
  98. toLogin()
  99. }
  100. },
  101. onReady() {
  102. },
  103. methods: {
  104. getUserInfo(){
  105. getUserInfo().then(res=>{
  106. this.userInfo = res.data
  107. })
  108. },
  109. // #ifdef MP
  110. openSubscribe: function(page) {
  111. uni.showLoading({
  112. title: '正在加载',
  113. })
  114. openRechargeSubscribe().then(res => {
  115. uni.hideLoading();
  116. uni.navigateTo({
  117. url: page,
  118. });
  119. }).catch(() => {
  120. uni.hideLoading();
  121. });
  122. },
  123. // #endif
  124. /**
  125. * 获取我的推荐
  126. */
  127. get_host_product: function() {
  128. let that = this;
  129. if(that.hotScroll) return
  130. getProductHot(
  131. that.hotPage,
  132. that.hotLimit,
  133. ).then(res => {
  134. that.hotPage++
  135. that.hotScroll = res.data.list.length<that.hotLimit
  136. that.hostProduct = that.hostProduct.concat(res.data.list)
  137. });
  138. }
  139. },
  140. onReachBottom() {
  141. this.get_host_product();
  142. },
  143. // 滚动监听
  144. onPageScroll(e) {
  145. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  146. uni.$emit('scroll');
  147. }
  148. }
  149. </script>
  150. <style scoped lang="scss">
  151. .my-account .wrapper {
  152. background-color: #fff;
  153. padding: 32rpx 0 34rpx 0;
  154. margin-bottom: 14rpx;
  155. }
  156. .my-account .wrapper .header {
  157. width: 690rpx;
  158. height: 330rpx;
  159. background-image: linear-gradient(to right, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
  160. border-radius: 16rpx;
  161. margin: 0 auto;
  162. box-sizing: border-box;
  163. color: rgba(255, 255, 255, 0.6);
  164. font-size: 24rpx;
  165. }
  166. .t-color{color:var(--view-theme);}
  167. .my-account .wrapper .header .headerCon {
  168. background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArIAAAFKCAYAAADhULxpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG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iyeP4jZAGANLWh4OQYELIAQBIbChCyAECcuuxgdgwIWQAgSX3UtTQfdyFkAYAwPu5CyAIAcXzchZAFAOKMzcddCFkAIPD57vpZhCwAEMXHXQhZACBSzcUOjgEhCwAkOa8/ELIAQNQz3aUHCFkAII65WIQsABCnNhSYi0XIAgBRal+suViELAAQ9xy3LxYhCwDEqYg1F4uQBQCi1PWzJ8eAkAUAktSHXVZtIWQdAQDEMRcLQhYA4riCFoQsAMSpmdjJMYCQBYAktZ3ASAEIWQCIM3tug5AFgDQ1UuD2LhCyABDFSAEIWQCINHleg5AFgDRDs6UAhCwABFocAQhZAEhjpACELABEPp9nxwBCFgDS2FIAQhYA4oztbW8sIGQBIIadsSBkASDSvMYsIGQBIEbtjHUNLQhZAIhjpACELADEqTexg2MAIQsASWom1s5YELIAEGdqPvACIQsAgc/hyTGAkAWAND7wAiELAHFOzQ1eIGQBIJAPvEDIAkAc67ZAyAJAHOu2QMgCQCTrtkDIAkCcCtizYwAhCwBp5uZtLAhZAAh85nobC0IWAOL4wAuELADEqVVbo2MAIQsAaSZHAEIWANJ4GwtCFgAimY2FnfwSYABJ5w5fwq1SbwAAAABJRU5ErkJggg==');
  169. background-repeat: no-repeat;
  170. background-size: 100%;
  171. height: 100%;
  172. width: 100%;
  173. padding: 36rpx 0 29rpx 0;
  174. box-sizing: border-box;
  175. }
  176. .my-account .wrapper .header .headerCon .account {
  177. padding: 0 35rpx;
  178. }
  179. .my-account .wrapper .header .headerCon .account .assets .money {
  180. font-size: 72rpx;
  181. color: #fff;
  182. }
  183. .my-account .wrapper .header .headerCon .account .recharge {
  184. font-size: 28rpx;
  185. width: 150rpx;
  186. height: 54rpx;
  187. border-radius: 27rpx;
  188. background-color: #fff9f8;
  189. text-align: center;
  190. line-height: 54rpx;
  191. }
  192. .my-account .wrapper .header .headerCon .cumulative {
  193. margin-top: 46rpx;
  194. }
  195. .my-account .wrapper .header .headerCon .cumulative .item {
  196. flex: 1;
  197. padding-left: 35rpx;
  198. }
  199. .my-account .wrapper .header .headerCon .cumulative .item .money {
  200. font-size: 48rpx;
  201. color: #fff;
  202. margin-top: 6rpx;
  203. }
  204. .my-account .wrapper .nav {
  205. height: 155rpx;
  206. border-bottom: 1px solid #f5f5f5;
  207. }
  208. .my-account .wrapper .nav .item {
  209. flex: 1;
  210. text-align: center;
  211. font-size: 26rpx;
  212. color: #999;
  213. }
  214. .my-account .wrapper .nav .item .pictrue {
  215. width: 44rpx;
  216. height: 44rpx;
  217. margin: 0 auto;
  218. margin-bottom: 20rpx;
  219. }
  220. .my-account .wrapper .nav .item .pictrue image {
  221. width: 100%;
  222. height: 100%;
  223. }
  224. .my-account .wrapper .advert {
  225. padding: 0 30rpx;
  226. margin-top: 30rpx;
  227. }
  228. .my-account .wrapper .advert .item {
  229. background-color: #fff6d1;
  230. width: 332rpx;
  231. height: 118rpx;
  232. border-radius: 10rpx;
  233. padding: 0 27rpx 0 25rpx;
  234. box-sizing: border-box;
  235. font-size: 24rpx;
  236. color: #e44609;
  237. }
  238. .my-account .wrapper .advert .item.on {
  239. background-color: #fff3f3;
  240. color: #e96868;
  241. }
  242. .my-account .wrapper .advert .item .pictrue {
  243. width: 78rpx;
  244. height: 78rpx;
  245. }
  246. .my-account .wrapper .advert .item .pictrue image {
  247. width: 100%;
  248. height: 100%;
  249. }
  250. .my-account .wrapper .advert .item .text .name {
  251. font-size: 30rpx;
  252. font-weight: bold;
  253. color: #f33c2b;
  254. margin-bottom: 7rpx;
  255. }
  256. .my-account .wrapper .advert .item.on .text .name {
  257. color: #f64051;
  258. }
  259. .my-account .wrapper .list {
  260. padding: 0 30rpx;
  261. }
  262. .my-account .wrapper .list .item {
  263. margin-top: 44rpx;
  264. }
  265. .my-account .wrapper .list .item .picTxt .iconfont {
  266. width: 82rpx;
  267. height: 82rpx;
  268. border-radius: 50%;
  269. background-image: linear-gradient(to right, #ff9389 0%, #f9776b 100%);
  270. text-align: center;
  271. line-height: 82rpx;
  272. color: #fff;
  273. font-size: 40rpx;
  274. }
  275. .my-account .wrapper .list .item .picTxt .iconfont.yellow {
  276. background-image: linear-gradient(to right, #ffccaa 0%, #fea060 100%);
  277. }
  278. .my-account .wrapper .list .item .picTxt .iconfont.green {
  279. background-image: linear-gradient(to right, #a1d67c 0%, #9dd074 100%);
  280. }
  281. .my-account .wrapper .list .item .picTxt {
  282. width: 428rpx;
  283. font-size: 30rpx;
  284. color: #282828;
  285. }
  286. .my-account .wrapper .list .item .picTxt .text {
  287. width: 317rpx;
  288. }
  289. .my-account .wrapper .list .item .picTxt .text .infor {
  290. font-size: 24rpx;
  291. color: #999;
  292. margin-top: 5rpx;
  293. }
  294. .my-account .wrapper .list .item .bnt {
  295. font-size: 26rpx;
  296. color: #282828;
  297. width: 156rpx;
  298. height: 52rpx;
  299. border: 1rpx solid #ddd;
  300. border-radius: 26rpx;
  301. text-align: center;
  302. line-height: 52rpx;
  303. }
  304. .my-account .wrapper .list .item .bnt.end {
  305. font-size: 26rpx;
  306. color: #aaa;
  307. background-color: #f2f2f2;
  308. border-color: #f2f2f2;
  309. }
  310. </style>