From 3fea9f0720e7751e4737ded74b3aa89db273688d Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期日, 28 九月 2025 17:55:11 +0800
Subject: [PATCH] 用户行为分析
---
pages/mine/set/personMsg.vue | 122 +++++++++++++++++++++++++++++-----------
1 files changed, 89 insertions(+), 33 deletions(-)
diff --git a/pages/mine/set/personMsg.vue b/pages/mine/set/personMsg.vue
index 613338b..16543c8 100644
--- a/pages/mine/set/personMsg.vue
+++ b/pages/mine/set/personMsg.vue
@@ -1,14 +1,16 @@
<template>
<view class="person-msg">
- <view class="head c-content" @click="changeFace">
+ <view class="head c-content">
<image v-if="form.face" :src="endpoint + '/' + form.face" mode=""></image>
<image v-else :src="'/pages/subComponents/static/missing-face.png'" mode=""></image>
- <view>鐐瑰嚮淇敼澶村儚</view>
+ <button class="avatar-button" type="default" open-type="chooseAvatar"聽@chooseavatar="onChooseAvatar">鐐瑰嚮淇敼澶村儚</button>
</view>
<u-form :model="form" ref="uForm" class="form">
<u-form-item label="鏄电О" label-width="150">
- <u-input v-model="form.nickName" placeholder="璇疯緭鍏ユ樀绉�" />
+ <u-input v-model="form.nickName" placeholder="璇疯緭鍏ユ樀绉�" type="nickname"/>
+
</u-form-item>
+
<u-form-item label="鎬у埆" label-width="150">
<u-radio-group v-model="form.sex" :active-color="lightColor">
<u-radio name="1">鐢�</u-radio>
@@ -122,11 +124,25 @@
showBirthday: false, //鏄剧ず鐢熸棩鏃ユ湡
};
},
+ onShow() {
+ this.form = {
+ nickName: storage.getUserInfo().nickName || "",
+ birthday: storage.getUserInfo().birthday || "",
+ face: storage.getUserInfo().face, //榛樿澶村儚
+ regionId: [], //鍦板潃Id
+ region: storage.getUserInfo().region || [], //鍦板潃
+ sex: storage.getUserInfo().sex, //鎬у埆
+ ___path: storage.getUserInfo().region,
+ mobile: storage.getUserInfo().mobile,
+ username: storage.getUserInfo().username,
+ }
+ },
onLoad() {
this.initCOS()
this.getMemberTag()
},
methods: {
+
toggleTag(tag) {
console.log(tag)
},
@@ -278,39 +294,67 @@
}
});
},
-
+ /**
+ * 淇敼澶村儚
+ * @param {Object} e
+ */
+ onChooseAvatar(e){
+ console.log(e.detail.avatarUrl)
+ console.log("")
+ console.log(e.detail)
+ const tempFilePath = e.detail.avatarUrl;
+ let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
+ if (fileName.indexOf('%') > -1) {
+ fileName = decodeURIComponent(fileName);
+ }
+ const fileKey = getFileKey(fileName);
+ this.cosClient.uploadFile({
+ Bucket: this.bucket,
+ Region: this.region,
+ Key: fileKey,
+ FilePath: tempFilePath,
+ SliceSize: 1024 * 1024 * 5 /* 瑙﹀彂鍒嗗潡涓婁紶鐨勯槇鍊�,5M */
+ }, (err, data) => {
+ if (err) {
+ console.log('涓婁紶澶辫触', err);
+ } else {
+ this.form.face = fileKey;
+ }
+ });
+ },
/**
* 淇敼澶村儚
*/
- changeFace(index) {
- uni.chooseImage({
- count: 1,
- sizeType: ['compressed'],
- sourceType: ['album'],
- success: (chooseImageRes) => {
- const tempFilePath = chooseImageRes.tempFilePaths[0];
- let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
- // 澶勭悊瀹夊崜鍙兘鐨刄RI缂栫爜
- if (fileName.indexOf('%') > -1) {
- fileName = decodeURIComponent(fileName);
- }
- const fileKey = getFileKey(fileName);
- this.cosClient.uploadFile({
- Bucket: this.bucket,
- Region: this.region,
- Key: fileKey,
- FilePath: tempFilePath,
- SliceSize: 1024 * 1024 * 5 /* 瑙﹀彂鍒嗗潡涓婁紶鐨勯槇鍊�,5M */
- }, (err, data) => {
- if (err) {
- console.log('涓婁紶澶辫触', err);
- } else {
- this.form.face = fileKey;
- }
- });
- },
- });
- },
+ // changeFace(index) {
+ // uni.chooseImage({
+ // count: 1,
+ // sizeType: ['compressed'],
+ // sourceType: ['album'],
+ // success: (chooseImageRes) => {
+
+ // const tempFilePath = chooseImageRes.tempFilePaths[0];
+ // let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
+ // // 澶勭悊瀹夊崜鍙兘鐨刄RI缂栫爜
+ // if (fileName.indexOf('%') > -1) {
+ // fileName = decodeURIComponent(fileName);
+ // }
+ // const fileKey = getFileKey(fileName);
+ // this.cosClient.uploadFile({
+ // Bucket: this.bucket,
+ // Region: this.region,
+ // Key: fileKey,
+ // FilePath: tempFilePath,
+ // SliceSize: 1024 * 1024 * 5 /* 瑙﹀彂鍒嗗潡涓婁紶鐨勯槇鍊�,5M */
+ // }, (err, data) => {
+ // if (err) {
+ // console.log('涓婁紶澶辫触', err);
+ // } else {
+ // this.form.face = fileKey;
+ // }
+ // });
+ // },
+ // });
+ // },
/**
* 閫夋嫨鍦板潃
@@ -497,4 +541,16 @@
color: #999;
font-size: 24rpx;
}
+ .avatar-button {
+ background: transparent;
+ color: $font-color-light;
+ font-size: $font-sm;
+ line-height: 2em;
+ margin: 0;
+ padding: 0;
+ border: none;
+ &::after {
+ border: none;
+ }
+ }
</style>
\ No newline at end of file
--
Gitblit v1.8.0