diff --git a/pagesInn/components/jin-edit/jin-edit.vue b/pagesInn/components/jin-edit/jin-edit.vue new file mode 100644 index 0000000..c435769 --- /dev/null +++ b/pagesInn/components/jin-edit/jin-edit.vue @@ -0,0 +1,303 @@ + + + + + diff --git a/pagesInn/components/jin-edit/jin-icons.vue b/pagesInn/components/jin-edit/jin-icons.vue new file mode 100644 index 0000000..223ff10 --- /dev/null +++ b/pagesInn/components/jin-edit/jin-icons.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/pagesInn/components/jin-edit/readme.md b/pagesInn/components/jin-edit/readme.md new file mode 100644 index 0000000..5fd5e2c --- /dev/null +++ b/pagesInn/components/jin-edit/readme.md @@ -0,0 +1,65 @@ +## jin-edit 基于editor的富文本编辑器 + +### 兼容性 + +这是一个uni-app的通用组件,兼容微信小程序端、安卓端、ios端(未测试)、H5端。作者因没有ios设备无法对ios端进行测试,其他端测试无问题。 + +微信小程序 | APP | H5 +:--: | :--: | :--: +√ | √ | √ + +我的HbuilderX版本2.6.7,不同的版本可能会造成不兼容的问题。 + +### 使用方式 + +1. 将此组件进入你的项目中的 /components/ 目录中 +2. 在某个页面中使用该插件 +- 在 `script` 中引用组件 +```javascript +import jinEdit from '../../components/jin-edit/jin-edit.vue'; +export default { + data() { + return { + + } + }, + components: { + jinEdit + }, + methods: { + // 点击发布 + editOk(res) { + console.log(res); + } + } +} +``` +- 在 `template` 中使用组件 +```html + +``` + +### Demo + +[uni-jin(一个uni-app组件集合)](https://github.com/wangjinxin613/uni-jin) + +### 参数 + +属性 | 类型 | 默认值 | 说明 +:--: | :--: | :--: | :--: +showImgSize | Boolean | false | 点击图片时显示图片大小控件 +showImgToolbar | Boolean | false | 点击图片时显示工具栏控件 +showImgResize | Boolean | false | 点击图片时显示修改尺寸控件 +placeholder | String | '' | 编辑器占位符 +uploadFileUrl | String | '#' | 图片上传的服务器地址 +fileKeyName | String | 'file' | 图片上传时的name +header | Object | - | 图片上传http请求的header +html | String | - | 初始化的html + +### 方法 + +方法名 | 参数 | 说明 +:--: | :--: | :--: +editOk | e={html,text,delta,isPublic} | 点击发布按钮触发 + +以上 \ No newline at end of file diff --git a/pagesInn/inn/innHome.vue b/pagesInn/inn/innHome.vue index d4644fa..2b84405 100644 --- a/pagesInn/inn/innHome.vue +++ b/pagesInn/inn/innHome.vue @@ -10,102 +10,100 @@ transparent="auto" color='#ffffff' /> - - - - - - - - - - - - - {{ inn.name }} - - - {{ inn.cityName }} - + + - - - - - {{ inn.ownerName }}/店主 - - 保证金:{{ inn.guaranteeValue }}元 - - - - - + + + + {{ inn.name }} + + + {{ inn.cityName }} - - - - {{ favoriteCount }} + + + + + + {{ inn.ownerName }}/店主 + + 保证金:{{ inn.guaranteeValue }}元 + + + + + + + + + + {{ favoriteCount }} + - + + - {{ inn.content }} + {{ inn.content }} + + - @@ -113,40 +111,35 @@ 简介: - - - - - --> + + + - {{ inn.address }} - - - - - - 联系客服 + + + + - - - - 进入地图 + + {{ inn.address }} + + + + + 导航 + + + + 客服 + - - @@ -178,7 +170,6 @@ - @@ -196,14 +187,12 @@ {{ info.name }} - - @@ -301,7 +308,9 @@ export default { inn: { cityName: '', pics: [], - desc: '' + desc: '', + latitude: '', + longitude: '' }, isMyInn: false, //是否是自己的客栈 goodsList: [], @@ -312,7 +321,11 @@ export default { partnerId: null, isLike: false, //点赞 isFavorite: false, - favoriteCount: 0 + favoriteCount: 0, + videoStyle: { + width: '750rpx', + height: '500rpx' + } } }, //必须在页面加 onPageScroll(e){} ,才能滑动显示背景 @@ -595,30 +608,65 @@ export default { } }, fetchInnDetail: function () { - let that = this; + const that = this + let reqFn = null if (this.isMyInn) { - getHotelDetail(that.id).then((res) => { - that.inn = res.data; - that.isLike = res.data.zanVo !== null; - that.isFavorite = res.data.hasFavorite - that.favoriteCount = res.data.favoriteCount - }).catch((err) => { - - }).finally(() => { - uni.stopPullDownRefresh(); - }); + reqFn = getHotelDetail } else { - getHomeHotelDetail(that.id).then((res) => { - that.inn = res.data; - that.isLike = res.data.zanVo !== null; - that.isFavorite = res.data.hasFavorite - that.favoriteCount = res.data.favoriteCount - }).catch((err) => { - - }).finally(() => { - uni.stopPullDownRefresh(); - }); + reqFn = getHomeHotelDetail } + reqFn(that.id).then((res) => { + const { success, data } = res + if (success) { + that.inn = data + that.isLike = data.zanVo !== null + that.isFavorite = data.hasFavorite + that.favoriteCount = data.favoriteCount + that.inn.latitude = that.inn.latitude ? parseFloat(that.inn.latitude) : 24.993587 + that.inn.longitude = that.inn.longitude ? parseFloat(that.inn.longitude) : 102.779656 + // coverType: 1-图片,2-视频 + if (data.coverType === 2) { + uni.getSystemInfo({ + success: info => { + const screenWidth = info.windowWidth + that.videoStyle.width = screenWidth + 'px' + that.videoStyle.height = screenWidth * 500 / 750 + 'px' + } + }) + // 视频宽高自适应 + /* + uni.downloadFile({ + url: data.cover, + success: downRes => { + const { tempFilePath } = downRes + if (tempFilePath) { + uni.getVideoInfo({ + src: tempFilePath, + success: videoRes => { + const { width, height } = videoRes + uni.getSystemInfo({ + success: info => { + const screenWidth = info.windowWidth + that.videoStyle.width = screenWidth + 'px' + that.videoStyle.height = screenWidth * height / width + 'px' + } + }) + }, + fail: err => { + console.log(err) + } + }) + } + } + }) + */ + } + } + }).catch((err) => { + + }).finally(() => { + uni.stopPullDownRefresh(); + }); }, initPoster() { getPoster(this.id).then(({data}) => this.posterUrl = data); @@ -770,20 +818,10 @@ export default { .full-img { width: 750rpx; } - - .box-mask { - position: absolute; - bottom: 0; - right: 0; - width: 596rpx; - box-sizing: border-box; - padding: 0 20rpx 12rpx; - background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000000 100%); - - .city-section { - width: 256rpx; - margin-left: 20rpx; - } + .video { + display: block; + width: 100%; + height: 100%; } } @@ -796,14 +834,28 @@ export default { font-size: 22rpx; line-height: 1; } - +.zan-favorite-wrap { + font-size: 32rpx; + color: #333; + .on { + color: #FF564A; + } +} .zan-box { - image { - width: 32rpx; - height: 32rpx; + .img { + width: 36rpx; + height: 36rpx; + margin: 0 8rpx 0 0; vertical-align: middle; } } +.favorite-box { + .icon { + width: 36rpx; + height: 36rpx; + margin: 0 8rpx 0 30rpx; + } +} .store-img { width: 686rpx; @@ -885,10 +937,37 @@ export default { .innInfoWrap { position: relative; - margin-top: -66rpx; - padding: 0 18*2rpx; + margin-top: -76rpx; + padding: 20rpx 36rpx; line-height: 1; z-index: 1; + .bg-color { + position: absolute; + top: 0; + left: 0; + right: 0; + z-index: 1; + height: 50%; + background: linear-gradient(-180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); + + .box-mask { + position: absolute; + bottom: 0; + right: 0; + left: 166rpx; + box-sizing: border-box; + padding: 0 32rpx 12rpx 0; + + .city-section { + width: 256rpx; + margin-left: 20rpx; + } + } + } + .body-cont { + position: relative; + z-index: 2; + } } .inn-logo { @@ -942,12 +1021,39 @@ export default { font-size: 10*2rpx; color: #FFFFFF; } - -.inn-signature { - background-image: url('http://admin-api.xdd618.com/file/pic/20210225101530789767.png'); - background-repeat: no-repeat; - background-size: 100% 100%; - padding: 20rpx; +.inn-signature-wrap { + position: relative; + z-index: 5; + padding: 0 32rpx; + margin: 20rpx 0 0 0; + .triangle { + position: absolute; + top: -20rpx; + left: 72rpx; + width: 0; + height: 0; + border-left: 20rpx solid transparent; + border-right: 20rpx solid transparent; + border-bottom: 24rpx solid rgba(243,243,246,0.39); + } + .inn-signature { + position: relative; + padding: 20rpx; + border-radius: 8rpx; + font-size: 24rpx; + color: #080F1A; + background: rgba(243,243,246,0.39); + box-shadow: 0px 6px 12px rgba(0,0,0,0.12); + } + .share-btn { + position: absolute; + right: 0; + bottom: -68rpx; + .img { + width: 212rpx; + height: 60rpx; + } + } } .inn-intro-bold { @@ -1152,4 +1258,65 @@ export default { color:#A6AAB3; font-size:28rpx; } +.map-wrapper { + position: relative; + z-index: 2; + height: 200rpx; + margin: 40rpx 0 0 0; + overflow: hidden; + .map-cont { + position: absolute; + top: 0; + left: 0; + z-index: 2; + width: 100%; + opacity: 0.3; + transform: translateY(-50rpx); + } + .bg { + position: absolute; + top: 0; + left: 0; + right: 0; + z-index: 3; + height: 60rpx; + background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); + } + .map-info { + position: relative; + z-index: 5; + display: flex; + align-items: center; + padding: 40rpx 32rpx; + color: #333; + font-size: 14px; + .map-info-hd { + .icon { + display: block; + width: 56rpx; + height: 56rpx; + } + } + .map-info-bd { + flex: 1; + padding: 0 60rpx 0 20rpx; + line-height: 60rpx; + } + .map-info-ft { + .item + .item { + margin: 0 0 0 36rpx; + } + .item { + text-align: center; + font-weight: bold; + .img { + display: block; + width: 72rpx; + height: 72rpx; + margin: 0 0 20rpx 0; + } + } + } + } +} diff --git a/pagesInn/inn/innInfoDetail.vue b/pagesInn/inn/innInfoDetail.vue index 8739e13..0ae4578 100644 --- a/pagesInn/inn/innInfoDetail.vue +++ b/pagesInn/inn/innInfoDetail.vue @@ -20,7 +20,7 @@ - diff --git a/pagesInn/inn/innInfoPublish.vue b/pagesInn/inn/innInfoPublish.vue index 0681d14..37e07f2 100644 --- a/pagesInn/inn/innInfoPublish.vue +++ b/pagesInn/inn/innInfoPublish.vue @@ -1,38 +1,69 @@