DESKTOP-O04BTUJ\muzen 3 년 전
부모
커밋
27f6af63e5
5개의 변경된 파일183개의 추가작업 그리고 65개의 파일을 삭제
  1. 7 1
      src/pages.json
  2. 48 60
      src/pages/index/detail.vue
  3. 5 4
      src/pages/index/index.vue
  4. 123 0
      src/pages/index/list.vue
  5. BIN
      src/static/logo.png

+ 7 - 1
src/pages.json

@@ -7,10 +7,16 @@
 			}
 		},
 		{
-			"path": "pages/index/detail",
+			"path": "pages/index/list",
 			"style": {
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path": "pages/index/detail",
+			"style": {
+				"navigationBarTitleText": "版本列表"
+			}
 		}
 	],
 	"globalStyle": {

+ 48 - 60
src/pages/index/detail.vue

@@ -1,27 +1,18 @@
 <template>
-  <view>
-    <uni-nav-bar :title="form.projectName" leftIcon="left" @clickLeft="getBack" />
-    <view class="title">Android安装包</view>
-    <view class="list" v-for="item in form.android" :key="item.id">
-      <view class="left">
+  <view class="content">
+    <view class="list" v-for="(item, index) in list" :key="item.id">
+      <view class="item">
         <img :src="item.icon">
         <view class="main">
-          <text>{{ item.name }}</text>
-          <text>{{ item.updateTimeText }} 更新 | {{ item.version }}</text>
+          <text style="fontSize: 28rpx">{{ item.name }}</text>
+          <text style="fontSize: 22rpx;color:#aaa">{{ item.version }} | {{ item.size }}</text>
+          <text style="fontSize: 22rpx;color:#aaa">{{ item.updateTimeText }}</text>
         </view>
       </view>
-      <a :href="item.downUrl">安装</a>
-    </view>
-    <view class="title">IOS安装包</view>
-    <view class="list" v-for="item in form.ios" :key="item.id">
-      <view class="left">
-        <img :src="item.icon">
-        <view class="main">
-          <text>{{ item.name }}</text>
-          <text>{{ item.updateTimeText }} 更新 | {{ item.version }}</text>
-        </view>
+      <view style="fontSize: 22rpx;color:#aaa;padding:20rpx 0;">
+        {{ item.updateContent }}
       </view>
-      <a :href="item.downUrl">安装</a>
+      <a :class="[index === 0 ? 'blue' : 'info']" :href="item.downUrl">安装</a>
     </view>
   </view>
 </template>
@@ -30,46 +21,41 @@
 export default {
   data() {
     return {
-      form: {}
+      list: []
     }
   },
   onLoad(e) {
-    this.form = JSON.parse(decodeURIComponent(e.item))
-  },
-  methods: {
-    getBack() {
-      uni.redirectTo({
-        url: `/pages/index/index`
-      })
-    },
+    uni.request({
+      url: `https://o3tapi.radio1964.com/device/project/update/list`,
+      data: {
+        projectId: e.projectId,
+        pageNum: 1,
+        pageSize: 100
+      },
+      method: 'get',
+      success: (res) => {
+        if (res.data.code === 0) {
+          this.list = res.data.data.records
+        }
+      }
+    })
   }
 }
 </script>
 
 <style lang="scss" scoped>
-.uni-list-chat {
-  display: flex;
-}
-
-.title {
-  padding: 28rpx 20rpx;
-  font-size: 28rpx;
-}
-
 .list {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
   padding: 28rpx 20rpx;
   background: #fff;
   border-bottom: 2rpx solid #eee;
 
-  .left {
+  .item {
     display: flex;
 
-    img {
+    .img {
       width: 100rpx;
       height: 100rpx;
+      border: 1px solid #eee;
       border-radius: 20rpx;
       margin-right: 20rpx;
     }
@@ -77,27 +63,29 @@ export default {
     .main {
       display: flex;
       flex-direction: column;
-      justify-content: space-around;
-
-      text:first-child {
-        font-size: 28rpx;
-      }
-
-      text:last-child {
-        font-size: 22rpx;
-      }
     }
   }
+}
 
-  a {
-    margin: 0;
-    background: none;
-    border: 2rpx solid #f80;
-    padding: 10rpx 30rpx;
-    font-size: 24rpx;
-    color: #f80;
-    border-radius: 10rpx;
-    text-decoration: none;
-  }
+a {
+  box-sizing: border-box;
+  display: block;
+  width: 100%;
+  padding: 25rpx 0;
+  text-align: center;
+  margin: 0;
+  font-size: 28rpx;
+  border-radius: 10rpx;
+  text-decoration: none;
+}
+
+.blue{
+  background: #409EFF;
+  color: #FFF
+}
+
+.info{
+  background: #f4f4f4;
+  color: #000;
 }
 </style>

+ 5 - 4
src/pages/index/index.vue

@@ -1,8 +1,8 @@
 <template>
   <view class="content">
     <view class="list" v-for="item in list" :key="item.id" @click="getDetail(item)">
-      <img :src="item.icon">
-      <text>{{ item.projectName }}</text>
+      <img :src="item.pic">
+      <text>{{ item.name }}</text>
     </view>
   </view>
 </template>
@@ -20,7 +20,7 @@ export default {
   methods: {
     getList() {
       uni.request({
-        url: `https://o3tapi.radio1964.com/device/project/update/list`,
+        url: `https://o3tapi.radio1964.com/device/project/list`,
         method: 'get',
         success: (res) => {
           if (res.data.code === 0) {
@@ -30,8 +30,9 @@ export default {
       })
     },
     getDetail(item) {
+      console.log(item);
       uni.navigateTo({
-        url: `/pages/index/detail?item=${encodeURIComponent(JSON.stringify(item))}`,
+        url: `/pages/index/list?title=${item.name}&id=${item.id}`,
       })
     }
   }

+ 123 - 0
src/pages/index/list.vue

@@ -0,0 +1,123 @@
+<template>
+  <view>
+    <uni-nav-bar :title="title" leftIcon="left" @clickLeft="getBack" />
+    <view class="title">Android安装包</view>
+    <view class="list" v-for="item in form.android" :key="item.id" @click="getDetail(item)">
+      <view class="left">
+        <img :src="item.icon">
+        <view class="main">
+          <text>{{ item.name }}</text>
+          <text>{{ item.updateTimeText }} 更新 | {{ item.version }}</text>
+        </view>
+      </view>
+      <a :href="item.downUrl">安装</a>
+    </view>
+    <view class="title">IOS安装包</view>
+    <view class="list" v-for="item in form.ios" :key="item.id">
+      <view class="left">
+        <img :src="item.icon">
+        <view class="main">
+          <text>{{ item.name }}</text>
+          <text>{{ item.updateTimeText }} 更新 | {{ item.version }}</text>
+        </view>
+      </view>
+      <a :href="item.downUrl">安装</a>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      title: '',
+      form: {}
+    }
+  },
+  onLoad(e) {
+    this.title = e.title
+    uni.request({
+      url: 'https://o3tapi.radio1964.com/device/project/update/group',
+      method: 'get',
+      data: {
+        projectId: e.id
+      },
+      success: (res) => {
+        this.form = res.data.data
+      }
+    });
+  },
+  methods: {
+    getBack() {
+      uni.redirectTo({
+        url: `/pages/index/index`
+      })
+    },
+    getDetail(item) {
+      uni.navigateTo({
+        url: `/pages/index/detail?projectId=${item.projectId}`
+      });
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .uni-navbar__header-container {
+  font-weight: bold;
+}
+
+::v-deep .uni-nav-bar-text {
+  font-size: 32rpx;
+}
+
+.title {
+  padding: 28rpx 20rpx;
+  font-size: 28rpx;
+}
+
+.list {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 28rpx 20rpx;
+  background: #fff;
+  border-bottom: 2rpx solid #eee;
+
+  .left {
+    display: flex;
+
+    img {
+      width: 100rpx;
+      height: 100rpx;
+      border-radius: 20rpx;
+      margin-right: 20rpx;
+    }
+
+    .main {
+      display: flex;
+      flex-direction: column;
+      justify-content: space-around;
+
+      text:first-child {
+        font-size: 28rpx;
+      }
+
+      text:last-child {
+        font-size: 22rpx;
+      }
+    }
+  }
+
+  a {
+    margin: 0;
+    background: none;
+    border: 2rpx solid #f80;
+    padding: 10rpx 30rpx;
+    font-size: 24rpx;
+    color: #f80;
+    border-radius: 10rpx;
+    text-decoration: none;
+  }
+}
+</style>

BIN
src/static/logo.png