diff --git a/api/api.js b/api/api.js index 7ecc3f1..4c9b2f5 100644 --- a/api/api.js +++ b/api/api.js @@ -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) diff --git a/common.scss b/common.scss index 297eba9..5fd3072 100644 --- a/common.scss +++ b/common.scss @@ -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; } \ No newline at end of file diff --git a/components/base/tabbar.vue b/components/base/tabbar.vue index 6e32780..2248ec9 100644 --- a/components/base/tabbar.vue +++ b/components/base/tabbar.vue @@ -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; diff --git a/components/list/videoList.vue b/components/list/videoList.vue index 30aca20..681d3eb 100644 --- a/components/list/videoList.vue +++ b/components/list/videoList.vue @@ -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 diff --git a/pages/index/center.vue b/pages/index/center.vue index 55233b4..0c25dd1 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -34,7 +34,7 @@ @@ -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}` + }) + }, } } @@ -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; - } - } - } } } }