新建工成
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { pinyin } from 'pinyin-pro';
|
||||
import { queryEngineering } from '@/common/api/gc.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -133,47 +134,7 @@ export default {
|
||||
}
|
||||
],
|
||||
gcList: [
|
||||
'南京灿能',
|
||||
'南京灿能',
|
||||
'南京灿能',
|
||||
'南京灿能',
|
||||
'南京灿能',
|
||||
'北京灿能',
|
||||
'北京灿能',
|
||||
'北京灿能',
|
||||
'北京灿能',
|
||||
'北京灿能',
|
||||
'上海灿能',
|
||||
'上海灿能',
|
||||
'上海灿能',
|
||||
'上海灿能',
|
||||
'上海灿能',
|
||||
'上海灿能',
|
||||
'广州灿能',
|
||||
'广州灿能',
|
||||
'广州灿能',
|
||||
'广州灿能',
|
||||
'广州灿能',
|
||||
'深圳灿能',
|
||||
'深圳灿能',
|
||||
'深圳灿能',
|
||||
'深圳灿能',
|
||||
'深圳灿能',
|
||||
'杭州灿能',
|
||||
'杭州灿能',
|
||||
'杭州灿能',
|
||||
'杭州灿能',
|
||||
'杭州灿能',
|
||||
'杭州灿能',
|
||||
'杭州灿能',
|
||||
'苏州灿能',
|
||||
'苏州灿能',
|
||||
'苏州灿能',
|
||||
'苏州灿能',
|
||||
'苏州灿能',
|
||||
'苏州灿能',
|
||||
'苏州灿能',
|
||||
'苏州灿能',
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -202,17 +163,17 @@ export default {
|
||||
|
||||
let result = []
|
||||
this.gcList.forEach(item => {
|
||||
let arr = pinyin(item[0], { toneType: 'none', type: 'array' })
|
||||
let arr = pinyin(item.name[0], { toneType: 'none', type: 'array' })
|
||||
let letter = arr[0][0].toUpperCase()
|
||||
console.log(letter);
|
||||
let index = result.findIndex(item => item.letter === letter)
|
||||
if (index === -1) {
|
||||
result.push({
|
||||
letter,
|
||||
data: [item]
|
||||
data: [item.name]
|
||||
})
|
||||
} else {
|
||||
result[index].data.push(item)
|
||||
result[index].data.push(item.name)
|
||||
}
|
||||
})
|
||||
return result
|
||||
@@ -234,7 +195,9 @@ export default {
|
||||
showDrawer() {
|
||||
this.$refs.showRight.open();
|
||||
},
|
||||
closeDrawer() {
|
||||
closeDrawer(e) {
|
||||
console.log(e);
|
||||
|
||||
this.$refs.showRight.close();
|
||||
},
|
||||
submitFeedBack() { uni.navigateTo({ url: '/pages/home/feedback' }) },
|
||||
@@ -304,10 +267,16 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
init(){
|
||||
queryEngineering().then(res => {
|
||||
this.gcList = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.userInfo = uni.getStorageSync('userInfo')
|
||||
setTimeout(() => {
|
||||
this.init()
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery().select('.nav').boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
|
||||
Reference in New Issue
Block a user