From fa42f78dbe0fa7ef9b33987476b061d9e3d3581a Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Mon, 18 May 2026 19:50:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=85=B3=E6=B3=A8=20?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=BF=AD=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/bind/applyForm.vue | 154 +++++++++++++++++++++++++----------------------- root/bind/view.vue | 4 +- root/bind/viewim.vue | 4 +- 3 files changed, 85 insertions(+), 77 deletions(-) diff --git a/root/bind/applyForm.vue b/root/bind/applyForm.vue index 04f7b8b..18bf4ee 100644 --- a/root/bind/applyForm.vue +++ b/root/bind/applyForm.vue @@ -21,52 +21,49 @@
申请人基本信息:
-
- 申请人 -
- -
+
{{ newForm.wxname }}
+
+
+
+ 企业logo +
+
+
+ +
+
+ +
+
+
+
+
企业简称 @@ -115,7 +112,7 @@ class="g_flex_1 g_ml_10" maxlength="30" type="textarea" - placeholder="申请备注…" + placeholder="申请关注说明…" placeholder-style="color:#999;font-size:16px;" :clearable="false" :customStyle="{ fontSize: '16px' }" @@ -141,8 +138,15 @@ :style="info.recordStatus == 1 || info.recordStatus == 2 ? 'pointer-events: none;background-color: #999;' : ''" hover-class="thover" @click="handleSubmit" - > - {{ info.recordStatus == 1 ? "已提交" : info.recordStatus == 2 ? "已关注" : "申请关注" }} + > +
+ + + +
+ {{ info.recordStatus == 1 ? "已提交" : info.recordStatus == 2 ? "已关注" : "申请关注" }} +
+
@@ -159,6 +163,7 @@ export default { }, data() { return { + btnloading:false, newForm:{ wxname:'', wxavatar:'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/pugongying/default.svg', @@ -187,6 +192,7 @@ export default { btnSpeed: -1, // -1 默认 0 按下 1请求中 2请求后 foa:2, + chooseAvatarLoading: false, }; }, onLoad(options) { @@ -214,7 +220,7 @@ export default { wxavatar:_datas.avatar || 'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/pugongying/default.svg', companyName: _datas.applyFullName, phone: _datas.tel, - remark:_datas.remark || '无备注', + remark:_datas.remark || '无申请说明', }; that.info.logo = _datas.logo; that.info.recordStatus = 1; @@ -238,37 +244,15 @@ export default { } }, methods: { - // 使用新的getUserProfile API获取用户信息 - getUserProfile() { - let that = this; - // 检查是否已经授权过 - if (that.newForm.wxname && that.newForm.wxname !== '微信昵称') { - return; - } - - uni.getUserProfile({ - desc: '用于完善用户资料', // 声明获取用户个人信息后的用途 - success: (res) => { - console.log("获取用户信息成功:", res); - if (res.userInfo) { - that.newForm.wxname = res.userInfo.nickName; - that.newForm.wxavatar = res.userInfo.avatarUrl || 'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/pugongying/default.svg'; - uni.showToast({ - title: '获取成功', - icon: 'success' - }); - } - }, - fail: (err) => { - console.log("获取用户信息失败:", err); - uni.showModal({ - title: '提示', - content: '您取消了授权,将无法获取微信昵称信息', - showCancel: false, - confirmText: '知道了' - }); - } - }); + onChooseAvatar(e) { + console.log("onChooseAvatar", e); + if (this.chooseAvatarLoading) return; + this.chooseAvatarLoading = true; + this.newForm.wxavatar = e.detail.avatarUrl; + // 重置状态,防止快速重复点击导致的冲突 + setTimeout(() => { + this.chooseAvatarLoading = false; + }, 1000); }, init() { let that = this; @@ -314,7 +298,14 @@ export default { if(!that.newForm.wxname){ uni.showToast({ - title: '请输入申请人昵称', + title: '请授权微信名字', + icon: 'none' + }); + return false; + } + if(!that.newForm.wxavatar || that.newForm.wxavatar == 'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/pugongying/default.svg'){ + uni.showToast({ + title: '请上传企业logo', icon: 'none' }); return false; @@ -326,9 +317,9 @@ export default { }); return false; } - if(!that.newForm.phone){ + if(!/^1[3-9]\d{9}$/.test(that.newForm.phone)){ uni.showToast({ - title: '请输入联系电话', + title: '请输入正确的手机号', icon: 'none' }); return false; @@ -350,22 +341,25 @@ export default { uni.showLoading({ title: "正在发送", }); + that.btnloading = true; setTimeout(() => { uni.hideLoading(); - that.G.Get( - that.api.bind_subscribeSubmit + "/" + that.info.agencyId, - params, - (res) => { + // that.G.Get( + // that.api.bind_subscribeSubmit + "/" + that.info.agencyId, + // params, + // (res) => { // 请求后 that.btnSpeed = 2; uni.showToast({ title: "提交成功", }); setTimeout(() => { + that.newForm.remark = '无申请说明' that.info.recordStatus = 1; + that.btnloading = false; }, 1500); - } - ); + // } + // ); }, 500); }, goPage($path) { @@ -378,6 +372,20 @@ export default {