doum
3 天以前 5d3b86a4d0032836c782e5e1319179eced5e5647
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<template>
    <view class="activity-container">
        <view class="base-message">
            <view class="message-item">
                <view class="logo">
                    <view class="label">活动图片</view>
                    <text class="label-tip">上传png/jpg格式图片,建议尺寸:800*800px</text>
                </view>
                <view class="message-value">
                    <uni-file-picker limit="9">
                    </uni-file-picker>
                </view>
            </view>
            <view class="message-item">
                <view class="label">活动名称</view>
                <view class="message-value">
                    <input
                        :inputBorder="false"
                        v-model="form.realName"
                        placeholderStyle="color:#ccc; font-size: 30rpx;"
                        placeholder="请输入活动名称" />
                </view>
            </view>
            <view class="message-item">
                <view class="label">活动类型</view>
                <view class="message-value" @click="$refs.activityType.open()">
                    <text :class="form.activityType?'':'un-select'">{{ form.activityType||'请选择活动类型' }}</text>
                    <uni-icons type="right" size="22" color="#CCCCCC"></uni-icons>
                </view>
            </view>
            <view class="message-item">
                <view class="label">活动时间</view>
                <view class="message-value"  @click="picker">
                    <text :class="form.startDate?'':'un-select'">{{ form.startDate ? `${form.startDate}~${form.endDate}`:'开始时间-结束时间' }}</text>
                    <uni-icons type="right" size="22" color="#CCCCCC"></uni-icons>
                </view>
            </view>
            <view class="message-item">
                <view class="label">报名时间</view>
                <view class="message-value"  @click="pickerApply">
                    <text :class="form.startApplyDate?'':'un-select'">{{ form.startApplyDate ? `${form.startApplyDate}~${form.endApplyDate}`:'开始时间-结束时间' }}</text>
                    <uni-icons type="right" size="22" color="#CCCCCC"></uni-icons>
                </view>
            </view>
            <view class="message-item">
                <view class="label">活动地址</view>
                <view class="message-value" @click="selectAddress">
                    <text :class="form.address?'':'un-select'">{{ form.address||'请选择地址' }}</text>
                    <uni-icons type="right" size="22" color="#CCCCCC"></uni-icons>
                </view>
            </view>
            <view class="message-item">
                <view class="label">人员上限</view>
                <view class="message-value">
                    <input
                        :inputBorder="false"
                        type="number"
                        v-model="form.numLimt"
                        placeholderStyle="color:#ccc; font-size: 30rpx;"
                        placeholder="0" />
                </view>
            </view>
            <view class="message-item">
                <view class="label">人员上限</view>
                <view class="message-value">
                    ¥
                    <input
                        :inputBorder="false"
                        type="number"
                        v-model="form.numLimt"
                        placeholderStyle="color:#ccc; font-size: 30rpx;"
                        placeholder="0" />
                </view>
            </view>
            <view class="parting"></view>
            <view class="bran-story">
                <view class="label">活动详情</view>
                <uni-easyinput
                    :inputBorder="false"
                    v-model="form.content"
                    :maxlength="500"
                    autoHeight
                    placeholder="请输入"
                    type="textarea"
                />
                <uni-file-picker limit="9">
                </uni-file-picker>
            </view>
            <view class="next-btn" @click="save">发布活动</view>
            <view class="safe-area"></view>
        </view>
        <activityType ref="activityType" :activityTypes="activityTypes" @updata="updataType" />
        <view class="pickers" style="">
            <uni-datetime-picker ref="activityTime"  @change="change" type="datetimerange" rangeSeparator="至" />
            <uni-datetime-picker ref="activityApplyTime"  @change="applyChange" type="datetimerange" rangeSeparator="至" />
        </view>
    </view>
</template>
 
