| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <template>
- <view class="content">
- <div class="choose-box">
- <div
- class="type"
- :class="{ active: typeActive }"
- @click="openPicker('type')"
- >
- 类型
- </div>
- <div
- class="state"
- :class="{ active: !typeActive }"
- @click="openPicker('state')"
- >
- 状态
- </div>
- </div>
- <div class="actives">
- <div v-for="(active, idx) in activeList" :key="idx" class="actives-item">
- <div class="active-content">
- <div class="img-box"><img :src="active.url" alt="" /></div>
- <div class="right">
- <div class="right-title">{{ active.title }}</div>
- <div class="right-inf">
- <div class="inf-type">
- <div
- :class="{ color: active.type == 1 }"
- class="originColor"
- ></div>
- <div>{{ active.type === 1 ? "线下" : "线上" }}</div>
- </div>
- <div class="inf-way">
- {{ active.way }}
- </div>
- <div class="inf-date">
- {{ active.date }}
- </div>
- </div>
- </div>
- </div>
- <div class="readShare">
- <div class="read">浏览 {{ active.read }}</div>
- <div class="share">分享 {{ active.share }}</div>
- </div>
- </div>
- </div>
- <mpvue-picker
- :themeColor="themeColor"
- ref="mpvuePicker"
- :mode="mode"
- :deepLength="deepLength"
- :pickerValueDefault="pickerValueDefault"
- @onConfirm="onConfirm"
- @onCancel="onCancel"
- :pickerValueArray="pickerValueArray"
- ></mpvue-picker>
- </view>
- </template>
- <script>
- import mpvuePicker from "@/components/mpvue-picker/mpvuePicker.vue";
- export default {
- components: {
- mpvuePicker,
- },
- data() {
- return {
- message: "找活动",
- themeColor: "#007AFF",
- mode: "selector",
- typeActive: true,
- deepLength: 1,
- pickerValueDefault: [0],
- pickerValueArray: [],
- pickerTypeArray: [
- {
- label: "全部",
- value: 1,
- },
- {
- label: "线上",
- value: 2,
- },
- {
- label: "线下",
- value: 3,
- },
- ],
- pickerStateArray: [
- {
- label: "全部",
- value: 4,
- },
- {
- label: "待开始",
- value: 5,
- },
- {
- label: "已开始",
- value: 6,
- },
- {
- label: "已结束",
- value: 7,
- },
- ],
- activeList: [
- {
- url: "/static/activity/1.png",
- title: "400场讲座,200门课程,免费送上门!就等你申请",
- way: "区人力资源局",
- date: "2021-08-08",
- read: 322,
- share: 1,
- type: 1, //1线上
- },
- {
- url: "/static/activity/2.png",
- title: "智能制造商标品牌培育系列培训活动",
- way: "市场监督管理局",
- date: "2021-08-07",
- read: 322,
- share: 1,
- type: 0, //0线下
- },
- ],
- };
- },
- onLoad() {},
- methods: {
- onConfirm() {},
- onCancel() {},
- openPicker(op) {
- switch (op) {
- case "type":
- this.pickerValueArray = this.pickerTypeArray;
- this.typeActive = true;
- break;
- case "state":
- this.pickerValueArray = this.pickerStateArray;
- this.typeActive = false;
- }
- this.$refs.mpvuePicker.show();
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .content {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 100%;
- .choose-box {
- padding: 20rpx 0;
- width: 100%;
- display: flex;
- position: fixed;
- height: 50rpx;
- top: 0;
- margin-bottom: 50rpx;
- .type,
- .state {
- width: 50%;
- display: flex;
- justify-content: center;
- }
- }
- .actives {
- margin-top: 50rpx;
- padding: 0 40rpx;
- display: flex;
- flex-direction: column;
- .actives-item {
- height: 150rpx;
- box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
- border-radius: 32rpx;
- margin-top: 20px;
- padding: 50rpx;
- display: flex;
- flex-direction: column;
- .active-content {
- display: flex;
- .img-box {
- margin-right: 20rpx;
- width: 120rpx;
- height: 120rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .right {
- height: 120rpx;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- .right-title {
- margin-bottom: 20rpx;
- font-size: 27rpx;
- font-weight: 600;
- letter-spacing: 3rpx;
- }
- .right-inf {
- display: flex;
- font-size: 22rpx;
- color: $uni-text-color-grey;
- .inf-type {
- margin-right: 20rpx;
- display: flex;
- align-items: center;
- .originColor {
- margin-right: 8rpx;
- height: 25rpx;
- width: 25rpx;
- border-radius: 50%;
- background-color: #ffcf86;
- }
- }
- .inf-way {
- margin-right: 20rpx;
- }
- }
- }
- }
- .readShare {
- display: flex;
- justify-content: flex-end;
- font-size: 20rpx;
- color: rgba(0, 0, 0, 0.3);
- margin-top: 20rpx;
- .read {
- margin-right: 60rpx;
- }
- }
- }
- }
- }
- .active {
- color: $uni-color-primary;
- }
- .color {
- background-color: #589cff !important;
- }
- </style>
|