Kaynağa Gözat

支付宝小程序兼容性修改

ylong 6 ay önce
ebeveyn
işleme
6545dae831
9 değiştirilmiş dosya ile 1010 ekleme ve 975 silme
  1. 1 1
      .env.dev.js
  2. 6 15
      .env.js
  3. 191 185
      App.vue
  4. 105 91
      api/config.js
  5. 1 1
      manifest.json
  6. 22 0
      pages-mine/pages/customer-service.vue
  7. 8 1
      pages.json
  8. 20 0
      pages/home/index.vue
  9. 656 681
      pages/mine/index.vue

+ 1 - 1
.env.dev.js

@@ -1,5 +1,5 @@
 export default {
     "NODE_ENV": 'development',
-    "apiUrl":"https://bpi.shuhi.com",
+    "apiUrl":"https://bk.shuhi.com",
     "apiUrlPrefix":"/api",
 };

+ 6 - 15
.env.js

@@ -1,18 +1,9 @@
-import dev from './.env.dev.js';
-import prod from './.env.prod.js';
-/* // 开发环境
-const dev = {
-	"apiUrl":"https://erp.521word.com"
-}
+import dev from "./.env.dev.js";
+import prod from "./.env.prod.js";
 
-// 生产环境
-const production= {
-	"apiUrl":"https://erp.521word.com"
-} */
-// 注意:这里的属性名要和上面package.json中定义的扩展节点编译名称相同
 const ENV_CONFIG = {
-	dev,
-	prod,
-}
+  development: dev,
+  production: prod,
+};
 console.log(ENV_CONFIG);
-module.exports = ENV_CONFIG
+module.exports = ENV_CONFIG;

+ 191 - 185
App.vue

@@ -1,53 +1,54 @@
 <script>
