|
|
@ -3,17 +3,17 @@ |
|
|
|
<view class="top-box"> |
|
|
|
<view>积分余额</view> |
|
|
|
<view class="points-num" style="margin: 24rpx 0 30rpx;"> |
|
|
|
<text style="padding-right: 6rpx;">300</text> |
|
|
|
<text style="padding-right: 6rpx;">{{totalScore}}</text> |
|
|
|
<image class="point-image" src="https://static.ticket.sz-trip.com/uploads/20250917/9969ed1c37123ae8b29533a9981d2a6f.png"></image> |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<view>已连签0天</view> |
|
|
|
<view>已连签{{cuntinue_days}}天</view> |
|
|
|
<view class="sub-text">注:连续签到可获得更多积分,断签后重新累积</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="day-sign-box"> |
|
|
|
<view class="day-sign-item" v-for="(item,i) in daySign" :key="i"> |
|
|
|
<view class="day-sign-points">+{{item.num}}</view> |
|
|
|
<view class="day-sign-points">+{{item.score}}</view> |
|
|
|
<view :class="['line','line'+i,i==lastSign?'last-line':'',i<lastSign?'active':'']"> |
|
|
|
<view class="dot"></view> |
|
|
|
<view class="last-sign" v-if="i==lastSign"></view> |
|
|
@ -34,18 +34,19 @@ |
|
|
|
<view class="product-box"> |
|
|
|
<view class="flex-between"> |
|
|
|
<view style="font-weight: bold;font-size: 35rpx;color: #000000;">每日精选</view> |
|
|
|
<view style="font-weight: 500;font-size: 27rpx;color: #999999;">1300人已兑换</view> |
|
|
|
<!-- <view style="font-weight: 500;font-size: 27rpx;color: #999999;">1300人已兑换</view> --> |
|
|
|
<view></view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="jx-box no-scrollbar"> |
|
|
|
<view class="jx-item" v-for="(item,i) in JXList" :key="i"> |
|
|
|
<view class="jx-item" v-for="(item,i) in JXList" :key="i" @click="gotoDetail(item)"> |
|
|
|
<image class="jx-head-image" :src="showImg(item.headimg)" mode="aspectFill"></image> |
|
|
|
<view class="jx-content" > |
|
|
|
<view class="title text-overflowRows">{{item.title}}</view> |
|
|
|
<view class="flex-between"> |
|
|
|
<view class="flex-between"> |
|
|
|
<text class="price" style="padding-right: 6rpx;">{{item.price}}</text> |
|
|
|
<image class="point-image" src="https://static.ticket.sz-trip.com/uploads/20250917/9969ed1c37123ae8b29533a9981d2a6f.png"></image> |
|
|
|
<text class="price" style="padding-right: 6rpx;">{{item.score_price}}</text> |
|
|
|
<!-- <image class="point-image" src="https://static.ticket.sz-trip.com/uploads/20250917/9969ed1c37123ae8b29533a9981d2a6f.png"></image> --> |
|
|
|
</view> |
|
|
|
<view class="btn">兑换</view> |
|
|
|
</view> |
|
|
@ -58,26 +59,26 @@ |
|
|
|
enable-flex scroll-x scroll-with-animation :show-scrollbar="false"> |
|
|
|
<view :id="`scroll${i}`" :class="['type-item',typeIndex==i?'active':'']" v-for="(type,i) in typeList" |
|
|
|
:key="i" @click="changeType(item,i)"> |
|
|
|
{{type.title}} |
|
|
|
{{type.name}} |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
<view class="search-box flex-between"> |
|
|
|
<view class="search-box flex-between" @click="gotoPath('/subPackages/pointsMall/search')"> |
|
|
|
<image class="point-image" src="https://static.ticket.sz-trip.com/uploads/20250917/c7aa588b22b5710fcf61f5c109153157.png"></image> |
|
|
|
<text style="height: 100%;">搜索</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="prod-box2"> |
|
|
|
<view class="jx-item" v-for="(item,i) in JXList" :key="i"> |
|
|
|
<view class="jx-item" v-for="(item,i) in prodList" :key="i" @click="gotoDetail(item)"> |
|
|
|
<image class="jx-head-image" :src="showImg(item.headimg)" mode="aspectFill"></image> |
|
|
|
<view class="jx-content" > |
|
|
|
<view class="title text-overflowRows">{{item.title}}</view> |
|
|
|
<view style="font-weight: 500;font-size: 24rpx;color: #999999;">已兑14100件</view> |
|
|
|
<view class="flex-between"> |
|
|
|
<view class="flex-between"> |
|
|
|
<text class="price" style="padding-right: 6rpx;">{{item.price}}</text> |
|
|
|
<image class="point-image" src="https://static.ticket.sz-trip.com/uploads/20250917/9969ed1c37123ae8b29533a9981d2a6f.png"></image> |
|
|
|
<text class="price" style="padding-right: 6rpx;">{{item.score_price}}</text> |
|
|
|
<!-- <image class="point-image" src="https://static.ticket.sz-trip.com/uploads/20250917/9969ed1c37123ae8b29533a9981d2a6f.png"></image> --> |
|
|
|
</view> |
|
|
|
<view class="btn">兑换</view> |
|
|
|
</view> |
|
|
@ -86,10 +87,10 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<uni-popup ref="signPop" type="center"> |
|
|
|
<uni-popup ref="signPop" type="center" mask-background-color="rgba(0,0,0,0.6)"> |
|
|
|
<view class="signPop" @click="$refs.signPop.close()"> |
|
|
|
<image class="close-pop" src="https://static.ticket.sz-trip.com/uploads/20250918/730cffbd6032bad9e6f87d4a5f20724b.png"></image> |
|
|
|
<view class="sign-content">+5</view> |
|
|
|
<view class="sign-content" v-if="todayRecord">+{{todayRecord.score}}</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
@ -100,35 +101,30 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
isSign: false, |
|
|
|
totalScore: 0, |
|
|
|
cuntinue_days: 0, |
|
|
|
// 7日连续签到日期 0-6 |
|
|
|
lastSign: 3, |
|
|
|
daySign: [ |
|
|
|
{num:1, active:true}, |
|
|
|
{num:2, active:true}, |
|
|
|
{num:3, active:true}, |
|
|
|
{num:4, active:false}, |
|
|
|
{num:5, active:false}, |
|
|
|
{num:6, active:false}, |
|
|
|
{num:7, active:false}, |
|
|
|
], |
|
|
|
lastSign: -1, |
|
|
|
daySign: [], |
|
|
|
todayRecord: null, |
|
|
|
|
|
|
|
|
|
|
|
JXList: [], |
|
|
|
|
|
|
|
typeIndex:0, |
|
|
|
scrollView: "scroll0", |
|
|
|
typeList: [ |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{title:"分类",value:"",}, |
|
|
|
{name:"分类",id:"680",}, |
|
|
|
], |
|
|
|
prodList: [], |
|
|
|
} |
|
|
|
}, |
|
|
|
onReady () { |
|
|
|
this.getScore() |
|
|
|
this.getSignList() |
|
|
|
this.getJXList() |
|
|
|
this.getTypeList() |
|
|
|
this.getProdListByType() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 签到 |
|
|
@ -137,20 +133,55 @@ |
|
|
|
this.$refs.signPop.open() |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取签到记录 |
|
|
|
getSignList () { |
|
|
|
this.Post({method:"POST"},"/api/user_sign/index").then(res=>{ |
|
|
|
let today = new Date().toISOString().split('T')[0]; |
|
|
|
// 在打卡记录中查找今天的记录 |
|
|
|
let todayRecordIndex = res.data.days.findIndex(day => day.date === today) |
|
|
|
let todayRecord = res.data.days[todayRecordIndex] |
|
|
|
this.isSign = todayRecord.is_sign; |
|
|
|
this.cuntinue_days = res.data.cuntinue_days; |
|
|
|
this.todayRecord = todayRecord; |
|
|
|
let startIndex = 0 |
|
|
|
if (this.cuntinue_days<=3) { |
|
|
|
startIndex = todayRecordIndex - this.cuntinue_days |
|
|
|
this.lastSign = this.cuntinue_days-1 |
|
|
|
} else { |
|
|
|
startIndex = 4; |
|
|
|
this.lastSign = 3 |
|
|
|
} |
|
|
|
this.daySign = res.data.days.slice(startIndex, startIndex+7) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取积分明细 取总积分 |
|
|
|
getScore() { |
|
|
|
this.Post({},"/api/uservice/user/getMyInfo").then(res=>{ |
|
|
|
this.totalScore = res.data.score |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 精选 |
|
|
|
getJXList(){ |
|
|
|
this.Post({ |
|
|
|
tag_id: 95, |
|
|
|
tag_id: 679, |
|
|
|
offset: 0, |
|
|
|
limit: 999, |
|
|
|
},'/api/product/get_product_by_tag_subject').then(res => { |
|
|
|
if (res.data.length < this.viewNum) { |
|
|
|
this.viewNum = 999 |
|
|
|
} |
|
|
|
this.JXList = res.data.list |
|
|
|
limit: 10, |
|
|
|
},'/api/score_goods_sku_price/index').then(res => { |
|
|
|
this.JXList = res.data.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取分类 |
|
|
|
getTypeList () { |
|
|
|
this.Post({pid: 680},'/api/product/tag_list').then(res => { |
|
|
|
this.typeList = [ |
|
|
|
{name:"全部",id:"",}, |
|
|
|
...res.data |
|
|
|
] |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
changeType (item,index) { |
|
|
|
if (index == this.typeIndex) { |
|
|
|
return |
|
|
@ -158,6 +189,23 @@ |
|
|
|
this.typeIndex = index; |
|
|
|
let i = (index-1)>0?(index-1):0; |
|
|
|
this.scrollView = "scroll"+i; |
|
|
|
this.getProdListByType() |
|
|
|
}, |
|
|
|
|
|
|
|
getProdListByType () { |
|
|
|
this.Post({ |
|
|
|
tag_id: this.typeList[this.typeIndex].id, |
|
|
|
offset: 0, |
|
|
|
limit: 10, |
|
|
|
},'/api/score_goods_sku_price/index').then(res => { |
|
|
|
this.prodList = res.data.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
gotoDetail (item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url:`/subPackages/pointsMall/detail?id=${item.id}&type=score` |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
@ -346,7 +394,7 @@ |
|
|
|
} |
|
|
|
.price{ |
|
|
|
font-weight: bold; |
|
|
|
font-size: 32rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
color: #FB2A54; |
|
|
|
} |
|
|
|
.btn{ |
|
|
@ -359,6 +407,7 @@ |
|
|
|
color: #FFFFFF; |
|
|
|
text-align: center; |
|
|
|
line-height: 47rpx; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -432,9 +481,6 @@ |
|
|
|
border-radius: 13rpx; |
|
|
|
} |
|
|
|
.price{ |
|
|
|
font-weight: bold; |
|
|
|
font-size: 32rpx; |
|
|
|
color: #FB2A54; |
|
|
|
} |
|
|
|
.btn{ |
|
|
|
width: 93rpx; |
|
|
|