index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="content">
  3. <view class="zdyNav">
  4. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  5. <view class="nav">
  6. 首页
  7. </view>
  8. </view>
  9. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  10. <view style="height: 44px;"></view>
  11. <!-- 我的待办 -->
  12. <view class="modular">
  13. <view class="modularTitle">我的待办</view>
  14. <view class="modularCont">
  15. <view class="modularLine" @click="goRouter('../upcoming/upcoming')">
  16. <image src="../../static/img/home_icon_1.png" mode="" class="modularImg"></image>
  17. <view class="subscript" v-if="count">{{count}}</view>
  18. <view class="modularName">待办事项</view>
  19. </view>
  20. </view>
  21. </view>
  22. <!--录入报告 -->
  23. <view class="modular" v-if="permissionList.indexOf('N001')!=-1||permissionList.indexOf('N002')!=-1">
  24. <view class="modularTitle">录入报告</view>
  25. <view class="modularCont" >
  26. <view class="modularLine" @click="goRouter('../entryReport/entryReport')" v-if="permissionList.indexOf('N001')!=-1">
  27. <image src="../../static/img/home_icon_2.png" mode="" class="modularImg"></image>
  28. <view class="modularName">录入报告</view>
  29. </view>
  30. <view class="modularLine" @click="goRouter('../reportManage/reportManage')" v-if="permissionList.indexOf('N002')!=-1">
  31. <image src="../../static/img/home_icon_3.png" mode="" class="modularImg"></image>
  32. <view class="modularName">报告管理</view>
  33. </view>
  34. </view>
  35. </view>
  36. <!--团队管理 -->
  37. <view class="modular" v-if="permissionList.indexOf('N004')!=-1||permissionList.indexOf('N003')!=-1">
  38. <view class="modularTitle">团队管理</view>
  39. <view class="modularCont">
  40. <view class="modularLine" @click="goRouter('../team/myTeam')" v-if="permissionList.indexOf('N003')!=-1">
  41. <image src="../../static/img/home_icon_4.png" mode="" class="modularImg"></image>
  42. <view class="modularName">我的团队</view>
  43. </view>
  44. <view class="modularLine" @click="goRouter('../teamStore/teamStore')" v-if="permissionList.indexOf('N004')!=-1">
  45. <image src="../../static/img/home_icon_5.png" mode="" class="modularImg"></image>
  46. <view class="modularName">团队门店</view>
  47. </view>
  48. </view>
  49. </view>
  50. <!--其他设置 -->
  51. <view class="modular">
  52. <view class="modularTitle">其他设置</view>
  53. <view class="modularCont">
  54. <view class="modularLine" @click="goRouter('../accountSet/accountSet')">
  55. <image src="../../static/img/home_icon_6.png" mode="" class="modularImg"></image>
  56. <view class="modularName">账号设置</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. uid: '',
  67. count: '',
  68. permissionList:'',
  69. iStatusBarHeight:'',
  70. }
  71. },
  72. onLoad() {
  73. //页面加载初始化生命周期函数
  74. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  75. //#ifdef H5
  76. var wxOpendata={
  77. openid: "o82ym5Hibc2EuO_k5DwudNk17v08",
  78. session_key: "jl7dKJHQwzBV0df15M4UEw==",
  79. unionid: "oH6Atwxitb1_hteVhEfqtCh6Ytb4"
  80. }
  81. uni.setStorage({
  82. key: 'wxOpendata',
  83. data:wxOpendata,
  84. success: function () {
  85. }
  86. });
  87. // #endif
  88. },
  89. onShow() {
  90. this.uid = uni.getStorageSync("logInData").uid;
  91. this.permissionList=uni.getStorageSync("logInData").permissionList;
  92. if(!this.permissionList){
  93. this.permissionList=[]
  94. }
  95. //this.permissionList=['N001']
  96. console.log(this.uid);
  97. if (this.uid) {
  98. this.getData()
  99. }
  100. },
  101. methods: {
  102. getData() {
  103. uni.showLoading({
  104. title: '加载中'
  105. })
  106. let url = 'accompany/SuperAccounts/listMyTodoPage',
  107. params = {
  108. page: 1,
  109. limit: 20,
  110. }
  111. this.$http(url, params, 'GET').then(res => {
  112. this.count = res.data.TotalSize
  113. })
  114. },
  115. //自己定义的方法函数
  116. goRouter(url) {
  117. console.log(url)
  118. //uni.navigateTo 路由跳转 url 是地址 路由还分为uni.redirectTo switchTab navigateBackreLaunch
  119. //this.$common.isUserId()
  120. uni.navigateTo({
  121. url: url
  122. })
  123. }
  124. }
  125. }
  126. </script>
  127. <style scoped>
  128. .content {
  129. background: #F4F5F7;
  130. min-height: 100vh;
  131. padding: 24rpx 20rpx;
  132. }
  133. /* #ifdef H5 */
  134. .content {
  135. background: #F4F5F7;
  136. padding: 24rpx 20rpx;
  137. }
  138. /* #endif */
  139. .modular {
  140. background: #FFFFFF;
  141. border-radius: 16rpx;
  142. padding: 30rpx 20rpx;
  143. margin-bottom: 20rpx;
  144. }
  145. .modularTitle {
  146. font-size: 32rpx;
  147. font-weight: 600;
  148. color: #3C3C3C;
  149. }
  150. .modularImg {
  151. width: 80rpx;
  152. height: 80rpx;
  153. }
  154. .modularCont {
  155. display: flex;
  156. }
  157. .modularLine {
  158. width: 25%;
  159. text-align: center;
  160. padding-top: 33rpx;
  161. position: relative;
  162. }
  163. .modularName {
  164. font-size: 24rpx;
  165. padding-top: 5rpx;
  166. color: #666666;
  167. }
  168. .subscript {
  169. width: 32rpx;
  170. height: 32rpx;
  171. border-radius: 16rpx;
  172. text-align: center;
  173. line-height: 32rpx;
  174. background-color: #F03B3B;
  175. color: #FFFFFF;
  176. font-size: 20rpx;
  177. z-index: 99;
  178. position: absolute;
  179. right: 32rpx;
  180. top: 16rpx;
  181. }
  182. .zdyNav{
  183. position: fixed;
  184. left: 0;
  185. top: 0;
  186. background: #FFFFFF;
  187. z-index: 11;
  188. }
  189. .nav{
  190. width: 100vw;
  191. height: 44px;
  192. background: #FFFFFF;
  193. text-align: center;
  194. font-size: 34rpx;
  195. line-height: 44px;
  196. }
  197. .status_bar{
  198. background: #FFFFFF;
  199. }
  200. </style>