index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view>
  3. <Headers></Headers>
  4. <view class="content wrap dflex">
  5. <Left-nav currentTab="index"></Left-nav>
  6. <view class="right">
  7. <view class="c-title">概况</view>
  8. <view class="idx-nav dflex">
  9. <navigator url="/pages/declareHonor/declareHonor" hover-class="none" class="li"><image src="../../static/images/sy_honor.png"></image></navigator>
  10. <navigator url="/pages/declareFunds/declareFunds" hover-class="none" class="li"><image src="../../static/images/sy_declare.png"></image></navigator>
  11. </view>
  12. <view class="c-box hb-box">
  13. <view class="sj-tits dflex">
  14. <view class="flex">文旅红榜</view>
  15. <navigator url="/pages/boardContent/boardContent" hover-class="none" class="sj-more">查看全部</navigator>
  16. </view>
  17. <view class="hb-list dflex">
  18. <view v-if="index <= 5" v-for="(item, index) in moneyDeclareList" :key="index" @click="jumpUrl('/pages/content/content?id=' + item.id)" class="li dflex">
  19. <image :src="'../../static/images/bdico' + getRandom() + '.png'"></image>
  20. <view class="flex">
  21. <view class="hb-tit tover">{{ item.title }}</view>
  22. <view class="hb-bri tover">{{ removeHtmlStyle(item.text) }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="c-box gk-info dflex">
  28. <view class="li dflex">
  29. <image src="../../static/images/idxico1.png"></image>
  30. <view>
  31. <text>累计营收</text>
  32. ¥{{ indexData.money ? indexData.money : '0.00' }}
  33. </view>
  34. </view>
  35. <view class="li dflex">
  36. <image src="../../static/images/idxico2.png"></image>
  37. <view>
  38. <text>累计客流量</text>
  39. {{ indexData.person ? indexData.person : 0 }}
  40. </view>
  41. </view>
  42. <view class="li dflex" @click="jumpUrl('/pages/personal/personal')">
  43. <image src="../../static/images/idxico3.png"></image>
  44. <view>
  45. <text>人力资源</text>
  46. {{ indexData.humanResources ? indexData.humanResources : 0 }}
  47. </view>
  48. </view>
  49. <view class="li dflex" @click="jumpUrl('/pages/materials/materials')">
  50. <image src="../../static/images/idxico4.png"></image>
  51. <view>
  52. <text>物资资源</text>
  53. {{ indexData.material ? indexData.material : 0 }}
  54. </view>
  55. </view>
  56. <view class="li dflex" @click="jumpUrl('/pages/complaint/complaint')">
  57. <image src="../../static/images/idxico5.png"></image>
  58. <view>
  59. <text>累计投诉</text>
  60. {{ indexData.complaint ? indexData.complaint : 0 }}
  61. </view>
  62. </view>
  63. </view>
  64. <view class="c-box sy-box">
  65. <view class="sj-tit">营收额</view>
  66. <view class="sye">
  67. <view class="canvasView">
  68. <!-- :echartsH5="true" :echartsApp="true" -->
  69. <qiun-data-charts
  70. type="line"
  71. :chartData="Line"
  72. :opts="{
  73. legend: {
  74. show: false
  75. },
  76. yAxis: {
  77. showTitle: true,
  78. data: [{ title: '单位(元)', titleOffsetY: -8 }]
  79. }
  80. }"
  81. />
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <Foot></Foot>
  88. </view>
  89. </template>
  90. <script>
  91. const app = getApp();
  92. const req = require('../../utils/request.js');
  93. const utils = require('../../utils/util.js');
  94. export default {
  95. data() {
  96. return {
  97. indexData: '',
  98. Line: {},
  99. form: {
  100. page: 1,
  101. limit: 10
  102. },
  103. moneyDeclareList: []
  104. };
  105. },
  106. onLoad() {
  107. this.getHongBList();
  108. },
  109. onShow() {
  110. let userInfo = req.getStorage('userInfo');
  111. if (userInfo.type!=1&&userInfo.institutionState != 2) {
  112. uni.navigateTo({
  113. url: '/pages/company/company'
  114. });
  115. }
  116. if(userInfo.type==1){
  117. uni.navigateTo({
  118. url: '/pages/learn/learn'
  119. });
  120. return
  121. }
  122. this.getData();
  123. },
  124. methods: {
  125. jumpUrl(url) {
  126. uni.navigateTo({
  127. url: url
  128. });
  129. },
  130. removeHtmlStyle(text) {
  131. var str = '';
  132. if (text) {
  133. str = utils.removeHtml(text);
  134. }
  135. return str;
  136. },
  137. getRandom() {
  138. return parseInt(Math.random() * 3 + 1);
  139. },
  140. getHongBList() {
  141. var formP = this.form;
  142. formP.code = 'wenlvhonbang';
  143. return new Promise((resolve, reject) => {
  144. req.getRequest('/api/v3/content/page', formP, data => {
  145. //资金申报公告
  146. this.moneyDeclareList = data.list;
  147. resolve();
  148. });
  149. });
  150. },
  151. getData() {
  152. req.getRequest('/api/v3/hy/indexData/get', {}, data => {
  153. this.indexData = data;
  154. if (data.monitors && data.monitors.length > 0) {
  155. this.Line = this.setStyleLine(data.monitors);
  156. }
  157. });
  158. },
  159. setStyleLine(data) {
  160. var line = {};
  161. if (data && data.length > 0) {
  162. //获取时间轴数据;
  163. line.categories = data.map(it => {
  164. return it.name;
  165. });
  166. line.series = [];
  167. var seriesItem = {};
  168. var list = data.map(itx => {
  169. return itx.value;
  170. });
  171. seriesItem.name = '';
  172. seriesItem.data = list;
  173. line.series.push(seriesItem);
  174. }
  175. return line;
  176. }
  177. }
  178. };
  179. </script>
  180. <style>
  181. .ec-canvas {
  182. display: flex;
  183. width: 100%;
  184. height: 100%;
  185. flex: 1;
  186. }
  187. .canvasView {
  188. width: 100%;
  189. margin-top: 30rpx;
  190. height: 100%;
  191. }
  192. </style>