Browse Source

上传

master
前端-胡立永 7 months ago
parent
commit
971894c69f
8 changed files with 396 additions and 15 deletions
  1. +16
    -3
      components/list/videoList.vue
  2. +3
    -0
      pages.json
  3. +11
    -0
      pages/index/center.vue
  4. +1
    -1
      pages_order/mine/cart.vue
  5. +115
    -6
      pages_order/mine/subscribe.vue
  6. +160
    -0
      pages_order/order/orderSubscribe.vue
  7. +2
    -5
      pages_order/service/StudyFurther.vue
  8. +88
    -0
      utils/utils.js

+ 16
- 3
components/list/videoList.vue View File

@ -1,6 +1,7 @@
<template>
<view class="videoList">
<view class="video-item" v-for="(item, index) in 10" :key="index">
<view class="video-item" v-for="(item, index) in 10" :key="index"
@click="showVideo(item)">
<view class="image">
<image src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img" mode="aspectFill">
</image>
@ -29,11 +30,12 @@
export default {
data() {
return {
}
},
methods: {
showVideo(item){
this.$utils.hanldePreview
},
}
}
</script>
@ -97,5 +99,16 @@
}
}
}
.showVideo{
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 1000%;
video{
// width: 100%;
// height: 100%;
}
}
}
</style>

+ 3
- 0
pages.json View File

@ -82,6 +82,9 @@
},
{
"path": "service/StudyFurther"
},
{
"path": "order/orderSubscribe"
}
]
}],


+ 11
- 0
pages/index/center.vue View File

@ -34,6 +34,7 @@
<!-- 我的预约 -->
<uv-cell icon="setting-fill" title="我的预约"
@click="$utils.navigateTo('/pages_order/order/orderSubscribe')"
isLink>
<template #icon>
<image src="/static/image/center/2.png"
@ -61,6 +62,16 @@
</template>
</uv-cell>
<!-- 购物车 -->
<uv-cell icon="setting-fill" title="购物车"
@click="$utils.navigateTo('/pages_order/mine/cart')"
isLink>
<template #icon>
<image src="/static/image/center/1.png"
class="uv-cell-icon"></image>
</template>
</uv-cell>
<!-- 加入志愿者 -->
<uv-cell icon="setting-fill" title="加入志愿者"
isLink>


+ 1
- 1
pages_order/mine/cart.vue View File

@ -1,6 +1,6 @@
<template>
<view class="page">
<navbar/>
<navbar title="购物车" leftClick @leftClick="$utils.navigateBack" />
<view class="user">
<uv-checkbox-group


+ 115
- 6
pages_order/mine/subscribe.vue View File

@ -1,6 +1,61 @@
<template>
<view>
<view class="page">
<!-- 我的预约 -->
<navbar title="我的预约" leftClick @leftClick="$utils.navigateBack" />
<view style="background-color: #fff;">
<uv-tabs :list="tabs"
lineColor="#B12026"
lineHeight="8rpx"
lineWidth="50rpx"
:scrollable="false"
@click="clickTabs"></uv-tabs>
</view>
<view class="subscribe-list">
<view class="item">
<!-- 主题 -->
<uv-cell title="景德镇一日游"
:border="false">
<template #icon>
<text class="text">主题</text>
</template>
<template #value>
<text class="price">199.0</text>
</template>
</uv-cell>
<!-- 时间 -->
<uv-cell
:border="false">
<template #icon>
<text class="text">时间</text>
</template>
<template #title>
<text class="time">2024-04-21</text>
</template>
</uv-cell>
<!-- 电话 -->
<uv-cell
:border="false">
<template #icon>
<text class="text">电话</text>
</template>
<template #title>
<text class="phone">15423451221</text>
</template>
</uv-cell>
<view class="btns">
<view class="btn">
再次预约
</view>
</view>
</view>
</view>
</view>
</template>
@ -8,15 +63,69 @@
export default {
data() {
return {
tabs: [{
name: '遗产路径'
},
{
name: '我要研学'
},
{
name: '文创好物'
},
],
}
},
methods: {
//tab
clickTabs(index) {
if (index == 0) {
this.state = -1;
} else {
this.state = index - 1;
}
this.getOrderList()
},
}
}
</script>
<style>
</style>
<style scoped lang="scss">
.page {
.subscribe-list{
.item{
background-color: #fff;
border-radius: 20rpx;
margin: 20rpx;
padding: 20rpx;
box-shadow: 0 0 16rpx 6rpx #00000011;
/deep/ text{
font-size: 26rpx;
color: #333333;
font-weight: 900;
}
/deep/ .text{
color: #B7BBC7;
margin-right: 20rpx;
font-size: 26rpx;
}
/deep/ .price{
color: #f40;
}
/deep/ .time{
color: $uni-color;
}
.btns{
display: flex;
justify-content: flex-end;
.btn{
padding: 10px 30rpx;
font-size: 24rpx;
background-color: $uni-color;
color: #fff;
border-radius: 35rpx;
}
}
}
}
}
</style>

