Browse Source

Merge pull request 'develop' (#12) from develop into master

Reviewed-on: http://gitea.qinglakeji.com:3000/develop/qwl-data-report-h5/pulls/12
master
曾尔比 3 years ago
parent
commit
2372d24ed1
  1. 5
      .env.online
  2. 2
      package.json
  3. 5
      src/api/data.js
  4. 20
      src/views/dataOverview/index.vue
  5. 27
      src/views/login.vue
  6. 49
      src/views/teamList/index.vue
  7. 24
      src/views/teamPerformance/index.vue

5
.env.online

@ -1,3 +1,4 @@
NODE_ENV=production
NODE_ENV=online
BUILD_ENV=online BUILD_ENV=online
VUE_APP_ENV=online
VUE_APP_ENV=online
VUE_APP_BASE_URL="http://test.qingweilai888.xyz"

2
package.json

@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve --mode development",
"serve": "vue-cli-service serve --mode online",
"build:dev": "vue-cli-service build --mode development", "build:dev": "vue-cli-service build --mode development",
"build:pro": "vue-cli-service build --mode production", "build:pro": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"

5
src/api/data.js

@ -19,6 +19,11 @@ class data{
async poxyList(param){ async poxyList(param){
return await get("/admin/DataReport/ShopDataReport/poxyList",param) return await get("/admin/DataReport/ShopDataReport/poxyList",param)
} }
async overviewByUserId(param){
return await get("/admin/DataReport/ShopDataReport/overviewByUserId",param)
}
} }
export default new data() export default new data()

20
src/views/dataOverview/index.vue

@ -110,7 +110,7 @@
<div class="moneyRanking"> <div class="moneyRanking">
<div class="title">本月团队业绩排名TOP</div> <div class="title">本月团队业绩排名TOP</div>
<div class="list"> <div class="list">
<div class="item" @click="toTeamPerformance" v-for="(item,index) of list.month_money_top" :key="index">
<div class="item" @click="toTeamPerformance(item.id)" v-for="(item,index) of list.month_money_top" :key="index">
<div class="rankNum"> <div class="rankNum">
<p>{{index+1}}</p> <p>{{index+1}}</p>
</div> </div>
@ -155,19 +155,17 @@
path: '/teamList', path: '/teamList',
query: { query: {
type: type, type: type,
level_id: id,
today_month:this.list.today_month,
level_id: id
} }
}) })
}, },
toTeamPerformance(){
// this.$router.push({
// path: '/teamPerformance',
// query: {
// // type: type,
// // level_id: id,
// }
// })
toTeamPerformance(id){
this.$router.push({
path: '/teamPerformance',
query: {
lid:id,
}
})
}, },
} }
} }

27
src/views/login.vue

@ -6,22 +6,25 @@
let url = this.$route.query; let url = this.$route.query;
let token; let token;
let url_string = JSON.stringify(url); let url_string = JSON.stringify(url);
if (url_string == "{}") {
this.$toast('请先登录')
} else {
token = url.token_type + " " + url.access_token;
if (process.env.NODE_ENV == "online") {
token =
"bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LnFpbmd3ZWlsYWk4ODgueHl6XC9hZG1pblwvbG9naW4iLCJpYXQiOjE2Mjc0NjU1ODksImV4cCI6MTk4NzQ2NTU4OSwibmJmIjoxNjI3NDY1NTg5LCJqdGkiOiJ6clVHYnJCOXlPWkpRanRUIiwic3ViIjoxNjEsInBydiI6IjBiMzZjMGUwMjMyZGVlZTlkOTZhZDA0NGY3YWE2MjQ2YTUwYTU3ZmEifQ.aFc5fCUffmDN7zBRn-D13kx1LuLNG1Ej7vQOu4O2_AA"
this.$store.commit("user/setToken", token); this.$store.commit("user/setToken", token);
this.$router.push({ this.$router.push({
path: "/home",
});
path: "/home",
});
} else {
if (url_string == "{}") {
this.$toast('请先登录')
} else {
token = url.token_type + " " + url.access_token;
this.$store.commit("user/setToken", token);
this.$router.push({
path: "/home",
});
}
} }
// token =
// "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LnFpbmd3ZWlsYWk4ODgueHl6XC9hZG1pblwvbG9naW4iLCJpYXQiOjE2Mjc0NjU1ODksImV4cCI6MTk4NzQ2NTU4OSwibmJmIjoxNjI3NDY1NTg5LCJqdGkiOiJ6clVHYnJCOXlPWkpRanRUIiwic3ViIjoxNjEsInBydiI6IjBiMzZjMGUwMjMyZGVlZTlkOTZhZDA0NGY3YWE2MjQ2YTUwYTU3ZmEifQ.aFc5fCUffmDN7zBRn-D13kx1LuLNG1Ej7vQOu4O2_AA"
// this.$store.commit("user/setToken", token);
// this.$router.push({
// path: "/home",
// });
}, },
}; };
</script> </script>

49
src/views/teamList/index.vue

