Merge branch 'develop' into 'sit'
2 See merge request K17_AITS/tra-app!48
This commit is contained in:
@@ -8,7 +8,6 @@ const ENV = import.meta.env
|
||||
export const get_base_url = url => {
|
||||
|
||||
if (ENV.MODE === 'development') { // 开发环境
|
||||
return ENV.VITE_APP_BASE_API_Url
|
||||
// H5必须用非https,手机端必须用https
|
||||
// #ifdef H5
|
||||
const baseUrl = ENV.VITE_APP_BASE_API_Url
|
||||
|
||||
@@ -115,6 +115,7 @@ const initRecord = () => {
|
||||
let _recordPerm = uni.getAppAuthorizeSetting()
|
||||
let _state = _recordPerm.microphoneAuthorized
|
||||
if(_state === 'authorized'){
|
||||
console.log('大大大大大');
|
||||
showTalkingModel.value = true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -49,9 +49,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="button_div">
|
||||
<image src="@/static/images/mascot/btn_1.png" class="img" mode="aspectFit"
|
||||
<image src="@/static/images/mascot/btn_1.png" class="img" mode="aspectFit"
|
||||
@click="select_it()"></image>
|
||||
<!-- <image :style="{ opacity: btn2Opacity }" src="@/static/images/mascot/btn_2.png" class="img" mode="aspectFit"
|
||||
<!-- <image :style="{ opacity: btn2Opacity }" src="@/static/images/mascot/btn_2.png" class="img" mode="aspectFit"
|
||||
@click="select_it()"></image> -->
|
||||
</view>
|
||||
<view class="fl1"></view>
|
||||
@@ -82,27 +82,36 @@
|
||||
const mascotList = reactive([])
|
||||
const windowsInfo = uni.getWindowInfo()
|
||||
const nowWidth = ref(0);
|
||||
|
||||
let initialIndex = 0; // 总轮播项数量
|
||||
const swiperCount = 4; // 总轮播项数量
|
||||
const TRANSITION_RATIO = 0.3;
|
||||
|
||||
const aa = computed(() => Math.floor(nowWidth.value / windowsInfo.screenWidth ));
|
||||
|
||||
|
||||
// 计算过渡起点(像素值,取整):屏幕宽度的20%位置
|
||||
const TRANSITION_SUM = computed(() => Math.floor(windowsInfo.screenWidth * TRANSITION_RATIO));
|
||||
const TRANSITION_START = computed(() => Math.floor(windowsInfo.screenWidth * (1 - TRANSITION_RATIO)));
|
||||
const TRANSITION_SUM = windowsInfo.screenWidth
|
||||
|
||||
const TRANSITION_START = Math.floor(windowsInfo.screenWidth * TRANSITION_RATIO)
|
||||
// 计算过渡终点(像素值,取整):屏幕宽度的80%位置
|
||||
const TRANSITION_END = computed(() => Math.floor(windowsInfo.screenWidth * TRANSITION_RATIO));
|
||||
const TRANSITION_END = Math.floor(windowsInfo.screenWidth * (1 - TRANSITION_RATIO))
|
||||
|
||||
// 第一张图透明度(0、2索引显示)
|
||||
console.log(TRANSITION_SUM, TRANSITION_START, TRANSITION_END);
|
||||
const btn1Opacity = computed(() => {
|
||||
|
||||
if (initialIndex % 2 === 1) { // 淡入
|
||||
console.log('111我淡入淡入');
|
||||
return 0;
|
||||
|
||||
if (initialIndex % 2 === 0) { // 淡入
|
||||
if (nowWidth.value <= TRANSITION_START.value) {
|
||||
return 0;
|
||||
} else {
|
||||
return Math.min(1, (nowWidth.value - TRANSITION_START.value) / TRANSITION_SUM.value);
|
||||
}
|
||||
} else { // 淡出
|
||||
console.log('111我淡出');
|
||||
if (nowWidth.value >= TRANSITION_END.value) {
|
||||
return 1;
|
||||
// console.log('111我淡出');
|
||||
if (nowWidth.value >= TRANSITION_END) {
|
||||
return 0;
|
||||
} else {
|
||||
return Math.max(0, 1 - (TRANSITION_END.value - nowWidth.value) / TRANSITION_SUM.value);
|
||||
}
|
||||
@@ -110,22 +119,29 @@
|
||||
});
|
||||
|
||||
const btn2Opacity = computed(() => {
|
||||
return 0;
|
||||
const initialIndex = swiperIndex.value;
|
||||
if (initialIndex % 2 === 0) { // 淡入
|
||||
console.log('222我淡入');
|
||||
if (nowWidth.value <= TRANSITION_START.value) {
|
||||
const aa = initialIndex
|
||||
if (nowWidth.value === windowsInfo.screenWidth) {
|
||||
initialIndex++
|
||||
console.log('嘻嘻切换。initialIndex');
|
||||
}
|
||||
if (aa % 2 === 1) { // 淡入
|
||||
// if (nowWidth.value <= TRANSITION_START) {
|
||||
// console.log(1);
|
||||
// return 1;
|
||||
// } else {
|
||||
// console.log(Math.max(0, 1 - (TRANSITION_END - nowWidth.value) / TRANSITION_SUM));
|
||||
// return Math.max(0, 1 - (TRANSITION_END - nowWidth.value) / TRANSITION_SUM);
|
||||
|
||||
// }
|
||||
} else { // 淡出
|
||||
// console.log('222我淡出');
|
||||
if (nowWidth.value >= TRANSITION_END) {
|
||||
console.log('淡入1', nowWidth.value, TRANSITION_END);
|
||||
return 1;
|
||||
} else {
|
||||
return Math.max(0, 1 - (TRANSITION_END.value - nowWidth.value) / TRANSITION_SUM.value);
|
||||
|
||||
}
|
||||
} else { // 淡出
|
||||
console.log('222我淡出');
|
||||
if (nowWidth.value >= TRANSITION_END.value) {
|
||||
return 0;
|
||||
} else {
|
||||
return Math.min(1, (nowWidth.value - TRANSITION_START.value) / TRANSITION_SUM.value);
|
||||
console.log('淡入2', nowWidth.value / TRANSITION_SUM);
|
||||
console.log('淡入2', Math.min(1, nowWidth.value / TRANSITION_SUM));
|
||||
return Math.min(0, nowWidth.value / TRANSITION_SUM);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -152,6 +168,7 @@
|
||||
detail
|
||||
}) => {
|
||||
nowWidth.value = Math.abs(detail.dx)
|
||||
console.log('宽度', nowWidth.value);
|
||||
}
|
||||
|
||||
const select_it = () => {
|
||||
|
||||
Reference in New Issue
Block a user