|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<view class="core-cla">
|
|
<view class="core-cla">
|
|
- <u-navbar leftIconSize="0" :placeholder="true" bgColor="#ffffff">
|
|
|
|
- <view class="u-nav-slot" slot="left">
|
|
|
|
|
|
+ <u-navbar leftIconSize="0" :placeholder="true" bgColor="#ffffff" >
|
|
|
|
+ <view class="u-nav-slot" slot="left" >
|
|
<text>兑换大厅</text>
|
|
<text>兑换大厅</text>
|
|
</view>
|
|
</view>
|
|
</u-navbar>
|
|
</u-navbar>
|
|
@@ -14,6 +14,7 @@
|
|
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
|
|
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
|
|
:duration="duration">
|
|
:duration="duration">
|
|
<swiper-item v-for="(item,index) in imgTop" :key="index" @click="toCoreRange(item.type,item.type=='link'?item.linkUrl:item.goodsTags)">
|
|
<swiper-item v-for="(item,index) in imgTop" :key="index" @click="toCoreRange(item.type,item.type=='link'?item.linkUrl:item.goodsTags)">
|
|
|
|
+ <!-- <web-view :src="item.linkUrl" v-if="item.type=='link'"></web-view> -->
|
|
<img :src="item.picUrl" alt="">
|
|
<img :src="item.picUrl" alt="">
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
@@ -25,13 +26,15 @@
|
|
|
|
|
|
<!-- 分类部分开始 -->
|
|
<!-- 分类部分开始 -->
|
|
<view class="classificationBox">
|
|
<view class="classificationBox">
|
|
- <view v-for="(item,index) in goods" :key="index" @click="toCoreRange('tag',item.categoryId)" class="ificationBox-mar">
|
|
|
|
|
|
+ <view v-for="(item,index) in goods" :key="index" @click="toCoreRange('category',item.categoryId)" class="ificationBox-mar">
|
|
<img :src="item.picUrl" alt="">
|
|
<img :src="item.picUrl" alt="">
|
|
<view v-text="item.name" style=" "></view>
|
|
<view v-text="item.name" style=" "></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 分类部分结束 -->
|
|
<!-- 分类部分结束 -->
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<!-- 限时秒杀部分开始 -->
|
|
<!-- 限时秒杀部分开始 -->
|
|
<view v-for="(item,index) in exclusive" :key="index">
|
|
<view v-for="(item,index) in exclusive" :key="index">
|
|
<view class=" sticky-bac">
|
|
<view class=" sticky-bac">
|
|
@@ -46,7 +49,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="Seckill-bom">
|
|
<view class="Seckill-bom">
|
|
<view class="Seckill-bom-grid" >
|
|
<view class="Seckill-bom-grid" >
|
|
- <navigator :url="`/pages/goods/detail?id=${ itemExc.goodsId }`" class="core-list-item"
|
|
|
|
|
|
+ <view :url="`/pages/goods/detail?id=${ itemExc.goodsId }`" class="core-list-item"
|
|
hover-class="navigator-hover" v-for="(itemExc, indexNum) in exclusiveSingle[index]" :key="indexNum" >
|
|
hover-class="navigator-hover" v-for="(itemExc, indexNum) in exclusiveSingle[index]" :key="indexNum" >
|
|
<view class="flex iamge-wrap">
|
|
<view class="flex iamge-wrap">
|
|
<image :src="itemExc.picUrl" mode=""></image>
|
|
<image :src="itemExc.picUrl" mode=""></image>
|
|
@@ -56,7 +59,8 @@
|
|
<image src="../../static/icon/bean.png" mode="aspectFill"></image>
|
|
<image src="../../static/icon/bean.png" mode="aspectFill"></image>
|
|
<view>× {{ itemExc.exchangePrice }}</view>
|
|
<view>× {{ itemExc.exchangePrice }}</view>
|
|
</view>
|
|
</view>
|
|
- </navigator>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <view></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -66,15 +70,31 @@
|
|
<!-- 精选商品部份开始 -->
|
|
<!-- 精选商品部份开始 -->
|
|
<u-sticky offset-top="60" class="">
|
|
<u-sticky offset-top="60" class="">
|
|
<view class="screen-coin uSticky-toTop">
|
|
<view class="screen-coin uSticky-toTop">
|
|
- <view class="flex screen-coin-select" @click="openSelect">
|
|
|
|
- <view class="title">
|
|
|
|
- <text v-if="actionInfo.min">{{ actionInfo.min }}</text>
|
|
|
|
- <text v-if="actionInfo.max">-{{ actionInfo.max }}</text>
|
|
|
|
- <text>{{ actionInfo.desc }}</text>
|
|
|
|
|
|
+ <view class="screen-coin-shopin">精选商品</view>
|
|
|
|
+ <view class="flex screen-coin-select">
|
|
|
|
+ <view @click="ascSelect" class="flex">
|
|
|
|
+ <view class="title">
|
|
|
|
+ <text>{{ ascListsingle.text}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <u-icon name="arrow-up" color="#333" size="18" v-if="ascShow"></u-icon>
|
|
|
|
+ <u-icon name="arrow-down" color="#333" size="18" v-else></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ <view @click="openSelect" class="flex">
|
|
|
|
+ <view class="title">
|
|
|
|
+ <text v-if="actionInfo.min">{{ actionInfo.min }}</text>
|
|
|
|
+ <text v-if="actionInfo.max">-{{ actionInfo.max }}</text>
|
|
|
|
+ <text>{{ actionInfo.desc }}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <u-icon name="arrow-up" color="#333" size="18" v-if="coinShow"></u-icon>
|
|
|
|
+ <u-icon name="arrow-down" color="#333" size="18" v-else></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="screen-coin-list" v-if="ascShow">
|
|
|
|
+ <view class="flex screen-coin-list-item" v-for="(item, index) in ascList" :key="index" @click="selectCoinTwo(item, index)">
|
|
|
|
+ <text :class="{ 'action': ascListIndex == index }">{{ item.text }}</text>
|
|
</view>
|
|
</view>
|
|
- <u-icon name="arrow-up" color="#333" size="18" v-if="coinShow"></u-icon>
|
|
|
|
- <u-icon name="arrow-down" color="#333" size="18" v-else></u-icon>
|
|
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<view class="screen-coin-list" v-if="coinShow">
|
|
<view class="screen-coin-list" v-if="coinShow">
|
|
<view class="flex screen-coin-list-item" v-for="(item, index) in coinList" :key="index"
|
|
<view class="flex screen-coin-list-item" v-for="(item, index) in coinList" :key="index"
|
|
@click="selectCoin(item, index)">
|
|
@click="selectCoin(item, index)">
|
|
@@ -108,7 +128,7 @@
|
|
<custom-tab-bar :activeValue="'core'" />
|
|
<custom-tab-bar :activeValue="'core'" />
|
|
|
|
|
|
<u-overlay :show="coinShow" @click="coinShow = false" zIndex="1"></u-overlay>
|
|
<u-overlay :show="coinShow" @click="coinShow = false" zIndex="1"></u-overlay>
|
|
-
|
|
|
|
|
|
+ <u-overlay :show="ascShow" @click="ascShow = false" zIndex="1"></u-overlay>
|
|
<!-- 精选商品结束 -->
|
|
<!-- 精选商品结束 -->
|
|
<custom-tab-bar :activeValue="'core'" />
|
|
<custom-tab-bar :activeValue="'core'" />
|
|
</view>
|
|
</view>
|
|
@@ -199,7 +219,26 @@
|
|
coinNum: {
|
|
coinNum: {
|
|
startPrice: null,
|
|
startPrice: null,
|
|
endPrice: null
|
|
endPrice: null
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ orderByColumn:'',//默认exchangePrice
|
|
|
|
+ isAsc:'',//从低到高asc isAsc:'desc'从高到低
|
|
|
|
+ ascShow:false,
|
|
|
|
+ ascList:[
|
|
|
|
+ {
|
|
|
|
+ data:'',
|
|
|
|
+ text:'默认排序'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ data:'asc',
|
|
|
|
+ text:'价格从低到高'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ data:'desc',
|
|
|
|
+ text:'价格从高到低'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ ascListsingle:{},
|
|
|
|
+ ascListIndex:0,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
@@ -208,6 +247,7 @@
|
|
onLoad() {
|
|
onLoad() {
|
|
this.pageList()
|
|
this.pageList()
|
|
this.actionInfo = this.coinList[this.actionIndex]
|
|
this.actionInfo = this.coinList[this.actionIndex]
|
|
|
|
+ this.ascListsingle = this.ascList[this.ascListIndex]
|
|
this.getSwiper()
|
|
this.getSwiper()
|
|
this.getListIficationBox()
|
|
this.getListIficationBox()
|
|
this.getExclusive()
|
|
this.getExclusive()
|
|
@@ -227,10 +267,15 @@
|
|
},
|
|
},
|
|
// 跳转点击事件
|
|
// 跳转点击事件
|
|
toCoreRange(type,data) {
|
|
toCoreRange(type,data) {
|
|
- // 跳转指令
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
|
+ if(type == "link"){
|
|
|
|
+ // web-view
|
|
|
|
+ }else{
|
|
|
|
+ uni.navigateTo({
|
|
url: `/pages/coreRange/coreRange?type=${type}&data=${data}`,
|
|
url: `/pages/coreRange/coreRange?type=${type}&data=${data}`,
|
|
})
|
|
})
|
|
|
|
+ }
|
|
|
|
+ // 跳转指令
|
|
|
|
+
|
|
console.log(`标签是${type},数据是${data}`)
|
|
console.log(`标签是${type},数据是${data}`)
|
|
},
|
|
},
|
|
//轮播图
|
|
//轮播图
|
|
@@ -260,9 +305,10 @@
|
|
getExclusive(){
|
|
getExclusive(){
|
|
$http.post(`/api/v1/mp/user/exchange/activity/list`, {noToken: true}).then(res => {
|
|
$http.post(`/api/v1/mp/user/exchange/activity/list`, {noToken: true}).then(res => {
|
|
this.exclusive = res.data
|
|
this.exclusive = res.data
|
|
|
|
+ console.log(res)
|
|
let arr = []
|
|
let arr = []
|
|
res.data.forEach(item=>{
|
|
res.data.forEach(item=>{
|
|
- $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=1&pageSize=4&orderByColumn=exchangePrice&isAsc=asc`, {
|
|
|
|
|
|
+ $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=1&pageSize=4`, {
|
|
noToken: true,
|
|
noToken: true,
|
|
tagIds: item.tagId, // 分类ID,可空
|
|
tagIds: item.tagId, // 分类ID,可空
|
|
}).then(r => {
|
|
}).then(r => {
|
|
@@ -285,11 +331,12 @@
|
|
title: '加载中'
|
|
title: '加载中'
|
|
});
|
|
});
|
|
let data = {
|
|
let data = {
|
|
- categoryId: '',
|
|
|
|
|
|
+ categoryId: this.categoryId,
|
|
|
|
+ tagIds: this.tagIds,
|
|
...this.coinNum,
|
|
...this.coinNum,
|
|
noToken: true
|
|
noToken: true
|
|
}
|
|
}
|
|
- $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=${this.pageNum}&pageSize=20`, data).then(
|
|
|
|
|
|
+ $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=${this.pageNum}&pageSize=20&orderByColumn=${this.orderByColumn}&isAsc=${this.isAsc}`, data).then(
|
|
res => {
|
|
res => {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
@@ -311,17 +358,41 @@
|
|
this.list = []
|
|
this.list = []
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
- openSelect() {
|
|
|
|
- uni.createSelectorQuery().select(".uSticky-toTop").boundingClientRect((data) => {
|
|
|
|
- uni.createSelectorQuery().select(".core-cla").boundingClientRect((res) => {
|
|
|
|
- uni.pageScrollTo({
|
|
|
|
- duration: 100, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
|
|
|
|
- scrollTop: data.top - res.top,
|
|
|
|
- })
|
|
|
|
- }).exec()
|
|
|
|
- }).exec()
|
|
|
|
-
|
|
|
|
- this.coinShow = !this.coinShow
|
|
|
|
|
|
+ pageListTwo() {
|
|
|
|
+ this.pageNum = 1
|
|
|
|
+ this.total = 0
|
|
|
|
+ this.list = []
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // openSelect() {
|
|
|
|
+ // uni.createSelectorQuery().select(".uSticky-toTop").boundingClientRect((data) => {
|
|
|
|
+ // uni.createSelectorQuery().select(".core-cla").boundingClientRect((res) => {
|
|
|
|
+ // uni.pageScrollTo({
|
|
|
|
+ // duration: 100, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
|
|
|
|
+ // scrollTop: data.top - res.top,
|
|
|
|
+ // })
|
|
|
|
+ // console.log(res.top)
|
|
|
|
+ // console.log(data.top)
|
|
|
|
+ // }).exec()
|
|
|
|
+ // }).exec()
|
|
|
|
+ // },
|
|
|
|
+ openSelect(){
|
|
|
|
+ if(this.coinShow == false){
|
|
|
|
+ this.coinShow = true
|
|
|
|
+ this.ascShow = false
|
|
|
|
+ }else{
|
|
|
|
+ this.coinShow = false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //排序切换
|
|
|
|
+ ascSelect(){
|
|
|
|
+ if(this.ascShow == false){
|
|
|
|
+ this.ascShow = true
|
|
|
|
+ this.coinShow = false
|
|
|
|
+ }else{
|
|
|
|
+ this.ascShow = false
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
selectCoin(item, index) {
|
|
selectCoin(item, index) {
|
|
@@ -332,6 +403,21 @@
|
|
this.coinNum.endPrice = item.max
|
|
this.coinNum.endPrice = item.max
|
|
this.pageList()
|
|
this.pageList()
|
|
},
|
|
},
|
|
|
|
+ selectCoinTwo(item, index){
|
|
|
|
+ this.ascListIndex = index
|
|
|
|
+ this.ascListsingle = this.ascList[this.ascListIndex]
|
|
|
|
+ this.ascShow = false
|
|
|
|
+
|
|
|
|
+ if(item.data == ''){
|
|
|
|
+ this.orderByColumn = ''
|
|
|
|
+ this.isAsc = ''
|
|
|
|
+ }else{
|
|
|
|
+ this.isAsc = item.data
|
|
|
|
+ this.orderByColumn = 'exchangePrice'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.pageListTwo()
|
|
|
|
+ },
|
|
},
|
|
},
|
|
//精选商品
|
|
//精选商品
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
@@ -422,7 +508,13 @@
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ .screen-coin-shopin{
|
|
|
|
+ color: #2f2f2f;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ line-height: 25px;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ padding: 8px;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
//================
|
|
//================
|