feat: 进入店铺组件更新为单元格组件(功能更强大)

This commit is contained in:
王奥斯 2021-11-12 10:55:12 +08:00
parent 197ad80fc3
commit 67b19e027a
5 changed files with 56 additions and 14 deletions

View File

@ -427,7 +427,7 @@
}, },
{ {
"icon_id": "13455314", "icon_id": "13455314",
"name": "进入店铺", "name": "单元格",
"font_class": "jinrudianpu", "font_class": "jinrudianpu",
"unicode": "e642", "unicode": "e642",
"unicode_decimal": 58946 "unicode_decimal": 58946

View File

@ -2,10 +2,12 @@
<div class="entertheshop"> <div class="entertheshop">
<!-- 内容 --> <!-- 内容 -->
<van-cell <van-cell
icon="shop-collect-o" :icon="datas.icon"
:title="datas.shopName" :title="datas.shopName"
is-link is-link
:value="datas.copywriting" :value="datas.copywriting"
:to="datas.type==10?datas.http.externalLink:''"
:url="datas.type==11?datas.http.externalLink:''"
/> />
<!-- 删除组件 --> <!-- 删除组件 -->

View File

@ -12,13 +12,13 @@
size="small" size="small"
> >
<el-form-item <el-form-item
label="店铺名称" label="左侧标题"
:hide-required-asterisk="true" :hide-required-asterisk="true"
prop="shopName" prop="shopName"
> >
<el-input <el-input
v-model="datas.shopName" v-model="datas.shopName"
placeholder="请输入店铺名称" placeholder="请输入左侧标题"
maxlength="10" maxlength="10"
show-word-limit show-word-limit
/> />
@ -26,18 +26,31 @@
<!-- 文案 --> <!-- 文案 -->
<el-form-item <el-form-item
label="文案" label="右侧内容"
:hide-required-asterisk="true" :hide-required-asterisk="true"
prop="copywriting" prop="copywriting"
> >
<el-input <el-input
v-model="datas.copywriting" v-model="datas.copywriting"
placeholder="请输入文案" placeholder="请输入右侧内容"
maxlength="8" maxlength="8"
show-word-limit show-word-limit
/> />
</el-form-item> </el-form-item>
<el-form-item label="左侧图标">
<img :src="datas.icon" v-if="datas.icon" />
<!-- 添加导航按钮 -->
<el-button
@click="$refs.upload.showUpload()"
class="uploadImg"
type="primary"
plain
>
<i class="el-icon-plus" />点击{{datas.icon?'更换':'添加'}}图片
</el-button>
</el-form-item>
<!-- 跳转页面 --> <!-- 跳转页面 -->
<el-form-item label="跳转页面"> <el-form-item label="跳转页面">
<div class="imgText"> <div class="imgText">
@ -67,10 +80,15 @@
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 上传图片 -->
<uploadimg ref="upload" @uploadInformation="uploadInformation" />
</div> </div>
</template> </template>
<script> <script>
import uploadimg from '../../uploadImg' //
export default { export default {
name: 'entertheshopstyle', name: 'entertheshopstyle',
props: { props: {
@ -82,11 +100,10 @@ export default {
// //
shopName: [ shopName: [
// //
{ required: true, message: '请输入店铺名称', trigger: 'blur' }, { required: true, message: '请输入左侧标题', trigger: 'blur' },
], ],
copywriting: [ copywriting: [
// //
{ required: true, message: '请输入文案', trigger: 'blur' },
], ],
}, },
optionsType: [ optionsType: [
@ -101,7 +118,17 @@ export default {
], // ], //
emptyText: '', emptyText: '',
} }
} },
methods: {
//
uploadInformation(res) {
this.datas.icon = res
console.log(res)
},
},
components: {
uploadimg,
},
} }
</script> </script>
@ -132,5 +159,17 @@ export default {
width: 40%; width: 40%;
} }
} }
/* 上传图片按钮 */
.uploadImg {
width: 345px;
height: 40px;
margin-top:20px ;
}
img{
display: block;
margin: 0 auto;
width: 56px;
height: 56px;
}
} }
</style> </style>

View File

@ -108,7 +108,7 @@ export default {
name: 'storeinformation', name: 'storeinformation',
}, },
{ {
text: '进入店铺', text: '单元格',
type: '1-13', type: '1-13',
icon: 'icon-jinrudianpu', icon: 'icon-jinrudianpu',
name: 'entertheshop', name: 'entertheshop',

View File

@ -217,14 +217,15 @@ componentProperties.set('storeinformation', {
}) })
componentProperties.set('entertheshop', { componentProperties.set('entertheshop', {
component: 'entertheshop', component: 'entertheshop',
text: '进入店铺', text: '单元格',
type: '1-13', type: '1-13',
active: true, active: true,
style: 'entertheshopstyle', style: 'entertheshopstyle',
setStyle: { setStyle: {
text: '进入店铺', text: '单元格',
shopName: '店铺名称', icon: '', // 左侧图标
copywriting: '进入店铺', shopName: '左侧标题',
copywriting: '右侧内容',
type: '10', type: '10',
http: {}, http: {},
}, },