acdr-ui/dist/dev/mp-weixin/modules/mall/commission/promoter.js.map

1 line
40 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"version":3,"file":"promoter.js","sources":["../../../../../../src/modules/mall/commission/promoter.vue","../../../../../../uniPage:/bW9kdWxlc1xtYWxsXGNvbW1pc3Npb25ccHJvbW90ZXIudnVl"],"sourcesContent":["<template>\r\n <s-layout title=\"推广人排行榜\">\r\n <view class=\"PromoterRank\" style=\"backgroundcolor: red\">\r\n <view class=\"redBg bg-color\">\r\n <view class=\"header\">\r\n <view class=\"nav acea-row row-center-wrapper\" style=\"display: flex\">\r\n <view\r\n class=\"item\"\r\n :class=\"state.currentTab === index ? 'font-color' : ''\"\r\n v-for=\"(item, index) in tabMaps\"\r\n :key=\"index\"\r\n @click=\"switchTap(index)\"\r\n >\r\n {{ item }}\r\n </view>\r\n </view>\r\n <!-- top3 排名 -->\r\n <view class=\"rank acea-row row-bottom row-around\">\r\n <view class=\"item\" v-show=\"state.two.id\">\r\n <view class=\"pictrue\">\r\n <image :src=\"state.two.avatar\"></image>\r\n </view>\r\n <view class=\"name line1\">{{ state.two.nickname }}</view>\r\n <view class=\"num\">{{ state.two.brokerageUserCount }}人</view>\r\n </view>\r\n <view class=\"item\" v-show=\"state.one.id\">\r\n <view class=\"pictrue\">\r\n <image :src=\"state.one.avatar\"></image>\r\n </view>\r\n <view class=\"name line1\">{{ state.one.nickname }}</view>\r\n <view class=\"num\">{{ state.one.brokerageUserCount }}人</view>\r\n </view>\r\n <view class=\"item\" v-show=\"state.three.id\">\r\n <view class=\"pictrue\">\r\n <image :src=\"state.three.avatar\"></image>\r\n </view>\r\n <view class=\"name line1\">{{ state.three.nickname }}</view>\r\n <view class=\"num\">{{ state.three.brokerageUserCount }}人</view>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- 其它排名 -->\r\n <view class=\"list\" v-if=\"state.rankList.length\">\r\n <view\r\n class=\"item acea-row row-between-wrapper\"\r\n v-for=\"(item, index) in state.rankList\"\r\n :key=\"index\"\r\n >\r\n <view class=\"num\">{{ index + 4 }}</view>\r\n <view class=\"picTxt acea-row row-between-wrapper\">\r\n <view class=\"pictrue\">\r\n <image :src=\"item.avatar\"></image>\r\n </view>\r\n <view class=\"text line1\">{{ item.nickname }}</view>\r\n </view>\r\n <view class=\"people font-color\">{{ item.brokerageUserCount }}人</view>\r\n </view>\r\n </view>\r\n </view>\r\n </s-layout>\r\n</template>\r\n\r\n<script setup>\r\nimport sheep from '@/sheep'\r\nimport { onLoad } from '@dcloudio/uni-app'\r\nimport { reactive } from 'vue'\r\nimport BrokerageApi from '@/sheep/api/trade/brokerage'\r\n\r\nconst tabMaps = ['周排行', '月排行']\r\n\r\nconst state = reactive({\r\n currentTab: 0,\r\n\r\n rankList: [],\r\n times: [],\r\n\r\n one: {}, // 排名第一\r\n two: {}, // 排名第二\r\n three: {}, // 排名第三\r\n})\r\n\r\nfunction switchTap(index) {\r\n if (state.currentTab === index) {\r\n return\r\n }\r\n state.currentTab = index\r\n calculateTimes()\r\n getRankList()\r\n}\r\n\r\nasync function getRankList() {\r\n // 重置数据\r\n state.one = {}\r\n state.two = {}\r\n state.three = {}\r\n state.rankList = []\r\n // 查询\r\n const { code, data } = await BrokerageApi.getBrokerageUserRankPageByUserCount({\r\n pageNo: 1,\r\n pageSize: 10,\r\n 'times[0]': state.times[0],\r\n 'times[1]': state.times[1],\r\n })\r\n if (code !== 0) {\r\n return\r\n }\r\n state.rankList = data.list\r\n state.one = state.rankList.shift() || {}\r\n state.two = state.rankList.shift() || {}\r\n state.trhee = state.rankList.shift() || {}\r\n}\r\n\r\nfunction calculateTimes()