|
|
@@ -294,7 +294,7 @@
|
|
|
</view>
|
|
|
<text style="color: #3385FF;width:170upx;">¥{{parseFloat(systemPrice)}}</text>
|
|
|
<button @tap="showDiscount()" class="admin-button-com middle default" style="width:140upx;">打折</button>
|
|
|
- <text v-if="discountValue>0 && discountValue<1">{{ Number(discountValue)*10 }}折</text>
|
|
|
+ <text v-if="discountValue>0 && discountValue<1">{{ (Number(discountValue)*10).toFixed(1) }}折</text>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
@@ -310,7 +310,7 @@
|
|
|
<view class="tui-title" v-if="form.sendType == 1">取花日期</view>
|
|
|
<view class="tui-title" v-else>配送日期</view>
|
|
|
<view class="uni-input" v-if="form.reachDate==''" @click="bindReachDateChange">
|
|
|
- <view style="width:410upx;font-size:32upx;color:#CCCCCC;">今天</view>
|
|
|
+ <view style="width:410upx;font-size:32upx;color:#CCCCCC;">默认当天</view>
|
|
|
</view>
|
|
|
<view class="uni-input" @click="bindReachDateChange">
|
|
|
<view style="width:410upx;font-size:32upx;">{{form.reachDate}}</view>
|
|
|
@@ -328,14 +328,14 @@
|
|
|
<picker mode="selector" :value="form.getStaffId" :range="staffList" range-key="name" @change="kdChange" class="tui-input" >
|
|
|
<input v-model="form.getStaffId" name="getStaffId" type="text" hidden />
|
|
|
<div style="padding:6upx 0 6upx 0;" v-if="form.getStaffName!=''">{{form.getStaffName}}</div>
|
|
|
- <div v-else style="padding:6upx 0 6upx 0;color:#CCCCCC;">自己</div>
|
|
|
+ <div v-else style="padding:6upx 0 6upx 0;color:#CCCCCC;">默认本人</div>
|
|
|
</picker>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true">
|
|
|
<view class="tui-title">账单日期</view>
|
|
|
<view class="uni-input" v-if="form.historyDate==''" @click="bindHistoryDateChange">
|
|
|
- <view style="width:410upx;font-size:32upx;color:#CCCCCC;">今天</view>
|
|
|
+ <view style="width:410upx;font-size:32upx;color:#CCCCCC;">默认当天</view>
|
|
|
</view>
|
|
|
<view class="uni-input" @click="bindHistoryDateChange">
|
|
|
<view style="width:410upx;font-size:32upx;">{{form.historyDate}}</view>
|
|
|
@@ -464,14 +464,41 @@
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
|
|
|
- <uni-popup ref="discountRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
|
|
|
- <view style="display:flex;padding:20upx;min-height:25vh;justify-content: space-between;align-items:center;flex-wrap:wrap;">
|
|
|
- <text v-for="(item, index) in discountList" :key="index" @click="setDiscount(item.value)"
|
|
|
- style="margin-left:25upx;border:1upx solid #999999;width:100upx;height:100upx;border-radius:20upx;justify-content:center;align-items:center;display:flex;">
|
|
|
- {{item.name}}
|
|
|
- </text>
|
|
|
- </view>
|
|
|
- </uni-popup>
|
|
|
+ <uni-popup ref="discountRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
|
|
|
+ <view class="discount-popup-container">
|
|
|
+ <!-- 标题 -->
|
|
|
+ <view class="discount-popup-title">选择打折</view>
|
|
|
+
|
|
|
+ <!-- 快捷折扣按钮 -->
|
|
|
+ <view class="discount-quick-buttons">
|
|
|
+ <button
|
|
|
+ v-for="(item, index) in discountList"
|
|
|
+ :key="index"
|
|
|
+ @click="setDiscount(item.value)"
|
|
|
+ :class="['discount-quick-btn', { active: discountValue === item.value }]"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 分割线 -->
|
|
|
+ <view class="discount-divider"></view>
|
|
|
+
|
|
|
+ <!-- 自定义输入 -->
|
|
|
+ <view class="discount-custom-section">
|
|
|
+ <view class="discount-custom-label">自定义折扣</view>
|
|
|
+ <view class="discount-custom-input-group">
|
|
|
+ <input v-model="customDiscount" type="digit" placeholder="85折请填0.85" class="discount-custom-input" />
|
|
|
+ <button class="admin-button-com middle blue" @click="setCustomDiscount">确认</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <view class="discount-action-buttons">
|
|
|
+ <button class="admin-button-com middle default" @click="cancelDiscount" > 取消 </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
|
|
|
<uni-popup ref="remindForwardRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
|
|
|
<view class="forward-popup-content">
|
|
|
@@ -560,6 +587,7 @@ export default {
|
|
|
reachDatePickerValue: '',
|
|
|
discountList:[{name:'1折',value:0.1},{name:'2折',value:0.2},{name:'3折',value:0.3},{name:'4折',value:0.4},{name:'5折',value:0.5},{name:'6折',value:0.6},{name:'7折',value:0.7},{name:'8折',value:0.8},{name:'9折',value:0.9},{name:'不打折',value:1}],
|
|
|
discountValue:0,
|
|
|
+ customDiscount:'',
|
|
|
autoLoad: false,
|
|
|
staffList:[],
|
|
|
payWayList:[{name:"线下微信",id:0},{name:"线下支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
|
|
|
@@ -966,6 +994,19 @@ export default {
|
|
|
let price = Number(this.systemPrice)*Number(num)
|
|
|
price = parseFloat(price.toFixed(2))
|
|
|
this.modifyPrice = price
|
|
|
+ this.customDiscount = ''
|
|
|
+ this.$refs.discountRef.close()
|
|
|
+ },
|
|
|
+ setCustomDiscount(){
|
|
|
+ const value = parseFloat(this.customDiscount)
|
|
|
+ if(isNaN(value) || value < 0 || value > 1){
|
|
|
+ this.$msg('请输入0到1之间的有效折扣值')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.setDiscount(value)
|
|
|
+ },
|
|
|
+ cancelDiscount(){
|
|
|
+ this.customDiscount = ''
|
|
|
this.$refs.discountRef.close()
|
|
|
},
|
|
|
beginScan(){
|
|
|
@@ -1296,8 +1337,93 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
<style lang="scss" scoped>
|
|
|
+.discount-quick-btn {
|
|
|
+ width: 120upx;
|
|
|
+ height: 120upx;
|
|
|
+ border-radius: 12upx;
|
|
|
+ border: 2upx solid #ddd;
|
|
|
+ background-color: #f9f9f9;
|
|
|
+ font-size: 32upx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ transition: all 0.2s ease;
|
|
|
+ padding: 0;
|
|
|
+ line-height: 1;
|
|
|
+ white-space: nowrap;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ border-color: #3385ff;
|
|
|
+ background-color: #3385ff;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.discount-popup-container {
|
|
|
+ width: 600upx;
|
|
|
+ padding: 30upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-popup-title {
|
|
|
+ font-size: 32upx;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+ text-align: center;
|
|
|
+ color: #333;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-quick-buttons {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: center;
|
|
|
+ gap: 15upx;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-divider {
|
|
|
+ height: 1upx;
|
|
|
+ background-color: #f0f0f0;
|
|
|
+ margin: 20upx 0;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-custom-section {
|
|
|
+ margin-bottom: 30upx;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-custom-label {
|
|
|
+ font-size: 28upx;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 15upx;
|
|
|
+ color: #333;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-custom-input-group {
|
|
|
+ display: flex;
|
|
|
+ gap: 10upx;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-custom-input {
|
|
|
+ flex: 1;
|
|
|
+ border: 1upx solid #ddd;
|
|
|
+ border-radius: 8upx;
|
|
|
+ padding: 12upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ min-height: 70upx;
|
|
|
+ line-height: 45upx;
|
|
|
+}
|
|
|
+
|
|
|
+.discount-action-buttons {
|
|
|
+ display: flex;
|
|
|
+ gap: 15upx;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+
|
|
|
.admin-button-com {
|
|
|
margin-right: 30upx;
|
|
|
&.active {
|