优化细节
This commit is contained in:
@@ -1,86 +1,86 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="admin-main">
|
||||
<view class="card-container">
|
||||
<view class="card-header">
|
||||
<text class="card-header-title">新人礼设置</text>
|
||||
<text class="card-header-title">鏂颁汉绀艰缃?/text>
|
||||
</view>
|
||||
|
||||
<view class="form-content">
|
||||
<!-- 赠送余额 -->
|
||||
<!-- 璧犻€佷綑棰?-->
|
||||
<view class="form-item">
|
||||
<view class="label-col">
|
||||
<text class="form-label">赠送余额(元):</text>
|
||||
<text class="form-label">璧犻€佷綑棰?鍏?:</text>
|
||||
</view>
|
||||
<view class="input-col">
|
||||
<input type="number" class="form-input" v-model="formData.balance" />
|
||||
<text class="form-tip">新用户奖励金额,必须大于等于0,0为不赠送</text>
|
||||
<text class="form-tip">鏂扮敤鎴峰鍔遍噾棰濓紝蹇呴』澶т簬绛変簬0锛?涓轰笉璧犻€?/text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 赠送积分 -->
|
||||
<!-- 璧犻€佺Н鍒?-->
|
||||
<view class="form-item">
|
||||
<view class="label-col">
|
||||
<text class="form-label">赠送积分:</text>
|
||||
<text class="form-label">璧犻€佺Н鍒?</text>
|
||||
</view>
|
||||
<view class="input-col">
|
||||
<input type="number" class="form-input" v-model="formData.integral" />
|
||||
<text class="form-tip">新用户奖励积分,必须大于等于0,0为不赠送</text>
|
||||
<text class="form-tip">鏂扮敤鎴峰鍔辩Н鍒嗭紝蹇呴』澶т簬绛変簬0锛?涓轰笉璧犻€?/text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 赠送优惠券 -->
|
||||
<!-- 璧犻€佷紭鎯犲埜 -->
|
||||
<view class="form-item row-center">
|
||||
<view class="label-col">
|
||||
<text class="form-label">赠送优惠券:</text>
|
||||
<text class="form-label">璧犻€佷紭鎯犲埜:</text>
|
||||
</view>
|
||||
<view class="input-col row-layout">
|
||||
<view class="coupon-display-area" v-if="formData.coupons.length > 0">
|
||||
<view v-for="(coupon, index) in formData.coupons" :key="index" class="coupon-tag-group">
|
||||
<view class="coupon-tag-main">
|
||||
<text class="coupon-tag-name">{{ coupon.name }}</text>
|
||||
<text class="coupon-tag-del" @click="removeCoupon(index)">×</text>
|
||||
<text class="coupon-tag-del" @click="removeCoupon(index)">脳</text>
|
||||
</view>
|
||||
<view class="explicit-edit-btn" @click="editCoupon(index)">
|
||||
<text class="edit-btn-text">修改设置</text>
|
||||
<text class="edit-btn-text">淇敼璁剧疆</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="btn-select-action" @click="showCouponModal = true">选择优惠券</button>
|
||||
<button class="btn-select-action" @click="showCouponModal = true">閫夋嫨浼樻儬鍒?/button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 确认按钮 -->
|
||||
<!-- 纭鎸夐挳 -->
|
||||
<view class="form-submit-bar">
|
||||
<button class="btn-primary-confirm" @click="handleSubmit">确认</button>
|
||||
<button class="btn-primary-confirm" @click="handleSubmit">纭</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券选择与详情配置弹窗 -->
|
||||
<!-- 浼樻儬鍒搁€夋嫨涓庤鎯呴厤缃脊绐?-->
|
||||
<view class="modal-mask" v-if="showCouponModal" @click="closeModal">
|
||||
<view class="modal-box" @click.stop>
|
||||
<view class="modal-head">
|
||||
<text class="modal-head-title">{{ isEditing ? '配置赠送详情' : '选择优惠券' }}</text>
|
||||
<text class="modal-head-close" @click="closeModal">×</text>
|
||||
<text class="modal-head-title">{{ isEditing ? '閰嶇疆璧犻€佽鎯? : '閫夋嫨浼樻儬鍒? }}</text>
|
||||
<text class="modal-head-close" @click="closeModal">脳</text>
|
||||
</view>
|
||||
|
||||
<view class="modal-body">
|
||||
<!-- 编辑/设置模式:当用户由于点击“修改设置”时触发 -->
|
||||
<!-- 缂栬緫/璁剧疆妯″紡锛氬綋鐢ㄦ埛鐢变簬鐐瑰嚮鈥滀慨鏀硅缃€濇椂瑙﹀彂 -->
|
||||
<view v-if="isEditing" class="setting-form">
|
||||
<view class="setting-row">
|
||||
<text class="setting-label">显示名称:</text>
|
||||
<input class="setting-input" v-model="editingCoupon.name" placeholder="请输入页面显示的名称" />
|
||||
<text class="setting-label">鏄剧ず鍚嶇О:</text>
|
||||
<input class="setting-input" v-model="editingCoupon.name" placeholder="璇疯緭鍏ラ〉闈㈡樉绀虹殑鍚嶇О" />
|
||||
</view>
|
||||
<view class="setting-row">
|
||||
<text class="setting-label">发放描述:</text>
|
||||
<input class="setting-input" v-model="editingCoupon.desc" placeholder="请输入发放时的描述" />
|
||||
<text class="setting-label">鍙戞斁鎻忚堪:</text>
|
||||
<input class="setting-input" v-model="editingCoupon.desc" placeholder="璇疯緭鍏ュ彂鏀炬椂鐨勬弿杩? />
|
||||
</view>
|
||||
<view class="setting-tip">
|
||||
<text class="tip-text">* 此处的修改仅影响“新人礼”活动中的展示,不影响优惠券自身配置</text>
|
||||
<text class="tip-text">* 姝ゅ鐨勪慨鏀逛粎褰卞搷鈥滄柊浜虹ぜ鈥濇椿鍔ㄤ腑鐨勫睍绀猴紝涓嶅奖鍝嶄紭鎯犲埜鑷韩閰嶇疆</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 选择模式 -->
|
||||
<!-- 閫夋嫨妯″紡 -->
|
||||
<view v-else class="selection-list">
|
||||
<view v-for="(item, index) in couponOptions" :key="index"
|
||||
class="selection-card" :class="{'selected-card': isSelected(item)}"
|
||||
@@ -91,7 +91,7 @@
|
||||
</view>
|
||||
<view class="card-right">
|
||||
<view class="check-circle" :class="{'checked-circle': isSelected(item)}">
|
||||
<text class="check-mark" v-if="isSelected(item)">✓</text>
|
||||
<text class="check-mark" v-if="isSelected(item)">鉁?/text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -99,8 +99,8 @@
|
||||
</view>
|
||||
|
||||
<view class="modal-foot">
|
||||
<button class="foot-btn-cancel" @click="closeModal">取消</button>
|
||||
<button class="foot-btn-ok" @click="confirmModal">确定</button>
|
||||
<button class="foot-btn-cancel" @click="closeModal">鍙栨秷</button>
|
||||
<button class="foot-btn-ok" @click="confirmModal">纭畾</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -128,9 +128,9 @@ const editingIndex = ref(-1)
|
||||
const editingCoupon = reactive<Coupon>({ id: 0, name: '', desc: '' })
|
||||
|
||||
const couponOptions = reactive<Coupon[]>([
|
||||
{ id: 1, name: '满100减10元券', desc: '全场通用' },
|
||||
{ id: 2, name: '新人5元无门槛', desc: '仅限新人使用' },
|
||||
{ id: 3, name: '满200减50元券', desc: '限特定商品' }
|
||||
{ id: 1, name: '婊?00鍑?0鍏冨埜', desc: '鍏ㄥ満閫氱敤' },
|
||||
{ id: 2, name: '鏂颁汉5鍏冩棤闂ㄦ', desc: '浠呴檺鏂颁汉浣跨敤' },
|
||||
{ id: 3, name: '婊?00鍑?0鍏冨埜', desc: '闄愮壒瀹氬晢鍝? }
|
||||
])
|
||||
|
||||
function isSelected(item: Coupon): boolean {
|
||||
@@ -174,11 +174,11 @@ function confirmModal() {
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
uni.showLoading({ title: '保存中...' })
|
||||
uni.showLoading({ title: '淇濆瓨涓?..' })
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '设置已生效',
|
||||
title: '璁剧疆宸茬敓鏁?,
|
||||
icon: 'success'
|
||||
})
|
||||
}, 500)
|
||||
@@ -193,7 +193,7 @@ function handleSubmit() {
|
||||
}
|
||||
|
||||
.card-container {
|
||||
background-color: #fff;
|
||||
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
@@ -519,3 +519,4 @@ function handleSubmit() {
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user