<script>
    import activityType from "@/components/merchant/activityType.vue"
    export default {
        components: { activityType },
        data() {
            return {
                form: {
                    activityType: '',
                    datetimerange: '',
                    startDate: '',
                    endDate: '',
                    startApplyDate: '',
                    endApplyDate: '',
                    address: '',
                    numLimt: '',
                },
                activityTypes: ['2131', 'dsada']
            };
        },
        onLoad(props) {
            console.log(props);
            if (props.title) {
                uni.setNavigationBarTitle({
                    title: props.title
                });
            }
        },
        methods: {
            updataType(v) {
                this.form.activityType = v
            },
            picker() {
                this.$refs.activityTime.show()
            },
            pickerApply() {
                this.$refs.activityApplyTime.show()
            },
            change(v) {
                console.log(v);
                thi.form.startDate = v[0]
                thi.form.endDate = v[1]
            },
            applyChange(v) {
                console.log(v);
                thi.form.startApplyDate = v[0]
                thi.form.endApplyDate = v[1]
            },
            selectAddress() {
                uni.navigateTo({
                    url: '/pages/selectLocation/selectLocation'
                })
            },
            save() {
                
            }
        }
        
    }
</script>
 
<style lang="scss" scoped>
.activity-container {
    height: 100%;
    background-color: #fff;
    overflow-y: scroll;
    overflow-x: hidden;
}
.base-message {
    background-color: #FFFFFF;
    padding: 20rpx 32rpx;
    box-sizing: border-box;
    width: 100%;
    .message-item {
        // height: 148rpx;
        padding: 30rpx 0;
        box-sizing: border-box;
        border-bottom: 2rpx solid #F4F5F4;
        .logo {
            display: flex;
            .label-tip {
                height: 36rpx;
                font-size: 24rpx;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #999999;
                line-height: 36rpx;
            }
        }
        .label {
            line-height: 30rpx;
            height: 30rpx;
            font-size: 30rpx;
            font-weight: 500;
            margin-bottom: 24rpx;
            // &::after {
            //     content: ' *';
            //     color: #D20A0A;
            // }
        }
        .message-value {
            line-height: 30rpx;
            font-size: 30rpx;
            display: flex;
            justify-content: space-between;
            input {
                flex: 1;
            }
            .un-select {
                font-size: 28rpx;
                color: #CCCCCC;
            }
            .labels {
                flex: 1;
                display: flex;
                flex-wrap: wrap;
                .label-item {
                    padding: 10rpx 12rpx;
                    background: rgba(210,10,10,0.1);
                    border-radius: 4rpx;
                    font-size: 24rpx;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #D20A0A;
                    line-height: 24rpx;
                    margin-right: 12rpx;
                    margin-bottom: 12rpx;
                }
            }
        }
    }
}
.parting {
    background: #f7f7f7;
    height: 16rpx;
    width: 120%;
    margin-left:-33rpx;
}
.bran-story {
    padding-top: 44rpx;
    border-bottom: 2rpx solid #F4F5F4;
    .label {
        line-height: 30rpx;
        height: 30rpx;
        font-size: 30rpx;
        font-weight: 500;
        margin-bottom: 24rpx;
    }
}
.next-btn {
    height: 72rpx;
    margin: 126rpx 56rpx 0;
    background: linear-gradient(270deg, #D20A0A 0%, #D95A5A 100%);
    border-radius: 36rpx 36rpx 36rpx 36rpx;
    color: #FFFFFF;
    line-height: 72rpx;
    text-align: center;
}
.save-btn {
    padding-bottom: env(safe-area-inset-bottom);
    
}
.safe-area {
    height: env(safe-area-inset-bottom);
    padding: 20rpx;
}
.pickers {
    position: fixed;
    bottom: -300rpx;
    z-index:9999;
}
/deep/ .uni-calendar-item--checked {
    background-color: #D20A0A!important;
}
/deep/ .uni-calendar-item--multiple .uni-calendar-item--before-checked, .uni-calendar-item--multiple .uni-calendar-item--after-checked {
    background-color: #D20A0A!important;
}
/deep/ .uni-datetime-picker--btn {
    background: linear-gradient(270deg, #D20A0A 0%, #D95A5A 100%);
}
</style>