Browse Source

云生态2

master^2
kk_888 3 years ago
parent
commit
44802a7007
  1. 14
      api/store.js
  2. 8
      components/vSwiper.vue
  3. 4
      config/index.js
  4. 2
      pages/activity/detail/index.vue
  5. 21
      pages/life/articleDetail/index.vue
  6. 53
      pages/life/index.vue

14
api/store.js

@ -144,6 +144,20 @@ export function getCartNum() {
return request.get("/cart/count");
}
// 最新活动
export function getActivity(data) {
return request.get("/life/index", data, {
login: true
});
}
/*
* 添加收藏
* */

8
components/vSwiper.vue

@ -5,11 +5,11 @@
<view class="item-box" :class="(swiperIndex == index ? 'active' : '')" @click="toDetial(item.id)">
<image mode="aspectFill" :src="item.imageInput" class="slide-image"></image>
<view class="content-box">
<view class="title-box">标题标题标题标题标题</view>
<view class="title-box">{{item.title}}</view>
<view class="content acea-row">
<view>云快讯</view>
<view>3小时</view>
<view>300阅读</view>
<view>3小时</view>
<view>{{item.visit}}阅读</view>
</view>
</view>
</view>
@ -92,7 +92,7 @@
margin-bottom: 10rpx;
}
.content{
color: #fff;
color: #000;
font-size: 26rpx;
}
.content view{

4
config/index.js

@ -1,7 +1,7 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api'
// export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api'
// export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api'
export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api'
// export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api'
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'

2
pages/activity/detail/index.vue

@ -109,7 +109,7 @@ export default {
*/
onLoad: function (options) {
let erCodeId = uni.getStorageSync('activityId');
console.log(options)
if (options.id) {
this.setData({
activityId: options.id

21
pages/life/articleDetail/index.vue

@ -2,14 +2,14 @@
<template>
<view class="article-box">
<view class="headline">楚牛电商一季度卖了300亿原因竟是这</view>
<view class="">
<view class="information-box acea-row">
<image src="../../../static/images/cart.png" mode=""></image>
<view class="">云快讯</view>
<view class="name">云快讯</view>
<view class="">203 </view>
<view>3小时前</view>
</view>
<view class="statement">转载声明本文由云快讯收录观点仅代表作者本人不代表云快讯立场云快讯不对所包含的准确性可靠性或完整性提供任何明示请自行承担任何责任</view>
<image src="../../../static/images/gd1.png" mode="" class="article-bg1"></image>
<!-- <view class="statement">转载声明本文由云快讯收录观点仅代表作者本人不代表云快讯立场云快讯不对所包含的准确性可靠性或完整性提供任何明示请自行承担任何责任</view>
<image src="../../../static/images/gd1.png" mode="" class="article-bg1"></image> -->
</view>
</template>
@ -46,4 +46,17 @@
padding-top: 30rpx;
margin-bottom: 60rpx;
}
.information-box{
width: 278rpx;
height: 92rpx;
}
.information-box image{
width: 72rpx;
height: 72rpx;
margin-right: 20rpx;
}
.name{
width: 180rpx;
height: 40rpx;
}
</style>

53
pages/life/index.vue

@ -47,38 +47,36 @@
</view>
</view>
<!-- 最新活动 -->
<view class="act-box">
<view class="act-box" >
<view class="headline"><image src="../../static/images/new-act.png" mode=""></image></view>
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="slide-left" v-for="(iiem,index) in 3" :key="index">
<view class="act-title">新零售与新营销模式重构和实战升级</view>
<view class="slide-left" v-for="(item,index) in activity" :key="index" @tap="toActiveDetail" :data-id="item.id">
<view class="act-title">{{item.name}}</view>
<view class="resource-list acea-row-nowrap">
<image src="../../static/images/new-bg.png" class="act-img"></image>
<image :src="item.images" class="act-img"></image>
<view>
<view class="act-time acea-row row-left">
<image src="../../static/images/act-time.png" mode=""></image>
<view>12-23 00:00至11-25 23:00</view>
<view>{{item.activityStartTime.split(' ')[0]}}{{item.activityEndTime.split(' ')[0]}}</view>
</view>
<view class="act-adress acea-row row-left">
<image src="../../static/images/act-address.png" mode=""></image>
<view class="line1">武汉市江夏区文化大道288号斤斤计较经济</view>
<view class="line1">{{item.address}}</view>
</view>
<view class="acea-row row-between-wrapper act-price">
<text class="act-i">进行中</text>
<text class="act-p">888.00</text>
<text class="act-p">{{item.price}}</text>
</view>
</view>
</view>
<view class="act-bottom acea-row row-between-wrapper">
<view class="act-bottom acea-row row-middle">
<view class="acea-row row-middle act-num">
<image src="../../static/images/cart.png"></image>
<image src="../../static/images/cart.png"></image>
<image src="../../static/images/cart.png"></image>
<text>15人报名</text>
</view>
<view class="enter-btn">
去报名
</view>
<view class="enter-btn">去报名</view>
</view>
</view>
</scroll-view>
@ -197,7 +195,7 @@
</view>
</template>
<script>
import { getCategory , getProducts, getArticle} from "@/api/store";
import { getCategory , getProducts, getArticle, getActivity} from "@/api/store";
import { trim } from "@/utils";
import { mapGetters } from 'vuex'
import tabbar from "../../tabbarComponent/tabbar";
@ -230,6 +228,7 @@ export default {
yunList: [],
active:1,
show:false,
activity:[],
};
},
watch: {
@ -245,6 +244,7 @@ export default {
mounted: function() {
this.getProducts();
this.getArticle();
this.getActivity();
},
onReachBottom() {
if(this.isLoad){
@ -319,6 +319,19 @@ export default {
this.yunList = res.data.content
})
},
getActivity(){
getActivity().then(res=>{
this.activity=res.data.activityList;
console.log(res);
})
},
toActiveDetail(e) {
let id = e.currentTarget.dataset.id;
uni.navigateTo({
url: '/pages/activity/detail/index?id=' + id
});
},
tabClick(i) {
console.log(i,'aiiii')
@ -516,6 +529,7 @@ export default {
width: 162rpx;
height: 190rpx;
margin-right: 28rpx;
border-radius: 12rpx;
}
.act-adress,.act-time{
margin: 8rpx 0 20rpx 0;
@ -529,14 +543,12 @@ export default {
.act-time image{
width: 18rpx;
height: 22rpx;
margin-right: 16rpx;
margin-top: 7rpx;
margin: 7rpx 16rpx 0 0;
}
.act-adress image{
width: 19rpx;
height: 23rpx;
margin-right: 14rpx;
margin-top: 8rpx;
margin: 8rpx 14rpx 0 0;
}
.act-price{
margin-top: 40rpx;
@ -548,9 +560,12 @@ export default {
.act-p{
font-size: 32rpx;
color: #2A2B2B;
font-weight: 600;
}
.act-bottom{
position: relative;
width: 562rpx;
height: 62rpx;
border-top: 1rpx solid #ECECEC;
}
.act-num image{
@ -560,7 +575,6 @@ export default {
}
.act-num{
min-width: 154rpx;
margin-top: 14rpx;
}
.act-num text{
font-size: 20rpx;
@ -575,9 +589,8 @@ export default {
background: linear-gradient(39deg, #FF5A0D 0%, #FFAC85 100%);
border-radius: 26rpx;
color: #fff;
margin-right: 38rpx;
margin-top: 8rpx;
position: absolute;
right: 38rpx;
}

Loading…
Cancel
Save