chenrong пре 1 година
родитељ
комит
68cdf751c7

+ 1 - 1
src/views/create/index.vue

@@ -90,7 +90,7 @@
                   v-model="form.characterIntroduction" 
                   type="textarea"
                   :autosize="{ minRows: 4, maxRows: 4}"
-                  placeholder="通过设置机器人的指令和反馈,机器人在玩家互动时即时回复,增强玩家的互动,有什么较好的指令。我们会对指令的使用情况进行了解,确保指令的正常使用。"
+                  placeholder="请在此处提供该角色的背景资讯。 使用'{char}'來指代您的角色。 例如:{char}是一个从小娇生惯养的大小姐。"
                 ></el-input>
               </el-form-item>
               <el-collapse class="collapse">

+ 70 - 14
src/views/homeComponents/HomePC.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="home bg-white px-28">
-    <div class=" text-3xl font-semibold pt-12 px-2 pb-6">
-      发现
-    </div>
-    <div class="min-h-screen">
+  <div class="home bg-white px-28 h-full flex flex-col">
+    <div class="top" ref="top">
+      <div class=" text-3xl font-semibold pt-12 px-2 pb-6">
+        发现
+      </div>
       <div class="flex">
         <div class="flex flex-wrap w-9/12">
           <div 
@@ -36,6 +36,11 @@
           />
         </div>
       </div>
+    </div>
+    <div class="lietRom flex-1 overflow-auto" 
+      v-infinite-scroll="load"
+      infinite-scroll-disabled="disabled"
+    >
       <div class="list mt-4">
         <div
           v-for="(item, index) in characterList"
@@ -51,7 +56,6 @@
             <p class="prologue text-sm">
               {{ item.prologue }}
             </p>
-
             <div class="labels flex my-1 flex-wrap">
               <div v-for="(item2, index2) in item.labelArr" :key="index2" class="m-0.5 tag px-2 py-1 rounded flex items-center text-xs text-gray-500">
                 <!-- <i class="fas fa-smile text-yellow-400 mr-2"></i> -->
@@ -80,7 +84,21 @@
           </div>
         </div>
       </div>
+      <p class="w-full py-4 text-gray-400 text-center" v-if="loading">加载中...</p>
+      <p class="w-full py-4 text-gray-400 text-center" v-if="noMore">没有更多了</p>
     </div>
+    
+    
+    <!-- <div class="my-4 flex justify-center">
+      <el-pagination
+        background
+        @current-change="handleCurrentChange"
+        :current-page.sync="query.pageNum"
+        :page-size="10"
+        layout="total, prev, pager, next"
+        :total="total">
+      </el-pagination>
+    </div> -->
   </div>
 </template>
 
@@ -100,6 +118,13 @@ export default {
   },
   data() {
     return {
+      query: {
+        pageSize: 10,
+        pageNum: 1
+      },
+      total: 0,
+      loading: false,
+      noMore: false,
       historys: [],
       labelLength: 8,
       searchName: '',
@@ -115,6 +140,11 @@ export default {
       ]
     }
   },
