From 4139482e75000140f6e28a95c550e76620b88a60 Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期三, 12 四月 2023 10:06:17 +0800
Subject: [PATCH] 首页修改
---
miniprogram/pages/user/index.ts | 53 +++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/miniprogram/pages/user/index.ts b/miniprogram/pages/user/index.ts
index 03ea24f..2d56001 100644
--- a/miniprogram/pages/user/index.ts
+++ b/miniprogram/pages/user/index.ts
@@ -4,7 +4,9 @@
Page({
data: {
- role:'',
+ videoheight:'',
+ autoplay:true,
+ role:0,
swcurrent: 0,
isShow: false,
userInfo: {},
@@ -17,13 +19,15 @@
url: '../logs/logs',
})
},
-
+ resizeVideo(e){
+ console.log(e);
+ this.setData({
+ videoheight:e.detail.height
+ })
+ },
onLoad() {
- this.setData({
- role:wx.getStorageSync('role')
- })
-
+
wx.request({
url: user.globalData.url+"/wx/login",
data: {
@@ -42,17 +46,41 @@
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);
+
}
})
@@ -62,8 +90,17 @@
url: "pages/user/index"
})
}
+
+
},
+ videoplay(e){
+ console.log(e);
+
+ this.setData({
+ autoplay:false
+ })
+ },
toDetailedInformation(){
console.log('鎶ユ璇︽儏');
wx.navigateTo({
--
Gitblit v1.8.0