createActive.vue 6.08 KB
Newer Older
xd's avatar
xd committed
1
<template>
xd's avatar
xd committed
2
  <div class="container">
xd's avatar
xd committed
3
    <div class="title">基础设置</div>
xd's avatar
xd committed
4
    <van-cell-group class="all">
xd's avatar
xd committed
5 6 7 8 9
      <van-cell title="活动标题" style="font-size:14px;">
        <template slot="default" >
          <van-field v-model="title" placeholder="请输入活动标题" class="right" style="font-size:14px;" />
        </template>
      </van-cell>
xd's avatar
xd committed
10 11
      <van-cell title="消费后领券" style="font-size:14px;">
        <template slot="default">
xd's avatar
xd committed
12
          <van-switch v-model="coupon" size="20px"  class="right"  />
xd's avatar
xd committed
13 14 15 16
        </template>
      </van-cell>
      <van-cell title="新客专享" style="font-size:14px;">
        <template slot="default">
xd's avatar
xd committed
17
          <van-switch v-model="newCustomer" size="20px"  class="right"  />
xd's avatar
xd committed
18 19 20 21 22 23 24 25 26 27
        </template>
      </van-cell>
      <van-cell title="领券条件" style="font-size:14px;">
        <template slot="default">
          <span class="phone">手机号必填</span>
          <van-switch v-model="condition" size="20px" />
        </template>
      </van-cell>
    </van-cell-group>
    <div class="title">券设置</div>
xd's avatar
xd committed
28
    <van-cell-group class="all">
xd's avatar
xd committed
29 30 31 32 33
      <van-cell title="活动标题" style="font-size:14px;">
        <template slot="default">
          <van-field v-model="title2" placeholder="请输入活动标题"  class="right" style="font-size:14px;" />
        </template>
      </van-cell>
xd's avatar
xd committed
34 35
      <van-cell title="券类型" style="font-size:14px;">
        <template slot="default">
xd's avatar
xd committed
36
          <van-radio-group v-model="type"  class="right" >
xd's avatar
xd committed
37 38 39 40 41 42 43 44
            <van-radio name="1" style="float:left;">代金券</van-radio>
            <van-radio name="2" style="float:right;">折扣券</van-radio>
          </van-radio-group>
        </template>
      </van-cell>
      <van-cell title="代金券金额" style="font-size:14px;">
        <template slot="default">
          <van-field
xd's avatar
xd committed
45
            class="right noborder"
xd's avatar
xd committed
46 47 48
            readonly
            clickable
            :value="cashCoupon"
xd's avatar
xd committed
49
            placeholder="输入代金券金额"
xd's avatar
xd committed
50 51 52 53 54 55 56 57 58 59 60 61 62
            @touchstart.native.stop="show = true"
          />
          <van-number-keyboard
            v-model="cashCoupon"
            :show="show"
            :maxlength="6"
            @blur="show = false"
          />
        </template>
      </van-cell>
      <van-cell title="使用门槛" style="font-size:14px;">
        <template slot="default">
          <van-field
xd's avatar
xd committed
63
            class="right noborder"
xd's avatar
xd committed
64 65 66
            readonly
            clickable
            :value="limit"
xd's avatar
xd committed
67
             placeholder="输入使用门槛"
xd's avatar
xd committed
68 69 70 71 72 73 74 75 76 77
            @touchstart.native.stop="show2 = true"
          />
          <van-number-keyboard
            v-model="limit"
            :show="show2"
            :maxlength="6"
            @blur="show2 = false"
          />
        </template>
      </van-cell>
xd's avatar
xd committed
78 79 80 81 82
      <van-cell title="活动开始时间" style="font-size:14px;">
        <template slot="default">
          <van-field
            class="right"
            v-model="startTime1"
xd's avatar
xd committed
83
            placeholder="选择活动开始时间" readonly="readonly"
xd's avatar
xd committed
84 85 86 87 88 89 90 91 92
            @click="startShow = true"
          />
          <van-popup v-model="startShow"  position="bottom" :overlay="true">
            <van-datetime-picker
              v-model="startTime"
              type="datetime"
              @cancel="startShow = false"
              @confirm="startShow = false"
              @change="startTimeChange"
xd's avatar
xd committed
93
            />
xd's avatar
xd committed
94
          </van-popup>
xd's avatar
xd committed
95 96 97 98
        </template>
      </van-cell>
      <van-cell title="活动结束时间" style="font-size:14px;">
        <template slot="default">
