master
xy 3 years ago
parent d33d9d5943
commit 551bbfa31c

@ -19,6 +19,18 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/active/detail",
"style": {
"navigationBarTitleText": "活动详情"
}
},
{
"path": "pages/active/my",
"style": {
"navigationBarTitleText": "我的活动"
}
},
{
"path": "pages/member/member",

@ -16,54 +16,28 @@
</swiper>
</view>
</view>
<view class="menuBox">
<view class="menuCol">
<image src="../../static/icon_home_huodong@2x.png"></image>
<view>参加活动</view>
</view>
<view class="menuCol">
<image src="../../static/icon_home_fuwu@2x.png"></image>
<view>享受服务</view>
</view>
<view class="menuCol">
<image src="../../static/icon_home_youhui@2x.png"></image>
<view>特价优惠</view>
</view>
<view class="menuCol">
<image src="../../static/icon_home_shanghu@2x.png"></image>
<view>优质商户</view>
</view>
<view class="menuCol">
<image src="../../static/icon_home_youxuan@2x.png"></image>
<view>为您优选</view>
</view>
<view class="menuCol">
<image src="../../static/icon_home_shangcheng@2x.png"></image>
<view>母婴商城</view>
</view>
<view class="menuCol" @tap="goCarecenter">
<image src="../../static/icon_home_yuezizhongxin.png"></image>
<view>月子中心</view>
</view>
<view class="menuCol">
<image src="../../static/icon_home_women@2x.png"></image>
<view>关于我们</view>
</view>
<view class="menuBox">
<block v-for="item in indexNav" :key="item.id">
<view class="menuCol" @click="toAction(item)" data-id="-1">
<image :src="item.icon"></image>
<view>{{item.name}}</view>
</view>
</block>
</view>
<!--为您精选活动-->
<view class="introBox">
<view class="normal_tit">为您精选</view>
<view class="intro_row">
<view class="row_col" v-for="item in activityList" :key="item.id" @tap="gotoDetail(item.id, 1)">
<view class="row_col" v-for="item in activityList.slice(0,2)" :key="item.id" @tap="gotoDetail(item.id)">
<view class="imgOuter">
<image mode="aspectFill" :src="item.cover"></image>
<image mode="aspectFill" :src="item.active_playbill"></image>
<view class="date">{{item.end_at}}</view>
</view>
<view class="title">{{item.name}}</view>
<view class="subTit">{{item.address}}</view>
<view class="price">
<text class="font_red">{{item.activity_price[0].selling_price > 0 ? `${item.activity_price[0].selling_price}` : '免费'}}</text>
{{item.people_number}}人参与
<text class="font_red">{{ Number(item.money) > 0 ? `${item.money}` : '免费' }}</text>
{{item.member_sum}}人参与
</view>
</view>
</view>
@ -79,8 +53,8 @@
<!--为您推荐福利&&服务-->
<view class="introBox hasMenu">
<view class="normal_tit padding_20">为您推荐</view>
<view class="intro_column" v-for="item in serviceList" :key="item.id" @tap="gotoDetail(item.id, 2)">
<view class="imgOuter"><image mode="aspectFill" :src="item.cover"></image><view class="i_intro">推荐</view></view>
<view class="intro_column" v-for="item in activityList" :key="item.id" @tap="gotoDetail(item.id)">
<view class="imgOuter"><image mode="aspectFill" :src="item.active_playbill"></image><view class="i_intro">推荐</view></view>
<view class="columnInfo">
<view class="title">{{item.name}}</view>
<view class="tags">
@ -89,10 +63,10 @@
<view class="subInfo">{{item.end_at}}</view>
<view class="subInfo">{{item.address}}</view>
<view class="price">
<text class="font_red" v-if="item.service_price[0].selling_price > 0">{{item.service_price[0].selling_price}}</text>
<text class="font_red" v-if="Number(item.money) > 0">{{item.money}}</text>
<text class="free" v-else></text>
<view class="shareMoney" v-if="item.service_price[0].shared_price > 0">
<text>分享金</text>{{item.service_price[0].shared_price}}
<view class="shareMoney" v-if="Number(item.money) > 0">
<text>分享金</text>{{ Number(item.money) }}
</view>
</view>
</view>
@ -109,7 +83,13 @@
indicatorDots: true,
autoplay: true,
interval: 4000,
activityList: [],
activityList: [],
activitySelect:{
page:1,
page_size:5,
myself:0
},
indexNav: [],
serviceList: [],
ads: [],
page: 1,
@ -120,58 +100,109 @@
},
onShow() {
this.getAdS()
this.getActivityList()
this.getServiceList()
this.getActivityList()
this.getNav()
// this.getServiceList()
},
onReachBottom() {
this.getServiceList()
this.getActivityList()
},
methods: {
goCarecenter(){
uni.navigateTo({
url:"../../packages/packageCarecenter/pages/careCenter/careCenter"
})
methods: {
toAction: function(item) {
console.log(item)
if (item.link) {
uni.redirectTo({
url: item.link
})
} else {
uni.showToast({
icon: "none",
title: "建设中"
})
}
},
async getNav(code) {
await weixin.request({
newUrl: true,
api: '/api/member/applet-menu-first/index',
data: {
page: 1,
page_size: 8,
sort_name: "sort_number",
sort_type: "asc"
},
utilSuccess: (res) => {
this.indexNav = res.data;
}
})
},
getActivityList() {
uni.request({
url: this.baseUrl + '/api/wechat/activity-index',
method: 'POST',
data: {page_size: 2},
success: r => {
if (r.data.code == 0) {
this.activityList = r.data.data.list
}
}
weixin.request({
api:"/api/member/active-list",
data:this.activitySelect,
utilSuccess:res => {
if(res.data.length > 0){
this.activitySelect.page ++
}else{
uni.showToast({
icon:'none',
title:"没有更多了"
})
}
if(this.activitySelect.page === 1){
this.activityList = res.data
}else{
this.activityList.push(...res.data)
}
console.log(res);
},
utilFail:err => {
console.log(err);
}
})
},
getServiceList() {
uni.request({
url: this.baseUrl + '/api/wechat/service-index',
method: 'POST',
data: {page: this.page},
success: r => {
if (r.data.code == 0) {
this.serviceList = this.serviceList.concat(r.data.data.list)
this.page++
}
}
})
// weixin.request({
// api:"/api/member/active-list",
// data:{
// },
// utilSuccess:res => {
// console.log(res);
// },
// utilFail:err => {
// console.log(err);
// }
// })
},
getAdS() {
uni.request({
url: this.baseUrl + '/api/wechat/adertisement-index',
method: 'POST',
data: {},
success: r => {
if (r.data.code == 0) {
this.ads = r.data.data
}
}
})
getAdS() {
this.ads = []
weixin.request({
newUrl: true,
api: '/api/member/other/advertisement',
data: {
origin_system: 1
},
utilSuccess: (res) => {
res.map(item => {
if (item.type === 0) {
this.ads.push({
id: item.id,
pic: item.pic,
action: item.action
})
}
})
},
utilFail: (err) => {
console.log(err, 'err');
}
})
},
gotoDetail(id, type) {
gotoDetail(id) {
uni.navigateTo({
url: `/pages/detail/detail?id=${id}&type=${type}`
url: `/pages/active/detail?id=${id}`
})
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,291 @@
<template>
<view class="introBox hasMenu">
<view v-if="activityList.length > 0">
<view class="intro_column" v-for="item in activityList" :key="item.id" @tap="gotoDetail(item.id)">
<view class="imgOuter">
<image mode="aspectFill" :src="item.active_playbill"></image>
<view class="i_intro">推荐</view>
</view>
<view class="columnInfo">
<view class="title">{{item.name}}</view>
<view class="tags">
<text v-for="(sub, subIdx) in item.label" :key="subIdx">{{sub}}</text>
</view>
<view class="subInfo">{{item.end_at}}</view>
<view class="subInfo">{{item.address}}</view>
<view class="price">
<text class="font_red" v-if="Number(item.money) > 0">{{item.money}}</text>
<text class="free" v-else></text>
<view class="shareMoney" v-if="Number(item.money) > 0">
<text>分享金</text>{{ Number(item.money) }}
</view>
</view>
</view>
</view>
</view>
<view v-else style="padding: 20rpx 0;text-align: center;font-weight: 600;">
暂无数据
</view>
</view>
</template>
<script>
import {
weixin
} from '@/utils/weixin.js'
export default {
data() {
return {
activitySelect: {
page: 1,
page_size: 10,
myself: 1
},
activityList: []
}
},
onReachBottom() {
this.getActivityList()
},
methods: {
gotoDetail(id) {
uni.navigateTo({
url: `/pages/active/detail?id=${id}`
})
},
getActivityList() {
weixin.request({
api: "/api/member/active-list",
data: this.activitySelect,
utilSuccess: res => {
if (res.data.length > 0) {
this.activitySelect.page++
} else {
uni.showToast({
icon: 'none',
title: "没有更多了"
})
}
if (this.activitySelect.page === 1) {
this.activityList = res.data
} else {
this.activityList.push(...res.data)
}
console.log(res);
},
utilFail: err => {
console.log(err);
}
})
},
},
onShow() {
this.getActivityList()
}
}
</script>
<style lang="scss" scoped>
.introBox {
width: 710rpx;
margin: 20rpx auto 0 auto;
border-radius: 16rpx;
background: #fff;
padding: 0 35rpx;
box-sizing: border-box;
}
.intro_row {
display: flex;
justify-content: space-between;
width: 100%;
}
.row_col {
width: 310rpx;
border-radius: 8rpx;
padding-bottom: 20rpx;
.imgOuter {
width: 310rpx;
height: 230rpx;
position: relative;
image {
width: 310rpx;
height: 230rpx;
border-radius: 8rpx 8rpx 0 0;
}
.date {
background-color: rgba(0, 0, 0, 0.3);
font-size: 20rpx;
color: #fff;
line-height: 32rrpx;
padding: 0 8rpx;
border-radius: 5rpx;
position: absolute;
left: 20rpx;
bottom: 20rpx;
font-weight: 500;
}
}
.title {
width: 100%;
font-size: 28rpx;
color: #333;
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-top: 20rpx;
}
.subTit {
width: 100%;
font-size: 22rpx;
color: #333;
font-weight: 400;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-top: 10rpx;
}
.price {
margin-top: 20rpx;
font-size: 22rpx;
color: #999;
text {
font-size: 32rpx;
font-weight: 400;
padding-right: 15rpx;
}
}
}
.introBox .intro_column:last-child {
border-bottom: none;
}
.intro_column {
display: flex;
justify-content: flex-start;
padding: 20rpx 0;
border-bottom: 2rpx solid #EAEAEA;
.imgOuter {
width: 260rpx;
height: 210rpx;
position: relative;
image {
width: 260rpx;
height: 210rpx;
border-radius: 5rpx;
}
.i_intro {
position: absolute;
top: 0;
left: 0;
width: 68rpx;
height: 32rpx;
background: #FF578A;
border-radius: 5rpx 0px 18rpx 5rpx;
font-size: 22rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 32rpx;
text-align: center;
}
}
.columnInfo {
width: 360rpx;
margin-left: 22rpx;
.title {
width: 100%;
font-size: 30rpx;
font-weight: bold;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tags text {
height: 28rpx;
background: rgba(255, 177, 62, 0.1);
border-radius: 4rpx;
line-height: 28rpx;
font-size: 20rpx;
padding: 0 10rpx;
margin-right: 10rpx;
color: #FF753E;
}
.subInfo {
width: 100%;
font-size: 24rpx;
color: #999;
font-weight: 400;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-top: 5rpx;
.font_red {
margin-left: 10rpx;
}
}
.price {
display: flex;
justify-content: flex-start;
align-items: center;
align-content: center;
margin-top: 8rpx;
text {
margin-right: 10rpx;
}
.shareMoney {
height: 28rpx;
border: 2rpx solid #FF578A;
border-radius: 4rpx;
line-height: 28rpx;
font-size: 20rpx;
margin-right: 10rpx;
padding-right: 10rpx;
color: #FF578A;
display: flex;
flex-direction: flex-start;
text {
background: #FF578A;
color: #fff;
padding: 0 10rpx;
}
}
.free {
height: 28rpx;
background: #FF753E;
border-radius: 4rpx;
line-height: 28rpx;
font-size: 20rpx;
padding: 0 10rpx;
margin-right: 10rpx;
color: #fff;
}
}
}
}
</style>

@ -45,6 +45,36 @@
</view>
</view>
</view>
</view>
<view class="myOrder">
<view class="orderTab">我的活动</view>
<view class="content">
<view class="tabCol">
<view class="orderMenu">
<!-- <view class="menuCol" @tap="goOrderCol(0)">
<image src="../../static/icon_daifukuan@2x.png"></image>
<text>待确认</text>
</view> -->
<view class="menuCol" @tap="goMyActive('unpaid')">
<image src="../../static/icon_daifuwu@2x.png"></image>
<text>待支付</text>
</view>
<view class="menuCol" @tap="goMyActive('ongoing')">
<image src="../../static/icon_yifuwu@2x.png"></image>
<text>进行中</text>
</view>
<view class="menuCol" @tap="goMyActive('finished')">
<image src="../../static/icon_daipingjia@2x.png"></image>
<text>已完成</text>
</view>
<view class="menuCol allOrder" @tap="goMyActive()">
<image src="../../static/icon_dingdan@2x.png"></image>
<text>全部活动</text>
<image class="line" src="../../static/bg_yinying@2x.png"></image>
</view>
</view>
</view>
</view>
</view>
<!--更多服务-->
<view class="introBox" style="display: none;">
@ -269,6 +299,11 @@
uni.navigateTo({
url: "../../packages/packageOrder/pages/myOrder/myOrder?status=" + v
})
},
goMyActive(flag){
uni.navigateTo({
url:'/pages/active/my'
})
},
nodata() {
uni.showToast({

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Loading…
Cancel
Save