浏览代码

登录和user_id

ck@123911.net 1 周之前
父节点
当前提交
61f69f2876
共有 2 个文件被更改,包括 1106 次插入1082 次删除
  1. 562 552
      pages/login/login.vue
  2. 544 530
      pages/my/my.vue

+ 562 - 552
pages/login/login.vue

@@ -46,7 +46,7 @@
 						<view class="item">
 							<input type="number" class="input" v-model="code" placeholder="请输入验证码" maxlength="6" />
 							<view class="btn blick-btn-animation" v-if="captchaTime === 0" @click="getCode">获取验证码</view>
-							 <!-- 使用云函数发送验证码 -->
+							<!-- 使用云函数发送验证码 -->
 							<!-- <view class="btn blick-btn-animation" v-if="captchaTime === 0" @click="sendSms()">获取验证码</view> -->
 							<view class="btn" v-if="captchaTime > 0">{{ captchaTime }}秒后重试</view>
 						</view>
@@ -56,7 +56,7 @@
 						</view>
 					</block>
 					<text class="btn_submit  white" @click="toLogin">登录/注册</text>
-					<text class="btn_submit blick-btn-animation" @click="oneClickLoginFun">一键登录</text> 
+					<text class="btn_submit blick-btn-animation" @click="oneClickLoginFun">一键登录</text>
 				</template>
 				<template v-else>
 					<view
@@ -94,624 +94,634 @@
 </template>
 
 <script>
-import pubc from '@/common/public.js'
-import { mapState } from 'vuex'
-import channel from "@/common/channel.js";
-import verificationCode from '@/common/verificationCode';
+	import pubc from '@/common/public.js'
+	import {
+		mapState
+	} from 'vuex'
+	import channel from "@/common/channel.js";
+	import verificationCode from '@/common/verificationCode';
 
