Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
|
1b325ab090 | 7 months ago |
|
3732848a77 | 7 months ago |
|
e153d434a4 | 8 months ago |
|
60dcdec97d | 8 months ago |
|
968e0eb975 | 8 months ago |
|
4842173222 | 10 months ago |
|
2bd0b8f26d | 1 year ago |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.7 KiB |
@ -1,191 +1,265 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-container">
|
<view class="app-container">
|
||||||
<u-navbar
|
<u-navbar leftText="返回" title="新增店铺活动" :autoBack="true" :placeholder="true" />
|
||||||
leftText="返回"
|
<view class="form-item">
|
||||||
title="新增店铺活动"
|
<view class="form-title">
|
||||||
:autoBack="true"
|
活动名称
|
||||||
:placeholder="true"
|
<text></text>
|
||||||
/>
|
</view>
|
||||||
<view class="form-item">
|
<view class="item-input view-global">
|
||||||
<view class="form-title">
|
<u--input placeholder="请输入名称" border="none" :customStyle="{ height: '45rpx' }"
|
||||||
活动名称
|
v-model="form.activeName"></u--input>
|
||||||
<text></text>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-input view-global">
|
<view class="form-item">
|
||||||
<u--input
|
<view class="form-title">
|
||||||
placeholder="请输入名称"
|
活动时间
|
||||||
border="none"
|
<text></text>
|
||||||
:customStyle="{ height: '45rpx' }"
|
</view>
|
||||||
v-model="form.activeName"
|
<view class="item-input view-global" style="
|
||||||
></u--input>
|
display: flex;
|
||||||
</view>
|
align-items: center;
|
||||||
</view>
|
justify-content: space-between;
|
||||||
<view class="form-item">
|
" @click="isCalendar = true">
|
||||||
<view class="form-title">
|
<text :style="'color:' + fColor(calendarRang)">{{
|
||||||
活动时间
|
calendarRang || "请选择日期"
|
||||||
<text></text>
|
}}</text>
|
||||||
</view>
|
<u-icon name="arrow-right" color="#D5D5D5"></u-icon>
|
||||||
<view
|
</view>
|
||||||
class="item-input view-global"
|
</view>
|
||||||
style="
|
<view class="form-item">
|
||||||
display: flex;
|
<view class="form-title">
|
||||||
align-items: center;
|
活动描述
|
||||||
justify-content: space-between;
|
<text></text>
|
||||||
"
|
</view>
|
||||||
@click="isCalendar = true"
|
<view class="item-input view-global">
|
||||||
>
|
<u--textarea v-model="form.activeContent" placeholder="请输入内容" border="none"></u--textarea>
|
||||||
<text :style="'color:' + fColor(calendarRang)">{{
|
</view>
|
||||||
calendarRang || "请选择日期"
|
</view>
|
||||||
}}</text>
|
<view class="form-item">
|
||||||
<u-icon name="arrow-right" color="#D5D5D5"></u-icon>
|
<view class="form-title">
|
||||||
</view>
|
活动地点
|
||||||
</view>
|
<text></text>
|
||||||
<view class="form-item">
|
</view>
|
||||||
<view class="form-title">
|
<view class="item-input view-global">
|
||||||
活动内容
|
<u--input placeholder="请输入活动地点" border="none" :customStyle="{ height: '45rpx' }"
|
||||||
<text></text>
|
v-model="form.activePoint"></u--input>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-input view-global">
|
</view>
|
||||||
<u--textarea
|
<!-- <view class="form-item">
|
||||||
v-model="form.activeContent"
|
<view class="form-title">
|
||||||
placeholder="请输入内容"
|
参与条件
|
||||||
border="none"
|
<text></text>
|
||||||
></u--textarea>
|
</view>
|
||||||
</view>
|
<view class="item-input view-global">
|
||||||
</view>
|
<u--textarea v-model="form.joinRequire" placeholder="请输入内容" border="none"></u--textarea>
|
||||||
<view class="form-item">
|
</view>
|
||||||
<view class="form-title">
|
</view> -->
|
||||||
活动地点
|
<view class="form-item">
|
||||||
<text></text>
|
<view class="form-title">
|
||||||
</view>
|
上传附件
|
||||||
<view class="item-input view-global">
|
<text></text>
|
||||||
<u--input
|
</view>
|
||||||
placeholder="请输入活动地点"
|
<view class="item-input view-global">
|
||||||
border="none"
|
<view class="" @click="openFile" v-show="!fileName">
|
||||||
:customStyle="{ height: '45rpx' }"
|
点击上传
|
||||||
v-model="form.activePoint"
|
</view>
|
||||||
></u--input>
|
<view class="view-globalFell" v-show="fileName">
|
||||||
</view>
|
<view class="fileName">
|
||||||
</view>
|
{{fileName}}
|
||||||
<view class="form-item">
|
</view>
|
||||||
<view class="form-title">
|
<view class="fileNamedelet" @click="fileName = ''">
|
||||||
参与条件
|
删除
|
||||||
<text></text>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-input view-global">
|
</view>
|
||||||
<u--textarea
|
</view>
|
||||||
v-model="form.joinRequire"
|
<fixed-buttom title="提交" @click="handleAdd"></fixed-buttom>
|
||||||
placeholder="请输入内容"
|
|
||||||
border="none"
|
<!-- 日历 -->
|
||||||
></u--textarea>
|
<u-calendar :show="isCalendar" :mode="mode" @confirm="onCalendar" @close="onCloseCalendar"></u-calendar>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
<fixed-buttom title="提交" @click="handleAdd"></fixed-buttom>
|
|
||||||
|
<script>
|
||||||
<!-- 日历 -->
|
import {
|
||||||
<u-calendar
|
addActivity
|
||||||
:show="isCalendar"
|
} from "../../api/jn/apply";
|
||||||
:mode="mode"
|
|
||||||
@confirm="onCalendar"
|
export default {
|
||||||
@close="onCloseCalendar"
|
data() {
|
||||||
></u-calendar>
|
return {
|
||||||
</view>
|
form: {},
|
||||||
</template>
|
fileName: "",
|
||||||
|
isCalendar: false,
|
||||||
<script>
|
calendarRang: "",
|
||||||
import { addActivity } from "../../api/jn/apply";
|
mode: "range",
|
||||||
|
fileWhiteList: ['txt', 'doc', 'docx', 'xls', 'xlsx', 'pdf', ]
|
||||||
export default {
|
};
|
||||||
data() {
|
},
|
||||||
return {
|
onLoad() {
|
||||||
form: {},
|
this.reset();
|
||||||
isCalendar: false,
|
},
|
||||||
calendarRang: "",
|
methods: {
|
||||||
mode: "range",
|
// 表单重置
|
||||||
};
|
reset() {
|
||||||
},
|
this.form = {
|
||||||
onLoad() {
|
id: null,
|
||||||
this.reset();
|
activeName: null,
|
||||||
},
|
activeStart: null,
|
||||||
methods: {
|
activeEnd: null,
|
||||||
// 表单重置
|
activeContent: null,
|
||||||
reset() {
|
activePoint: null,
|
||||||
this.form = {
|
joinRequire: null,
|
||||||
id: null,
|
activeState: 1,
|
||||||
activeName: null,
|
createId: null,
|
||||||
activeStart: null,
|
createBy: null,
|
||||||
activeEnd: null,
|
createTime: null,
|
||||||
activeContent: null,
|
updateId: null,
|
||||||
activePoint: null,
|
updateBy: null,
|
||||||
joinRequire: null,
|
updateTime: null,
|
||||||
activeState: 1,
|
remark: null,
|
||||||
createId: null,
|
gridId: null,
|
||||||
createBy: null,
|
gridName: null,
|
||||||
createTime: null,
|
partId: null,
|
||||||
updateId: null,
|
partName: null,
|
||||||
updateBy: null,
|
};
|
||||||
updateTime: null,
|
},
|
||||||
remark: null,
|
onCloseCalendar() {
|
||||||
gridId: null,
|
this.isCalendar = false;
|
||||||
gridName: null,
|
},
|
||||||
partId: null,
|
onCalendar(e) {
|
||||||
partName: null,
|
console.log(e);
|
||||||
};
|
this.calendarRang = `${e[0]}——${e[e.length - 1]}`;
|
||||||
},
|
this.form.activeStart = e[0];
|
||||||
onCloseCalendar() {
|
this.form.activeEnd = e[e.length - 1];
|
||||||
this.isCalendar = false;
|
this.isCalendar = false;
|
||||||
},
|
},
|
||||||
onCalendar(e) {
|
handleAdd() {
|
||||||
console.log(e);
|
console.log(this.form);
|
||||||
this.calendarRang = `${e[0]}——${e[e.length - 1]}`;
|
addActivity(this.form).then((response) => {
|
||||||
this.form.activeStart = e[0];
|
uni.navigateBack({
|
||||||
this.form.activeEnd = e[e.length - 1];
|
delta: 1,
|
||||||
this.isCalendar = false;
|
});
|
||||||
},
|
});
|
||||||
handleAdd() {
|
},
|
||||||
console.log(this.form);
|
fColor(calendarRang) {
|
||||||
addActivity(this.form).then((response) => {
|
return calendarRang ? "#2e2f31" : "#c0c4cc";
|
||||||
uni.navigateBack({
|
},
|
||||||
delta: 1,
|
//上传2
|
||||||
});
|
// 打开文件选择器
|
||||||
});
|
openFile() {
|
||||||
},
|
uni.chooseFile({
|
||||||
fColor(calendarRang) {
|
count: 1, //默认100
|
||||||
return calendarRang ? "#2e2f31" : "#c0c4cc";
|
extension: ['.zip', '.doc', '.xls', '.pdf', 'docx', '.rar', '.7z', '.jpg', '.png', '.jpeg'],
|
||||||
},
|
success: (res) => {
|
||||||
},
|
console.log(res);
|
||||||
};
|
if (res.tempFiles[0].size / 1024 / 1024 > 20) {
|
||||||
</script>
|
this.$refs.uToast.show({
|
||||||
|
title: '附件大小不能超过20M',
|
||||||
<style lang="scss" scoped>
|
type: 'warning',
|
||||||
.form-item {
|
})
|
||||||
.form-title {
|
return;
|
||||||
position: relative;
|
}
|
||||||
font-size: 30rpx;
|
this.resultPath(res.tempFilePaths[0], res.tempFiles[0].name);
|
||||||
font-weight: bold;
|
}
|
||||||
color: #2e2f31;
|
});
|
||||||
margin-bottom: 20rpx;
|
},
|
||||||
}
|
// 选取的文件路径获取后回调
|
||||||
|
resultPath(path, fileName) {
|
||||||
.form-title text {
|
console.log(path)
|
||||||
content: "";
|
console.log(fileName)
|
||||||
position: absolute;
|
uni.showLoading({
|
||||||
left: 0;
|
title: '上传中...',
|
||||||
bottom: 0;
|
});
|
||||||
height: 12rpx;
|
uni.uploadFile({
|
||||||
width: 140rpx;
|
url: "https://t-jn-bjh-admin-server.jsszkd.com/common/upload",
|
||||||
background: url("/static/images/juxing.png");
|
filePath: path,
|
||||||
background-size: cover;
|
header: {
|
||||||
max-width: 300rpx;
|
// "Authorization": "xxx",
|
||||||
z-index: 0;
|
// 'content-type':'multipart/form-data; boundary=----WebKitFormBoundaryHEdN1AIjcdUkAaXM',
|
||||||
}
|
},
|
||||||
|
formData: {
|
||||||
.item-input {
|
// 'user': 'test'
|
||||||
margin-bottom: 30rpx;
|
},
|
||||||
border-radius: 16rpx;
|
success: (uploadFileRes) => {
|
||||||
background-color: #fff;
|
let obj = JSON.parse(uploadFileRes.data);
|
||||||
box-sizing: border-box;
|
console.log(obj);
|
||||||
padding: 25rpx;
|
this.fileName = obj.originalFilename
|
||||||
}
|
this.form.joinRequire = obj.url
|
||||||
}
|
uni.showToast({
|
||||||
</style>
|
title: obj.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '上传失败',
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.form-item {
|
||||||
|
.form-title {
|
||||||
|
position: relative;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2e2f31;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-title text {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
height: 12rpx;
|
||||||
|
width: 140rpx;
|
||||||
|
background: url("/static/images/juxing.png");
|
||||||
|
background-size: cover;
|
||||||
|
max-width: 300rpx;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-input {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-globalFell {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.fileName {
|
||||||
|
max-width: 400rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
/* 不换行 */
|
||||||
|
overflow: hidden;
|
||||||
|
/* 溢出部分隐藏 */
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/* 显示省略号 */
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fileNamedelet {
|
||||||
|
width: 100rpx;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,191 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app-container">
|
||||||
|
<u-navbar
|
||||||
|
leftText="返回"
|
||||||
|
title="新增店铺活动"
|
||||||
|
:autoBack="true"
|
||||||
|
:placeholder="true"
|
||||||
|
/>
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="form-title">
|
||||||
|
活动名称
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
<view class="item-input view-global">
|
||||||
|
<u--input
|
||||||
|
placeholder="请输入名称"
|
||||||
|
border="none"
|
||||||
|
:customStyle="{ height: '45rpx' }"
|
||||||
|
v-model="form.activeName"
|
||||||
|
></u--input>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="form-title">
|
||||||
|
活动时间
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="item-input view-global"
|
||||||
|
style="
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
"
|
||||||
|
@click="isCalendar = true"
|
||||||
|
>
|
||||||
|
<text :style="'color:' + fColor(calendarRang)">{{
|
||||||
|
calendarRang || "请选择日期"
|
||||||
|
}}</text>
|
||||||
|
<u-icon name="arrow-right" color="#D5D5D5"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="form-title">
|
||||||
|
活动内容
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
<view class="item-input view-global">
|
||||||
|
<u--textarea
|
||||||
|
v-model="form.activeContent"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
border="none"
|
||||||
|
></u--textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="form-title">
|
||||||
|
活动地点
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
<view class="item-input view-global">
|
||||||
|
<u--input
|
||||||
|
placeholder="请输入活动地点"
|
||||||
|
border="none"
|
||||||
|
:customStyle="{ height: '45rpx' }"
|
||||||
|
v-model="form.activePoint"
|
||||||
|
></u--input>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="form-title">
|
||||||
|
参与条件
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
<view class="item-input view-global">
|
||||||
|
<u--textarea
|
||||||
|
v-model="form.joinRequire"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
border="none"
|
||||||
|
></u--textarea>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<fixed-buttom title="提交" @click="handleAdd"></fixed-buttom>
|
||||||
|
|
||||||
|
<!-- 日历 -->
|
||||||
|
<u-calendar
|
||||||
|
:show="isCalendar"
|
||||||
|
:mode="mode"
|
||||||
|
@confirm="onCalendar"
|
||||||
|
@close="onCloseCalendar"
|
||||||
|
></u-calendar>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addActivity } from "../../api/jn/apply";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {},
|
||||||
|
isCalendar: false,
|
||||||
|
calendarRang: "",
|
||||||
|
mode: "range",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
activeName: null,
|
||||||
|
activeStart: null,
|
||||||
|
activeEnd: null,
|
||||||
|
activeContent: null,
|
||||||
|
activePoint: null,
|
||||||
|
joinRequire: null,
|
||||||
|
activeState: 1,
|
||||||
|
createId: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateId: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null,
|
||||||
|
gridId: null,
|
||||||
|
gridName: null,
|
||||||
|
partId: null,
|
||||||
|
partName: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onCloseCalendar() {
|
||||||
|
this.isCalendar = false;
|
||||||
|
},
|
||||||
|
onCalendar(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.calendarRang = `${e[0]}——${e[e.length - 1]}`;
|
||||||
|
this.form.activeStart = e[0];
|
||||||
|
this.form.activeEnd = e[e.length - 1];
|
||||||
|
this.isCalendar = false;
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
console.log(this.form);
|
||||||
|
addActivity(this.form).then((response) => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fColor(calendarRang) {
|
||||||
|
return calendarRang ? "#2e2f31" : "#c0c4cc";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.form-item {
|
||||||
|
.form-title {
|
||||||
|
position: relative;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2e2f31;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-title text {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
height: 12rpx;
|
||||||
|
width: 140rpx;
|
||||||
|
background: url("/static/images/juxing.png");
|
||||||
|
background-size: cover;
|
||||||
|
max-width: 300rpx;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-input {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 25rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in new issue