-	export default {
-		globalData: {
-			// 胶囊距上距离
-			menuTop: 0,
-			// 导航栏高度
-			navBarHeight: 0,
-			// 胶囊距右方间距(方保持左、右间距一致)
-			menuRight: 0,
-			// 胶囊距底部间距(保持底部间距一致)
-			menuBotton: 0,
-			// 胶囊高度(自定义内容可与胶囊高度保证一致)
-			menuHeight: 0,
-			// 状态栏高度
-			statusBarHeight: 0,
-			// 安全距离
-			safeAreaHeight: 0,
-			// 胶囊宽度
-			menuWidth: 0,
-			// 窗口宽度
-			windowWidth: 0,
-			// 窗口宽度高度
-			windowHeight: 0,
-			// 常规子页面可操作区域高度
-			pageContentHeight: 0,
-		},
-		onLaunch(options) {
-			const that = this;
-			// 获取系统信息
-			const systemInfo = uni.getSystemInfoSync();
-			// 胶囊按钮位置信息
-			const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
-			console.log(menuButtonInfo);
-			// 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
-			that.globalData.menuTop = menuButtonInfo.top - systemInfo.statusBarHeight;
-			that.globalData.menuBotton = menuButtonInfo.top - systemInfo.statusBarHeight;
-			that.globalData.menuWidth = menuButtonInfo.width;
-			that.globalData.navBarHeight =
-				(menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
-			that.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
-			that.globalData.menuHeight = menuButtonInfo.height;
-			that.globalData.statusBarHeight = systemInfo.statusBarHeight;
-			that.globalData.safeAreaHeight = systemInfo.safeAreaInsets.bottom;
-			that.globalData.windowWidth = systemInfo.windowWidth;
-			that.globalData.windowHeight = systemInfo.windowHeight;
-			that.globalData.pageContentHeight =
-				systemInfo.windowHeight -
-				(that.globalData.navBarHeight + that.globalData.menuTop + that.globalData.menuBotton);
-			console.log(options, "onLaunch系统信息");
-			let params = {};
+export default {
+	globalData: {
+		// 胶囊距上距离
+		menuTop: 0,
+		// 导航栏高度
+		navBarHeight: 0,
+		// 胶囊距右方间距(方保持左、右间距一致)
+		menuRight: 0,
+		// 胶囊距底部间距(保持底部间距一致)
+		menuBotton: 0,
+		// 胶囊高度(自定义内容可与胶囊高度保证一致)
+		menuHeight: 0,
+		// 状态栏高度
+		statusBarHeight: 0,
+		// 安全距离
+		safeAreaHeight: 0,
+		// 胶囊宽度
+		menuWidth: 0,
+		// 窗口宽度
+		windowWidth: 0,
+		// 窗口宽度高度
+		windowHeight: 0,
+		// 常规子页面可操作区域高度
+		pageContentHeight: 0,
+	},
+	onLaunch(options) {
+		const that = this;
+		// 获取系统信息
+		const systemInfo = uni.getSystemInfoSync();
+		// 胶囊按钮位置信息
+		const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
+		console.log(menuButtonInfo);
+		// 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
+		that.globalData.menuTop = menuButtonInfo.top - systemInfo.statusBarHeight;
+		that.globalData.menuBotton = menuButtonInfo.top - systemInfo.statusBarHeight;
+		that.globalData.menuWidth = menuButtonInfo.width;
+		that.globalData.navBarHeight =
+			(menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
+		that.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
+		that.globalData.menuHeight = menuButtonInfo.height;
+		that.globalData.statusBarHeight = systemInfo.statusBarHeight;
+		that.globalData.safeAreaHeight = systemInfo.safeAreaInsets.bottom;
+		that.globalData.windowWidth = systemInfo.windowWidth;
+		that.globalData.windowHeight = systemInfo.windowHeight;
+		that.globalData.pageContentHeight =
+			systemInfo.windowHeight -
+			(that.globalData.navBarHeight + that.globalData.menuTop + that.globalData.menuBotton);
+		console.log(options, "onLaunch系统信息");
+		let params = {};
+		if (options.query) {
 			if (options.query.scene) {
 				// 对 scene 进行解码
 				const decodeScene = decodeURIComponent(options.query.scene);
@@ -63,160 +64,165 @@
 				if (params.inviteCode) {
 					uni.setStorageSync('inviteCode', params.inviteCode)
 					console.log('解析出的 inviteCode 参数:', params.inviteCode);
-					this.slientLogin(params.inviteCode,'inviteCode');
-				} else if(params.upsellCode){
+					this.slientLogin(params.inviteCode, 'inviteCode');
+				} else if (params.upsellCode) {
 					// 用于书籍加价的邀请码,关联订单 id 和 isbn
 					uni.setStorageSync('upsellCode', params.upsellCode)
 					that.globalData.upsellCode = params.upsellCode
 					console.log('解析出的 upsellCode 参数:', params.upsellCode);
-					this.slientLogin(params.upsellCode,'upsellCode');
-				}else{
+					this.slientLogin(params.upsellCode, 'upsellCode');
+				} else {
 					this.slientLogin();
 				}
 			}
 
 			// 如果链接参数中有一个名为 inviteCode 的参数
-			if(options.query.inviteCode){
+			if (options.query.inviteCode) {
 				uni.setStorageSync('inviteCode', options.query.inviteCode)
-				this.slientLogin(options.query.inviteCode,'inviteCode');
+				this.slientLogin(options.query.inviteCode, 'inviteCode');
 			}
 			// 如果链接参数中有一个名为 upsellCode 的参数
-			if(options.query.upsellCode){
+			if (options.query.upsellCode) {
 				uni.setStorageSync('upsellCode', options.query.upsellCode)
 				that.globalData.upsellCode = options.query.upsellCode
-				this.slientLogin(options.query.upsellCode,'upsellCode');
+				this.slientLogin(options.query.upsellCode, 'upsellCode');
 			}
+		}else{
+			this.slientLogin()
+		}
+	},
+	methods: {
+		slientLogin(code2, type) {
+			uni.login({
+				success(res) {
+					//plat	integer($int32)平台 1-微信 2-支付宝
+					let platform = uni.getSystemInfoSync().uniPlatform
+					console.log(platform, 'platform')
+					let data = { code: res.code, plat: platform === 'mp-alipay' ? 2 : 1  }
+					if (type) {
+						data[type] = code2
+					}
+					uni.setStorageSync('loginType', data)
+
+					uni.$u.http
+						.post("/user/miniLogin", data)
+						.then((response) => {
+							if (response.code == 200) {
+								console.log(response.data, data, "登录成功");
+								uni.setStorageSync("loginSuccess", response.data);
+								uni.setStorageSync("token", response.data.token);
+							}
+						});
+				},
+				fail: (err) => {
+					console.log(err, "wx.login登录失败");
+				},
+			});
 		},
-		methods: {
-			slientLogin(code2,type) {
-				uni.login({
-					success(res) {
-						let data = { code: res.code }
-						if(type){
-							data[type] = code2
-						}
-						uni.setStorageSync('loginType', data)
-						console.log(data, "登录参数onLaunch");
-
-						uni.$u.http
-							.post("/user/wxLogin", data)
-							.then((response) => {
-								if (response.code == 200) {
-									console.log(response.data,data, "登录成功");
-									uni.setStorageSync("loginSuccess", response.data);
-									uni.setStorageSync("token", response.data.token);
-								}
-							});
-					},
-					fail: (err) => {
-						console.log(err, "wx.login登录失败");
-					},
-				});
-			},
-		},
-	};
+	},
+};
 </script>
 
 <style lang="scss">
-	// ===
-	// === 注意:此处导入的css,会作用于全部.vue文件,请适量导入
-	// ===
-	body {
-		font-family: PingFang-SC-Regular, PingFang-SC;
-	}
-
-	page {
-		background-color: $app-theme-bg-gray-deep-color;
-	}
-
-	@import "uview-ui/index.scss";
-	@import "./static/css/common.scss";
-
-	/* 解决小程序和app滚动条的问题 */
-	/* #ifdef MP-WEIXIN || APP-PLUS */
-	::-webkit-scrollbar {
-		display: none;
-		width: 0 !important;
-		height: 0 !important;
-		-webkit-appearance: none;
-		background: transparent;
-		color: transparent;
-	}
-
-	/* #endif */
-
-	/* 解决H5 的问题 */
-	/* #ifdef H5 */
-	uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
-		/* 隐藏滚动条,但依旧具备可以滚动的功能 */
-		display: none;
-		width: 0 !important;
-		height: 0 !important;
-		-webkit-appearance: none;
-		background: transparent;
-		color: transparent;
-	}
-
-	/* #endif */
-
-	.shu-elip-1 {
-		overflow: hidden;
-		text-overflow: ellipsis;
-		white-space: nowrap;
-	}
-
-	.shu-elip-2 {
-		display: -webkit-box;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		word-wrap: break-word;
-		white-space: normal !important;
-		-webkit-line-clamp: 2;
-		-webkit-box-orient: vertical;
-	}
-
-	// 导出 scss 变量用于在 script 下使用
-	.price_color {
-		color: $app-theme-text-money-color;
-	}
-
-	.color_blue {
-		color: $app-theme-blue;
-	}
-
-	.btnGroup {
-		display: flex;
-		align-items: center;
-
-		.btn {
-			margin: 0 10rpx;
-		}
-	}
-
-	.mallbtn {
-		min-width: 200rpx;
-		line-height: 66rpx;
-		padding: 0 20rpx;
-		border-radius: 36rpx;
-		color: #ffffff;
-		margin-right: 20rpx;
-		text-align: center;
-		flex: 1;
-		padding: 0 30rpx;
-	}
-
-	.soldOutBtn {
-		@extend .mallbtn;
-		background-color: $app-theme-nobuy-bg-color;
-	}
-
-	.joinCartBtn {
-		@extend .mallbtn;
-		background-color: $app-theme-joincart-bg-color;
-	}
-
-	.buyBtn {
-		@extend .mallbtn;
-		background-color: $app-theme-buybtn-bg-color;
+// ===
+// === 注意:此处导入的css,会作用于全部.vue文件,请适量导入
+// ===
+body {
+	font-family: PingFang-SC-Regular, PingFang-SC;
+}
+
+page {
+	background-color: $app-theme-bg-gray-deep-color;
+}
+
+@import "uview-ui/index.scss";
+@import "./static/css/common.scss";
+
+/* 解决小程序和app滚动条的问题 */
+/* #ifdef MP-WEIXIN || APP-PLUS */
+::-webkit-scrollbar {
+	display: none;
+	width: 0 !important;
+	height: 0 !important;
+	-webkit-appearance: none;
+	background: transparent;
+	color: transparent;
+}
+
+/* #endif */
+
+/* 解决H5 的问题 */
+/* #ifdef H5 */
+uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
+	/* 隐藏滚动条,但依旧具备可以滚动的功能 */
+	display: none;
+	width: 0 !important;
+	height: 0 !important;
+	-webkit-appearance: none;
+	background: transparent;
+	color: transparent;
+}
+
+/* #endif */
+
+.shu-elip-1 {
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+}
+
+.shu-elip-2 {
+	display: -webkit-box;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	word-wrap: break-word;
+	white-space: normal !important;
+	-webkit-line-clamp: 2;
+	-webkit-box-orient: vertical;
+}
+
+// 导出 scss 变量用于在 script 下使用
+.price_color {
+	color: $app-theme-text-money-color;
+}
+
+.color_blue {
+	color: $app-theme-blue;
+}
+
+.btnGroup {
+	display: flex;
+	align-items: center;
+
+	.btn {
+		margin: 0 10rpx;
 	}
+}
+
+.mallbtn {
+	min-width: 200rpx;
+	line-height: 66rpx;
+	padding: 0 20rpx;
+	border-radius: 36rpx;
+	color: #ffffff;
+	margin-right: 20rpx;
+	text-align: center;
+	flex: 1;
+	padding: 0 30rpx;
+}
+
+.soldOutBtn {
+	@extend .mallbtn;
+	background-color: $app-theme-nobuy-bg-color;
+}
+
+.joinCartBtn {
+	@extend .mallbtn;
+	background-color: $app-theme-joincart-bg-color;
+}
+
+.buyBtn {
+	@extend .mallbtn;
+	background-color: $app-theme-buybtn-bg-color;
+}
 </style>

+ 105 - 91
api/config.js

@@ -1,104 +1,118 @@
-import ENV_CONFIG from '@/.env.js'
-import { silentLogin } from './auth'
+import ENV_CONFIG from "@/.env.js";
+import { silentLogin } from "./auth";
 // api前缀
-export const HTTP_URL_DEV_PREFIX = '/api'
-export const HTTP_URL_PROD_PREFIX = '/api'
-const env = ENV_CONFIG[process.env.ENV_TYPE || 'dev'];
+export const HTTP_URL_DEV_PREFIX = "/api";
+export const HTTP_URL_PROD_PREFIX = "/api";
+
+let envVersion = "";
+let info = uni.getAccountInfoSync();
+// 微信小程序:获取环境版本(开发版、体验版、正式版)
+envVersion = info.miniProgram.envVersion;
+
+// #ifdef MP-ALIPAY
+// 支付宝小程序:使用 my.getRunMode 获取环境
+my.getRunMode && my.getRunMode({
+  success: (res) => {
+    envVersion = res.runMode;
+    console.log(envVersion, "envVersion");
+  },
+});
+// #endif
+
+const env = ENV_CONFIG[envVersion == "release" ? "production" : "development"];
+
 // 基于uview-ui的http配置
 export const UVIEWUI_HTTP_CONFIG = {
-	// 地址
-	baseUrl: env.apiUrl + env.apiUrlPrefix,
-	// 请求方式
-	method: 'post',
-	// 参数类型
-	dataType: 'json',
-	// 是否显示请求中的loading
-	showLoading: true,
-	// 请求loading中的文字提示
-	loadingText: '请求中...',
-	// 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
-	loadingTime: 800,
-	// 是否在拦截器中返回服务端的原始数据
-	originalData: true,
-	// 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
-	loadingMask: true,
-	// header:{
-	// 	token:uni.getStorageSync('token')
-	// },
-}
+  // 地址
+  baseUrl: env.apiUrl + env.apiUrlPrefix,
+  // 请求方式
+  method: "post",
+  // 参数类型
+  dataType: "json",
+  // 是否显示请求中的loading
+  showLoading: true,
+  // 请求loading中的文字提示
+  loadingText: "请求中...",
+  // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
+  loadingTime: 800,
+  // 是否在拦截器中返回服务端的原始数据
+  originalData: true,
+  // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
+  loadingMask: true,
+  // header:{
+  // 	token:uni.getStorageSync('token')
+  // },
+};
 
 // 此处配置请求拦截器
 export const httpRequest = (config) => {
-	const token = uni.getStorageSync('token');
-	config.header.Authorization = token ? `Bearer ${token}` : ''
-	return config;
-}
+  const token = uni.getStorageSync("token");
+  config.header.Authorization = token ? `Bearer ${token}` : "";
+  return config;
+};
 
 // 此处配置响应拦截器
 export const httpResponse = (res) => {
-	return new Promise(function(resolve, reject) {
-		if (res.statusCode == 200) {
-			console.log('成功>>>>', res.data);
-			if (res.data.code !== 200) {
-				uni.showToast({
-					icon: 'none',
-					title: res.data.msg
-				})
-				return reject(res.data);
-			}
-			if (res.data.code == 401) {
-				console.log('接口未登录>>>>401');
-				// 尝试静默登录
-				silentLogin()
-					.then((data) => {
-						// 登录成功,重新发起之前失败的请求
-						uni.$u.http.request(res.config).then(resolve).catch(reject);
-					})
-					.catch(() => {
-						// 登录失败,跳转首页
-						uni.switchTab({
-							url: '/pages/home/index'
-						});
-						reject(res.data);
-					});
-				return;
-			}
-			return resolve(res.data);
-		}
-		if (res.statusCode == 401) {
-			console.log('接口未登录>>>>401',res);
-
-			silentLogin()
-				.then((data) => {
-					// 登录成功,重新发起之前失败的请求
-					uni.$u.http.request(res.config).then(resolve).catch(reject);
-				})
-				.catch(() => {
-					// 登录失败,跳转首页
-					uni.switchTab({
-						url: '/pages/home/index'
-					});
-					reject(res.data);
-				});
-			return;
-		}
-		if (res.statusCode == 500) {
-			console.log('服务器异常>>>>500', res.config);
-			uni.showToast({
-				title: '服务器异常,请联系客服!',
-				icon: 'none',
-				duration: 3000
-			})
-			return reject(res.data);
-		}
+  return new Promise(function (resolve, reject) {
+    if (res.statusCode == 200) {
+      if (res.data.code !== 200) {
+        uni.showToast({
+          icon: "none",
+          title: res.data.msg || "服务器异常,请联系客服",
+        });
+        return resolve(res.data);
+      }
+      if (res.data.code == 401) {
+        console.log("接口未登录>>>>401");
+        // 尝试静默登录
+        silentLogin()
+          .then((data) => {
+            // 登录成功,重新发起之前失败的请求
+            uni.$u.http.request(res.config).then(resolve).catch(reject);
+          })
+          .catch(() => {
+            // 登录失败,跳转首页
+            uni.switchTab({
+              url: "/pages/home/index",
+            });
+            reject(res.data);
+          });
+        return resolve(res.data);
+      }
+      return resolve(res.data);
+    }
+    if (res.statusCode == 401) {
+      silentLogin()
+        .then((data) => {
+          // 登录成功,重新发起之前失败的请求
+          uni.$u.http.request(res.config).then(resolve).catch(reject);
+        })
+        .catch(() => {
+          // 登录失败,跳转首页
+          uni.switchTab({
+            url: "/pages/home/index",
+          });
+          reject(res.data);
+        });
+      return resolve(res.data);
+    }
+    if (res.statusCode == 500) {
+      console.log("服务器异常>>>>500", res.config);
+      uni.showToast({
+        title: "服务器异常,请联系客服!",
+        icon: "none",
+        duration: 3000,
+      });
+      return resolve(res.data);
+    }
 
-		return resolve(res.data);
-	})
-}
+    return resolve(res.data);
+  });
+};
 
 // http安装方法
 export const installHttpConfig = (Vue, vm) => {
-	Vue.prototype.$u.http.setConfig(UVIEWUI_HTTP_CONFIG);
-	Vue.prototype.$u.http.interceptor.request = httpRequest
-	Vue.prototype.$u.http.interceptor.response = httpResponse
-}
+  Vue.prototype.$u.http.setConfig(UVIEWUI_HTTP_CONFIG);
+  Vue.prototype.$u.http.interceptor.request = httpRequest;
+  Vue.prototype.$u.http.interceptor.response = httpResponse;
+};

