Commit 9eb69e37 by 前端

案例

1 parent 5bbe555c
...@@ -86,6 +86,13 @@ ...@@ -86,6 +86,13 @@
} }
}, },
{ {
"path": "pages/boutique/preview",
"style": {
"navigationStyle": "custom",
"disableSwipeBack": true
}
},
{
"path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
"style": { "style": {
"disableScroll": true, "disableScroll": true,
......
...@@ -6,10 +6,18 @@ ...@@ -6,10 +6,18 @@
type="text" type="text"
class="input" class="input"
:value="name" :value="name"
placeholder="搜索图片/视频名称"
maxlength="50" maxlength="50"
@blur="input($event)" @blur="input($event)"
@focus="focus"
/> />
<view class="input-tips" v-if="!isSearch"
>搜索图片/视频名称<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons
></view>
</view> </view>
<scroll-view <scroll-view
...@@ -22,9 +30,10 @@ ...@@ -22,9 +30,10 @@
<template v-if="list.length"> <template v-if="list.length">
<template v-for="item in list"> <template v-for="item in list">
<view class="item" :key="item.id"> <view class="item" :key="item.id">
<view class="item-autio"> <view class="item-autio" @click="playVideo(item)">
<image :src="item.detailUrl" class="cover-box"></image> <image :src="item.detailUrl" class="cover-box"></image>
<image <image
v-if="item.sourceType == 2"
src="../../assets/images/boutique/play.png" src="../../assets/images/boutique/play.png"
class="play-box" class="play-box"
></image> ></image>
...@@ -42,6 +51,17 @@ ...@@ -42,6 +51,17 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="popup-box" v-if="popupShow">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="24" color="#fff"></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video ref="videoPlayer" :src="videoSrc" controls></video>
</view>
</view>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -50,8 +70,11 @@ export default { ...@@ -50,8 +70,11 @@ export default {
name: '', name: '',
data () { data () {
return { return {
name:'', name:'',
list: [], list: [],
popupShow:false,
isSearch:false,
videoSrc: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
} }
}, },
props: { props: {
...@@ -60,14 +83,29 @@ export default { ...@@ -60,14 +83,29 @@ export default {
default: () => [] default: () => []
} }
}, },
beforeDestroy() {
this.popupShow = false
},
mounted() { mounted() {
// this.list = utils.deepClone(this.views) // this.list = utils.deepClone(this.views)
console.log(this.views) console.log(this.views)
this.list = this.views this.list = this.views
}, },
methods: { methods: {
playVideo(item) {
const {tabName,sourceType,detailUrl} = item
uni.navigateTo({
url: `/pages/boutique/preview?tabName=${tabName}&sourceType=${sourceType}&detailUrl=${detailUrl}`
})
},
focus() {
this.isSearch = true
},
input(e) { input(e) {
this.name = e.detail.value this.name = e.detail.value
if(this.name == '')
this.isSearch = false
this.list = this.views.filter(i=>i.tabName.includes(this.name)) this.list = this.views.filter(i=>i.tabName.includes(this.name))
}, },
}, },
...@@ -86,14 +124,33 @@ export default { ...@@ -86,14 +124,33 @@ export default {
padding: 64rpx; padding: 64rpx;
margin-top: 120rpx; margin-top: 120rpx;
.input-box { .input-box {
position: relative;
.input { .input {
padding-left: 30rpx; padding-left: 30rpx;
text-align: center;
height: 80rpx; height: 80rpx;
background: #ffffff; background: #ffffff;
border: 3rpx solid #a8c1ff; border: 3rpx solid #a8c1ff;
border-radius: 16rpx; border-radius: 16rpx;
width: 100%; width: 100%;
line-height: 80rpx; line-height: 80rpx;
z-index: 1;
}
.input-tips {
color: #999999;
position: absolute;
left: 0;
top: 0;
height: 80rpx;
width: 100%;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
.icon {
margin-left: 12rpx;
}
} }
} }
.list { .list {
...@@ -132,6 +189,44 @@ export default { ...@@ -132,6 +189,44 @@ export default {
} }
} }
} }
.popup-box {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #000;
padding: 100rpx 0rpx;
z-index: 100;
.nav-bar {
width: 100%;
height: 96rpx;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
}
}
.popup-body {
width: 100%;
height: 100%;
video {
width: 100%;
height: 100%;
}
}
}
.nothing { .nothing {
width: 100vw; width: 100vw;
flex-direction: column; flex-direction: column;
......
...@@ -6,10 +6,18 @@ ...@@ -6,10 +6,18 @@
type="text" type="text"
class="input" class="input"
:value="customerNameOrPhone" :value="customerNameOrPhone"
placeholder="搜索客户姓名/电话"
maxlength="11" maxlength="11"
@blur="input($event)" @blur="input($event)"
@focus="focus"
/> />
<view class="input-tips" v-if="!isSearch"
>搜索客户姓名/电话<uni-icons
type="search"
class="icon"
color="#999"
size="20"
></uni-icons
></view>
</view> </view>
<scroll-view <scroll-view
...@@ -63,7 +71,8 @@ export default { ...@@ -63,7 +71,8 @@ export default {
mixins:[Record], mixins:[Record],
data () { data () {
return { return {
customerNameOrPhone:'', customerNameOrPhone:'',
isSearch:false,
list: [{ list: [{
id:1, id:1,
carModel:1, carModel:1,
...@@ -96,9 +105,15 @@ export default { ...@@ -96,9 +105,15 @@ export default {
}, },
input(e) { input(e) {
this.customerNameOrPhone = e.detail.value this.customerNameOrPhone = e.detail.value
if(this.customerNameOrPhone == '')
this.isSearch = false
this.pageNum = 1 this.pageNum = 1
this.getRecordList() this.getRecordList()
}, },
focus() {
this.isSearch = true
},
getRecordList() { getRecordList() {
const { pageNum, pageSize,customerNameOrPhone } = this, const { pageNum, pageSize,customerNameOrPhone } = this,
userInfo = uni.$storage.get("userInfo"), userInfo = uni.$storage.get("userInfo"),
...@@ -154,6 +169,7 @@ export default { ...@@ -154,6 +169,7 @@ export default {
padding: 64rpx; padding: 64rpx;
margin-top: 120rpx; margin-top: 120rpx;
.input-box { .input-box {
position: relative;
.input { .input {
padding-left: 30rpx; padding-left: 30rpx;
height: 80rpx; height: 80rpx;
...@@ -164,6 +180,22 @@ export default { ...@@ -164,6 +180,22 @@ export default {
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
} }
.input-tips {
color: #999999;
position: absolute;
left: 0;
top: 0;
height: 80rpx;
width: 100%;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
.icon {
margin-left: 12rpx;
}
}
} }
.record-box { .record-box {
height: calc(100vh - 300rpx); height: calc(100vh - 300rpx);
......
<template>
<view class="popup-box">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="24" color="#fff"></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video
ref="videoPlayer"
:src="videoSrc"
controls
v-if="sourceType == 2"
></video>
<view class="img-detail" v-else
><image :src="detailUrl" :style="{ width: width + 'px' }"
/></view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
export default {
data () {
return {
width:0,
videoSrc: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
title: '11',
sourceType: '',
detailUrl: ''
}
},
onLoad (options) {
const {tabName,sourceType,detailUrl} = options
this.title = tabName
this.sourceType = sourceType
this.detailUrl = detailUrl
const img = new Image()
img.onload = ()=> {
this.width = document.querySelector('.img-detail').offsetHeight*img.height/img.width
console.log(this.width)
}
img.src = detailUrl
},
methods: {
back() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.popup-box {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #000;
padding: 100rpx 0rpx;
z-index: 100;
.nav-bar {
width: 100%;
height: 96rpx;
margin-bottom: 50rpx;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
.title {
color: #fff;
flex: 1;
font-size: 32rpx;
text-align: center;
}
}
.popup-body {
width: 100%;
height: calc(100% - 200rpx);
video {
width: 100%;
height: 100%;
}
.img-detail {
height: 100%;
text-align: center;
image {
height: 100%;
width: auto;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!