Browse Source

积分

dev_delivery
jiazhipeng 1 month ago
parent
commit
9b8304426f
  1. 24
      pages.json
  2. 1100
      subPackages/pointsMall/detail.vue
  3. 134
      subPackages/pointsMall/index.vue
  4. 1510
      subPackages/pointsMall/order.vue
  5. 23
      subPackages/pointsMall/search.vue
  6. 37
      subPackages/pointsMall/searchResult.vue

24
pages.json

@ -379,6 +379,30 @@
"style": {
"navigationBarTitleText" : "积分商城"
}
},
{
"path" : "pointsMall/search",
"style" : {
"navigationBarTitleText" : "搜索"
}
},
{
"path" : "pointsMall/searchResult",
"style" : {
"navigationBarTitleText" : "搜索"
}
},
{
"path" : "pointsMall/detail",
"style" : {
"navigationBarTitleText" : "详情"
}
},
{
"path" : "pointsMall/order",
"style" : {
"navigationBarTitleText" : "下单"
}
}
]

1100
subPackages/pointsMall/detail.vue

File diff suppressed because it is too large

134
subPackages/pointsMall/index.vue

@ -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;

1510
subPackages/pointsMall/order.vue

File diff suppressed because it is too large

23
subPackages/pointsMall/search.vue

@ -13,12 +13,6 @@
<div v-for="his,hisIndex in history.slice(0,10)" @click="gotoHot(his)" :key="hisIndex"
class="search-item textOver">{{his}}</div>
</div>
<div class="search-title">大家在搜</div>
<div class="search-list">
<div @click="gotoHot(hot.name)" class="search-item textOver" v-for="hot,hotIndex in hot" :key="hotIndex">
{{hot.name}}
</div>
</div>
</div>
</template>
@ -31,7 +25,7 @@
keywords: '',
history: [],
hot: [],
keywords_name: 'tz_trip_keyowrds',
keywords_name: 'tz_trip_jf_keyowrds',
options: {},
type: '', // techantechanResult
}
@ -43,16 +37,9 @@
},
onShow() {
this.history = uni.getStorageSync(this.keywords_name) ? JSON.parse(uni.getStorageSync(this.keywords_name)) :[];
this.getHot()
},
methods: {
getHot() {
this.Post({
limit: 10,
}, '/api/search/hot').then(res => {
this.hot = res.data;
})
},
delHis() {
this.history = [];
uni.removeStorageSync(this.keywords_name)
@ -61,8 +48,7 @@
})
},
search(e) {
let url = '/subPackages/search/result'
if (this.type == 'techan') { url = '/subPackages/search/techanResult' }
let url = '/subPackages/pointsMall/searchResult'
if (this.keywords) {
this.pushHis(this.keywords);
uni.navigateTo({
@ -71,8 +57,7 @@
}
},
gotoHot(name) {
let url = '/subPackages/search/result'
if (this.type == 'techan') { url = '/subPackages/search/techanResult' }
let url = '/subPackages/pointsMall/searchResult'
uni.navigateTo({
url: url+`?keywords=${name}`
})

37
subPackages/pointsMall/searchResult.vue

@ -6,38 +6,38 @@
<input type="text" class="input" placeholder="请输入关键字" v-model="keywords" @confirm="search" />
<div class="btn" @click="search()">搜索</div>
</div>
<view class="common-box">
<!-- <view class="common-box">
<view class="common-types com-flex-tao">
<view @click="setType(index)" v-for="(item, index) in typeList" :key="item.id"
:class="['common-type', typeIndex == index ? 'active' : '']">
{{ item.name }}
</view>
</view>
</view>
</view> -->
</view>
<div class="search-list">
<view @click="gotoDetailByType(item.ext)" v-for="(item, key) in list" :key="item.id" class="search-item">
<view class="img" style="position: relative;">
<image class="img" :src="showImg(item.ext.headimg)" mode="aspectFill"></image>
<view class="hover-use-type" v-if="item.ext.type=='post'&&item.ext.delivery_method">
<image class="img" :src="showImg(item.headimg)" mode="aspectFill"></image>
<!-- <view class="hover-use-type" v-if="item.ext.type=='post'&&item.ext.delivery_method">
{{item.ext.delivery_method_str.join('/')}}
</view>
</view> -->
</view>
<view class="content">
<view class="title text-overflowRows">
{{item.ext.title}}
{{item.title}}
</view>
<view class="flex-between">
<view class="distance text-overflow" >
<!-- <view class="distance text-overflow" >
<image v-if="item.ext.address||item.ext.scene_address" :src="showImg('https://static.ticket.sz-trip.com/uploads/20250619/0e16bffb0cd3648faa47879d0d532842.png')" class="icon-tip"></image>
<text v-if="item.ext.address">{{item.ext.address}}</text>
<text v-else-if="item.ext.scene_address">{{item.ext.scene_address}}</text>
</view>
</view> -->
<view class="bottom">
<view class="price ticlet-price">
{{item.ext.price/100}}
{{item.score_price}}
</view>
</view>
</view>
@ -103,11 +103,11 @@
return
}
let history = JSON.parse(uni.getStorageSync('tz_trip_keyowrds')) || [];
let history = JSON.parse(uni.getStorageSync('tz_trip_jf_keyowrds')) || [];
let index = history.findIndex(item => item == keywords);
if (index >= 0) history.splice(index, 1);
history.unshift(keywords);
uni.setStorageSync('tz_trip_keyowrds',JSON.stringify(history))
uni.setStorageSync('tz_trip_jf_keyowrds',JSON.stringify(history))
},
gotoDetail(item) {
@ -120,13 +120,14 @@
limit: 10,
lon: uni.getStorageSync('location').lon || '120',
lat: uni.getStorageSync('location').lat || '36',
}, '/api/search/search').then(res => {
let resData = res.data.list
resData.forEach(v=>{
if (v.ext.delivery_method) {
v.ext.delivery_method_str = this.getDeliveryMethodStr(v.ext.delivery_method)
}
})
}, '/api/score_goods_sku_price/index').then(res => {
console.log(res)
let resData = res.data.data || []
// resData.forEach(v=>{
// if (v.ext.delivery_method) {
// v.ext.delivery_method_str = this.getDeliveryMethodStr(v.ext.delivery_method)
// }
// })
this.list = [...this.list, ...resData];
this.showMore = true
if (res.data.length<10) {

Loading…
Cancel
Save