From ac41263c85bb295bd0dcb286173986bc88d7e4ae Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期三, 12 四月 2023 10:43:52 +0800
Subject: [PATCH] 修改禁言

---
 miniprogram/pages/user/index.ts |  113 +++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 90 insertions(+), 23 deletions(-)

diff --git a/miniprogram/pages/user/index.ts b/miniprogram/pages/user/index.ts
index 4c62a6f..2d56001 100644
--- a/miniprogram/pages/user/index.ts
+++ b/miniprogram/pages/user/index.ts
@@ -4,6 +4,9 @@
 
 Page({
     data: {
+        videoheight:'',
+        autoplay:true,
+        role:0,
         swcurrent: 0,
         isShow: false,
         userInfo: {},
@@ -16,37 +19,101 @@
             url: '../logs/logs',
         })
     },
-
+    resizeVideo(e){
+        console.log(e);
+        this.setData({
+            videoheight:e.detail.height
+        })
+    },
 
     onLoad() {
-        if (wx.getStorageSync('info') == '') {
-            wx.redirectTo({
-                url: '../user/loginInfo/index'
-            })
-        }
-        wx.request(
-            {
-                url: user.globalData.url + "/wx/publicity?size=" + "4",
-                method: "GET",
-                header: { 'token': wx.getStorageSync('token') },
-                success: (res) => {
+     
+        wx.request({
+            url: user.globalData.url+"/wx/login",
+            data: {
+                "phone": wx.getStorageSync('phone'),
+            },
+            method: "GET",
+            success: (res) => {
+                wx.setStorageSync('token', res.data.data.token)
+                wx.setStorageSync('role', res.data.data.role)
+                wx.setStorageSync('id', res.data.data.id)
+                wx.setStorageSync('card',res.data.data.time)
 
-                    res.data.data.map(i => {
-                        if (i.photoStr != null) {
-                            i.photoStr = i.photoStr.split(",").map(i => user.globalData.imageUrl + "/img/" + i),
-                                this.data.images = i.photoStr
+                wx.request(
+                    {
+                        url: user.globalData.url + "/wx/publicity?size=" + "4",
+                        method: "GET",
+                        header: { 'token': wx.getStorageSync('token') },
+                        success: (res) => {
+                            this.setData({
+                                role:wx.getStorageSync('role')
+                            })
+                            
+                            res.data.data.map(i => {
+                                let imgarr=[]
+                                if (i.photoStr != null) {
+                                    
+                                    i.photoStr = i.photoStr.split(",").map(i => user.globalData.imageUrl + "/img/" + i),
+                                        this.data.images = i.photoStr
+                                        i.photoStr.map(j=>{
+                                            let type=j.substring(j.lastIndexOf(".")+1)
+
+                                           
+                                            let obj={
+                                                url: j,
+                                                type:'png'
+                                             }
+                                             if (type=='mp4') {
+                                                obj.type = 'mp4'
+                                            }else{
+                                                obj.type = 'png'
+                                            }
+                                            imgarr.push(obj)
+                                        })
+                                        i.imagarr=imgarr
+                                }
+
+                                i.releaseTime = i.releaseTime.replace(/-/g,"/")
+                            })
+                            this.setData({
+                                causeList: res.data.data,
+                            })
+                                console.log(this.data.causeList);
+                                
+        
                         }
                     })
-                    this.setData({
-                        causeList: res.data.data,
-                    })
-
-
-                }
+               }})
+        if (wx.getStorageSync('info') == '') {
+            wx.redirectTo({
+                url: "pages/user/index"
             })
+        }
+    
+        
+       
+    },
+    videoplay(e){
+        console.log(e);
+        
+        this.setData({
+            autoplay:false
+        })
+    },
+    toDetailedInformation(){
+        console.log('鎶ユ璇︽儏');
+        wx.navigateTo({
+                    url: '/pages/manager/report/index'
+                })
+    },
+    toManage(){
+        console.log('妗堜欢绠$悊');
+                wx.navigateTo({
+                            url: '/pages/manager/cause/index'
+                        })
     },
     getReport() {
-        console.log("xxx")
         wx.navigateTo({
             url: '../user/report/index'
         })

--
Gitblit v1.8.0