center.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view>
  3. <view class="topBackground" style="overflow:hidden">
  4. <view class="personal" style="background-color: rgba(0, 0, 0, 0);box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);">
  5. <view style="height: 150rpx;">
  6. <view style="float: left;">
  7. <u-avatar :src="src" shape="circle" size="70"
  8. style="box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.4);"></u-avatar>
  9. </view>
  10. <view style="float: left;margin-left: 50rpx;margin-top: 10rpx;">
  11. <u--text color="#fff" :text="userName?userName:''" size="28"></u--text>
  12. <u--text color="#fff" v-if="role" :text="jigoData" size="14"></u--text>
  13. <!-- <u--text color="#fff" v-if="role" :text="'角色:'+role"></u--text> -->
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="tips">
  19. <view style="text-align: center;font-size: 32rpx;color: #525454;">
  20. <view>今日收入</view>
  21. <u-count-to :startVal="0" :endVal="income" :decimals="2" color="#fd5003" fontSize="44"></u-count-to>
  22. <text style="color: #fd5003;">元</text>
  23. <u-grid :border="false">
  24. <u-grid-item>
  25. <text style="color: #525454;">推广海报</text>
  26. </u-grid-item>
  27. <u-grid-item>
  28. <text style="color: #525454;">轮毂升级</text>
  29. </u-grid-item>
  30. <u-grid-item>
  31. <text style="color: #525454;">我的足迹</text>
  32. </u-grid-item>
  33. </u-grid>
  34. </view>
  35. </view>
  36. <!-- <view class="head">
  37. <view style="display: flex;justify-content: space-between;width:96%;height:60rpx;line-height: 60rpx;margin: auto auto 30rpx auto;border-bottom: 1rpx solid #EDEDED;">
  38. <view>业务中心</view>
  39. <view><u--text suffixIcon="arrow-right" iconStyle="font-size: 18px" text="查看更多"></u--text></view>
  40. </view>
  41. <u-grid :border="false" col="4">
  42. <u-grid-item>
  43. <u--image :showLoading="true" src="../../static/images/user/PT.png" width="64rpx" height="64rpx" @click="click"></u--image>
  44. <text class="grid-text">采购跟踪</text>
  45. </u-grid-item>
  46. <u-grid-item>
  47. <u--image :showLoading="true" src="../../static/images/user/SO.png" width="64rpx" height="64rpx" @click="click"></u--image>
  48. <text class="grid-text">销售订单</text>
  49. </u-grid-item>
  50. <u-grid-item>
  51. <u--image :showLoading="true" src="../../static/images/user/CC.png" width="64rpx" height="64rpx" @click="click"></u--image>
  52. <text class="grid-text">渠道客户</text>
  53. </u-grid-item>
  54. <u-grid-item>
  55. <u--image :showLoading="true" src="../../static/images/user/VR.png" width="64rpx" height="64rpx" @click="click"></u--image>
  56. <text class="grid-text">拜访记录</text>
  57. </u-grid-item>
  58. </u-grid>
  59. </view> -->
  60. <!-- <view class="head">
  61. <view style="display: flex;justify-content: space-between;width:96%;height:60rpx;line-height: 60rpx;margin: auto auto 30rpx auto;border-bottom: 1rpx solid #EDEDED;">
  62. 办公中心
  63. </view>
  64. <u-grid :border="false" col="4">
  65. <u-grid-item>
  66. <u--image :showLoading="true" src="../../static/images/user/QX.png" width="64rpx" height="64rpx" @click="click"></u--image>
  67. <text class="grid-text">权限设置</text>
  68. </u-grid-item>
  69. <u-grid-item>
  70. <u--image :showLoading="true" src="../../static/images/user/GG.png" width="64rpx" height="64rpx" @click="click"></u--image>
  71. <text class="grid-text">公告管理</text>
  72. </u-grid-item>
  73. <u-grid-item>
  74. <u--image :showLoading="true" src="../../static/images/user/GC.png" width="64rpx" height="64rpx" @click="click"></u--image>
  75. <text class="grid-text">工厂政策</text>
  76. </u-grid-item>
  77. <u-grid-item>
  78. <u--image :showLoading="true" src="../../static/images/user/YG.png" width="64rpx" height="64rpx" @click="click"></u--image>
  79. <text class="grid-text">员工管理</text>
  80. </u-grid-item>
  81. </u-grid>
  82. </view> -->
  83. <view class="head">
  84. <u-cell-group title-bg-color="rgb(243, 244, 246)" :border="false">
  85. <u-cell title="供应商" icon="account" :isLink="true" center @click="pageJump('supplier')"></u-cell>
  86. <u-cell title="设置" icon="setting" :isLink="true" :border="false" center @click="setUp"></u-cell>
  87. </u-cell-group>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. import {
  93. queryList
  94. } from '@/api/views/record/index.js'
  95. import {
  96. dateFormat
  97. } from '@/common/dateFormat.js'
  98. import {
  99. bladeUserDetail,
  100. orderTodayIncome
  101. } from '@/api/OutboundTask/index.js'
  102. export default {
  103. data() {
  104. return {
  105. src: uni.getStorageSync('userInfo').avatar,
  106. revenueTop: 0,
  107. userName: '',
  108. role: uni.getStorageSync('userInfo').role_name,
  109. jigoData: '',
  110. shruData: null, // 今日收入数据
  111. income:null,
  112. }
  113. },
  114. onLoad() {
  115. uni.getSystemInfo({
  116. success: (e) => {
  117. this.revenueTop = e.statusBarHeight
  118. }
  119. })
  120. },
  121. onShow() {
  122. console.log(uni.getStorageSync('userInfo'), 109);
  123. this.src = uni.getStorageSync('userInfo').avatar
  124. this.userName = uni.getStorageSync('userInfo').account
  125. // 获取机构数据
  126. bladeUserDetail(uni.getStorageSync('userInfo').user_id).then(res => {
  127. console.log(res, 118);
  128. this.jigoData = res.data.deptName
  129. })
  130. this.role = uni.getStorageSync('userInfo').role_name
  131. this.orderTodayIncomefun()
  132. this.getQueryList()
  133. },
  134. methods: {
  135. getQueryList() {
  136. let obj = {}
  137. obj.statusDate = dateFormat(new Date, 'YYYY-MM-DD') + ' 00:00:00'
  138. obj.endDate = dateFormat(new Date, 'YYYY-MM-DD') + ' 23:59:59'
  139. queryList(obj).then(res => {
  140. this.income = res.data.income
  141. })
  142. },
  143. // 获取今日收入数据
  144. orderTodayIncomefun() {
  145. orderTodayIncome().then(res => {
  146. this.shruData = res.data
  147. })
  148. },
  149. click() {
  150. uni.showToast({
  151. title: '暂无功能',
  152. icon: 'none'
  153. });
  154. },
  155. setUp() {
  156. this.$u.route('/pages/user/setUp');
  157. },
  158. pageJump(value) {
  159. switch (value) {
  160. case "supplier":
  161. uni.$u.route('/pages/views/supplier/index');
  162. break;
  163. }
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="scss" scoped>
  169. .topBackground {
  170. width: 100%;
  171. height: 300rpx;
  172. background: url("../../static/images/view/home/head_bg.png") no-repeat;
  173. background-size: 100% 100%;
  174. padding-top: var(--status-bar-height);
  175. }
  176. .tips {
  177. width: 96%;
  178. margin: 0 auto;
  179. padding: 20rpx 0;
  180. background-color: #FFFFFF;
  181. margin-top: -100rpx;
  182. border-radius: 30rpx;
  183. box-shadow: 0px 1px 14px 4px rgba(0, 0, 0, 0.04);
  184. z-index: 999;
  185. }
  186. .personal {
  187. margin: 0 auto;
  188. background-color: #FFFFFF;
  189. margin-top: 20rpx;
  190. border-radius: 40rpx;
  191. padding: 20rpx;
  192. box-shadow: 0px 1px 14px 4px rgba(0, 0, 0, 0.04);
  193. }
  194. .head {
  195. margin: 0 auto;
  196. background-color: #FFFFFF;
  197. margin-top: 20rpx;
  198. border-radius: 40rpx;
  199. padding: 20rpx 20rpx 20rpx 20rpx;
  200. box-shadow: 0px 1px 14px 4px rgba(0, 0, 0, 0.04);
  201. }
  202. .grid-text {
  203. font-size: 14px;
  204. color: #909399;
  205. padding: 10rpx 0 20rpx 0rpx;
  206. /* #ifndef APP-PLUS */
  207. box-sizing: border-box;
  208. /* #endif */
  209. }
  210. </style>