|
@@ -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>
|
|
@@ -10,10 +10,10 @@
|
|
<view class="uni-padding-wrap">
|
|
<view class="uni-padding-wrap">
|
|
<view class="page-section swiper">
|
|
<view class="page-section swiper">
|
|
<view class="page-section-spacing">
|
|
<view class="page-section-spacing">
|
|
-
|
|
|
|
<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, item.name)">
|
|
<!-- <web-view :src="item.linkUrl" v-if="item.type=='link'"></web-view> -->
|
|
<!-- <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>
|
|
@@ -26,31 +26,30 @@
|
|
|
|
|
|
<!-- 分类部分开始 -->
|
|
<!-- 分类部分开始 -->
|
|
<view class="classificationBox">
|
|
<view class="classificationBox">
|
|
- <view v-for="(item,index) in goods" :key="index" @click="toCoreRange('category',item.categoryId)" class="ificationBox-mar">
|
|
|
|
|
|
+ <view v-for="(item,index) in goods" :key="index" @click="toCoreRange('category',item.categoryId, item.name)"
|
|
|
|
+ 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 exclusiveSingle" :key="index">
|
|
<view class=" sticky-bac">
|
|
<view class=" sticky-bac">
|
|
<text class="sticky-bac-text1" v-text="item.name"></text>
|
|
<text class="sticky-bac-text1" v-text="item.name"></text>
|
|
- <view @click="toCoreRange('tag',item.tagId)" class="sticky-bac-text2">
|
|
|
|
|
|
+ <view @click="toCoreRange('tag',item.tagId, item.name)" class="sticky-bac-text2">
|
|
<view></view>
|
|
<view></view>
|
|
<view class="flex ">
|
|
<view class="flex ">
|
|
<text>更多</text>
|
|
<text>更多</text>
|
|
<u-icon name="arrow-right" color="#9c9c9c" size="16"></u-icon>
|
|
<u-icon name="arrow-right" color="#9c9c9c" size="16"></u-icon>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view class="Seckill-bom">
|
|
<view class="Seckill-bom">
|
|
- <view class="Seckill-bom-grid" >
|
|
|
|
- <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" >
|
|
|
|
|
|
+ <view class="Seckill-bom-grid">
|
|
|
|
+ <navigator :url="`/pages/goods/detail?id=${ itemExc.goodsId }`" class="core-list-item"
|
|
|
|
+ hover-class="navigator-hover" v-for="(itemExc, indexNum) in item.data" :key="indexNum">
|
|
<view class="flex iamge-wrap">
|
|
<view class="flex iamge-wrap">
|
|
<image :src="itemExc.picUrl" mode=""></image>
|
|
<image :src="itemExc.picUrl" mode=""></image>
|
|
</view>
|
|
</view>
|
|
@@ -59,7 +58,7 @@
|
|
<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>
|
|
- </view>
|
|
|
|
|
|
+ </navigator>
|
|
<view></view>
|
|
<view></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -90,11 +89,12 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="screen-coin-list" v-if="ascShow">
|
|
<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)">
|
|
|
|
|
|
+ <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>
|
|
<text :class="{ 'action': ascListIndex == index }">{{ item.text }}</text>
|
|
</view>
|
|
</view>
|
|
</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)">
|
|
@@ -151,9 +151,9 @@
|
|
duration: 2000,
|
|
duration: 2000,
|
|
imgTop: [],
|
|
imgTop: [],
|
|
goods: [],
|
|
goods: [],
|
|
- exclusive:[],
|
|
|
|
- exclusiveSingle:[],
|
|
|
|
-
|
|
|
|
|
|
+ exclusive: [],
|
|
|
|
+ exclusiveSingle: [],
|
|
|
|
+
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
total: 0,
|
|
total: 0,
|
|
list: [],
|
|
list: [],
|
|
@@ -220,25 +220,24 @@
|
|
startPrice: null,
|
|
startPrice: null,
|
|
endPrice: null
|
|
endPrice: null
|
|
},
|
|
},
|
|
- orderByColumn:'',//默认exchangePrice
|
|
|
|
- isAsc:'',//从低到高asc isAsc:'desc'从高到低
|
|
|
|
- ascShow:false,
|
|
|
|
- ascList:[
|
|
|
|
- {
|
|
|
|
- data:'',
|
|
|
|
- text:'默认排序'
|
|
|
|
|
|
+ orderByColumn: '', //默认exchangePrice
|
|
|
|
+ isAsc: '', //从低到高asc isAsc:'desc'从高到低
|
|
|
|
+ ascShow: false,
|
|
|
|
+ ascList: [{
|
|
|
|
+ data: '',
|
|
|
|
+ text: '默认排序'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- data:'asc',
|
|
|
|
- text:'价格从低到高'
|
|
|
|
|
|
+ data: 'asc',
|
|
|
|
+ text: '价格从低到高'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- data:'desc',
|
|
|
|
- text:'价格从高到低'
|
|
|
|
|
|
+ data: 'desc',
|
|
|
|
+ text: '价格从高到低'
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- ascListsingle:{},
|
|
|
|
- ascListIndex:0,
|
|
|
|
|
|
+ ascListsingle: {},
|
|
|
|
+ ascListIndex: 0,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
@@ -256,28 +255,30 @@
|
|
changeIndicatorDots(e) {
|
|
changeIndicatorDots(e) {
|
|
this.indicatorDots = true
|
|
this.indicatorDots = true
|
|
},
|
|
},
|
|
|
|
+
|
|
changeAutoplay(e) {
|
|
changeAutoplay(e) {
|
|
this.autoplay = true
|
|
this.autoplay = true
|
|
},
|
|
},
|
|
|
|
+
|
|
intervalChange(e) {
|
|
intervalChange(e) {
|
|
this.interval = e.target.value
|
|
this.interval = e.target.value
|
|
},
|
|
},
|
|
|
|
+
|
|
durationChange(e) {
|
|
durationChange(e) {
|
|
this.duration = e.target.value
|
|
this.duration = e.target.value
|
|
},
|
|
},
|
|
|
|
+
|
|
// 跳转点击事件
|
|
// 跳转点击事件
|
|
- toCoreRange(type,data) {
|
|
|
|
- if(type == "link"){
|
|
|
|
|
|
+ toCoreRange(type, data, name) {
|
|
|
|
+ if (type == "link") {
|
|
// web-view
|
|
// web-view
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: `/pages/coreRange/coreRange?type=${type}&data=${data}`,
|
|
|
|
- })
|
|
|
|
|
|
+ url: `/pages/coreRange/coreRange?type=${ type }&data=${ data }&name=${ name }`,
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- // 跳转指令
|
|
|
|
-
|
|
|
|
- console.log(`标签是${type},数据是${data}`)
|
|
|
|
},
|
|
},
|
|
|
|
+
|
|
//轮播图
|
|
//轮播图
|
|
getSwiper() {
|
|
getSwiper() {
|
|
$http.post(`/api/v1/mp/user/exchange/banner/list`, {
|
|
$http.post(`/api/v1/mp/user/exchange/banner/list`, {
|
|
@@ -291,9 +292,12 @@
|
|
this.imgTop = this.imgTop.concat(res.data)
|
|
this.imgTop = this.imgTop.concat(res.data)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
// 分类列表
|
|
// 分类列表
|
|
- getListIficationBox(){
|
|
|
|
- $http.post(`/api/v1/mp/user/exchange/category/list`, {noToken: true}).then(res => {
|
|
|
|
|
|
+ getListIficationBox() {
|
|
|
|
+ $http.post(`/api/v1/mp/user/exchange/category/list`, {
|
|
|
|
+ noToken: true
|
|
|
|
+ }).then(res => {
|
|
res.data.forEach(item => {
|
|
res.data.forEach(item => {
|
|
let picUrlArr = item.picUrl.split(',')
|
|
let picUrlArr = item.picUrl.split(',')
|
|
item.picUrl = env.filePublic + picUrlArr[0]
|
|
item.picUrl = env.filePublic + picUrlArr[0]
|
|
@@ -301,27 +305,31 @@
|
|
this.goods = this.goods.concat(res.data)
|
|
this.goods = this.goods.concat(res.data)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
// 秒杀
|
|
// 秒杀
|
|
- getExclusive(){
|
|
|
|
- $http.post(`/api/v1/mp/user/exchange/activity/list`, {noToken: true}).then(res => {
|
|
|
|
- this.exclusive = res.data
|
|
|
|
- console.log(res)
|
|
|
|
- let arr = []
|
|
|
|
- res.data.forEach(item=>{
|
|
|
|
- $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=1&pageSize=4`, {
|
|
|
|
- noToken: true,
|
|
|
|
- tagIds: item.tagId, // 分类ID,可空
|
|
|
|
- }).then(r => {
|
|
|
|
- r.rows.forEach(ite => {
|
|
|
|
- let picUrlArr = ite.picUrl.split(',')
|
|
|
|
- ite.picUrl = env.filePublic + picUrlArr[0]
|
|
|
|
- })
|
|
|
|
- arr.push(r.rows)
|
|
|
|
- })
|
|
|
|
|
|
+ async getExclusive() {
|
|
|
|
+ let resData = await $http.post(`/api/v1/mp/user/exchange/activity/list`, {
|
|
|
|
+ noToken: true
|
|
|
|
+ })
|
|
|
|
+ let goodsList = []
|
|
|
|
+ for (let item of resData.data) {
|
|
|
|
+
|
|
|
|
+ let resDatas = await $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=1&pageSize=4`, {
|
|
|
|
+ noToken: true,
|
|
|
|
+ tagIds: item.tagId
|
|
|
|
+ })
|
|
|
|
+ goodsList.push({
|
|
|
|
+ data: resDatas.rows,
|
|
|
|
+ name: item.name,
|
|
|
|
+ tagId: item.tagId
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ goodsList.forEach(item => {
|
|
|
|
+ item.data.forEach(items => {
|
|
|
|
+ items.picUrl = env.filePublic + items.picUrl.split(',')[0]
|
|
})
|
|
})
|
|
- this.exclusiveSingle = arr
|
|
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ this.exclusiveSingle = goodsList
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -336,7 +344,9 @@
|
|
...this.coinNum,
|
|
...this.coinNum,
|
|
noToken: true
|
|
noToken: true
|
|
}
|
|
}
|
|
- $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=${this.pageNum}&pageSize=20&orderByColumn=${this.orderByColumn}&isAsc=${this.isAsc}`, 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) {
|
|
@@ -365,32 +375,21 @@
|
|
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,
|
|
|
|
- // })
|
|
|
|
- // console.log(res.top)
|
|
|
|
- // console.log(data.top)
|
|
|
|
- // }).exec()
|
|
|
|
- // }).exec()
|
|
|
|
- // },
|
|
|
|
- openSelect(){
|
|
|
|
- if(this.coinShow == false){
|
|
|
|
|
|
+ openSelect() {
|
|
|
|
+ if (this.coinShow == false) {
|
|
this.coinShow = true
|
|
this.coinShow = true
|
|
this.ascShow = false
|
|
this.ascShow = false
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.coinShow = false
|
|
this.coinShow = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
//排序切换
|
|
//排序切换
|
|
- ascSelect(){
|
|
|
|
- if(this.ascShow == false){
|
|
|
|
|
|
+ ascSelect() {
|
|
|
|
+ if (this.ascShow == false) {
|
|
this.ascShow = true
|
|
this.ascShow = true
|
|
this.coinShow = false
|
|
this.coinShow = false
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.ascShow = false
|
|
this.ascShow = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -403,19 +402,19 @@
|
|
this.coinNum.endPrice = item.max
|
|
this.coinNum.endPrice = item.max
|
|
this.pageList()
|
|
this.pageList()
|
|
},
|
|
},
|
|
- selectCoinTwo(item, index){
|
|
|
|
|
|
+ selectCoinTwo(item, index) {
|
|
this.ascListIndex = index
|
|
this.ascListIndex = index
|
|
this.ascListsingle = this.ascList[this.ascListIndex]
|
|
this.ascListsingle = this.ascList[this.ascListIndex]
|
|
this.ascShow = false
|
|
this.ascShow = false
|
|
-
|
|
|
|
- if(item.data == ''){
|
|
|
|
|
|
+
|
|
|
|
+ if (item.data == '') {
|
|
this.orderByColumn = ''
|
|
this.orderByColumn = ''
|
|
this.isAsc = ''
|
|
this.isAsc = ''
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.isAsc = item.data
|
|
this.isAsc = item.data
|
|
this.orderByColumn = 'exchangePrice'
|
|
this.orderByColumn = 'exchangePrice'
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
this.pageListTwo()
|
|
this.pageListTwo()
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -444,7 +443,8 @@
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .uni-padding-wrap img{
|
|
|
|
|
|
+
|
|
|
|
+ .uni-padding-wrap img {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
@@ -480,7 +480,9 @@
|
|
line-height: 25px;
|
|
line-height: 25px;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
padding: 8px;
|
|
padding: 8px;
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ;
|
|
|
|
|
|
.sticky-bac-text2 {
|
|
.sticky-bac-text2 {
|
|
width: 128px;
|
|
width: 128px;
|
|
@@ -498,9 +500,9 @@
|
|
padding: 0 0.3rem;
|
|
padding: 0 0.3rem;
|
|
// margin-bottom: 10px;
|
|
// margin-bottom: 10px;
|
|
background-color: #FFFFFF;
|
|
background-color: #FFFFFF;
|
|
-
|
|
|
|
|
|
+
|
|
.Seckill-bom-grid {
|
|
.Seckill-bom-grid {
|
|
- min-height:550rpx ;
|
|
|
|
|
|
+ min-height: 550rpx;
|
|
display: flex;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
@@ -508,7 +510,8 @@
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .screen-coin-shopin{
|
|
|
|
|
|
+
|
|
|
|
+ .screen-coin-shopin {
|
|
color: #2f2f2f;
|
|
color: #2f2f2f;
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
line-height: 25px;
|
|
line-height: 25px;
|