info.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <view class="pos-r padding-lr-sm" v-if="fetch && fetch.info" @click="Dever.close()">
  3. <use-tabbar :tabbar="false" />
  4. <!-- 我的余额区域 -->
  5. <view class="gold-section">
  6. <view class="dflex-b">
  7. <u-popover position="right" width="200px" v-if="fetch.info.exp > 0">
  8. <view class="title">{{fetch.info.name}}
  9. <view style="margin-left:5px;display: inline-block;">
  10. <u-icon name="question-circle"></u-icon>
  11. </view>
  12. </view>
  13. <template v-slot:content>
  14. <view style="color: white;">
  15. <u-parse :content="fetch.info.exp_tip"></u-parse>
  16. </view>
  17. </template>
  18. </u-popover>
  19. <view class="title" v-else>{{fetch.info.name}}</view>
  20. <!--
  21. <text class="link" @click="goToExplain">{{fetch.info.name}}说明</text>
  22. -->
  23. </view>
  24. <view class="balance-number margin-top-sm">
  25. <text class="price" v-if="fetch.user.status == 1">
  26. {{fetch.user.yue}}
  27. </text>
  28. <text class="price" v-if="fetch.user.status == 2">
  29. {{fetch.user.yue}} <span style="color:#bababa;margin-left:20rpx">[封]</span>
  30. </text>
  31. </view>
  32. <view class="dflex-b amount-summary">
  33. <view class="summary-item">
  34. <view class="label">入账</view>
  35. <view class="value">{{fetch.user.total}}</view>
  36. </view>
  37. <view class="summary-item">
  38. <view class="label">出账</view>
  39. <view class="value">{{fetch.user.used}}</view>
  40. </view>
  41. <view class="summary-item">
  42. <view class="label">冻结</view>
  43. <view class="value">{{fetch.user.frozen}}</view>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 功能卡片 -->
  48. <view class="dflex-b margin-top-sm" style="align-items: stretch;" v-if="fetch.info.button == 1">
  49. <view class="card-tile flex1" v-if="fetch.info.recharge == 1"
  50. @click="Dever.location('score/recharge?id=' + id)">
  51. <view class="iconfont iconmingxi icon" style="color: #ff696b;"></view>
  52. <view class="text-content">
  53. <view class="title">充值</view>
  54. <view class="desc">查看充值记录</view>
  55. </view>
  56. </view>
  57. <view class="card-tile flex1" v-if="fetch.info.withdraw == 1"
  58. @click="Dever.location('score/withdraw?id=' + id)">
  59. <view class="iconfont iconmingxi icon" style="color: #6f96f1;"></view>
  60. <view class="text-content">
  61. <view class="title">提现</view>
  62. <view class="desc">查看提现记录</view>
  63. </view>
  64. </view>
  65. <view class="card-tile flex1" v-if="fetch.info.exchange == 1"
  66. @click="Dever.location('score/exchange?id=' + id)">
  67. <view class="iconfont iconmingxi icon" style="color: #ffbc49;"></view>
  68. <view class="text-content">
  69. <view class="title">兑换</view>
  70. <view class="desc">查看兑换记录</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="dflex-b margin-top-sm" style="align-items: stretch;" v-if="fetch.info.button == 2">
  75. <view class="card-tile wpre-50 dflex-flow-c">
  76. <view class="desc">待审:<text class="price">{{fetch.user.withdraw_cash}}</text></view>
  77. <view class="dflex margin-top-sm" @click="Dever.location('score/withdraw?id=' + id)">
  78. <view class="iconfont iconmingxi icon" style="color: #6f96f1;"></view>
  79. <view class="text-content">
  80. <view class="title">提现</view>
  81. <view class="desc">查看提现记录</view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="wpre-50 ">
  86. <view class="card-tile" @click="Dever.location('score/recharge?id=' + id)">
  87. <view class="iconfont iconmingxi icon" style="color: #ff696b;"></view>
  88. <view class="text-content">
  89. <view class="title">充值</view>
  90. <view class="desc">查看充值记录</view>
  91. </view>
  92. </view>
  93. <view class="card-tile" @click="Dever.location('score/exchange?id=' + id)">
  94. <view class="iconfont iconmingxi icon" style="color: #ffbc49;"></view>
  95. <view class="text-content">
  96. <view class="title">兑换</view>
  97. <view class="desc">查看兑换记录</view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <!-- 记录列表 -->
  103. <view class="record-list margin-top-sm" v-if="fetch">
  104. <view class="record-title fs fwbd ft-black margin-bottom-sm">账单记录</view>
  105. <u-subsection :list="list" :current="current" @change="sectionChange" activeColor="#f56c6c"></u-subsection>
  106. <u-empty v-if="fetch['list_' + current] && fetch['list_' + current].length <= 0" marginTop="30" mode="data"
  107. text="暂无记录"></u-empty>
  108. <view v-else>
  109. <view class="record-item" v-for="(item, index) in fetch['list_' + current]" :key="index">
  110. <view class="record-left">
  111. <view class="record-name">{{ item.action_name }}</view>
  112. <view class="record-desc" v-if="item.desc">{{ item.desc }}</view>
  113. <view class="record-time">{{ item.cdate }}</view>
  114. </view>
  115. <view class="record-amount"
  116. :class="{ income: item.type == 1, expense: item.type == 2, lock: item.type == 3 }">
  117. <text v-if="item.type == 1">+</text>
  118. <text v-if="item.type == 3">待入账</text>
  119. <text>{{ item.amount }}</text>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <view class="safe-area-inset-bottom"></view>
  125. </view>
  126. </template>
  127. <script>
  128. export default {
  129. data() {
  130. return {
  131. list: ['全部', '入账', '出账', '冻结'],
  132. fetch: {},
  133. id: 0,
  134. current: 0,
  135. }
  136. },
  137. onLoad(options) {
  138. if (options && options.id) {
  139. this.id = options.id;
  140. } else {
  141. this.Dever.location('source/home');
  142. return;
  143. }
  144. },
  145. onShow() {
  146. this.loadData();
  147. this.loadList(1);
  148. },
  149. //下拉刷新
  150. onPullDownRefresh() {
  151. this.loadList(1);
  152. },
  153. //加载更多
  154. onReachBottom() {
  155. this.loadList(2);
  156. },
  157. methods: {
  158. loadData() {
  159. this.DeverApi.get(this, 'score.info', {
  160. id: this.id
  161. });
  162. },
  163. loadList(page) {
  164. this.DeverApi.page([page, 'list_' + this.current], this, 'score.log', {
  165. id: this.id,
  166. type: this.current
  167. });
  168. },
  169. sectionChange(index) {
  170. this.current = index;
  171. this.loadList(1)
  172. }
  173. }
  174. }
  175. </script>
  176. <style lang="scss">
  177. .gold-section {
  178. background: #ffffff;
  179. border-radius: 24rpx;
  180. padding: 32rpx;
  181. .dflex-b {
  182. display: flex;
  183. justify-content: space-between;
  184. align-items: center;
  185. }
  186. .title {
  187. font-size: 32rpx;
  188. font-weight: bold;
  189. color: #333;
  190. }
  191. .link {
  192. font-size: 24rpx;
  193. color: #ff9800;
  194. text-decoration: underline;
  195. }
  196. .balance-number {
  197. margin-top: 20rpx;
  198. .price {
  199. font-size: 48rpx;
  200. color: #ff9800;
  201. font-weight: bold;
  202. }
  203. }
  204. .amount-summary {
  205. display: flex;
  206. justify-content: space-between;
  207. margin-top: 32rpx;
  208. .summary-item {
  209. flex: 1;
  210. display: flex;
  211. flex-direction: column;
  212. .label {
  213. font-size: 24rpx;
  214. color: #888;
  215. }
  216. .value {
  217. margin-top: 10rpx;
  218. font-size: 30rpx;
  219. font-weight: 600;
  220. color: #333;
  221. }
  222. }
  223. }
  224. }
  225. .card-tile {
  226. border-radius: 24rpx;
  227. padding: 30rpx;
  228. background: #ffffff;
  229. display: flex;
  230. align-items: center;
  231. justify-content: center;
  232. transition: all 0.2s ease-in-out;
  233. .icon {
  234. font-size: 60rpx;
  235. margin-right: 24rpx;
  236. }
  237. .text-content {
  238. display: flex;
  239. flex-direction: column;
  240. .title {
  241. font-size: 30rpx;
  242. font-weight: 600;
  243. color: #333;
  244. }
  245. .desc {
  246. font-size: 24rpx;
  247. color: #999;
  248. margin-top: 6rpx;
  249. }
  250. }
  251. &:active {
  252. transform: scale(0.97);
  253. }
  254. &:first-child {
  255. margin-right: 10rpx;
  256. }
  257. }
  258. .wpre-50 .card-tile {
  259. &:first-child {
  260. margin-bottom: 12rpx;
  261. margin-right: 0rpx;
  262. }
  263. }
  264. .record-list {
  265. background: #ffffff;
  266. border-radius: 20rpx;
  267. padding: 30rpx;
  268. .record-title {
  269. font-size: 30rpx;
  270. font-weight: bold;
  271. color: #333;
  272. }
  273. .record-item {
  274. display: flex;
  275. justify-content: space-between;
  276. align-items: center;
  277. padding: 20rpx 0;
  278. border-bottom: 1px solid #f0f0f0;
  279. &:last-child {
  280. border-bottom: none;
  281. }
  282. .record-left {
  283. display: flex;
  284. flex-direction: column;
  285. .record-name {
  286. font-size: 28rpx;
  287. color: #333;
  288. }
  289. .record-desc {
  290. font-size: 28rpx;
  291. color: #999;
  292. }
  293. .record-time {
  294. font-size: 24rpx;
  295. color: #999;
  296. margin-top: 6rpx;
  297. }
  298. }
  299. .record-amount {
  300. font-size: 28rpx;
  301. font-weight: bold;
  302. &.income {
  303. color: #4caf50;
  304. }
  305. &.expense {
  306. color: #f44336;
  307. }
  308. &.lock {
  309. color: #999;
  310. }
  311. }
  312. }
  313. }
  314. .empty-record {
  315. text-align: center;
  316. padding: 60rpx 0;
  317. .empty-icon {
  318. width: 160rpx;
  319. height: 160rpx;
  320. margin-bottom: 20rpx;
  321. opacity: 0.6;
  322. }
  323. .empty-text {
  324. font-size: 28rpx;
  325. color: #999;
  326. }
  327. }
  328. </style>