Browse Source

完成权限弹窗功能 分享功能 修复部分bug

XSXS 2 months ago
parent
commit
f57b53804b

+ 223 - 0
common/encryption.js

@@ -0,0 +1,223 @@
+/**
+ * 高级加密与解密工具
+ * 提供字符串和对象的加密解密功能
+ */
+
+// 密钥(生产环境应更换为强密钥)
+const DEFAULT_KEY = 'mengchuangPlanet2025';
+
+/**
+ * 简单的字符串加密
+ * @param {String} str - 要加密的字符串
+ * @param {String} key - 加密密钥(可选)
+ * @returns {String} - 加密后的字符串
+ */
+export function encryptString(str, key = DEFAULT_KEY) {
+  if (!str) return '';
+  
+  try {
+    // 生成密钥字节序列
+    const keyBytes = generateKeyBytes(key);
+    
+    // 加密
+    let encrypted = '';
+    for (let i = 0; i < str.length; i++) {
+      const charCode = str.charCodeAt(i);
+      const keyByte = keyBytes[i % keyBytes.length];
+      encrypted += String.fromCharCode(charCode ^ keyByte);
+    }
+    
+    // Base64编码
+    return btoa(encrypted);
+  } catch (e) {
+    console.error('字符串加密失败:', e);
+    return '';
+  }
+}
+
+/**
+ * 解密字符串
+ * @param {String} encryptedStr - 加密后的字符串
+ * @param {String} key - 解密密钥(需与加密密钥相同)
+ * @returns {String} - 解密后的字符串
+ */
+export function decryptString(encryptedStr, key = DEFAULT_KEY) {
+  if (!encryptedStr) return '';
+  
+  try {
+    // Base64解码
+    const encrypted = atob(encryptedStr);
+    
+    // 生成密钥字节序列
+    const keyBytes = generateKeyBytes(key);
+    
+    // 解密
+    let decrypted = '';
+    for (let i = 0; i < encrypted.length; i++) {
+      const charCode = encrypted.charCodeAt(i);
+      const keyByte = keyBytes[i % keyBytes.length];
+      decrypted += String.fromCharCode(charCode ^ keyByte);
+    }
+    
+    return decrypted;
+  } catch (e) {
+    console.error('字符串解密失败:', e);
+    return '';
+  }
+}
+
+/**
+ * 加密对象
+ * @param {Object} obj - 要加密的对象
+ * @param {String} key - 加密密钥(可选)
+ * @returns {String} - 加密后的字符串
+ */
+export function encryptObject(obj, key = DEFAULT_KEY) {
+  if (!obj) return '';
+  
+  try {
+    // 将对象转为JSON字符串
+    const jsonStr = JSON.stringify(obj);
+    
+    // 加密JSON字符串
+    return encryptString(jsonStr, key);
+  } catch (e) {
+    console.error('对象加密失败:', e);
+    return '';
+  }
+}
+
+/**
+ * 解密对象
+ * @param {String} encryptedStr - 加密后的字符串
+ * @param {String} key - 解密密钥(需与加密密钥相同)
+ * @returns {Object|null} - 解密后的对象,失败返回null
+ */
+export function decryptObject(encryptedStr, key = DEFAULT_KEY) {
+  if (!encryptedStr) return null;
+  
+  try {
+    // 解密JSON字符串
+    const jsonStr = decryptString(encryptedStr, key);
+    
+    // 解析JSON
+    return JSON.parse(jsonStr);
+  } catch (e) {
+    console.error('对象解密失败:', e);
+    return null;
+  }
+}
+
+/**
+ * 生成安全的URL参数
+ * @param {Object} params - 参数对象
+ * @param {String} key - 加密密钥(可选)
+ * @returns {String} - 加密后的URL参数字符串
+ */
+export function generateSecureUrlParams(params, key = DEFAULT_KEY) {
+  if (!params) return '';
+  
+  try {
+    // 加密对象
+    const encrypted = encryptObject(params, key);
+    
+    // URL安全编码
+    return encodeURIComponent(encrypted);
+  } catch (e) {
+    console.error('URL参数加密失败:', e);
+    return '';
+  }
+}
+
+/**
+ * 解析安全的URL参数
+ * @param {String} encryptedParams - 加密的URL参数字符串
+ * @param {String} key - 解密密钥(需与加密密钥相同)
+ * @returns {Object|null} - 解密后的参数对象
+ */
+export function parseSecureUrlParams(encryptedParams, key = DEFAULT_KEY) {
+  if (!encryptedParams) return null;
+  
+  try {
+    // URL解码
+    const decoded = decodeURIComponent(encryptedParams);
+    
+    // 解密对象
+    return decryptObject(decoded, key);
+  } catch (e) {
+    console.error('URL参数解密失败:', e);
+    return null;
+  }
+}
+
+/**
+ * 生成密钥的字节序列
+ * @param {String} key - 密钥
+ * @returns {Array} - 字节序列
+ * @private
+ */
+function generateKeyBytes(key) {
+  const bytes = [];
+  for (let i = 0; i < key.length; i++) {
+    bytes.push(key.charCodeAt(i));
+  }
+  return bytes;
+}
+
+/**
+ * 生成随机密钥
+ * @param {Number} length - 密钥长度
+ * @returns {String} - 随机密钥
+ */
+export function generateRandomKey(length = 32) {
+  const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+  let result = '';
+  
+  for (let i = 0; i < length; i++) {
+    result += chars.charAt(Math.floor(Math.random() * chars.length));
+  }
+  
+  return result;
+}
+
+/**
+ * 使用随机盐值加密敏感数据
+ * @param {String} data - 要加密的数据
+ * @param {String} key - 加密密钥(可选)
+ * @returns {Object} - 包含加密数据和盐值的对象
+ */
+export function encryptWithSalt(data, key = DEFAULT_KEY) {
+  // 生成随机盐值
+  const salt = generateRandomKey(16);
+  
+  // 使用盐值和密钥加密
+  const encrypted = encryptString(data, salt + key);
+  
+  return {
+    data: encrypted,
+    salt: salt
+  };
+}
+
+/**
+ * 使用盐值解密数据
+ * @param {String} encryptedData - 加密后的数据
+ * @param {String} salt - 盐值
+ * @param {String} key - 解密密钥(可选)
+ * @returns {String} - 解密后的数据
+ */
+export function decryptWithSalt(encryptedData, salt, key = DEFAULT_KEY) {
+  return decryptString(encryptedData, salt + key);
+}
+
+export default {
+  encryptString,
+  decryptString,
+  encryptObject,
+  decryptObject,
+  generateSecureUrlParams,
+  parseSecureUrlParams,
+  generateRandomKey,
+  encryptWithSalt,
+  decryptWithSalt
+} 

+ 48 - 58
common/permission.js

@@ -355,27 +355,66 @@ class PermissionManager {
     }
   }
 
