record.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <app-layout>
  3. <view class="info dir-left-nowrap" :style="{backgroundImage: `url(${community.log})`}">
  4. <view class="info-item dir-top-nowrap main-center">
  5. <view>订单总数(笔)</view>
  6. <view class="num">{{detail.order_num}}</view>
  7. </view>
  8. <view class="line"></view>
  9. <view class="info-item dir-top-nowrap main-center">
  10. <view>本团收入(元)</view>
  11. <view class="num">{{detail.order_price}}</view>
  12. </view>
  13. </view>
  14. <view class="number dir-left-nowrap">
  15. <view class="number-item dir-top-nowrap main-center box-grow-1">
  16. <view>参与人数</view>
  17. <view class="num">{{detail.user_num}}</view>
  18. </view>
  19. <view class="number-item dir-top-nowrap main-center box-grow-1">
  20. <view>浏览人数</view>
  21. <view class="num">{{detail.log_num}}</view>
  22. </view>
  23. <view class="number-item dir-top-nowrap main-center box-grow-1">
  24. <view class="label">转化率</view>
  25. <view class="num">{{rate}}%</view>
  26. </view>
  27. </view>
  28. <view class="list">
  29. <view class="item main-between cross-center" v-for="(item,index) in detail.list" :key="index">
  30. <view class="dir-left-nowrap cross-center">
  31. <view class="index">{{item.index}}</view>
  32. <view class="avatar">
  33. <image :src="item.avatar"></image>
  34. </view>
  35. <view class="nickname t-omit">{{item.nickname}}</view>
  36. </view>
  37. <view class="time">{{item.created_at}}</view>
  38. </view>
  39. </view>
  40. </app-layout>
  41. </template>
  42. <script>
  43. import {mapGetters, mapState} from 'vuex';
  44. export default {
  45. data() {
  46. return {
  47. id: 0,
  48. rate: 0,
  49. detail: {
  50. list: [],
  51. log_num: '0',
  52. user_num: '0',
  53. order_price: '0',
  54. order_num: '0',
  55. },
  56. }
  57. },
  58. components: {
  59. },
  60. computed: {
  61. ...mapGetters('mallConfig', {
  62. getTheme: 'getTheme',
  63. }),
  64. ...mapState({
  65. stock: state => state.mallConfig.__wxapp_img.stock,
  66. community: state => state.mallConfig.__wxapp_img.community,
  67. userInfo: state => state.user.info,
  68. })
  69. },
  70. onLoad: function (options) {
  71. this.id = options.id;
  72. this.getList();
  73. },
  74. methods: {
  75. getList() {
  76. let that = this;
  77. that.$request({
  78. url: that.$api.community.activity_log,
  79. data: {
  80. id: that.id
  81. },
  82. method: 'post'
  83. }).then(response=>{
  84. uni.hideLoading();
  85. if(response.code == 0) {
  86. that.detail = response.data;
  87. for(let i in that.detail.list) {
  88. that.detail.list[i].index = +i +1;
  89. if(that.detail.list[i].index < 10) {
  90. that.detail.list[i].index = '0' + that.detail.list[i].index
  91. }
  92. }
  93. if(that.detail.log_num > 0) {
  94. that.rate = Math.round(that.detail.user_num / that.detail.log_num * 100)
  95. }
  96. }else {
  97. uni.showToast({
  98. title: response.msg,
  99. icon: 'none',
  100. duration: 1000
  101. });
  102. }
  103. }).catch(response => {
  104. uni.hideLoading();
  105. that.$hideLoading();
  106. });
  107. }
  108. }
  109. }
  110. </script>
  111. <style scoped lang="scss">
  112. .info {
  113. height: #{260rpx};
  114. background-color: #4859E8;
  115. color: #fff;
  116. font-size: #{34rpx};
  117. position: relative;
  118. background-size: 100% 100%;
  119. .info-item {
  120. width: 50%;
  121. height: #{260rpx};
  122. text-align: center;
  123. .num {
  124. font-size: #{40rpx};
  125. font-family: DIN;
  126. margin-top: #{15rpx};
  127. }
  128. }
  129. .line {
  130. width: #{2rpx};
  131. height: #{130rpx};
  132. position: absolute;
  133. top: #{65rpx};
  134. left: 50%;
  135. margin-left: #{-1rpx};
  136. z-index: 5;
  137. background-color: #fff;
  138. }
  139. }
  140. .number {
  141. width: #{702rpx};
  142. margin: #{24rpx};
  143. border-radius: #{16rpx};
  144. background-color: #fff;
  145. height: #{132rpx};
  146. .number-item {
  147. text-align: center;
  148. font-size: #{26rpx};
  149. color: #999;
  150. .num {
  151. font-size: #{28rpx};
  152. color: #353535;
  153. margin-top: #{10rpx};
  154. }
  155. }
  156. }
  157. .list {
  158. background-color: #fff;
  159. border-radius: #{16rpx};
  160. padding: 0 #{32rpx};
  161. margin: 0 #{24rpx} #{24rpx};
  162. width: #{702rpx};
  163. .item {
  164. height: #{100rpx};
  165. border-top: #{2rpx} solid #e2e2e2;
  166. padding: 0 #{18rpx};
  167. &:first-of-type {
  168. border-top: 0;
  169. }
  170. .index {
  171. font-size: #{26rpx};
  172. height: #{100rpx};
  173. line-height: #{100rpx};
  174. font-weight: 600;
  175. color: #3C8DF1;
  176. margin-right: #{24rpx};
  177. }
  178. .avatar {
  179. width: #{56rpx};
  180. height: #{56rpx};
  181. border-radius: 50%;
  182. margin-right: #{24rpx};
  183. image {
  184. width: #{56rpx};
  185. height: #{56rpx};
  186. border-radius: 50%;
  187. }
  188. }
  189. .name {
  190. font-size: #{28rpx};
  191. height: #{100rpx};
  192. line-height: #{100rpx};
  193. color: #3b3939;
  194. width: #{300rpx};
  195. }
  196. .time {
  197. font-size: #{26rpx};
  198. color: #999;
  199. }
  200. }
  201. }
  202. </style>