shish 6 лет назад
Родитель
Сommit
7ad5883462
2 измененных файлов с 96 добавлено и 80 удалено
  1. 77 77
      mall/src/components/app-date-picker.vue
  2. 19 3
      mall/src/components/app-delivery.vue

+ 77 - 77
mall/src/components/app-date-picker.vue

@@ -1,87 +1,87 @@
 <template>
-	<view>
-		<picker :mode="mode" :value="date" :start="startDate2" :end="endDate2" @change="bindDateChange">
-			<slot>
-				<view class="uni-input">
-					<span v-if="placeholder && !date">{{placeholder}}</span>
-					<span v-else>{{date}}</span>
-					<span></span>
-				</view>
-			</slot>
-		</picker>
-	</view>
+  <view>
+    <picker :mode="mode" :value="date" :start="startDate2" :end="endDate2" @change="bindDateChange">
+      <slot>
+        <view class="uni-input">
+          <span v-if="placeholder && !date">{{placeholder}}</span>
+          <span v-else>{{date}}</span>
+          <span></span>
+        </view>
+      </slot>
+    </picker>
+  </view>
 </template>
 
 <script>
 export default {
-	name: 'app-date-picker',
-	props: {
-		mode: {
-			type: String,
-			default: 'date'
-		},
-		placeholder: {
-			type: String,
-			default: null
-		},
-		dateVal: {
-			type: String,
-			default: ''
-		},
-		startDate: {
-			type: String,
-			default: ''
-		},
-		endDate: {
-			type: String,
-			default: ''
-		}
-	},
-	data() {
-		return {
-			date: null
-		}
-	},
-	watch: {
-		dateVal(val) {
-			this.date = val
-		}
-	},
-	computed: {
-		startDate2() {
-			console.log(this.getDate('start'))
-			return this.getDate('start')
-		},
-		endDate2() {
-			return this.getDate('end')
-		}
-	},
-	methods: {
-		bindDateChange: function(e) {
-			let val = e.target.value
-			this.date = val
-			console.log(val)
-			this.$emit('update:dateVal', val)
-			this.$emit('change', val)
-		},
-		getDate(type) {
-			const date = new Date()
-			let year = date.getFullYear()
-			let month = date.getMonth() + 1
-			let day = date.getDate()
+  name: "app-date-picker",
+  props: {
+    mode: {
+      type: String,
+      default: "date"
+    },
+    placeholder: {
+      type: String,
+      default: null
+    },
+    dateVal: {
+      type: String,
+      default: ""
+    },
+    startDate: {
+      type: String,
+      default: ""
+    },
+    endDate: {
+      type: String,
+      default: ""
+    }
+  },
+  data() {
+    return {
+      date: null
+    };
+  },
+  watch: {
+    dateVal(val) {
+      this.date = val;
+    }
+  },
+  computed: {
+    startDate2() {
+      console.log(this.getDate("start"));
+      return this.getDate("start");
+    },
+    endDate2() {
+      return this.getDate("end");
+    }
+  },
+  methods: {
+    bindDateChange: function(e) {
+      let val = e.target.value;
+      this.date = val;
+      console.log(val);
+      this.$emit("update:dateVal", val);
+      this.$emit("change", val);
+    },
+    getDate(type) {
+      const date = new Date();
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      let day = date.getDate();
 
-			if (type === 'start') {
-				year = this.startDate
-			} else if (type === 'end') {
-				year = this.endDate
-			}
+      if (type === "start") {
+        year = this.startDate;
+      } else if (type === "end") {
+        year = this.endDate;
+      }
 
-			month = month > 9 ? month : '0' + month
-			day = day > 9 ? day : '0' + day
-			return `${year}-${month}-${day}`
-		}
-	}
-}
+      month = month > 9 ? month : "0" + month;
+      day = day > 9 ? day : "0" + day;
+      return `${year}-${month}-${day}`;
+    }
+  }
+};
 </script>
 
 <style scoped>

+ 19 - 3
mall/src/components/app-delivery.vue

@@ -61,10 +61,12 @@
       </tui-list-cell>-->
       <tui-list-cell class="line-cell" :hover="false">
         <div class="tui-title">我的电话</div>
+
+        <!-- #ifdef MP-WEIXIN -->
         <input
           v-model="form.bookMobile"
           placeholder-class="phcolor"
-          style="width:280rpx;"
+          style="width:330rpx;"
           disabled
           class="tui-input"
           name="bookMobile"
@@ -76,7 +78,21 @@
           @click="showPopup"
           open-type="getPhoneNumber"
           @getphonenumber="getWxMobile"
-        >自动填写</button>
+          style="padding:12rpx 25rpx;"
+        >帮我填</button>
+        <!-- #endif -->
+
+        <!-- #ifndef MP-WEIXIN -->
+        <input
+          v-model="form.bookMobile"
+          placeholder-class="phcolor"
+          class="tui-input"
+          name="bookMobile"
+          placeholder="送到了通知您(选填)"
+          type="number"
+        />
+        <!-- #endif -->
+
       </tui-list-cell>
       <tui-list-cell class="line-cell" :hover="false" :arrow="true">
         <div class="tui-title">送达时间</div>
@@ -385,4 +401,4 @@ export default {
     }
   }
 }
-</style>
+</style>