integral.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view>
  3. <view class="top">
  4. <image src="./img/jifen.jpg" mode="aspectFill"></image>
  5. <view class="inner">
  6. <view class="name">总积分</view>
  7. <view class="total">{{total}}</view>
  8. </view>
  9. </view>
  10. <view class="content">
  11. <view class="title">
  12. <view class="text">积分规则</view>
  13. <view class="more" @click="go_more()">积分明细 <uni-icons type="arrowright" color="#999" size="11"></uni-icons>
  14. </view>
  15. </view>
  16. <view class="list">
  17. <view class="item">
  18. <view class="left">
  19. <view class="type">签到</view>
  20. <view class="text">1分/每日首次登录</view>
  21. <view class="box">
  22. <slider block-size="0" disabled :min="1" :max="1"/>
  23. <view class="text"> 已获1分/每日上限1分</view>
  24. </view>
  25. </view>
  26. <view class="right">
  27. <view class="tip" v-if="is_finish == 0" style="background-color: #94BA2B;color: #FFFFFF;">未完成</view>
  28. <view class="tip" v-if="is_finish == 1">已完成</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. // 完成状态
  40. is_finish:0,
  41. // 总积分
  42. total:0
  43. };
  44. },
  45. onLoad() {
  46. this.get_staff_integral_list()
  47. //查询员工积分
  48. this.get_staff_integral_query()
  49. },
  50. methods:{
  51. //查询员工积分
  52. get_staff_integral_query() {
  53. this.$api.staff_integral_query({
  54. staff_num: uni.getStorageSync('user').staff_num
  55. }).then((res) => {
  56. // console.log(res)
  57. this.total = res.data.content.data.integral_sum
  58. })
  59. },
  60. get_staff_integral_list(){
  61. this.$api.staff_integral_list({
  62. staff_num: uni.getStorageSync('user').staff_num,
  63. integral_type: 1
  64. }).then((res)=>{
  65. // console.log(res.data.content.data)
  66. this.is_finish = res.data.content.data.is_finish
  67. })
  68. },
  69. // 积分明细
  70. go_more(){
  71. uni.navigateTo({
  72. url:"./detail/detail"
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. .top{
  80. image{
  81. width: 750rpx;
  82. height: 340rpx;
  83. }
  84. position: relative;
  85. .inner{
  86. position: absolute;
  87. top: 0;
  88. left: 0;
  89. width: 750rpx;
  90. text-align: center;
  91. color: #FFFFFF;
  92. .name{
  93. margin-top: 140rpx;
  94. font-size: 32rpx;
  95. }
  96. .total{
  97. font-size: 68rpx;
  98. line-height: 150rpx;
  99. }
  100. }
  101. }
  102. .content {
  103. background-color: #FFFFFF;
  104. box-sizing: border-box;
  105. padding: 50rpx 25rpx;
  106. }
  107. .title {
  108. display: flex;
  109. align-items: baseline;
  110. justify-content: space-between;
  111. .text {
  112. font-size: 36rpx;
  113. }
  114. .more {
  115. font-size: 26rpx;
  116. color: #999;
  117. }
  118. }
  119. .list{
  120. margin-top: 40rpx;
  121. .item{
  122. display: flex;
  123. justify-content: space-between;
  124. align-items: center;
  125. // height: 150rpx;
  126. .left{
  127. font-size: 28rpx;
  128. line-height: 50rpx;
  129. .type{
  130. font-size: 32rpx;
  131. }
  132. .text{
  133. color: #999;
  134. }
  135. .box{
  136. display: flex;
  137. align-items: center;
  138. slider{
  139. margin: 0;
  140. width: 100rpx;
  141. }
  142. .text{
  143. margin-left: 20rpx;
  144. color: #999;
  145. }
  146. }
  147. }
  148. .right{
  149. .tip{
  150. padding: 10rpx 20rpx;
  151. background-color: #e9e9e9;
  152. color: #666;
  153. font-size: 24rpx;
  154. }
  155. }
  156. }
  157. }
  158. </style>