Browse Source

feat: 接口对接;

fox
Fox-33 2 days ago
parent
commit
47750b2c01
4 changed files with 42 additions and 25 deletions
  1. +1
    -1
      api/api.js
  2. +20
    -0
      api/model/other.js
  3. +16
    -19
      pages/index/center.vue
  4. +5
    -5
      pages_order/center/serve.vue

+ 1
- 1
api/api.js View File

@ -5,7 +5,7 @@ import utils from '../utils/utils.js'
let limit = {}
let debounce = {}
const models = ['index', 'case', 'serve']
const models = ['index', 'case', 'serve', 'other']
const config = {
// 示例


+ 20
- 0
api/model/other.js View File

@ -0,0 +1,20 @@
// 其他相关接口
const api = {
/**
* 其他-获取其他模块文章列表
*/
queryOtherArticleList: {
url: '/index/queryOtherArticleList',
method: 'GET',
},
/**
* 其他-获取其他模块文章详情
*/
queryOtherArticleById: {
url: '/index/queryOtherArticleById',
method: 'GET',
},
}
export default api

+ 16
- 19
pages/index/center.vue View File

@ -15,16 +15,8 @@
</view>
<view class="list">
<view class="list-item" @click="jumpToDetail('other_service')">
<!-- <image class="list-item-bg" :src="configList.config_image_service" mode="scaleToFill"></image> -->
<image class="list-item-bg" src="@/static/image/bg-other-serve.png" mode="widthFix"></image>
<view class="flex list-item-fg">
<image class="icon" src="@/static/image/icon-other-serve.png" mode="widthFix"></image>
<view class="info">
<view class="title">其他服务</view>
<view class="desc">Other services</view>
</view>
</view>
<view class="list-item" v-for="item in list" :key="item.id" @click="jumpToDetail(item.id)">
<image class="list-item-bg" :src="item.image" mode="widthFix"></image>
</view>
</view>
@ -35,14 +27,18 @@
<script>
import utils from '@/utils/utils'
import mixinsList from '@/mixins/list.js'
import tabber from '@/components/base/tabbar.vue'
export default {
mixins: [mixinsList],
components: {
tabber,
},
data() {
return {
mixinsListApi: 'queryOtherArticleList',
style: '',
}
},
@ -50,9 +46,9 @@
this.style = `padding-top: calc(${utils.getNavHeight()}px - 16rpx)`
},
methods: {
jumpToDetail(paramCode) {
jumpToDetail(articleId) {
uni.navigateTo({
url: `/pages_order/center/serve?paramCode=${paramCode}`
url: `/pages_order/center/serve?articleId=${articleId}`
})
},
},
@ -157,11 +153,12 @@
&-item {
position: relative;
width: 100%;
height: 170rpx;
// height: 170rpx;
height: auto;
font-size: 0;
border-radius: 10rpx;
overflow: hidden;
background: linear-gradient(to right, rgba($color: #E2DDFF, $alpha: 0.26), rgba($color: #C8C3FD, $alpha: 0.26));
// background: linear-gradient(to right, rgba($color: #E2DDFF, $alpha: 0.26), rgba($color: #C8C3FD, $alpha: 0.26));
box-shadow: 4rpx 4rpx 6rpx 0rpx rgba(0,0,0,0.15);
& + & {
@ -169,11 +166,11 @@
}
&-bg {
// $w: calc(100vw - 18rpx*2);
// width: $w;
// height: calc(#{$w} * 179 / 714);
width: 100%;
height: 100%;
$w: calc(100vw - 38rpx*2);
width: $w;
height: calc(#{$w} * 179 / 714);
// width: 100%;
// height: 100%;
}
&-fg {


+ 5
- 5
pages_order/center/serve.vue View File

@ -2,7 +2,7 @@
<view class="page__view">
<!-- 导航栏 -->
<navbar :title="details.paramDesc" leftClick @leftClick="$utils.navigateBack" />
<navbar :title="details.title" leftClick @leftClick="$utils.navigateBack" />
<image class="img" :src="details.details" mode="widthFix"></image>
@ -16,13 +16,13 @@
details: {},
}
},
onLoad({ paramCode }) {
this.getData(paramCode)
onLoad({ articleId }) {
this.getData(articleId)
},
methods: {
async getData(paramCode) {
async getData(articleId) {
try {
this.details = await this.$fetch('querySummaryByParamCode', { paramCode })
this.details = await this.$fetch('queryOtherArticleById', { articleId })
} catch (err) {
console.log('err', err)
}


Loading…
Cancel
Save