1、首页的轮播图的接口对接
This commit is contained in:
parent
bb30e2332f
commit
39ececc902
@ -14,17 +14,18 @@
|
|||||||
<!-- 满减券 -->
|
<!-- 满减券 -->
|
||||||
<view class="exChangeBox" v-if="currentTab == 0">
|
<view class="exChangeBox" v-if="currentTab == 0">
|
||||||
<view class="couponsList">
|
<view class="couponsList">
|
||||||
<view class="list-item">
|
<view class="list-item" v-for="(item, index) in couponFullList" :key="index">
|
||||||
<view class="itemLeft">
|
<view class="itemLeft">
|
||||||
<view class="fslh60 c3 bold">50</view>
|
<view class="fslh60 c3 bold">{{item.amount}}</view>
|
||||||
<view class="fslh28 c3 regular" style="margin-top: 15rpx;">满减券</view>
|
<view class="fslh28 c3 regular" style="margin-top: 15rpx;">{{item.type_text}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemRight">
|
<view class="itemRight">
|
||||||
<view class="item-RightLeft">
|
<view class="item-RightLeft">
|
||||||
<view class="fs32 c3D bold" style="line-height: 36rpx;">满100减50</view>
|
<view class="fs32 c3D bold" style="line-height: 36rpx;">{{item.name}}</view>
|
||||||
<view class="fs24 c9 regular" style="margin-top: 20rpx;line-height: 30rpx;">仅限原料商城可用</view>
|
<view class="fs24 c9 regular" style="margin-top: 20rpx;line-height: 30rpx;">仅限原料商城可用
|
||||||
</view>
|
</view>
|
||||||
<view class="item-btn">去使用</view>
|
</view>
|
||||||
|
<view class="item-btn" @click="toUseFull(item)">去使用</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -33,18 +34,18 @@
|
|||||||
<!-- 次数券 -->
|
<!-- 次数券 -->
|
||||||
<view class="exChangeBox" v-if="currentTab == 1">
|
<view class="exChangeBox" v-if="currentTab == 1">
|
||||||
<view class="couponsList">
|
<view class="couponsList">
|
||||||
<view class="list-item" v-for="(item, index) in couponList" :key="index"
|
<view class="list-item" v-for="(e, i) in couponTimesList" :key="i">
|
||||||
@click="openCouponPro(item)">
|
|
||||||
<view class="itemLeft">
|
<view class="itemLeft">
|
||||||
<view class="fslh60 c3 bold">1</view>
|
<view class="fslh60 c3 bold" style="text-align: center;">{{e.mobile_number}}</view>
|
||||||
<view class="fslh28 c3 regular" style="margin-top: 15rpx;">次数券</view>
|
<view class="fslh28 c3 regular" style="margin-top: 15rpx;">次数券</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemRight">
|
<view class="itemRight">
|
||||||
<view class="item-RightLeft">
|
<view class="item-RightLeft">
|
||||||
<view class="fs32 c3D bold" style="line-height: 36rpx;">增加拨打次数</view>
|
<view class="fs32 c3D bold" style="line-height: 36rpx;">{{e.name}}</view>
|
||||||
<view class="fs24 c9 regular" style="margin-top: 20rpx;line-height: 30rpx;">仅限增加拨打次数使用</view>
|
<view class="fs24 c9 regular" style="margin-top: 30rpx;line-height: 30rpx;">
|
||||||
|
仅限增加拨打次数使用</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-btn">去使用</view>
|
<view class="item-btn" @click="toUseTimes(e)">去使用</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -52,10 +53,14 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 无数据展示 -->
|
<!-- 无数据展示 -->
|
||||||
<view class="grid flex-column justify-center align-center" v-if="couponList.length == 0" style="margin: 0 auto;margin-top: 300rpx;">
|
<view class="grid flex-column justify-center align-center"
|
||||||
<image src="https://jiangxiaoxian.0rui.cn/noneList.png" mode="" style="width: 520rpx;height: 259rpx;">
|
v-if="(currentTab == 0 && couponFullCount == 0) || (currentTab == 1 && couponTimesCount == 0)"
|
||||||
|
style="margin: 0 auto;margin-top: 300rpx;">
|
||||||
|
<image src="https://jiangxiaoxian.0rui.cn/noneList.png" mode=""
|
||||||
|
style="width: 520rpx;height: 259rpx;">
|
||||||
</image>
|
</image>
|
||||||
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;text-align: center;width: 100%;">暂无数据信息</view>
|
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;text-align: center;width: 100%;">
|
||||||
|
暂无数据信息</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@ -86,7 +91,7 @@
|
|||||||
status: 1,
|
status: 1,
|
||||||
})
|
})
|
||||||
const tabMaps = [{
|
const tabMaps = [{
|
||||||
name: '优惠券',
|
name: '满减券',
|
||||||
value: '1',
|
value: '1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -102,8 +107,16 @@
|
|||||||
currentTab.value = e.index
|
currentTab.value = e.index
|
||||||
console.log('切换tabs', currentTab.value);
|
console.log('切换tabs', currentTab.value);
|
||||||
listQuery.value.status = e.value
|
listQuery.value.status = e.value
|
||||||
couponList.value = []
|
listQuery.value.page = 1;
|
||||||
getCouponList();
|
listQuery.value.limit = 10;
|
||||||
|
listQuery.value.list_rows = 10
|
||||||
|
couponFullList.value = []
|
||||||
|
couponTimesCount.value = []
|
||||||
|
if (currentTab.value == 0) {
|
||||||
|
getCouponFullList();
|
||||||
|
} else {
|
||||||
|
getCouponTimesList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//页面跳转
|
//页面跳转
|
||||||
@ -114,21 +127,21 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//满减券
|
/* 满减券 */
|
||||||
const couponList = ref([])
|
const couponFullList = ref([])
|
||||||
const couponCount = ref(0)
|
const couponFullCount = ref(0)
|
||||||
const homrS = ref(false)
|
const homrS = ref(false)
|
||||||
async function getCouponList() {
|
async function getCouponFullList() {
|
||||||
const res = await sheep.$api.app.scoreShop.fullList({
|
const res = await sheep.$api.coupon.userCoupon({
|
||||||
page: listQuery.value.page,
|
page: listQuery.value.page,
|
||||||
limit: listQuery.value.limit,
|
list_rows: listQuery.value.list_rows,
|
||||||
status: listQuery.value.status,
|
add_type: 'reduce',
|
||||||
order: 'normal'
|
type: 'geted'
|
||||||
});
|
});
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
couponList.value = [...couponList.value, ...res.data.list];
|
couponFullList.value = [...couponFullList.value, ...res.data.data];
|
||||||
couponCount.value = res.data.count;
|
couponFullCount.value = res.data.total;
|
||||||
score.value = res.data.score
|
console.log('满减券',couponFullList.value,couponFullList.value[0]);
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
@ -136,6 +149,36 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* 次数券 */
|
||||||
|
const couponTimesList = ref([])
|
||||||
|
const couponTimesCount = ref(0)
|
||||||
|
async function getCouponTimesList() {
|
||||||
|
const res = await sheep.$api.coupon.userTimesList({
|
||||||
|
page: listQuery.value.page,
|
||||||
|
limit: listQuery.value.limit,
|
||||||
|
status: 1,
|
||||||
|
order: 'normal'
|
||||||
|
});
|
||||||
|
if (res.code === 1) {
|
||||||
|
couponTimesList.value = [...couponTimesList.value, ...res.data.list];
|
||||||
|
couponTimesCount.value = res.data.count;
|
||||||
|
// score.value = res.data.score
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 使用券 */
|
||||||
|
function toUseFull(item) {
|
||||||
|
|
||||||
|
}
|
||||||
|
function toUseTimes(e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//加载更多
|
//加载更多
|
||||||
function onScrolltolower() {
|
function onScrolltolower() {
|
||||||
if (couponList.value.length < couponCount.value) {
|
if (couponList.value.length < couponCount.value) {
|
||||||
@ -165,7 +208,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getCouponList();
|
getCouponFullList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -236,7 +279,6 @@
|
|||||||
.exChangeBox {
|
.exChangeBox {
|
||||||
// background-color: #f7f7f7;
|
// background-color: #f7f7f7;
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
margin-top: 30rpx;
|
|
||||||
|
|
||||||
.couponsList {
|
.couponsList {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -50,24 +50,24 @@
|
|||||||
<view class="swiper_s">
|
<view class="swiper_s">
|
||||||
<swiper class="swiper_s" :circular="true" :autoplay="true" indicator-active-color="#0DAE11"
|
<swiper class="swiper_s" :circular="true" :autoplay="true" indicator-active-color="#0DAE11"
|
||||||
indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent"
|
indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent"
|
||||||
@animationfinish="swiperChange">
|
@animationfinish="swiperChange" v-for="(item, index) in bannerList" :key="index">
|
||||||
<!-- v-for="(item, index) in swiperList" :key="index" @click="openSwiper(item)"-->
|
<!-- v-for="(item, index) in swiperList" :key="index" @click="openSwiper(item)"-->
|
||||||
<swiper-item style="margin: 0 auto;" >
|
<swiper-item style="margin: 0 auto;" >
|
||||||
<view style="position: relative;width: 100%;height: 100%;">
|
<view style="position: relative;width: 100%;height: 100%;">
|
||||||
<!--<view class="fnon_tit"></view>
|
<!--<view class="fnon_tit"></view>
|
||||||
<view class="text">{{ item.title ? item.title : '' }}</view>
|
<view class="text">{{ item.title ? item.title : '' }}</view>
|
||||||
@click="click(item.url)" 跳转活动链接 -->
|
@click="click(item.url)" 跳转活动链接 -->
|
||||||
<image class="swiper-image" src="/static/swiper.png" mode="scaleToFill" />
|
<image class="swiper-image" :src="item.image" mode="scaleToFill" />
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
<swiper-item style="margin: 0 auto;">
|
<!-- <swiper-item style="margin: 0 auto;">
|
||||||
<view style="position: relative;width: 100%;height: 100%">
|
<view style="position: relative;width: 100%;height: 100%">
|
||||||
<!--<view class="fnon_tit"></view>
|
<!--<view class="fnon_tit"></view>
|
||||||
<view class="text">{{ item.title ? item.title : '' }}</view>
|
<view class="text">{{ item.title ? item.title : '' }}</view>
|
||||||
@click="click(item.url)" 跳转活动链接 -->
|
@click="click(item.url)" 跳转活动链接
|
||||||
<image class="swiper-image" src="/static/cart-empty.png" mode="scaleToFill" />
|
<image class="swiper-image" src="/static/cart-empty.png" mode="scaleToFill" />
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item> -->
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -227,6 +227,7 @@
|
|||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
getList();
|
getList();
|
||||||
|
getBanner();
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
// 小程序识别二维码
|
// 小程序识别二维码
|
||||||
if (options.scene) {
|
if (options.scene) {
|
||||||
@ -261,6 +262,16 @@
|
|||||||
|
|
||||||
onPageScroll(() => {});
|
onPageScroll(() => {});
|
||||||
|
|
||||||
|
const bannerList = ref([])
|
||||||
|
async function getBanner() {
|
||||||
|
const res = await sheep.$api.home.homeBanner({});
|
||||||
|
console.log('banner',res);
|
||||||
|
if(res.code == 1) {
|
||||||
|
bannerList.value = res.data.list
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const toPage = (e) => {
|
const toPage = (e) => {
|
||||||
if (isLogin.value == true) {
|
if (isLogin.value == true) {
|
||||||
|
@ -17,6 +17,12 @@ export default {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
params,
|
params,
|
||||||
}),
|
}),
|
||||||
|
userTimesList: (params) =>
|
||||||
|
request({
|
||||||
|
url: 'meal.score/mobile_list',
|
||||||
|
method: 'GET',
|
||||||
|
params,
|
||||||
|
}),
|
||||||
detail: (id, user_coupon_id) =>
|
detail: (id, user_coupon_id) =>
|
||||||
request({
|
request({
|
||||||
url: 'coupon/detail',
|
url: 'coupon/detail',
|
||||||
|
10
sheep/api/home.js
Normal file
10
sheep/api/home.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
homeBanner: (params) =>
|
||||||
|
request({
|
||||||
|
url: 'home/homeImages',
|
||||||
|
method: 'GET',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
};
|
@ -14,6 +14,7 @@ import trade from "./trade"
|
|||||||
import user from "./user"
|
import user from "./user"
|
||||||
import rent from "./rent"
|
import rent from "./rent"
|
||||||
import school from "./school"
|
import school from "./school"
|
||||||
|
import home from "./home"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
activity,
|
activity,
|
||||||
@ -32,5 +33,6 @@ export default {
|
|||||||
user,
|
user,
|
||||||
rent,
|
rent,
|
||||||
school,
|
school,
|
||||||
|
home,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user