xd's avatar
xd committed
99 100 101 102 103
          <van-field
            class="right"
            v-model="endTime1"
            placeholder="选择活动结束时间" readonly="readonly"
            @click="endShow = true"
xd's avatar
xd committed
104
          />
xd's avatar
xd committed
105 106 107 108 109 110 111 112 113
          <van-popup v-model="endShow"  position="bottom" :overlay="true">
            <van-datetime-picker
              v-model="endTime"
              type="datetime"
              @cancel="endShow = false"
              @confirm="endShow = false"
              @change="endTimeChange"
            />
          </van-popup>
xd's avatar
xd committed
114 115
        </template>
      </van-cell>
xd's avatar
xd committed
116 117 118 119 120 121 122 123 124 125
      <div class="des">描述</div>   
      <van-field
        class="area"
        v-model="message"
        rows="2"
        autosize
        type="textarea"
        placeholder="请输入描述"
        show-word-limit
      />
xd's avatar
xd committed
126
    </van-cell-group>
xd's avatar
xd committed
127
    <div class="creat">创建活动</div>
xd's avatar
xd committed
128 129 130 131 132 133 134
  </div>
</template>

<script>
export default {
  data() {
    return {
xd's avatar
xd committed
135 136
      title: "",
      title2: "",
xd's avatar
xd committed
137 138 139 140 141 142 143 144
      coupon: "",
      newCustomer: "",
      condition: "",
      type: "",
      show: false,
      show2: false,
      cashCoupon: "",
      limit: "",
xd's avatar
xd committed
145 146 147 148 149 150 151 152
      startTime: new Date(),
      startTime1: "",
      endTime: "",
      endTime1: "",
      startShow: false,
      endShow: false,
      message: "",
      
xd's avatar
xd committed
153 154 155
    };
  },
  methods: {
xd's avatar
xd committed
156 157 158
    startTimeChange(e) {
      let startTimeArr = e.getValues()
      this.startTime1 = `${startTimeArr[0]}-${startTimeArr[1]}-${startTimeArr[2]}  ${startTimeArr[3]}:${startTimeArr[4]}:00`
xd's avatar
xd committed
159
    },
xd's avatar
xd committed
160 161 162
    endTimeChange(e) {
      let endTimeArr = e.getValues()
      this.endTime1 = `${endTimeArr[0]}-${endTimeArr[1]}-${endTimeArr[2]}  ${endTimeArr[3]}:${endTimeArr[4]}:00`
xd's avatar
xd committed
163
    }
xd's avatar
xd committed
164 165
  },
  mounted() {
xd's avatar
xd committed
166 167 168 169
  }
};
</script>
<style>
xd's avatar
xd committed
170

xd's avatar
xd committed
171 172
</style>

xd's avatar
xd committed
173 174 175 176 177 178 179
<style  scoped>
.all >>> input {
  text-align: right;
}
.noborder >>> .van-cell:not(:last-child)::after {
  display: none !important;
}
xd's avatar
xd committed
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
.noborder .van-cell:not(:last-child)::after{
  border: 0px solid red !important;
}
.creat {
  margin-top: 80px;
  width:96%;
  height:40px;
  background:rgba(117,178,253,1);
  border-radius:10px;
  text-align: center;
  line-height: 40px;
  font-size:16px;
  font-weight:bold;
  color: #fff;
  margin-left: 2%;
xd's avatar
xd committed
195
  margin-bottom: 16px;
xd's avatar
xd committed
196 197 198 199 200 201 202 203 204 205 206
}
.container {
  background:rgba(248,248,248,1);
}
.van-field__body textarea {
  background:rgba(248,248,248,1);
}
.des {
  padding: 6px 16px;
  font-size: 14px;
}
xd's avatar
xd committed
207

xd's avatar
xd committed
208 209
.phone {
  float: left;
xd's avatar
xd committed
210

xd's avatar
xd committed
211 212 213 214 215 216 217 218 219
}
.title {
  background-color: #f8f8f8;
  height: 36px;
  line-height: 36px;
  font-size: 12px;
  padding-left: 16px;
  color: #2d476a;
}
xd's avatar
xd committed
220 221 222 223 224 225 226 227
[data-v-08d4afe1] .van-cell {
  height: 100%;
  font-size: 14px;
}
.right {
  padding: 0;
  
}
xd's avatar
xd committed
228
</style>