From b628d9eaed3de37e7e59d0fe47dd12b58a952f0e Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期二, 21 三月 2023 16:31:46 +0800
Subject: [PATCH] 用户聊天头像修改
---
miniprogram/pages/user/index.ts | 88 +++++++++++++++++++++++++++++--------------
1 files changed, 59 insertions(+), 29 deletions(-)
diff --git a/miniprogram/pages/user/index.ts b/miniprogram/pages/user/index.ts
index 92ebeb6..284c23d 100644
--- a/miniprogram/pages/user/index.ts
+++ b/miniprogram/pages/user/index.ts
@@ -4,9 +4,11 @@
Page({
data: {
+ swcurrent: 0,
isShow: false,
userInfo: {},
- causeList:[]
+ causeList: [],
+ images: []
},
// 浜嬩欢澶勭悊鍑芥暟
bindViewTap() {
@@ -17,53 +19,81 @@
onLoad() {
- wx.request(
- {
- url:user.globalData.url+"/publicity?size="+"4",
- method:"GET",
- header:{'token':wx.getStorageSync('token')},
- success:(res)=>{
- this.setData({
- causeList:res.data.data.records
- })
- console.log(this.data.causeList)
- }
- })
+ wx.request({
+ url: user.globalData.url+"/wx/login",
+ data: {
+ "phone": wx.getStorageSync('phone'),
+ },
+ method: "GET",
+ success: (res) => {
+ console.log(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)
+
+ wx.request(
+ {
+ url: user.globalData.url + "/wx/publicity?size=" + "4",
+ 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 => user.globalData.imageUrl + "/img/" + i),
+ this.data.images = i.photoStr
+ }
+ })
+ this.setData({
+ causeList: res.data.data,
+ })
+
+
+ }
+ })
+ }})
+ if (wx.getStorageSync('info') == '') {
+ wx.redirectTo({
+ url: '../user/loginInfo/index'
+ })
+ }
+
},
getReport() {
console.log("xxx")
wx.navigateTo({
url: '../user/report/index'
})
- }
- ,getPublicty(){
+ },
+ getPublicty() {
console.log("publicty")
wx.navigateTo({
- url:'../user/pubulicty/index'
+ url: '../user/pubulicty/index'
})
-
- }
- ,getGroup(){
+ },
+ getGroup() {
console.log("group")
wx.navigateTo({
- url:'../user/group/index'
- })}
- ,getCause(){
+ url: '../user/group/index'
+ })
+ },
+ getCause() {
console.log("cause")
wx.navigateTo({
- url:'../manager/cause/index'
+ url: '../manager/cause/index'
})
- }
- ,getAudi(){
+ },
+ getAudi() {
console.log("myself")
wx.navigateTo({
- url:'../user/myself/index'
+ url: '../user/myself/index'
})
- }
- ,more(){
+ },
+ more() {
console.log("myself")
wx.navigateTo({
- url:'../user/pubulicty/index'
+ url: '../user/pubulicty/index'
})
}
})
--
Gitblit v1.8.0