|
|
@ -1,6 +1,9 @@ |
|
|
|
<template> |
|
|
|
<view class="bg bg-padding"> |
|
|
|
<image class="top-image" src="https://static.ticket.sz-trip.com/uploads/20251011/50e0ae7f09f23c278cab8472b6e99c07.png"></image> |
|
|
|
<view class="top-image"> |
|
|
|
<view>Hi,欢迎来时味苏州</view> |
|
|
|
<view style="font-weight: 400;font-size: 27rpx;color: rgba(255,255,255,0.64);margin-top: 10rpx;">不时不食 鲜逢其时</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="main-content"> |
|
|
|
<view class="topBox" > |
|
|
@ -17,12 +20,12 @@ |
|
|
|
|
|
|
|
<view class="flex-column-center"> |
|
|
|
<view class="title">优惠券</view> |
|
|
|
<view class="num">7</view> |
|
|
|
<view class="num">{{couponNum}}</view> |
|
|
|
</view> |
|
|
|
<view style="height: 35rpx;width: 2rpx;background:#E3E3E3;"></view> |
|
|
|
<view class="flex-column-center"> |
|
|
|
<view class="title">积分</view> |
|
|
|
<view class="num">0</view> |
|
|
|
<view class="num">{{userInfo.score||0}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
@ -40,6 +43,8 @@ |
|
|
|
<view class="orderItem" v-for="(item,index) in orderList" :key="index" @click="goTrades(item)"> |
|
|
|
<img :src="item.src" alt=""> |
|
|
|
<view>{{item.title}}</view> |
|
|
|
|
|
|
|
<view class="count" v-if="item.needCount">{{item.count}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 待付款轮播 --> |
|
|
@ -59,10 +64,8 @@ |
|
|
|
</swiper> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="cygj"> |
|
|
|
<view class="moreBox">我的服务</view> |
|
|
|
|
|
|
|
<view style="display:flex;align-items:center;flex-wrap:wrap"> |
|
|
|
<view :class="['cyItem',item.customClass]" v-for="(item,index) in cyList.filter(x=>x.isShow)" :key="index" |
|
|
|
@click="gotoUrl(item,index)"> |
|
|
@ -72,15 +75,33 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="recommend-box" > |
|
|
|
<view class="type-container flex-center"> |
|
|
|
<view :class="['type-item',typeIndex==0?'active':'']" @click="changeTypeIndex(0)">为您推荐</view> |
|
|
|
<!-- <view :class="['type-item',typeIndex==1?'active':'']" @click="changeTypeIndex(1)">我的常买</view> --> |
|
|
|
</view> |
|
|
|
<view class="new-hot-box hot-box" v-if="hotList.length>0"> |
|
|
|
<image class="hot-adv" v-if="hotAdv" :src="hotAdv.head_img" mode="aspectFill" @click.stop="gotoBannerDetail(hotAdv)"></image> |
|
|
|
<view v-for="(item,index) in hotList" :key="index" class="hot-item" @click="gotoDetailByType(item)"> |
|
|
|
<image :src="item.headimg" mode="aspectFill"></image> |
|
|
|
<view class="hot-content"> |
|
|
|
<view class="title text-overflowRows">{{item.title}}</view> |
|
|
|
<view class="flex-between"> |
|
|
|
<view class="price">{{item.price / 100}}</view> |
|
|
|
<view class="btn-buy"> |
|
|
|
<image src="https://static.ticket.sz-trip.com/uploads/20251011/c8e4e3c91033663610e0c1e0e4823daa.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 图片 --> |
|
|
|
<uni-popup ref="popup" type="center"> |
|
|
|
<image class="consult-popup" :src="showImg" :show-menu-by-longpress="true"></image> |
|
|
|
<image class="consult-popup" :src="popshowImg" :show-menu-by-longpress="true"></image> |
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
<uni-popup ref="kfpopup" type="bottom" :safe-area="false"> |
|
|
@ -135,6 +156,7 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
couponNum: 0, |
|
|
|
dfkList: [], |
|
|
|
differTimeList: [], |
|
|
|
nowDateTime: '', //当前时间秒数 |
|
|
@ -147,7 +169,9 @@ |
|
|
|
{ |
|
|
|
src: 'https://static.ticket.sz-trip.com/uploads/20251011/806d65eb846e60a98352ba09d8660ce7.png', |
|
|
|
title: '待发货', |
|
|
|
status: 'WAIT_POST' |
|
|
|
status: 'WAIT_POST', |
|
|
|
count: 0, |
|
|
|
needCount: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
src: 'https://static.ticket.sz-trip.com/uploads/20251011/f3ea0d6a80ae0e10be1b974ad10955fb.png', |
|
|
@ -214,12 +238,10 @@ |
|
|
|
{ |
|
|
|
src: 'https://static.ticket.sz-trip.com/uploads/20251011/a1c19ffa332ff9a5de9fcc983874baea.png', |
|
|
|
title: '进群抽奖', |
|
|
|
path: '', |
|
|
|
path: '/subPackages/activity/prizeInQun', |
|
|
|
isShow: true, |
|
|
|
customClass: "prize", |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
src: 'https://static.ticket.sz-trip.com/uploads/20251011/c6c29ace07206eec5418fb51068fa4ca.png', |
|
|
|
title: '用户协议', |
|
|
@ -233,20 +255,32 @@ |
|
|
|
isShow: true |
|
|
|
} |
|
|
|
], |
|
|
|
showImg: "", |
|
|
|
popshowImg: "", |
|
|
|
|
|
|
|
hotList: [], |
|
|
|
hotAdv: null, |
|
|
|
finished: false, |
|
|
|
typeIndex: 0, |
|
|
|
} |
|
|
|
}, |
|
|
|
onReady () { |
|
|
|
this.getHotList() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
// 根据token获取个人信息 |
|
|
|
// this.Post({ |
|
|
|
// token: '' |
|
|
|
// },'/api/uservice/user/getMyInfo').then(res => { |
|
|
|
// this.$store.commit('changeUserInfo', res.data); |
|
|
|
// }) |
|
|
|
|
|
|
|
this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {} |
|
|
|
console.log(this.userInfo) |
|
|
|
uni.setStorageSync('isFlag', true) |
|
|
|
this.Post({noShowLoading: true}, "/api/uservice/user/getMyInfo").then(res => { |
|
|
|
if (res.data) { |
|
|
|
let info = res.data; |
|
|
|
info.token = JSON.parse(uni.getStorageSync('userInfo')).token || this.$store.state.user.userInfo.token |
|
|
|
this.$store.commit('changeUserInfo', info) |
|
|
|
this.userInfo = info |
|
|
|
uni.setStorageSync('isFlag', true) |
|
|
|
|
|
|
|
this.getCouponNum() |
|
|
|
this.getDFH() |
|
|
|
} |
|
|
|
console.log(this.userInfo) |
|
|
|
}) |
|
|
|
// this.dfkList = [] |
|
|
|
// this.nowDateTime = parseInt(new Date().getTime() / 1000) |
|
|
|
// this.Post({}, "/api/user/userInfo").then((res) => { |
|
|
@ -330,6 +364,21 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 代发货数量 |
|
|
|
getDFH() { |
|
|
|
let params = { |
|
|
|
offset: 0, |
|
|
|
limit: 1, |
|
|
|
state: 'WAIT_POST', |
|
|
|
noShowLoading: true, |
|
|
|
} |
|
|
|
this.Post(params, '/api/order/list').then(res => { |
|
|
|
if (res) { |
|
|
|
this.orderList[1].count = res.data.total || 0 |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
goToOrderDetail(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/subPackages/order/detail?id=' + item.order_id |
|
|
@ -383,7 +432,7 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
if (item.GZHImg) { |
|
|
|
this.showImg = item.GZHImg; |
|
|
|
this.popshowImg = item.GZHImg; |
|
|
|
this.$refs.popup.open() |
|
|
|
return |
|
|
|
} |
|
|
@ -422,7 +471,87 @@ |
|
|
|
// } |
|
|
|
// }); |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
getCouponNum () { |
|
|
|
this.Post({ |
|
|
|
status: 1, |
|
|
|
offset: 0, |
|
|
|
limit: 100, |
|
|
|
noShowLoading: true, |
|
|
|
}, "/api/coupon/get_user_list").then((res) => { |
|
|
|
if (res) { |
|
|
|
this.couponNum = res.data.length |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
changeTypeIndex (typeIndex) { |
|
|
|
if (typeIndex != this.typeIndex) { |
|
|
|
this.typeIndex = typeIndex |
|
|
|
this.hotList = [] |
|
|
|
this.hotAdv = null |
|
|
|
this.finished = false |
|
|
|
// todo |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getHotList() { |
|
|
|
this.Post({ |
|
|
|
// tag_id: 648, |
|
|
|
offset: this.hotList.length, |
|
|
|
limit: 5, |
|
|
|
order: "sales_number" |
|
|
|
},'/api/product/get_product_by_type').then(res => { |
|
|
|
this.hotList = [...this.hotList, ...res.data.list] |
|
|
|
if(res.data.list.length < 5) this.finished = true |
|
|
|
}) |
|
|
|
// 广告 |
|
|
|
if (!this.hotAdv) { |
|
|
|
this.Post({ |
|
|
|
type_id: 5, |
|
|
|
position: 6, |
|
|
|
},"/api/adv/getAdv").then(res => { |
|
|
|
if (res) { |
|
|
|
if (Array.isArray(res.data) && res.data.length>0) |
|
|
|
this.hotAdv = res.data[0] |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 广告跳转 |
|
|
|
gotoBannerDetail(item) { |
|
|
|
// 1产品详情 2功能模块 3外部链接 4外部小程序 |
|
|
|
switch (item.jump_type){ |
|
|
|
case 1: |
|
|
|
this.gotoDetailByType(item.product_model) |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
this.gotoPath(item.front_model.inside) |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
this.gotoWebUrl(item.tdata.url) |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
uni.navigateToMiniProgram({ |
|
|
|
shortLink: item.tdata.url |
|
|
|
}) |
|
|
|
// #endif |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReachBottom() { |
|
|
|
setTimeout(() => { |
|
|
|
if(!this.finished) this.getHotList() |
|
|
|
},1000) |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
@ -442,7 +571,14 @@ |
|
|
|
.top-image{ |
|
|
|
width: 100%; |
|
|
|
height: 453.43rpx; |
|
|
|
display: block; |
|
|
|
background-image: url("https://static.ticket.sz-trip.com/uploads/20251011/a1f6b25761ddebba529d822db1d54497.png"); |
|
|
|
background-size: 100% 100%; |
|
|
|
padding-top: 215rpx; |
|
|
|
padding-right: 26rpx; |
|
|
|
font-weight: 500; |
|
|
|
font-size: 43rpx; |
|
|
|
color: #FFFFFF; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
.main-content{ |
|
|
|
width: 750rpx; |
|
|
@ -559,12 +695,28 @@ |
|
|
|
color: #535355; |
|
|
|
width: 20%; |
|
|
|
text-align: center; |
|
|
|
position: relative; |
|
|
|
|
|
|
|
img { |
|
|
|
width: 48rpx; |
|
|
|
height: 48rpx; |
|
|
|
margin-bottom: 12rpx; |
|
|
|
} |
|
|
|
.count{ |
|
|
|
width: 24rpx; |
|
|
|
height: 24rpx; |
|
|
|
background: #EA2A2A; |
|
|
|
border-radius: 50%; |
|
|
|
position: absolute; |
|
|
|
top: -6rpx; |
|
|
|
right: 40rpx; |
|
|
|
font-weight: bold; |
|
|
|
font-size: 21rpx; |
|
|
|
color: #FFFFFF; |
|
|
|
text-align: center; |
|
|
|
line-height: 24rpx; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
.orderItem:nth-child(n+6) { |
|
|
|
margin-top: 28rpx; |
|
|
@ -812,6 +964,120 @@ |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
|
|
|
|
.recommend-box{ |
|
|
|
width: 100%; |
|
|
|
padding: 30rpx 0 0; |
|
|
|
.rmtj-img{ |
|
|
|
width: 222rpx; |
|
|
|
height: 31.33rpx; |
|
|
|
display: block; |
|
|
|
margin: 0 auto; |
|
|
|
} |
|
|
|
.hot-box { |
|
|
|
margin-top: 20rpx; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
&.new-hot-box{ |
|
|
|
flex-wrap: wrap; |
|
|
|
.hot-adv{ |
|
|
|
width: 340rpx; |
|
|
|
height: 490rpx; |
|
|
|
border-radius: 20rpx; |
|
|
|
overflow: hidden; |
|
|
|
margin-bottom: 16rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.hot-item { |
|
|
|
width: 334rpx; |
|
|
|
height: 497rpx; |
|
|
|
background: #FFFFFF; |
|
|
|
border-radius: 20rpx; |
|
|
|
overflow: hidden; |
|
|
|
margin-bottom: 26rpx; |
|
|
|
|
|
|
|
image { |
|
|
|
width: 334.67rpx; |
|
|
|
height: 342rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.hot-content { |
|
|
|
height: 155rpx; |
|
|
|
padding: 6rpx 12rpx 20rpx; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
justify-content: space-between; |
|
|
|
.title { |
|
|
|
font-weight: 500; |
|
|
|
font-size: 29rpx; |
|
|
|
color: #000000; |
|
|
|
} |
|
|
|
|
|
|
|
.price { |
|
|
|
font-weight: 500; |
|
|
|
font-size: 33rpx; |
|
|
|
color: #FA0005; |
|
|
|
&::before{ |
|
|
|
content: "¥"; |
|
|
|
color: 24rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.btn-buy{ |
|
|
|
width: 53rpx; |
|
|
|
height: 53rpx; |
|
|
|
background: #97AF65; |
|
|
|
border-radius: 50%; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
image{ |
|
|
|
width: 32rpx; |
|
|
|
height: 32rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.type-container{ |
|
|
|
width: 100%; |
|
|
|
height: 60rpx; |
|
|
|
font-weight: 400; |
|
|
|
font-size: 26rpx; |
|
|
|
color: #888888; |
|
|
|
.type-item{ |
|
|
|
position: relative; |
|
|
|
margin: 0 auto; |
|
|
|
background-image: url("https://static.ticket.sz-trip.com/uploads/20251014/8023de50445d70ca73d64eb618e21af9.png"); |
|
|
|
background-size: 100% 100%; |
|
|
|
width: 239.33rpx; |
|
|
|
height: 52rpx; |
|
|
|
font-weight: 500; |
|
|
|
font-size: 29rpx; |
|
|
|
color: #212A0D; |
|
|
|
text-align: center; |
|
|
|
line-height: 52rpx; |
|
|
|
} |
|
|
|
// .type-item.active{ |
|
|
|
// font-weight: 500; |
|
|
|
// font-size: 30rpx; |
|
|
|
// color: #739826; |
|
|
|
// } |
|
|
|
// .type-item.active::after{ |
|
|
|
// content: '1'; |
|
|
|
// width: 20rpx; |
|
|
|
// height: 5.33rpx; |
|
|
|
// border-radius: 6rpx; |
|
|
|
// background: linear-gradient(to right, #719723, #97AF65); |
|
|
|
// position: absolute; |
|
|
|
// bottom: -10rpx; |
|
|
|
// left: calc(50% - 10rpx); |
|
|
|
// display: block; |
|
|
|
// font-size: 0; |
|
|
|
// } |
|
|
|
} |
|
|
|
</style> |