Merge branch 'dev'

This commit is contained in:
lifizer
2024-03-22 21:16:26 +08:00
15 changed files with 597 additions and 294 deletions
+5
View File
@@ -290,4 +290,9 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
.ai-center { .ai-center {
align-items: center; align-items: center;
}
.ql-editor.ql-blank::before {
font-style: normal;
font-size: 28rpx;
color: #C2C5CC;
} }
+110
View File
@@ -0,0 +1,110 @@
<template>
<view class="cover-box-wrap">
<view class="cover-box">
<image
:src="item.cover"
class="cover"
mode="scaleToFill"
/>
<view class="my-mask">
<image
class="icon"
:src="webUrl + '/20220510142728577618.png'"
mode="scaleToFill"
/>
<text>{{ item.cityName }}</text>
</view>
</view>
<view class="more-t">{{ item.content }}</view>
<view class="flex ai-center bottom">
<image
v-if="item.logo"
:src="item.logo"
class="logo"
mode="scaleToFill"
></image>
<image
v-else
:src="webUrl + '/20230609145651814148.png'"
class="logo"
/>
<text class="one-t">{{ item.name }}</text>
</view>
</view>
</template>
<script>
export default {
name: 'FunHotelItem',
props: {
item: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL
}
}
}
</script>
<style scoped lang="less">
.cover-box-wrap {
margin: 20rpx 0 0 0;
.cover-box {
position: relative;
width: 328rpx;
height: auto;
border-radius: 14rpx;
overflow: hidden;
}
.cover {
width: 328rpx;
height: 328rpx;
vertical-align: middle;
}
.icon {
width: 26rpx;
height: 26rpx;
margin-top: -6rpx;
margin-right: 6rpx;
vertical-align: middle;
}
.logo {
width: 36rpx;
height: 36rpx;
vertical-align: middle;
margin: 0 8rpx;
border-radius: 50%;
}
.item {
width: 328rpx;
box-sizing: border-box;
}
.my-mask {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 60rpx;
line-height: 60rpx;
box-sizing: border-box;
padding: 0 24rpx;
background: linear-gradient(rgba(51, 51, 51, 0), rgba(0, 0, 0, 1));
color: #fff;
font-size: 24rpx;
}
.more-t {
margin: 10rpx;
}
.one-t {
color: #666;
font-size: 24rpx;
}
.bottom {
margin: 0 0 20rpx 0;
}
}
</style>
+163 -189
View File
@@ -1,117 +1,36 @@
<script>
import {getHotelList, getHotelTypeList} from "@/api/inn.js";
import {getCurAddress, getLocation} from "@/utils/common";
export default {
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
name: "",
page: 1,
typeList: [],
typeIndex: 0,
cityName: "",
hotelList: [],
}
},
onLoad() {
this.getMapData();
getHotelTypeList().then(({data}) => {
this.typeList = data;
});
},
onShow() {
let memCityName = uni.getStorageSync("cityName")
if (memCityName.length) {
this.cityName = memCityName;
uni.removeStorageSync("cityName")
this.search();
}
},
onReachBottom() {
if (!this.cityName) {
return
}
this.page++;
this.fetchList();
},
methods: {
goCity() {
uni.navigateTo({
url: `/pages/chose-city/chose-city?type=2&city=${this.cityName}`
})
},
goInnDetail(item) {
uni.navigateTo({
url: `/pagesInn/inn/innHome?id=${item.id}`
})
},
async getMapData() {
const map = await getLocation();
if (map.length > 1) {
const {latitude, longitude} = map[1];
const address = await getCurAddress(latitude, longitude);
this.cityName = address[1].data.result.ad_info.city;
this.search();
}
},
tapType(index) {
if (this.typeIndex === index) return;
this.typeIndex = index;
this.search();
},
search() {
this.page = 1;
this.hotelList = [];
this.fetchList();
},
fetchList() {
let param = {
page: this.page,
type: this.typeList[this.typeIndex].id,
cityName: this.cityName
};
let name = this.name.trim();
if (name.length > 0) param.name = name;
getHotelList(param).then(res => {
if (res.status === 200) {
for (let i = 0; i < res.data.length; i++) {
res.data[i].hide = true;
this.hotelList.push(res.data[i])
}
}
})
}
}
}
</script>
<template> <template>
<view class="have-fun"> <view class="have-fun">
<!-- <u-navbar title="寻趣味" height="90rpx">-->
<!-- <view slot="left">&nbsp;</view>-->
<!-- </u-navbar>-->
<view class="top-box"> <view class="top-box">
<view class="search-box flex jc-between ai-center"> <view class="search-box flex jc-between ai-center">
<input type="text" v-model="name" placeholder="搜索店铺" placeholder-style="color:#949494" <input
@confirm="search"> v-model="name"
<image class="icon" :src="webUrl+'/20220903142935869059.png'" mode="scaleToFill" type="text"
@click="search"/> placeholder="搜索店铺"
placeholder-style="color:#949494"
@confirm="search"
>
<image
class="icon"
:src="webUrl+'/20220903142935869059.png'"
mode="scaleToFill"
@click="search"
/>
</view> </view>
<scroll-view class="type-box flex" scroll-x enable-flex> <scroll-view class="type-box flex" scroll-x enable-flex>
<view class="item flex-0 flex flex-col jc-center ai-center" :class="{'active':typeIndex===index}" <view
v-for="(item,index) in typeList" :key="index" @click="tapType(index)"> v-for="(item, index) in typeList"
:key="index"
:class="{
'active': typeIndex === index
}"
class="item flex-0 flex flex-col jc-center ai-center"
@click="tapType(index)"
>
<image :src="item.icon" mode="scaleToFill"/> <image :src="item.icon" mode="scaleToFill"/>
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="body"> <view class="body">
<view class="flex jc-end"> <view class="flex jc-end">
<view class="city-box" @click="goCity('cloud')"> <view class="city-box" @click="goCity('cloud')">
@@ -119,41 +38,150 @@ export default {
<text>{{ cityName }}</text> <text>{{ cityName }}</text>
</view> </view>
</view> </view>
<view v-if="isLoad">
<view class="list" v-if="hotelList.length"> <view v-if="hotelList.length > 0">
<custom-waterfalls-flow :value="hotelList" imageKey="cover"> <view class="list-wrapper">
<view <view class="list">
v-for="(item,index) in hotelList" <view
:key="index" v-for="(item, index) in hotelEvenList"
class="item" :key="index"
@click="goInnDetail(item)" class="item"
> @click="goInnDetail(item)"
<view class="cover-box"> >
<image class="cover" :src="item.cover" mode="scaleToFill"></image> <fun-hotel-item :item="item" />
<view class="my-mask">
<image class="icon" :src="webUrl+'/20220510142728577618.png'"
mode="scaleToFill"></image>
<text>{{ item.cityName }}</text>
</view> </view>
</view> </view>
<view class="more-t">{{ item.content }}</view> <view class="list">
<view class="flex ai-center" style="margin-bottom: 18rpx;"> <view
<image class="logo" :src="item.logo" mode="scaleToFill" v-if="item.logo"></image> v-for="(item, index) in hotelOddList"
<image class="logo" :src="webUrl+'/20230609145651814148.png'" v-else/> :key="index"
<text class="one-t">{{ item.name }}</text> class="item"
@click="goInnDetail(item)"
>
<fun-hotel-item :item="item" />
</view>
</view> </view>
</view> </view>
</custom-waterfalls-flow> </view>
</view> <view class="v4-nodata" v-else>
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
<view class="v4-nodata" v-else> <view class="text">暂无数据</view>
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/> </view>
<view class="text">暂无数据</view>
</view> </view>
<goo-skeleton v-else />
</view> </view>
</view> </view>
</template> </template>
<script>
import { getHotelList, getHotelTypeList } from "@/api/inn.js"
import { getCurAddress, getLocation } from "@/utils/common"
import GooSkeleton from '@/components/GooSkeleton/index.vue'
import FunHotelItem from './components/HotelItem'
export default {
components: {
GooSkeleton,
FunHotelItem
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
name: '',
page: 1,
typeList: [],
typeIndex: 0,
cityName: '',
hotelList: [],
isLoad: false
}
},
computed: {
hotelOddList() {
const arr = this.hotelList.filter(function(item, index) { return index % 2 === 1 })
return arr
},
hotelEvenList() {
const arr = this.hotelList.filter(function(item, index) { return index % 2 === 0 })
return arr
}
},
onLoad() {
this.getMapData()
getHotelTypeList().then(({data}) => {
this.typeList = data;
})
},
onShow() {
const memCityName = uni.getStorageSync('cityName')
if (memCityName.length) {
this.cityName = memCityName
uni.removeStorageSync('cityName')
this.search()
}
},
methods: {
goCity() {
uni.navigateTo({
url: `/pages/chose-city/chose-city?type=2&city=${this.cityName}`
})
},
goInnDetail(item) {
uni.navigateTo({
url: `/pagesInn/inn/innHome?id=${item.id}`
})
},
async getMapData() {
const map = await getLocation()
if (map.length > 1) {
const {latitude, longitude} = map[1]
const address = await getCurAddress(latitude, longitude)
this.cityName = address[1].data.result.ad_info.city
this.search()
}
},
tapType(index) {
if (this.typeIndex === index) return
this.typeIndex = index
this.search()
},
search() {
this.isLoad = false
this.page = 1
this.hotelList = []
this.fetchList()
},
fetchList() {
const param = {
page: this.page,
type: this.typeList[this.typeIndex].id,
cityName: this.cityName
}
const name = this.name.trim()
if (name.length > 0) {
param.name = name
}
getHotelList(param).then(res => {
const { success, data } = res
if (success) {
for (let i = 0; i < data.length; i++) {
const cover = data[i].cover
data[i].hide = true
// 视频封面取第一帧图片
if (data[i].coverType === 2) {
data[i].videoCover = cover
data[i].cover = (cover + '?vframe/jpg/offset/1')
} else {
data[i].videoCover = ''
}
this.hotelList.push(data[i])
}
}
}).finally(() => {
this.isLoad = true
})
}
}
}
</script>
<style scoped lang="less"> <style scoped lang="less">
.have-fun { .have-fun {
//padding-top: 120rpx; //padding-top: 120rpx;
@@ -240,70 +268,16 @@ export default {
} }
} }
.list { .list-wrapper {
margin-top: 20rpx; display: flex;
justify-content: space-between;
.cover { .list {
width: 328rpx; width: 328rpx;
height: 328rpx; .item {
vertical-align: middle;
}
.icon {
width: 26rpx;
height: 26rpx;
margin-top: -6rpx;
margin-right: 6rpx;
vertical-align: middle;
}
.logo {
width: 36rpx;
height: 36rpx;
vertical-align: middle;
margin: 0 8rpx;
border-radius: 50%;
}
.item {
width: 328rpx;
box-sizing: border-box;
}
.cover-box {
position: relative;
width: 328rpx;
height: auto;
border-radius: 14rpx;
overflow: hidden;
.my-mask {
position: absolute;
bottom: 0;
left: 0;
width: 100%; width: 100%;
height: 60rpx;
line-height: 60rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 24rpx;
background: linear-gradient(rgba(51, 51, 51, 0), rgba(0, 0, 0, 1));
color: #fff;
font-size: 24rpx;
} }
} }
.more-t {
margin: 10rpx;
}
.one-t {
color: #666;
font-size: 24rpx;
}
}
/deep/ .waterfalls-flow-column .column-value {
background-color: rgba(0, 0, 0, 0) !important;
} }
} }
</style> </style>
+3 -1
View File
@@ -211,7 +211,9 @@
<view class="msg_title"> <view class="msg_title">
{{ unReadMessageInfo.noticeTitle }} {{ unReadMessageInfo.noticeTitle }}
</view> </view>
<view class="msg_content" v-html="unReadMessageInfo.noticeContent"></view> <view class="msg_content">
<rich-text :nodes="unReadMessageInfo.noticeContent" />
</view>
<view class="msg_line"></view> <view class="msg_line"></view>
<view class="msg_btn" @click="msgConfirm">我知道了</view> <view class="msg_btn" @click="msgConfirm">我知道了</view>
</view> </view>
+9 -2
View File
@@ -316,9 +316,10 @@ export default {
}, },
{ {
text: '帮助中心', text: '帮助中心',
url: '/pages/user/Message/Message', url: '',
icon: '/icon/icon-help.png', icon: '/icon/icon-help.png',
allowEnter: true allowEnter: true,
showTip: true
}, },
{ {
text: '设置中心', text: '设置中心',
@@ -468,6 +469,12 @@ export default {
}, },
toolItemClickHandle(item) { toolItemClickHandle(item) {
const url = item.url const url = item.url
if (item.showTip) {
this.$dialog.toast({
mes: '暂未开放'
})
return
}
if (!url || !item.allowEnter) { if (!url || !item.allowEnter) {
return return
} }
+32 -5
View File
@@ -1,17 +1,19 @@
<template> <template>
<view class="container" :style="{height: height}"> <view class="container" :style="{height: height}">
<editor <editor
ref="editot"
id="editor"
class="ql-container" class="ql-container"
:placeholder="placeholder" :placeholder="placeholder"
:show-img-size="true" :show-img-size="true"
:show-img-toolbar="true" :show-img-toolbar="true"
:show-img-resize="true" :show-img-resize="true"
:read-only="readOnly"
placeholder-style="font-size:24rpx;color:#C2C5CC;"
@ready="onEditorReady" @ready="onEditorReady"
id="editor"
@statuschange="statuschange" @statuschange="statuschange"
@focus="editFocus" @focus="editFocus"
@blur="editBlur" @blur="editBlur"
ref="editot"
></editor> ></editor>
<!-- 操作工具 --> <!-- 操作工具 -->
<view class="tool-view" > <view class="tool-view" >
@@ -36,7 +38,7 @@
</view> </view>
</view> </view>
<view class="tool"> <view class="tool">
<!-- <jinIcon class="single" type="&#xe6f3;" title="图片" @click="insertImage"></jinIcon> --> <jinIcon class="single" type="&#xe6f3;" title="图片" @click="insertImage"></jinIcon>
<jinIcon class="single" type="&#xe6f9;" title="格式" @click="showMore" :color="showMoreTool ? activeColor : '#666666'"></jinIcon> <jinIcon class="single" type="&#xe6f9;" title="格式" @click="showMore" :color="showMoreTool ? activeColor : '#666666'"></jinIcon>
<jinIcon class="single" type="&#xe6eb;" title="分割线" @click="insertDivider"></jinIcon> <jinIcon class="single" type="&#xe6eb;" title="分割线" @click="insertDivider"></jinIcon>
<jinIcon class="single" type="&#xe6e8;" title="撤回" @click="undo"></jinIcon> <jinIcon class="single" type="&#xe6e8;" title="撤回" @click="undo"></jinIcon>
@@ -49,8 +51,15 @@
<script> <script>
import jinIcon from './jin-icons.vue'; import jinIcon from './jin-icons.vue';
import {
chooseImage
} from '@/utils'
export default { export default {
props: { props: {
readOnly: {
type: Boolean,
default: false
},
// 点击图片时显示图片大小控件 // 点击图片时显示图片大小控件
showImgSize: { showImgSize: {
type: Boolean, type: Boolean,
@@ -127,14 +136,32 @@ export default {
},res => { },res => {
this.editorCtx = res.context; this.editorCtx = res.context;
this.editorCtx.setContents({ this.editorCtx.setContents({
html: this.html html: this.html,
success: () => {
this.editorCtx.blur()
}
}) })
setTimeout(() => {
uni.pageScrollTo({
scrollTop: 0,
duration: 0
})
}, 500)
}) })
.exec(); .exec();
}, },
undo() { undo() {
this.editorCtx.undo(); this.editorCtx.undo();
}, },
insertImage() {
const _this = this
chooseImage((path) => {
_this.editorCtx.insertImage({
src: path,
alt: '图片'
})
})
},
/// 插入分割线 /// 插入分割线
insertDivider() { insertDivider() {
this.editorCtx.insertDivider(); this.editorCtx.insertDivider();
@@ -238,7 +265,7 @@ export default {
.ql-container { .ql-container {
line-height: 150%; line-height: 150%;
font-size: 22rpx; font-size: 28rpx;
width: 100%; width: 100%;
height: 240px; height: 240px;
background: #fff; background: #fff;
+2 -2
View File
@@ -23,7 +23,7 @@
}, },
fontSize: { fontSize: {
type: String, type: String,
default: '32rpx' default: '36rpx'
}, },
title: { title: {
type: String, type: String,
@@ -53,7 +53,7 @@
bottom: 0; bottom: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 8px; font-size: 12px;
color: #666; color: #666;
line-height: 8px; line-height: 8px;
transform: translateY(-8px); transform: translateY(-8px);
+44 -8
View File
@@ -29,8 +29,8 @@
<video <video
:src="inn.cover" :src="inn.cover"
:autoplay="true" :autoplay="true"
:controls="false" :controls="true"
:loop="true" :loop="false"
object-fit="contain" object-fit="contain"
play-btn-position="center" play-btn-position="center"
class="video" class="video"
@@ -257,10 +257,22 @@
</view> </view>
<view class="flex"> <view class="flex">
<image <image
v-if="!item.zanVo"
:src="webUrl + '/page/hotel/zan-off.png'"
class="zan-off-icon"
@click="likeInfoItemHandle(item, index, 1)"
/>
<image
v-else
:src="webUrl + '/page/hotel/zan-on.png'"
class="zan-on-icon"
@click="likeInfoItemHandle(item, index, 0)"
/>
<!-- <image
:src="webUrl + '/20230803151302213857.png'" :src="webUrl + '/20230803151302213857.png'"
class="icon" class="icon"
/> />
<text class="seeNum-txt">{{ item.zan }}</text> <text class="seeNum-txt">{{ item.zan }}</text> -->
</view> </view>
<view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)"> <view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)">
<image <image
@@ -408,7 +420,8 @@ import {
getPoster, getPoster,
getHotelGoodList, getHotelGoodList,
postHotelNewsDel, postHotelNewsDel,
setTopHotelNew setTopHotelNew,
getHotelNewsZan
} from "@/api/inn.js" } from "@/api/inn.js"
import {formatDateTime} from "@/utils" import {formatDateTime} from "@/utils"
import {getUrlParam} from "@/utils/common.js" import {getUrlParam} from "@/utils/common.js"
@@ -465,7 +478,7 @@ export default {
onPageScroll(e) { onPageScroll(e) {
this.scrollData = e this.scrollData = e
}, },
onLoad: function (options) { onLoad(options) {
if (options.id) { if (options.id) {
this.id = options.id || null this.id = options.id || null
this.partnerId = options.partnerId || null this.partnerId = options.partnerId || null
@@ -493,7 +506,7 @@ export default {
if (!this.isLoad) { if (!this.isLoad) {
return return
} }
if (this.inn.hasProduct <= 0) { if (this.inn.hasProduct > 0) {
this.fetchGoods() this.fetchGoods()
} }
this.fetchInnInfoList() this.fetchInnInfoList()
@@ -686,7 +699,6 @@ export default {
if (data.hasProduct <= 0) { if (data.hasProduct <= 0) {
_this.activeIndex = 1 _this.activeIndex = 1
_this.tabList[0].isShow = false _this.tabList[0].isShow = false
_this.isLoadInfoListSuccess = true
} else { } else {
_this.fetchGoods() _this.fetchGoods()
} }
@@ -839,11 +851,26 @@ export default {
this.$dialog.toast({ this.$dialog.toast({
mes: '操作成功!' mes: '操作成功!'
}) })
setTimeout(() => {
uni.hideLoading()
}, 3000)
this.fetchInnInfoList() this.fetchInnInfoList()
} }
}).finally(() => { }).catch(() => {
uni.hideLoading() uni.hideLoading()
}) })
},
likeInfoItemHandle(item, index, value) {
getHotelNewsZan(item.id).then(res => {
const { success } = res
if (success) {
this.$dialog.toast({
mes: '操作成功!'
})
this.$set(this.infoArray[index], 'zanVo', value)
// this.fetchInnInfoList()
}
})
} }
} }
} }
@@ -853,6 +880,7 @@ export default {
@import "@/assets/css/store.less"; @import "@/assets/css/store.less";
.my-inn-page { .my-inn-page {
padding: 0 0 100rpx 0; padding: 0 0 100rpx 0;
background-color: #f6f6f6;
} }
.cover-box { .cover-box {
position: relative; position: relative;
@@ -1289,6 +1317,14 @@ export default {
height: 32rpx; height: 32rpx;
margin: 0 8rpx 0 0; margin: 0 8rpx 0 0;
} }
.zan-off-icon {
width: 138rpx;
height: 40rpx;
}
.zan-on-icon {
width: 80rpx;
height: 40rpx;
}
.more-btn { .more-btn {
position: relative; position: relative;
.more-wrapper { .more-wrapper {
+35 -36
View File
@@ -8,7 +8,7 @@
'active': tabIndex === index 'active': tabIndex === index
}" }"
@click="changeTab(index)" @click="changeTab(index)"
>{{item.label}}</text> >{{ item.label }}</text>
</view> </view>
<form @submit="formSubmit"> <form @submit="formSubmit">
<view class="form-item"> <view class="form-item">
@@ -37,6 +37,7 @@
:dataList="picsArray" :dataList="picsArray"
:upload_img_wh="uploadImgWH" :upload_img_wh="uploadImgWH"
:upload_max="uploadMax" :upload_max="uploadMax"
:upload_count="uploadCount"
:url="uploadUrl" :url="uploadUrl"
:type='uploadType' :type='uploadType'
:header="uploadHeader" :header="uploadHeader"
@@ -48,7 +49,7 @@
<view class="inp"> <view class="inp">
<jin-edit <jin-edit
:html="form.content" :html="form.content"
placeholder="请输入内容" placeholder="请输入内容..."
height="320px" height="320px"
@editOk="editOk" @editOk="editOk"
/> />
@@ -62,14 +63,14 @@
</template> </template>
<script> <script>
import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue'; import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue'
import jinEdit from '@/pagesInn/components/jin-edit/jin-edit.vue'; import jinEdit from '@/pagesInn/components/jin-edit/jin-edit.vue'
import { import {
VUE_APP_API_URL VUE_APP_API_URL
} from "@/config"; } from '@/config'
import { import {
postHotelNewsAdd postHotelNewsAdd
} from "@/api/inn.js"; } from '@/api/inn.js'
export default { export default {
components: { components: {
tmUpload, tmUpload,
@@ -77,7 +78,6 @@
}, },
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL,
uploadUrl: VUE_APP_API_URL + '/api/upload', uploadUrl: VUE_APP_API_URL + '/api/upload',
uploadType: 'image', uploadType: 'image',
uploadCount: 9, uploadCount: 9,
@@ -88,19 +88,18 @@
uploadedFilesArray: [], uploadedFilesArray: [],
uploadMax:10, uploadMax:10,
picsArray: [], picsArray: [],
showUpload:true, showUpload: true,
hotelId: 0, hotelId: 0,
tabData: [{ tabData: [{
label: "图文动态", label: '图文动态',
type: "NT_TEXT", type: 'NT_TEXT',
uploadType: "image", uploadType: 'image',
uploadCount: 9 uploadCount: 9
}, },
{ {
label: "视频动态", label: '视频动态',
type: "NT_VIDEO", type: 'NT_VIDEO',
uploadType: "video", uploadType: 'video',
uploadCount: 1 uploadCount: 1
} }
], ],
@@ -113,17 +112,16 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.hotelId = option.hotelId; this.hotelId = option.hotelId
}, },
methods: { methods: {
changeTab(index) { changeTab(index) {
this.tabIndex = index; this.tabIndex = index
this.showUpload = false; this.showUpload = false
this.uploadType = this.tabData[index].uploadType; this.uploadType = this.tabData[index].uploadType
this.uploadCount = this.tabData[index].uploadCount; this.uploadCount = this.tabData[index].uploadCount
setTimeout(()=>{ setTimeout(()=>{
this.showUpload = true; this.showUpload = true
},100) },100)
}, },
editOk(res) { editOk(res) {
@@ -135,41 +133,41 @@
}, },
formSubmit(e) { formSubmit(e) {
if (!this.form.title) { if (!this.form.title) {
this.$dialog.error("请输入动态标题"); this.$dialog.error('请输入动态标题')
return; return
} }
if (!this.form.intro) { if (!this.form.intro) {
this.$dialog.error("请输入简介"); this.$dialog.error('请输入简介')
return; return
} }
if (!this.form.content) { if (!this.form.content) {
this.$dialog.error("请输入资讯详情"); this.$dialog.error('请输入资讯详情')
return; return
} }
if (this.uploadedFilesArray.length == 0) { if (this.uploadedFilesArray.length == 0) {
this.$dialog.error("请上传动态图片或视频"); this.$dialog.error('请上传动态图片或视频')
return; return
} }
uni.showLoading(); uni.showLoading();
postHotelNewsAdd({ postHotelNewsAdd({
hotelId: this.hotelId, hotelId: this.hotelId,
name: this.form.title, name: this.form.title,
intro: this.form.intro, intro: this.form.intro,
content: this.form.content, content: this.form.content.replace(/\<img src/g, '<img style="display: block;max-width: 100%;" src'),
type: this.uploadType === 'image' ? 'NT_TEXT' : 'NT_VIDEO', type: this.uploadType === 'image' ? 'NT_TEXT' : 'NT_VIDEO',
resources: this.uploadType === 'image' ? this.uploadedFilesArray : [], resources: this.uploadType === 'image' ? this.uploadedFilesArray : [],
video: this.uploadType === 'image' ? '' : this.uploadedFilesArray[0] video: this.uploadType === 'image' ? '' : this.uploadedFilesArray[0]
}).then(res => { }).then(res => {
uni.hideLoading(); uni.hideLoading();
this.$dialog.toast({ this.$dialog.toast({
mes: "发布成功!" mes: '发布成功!'
}); })
setTimeout(() => { setTimeout(() => {
this.$yrouter.back(); this.$yrouter.back()
}, 1000); }, 3000)
}).catch((err) => { }).catch((err) => {
uni.hideLoading(); uni.hideLoading();
this.$dialog.error(err.msg); this.$dialog.error(err.msg)
}) })
} }
} }
@@ -221,6 +219,7 @@
padding: 10rpx 16rpx; padding: 10rpx 16rpx;
border: 1px solid #eee; border: 1px solid #eee;
border-radius: 6rpx; border-radius: 6rpx;
font-size: 28rpx;
} }
.inp-input { .inp-input {
padding: 0 16rpx; padding: 0 16rpx;
+3 -3
View File
@@ -80,11 +80,11 @@
</template> </template>
<script> <script>
import {getDetail, getPrize, takePrize} from "@/api/lottery"; import { getDetail, getPrize, takePrize } from '@/api/lottery'
import gbroMarquee from "@/components/gbro-marquee/marquee.vue"; import gbroMarquee from '../components/gbro-marquee/marquee.vue'
export default { export default {
components: {gbroMarquee}, components: { gbroMarquee },
data() { data() {
return { return {
ready: false, ready: false,
+142
View File
@@ -0,0 +1,142 @@
<template>
<view class="components-coupons">
<image class="coupons__cover" :src="data.image" mode="widthFix"/>
<view class="coupons__section flex jc-between ai-center">
<view>有效期至
<text>{{ data.endTime }}</text>
</view>
<view class="coupons__tag coupons__tag-expire" v-if="data.status===2">已到期</view>
<view class="coupons__tag" @click="goGoods()" v-if="data.status===0 && !radioModel">去使用</view>
<view @click="selectCoupon">
<radio :value="data.id" :checked="data.checked" color="#FF564A" v-if="radioModel && data.status===0"/>
</view>
</view>
<view class="coupons__rules">
<view class="coupons__rules-title" @click="changeRules()">使用规则
<image :class="{'open':isOpen}" :src="webUrl+'/20231125220409665027.png'" mode="scaleToFill"/>
</view>
<view
:class="isOpen ? 'auto-height' : ''"
class="coupon-html"
>
<rich-text :nodes="data.description" />
</view>
</view>
</view>
</template>
<script>
export default {
name: "Coupons",
props: {
data: Object,
radioModel: {
type: Boolean,
default: false
},
checked: {
type: Boolean,
default: false
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
isOpen: false
}
},
methods: {
changeRules() {
this.isOpen = !this.isOpen
},
goGoods() {
uni.switchTab({url: '/pages/home/landMark'})
// this.$global.navToGoods(this.data.productId)
},
selectCoupon() {
if (!this.radioModel) return
this.$emit('change', this.data.id)
}
}
}
</script>
<style scoped lang="less">
.components-coupons {
width: 686rpx;
box-sizing: border-box;
border: 2rpx solid #FF564A;
border-radius: 16rpx;
overflow: hidden;
image {
vertical-align: middle;
}
.coupons__cover {
width: 100%;
height: auto;
}
.coupons__section {
width: 100%;
box-sizing: border-box;
padding: 18rpx 20rpx 16rpx 16rpx;
font-size: 32rpx;
line-height: 1;
text {
color: #EA1C1C;
font-weight: bold;
}
.coupons__tag {
display: flex;
justify-content: center;
align-items: center;
width: 120rpx;
height: 52rpx;
box-sizing: border-box;
border-radius: 8rpx;
border: 2px solid #0DC5C5;
color: #0DC5C5;
font-size: 32rpx;
line-height: 1;
}
.coupons__tag-expire {
border: 2rpx solid #BFBFBF;
color: #999999;
}
}
.coupons__rules {
padding: 0 20rpx 20rpx 16rpx;
.coupons__rules-title {
color: #999999;
font-size: 28rpx;
image {
width: 26rpx;
height: 26rpx;
margin-left: 6rpx;
}
.open {
transform: rotate(180deg);
}
}
.coupon-html {
height: 80rpx;
overflow: hidden;
transition: all .3s;
&.auto-height {
height: auto;
}
}
}
}
</style>
+4 -39
View File
@@ -5,23 +5,13 @@
<Coupons class="coupons" :data="item" v-for="(item,index) in list" :key="index"/> <Coupons class="coupons" :data="item" v-for="(item,index) in list" :key="index"/>
<image class="zero-coupons" :src="webUrl+'/20231201201733142658.png'" mode="scaleToFill" v-if="list.length===0"/> <image class="zero-coupons" :src="webUrl+'/20231201201733142658.png'" mode="scaleToFill" v-if="list.length===0"/>
<!-- <view>-->
<!-- <button @tap="startRecord">开始录音</button>-->
<!-- <button @tap="endRecord">停止录音</button>-->
<!-- <button @tap="playVoice">播放录音</button>-->
<!-- </view>-->
</view> </view>
</template> </template>
<script> <script>
import SubSection from "@/components/SubSection.vue"; import SubSection from '@/components/SubSection.vue'
import Coupons from "@/components/Coupons.vue"; import Coupons from '../components/Coupons.vue'
import {getCouponsUser} from "@/api/user"; import {getCouponsUser} from '@/api/user'
const recorderManager = uni.getRecorderManager();
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
export default { export default {
name: "myCoupons", name: "myCoupons",
@@ -29,7 +19,6 @@ export default {
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
voicePath: '',
current: 0, current: 0,
canUse: 0, canUse: 0,
notUse: 0, notUse: 0,
@@ -37,34 +26,10 @@ export default {
} }
}, },
onLoad() { onLoad() {
// let self = this;
// recorderManager.onStop(function (res) {
// console.log('recorder stop' + JSON.stringify(res));
// self.voicePath = res.tempFilePath;
// });
this.fetchList(1) this.fetchList(1)
this.fetchList(2) this.fetchList(2)
}, },
methods: { methods: {
startRecord() {
console.log('开始录音');
recorderManager.start();
},
endRecord() {
console.log('录音结束');
recorderManager.stop();
},
playVoice() {
console.log('播放录音');
if (this.voicePath) {
innerAudioContext.src = this.voicePath;
innerAudioContext.play();
}
},
changeNav(index) { changeNav(index) {
this.current = index this.current = index
this.fetchList(index + 1) this.fetchList(index + 1)
@@ -79,7 +44,7 @@ export default {
if (type === 1) this.canUse = data.length if (type === 1) this.canUse = data.length
if (type === 2) this.notUse = data.length if (type === 2) this.notUse = data.length
}) })
}, }
} }
} }
</script> </script>
@@ -1,8 +1,29 @@
<template> <template>
<view class="waterfalls-flow"> <view class="waterfalls-flow">
<view v-for="(item,index) in data.column" :key="index" class="waterfalls-flow-column" :id="`waterfalls_flow_column_${index+1}`" :msg="msg" :style="{'width':w,'margin-left':index==0?0:m}"> <view
<view :class="['column-value',{'column-value-show':item2.o}]" v-for="(item2,index2) in columnValue(index)" :key="index2" :style="[s1]" @click.stop="wapperClick(item2)"> v-for="(item, index) in data.column"
<view class="inner" v-if="data.seat==1"> :key="index" class="waterfalls-flow-column"
:id="`waterfalls_flow_column_${index+1}`"
:msg="msg"
:style="{
'width': w,
'margin-left': index == 0 ? 0 : m
}"
>
<view
v-for="(item2, index2) in columnValue(index)"
:key="index2"
:class="[
'column-value',
{ 'column-value-show': item2.o }
]"
:style="[s1]"
@click.stop="wapperClick(item2)"
>
<view
v-if="data.seat == 1"
class="inner"
>
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<!-- #ifdef VUE2 --> <!-- #ifdef VUE2 -->
<slot name="slot{{item2.index}}"></slot> <slot name="slot{{item2.index}}"></slot>
@@ -15,8 +36,22 @@
<slot v-bind="item2"></slot> <slot v-bind="item2"></slot>
<!-- #endif --> <!-- #endif -->
</view> </view>
<image :class="['img',{'img-hide':item2[hideImageKey]==true||item2[hideImageKey]==1},{'img-error':!item2[data.imageKey]}]" :src="item2[data.imageKey]" mode="widthFix" @load="imgLoad(item2,index+1)" @error="imgError(item2,index+1)" @click.stop="imageClick(item2)"></image> <image
<view class="inner" v-if="data.seat==2"> :class="[
'img',
{ 'img-hide': item2[hideImageKey] == true || item2[hideImageKey] == 1 },
{ 'img-error': !item2[data.imageKey] }
]"
:src="item2[data.imageKey]"
mode="widthFix"
@load="imgLoad(item2, index+1)"
@error="imgError(item2, index+1)"
@click.stop="imageClick(item2)"
/>
<view
v-if="data.seat==2"
class="inner"
>
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<!-- #ifdef VUE2 --> <!-- #ifdef VUE2 -->
<slot name="slot{{item2.index}}"></slot> <slot name="slot{{item2.index}}"></slot>
@@ -156,6 +191,7 @@
this.msg++; this.msg++;
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.data.list)
this.initValue(this.curIndex, 'refresh==>'); this.initValue(this.curIndex, 'refresh==>');
}) })
}, 1) }, 1)
+4 -4
View File
@@ -49,7 +49,7 @@ dialog.message = (mes = "操作失败", obj = {}) => {
uni.showToast({ uni.showToast({
title: mes, title: mes,
icon: "none", icon: "none",
duration: 2000, duration: 3000,
complete: () => { complete: () => {
resolve(); resolve();
} }
@@ -61,7 +61,7 @@ dialog.toast = (options) => {
uni.showToast({ uni.showToast({
title: options.mes, title: options.mes,
icon: "none", icon: "none",
duration: 2000, duration: 3000,
complete: () => { complete: () => {
options.callback ? options.callback() : null options.callback ? options.callback() : null
} }
@@ -72,7 +72,7 @@ dialog.error = (mes) => {
uni.showToast({ uni.showToast({
title: mes, title: mes,
icon: "none", icon: "none",
duration: 2000 duration: 3000
}); });
}; };
@@ -84,7 +84,7 @@ export function validatorDefaultCatch(err, type = "message") {
uni.showToast({ uni.showToast({
title: err.errors[0].message, title: err.errors[0].message,
icon: 'none', icon: 'none',
duration: 2000 duration: 3000
}) })
return false return false
} }