index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <template>
  2. <block>
  3. <view class="topBack" :style="'top: ' + menuButton.top + 'px'">
  4. <!-- <text class="ico-moon icon-leftarrow" wx:if="{{pages > 1}}" bindtap="toPage" data-mold="back"></text> -->
  5. <image v-if="pages > 1" @tap="toback"
  6. src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f566738e424f33a415dea22dc4e11eec.png"
  7. class="ico-moon"></image>
  8. <image mode="heightFix" :style="'height: ' + menuButton.height * 2 + 'rpx'" @tap="toPage"
  9. data-url="/pages/index/index" class="h-backBtn" v-else
  10. src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/2847/41c5f36528b8f4204130c4977c1ec2c5.png">
  11. </image>
  12. <view class="userName">后台管理</view>
  13. </view>
  14. <view class="tpBg"></view>
  15. <view class="content">
  16. <view class="box">
  17. <view class="totalAllTitle">今日营业额(元)</view>
  18. <view class="total">
  19. <view class="totalNum">{{ info.money }}</view>
  20. </view>
  21. <view class="datas">
  22. <view class="dataItem">
  23. <view>昨日营业额</view>
  24. <view>{{ info.rozenAmount }}</view>
  25. <!-- <image
  26. src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/0a57e6af52d6001a69c585478c71f8b6.png"
  27. mode="widthFix" class="iicon"></image> -->
  28. </view>
  29. <view class="dataItem">
  30. <view>当月营业额</view>
  31. <view>{{ info.cumulativembodiment }}</view>
  32. </view>
  33. <view class="dataItem">
  34. <view>总营业额</view>
  35. <view>{{ info.cumulativencome }}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="box1">
  40. <view class="iItem" @tap="toPage" :data-url="item.url" v-for="(item, index) in list2" :key="index">
  41. <view class="iLeft">
  42. <image :src="item.icon" mode="widthFix"></image>
  43. <view>{{ item.name }}</view>
  44. </view>
  45. <image
  46. src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/9badd173c236af20edc6f800111d24c3.png"
  47. mode="widthFix" class="iRight"></image>
  48. </view>
  49. </view>
  50. </view>
  51. </block>
  52. </template>
  53. <script module="parse" lang="wxs">
  54. module.exports = {
  55. filterTime: function(time) {
  56. console.log(time)
  57. var nowDate = getDate(time * 1000);
  58. var year = nowDate.getFullYear();
  59. var month = nowDate.getMonth() + 1;
  60. var date = nowDate.getDate();
  61. var hours = nowDate.getHours();
  62. var minutes = nowDate.getMinutes();
  63. var seconds = nowDate.getSeconds();
  64. month = month > 9 ? month : '0' + month;
  65. date = date > 9 ? date : '0' + date;
  66. hours = hours > 9 ? hours : '0' + hours;
  67. minutes = minutes > 9 ? minutes : '0' + minutes;
  68. seconds = seconds > 9 ? seconds : '0' + seconds;
  69. return year + '-' + month + '-' + date + " " + hours + ":" + minutes + ":" + seconds;
  70. }
  71. }
  72. </script>
  73. <script>
  74. // pages/backstage/index/index.js
  75. var app = getApp();
  76. export default {
  77. data() {
  78. return {
  79. list2: [{
  80. name: '团队管理',
  81. icon: 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/612dcfbf599a0be79cab31e7e9ceb651.png',
  82. url: '/pages/term/index'
  83. },
  84. ],
  85. info: {
  86. },
  87. pages: '',
  88. menuButton: {
  89. top: '',
  90. height: 0
  91. },
  92. Page: 0
  93. };
  94. }
  95. /**
  96. * 生命周期函数--监听页面加载
  97. */
  98. ,
  99. onLoad: function(options) {
  100. let page = getCurrentPages();
  101. var menuButton = uni.getMenuButtonBoundingClientRect();
  102. console.log(menuButton);
  103. this.pages = page.length,
  104. this.menuButton = menuButton,
  105. this.getinfo();
  106. },
  107. /**
  108. * 生命周期函数--监听页面初次渲染完成
  109. */
  110. onReady: function() {},
  111. /**
  112. * 生命周期函数--监听页面显示
  113. */
  114. onShow: function() {},
  115. /**
  116. * 生命周期函数--监听页面隐藏
  117. */
  118. onHide: function() {},
  119. /**
  120. * 生命周期函数--监听页面卸载
  121. */
  122. onUnload: function() {},
  123. /**
  124. * 页面相关事件处理函数--监听用户下拉动作
  125. */
  126. onPullDownRefresh: function() {
  127. },
  128. /**
  129. * 页面上拉触底事件的处理函数
  130. */
  131. onReachBottom: function() {
  132. },
  133. /**
  134. * 用户点击右上角分享
  135. */
  136. onShareAppMessage: function() {},
  137. methods: {
  138. async getinfo() {
  139. let data = await this.$api.request('/wallet/index');
  140. console.log(data)
  141. this.info = data;
  142. },
  143. toPage(e) {
  144. app.globalData.toPage(e);
  145. },
  146. toback() {
  147. uni.navigateBack({
  148. delta: 1
  149. });
  150. },
  151. }
  152. };
  153. </script>
  154. <style>
  155. page {
  156. background: #F4F5F9;
  157. }
  158. .topBack {
  159. position: absolute;
  160. top: 0;
  161. left: 0;
  162. z-index: 1;
  163. margin-top: 2rpx;
  164. display: flex;
  165. align-items: center;
  166. }
  167. .topBack .ico-moon {
  168. padding: 0 0rpx 0 30rpx;
  169. width: 70rpx;
  170. height: 40rpx;
  171. }
  172. .h-backBtn {
  173. margin-left: 30rpx;
  174. }
  175. .homeImg {
  176. height: 40rpx;
  177. width: 40rpx;
  178. margin-right: 10rpx;
  179. }
  180. .userName {
  181. font-size: 28rpx;
  182. color: #fff;
  183. margin-left: 20rpx;
  184. font-size: 36rpx;
  185. }
  186. .tpBg {
  187. background: #FE5879;
  188. background-size: 100% 100%;
  189. width: 100%;
  190. height: 380rpx;
  191. }
  192. .content {
  193. margin: -180rpx 30rpx 25rpx;
  194. }
  195. .box {
  196. border-radius: 12rpx;
  197. background: #fff;
  198. padding: 50rpx 20rpx 40rpx;
  199. margin-bottom: 25rpx;
  200. }
  201. .totalAllTitle {
  202. color: #9194A6;
  203. margin-bottom: 28rpx;
  204. text-align: center;
  205. }
  206. .total {
  207. display: flex;
  208. align-items: center;
  209. justify-content: center;
  210. padding-bottom: 20rpx;
  211. }
  212. .totalNum {
  213. font-size: 50rpx;
  214. }
  215. .totalJump {
  216. display: flex;
  217. align-items: center;
  218. width: 220rpx;
  219. height: 70rpx;
  220. justify-content: center;
  221. background: #FB4C6F;
  222. border-radius: 12rpx;
  223. border-radius: 12rpx;
  224. }
  225. .totalJump>view {
  226. font-size: 28rpx;
  227. color: #fff;
  228. }
  229. .totalJump>image {
  230. width: 14rpx;
  231. margin-left: 14rpx;
  232. margin-top: 5rpx;
  233. }
  234. .tip {
  235. font-size: 30rpx;
  236. padding-bottom: 10rpx;
  237. }
  238. .iItem {
  239. display: flex;
  240. align-items: center;
  241. justify-content: space-between;
  242. padding: 32rpx 0;
  243. border-bottom: 1px solid #E4E5EE;
  244. }
  245. .iItem:last-child {
  246. border-bottom: none;
  247. padding-bottom: 0;
  248. }
  249. .iLeft {
  250. display: flex;
  251. align-items: center;
  252. }
  253. .iLeft>image {
  254. width: 40rpx;
  255. }
  256. .iLeft>view {
  257. font-size: 28rpx;
  258. margin-left: 32rpx;
  259. }
  260. .iRight {
  261. width: 12rpx;
  262. }
  263. .datas {
  264. padding-top: 50rpx;
  265. display: flex;
  266. align-items: center;
  267. justify-content: space-between;
  268. padding-bottom: 16rpx;
  269. }
  270. .dataItem {
  271. display: flex;
  272. flex-direction: column;
  273. align-items: center;
  274. position: relative;
  275. }
  276. .dataItem>view:nth-child(1) {
  277. color: #9194A6;
  278. }
  279. .dataItem>view:nth-child(2) {
  280. margin-top: 15rpx;
  281. font-size: 30rpx;
  282. }
  283. .iicon {
  284. width: 28rpx;
  285. position: absolute;
  286. top: 4rpx;
  287. right: -38rpx;
  288. }
  289. .btns {
  290. display: flex;
  291. align-items: center;
  292. justify-content: space-around;
  293. }
  294. .btn1 {
  295. background: #fff;
  296. border: 1px solid #9194A6;
  297. color: #011B33 !important;
  298. }
  299. .btn1>view {
  300. color: #011B33 !important;
  301. }
  302. .box1 {
  303. border-radius: 12rpx;
  304. background: #fff;
  305. padding: 50rpx;
  306. margin-bottom: 25rpx;
  307. padding-top: 0;
  308. }
  309. .iItem {
  310. display: flex;
  311. align-items: center;
  312. justify-content: space-between;
  313. padding: 32rpx 0;
  314. border-bottom: 1px solid #e4e5ee;
  315. }
  316. .iItem:last-child {
  317. border-bottom: none;
  318. padding-bottom: 0;
  319. }
  320. .iLeft {
  321. display: flex;
  322. align-items: center;
  323. }
  324. .iLeft>image {
  325. width: 40rpx;
  326. }
  327. .iLeft>view {
  328. font-size: 28rpx;
  329. margin-left: 32rpx;
  330. }
  331. .iRight {
  332. width: 12rpx;
  333. }
  334. view {
  335. font-size: 24rpx;
  336. }
  337. .rWrap {
  338. display: flex;
  339. align-items: center;
  340. }
  341. .intergal {
  342. color: #000000;
  343. font-size: 30rpx;
  344. margin-right: 12rpx;
  345. }
  346. </style>