提交 14acfbfc 作者: 王定

feat: 更换.env.development文件的接口地址为线上地址

上级 95308e65
# API 接口地址 # API 接口地址
# VITE_GLOB_API_URL=http://111.22.182.169:49600 VITE_GLOB_API_URL=http://111.22.182.169:49600
VITE_GLOB_API_URL=http://36.133.16.81:42111 # VITE_GLOB_API_URL=http://36.133.16.81:42111
# API 接口地址前缀 # API 接口地址前缀
# VITE_GLOB_API_URL_PREFIX=/jeecgboot VITE_GLOB_API_URL_PREFIX=/jeecgboot
VITE_GLOB_API_URL_PREFIX=/jeecg-boot # VITE_GLOB_API_URL_PREFIX=/jeecg-boot
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app'
import Navigate from '@/utils/page/navigate'
import { reactive, ref } from 'vue'
import * as NongzhiAPI from '@/api/model/nongzhi'
const bgColorData = ["#EEFAEB","#EFF1FF","#FFF3F1","#E8F7F7","#FFF3E7","#FAF8EA"];
let testDataList = ['营业执照','食品经营许可证类选择器允许你根据元素在','有机产品认证书','无公害农产品证书','有机产品认证书','营业执照']
const pageData = reactive({
})
</script>
<template> <template>
<view> <view class="w-full h-95vh bg-#E6F5E8 detail_page">
详情页的内容 <view class="module_width top_content">
<view class="enterprise_logo_view"><image class="enterprise_logo" mode="heightFix" src="/static/images/test/test_logo.png" /></view>
<view class="enterprise_business">主营:粮、油、糖、棉、肉、乳等品类的全球一体化运营</view>
<view class="enterprise_description">中粮集团下设中粮粮油、中国粮油、中国食品、地产酒店、中国土畜、中粮屯河、中粮包装、中粮发展、金融等9大业务板块,拥有中国食品、中粮控股两家香港上市公司,中粮屯河、中粮地产和丰原生化3家内地上市公司。福临门食用油、长城葡萄酒、金帝巧克力、屯河番茄制品、家佳康肉制品以及大悦城Shopping Mall、亚龙湾度假区、凯莱酒店、雪莲羊绒、中茶茶叶、中英人寿保险农村金融服务等等。 </view>
</view>
<view class="module_width middle_content">
<view class="module_title">资质证书</view>
<view class="module_separate"></view>
<view class="module_qualification">
<view class="qualification_item qualification_bg" v-for="(item,index) in testDataList" :key="index">
<image class="enterprise_logo" mode="heightFix" src="/static/images/test/test_business.png" />
<view class="qualification_name ellipsis">{{item}}</view>
</view>
</view>
</view>
<view class="module_width footer_content">主营产品</view>
</view> </view>
</template> </template>
<script> <style lang="less" scoped>
export default { .detail_page{
data() { display: flex;
return { flex-wrap: wrap;
justify-content: center;
align-items: flex-start;
align-content: flex-start;
.module_width{
width: 690rpx;
margin-top: 24rpx;
background: #FFFFFF;
border-radius: 20rpx;
padding:28rpx;
box-sizing: border-box;
}
.ellipsis{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.top_content{
.enterprise_logo_view{
width: 630rpx;
display:flex;
align-items: flex-start;
.enterprise_logo{
height: 80rpx;
} }
}, }
methods: { .enterprise_business{
width: 636rpx;
padding:8rpx 20rpx;
border-radius: 8rpx;
background: linear-gradient(233.81deg, rgba(92, 181, 110, 1) 0%, rgba(100, 214, 62, 1) 100%);
font-size: 24rpx;
font-weight: 500;
line-height: 40rpx;
color: #FFFFFF;
margin-top: 32rpx;
}
.enterprise_description{
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 400;
letter-spacing: 0px;
line-height: 40rpx;
color: #333333;
text-align: justify;
vertical-align: middle;
text-indent: 2em;
} }
} }
</script> .middle_content{
<style> }
.module_title{
font-size: 32rpx;
font-weight: 500;
line-height: 40rpx;
color: #333333;
text-align: justify;
vertical-align: middle;
}
.module_separate{
margin-top: 20rpx;
width: 128rpx;
height: 6rpx;
opacity: 1;
background: linear-gradient(233.81deg, #5CB56E 0%, #64D63E 100%);
}
.module_qualification{
margin-top: 32rpx;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-content: flex-start;
.qualification_item{
width: 198rpx;
height: 166rpx;
margin-left: 20rpx;
margin-top: 26rpx;
border-radius: 8rpx;
background: #EEFAEB;
padding-top: 8rpx;
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
justify-content: center;
.enterprise_logo{
height: 114rpx;
max-width: 160rpx;
}
.qualification_name{
height: 40rpx;
line-height: 40rpx;
font-size: 20rpx;
color: #333333;
max-width: 160rpx;
}
}
.qualification_item:nth-child(3n+1){
margin-left: 0rpx;
}
}
}
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import { onLoad, onPullDownRefresh, onShow } from '@dcloudio/uni-app' import { onLoad, onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import Navigate from '@/utils/page/navigate'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import * as NongzhiAPI from '@/api/model/nongzhi' import * as NongzhiAPI from '@/api/model/nongzhi'
const model = reactive({ const pageData = reactive({
params: { params: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
...@@ -18,47 +19,46 @@ ...@@ -18,47 +19,46 @@
}) })
async function getList(params) { async function getList(params) {
if (model.loading) return if (pageData.loading) return
model.loading = true pageData.loading = true
NongzhiAPI.getEnterpriseList(params).then((res) => { NongzhiAPI.getEnterpriseList(params).then((res) => {
if (res.records.length > 0) { if (res.records.length > 0) {
const { records } = res const { records } = res
if (model.params.pageNo === 1) { if (pageData.params.pageNo === 1) {
model.dataList = records pageData.dataList = records
} else { } else {
model.dataList = [...model.dataList, ...records] pageData.dataList = [...pageData.dataList, ...records]
} }
model.hasMore = records.length === model.params.pageSize pageData.hasMore = records.length === pageData.params.pageSize
model.params.pageNo++ pageData.params.pageNo++
} else { } else {
model.hasMore = false pageData.hasMore = false
} }
}) })
model.loading = false pageData.loading = false
} }
function toDetail(item) { function toDetail(item) {
uni.navigateTo({ let param = encodeURIComponent(JSON.stringify({id:1,name:"中粮集团"}));
url: `/pages/kexinnongzi/detail?id=${item.id}`, Navigate.to(`/pages/kexinnongzi/detail?param=${param}`)
})
} }
function resetData() { function resetData() {
model.params.pageNo = 1 pageData.params.pageNo = 1
model.hasMore = true pageData.hasMore = true
model.loading = false pageData.loading = false
} }
onPullDownRefresh(() => { onPullDownRefresh(() => {
resetData() resetData()
getList(model.params) getList(pageData.params)
}) })
onShow(() => { onShow(() => {
resetData() resetData()
getList(model.params) getList(pageData.params)
}) })
</script> </script>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
class="w-full h-full" class="w-full h-full"
style="font-family: '思源黑体'; font-weight: 400" style="font-family: '思源黑体'; font-weight: 400"
scroll-y scroll-y
@scrolltolower="getList(model.params)" @scrolltolower="getList(pageData.params)"
:show-scrollbar="false" :show-scrollbar="false"
> >
<view class="top_img"> <view class="top_img">
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</view> </view>
<view class="page_content"> <view class="page_content">
<view class="item_list" v-for="item in model.dataList" :key="item.id" @click="toDetail(item)"> <view class="item_list" v-for="item in pageData.dataList" :key="item.id" @click="toDetail(item)">
<view class="item_left"> <view class="item_left">
<image class="enterprise_logo" mode="aspectFit" :src="item.businessLicenseUrl" /> <image class="enterprise_logo" mode="aspectFit" :src="item.businessLicenseUrl" />
</view> </view>
...@@ -90,34 +90,24 @@ ...@@ -90,34 +90,24 @@
</view> </view>
</view> </view>
<view class="item_list" @click="toDetail({name:'中粮集团',id:8})">
<view class="item_left">
<image class="enterprise_logo" mode="aspectFit" src="" />
</view>
<view class="item_right">
<view class="item_name ellipsis">中粮集团</view>
<view class="item_description ellipsis">产品描述</view>
<view class="item_details">
<view class="detail_btn">查看详情</view>
</view>
</view>
</view>
</view> </view>
<!-- <view
v-for="news in newsList"
:key="news.id"
class="w-full h-auto flex flex-row justify-around p-2 bg-#fff border-rd-lg mb-2"
style="min-height: 120rpx"
@click="toNewsDetail(news)"
>
<view class="flex flex-col justify-between" :style="news.posterUrl ? 'width: 68%' : 'width: 100%'">
<view class="ellipsis-multiline fontsize_28 color-#333333">{{ news.title }}</view>
<view class="flex flex-row justify-between text-25 color-#686868">
<text>{{ dayjs(news.publishDate).format('YYYY年MM月DD日') }}</text>
<view class="mr-1 flex-center">
<image class="mt-0.5 mr-1 w-30 h-26" src="/static/images/news/views.png" />
<view class="flex-center text-24 lh-24rpx">{{ news.viewCount }}</view>
</view>
<view v-show="!news.posterUrl" class="w-4%"></view>
</view>
</view>
<view v-show="news.posterUrl" class="w-30% h-130">
<image class="w-full h-full border-rd" :src="news.posterUrl" />
</view>
</view> -->
<!-- 加载状态 --> <!-- 加载状态 -->
<view class="loading-status"> <view class="loading-status">
<text v-if="model.loading">加载中...</text> <text v-if="pageData.loading">加载中...</text>
<text v-else-if="!model.hasMore">没有更多数据了</text> <text v-else-if="!pageData.hasMore">没有更多数据了</text>
<text v-else>上拉加载更多</text> <text v-else>上拉加载更多</text>
</view> </view>
</scroll-view> </scroll-view>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论