index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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('auth')">
  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('company')">
  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" @click="go('packages')">
  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' }">去接包</view>
  55. </view>
  56. </view>
  57. <!--电子签约-->
  58. <view class="item" @click="go('contract')">
  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. if (url == 'auth') {
  112. uni.navigateTo({ url: '/pages/auth/index' });
  113. }
  114. if (url == 'company' && this.user.isAuthentication === 1) {
  115. uni.navigateTo({ url: '/pages/company/index' });
  116. }
  117. if (url == 'packages' && this.user.isCompany > 0) {
  118. uni.switchTab({ url: '/pages/packages/index' });
  119. }
  120. if (url == 'contract') {
  121. }
  122. } else {
  123. uni.navigateTo({ url: '/pages/user/login' });
  124. }
  125. }
  126. }
  127. };
  128. </script>
  129. <style lang="scss">
  130. .main {
  131. padding: 5px 15px 15px 15px;
  132. }
  133. .banner {
  134. }
  135. .notice {
  136. margin-top: 10px;
  137. }
  138. .flow {
  139. padding-top: 20px;
  140. .title {
  141. font-size: 15px;
  142. }
  143. .item {
  144. background-color: white;
  145. border-radius: 10px;
  146. padding: 18px;
  147. overflow: hidden;
  148. margin-top: 12px;
  149. .tb {
  150. float: left;
  151. padding: 13px;
  152. border: 1px solid $main-color;
  153. color: $main-color;
  154. border-radius: 50%;
  155. font-size: 23px;
  156. }
  157. .con {
  158. float: left;
  159. padding-left: 20px;
  160. .bt {
  161. font-size: 18px;
  162. }
  163. .bor {
  164. background-color: red;
  165. border-radius: 20px;
  166. height: 9px;
  167. margin-top: -9px;
  168. width: 105px;
  169. margin-left: -5px;
  170. }
  171. .zt {
  172. font-size: 13px;
  173. padding-top: 5px;
  174. color: #909090;
  175. }
  176. }
  177. .state {
  178. float: right;
  179. padding-top: 11px;
  180. .zt {
  181. font-size: 13px;
  182. color: $main-color;
  183. }
  184. .icon {
  185. color: #909090;
  186. }
  187. .go {
  188. padding: 5px 12px;
  189. font-size: 14px;
  190. background-color: #5a7afc;
  191. color: white;
  192. border-radius: 20px;
  193. }
  194. }
  195. }
  196. }
  197. </style>