feat:小程序兼容版本调整
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<view class="input-area-wrapper">
|
||||
<view v-if="!visibleWaveBtn" class="area-input">
|
||||
<!-- 语音/键盘切换 -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="input-container-voice" @click="toggleVoiceMode">
|
||||
<image
|
||||
class="voice-icon"
|
||||
@@ -14,6 +15,7 @@
|
||||
src="https://oss.nianxx.cn/mp/static/version_101/home/input_keyboard_icon.png"
|
||||
/>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 输入框/语音按钮容器 -->
|
||||
<view class="input-button-container">
|
||||
@@ -77,8 +79,10 @@ import { ref, computed, watch, nextTick, onMounted, defineExpose } from "vue";
|
||||
import RecordingWaveBtn from "@/components/Speech/RecordingWaveBtn.vue";
|
||||
import { getCurrentConfig } from "@/constant/base";
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
const plugin = requirePlugin("WechatSI");
|
||||
const manager = plugin.getRecordRecognitionManager();
|
||||
// #endif
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: String,
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
}
|
||||
|
||||
.input-button-container {
|
||||
// #ifdef MP-TOUTIAO
|
||||
margin-left: 12px;
|
||||
// #endif
|
||||
flex: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<ChatCardOther class="flex flex-justify-center" :text="item.msg">
|
||||
<ChatCardOther :text="item.msg">
|
||||
<ActivityListComponent v-if="
|
||||
mainPageDataModel.activityList &&
|
||||
mainPageDataModel.activityList.length > 0
|
||||
|
||||
@@ -21,7 +21,12 @@ import { checkToken } from "@/hooks/useGoLogin";
|
||||
const itemList = ref([
|
||||
{
|
||||
icon: "",
|
||||
// #ifdef MP-TOUTIAO
|
||||
title: "商品列表",
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
title: "快速预定",
|
||||
// #endif
|
||||
type: Command.quickBooking,
|
||||
},
|
||||
{
|
||||
@@ -29,6 +34,7 @@ const itemList = ref([
|
||||
title: "探索发现",
|
||||
type: Command.discovery,
|
||||
},
|
||||
// #ifdef MP-WEIXIN
|
||||
{
|
||||
icon: "",
|
||||
title: "呼叫服务",
|
||||
@@ -39,6 +45,7 @@ const itemList = ref([
|
||||
title: "更多",
|
||||
type: Command.more,
|
||||
},
|
||||
// #endif
|
||||
]);
|
||||
|
||||
const sendReply = (item) => {
|
||||
|
||||
@@ -39,7 +39,12 @@ const popup = ref(null);
|
||||
const list = ref([
|
||||
{
|
||||
icon: "https://oss.nianxx.cn/mp/static/version_101/home/ksyd.png",
|
||||
// #ifdef MP-TOUTIAO
|
||||
title: "商品列表",
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
title: "快速预定",
|
||||
// #endif
|
||||
content: "预定门票、房间、餐食",
|
||||
btnText: "去预定",
|
||||
type: Command.quickBooking,
|
||||
|
||||
@@ -2,29 +2,23 @@
|
||||
<view class="container">
|
||||
<ModuleTitle :title="recommendTheme.themeName" />
|
||||
|
||||
<view class="container-scroll font-size-0 scroll-x whitespace-nowrap">
|
||||
<view
|
||||
class="card-item bg-white inline-block rounded-20 mr-8"
|
||||
v-for="(item, index) in recommendTheme.recommendPostsList"
|
||||
:key="index"
|
||||
@click="sendReply(item)"
|
||||
>
|
||||
<view class="m-4 relative">
|
||||
<image
|
||||
class="card-img rounded-16 relative z-10"
|
||||
:src="item.coverPhoto"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view class="container-scroll font-size-0 scroll-x">
|
||||
<view class="whitespace-nowrap">
|
||||
<view class="card-item bg-white inline-block rounded-20 mr-8"
|
||||
v-for="(item, index) in recommendTheme.recommendPostsList" :key="index" @click="sendReply(item)">
|
||||
<view class="m-4 relative">
|
||||
<image class="card-img rounded-16 relative z-10" :src="item.coverPhoto" mode="aspectFill" />
|
||||
|
||||
<view class="shadow absolute rounded-16"></view>
|
||||
</view>
|
||||
|
||||
<view class="card-text border-box">
|
||||
<view class="color-171717 font-size-14 line-height-20 ellipsis-1">
|
||||
{{ item.topic }}
|
||||
<view class="shadow absolute rounded-16"></view>
|
||||
</view>
|
||||
<view class="font-size-11 color-99A0AE">
|
||||
{{ item.userInputContent }}
|
||||
|
||||
<view class="card-text border-box">
|
||||
<view class="color-171717 font-size-14 line-height-20 ellipsis-1">
|
||||
{{ item.topic }}
|
||||
</view>
|
||||
<view class="font-size-11 color-99A0AE">
|
||||
{{ item.userInputContent }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -28,12 +28,19 @@
|
||||
<!-- 按钮区域 -->
|
||||
<view class="login-btn-area">
|
||||
<!-- 同意隐私协议并获取手机号按钮 -->
|
||||
<button v-if="needWxAuthLogin" class="login-btn" type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button v-if="needWxAuthLogin" class="login-btn" type="primary" open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhoneNumber">
|
||||
手机号快捷登录
|
||||
</button>
|
||||
<button v-else class="login-btn" type="primary" @click="handleAgreeAndGetPhone">
|
||||
手机号快捷登录
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-TOUTIAO -->
|
||||
<button class="login-btn" type="primary" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberHandler"
|
||||
bindtap="bindPhone">登录</button>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<AgreePopup ref="agreePopup" :visible="visible" :agreement="computedAgreement" @close="visible = false" />
|
||||
@@ -96,9 +103,49 @@ const getPhoneNumber = (e) => {
|
||||
title: "获取登录手机号失败",
|
||||
icon: "none",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const getPhoneNumberHandler = (e) => {
|
||||
console.log(e.detail.errMsg);
|
||||
console.log(e.detail.iv);
|
||||
console.log(e.detail.encryptedData);
|
||||
}
|
||||
|
||||
// 抖音登录获取code
|
||||
const codeDy = ref(null)
|
||||
const loginDy = () => {
|
||||
let that = this;
|
||||
tt.login({
|
||||
force: true,
|
||||
success(res) {
|
||||
const { code, errMsg, anonymousCode, isLogin } = res;
|
||||
codeDy.value = code;
|
||||
// console.log(`tt-login success`, errMsg);
|
||||
console.log(`code(临时登录凭证, 有效期 3 分钟) : `, code);
|
||||
// console.log(`anonymousCode(用于标识当前设备, 无论登录与否都会返回, 有效期 3 分钟) : `, anonymousCode);
|
||||
// console.log(`isLogin(判断在当前 APP(头条、抖音等)是否处于登录状态) : `, isLogin);
|
||||
// that.setData({
|
||||
// hasLogin: true
|
||||
// });
|
||||
// tt.showToast({
|
||||
// title: "登录成功"
|
||||
// })
|
||||
},
|
||||
fail(err) {
|
||||
// tt.showModal({
|
||||
// title: '登录失败',
|
||||
// content: JSON.stringify(err),
|
||||
// showCancel: false
|
||||
// });
|
||||
console.log(`tt-login failed`, err.errMsg);
|
||||
},
|
||||
complete(res) {
|
||||
console.log(`tt-login completed`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// 登录成功返回上一页
|
||||
const loginSuccess = () => {
|
||||
uni.showToast({
|
||||
@@ -141,6 +188,7 @@ getPrivacyAgreementData();
|
||||
|
||||
// 页面显示时刷新token
|
||||
onShow(async () => {
|
||||
loginDy();
|
||||
const res = await refreshToken();
|
||||
needWxAuthLogin.value = res;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user