From 9b8304426fa1724913dda1b5bdaacf1db8141646 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Thu, 18 Sep 2025 18:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 24 + subPackages/pointsMall/detail.vue | 1100 +++++++++++++++++ subPackages/pointsMall/index.vue | 134 +- subPackages/pointsMall/order.vue | 1510 +++++++++++++++++++++++ subPackages/pointsMall/search.vue | 23 +- subPackages/pointsMall/searchResult.vue | 37 +- 6 files changed, 2747 insertions(+), 81 deletions(-) create mode 100644 subPackages/pointsMall/detail.vue create mode 100644 subPackages/pointsMall/order.vue diff --git a/pages.json b/pages.json index b6968b1..48ff9e1 100644 --- a/pages.json +++ b/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" : "下单" + } } ] diff --git a/subPackages/pointsMall/detail.vue b/subPackages/pointsMall/detail.vue new file mode 100644 index 0000000..b4e0e21 --- /dev/null +++ b/subPackages/pointsMall/detail.vue @@ -0,0 +1,1100 @@ + + + + + \ No newline at end of file diff --git a/subPackages/pointsMall/index.vue b/subPackages/pointsMall/index.vue index 1b80268..2e72177 100644 --- a/subPackages/pointsMall/index.vue +++ b/subPackages/pointsMall/index.vue @@ -3,17 +3,17 @@ 积分余额 - 300 + {{totalScore}} - 已连签0天 + 已连签{{cuntinue_days}}天 注:连续签到可获得更多积分,断签后重新累积 - +{{item.num}} + +{{item.score}} @@ -34,18 +34,19 @@ 每日精选 - 1300人已兑换 + + - + {{item.title}} - {{item.price}} - + {{item.score_price}} + 兑换 @@ -58,26 +59,26 @@ enable-flex scroll-x scroll-with-animation :show-scrollbar="false"> - {{type.title}} + {{type.name}} - + 搜索 - + {{item.title}} 已兑14100件 - {{item.price}} - + {{item.score_price}} + 兑换 @@ -86,10 +87,10 @@ - + - +5 + +{{todayRecord.score}} @@ -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; diff --git a/subPackages/pointsMall/order.vue b/subPackages/pointsMall/order.vue new file mode 100644 index 0000000..0cc2842 --- /dev/null +++ b/subPackages/pointsMall/order.vue @@ -0,0 +1,1510 @@ + + + + + \ No newline at end of file diff --git a/subPackages/pointsMall/search.vue b/subPackages/pointsMall/search.vue index 06714f3..a827229 100644 --- a/subPackages/pointsMall/search.vue +++ b/subPackages/pointsMall/search.vue @@ -13,12 +13,6 @@
{{his}}
-
大家在搜
-
-
- {{hot.name}} -
-
@@ -31,7 +25,7 @@ keywords: '', history: [], hot: [], - keywords_name: 'tz_trip_keyowrds', + keywords_name: 'tz_trip_jf_keyowrds', options: {}, type: '', // techan时跳转techanResult } @@ -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}` }) diff --git a/subPackages/pointsMall/searchResult.vue b/subPackages/pointsMall/searchResult.vue index ae94cd2..cc49c48 100644 --- a/subPackages/pointsMall/searchResult.vue +++ b/subPackages/pointsMall/searchResult.vue @@ -6,38 +6,38 @@
搜索
- +
- - + + - {{item.ext.title}} + {{item.title}} - + - {{item.ext.price/100}} + {{item.score_price}} @@ -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) {