diff --git a/components/RankingPopup.vue b/components/RankingPopup.vue new file mode 100644 index 0000000..aa1dac8 --- /dev/null +++ b/components/RankingPopup.vue @@ -0,0 +1,670 @@ + + + + + diff --git a/components/RankingPopupExample.vue b/components/RankingPopupExample.vue new file mode 100644 index 0000000..2e4d364 --- /dev/null +++ b/components/RankingPopupExample.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/components/noticePopup.vue b/components/noticePopup.vue index 49884e5..91e2827 100644 --- a/components/noticePopup.vue +++ b/components/noticePopup.vue @@ -19,7 +19,6 @@
- @@ -42,12 +41,12 @@ export default { } }, mounted() { - this.getUserTc() + // this.getUserTc() }, methods: { closeTap() { this.noticeFlag = false - // this.$emit("getTree"); + this.$emit('close') }, getUserTc(data) { api @@ -63,6 +62,8 @@ export default { if (items == this.publishLocationIndex) { this.noticeFlag = true this.content = res.data[0] + } else { + this.$emit('close') } }) } diff --git a/components/region-select/index.vue b/components/region-select/index.vue index 59824a0..4679daa 100644 --- a/components/region-select/index.vue +++ b/components/region-select/index.vue @@ -101,20 +101,24 @@ export default { if (!this.autoTrigger) { return } - uni.showLoading({ - title: '加载中...', - }) - this.getRegionSelect() - .then(selectedList => { - this.selectedList = selectedList - const area = selectedList.shift() - this.open(area) - }) - .catch(() => { - uni.hideLoading() - }) + this.init() }, methods: { + init() { + uni.showLoading({ + title: '加载中...', + }) + this.getRegionSelect() + .then(selectedList => { + this.selectedList = selectedList + const area = selectedList.shift() + this.open(area) + }) + .catch(() => { + this.$emit('success') + uni.hideLoading() + }) + }, async getRegionSelect() { return new Promise(async (resolve, reject) => { try { @@ -125,7 +129,6 @@ export default { .filter(key => res.data[key]) .filter(key => !res.data?.data?.[`${key}Data`]) .reverse() - console.log(needSelected, 'needSelected') if ( needSelected?.length && Object.keys(res.data?.data || {}).length < needSelected?.length @@ -274,6 +277,7 @@ export default { throw new Error(res.message || 'Failed to set region') } } catch (error) { + this.$emit('success') console.error('Failed to set region:', error) } }, diff --git a/config/index.js b/config/index.js index 5d2d869..3525b65 100644 --- a/config/index.js +++ b/config/index.js @@ -1,19 +1,30 @@ - const http = uni.$u.http //首页 -export const userIndex = (params) => http.get('/sale/api/wares/get-app-index', { params }) +export const userIndex = params => + http.get('/sale/api/wares/get-app-index', { params }) //修改头像 -export const updateHead = (data) => http.post('/member/api/member/update-head', data) +export const updateHead = data => + http.post('/member/api/member/update-head', data) //提货记录列表 -export const pickList = (params) => http.get('/activity/api/pick/list', { params }) +export const pickList = params => + http.get('/activity/api/pick/list', { params }) //提货专区列表 -export const pickLogList = (params) => http.get('/activity/api/pick/pick-log', { params }) +export const pickLogList = params => + http.get('/activity/api/pick/pick-log', { params }) //植树活动 -export const queryTreeActivity = (params) => http.get('/activity/api/sa-tree-order/queryTreeActivity', { params }) +export const queryTreeActivity = params => + http.get('/activity/api/sa-tree-order/queryTreeActivity', { params }) //创客空间列表 -export const marketList = (params) => http.get('/member/api/maker-space/list', { params }) \ No newline at end of file +export const marketList = params => + http.get('/member/api/maker-space/list', { params }) + +export const getTopPeople = params => + http.post('/member/api/member-statistics/topPeople', params) + +export const getTopAmount = params => + http.post('/member/api/member-statistics/topAmount', params) diff --git a/config/request.js b/config/request.js index 8a68a49..de3f61c 100644 --- a/config/request.js +++ b/config/request.js @@ -19,7 +19,7 @@ module.exports = vm => { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = 'http://192.168.0.86:8080' + config.baseURL = 'https://t-app.beida666.com/prod-api' //#endif //#ifdef QA_SERVER diff --git a/pages/index/index.vue b/pages/index/index.vue index 576377e..71006c1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -27,6 +27,7 @@ + @@ -54,7 +55,7 @@
- + +
- +
@@ -107,6 +112,7 @@ import { mapGetters } from 'vuex' import RegionSelect from '@/components/region-select/index.vue' import RaisedTabbar from '@/components/raised-tabbar.vue' import GoodsList from '@/components/goods-list.vue' +import RankingPopup from '@/components/RankingPopup.vue' export default { components: { noticePopup, @@ -116,6 +122,7 @@ export default { areaProductList, RegionSelect, GoodsList, + RankingPopup, }, filters: { seles(value) { @@ -128,6 +135,7 @@ export default { }, data() { return { + rankingComplete: false, newShareMember: false, promptFlag: false, promptMsg: '', @@ -353,6 +361,7 @@ export default { // this.getLanguage(); this.getService() + // this.showRankingPopups() }, onShow() { this.$store.dispatch('getCarLength') @@ -360,6 +369,10 @@ export default { this.user = uni.getStorageSync('User') this.getAreaGoods() this.newShareMember = this.user?.loginType !== 0 + if (this.user.memberCode !== 'BD68880628') { + console.log('init') + this.$refs.regionSelect.init() + } }) }, onPullDownRefresh() { @@ -379,6 +392,33 @@ export default { } }, + // 显示排行榜弹窗 + async showRankingPopups() { + try { + this.$nextTick(async () => { + await this.$refs.rankingPopup.showRankingPopups() + }) + } catch (error) { + console.error('显示排行榜失败:', error) + uni.showToast({ + title: '加载排行榜失败', + icon: 'error', + }) + } + }, + + // 排行榜查看完成回调 + handleRankingComplete() { + this.rankingComplete = true + this.$refs.child.getUserTc() + }, + regionSelectSuccess() { + if (this.rankingComplete) { + return + } + this.showRankingPopups() + }, + goAreaUrl() { ban.agreementName().then(res => { if (res.data == 0) { @@ -450,15 +490,11 @@ export default { } }) }, - callChildMethod() { - this.$refs.child.getUserTc() - }, callznMethod() { this.$refs.child2.getUserTc2() }, - // 植树弹层 - getTree() { - this.$refs.tree.getData() + noticePopupHandleClose() { + // this.$refs.regionSelect.getRegionSelect() }, isEmpty(v) { switch (typeof v) { @@ -619,6 +655,37 @@ export default { height: 100%; } } + +// 排行榜入口样式 +.ranking-entry { + padding: 20rpx 30rpx; + + .ranking-btn { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + border-radius: 25rpx; + padding: 20rpx 30rpx; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3); + + .ranking-icon { + font-size: 32rpx; + margin-right: 12rpx; + } + + .ranking-text { + color: #fff; + font-size: 28rpx; + font-weight: bold; + } + + &:active { + transform: scale(0.98); + transition: transform 0.1s ease; + } + } +} .content1 { background: url('~@/static/images/fBgd.jpg') no-repeat; background-size: 100% 100%; diff --git a/static/images/rank-1.svg b/static/images/rank-1.svg new file mode 100644 index 0000000..2e71275 --- /dev/null +++ b/static/images/rank-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/images/rank-2.svg b/static/images/rank-2.svg new file mode 100644 index 0000000..cd262ed --- /dev/null +++ b/static/images/rank-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/images/rank-3.svg b/static/images/rank-3.svg new file mode 100644 index 0000000..cc5c979 --- /dev/null +++ b/static/images/rank-3.svg @@ -0,0 +1 @@ + \ No newline at end of file