Browse Source

master
前端-胡立永 1 month ago
parent
commit
c627d47da6
3 changed files with 156 additions and 103 deletions
  1. +3
    -0
      pages.json
  2. +3
    -103
      pages/index/index.vue
  3. +150
    -0
      pages_order/author/editor.vue

+ 3
- 0
pages.json View File

@ -53,6 +53,9 @@
{ {
"path": "product/productDetail" "path": "product/productDetail"
}, },
{
"path": "author/editor"
},
{ {
"path": "order/refundsOrExchange" "path": "order/refundsOrExchange"
}, },


+ 3
- 103
pages/index/index.vue View File

@ -3,111 +3,11 @@
<navbar/> <navbar/>
<view class="search">
<view @click="showSelectArea" class="left-area">
<image src="@/static/image/home/address-icon.png"></image>
<view class="area">{{ area }}</view>
<image src="@/static/image/home/arrow-icon.png" mode="aspectFit"></image>
<view class="parting-line">|</view>
</view>
<view class="center-area">
<image
style="margin-right: 20rpx;"
src="@/static/image/home/search-icon.png"></image>
<input v-model="queryParams.title"
placeholder="桌布租赁" />
</view>
<!-- <view class="right-area">
<view @click="searchAddress" class="search-button">
搜索
</view>
</view> -->
<view class="uni-color-btn"
@click="$utils.navigateTo('/pages_order/author/editor')">
章节编辑器
</view> </view>
<view class="swipe">
<uv-swiper
:list="bannerList"
indicator
height="320rpx"
keyName="url"></uv-swiper>
</view>
<!-- 水洗店 -->
<view class="userShop"
v-if="userShop">
<view class="list">
<view class="item"
v-for="(item, index) in 4"
:key="index">
<view class="">
<view class="">
我的客户
</view>
<view class="num">
{{ 30 }}
</view>
</view>
<view class="">
<image :src="`/static/image/home/${index}.png`" mode=""></image>
</view>
</view>
</view>
</view>
<!-- 酒店 -->
<view class="user"
v-else>
<uv-notice-bar
fontSize="28rpx"
:text="text"></uv-notice-bar>
<view class="shop">
<image
class="image"
src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
mode=""></image>
<view class="shopInfo">
<view class="title">
HOUS水洗店
</view>
<view class="tags">
<view class="tag">
桌布水洗
</view>
<view class="tag">
桌布租赁
</view>
</view>
<view class="time">
9:00-18:00
</view>
<view class="address">
长沙市天心区桂花坪街道231号
</view>
</view>
<view class="btns">
<view class="btn"
@click="$utils.navigateTo('/pages_order/auth/wxUserInfo')">
我要水洗
</view>
</view>
<view class="tips">
关联门店主信门店
</view>
</view>
<view class="productList">
<productList/>
</view>
</view>
<!-- <selectArea ref="selectArea" @close="closeAreaPro" @select="selectArea"></selectArea> -->
<PrivacyAgreementPoup/> <PrivacyAgreementPoup/>
<tabber select="home"/> <tabber select="home"/>


+ 150
- 0
pages_order/author/editor.vue View File

@ -0,0 +1,150 @@
<template>
<view class="page">
<navbar title="1531字"
leftClick @leftClick="$utils.navigateBack"/>
<view class="title">
<input type="text"
placeholder="请输入章节标题"
v-model="form.title"/>
</view>
<editor id="editor"
class="ql-container"
placeholder="请输入正文..."
@statuschange="onStatusChange"
@input="onInput"
@ready="onEditorReady">
</editor>
<view class="plus">
发布
</view>
</view>
</template>
<script>
export default {
data() {
return {
formats: {},
form : {
title : '',
},
}
},
onLoad() {
},
methods: {
onInput(e){
console.log(e.detail);
},
onEditorReady() {
uni.createSelectorQuery().select('#editor').context((res) => {
this.editorCtx = res.context
}).exec()
},
undo() {
this.editorCtx.undo()
},
redo() {
this.editorCtx.redo()
},
format(e) {
let {
name,
value
} = e.target.dataset
if (!name) return
// console.log('format', name, value)
this.editorCtx.format(name, value)
},
onStatusChange(e) {
const formats = e.detail
this.formats = formats
},
insertDivider() {
this.editorCtx.insertDivider({
success: function() {
console.log('insert divider success')
}
})
},
clear() {
uni.showModal({
title: '清空编辑器',
content: '确定清空编辑器全部内容?',
success: res => {
if (res.confirm) {
this.editorCtx.clear({
success: function(res) {
console.log("clear success")
}
})
}
}
})
},
removeFormat() {
this.editorCtx.removeFormat()
},
insertDate() {
const date = new Date()
const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
this.editorCtx.insertText({
text: formatDate
})
},
insertImage() {
uni.chooseImage({
count: 1,
success: (res) => {
this.editorCtx.insertImage({
src: res.tempFilePaths[0],
alt: '图像',
success: function() {
console.log('insert image success')
}
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.page{
font-size: 32rpx;
.title{
padding: 30rpx;
background-color: #fff;
margin: 10rpx 0;
input{
}
}
.ql-container{
background-color: #fff;
padding: 30rpx;
width: 100%;
box-sizing: border-box;
min-height: calc(100vh - 300rpx);
line-height: 50rpx;
}
.plus{
background-color: $uni-color;
color: #fff;
position: fixed;
right: 20rpx;
top: 40%;
width: 100rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 25rpx;
}
}
</style>

Loading…
Cancel
Save