-export default {
-	components: {},
-	computed: {
-		...mapState('hideModule', ['isSmsLogin'])
-	},
-	data() {
-		return {
-			skey: '',
-			sel: 1,
-			is_agree: 0,
-			type: 'mobile',
-			myinfo: {
-				nickname: '',
-				join_name: '',
-				num_1: 0,
-				num_2: 0,
-				num_3: 0,
-				num_4: 0,
-				is_login: 'no',
-				num_history: 0,
-				num_collection: 0
-			},
-			mobile: '',
-			password: '',
-			code: '',
-			captchaTime: 0,
-			push_token: '',
-			lat: '',
-			lng: '',
-			univerifyStyle: {
-				"fullScreen": false, // 是否全屏显示,默认值: false
-				"backgroundColor": "#ffffff",  // 授权页面背景颜色,默认值:#ffffff
-				"backgroundImage": "", // 全屏显示的背景图片,默认值:"" (仅支持本地图片,只有全屏显示时支持)
-				"icon": {
-					"path": "/static/logo.png", // 自定义显示在授权框中的logo,仅支持本地图片 默认显示App logo
-					"width": "60px",  //图标宽度 默认值:60px
-					"height": "60px"   //图标高度 默认值:60px
-				},
-				"closeIcon": {
-					// "path": "/static/icon/whiteBackground.png", // 自定义显示在授权框中的取消图片,仅支持本地图片
-					"width": "60px",  //图标宽度 默认值:60px (HBuilderX 4.0+ 仅iOS支持)
-					"height": "60px"   //图标高度 默认值:60px (HBuilderX 4.0+ 仅iOS支持)
-				},
-				"phoneNum": {
-					"color": "#202020"  // 手机号文字颜色 默认值:#202020
-				},
-				"slogan": {
-					"color": "#BBBBBB"  //  slogan 字体颜色 默认值:#BBBBBB
-				},
-				"authButton": {
-					"normalColor": "#131313", // 授权按钮正常状态背景颜色 默认值:#3479f5
-					"highlightColor": "#131313",  // 授权按钮按下状态背景颜色 默认值:#2861c5(仅ios支持)
-					"disabledColor": "#73aaf5",  // 授权按钮不可点击时背景颜色 默认值:#73aaf5(仅ios支持)
-					"textColor": "#ffffff",  // 授权按钮文字颜色 默认值:#ffffff
-					"title": "本机号码一键登录", // 授权按钮文案 默认值:"本机号码一键登录"
-					"borderRadius": "24px"	// 授权按钮圆角 默认值:"24px" (按钮高度的一半)
+	export default {
+		components: {},
+		computed: {
+			...mapState('hideModule', ['isSmsLogin'])
+		},
+		data() {
+			return {
+				skey: '',
+				sel: 1,
+				is_agree: 0,
+				type: 'mobile',
+				myinfo: {
+					nickname: '',
+					join_name: '',
+					num_1: 0,
+					num_2: 0,
+					num_3: 0,
+					num_4: 0,
+					is_login: 'no',
+					num_history: 0,
+					num_collection: 0
 				},
-				"otherLoginButton": {
-					"visible": false, // 是否显示其他登录按钮,默认值:true
-					"normalColor": "", // 其他登录按钮正常状态背景颜色 默认值:透明
-					"highlightColor": "", // 其他登录按钮按下状态背景颜色 默认值:透明
-					"textColor": "#656565", // 其他登录按钮文字颜色 默认值:#656565
-					"title": "其他登录方式", // 其他登录方式按钮文字 默认值:"其他登录方式"
-					"borderColor": "",  //边框颜色 默认值:透明(仅iOS支持)
-					"borderRadius": "0px" // 其他登录按钮圆角 默认值:"24px" (按钮高度的一半)
+				mobile: '',
+				password: '',
+				code: '',
+				captchaTime: 0,
+				push_token: '',
+				lat: '',
+				lng: '',
+				univerifyStyle: {
+					"fullScreen": false, // 是否全屏显示,默认值: false
+					"backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff
+					"backgroundImage": "", // 全屏显示的背景图片,默认值:"" (仅支持本地图片,只有全屏显示时支持)
+					"icon": {
+						"path": "/static/logo.png", // 自定义显示在授权框中的logo,仅支持本地图片 默认显示App logo
+						"width": "60px", //图标宽度 默认值:60px
+						"height": "60px" //图标高度 默认值:60px
+					},
+					"closeIcon": {
+						// "path": "/static/icon/whiteBackground.png", // 自定义显示在授权框中的取消图片,仅支持本地图片
+						"width": "60px", //图标宽度 默认值:60px (HBuilderX 4.0+ 仅iOS支持)
+						"height": "60px" //图标高度 默认值:60px (HBuilderX 4.0+ 仅iOS支持)
+					},
+					"phoneNum": {
+						"color": "#202020" // 手机号文字颜色 默认值:#202020
+					},
+					"slogan": {
+						"color": "#BBBBBB" //  slogan 字体颜色 默认值:#BBBBBB
+					},
+					"authButton": {
+						"normalColor": "#131313", // 授权按钮正常状态背景颜色 默认值:#3479f5
+						"highlightColor": "#131313", // 授权按钮按下状态背景颜色 默认值:#2861c5(仅ios支持)
+						"disabledColor": "#73aaf5", // 授权按钮不可点击时背景颜色 默认值:#73aaf5(仅ios支持)
+						"textColor": "#ffffff", // 授权按钮文字颜色 默认值:#ffffff
+						"title": "本机号码一键登录", // 授权按钮文案 默认值:"本机号码一键登录"
+						"borderRadius": "24px" // 授权按钮圆角 默认值:"24px" (按钮高度的一半)
+					},
+					"otherLoginButton": {
+						"visible": false, // 是否显示其他登录按钮,默认值:true
+						"normalColor": "", // 其他登录按钮正常状态背景颜色 默认值:透明
+						"highlightColor": "", // 其他登录按钮按下状态背景颜色 默认值:透明
+						"textColor": "#656565", // 其他登录按钮文字颜色 默认值:#656565
+						"title": "其他登录方式", // 其他登录方式按钮文字 默认值:"其他登录方式"
+						"borderColor": "", //边框颜色 默认值:透明(仅iOS支持)
+						"borderRadius": "0px" // 其他登录按钮圆角 默认值:"24px" (按钮高度的一半)
+					},
+					"privacyTerms": {
+						"defaultCheckBoxState": false, // 条款勾选框初始状态 默认值: true
+						"isCenterHint": true, //未勾选服务条款时点击登录按钮的提示是否居中显示 默认值: false (3.7.13+ 版本支持)
+						"uncheckedImage": "/static/icon/wd_icon_gouxuan04.png", // 可选 条款勾选框未选中状态图片(仅支持本地图片 建议尺寸 24x24px)(3.2.0+ 版本支持)
+						"checkedImage": "/static/icon/wd_icon_gouxuan05.png", // 可选 条款勾选框选中状态图片(仅支持本地图片 建议尺寸24x24px)(3.2.0+ 版本支持)
+						"checkBoxSize": 20, // 可选 条款勾选框大小
+						"textColor": "#BBBBBB", // 文字颜色 默认值:#BBBBBB
+						"termsColor": "#5496E3", //  协议文字颜色 默认值: #5496E3
+						"prefix": "我已阅读并同意", // 条款前的文案 默认值:"我已阅读并同意"
+						"suffix": "并使用本机号码登录", // 条款后的文案 默认值:"并使用本机号码登录"
+						"privacyItems": [ // 自定义协议条款,最大支持2个,需要同时设置url和title. 否则不生效
+							{
+								"url": "https://e.zhichao.art/web/yszc.php", // 点击跳转的协议详情页面
+								"title": "隐私协议" // 协议名称
+							},
+							{
+								"url": "https://e.zhichao.art/web/yhxy.php", // 点击跳转的协议详情页面
+								"title": "用户使用协议" // 协议名称
+							}
+						]
+					},
+					"buttons": { // 自定义页面下方按钮仅全屏模式生效(3.1.14+ 版本支持)
+						"iconWidth": "45px", // 图标宽度(高度等比例缩放) 默认值:45px
+						"list": [{
+								"provider": "apple",
+								// "iconPath": "/static/apple.png" // 图标路径仅支持本地图片
+							},
+							{
+								"provider": "weixin",
+								// "iconPath": "/static/wechat.png" // 图标路径仅支持本地图片
+							}
+						]
+					}
 				},
-				"privacyTerms": {
-					"defaultCheckBoxState": false, // 条款勾选框初始状态 默认值: true
-					"isCenterHint": true, //未勾选服务条款时点击登录按钮的提示是否居中显示 默认值: false (3.7.13+ 版本支持)
-					"uncheckedImage": "/static/icon/wd_icon_gouxuan04.png", // 可选 条款勾选框未选中状态图片(仅支持本地图片 建议尺寸 24x24px)(3.2.0+ 版本支持)
-					"checkedImage": "/static/icon/wd_icon_gouxuan05.png", // 可选 条款勾选框选中状态图片(仅支持本地图片 建议尺寸24x24px)(3.2.0+ 版本支持)
-					"checkBoxSize": 20, // 可选 条款勾选框大小
-					"textColor": "#BBBBBB", // 文字颜色 默认值:#BBBBBB
-					"termsColor": "#5496E3", //  协议文字颜色 默认值: #5496E3
-					"prefix": "我已阅读并同意", // 条款前的文案 默认值:"我已阅读并同意"
-					"suffix": "并使用本机号码登录", // 条款后的文案 默认值:"并使用本机号码登录"
-					"privacyItems": [  // 自定义协议条款,最大支持2个,需要同时设置url和title. 否则不生效
-						{
-							"url": "https://e.zhichao.art/web/yszc.php", // 点击跳转的协议详情页面
-							"title": "隐私协议" // 协议名称
-						},
-						{
-							"url": "https://e.zhichao.art/web/yhxy.php", // 点击跳转的协议详情页面
-							"title": "用户使用协议" // 协议名称
-						}
-					]
+				templateId: 36155, //短信模板ID 
+				expMinute: '15', //短信有效时间
+				randomVerificationCode: '',
+			}
+		},
+		onLoad() {
+			setTimeout(function() {
+				console.log(this.isSmsLogin, 'isSmsLogin');
+				uni.setNavigationBarColor({
+					frontColor: '#ffffff',
+					backgroundColor: '#00000000',
+					animation: {
+						duration: 400,
+						timingFunc: 'easeIn'
+					}
+				})
+			}, 200);
+			let that = this;
+			uni.getPushClientId({
+				success: (res) => {
+					console.log("su:", res.cid);
+					that.push_token = res.cid;
 				},
-				"buttons": {  // 自定义页面下方按钮仅全屏模式生效(3.1.14+ 版本支持)
-					"iconWidth": "45px", // 图标宽度(高度等比例缩放) 默认值:45px
-					"list": [
-						{
-							"provider": "apple",
-							// "iconPath": "/static/apple.png" // 图标路径仅支持本地图片
-						},
-						{
-							"provider": "weixin",
-							// "iconPath": "/static/wechat.png" // 图标路径仅支持本地图片
-						}
-					]
-				}
-			}, 
-			templateId :36155,//短信模板ID 
-			expMinute:'15', //短信有效时间
-			randomVerificationCode:'',
-		}
-	},
-	onLoad() {
-		setTimeout(function () {
-			console.log(this.isSmsLogin, 'isSmsLogin'); 
-			uni.setNavigationBarColor({
-				frontColor: '#ffffff',
-				backgroundColor: '#00000000',
-				animation: {
-					duration: 400,
-					timingFunc: 'easeIn'
+				fail(err) {
+					that.push_token = '';
+					console.log(err)
 				}
-			})
-		}, 200);
-		let that = this;
-		uni.getPushClientId({
-			success: (res) => {
-				console.log("su:", res.cid);
-				that.push_token = res.cid;
-			},
-			fail(err) {
-				that.push_token = '';
-				console.log(err)
-			}
-		});
-		let channelStr = channel && channel.getCurrentStore() && channel.getCurrentStore().channel;
-		if (channelStr && channelStr == 'huawei') {
-			this.univerifyStyle.privacyTerms.defaultCheckBoxState = false;
-		} else {
-			this.univerifyStyle.privacyTerms.defaultCheckBoxState = true;
+			});
+			let channelStr = channel && channel.getCurrentStore() && channel.getCurrentStore().channel;
+			if (channelStr && channelStr == 'huawei') {
+				this.univerifyStyle.privacyTerms.defaultCheckBoxState = false;
+			} else {
+				this.univerifyStyle.privacyTerms.defaultCheckBoxState = true;
 
-		}
-		this.oneClickLoginFun(channel);
-	},
-	onShow() {
-		// let hsign = pubc.Encrypt("aboa-wifl-kwfl-zjfk-wlaa_FA0412932BAE9D98506580ADB348BEF9");
-		// console.log("hsign", hsign)
+			}
+			this.oneClickLoginFun(channel);
+		},
+		onShow() {
+			// let hsign = pubc.Encrypt("aboa-wifl-kwfl-zjfk-wlaa_FA0412932BAE9D98506580ADB348BEF9");
+			// console.log("hsign", hsign)
 
 
-		// let skey = uni.getStorageSync("wapptoken");
-		// if (skey != null && skey != "" && skey != undefined) {
-		// 	uni.switchTab({
-		// 		url: "/pages/index/index"
-		// 	});
-		// 	return;
-		// }
-		// let that = this;
-		// uni.getLocation({
-		// 	type: 'wgs84',
-		// 	success: function(res) {
-		// 		that.lat = res.latitude;
-		// 		that.lng = res.longitude;
-		// 	},
-		// 	fail: function(error) {
-		// 		console.error('获取位置失败:', error);
-		// 	}
-		// });
+			// let skey = uni.getStorageSync("wapptoken");
+			// if (skey != null && skey != "" && skey != undefined) {
+			// 	uni.switchTab({
+			// 		url: "/pages/index/index"
+			// 	});
+			// 	return;
+			// }
+			// let that = this;
+			// uni.getLocation({
+			// 	type: 'wgs84',
+			// 	success: function(res) {
+			// 		that.lat = res.latitude;
+			// 		that.lng = res.longitude;
+			// 	},
+			// 	fail: function(error) {
+			// 		console.error('获取位置失败:', error);
+			// 	}
+			// });
 
 
-	},
-	methods: {
-		goWeb(url, title) {
-			uni.navigateTo({
-				url: `/pages/webview/index?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`
-			})
 		},
-		onBack() { },
-		agreeChk() {
-			if (this.is_agree == 0) {
-				this.is_agree = 1;
-			} else {
-				this.is_agree = 0;
-			}
-		},
-		goPage(page) {
-			if (page == 'yhxy') {
+		methods: {
+			goWeb(url, title) {
 				uni.navigateTo({
-					url: '/pages/AboutUs/yhxy'
+					url: `/pages/webview/index?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`
 				})
-			} else if (page == 'yszc') {
-				// #ifdef APP-PLUS
-				plus.runtime.openWeb('https://e.zhichao.art/web/yszc.php') // plus.runtime.openWeb(href);
-				// #endif
+			},
+			onBack() {},
+			agreeChk() {
+				if (this.is_agree == 0) {
+					this.is_agree = 1;
+				} else {
+					this.is_agree = 0;
+				}
+			},
+			goPage(page) {
+				if (page == 'yhxy') {
+					uni.navigateTo({
+						url: '/pages/AboutUs/yhxy'
+					})
+				} else if (page == 'yszc') {
+					// #ifdef APP-PLUS
+					plus.runtime.openWeb('https://e.zhichao.art/web/yszc.php') // plus.runtime.openWeb(href);
+					// #endif
 
-				// #ifdef H5
-				window.open('https://e.zhichao.art/web/yszc.php')
-				// #endif
+					// #ifdef H5
+					window.open('https://e.zhichao.art/web/yszc.php')
+					// #endif
 
-				// uni.navigateTo({
-				// 	url: '/pages/AboutUs/yszc'
-				// })
-			} else {
+					// uni.navigateTo({
+					// 	url: '/pages/AboutUs/yszc'
+					// })
+				} else {
+					uni.navigateTo({
+						url: page,
+					});
+				}
+			},
+			toRegist() {
 				uni.navigateTo({
-					url: page,
-				});
-			}
-		},
-		toRegist() {
-			uni.navigateTo({
-				url: "/pages/login/reg",
-			});
-		},
-		toLogin() {
-			let that = this;
-			if (this.mobile.length != 11) {
-				uni.showToast({
-					title: "请输入手机号",
-					icon: "none",
+					url: "/pages/login/reg",
 				});
-				return;
-			}
-			if (this.type == 'pass') {
-				if (this.password.length < 6) {
+			},
+			toLogin() {
+				let that = this;
+				if (this.mobile.length != 11) {
 					uni.showToast({
-						title: "请输入不小于6位的密码",
+						title: "请输入手机号",
 						icon: "none",
 					});
 					return;
 				}
-			} else {
-				if (this.code.length < 4) {
+				if (this.type == 'pass') {
+					if (this.password.length < 6) {
+						uni.showToast({
+							title: "请输入不小于6位的密码",
+							icon: "none",
+						});
+						return;
+					}
+				} else {
+					if (this.code.length < 4) {
+						uni.showToast({
+							title: "请输入手机验证码",
+							icon: "none",
+						});
+						return;
+					}
+				}
+				if (this.is_agree == 0) {
 					uni.showToast({
-						title: "请输入手机验证码",
+						title: "请确认并选择协议",
 						icon: "none",
 					});
 					return;
 				}
-			}
-			if (this.is_agree == 0) {
-				uni.showToast({
-					title: "请确认并选择协议",
-					icon: "none",
+				let method = '/Member/gamelogin';
+				if (this.btn_type == 'reg') {
+					method = '/Member/register';
+					if (this.code.length < 4) {
+						uni.showToast({
+							title: '请输入验证码',
+							icon: 'none'
+						});
+						return;
+					}
+				} else if (this.btn_type == 'reset') {
+					method = '/Member/resetPass';
+					if (this.code.length < 4) {
+						uni.showToast({
+							title: '请输入验证码',
+							icon: 'none'
+						});
+						return;
+					}
+				}
+				this.loginInterface({
+					isOneClickLogin: false,
+					phone: ''
+				}, )
+
+			},
+			loginInterface({
+				isOneClickLogin,
+				phone
+			}) {
+				let that = this;
+				let channel = "";
+				// #ifdef APP-PLUS
+				channel = plus.runtime.channel;
+				// #endif
+
+				uni.showLoading({
+					mask: true,
 				});
-				return;
-			}
-			let method = '/Member/gamelogin';
-			if (this.btn_type == 'reg') {
-				method = '/Member/register';
-				if (this.code.length < 4) {
+				console.log("host", this.$apiHost + method);
+				let mobile = this.mobile;
+				let code = this.code;
+				let type = this.type;
+				console.log(type, 89);
+				let method = '/Member/gamelogin';
+				if (isOneClickLogin) {
+					mobile = phone;
+					code = '123601';
+					type = 'mobile';
+				}
+				uni.request({
+					url: this.$apiHost + method,
+					data: {
+						uuid: getApp().globalData.uuid,
+						channel: channel,
+						loginType: type,
+						mobile,
+						password: this.password,
+						code,
+						push_token: this.push_token,
+						lat: this.lat,
+						lng: this.lng,
+					},
+					header: {
+						"content-type": "application/json",
+					},
+					success: (res) => {
+						console.log("----", res.data);
+						if (res.data.success == "yes") {
+							uni.showToast({
+								title: "登录成功",
+								icon: "none",
+							});
+							console.log("res.data", res.data);
+							if (res.data.uuid.length > 5) {
+								uni.setStorageSync("app_uuid", res.data.uuid);
+								getApp().globalData.uuid = res.data.uuid;
+							}
+							uni.setStorageSync("is_login", "yes");
+							uni.setStorageSync("wapptoken", res.data.skey);
+							getApp().globalData.skey = res.data.skey;
+							if (res.data.header_c != "") {
+								getApp().globalData.headerSign = pubc.Encrypt(res.data.header_c + "_" +
+									getApp().globalData.uuid);
+								uni.setStorageSync("headerSign", getApp().globalData.headerSign);
+							}
+							getApp().globalData.headerC = res.data.header_c;
+							if (res.data.nickname == '') {
+								uni.redirectTo({
+									url: '/pages/my/step'
+								});
+								return;
+							}
+							// 获取用户信息储存全局
+							uni.request({
+								url: this.$apiHost + '/User/getinfo',
+								data: {
+									uuid: getApp().globalData.uuid,
+									skey: getApp().globalData.skey
+								},
+								header: {
+									"content-type": "application/json",
+									'sign': getApp().globalData.headerSign
+								},
+								success: (res) => {
+									console.log("--获取用户信息--:", res.data);
+
+									if (res.data.need_login == "yes") {
+
+									}
+									if (res.data.aihao) {
+										this.aihao_tags = res.data.aihao.split(",");
+									}
+									if (res.data.nickname) {
+										getApp().globalData.nickname = res.data.nickname
+										uni.removeStorageSync("nickname");
+										uni.setStorageSync("nickname", res.data.nickname);
+									}
+									if (res.data.mobile) {
+										getApp().globalData.mobile = res.data.mobile
+										uni.removeStorageSync("mobile", res.data.mobile);
+										uni.setStorageSync("mobile", res.data.mobile);
+									}
+									if (res.data.user_id) {
+										getApp().globalData.user_id = res.data.user_id
+										uni.removeStorageSync("user_id");
+										uni.setStorageSync("user_id", res.data.user_id);
+									}
+									if (res.data.avator) {
+										getApp().globalData.avator = res.data.avator
+										uni.removeStorageSync("avator");
+										uni.setStorageSync("avator", res.data.avator);
+									}
+
+								},
+								complete: (com) => {
+									// uni.hideLoading();
+								},
+								fail: (e) => {
+									console.log("----e:", e);
+								}
+							});
+							uni.switchTab({
+								url: "/pages/index/index",
+							});
+						} else if (res.data.success == "no") {
+							uni.showToast({
+								title: res.data.str,
+								icon: "none",
+							});
+						} else {
+							uni.showToast({
+								title: "操作失败,请联系客服",
+								icon: "none",
+							});
+						}
+					},
+					complete: (com) => {
+						uni.hideLoading();
+					},
+				});
+			},
+			getCode() {
+				if (this.mobile.length != 11) {
 					uni.showToast({
-						title: '请输入验证码',
+						title: '请输入手机号',
 						icon: 'none'
 					});
 					return;
 				}
-			} else if (this.btn_type == 'reset') {
-				method = '/Member/resetPass';
-				if (this.code.length < 4) {
+				if (this.captchaTime > 0) {
 					uni.showToast({
-						title: '请输入验证码',
+						title: '不能重复获取',
 						icon: 'none'
 					});
 					return;
 				}
-			}
-			this.loginInterface({ isOneClickLogin: false, phone: '' },)
-
-		},
-		loginInterface({ isOneClickLogin, phone }) {
-			let that = this;
-			let channel = "";
-			// #ifdef APP-PLUS
-			channel = plus.runtime.channel;
-			// #endif
-
-			uni.showLoading({
-				mask: true,
-			});
-			console.log("host", this.$apiHost + method);
-			let mobile = this.mobile;
-			let code = this.code;
-			let type = this.type;
-			console.log(type, 89);
-			let method = '/Member/gamelogin';
-			if (isOneClickLogin) {
-				mobile = phone;
-				code = '123601';
-				type = 'mobile';
-			}
-			uni.request({
-				url: this.$apiHost + method,
-				data: {
-					uuid: getApp().globalData.uuid,
-					channel: channel,
-					loginType: type,
-					mobile,
-					password: this.password,
-					code,
-					push_token: this.push_token,
-					lat: this.lat,
-					lng: this.lng,
-				},
-				header: {
-					"content-type": "application/json",
-				},
-				success: (res) => {
-					console.log("----", res.data);
-					if (res.data.success == "yes") {
-						uni.showToast({
-							title: "登录成功",
-							icon: "none",
-						});
-						console.log("res.data", res.data);
-						if (res.data.uuid.length > 5) {
-							uni.setStorageSync("app_uuid", res.data.uuid);
-							getApp().globalData.uuid = res.data.uuid;
-						}
-						uni.setStorageSync("is_login", "yes");
-						uni.setStorageSync("wapptoken", res.data.skey);
-						getApp().globalData.skey = res.data.skey;
-						if (res.data.header_c != "") {
-							getApp().globalData.headerSign = pubc.Encrypt(res.data.header_c + "_" +
-								getApp().globalData.uuid);
-							uni.setStorageSync("headerSign", getApp().globalData.headerSign);
-						}
-						getApp().globalData.headerC = res.data.header_c;
-						if (res.data.nickname == '') {
-							uni.redirectTo({
-								url: '/pages/my/step'
-							});
-							return;
-						}
-						// 获取用户信息储存全局
-						uni.request({
-							url: this.$apiHost + '/User/getinfo',
-							data: {
-								uuid: getApp().globalData.uuid,
-								skey: getApp().globalData.skey
-							},
-							header: {
-								"content-type": "application/json",
-								'sign': getApp().globalData.headerSign
-							},
-							success: (res) => {
-								console.log("--获取用户信息--:", res.data);
-
-								if (res.data.need_login == "yes") {
-
-								}
-								if (res.data.aihao) {
-									this.aihao_tags = res.data.aihao.split(",");
-								}
-								if (res.data.nickname) {
-									getApp().globalData.nickname = res.data.nickname
-									uni.removeStorageSync("nickname");
-									uni.setStorageSync("nickname", res.data.nickname);
-								}
-								if (res.data.mobile) {
-									getApp().globalData.mobile = res.data.mobile
-									uni.removeStorageSync("mobile", res.data.mobile);
-									uni.setStorageSync("mobile", res.data.mobile);
-								}
-								if (res.data.user_id) {
-									getApp().globalData.user_id = res.data.user_id
-									uni.removeStorageSync("user_id");
-									uni.setStorageSync("user_id", res.data.user_id);
-								}
-								if (res.data.avator) {
-									getApp().globalData.avator = res.data.avator
-									uni.removeStorageSync("avator");
-									uni.setStorageSync("avator", res.data.avator);
-								}
+				this.captchaTime = 60;
 
-							},
-							complete: (com) => {
-								// uni.hideLoading();
-							},
-							fail: (e) => {
-								console.log("----e:", e);
-							}
-						});
-						uni.switchTab({
-							url: "/pages/index/index",
-						});
-					} else if (res.data.success == "no") {
+				uni.request({
+					url: this.$apiHost + '/Web/getcode', //仅为示例,并非真实接口地址。
+					data: {
+						skey: this.skey,
+						mobile: this.mobile,
+					},
+					header: {
+						'content-type': 'application/json' //自定义请求头信息
+					},
+					success: (res) => {
+						console.log("----", res.data)
 						uni.showToast({
 							title: res.data.str,
-							icon: "none",
-						});
-					} else {
-						uni.showToast({
-							title: "操作失败,请联系客服",
-							icon: "none",
-						});
+							icon: 'none'
+						})
+						if (res.data.success == 'yes') {
+							this.getCodeTime();
+						} else {
+							this.captchaTime = 0;
+						}
 					}
-				},
-				complete: (com) => {
-					uni.hideLoading();
-				},
-			});
-		},
-		getCode() {
-			if (this.mobile.length != 11) {
-				uni.showToast({
-					title: '请输入手机号',
-					icon: 'none'
 				});
-				return;
-			}
-			if (this.captchaTime > 0) {
-				uni.showToast({
-					title: '不能重复获取',
-					icon: 'none'
-				});
-				return;
-			}
-			this.captchaTime = 60;
-
-			uni.request({
-				url: this.$apiHost + '/Web/getcode', //仅为示例,并非真实接口地址。
-				data: {
-					skey: this.skey,
-					mobile: this.mobile,
-				},
-				header: {
-					'content-type': 'application/json' //自定义请求头信息
-				},
-				success: (res) => {
-					console.log("----", res.data)
-					uni.showToast({
-						title: res.data.str,
-						icon: 'none'
-					})
-					if (res.data.success == 'yes') {
+			},
+			getCodeTime() {
+				if (this.captchaTime > 0) {
+					setTimeout(() => {
+						this.captchaTime--;
 						this.getCodeTime();
-					} else {
-						this.captchaTime = 0;
-					}
+					}, 1000);
 				}
-			});
-		},
-		getCodeTime() {
-			if (this.captchaTime > 0) {
-				setTimeout(() => {
-					this.captchaTime--;
-					this.getCodeTime();
-				}, 1000);
-			}
-		},
+			},
 
-		oneClickLoginFun() {
-			let _this = this;
-			//预登陆
-			uni.preLogin({
-				provider: 'univerify',
-				success() {  //预登录成功
-					// 显示一键登录选项
-					uni.login({
-						provider: 'univerify',
-						univerifyStyle: _this.univerifyStyle,
-						success(res) { // 登录成功
-							console.log(res.authResult.access_token);
-							console.log(res.authResult.openid);
-							// 此处获取了openid和access_token
-							// {openid:'登录授权唯一标识',access_token:'接口返回的 token'}
-							// 通过uniCloud.callFunction函数实现前端获取手机号
-							uniCloud.callFunction({
-								name: "oneClickLogin", // 填写你自己的云函数名称
-								//传入上面获取的openid和access_token获取手机号
-								data: {
-									access_token: res.authResult.access_token, // 客户端一键登录接口返回的access_token
-									openid: res.authResult.openid // 客户端一键登录接口返回的openid
-								}
-							}).then((dataRes) => {
-								//此处已经成功获取手机号等信息
-								console.log("云函数返回的参数1", dataRes)
-								let phone = dataRes.result.data.phoneNumber
-								if (phone) {
-									_this.loginInterface({
-										isOneClickLogin: true,
-										phone,
-									})
-									setTimeout(() => {
-										uni.closeAuthView() //关闭一键登录弹出窗口 
-									}, 500)
-								} else {
+			oneClickLoginFun() {
+				let _this = this;
+				//预登陆
+				uni.preLogin({
+					provider: 'univerify',
+					success() { //预登录成功
+						// 显示一键登录选项
+						uni.login({
+							provider: 'univerify',
+							univerifyStyle: _this.univerifyStyle,
+							success(res) { // 登录成功
+								console.log(res.authResult.access_token);
+								console.log(res.authResult.openid);
+								// 此处获取了openid和access_token
+								// {openid:'登录授权唯一标识',access_token:'接口返回的 token'}
+								// 通过uniCloud.callFunction函数实现前端获取手机号
+								uniCloud.callFunction({
+									name: "oneClickLogin", // 填写你自己的云函数名称
+									//传入上面获取的openid和access_token获取手机号
+									data: {
+										access_token: res.authResult
+											.access_token, // 客户端一键登录接口返回的access_token
+										openid: res.authResult.openid // 客户端一键登录接口返回的openid
+									}
+								}).then((dataRes) => {
+									//此处已经成功获取手机号等信息
+									console.log("云函数返回的参数1", dataRes)
+									let phone = dataRes.result.data.phoneNumber
+									if (phone) {
+										_this.loginInterface({
+											isOneClickLogin: true,
+											phone,
+										})
+										setTimeout(() => {
+											uni.closeAuthView() //关闭一键登录弹出窗口 
+										}, 500)
+									} else {
 
-								}
-								// 获取手机号后根据自己的需求做后面的登录操作即可
-								//...
-							}).catch((err) => {
-								console.log(err);
-								console.log("云函数报错", err)
-								uni.showToast({
-									title: err.errMsg,
-									icon: "none"
-								})
-								this_ = this
-								setTimeout(() => {
-									uni.closeAuthView() //关闭一键登录弹出窗口
-									_this.onClickMsgLogin()
+									}
+									// 获取手机号后根据自己的需求做后面的登录操作即可
+									//...
+								}).catch((err) => {
+									console.log(err);
+									console.log("云函数报错", err)
 									uni.showToast({
-										title: "请插入SIM卡并且使用流量后再重试",
+										title: err.errMsg,
 										icon: "none"
 									})
-								}, 500)
-							})
-						},
-						fail(res) {  // 登录失败
-							console.log(res.errCode)
-							console.log(res.errMsg)
-						}
-					})
-				},
-				fail(res) {
-					// 预登录失败
-					// 不显示一键登录选项(或置灰)
-					// 根据错误信息判断失败原因,如有需要可将错误提交给统计服务器
-					console.log(res.errCode)
-					console.log(res.errMsg)
-					_this.onClickMsgLogin()
-					uni.hideToast();
+									this_ = this
+									setTimeout(() => {
+										uni.closeAuthView() //关闭一键登录弹出窗口
+										_this.onClickMsgLogin()
+										uni.showToast({
+											title: "请插入SIM卡并且使用流量后再重试",
+											icon: "none"
+										})
+									}, 500)
+								})
+							},
+							fail(res) { // 登录失败
+								console.log(res.errCode)
+								console.log(res.errMsg)
+							}
+						})
+					},
+					fail(res) {
+						// 预登录失败
+						// 不显示一键登录选项(或置灰)
+						// 根据错误信息判断失败原因,如有需要可将错误提交给统计服务器
+						console.log(res.errCode)
+						console.log(res.errMsg)
+						_this.onClickMsgLogin()
+						uni.hideToast();
+						uni.showToast({
+							title: "请插入SIM卡并且使用流量后再重试",
+							icon: "none",
+							duration: 3000
+						})
+					}
+				})
+			},
+			// 一键登录失败
+			onClickMsgLogin() {
+				uni.closeAuthView()
+				uni.hideToast();
+				setTimeout(() => {
 					uni.showToast({
 						title: "请插入SIM卡并且使用流量后再重试",
 						icon: "none",
 						duration: 3000
 					})
-				}
-			})
-		},
-		// 一键登录失败
-		onClickMsgLogin() {
-			uni.closeAuthView()
-			uni.hideToast();
-			setTimeout(() => {
-				uni.showToast({
-					title: "请插入SIM卡并且使用流量后再重试",
-					icon: "none",
-					duration: 3000
-				})
-			}, 500)
-
+				}, 500)
 
-		},
-		// 发送短信验证码
-		sendSms() {
-			// 手机号格式验证
-			const mobileRegex = /^1[3-9]\d{9}$/;
-			if (!this.mobile) {
-				uni.showToast({
-					title: '请输入手机号',
-					icon: 'none'
-				});
-				return;
-			}
-			if (!mobileRegex.test(this.mobile)) {
-				uni.showToast({
-					title: '请输入正确的手机号',
-					icon: 'none'
-				});
-				return;
-			}
-
-			// 检查是否在倒计时中
-			if (this.captchaTime > 0) {
-				uni.showToast({
-					title: '不能重复获取',
-					icon: 'none'
-				});
-				return;
-			}
 
-			// 生成验证码
-			const code = verificationCode.generateCode();
-			console.log("生成的验证码:", code);
-			console.log({templateId: this.templateId,
-					phone: this.mobile,
-					code: code,
-					expMinute: this.expMinute});
-			// 调用云函数发送验证码
-			uniCloud.callFunction({
-				name: "smsVerification",
-				data: {
-					templateId: this.templateId + '',
-					phone: this.mobile + '',
-					code: code + '',
-					expMinute: this.expMinute + '',
-					name: '萌创星球',
+			},
+			// 发送短信验证码
+			sendSms() {
+				// 手机号格式验证
+				const mobileRegex = /^1[3-9]\d{9}$/;
+				if (!this.mobile) {
+					uni.showToast({
+						title: '请输入手机号',
+						icon: 'none'
+					});
+					return;
 				}
-			}).then((dataRes) => {
-				console.log("云函数返回的参数", dataRes);
-				if (dataRes.result && dataRes.result.success) {
+				if (!mobileRegex.test(this.mobile)) {
 					uni.showToast({
-						title: '验证码发送成功',
+						title: '请输入正确的手机号',
 						icon: 'none'
 					});
-					// 开始倒计时
-					this.captchaTime = 60;
-					this.getCodeTime();
-				} else {
+					return;
+				}
+
+				// 检查是否在倒计时中
+				if (this.captchaTime > 0) {
 					uni.showToast({
-						title: dataRes.result.message || '验证码发送失败',
+						title: '不能重复获取',
 						icon: 'none'
 					});
-					this.captchaTime = 0;
+					return;
 				}
-			}).catch((err) => {
-				console.log("发送验证码失败:", err);
-				uni.showToast({
-					title: '验证码发送失败',
-					icon: 'none'
+
+				// 生成验证码
+				const code = verificationCode.generateCode();
+				console.log("生成的验证码:", code);
+				console.log({
+					templateId: this.templateId,
+					phone: this.mobile,
+					code: code,
+					expMinute: this.expMinute
 				});
-				this.captchaTime = 0;
-			});
-		},
+				// 调用云函数发送验证码
+				uniCloud.callFunction({
+					name: "smsVerification",
+					data: {
+						templateId: this.templateId + '',
+						phone: this.mobile + '',
+						code: code + '',
+						expMinute: this.expMinute + '',
+						name: '萌创星球',
+					}
+				}).then((dataRes) => {
+					console.log("云函数返回的参数", dataRes);
+					if (dataRes.result && dataRes.result.success) {
+						uni.showToast({
+							title: '验证码发送成功',
+							icon: 'none'
+						});
+						// 开始倒计时
+						this.captchaTime = 60;
+						this.getCodeTime();
+					} else {
+						uni.showToast({
+							title: dataRes.result.message || '验证码发送失败',
+							icon: 'none'
+						});
+						this.captchaTime = 0;
+					}
+				}).catch((err) => {
+					console.log("发送验证码失败:", err);
+					uni.showToast({
+						title: '验证码发送失败',
+						icon: 'none'
+					});
+					this.captchaTime = 0;
+				});
+			},
+		}
 	}
-}
 </script>
 
 <style scoped lang="scss">
-@import 'login.scss';
+	@import 'login.scss';
 </style>

+ 544 - 530
pages/my/my.vue

@@ -41,7 +41,7 @@
 						</view>
 
 
-						<view class="label-box" id="labelBox">
+						<view class="label-box" id="labelBox" @click="goPage('/pages/my/editInfo')">
 							<view class="label-item sex-item">
 
 								<image src="../../static/icon/wd_icon_nv.png" mode="widthFix" v-if="myinfo.sex_id == 2">
@@ -316,584 +316,598 @@
 </template>
 
 <script>
-import tabbarView from "@/components/tabbar/tabbar.vue";
-import tabbar from "@/mixins/tabbar";
-import CustomConfirm from "@/components/custome-confirm/customeConfirm.vue";
-import CircleAvatar from "@/components/CircleAvatar/CircleAvatar.vue";
-import meCard from "@/components/meCard/meCard.vue";
-import WorkItem from "@/components/WorkItem/WorkItem.vue";
-import { mapState } from 'vuex'
-import { scientificCounting } from "@/common/util.js";
-import { RgbQuant } from '@/common/RgbQuant.js';
-export default {
-	components: {
-		tabbarView,
-		CustomConfirm,
-		CircleAvatar,
-		meCard,
-		WorkItem,
-	},
-	mixins: [tabbar],
-	data() {
-		return {
-			bgImage: '',
-			title: "",
-			sel: 1,
-			firstLevelNavActive: 0,
-			labelBoxHeight: 0,
-			myinfo: {
-				avator: "../../static/logo.png",
-				nickname: "",
-				join_name: "",
-				num_1: 0,
-				num_2: 0,
-				num_3: 0,
-				num_4: 0,
-				is_login: "no",
-				num_history: 0,
-				num_collection: 0,
-			},
-			aihao_tags: [],
-			menu_list: [],
-			data_list: [],
-			activeTab: 0,
-			offset: 0,
-			hasMore: true,
-			isLoading: false,
-			isDataLoaded: false,
-			worksList: [],
-			showShare: false,
-			shareTitle: "",
-			shareDesc: "",
-			shareImg: "",
-			userId: 0,
-			headerBoxStyle: {
-				background: 'linear-gradient(360deg, #16210E 0%, rgba(55,73,36,0) 100%)'
-			},
-		};
-	},
-	onLoad(e) {
-		// setTimeout(function() {
-		// 	uni.setNavigationBarColor({
-		// 		frontColor: '#ffffff',
-		// 		backgroundColor: '#00000000',
-		// 		animation: {
-		// 			duration: 400,
-		// 			timingFunc: 'easeIn'
-		// 		}
-		// 	})
-		// }, 200); 
-		uni.$on('switchToMyPage', (data) => {
-			if (data.type === 'article') {
-				this.firstLevelNavActiveSwitch(1);
-			} else if (data.type === 'generatingInProgress') {
-				this.firstLevelNavActiveSwitch(0)
-				this.switchTab(1);
-			} else {
-				this.firstLevelNavActiveSwitch(0)
-				this.switchTab(0);
-			}
-		});
-	},
-	onUnload() {
-		// 移除事件监听
-		uni.$off('switchToMyPage');
-	},
-	computed: {
-		...mapState('switchingModule', ['isRecharge'])
-	},
-	onShow() {
-		uni.$emit("check_login", () => { });
-		this.offset = 0;
-		this.hasMore = true;
-		this.worksList = [];
-		this.loadInfo();
-
-		// 使用nextTick确保DOM已更新
-		this.$nextTick(() => {
-			this.getLabelBoxHeight();
-		});
-
-		// 检查全局变量,如果需要切换到生成中标签
-		if (getApp().globalData.needSwitchToGenerating) {
-			setTimeout(() => {
-				this.switchTab(1);
-				// 重置全局变量
-				getApp().globalData.needSwitchToGenerating = false;
-			}, 300);
-		} else {
-			this.loadWorksList();
-		}
-	},
-	onReachBottom() {
-		if (this.hasMore && !this.isLoading) {
-			this.loadMoreWorks();
-		}
-	},
-	methods: {
-		clickShare(item) {
-			this.showShare = true;
+	import tabbarView from "@/components/tabbar/tabbar.vue";
+	import tabbar from "@/mixins/tabbar";
+	import CustomConfirm from "@/components/custome-confirm/customeConfirm.vue";
+	import CircleAvatar from "@/components/CircleAvatar/CircleAvatar.vue";
+	import meCard from "@/components/meCard/meCard.vue";
+	import WorkItem from "@/components/WorkItem/WorkItem.vue";
+	import {
+		mapState
+	} from 'vuex'
+	import {
+		scientificCounting
+	} from "@/common/util.js";
+	import {
+		RgbQuant
+	} from '@/common/RgbQuant.js';
+	export default {
+		components: {
+			tabbarView,
+			CustomConfirm,
+			CircleAvatar,
+			meCard,
+			WorkItem,
 		},
-		async showConfirm() {
-			let that = this;
-			this.$refs["customConfirm"]
-				.confirm({
-					title: "确认解绑",
-					content: "解绑微信账号后将无法继续使用它登录该App账号?",
-					DialogType: "inquiry",
-					btn1: "再考虑一下",
-					btn2: "确认解绑",
-					animation: 0,
-				})
-				.then((res) => { });
+		mixins: [tabbar],
+		data() {
+			return {
+				bgImage: '',
+				title: "",
+				sel: 1,
+				firstLevelNavActive: 0,
+				labelBoxHeight: 0,
+				myinfo: {
+					avator: "../../static/logo.png",
+					nickname: "",
+					join_name: "",
+					num_1: 0,
+					num_2: 0,
+					num_3: 0,
+					num_4: 0,
+					is_login: "no",
+					num_history: 0,
+					num_collection: 0,
+				},
+				aihao_tags: [],
+				menu_list: [],
+				data_list: [],
+				activeTab: 0,
+				offset: 0,
+				hasMore: true,
+				isLoading: false,
+				isDataLoaded: false,
+				worksList: [],
+				showShare: false,
+				shareTitle: "",
+				shareDesc: "",
+				shareImg: "",
+				userId: 0,
+				headerBoxStyle: {
+					background: 'linear-gradient(360deg, #16210E 0%, rgba(55,73,36,0) 100%)'
+				},
+			};
 		},
-		onBack() { },
-		chkSel() {
-			if (this.sel == 1) {
-				this.sel = 0;
-			} else {
-				this.sel = 1;
-			}
+		onLoad(e) {
+			// setTimeout(function() {
+			// 	uni.setNavigationBarColor({
+			// 		frontColor: '#ffffff',
+			// 		backgroundColor: '#00000000',
+			// 		animation: {
+			// 			duration: 400,
+			// 			timingFunc: 'easeIn'
+			// 		}
+			// 	})
+			// }, 200); 
+			uni.$on('switchToMyPage', (data) => {
+				if (data.type === 'article') {
+					this.firstLevelNavActiveSwitch(1);
+				} else if (data.type === 'generatingInProgress') {
+					this.firstLevelNavActiveSwitch(0)
+					this.switchTab(1);
+				} else {
+					this.firstLevelNavActiveSwitch(0)
+					this.switchTab(0);
+				}
+			});
 		},
-		goPage(page) {
-			console.log(999);
+		onUnload() {
+			// 移除事件监听
+			uni.$off('switchToMyPage');
+		},
+		computed: {
+			...mapState('switchingModule', ['isRecharge'])
+		},
+		onShow() {
+			uni.$emit("check_login", () => {});
+			this.offset = 0;
+			this.hasMore = true;
+			this.worksList = [];
+			this.loadInfo();
 
-			uni.navigateTo({
-				url: page,
+			// 使用nextTick确保DOM已更新
+			this.$nextTick(() => {
+				this.getLabelBoxHeight();
 			});
 
+			// 检查全局变量,如果需要切换到生成中标签
+			if (getApp().globalData.needSwitchToGenerating) {
+				setTimeout(() => {
+					this.switchTab(1);
+					// 重置全局变量
+					getApp().globalData.needSwitchToGenerating = false;
+				}, 300);
+			} else {
+				this.loadWorksList();
+			}
 		},
-		initiateFundraising() {
-			if (this.myinfo.my_level < 3) {
-				this.$refs["DialogBox"]
+		onReachBottom() {
+			if (this.hasMore && !this.isLoading) {
+				this.loadMoreWorks();
+			}
+		},
+		methods: {
+			clickShare(item) {
+				this.showShare = true;
+			},
+			async showConfirm() {
+				let that = this;
+				this.$refs["customConfirm"]
 					.confirm({
-						title: "提示",
-						content: "您当前的等级为" + this.myinfo.my_level + "级,需要达到3级才能发起募集",
+						title: "确认解绑",
+						content: "解绑微信账号后将无法继续使用它登录该App账号?",
 						DialogType: "inquiry",
-						btn1: "取消",
-						btn2: "去查看等级",
+						btn1: "再考虑一下",
+						btn2: "确认解绑",
 						animation: 0,
 					})
-					.then((res) => {
-						this.goPage('/pages/my/creativeExpert')
+					.then((res) => {});
+			},
+			onBack() {},
+			chkSel() {
+				if (this.sel == 1) {
+					this.sel = 0;
+				} else {
+					this.sel = 1;
+				}
+			},
+			goPage(page) {
+				console.log(999);
 
-					}, (res) => {
-					});
-				return;
-			}
-			this.goPage('/pages/my/initiateCrowdfunding')
-		},
-		async calculateThemeColor(imageUrl) {
-			if (!imageUrl) {
-				// 如果没有图片,则使用默认样式
-				this.headerBoxStyle = {
-					background: 'linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent)'
-				};
-				return;
-			}
-			console.log('开始计算主题色, imageUrl:', imageUrl);
-			const canvasId = 'themeCanvas';
-			const ctx = uni.createCanvasContext(canvasId, this);
-
-			uni.getImageInfo({
-				src: imageUrl,
-				success: (imageInfo) => {
-					console.log('图片信息获取成功:', imageInfo);
-					const canvasWidth = 100; // 缩小图片以加快处理速度
-					const canvasHeight = Math.floor(canvasWidth * (imageInfo.height / imageInfo.width));
-
-					// 绘制图片到canvas
-					ctx.drawImage(imageInfo.path, 0, 0, canvasWidth, canvasHeight);
-					ctx.draw(false, () => {
-						console.log('Canvas 绘制完成');
-						// 获取像素数据
-						uni.canvasGetImageData({
-							canvasId: canvasId,
-							x: 0,
-							y: 0,
-							width: canvasWidth,
-							height: canvasHeight,
-							success: (res) => {
-								console.log('像素数据获取成功');
-								const pixels = res.data;
+				uni.navigateTo({
+					url: page,
+				});
 
-								// 使用 RgbQuant 提取主要颜色
-								const quant = new RgbQuant({
-									colors: 16, // 提取16种主要颜色
-									method: 2, // 使用 WuQuant 算法
-								});
-								quant.sample(pixels);
-								const palette = quant.quantize();
-
-								if (quant.vboxes && quant.vboxes.length > 0) {
-									let dominantColor = null;
-									let maxPopulation = 0;
-
-									// 找到像素数最多的颜色区域
-									quant.vboxes.forEach(vbox => {
-										const population = vbox.size(quant.histogram);
-										if (population > maxPopulation) {
-											maxPopulation = population;
-											dominantColor = vbox.color(quant.histogram);
-										}
+			},
+			initiateFundraising() {
+				if (this.myinfo.my_level < 3) {
+					this.$refs["DialogBox"]
+						.confirm({
+							title: "提示",
+							content: "您当前的等级为" + this.myinfo.my_level + "级,需要达到3级才能发起募集",
+							DialogType: "inquiry",
+							btn1: "取消",
+							btn2: "去查看等级",
+							animation: 0,
+						})
+						.then((res) => {
+							this.goPage('/pages/my/creativeExpert')
+
+						}, (res) => {});
+					return;
+				}
+				this.goPage('/pages/my/initiateCrowdfunding')
+			},
+			async calculateThemeColor(imageUrl) {
+				if (!imageUrl) {
+					// 如果没有图片,则使用默认样式
+					this.headerBoxStyle = {
+						background: 'linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent)'
+					};
+					return;
+				}
+				console.log('开始计算主题色, imageUrl:', imageUrl);
+				const canvasId = 'themeCanvas';
+				const ctx = uni.createCanvasContext(canvasId, this);
+
+				uni.getImageInfo({
+					src: imageUrl,
+					success: (imageInfo) => {
+						console.log('图片信息获取成功:', imageInfo);
+						const canvasWidth = 100; // 缩小图片以加快处理速度
+						const canvasHeight = Math.floor(canvasWidth * (imageInfo.height / imageInfo
+							.width));
+
+						// 绘制图片到canvas
+						ctx.drawImage(imageInfo.path, 0, 0, canvasWidth, canvasHeight);
+						ctx.draw(false, () => {
+							console.log('Canvas 绘制完成');
+							// 获取像素数据
+							uni.canvasGetImageData({
+								canvasId: canvasId,
+								x: 0,
+								y: 0,
+								width: canvasWidth,
+								height: canvasHeight,
+								success: (res) => {
+									console.log('像素数据获取成功');
+									const pixels = res.data;
+
+									// 使用 RgbQuant 提取主要颜色
+									const quant = new RgbQuant({
+										colors: 16, // 提取16种主要颜色
+										method: 2, // 使用 WuQuant 算法
 									});
-
-									if (dominantColor) {
-										const [r, g, b] = dominantColor.map(value => Math.min(255, Math.max(0, value)));
-										const themeColor = `rgba(${r}, ${g}, ${b}, 0.5)`;
-										console.log('计算出的主题色 (Dominant):', themeColor);
-
-										// 更新 header-box 的背景样式
-										this.headerBoxStyle = {
-											background: `linear-gradient(to bottom, ${themeColor}, transparent)`
-										};
+									quant.sample(pixels);
+									const palette = quant.quantize();
+
+									if (quant.vboxes && quant.vboxes.length > 0) {
+										let dominantColor = null;
+										let maxPopulation = 0;
+
+										// 找到像素数最多的颜色区域
+										quant.vboxes.forEach(vbox => {
+											const population = vbox.size(quant
+												.histogram);
+											if (population > maxPopulation) {
+												maxPopulation = population;
+												dominantColor = vbox.color(
+													quant.histogram);
+											}
+										});
+
+										if (dominantColor) {
+											const [r, g, b] = dominantColor.map(
+												value => Math.min(255, Math.max(0,
+													value)));
+											const themeColor =
+												`rgba(${r}, ${g}, ${b}, 0.5)`;
+											console.log('计算出的主题色 (Dominant):',
+												themeColor);
+
+											// 更新 header-box 的背景样式
+											this.headerBoxStyle = {
+												background: `linear-gradient(to bottom, ${themeColor}, transparent)`
+											};
+										}
 									}
+								},
+								fail: (err) => {
+									console.error('获取像素数据失败:', err);
 								}
-							},
-							fail: (err) => {
-								console.error('获取像素数据失败:', err);
-							}
-						});
-					});
-				},
-				fail: (err) => {
-					console.error('获取图片信息失败:', err);
-				}
-			});
-		},
-		async loadInfo() {
-			console.log({
-				uuid: getApp().globalData.uuid,
-				skey: getApp().globalData.skey,
-			});
-			uni.request({
-				url: this.$apiHost + "/User/getinfo",
-				data: {
-					uuid: getApp().globalData.uuid,
-					skey: getApp().globalData.skey,
-				},
-				header: {
-					"content-type": "application/json",
-					sign: getApp().globalData.headerSign,
-				},
-				success: (res) => {
-					console.log("----:", JSON.parse(JSON.stringify(res.data)));
-					if (res.data) {
-
-						this.shareTitle = res.data.nickname
-						this.shareDesc = res.data.content
-						this.shareImg = res.data.avator
-						this.userId = res.data.user_id
-					}
-					if (res.data.need_login == "yes") {
-						// getApp().globalData.skey = "";
-						// getApp().globalData.uuid = "";
-
-						uni.removeStorageSync("wapptoken");
-						uni.redirectTo({
-							url: "/pages/login/login",
+							});
 						});
-						return;
+					},
+					fail: (err) => {
+						console.error('获取图片信息失败:', err);
 					}
-					if (res.data.aihao) {
-						this.aihao_tags = res.data.aihao.split(",");
-					}
-					this.myinfo = res.data;
-					this.bgImage = res.data.bgimg;
-					// 在获取到背景图片后,计算主题色
-					// this.calculateThemeColor(this.bgImage);
-				},
-				complete: (com) => {
-					// uni.hideLoading();
-				},
-				fail: (e) => {
-					console.log("----e:", e);
-				},
-			});
-
-			uni.request({
-				url: this.$apiHost + "/Member/getinfoData",
-				data: {
+				});
+			},
+			async loadInfo() {
+				console.log({
 					uuid: getApp().globalData.uuid,
 					skey: getApp().globalData.skey,
-				},
-				header: {
-					"content-type": "application/json",
-					sign: getApp().globalData.headerSign,
-				},
-				success: async (res) => {
-					console.log("----:", JSON.parse(JSON.stringify(res.data)));
-					if (res.data) {
-						this.bgImage = res.data.bgimg;
-						if (this.bgImage) {
-							// 计算主题色并更新蒙版背景
-							// const gradient = await this.calculateThemeColor(this.bgImage);
-							const gradient = `linear-gradient(to bottom,transparent, rgba(0, 0, 0, .8))`;
-							this.headerBoxStyle = {
-								background: gradient
-							};
+				});
+				uni.request({
+					url: this.$apiHost + "/User/getinfo",
+					data: {
+						uuid: getApp().globalData.uuid,
+						skey: getApp().globalData.skey,
+					},
+					header: {
+						"content-type": "application/json",
+						sign: getApp().globalData.headerSign,
+					},
+					success: (res) => {
+						console.log("----:", JSON.parse(JSON.stringify(res.data)));
+						if (res.data) {
+
+							this.shareTitle = res.data.nickname
+							this.shareDesc = res.data.content
+							this.shareImg = res.data.avator
+							this.userId = res.data.user_id
 						}
-					}
-				},
-				complete: (com) => {
-					// uni.hideLoading();
-				},
-				fail: (e) => {
-					console.log("----e:", e);
-				},
-			});
-		},
-		onLogout() {
-			let that = this;
-			this.$refs["DialogBox"]
-				.confirm({
-					title: "提示",
-					content: "确定退出吗?",
-					DialogType: "inquiry",
-					btn1: "取消",
-					btn2: "退出",
-					animation: 0,
-				})
-				.then((res) => {
-					uni.request({
-						url: that.$apiHost + "/My/logout",
-						data: {
-							uuid: getApp().globalData.uuid,
-							skey: getApp().globalData.skey,
-						},
-						header: {
-							"content-type": "application/json",
-							sign: getApp().globalData.headerSign,
-						},
-						success: (res) => {
-							console.log("----:", res.data);
+						if (res.data.need_login == "yes") {
 							// getApp().globalData.skey = "";
 							// getApp().globalData.uuid = "";
+
 							uni.removeStorageSync("wapptoken");
 							uni.redirectTo({
 								url: "/pages/login/login",
 							});
-						},
-						complete: (com) => {
-							// uni.hideLoading();
-						},
-						fail: (e) => {
-							console.log("----e:", e);
-						},
-					});
-				});
-		},
-		switchTab(index) {
-			this.activeTab = index;
-			this.offset = 0;
-			this.hasMore = true;
-			this.worksList = [];
-			this.loadWorksList();
-		},
-		loadWorksList() {
-			if (this.isLoading) return;
-			this.isLoading = true;
-			this.isDataLoaded = false;
-
-			// 根据activeTab选择不同的API
-			let apiUrl = "";
-			if (this.firstLevelNavActive == 0) {
-				if (this.activeTab === 0) {
-					apiUrl = "/Work/getlist";
-				} else {
-					apiUrl = "/WorkAI/getMyQueueList";
-				}
-			} else if (this.firstLevelNavActive == 1) {
-				apiUrl = "/Article/getlist";
-			}
-			uni.request({
-				url: this.$apiHost + apiUrl,
-				data: {
-					uuid: getApp().globalData.uuid,
-					skey: getApp().globalData.skey,
-					type: "my",
-					offset: this.offset,
-					status: this.activeTab === 0 ? 1 : undefined,
-				},
-				header: {
-					"content-type": "application/json",
-					sign: getApp().globalData.headerSign,
-				},
-				success: (res) => {
-					console.log("列表数据:", JSON.parse(JSON.stringify(res.data)));
-					if (res.data.success == "yes" && res.data.list) {
-						if (res.data.list.length > 0) {
-							this.worksList = [...this.worksList, ...res.data.list];
-							this.offset += res.data.list.length;
+							return;
 						}
+						if (res.data.aihao) {
+							this.aihao_tags = res.data.aihao.split(",");
+						}
+						this.myinfo = res.data;
+						getApp().globalData.user_id = res.data.user_id;
+						// this.bgImage = res.data.bgimg;
+						// 在获取到背景图片后,计算主题色
+						// this.calculateThemeColor(this.bgImage);
+					},
+					complete: (com) => {
+						// uni.hideLoading();
+					},
+					fail: (e) => {
+						console.log("----e:", e);
+					},
+				});
 
-						if (res.data.list.length < 20) {
-							this.hasMore = false;
+				uni.request({
+					url: this.$apiHost + "/Member/getinfoData",
+					data: {
+						uuid: getApp().globalData.uuid,
+						skey: getApp().globalData.skey,
+					},
+					header: {
+						"content-type": "application/json",
+						sign: getApp().globalData.headerSign,
+					},
+					success: async (res) => {
+						console.log("----:", JSON.parse(JSON.stringify(res.data)));
+						if (res.data) {
+							this.bgImage = res.data.bgimg;
+							if (this.bgImage) {
+								// 计算主题色并更新蒙版背景
+								// const gradient = await this.calculateThemeColor(this.bgImage);
+								const gradient =
+									`linear-gradient(to bottom,transparent, rgba(0, 0, 0, .8))`;
+								this.headerBoxStyle = {
+									background: gradient
+								};
+							}
 						}
+					},
+					complete: (com) => {
+						// uni.hideLoading();
+					},
+					fail: (e) => {
+						console.log("----e:", e);
+					},
+				});
+			},
+			onLogout() {
+				let that = this;
+				this.$refs["DialogBox"]
+					.confirm({
+						title: "提示",
+						content: "确定退出吗?",
+						DialogType: "inquiry",
+						btn1: "取消",
+						btn2: "退出",
+						animation: 0,
+					})
+					.then((res) => {
+						uni.request({
+							url: that.$apiHost + "/My/logout",
+							data: {
+								uuid: getApp().globalData.uuid,
+								skey: getApp().globalData.skey,
+							},
+							header: {
+								"content-type": "application/json",
+								sign: getApp().globalData.headerSign,
+							},
+							success: (res) => {
+								console.log("----:", res.data);
+								// getApp().globalData.skey = "";
+								// getApp().globalData.uuid = "";
+								uni.removeStorageSync("wapptoken");
+								uni.redirectTo({
+									url: "/pages/login/login",
+								});
+							},
+							complete: (com) => {
+								// uni.hideLoading();
+							},
+							fail: (e) => {
+								console.log("----e:", e);
+							},
+						});
+					});
+			},
+			switchTab(index) {
+				this.activeTab = index;
+				this.offset = 0;
+				this.hasMore = true;
+				this.worksList = [];
+				this.loadWorksList();
+			},
+			loadWorksList() {
+				if (this.isLoading) return;
+				this.isLoading = true;
+				this.isDataLoaded = false;
+
+				// 根据activeTab选择不同的API
+				let apiUrl = "";
+				if (this.firstLevelNavActive == 0) {
+					if (this.activeTab === 0) {
+						apiUrl = "/Work/getlist";
 					} else {
-						this.hasMore = false;
-						this.worksList = [];
+						apiUrl = "/WorkAI/getMyQueueList";
 					}
+				} else if (this.firstLevelNavActive == 1) {
+					apiUrl = "/Article/getlist";
+				}
+				uni.request({
+					url: this.$apiHost + apiUrl,
+					data: {
+						uuid: getApp().globalData.uuid,
+						skey: getApp().globalData.skey,
+						type: "my",
+						offset: this.offset,
+						status: this.activeTab === 0 ? 1 : undefined,
+					},
+					header: {
+						"content-type": "application/json",
+						sign: getApp().globalData.headerSign,
+					},
+					success: (res) => {
+						console.log("列表数据:", JSON.parse(JSON.stringify(res.data)));
+						if (res.data.success == "yes" && res.data.list) {
+							if (res.data.list.length > 0) {
+								this.worksList = [...this.worksList, ...res.data.list];
+								this.offset += res.data.list.length;
+							}
 
-					if (this.activeTab === 0) {
-						this.updateDataList();
-					}
-					console.log("作品列表数据:", this.worksList);
-				},
-				complete: () => {
-					this.isLoading = false;
-					this.isDataLoaded = true;
-				},
-				fail: (e) => {
-					console.log("请求列表失败:", e);
-					this.isLoading = false;
-					this.isDataLoaded = true;
-					this.worksList = [];
-				},
-			});
-		},
-		firstLevelNavActiveSwitch(n) {
-			this.firstLevelNavActive = n;
-			this.offset = 0;
-			this.hasMore = true;
-			this.worksList = [];
-			if (this.firstLevelNavActive == 0) {
-				this.activeTab = 0;
-			}
-			this.loadWorksList();
-		},
+							if (res.data.list.length < 20) {
+								this.hasMore = false;
+							}
+						} else {
+							this.hasMore = false;
+							this.worksList = [];
+						}
 
-		loadMoreWorks() {
-			if (this.hasMore && !this.isLoading) {
+						if (this.activeTab === 0) {
+							this.updateDataList();
+						}
+						console.log("作品列表数据:", this.worksList);
+					},
+					complete: () => {
+						this.isLoading = false;
+						this.isDataLoaded = true;
+					},
+					fail: (e) => {
+						console.log("请求列表失败:", e);
+						this.isLoading = false;
+						this.isDataLoaded = true;
+						this.worksList = [];
+					},
+				});
+			},
+			firstLevelNavActiveSwitch(n) {
+				this.firstLevelNavActive = n;
+				this.offset = 0;
+				this.hasMore = true;
+				this.worksList = [];
+				if (this.firstLevelNavActive == 0) {
+					this.activeTab = 0;
+				}
 				this.loadWorksList();
-			}
-		},
-		updateDataList() {
-			this.data_list = this.worksList.map((item) => {
-				return {
-					url: item.images || item.img_url || item.url || "../../static/logo.png",
-					title: item.title || item.description || "作品",
-					id: item.id,
-				};
-			});
-		},
-		goWork(item) {
-			uni.$emit("check_login", () => { });
-			// , //任务状态(1:排队中,3:生成失败,4:生成失败,9:创作完成)
-			if (this.activeTab == 0) {
-				uni.navigateTo({
-					// url: "/pages/index/workDetail?id=" + item.id,
-					url: "/pages/makedetail/makeDetail?id=" +
-						item.queue_id +
-						"&queueId=" +
-						item.id,
+			},
+
+			loadMoreWorks() {
+				if (this.hasMore && !this.isLoading) {
+					this.loadWorksList();
+				}
+			},
+			updateDataList() {
+				this.data_list = this.worksList.map((item) => {
+					return {
+						url: item.images || item.img_url || item.url || "../../static/logo.png",
+						title: item.title || item.description || "作品",
+						id: item.id,
+					};
 				});
-			} else {
-				if (item.status >= 9) {
+			},
+			goWork(item) {
+				uni.$emit("check_login", () => {});
+				// , //任务状态(1:排队中,3:生成失败,4:生成失败,9:创作完成)
+				if (this.activeTab == 0) {
 					uni.navigateTo({
-						url: "/pages/makedetail/makeDetail?id=" + item.id,
+						// url: "/pages/index/workDetail?id=" + item.id,
+						url: "/pages/makedetail/makeDetail?id=" +
+							item.queue_id +
+							"&queueId=" +
+							item.id,
 					});
-				}
-				if (item.status < 9 && item.status != 3 && item.status != 4) {
-					// <!-- <text v-if="item.task_type === 1">灵感创作</text>
-					// <text v-else-if="item.task_type === 2">音乐</text> -->
-					var url = "";
-					if (item.task_type === 1) {
-						url = "/makedetail/makeImgDetail";
-					}
-					if (item.task_type === 2) {
-						url = "/makedetail/makeMusicDetail";
-					}
-					if (url) {
+				} else {
+					if (item.status >= 9) {
 						uni.navigateTo({
-							url: "/pages" + url + "?id=" + item.id,
+							url: "/pages/makedetail/makeDetail?id=" + item.id,
 						});
 					}
+					if (item.status < 9 && item.status != 3 && item.status != 4) {
+						// <!-- <text v-if="item.task_type === 1">灵感创作</text>
+						// <text v-else-if="item.task_type === 2">音乐</text> -->
+						var url = "";
+						if (item.task_type === 1) {
+							url = "/makedetail/makeImgDetail";
+						}
+						if (item.task_type === 2) {
+							url = "/makedetail/makeMusicDetail";
+						}
+						if (url) {
+							uni.navigateTo({
+								url: "/pages" + url + "?id=" + item.id,
+							});
+						}
+					}
 				}
-			}
-		},
-		goWork2(item) {
-			uni.navigateTo({
-				// url: "/pages/index/workDetail?id=" + item.id,
-				url: "/pages/index/articleDetail?id=" + item.id,
-			});
-		},
-		navigateToSettings() {
-			uni.$emit("check_login", () => {
+			},
+			goWork2(item) {
 				uni.navigateTo({
-					url: "/pages/my/setting",
+					// url: "/pages/index/workDetail?id=" + item.id,
+					url: "/pages/index/articleDetail?id=" + item.id,
 				});
-			});
-		},
-		navigateToFollow() {
-			uni.navigateTo({
-				url: "/pages/my/follow",
-			});
-		},
-		formatText(text) {
-			if (!text) return '';
-			return text.length > 20 ? text.substring(0, 20) + '...' : text;
-		},
-		scientificCounting(num) {
-			if (!num) {
-				return 0;
-			}
-			if (num < 1000) {
-				return num;
-			} else if (num < 1000000) {
-				return (num / 1000).toFixed(1) + 'k';
-			} else if (num < 1000000000) {
-				return (num / 1000000).toFixed(1) + 'M';
-			} else {
-				return (num / 1000000000).toFixed(1) + 'B';
-			}
-		},
-		// 获取label-box高度的方法
-		getLabelBoxHeight() {
-			setTimeout(() => {
-				const query = uni.createSelectorQuery();
-				query.select('#labelBox').boundingClientRect(data => {
-					if (data) {
-						this.labelBoxHeight = data.height;
-						console.log('label-box高度:', this.labelBoxHeight);
-					}
-				}).exec();
-			}, 100);
+			},
+			navigateToSettings() {
+				uni.$emit("check_login", () => {
+					uni.navigateTo({
+						url: "/pages/my/setting",
+					});
+				});
+			},
+			navigateToFollow() {
+				uni.navigateTo({
+					url: "/pages/my/follow",
+				});
+			},
+			formatText(text) {
+				if (!text) return '';
+				return text.length > 20 ? text.substring(0, 20) + '...' : text;
+			},
+			scientificCounting(num) {
+				if (!num) {
+					return 0;
+				}
+				if (num < 1000) {
+					return num;
+				} else if (num < 1000000) {
+					return (num / 1000).toFixed(1) + 'k';
+				} else if (num < 1000000000) {
+					return (num / 1000000).toFixed(1) + 'M';
+				} else {
+					return (num / 1000000000).toFixed(1) + 'B';
+				}
+			},
+			// 获取label-box高度的方法
+			getLabelBoxHeight() {
+				setTimeout(() => {
+					const query = uni.createSelectorQuery();
+					query.select('#labelBox').boundingClientRect(data => {
+						if (data) {
+							this.labelBoxHeight = data.height;
+							console.log('label-box高度:', this.labelBoxHeight);
+						}
+					}).exec();
+				}, 100);
+			},
 		},
-	},
-};
+	};
 </script>
 
 <style scoped lang="scss">
-@import "my.scss";
-
-.empty-state {
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	justify-content: center;
-	padding: 60rpx 0;
-	margin-top: 40rpx;
-	background: #FFFFFF;
-	border-radius: 20rpx;
-	width: 710rpx;
-
-	.empty-image {
-		width: 240rpx;
-		height: 240rpx;
-		margin-bottom: 30rpx;
-	}
+	@import "my.scss";
+
+	.empty-state {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		padding: 60rpx 0;
+		margin-top: 40rpx;
+		background: #FFFFFF;
+		border-radius: 20rpx;
+		width: 710rpx;
+
+		.empty-image {
+			width: 240rpx;
+			height: 240rpx;
+			margin-bottom: 30rpx;
+		}
 
-	.empty-text {
-		font-size: 32rpx;
-		color: #333333;
-		margin-bottom: 16rpx;
-		font-weight: 500;
-	}
+		.empty-text {
+			font-size: 32rpx;
+			color: #333333;
+			margin-bottom: 16rpx;
+			font-weight: 500;
+		}
 
-	.empty-subtext {
-		font-size: 28rpx;
-		color: #999999;
+		.empty-subtext {
+			font-size: 28rpx;
+			color: #999999;
+		}
 	}
-}
 </style>