|
@@ -1,6 +1,44 @@
|
|
<template>
|
|
<template>
|
|
<view class="main">
|
|
<view class="main">
|
|
- {{info}}
|
|
|
|
|
|
+ <view class="one" v-if="info.file.length>0">
|
|
|
|
+ <swiper class="swiper" circular :indicator-dots="true" indicator-color="#F5F5F5"
|
|
|
|
+ indicator-active-color="#ffffff" :autoplay="true" :interval="3000" :duration="1000">
|
|
|
|
+ <swiper-item class="list" v-for="(item,index) in info.file" :key="index">
|
|
|
|
+ <image class="image" :src="item.url" mode="">
|
|
|
|
+ </image>
|
|
|
|
+ </swiper-item>
|
|
|
|
+ </swiper>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="bottom">
|
|
|
|
+ <view class="two">
|
|
|
|
+ <view class="two_1">{{info.name}}</view>
|
|
|
|
+ <view class="two_2">{{info.open_time}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="thr">
|
|
|
|
+ <view class="thr_1">
|
|
|
|
+ <view class="left">地址:</view>
|
|
|
|
+ <view class="right"><text :user-select='true'>{{info.address}}</text></view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="thr_1">
|
|
|
|
+ <view class="left">状态:</view>
|
|
|
|
+ <view class="right">
|
|
|
|
+ <text :class="[info.status=='0'?'text_1':'text_2']">{{info.zhStatus}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="thr_1">
|
|
|
|
+ <view class="left">官方电话:</view>
|
|
|
|
+ <view class="right"><text :user-select='true'>{{info.phone}}</text></view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="four" v-if="info.policy">
|
|
|
|
+ <view class="four_1">优待政策</view>
|
|
|
|
+ <rich-text :nodes="formatRichText(info.policy)"></rich-text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="four">
|
|
|
|
+ <view class="four_1">简介</view>
|
|
|
|
+ <rich-text :nodes="formatRichText(info.brief)"></rich-text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -9,7 +47,11 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
user: {},
|
|
user: {},
|
|
- info: {},
|
|
|
|
|
|
+ info: {
|
|
|
|
+ file: []
|
|
|
|
+ },
|
|
|
|
+ // 字典表
|
|
|
|
+ statusList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad: async function(e) {
|
|
onLoad: async function(e) {
|
|
@@ -26,7 +68,9 @@
|
|
const that = this;
|
|
const that = this;
|
|
try {
|
|
try {
|
|
const res = uni.getStorageSync('token');
|
|
const res = uni.getStorageSync('token');
|
|
- if (res) that.$set(that, `user`, res);
|
|
|
|
|
|
+ if (res) {
|
|
|
|
+ that.$set(that, `user`, res);
|
|
|
|
+ }
|
|
} catch (e) {
|
|
} catch (e) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: err.errmsg,
|
|
title: err.errmsg,
|
|
@@ -35,12 +79,12 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 查询
|
|
|
|
async search() {
|
|
async search() {
|
|
const that = this;
|
|
const that = this;
|
|
- let res;
|
|
|
|
- res = await that.$api(`/config`, 'GET', {})
|
|
|
|
|
|
+ const res = await that.$api(`/config`, 'GET', {})
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
|
|
+ const status = that.statusList.find(i => i.value == res.data.status)
|
|
|
|
+ if (status) res.data.zhStatus = status.label
|
|
that.$set(that, `info`, res.data)
|
|
that.$set(that, `info`, res.data)
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -48,13 +92,114 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 处理富文本
|
|
|
|
+ formatRichText(html) {
|
|
|
|
+ // 富文本内容格式化
|
|
|
|
+ return html && html.replace(/<img[^>]*>/gi, function(match, capture) {
|
|
|
|
+ // 查找所有的 img 元素
|
|
|
|
+ return match.replace(/style=".*"/gi, '').replace(/style='.*'/gi,
|
|
|
|
+ '')
|
|
|
|
+ // 删除找到的所有 img 元素中的 style 属性
|
|
|
|
+ }).replace(/\<img/gi, '<img style="width:100%;"') // 对 img 元素增加 style 属性,并设置宽度为 100%
|
|
|
|
+ },
|
|
|
|
+ // 查询其他信息
|
|
async searchOther() {
|
|
async searchOther() {
|
|
const that = this;
|
|
const that = this;
|
|
- }
|
|
|
|
|
|
+ let res;
|
|
|
|
+ // 查询类型
|
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
|
+ type: 'config_status',
|
|
|
|
+ is_use: '0',
|
|
|
|
+ })
|
|
|
|
+ if (res.errcode == '0') that.$set(that, `statusList`, res.data);
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
|
- .main {}
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+ .main {
|
|
|
|
+ .one {
|
|
|
|
+ .swiper {
|
|
|
|
+ height: 70vw;
|
|
|
|
+
|
|
|
|
+ .list {
|
|
|
|
+ .image {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .bottom {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 65vw;
|
|
|
|
+ left: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ background-color: var(--mainColor);
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ padding: 2vw 0 0 0;
|
|
|
|
+
|
|
|
|
+ .two {
|
|
|
|
+ padding: 4vw 2vw;
|
|
|
|
+ text-align: center;
|
|
|
|
+
|
|
|
|
+ .two_1 {
|
|
|
|
+ padding: 1vw 0;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: var(--font16Size);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .two_2 {
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .thr {
|
|
|
|
+ padding: 2vw;
|
|
|
|
+
|
|
|
|
+ .thr_1 {
|
|
|
|
+ display: flex;
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+ padding: 0 0 1vw 0;
|
|
|
|
+
|
|
|
|
+ .left {
|
|
|
|
+ padding: 0 1vw 0 0;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .right {
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+
|
|
|
|
+ .text_1 {
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+ padding: 3px 5px;
|
|
|
|
+ color: var(--mainColor);
|
|
|
|
+ background-color: mediumseagreen;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .text_2 {
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+ padding: 3px 5px;
|
|
|
|
+ color: var(--mainColor);
|
|
|
|
+ background-color: red;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .four {
|
|
|
|
+ padding: 2vw;
|
|
|
|
+
|
|
|
|
+ .four_1 {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: var(--font16Size);
|
|
|
|
+ padding: 0 0 1vw 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|