+  computed: {
+    disabled () {
+      return this.loading || this.noMore
+    }
+  },
   mounted() {
     // 获取标签
     this.getLabelList()
@@ -122,6 +152,10 @@ export default {
     this.getCharacterList()
   },
   methods: {
+    load() {
+      this.query.pageNum += 1
+      this.getCharacterList()
+    },
     Enterkey(e) {
       if (e.keyCode == 13) {
         this.searchChange()
@@ -133,6 +167,8 @@ export default {
         characterName: this.searchName,
         labelId: this.selectLabel
       }
+      this.query.pageNum = 1
+      this.characterList = []
       this.getCharacterList(query)
     },
     searchChange() {
@@ -140,6 +176,8 @@ export default {
         characterName: this.searchName,
         labelId: this.selectLabel
       }
+      this.query.pageNum = 1
+      this.characterList = []
       this.getCharacterList(query)
     },
     getLabelList() {
@@ -153,10 +191,8 @@ export default {
       })
     },
     getCharacterList(query) {
-      let params = {
-        pageSize: 20,
-        pageNum: 1
-      }
+      this.loading = true
+      let params = this.query
       if (query) {
         params = {
           ...params,
@@ -164,10 +200,21 @@ export default {
         }
       }
       characterListApi(params).then(res => {
-        // console.log(res, '角色列表');
-        this.characterList = res.rows
+        // console.log(res, '角色列表');\
+        if (res.rows.length == 0) {
+          this.noMore = true
+        }
+        // this.characterList = res.rows
+        this.characterList = [...this.characterList, ...res.rows]
+        this.total = res.total
+        this.loading = false
       })
     },
+    handleCurrentChange() {
+      this.query.pageNum = 1
+      this.characterList = []
+      this.getCharacterList()
+    },
     clickLabel(item) {
       this.selectLabel = []
       let index = this.selectLabel.indexOf(item.id)
@@ -182,6 +229,8 @@ export default {
         characterName: this.searchName,
         labelId: this.selectLabel
       }
+      this.query.pageNum = 1
+      this.characterList = []
       this.getCharacterList(query)
     },
     clearSelectLabel() {
@@ -191,6 +240,8 @@ export default {
         characterName: this.searchName,
         labelId: this.selectLabel
       }
+      this.query.pageNum = 1
+      this.characterList = []
       this.getCharacterList(query)
     },
     toDetail(item) {
@@ -295,8 +346,7 @@ export default {
   background: #ffffff0f; 
   border: 1px solid #ffffff2e;
   height: 35vw;
-  min-height: 480px;
-  max-height: 500px;
+  height: 480px;
 }
 .box2:hover {
   border: solid 1px var(--bg-color1);
@@ -370,4 +420,10 @@ export default {
   grid-auto-rows: minmax(480px, auto);
   grid-gap: 20px;
 }
+.lietRom {
+  padding: 5px;
+}
+.lietRom::-webkit-scrollbar {
+  display: none;
+}
 </style>

+ 31 - 7
src/views/profile/index.vue

@@ -95,11 +95,29 @@
               <v-icon name="fire" scale="1"/>
               <span class="ml-1">{{ item.hotCount||0 }}</span>
             </div>
-
           </div>
         </div>
       </div>
     </div>
+    <el-dialog
+      title="提示"
+      :visible.sync="dialogVisible"
+      width="30%"
+    >
+      <div class="flex justify-between px-2 py-3 border-b border-gray-200">
+        <div>角色</div>
+        <div>{{ selectObj.name }}</div>
+      </div>
+      <div class="flex justify-between px-2 py-3 border-b border-gray-200">
+        <div>角色</div>
+        <div>{{ selectObj.name }}</div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="toChat">聊 天</el-button>
+        <el-button type="primary">编 辑</el-button>
+      </span>
+    </el-dialog>
+    
   </div>
 </template>
 
@@ -110,6 +128,8 @@ import 'vue-awesome/icons/fire'
 export default {
   data() {
     return {
+      dialogVisible: false,
+      selectObj: {},
       active: 0,
       characterList: []
     }
@@ -118,16 +138,20 @@ export default {
     this.getCharacterList()
   },
   methods: {
-    
     toDetail(item) {
+      console.log(item, 'item');
+      this.selectObj = item
+      this.dialogVisible = true
+    },
+    toChat() {
       let query = {}
-      if (item.scene == 0) {
+      if (this.selectObj.scene == 0) {
         // 点击是角色
-        query.characterId = item.id
-      } else if (item.scene == 1) {
+        query.characterId = this.selectObj.id
+      } else if (this.selectObj.scene == 1) {
         // 点击是场景
-        query.characterId = item.characterId
-        query.sceneId = item.id
+        query.characterId = this.selectObj.characterId
+        query.sceneId = this.selectObj.id
       }
       this.$router.push({
         path: '/chat',

+ 17 - 0
src/views/user/components/userInfo.vue

@@ -0,0 +1,17 @@
+<template>
+  <div class="user-info py-10 px-20 w-full h-full">
+    <div class=" text-xl mb-4">用户信息</div>
+    <div class=" w-full rounded-lg ">
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 7 - 2
src/views/user/index.vue

@@ -60,13 +60,18 @@
         v1.8.1
       </div>
     </div>
-    <div class=" flex-1 h-full bg-gray-50"></div>
+    <div class=" flex-1 h-full bg-gray-50">
+      <UserInfo />
+    </div>
   </div>
 </template>
 
 <script>
-
+import UserInfo from "./components/userInfo.vue"
 export default {
+  components: {
+    UserInfo
+  },
   data() {
     return {
       active: '1',