leisure-core 0.4.16 → 0.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,9 @@
22
22
  ></el-option>
23
23
  </el-select>
24
24
  </el-form-item>
25
+ <el-form-item label="手机号">
26
+ <el-input v-model="searchData.phone" placeholder="手机号"></el-input>
27
+ </el-form-item>
25
28
  <el-form-item
26
29
  ><el-button type="primary" @click="list">查询</el-button></el-form-item
27
30
  >
@@ -48,6 +51,12 @@
48
51
  show-overflow-tooltip
49
52
  tooltip-effect="dark"
50
53
  ></el-table-column>
54
+ <el-table-column
55
+ prop="phone"
56
+ label="用户手机号"
57
+ show-overflow-tooltip
58
+ tooltip-effect="dark"
59
+ ></el-table-column>
51
60
  <el-table-column prop="oid" label="使用的订单id">
52
61
  <template slot-scope="scope">
53
62
  {{ scope.row.status == 1 ? scope.row.oid : "" }}
@@ -56,7 +65,7 @@
56
65
  <el-table-column prop="title" label="优惠券标题"></el-table-column>
57
66
  <el-table-column prop="caption" label="优惠券描述"></el-table-column>
58
67
  <el-table-column
59
- prop="cdate"
68
+ prop="date_start"
60
69
  label="领用时间"
61
70
  show-overflow-tooltip
62
71
  tooltip-effect="dark"
@@ -65,6 +74,8 @@
65
74
  <el-table-column
66
75
  prop="udate"
67
76
  label="使用时间"
77
+ show-overflow-tooltip
78
+ tooltip-effect="dark"
68
79
  :formatter="dateFormatter"
69
80
  ></el-table-column>
70
81
  <el-table-column
@@ -76,10 +87,7 @@
76
87
  ></el-table-column>
77
88
  <el-table-column label="是否已经使用">
78
89
  <template slot-scope="scope">
79
- <span v-if="scope.row.status == 0">未使用</span>
80
- <span v-if="scope.row.status == 1">已经使用</span>
81
- <span v-if="scope.row.status == 2">已经过期</span>
82
- <span v-if="scope.row.status == 3">已经作废</span>
90
+ <span>{{ currentStatus(scope.row) }}</span>
83
91
  </template>
84
92
  </el-table-column>
85
93
  <el-table-column prop="note" label="备注"></el-table-column>
@@ -98,6 +106,7 @@
98
106
  </template>
99
107
  <script>
100
108
  import moment from "moment";
109
+ import dayjs from "dayjs";
101
110
  import { listByUid } from "@/api/coupon";
102
111
  export default {
103
112
  name: "le-coupon-details",
@@ -111,6 +120,7 @@ export default {
111
120
  total: 1,
112
121
  date_end: "",
113
122
  date_start: "",
123
+ phone: "",
114
124
  },
115
125
  timeArr: "",
116
126
  status: 0,
@@ -132,6 +142,24 @@ export default {
132
142
  dateFormatter(row, column, cellValue, index) {
133
143
  if (cellValue) return moment.unix(cellValue).format("YYYY-MM-DD HH:mm");
134
144
  },
145
+ currentStatus(item) {
146
+ let status = item.status;
147
+ let date_end = item.date_end;
148
+ let now = dayjs().unix();
149
+ if (now > date_end) {
150
+ return "已经过期";
151
+ } else if (status == 0) {
152
+ return "未使用";
153
+ } else if (status == 1) {
154
+ return "已经使用";
155
+ } else if (status == 3) {
156
+ return "已经作废";
157
+ } else if (status == 2) {
158
+ return "已经过期";
159
+ } else {
160
+ return "未知状态";
161
+ }
162
+ },
135
163
  current_change(currentPage) {
136
164
  this.searchData.pageNo = currentPage;
137
165
  this.list();
@@ -59,15 +59,15 @@
59
59
  </el-col>
60
60
  </el-row>
61
61
  </el-form-item>
62
- <el-form-item v-if="false" label="优惠券有效期" prop="period">
62
+ <el-form-item label="优惠券有效期" prop="period">
63
63
  <el-row>
64
64
  <el-input-number
65
65
  v-model="form.period"
66
- :min="1"
66
+ :min="30"
67
67
  :max="9999"
68
68
  label="描述文字"
69
69
  ></el-input-number>
70
- <span style="margin-left: 6px">单位:天</span>
70
+ <span style="margin-left: 6px">单位:天(默认30天内有效)</span>
71
71
  </el-row>
72
72
  </el-form-item>
73
73
  <!-- <el-form-item label="优惠券使用范围" prop="rang">
@@ -359,4 +359,4 @@ export default {
359
359
  height: calc(100vh - 130px);
360
360
  overflow: auto;
361
361
  }
362
- </style>
362
+ </style>
@@ -18,6 +18,9 @@
18
18
  </el-option>
19
19
  </el-select>
20
20
  </el-form-item>
21
+ <el-form-item label="赠送原因" prop="source">
22
+ <el-input v-model="ruleForm.source"></el-input>
23
+ </el-form-item>
21
24
  <el-form-item v-rfooter>
22
25
  <el-button type="info" @click="close()">取消</el-button>
23
26
  <el-button type="primary" @click="save">保存</el-button>
@@ -37,15 +40,27 @@ export default {
37
40
  type: String,
38
41
  default: "",
39
42
  },
43
+ phone: {
44
+ type: String,
45
+ default: "",
46
+ },
40
47
  },
41
48
  data() {
42
49
  return {
43
50
  coupons: [],
44
51
  ruleForm: {
45
52
  cid: "",
53
+ source: "",
46
54
  },
47
55
  rules: {
48
56
  cid: [{ required: true, message: "必须选择优惠券", trigger: "blur" }],
57
+ source: [
58
+ {
59
+ max: 150,
60
+ message: "长度在 1 到 150个字符",
61
+ trigger: "blur",
62
+ },
63
+ ],
49
64
  },
50
65
  };
51
66
  },
@@ -70,7 +85,8 @@ export default {
70
85
  couponId: this.ruleForm.cid,
71
86
  uid: this.uid,
72
87
  unionid: this.unionid,
73
- source: "后台赠送优惠券",
88
+ phone: this.phone,
89
+ source: "后台赠送优惠券" + this.ruleForm.source,
74
90
  };
75
91
  sendCoupons(params)
76
92
  .then((res) => {
@@ -159,6 +159,7 @@
159
159
  v-if="showYhj"
160
160
  :uid="currentUser.id"
161
161
  :unionid="currentUser.unionid"
162
+ :phone="currentUser.phone"
162
163
  @close="cancelShowYhj"
163
164
  ></le-coupon-give>
164
165
  </le-dialog-container>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "description": "leisure-core是leisure-ui-core的简称,是京心数据基于vue2.0开发的一套后台系统框架与js库,包含登录,首页框架等",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",