Ver Fonte

* 修改环境配置文件

chen.cheng há 11 meses atrás
pai
commit
6b8347c5af
4 ficheiros alterados com 112 adições e 27 exclusões
  1. 35 0
      components/ItemList/index.vue
  2. 7 8
      main.js
  3. 67 0
      package.json
  4. 3 19
      pages/tabbar/index/index.vue

+ 35 - 0
components/ItemList/index.vue

@@ -0,0 +1,35 @@
+<template>
+  <view class="item-list-container">
+    <view v-for="(item, index) in ds" :key="index">
+      <view class="item-list">
+        <view class="item-list-left">
+          <image class="item-list-img" :src="item.imgUrl"></image>
+        </view>
+        <view class="item-list-right">
+          <view class="item-title">{{ item.title }}</view>
+          <view class="item-content">{{ item.date }}</view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    ds: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {};
+  },
+  created() {
+    this.children = [];
+  },
+  onLoad() {
+  },
+  methods: {},
+};
+</script>

+ 7 - 8
main.js

@@ -1,13 +1,12 @@
-import Vue from 'vue'
-import App from './App'
-
-// vuex
-import store from './store'
-
 // 引入全局uView
-import uView from '@/uni_modules/uview-ui'
+import uView from '@/uni_modules/uview-ui';
+import Vue from 'vue';
+import App from './App';
 
-import mixin from './common/mixin'
+import mixin from './common/mixin';
+
+// vuex
+import store from './store';
 
 Vue.prototype.$store = store
 

+ 67 - 0
package.json

@@ -7,5 +7,72 @@
 	"devDependencies": {
 		"eslint": "^8.2.0",
 		"eslint-config-airbnb": "^19.0.0"
+	},
+	"uni-app": {
+		"scripts": {
+			"h5dev": {
+				"title": "h5开发版",
+				"browser": "chrome",
+				"env": {
+					"UNI_PLATFORM": "h5",
+					"UNI_FILE_PREFIX": "http://127.0.0.1:9001/cdn/"
+				},
+				"define": {
+					"H5-DEV": true
+				}
+			},
+			"h5test": {
+				"title": "h5测试版",
+				"browser": "chrome",
+				"env": {
+					"UNI_PLATFORM": "h5",
+					"UNI_FILE_PREFIX": "http://127.0.0.1:9001/cdn/"
+				},
+				"define": {
+					"H5-TEST": true
+				}
+			},
+			"h5prod": {
+				"title": "h5生产版",
+				"browser": "chrome",
+				"env": {
+					"UNI_PLATFORM": "h5",
+					"UNI_FILE_PREFIX": "http://127.0.0.1:9001/cdn/"
+				},
+				"define": {
+					"H5-PROD": true
+				}
+			},
+			"mp-weixin-dev": {
+				"title": "微信开发版",
+				"env": {
+					"UNI_PLATFORM": "mp-weixin",
+					"UNI_FILE_PREFIX": "http://127.0.0.1:9001/cdn/"
+				},
+				"define": {
+					"MP-WEIXIN-DEV": true
+				}
+			},
+			"mp-weixin-test": {
+				"title": "微信测试版",
+				"env": {
+					"UNI_PLATFORM": "mp-weixin",
+					"UNI_FILE_PREFIX": "http://127.0.0.1:9001/cdn/"
+				},
+				"define": {
+					"MP-WEIXIN-TEST": true
+				}
+			},
+			"mp-weixin-prod": {
+				"title": "微信生产版",
+				"env": {
+					"UNI_PLATFORM": "mp-weixin",
+					"UNI_FILE_PREFIX": "http://127.34.0.1:9001/cdn/"
+				},
+				"define": {
+					"MP-WEIXIN-PROD": true
+				}
+			}
+		}
 	}
 }

+ 3 - 19
pages/tabbar/index/index.vue

@@ -35,24 +35,7 @@
         <view class="rectangle"></view>
         <view class="line"></view>
       </view>
-      <u-list>
-        <u-list-item
-            v-for="(item, index) in indexList"
-            :key="index"
-        >
-          <u-cell
-              :title="`列表长度-${index + 1}`"
-          >
-            <u-avatar
-                slot="icon"
-                shape="square"
-                size="35"
-                :src="item.url"
-                customStyle="margin: -3px 5px -3px 0"
-            ></u-avatar>
-          </u-cell>
-        </u-list-item>
-      </u-list>
+
     </view>
   </view>
 </template>
@@ -60,8 +43,9 @@
 <script>
 export default {
   data() {
+	  debugger
     return {
-      keyword: '',
+      keyword: process.env.UNI_FILE_PREFIX ,
       list: [
         '/static/images/swiper/title.png',
       ],