Compare commits

...

8 Commits

Author SHA1 Message Date
  chutingting dccff45b4b edit video 1 year ago
  chutingting ab4e367271 edit video 1 year ago
  chutingting 8ca0642987 edit 1 year ago
  chutingting 3acb35297e edit 1 year ago
  chutingting e38689cf91 video 1 year ago
  chutingting edf8e593aa edit video 1 year ago
  chutingting a62f230f9b video 1 year ago
  congzc 23891067b1 1 1 year ago
5 changed files with 5197 additions and 39 deletions
Split View
  1. +1
    -1
      README.md
  2. +5089
    -0
      package-lock.json
  3. +10
    -0
      src/api/login.js
  4. +51
    -35
      src/pages/chooseStyle/index.vue
  5. +46
    -3
      src/pages/login/index.vue

+ 1
- 1
README.md View File

@@ -1,4 +1,4 @@
# Suimang-wxapp
# Suimang大屏

# setStorageSync 键名



+ 5089
- 0
package-lock.json
File diff suppressed because it is too large
View File


+ 10
- 0
src/api/login.js View File

@@ -39,4 +39,14 @@ export function loginByCodeApi(data) {
method: 'POST',
data
})
}

/**
* @description: 获取视频
*/
export function getVideoApi(data) {
return request({
url: `/api/home/videoUrl`,
method: 'get'
})
}

+ 51
- 35
src/pages/chooseStyle/index.vue View File

@@ -10,10 +10,12 @@
:activeStyle="{ color: '#ff4f00', fontsize: '30rpx' }"
:inactiveStyle="{ color: '#fff', fontsize: '30rpx' }"
@click="chooseTab"
@change="changeTabCurrent"
:current="CurrentNum"
></u-tabs>
<view class="moreTabs">
<!-- <view class="moreIcon" @click="showPopup = true"> 更多 </view> -->
<view class="moreIcon" @click="showPopup = true"> 更多 </view>
<view class="moreIcon" @click="showPopup = true"> 更多筛选 </view>
</view>
</view>
<!-- 更多tab弹出层 -->
@@ -95,8 +97,8 @@ const sex = ref(2);
const sexList = ref([
{ name: "女", id: 2 },
{ name: "男", id: 1 },
{ name: "单人", id: 3 },
{ name: "多人", id: 4 },
// { name: "单人", id: 3 },
// { name: "多人", id: 4 },
]);
const sexList2 = ref([
{ name: "女", id: 2 },
@@ -104,49 +106,63 @@ const sexList2 = ref([
]);

// 类型
const mouldType = ref("");
const mouldType = ref(1);
const mouldTypeList = ref([
{ name: "单人", id: 1 },
{ name: "多人", id: 2 },
]);
// 点击tab
function chooseTab(item) {
if (item.id < 3) {
sex.value = item.id;
mouldType.value = "";
} else if (item.id == 3) {
mouldType.value = 1;
sex.value = "";
} else if (item.id == 4) {
mouldType.value = 2;
sex.value = "";
}
sex.value = item.id;
// if (item.id < 3) {
// sex.value = item.id;
// mouldType.value = "";
// } else if (item.id == 3) {
// mouldType.value = 1;
// sex.value = "";
// } else if (item.id == 4) {
// mouldType.value = 2;
// sex.value = "";
// }
}
const CurrentNum = ref(0);
function changeTabCurrent(tabItem) {
console.log(tabItem.index);
CurrentNum.value = tabItem.index;
}
// 更多里的tab 性别
function chooseSex(item) {
if (sex.value == item.id) {
if (mouldType.value == "") {
return;
} else {
sex.value = "";
}
} else {
sex.value = item.id;
mouldType.value = "";
if (item.id == 2) {
CurrentNum.value = 0;
}
if (item.id == 1) {
CurrentNum.value = 1;
}
sex.value = item.id;
// if (sex.value == item.id) {
// if (mouldType.value == "") {
// return;
// } else {
// sex.value = "";
// }
// } else {
// sex.value = item.id;
// mouldType.value = "";
// }
}
// 更多里的tab 类型
function chooseMouldType(item) {
if (mouldType.value == item.id) {
if (sex.value == "") {
return;
} else {
mouldType.value = "";
}
} else {
mouldType.value = item.id;
sex.value = "";
}
mouldType.value = item.id;
// if (mouldType.value == item.id) {
// if (sex.value == "") {
// return;
// } else {
// mouldType.value = "";
// }
// } else {
// mouldType.value = item.id;
// sex.value = "";
// }
}
//#endregion

@@ -325,9 +341,9 @@ onUnload(() => {
background: linear-gradient(90deg, transparent 20%, #333 100%);
// background-color: red;
.moreIcon {
margin-left: 50rpx;
margin-left: 30rpx;
margin-top: 15rpx;
width: 130rpx;
width: 150rpx;
height: 60rpx;
border-radius: 40rpx;
background-color: #ff4f00;


+ 46
- 3
src/pages/login/index.vue View File

@@ -1,6 +1,15 @@
<template>
<view class="page">
<image src="../../assets/img/homeImg.jpg" mode="scaleToFill" />
<!-- <image src="../../assets/img/homeImg.jpg" mode="scaleToFill" />
muted-->
<video id="myVideo"
ref="myVideo"
:src='videoUrl'
autoplay
loop
:controls="false">
</video>
<view class="bottomBox">
<view class="orangeBtn" @click="toChooseStyle">拍摄数码写真</view>
<view class="IMEI" @click="Imei"
@@ -14,11 +23,13 @@

<script setup>
//#region 导入
import { ref } from "vue";
import { isPlainObject, onLoad, onUnload } from "@dcloudio/uni-app";
import { getCurrentInstance, ref,nextTick } from "vue";
import { isPlainObject, onLoad, onUnload, onShow } from "@dcloudio/uni-app";
import { userInfoModules } from "@/store/modules/userInfo";
import { getVideoApi } from "@/api/login.js";

const userInfoModulesPinia = userInfoModules();

//#endregion ----------------------------------

function toChooseStyle() {
@@ -66,11 +77,35 @@ function fileReaderTest() {
}
}


const videoUrl = ref('')
const { proxy } = getCurrentInstance();

function getVideoFn() {
getVideoApi().then(res => {
videoUrl.value = res.data
nextTick(()=>{
// const video = document.querySelector("video.uni-video-video");
// video.muted = false
// video.play()
// proxy.$refs.myVideo.muted = false
// proxy.$refs.myVideo.play();
})
})
}

onShow(() => {
getVideoFn()
})
//#region 初始化
onLoad(() => {
getVideoFn()
runGetAndroidId();
// fileReaderTest();
userInfoModulesPinia.clearStorage();

});
//#endregion ----------------------------------

@@ -137,6 +172,14 @@ function reFresh() {
position: relative;
width: 100vw;
height: 100vh;
// uni-video{
// width:100%;
// height:100%;
// }
#myVideo{
width: 100%;
height: 100%;
}
image {
position: absolute;
width: 100%;


Loading…
Cancel
Save