From f68f67f34857085d627cc2acdcfe714eb8bbdcb5 Mon Sep 17 00:00:00 2001
From: 安瑾然 <m17681517455@outlook.com>
Date: 星期四, 23 三月 2023 13:58:11 +0800
Subject: [PATCH] 图片预览

---
 miniprogram/pages/user/pubulicty/index.ts |   88 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 76 insertions(+), 12 deletions(-)

diff --git a/miniprogram/pages/user/pubulicty/index.ts b/miniprogram/pages/user/pubulicty/index.ts
index 2b71296..a3db613 100644
--- a/miniprogram/pages/user/pubulicty/index.ts
+++ b/miniprogram/pages/user/pubulicty/index.ts
@@ -3,23 +3,87 @@
 const userCause = getApp()
 
 Page({
-  data: {
-    causeList:[],
-    isShow:false
-  },
-  // 浜嬩欢澶勭悊鍑芥暟
-  onLoad() {
-    wx.request(  
+    data: {
+        cardFig:true,
+        swcurrent: 0,
+        causeList: [],
+        isShow: false
+    },
+    register(e){
+        console.log(e);
+        
+    },
+    getMobile(){
+     // 鑾峰彇鎵嬫満鍙�
+     wx.request(  
         {
-          url:userCause.globalData.url+"/publicity",
+          url:userCause.globalData.url+  "/wx/user/myself",
           method:"GET",
+          data:{
+              id:wx.getStorageSync('id')
+          },
           header:{'token':wx.getStorageSync('token')},
           success:(res)=>{
-              this.setData({
-                causeList:res.data.data.records
-              })
-              console.log(this.data.causeList)
+              console.log(res)
+            if (res.data.data.userMobile) {
+                this.getUserRegister(res.data.data.userMobile)
+            }
           }
               })
+  
+    },
+    // 閫氳繃鎵嬫満鍙锋煡璇㈡槸鍚︽槸宸叉敞鍐岀敤鎴�
+    getUserRegister(phone){
+        wx.request(  
+            {
+              url:userCause.globalData.url+  "/wx/isExist",
+              method:"GET",
+              data:{
+                phone:phone
+              },
+              header:{'token':wx.getStorageSync('token')},
+              success:(res)=>{
+                  console.log(res)
+               
+                     }
+                  })
+    },
+    // 浜嬩欢澶勭悊鍑芥暟
+    onLoad() {
+        if (wx.getStorageSync('token')) {
+            this.setData({
+                cardFig:false
+            })
+        }
+        // this.getMobile()
+        // let  info=wx.getStorageSync('card')
+        // console.log(info);
+        
+        //                     if (info) {
+        //                       this.setData({
+        //                           cardFig :false
+        //                       })
+        //                     }else{
+        //                         this.setData({
+        //                             cardFig :true
+        //                         })
+        //                     }
+        wx.request(
+            {
+                url: userCause.globalData.url + "/wx/publicity",
+                method: "GET",
+                // header: { 'token': wx.getStorageSync('token') },
+                success: (res) => {
+                    res.data.data.map(i => {
+                        if (i.photoStr != null) {
+                            i.photoStr = i.photoStr.split(",").map(i => userCause.globalData.imageUrl + "/img/" + i),
+                                this.data.images = i.photoStr
+                        }
+                    })
+                    this.setData({
+                        causeList: res.data.data
+                    })
+                }
+            })
     }
 })

--
Gitblit v1.8.0