lhl 3 yıl önce
ebeveyn
işleme
1e2e272a90

+ 17 - 12
components/uni-popup/uni-popup-dialog.vue

@@ -7,9 +7,9 @@
 			<text class="uni-dialog-content-text" v-if="mode === 'base'">{{content}}</text>
 			<input v-else class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholder" :focus="focus">
 		</view>
-		<view class="uni-dialog-picker">
+		<view class="uni-dialog-picker" if="isSkm">
 			<picker @change="bindPickerChange" :value="index" :range="array">
-				<view class="uni-input">{{array[index]}}</view>
+				<view class="picker-val">支付方式:{{array[index]}}</view>
 			</picker>
 		</view>
 		<view class="uni-dialog-button-group">
@@ -91,9 +91,9 @@
 				type: Boolean,
 				default: false
 			},
-			code: {
-				type: String,
-				default: ''
+			isSkm: {
+				type: Boolean,
+				default: false
 			}
 		},
 		data() {
@@ -101,7 +101,8 @@
 				dialogType: 'error',
 				focus: false,
 				val: "",
-				isSkm: false,
+				array: ['余额','消费券','积分'],
+				index:0
 			}
 		},
 		inject: ['popup'],
@@ -117,10 +118,6 @@
 			value(val) {
 				this.val = val
 			},
-			code(val) {
-				let isnum = /^\d+$/.test(val);
-				this.isSkm = isnum
-			}
 		},
 		created() {
 			// 对话框遮罩不可点击
@@ -158,8 +155,9 @@
 				this.popup.close()
 			},
 			// 改变支付方式
-			bindPickerChange() {
-				
+			bindPickerChange(e) {
+				this.index = e.target.value
+				this.$emit('changeShowPayType',this.index)
 			}
 		}
 	}
@@ -258,4 +256,11 @@
 	.uni-popup__info {
 		color: #909399;
 	}
+	.picker-val {
+		padding: 0rpx 0 30rpx 30rpx;
+		// text-align: center;
+		font-size: 14px;
+		width: 100%;
+		// background-color: red;
+	}
 </style>

+ 13 - 3
pages/received/index.vue

@@ -63,7 +63,8 @@
 			</view>
 		</view>
 		<uniPopup ref="popup1" type="dialog">
-			<uni-popup-dialog
+			<uni-popup-dialog
+				:isSkm="isSkm"
 				mode="input"
 				type="input"
 				title="支付"
@@ -71,7 +72,8 @@
 				:duration="2000"
 				:before-close="true"
 				@close="close"
-				@confirm="confirm"
+				@confirm="confirm"
+				@changeShowPayType="changeShowPayType"
 			></uni-popup-dialog>
 		</uniPopup>
 		<uniPopup ref="popup2" type="message"><uni-popup-message type="success" message="支付成功" :duration="2000"></uni-popup-message></uniPopup>
@@ -135,6 +137,7 @@ export default {
 	// #endif
 	data() {
 		return {
+			isSkm: false,
 			showPayType: 0,
 			payType: 0,//付款码type 0-余额  1-消费券  2-积分
 			payTypeShow:0,//付款码type 0-余额  1-消费券  2-积分
@@ -413,7 +416,8 @@ export default {
 				this.receivedCollectionCode();
 			}
 			// 扫码收付款
-			if (item === 2) {
+			if (item === 2) {
+				this.$refs.popup1.open();
 				clearInterval(this.setTimeOutPay);
 				this.ToChangeInto();
 				return;
@@ -431,6 +435,7 @@ export default {
 				success: function(res) {
 					let i = res.resultStr.split(",");
 					obj.code = i[0];
+					obj.isSkm = /^\d+$/.test(obj.code);
 					obj.payTypeShow = i[1]*1
 					
 					obj.$refs.popup1.open();
@@ -443,6 +448,8 @@ export default {
 				success: function(e) {
 					let i = e.result.split(",");
 					obj.code = i[0];
+					obj.code = i[0];
+					obj.isSkm = /^\d+$/.test(obj.code);
 					obj.payTypeShow = i[1]*1
 					obj.$refs.popup1.open();
 				}
@@ -513,6 +520,9 @@ export default {
 			this.$refs.popupPay.close()
 			console.log(this.payType)
 			this.clickItem(0)
+		},
+		changeShowPayType(e) {
+			this.payTypeShow = e
 		}
 	}
 };