integrateAccount.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <!-- 账户积分 -->
  3. <view class="" style="background-color: #ebebeb;">
  4. <view style="background-color: $color-white !important;">
  5. <u-navbar :back-text="i18n('Back')" :back-text-style="backStyle" back-icon-color="#fff" title-color="#fff"
  6. :background="background" title-width="300" :title="i18n('getPersonIntegrate')"></u-navbar>
  7. </view>
  8. <view class="content">
  9. <view class="user-info">
  10. <view class="user-pic">
  11. <image class="ui-pic-detail" :src="websiteUrl+picDetail.userPic" mode=""></image>
  12. <view class="user-grade-now">
  13. {{userInfos.levelName}}
  14. </view>
  15. </view>
  16. <view class="integrate-now"><text
  17. class="big-num">{{userInfos.point}}</text>{{$i18n.locale=='zh'?'积分':'Integral'}}</view>
  18. <u-button class=" get-integrate" type="custom" shape="circle" @tap="toListDetails">
  19. <text class="get-integrate-info">{{$i18n.locale=='zh'?'明细':'Detail'}}</text>
  20. </u-button>
  21. </view>
  22. <view class="container">
  23. <view class="container-title">{{$i18n.locale=='zh'?'热门兑换':'Hot for'}}</view>
  24. <view class="container-content" v-for="(InfoList,index) in ShopInfo" :key="index">
  25. <view class="content-left">
  26. <image :src="websiteUrl + InfoList.picture" class="left-pic">
  27. </image>
  28. <view class="littlt-pic">
  29. <image src="/static/fill-little.png" class="fire-pic" />TOP<text
  30. class="little-num">{{index}}</text>
  31. </view>
  32. </view>
  33. <view class="content-right">
  34. <view class="content-right-title">
  35. {{$i18n.locale=='zh'? InfoList.commodityName:InfoList.commodityNameEn}}
  36. </view>
  37. <view class="content-right-need">
  38. {{$i18n.locale=='zh'?'所需分值:':'The score'}}<text class="need-num">{{InfoList.point}}</text>
  39. </view>
  40. <view class="content-right-lost">
  41. <view class="lost-num">
  42. {{$i18n.locale=='zh'?'累计兑换量:':'Accumulated exchange:'}}{{InfoList.exchangeQuantity}}
  43. </view>
  44. <view class="lost-info">
  45. {{$i18n.locale=='zh'?`${InfoList.inventoryQuantity>=100?'库存充足':InfoList.inventoryQuantity}`:
  46. `${InfoList.inventoryQuantity>=100?"sufficientstock":InfoList.inventoryQuantity}`}}
  47. </view>
  48. </view>
  49. <button class="button-popup-success2" @tap="toShopInfo(InfoList.id)"
  50. v-if="InfoList.commodityStatus==2">
  51. <text class="button-text-success">{{$i18n.locale=='zh'?'立即兑换':'Immediately change'}}</text>
  52. </button>
  53. <button class="button-popup-success" @tap="toShopInfo(InfoList.id)" v-else>
  54. <text class="button-text-success">{{$i18n.locale=='zh'?'立即兑换':'Immediately change'}}</text>
  55. </button>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. background: {
  67. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  68. },
  69. backStyle: {
  70. color: '#FFFFFF',
  71. },
  72. picDetail: {},
  73. ShopInfo: {},
  74. userInfos: {},
  75. };
  76. },
  77. onShow() {
  78. this.getUserDetail();
  79. this.getUserInfo();
  80. this.getShoppingDetail();
  81. },
  82. methods: {
  83. i18n(data) {
  84. return this.$t('common.' + data);
  85. },
  86. toListDetails() {
  87. uni.navigateTo({
  88. url: './integrateListDetail'
  89. })
  90. },
  91. toGetIntegrate() {
  92. uni.navigateTo({
  93. url: './getIntegrate'
  94. })
  95. },
  96. toShopInfo(id) {
  97. uni.navigateTo({
  98. url: './userShopDetails?id=' + id
  99. })
  100. },
  101. async getUserInfo() {
  102. const res = await this.$myRequest({
  103. url: '/uc/userCenter/findBasicInfo',
  104. data: {},
  105. });
  106. this.picDetail = res.data
  107. await this.getUserDetail();
  108. },
  109. async getShoppingDetail() {
  110. const res = await this.$myRequest({
  111. url: '/uc/umsPointCommoditys/commodityList',
  112. data: {}
  113. });
  114. this.ShopInfo = res.data.pointCommoditys
  115. },
  116. async getUserDetail() {
  117. const res = await this.$myRequest({
  118. url: '/uc/umsUserPoints/getUserPoint',
  119. data: {
  120. }
  121. });
  122. this.userInfos = res.data.umsUserPoints[0]
  123. if (this.userInfos.levelName == '白银用户') {
  124. if (this.$i18n.locale == 'zh') {
  125. this.userInfos.levelName = '白银用户'
  126. } else {
  127. this.userInfos.levelName = 'Silver User'
  128. }
  129. } else if (this.userInfos.levelName == '黄金用户') {
  130. if (this.$i18n.locale == 'zh') {
  131. this.userInfos.levelName = '黄金用户'
  132. } else {
  133. this.userInfos.levelName = 'Gold User'
  134. }
  135. } else if (this.userInfos.levelName == '铂金用户') {
  136. if (this.$i18n.locale == 'zh') {
  137. this.userInfos.levelName = '铂金用户'
  138. } else {
  139. this.userInfos.levelName = 'Platinum User'
  140. }
  141. } else {
  142. if (this.$i18n.locale == 'zh') {
  143. this.userInfos.levelName = '星钻用户'
  144. } else {
  145. this.userInfos.levelName = 'Star User'
  146. }
  147. }
  148. },
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .content {
  154. width: 100%;
  155. height: 100%;
  156. .user-info {
  157. display: flex;
  158. justify-content: space-around;
  159. background-image: url('/static/bgc-user.png');
  160. background-size: 100%;
  161. height: 200rpx;
  162. position: relative;
  163. .user-pic {
  164. width: 20%;
  165. height: 73%;
  166. margin-top: 4%;
  167. margin-left: 4%;
  168. border-radius: 50%;
  169. background-color: #e9e9e9;
  170. overflow: hidden;
  171. .ui-pic-detail {
  172. width: 100%;
  173. height: 100%;
  174. }
  175. }
  176. .user-grade-now {
  177. font-size: 20rpx;
  178. width: 25%;
  179. text-align: center;
  180. transform: translateY(410%);
  181. border-radius: 50rpx;
  182. background-color: #DFAC74FF;
  183. z-index: 999;
  184. position: absolute;
  185. left: 2%;
  186. top: 30rpx;
  187. }
  188. }
  189. .integrate-now {
  190. width: 30%;
  191. text-align: center;
  192. margin-left: 11%;
  193. .big-num {
  194. display: block;
  195. font-size: 60rpx;
  196. font-weight: 700;
  197. margin-bottom: -8%;
  198. margin-top: 18%;
  199. }
  200. }
  201. .get-integrate {
  202. width: 30%;
  203. height: 26%;
  204. transform: translateX(50%) translateY(145%);
  205. background-color: #44D7B6FF;
  206. border: none;
  207. .get-integrate-info {
  208. font-size: 30rpx;
  209. color: #fff;
  210. transform: translateX(-85%);
  211. }
  212. }
  213. }
  214. .container {
  215. width: 100%;
  216. background-color: #fff;
  217. margin-top: 4%;
  218. .container-title {
  219. font-size: 36rpx;
  220. font-weight: 700;
  221. margin-left: 4%;
  222. padding-bottom: 12px;
  223. transform: translateY(20%);
  224. margin-bottom: 4%;
  225. }
  226. .container-content {
  227. width: 92%;
  228. margin-left: 4%;
  229. margin-bottom: 4%;
  230. display: flex;
  231. justify-content: space-between;
  232. .content-left {
  233. width: 34%;
  234. height: 300rpx;
  235. background-color: antiquewhite;
  236. .left-pic {
  237. width: 100%;
  238. height: 100%;
  239. }
  240. .littlt-pic {
  241. width: 120rpx;
  242. height: 30rpx;
  243. border-radius: 0 0 60rpx 0;
  244. background-color: #F29D43FF;
  245. transform: translateY(-1052%);
  246. font-size: 8rpx;
  247. color: #fff;
  248. line-height: 31rpx;
  249. .fire-pic {
  250. width: 20rpx;
  251. height: 20rpx;
  252. margin: 0 6rpx;
  253. }
  254. .little-num {
  255. margin-left: 4rpx;
  256. font-size: 26rpx;
  257. font-weight: 700;
  258. }
  259. }
  260. }
  261. .content-right {
  262. width: 65%;
  263. .content-right-title {
  264. font-size: 30rpx;
  265. font-weight: 700;
  266. color: #0B0B11FF;
  267. }
  268. .content-right-need {
  269. color: #0B0B11FF;
  270. margin-top: 16rpx;
  271. margin-bottom: 16rpx;
  272. margin-left: 4%;
  273. font-size: 24rpx;
  274. .need-num {
  275. color: #E02020FF;
  276. // margin-left: 6%;
  277. }
  278. }
  279. .content-right-lost {
  280. color: #0B0B11FF;
  281. display: flex;
  282. justify-content: space-between;
  283. margin-bottom: 18rpx;
  284. .lost-num {
  285. margin-left: 3%;
  286. font-size: 22rpx;
  287. }
  288. .lost-info {
  289. margin-right: 5%;
  290. font-size: 22rpx;
  291. }
  292. }
  293. .button-popup-success2 {
  294. color: deepskyblue;
  295. width: 40%;
  296. height: 48rpx;
  297. line-height: 48rpx;
  298. margin-left: 4%;
  299. font-size: 18rpx;
  300. border-radius: 50rpx;
  301. border: 1rpx solid #a6a9ad;
  302. background-color: #a6a9ad;
  303. .button-text-success {
  304. color: black;
  305. }
  306. }
  307. .button-popup-success {
  308. color: deepskyblue;
  309. width: 40%;
  310. height: 48rpx;
  311. line-height: 48rpx;
  312. margin-left: 4%;
  313. font-size: 18rpx;
  314. border-radius: 50rpx;
  315. border: 1rpx solid wheat;
  316. .button-text-success {
  317. color: black;
  318. }
  319. }
  320. }
  321. }
  322. }
  323. </style>