zhangdan vor 4 Jahren
Ursprung
Commit
5f3d363ea9
2 geänderte Dateien mit 50 neuen und 46 gelöschten Zeilen
  1. 1 1
      components/uni-popup/uni-popup-dialog.vue
  2. 49 45
      pages/index/addData.vue

+ 1 - 1
components/uni-popup/uni-popup-dialog.vue

@@ -217,7 +217,7 @@
 	}
 
 	.uni-button-color {
-		color: $uni-color-primary;
+		color: #0DC55F;
 	}
 
 	.uni-dialog-input {

+ 49 - 45
pages/index/addData.vue

@@ -1,41 +1,42 @@
 <template>
 	<view class="content">
-		<view class="form-data">
-			<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
-					<u-form-item label="其他垃圾:" >
-						<u-input placeholder="请输入" :maxlength="30" v-model="form.receiverName" />
-						<text slot="right" style="color: #000000;">桶(约{{125}}kg)</text>
-					</u-form-item>
-					<u-form-item label="厨余垃圾:" >
-						<u-input placeholder="请输入" :maxlength="11" type="number" v-model="form.receiverPhone" />
-						<text slot="right" style="color: #000000;">桶(约{{125}}kg)</text>
-					</u-form-item>
-					<u-form-item label="建筑垃圾:" >
-						<u-input placeholder="请输入" :maxlength="11" type="number" v-model="form.receiverPhone" />
-						<text slot="right" style="color: #000000;">吨(约{{125}}kg)</text>
-					</u-form-item>
-			</u-form>
-		</view>
-		<view class="form-data remark">
-			<text>信息备注</text>
-			<textarea :auto-height="true" :maxlength="500" v-model="form.receiveAddress" class="receiveAddress"/>
-		</view>
-		<view class="form-data qyImg">
-			<text>清运照片</text>
-			<view class="info-main">
-				<view class="photograph-con">
-					<u-icon v-show="photograph" name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph"></u-icon>
-					<u-icon v-show="!photograph" name="camera" color="#bfbfbf" size="60" class="photograph-icon"></u-icon>
-					<!-- <u-image src="/static/camera.png"></u-image> -->
-					<u-image v-show="photograph" width="100%" height="100%" :src="photograph" @click="previewPictures"></u-image>
+		<view>
+			<view class="form-data">
+					<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
+							<u-form-item label="其他垃圾:" >
+								<u-input placeholder="请输入" :maxlength="30" v-model="form.receiverName" />
+								<text slot="right" style="color: #000000;">桶(约{{125}}kg)</text>
+							</u-form-item>
+							<u-form-item label="厨余垃圾:" >
+								<u-input placeholder="请输入" :maxlength="11" type="number" v-model="form.receiverPhone" />
+								<text slot="right" style="color: #000000;">桶(约{{125}}kg)</text>
+							</u-form-item>
+							<u-form-item label="建筑垃圾:" >
+								<u-input placeholder="请输入" :maxlength="11" type="number" v-model="form.receiverPhone" />
+								<text slot="right" style="color: #000000;">吨(约{{125}}kg)</text>
+							</u-form-item>
+					</u-form>
 				</view>
-			</view>
-		</view>
-		<view class="buttons">
-			<u-button  @click="submit" class="submit" type="success">提交</u-button>
+				<view class="form-data remark">
+					<text>信息备注</text>
+					<textarea :auto-height="true" :maxlength="500" v-model="form.receiveAddress" class="receiveAddress"/>
+				</view>
+				<view class="form-data qyImg">
+					<text>清运照片</text>
+					<view class="info-main">
+						<view class="photograph-con">
+							<u-icon v-show="photograph" name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph"></u-icon>
+							<u-icon v-show="!photograph" name="camera" color="#bfbfbf" size="60" class="photograph-icon"></u-icon>
+							<!-- <u-image src="/static/camera.png"></u-image> -->
+							<u-image v-show="photograph" width="100%" height="100%" :src="photograph" @click="previewPictures"></u-image>
+						</view>
+					</view>
+				</view>
+			<u-button  @click="open" class="submitBtn" type="success" shape="circle">提交</u-button>
+			<uni-popup ref="openModal" type="center">
+				<uni-popup-dialog content="确认提交吗?" @close="close" @confirm="onOk" :title="title"></uni-popup-dialog>
+			</uni-popup>
 		</view>
-		<!-- 确认弹框 -->
-			<!-- <modal v-model="show" :content="content" :show-title='false' :show-cancel-button='true' confirm-color="#0DC55F"  @bindconfirm="confirm"  bindcancel="cancel"></modal> -->
 	</view>
 </template>
 
@@ -43,16 +44,16 @@
 	import {
 		saveAddress
 	} from '@/api/receiveAddress.js'
-	import Address from '@/components/address.vue'
+	import uniPopup from '@/components/uni-popup/uni-popup.vue'
+	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
 	export default {
 		components: {
-			Address
+			uniPopup,uniPopupDialog
 		},
 		data() {
 			return {
-				// show: false,
+				title:'',
 				show:false,
-				content:'确认提交吗?',
 				src:"",
 				photograph: [], //  图片路径
 				form: {
@@ -129,14 +130,17 @@
 					this.photograph = '';
 				}, 500);
 			},
-			confirm(){
-				this.show=false
+			// 提交
+			open(){
+				this.$refs.openModal.open()
 			},
-			cancel(){
-				this.show=false
+			// 取消
+			close(){
 			},
-			submit() {
-				this.show=true
+			// 确认提交
+			onOk() {
+				this.$refs.openModal.open()
+				// this.show=true
 				
 				// this.$refs.uForm.validate(valid => {
 				// 	if (valid) {
@@ -276,7 +280,7 @@
 				}
 			}
 		}
-		.submit{
+		.submitBtn{
 			font-size: 32upx;
 			display: block;
 			width: 670upx;