新建工成

This commit is contained in:
仲么了
2023-04-12 18:39:52 +08:00
parent d6b2c98d1f
commit ff2fd537ec
11 changed files with 1105 additions and 1071 deletions

View File

@@ -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