user-server.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view class="content">
  3. <scroll-view class="data_body" scroll-y :style="{height:scrollHeight}">
  4. <template v-if="true">
  5. <!-- 会员成长数据-->
  6. <view class="view_item">
  7. <view class="title">会员成长数据</view>
  8. <view class="progress_circle">
  9. <view v-for="(item,index) in CircleData" :key="index" :class="['progress_block','block_'+index]">
  10. <view class="name">{{item.series[0].name}}</view>
  11. <view class="value">{{item.series[0].value}}</view>
  12. <view class="charts-box arcbar" style="height: 180rpx;width: 60%;">
  13. <qiun-data-charts type="arcbar" :chartData="item" :canvasId="'four_a_'+index" :canvas2d="isCanvas2d"
  14. :resshow="delayload"
  15. :opts="{title:{name:item.series[0].precent,color:item.series[0].color,fontSize:15},subtitle:{name:'',color:'#666666',fontSize:12},extra:{arcbar:{backgroundColor:item.series[0].backgroundColor}}}" />
  16. </view>
  17. <view class="planet">
  18. <view class="planet_shadow"></view>
  19. <view class="crater1"></view>
  20. <view class="crater2"></view>
  21. <view class="crater3"></view>
  22. <view class="crater4"></view>
  23. </view>
  24. <view class="star" :class="['star'+index]"></view>
  25. <view class="star pink" :class="['star'+index]"></view>
  26. <view class="star blue" :class="['star'+index]"></view>
  27. <view class="star yellow" :class="['star'+index]"></view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="split_line"></view>
  32. <!-- 会员数据来源 -->
  33. <view class="friend_operate">
  34. <view class="title">会员数据来源
  35. <text class="font-small" style="color: #ff9900;">(Top5访问来源)</text>
  36. </view>
  37. <view v-if="delayload" class="charts-box">
  38. <qiun-data-charts
  39. type="ring"
  40. canvasId="four_b"
  41. :canvas2d="isCanvas2d"
  42. :resshow="delayload"
  43. :opts="{legend:{position: 'bottom'},title:{name: '',},subtitle: {name: ''}}"
  44. :chartData="ProductRateData"/>
  45. </view>
  46. </view>
  47. <view class="split_line"></view>
  48. <!-- 服务评价概览-->
  49. <view class="friend_operate">
  50. <view class="title">服务评价概览</view>
  51. <text-block :content="ServiceComment"></text-block>
  52. </view>
  53. <!-- 本周会员访问趋势图 -->
  54. <view class="friend_operate">
  55. <view class="title">本周会员访问趋势图</view>
  56. <view v-if="delayload" class="charts-box" style="height: 300px;">
  57. <qiun-data-charts
  58. type="mix"
  59. canvasId="four_c"
  60. :canvas2d="isCanvas2d"
  61. :resshow="delayload"
  62. :opts="{yAxis:{data:[{position: 'left',title: '',min:0,unit:'万'}]}}"
  63. :chartData="TrendData"
  64. />
  65. </view>
  66. </view>
  67. <view class="split_line"></view>
  68. <!-- 新增会员排行榜 -->
  69. <view class="friend_operate">
  70. <view class="title">新增会员排行榜</view>
  71. <progress-bar :isRank="isRank" :content="RankData" />
  72. </view>
  73. </template>
  74. <template v-else>
  75. <view class="container padding_stand-big normal_color">
  76. <li class="iconfont icon-cry cry"></li>暂无数据
  77. </view>
  78. </template>
  79. </scroll-view>
  80. </view>
  81. </template>
  82. <script>
  83. import ProgressBar from "../progress-bar/progress-bar.vue"
  84. import CircleData from "../../static/json/user-server/1.json"
  85. import ProductRateData from '../../static/json/user-server/2.json';
  86. import TrendData from '../../static/json/user-server/3.json';
  87. import ServiceComment from '../../static/json/user-server/4.json';
  88. import RankData from '../../static/json/user-server/5.json';
  89. import Config from '../../static/js/config'
  90. export default {
  91. name:"user-server",
  92. props:{
  93. scrollHeight:{
  94. type:String,
  95. default:"600px"
  96. }
  97. },
  98. components:{
  99. ProgressBar
  100. },
  101. data(){
  102. return {
  103. CircleData,
  104. TrendData,
  105. ProductRateData,
  106. ServiceComment,
  107. RankData,
  108. isRank:true,
  109. isCanvas2d:Config.ISCANVAS2D,
  110. delayload: false, //延时加载图表,否则会出现图表加载完后定位错乱
  111. }
  112. },
  113. methods:{
  114. async getData(){
  115. uni.showLoading();
  116. await setTimeout(() => {
  117. this.delayload = true;
  118. uni.hideLoading();
  119. }, 1000)
  120. }
  121. },
  122. mounted() {
  123. this.getData();
  124. }
  125. }
  126. </script>
  127. <style scoped lang="scss">
  128. .content{
  129. padding-top: 10rpx;
  130. }
  131. .data_body{
  132. height: 100%;
  133. text-align: center;
  134. color: #333333;
  135. background-repeat: repeat;
  136. background-color: #ffffff;
  137. .friend_operate{
  138. padding: 30rpx 20rpx;
  139. .title{
  140. text-align:left;
  141. margin-bottom: 30rpx;
  142. font-size: 40rpx;
  143. }
  144. }
  145. .view_item{
  146. padding: 30rpx 20rpx;
  147. .title{
  148. text-align:left;
  149. margin-bottom: 30rpx;
  150. font-size: 40rpx;
  151. }
  152. }
  153. .progress_circle{
  154. display: flex;
  155. flex-wrap: wrap;
  156. justify-content: space-around;
  157. align-items: center;
  158. height: 450rpx;
  159. .progress_block{
  160. width: 45%;
  161. border-radius: 20rpx;
  162. height: 180rpx;
  163. position: relative;
  164. overflow: hidden;
  165. .name{
  166. color: #fff;
  167. font-size: 24rpx;
  168. position: absolute;
  169. top: 20rpx;
  170. left: 10rpx;
  171. max-width: 144rpx;
  172. }
  173. .value{
  174. color: #fff;
  175. font-size: 40rpx;
  176. position: absolute;
  177. top: 64rpx;
  178. left: 10rpx;
  179. max-width: 144rpx;
  180. }
  181. .circle{
  182. position: absolute;
  183. right: 8rpx;
  184. top: 16rpx;
  185. }
  186. .arcbar{
  187. position: absolute;
  188. right: -4rpx;
  189. top: 8rpx;
  190. }
  191. }
  192. .block_0{
  193. background-color: #0FC3FF;
  194. }
  195. .block_1{
  196. background-color: #FF6B8B;
  197. }
  198. .block_2{
  199. background-color: #FFCB1D;
  200. }
  201. .block_3{
  202. background-color: #3BDCAA;
  203. }
  204. }
  205. }
  206. .planet {
  207. width: 60px;
  208. height: 60px;
  209. border-radius: 50%;
  210. background: #333;
  211. position: absolute;
  212. left: -13px;
  213. bottom: -26px;
  214. overflow: hidden;
  215. opacity: 0.5;
  216. z-index: 0;
  217. }
  218. .planet_shadow {
  219. position: absolute;
  220. border-radius: 50%;
  221. height: 100%;
  222. width: 100%;
  223. top: -40%;
  224. right: -10%;
  225. border: 35px solid rgba(0, 0, 0, .15);
  226. }
  227. .crater1,
  228. .crater2,
  229. .crater3,
  230. .crater4 {
  231. position: absolute;
  232. border-radius: 50%;
  233. background: rgba(0, 0, 0, .3);
  234. box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .2);
  235. }
  236. .crater1 {
  237. width: 20px;
  238. height: 20px;
  239. left: 25%;
  240. top: 20%;
  241. }
  242. .crater2 {
  243. width: 10px;
  244. height: 10px;
  245. left: 50%;
  246. top: 60%;
  247. }
  248. .crater3 {
  249. width: 15px;
  250. height: 15px;
  251. left: 30%;
  252. top: 65%;
  253. }
  254. .crater4 {
  255. width: 15px;
  256. height: 15px;
  257. left: 60%;
  258. top: 35%;
  259. }
  260. .star {
  261. display: block;
  262. width: 5px;
  263. height: 5px;
  264. border-radius: 50%;
  265. background: #FFF;
  266. top: 10px;
  267. left: 50px;
  268. position: relative;
  269. transform-origin: 100% 0;
  270. box-shadow: 0 0 5px 5px rgba(255, 255, 255, .3);
  271. opacity: 0;
  272. z-index: 2;
  273. }
  274. .star0{
  275. animation: star-ani 4s infinite ease-out;
  276. }
  277. .star1{
  278. animation: star-ani 5s infinite ease-out;
  279. }
  280. .star2{
  281. animation: star-ani 6s infinite ease-out;
  282. }
  283. .star3{
  284. animation: star-ani 7s infinite ease-out;
  285. }
  286. .star:after {
  287. content: '';
  288. display: block;
  289. top: 20px;
  290. left: 60px;
  291. border: 0px solid #fff;
  292. border-width: 0px 90px 2px 90px;
  293. border-color: transparent transparent transparent rgba(255, 255, 255, .3);
  294. transform: rotate(-45deg) translate3d(1px, 3px, 0);
  295. box-shadow: 0 0 1px 0 rgba(255, 255, 255, .1);
  296. transform-origin: 0% 100%;
  297. animation: shooting-ani 100s infinite ease-out;
  298. }
  299. .pink {
  300. top: 10px;
  301. left: 60px;
  302. background: #ff5a99;
  303. animation-delay: 5s;
  304. -webkit-animation-delay: 5s;
  305. -moz-animation-delay: 5s;
  306. }
  307. .pink:after {
  308. border-color: transparent transparent transparent #ff5a99;
  309. animation-delay: 5s;
  310. -webkit-animation-delay: 5s;
  311. -moz-animation-delay: 5s;
  312. }
  313. .blue {
  314. top: 15px;
  315. left: 70px;
  316. background: cyan;
  317. animation-delay: 7s;
  318. -webkit-animation-delay: 7s;
  319. -moz-animation-delay: 7s;
  320. }
  321. .blue:after {
  322. border-color: 'transpareanimation-delay: 12s';
  323. -webkit-animation-delay: 7s;
  324. -moz-animation-delay: 7s;
  325. animation-delay: 7s;
  326. }
  327. .yellow {
  328. top: 0px;
  329. left: 80px;
  330. background: #ffcd5c;
  331. animation-delay: 5.8s;
  332. }
  333. .yellow:after {
  334. border-color: transparent transparent transparent #ffcd5c;
  335. animation-delay: 5.8s;
  336. }
  337. @keyframes star-ani {
  338. 0% {
  339. opacity: 0;
  340. transform: scale(0) rotate(0) translate3d(0, 0, 0);
  341. -webkit-transform: scale(0) rotate(0) translate3d(0, 0, 0);
  342. -moz-transform: scale(0) rotate(0) translate3d(0, 0, 0);
  343. }
  344. 50% {
  345. opacity: 0.5;
  346. transform: scale(1) rotate(0) translate3d(-20px, 20px, 0);
  347. -webkit-transform: scale(1) rotate(0) translate3d(-20px, 20px, 0);
  348. -moz-transform: scale(1) rotate(0) translate3d(-20px, 20px, 0);
  349. }
  350. 100% {
  351. opacity: 0;
  352. transform: scale(1) rotate(0) translate3d(-30px, 30px, 0);
  353. -webkit-transform: scale(1) rotate(0) translate3d(-30px, 30px, 0);
  354. -moz-transform: scale(1) rotate(0) translate3d(-30px, 30px, 0);
  355. }
  356. }
  357. </style>