|
@@ -27,10 +27,10 @@
|
|
<uni-easyinput placeholder="请输入验证码" v-model="state.sms.code" :inputBorder="false" type="number" maxlength="6"></uni-easyinput>
|
|
<uni-easyinput placeholder="请输入验证码" v-model="state.sms.code" :inputBorder="false" type="number" maxlength="6"></uni-easyinput>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
</uni-forms>
|
|
</uni-forms>
|
|
- <view>
|
|
|
|
|
|
+ <!-- <view>
|
|
<button v-if="!protocol" class="wxLogon" type="text" :plain="true" @click="showProtocolToast">微信一键登录</button>
|
|
<button v-if="!protocol" class="wxLogon" type="text" :plain="true" @click="showProtocolToast">微信一键登录</button>
|
|
<button v-else class="wxLogon" type="text" :plain="true" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信一键登录</button>
|
|
<button v-else class="wxLogon" type="text" :plain="true" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信一键登录</button>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
|
|
<button class="send-button" @tap="handleLogin"> 登录/注册 </button>
|
|
<button class="send-button" @tap="handleLogin"> 登录/注册 </button>
|
|
<view class="agreement-box ss-flex ss-row-center">
|
|
<view class="agreement-box ss-flex ss-row-center">
|
|
@@ -136,30 +136,30 @@ const handleLogin = async () => {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-const showProtocolToast = () => {
|
|
|
|
- uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
|
|
|
|
-}
|
|
|
|
|
|
+// const showProtocolToast = () => {
|
|
|
|
+// uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
|
|
|
|
+// }
|
|
|
|
|
|
// 微信登录
|
|
// 微信登录
|
|
-const getPhoneNumber = async (e) => {
|
|
|
|
- if (e?.detail?.errMsg !== 'getPhoneNumber:ok') {
|
|
|
|
- uni.showToast({ title: '微信登录失败', icon: 'none' })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- changeType.value = 'login'
|
|
|
|
- wx.login({
|
|
|
|
- success: async (result) => {
|
|
|
|
- const wxLoginCode = result?.code || ''
|
|
|
|
- const query = {
|
|
|
|
- loginCode: wxLoginCode,
|
|
|
|
- phoneCode: e.detail.code,
|
|
|
|
- state: e.detail.encryptedData,
|
|
|
|
- }
|
|
|
|
- await useUserStore.handleSmsLogin(query, 2)
|
|
|
|
- },
|
|
|
|
- fail:(res)=> { console.log("获取登录凭证code失败!", res) }
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+// const getPhoneNumber = async (e) => {
|
|
|
|
+// if (e?.detail?.errMsg !== 'getPhoneNumber:ok') {
|
|
|
|
+// uni.showToast({ title: '微信登录失败', icon: 'none' })
|
|
|
|
+// return
|
|
|
|
+// }
|
|
|
|
+// changeType.value = 'login'
|
|
|
|
+// wx.login({
|
|
|
|
+// success: async (result) => {
|
|
|
|
+// const wxLoginCode = result?.code || ''
|
|
|
|
+// const query = {
|
|
|
|
+// loginCode: wxLoginCode,
|
|
|
|
+// phoneCode: e.detail.code,
|
|
|
|
+// state: e.detail.encryptedData,
|
|
|
|
+// }
|
|
|
|
+// await useUserStore.handleSmsLogin(query, 2)
|
|
|
|
+// },
|
|
|
|
+// fail:(res)=> { console.log("获取登录凭证code失败!", res) }
|
|
|
|
+// })
|
|
|
|
+// }
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|