| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <template>
- <view class="content">
- <view class="actives">
- <view
- class="notice-content-box"
- v-for="(item, index) in activityList"
- :key="index"
- style="justify-content: start; padding: 30rpx 0 30rpx 30rpx;border-radius: 0;"
- @click="goActiveDeatil(item.id)" >
- <image
- :src="item.url"
- style="
- width: 112rpx;
- height: 112rpx;
- margin-right: 20rpx;
- border-radius: 10%;
- "
- ></image>
- <view class="notice-content" style="width: 75%">
- <view class="notice-content-font">{{
- item.title
- }}</view>
- <view class="display-flex-start" style="margin-top: 20rpx">
- <view class="notice-content-time color-a7adba">
- {{item.address}}
- </view>
- <view class="notice-content-time display-flex-start">
- <text class="color-a7adba">¥:</text>
- <text class="order-money">{{item.money}}</text>
- </view>
- </view>
- <view class="display-between" style="margin-top: 20rpx">
- <view class="notice-content-time color-a7adba" style="visibility: hidden;">
- {{item.time}}
- </view>
- <view class="display-flex-start">
- <view class="notice-content-time" style="color: #d9001b;">{{item.orderStatus}}</view>
- </view>
- </view>
- </view>
- </view>
- <image src="../../static/nodata.svg" mode="aspectFit" style="width: 100%;" v-if="activityList.length === 0"></image>
- </view>
- </view>
- </template>
- <script>
- import md5 from "@/common/md5.js";
- export default {
- data() {
- return {
- message: "我的活动",
- themeColor: "#007AFF",
- mode: "selector",
- typeActive: true,
- indexType: 0,
- indexState: 0,
- activityList: [
- {
- url: "/static/order-poster.svg",
- title: "2022-2023年度供暖费",
- address: "千林郡5号楼1单元10层1001室",
- money:'2385.40',
- time: "2021-09-05",
- orderStatus:'待缴费'
- },
- {
- url: "/static/order-poster.svg",
- title: "2022-2023年度供暖费",
- address: "千林郡5号楼1单元10层1001室",
- money:'2385.40',
- time: "2021-09-05",
- orderStatus:'已缴费'
- },
- {
- url: "/static/order-poster.svg",
- title: "2022-2023年度供暖费",
- address: "千林郡5号楼1单元10层1001室",
- money:'2385.40',
- time: "2021-09-05",
- orderStatus:'空置已缴费'
- },
- ],
- activeListCopy: [],
- };
- },
- onLoad() {
- this.getActive();
- },
- methods: {
- goDeatil(id) {
- uni.navigateTo({
- url: "/pages/activity/activity_deatil?id=" + id,
- });
- },
- getActive() {
- let md5Sign = md5(
- "method=" +
- "activity" +
- "×tamp=" +
- getApp().globalData.globalTimestamp +
- "&secret=" +
- getApp().globalData.secret
- );
- let url =
- getApp().globalData.shareUrl +
- "api/api.php" +
- "?method=activity&source=activity&action=my_list×tamp=" +
- getApp().globalData.globalTimestamp +
- "&sign=" +
- md5Sign;
- let postData = {
- // page: 1,
- // page_size: 15,
- openId:getApp().globalData.open_id
- };
- uni.request({
- url: url,
- method: "POST",
- header: {
- "content-type": "application/x-www-form-urlencoded",
- },
- data: postData,
- success: (res) => {
- // console.log(res);
- if (res.data.code === 200) {
- let list = res.data.data.list;
- this.activeList = list.map((item) => {
- /*
- url: "/static/activity/2.png",
- title: "智能制造商标品牌培育系列培训活动",
- way: "市场监督管理局",
- date: "2021-08-07",
- read: 322,
- share: 1,
- type: 0, //0线下
- */
- let ob = {
- url: "",
- title: "",
- way: "",
- date: "",
- read: 0,
- share: 0,
- type: "",
- status:'',
- id: "",
- status: 0,
- };
- ob.url = item.pic_url ? getApp().globalData.shareUrl + item.pic_url : '/static/activity/default.png';
- ob.title = item.name;
- ob.way = item.sponsor;
- let time = this.$options.filters["globalTime"](item.start_time);
- let timeSecond = this.$options.filters["globalTime"](item.end_time);
- ob.date = time + "至" + timeSecond;
- ob.read = parseInt(item.base_read_count) + parseInt(item.real_read_count);
- ob.share =parseInt(item.real_repost_count) +parseInt(item.base_repost_count);
- ob.type = item.type;
- ob.status = item.status;
- ob.id = item.id;
- ob.status = item.status;
- return ob;
- });
- this.activeListCopy = this.activeList;
- }
- },
- fail: () => {
- console.log("连接失败");
- },
- });
- },
- },
- };
- </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;
- position: relative;
- .packer {
- width: 100%;
- .picker_title {
- z-index: 99;
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- }
- }
- }
- .type::after,
- .state::after {
- z-index: -1;
- content: "";
- position: absolute;
- right: 30%;
- top: 20%;
- width: 0;
- height: 0;
- border-top: 15rpx solid rgb(173, 173, 173);
- border-left: 15rpx solid transparent;
- border-right: 15rpx solid transparent;
- }
- }
- .actives {
- width: 90%;
- // margin-top: 50rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- .actives-item {
- width: 100%;
- // height: 150rpx;
- box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
- border-radius: 32rpx;
- // margin-top: 20px;
- padding: 20rpx;
- display: flex;
- flex-direction: column;
- margin-top: 20rpx;
- margin-bottom: 10rpx;
- .readShare {
- display: flex;
- justify-content: flex-end;
- font-size: 26rpx;
- color: rgba(0, 0, 0, 0.3);
- margin-top: 20rpx;
- align-items: center;
- .active-tips-box {
- font-size: 28rpx;
- padding: 10rpx;
- border-radius: 10rpx;
- color: #fff;
- margin-right: 50rpx;
- }
- .wait-color {
- background-color: #aee359;
- }
- .ing-color {
- background-color: #00a8ea;
- }
- .end-color {
- background-color: #d7d7d7;
- }
- .read {
- width: 20%;
- text-align: center;
- // margin-right: 60rpx;
- }
- .share {
- width: 20%;
- text-align: center;
- }
- }
- }
- }
- }
- .active {
- color: $uni-color-primary;
- }
- .color {
- background-color: #589cff !important;
- }
- .notice-content-box {
- display: flex;
- padding: 30rpx 20rpx 30rpx 20rpx;
- background-color: #ffffff;
- box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
- border-radius: 32rpx;
- margin-top: 20rpx;
- justify-content: space-between;
- .notice-content-font {
- font-size: 32rpx;
- color: #0d1937;
- /* font-weight: 600; */
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .notice-content-time {
- font-size: 26rpx;
- letter-spacing: 0.02em;
- color: #333333;
- }
- .order-money {
- color: #d9001b;
- font-size: 36rpx;
- font-weight: 500;
- }
- }
- </style>
|