index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="main">
  3. <!--轮播图-->
  4. <view class="banner">
  5. <u-swiper circular :radius="5" :indicator="true" keyName="image" :list="bannerList" :height="150" class="uni-swiper" @click="click"></u-swiper>
  6. </view>
  7. <!--通知公告-->
  8. <view class="notice">
  9. <u-notice-bar color="#848484" :text="noticeList" :step="true" direction="column" mode="link" bgColor="white" speed="300" url="/pages/notice/index"></u-notice-bar>
  10. </view>
  11. <view class="flow">
  12. <view class="title">操作流程</view>
  13. <!--实名认证-->
  14. <view class="item" @click="go('/pages/authentication/index')">
  15. <view class="icon tb">&#xe600;</view>
  16. <view class="con">
  17. <view class="bt">实名认证</view>
  18. <view class="bor" style="background: linear-gradient(to right, rgb(198 187 250), rgb(251 251 251))"></view>
  19. <view class="zt">{{ !user.isAuthentication || user.isAuthentication == 0 ? '尚未提交资料' : '已提交资料' }}</view>
  20. </view>
  21. <view class="state" v-if="user.isAuthentication === 1">
  22. <text class="zt">已认证</text>
  23. <text class="icon">&#xe62b;</text>
  24. </view>
  25. <view class="state" v-else>
  26. <view class="go">去认证</view>
  27. </view>
  28. </view>
  29. <!--关联企业-->
  30. <view class="item" @click="go('/pages/company/index')">
  31. <view class="icon tb">&#xe623;</view>
  32. <view class="con">
  33. <view class="bt">关联企业</view>
  34. <view class="bor" style="background: linear-gradient(to right, #eecce0, rgb(253 253 253))"></view>
  35. <view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '尚未关联企业' : '已完成' }}</view>
  36. </view>
  37. <view class="state" v-if="user.isCompany > 0">
  38. <text class="zt">{{ user.isCompany }}家</text>
  39. <text class="icon">&#xe62b;</text>
  40. </view>
  41. <view class="state" v-else>
  42. <view class="go" :style="{ backgroundColor: user.isAuthentication === 1 ? '#5a7afc' : '#d6d6d6' }">去关联</view>
  43. </view>
  44. </view>
  45. <!--开始接包-->
  46. <view class="item">
  47. <view class="icon tb">&#xe604;</view>
  48. <view class="con">
  49. <view class="bt">开始接包</view>
  50. <view class="bor" style="background: linear-gradient(to right, #c9f1d4, rgb(250 255 252))"></view>
  51. <view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '请先完成上一步' : '去接包' }}</view>
  52. </view>
  53. <view class="state">
  54. <view class="go" :style="{ backgroundColor: user.isCompany > 0 ? '#5a7afc' : '#d6d6d6' }" @click="tab()">去接包</view>
  55. </view>
  56. </view>
  57. <!--电子签约-->
  58. <view class="item">
  59. <view class="icon tb">&#xe6ed;</view>
  60. <view class="con">
  61. <view class="bt">电子签约</view>
  62. <view class="bor" style="background: linear-gradient(to right, #f6f6bf, rgb(246 246 246))"></view>
  63. <view class="zt">{{ !user.isContract || user.isContract == 0 ? '请签约' : '已签约' }}</view>
  64. </view>
  65. <view class="state">
  66. <view class="go" :style="{ backgroundColor: user.isCompany > 0 ? '#5a7afc' : '#d6d6d6' }">去签约</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. export default {
  74. data() {
  75. return {
  76. ip: this.http.ip,
  77. user: {},
  78. bannerList: [{ image: '../../static/index.jpg' }],
  79. noticeList: ['承揽时代小程序上线了', '个人接包时代来临,动动手指就赚钱']
  80. };
  81. },
  82. onShow() {
  83. if (this.hasLogin()) {
  84. this.getUser();
  85. }
  86. },
  87. onLoad() {
  88. //this.getData();
  89. },
  90. methods: {
  91. getUser() {
  92. this.http.request({
  93. url: '/app/user/info',
  94. success: (res) => {
  95. this.user = res.data.data;
  96. }
  97. });
  98. },
  99. getData() {
  100. this.http.request({
  101. url: this.http.urls.home_list,
  102. success: (res) => {
  103. res.data.data.forEach((item) => {
  104. this.noticeList.push(item.title);
  105. });
  106. }
  107. });
  108. },
  109. go(url) {
  110. if (this.hasLogin()) {
  111. uni.navigateTo({ url: url });
  112. } else {
  113. uni.navigateTo({ url: '/pages/user/login' });
  114. }
  115. },
  116. tab() {
  117. if (this.user.isCompany > 0) {
  118. uni.switchTab({ url: '/pages/packages/index' });
  119. }
  120. }
  121. }
  122. };
  123. </script>
  124. <style lang="scss">
  125. .main {
  126. padding: 5px 15px 15px 15px;
  127. }
  128. .banner {
  129. }
  130. .notice {
  131. margin-top: 10px;
  132. }
  133. .flow {
  134. padding-top: 20px;
  135. .title {
  136. font-size: 15px;
  137. }
  138. .item {
  139. background-color: white;
  140. border-radius: 10px;
  141. padding: 18px;
  142. overflow: hidden;
  143. margin-top: 12px;
  144. .tb {
  145. float: left;
  146. padding: 13px;
  147. border: 1px solid $main-color;
  148. color: $main-color;
  149. border-radius: 50%;
  150. font-size: 23px;
  151. }
  152. .con {
  153. float: left;
  154. padding-left: 20px;
  155. .bt {
  156. font-size: 18px;
  157. }
  158. .bor {
  159. background-color: red;
  160. border-radius: 20px;
  161. height: 9px;
  162. margin-top: -9px;
  163. width: 105px;
  164. margin-left: -5px;
  165. }
  166. .zt {
  167. font-size: 13px;
  168. padding-top: 5px;
  169. color: #909090;
  170. }
  171. }
  172. .state {
  173. float: right;
  174. padding-top: 11px;
  175. .zt {
  176. font-size: 13px;
  177. color: $main-color;
  178. }
  179. .icon {
  180. color: #909090;
  181. }
  182. .go {
  183. padding: 5px 12px;
  184. font-size: 14px;
  185. background-color: #5a7afc;
  186. color: white;
  187. border-radius: 20px;
  188. }
  189. }
  190. }
  191. }
  192. </style>