|
|
@@ -13,55 +13,107 @@
|
|
13
|
13
|
</view>
|
|
14
|
14
|
</view>
|
|
15
|
15
|
<view class="product-manger-content--tab">
|
|
16
|
|
- <tabsVue :category="dataList" :currentActive="currentActive" @tabs="tabsHandleClick"/>
|
|
|
16
|
+ <tabsVue
|
|
|
17
|
+ :category="dataList"
|
|
|
18
|
+ :currentActive="currentActive"
|
|
|
19
|
+ @tabs="tabsHandleClick"
|
|
|
20
|
+ />
|
|
17
|
21
|
</view>
|
|
18
|
22
|
</view>
|
|
19
|
23
|
<view class="product-manger-content--list">
|
|
20
|
|
- <template v-if="list.length > 0">
|
|
21
|
|
- <view class="list-card" v-for="(item, index) in list" :key="index">
|
|
22
|
|
- <view class="list-card-top">
|
|
23
|
|
- <view class="list-card-top--left">
|
|
24
|
|
- <image
|
|
25
|
|
- src="/static/images/new_ui/tianjiachanpin.png"
|
|
26
|
|
- mode="scaleToFill"
|
|
27
|
|
- @error="imgError"
|
|
28
|
|
- />
|
|
29
|
|
- </view>
|
|
30
|
|
- <view class="list-card-top--right">
|
|
31
|
|
- <view class="list-card-top--right-title"
|
|
32
|
|
- >此处显示商品名称最多一行,显示不下此处显示商品名称最多一行,显示不下</view
|
|
33
|
|
- >
|
|
34
|
|
- <view class="list-card-top--right-description">
|
|
35
|
|
- <view class="list-card-top--right-description--left">
|
|
36
|
|
- <text class="title">销量</text>
|
|
37
|
|
- <text>5000</text>
|
|
|
24
|
+ <template v-if="list.length > 0">
|
|
|
25
|
+ <view class="list-card" v-for="(item, index) in list" :key="index">
|
|
|
26
|
+ <view class="list-card-top">
|
|
|
27
|
+ <view class="list-card-top--left">
|
|
|
28
|
+ <image
|
|
|
29
|
+ v-if="item.image && !isError"
|
|
|
30
|
+ :src="item.image"
|
|
|
31
|
+ mode="scaleToFill"
|
|
|
32
|
+ @error="imgError"
|
|
|
33
|
+ @load="loadImage"
|
|
|
34
|
+ />
|
|
|
35
|
+ <image
|
|
|
36
|
+ v-else
|
|
|
37
|
+ src="/static/images/new_ui/wutu.png"
|
|
|
38
|
+ mode="scaleToFill"
|
|
|
39
|
+ @error="imgError"
|
|
|
40
|
+ />
|
|
|
41
|
+ </view>
|
|
|
42
|
+ <view class="list-card-top--right">
|
|
|
43
|
+ <view class="list-card-top--right-title">{{
|
|
|
44
|
+ item.store_name
|
|
|
45
|
+ }}</view>
|
|
|
46
|
+ <view class="list-card-top--right-description">
|
|
|
47
|
+ <view class="list-card-top--right-description--left">
|
|
|
48
|
+ <text class="title">销量</text>
|
|
|
49
|
+ <text class="mdikd">{{ item.sales || 0 }}</text>
|
|
|
50
|
+ </view>
|
|
|
51
|
+ <view class="list-card-top--right-description--right">
|
|
|
52
|
+ <text class="title">库存</text>
|
|
|
53
|
+ <text class="mdikd">{{ item.stock || 0 }}</text>
|
|
|
54
|
+ </view>
|
|
38
|
55
|
</view>
|
|
39
|
|
- <view class="list-card-top--right-description--right">
|
|
40
|
|
- <text class="title">库存</text>
|
|
41
|
|
- <text>5000</text>
|
|
|
56
|
+ <view class="list-card-top--right-description">
|
|
|
57
|
+ <view class="list-card-top--right-description--left">
|
|
|
58
|
+ <text class="title">活动:</text>
|
|
|
59
|
+ <text class="mdikd" style="color: red">{{
|
|
|
60
|
+ item.seckill == 1 ? "秒杀" : "无"
|
|
|
61
|
+ }}</text>
|
|
|
62
|
+ </view>
|
|
42
|
63
|
</view>
|
|
43
|
|
- </view>
|
|
44
|
|
- <view class="list-card-top--right-price">
|
|
45
|
|
- <view class="list-card-top--right-price--left">
|
|
46
|
|
- <text>¥</text>
|
|
47
|
|
- <text class="price">5000</text>
|
|
|
64
|
+ <view class="list-card-top--right-price">
|
|
|
65
|
+ <view class="list-card-top--right-price--left">
|
|
|
66
|
+ <text>¥</text>
|
|
|
67
|
+ <text class="price">{{ item.price || "0.00" }}</text>
|
|
|
68
|
+ </view>
|
|
48
|
69
|
</view>
|
|
49
|
70
|
</view>
|
|
50
|
71
|
</view>
|
|
51
|
|
- </view>
|
|
52
|
|
- <view class="list-card-bottom-btn">
|
|
53
|
|
- <view class="list-card-bottom-btn-list">
|
|
54
|
|
- <view class="list-card-bottom-btn-list--item">推荐</view>
|
|
55
|
|
- <view class="list-card-bottom-btn-list--item">驳回原因</view>
|
|
56
|
|
- <view class="list-card-bottom-btn-list--item">上架</view>
|
|
57
|
|
- <view class="list-card-bottom-btn-list--item">下架</view>
|
|
58
|
|
- <view class="list-card-bottom-btn-list--item">删除草稿</view>
|
|
|
72
|
+ <view class="list-card-bottom-btn">
|
|
|
73
|
+ <view class="list-card-bottom-btn-list">
|
|
|
74
|
+ <button
|
|
|
75
|
+ class="list-card-bottom-btn-list--item set-activity active"
|
|
|
76
|
+ @click="huodong(item, index)"
|
|
|
77
|
+ >
|
|
|
78
|
+ 活动
|
|
|
79
|
+ </button>
|
|
|
80
|
+ <!-- v-if="tableFrom.type === '5'" -->
|
|
|
81
|
+ <button
|
|
|
82
|
+ v-if="type == 5"
|
|
|
83
|
+ class="list-card-bottom-btn-list--item bohui-activity active"
|
|
|
84
|
+ @click="handleRestore(item.product_id)"
|
|
|
85
|
+ >
|
|
|
86
|
+ 恢复商品
|
|
|
87
|
+ </button>
|
|
|
88
|
+ <template v-if="type == 1 || type == 2">
|
|
|
89
|
+ <button
|
|
|
90
|
+ class="list-card-bottom-btn-list--item set-activity active"
|
|
|
91
|
+ v-if="item.is_show == 0"
|
|
|
92
|
+ @click="onHandleShow(item, 'shangjia')"
|
|
|
93
|
+ >
|
|
|
94
|
+ 上架
|
|
|
95
|
+ </button>
|
|
|
96
|
+ <button
|
|
|
97
|
+ v-if="item.is_show == 1"
|
|
|
98
|
+ class="list-card-bottom-btn-list--item set-activity active"
|
|
|
99
|
+ @click="onHandleShow(item, 'xiajia')"
|
|
|
100
|
+ >
|
|
|
101
|
+ 下架
|
|
|
102
|
+ </button>
|
|
|
103
|
+ </template>
|
|
|
104
|
+ <button
|
|
|
105
|
+ v-if="type != 1 && type != 3 && type != 4"
|
|
|
106
|
+ class="list-card-bottom-btn-list--item delete-activity active"
|
|
|
107
|
+ @click="handleDelete(item, index)"
|
|
|
108
|
+ >
|
|
|
109
|
+ {{ type == "5" ? "删除" : "加入回收站" }}
|
|
|
110
|
+ </button>
|
|
|
111
|
+ </view>
|
|
59
|
112
|
</view>
|
|
60
|
113
|
</view>
|
|
61
|
|
- </view>
|
|
62
|
|
- </template>
|
|
63
|
|
- <template v-else>
|
|
64
|
|
- <emptyDataVue style="top:0"/>
|
|
|
114
|
+ </template>
|
|
|
115
|
+ <template v-else>
|
|
|
116
|
+ <emptyDataVue style="top: 0" />
|
|
65
|
117
|
</template>
|
|
66
|
118
|
<view
|
|
67
|
119
|
class=""
|
|
|
@@ -71,6 +123,70 @@
|
|
71
|
123
|
—— 已经到最底部了哦 ——
|
|
72
|
124
|
</view>
|
|
73
|
125
|
</view>
|
|
|
126
|
+ <!-- 弹窗主体 -->
|
|
|
127
|
+ <uni-popup
|
|
|
128
|
+ ref="popup"
|
|
|
129
|
+ type="center"
|
|
|
130
|
+ :is-mask-click="false"
|
|
|
131
|
+ background-color="#rgba(0,0,0,0.5)"
|
|
|
132
|
+ >
|
|
|
133
|
+ <view class="popup-container" :class="[isOpen ? 'popup-show' : '']">
|
|
|
134
|
+ <!-- 标题区 -->
|
|
|
135
|
+ <view class="popup-header">
|
|
|
136
|
+ <text class="title">活动设置</text>
|
|
|
137
|
+ </view>
|
|
|
138
|
+ <!-- 内容区 -->
|
|
|
139
|
+ <view class="content-wrapper">
|
|
|
140
|
+ <view class="form-item">
|
|
|
141
|
+ <uni-data-checkbox
|
|
|
142
|
+ mode="button"
|
|
|
143
|
+ icon="left"
|
|
|
144
|
+ v-model="formData.radio"
|
|
|
145
|
+ :localdata="rangeData"
|
|
|
146
|
+ ></uni-data-checkbox>
|
|
|
147
|
+ </view>
|
|
|
148
|
+ <!-- 秒杀区块 -->
|
|
|
149
|
+ <view class="form-item">
|
|
|
150
|
+ <uni-data-checkbox
|
|
|
151
|
+ mode="button"
|
|
|
152
|
+ icon="left"
|
|
|
153
|
+ v-model="formData.radios"
|
|
|
154
|
+ :localdata="rangeData1"
|
|
|
155
|
+ @change="onSwitchChange"
|
|
|
156
|
+ ></uni-data-checkbox>
|
|
|
157
|
+ </view>
|
|
|
158
|
+
|
|
|
159
|
+ <!-- 价格输入 -->
|
|
|
160
|
+ <view class="form-item">
|
|
|
161
|
+ <view class="item-label">秒杀价格</view>
|
|
|
162
|
+ <uni-easyinput
|
|
|
163
|
+ v-model="formData.seckill_price"
|
|
|
164
|
+ :errorMessage="isEmpty"
|
|
|
165
|
+ focus
|
|
|
166
|
+ placeholder="输入价格"
|
|
|
167
|
+ :adjust-position="false"
|
|
|
168
|
+ @change="changeInput"
|
|
|
169
|
+ type="digit"
|
|
|
170
|
+ ></uni-easyinput>
|
|
|
171
|
+ </view>
|
|
|
172
|
+ <!-- 时间选择 -->
|
|
|
173
|
+ <view class="form-item">
|
|
|
174
|
+ <view class="item-label">时间设置</view>
|
|
|
175
|
+ <uni-datetime-picker
|
|
|
176
|
+ type="datetime"
|
|
|
177
|
+ v-model="formData.seckill_date"
|
|
|
178
|
+ @change="onDateChange"
|
|
|
179
|
+ />
|
|
|
180
|
+ </view>
|
|
|
181
|
+ </view>
|
|
|
182
|
+
|
|
|
183
|
+ <!-- 操作按钮 -->
|
|
|
184
|
+ <view class="action-btns">
|
|
|
185
|
+ <button class="btn prev-step" @click="closePopup">取消</button>
|
|
|
186
|
+ <button class="btn submit-btn" @click="handleSubmit">提交</button>
|
|
|
187
|
+ </view>
|
|
|
188
|
+ </view>
|
|
|
189
|
+ </uni-popup>
|
|
74
|
190
|
</view>
|
|
75
|
191
|
</template>
|
|
76
|
192
|
|
|
|
@@ -79,14 +195,22 @@ import headersVue from "../components/headers/headers.vue";
|
|
79
|
195
|
import searchVue from "./components/search/search.vue";
|
|
80
|
196
|
import tabsVue from "./components/tablist.vue";
|
|
81
|
197
|
import emptyDataVue from "../components/emptyData/emptyData.vue";
|
|
82
|
|
-import { getProductList, getGoodsTab } from "@/commit/product.js";
|
|
|
198
|
+import {
|
|
|
199
|
+ getProductList,
|
|
|
200
|
+ getGoodsTab,
|
|
|
201
|
+ changeshowApi,
|
|
|
202
|
+ destoryApi,
|
|
|
203
|
+ productDeleteApi,
|
|
|
204
|
+ productRestoreApi,
|
|
|
205
|
+ Addseckill, //活动
|
|
|
206
|
+} from "@/commit/product.js";
|
|
83
|
207
|
//商品列表
|
|
84
|
208
|
export default {
|
|
85
|
209
|
components: {
|
|
86
|
210
|
headersVue,
|
|
87
|
211
|
searchVue,
|
|
88
|
212
|
tabsVue,
|
|
89
|
|
- emptyDataVue
|
|
|
213
|
+ emptyDataVue,
|
|
90
|
214
|
},
|
|
91
|
215
|
|
|
92
|
216
|
data() {
|
|
|
@@ -103,7 +227,7 @@ export default {
|
|
103
|
227
|
type: 1,
|
|
104
|
228
|
is_gift_bag: "",
|
|
105
|
229
|
p_type: "",
|
|
106
|
|
- isError:false,
|
|
|
230
|
+ isError: false,
|
|
107
|
231
|
dataList: [
|
|
108
|
232
|
{
|
|
109
|
233
|
type: 1,
|
|
|
@@ -141,6 +265,21 @@ export default {
|
|
141
|
265
|
count: 0,
|
|
142
|
266
|
},
|
|
143
|
267
|
],
|
|
|
268
|
+ formData: {
|
|
|
269
|
+ radio: "1",
|
|
|
270
|
+ radios: "1",
|
|
|
271
|
+ seckill_price: "",
|
|
|
272
|
+ seckill_date: "",
|
|
|
273
|
+ product_id: "",
|
|
|
274
|
+ },
|
|
|
275
|
+ isOpen: false,
|
|
|
276
|
+ rangeData: [
|
|
|
277
|
+ { value: "1", text: "大仓活动" },
|
|
|
278
|
+ { value: "2", text: "平台活动" },
|
|
|
279
|
+ ],
|
|
|
280
|
+ rangeData1: [{ value: "1", text: "秒杀" }],
|
|
|
281
|
+ isEmpty: false,
|
|
|
282
|
+ dataObj: {},
|
|
144
|
283
|
};
|
|
145
|
284
|
},
|
|
146
|
285
|
async onLoad(options) {
|
|
|
@@ -169,8 +308,15 @@ export default {
|
|
169
|
308
|
}
|
|
170
|
309
|
},
|
|
171
|
310
|
methods: {
|
|
172
|
|
- imgError(){
|
|
173
|
|
- this.isError = true
|
|
|
311
|
+ async initData() {
|
|
|
312
|
+ await this.getGoodsTabData();
|
|
|
313
|
+ await this.getProductListData();
|
|
|
314
|
+ },
|
|
|
315
|
+ imgError() {
|
|
|
316
|
+ this.isError = true;
|
|
|
317
|
+ },
|
|
|
318
|
+ loadImage(e) {
|
|
|
319
|
+ // console.log(e,"loadImage")
|
|
174
|
320
|
},
|
|
175
|
321
|
headerJump() {
|
|
176
|
322
|
uni.switchTab({ url: "/shop/productManagementModule/index" });
|
|
|
@@ -227,12 +373,225 @@ export default {
|
|
227
|
373
|
uni.hideLoading();
|
|
228
|
374
|
}
|
|
229
|
375
|
},
|
|
230
|
|
- async tabsHandleClick(obj) {
|
|
|
376
|
+ async tabsHandleClick(obj) {
|
|
231
|
377
|
this.currentActive = obj.index;
|
|
232
|
378
|
this.type = obj.item?.type || 1;
|
|
233
|
|
-
|
|
|
379
|
+ this.page = 1;
|
|
|
380
|
+ this.list = [];
|
|
|
381
|
+ this.is_panudn = true;
|
|
|
382
|
+ uni.pageScrollTo({ scrollTop: 0, duration: 0 });
|
|
234
|
383
|
await this.getProductListData();
|
|
235
|
384
|
},
|
|
|
385
|
+ async search(val) {
|
|
|
386
|
+ this.keyword = val;
|
|
|
387
|
+ // console.log(val)
|
|
|
388
|
+ await this.getProductListData();
|
|
|
389
|
+ },
|
|
|
390
|
+ async onHandleShow(item, type) {
|
|
|
391
|
+ const id = item.product_id;
|
|
|
392
|
+ const data = {
|
|
|
393
|
+ status: item.is_show,
|
|
|
394
|
+ };
|
|
|
395
|
+ const titleTips = item.is_show == 1 ? "商品下架中" : "商品上架中";
|
|
|
396
|
+ const titleMsg = item.is_show == 1 ? "商品下架成功" : "商品上架成功";
|
|
|
397
|
+ uni.showLoading({
|
|
|
398
|
+ title: titleTips,
|
|
|
399
|
+ });
|
|
|
400
|
+ try {
|
|
|
401
|
+ const res = await changeshowApi(id, data);
|
|
|
402
|
+ if (res.data.status == 200) {
|
|
|
403
|
+ uni.showToast({
|
|
|
404
|
+ title: titleMsg,
|
|
|
405
|
+ icon: "none",
|
|
|
406
|
+ });
|
|
|
407
|
+ await this.getProductListData();
|
|
|
408
|
+ }
|
|
|
409
|
+ } catch (error) {
|
|
|
410
|
+ } finally {
|
|
|
411
|
+ uni.hideLoading();
|
|
|
412
|
+ uni.hideToast();
|
|
|
413
|
+ }
|
|
|
414
|
+ },
|
|
|
415
|
+ /**删除 */
|
|
|
416
|
+ handleDelete(item, index) {
|
|
|
417
|
+ // {{item.type === "5" ? "删除" : "加入回收站"}}
|
|
|
418
|
+ const req = this.type === "5" ? destoryApi : productDeleteApi;
|
|
|
419
|
+ const titleContent =
|
|
|
420
|
+ this.type === "5" ? "是否删除产品?" : "是否商品加入回收站中?";
|
|
|
421
|
+ const titleTips = this.type === "5" ? "商品删除中" : "商品加入回收站中";
|
|
|
422
|
+ const titleMsg =
|
|
|
423
|
+ this.type === "5" ? "商品删除成功" : "商品加入回收站成功";
|
|
|
424
|
+ const product_id = item.product_id;
|
|
|
425
|
+ const _this = this;
|
|
|
426
|
+ uni.showModal({
|
|
|
427
|
+ title: "温馨提示",
|
|
|
428
|
+ content: titleContent,
|
|
|
429
|
+ showCancel: true,
|
|
|
430
|
+ success: ({ confirm, cancel }) => {
|
|
|
431
|
+ if (confirm) {
|
|
|
432
|
+ uni.showLoading({
|
|
|
433
|
+ title: titleTips,
|
|
|
434
|
+ });
|
|
|
435
|
+ req(product_id)
|
|
|
436
|
+ .then((res) => {
|
|
|
437
|
+ if (res.data.status == 200) {
|
|
|
438
|
+ uni.showToast({
|
|
|
439
|
+ title: titleMsg,
|
|
|
440
|
+ icon: "none",
|
|
|
441
|
+ });
|
|
|
442
|
+ this.list.splice(index, 1);
|
|
|
443
|
+ _this.initData();
|
|
|
444
|
+ }
|
|
|
445
|
+ })
|
|
|
446
|
+ .finally(() => {
|
|
|
447
|
+ uni.hideLoading();
|
|
|
448
|
+ uni.hideToast();
|
|
|
449
|
+ });
|
|
|
450
|
+ } else if (cancel) {
|
|
|
451
|
+ }
|
|
|
452
|
+ },
|
|
|
453
|
+ });
|
|
|
454
|
+ },
|
|
|
455
|
+ //恢复产品
|
|
|
456
|
+ handleRestore(id) {
|
|
|
457
|
+ const _this = this;
|
|
|
458
|
+ const titleTips = "商品恢复中";
|
|
|
459
|
+ const titleMsg = "商品恢复成功";
|
|
|
460
|
+ const product_id = id;
|
|
|
461
|
+ uni.showModal({
|
|
|
462
|
+ title: "温馨提示",
|
|
|
463
|
+ content: "是否恢复商品?",
|
|
|
464
|
+ showCancel: true,
|
|
|
465
|
+ success: ({ confirm, cancel }) => {
|
|
|
466
|
+ if (confirm) {
|
|
|
467
|
+ uni.showLoading({
|
|
|
468
|
+ title: titleTips,
|
|
|
469
|
+ });
|
|
|
470
|
+ productRestoreApi(product_id)
|
|
|
471
|
+ .then((res) => {
|
|
|
472
|
+ if (res.data.status == 200) {
|
|
|
473
|
+ uni.showToast({
|
|
|
474
|
+ title: titleMsg,
|
|
|
475
|
+ icon: "none",
|
|
|
476
|
+ });
|
|
|
477
|
+ _this.initData();
|
|
|
478
|
+ }
|
|
|
479
|
+ })
|
|
|
480
|
+ .finally(() => {
|
|
|
481
|
+ uni.hideLoading();
|
|
|
482
|
+ uni.hideToast();
|
|
|
483
|
+ });
|
|
|
484
|
+ } else if (cancel) {
|
|
|
485
|
+ }
|
|
|
486
|
+ },
|
|
|
487
|
+ });
|
|
|
488
|
+ },
|
|
|
489
|
+ huodong(item) {
|
|
|
490
|
+ this.dataObj = item;
|
|
|
491
|
+ const _this = this;
|
|
|
492
|
+ if (item.seckill == 1 && this.type !=2) {
|
|
|
493
|
+ uni.showModal({
|
|
|
494
|
+ title: "温馨提示",
|
|
|
495
|
+ content: "此商品正在处于秒杀状态,请勿操作",
|
|
|
496
|
+ showCancel: false,
|
|
|
497
|
+ success: ({ confirm, cancel }) => {},
|
|
|
498
|
+ });
|
|
|
499
|
+ return;
|
|
|
500
|
+ }
|
|
|
501
|
+ _this.showPopup()
|
|
|
502
|
+ // Addseckill({}).then(data=>{
|
|
|
503
|
+ // console.log(data)
|
|
|
504
|
+ // }).catch((res) => {
|
|
|
505
|
+ // console.log(res);
|
|
|
506
|
+ // if (res.data.message == "没有权限访问") {
|
|
|
507
|
+ // uni.showToast({
|
|
|
508
|
+ // title: res.data.message || "没有权限访问",
|
|
|
509
|
+ // icon: "none",
|
|
|
510
|
+ // });
|
|
|
511
|
+ // } else {
|
|
|
512
|
+ // _this.showPopup();
|
|
|
513
|
+ // }
|
|
|
514
|
+ // });
|
|
|
515
|
+ },
|
|
|
516
|
+ showPopup() {
|
|
|
517
|
+ this.isOpen = true;
|
|
|
518
|
+ this.$refs.popup.open();
|
|
|
519
|
+ },
|
|
|
520
|
+ closePopup() {
|
|
|
521
|
+ this.isOpen = false;
|
|
|
522
|
+ this.formData.radio = "1";
|
|
|
523
|
+ this.formData.radios = "1";
|
|
|
524
|
+ this.formData.seckill_price = "";
|
|
|
525
|
+ this.formData.seckill_date = "";
|
|
|
526
|
+ this.$refs.popup.close();
|
|
|
527
|
+ },
|
|
|
528
|
+ onDateChange(data) {
|
|
|
529
|
+ this.formData.seckill_date = data;
|
|
|
530
|
+ },
|
|
|
531
|
+ convertToISOString(dateStr) {
|
|
|
532
|
+ // 将输入的日期时间字符串中的空格替换为 'T',以符合 ISO 8601 格式
|
|
|
533
|
+ const isoFormatStr = dateStr.replace(" ", "T");
|
|
|
534
|
+ // 创建 Date 对象
|
|
|
535
|
+ const date = new Date(isoFormatStr);
|
|
|
536
|
+ // 将 Date 对象转换为 ISO 8601 格式的字符串
|
|
|
537
|
+ return date.toISOString();
|
|
|
538
|
+ },
|
|
|
539
|
+ async handleSubmit() {
|
|
|
540
|
+ // 提交逻辑
|
|
|
541
|
+ this.formData.product_id = this.dataObj.product_id;
|
|
|
542
|
+ let params = JSON.parse(JSON.stringify(this.formData));
|
|
|
543
|
+
|
|
|
544
|
+ if (
|
|
|
545
|
+ params.seckill_price == "" ||
|
|
|
546
|
+ params.seckill_price == null ||
|
|
|
547
|
+ params.seckill_price == undefined
|
|
|
548
|
+ ) {
|
|
|
549
|
+ uni.showToast({
|
|
|
550
|
+ title: "请输入秒杀价格",
|
|
|
551
|
+ icon: "none",
|
|
|
552
|
+ });
|
|
|
553
|
+ this.isEmpty = true;
|
|
|
554
|
+ return;
|
|
|
555
|
+ }
|
|
|
556
|
+ if (
|
|
|
557
|
+ params.seckill_date == "" ||
|
|
|
558
|
+ params.seckill_date == null ||
|
|
|
559
|
+ params.seckill_date == undefined
|
|
|
560
|
+ ) {
|
|
|
561
|
+ uni.showToast({
|
|
|
562
|
+ title: "请选择秒杀时间",
|
|
|
563
|
+ icon: "none",
|
|
|
564
|
+ });
|
|
|
565
|
+ return;
|
|
|
566
|
+ }
|
|
|
567
|
+ params.seckill_date = this.convertToISOString(params.seckill_date);
|
|
|
568
|
+
|
|
|
569
|
+ this.isEmpty = false;
|
|
|
570
|
+ uni.showLoading({
|
|
|
571
|
+ title: "秒杀活动添加中",
|
|
|
572
|
+ });
|
|
|
573
|
+ console.log(params);
|
|
|
574
|
+ try {
|
|
|
575
|
+ const res = await Addseckill(params);
|
|
|
576
|
+ if (res.data.status == 200) {
|
|
|
577
|
+ uni.showToast({
|
|
|
578
|
+ title: "秒杀活动添加成功",
|
|
|
579
|
+ icon: "none",
|
|
|
580
|
+ });
|
|
|
581
|
+ this.closePopup();
|
|
|
582
|
+ this.initData();
|
|
|
583
|
+ }
|
|
|
584
|
+ } catch (error) {
|
|
|
585
|
+ } finally {
|
|
|
586
|
+ uni.hideLoading();
|
|
|
587
|
+ uni.hideToast();
|
|
|
588
|
+ }
|
|
|
589
|
+ },
|
|
|
590
|
+ changeInput(val) {
|
|
|
591
|
+ if (val) {
|
|
|
592
|
+ this.isEmpty = false;
|
|
|
593
|
+ }
|
|
|
594
|
+ },
|
|
236
|
595
|
},
|
|
237
|
596
|
};
|
|
238
|
597
|
</script>
|
|
|
@@ -339,6 +698,10 @@ page {
|
|
339
|
698
|
flex: 40%;
|
|
340
|
699
|
.title {
|
|
341
|
700
|
padding-right: 16rpx;
|
|
|
701
|
+ font-size: 26rpx;
|
|
|
702
|
+ }
|
|
|
703
|
+ .mdikd {
|
|
|
704
|
+ font-size: 26rpx;
|
|
342
|
705
|
}
|
|
343
|
706
|
}
|
|
344
|
707
|
.list-card-top--right-price {
|
|
|
@@ -365,20 +728,111 @@ page {
|
|
365
|
728
|
gap: 20rpx;
|
|
366
|
729
|
user-select: none;
|
|
367
|
730
|
.list-card-bottom-btn-list--item {
|
|
|
731
|
+ flex: 1;
|
|
368
|
732
|
display: flex;
|
|
369
|
733
|
justify-content: center;
|
|
370
|
734
|
align-items: center;
|
|
|
735
|
+ flex-wrap: wrap;
|
|
371
|
736
|
width: 146rpx;
|
|
|
737
|
+ white-space: nowrap;
|
|
372
|
738
|
height: 60rpx;
|
|
373
|
|
- border-radius: 8rpx;
|
|
374
|
|
- border: 1rpx solid #e5e5e5;
|
|
|
739
|
+ // border: 1rpx solid #e5e5e5;
|
|
375
|
740
|
font-weight: 400;
|
|
376
|
741
|
font-size: 24rpx;
|
|
|
742
|
+ border-radius: 12rpx;
|
|
377
|
743
|
color: #333333;
|
|
|
744
|
+ transition: all 0.2s;
|
|
|
745
|
+
|
|
|
746
|
+ &.edit-price {
|
|
|
747
|
+ background: #fff;
|
|
|
748
|
+ color: #007aff;
|
|
|
749
|
+ // border: 1rpx solid #007aff;
|
|
|
750
|
+ }
|
|
|
751
|
+
|
|
|
752
|
+ &.set-activity {
|
|
|
753
|
+ background: #007aff;
|
|
|
754
|
+ color: white;
|
|
|
755
|
+ }
|
|
|
756
|
+ &.delete-activity {
|
|
|
757
|
+ background: #f15314;
|
|
|
758
|
+ color: white;
|
|
|
759
|
+ }
|
|
|
760
|
+ &.bohui-activity {
|
|
|
761
|
+ background: #e9ca1d;
|
|
|
762
|
+ color: white;
|
|
|
763
|
+ }
|
|
|
764
|
+
|
|
|
765
|
+ &:active {
|
|
|
766
|
+ opacity: 0.8;
|
|
|
767
|
+ transform: scale(0.98);
|
|
|
768
|
+ }
|
|
378
|
769
|
}
|
|
379
|
770
|
}
|
|
380
|
771
|
}
|
|
381
|
772
|
}
|
|
382
|
773
|
}
|
|
383
|
774
|
}
|
|
|
775
|
+.popup-container {
|
|
|
776
|
+ width: 80vw;
|
|
|
777
|
+ background: #ffffff;
|
|
|
778
|
+ border-radius: 16rpx;
|
|
|
779
|
+ transition: all 0.3s ease;
|
|
|
780
|
+ transform: scale(0.8);
|
|
|
781
|
+ opacity: 0;
|
|
|
782
|
+ padding: 20rpx;
|
|
|
783
|
+ .popup-header {
|
|
|
784
|
+ padding: 0rpx 15rpx 15rpx;
|
|
|
785
|
+ border-bottom: 1px solid #eee;
|
|
|
786
|
+ .title {
|
|
|
787
|
+ font-size: 36rpx;
|
|
|
788
|
+ font-weight: 600;
|
|
|
789
|
+ color: #333;
|
|
|
790
|
+ text-align: center;
|
|
|
791
|
+ }
|
|
|
792
|
+ }
|
|
|
793
|
+}
|
|
|
794
|
+.content-wrapper {
|
|
|
795
|
+ overflow: auto;
|
|
|
796
|
+ .form-item {
|
|
|
797
|
+ padding: 15rpx 0;
|
|
|
798
|
+ .item-label {
|
|
|
799
|
+ font-size: 28rpx;
|
|
|
800
|
+ font-weight: 600;
|
|
|
801
|
+ color: #333;
|
|
|
802
|
+ margin-bottom: 12rpx;
|
|
|
803
|
+ }
|
|
|
804
|
+ }
|
|
|
805
|
+}
|
|
|
806
|
+.popup-show {
|
|
|
807
|
+ transform: scale(1);
|
|
|
808
|
+ opacity: 1;
|
|
|
809
|
+}
|
|
|
810
|
+.action-btns {
|
|
|
811
|
+ display: flex;
|
|
|
812
|
+ padding: 24rpx;
|
|
|
813
|
+ gap: 20rpx;
|
|
|
814
|
+ border-top: 1px solid #eee;
|
|
|
815
|
+
|
|
|
816
|
+ .btn {
|
|
|
817
|
+ flex: 1;
|
|
|
818
|
+ height: 80rpx;
|
|
|
819
|
+ line-height: 80rpx;
|
|
|
820
|
+ border-radius: 8rpx;
|
|
|
821
|
+ font-size: 28rpx;
|
|
|
822
|
+
|
|
|
823
|
+ &.prev-step {
|
|
|
824
|
+ background: #f8f8f8;
|
|
|
825
|
+ color: #666;
|
|
|
826
|
+ }
|
|
|
827
|
+
|
|
|
828
|
+ &.submit-btn {
|
|
|
829
|
+ background: #007aff;
|
|
|
830
|
+ color: white;
|
|
|
831
|
+ }
|
|
|
832
|
+ }
|
|
|
833
|
+}
|
|
|
834
|
+
|
|
|
835
|
+/deep/.uni-popup {
|
|
|
836
|
+ z-index: 667;
|
|
|
837
|
+}
|
|
384
|
838
|
</style>
|