Browse Source

上传

master
前端-胡立永 10 months ago
parent
commit
aa6249f6a8
7 changed files with 135 additions and 52 deletions
  1. +34
    -13
      api/api.js
  2. +19
    -0
      common.scss
  3. +1
    -1
      components/base/tabbar.vue
  4. +1
    -3
      components/list/videoList.vue
  5. +1
    -1
      pages/index/center.vue
  6. +1
    -1
      pages_order/service/articleDetail.vue
  7. +78
    -33
      pages_order/service/reservationDetail.vue

+ 34
- 13
api/api.js View File

@ -1,5 +1,9 @@
import http from './http.js'
let limit = {}
let debounce = {}
const config = {
// 示例
// wxLogin : {url : '/api/wxLogin', method : 'POST',
@ -108,15 +112,9 @@ const config = {
method: 'GET',
showLoading: true,
},
// 根据角色id获取视频列表
queryVedioBySpot: {
url: '/info/queryVedioBySpot',
method: 'GET',
showLoading: true,
},
// 获取视频列表
queryVideoList: {
url: '/info/queryVideoList',
queryVedioById: {
url: '/info/queryVedioById',
method: 'GET',
showLoading: true,
},
@ -143,24 +141,47 @@ export function api(key, data, callback, loadingTitle) {
// 接口限流
if (req.limit) {
let storageKey = 'limit:' + req.url
let storage = uni.getStorageSync(storageKey)
if (storage && new Date().getTime() - parseInt(storage) < req.limit) {
let storageKey = req.url
let storage = limit[storageKey]
if (storage && new Date().getTime() - storage < req.limit) {
return
}
uni.setStorageSync(storageKey, new Date().getTime())
limit[storageKey] = new Date().getTime()
}
//必须登录
if (req.auth) {
if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: '/pages/login/mobile'
url: '/pages_order/auth/wxLogin'
})
console.error('需要登录')
return
}
}
// 接口防抖
if(req.debounce){
let storageKey = req.url
let storage = debounce[storageKey]
if (storage) {
clearTimeout(storage)
}
debounce[storageKey] = setTimeout(() => {
clearTimeout(storage)
delete debounce[storageKey]
http.http(req.url, data, callback, req.method,
loadingTitle || req.showLoading, loadingTitle || req.loadingTitle)
}, req.debounce)
return
}
http.http(req.url, data, callback, req.method,
loadingTitle || req.showLoading, loadingTitle || req.loadingTitle)


+ 19
- 0
common.scss View File

@ -18,4 +18,23 @@
display:-webkit-box; //作为弹性伸缩盒子模型显示
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp:3; //显示的行
}
.share{
padding: 0;
margin: 0;
background-color: #fff;
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
align-items: center !important;
font-size: 26rpx;
}
.share::after{
border: none;
padding: 0;
margin: 0;
width: 0;
height: 0;
}

+ 1
- 1
components/base/tabbar.vue View File

@ -76,7 +76,7 @@
flex-direction: row;
height: 120rpx;
padding-bottom: env(safe-area-inset-bottom);
z-index: 999999;
z-index: 10074;
bottom: 0;
left: 0;
color: #BCBCBC;


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

