Browse Source

个人中心改版

master
jiazhipeng 7 days ago
parent
commit
0d6b1dac36
  1. 6
      pages.json
  2. 320
      pages/user/user.vue
  3. 41
      subPackages/activity/prizeInQun.vue

6
pages.json

@ -368,6 +368,12 @@
"navigationBarTitleText" : "绿色有机标准认证" "navigationBarTitleText" : "绿色有机标准认证"
} }
}, },
{
"path": "activity/prizeInQun",
"style": {
"navigationBarTitleText" : "进群抽奖"
}
},
{ {
"path": "user/comment", "path": "user/comment",
"style": { "style": {

320
pages/user/user.vue

@ -1,6 +1,9 @@
<template> <template>
<view class="bg bg-padding"> <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="main-content">
<view class="topBox" > <view class="topBox" >
@ -17,12 +20,12 @@
<view class="flex-column-center"> <view class="flex-column-center">
<view class="title">优惠券</view> <view class="title">优惠券</view>
<view class="num">7</view> <view class="num">{{couponNum}}</view>
</view> </view>
<view style="height: 35rpx;width: 2rpx;background:#E3E3E3;"></view> <view style="height: 35rpx;width: 2rpx;background:#E3E3E3;"></view>
<view class="flex-column-center"> <view class="flex-column-center">
<view class="title">积分</view> <view class="title">积分</view>
<view class="num">0</view> <view class="num">{{userInfo.score||0}}</view>
</view> </view>
</view> </view>
@ -40,6 +43,8 @@
<view class="orderItem" v-for="(item,index) in orderList" :key="index" @click="goTrades(item)"> <view class="orderItem" v-for="(item,index) in orderList" :key="index" @click="goTrades(item)">
<img :src="item.src" alt=""> <img :src="item.src" alt="">
<view>{{item.title}}</view> <view>{{item.title}}</view>
<view class="count" v-if="item.needCount">{{item.count}}</view>
</view> </view>
</view> </view>
<!-- 待付款轮播 --> <!-- 待付款轮播 -->
@ -59,10 +64,8 @@
</swiper> --> </swiper> -->
</view> </view>
<view class="cygj"> <view class="cygj">
<view class="moreBox">我的服务</view> <view class="moreBox">我的服务</view>
<view style="display:flex;align-items:center;flex-wrap:wrap"> <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" <view :class="['cyItem',item.customClass]" v-for="(item,index) in cyList.filter(x=>x.isShow)" :key="index"
@click="gotoUrl(item,index)"> @click="gotoUrl(item,index)">
@ -72,15 +75,33 @@
</view> </view>
</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> </view>
<!-- 图片 --> <!-- 图片 -->
<uni-popup ref="popup" type="center"> <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>
<uni-popup ref="kfpopup" type="bottom" :safe-area="false"> <uni-popup ref="kfpopup" type="bottom" :safe-area="false">
@ -135,6 +156,7 @@
}, },
data() { data() {
return { return {
couponNum: 0,
dfkList: [], dfkList: [],
differTimeList: [], differTimeList: [],
nowDateTime: '', // nowDateTime: '', //
@ -147,7 +169,9 @@
{ {
src: 'https://static.ticket.sz-trip.com/uploads/20251011/806d65eb846e60a98352ba09d8660ce7.png', src: 'https://static.ticket.sz-trip.com/uploads/20251011/806d65eb846e60a98352ba09d8660ce7.png',
title: '待发货', title: '待发货',
status: 'WAIT_POST' status: 'WAIT_POST',
count: 0,
needCount: true
}, },
{ {
src: 'https://static.ticket.sz-trip.com/uploads/20251011/f3ea0d6a80ae0e10be1b974ad10955fb.png', 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', src: 'https://static.ticket.sz-trip.com/uploads/20251011/a1c19ffa332ff9a5de9fcc983874baea.png',
title: '进群抽奖', title: '进群抽奖',
path: '', path: '/subPackages/activity/prizeInQun',
isShow: true, isShow: true,
customClass: "prize", customClass: "prize",
}, },
{ {
src: 'https://static.ticket.sz-trip.com/uploads/20251011/c6c29ace07206eec5418fb51068fa4ca.png', src: 'https://static.ticket.sz-trip.com/uploads/20251011/c6c29ace07206eec5418fb51068fa4ca.png',
title: '用户协议', title: '用户协议',
@ -233,20 +255,32 @@
isShow: true isShow: true
} }
], ],
showImg: "", popshowImg: "",
hotList: [],
hotAdv: null,
finished: false,
typeIndex: 0,
} }
}, },
onReady () {
this.getHotList()
},
onShow() { onShow() {
// token // token
// this.Post({ this.Post({noShowLoading: true}, "/api/uservice/user/getMyInfo").then(res => {
// token: '' if (res.data) {
// },'/api/uservice/user/getMyInfo').then(res => { let info = res.data;
// this.$store.commit('changeUserInfo', res.data); info.token = JSON.parse(uni.getStorageSync('userInfo')).token || this.$store.state.user.userInfo.token
// }) this.$store.commit('changeUserInfo', info)
this.userInfo = info
this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {} uni.setStorageSync('isFlag', true)
console.log(this.userInfo)
uni.setStorageSync('isFlag', true) this.getCouponNum()
this.getDFH()
}
console.log(this.userInfo)
})
// this.dfkList = [] // this.dfkList = []
// this.nowDateTime = parseInt(new Date().getTime() / 1000) // this.nowDateTime = parseInt(new Date().getTime() / 1000)
// this.Post({}, "/api/user/userInfo").then((res) => { // 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) { goToOrderDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: '/subPackages/order/detail?id=' + item.order_id url: '/subPackages/order/detail?id=' + item.order_id
@ -383,7 +432,7 @@
return; return;
} }
if (item.GZHImg) { if (item.GZHImg) {
this.showImg = item.GZHImg; this.popshowImg = item.GZHImg;
this.$refs.popup.open() this.$refs.popup.open()
return 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> </script>
@ -442,7 +571,14 @@
.top-image{ .top-image{
width: 100%; width: 100%;
height: 453.43rpx; 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{ .main-content{
width: 750rpx; width: 750rpx;
@ -559,12 +695,28 @@
color: #535355; color: #535355;
width: 20%; width: 20%;
text-align: center; text-align: center;
position: relative;
img { img {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
margin-bottom: 12rpx; 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) { .orderItem:nth-child(n+6) {
margin-top: 28rpx; margin-top: 28rpx;
@ -812,6 +964,120 @@
text-align: left; 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> </style>

41
subPackages/activity/prizeInQun.vue

@ -0,0 +1,41 @@
<template>
<view class="bg">
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"
:show-menu-by-longpress="true"></image>
</view>
</template>
<script>
export default {
data() {
return {
headImg: null,
}
},
onLoad(option) {
this.getHeadImg(2400)
},
methods: {
getHeadImg (id) {
this.Post({id},'/api/multimedia/detail').then(res => {
this.headImg = res.data.head_img
uni.setNavigationBarTitle({
title:res.data.title
})
});
},
},
}
</script>
<style lang="scss" scoped>
.bg {
width: 750rpx;
min-height: 100vh;
}
.topImg {
width: 100%;
}
</style>
Loading…
Cancel
Save