+  /**
+   * 请求权限
+   * @param {string} permissionType 权限类型
+   * @param {Object} options 配置选项
+   * @returns {Promise<boolean>} 是否获得权限
+   */
   static async request(permissionType, options = {}) {
-    const config = PERMISSION_CONFIG[permissionType];
+    const config = getPermissionConfig(permissionType, options);
     if (!config) return false;
 
+    // 先检查权限
     const hasPermission = await this.check(permissionType);
     if (hasPermission) return true;
 
-    const confirmed = await showPermissionDialog({
-      title: options.title || config.title,
-      content: options.describe || config.describe
-    });
-
-    if (!confirmed) return false;
+    // 显示权限申请对话框
+    const dialogResult = await showPermissionDialog(config);
+    if (!dialogResult) return false;
 
+    // #ifdef APP-PLUS
     if (isIos) {
-      const handler = IOS_PERMISSION_HANDLERS[config.iosHandler];
-      return handler ? await handler.request() : false;
+      // iOS权限请求逻辑
+      return false;
     } else {
+      // Android权限请求
       const result = await ANDROID_PERMISSION_HANDLERS.request(config.androidPermission);
+      
+      // 如果权限被永久拒绝,引导用户去设置页面
+      if (result === -1) {
+        return new Promise((resolve) => {
+          uni.showModal({
+            title: '权限申请',
+            content: `${config.permissionName}权限被永久拒绝,请到设置中手动开启`,
+            confirmText: '去设置',
+            cancelText: '取消',
+            success: function(res) {
+              if (res.confirm) {
+                // 跳转到应用权限设置页面
+                if (plus.os.name.toLowerCase() === 'android') {
+                  const main = plus.android.runtimeMainActivity();
+                  const Intent = plus.android.importClass('android.content.Intent');
+                  const Settings = plus.android.importClass('android.provider.Settings');
+                  const Uri = plus.android.importClass('android.net.Uri');
+                  const intent = new Intent();
+                  intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+                  const uri = Uri.fromParts('package', main.getPackageName(), null);
+                  intent.setData(uri);
+                  main.startActivity(intent);
+                }
+              }
+              resolve(false);
+            }
+          });
+        });
+      }
+      
       return result === 1;
     }
+    // #endif
+
+    return false;
   }
 
   static openSettings() {
@@ -404,54 +443,6 @@ class PermissionManager {
 // 显示权限说明弹窗
 const showPermissionDialog = (options) => {
   return new Promise((resolve) => {
-    // #ifdef APP-PLUS
-    // 获取当前页面实例
-    const pages = getCurrentPages();
-    const currentPage = pages[pages.length - 1];
-    
-    if (currentPage && currentPage.$vm && currentPage.$vm.$refs && currentPage.$vm.$refs.customConfirm) {
-      const customConfirm = currentPage.$vm.$refs.customConfirm;
-      if (typeof customConfirm.confirm === 'function') {
-        customConfirm.confirm({
-          title: options.title || '权限申请',
-          content: options.content || options.describe,
-          btn1: '暂不授权',
-          btn2: '去授权',
-          DialogType: 'inquiry',
-          animation: 0
-        }).then(res => {
-          resolve(res.isConfirm);
-        }).catch(() => {
-          resolve(false);
-        });
-      } else {
-        // 降级使用 uni.showModal
-        uni.showModal({
-          title: options.title || '权限申请',
-          content: options.content || options.describe,
-          cancelText: '暂不授权',
-          confirmText: '去授权',
-          success: (res) => {
-            resolve(res.confirm);
-          }
-        });
-      }
-    } else {
-      // 降级使用 uni.showModal
-      uni.showModal({
-        title: options.title || '权限申请',
-        content: options.content || options.describe,
-        cancelText: '暂不授权',
-        confirmText: '去授权',
-        success: (res) => {
-          resolve(res.confirm);
-        }
-      });
-    }
-    // #endif
-
-    // #ifndef APP-PLUS
-    // 非 APP 环境使用 uni.showModal
     uni.showModal({
       title: options.title || '权限申请',
       content: options.content || options.describe,
@@ -461,7 +452,6 @@ const showPermissionDialog = (options) => {
         resolve(res.confirm);
       }
     });
-    // #endif
   });
 };
 

+ 356 - 56
common/util.js

@@ -1,89 +1,389 @@
 function friendlyDate(timestamp) {
-    var formats = {
-        'year': '%n% 年前',
-        'month': '%n% 月前',
-        'day': '%n% 天前',
-        'hour': '%n% 小时前',
-        'minute': '%n% 分钟前',
-        'second': '%n% 秒前',
-    };
+  var formats = {
+    'year': '%n% 年前',
+    'month': '%n% 月前',
+    'day': '%n% 天前',
+    'hour': '%n% 小时前',
+    'minute': '%n% 分钟前',
+    'second': '%n% 秒前',
+  };
 
-    var now = Date.now();
-    var seconds = Math.floor((now - timestamp) / 1000);
-    var minutes = Math.floor(seconds / 60);
-    var hours = Math.floor(minutes / 60);
-    var days = Math.floor(hours / 24);
-    var months = Math.floor(days / 30);
-    var years = Math.floor(months / 12);
+  var now = Date.now();
+  var seconds = Math.floor((now - timestamp) / 1000);
+  var minutes = Math.floor(seconds / 60);
+  var hours = Math.floor(minutes / 60);
+  var days = Math.floor(hours / 24);
+  var months = Math.floor(days / 30);
+  var years = Math.floor(months / 12);
 
-    var diffType = '';
-    var diffValue = 0;
-    if (years > 0) {
-        diffType = 'year';
-        diffValue = years;
+  var diffType = '';
+  var diffValue = 0;
+  if (years > 0) {
+    diffType = 'year';
+    diffValue = years;
+  } else {
+    if (months > 0) {
+      diffType = 'month';
+      diffValue = months;
     } else {
-        if (months > 0) {
-            diffType = 'month';
-            diffValue = months;
+      if (days > 0) {
+        diffType = 'day';
+        diffValue = days;
+      } else {
+        if (hours > 0) {
+          diffType = 'hour';
+          diffValue = hours;
         } else {
-            if (days > 0) {
-                diffType = 'day';
-                diffValue = days;
-            } else {
-                if (hours > 0) {
-                    diffType = 'hour';
-                    diffValue = hours;
-                } else {
-                    if (minutes > 0) {
-                        diffType = 'minute';
-                        diffValue = minutes;
-                    } else {
-                        diffType = 'second';
-                        diffValue = seconds === 0 ? (seconds = 1) : seconds;
-                    }
-                }
-            }
+          if (minutes > 0) {
+            diffType = 'minute';
+            diffValue = minutes;
+          } else {
+            diffType = 'second';
+            diffValue = seconds === 0 ? (seconds = 1) : seconds;
+          }
         }
+      }
     }
-    return formats[diffType].replace('%n%', diffValue);
+  }
+  return formats[diffType].replace('%n%', diffValue);
 }
 
 function getStorage(key) {
   //#ifdef H5
-    const value = localStorage.getItem(key);
-    return value !== null && value !== undefined ? value : undefined;
+  const value = localStorage.getItem(key);
+  return value !== null && value !== undefined ? value : undefined;
   //#endif
   //#ifndef H5
-    const value = uni.getStorageSync(key);
-    return value !== null && value !== undefined ? value : undefined;
+  const value = uni.getStorageSync(key);
+  return value !== null && value !== undefined ? value : undefined;
   //#endif
 }
 
- 
+
 function setStorage(key, value) {
   //#ifdef H5
-    localStorage.setItem(key, value);
+  localStorage.setItem(key, value);
   //#endif
   //#ifndef H5
-    return uni.setStorageSync(key, value);
+  return uni.setStorageSync(key, value);
   //#endif
 }
 
- 
+
 
 function removeStorage(key) {
   //#ifdef H5
-    localStorage.removeItem(key);
+  localStorage.removeItem(key);
   //#endif
   //#ifndef H5
-    return uni.removeStorageSync(key);
+  return uni.removeStorageSync(key);
   //#endif
 }
- 
+// #ifdef APP-PLUS
+// 文字换行
+function drawtext(text, maxWidth) {
+	let textArr = text.split("");
+	let len = textArr.length;
+	// 上个节点
+	let previousNode = 0;
+	// 记录节点宽度
+	let nodeWidth = 0;
+	// 文本换行数组
+	let rowText = [];
+	// 如果是字母,侧保存长度
+	let letterWidth = 0;
+	// 汉字宽度
+	let chineseWidth = 16;
+	// otherFont宽度
+	let otherWidth = 8;
+	for (let i = 0; i < len; i++) {
+		if (/[\u4e00-\u9fa5]|[\uFE30-\uFFA0]/g.test(textArr[i])) {
+			if (letterWidth > 0) {
+				if (nodeWidth + chineseWidth + letterWidth * otherWidth > maxWidth) {
+					rowText.push({
+						type: "text",
+						content: text.substring(previousNode, i)
+					});
+					previousNode = i;
+					nodeWidth = chineseWidth;
+					letterWidth = 0;
+				} else {
+					nodeWidth += chineseWidth + letterWidth * otherWidth;
+					letterWidth = 0;
+				}
+			} else {
+				if (nodeWidth + chineseWidth > maxWidth) {
+					rowText.push({
+						type: "text",
+						content: text.substring(previousNode, i)
+					});
+					previousNode = i;
+					nodeWidth = chineseWidth;
+				} else {
+					nodeWidth += chineseWidth;
+				}
+			}
+		} else {
+			if (/\n/g.test(textArr[i])) {
+				rowText.push({
+					type: "break",
+					content: text.substring(previousNode, i)
+				});
+				previousNode = i + 1;
+				nodeWidth = 0;
+				letterWidth = 0;
+			} else if (textArr[i] == "\\" && textArr[i + 1] == "n") {
+				rowText.push({
+					type: "break",
+					content: text.substring(previousNode, i)
+				});
+				previousNode = i + 2;
+				nodeWidth = 0;
+				letterWidth = 0;
+			} else if (/[a-zA-Z0-9]/g.test(textArr[i])) {
+				letterWidth += 1;
+				if (nodeWidth + letterWidth * otherWidth > maxWidth) {
+					rowText.push({
+						type: "text",
+						content: text.substring(previousNode, i + 1 - letterWidth)
+					});
+					previousNode = i + 1 - letterWidth;
+					nodeWidth = letterWidth * otherWidth;
+					letterWidth = 0;
+				}
+			} else {
+				if (nodeWidth + otherWidth > maxWidth) {
+					rowText.push({
+						type: "text",
+						content: text.substring(previousNode, i)
+					});
+					previousNode = i;
+					nodeWidth = otherWidth;
+				} else {
+					nodeWidth += otherWidth;
+				}
+			}
+		}
+	}
+	if (previousNode < len) {
+		rowText.push({
+			type: "text",
+			content: text.substring(previousNode, len)
+		});
+	}
+	return rowText;
+}
+// 重写app弹窗
+uni.showModal = function(options) {
+	let optionsObj = Object.assign({
+		title: "提示",
+		content: "自定义内容",
+		align: "center", // 对齐方式 left/center/right
+		cancelText: "取消", // 取消按钮的文字
+		cancelColor: "#8F8F8F", // 取消按钮颜色
+		confirmText: "确定", // 确认按钮文字
+		confirmColor: "#1C79D6", // 确认按钮颜色 
+		showCancel: true, // 是否显示取消按钮,默认为 true
+	}, options);
+	// 以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
+	const screenWidth = plus.screen.resolutionWidth;
+	const screenHeight = plus.screen.resolutionHeight;
+	//弹窗容器宽度
+	const popupViewWidth = screenWidth * 0.8;
+	// 弹窗容器的Padding
+	const viewContentPadding = 20;
 
+	// 弹窗容器的宽度
+	const viewContentWidth = parseInt(popupViewWidth - (viewContentPadding * 2));
+	// 描述的列表
+	const descriptionList = drawtext(optionsObj.content, viewContentWidth);
+	// 弹窗高度
+	let popupViewHeight = 168;
+	// 弹窗遮罩层
+	let maskLayer = new plus.nativeObj.View("maskLayer", { //先创建遮罩层
+		top: '0px',
+		left: '0px',
+		height: '100%',
+		width: '100%',
+		backgroundColor: 'rgba(0,0,0,0.5)'
+	});
+	let popupViewContentList = [{
+		tag: 'font',
+		id: 'title',
+		text: optionsObj.title,
+		textStyles: {
+			size: '18px',
+			color: "#333",
+			weight: "bold",
+			whiteSpace: "normal"
+		},
+		position: {
+			top: viewContentPadding + "px",
+			left: viewContentPadding + "px",
+			width: viewContentWidth + "px",
+			height: "30px",
+		}
+	}];
+	const textHeight = 22;
+	let contentTop = 65;
+	descriptionList.forEach((item, index) => {
+		if (index > 0) {
+			popupViewHeight += textHeight;
+			contentTop += textHeight;
+		}
+		popupViewContentList.push({
+			tag: 'font',
+			id: 'content' + index + 1,
+			text: item.content,
+			textStyles: {
+				size: '16px',
+				color: "#333",
+				lineSpacing: "50%",
+				align: optionsObj.align
+			},
+			position: {
+				top: contentTop + "px",
+				left: viewContentPadding + "px",
+				width: viewContentWidth + "px",
+				height: textHeight + "px",
+			}
+		});
+		if (item.type == "break") {
+			contentTop += 10;
+			popupViewHeight += 10;
+		}
+	});
+	popupViewContentList.push({
+		tag: 'rect',
+		id: 'lineTop',
+		rectStyles: {
+			color: "#f1f1f1",
+		},
+		position: {
+			top: contentTop + 50 + "px",
+			left: "0px",
+			width: "100%",
+			height: "1px",
+		}
+	});
+	if (optionsObj.showCancel) {
+		popupViewContentList.push({
+			tag: 'rect',
+			id: 'line',
+			rectStyles: {
+				color: "#f1f1f1",
+			},
+			position: {
+				top: contentTop + 50 + "px",
+				left: popupViewWidth / 2 + "px",
+				width: "1px",
+				height: "50px",
+			}
+		});
+		popupViewContentList.push({
+			tag: 'font',
+			id: 'cancelText',
+			text: optionsObj.cancelText,
+			textStyles: {
+				size: '16px',
+				color: optionsObj.cancelColor,
+			},
+			position: {
+				top: contentTop + 50 + "px",
+				left: "0px",
+				width: popupViewWidth / 2 + "px",
+				height: "50px",
+			}
+		});
+		popupViewContentList.push({
+			tag: 'font',
+			id: 'confirmText',
+			text: optionsObj.confirmText,
+			textStyles: {
+				size: '16px',
+				color: optionsObj.confirmColor,
+			},
+			position: {
+				top: contentTop + 50 + "px",
+				left: popupViewWidth / 2 + "px",
+				width: popupViewWidth / 2 + "px",
+				height: "50px",
+			}
+		});
+	} else {
+		popupViewContentList.push({
+			tag: 'font',
+			id: 'confirmText',
+			text: optionsObj.confirmText,
+			textStyles: {
+				size: '16px',
+				color: optionsObj.confirmColor,
+			},
+			position: {
+				top: contentTop + 50 + "px",
+				left: "0px",
+				width: "100%",
+				height: "50px",
+			}
+		});
+	}
+	// 弹窗内容
+	let popupView = new plus.nativeObj.View("popupView", { //创建底部图标菜单
+		tag: "rect",
+		top: (screenHeight - popupViewHeight) / 2 + "px",
+		left: '10%',
+		height: popupViewHeight + "px",
+		width: "80%"
+	});
+	// 绘制白色背景
+	popupView.drawRect({
+		color: "#FFFFFF",
+		radius: "8px"
+	}, {
+		top: "0px",
+		height: popupViewHeight + "px",
+	});
+	popupView.draw(popupViewContentList);
+	popupView.addEventListener("click", function(e) {
+		if (optionsObj.showCancel) {
+			if (e.clientY > popupViewHeight - 50 && e.clientX < popupViewWidth / 2) {
+				// 取消
+				maskLayer.close();
+				popupView.close();
+				options.success && options.success({
+					confirm: false,
+					cancel: true
+				});
+			} else if (e.clientY > popupViewHeight - 50 && e.clientX > popupViewWidth / 2) {
+				// 确定
+				maskLayer.close();
+				popupView.close();
+				options.success && options.success({
+					confirm: true,
+					cancel: false
+				});
+			}
+		} else {
+			if (e.clientY > popupViewHeight - 50) {
+				// 确定
+				maskLayer.close();
+				popupView.close();
+				options.success && options.success({
+					confirm: true,
+					cancel: false
+				});
+			}
+		}
+	});
+	// 显示弹窗
+	maskLayer.show();
+	popupView.show();
+	options.complete && options.complete();
+};
+// #endif
 export {
-    friendlyDate,
-    getStorage,
-    setStorage,
-    removeStorage
+  friendlyDate,
+  getStorage,
+  setStorage,
+  removeStorage
 }

+ 19 - 3
components/CommentSection/CommentSection.vue

@@ -39,7 +39,7 @@
 
 <script>
 import CComment from "@/components/cc-comment/cc-comment.vue";
-
+import { getStorage, setStorage, removeStorage } from "@/common/util.js";
 export default {
 	name: 'CommentSection',
 	components: {
@@ -154,9 +154,25 @@ export default {
 			});
 		},
 		openComment() {
+			var isContentRecommendation = getStorage("isContentRecommendation");
+			if (isContentRecommendation != "false") {
+				isContentRecommendation = true;
+			} else {
+				isContentRecommendation = false;
+			}
+			
+			if (isContentRecommendation == false) {
+				uni.showToast({
+					title: '当前无法评论',
+					icon: 'none'
+				});
+				return;
+			}
+			
 			uni.$emit('check_login', () => { 
-			let ccRef = this.$refs["ccRef"];
-			ccRef.newCommentFun();})
+				let ccRef = this.$refs["ccRef"];
+				ccRef.newCommentFun();
+			})
 		},
 		likeFun({ params }, callback) {
 			uni.$emit('check_login', () => {

+ 3 - 1
components/DialogBox/DialogBox.vue

@@ -141,7 +141,8 @@
 				this.hide();
 				this.reject({
 					value: this.options.value,
-					isConfirm: true,
+					isConfirm: false,
+					confirm: false,
 				});
 			},
 			/**
@@ -152,6 +153,7 @@
 				this.resolve({
 					value: this.options.value,
 					isConfirm: true,
+					confirm: true,
 				});
 			},
 		},

+ 41 - 11
components/SharePopup/SharePopup.vue

@@ -15,6 +15,8 @@
 </template>
 
 <script>
+import { generateSecureUrlParams } from '@/common/encryption.js'
+
 export default {
   name: 'ShareModal',
   props: {
@@ -22,9 +24,8 @@ export default {
       type: Boolean,
       default: false
     },
-    shareUrl: {
-      type: String,
-      required: true
+    userId: {
+      default: 0
     },
     shareTitle: {
       type: String,
@@ -32,13 +33,18 @@ export default {
     },
     shareDesc: {
       type: String,
-      default: ''
+      default: '快来加入萌创星球吧!'
     },
     shareImg: {
       type: String,
       default: ''
+    },
+    view: {
+      type: String,
+      default: ''
     }
   },
+  
   data() {
     return {
       shareOptions: [
@@ -48,9 +54,27 @@ export default {
         { id: 'copy', title: '复制链接', icon: '/static/icon/sy_icon_fuzhilianjie.png' },
         { id: 'report', title: '举报', icon: '/static/icon/sy_icon_jubao01.png' },
         { id: 'more', title: '更多', icon: '../../static/icon/sy_icon_gengduo.png' } 
-      ]
+      ],
+      from_id: 0
     }
   },
+  computed: {
+    shareUrl() { 
+      const urlParams = {
+        userId: this.userId,
+        action: this.view,
+        timestamp: new Date().getTime(),
+        from_id: this.from_id
+      }
+      const secureParams = generateSecureUrlParams(urlParams)
+      return `${this.$shareUrl}?params=${secureParams}`
+    }
+  },
+  created() {
+    uni.$emit('check_login', () => { 
+      this.from_id = getApp().globalData.user_id
+    }) 
+  },
   methods: {
     handleClose() {
       this.$emit('close')
@@ -113,7 +137,7 @@ export default {
         type: 0,
         title: this.shareTitle,
         summary: this.shareDesc,
-        imageUrl: this.shareImg,
+        imageUrl: this.shareImg || this.$icon,
         href: this.shareUrl,
         success: () => {
           uni.showToast({
@@ -138,7 +162,7 @@ export default {
             title: this.shareTitle,
             desc: this.shareDesc,
             link: this.shareUrl,
-            imgUrl: this.shareImg,
+            imgUrl: this.shareImg || this.$icon,
             success: () => {
               uni.showToast({
                 title: '分享成功',
@@ -165,7 +189,13 @@ export default {
       // #ifdef MP-WEIXIN
       uni.showShareMenu({
         withShareTicket: true,
-        menus: ['shareAppMessage']
+        menus: ['shareAppMessage'],
+        success: () => {
+          uni.updateShareMenu({
+            withShareTicket: true,
+            isPrivateMessage: true
+          })
+        }
       })
       // #endif
     },
@@ -177,7 +207,7 @@ export default {
         type: 0,
         title: this.shareTitle,
         summary: this.shareDesc,
-        imageUrl: this.shareImg,
+        imageUrl: this.shareImg  || this.$icon,
         href: this.shareUrl,
         success: () => {
           uni.showToast({
@@ -201,7 +231,7 @@ export default {
           wx.updateTimelineShareData({
             title: this.shareTitle,
             link: this.shareUrl,
-            imgUrl: this.shareImg,
+            imgUrl: this.shareImg  || this.$icon,
             success: () => {
               uni.showToast({
                 title: '分享成功',
@@ -251,7 +281,7 @@ export default {
         type: 0,
         title: this.shareTitle,
         summary: this.shareDesc,
-        imageUrl: this.shareImg,
+        imageUrl: this.shareImg  || this.$icon,
         href: this.shareUrl,
         success: () => {
           uni.showToast({

+ 31 - 0
components/cc-comment/cc-comment.vue

@@ -86,6 +86,7 @@
 
 <script>
 import CommonComp from "./componets/common";
+import { getStorage, setStorage, removeStorage } from "@/common/util.js";
 export default {
 	components: {
 		CommonComp
@@ -222,6 +223,21 @@ export default {
 			index2
 		}) {
 			uni.$emit('check_login', () => {
+				var isContentRecommendation = getStorage("isContentRecommendation");
+				if (isContentRecommendation != "false") {
+					isContentRecommendation = true;
+				} else {
+					isContentRecommendation = false;
+				}
+				
+				if (isContentRecommendation == false) {
+					uni.showToast({
+						title: '当前无法评论',
+						icon: 'none'
+					});
+					return;
+				}
+				
 				if (this.isComment == 0) {
 					uni.showToast({
 						title: '暂无评论权限',
@@ -240,6 +256,21 @@ export default {
 		},
 		// 发起新评论
 		newCommentFun() {
+			var isContentRecommendation = getStorage("isContentRecommendation");
+			if (isContentRecommendation != "false") {
+				isContentRecommendation = true;
+			} else {
+				isContentRecommendation = false;
+			}
+			
+			if (isContentRecommendation == false) {
+				uni.showToast({
+					title: '当前无法评论',
+					icon: 'none'
+				});
+				return;
+			}
+			
 			if (this.isComment == 0) {
 				uni.showToast({
 					title: '暂无评论权限',

+ 1 - 4
components/kxj-previewImage/kxj-previewImage.vue

@@ -34,10 +34,7 @@
 </template>
 
 <script>
-	import {
-		requestAndroidPermission,
-		gotoAppPermissionSetting
-	} from '../../pages/index/permission.js'
+ 
 	export default {
 		name: 'ksj-previewImage', //插件名称
 		props: {

+ 6 - 0
main.js

@@ -19,6 +19,12 @@ Vue.config.productionTip = false
 Vue.prototype.$apiHost = 'https://e.zhichao.art/Gapi';
 Vue.prototype.$apiHost2 = 'https://e.zhichao.art/Gapi2';
 Vue.prototype.$isWeb3 = 0;
+// 分享链接
+Vue.prototype.$shareUrl = 'https://e.zhichao.art/share/#/';
+// 分享图标  默认为logo
+Vue.prototype.$icon = 'https://e.zhichao.art/static/logo.png';
+
+
 // Vue.prototype.now = Date.now || function () {  
 //     return new Date().getTime();  
 // };  

+ 71 - 32
pages/index/articleDetail.vue

@@ -45,7 +45,7 @@
 		<template v-if="isMessage">
 			<!--  轮播图部分 -->
 			<uv-swiper v-if="articleInfo.type == 'user'" class="swiper-box" height="1032rpx" :list="swperImages"
-				indicator indicatorMode="dot" bgColor="#fff" :autoplay="false">
+				indicator indicatorMode="dot" bgColor="#fff" :autoplay="false" @click="previewImage">
 			</uv-swiper>
 
 			<!-- 文章内容区域 -->
@@ -139,6 +139,8 @@
 			</view>
 		</CustomPopup>
 		<DialogBox ref="DialogBox"></DialogBox>
+		<SharePopup :visible="showShare" :userId="userId" :share-title="shareTitle" :share-desc="shareDesc" :share-img="shareImg" view="articleDetail"
+			@close="showShare = false" />
 	</view>
 </template>
 
@@ -147,6 +149,7 @@ import htmlParser from "../../common/html-parser";
 import CommentSection from "@/components/CommentSection/CommentSection.vue";
 import previewImage from "@/components/kxj-previewImage/kxj-previewImage.vue"; //引用插件
 import CustomPopup from "@/components/CustomPopup/CustomPopup.vue";
+import SharePopup from "@/components/SharePopup/SharePopup.vue";
 function parseImgs(nodes) {
 	nodes.forEach((node) => {
 		if (node.name === "img" && node.attrs && node.attrs["data-img-size-val"]) {
@@ -166,6 +169,7 @@ export default {
 		previewImage,
 		CommentSection,
 		CustomPopup,
+		SharePopup,
 	},
 	data() {
 		return {
@@ -210,6 +214,11 @@ export default {
 			isItMe: false,
 			sms_id: 0,
 			isMessage: true,
+			showShare: false,
+			shareTitle: "分享标题",
+			shareDesc: "分享描述",
+			shareImg: "https://your-share-image.com/image.jpg",
+			userId: 0,
 		};
 	},
 	onLoad(parms) {
@@ -389,6 +398,12 @@ export default {
 								? true
 								: false;
 
+						// 更新分享相关数据
+						this.shareTitle = this.articleInfo.title || '萌创星球';
+						this.shareDesc = this.articleInfo.content;
+						this.shareImg = this.articleInfo.images;
+						this.userId = this.articleInfo.userID;
+
 						const nodes = htmlParser(res.data.article.content);
 						// #ifdef APP-PLUS-NVUE
 						parseImgs(nodes);
@@ -570,12 +585,15 @@ export default {
 		showActionSheet(n) {
 			uni.$emit('check_login', () => {
 				if (n==0) {
-					this.items = [
-						{
-							text: "分享作品",
-							icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
-						},
-					];
+					// this.items = [
+                    //     {
+                    //         text: "分享作品",
+                    //         icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
+                    //     },
+                    // ];
+					// 如果只有一个分享按钮,直接唤醒分享弹窗
+					this.showShare = true;
+					return;
 				}
 				if (n==1) {
 					this.items = [
@@ -595,12 +613,15 @@ export default {
 					];
 				}
 				if (n==2) {
-					this.items = [
-						{
-							text: "分享消息",
-							icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
-						},
-					];
+					// this.items = [
+                    //     {
+                    //         text: "分享消息",
+                    //         icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
+                    //     },
+                    // ];
+					// 如果只有一个分享按钮,直接唤醒分享弹窗
+					this.showShare = true;
+					return;
 				}
 				this.$refs.actionSheet.show();
 			})
@@ -610,20 +631,16 @@ export default {
 		},
 		handleActionSelect(index, item) {
 			console.log("ActionSheet selected index:", item.text);
-			switch (item.text) {
-				case "分享作品":
-					console.log("分享作品");
-					break;
-				case "修改帖子":
-					console.log("修改帖子");
-					uni.navigateTo({
-						url: "/pages/make/fabuArticle?id=" + this.articleInfo.id,
-					});
-					break;
-				case "删除作品":
-					console.log("删除作品");
-					this.deleteArticle();
-					break;
+			if (item.text === "分享作品") {
+				this.showShare = true;
+			} else if (item.text === "修改帖子") {
+				console.log("修改帖子");
+				uni.navigateTo({
+					url: "/pages/make/fabuArticle?id=" + this.articleInfo.id,
+				});
+			} else if (item.text === "删除作品") {
+				console.log("删除作品");
+				this.deleteArticle();
 			}
 		},
 		imageString(str) {
@@ -649,6 +666,9 @@ export default {
 					animation: 0,
 				})
 				.then(() => {
+					uni.showLoading({
+						title: '删除中...'
+					});
 					uni.request({
 						url: this.$apiHost + "/Article/doAct",
 						data: {
@@ -661,16 +681,18 @@ export default {
 							sign: getApp().globalData.headerSign,
 						},
 						success: (res) => {
+							uni.hideLoading();
 							if (res.data.success === "yes") {
 								uni.showToast({
 									title: "删除成功",
 									icon: "success",
 								});
-								// 重新获取列表
-								// this.getArticleList();
+								// 删除成功后返回上一页
 								setTimeout(() => {
-									uni.navigateBack({});
-								}, 800);
+									uni.navigateBack({
+										delta: 1
+									});
+								}, 1500);
 							} else {
 								uni.showToast({
 									title: res.data.str || "删除失败",
@@ -678,10 +700,17 @@ export default {
 								});
 							}
 						},
+						fail: () => {
+							uni.hideLoading();
+							uni.showToast({
+								title: "删除失败",
+								icon: "none",
+							});
+						}
 					});
 				})
 				.catch(() => {
-					// this.delCloseFun()
+					// 用户取消删除
 				});
 		},
 		goToUserHomepage(id) {
@@ -694,6 +723,16 @@ export default {
 				});
 			})
 		},
+		// 预览图片
+		previewImage(index) {
+			if (!this.swperImages || this.swperImages.length === 0) return;
+			uni.previewImage({
+				urls: this.swperImages,
+				current: index,
+				indicator: 'number',
+				loop: true
+			});
+		},
 	},
 };
 </script>

+ 2 - 2
pages/index/index.vue

@@ -25,7 +25,7 @@
             <view class="top" style="display: flex">
               <!-- 手动选择城市功能隐藏 -->
               <!-- <view class="topBox" @click="lhSelectCityFun"> -->
-              <view class="topBox" @click="lhSelectCityFun">
+              <view class="topBox"  >
                 <text style="
                     margin-left: 10rpx;
                     margin-right: 20rpx;
@@ -402,7 +402,7 @@ export default {
       this.queryList();
     } else {
       this.tabs = ["关注", "推荐", "探索"];
-      this.currentTab = 1;
+      // this.currentTab = 1;
       // 如果数据为空,加载初始数据
       if (this.recommendList.length === 0) {
         this.initialLoad();

+ 0 - 273
pages/index/permission.js

@@ -1,273 +0,0 @@
-/**
- * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
- */
-
-var isIos
-// #ifdef APP-PLUS
-isIos = (plus.os.name == "iOS")
-// #endif
-
-// 判断推送权限是否开启
-function judgeIosPermissionPush() {
-	var result = false;
-	var UIApplication = plus.ios.import("UIApplication");
-	var app = UIApplication.sharedApplication();
-	var enabledTypes = 0;
-	if (app.currentUserNotificationSettings) {
-		var settings = app.currentUserNotificationSettings();
-		enabledTypes = settings.plusGetAttribute("types");
-		console.log("enabledTypes1:" + enabledTypes);
-		if (enabledTypes == 0) {
-			console.log("推送权限没有开启");
-		} else {
-			result = true;
-			console.log("已经开启推送功能!")
-		}
-		plus.ios.deleteObject(settings);
-	} else {
-		enabledTypes = app.enabledRemoteNotificationTypes();
-		if (enabledTypes == 0) {
-			console.log("推送权限没有开启!");
-		} else {
-			result = true;
-			console.log("已经开启推送功能!")
-		}
-		console.log("enabledTypes2:" + enabledTypes);
-	}
-	plus.ios.deleteObject(app);
-	plus.ios.deleteObject(UIApplication);
-	return result;
-}
-
-// 判断定位权限是否开启
-function judgeIosPermissionLocation() {
-	var result = false;
-	var cllocationManger = plus.ios.import("CLLocationManager");
-	var status = cllocationManger.authorizationStatus();
-	result = (status != 2)
-	console.log("定位权限开启:" + result);
-	// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
-	/* var enable = cllocationManger.locationServicesEnabled();
-	var status = cllocationManger.authorizationStatus();
-	console.log("enable:" + enable);
-	console.log("status:" + status);
-	if (enable && status != 2) {
-		result = true;
-		console.log("手机定位服务已开启且已授予定位权限");
-	} else {
-		console.log("手机系统的定位没有打开或未给予定位权限");
-	} */
-	plus.ios.deleteObject(cllocationManger);
-	return result;
-}
-
-// 判断麦克风权限是否开启
-function judgeIosPermissionRecord() {
-	var result = false;
-	var avaudiosession = plus.ios.import("AVAudioSession");
-	var avaudio = avaudiosession.sharedInstance();
-	var permissionStatus = avaudio.recordPermission();
-	console.log("permissionStatus:" + permissionStatus);
-	if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
-		console.log("麦克风权限没有开启");
-	} else {
-		result = true;
-		console.log("麦克风权限已经开启");
-	}
-	plus.ios.deleteObject(avaudiosession);
-	return result;
-}
-
-// 判断相机权限是否开启
-function judgeIosPermissionCamera() {
-	var result = false;
-	var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
-	var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
-	console.log("authStatus:" + authStatus);
-	if (authStatus == 3) {
-		result = true;
-		console.log("相机权限已经开启");
-	} else {
-		console.log("相机权限没有开启");
-	}
-	plus.ios.deleteObject(AVCaptureDevice);
-	return result;
-}
-
-// 判断相册权限是否开启
-function judgeIosPermissionPhotoLibrary() {
-	var result = false;
-	var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
-	var authStatus = PHPhotoLibrary.authorizationStatus();
-	console.log("authStatus:" + authStatus);
-	if (authStatus == 3) {
-		result = true;
-		console.log("相册权限已经开启");
-	} else {
-		console.log("相册权限没有开启");
-	}
-	plus.ios.deleteObject(PHPhotoLibrary);
-	return result;
-}
-
-// 判断通讯录权限是否开启
-function judgeIosPermissionContact() {
-	var result = false;
-	var CNContactStore = plus.ios.import("CNContactStore");
-	var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
-	if (cnAuthStatus == 3) {
-		result = true;
-		console.log("通讯录权限已经开启");
-	} else {
-		console.log("通讯录权限没有开启");
-	}
-	plus.ios.deleteObject(CNContactStore);
-	return result;
-}
-
-// 判断日历权限是否开启
-function judgeIosPermissionCalendar() {
-	var result = false;
-	var EKEventStore = plus.ios.import("EKEventStore");
-	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
-	if (ekAuthStatus == 3) {
-		result = true;
-		console.log("日历权限已经开启");
-	} else {
-		console.log("日历权限没有开启");
-	}
-	plus.ios.deleteObject(EKEventStore);
-	return result;
-}
-
-// 判断备忘录权限是否开启
-function judgeIosPermissionMemo() {
-	var result = false;
-	var EKEventStore = plus.ios.import("EKEventStore");
-	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
-	if (ekAuthStatus == 3) {
-		result = true;
-		console.log("备忘录权限已经开启");
-	} else {
-		console.log("备忘录权限没有开启");
-	}
-	plus.ios.deleteObject(EKEventStore);
-	return result;
-}
-
-// Android权限查询
-function requestAndroidPermission(permissionID) {
-	console.log('requestAndroidPermission:' + permissionID);
-	return new Promise((resolve, reject) => {
-		plus.android.requestPermissions(
-			[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
-			function(resultObj) {
-				var result = 0;
-				for (var i = 0; i < resultObj.granted.length; i++) {
-					var grantedPermission = resultObj.granted[i];
-					console.log('已获取的权限:' + grantedPermission);
-					result = 1
-				}
-				for (var i = 0; i < resultObj.deniedPresent.length; i++) {
-					var deniedPresentPermission = resultObj.deniedPresent[i];
-					console.log('拒绝本次申请的权限:' + deniedPresentPermission);
-					result = 0
-				}
-				for (var i = 0; i < resultObj.deniedAlways.length; i++) {
-					var deniedAlwaysPermission = resultObj.deniedAlways[i];
-					console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
-					result = -1
-				}
-				resolve(result);
-				// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
-				// if (result != 1) {
-				// gotoAppPermissionSetting()
-				// }
-			},
-			function(error) {
-				console.log('申请权限错误:' + error.code + " = " + error.message);
-				resolve({
-					code: error.code,
-					message: error.message
-				});
-			}
-		);
-	});
-}
-
-// 使用一个方法,根据参数判断权限
-function judgeIosPermission(permissionID) {
-	if (permissionID == "location") {
-		return judgeIosPermissionLocation()
-	} else if (permissionID == "camera") {
-		return judgeIosPermissionCamera()
-	} else if (permissionID == "photoLibrary") {
-		return judgeIosPermissionPhotoLibrary()
-	} else if (permissionID == "record") {
-		return judgeIosPermissionRecord()
-	} else if (permissionID == "push") {
-		return judgeIosPermissionPush()
-	} else if (permissionID == "contact") {
-		return judgeIosPermissionContact()
-	} else if (permissionID == "calendar") {
-		return judgeIosPermissionCalendar()
-	} else if (permissionID == "memo") {
-		return judgeIosPermissionMemo()
-	}
-	return false;
-}
-
-// 跳转到**应用**的权限页面
-function gotoAppPermissionSetting() {
-	if (isIos) {
-		var UIApplication = plus.ios.import("UIApplication");
-		var application2 = UIApplication.sharedApplication();
-		var NSURL2 = plus.ios.import("NSURL");
-		// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");		
-		var setting2 = NSURL2.URLWithString("app-settings:");
-		application2.openURL(setting2);
-
-		plus.ios.deleteObject(setting2);
-		plus.ios.deleteObject(NSURL2);
-		plus.ios.deleteObject(application2);
-	} else {
-		// console.log(plus.device.vendor);
-		var Intent = plus.android.importClass("android.content.Intent");
-		var Settings = plus.android.importClass("android.provider.Settings");
-		var Uri = plus.android.importClass("android.net.Uri");
-		var mainActivity = plus.android.runtimeMainActivity();
-		var intent = new Intent();
-		intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
-		var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
-		intent.setData(uri);
-		mainActivity.startActivity(intent);
-	}
-}
-
-// 检查系统的设备服务是否开启
-// var checkSystemEnableLocation = async function () {
-function checkSystemEnableLocation() {
-	if (isIos) {
-		var result = false;
-		var cllocationManger = plus.ios.import("CLLocationManager");
-		var result = cllocationManger.locationServicesEnabled();
-		console.log("系统定位开启:" + result);
-		plus.ios.deleteObject(cllocationManger);
-		return result;
-	} else {
-		var context = plus.android.importClass("android.content.Context");
-		var locationManager = plus.android.importClass("android.location.LocationManager");
-		var main = plus.android.runtimeMainActivity();
-		var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
-		var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
-		console.log("系统定位开启:" + result);
-		return result
-	}
-}
-
-module.exports = {
-	judgeIosPermission: judgeIosPermission,
-	requestAndroidPermission: requestAndroidPermission,
-	checkSystemEnableLocation: checkSystemEnableLocation,
-	gotoAppPermissionSetting: gotoAppPermissionSetting
-}

+ 203 - 16
pages/index/workDetail.vue

@@ -19,11 +19,13 @@
         </view>
       </view>
       <view class="navbar-right">
-        <text class="followTheAuthor followTheAuthor1" v-if="author.is_attention == 0"
-          @click="() => followTheAuthor(1)">+关注</text>
-        <text class="followTheAuthor followTheAuthor0" v-if="author.is_attention == 1"
-          @click="followTheAuthor(0)">已关注</text>
-        <image v-if="true" @click="showActionSheet(0)" src="../../static/icon/sy_icon_fenxiang.png" mode="widthFix">
+        <template v-if="!isItMe">
+          <text class="followTheAuthor followTheAuthor1" v-if="author.is_attention == 0"
+            @click="() => followTheAuthor(1)">+关注</text>
+          <text class="followTheAuthor followTheAuthor0" v-if="author.is_attention == 1"
+            @click="followTheAuthor(0)">已关注</text>
+          </template>
+        <image v-if="!isItMe" @click="showActionSheet(0)" src="../../static/icon/sy_icon_fenxiang.png" mode="widthFix">
         </image>
         <view v-else class="navbar-right" @click="showActionSheet(1)">
           <text class="fa fa-ellipsis-h"></text>
@@ -32,9 +34,9 @@
     </view>
 
     <!-- 灵感 -->
-    <template v-if="articleInfo.task_type == 1"> 
+    <template v-if="articleInfo.task_type == 1">
       <view class="inspiration-content" v-if="home_image">
-        <image v-if="home_image"  :src="home_image" class="inspirationPictures" mode="widthFix"></image>
+        <image v-if="home_image" :src="home_image" class="inspirationPictures" mode="widthFix" @click="previewImage(home_image)"></image>
       </view>
     </template>
     <!-- 音乐 -->
@@ -188,6 +190,9 @@
     <!-- 自定义 ActionSheet -->
     <ActionSheet ref="actionSheet" :items="items" @select="handleActionSelect" @cancel="handleActionCancel" />
     <view class="thread2"></view>
+
+    <SharePopup :visible="showShare" :userId="userId" :share-title="shareTitle" :share-desc="shareDesc"
+      :share-img="shareImg" view="workDetail" @close="showShare = false" />
   </view>
 </template>
 
@@ -196,6 +201,7 @@ import htmlParser from "../../common/html-parser";
 import previewImage from "@/components/kxj-previewImage/kxj-previewImage.vue"; //引用插件
 import CommentSection from "@/components/CommentSection/CommentSection.vue";
 import ActionSheet from "@/components/ActionSheet/ActionSheet.vue";
+import SharePopup from "@/components/SharePopup/SharePopup.vue";
 function parseImgs(nodes) {
   nodes.forEach((node) => {
     if (node.name === "img" && node.attrs && node.attrs["data-img-size-val"]) {
@@ -215,6 +221,7 @@ export default {
     previewImage,
     CommentSection,
     ActionSheet,
+    SharePopup,
   },
   data() {
     return {
@@ -230,6 +237,11 @@ export default {
       list_wish: [],
       content: "",
       author: {},
+      showShare: false,
+      shareTitle: "",
+      shareDesc: "",
+      shareImg: "",
+      userId: 0,
       // 添加文章信息字段
       articleInfo: {
         title: "",
@@ -262,6 +274,7 @@ export default {
       audioPlayer: null, // 添加音频播放器实例
       sms_id: 0,
       isMessage: true,
+      isItMe: false,
     };
   },
   onLoad(parms) {
@@ -339,9 +352,10 @@ export default {
         },
         success: (res) => {
           console.log("文章信息:", res.data);
+          
           if (res.data.success === "yes") {
             console.log("文章信息:", res.data.data);
-
+        
             // 更新文章信息
             if (res.data.article) {
               this.articleInfo = res.data.article;
@@ -352,6 +366,14 @@ export default {
             this.home_image = res.data.data.images;
             this.author = res.data.author;
 
+            // 更新分享相关数据
+            this.shareTitle = this.articleInfo.title || '萌创星球';
+            this.shareDesc = this.articleInfo.content;
+            this.shareImg = this.home_image;
+            this.userId = this.articleInfo.userID;
+            this.isItMe = 	this.userId == getApp().globalData.user_id
+								? true
+								: false;
             this.userInfo.user_id = res.data.id; // 用户id
             this.userInfo.user_name = res.data.nickname; // 用户名
             this.userInfo.user_avatar = res.data.avator; // 用户头像地址
@@ -537,12 +559,9 @@ export default {
     showActionSheet(n) {
       uni.$emit('check_login', () => {
         if (n == 0) {
-          this.items = [
-            {
-              text: "分享作品",
-              icon: "../../static/icon/cz_icon_fenxiangzuopin.png",
-            },
-          ];
+          // 如果只有一个分享按钮,直接唤醒分享弹窗
+          this.showShare = true;
+          return;
         }
         if (n == 1) {
           this.items = [
@@ -569,6 +588,166 @@ export default {
     },
     handleActionSelect(index, item) {
       console.log("ActionSheet selected index:", item.text);
+      if (item.text === "分享作品") {
+        this.showShare = true;
+      } else if (item.text === "修改封面") {
+        // 修改封面
+        if (this.articleInfo.status == 3) {
+          uni.showToast({
+            title: '作品已完成,无法修改封面!',
+            icon: 'success'
+          });
+          return;
+        }
+        this.editCover();
+      } else if (item.text === "删除作品") {
+        // 删除作品
+        this.deleteWork();
+      }
+    },
+    // 修改封面
+    editCover() {
+      var _self = this;
+      uni.chooseImage({
+        count: 1,
+        sizeType: ['compressed'],
+        sourceType: ['album', 'camera'],
+        success: function (res) {
+          console.log('res:', res)
+          if (res.tempFilePaths.length > 0) {
+            _self.imglocal = res.tempFilePaths[0]
+            const tempFilePaths = res.tempFilePaths[0];
+            console.log('tempFilePaths:', tempFilePaths);
+            const uploadTask = uni.uploadFile({
+              url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self.skey,
+              filePath: res.tempFilePaths[0],
+              name: 'file',
+              success: function (uploadFileRes) {
+                let resdata = JSON.parse(uploadFileRes.data)
+                console.log('Success11:', uploadFileRes);
+                console.log('Success21:', resdata);
+                if (resdata.success == 'yes') {
+                  // 调用修改封面接口
+                  uni.request({
+                    url: _self.$apiHost + '/WorkAI/queueAction',
+                    method: 'GET',
+                    data: {
+                      uuid: getApp().globalData.uuid,
+                      act: 'editImg',
+                      result_images: resdata.url,
+                      id: _self.arcID
+                    },
+                    header: {
+                      'content-type': 'application/json',
+                      'sign': getApp().globalData.headerSign
+                    },
+                    success: (res) => {
+                      if (res.data.success === "yes") {
+                        // 只有在修改封面成功时才更新页面中的图片
+                        _self.home_image = resdata.url;
+                        uni.showToast({
+                          title: '修改封面成功',
+                          icon: 'success'
+                        });
+                      } else {
+                        uni.showToast({
+                          title: '修改封面失败',
+                          icon: 'none'
+                        });
+                      }
+                    },
+                    fail: () => {
+                      uni.showToast({
+                        title: '修改封面失败',
+                        icon: 'none'
+                      });
+                    }
+                  });
+                }
+              },
+              fail: function (uploadFileFail) {
+                console.log('Error:', uploadFileFail.data);
+                uni.showToast({
+                  title: '图片上传失败',
+                  icon: 'none'
+                });
+              }
+            });
+          }
+        },
+        error: function (e) {
+          console.log(e);
+          uni.showToast({
+            title: '选择图片失败',
+            icon: 'none'
+          });
+        }
+      });
+    },
+    // 删除作品
+    deleteWork() {
+      this.$refs["customConfirm"]
+        .confirm({
+          title: "确认删除",
+          content: "确定要删除这个作品吗?",
+          DialogType: "inquiry",
+          btn1: "再考虑一下",
+          btn2: "确认解绑",
+          animation: 0,
+        })
+        .then((res) => {
+          if (res.confirm) {
+            // 用户点击确定,执行删除操作
+            this.confirmDelete();
+          }
+        });
+    },
+    // 确认删除
+    confirmDelete() {
+      uni.showLoading({
+        title: '删除中...'
+      });
+
+      uni.request({
+        url: this.$apiHost + '/WorkAI/queueAction',
+        method: 'GET',
+        data: {
+          uuid: getApp().globalData.uuid,
+          act: 'del',
+          id: this.arcID
+        },
+        header: {
+          'content-type': 'application/json',
+          'sign': getApp().globalData.headerSign
+        },
+        success: (res) => {
+          uni.hideLoading();
+          if (res.data.success === "yes") {
+            uni.showToast({
+              title: '删除成功',
+              icon: 'success'
+            });
+            // 删除成功后返回上一页
+            setTimeout(() => {
+              uni.navigateBack({
+                delta: 1
+              });
+            }, 1500);
+          } else {
+            uni.showToast({
+              title: '删除失败',
+              icon: 'none'
+            });
+          }
+        },
+        fail: () => {
+          uni.hideLoading();
+          uni.showToast({
+            title: '删除失败',
+            icon: 'none'
+          });
+        }
+      });
     },
     goCreate() {
       // 切换到标签页
@@ -587,6 +766,16 @@ export default {
         });
       })
     },
+    // 预览图片
+    previewImage(url) {
+      if (!url) return;
+      uni.previewImage({
+        urls: [url],
+        current: url,
+        indicator: 'number',
+        loop: true
+      });
+    },
   },
 };
 </script>
@@ -594,5 +783,3 @@ export default {
 <style scoped lang="scss">
 @import "workDetail.scss";
 </style>
-
-

+ 1 - 1
pages/login/login.vue

@@ -23,7 +23,7 @@
 			<block v-if="type == 'pass' || type == 'mobile'">
 				<view class="name">手机号码:</view>
 				<view class="item">
-					<input type="text" class="input" v-model="mobile" placeholder="请输入手机号码" maxlength="11" />
+					<input type="number" class="input" v-model="mobile" placeholder="请输入手机号码" maxlength="11" />
 				</view>
 				<block v-if="type == 'pass'">
 					<view class="name">登录密码:</view>

+ 23 - 3
pages/makedetail/makeDetail.vue

@@ -134,6 +134,8 @@
 			</view>
 		</CustomPopup>
 		<DialogBox ref="customConfirm"></DialogBox>
+		<SharePopup :visible="showShare" :userId="userId" :share-title="shareTitle" :share-desc="shareDesc" :share-img="shareImg" view="makeDetail"
+			@close="showShare = false" />
 	</view>
 </template>
 
@@ -142,12 +144,14 @@ import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue'; /
 import NicknamePopup from '@/components//NicknamePopup/NicknamePopup.vue';
 import CustomPopup from '@/components/CustomPopup/CustomPopup.vue';
 import ActionSheet from '@/components/ActionSheet/ActionSheet.vue';
+import SharePopup from "@/components/SharePopup/SharePopup.vue";
 export default {
 	components: {
 		previewImage,
 		NicknamePopup,
 		CustomPopup,
 		ActionSheet,
+		SharePopup,
 	},
 	data() {
 		return {
@@ -166,6 +170,11 @@ export default {
 			noteContent: '',
 			pixelColor: null, // 存储像素颜色值
 			queueId: 0,
+			showShare: false,
+			shareTitle: "",
+			shareDesc: "",
+			shareImg: "",
+			userId: 0,
 			// 队列详情数据
 			queueDetail: {
 				id: 0,
@@ -423,7 +432,8 @@ export default {
 						// 更新队列详情
 						this.queueDetail = res.data.data;
 						this.noteContent = res.data.data.content;
-
+						
+						
 						// 更新图片列表
 						if (this.queueDetail.result_images && this.queueDetail.result_images !== "") {
 							this.image_list = this.queueDetail.result_images.split(",");
@@ -441,6 +451,13 @@ export default {
 						if (this.queueDetail.task_type == 2 && this.queueDetail.result_audio) {
 							this.audioPlayer.src = this.queueDetail.result_audio;
 						}
+						// 更新分享相关数据
+						this.shareTitle = res.data.data.song_name||'萌创星球';
+						this.shareDesc = res.data.data.description;
+						this.shareImg = this.home_image;
+						this.userId = res.data.data.sso_id;
+
+						console.log(this.shareTitle,9,this.shareDesc,2,this.shareImg,3,this.userId,4,'分享数据');
 					} else {
 						uni.showToast({
 							title: '获取详情失败',
@@ -503,6 +520,7 @@ export default {
 
 			switch (item.text) {
 				case '分享作品':
+					this.showShare = true;
 					break;
 				case '修改封面':
 					// 修改封面
@@ -612,15 +630,17 @@ export default {
 					content: "确定要删除这个作品吗?",
 					DialogType: "inquiry",
 					btn1: "再考虑一下",
-					btn2: "确认解绑",
+					btn2: "确认删除",
 					animation: 0,
 				})
 				.then((res) => {
+					console.log(res);
+					
 					if (res.confirm) {
 						// 用户点击确定,执行删除操作
 						this.confirmDelete();
 					}
-				});
+				},()=>{});
 		},
 		// 确认删除
 		confirmDelete() {

+ 2 - 2
pages/makedetail/makeImgDetail.vue

@@ -124,7 +124,7 @@
 				</view>
 
 
-				<view class="promotion-link">
+				<view class="promotion-link" @click="goPage('/pages/vip/index')">
 					<image class="vip" src="/static/makedetail/wd_icon_vip(1).png" mode="aspectFit"></image>
 					<text> 即刻开通订阅,获取各种福利! </text>
 					<image class="jiantou" src="/static/makedetail/cz_icon_jiantou.png" mode="aspectFit"></image>
@@ -226,7 +226,7 @@ export default {
 			this.getQueueDetail(e.id)
 		}
 	},
-	methods: {
+	methods: { 
 		doYouWantToEdit() {
 			return this.inQueue || this.queuing
 		},

+ 1 - 1
pages/makedetail/makeMusicDetail.vue

@@ -114,7 +114,7 @@
 
 			<view v-else class="generate-btn prohibit">生成中 </view>
 
-			<view class="promotion-link">
+			<view class="promotion-link" @click="goPage('/pages/vip/index')">
 				<image class="vip" src="/static/makedetail/wd_icon_vip(1).png" mode="aspectFit"></image>
 				<text> 即刻开通订阅,获取各种福利! </text>
 				<image class="jiantou" src="/static/makedetail/cz_icon_jiantou.png" mode="aspectFit"></image>

+ 3 - 6
pages/my/editInfo.vue

@@ -162,10 +162,7 @@
 </template>
 
 <script>
-	import {
-		requestAndroidPermission,
-		gotoAppPermissionSetting
-	} from '../index/permission.js'
+ 
 	import PageHeader from '@/components/PageHeader/PageHeader.vue';
 	import CircleAvatar from '@/components/CircleAvatar/CircleAvatar.vue';
 	import NicknamePopup from '@/components/NicknamePopup/NicknamePopup.vue';
@@ -355,7 +352,7 @@
 							animation: 0,
 							icon: "none"
 						});
-						if (this.success == 'yes' && isBack == true) {
+						if ( res.data.success == 'yes' && isBack == true) {
 							if (this.nickname) {
 								getApp().globalData.nickname = this.nickname
 								uni.removeStorageSync("nickname");
@@ -368,7 +365,7 @@
 								uni.setStorageSync("avator", this.avator);
 							}
 							setTimeout(function() {
-								console.log('返回');
+							 
 
 								uni.navigateBack()
 							}, 800)

+ 1 - 2
pages/my/my.vue

@@ -228,8 +228,7 @@
 				<!-- <view class="loading-more" v-if="isLoading">加载中...</view>
 				<view class="no-more" v-if="!hasMore && worksList.length > 0">没有更多作品了</view>
 				<view class="no-more" v-if="!hasMore && worksList.length === 0">暂无作品</view> -->
-			</view>
-			<view style="width: 100%; text-align: center; background: #fff">杭州智潮创意科技有限公司</view>
+			</view> 
 
 			<view class="blankHeight"></view>
 		</view>

+ 4 - 4
pages/my/myStar.vue

@@ -22,7 +22,7 @@
 		<!-- 角色展示页面 -->
 		<view class="character-page" v-else-if="state == 1">
 			<view class="character-container">
-				<image :src="starImg || 'https://e.zhichao.art/AI_images/b_3_92.png'" mode="widthFix"
+				<image :src="starInfo.image || ''" mode="widthFix"
 					class="character-image">
 				</image>
 			</view>
@@ -135,13 +135,13 @@
 					<view class="character-name">
 						<uv-input v-if="state == 5" v-model="starInfo.nickname" placeholder="请输入昵称" border="none" />
 						<text v-else>{{ starInfo.nickname }}</text>
-						<image class="male" v-if="starInfo.sex == 0" src="../../static/me/wd_icon_nan.png"
+						<image class="male" v-if="starInfo.sex_id == 1" src="../../static/me/wd_icon_nan.png"
 							mode="aspectFit">
 						</image>
-						<image class="female" v-else-if="starInfo.sex == 1" src="../../static/me/wd_icon_nv.png"
+						<image class="female" v-else-if="starInfo.sex_id == 2" src="../../static/me/wd_icon_nv.png"
 							mode="aspectFit">
 						</image>
-						<image class="other" v-else src="../../static/me/wd_icon_qita.png" mode="aspectFit"></image>
+						<image class="other" v-else-if="starInfo.sex_id == 3" src="../../static/me/wd_icon_qita.png" mode="aspectFit"></image>
 					</view>
 
 					<!-- 人物简介 -->

+ 1 - 0
pages/my/setting.vue

@@ -410,6 +410,7 @@ export default {
           uni.removeStorageSync("uuid");
           uni.removeStorageSync("user_id");
           uni.removeStorageSync("is_login");
+          removeStorage("isContentRecommendation");
           uni.redirectTo({
             url: "/pages/login/login",
           });

+ 111 - 117
pages/my/step.vue

@@ -153,43 +153,37 @@
     </uni-popup>
 
     <!-- 权限申请提示 -->
-    <!-- <view v-if="showRights" style="
+    <view v-if="showRights" style="
         width: 100%;
         height: 300rpx;
         background-color: rgba(255, 255, 255, 0.9);
         position: fixed;
         top: 0;
-        left: 0;
-        z-index: 999;
         display: flex;
         flex-direction: column;
         justify-content: center;
         align-items: center;
-      ">
+        z-index: 999;">
       <text style="
           width: 90%;
           color: #000000;
           font-size: 38rpx;
           text-align: left;
           padding: 10rpx 20rpx;
-          padding-top: 10rpx;
-        ">正在获取相机、存储权限</text>
+          padding-top: 10rpx;">正在获取相机、存储权限</text>
       <text style="
           width: 90%;
           color: #666666;
           font-size: 28rpx;
           text-align: left;
-          padding: 10rpx 20rpx;
-        ">该权限用于获取设备拍摄或获取本地应用相册,进行头像或图片上传。</text>
-    </view> -->
+          padding: 10rpx 20rpx;">该权限用于获取设备拍摄或获取本地应用相册,进行头像或图片上传。</text>
+    </view>
   </view>
 </template>
 
-<script>
-import {
-  requestAndroidPermission,
-  gotoAppPermissionSetting,
-} from "../index/permission.js";
+<script> 
+import permission from '@/common/permission.js'; 
+
 export default {
   components: {},
   data() {
@@ -541,120 +535,120 @@ export default {
       });
     },
     chooseAvatar() {
-      this.checkRights();
-      console.log("----upload avatar");
-      var _self = this;
-      uni.chooseImage({
-        count: 1,
-        sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有
-        sourceType: ["album", "camera"], // 从相册、相机选择
-        extension: [".png", ".jpeg", ".jpg"],
-        success: function (res) {
-          console.log("res:", res);
-          if (res.tempFilePaths.length > 0) {
-            _self.imglocal = res.tempFilePaths[0];
-            _self.userInfo.avatar = res.tempFilePaths[0]; // 立即显示选择的图片
-            const tempFilePaths = res.tempFilePaths[0];
-            console.log("tempFilePaths:", tempFilePaths);
-
-            // 图片上传
-            const uploadTask = uni.uploadFile({
-              url: _self.$apiHost + "/Xweb/upload_img?skey=" + _self.skey, // post请求地址
-              filePath: res.tempFilePaths[0],
-              name: "file", // 文件对应的 key
-              success: function (uploadFileRes) {
-                let resdata = JSON.parse(uploadFileRes.data);
-                console.log("Upload success:", uploadFileRes);
-                console.log("Upload data:", resdata);
-                if (resdata.success == "yes") {
-                  _self.showRights = false;
-                  _self.userInfo.avatar = resdata.url; // 更新为服务器返回的URL
-                  uni.showToast({
-                    title: "头像上传成功",
-                    icon: "success",
-                    duration: 1500,
-                  });
-                } else {
-                  uni.showToast({
-                    title: resdata.msg || "上传失败",
-                    icon: "none",
-                    duration: 1500,
-                  });
-                }
-              },
-              fail: function (uploadFileFail) {
-                console.log("Error:", uploadFileFail);
-                uni.showToast({
-                  title: "上传失败,请重试",
-                  icon: "none",
-                  duration: 1500,
-                });
-              },
-              complete: () => {
-                console.log("Upload complete");
-              },
-            });
+      uni.showActionSheet({
+        itemList: ['拍照', '从相册选择'],
+        success: (res) => {
+          const sourceType = res.tapIndex === 0 ? 'camera' : 'album';
+          this.chooseImage(sourceType);
+        }
+      });
+    },
+    async chooseImage(sourceType) {
+      try {
+        let hasPermission = false;
+        
+        if (sourceType === 'camera') {
+          hasPermission = await this.checkCameraPermission();
+        } else if (sourceType === 'album') {
+          hasPermission = await this.checkPhotoLibraryPermission();
+        }
 
-            // 显示上传进度
-            uploadTask.onProgressUpdate((res) => {
-              console.log("上传进度" + res.progress);
-              console.log("已经上传的数据长度" + res.totalBytesSent);
-              console.log(
-                "预期需要上传的数据总长度" + res.totalBytesExpectedToSend
-              );
-            });
-          }
-        },
-        error: function (e) {
-          console.log(e);
+        if (!hasPermission) {
           uni.showToast({
-            title: "选择图片失败",
-            icon: "none",
-            duration: 1500,
+            title: '未获得权限',
+            icon: 'none'
           });
-        },
+          return;
+        }
+
+        uni.chooseImage({
+          count: 1,
+          sizeType: ['compressed'],
+          sourceType: [sourceType],
+          success: async (res) => {
+            console.log('res:', res)
+            if (res.tempFilePaths.length > 0) {
+              this.userInfo.avatar = res.tempFilePaths[0]; // 立即显示选择的图片
+              const tempFilePath = res.tempFilePaths[0];
+              console.log('tempFilePaths:', tempFilePath);
+              await this.uploadImage(tempFilePath);
+            }
+          },
+          fail: (err) => {
+            console.error('选择图片失败:', err);
+            uni.showToast({
+              title: '选择图片失败',
+              icon: 'none'
+            });
+          }
+        });
+      } catch (error) {
+        console.error('权限检查失败:', error);
+        uni.showToast({
+          title: '权限检查失败',
+          icon: 'none'
+        });
+      }
+    },
+    async checkCameraPermission() {
+      const hasPermission = await permission.request(permission.PermissionType.CAMERA, {
+        title: '相机权限申请',
+        describe: '需要使用相机拍摄照片,请允许使用相机权限'
       });
+      return hasPermission;
     },
-    checkRights() {
-      let that = this;
-      that.showRights = true;
-      requestAndroidPermission("android.permission.CAMERA")
-        .then((result) => {
-          that.showRights = false;
-          // 根据返回的结果进行处理
-          if (result === 1) {
-            // 已获得授权
-          } else if (result === 0) {
-            console.log("权限被拒绝");
+    async checkPhotoLibraryPermission() {
+      const hasPermission = await permission.request(permission.PermissionType.PHOTO_LIBRARY, {
+        title: '相册权限申请',
+        describe: '需要访问相册选择照片,请允许访问相册权限'
+      });
+      return hasPermission;
+    },
+    uploadImage(tempFilePath) {
+      const _self = this;
+      const uploadTask = uni.uploadFile({
+        url: _self.$apiHost + '/Xweb/upload_img?skey=' + _self.skey,
+        filePath: tempFilePath,
+        name: 'file',
+        success: function(uploadFileRes) {
+          let resdata = JSON.parse(uploadFileRes.data);
+          console.log('Success:', uploadFileRes);
+          console.log('Upload data:', resdata);
+          if (resdata.success == 'yes') {
+            _self.showRights = false;
+            _self.userInfo.avatar = resdata.url;
             uni.showToast({
-              title: "相机权限被拒绝",
-              icon: "none",
-              duration: 2000,
+              title: '头像上传成功',
+              icon: 'success',
+              duration: 1500
             });
-          } else if (result === -1) {
-            console.log("权限被永久拒绝");
-            uni.showModal({
-              title: "提示",
-              content: "相机权限被永久拒绝,请到设置中手动开启",
-              confirmText: "去设置",
-              cancelText: "取消",
-              success: function (res) {
-                if (res.confirm) {
-                  gotoAppPermissionSetting();
-                }
-              },
+          } else {
+            uni.showToast({
+              title: resdata.msg || '上传失败',
+              icon: 'none',
+              duration: 1500
             });
           }
-        })
-        .catch((error) => {
-          that.showRights = true;
-          console.log("权限申请失败:", error);
+        },
+        fail: function(uploadFileFail) {
+          console.error('Error:', uploadFileFail);
           uni.showToast({
-            title: "权限申请失败",
-            icon: "none",
-            duration: 1500,
+            title: '上传失败,请重试',
+            icon: 'none',
+            duration: 1500
           });
-        });
+        },
+        complete: () => {
+          console.log('Upload complete');
+        }
+      });
+
+      // 显示上传进度
+      uploadTask.onProgressUpdate((res) => {
+        console.log('上传进度' + res.progress);
+        console.log('已经上传的数据长度' + res.totalBytesSent);
+        console.log('预期需要上传的数据总长度' + res.totalBytesExpectedToSend);
+      });
     },
     toggleInterest(id) {
       if (this.selectedInterests.includes(id)) {

+ 10 - 4
pages/my/teenagePassword.vue

@@ -31,6 +31,7 @@
 
 <script>
 import PageHeader from '@/components/PageHeader/PageHeader.vue'
+import { getStorage, setStorage, removeStorage } from "@/common/util.js";
 export default {
 	components: { PageHeader },
 	data() {
@@ -123,7 +124,7 @@ export default {
 					this.$refs.code.clear() // 清空输入框
 				}
 			}
- 
+
 
 			if (res && res.str) {
 				if (res && res.str == '操作成功') {
@@ -170,7 +171,7 @@ export default {
 						'sign': getApp().globalData.headerSign
 					},
 					success: (res) => {
-						console.log("设置结果:", res.data);
+						console.log("设置结果:", res.data); 
 						resolve(res.data);
 
 					},
@@ -223,7 +224,11 @@ export default {
 					success: (res) => {
 						console.log("切换结果:", res.data);
 						resolve(res.data);
-
+						if (res.data.is_open_young == 1) {
+							setStorage("isContentRecommendation", false);
+						} else if (res.data.is_open_young == 0) {
+							setStorage("isContentRecommendation", true);
+						}
 					},
 					fail: (e) => {
 						console.log("切换失败:", e);
@@ -290,7 +295,8 @@ page {
 	color: #999999;
 	text-align: center;
 	padding-top: 44rpx;
-	span{
+
+	span {
 		color: #0084FF;
 	}
 }

+ 19 - 14
pages/my/userHomepage.vue

@@ -56,7 +56,8 @@
                 </view>
               </view>
               <view class="points-box">
-                <text class="followTheAuthor followTheAuthor1" v-if="!myinfo.is_attention" @click="followTheAuthor(1)">+关注</text>
+                <text class="followTheAuthor followTheAuthor1" v-if="!myinfo.is_attention"
+                  @click="followTheAuthor(1)">+关注</text>
                 <text class="followTheAuthor followTheAuthor0" v-else @click="followTheAuthor(0)">已关注</text>
               </view>
             </view>
@@ -66,7 +67,7 @@
 
       <view class="myinfo">
         <!-- 作品列表 -->
-        <view class="numlist1"   style="margin-top: 30rpx">
+        <view class="numlist1" style="margin-top: 30rpx">
           <WorkItem v-for="(item, index) in worksList" :subtitle="true" :key="index" :item="item"
             @click="goWork(item)" />
         </view>
@@ -79,8 +80,8 @@
     <DialogBox ref="DialogBox"></DialogBox>
 
     <!-- SharePopup组件 -->
-    <SharePopup :visible="showShare" :share-url="shareUrl" :share-title="shareTitle" :share-desc="shareDesc"
-      :share-img="shareImg" @close="showShare = false" />
+    <SharePopup :visible="showShare" :userId="userId" :share-title="shareTitle" :share-desc="shareDesc" :share-img="shareImg" view="userHomepage"
+      @close="showShare = false" />
   </view>
 </template>
 
@@ -122,10 +123,10 @@ export default {
       isLoading: false,
       worksList: [],
       showShare: false,
-      shareUrl: "https://your-share-url.com",
       shareTitle: "分享标题",
       shareDesc: "分享描述",
       shareImg: "https://your-share-image.com/image.jpg",
+      userId: 0,
       id: 0,
     };
   },
@@ -149,7 +150,7 @@ export default {
   },
   methods: {
     // 关注作者
-    followTheAuthor(n) { 
+    followTheAuthor(n) {
       uni.request({
         url: this.$apiHost + "/Member/attention",
         data: {
@@ -225,7 +226,7 @@ export default {
       });
       uni.request({
         url: this.$apiHost + "/Member/getHomeInfo",
-       
+
         data: {
           uuid: getApp().globalData.uuid,
           skey: getApp().globalData.skey,
@@ -237,6 +238,10 @@ export default {
         },
         success: (res) => {
           console.log("----:", JSON.parse(JSON.stringify(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") {
             uni.removeStorageSync("wapptoken");
             uni.redirectTo({
@@ -269,7 +274,7 @@ export default {
       this.isLoading = true;
 
       // 根据activeTab选择不同的API
-      
+
       uni.request({
         url: this.$apiHost + '/Work/getlist',
         data: {
@@ -277,7 +282,7 @@ export default {
           skey: getApp().globalData.skey,
           type: "other", // 固定为my,表示获取自己的作品
           offset: this.offset,
-          user_id:this.id
+          user_id: this.id
         },
         header: {
           "content-type": "application/json",
@@ -297,8 +302,8 @@ export default {
           } else {
             this.hasMore = false;
           }
- 
-         
+
+
         },
         complete: () => {
           this.isLoading = false;
@@ -337,10 +342,10 @@ export default {
     },
     goWork(item) {
       uni.$emit("check_login", () => { });
-      
+
       uni.navigateTo({
-            url: "/pages/index/workDetail?id=" + item.id,
-          });
+        url: "/pages/index/workDetail?id=" + item.id,
+      });
     },
     navigateToFollow() {
       uni.navigateTo({

+ 46 - 2
pages/vip/index.vue

@@ -51,8 +51,8 @@
 				</view>
 			</view>
 
-			<uv-notice-bar speed="250" color="#333"
-				:text="'uv-ui众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用'"></uv-notice-bar>
+			<uv-notice-bar direction="column" speed="250" color="#333"
+				:text="memberInformation"></uv-notice-bar>
 
 			<!-- 会员特权列表 -->
 			<view class="vip-privileges">
@@ -129,6 +129,50 @@ export default {
 				is_vip: false,
 				vip_date: '2023-10-23'
 			},
+			memberInformation:[
+			'墨色** 于10分钟前开通了月会员',
+			'雾散时** 于24分钟前开通了季会员',
+			'Jox** 于17分钟前开通了月会员',
+			'漂亮的** 于19分钟前开通了年会员',
+			'Ri** 于30分钟前开通了季会员',
+			'山桃** 于15分钟前开通了月会员',
+			'zx** 于19分钟前开通了年会员',
+			'** 于13分钟前开通了年会员',
+			'CarrollSo** 于21分钟前开通了季会员',
+			'Nanng** 于17分钟前开通了月会员',
+			'芭比B** 于9分钟前开通了年会员',
+			'小周不是** 于29分钟前开通了季会员',
+			'落雪_** 于26分钟前开通了月会员',
+			'雾岛听蝉9** 于19分钟前开通了年会员',
+			'如** 于19分钟前开通了季会员',
+			'言川Art** 于25分钟前开通了月会员',
+			'兔子君mrbun** 于30分钟前开通了月会员',
+			'呼哧Hac** 于6分钟前开通了年会员',
+			'alxe_不爱吹** 于17分钟前开通了季会员',
+			'飞清** 于25分钟前开通了月会员',
+		],
+		// 	memberInformation:[
+		// 	'墨色轨迹于10分钟前开通了月会员',
+		// 	'雾散时见山于24分钟前开通了季会员',
+		// 	'Joxin于17分钟前开通了月会员',
+		// 	'漂亮的倾城于19分钟前开通了年会员',
+		// 	'Rick于30分钟前开通了季会员',
+		// 	'山桃始华于15分钟前开通了月会员',
+		// 	'zx浊酒于19分钟前开通了年会员',
+		// 	'桥九于13分钟前开通了年会员',
+		// 	'CarrollSong于21分钟前开通了季会员',
+		// 	'Nanngua于17分钟前开通了月会员',
+		// 	'芭比Box于9分钟前开通了年会员',
+		// 	'小周不是小粥于29分钟前开通了季会员',
+		// 	'落雪_桃桃于26分钟前开通了月会员',
+		// 	'雾岛听蝉999于19分钟前开通了年会员',
+		// 	'如青稞于19分钟前开通了季会员',
+		// 	'言川Artie于25分钟前开通了月会员',
+		// 	'兔子君mrbunny于30分钟前开通了月会员',
+		// 	'呼哧Hachi于6分钟前开通了年会员',
+		// 	'alxe_不爱吹泡泡于17分钟前开通了季会员',
+		// 	'飞清云淡于25分钟前开通了月会员',
+		// ],
 			priceOptions: [
 			],
 			selectedPrice: 1, // 默认选中的价格选项索引

BIN
static/logo.png