12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <template>
- <view>
- <t-i-navbar></t-i-navbar>
- <!-- notice -->
- <t-i-notice :base_url="base_url"></t-i-notice>
- <!-- banner -->
- <t-i-banner :base_url="base_url"></t-i-banner>
- <!-- 固定入口 -->
- <t-i-icon :base_url="base_url"></t-i-icon>
- <!-- 常用功能 -->
- <t-i-common></t-i-common>
- <!-- 新闻列表 -->
- <t-i-news :base_url="base_url"></t-i-news>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 当前煤矿编码
- mine_code: "",
-
- // 首页接口的基础请求路径 默认为当前矿编码的基础路径
- base_url: " "
- }
- },
- onLoad() {
- // 初始化当前煤矿编码
- this.mine_code = uni.getStorageSync('mine_code')
-
- // 根据矿编码切换首页接口不同的请求基础路径
- switch (this.mine_code) {
- case 'ningdongyunying':
- this.base_url = "http://ningdongyunying.nxjiewei.com:8011/api"
- break;
- case 'meihuajing':
- this.base_url = "http://meihuajing.nxjiewei.com:8011/api"
- break;
- default:
- this.base_url = ""
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #F6FAF6;
- }
- </style>
|