【前端】云工厂的纸掌柜app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
3.8 KiB

<template>
<view class="store-setting">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="store-setting-title">店铺设置</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="store-setting-main">
<view class="store-setting-name"><text>店铺名称</text></view>
<view class="">
<qn-easyinput
class="store-setting-textArea"
:maxlength="100"
:styles="{ disableColor: '#F7F8FA' }"
v-model="storeName"
:inputBorder="false"
type="textarea"
placeholder="请输入店铺名称"
></qn-easyinput>
</view>
<view class="store-log">
<view class="tore-setting-name"><text>店铺logo</text></view>
<view class="store-log store-image-flex">
<uni-file-picker
class="stotr-image-width"
v-model="imageValue"
file-mediatype="image"
mode="grid"
file-extname="png,jpg"
:limit="1"
:image-styles="imageStyles"
@progress="progress"
@success="success"
@fail="fail"
@select="select"
@delete="deleteImage"
/>
<view class="store-image-text ">建议尺寸:200*200像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view>
</view>
</view>
<view class="store-log">
<view class="tore-setting-name"><text>背景图片</text></view>
<view class="store-log store-image-flex">
<uni-file-picker class="stotr-image-widtht" :limit="1" fileMediatype="image" :image-styles="imageStylest" />
<view class="store-image-text">建议尺寸:750*370像素,尺寸不匹配时,图片将被压缩或拉伸以铺满画面</view>
</view>
</view>
</view>
<view class="">
<view class="upload-btn"><button type="primary" class="btn-class">保存设置</button></view>
</view>
</view>
</template>
<script>
import { back, go2 } from '@/utils/hook.js'
export default {
data() {
return {
storeName: '',
imageValue: [],
imageStyles: {
width: 100,
height: 100,
border: {
color: '#f1f1f1',
width: 1,
style: 'dashed',
radius: '4rpx'
}
},
imageStylest: {
width: 183,
height: 94,
border: {
color: '#f1f1f1',
width: 1,
style: 'dashed',
radius: '4rpx'
}
}
}
},
methods: {
back,
// 上传进度
progress() {},
// 上传成功回调
success(item) {
console.log(item)
},
// 上传失败回调
fail(item) {
console.log(item)
},
// 图片选择事件
select(item) {
console.log(item)
console.log(this.imageValue)
this.imageValue.push(item.tempFiles[0])
},
// 删除图片
deleteImage(item) {
console.log('deleteImage', item)
for (let i = 0; i < this.imageValue.length; i++) {
if (this.imageValue[i].uuid === item.tempFile.uuid) {
this.imageValue.splice(i, 1)
}
}
console.log(this.imageValue)
}
}
}
</script>
<style lang="scss">
.store-setting {
background-color: #FFFFFF;
.store-setting-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.store-setting-main {
padding: 20rpx 32rpx;
background-color: #ffffff;
}
.store-setting-name {
// font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 500;
}
.store-setting-textArea {
background: #f7f8fa;
border-radius: 20rpx;
padding: 10rpx;
margin-top: 20rpx;
}
.store-log {
margin-top: 32rpx;
}
.store-image-flex{
display: flex;
}
.store-image-text {
font-size: 24rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
line-height: 40rpx;
margin-left: 10rpx;
}
.stotr-image-widtht{
width: 100%;
}
.stotr-image-width{
width: 50%;
}
.upload-btn{
position: absolute;
width: 92%;
bottom: 32rpx;
left: 32rpx;
}
}
</style>