gold.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="huazhi-box">
  3. <Navbar title="我的绿通" color="#333"></Navbar>
  4. <view class="content">
  5. <view class="bk"></view>
  6. <view class="info">
  7. <view class="bottom">
  8. <view class="item">
  9. <view class="tip">可用绿通</view>
  10. <view class="num">{{info.gold}}</view>
  11. <view class="tip">我的绿通:{{info.lockedGold}}</view>
  12. </view>
  13. <view class="title">
  14. 绿通兑换产品系数(1 : {{info.goldOfficialPrice}})
  15. </view>
  16. </view>
  17. <view class="box">
  18. <view class="item-box">
  19. <view class="item" @click="toPage('/packages/user/fund/record-all', {classify: 5, name: '空投奖励'})">
  20. <view class="left">
  21. <image :src="static ? static + 'gold-01.png' : ''" class="pic" mode="widthFix"></image>
  22. <text>空投奖励</text>
  23. </view>
  24. <div class="right">
  25. {{info.airDropped}}
  26. <text class="icon">&#xe84a;</text>
  27. </div>
  28. </view>
  29. </view>
  30. <view class="item-box">
  31. <view class="item" @click="toPage('/packages/user/fund/record-all', {classify: 6, name: '打赏记录'})">
  32. <view class="left">
  33. <image :src="static ? static + 'gold-02.png' : ''" class="pic" mode="widthFix"></image>
  34. <text>打赏记录</text>
  35. </view>
  36. <view class="right">
  37. {{info.rewardNum}}条
  38. <text class="icon">&#xe84a;</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="item-box">
  43. <view class="item" @click="toPage('/packages/user/fund/record-all', {classify: 8, name: 'KPI考核'})">
  44. <view class="left">
  45. <image :src="static ? static + 'gold-03.png' : ''" class="pic" mode="widthFix"></image>
  46. <text>KPI考核</text>
  47. </view>
  48. <view class="right">
  49. {{info.kpiTotal}}条
  50. <text class="icon">&#xe84a;</text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="item-box">
  55. <view class="item" @click="toPage('/packages/user/fund/record-all', {classify: 7, name: '绿通互转记录'})">
  56. <view class="left">
  57. <image :src="static ? static + 'gold-04.png' : ''" class="pic" mode="widthFix"></image>
  58. <text>绿通互转记录</text>
  59. </view>
  60. <view class="right">
  61. {{info.goldTransferNum}}条
  62. <text class="icon">&#xe84a;</text>
  63. <!-- <IconText class="icon" :code="`\ue84a`" color="#999" size='12'></IconText> -->
  64. </view>
  65. </view>
  66. </view>
  67. <view class="item-box">
  68. <view class="item" @click="toPage('/packages/user/fund/record-all', {classify: 9, name: '订单记录'})">
  69. <view class="left">
  70. <image :src="static ? static + 'gold-05.png' : ''" class="pic" mode="widthFix"></image>
  71. <text>订单记录</text>
  72. </view>
  73. <view class="right">
  74. {{info.orderTotal}}条
  75. <text class="icon">&#xe84a;</text>
  76. <!-- <IconText class="icon" :code="`\ue84a`" color="#999" size='12'></IconText> -->
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script lang='ts'>
  86. import {
  87. Component,
  88. Prop,
  89. Vue
  90. } from 'vue-property-decorator';
  91. import {
  92. OSS_STATIC
  93. } from '@/common/constants';
  94. @Component({
  95. filters: {
  96. moneyFormat(val: any) {
  97. if (!+val) return '0.00';
  98. return (+val).toFixed(2);
  99. },
  100. moneyFormat2(val: any) {
  101. if (!+val) return '0.000000000000000000';
  102. return (+val).toFixed(18);
  103. }
  104. }
  105. })
  106. export default class Huazhi extends Vue {
  107. static: string = OSS_STATIC;
  108. info: any = {};
  109. onShow() {
  110. this.getInfo();
  111. }
  112. toPage(url: any, data: any) {
  113. if (!url) {
  114. uni.showToast({
  115. title: '敬请期待',
  116. icon: 'none'
  117. })
  118. return;
  119. }
  120. this.$Router.push({
  121. path: url,
  122. query: data
  123. })
  124. }
  125. getInfo() {
  126. this.$http
  127. .get({
  128. url: this.$api.getHuazhi
  129. })
  130. .then((res: any) => {
  131. this.info = res;
  132. }, (err: any) => {
  133. console.log(err);
  134. });
  135. }
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .huazhi-box {
  140. .content {
  141. @include flex-y();
  142. .bk {
  143. width: vw(800);
  144. height: vw(800);
  145. background: #6ABCE6;
  146. border-radius: vw(300);
  147. position: absolute;
  148. left: 50%;
  149. transform: translateX(-50%);
  150. top: vw(-600);
  151. }
  152. .info {
  153. position: relative;
  154. z-index: 10;
  155. margin-top: vw(30);
  156. .top {
  157. @include flex-x();
  158. }
  159. .bottom {
  160. background: #fff;
  161. width: vw(355);
  162. border-radius: vw(10);
  163. // margin-top: vw(20);
  164. overflow: hidden;
  165. .title {
  166. height: vw(50);
  167. line-height: vw(50);
  168. background: #F2F9FF;
  169. @include word-vw(12, #333);
  170. text-align: center;
  171. margin-top: vw(20);
  172. }
  173. .item {
  174. @include flex-y();
  175. flex: 1;
  176. }
  177. .name {
  178. @include word-vw(14, #333);
  179. }
  180. .num {
  181. @include word-vw(24, #333);
  182. font-weight: bold;
  183. margin-top: vw(12);
  184. }
  185. .tip {
  186. text-align: center;
  187. box-sizing: border-box;
  188. @include word-vw(12, #999);
  189. margin-top: vw(15);
  190. }
  191. .balance {
  192. @include flex-y();
  193. padding-top: vw(18);
  194. @include word-vw(24, #000);
  195. font-weight: bold;
  196. margin-bottom: vw(6);
  197. .btn {
  198. margin-top: vw(12);
  199. @include solid-btn(100, 24, #fff, 12);
  200. @include word-vw(12, #fff);
  201. }
  202. }
  203. }
  204. .box {
  205. @include flex-y();
  206. width: 100%;
  207. margin-top: vw(20);
  208. .item-box {
  209. width: 100%;
  210. @include flex-x();
  211. }
  212. .item {
  213. width: 100%;
  214. height: vw(66);
  215. flex-shrink: 1;
  216. @include flex-x();
  217. box-sizing: border-box;
  218. @include word-vw(14, #A8A8A8);
  219. background: #fff;
  220. margin-top: vw(10);
  221. border-radius: vw(10);
  222. padding: 0 vw(18);
  223. .left{
  224. @include flex-x();
  225. flex-shrink: 0;
  226. image {
  227. width: vw(18);
  228. // height: vw(36);
  229. margin-right: vw(8);
  230. }
  231. }
  232. .right {
  233. @include flex-x(center, center);
  234. @include word-vw(12, #999);
  235. white-space: nowrap;
  236. flex-wrap: nowrap;
  237. flex-shrink: 0;
  238. .icon {
  239. // @include word-vw(14, #333);
  240. margin-left: vw(8);
  241. font-family: 'iconfont';
  242. font-size: vw(12);
  243. }
  244. }
  245. }
  246. }
  247. }
  248. }
  249. }
  250. </style>