+ 160
- 0
pages_order/order/orderSubscribe.vue View File

@ -0,0 +1,160 @@
<template>
<view class="page">
<navbar title="提交预约" leftClick @leftClick="$utils.navigateBack" />
<view class="box">
<view class="info">
<view class="title">
遗产讲述
</view>
<view class="tips">
开放时间06:00-21:00
</view>
<view class="tips">
开放时间06:00-21:00
</view>
</view>
<view class="form-time">
<!-- 预约日期 -->
<view class="title">
预约日期
</view>
<view class="line">
<view class="">
2024
<view class="icon">
<uv-icon
name="arrow-down"
size="26rpx">
</uv-icon>
</view>
</view>
<view class="">
9
<view class="icon">
<uv-icon
name="arrow-down"
size="26rpx">
</uv-icon>
</view>
</view>
<view class="">
9
<view class="icon">
<uv-icon
name="arrow-down"
size="26rpx">
</uv-icon>
</view>
</view>
</view>
<!-- 预约日期 -->
<view class="title">
预约日期
</view>
<view class="line">
<view class="">
08:00
<view class="icon">
<uv-icon
name="arrow-down"
size="26rpx">
</uv-icon>
</view>
</view>
<view class="">
14:00
<view class="icon">
<uv-icon
name="arrow-down"
size="26rpx">
</uv-icon>
</view>
</view>
</view>
</view>
</view>
<view class="box">
<view class="form-input">
<view class="title">
游客信息
</view>
<view class="input">
<view class="label">
</view>
<input type="text" />
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
.page{
.box{
border-radius: 20rpx;
margin: 20rpx;
background-color: #fff;
box-shadow: 0 0 16rpx 6rpx #00000011;
.info{
padding: 40rpx;
border-bottom: 1rpx dashed #000;
.title{
font-size: 34rpx;
font-weight: 900;
padding-bottom: 20rpx;
}
.tips{
font-size: 26rpx;
color: #666666;
padding: 10rpx 0;
}
}
.form-time{
padding: 40rpx;
.title{
font-weight: 900;
padding-bottom: 20rpx;
margin-top: 10rpx;
}
.line{
display: flex;
align-items: center;
>view{
border: 1rpx solid #333;
padding: 6rpx 20rpx;
margin: 10rpx;
border-radius: 10rpx;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: center;
.icon{
padding: 0 10rpx;
}
}
}
}
.form-input{
padding: 40rpx;
}
}
}
</style>

+ 2
- 5
pages_order/service/StudyFurther.vue View File

@ -8,6 +8,7 @@
v-model="keyword"
:animation="true"
height="70"
:showAction="false"
searchIconSize="44"
>
</uv-search>
@ -55,11 +56,7 @@
.page{
.search{
background-color: #fff;
height: 110rpx;
width: 100%;
uv-search{
}
padding: 20rpx;
}
.list{
.item{


+ 88
- 0
utils/utils.js View File

@ -91,6 +91,93 @@ export function getHrefParams(name) {
}
}
//其中url是文件的地址
export function hanldePreview(url) {
console.log("url--->", url)
let index = url.lastIndexOf('.');
let fileType = url.substring(index + 1, url.length);
let white_filetype = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf']
let white_image = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'ico', 'wbmp', 'fax', 'net', 'rp', 'jfif', 'jpe',
'tiff', 'tif'
]
let white_media = ['mp3', 'wav', 'flac', 'aac', 'mp4', 'avi', 'wmv', 'mov', 'flv']
uni.downloadFile({
url: url,
success: function(res) {
console.log("res--->", res)
var filePath = res.tempFilePath;
if (white_filetype.indexOf(fileType) != -1) {
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log('打开文档成功');
},
fail: function(err) {
console.log('打开文档失败--->', err);
uni.showToast({
title: err.errMsg,
icon: 'none'
})
},
});
} else if (white_image.indexOf(fileType) != -1) {
uni.previewImage({
urls: [filePath],
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
},
fail: function(err) {
console.log(err.errMsg);
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
}
});
} else if (white_media.indexOf(fileType) != -1) {
wx.previewMedia({
sources: [{
url: filePath, //图片或者视频所在路径
type: 'video', //图片为image,视频为video
}],
success(res) {
//预览成功
// uni.showToast({
// title: "预览成功",
// icon: "none"
// })
},
fail(err) {
console.log(err);
uni.showToast({
title: err.errMsg,
icon: 'none'
})
//预览失败
}
})
} else {
uni.showToast({
title: '不支持打开该类型文件',
icon: 'none'
})
}
},
fail: function(err) {
console.log("err--->", err)
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
});
}
//深度对比合并两个对象,相同属性b会覆盖a
export function deepMergeObject(a, b){
@ -149,4 +236,5 @@ export default {
navigateTo,
navigateBack,
redirectTo,
hanldePreview,
}

Loading…
Cancel
Save