团队id等

master
yujialong 2 years ago
parent 2be807f0ee
commit c5b618e5ae
  1. 4
      App.vue
  2. 4
      config/request.js
  3. 8
      order/orders/orders.vue
  4. 8
      pages/clients/clients.vue
  5. 22
      pages/index/index.vue
  6. 2
      pages/products/products.vue
  7. 8
      pages/teams/teams.vue

@ -1,7 +1,9 @@
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
uni.setEnableDebug({
enableDebug: true
})
}, },
onShow: function() { onShow: function() {
console.log('App Launch'); console.log('App Launch');

@ -5,7 +5,9 @@
*/ */
export default { export default {
baseURL: 'https://huorantech.cn/', // baseURL: 'https://huorantech.cn/',
// baseURL: 'http://192.168.31.137:9000/',
baseURL: 'http://121.37.12.51/',
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' 'Content-Type': 'application/json;charset=UTF-8'
}, },

@ -182,7 +182,11 @@
orderStatus: this.orderStatus, orderStatus: this.orderStatus,
type: this.curTab type: this.curTab
} }
uni.showLoading({
title: '加载中'
})
list(data).then(({ data }) => { list(data).then(({ data }) => {
uni.hideLoading()
// list // list
const list = data.records const list = data.records
list.map(e => { list.map(e => {
@ -193,7 +197,9 @@
const noMore = this.list.length === data.total // const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1 this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {}) }).catch(e => {
uni.hideLoading()
})
}, },
initList() { initList() {
this.page = 1 this.page = 1

@ -149,14 +149,20 @@
pageSize: this.pageSize, pageSize: this.pageSize,
type: this.curTab // 团队:1 / 个人:0 type: this.curTab // 团队:1 / 个人:0
} }
uni.showLoading({
title: '加载中'
})
all(data).then(({ data }) => { all(data).then(({ data }) => {
uni.hideLoading()
// list // list
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records
this.page++ // page+1 this.page++ // page+1
const noMore = this.list.length === data.total // const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1 this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {}) }).catch(e => {
uni.hideLoading()
})
}, },
initList() { initList() {
this.page = 1 this.page = 1

@ -110,7 +110,8 @@
data() { data() {
return { return {
per: true, // per: true, //
teamId: uni.getStorageSync('team').teamId || '', // teamId: uni.getStorageSync('team').teamId || '',
teamId: '',
list: [], list: [],
id: '', id: '',
teamList: [] teamList: []
@ -133,6 +134,7 @@
teamId: this.teamId, teamId: this.teamId,
platformId: 4 platformId: 4
}).then(({ permissionMenu }) => { }).then(({ permissionMenu }) => {
uni.hideLoading()
const auth = [] const auth = []
const generateAuth = (list, parent) => { const generateAuth = (list, parent) => {
list.map(e => { list.map(e => {
@ -146,28 +148,36 @@
this.$forceUpdate() this.$forceUpdate()
this.initRole() this.initRole()
}).catch(e => { }).catch(e => {
uni.hideLoading()
uni.setStorageSync('auth', []) uni.setStorageSync('auth', [])
this.initRole() this.initRole()
}) })
}, },
// //
getInfo() { getInfo() {
uni.showLoading({
title: '加载中'
})
getTeamsByAccountId().then(({ data }) => { getTeamsByAccountId().then(({ data }) => {
data.map(e => { data.map(e => {
const n = e.partnerClassificationList const n = e.partnerClassificationList
e.id = n.id e.id = n.id
e.teamId = e.partnerClassificationId e.teamId = n.isTeam == 1 ? e.partnerClassificationId : n.id
e.partnerClassificationName = n.partnerClassificationName e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList delete e.partnerClassificationList
}) })
if (data.length) { if (data.length) {
// /**
if (!this.teamId) { * @description 如果是第一次进则默认选中第一个团队并把该团队的信息存入缓存
* 或者团队列表里没有该id则说明超管已经被转让也需要重新选中团队
*/
if (!this.teamId || !data.find(e => e.teamId == this.teamId)) {
this.teamId = data[0].teamId this.teamId = data[0].teamId
uni.setStorageSync('team', data[0]) uni.setStorageSync('team', data[0])
} }
} else { } else {
// 退 // 退
uni.hideLoading()
uni.clearStorageSync() uni.clearStorageSync()
uni.navigateTo({ uni.navigateTo({
url: '../login/login' url: '../login/login'
@ -176,7 +186,9 @@
this.list = data this.list = data
this.getAuth() this.getAuth()
}).catch(e => {}) }).catch(e => {
uni.hideLoading()
})
}, },
// //
teamChange() { teamChange() {

@ -12,7 +12,7 @@
<ul class="list"> <ul class="list">
<li v-for="item in list"> <li v-for="item in list">
<view class="pro-name"> <view class="pro-name">
<image v-if="item.miniProgramPictureAddress" class="icon" :src="item.miniProgramPictureAddress" mode="widthFix"></image> <image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
{{ item.productName }} {{ item.productName }}
</view> </view>
<view class="info"> <view class="info">

@ -84,6 +84,9 @@
}, },
// //
getList() { getList() {
uni.showLoading({
title: '加载中'
})
teamList({ teamList({
type: 1, type: 1,
pageNum: this.page, pageNum: this.page,
@ -91,6 +94,7 @@
keyWord: this.keyword, keyWord: this.keyword,
partnerClassificationId: uni.getStorageSync('team').teamId partnerClassificationId: uni.getStorageSync('team').teamId
}).then(({ pageList }) => { }).then(({ pageList }) => {
uni.hideLoading()
const { records } = pageList const { records } = pageList
// list // list
this.list = this.reachBottom > 0 ? [...this.list, ...records] : records this.list = this.reachBottom > 0 ? [...this.list, ...records] : records
@ -98,7 +102,9 @@
const noMore = this.list.length === pageList.total // const noMore = this.list.length === pageList.total //
this.status = noMore ? 'noMore' : 'more' // noMore this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1 this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {}) }).catch(e => {
uni.hideLoading()
})
}, },
initList() { initList() {
this.page = 1 this.page = 1

Loading…
Cancel
Save