把别人的后端接口数据导入到自己新的接口项目后,接口地址改成自己的之后,写service.stype == 10 || service.stype == 15 || service.stype == 20,然后不管点击哪个模块都是跳转到同一个页面是为什么?
例如点击开心取药或上门助浴都是跳转到下方的那个页面
前端代码:
<template>
<view>
<block v-if="service.stype == 10 || service.stype == 15 || service.stype == 20 ">
<view class="pub-box">
<view class="pub-box-bd">
<view class="weui-cell weui-cell_input">
.....//功能1
</view>
<view class="weui-cell weui-cell_input">
....//功能2
</view>
<view class="weui-cell weui-cell_input" @click="onClientChange">
....//功能3
</view>
</view>
</view>
</block>
</template>
<script setup>部分数据:
import { ref, reactive ,computed,toRaw} from 'vue'
import {onLoad} from '@dcloudio/uni-app'
const app = getApp()
onLoad((options) => {
console.log(options,'options')
main_load(options)
})
//页面服务详情数据
const service = ref({})
const main_load = (options) => {
app.globalData.utils.request({
url:'/Service/order',
data:{
svid:options.svid
},
success:(res) => {
console.log(res)
service.value = res.data.service;
}
})
}
后端部分数据:
{
"code": 10000,
"msg": "",
"time": "1707110701",
"data": {
"now": 1707110701,
"services": [
{
"id": 1,
"code": "dp",
"stype": "40",
"name": "代跑取药",
"intro": "人工带跑取药,省时省力",
"price": "0.01",
"priceo": "100.00",
"use_switch": 1,
"stype_text": "Stype 40"
},
{
"id": 2,
"code": "pz",
"stype": "15",
"name": "就医陪诊(半天)",
"intro": "就医陪诊,值得托付",
"price": "0.01",
"priceo": "150.00",
"use_switch": 1,
"stype_text": "Stype 15"
}
]
}
}
②
{
"code": 10000,
"msg": "",
"time": "1700982698",
"data": {
"now": 1700982698,
"navs": [
{
"id": 3,
"stype": "1",
"stype_link": "/pages/service/index?svid=1&hid=5",
"title": "开心取药",
"tcolor": "",
"cat_text": "",
"stype_text": "Stype 1"
},
{
"id": 4,
"stype": "1",
"stype_link": "/pages/service/index?svid=4&hid=5",
"title": "上门助浴",
"tcolor": "",
"cat_text": "",
"stype_text": "Stype 1"
}
],
}
}
..