Files
crmeb-mp/components/customForm/index.vue
karlcarlo a5c5d753b6 feat: 添加静态资源文件及基础组件
- 新增大量图片资源,包括图标、背景图、海报等,用于页面展示
- 添加字体文件及样式配置,支持自定义字体
- 引入 uni-ui 组件库,包括图标、弹窗、日期选择器等常用组件
- 添加网络状态监听、加密工具等基础工具函数
- 配置 Vuex 状态管理,包括购物车数量、热门搜索词等
- 增加页面组件,如用户协议、分销信息、提现状态等
- 配置项目构建和忽略文件,优化开发体验
2026-02-26 17:59:51 +08:00

99 lines
2.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<!-- 自定义组件 -->
<view class='wrapper card' v-if="customForm && customForm.length && isShow">
<view class='item acea-row row-between' v-for="(item,index) in customForm" :key="index" v-if="(item.value && ['uploadPicture','dateranges'].indexOf(item.name) == -1) || (item.value.length && ['uploadPicture','dateranges'].indexOf(item.name) != -1)">
<view class="title">{{item.titleConfig.value}}:</view>
<view v-if="item.name == 'uploadPicture'" class='conter'>
<view class='pictrue' v-for="(img,indexn) in item.value" :key="indexn">
<image :src='img' mode="aspectFill" @click='getCustomForm(index,indexn)'></image>
</view>
</view>
<view v-else-if="item.name == 'dateranges'" class="conter">
<text v-if="item.value.length">{{item.value[0]+'/'+item.value[1]}}</text>
</view>
<view v-else class='conter'>{{item.value}}</view>
</view>
<slot name="bottom"></slot>
</view>
</template>
<script>
export default {
name: 'customForm',
props: {
customForm:{
type: Array,
default: () => []
}
},
data() {
return {
isShow:0
};
},
watch: {
customForm (value) {
if(value && value.length){
value.forEach((item)=>{
if(item.value){
return this.isShow = 1
}
})
}
}
},
created() {},
mounted() {},
methods: {
getCustomForm: function(index,indexn) {
uni.previewImage({
urls: this.customForm[index].value,
current: this.customForm[index].value[indexn]
});
},
}
};
</script>
<style lang="scss">
.wrapper{
background-color: #fff;
margin-top: 6px;
padding: 15px;
}
.wrapper .item {
font-size: 28rpx;
color: #282828;
}
.wrapper .item .title{
width: 200rpx;
}
.wrapper .item~.item {
margin-top: 20rpx;
white-space: normal;
word-break: break-all;
word-wrap: break-word;
}
.wrapper .item .conter {
color: #868686;
width: 460rpx;
display: flex;
flex-wrap: nowrap;
justify-content: flex-end;
text-align: right;
.pictrue{
width: 80rpx;
height: 80rpx;
margin-left: 6rpx;
image{
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
}
</style>