@ -60,9 +60,7 @@
this.queryParams.roleInfoId = this.roleId
}
let url = this.roleId ? 'queryVedioBySpot' : 'queryVideoList'
this.$api('queryVedioBySpot', this.queryParams, res => {
this.$api('queryVedioById', this.queryParams, res => {
if(res.code == 200){
this.list = res.result.records
this.total = res.result.total


+ 1
- 1
pages/index/center.vue View File

@ -34,7 +34,7 @@
<!-- 我的预约 -->
<uv-cell icon="setting-fill" title="我的预约"
@click="$utils.navigateTo('/pages_order/order/orderSubscribe')"
@click="$utils.navigateTo('/pages_order/mine/subscribe')"
isLink>
<template #icon>
<image src="/static/image/center/2.png"


+ 1
- 1
pages_order/service/articleDetail.vue View File

@ -28,7 +28,7 @@
methods: {
queryArticleById(){
this.$api('queryArticleById', {
id : this.id
articleId : this.id
}, res => {
uni.stopPullDownRefresh()
if(res.code == 200){


+ 78
- 33
pages_order/service/reservationDetail.vue View File

@ -13,25 +13,36 @@
</view>
<view class="left-list">
<view>
<uv-icon
name="star"
size="50rpx"
></uv-icon>
收藏
<button
class="share">
<uv-icon
name="star"
size="50rpx"
></uv-icon>
收藏
</button>
</view>
<view>
<uv-icon
name="star"
size="50rpx"
></uv-icon>
收藏
<button
open-type="share"
class="share">
<uv-icon
name="share"
size="50rpx"
></uv-icon>
分享
</button>
</view>
<view>
<uv-icon
name="star"
size="50rpx"
></uv-icon>
收藏
<view
@click="$refs.actionSheet.open()">
<button
class="share">
<uv-icon
name="server-man"
size="50rpx"
></uv-icon>
客服
</button>
</view>
</view>
</view>
@ -50,8 +61,10 @@
{{ detail.price }}
</view>
</view>
<view>
<image src="../static/reservationDetail/3.png" mode=""></image>
<view
@click="toUrl(detail, type)">
<image v-if="type == 2" src="../static/reservationDetail/3.png" mode=""></image>
<image v-else src="../static/reservationDetail/4.png" mode=""></image>
<view>
预约
</view>
@ -102,6 +115,13 @@
<videoList ref="videoList" :roleId="id"/>
</view>
<uv-action-sheet
ref="actionSheet"
:actions="actionSheet"
@select="select">
</uv-action-sheet>
<tabber/>
</view>
</template>
@ -119,6 +139,16 @@
type: 0,
id : 0,
detail : {},
actionSheet : [
{
name: '线上客服',
openType: 'contact'
},
{
name: '电话呼叫',
type : 'phone',
},
],
}
},
onLoad(args) {
@ -126,7 +156,9 @@
this.id = args.id
},
onShow() {
this.$refs.videoList.queryVideoList()
this.$nextTick(() => {
this.$refs.videoList.queryVideoList()
})
this.getData()
},
onPullDownRefresh(){
@ -137,6 +169,13 @@
onReachBottom() {
this.$refs.videoList.loadMoreData()
},
onShareAppMessage(res) {
return {
title: this.titles[this.type],
desc: this.detail.roleName,
path: '/pages_order/service/reservationDetail?id=' + this.id
}
},
methods: {
getData(){
this.$api('queryRoleInfoById', {
@ -148,6 +187,23 @@
}
})
},
select(e){
if(e.type == 'phone'){
uni.makePhoneCall({
// 12345 this.mobile
phoneNumber: '123',
//
success: (res) => {
console.log('调用成功!')
},
})
}
},
toUrl(detail, type){
uni.navigateTo({
url: `/pages_order/order/orderSubscribe?id=${detail.id}&type=${type}`
})
},
}
}
</script>
@ -191,8 +247,8 @@
display: flex;
justify-content: space-around;
image{
width: 100rpx;
height: 100rpx;
width: 80rpx;
height: 80rpx;
margin-bottom: 10rpx;
}
>view{
@ -206,6 +262,7 @@
align-items: center;
flex-direction: column;
color: $uni-color;
font-size: 28rpx;
}
}
}
@ -249,18 +306,6 @@
color: $uni-color;
padding: 15rpx;
}
.list{
display: flex;
flex-wrap: wrap;
>view{
margin: 15rpx;
image{
width: 330rpx;
height: 350rpx;
border-radius: 30rpx;
}
}
}
}
}
}


Loading…
Cancel
Save