+ 1 - 1
manifest.json

@@ -122,7 +122,7 @@
     "mp-alipay" : {
         "usingComponents" : true,
         "component2" : true,
-        "appid" : "2021005158666596"
+        "appid" : "2021005103690548"
     },
     "mp-qq" : {
         "optimization" : {

+ 22 - 0
pages-mine/pages/customer-service.vue

@@ -0,0 +1,22 @@
+<template>
+    <view class="container">
+        <web-view :src="serviceUrl"></web-view>
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            serviceUrl: 'http://xkf.zhimakf.com/s/132094qkhm'
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+    width: 100%;
+    height: 100vh;
+}
+</style> 

+ 8 - 1
pages.json

@@ -7,6 +7,7 @@
             "path": "pages/home/index",
             "style": {
                 "navigationBarTitleText": "",
+                "navigationBarTextStyle": "white",
                 "navigationStyle": "custom",
                 "mp-alipay": {
                     "transparentTitle": "always",
@@ -17,7 +18,7 @@
         {
             "path": "pages/mine/index",
             "style": {
-                "navigationBarTitleText": "我的",
+                "navigationBarTitleText": "",
                 "navigationBarBackgroundColor": "#38C148",
                 "navigationBarTextStyle": "white",
                 "navigationStyle": "custom",
@@ -182,6 +183,12 @@
                     "style": {
                         "navigationBarTitleText": "卖书规则"
                     }
+                },
+                {
+                    "path": "pages/customer-service",
+                    "style": {
+                        "navigationBarTitleText": "在线客服"
+                    }
                 }
             ]
         },

+ 20 - 0
pages/home/index.vue

@@ -164,6 +164,16 @@
             @touchmove="touchMove"
             @touchend="touchEnd"
         >
+            <!-- #ifdef MP-ALIPAY -->
+            <button class="service-btn" @click="navigateToCustomerService">
+                <image
+                    src="/static/img/kf.png"
+                    mode="widthFix"
+                    style="width: 126rpx; height: 140rpx"
+                ></image>
+            </button>
+            <!-- #endif -->
+            <!-- #ifndef MP-ALIPAY -->
             <button class="service-btn" open-type="contact">
                 <image
                     src="/static/img/kf.png"
@@ -171,6 +181,7 @@
                     style="width: 126rpx; height: 140rpx"
                 ></image>
             </button>
+            <!-- #endif -->
         </view>
 
         <ConfirmBooks ref="confirmBooks" @incomplete="handleIncomplete" />
@@ -361,6 +372,12 @@ export default {
             this.deleteBook = book;
             this.$refs.deleteDialog.openPopup(book);
         },
+        //支付宝小程序的客服
+        navigateToCustomerService() {
+            uni.navigateTo({
+                url: '/pages-mine/pages/customer-service'
+            });
+        },
 
         confirmDelete() {
             uni.$u.http
@@ -735,6 +752,9 @@ export default {
         font-size: 34rpx;
         color: #ffffff;
         padding-left: 40rpx;
+		/* #ifdef MP-ALIPAY */
+		padding-left: 70rpx;
+		/* #endif */
     }
 }
 

+ 656 - 681
pages/mine/index.vue

@@ -1,694 +1,669 @@
 <template>
-  <view class="mine-page">
-    <!-- <u-navbar title="我的" bgColor="transparent" titleBold></u-navbar> -->
-    <!-- 顶部用户信息 -->
-    <view class="user-info">
-      <view class="user-header" @tap="handleUpdateUserInfo">
-        <view class="user-avatar">
-          <image
-            class="avatar"
-            :src="userInfo.imgPath"
-            mode="aspectFill"
-            v-if="userInfo.imgPath"
-            style="width: 100%; height: 100%; display: block"
-          ></image>
-          <image
-            class="avatar"
-            src="https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/logo3.png"
-            mode="heightFix"
-            v-else
-            style="
-              width: 100%;
-              height: 116rpx;
-              display: block;
-              border-radius: 10%;
-            "
-          ></image>
-        </view>
-        <view class="user-detail">
-          <view class="nickname">{{ userInfo.nickName }}</view>
-          <view
-            class="user-tag"
-            v-for="(tag, index) in userInfo.tags"
-            :key="index"
-            >{{ tag }}</view
-          >
-        </view>
-      </view>
-
-      <!-- 用户数据 -->
-      <view class="user-data">
-        <view
-          class="data-item"
-          @click="navigateToTool('/pages-mine/pages/wallet')"
-        >
-          <view class="amount">{{ userInfo.accountMoney || 0 }}</view>
-          <view class="label">我的钱包</view>
-        </view>
-        <view class="data-item">
-          <view class="amount">{{ userInfo.couponNum || 0 }}</view>
-          <view class="label">优惠券</view>
-          <view class="badge" v-if="userInfo.couponNum"
-            >{{ userInfo.couponNum }}张可领</view
-          >
-        </view>
-        <view class="data-item">
-          <view class="amount">{{ userInfo.point || 0 }}</view>
-          <view class="label">我的积分</view>
-        </view>
-      </view>
-    </view>
-
-    <!-- 卖书订单 -->
-    <view class="order-section">
-      <view class="section-header">
-        <text>卖书订单</text>
-        <view class="view-all" @click="viewAllOrders">
-          <text>查看全部</text>
-          <u-icon name="arrow-right" size="24" color="#999"></u-icon>
-        </view>
-      </view>
-      <view class="order-types" style="padding: 0 20rpx">
-        <view
-          class="type-item flex-d flex-a-c"
-          v-for="(item, index) in orderTypes"
-          :key="index"
-          @click="navigateToOrder(item.path)"
-        >
-          <image class="type-icon" :src="item.icon" mode="aspectFit"></image>
-          <text>{{ item.name }}</text>
-          <view class="badge" v-if="item.badge">{{ item.badge }}</view>
-        </view>
-      </view>
-    </view>
-
-    <!-- 实用工具 -->
-    <view class="tools-section">
-      <view class="section-title">实用工具</view>
-      <view class="tools-grid">
-        <view
-          class="tool-item flex-d flex-a-c"
-          v-for="(tool, index) in tools"
-          :key="index"
-          @click="navigateToTool(tool.path)"
-        >
-          <button
-            class="link-service flex-d flex-a-c"
-            open-type="contact"
-            v-if="tool.path == 'link-service'"
-          >
-            <image class="tool-icon" :src="tool.icon" mode="aspectFit"></image>
-            <text>联系客服</text>
-          </button>
-          <block v-else>
-            <image class="tool-icon" :src="tool.icon" mode="aspectFit"></image>
-            <text>{{ tool.name }}</text>
-          </block>
-        </view>
-      </view>
-    </view>
-
-    <!-- 悬浮提现确认按钮 -->
-    <withdrawal-confirm
-      :visible="withdrawalOrder && withdrawalOrder.length > 0"
-      :initialPosition="buttonPosition"
-      @click="navigateToWithdrawal"
-      @position-change="onPositionChange"
-    />
-
-    <!-- 活动悬浮按钮 -->
-    <floating-activity
-      :img="activityInfo.img"
-      :visible="activityInfo.frequency && activityInfo.frequency == 3"
-      :initialPosition="activityPosition"
-      @click="contactCustomerService"
-      @position-change="onActivityButtonPositionChange"
-    />
-
-    <!-- 提现进度弹窗 -->
-    <withdrawal-progress
-      :orderInfo="currentWithdrawalOrder"
-      @confirm="confirmWithdrawal"
-      ref="withdrawalRef"
-    />
-  </view>
+	<view class="mine-page">
+		<!-- <u-navbar title="我的" bgColor="transparent" titleBold></u-navbar> -->
+		<!-- 顶部用户信息 -->
+		<view class="user-info">
+			<view class="user-header" @tap="handleUpdateUserInfo">
+				<view class="user-avatar">
+					<image class="avatar" :src="userInfo.imgPath" mode="aspectFill" v-if="userInfo.imgPath" style="width: 100%; height: 100%; display: block"></image>
+					<image
+						class="avatar"
+						src="https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/logo3.png"
+						mode="heightFix"
+						v-else
+						style="width: 100%; height: 116rpx; display: block; border-radius: 10%"
+					></image>
+				</view>
+				<view class="user-detail">
+					<view class="nickname">{{ userInfo.nickName }}</view>
+					<view class="user-tag" v-for="(tag, index) in userInfo.tags" :key="index">{{ tag }}</view>
+				</view>
+			</view>
+
+			<!-- 用户数据 -->
+			<view class="user-data">
+				<view class="data-item" @click="navigateToTool('/pages-mine/pages/wallet')">
+					<view class="amount">{{ userInfo.accountMoney || 0 }}</view>
+					<view class="label">我的钱包</view>
+				</view>
+				<view class="data-item">
+					<view class="amount">{{ userInfo.couponNum || 0 }}</view>
+					<view class="label">优惠券</view>
+					<view class="badge" v-if="userInfo.couponNum">{{ userInfo.couponNum }}张可领</view>
+				</view>
+				<view class="data-item">
+					<view class="amount">{{ userInfo.point || 0 }}</view>
+					<view class="label">我的积分</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 卖书订单 -->
+		<view class="order-section">
+			<view class="section-header">
+				<text>卖书订单</text>
+				<view class="view-all" @click="viewAllOrders">
+					<text>查看全部</text>
+					<u-icon name="arrow-right" size="24" color="#999"></u-icon>
+				</view>
+			</view>
+			<view class="order-types" style="padding: 0 20rpx">
+				<view class="type-item flex-d flex-a-c" v-for="(item, index) in orderTypes" :key="index" @click="navigateToOrder(item.path)">
+					<image class="type-icon" :src="item.icon" mode="aspectFit"></image>
+					<text>{{ item.name }}</text>
+					<view class="badge" v-if="item.badge">{{ item.badge }}</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 实用工具 -->
+		<view class="tools-section">
+			<view class="section-title">实用工具</view>
+			<view class="tools-grid">
+				<view class="tool-item flex-d flex-a-c" v-for="(tool, index) in tools" :key="index" @click="navigateToTool(tool.path)">
+					<!-- #ifdef MP-ALIPAY -->
+					<button class="link-service flex-d flex-a-c" v-if="tool.path == 'link-service'" @click="navigateToCustomerService">
+						<image class="tool-icon" :src="tool.icon" mode="aspectFit"></image>
+						<text>联系客服</text>
+					</button>
+					<!-- #endif -->
+					<!-- #ifndef MP-ALIPAY -->
+					<button class="link-service flex-d flex-a-c" open-type="contact" v-if="tool.path == 'link-service'">
+						<image class="tool-icon" :src="tool.icon" mode="aspectFit"></image>
+						<text>联系客服</text>
+					</button>
+					<!-- #endif -->
+
+					<block v-else>
+						<image class="tool-icon" :src="tool.icon" mode="aspectFit"></image>
+						<text>{{ tool.name }}</text>
+					</block>
+				</view>
+			</view>
+		</view>
+
+		<!-- 悬浮提现确认按钮 -->
+		<withdrawal-confirm
+			:visible="withdrawalOrder && withdrawalOrder.length > 0"
+			:initialPosition="buttonPosition"
+			@click="navigateToWithdrawal"
+			@position-change="onPositionChange"
+		/>
+
+		<!-- 活动悬浮按钮 -->
+		<floating-activity
+			:img="activityInfo.img"
+			:visible="activityInfo.frequency && activityInfo.frequency == 3"
+			:initialPosition="activityPosition"
+			@click="contactCustomerService"
+			@position-change="onActivityButtonPositionChange"
+		/>
+
+		<!-- 提现进度弹窗 -->
+		<withdrawal-progress :orderInfo="currentWithdrawalOrder" @confirm="confirmWithdrawal" ref="withdrawalRef" />
+	</view>
 </template>
 
 <script>
-import WithdrawalProgress from "./components/withdrawal-progress.vue";
-import WithdrawalConfirm from "../../components/withdrawal-confirm.vue";
-import floatingActivity from "../../components/floating-activity.vue";
+import WithdrawalProgress from './components/withdrawal-progress.vue';
+import WithdrawalConfirm from '../../components/withdrawal-confirm.vue';
+import floatingActivity from '../../components/floating-activity.vue';
 
 export default {
-  components: {
-    WithdrawalProgress,
-    WithdrawalConfirm,
-    floatingActivity,
-  },
-  data() {
-    return {
-      userInfo: {
-        userId: 0,
-        openid: "",
-        imgPath: "",
-        nickName: "这里是微信昵称.",
-        mobile: "",
-        tags: [],
-        accountMoney: 0,
-        couponNum: 0,
-        point: 0,
-        firstAuditNum: 0,
-        pickUpNum: 0,
-        auditNum: 0,
-        payNum: 0,
-        refundNum: 0,
-      },
-      orderTypes: [
-        {
-          name: "待初审",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/1.png",
-          badge: 0,
-          key: "firstAuditNum",
-          path: "/pages-mine/pages/order-page?status=2",
-        },
-        {
-          name: "待取件",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/2.png",
-          badge: 0,
-          key: "pickUpNum",
-          path: "/pages-mine/pages/order-page?status=3",
-        },
-        {
-          name: "待审核",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/3.png",
-          badge: 0,
-          key: "auditNum",
-          path: "/pages-mine/pages/order-page?status=8",
-        },
-        {
-          name: "待到款",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/4.png",
-          badge: 0,
-          key: "payNum",
-          path: "/pages-mine/pages/order-page?status=10",
-        },
-        {
-          name: "申请退回",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/5.png",
-          badge: 0,
-          key: "refundNum",
-          path: "/pages-mine/pages/apply-return",
-        },
-      ],
-      tools: [
-        {
-          name: "消息通知",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t1.png",
-          path: "/pages-mine/pages/notice",
-        },
-        {
-          name: "我的收藏",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t2.png",
-          path: "",
-        },
-        {
-          name: "我的足迹",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t3.png",
-          path: "",
-        },
-        {
-          name: "我的地址",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t4.png",
-          path: "/pages-mine/pages/address/list",
-        },
-        {
-          name: "我的优惠券",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t5.png",
-          path: "",
-        },
-        {
-          name: "联系客服",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t6.png",
-          path: "link-service",
-        },
-        {
-          name: "意见反馈",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t7.png",
-          path: "/pages-mine/pages/feedback",
-        },
-        {
-          name: "到货提醒",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t8.png",
-          path: "/pages/tools/arrival-notice",
-        },
-        {
-          name: "合伙人计划",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t9.png",
-          path: "/pages-mine/pages/partner/partner-rule",
-        },
-        {
-          name: "买卖答疑",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t10.png",
-          path: "/pages-mine/pages/rules-for-sellbooks",
-        },
-        {
-          name: "关于书嗨",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t11.png",
-          path: "/pages-home/pages/about-us",
-        },
-        {
-          name: "我的余额",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t12.png",
-          path: "/pages-mine/pages/wallet",
-        },
-        {
-          name: "用户设置",
-          icon: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t13.png",
-          path: "/pages-mine/pages/setting",
-        },
-      ],
-      // 悬浮按钮位置
-      buttonPosition: {
-        left: "auto",
-        right: 0,
-        bottom: "10%",
-      },
-      // 客服按钮位置
-      activityPosition: {
-        left: "auto",
-        right: 0,
-        bottom: "25%",
-      },
-      withdrawalOrder: [],
-      // 提现进度弹窗相关
-      showWithdrawalModal: false,
-      currentWithdrawalOrder: {},
-
-      //活动弹窗信息
-      activityInfo: {},
-    };
-  },
-  methods: {
-    //获取是否显示活动弹窗
-    getActivityStatus() {
-      uni.$u.http.post("/token/home/activity/dialog").then((res) => {
-        if (res.code == 200) {
-          this.activityInfo = res.data;
-        }
-      });
-    },
-
-    //获取是否存在待确认提现的订单
-    getWithdrawalOrder() {
-      uni.$u.http.get("/token/user/withdrawWindows").then((res) => {
-        console.log(res);
-        if (res.code == 200) {
-          this.withdrawalOrder = res.data;
-        }
-      });
-    },
-
-    //用户信息
-    handleUpdateUserInfo() {
-      uni.navigateTo({
-        url: "/pages-mine/pages/setting",
-      });
-    },
-    //查看全部订单
-    viewAllOrders() {
-      uni.navigateTo({
-        url: "/pages-mine/pages/order-page?status=-1",
-      });
-    },
-    //跳转订单
-    navigateToOrder(path) {
-      uni.navigateTo({
-        url: path,
-      });
-    },
-    //跳转工具
-    navigateToTool(path) {
-      if (!path)
-        return uni.showToast({
-          title: "开发中...",
-          icon: "none",
-        });
-
-      if (path == "/pages-mine/pages/partner/partner-rule") {
-        this.getPartnerStatus();
-      } else {
-        uni.navigateTo({
-          url: path,
-        });
-      }
-    },
-    // 导航到提现确认页面
-    navigateToWithdrawal() {
-      if (this.withdrawalOrder && this.withdrawalOrder.length > 0) {
-        // 显示提现进度弹窗,使用第一个提现订单
-        this.currentWithdrawalOrder = this.withdrawalOrder[0];
-        this.$refs.withdrawalRef.openModal();
-      } else {
-        // 如果没有待确认的提现订单,直接跳转到钱包页面
-        uni.navigateTo({
-          url: "/pages-mine/pages/wallet",
-        });
-      }
-    },
-    //获取用户信息
-    getUserInfo() {
-      uni.$u.http.get("/token/user/detail").then((res) => {
-        console.log(res);
-        if (res.code == 200) {
-          this.userInfo = res.data;
-          uni.setStorageSync("userInfo", this.userInfo);
-
-          this.orderTypes.forEach((item) => {
-            item.badge = this.userInfo[item.key];
-          });
-        }
-      });
-    },
-    //获取合伙人状态
-    getPartnerStatus() {
-      let item = this.tools.find((item) => item.name == "合伙人计划");
-      uni.$u.get("/token/getUserPartnerInfo").then((res) => {
-        if (res.code == 200) {
-          let { status } = res.data;
-          if (status == -1 || status == 4) {
-            item.path = "/pages-mine/pages/partner/partner-rule";
-          } else if (status == 1) {
-            item.path = "/pages-mine/pages/partner/partner-home";
-          } else {
-            item.path = "/pages-mine/pages/partner/partner-status";
-          }
-        } else {
-          item.path = "/pages-mine/pages/partner/partner-status";
-        }
-
-        uni.navigateTo({
-          url: item.path,
-        });
-      });
-    },
-
-    // 更新悬浮按钮位置
-    onPositionChange(position) {
-      this.buttonPosition = position;
-    },
-
-    // 更新活动按钮位置
-    onActivityButtonPositionChange(position) {
-      this.activityPosition = position;
-    },
-
-    // 联系客服
-    contactCustomerService() {
-      uni.navigateTo({
-        url: this.activityInfo.jumpPage,
-      });
-    },
-
-    // 关闭提现进度弹窗
-    closeWithdrawalModal() {
-      this.$refs.withdrawalRef.handleClose();
-    },
-
-    confirmWithdrawal(item) {
-      uni.$u.http
-        .post("/token/user/withdrawConfirm", {
-          orderNo: item.orderNo,
-        })
-        .then((res) => {
-          if (res.code === 200) {
-            this.handleConfirmReceipt(res.data);
-          }
-        })
-        .catch((err) => {
-          uni.showToast({
-            title: err.message || "确认失败",
-            icon: "none",
-          });
-        });
-    },
-    //执行微信确认收款操作
-    handleConfirmReceipt(data) {
-      if (wx.canIUse("requestMerchantTransfer")) {
-        wx.requestMerchantTransfer({
-          mchId: data.mchId,
-          appId: data.appId,
-          package: data.packageStr,
-          success: (res) => {
-            // res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
-            uni.showToast({
-              title: "确认收款成功",
-              icon: "none",
-            });
-            this.closeWithdrawalModal();
-            // 刷新列表
-            this.getWithdrawalOrder();
-          },
-          fail: (res) => {
-            console.log("fail:", res);
-          },
-        });
-      } else {
-        wx.showModal({
-          content: "你的微信版本过低,请更新至最新版本。",
-          showCancel: false,
-        });
-      }
-    },
-  },
-  onReady() {
-    // 获取屏幕宽度和高度
-    uni.getSystemInfo({
-      success: (res) => {
-        this.screenWidth = res.windowWidth;
-        this.screenHeight = res.windowHeight;
-      },
-    });
-
-    this.getActivityStatus();
-  },
-  onShow() {
-    let token = uni.getStorageSync("token");
-    if (token) {
-      this.getUserInfo();
-      this.getWithdrawalOrder();
-    }
-  },
+	components: {
+		WithdrawalProgress,
+		WithdrawalConfirm,
+		floatingActivity
+	},
+	data() {
+		return {
+			userInfo: {
+				userId: 0,
+				openid: '',
+				imgPath: '',
+				nickName: '这里是微信昵称.',
+				mobile: '',
+				tags: [],
+				accountMoney: 0,
+				couponNum: 0,
+				point: 0,
+				firstAuditNum: 0,
+				pickUpNum: 0,
+				auditNum: 0,
+				payNum: 0,
+				refundNum: 0
+			},
+			orderTypes: [
+				{
+					name: '待初审',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/1.png',
+					badge: 0,
+					key: 'firstAuditNum',
+					path: '/pages-mine/pages/order-page?status=2'
+				},
+				{
+					name: '待取件',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/2.png',
+					badge: 0,
+					key: 'pickUpNum',
+					path: '/pages-mine/pages/order-page?status=3'
+				},
+				{
+					name: '待审核',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/3.png',
+					badge: 0,
+					key: 'auditNum',
+					path: '/pages-mine/pages/order-page?status=8'
+				},
+				{
+					name: '待到款',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/4.png',
+					badge: 0,
+					key: 'payNum',
+					path: '/pages-mine/pages/order-page?status=10'
+				},
+				{
+					name: '申请退回',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/5.png',
+					badge: 0,
+					key: 'refundNum',
+					path: '/pages-mine/pages/apply-return'
+				}
+			],
+			tools: [
+				{
+					name: '消息通知',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t1.png',
+					path: '/pages-mine/pages/notice'
+				},
+				{
+					name: '我的收藏',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t2.png',
+					path: ''
+				},
+				{
+					name: '我的足迹',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t3.png',
+					path: ''
+				},
+				{
+					name: '我的地址',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t4.png',
+					path: '/pages-mine/pages/address/list'
+				},
+				{
+					name: '我的优惠券',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t5.png',
+					path: ''
+				},
+				{
+					name: '联系客服',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t6.png',
+					path: 'link-service'
+				},
+				{
+					name: '意见反馈',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t7.png',
+					path: '/pages-mine/pages/feedback'
+				},
+				{
+					name: '到货提醒',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t8.png',
+					path: '/pages/tools/arrival-notice'
+				},
+				{
+					name: '合伙人计划',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t9.png',
+					path: '/pages-mine/pages/partner/partner-rule'
+				},
+				{
+					name: '买卖答疑',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t10.png',
+					path: '/pages-mine/pages/rules-for-sellbooks'
+				},
+				{
+					name: '关于书嗨',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t11.png',
+					path: '/pages-home/pages/about-us'
+				},
+				{
+					name: '我的余额',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t12.png',
+					path: '/pages-mine/pages/wallet'
+				},
+				{
+					name: '用户设置',
+					icon: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/t13.png',
+					path: '/pages-mine/pages/setting'
+				}
+			],
+			// 悬浮按钮位置
+			buttonPosition: {
+				left: 'auto',
+				right: 0,
+				bottom: '10%'
+			},
+			// 客服按钮位置
+			activityPosition: {
+				left: 'auto',
+				right: 0,
+				bottom: '25%'
+			},
+			withdrawalOrder: [],
+			// 提现进度弹窗相关
+			showWithdrawalModal: false,
+			currentWithdrawalOrder: {},
+
+			//活动弹窗信息
+			activityInfo: {}
+		};
+	},
+	methods: {
+		//获取是否显示活动弹窗
+		getActivityStatus() {
+			uni.$u.http.post('/token/home/activity/dialog').then((res) => {
+				if (res.code == 200) {
+					this.activityInfo = res.data;
+				}
+			});
+		},
+
+		//获取是否存在待确认提现的订单
+		getWithdrawalOrder() {
+			uni.$u.http.get('/token/user/withdrawWindows').then((res) => {
+				console.log(res);
+				if (res.code == 200) {
+					this.withdrawalOrder = res.data;
+				}
+			});
+		},
+
+		//用户信息
+		handleUpdateUserInfo() {
+			uni.navigateTo({
+				url: '/pages-mine/pages/setting'
+			});
+		},
+		//查看全部订单
+		viewAllOrders() {
+			uni.navigateTo({
+				url: '/pages-mine/pages/order-page?status=-1'
+			});
+		},
+		//跳转订单
+		navigateToOrder(path) {
+			uni.navigateTo({
+				url: path
+			});
+		},
+		//跳转工具
+		navigateToTool(path) {
+			if (!path)
+				return uni.showToast({
+					title: '开发中...',
+					icon: 'none'
+				});
+
+			if (path == '/pages-mine/pages/partner/partner-rule') {
+				this.getPartnerStatus();
+			} else {
+				uni.navigateTo({
+					url: path
+				});
+			}
+		},
+		// 导航到提现确认页面
+		navigateToWithdrawal() {
+			if (this.withdrawalOrder && this.withdrawalOrder.length > 0) {
+				// 显示提现进度弹窗,使用第一个提现订单
+				this.currentWithdrawalOrder = this.withdrawalOrder[0];
+				this.$refs.withdrawalRef.openModal();
+			} else {
+				// 如果没有待确认的提现订单,直接跳转到钱包页面
+				uni.navigateTo({
+					url: '/pages-mine/pages/wallet'
+				});
+			}
+		},
+		//获取用户信息
+		getUserInfo() {
+			uni.$u.http.get('/token/user/detail').then((res) => {
+				console.log(res);
+				if (res.code == 200) {
+					this.userInfo = res.data;
+					uni.setStorageSync('userInfo', this.userInfo);
+
+					this.orderTypes.forEach((item) => {
+						item.badge = this.userInfo[item.key];
+					});
+				}
+			});
+		},
+		//获取合伙人状态
+		getPartnerStatus() {
+			let item = this.tools.find((item) => item.name == '合伙人计划');
+			uni.$u.get('/token/getUserPartnerInfo').then((res) => {
+				if (res.code == 200) {
+					let { status } = res.data;
+					if (status == -1 || status == 4) {
+						item.path = '/pages-mine/pages/partner/partner-rule';
+					} else if (status == 1) {
+						item.path = '/pages-mine/pages/partner/partner-home';
+					} else {
+						item.path = '/pages-mine/pages/partner/partner-status';
+					}
+				} else {
+					item.path = '/pages-mine/pages/partner/partner-status';
+				}
+
+				uni.navigateTo({
+					url: item.path
+				});
+			});
+		},
+
+		// 更新悬浮按钮位置
+		onPositionChange(position) {
+			this.buttonPosition = position;
+		},
+
+		// 更新活动按钮位置
+		onActivityButtonPositionChange(position) {
+			this.activityPosition = position;
+		},
+
+		// 联系客服
+		contactCustomerService() {
+			uni.navigateTo({
+				url: this.activityInfo.jumpPage
+			});
+		},
+
+		// 关闭提现进度弹窗
+		closeWithdrawalModal() {
+			this.$refs.withdrawalRef.handleClose();
+		},
+
+		confirmWithdrawal(item) {
+			uni.$u.http
+				.post('/token/user/withdrawConfirm', {
+					orderNo: item.orderNo
+				})
+				.then((res) => {
+					if (res.code === 200) {
+						this.handleConfirmReceipt(res.data);
+					}
+				})
+				.catch((err) => {
+					uni.showToast({
+						title: err.message || '确认失败',
+						icon: 'none'
+					});
+				});
+		},
+		//执行微信确认收款操作
+		handleConfirmReceipt(data) {
+			if (wx.canIUse('requestMerchantTransfer')) {
+				wx.requestMerchantTransfer({
+					mchId: data.mchId,
+					appId: data.appId,
+					package: data.packageStr,
+					success: (res) => {
+						// res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
+						uni.showToast({
+							title: '确认收款成功',
+							icon: 'none'
+						});
+						this.closeWithdrawalModal();
+						// 刷新列表
+						this.getWithdrawalOrder();
+					},
+					fail: (res) => {
+						console.log('fail:', res);
+					}
+				});
+			} else {
+				wx.showModal({
+					content: '你的微信版本过低,请更新至最新版本。',
+					showCancel: false
+				});
+			}
+		},
+		navigateToCustomerService() {
+			uni.navigateTo({
+				url: '/pages-mine/pages/customer-service'
+			});
+		}
+	},
+	onReady() {
+		// 获取屏幕宽度和高度
+		uni.getSystemInfo({
+			success: (res) => {
+				this.screenWidth = res.windowWidth;
+				this.screenHeight = res.windowHeight;
+			}
+		});
+
+		this.getActivityStatus();
+	},
+	onShow() {
+		let token = uni.getStorageSync('token');
+		if (token) {
+			this.getUserInfo();
+			this.getWithdrawalOrder();
+		}
+	}
 };
 </script>
 
 <style lang="scss" scoped>
 .mine-page {
-  min-height: 100vh;
-  background-color: #f5f5f5;
-  position: relative;
-
-  .link-service {
-    background: transparent;
-    border: none;
-    padding: 0;
-    margin: 0;
-    width: 100%;
-    height: 100%;
-    line-height: 36rpx;
-  }
-
-  .user-info {
-    background: url("/static/img/bg.png") no-repeat center center;
-    background-size: 100% 100%;
-    position: absolute;
-    top: 0;
-    left: 0;
-    padding: 20rpx 50rpx 120rpx;
-    color: #fff;
-    position: relative;
-    padding-top: 160rpx;
-
-    &::after {
-      width: 140%;
-      position: absolute;
-      left: -20%;
-      top: 0;
-      z-index: -1;
-      content: "";
-      border-radius: 0 0 50% 50%;
-      background: #fd6954;
-    }
-
-    .user-header {
-      display: flex;
-      align-items: center;
-      margin-bottom: 40rpx;
-
-      .user-avatar {
-        border-radius: 50%;
-        margin-right: 20rpx;
-        border: 4rpx solid #fff;
-        width: 128rpx;
-        height: 128rpx;
-        overflow: hidden;
-        flex-shrink: 0;
-        background: #fff;
-
-        .avatar {
-          width: 100%;
-          height: 100%;
-          border-radius: 50%;
-          object-fit: cover;
-        }
-      }
-
-      .user-detail {
-        .nickname {
-          font-size: 32rpx;
-          font-weight: 500;
-          margin-bottom: 8rpx;
-        }
-
-        .user-tag {
-          display: inline-block;
-          font-size: 22rpx;
-          padding: 4rpx 12rpx;
-          background: linear-gradient(-90deg, #272321, #4b4542);
-          border-radius: 4rpx;
-          margin-top: 8rpx;
-          margin-right: 10rpx;
-        }
-      }
-    }
-
-    .user-data {
-      display: flex;
-      justify-content: space-between;
-      position: relative;
-      z-index: 1;
-      padding: 0 40rpx;
-
-      .data-item {
-        position: relative;
-        text-align: center;
-
-        .amount {
-          font-size: 38rpx;
-          font-weight: 500;
-          margin-bottom: 8rpx;
-        }
-
-        .label {
-          font-size: 24rpx;
-          font-weight: 400;
-          opacity: 0.9;
-        }
-
-        .badge {
-          position: absolute;
-          top: -15rpx;
-          right: -120%;
-          padding: 0 10rpx;
-          font-size: 20rpx;
-          line-height: 30rpx;
-          height: 30rpx;
-          background: #ff8400;
-          border-radius: 15rpx 15rpx 15rpx 0rpx;
-        }
-      }
-    }
-  }
-
-  .order-section {
-    margin: -90rpx 30rpx 20rpx;
-    background: #fff;
-    border-radius: 12rpx;
-    padding: 30rpx;
-    position: relative;
-    z-index: 2;
-
-    .section-header {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      margin-bottom: 30rpx;
-
-      .view-all {
-        display: flex;
-        align-items: center;
-        color: #999;
-        font-size: 26rpx;
-      }
-    }
-
-    .order-types {
-      display: flex;
-      justify-content: space-between;
-
-      .type-item {
-        text-align: center;
-        position: relative;
-        .badge {
-          position: absolute;
-          top: -15rpx;
-          right: -6px;
-          padding: 0 10rpx;
-          font-size: 20rpx;
-          line-height: 30rpx;
-          height: 30rpx;
-          background: #f56c6c;
-          color: #fff;
-          border-radius: 15rpx 15rpx 15rpx 0rpx;
-        }
-
-        .type-icon {
-          width: 60rpx;
-          height: 60rpx;
-          margin-bottom: 12rpx;
-        }
-
-        text {
-          font-size: 26rpx;
-          color: #333;
-        }
-      }
-    }
-  }
-
-  .tools-section {
-    margin: 30rpx;
-    background: #fff;
-    border-radius: 12rpx;
-    padding: 30rpx;
-    position: relative;
-    z-index: 2;
-
-    .section-title {
-      font-size: 30rpx;
-      font-weight: 500;
-      margin-bottom: 30rpx;
-    }
-
-    .tools-grid {
-      display: grid;
-      grid-template-columns: repeat(4, 1fr);
-      gap: 30rpx;
-
-      .tool-item {
-        text-align: center;
-
-        .tool-icon {
-          width: 60rpx;
-          height: 60rpx;
-          margin-bottom: 12rpx;
-        }
-
-        text {
-          font-size: 24rpx;
-          color: #333;
-        }
-      }
-    }
-  }
+	min-height: 100vh;
+	background-color: #f5f5f5;
+	position: relative;
+
+	.link-service {
+		background: transparent;
+		border: none;
+		padding: 0;
+		margin: 0;
+		width: 100%;
+		height: 100%;
+		line-height: 36rpx;
+	}
+
+	.user-info {
+		background: url('/static/img/bg.png') no-repeat center center;
+		background-size: 100% 100%;
+		position: absolute;
+		top: 0;
+		left: 0;
+		padding: 20rpx 50rpx 120rpx;
+		color: #fff;
+		position: relative;
+		padding-top: 160rpx;
+
+		&::after {
+			width: 140%;
+			position: absolute;
+			left: -20%;
+			top: 0;
+			z-index: -1;
+			content: '';
+			border-radius: 0 0 50% 50%;
+			background: #fd6954;
+		}
+
+		.user-header {
+			display: flex;
+			align-items: center;
+			margin-bottom: 40rpx;
+
+			.user-avatar {
+				border-radius: 50%;
+				margin-right: 20rpx;
+				border: 4rpx solid #fff;
+				width: 128rpx;
+				height: 128rpx;
+				overflow: hidden;
+				flex-shrink: 0;
+				background: #fff;
+
+				.avatar {
+					width: 100%;
+					height: 100%;
+					border-radius: 50%;
+					object-fit: cover;
+				}
+			}
+
+			.user-detail {
+				.nickname {
+					font-size: 32rpx;
+					font-weight: 500;
+					margin-bottom: 8rpx;
+				}
+
+				.user-tag {
+					display: inline-block;
+					font-size: 22rpx;
+					padding: 4rpx 12rpx;
+					background: linear-gradient(-90deg, #272321, #4b4542);
+					border-radius: 4rpx;
+					margin-top: 8rpx;
+					margin-right: 10rpx;
+				}
+			}
+		}
+
+		.user-data {
+			display: flex;
+			justify-content: space-between;
+			position: relative;
+			z-index: 1;
+			padding: 0 40rpx;
+
+			.data-item {
+				position: relative;
+				text-align: center;
+
+				.amount {
+					font-size: 38rpx;
+					font-weight: 500;
+					margin-bottom: 8rpx;
+				}
+
+				.label {
+					font-size: 24rpx;
+					font-weight: 400;
+					opacity: 0.9;
+				}
+
+				.badge {
+					position: absolute;
+					top: -15rpx;
+					right: -120%;
+					padding: 0 10rpx;
+					font-size: 20rpx;
+					line-height: 30rpx;
+					height: 30rpx;
+					background: #ff8400;
+					border-radius: 15rpx 15rpx 15rpx 0rpx;
+				}
+			}
+		}
+	}
+
+	.order-section {
+		margin: -90rpx 30rpx 20rpx;
+		background: #fff;
+		border-radius: 12rpx;
+		padding: 30rpx;
+		position: relative;
+		z-index: 2;
+
+		.section-header {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin-bottom: 30rpx;
+
+			.view-all {
+				display: flex;
+				align-items: center;
+				color: #999;
+				font-size: 26rpx;
+			}
+		}
+
+		.order-types {
+			display: flex;
+			justify-content: space-between;
+
+			.type-item {
+				text-align: center;
+				position: relative;
+				.badge {
+					position: absolute;
+					top: -15rpx;
+					right: -6px;
+					padding: 0 10rpx;
+					font-size: 20rpx;
+					line-height: 30rpx;
+					height: 30rpx;
+					background: #f56c6c;
+					color: #fff;
+					border-radius: 15rpx 15rpx 15rpx 0rpx;
+				}
+
+				.type-icon {
+					width: 60rpx;
+					height: 60rpx;
+					margin-bottom: 12rpx;
+				}
+
+				text {
+					font-size: 26rpx;
+					color: #333;
+				}
+			}
+		}
+	}
+
+	.tools-section {
+		margin: 30rpx;
+		background: #fff;
+		border-radius: 12rpx;
+		padding: 30rpx;
+		position: relative;
+		z-index: 2;
+
+		.section-title {
+			font-size: 30rpx;
+			font-weight: 500;
+			margin-bottom: 30rpx;
+		}
+
+		.tools-grid {
+			display: grid;
+			grid-template-columns: repeat(4, 1fr);
+			gap: 30rpx;
+
+			.tool-item {
+				text-align: center;
+
+				.tool-icon {
+					width: 60rpx;
+					height: 60rpx;
+					margin-bottom: 12rpx;
+				}
+
+				text {
+					font-size: 24rpx;
+					color: #333;
+				}
+			}
+		}
+	}
 }
 </style>