myselection.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view>
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="menu" v-if="!loading">
  7. <view class="menu-item" @click="toAll()">
  8. <p v-bind:class="tab == 'all'?'lor':'unlor'">全部</p>
  9. </view>
  10. <view class="menu-item" @click="toApply()">
  11. <p v-bind:class="tab == 'apply'?'lor':'unlor'">已报名</p>
  12. </view>
  13. <view class="menu-item" @click="toExecute()">
  14. <p v-bind:class="tab == 'execute'?'lor':'unlor'">执行中</p>
  15. </view>
  16. <view class="menu-item" @click="toEnd()">
  17. <p v-bind:class="tab == 'end'?'lor':'unlor'">已结束</p>
  18. </view>
  19. </view>
  20. <view class="home" v-if="tab == 'all'" style="padding-top: 100rpx;">
  21. <view class="task">
  22. <view class="task-card">
  23. <view class="task-head">
  24. <view class="task-head-account">
  25. <image class="platform-img"></image>
  26. <p>丸子在成都</p>
  27. </view>
  28. <view class="task-head-status">
  29. <p>已报名</p>
  30. </view>
  31. </view>
  32. <view class="task-info">
  33. <view class="task-info-left">
  34. <image class="project-img"></image>
  35. <view class="task-info-txt">
  36. <p style="color: #000;font-size: 32rpx;">鹿小井婴儿餐具清洗液</p>
  37. <p style="color: #F0D232;">上传截止时间:2022/1/9 10:00</p>
  38. <p>样品预计返现金额:¥35.0</p>
  39. <p>预计收益:¥300.0</p>
  40. </view>
  41. </view>
  42. </view>
  43. <view style="text-align: right;">
  44. <p style="display: inline-block;">实际收益:¥435.0</p>
  45. </view>
  46. </view>
  47. <view class="task-card">
  48. <view class="task-head">
  49. <view class="task-head-account">
  50. <image class="platform-img"></image>
  51. <p>丸子在成都</p>
  52. </view>
  53. <view class="task-head-status">
  54. <p>已报名</p>
  55. </view>
  56. </view>
  57. <view class="task-info">
  58. <view class="task-info-left">
  59. <image class="project-img"></image>
  60. <view class="task-info-txt">
  61. <p style="color: #000;font-size: 32rpx;">鹿小井婴儿餐具清洗液</p>
  62. <p style="color: #F0D232;">上传截止时间:2022/1/9 10:00</p>
  63. <p>样品预计返现金额:¥35.0</p>
  64. <p>预计收益:¥300.0</p>
  65. </view>
  66. </view>
  67. </view>
  68. <view style="text-align: right;">
  69. <p style="display: inline-block;">实际收益:¥435.0</p>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="home" v-if="tab == 'apply'" style="padding-top: 100rpx;">
  75. </view>
  76. <view class="home" v-if="tab == 'execute'" style="padding-top: 100rpx;">
  77. </view>
  78. <view class="home" v-if="tab == 'end'" style="padding-top: 100rpx;">
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import mvBar from "@/components/mys_navBar/mysNavBar";
  85. export default {
  86. components: {
  87. mvBar,
  88. },
  89. data() {
  90. return {
  91. navH: getApp().globalData.navHeight,
  92. mysNavConfig: {
  93. /* 开启单页显示首页图标 */
  94. isHome: true,
  95. /* 固定导航 */
  96. navFixed: true,
  97. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  98. navTitle: {
  99. text: "选品广场",
  100. color: "",
  101. fontSize: "32rpx", // px upx rpx
  102. fontWeight: "normal", // 100 - 700
  103. },
  104. btnType: "type2",
  105. onLeftClick: "/pages/mycenter/mycenter",
  106. /* type2 按钮 */
  107. type2Config: {
  108. // 左图标
  109. leftPath: "/static/img/png2.png",
  110. // 右图标
  111. rightPath: "/static/img/png4.png",
  112. // 圆角
  113. radius: "40rpx",
  114. },
  115. },
  116. tab: 'all',
  117. }
  118. },
  119. async onLoad(options) {
  120. // 判断登录
  121. await this.isLogin();
  122. if (this.token === '') {
  123. uni.showModal({
  124. content: '请先登录',
  125. success: function(res) {
  126. if (res.confirm) {
  127. uni.navigateTo({
  128. url: '/pages/login/login'
  129. });
  130. } else if (res.cancel) {
  131. uni.navigateBack();
  132. }
  133. }
  134. });
  135. }
  136. let data = options.textObj.replace(/""/g, "");
  137. data = JSON.parse(decodeURIComponent(data))
  138. this.tab = data.tab
  139. },
  140. methods: {
  141. // 判断登陆是否过期
  142. isLogin() {
  143. return this.$https.get('/youngee/c/t/g/is-login')
  144. .then(res => {
  145. if (res.data.code === 403) {
  146. // 登陆已失效
  147. this.token = ""
  148. uni.clearStorage();
  149. } else {
  150. this.token = uni.getStorageSync('token')
  151. }
  152. })
  153. },
  154. toAll() {
  155. this.tab = 'all'
  156. },
  157. toApply() {
  158. this.tab = 'apply'
  159. },
  160. toExecute() {
  161. this.tab = 'execute'
  162. },
  163. toEnd() {
  164. this.tab = 'end'
  165. },
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. p {
  171. font-size: 32rpx;
  172. }
  173. .menu {
  174. position: fixed;
  175. border-bottom: #FCCF41;
  176. background-color: #FFFFFF;
  177. justify-content: space-around;
  178. height: 5%;
  179. width: 100%;
  180. display: flex;
  181. z-index: 10;
  182. }
  183. .menu-item p {
  184. font-weight: 600;
  185. &.lor {
  186. border-bottom: 5rpx solid #F0D232;
  187. color: #F0D232;
  188. padding-bottom: 15rpx;
  189. }
  190. &.unlor {
  191. border-bottom: 5rpx solid #fff;
  192. color: #81838f;
  193. padding-bottom: 15rpx;
  194. }
  195. }
  196. .task-card {
  197. margin: 10rpx 0;
  198. // border-bottom: 1rpx #d7d7d7 solid;
  199. .task-head {
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. padding: 10rpx 20rpx;
  204. .task-head-account {
  205. display: flex;
  206. }
  207. .platform-img {
  208. width: 40rpx;
  209. height: 40rpx;
  210. margin-right: 10rpx;
  211. background-color: #F0D232;
  212. }
  213. .task-head-status p {
  214. color: red;
  215. }
  216. }
  217. .task-info {
  218. display: flex;
  219. justify-content: space-between;
  220. padding: 10rpx 20rpx;
  221. .task-info-left {
  222. display: flex;
  223. // align-items: center;
  224. .project-img {
  225. height: 120rpx;
  226. width: 120rpx;
  227. background-color: #b3c96b;
  228. }
  229. .task-info-txt {
  230. margin-left: 10rpx;
  231. }
  232. .task-info-txt p {
  233. font-size: 24rpx;
  234. color: #85859d;
  235. margin-bottom: 10rpx;
  236. }
  237. }
  238. .task-info-right p {
  239. font-size: 24rpx;
  240. }
  241. }
  242. }
  243. </style>