0225172 4 meses atrás
pai
commit
b902d4e106

+ 9 - 9
package-lock.json

@@ -23,7 +23,7 @@
         "@capacitor/status-bar": "6.0.0",
         "@ionic/angular": "^8.0.0",
         "ionicons": "^7.0.0",
-        "parse": "^5.2.0",
+        "parse": "^5.3.0",
         "rxjs": "~7.8.0",
         "swiper": "^11.1.4",
         "tslib": "^2.3.0",
@@ -2526,9 +2526,9 @@
       }
     },
     "node_modules/@babel/runtime-corejs3": {
-      "version": "7.24.6",
-      "resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.24.6.tgz",
-      "integrity": "sha512-tbC3o8uHK9xMgMsvUm9qGqxVpbv6yborMBLbDteHIc7JDNHsTV0vDMQ5j1O1NXvO+BDELtL9KgoWYaUVIVGt8w==",
+      "version": "7.24.7",
+      "resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.24.7.tgz",
+      "integrity": "sha512-eytSX6JLBY6PVAeQa2bFlDx/7Mmln/gaEpsit5a3WEvjGfiIytEsgAwuIXCPM0xvw0v0cJn3ilq0/TvXrW0kgA==",
       "dependencies": {
         "core-js-pure": "^3.30.2",
         "regenerator-runtime": "^0.14.0"
@@ -13428,11 +13428,11 @@
       }
     },
     "node_modules/parse": {
-      "version": "5.2.0",
-      "resolved": "https://registry.npmmirror.com/parse/-/parse-5.2.0.tgz",
-      "integrity": "sha512-FoD3kcLAQCw/2J1984sl3GUBzbHE2tA9mUcyw/EBWZ46WVZTzV+kjnA5tttXyzN4uodt21wSluzjbGnyLqreKw==",
+      "version": "5.3.0",
+      "resolved": "https://registry.npmmirror.com/parse/-/parse-5.3.0.tgz",
+      "integrity": "sha512-mWBnE6hHJhdvlx5KPQcYgCGRdgqKhPw+5fSC0j7vOfse3Lkh3xtDwOfmDpvv2LXZVBj72G/mgVKMRmbAICRzkQ==",
       "dependencies": {
-        "@babel/runtime-corejs3": "7.24.6",
+        "@babel/runtime-corejs3": "7.24.7",
         "idb-keyval": "6.2.1",
         "react-native-crypto-js": "1.0.0",
         "uuid": "10.0.0",
@@ -13440,7 +13440,7 @@
         "xmlhttprequest": "1.8.0"
       },
       "engines": {
-        "node": ">=18 <21"
+        "node": "18 || 19 || 20 || 22"
       },
       "optionalDependencies": {
         "crypto-js": "4.2.0"

+ 1 - 1
package.json

@@ -28,7 +28,7 @@
     "@capacitor/status-bar": "6.0.0",
     "@ionic/angular": "^8.0.0",
     "ionicons": "^7.0.0",
-    "parse": "^5.2.0",
+    "parse": "^5.3.0",
     "rxjs": "~7.8.0",
     "swiper": "^11.1.4",
     "tslib": "^2.3.0",

+ 0 - 10
src/app/contact/contact.page.ts

@@ -11,16 +11,6 @@ Parse.serverURL = "http://web2023.fmode.cn:9999/parse"; // 设置serverURL
 })
 export class ContactPage implements OnInit {
 
-  // cards = [
-  //   { title: '云南攻略交流群', description: '云南,多彩风情之地。雄奇的梯田、神秘的石林、壮丽的峡谷、古朴的古镇,处处皆景。品尝鲜美的过桥米线、体验原生态茶园、感受多元文化交融。' },
-  //   { title: '贵州攻略交流群', description: '云南,多彩风情之地。雄奇的梯田、神秘的石林、壮丽的峡谷、古朴的古镇,处处皆景。品尝鲜美的过桥米线、体验原生态茶园、感受多元文化交融。' },
-  //   { title: '贵州攻略交流群', description: '云南,多彩风情之地。雄奇的梯田、神秘的石林、壮丽的峡谷、古朴的古镇,处处皆景。品尝鲜美的过桥米线、体验原生态茶园、感受多元文化交融。' },
-  //   { title: '贵州攻略交流群', description: '云南,多彩风情之地。雄奇的梯田、神秘的石林、壮丽的峡谷、古朴的古镇,处处皆景。品尝鲜美的过桥米线、体验原生态茶园、感受多元文化交融。' },
-  //   { title: '贵州攻略交流群', description: '云南,多彩风情之地。雄奇的梯田、神秘的石林、壮丽的峡谷、古朴的古镇,处处皆景。品尝鲜美的过桥米线、体验原生态茶园、感受多元文化交融。' },
-    // 可以添加更多卡片数据
-  // ];
-
-
   constructor() { }
 
   ngOnInit() {

+ 6 - 8
src/app/tab3/tab3.page.html

@@ -78,19 +78,17 @@
       </ion-segment-button>
     </ion-segment>
   
-    <div *ngIf="currentTab === 'unpublished'">
+    <ion-card *ngIf="currentTab === 'unpublished'">
       <img src="https://gd-hbimg.huaban.com/068da346d1fbca8edd952fb7e77b0eb0468ac03512a0f-Rm3mAD_fw658webp" class="img-center" style="width: 300px; height: 300px;">
       <div class="center-text">
-        <h1>暂无内容</h1>
+        暂无内容
       </div>
-    </div>
+    </ion-card>
   
-    <div *ngIf="currentTab === 'published'">
+    <ion-card  *ngIf="currentTab === 'published'">
       <img src="https://gd-hbimg.huaban.com/068da346d1fbca8edd952fb7e77b0eb0468ac03512a0f-Rm3mAD_fw658webp" class="img-center" style="width: 300px; height: 300px;">
-      <div class="center-text">
-        <h1>暂无内容</h1>
-      </div>
-    </div>
+      <ion-card class="center-text">暂无内容</ion-card>
+    </ion-card>
   
     <div *ngIf="currentTab === 'liked'">
       <div class="center-text">

+ 14 - 0
src/app/tab3/tab3.page.ts

@@ -1,6 +1,9 @@
 import { Component, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
+// 引用Parse JS SDK
 import Parse from "parse";
+Parse.initialize("dev"); // 设置applicationId
+Parse.serverURL = "http://web2023.fmode.cn:9999/parse"; // 设置serverURL
 @Component({
   selector: 'app-tab3',
   templateUrl: 'tab3.page.html',
@@ -41,6 +44,7 @@ export class Tab3Page implements OnInit{
       setInterval(async ()=>{
       this.user = await Parse.User.current()
     },1000)
+    this.loadPets()
   }
   logout(){
     Parse.User.logOut();
@@ -53,4 +57,14 @@ export class Tab3Page implements OnInit{
  navigateToCreatePage() {
   this.router.navigate(['/tab3/tab3-create']);
   }
+
+   
+    
+      
+    InputContentsList:Array<Parse.Object> = []
+    async loadPets(){
+    let query = new Parse.Query("CreatContents");
+    let list = await query.find();
+    this.InputContentsList = list
+    }
 }

+ 4 - 2
src/modules/page/tab3-create/tab3-create.page.html

@@ -15,8 +15,10 @@
   </ion-header>
 
   <div>
-    <ion-textarea placeholder="填写标题更容易被推荐哦" rows="6"></ion-textarea>
-    <ion-textarea placeholder="来记录你的旅途吧" rows="20"></ion-textarea>
+    <ion-textarea placeholder="填写标题更容易被推荐哦" rows="6" 
+    [(ngModel)]="title"></ion-textarea>
+    <ion-textarea placeholder="来记录你的旅途吧" rows="20" [(ngModel)]="contents">
+    </ion-textarea>
     
     <ion-button (click)="saveDraft()" expand="full">存草稿</ion-button>
     <ion-button (click)="publish()" expand="full">发布</ion-button>

+ 36 - 3
src/modules/page/tab3-create/tab3-create.page.ts

@@ -1,7 +1,9 @@
 import { Component, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
 import { ToastController } from '@ionic/angular';
-
+import Parse from "parse";
+Parse.initialize("dev"); // 设置applicationId
+Parse.serverURL = "http://web2023.fmode.cn:9999/parse"; // 设置
 @Component({
   selector: 'app-tab3-create',
   templateUrl: './tab3-create.page.html',
@@ -29,7 +31,38 @@ export class Tab3CreatePage implements OnInit {
     });
     toast.present();
   }
-  ngOnInit() {
-  }
+  
+
+  ngOnInit(){
 
+  }
+  title: string="";
+  contents: string="";
+  async register(){
+    let user = new Parse.User()
+    user.set("title",this.title)
+    user.set("contents",this.contents)
+    try {
+      let result = await user.signUp();
+      console.log(result)
+      // if(result?.id){
+      //   this.navCtrl.back()
+      // }
+      // Hooray! Let them use the app now.
+  } catch (error:any) {
+      // 新增提示词详情,根据Parse.User.signUp方法返回的不同英文提示词,增加对应的中文内容转换
+      // let message:string = ""
+      // if(error?.message.indexOf("already exists")>-1){
+      //   message = "该账号已存在请修改后重试"
+      // }
+      // if(error?.message.indexOf("empty")>-1){
+      //   message = "账号不能为空请输入后重试"
+      // }
+      // this.presentAlert({
+      //   header:"注册失败",
+      //   subHeader:"状态码:"+error.code,
+      //   message:message || error.message
+      // })
+    }
+  }
 }