@ -14,9 +14,9 @@
</div> </div>
<div class="teamInfo"> <div class="teamInfo">
<div class="teamName">{{item.username}}</div> <div class="teamName">{{item.username}}</div>
<div class="teamMoney"></div>
<!-- <div class="teamMoney">{{today_month}}月打款业绩{{item.team_integral | capitalize}}</div> -->
<div class="teamNum">团队人数{{item.team_num}}</div>
<div class="teamNum" v-if="id"></div>
<div class="teamMoney">注册时间{{item.created_at |time}}</div>
<div class="teamNum" v-if="!id">团队人数{{item.team_num}}</div>
</div> </div>
</div> </div>
</van-list> </van-list>
@ -31,7 +31,7 @@
import { import {
Tab, Tab,
Tabs, Tabs,
Empty
Empty
} from 'vant'; } from 'vant';
export default { export default {
data() { data() {
@ -44,17 +44,20 @@
totalPage: 1, totalPage: 1,
}, },
error: false, error: false,
type:'',
level_id:'',
today_month:this.$route.query.today_month,
type: '',
level_id: '',
id: '',
} }
}, },
filters: { filters: {
capitalize: function (val) { capitalize: function (val) {
return (+val || 0).toFixed(0).replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') return (+val || 0).toFixed(0).replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
}, },
time: function (val) {
return val.substring(0, 10);
},
capitalize2: function (index) { capitalize2: function (index) {
let key = Number(index-1)
let key = Number(index - 1)
const statusList = [ const statusList = [
"vip", "vip",
"总代", "总代",
@ -66,6 +69,10 @@
} }
}, },
created() { created() {
if (this.$route.query.id) {
console.log(`2222222222222222`);
this.id = this.$route.query.id
}
this.getList() this.getList()
}, },
methods: { methods: {
@ -73,9 +80,16 @@
const res = await data.poxyList({ const res = await data.poxyList({
type: this.$route.query.type, type: this.$route.query.type,
level_id: this.$route.query.level_id, level_id: this.$route.query.level_id,
page:++this.list.curPage,
user_id: this.id,
page: ++this.list.curPage,
}) })
const information = res.data.data
let information
if (this.$route.query.id) {
information = res.data
} else {
information = res.data.data
}
console.log(information, '222');
if (JSON.stringify(information.data) != '[]') { if (JSON.stringify(information.data) != '[]') {
this.list.data.push(...information.data); this.list.data.push(...information.data);
this.list.totalPage = information.last_page; this.list.totalPage = information.last_page;
@ -92,9 +106,6 @@
this.list.finished = true; this.list.finished = true;
}); });
} }
},
addList() {
}, },
onLoad() { onLoad() {
var _this = this; var _this = this;
@ -114,18 +125,20 @@
min-height: 100vh; min-height: 100vh;
background: RGBA(63, 66, 88, 1); background: RGBA(63, 66, 88, 1);
position: relative; position: relative;
.empty{
.empty {
position: absolute; position: absolute;
top: 20%; top: 20%;
left:50%;
left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} }
.moneyRanking { .moneyRanking {
min-height: 100vh; min-height: 100vh;
background: RGBA(63, 66, 88, 1); background: RGBA(63, 66, 88, 1);
padding: 0 70px; padding: 0 70px;
padding-top: 50px; padding-top: 50px;
.title { .title {
font-size: 40px; font-size: 40px;
@ -191,8 +204,8 @@
} }
.teamMoney { .teamMoney {
height: 26px;
line-height: 26px;
// height: 26px;
// line-height: 26px;
font-size: 26px; font-size: 26px;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;

24
src/views/teamPerformance/index.vue

@ -119,7 +119,7 @@
</div> </div>
<div class="teamInfo"> <div class="teamInfo">
<div class="teamName">{{item.username}}</div> <div class="teamName">{{item.username}}</div>
<div class="teamMoney">7月打款业绩{{item.team_integral | capitalize}}</div>
<div class="teamMoney">{{list.today_month}}月打款业绩{{item.team_integral | capitalize}}</div>
<div class="teamNum">团队人数{{item.team_num}}</div> <div class="teamNum">团队人数{{item.team_num}}</div>
</div> </div>
</div> </div>
@ -134,6 +134,7 @@
data() { data() {
return { return {
list: {}, list: {},
id:'',
} }
}, },
filters: { filters: {
@ -142,22 +143,27 @@
}, },
}, },
created() { created() {
this.id = this.$route.query.lid
console.log(this.id,'-----------------');
this.getData() this.getData()
}, },
methods: { methods: {
async getData() { async getData() {
const res = await data.overview();
const res = await data.overviewByUserId({
user_id:this.id,
});
this.list = res.data this.list = res.data
console.log(this.list, '---this.list'); console.log(this.list, '---this.list');
}, },
toTeamList(type, id) { toTeamList(type, id) {
// this.$router.push({
// path: '/teamList',
// query: {
// type: type,
// level_id: id,
// }
// })
this.$router.push({
path: '/teamList',
query: {
type: type,
level_id: id,
id:this.id,
}
})
}, },
} }
} }

Loading…
Cancel
Save