Browse Source

check list

lhl 1 year ago
parent
commit
7ae8bef061

+ 15 - 0
api/store.js

@@ -555,4 +555,19 @@ export function getSeverCardList(data) {
 //获取服务卡详情
 export function getSeverCardDetail(id) {
 	return request.get(`v2/service_card/${id}`);
+}
+
+//获取服务项目
+export function getServeItem(data) {
+	return request.get("v2/Project", data);
+}
+
+//获取服务项目详情
+export function getServeItemDetail(id) {
+	return request.get("v2/Project/" + id);
+}
+
+export function getMen(data) {
+	// api/work/member//
+	return request.get("work/member", data);
 }

+ 12 - 0
pages.json

@@ -141,6 +141,12 @@
             }
           }
         },
+		{
+		  "path": "user_order/index",
+		  "style": {
+		    "navigationBarTitleText": "我的服务卡"
+		  }
+		},
         {
           "path": "message_center/index",
           "style": {
@@ -1771,6 +1777,12 @@
             }
           }
         },
+		{
+		    "path": "goods_list/list",
+		    "style": {
+		      "navigationBarTitleText": "商品列表"
+		    }
+		  },
         {
           "path": "goods_search/index",
           "style": {

+ 51 - 2
pages/goods/components/deliveryMethod/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<!-- 选择门店 -->
-		<view class="product-window on" :class="[module?'ons':'']">
+		<view class="product-window on" :class="[module?'ons':'']" v-if="ptype != 6">
 			<view class="store-box">
 				<view class="store-title" :class="isDisplay.length>1?'on':''">配送</view>
 				<view class="iconfont icon-guanbi5" @click="module=false" />
@@ -44,6 +44,49 @@
 				<view class="btn" @click="define">确认</view>
 			</view>
 		</view>
+		<view class="product-window on" :class="[module?'ons':'']" v-if="ptype ==6">
+			<view class="store-box">
+				<view class="store-title" :class="isDisplay.length>1?'on':''">选择门店</view>
+				<view class="iconfont icon-guanbi5" @click="module=false" />
+				<!-- <view class="cart acea-row row-middle" v-if="isDisplay.length>1">
+					<view class="mode acea-row row-center-wrapper" v-if="isDisplay.includes('1')"
+						@click="storeNewInfofN(1)" :class="flag==1?'select':''">商城配送
+					</view>
+					<view class="mode acea-row row-center-wrapper" v-if="isDisplay.includes('2') && storeSelfMention"
+						@click="storeNewInfofN(2)" :class="flag==2?'select':''">门店自提
+					</view>
+					<view class="mode acea-row row-center-wrapper" v-if="isDisplay.includes('3')"
+						@click="storeNewInfofN(3)" :class="flag==3?'select':''">门店配送
+					</view>
+				</view> -->
+				<view class="list-box" >
+					<view class="list acea-row row-between-wrapper" v-for="(item,index) in storeList" :key="index" @click="activeFn(index,item)"
+						:class="{active:sortIndex===index}">
+						<text class="iconfont icon-xuanzhong6" v-if="sortIndex===index"></text>
+						<view class="left">
+							<view class="name line1">{{item.name}}</view>
+							<view class="adress acea-row">
+								<text class="iconfont icon-dingwei2" />
+								<view class="detail">{{item.detailed_address}}</view>
+							</view>
+							<view class="adress">
+								<text class="iconfont icon-yingyeshijian2" />
+								营业时间:{{item.day_time}}
+							</view>
+						</view>
+						<view class="right">
+							<view class="font-num" @click.stop="goStore(item)">进店选购</view>
+							<view class="km">距离{{item.range}}km</view>
+							<view class="icon acea-row row-center">
+								<view class="iconfont icon-dianhua" @click.stop="call(item.phone)"></view>
+								<view class="iconfont icon-dingwei2" @click.stop="showMaoLocation(item)"></view>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="btn" @click="define">确认</view>
+			</view>
+		</view>
 		<view class="mask" @touchmove.prevent @click="module=false" v-if="module"></view>
 	</view>
 </template>
@@ -51,6 +94,10 @@
 <script>
 	export default {
 		props: {
+			ptype: {
+				type: Number,
+				default:0
+			},
 			isDisplay: {
 				type: Array,
 				default:()=>[]
@@ -83,7 +130,9 @@
 				this.storeItem = v[0];
 			}
 		},
-		mounted() {},
+		mounted() {
+			console.log(this.storeList,'storeList')
+		},
 		methods: {
 			// 跳转门店
 			goStore(item){

+ 228 - 0
pages/goods/goods_list/list.vue

@@ -0,0 +1,228 @@
+<template>
+	<view class="content">
+		<view class="good-list">
+			<view class="good" v-for="item in list" @click="navTo('/pages/goods_details/index?id=' + item.product.id)">
+				<image :src="item.slider_image" mode="" class="good-image"></image>
+				<view class="good-name ">
+					<view class="clamp">
+						{{item.store_name}}
+					</view>
+				</view>
+				<view class="time-wrap">
+					<view class="time">
+						时间:{{item.product.unit_name}}
+					</view>
+
+				</view>
+				<view class="good-price">
+					<view class="price">
+						¥{{item.product.price}}
+					</view>
+					<view class="xl">
+					</view>
+				</view>
+			</view>
+		</view>
+		<u-loadmore :status="loadingType" />
+	</view>
+</template>
+
+<script>
+	import {
+		getServeItem
+	} from "@/api/store.js"
+	export default {
+		data() {
+			return {
+				list: [],
+				type: 0,
+				page: 1,
+				limit: 100,
+				loadingType: 'loadmore'
+			}
+		},
+		onLoad(opt) {
+			if (opt.type) {
+				this.type = opt.type
+			}
+			this.getList()
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+			// this.getList()
+		},
+		onReady() {
+
+		},
+		methods: {
+			navTo(url) {
+				uni.navigateTo({
+					url
+				});
+			},
+			getList() {
+				let that = this;
+				let getList;
+				if (that.loadingType == 'loading' || that.loadingType == 'nomore') {
+					return
+				}
+				that.loadingType = 'loading'
+				if (that.type == 0) {
+					getList = getServeItem
+				}
+				getList({
+					page: that.page,
+					pageSize: that.limit,
+					service_card_id: 0
+				}).then(res => {
+					console.log(res)
+					let arr = res.data.list
+					that.list = that.list.concat(arr)
+					console.log(that.list)
+					that.page++
+					if (arr.length == that.limit) {
+						that.loadingType = 'loadmore'
+					} else {
+						that.loadingType = 'nomore'
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.gq-list {
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: flex-start;
+		// justify-content: space-between;
+		padding: 20rpx 0 20rpx 20rpx;
+	}
+
+	.gq-item {
+		margin: 0 0 20rpx 14rpx;
+		width: 227rpx;
+		// height: 425rpx;
+		background: #FFFFFF;
+		box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
+		border-radius: 10rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: space-between;
+		padding: 15rpx 14rpx;
+
+		.gq-logo {
+			width: 182rpx;
+			height: 192rpx;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			margin-bottom: 20rpx;
+
+			image {
+				width: 182rpx;
+				height: 192rpx;
+				background-color: #eee;
+			}
+		}
+
+		.store-name {
+			padding-top: 10rpx;
+			text-align: center;
+			width: 100%;
+			font-size: 26rpx;
+			font-weight: 500;
+			color: #262261;
+			overflow: hidden;
+		}
+
+		.info {
+			width: 100%;
+			display: flex;
+			padding: 5rpx 0;
+
+			.info-tit {
+				font-size: 18rpx;
+				flex-shrink: 0;
+			}
+
+			.info-val {
+				flex-grow: 1;
+				text-align: center;
+				font-size: 20rpx;
+				width: 140rpx;
+				border-bottom: 1px #C7C7C7 solid;
+			}
+		}
+
+	}
+
+	.good-list {
+		display: flex;
+		justify-content: space-between;
+		flex-wrap: wrap;
+		padding: 20rpx 28rpx;
+
+		.good {
+			width: 336rpx;
+			height: 500rpx;
+			background: #FFFFFF;
+			box-shadow: 0px 0px 6rpx 0px rgba(0, 0, 0, 0.1);
+			border-radius: 14rpx;
+			margin-bottom: 20rpx;
+			position: relative;
+
+			.good-image {
+				width: 336rpx;
+				height: 336rpx;
+				background-color: #eee;
+				border-radius: 14rpx 14rpx 0 0;
+			}
+
+			.good-name {
+				font-size: 28rpx;
+				font-weight: bold;
+				color: #333333;
+				padding: 0 20rpx;
+			}
+
+			.good-key {
+				font-size: 22rpx;
+				font-weight: 500;
+				color: #999999;
+				padding-left: 20rpx
+			}
+
+			.time {
+				padding: 5rpx 10rpx;
+				border: 1px solid #ff6973;
+				color: #ff6973;
+				display: inline-block;
+				margin: 10rpx 0;
+				margin-left: 20rpx;
+			}
+
+			.good-price {
+				display: flex;
+				width: 336rpx;
+				justify-content: space-between;
+				font-size: 28rpx;
+				font-weight: bold;
+				color: #ff6973;
+				position: absolute;
+				bottom: 20rpx;
+				padding: 0 20rpx;
+
+				.xl {
+					font-size: 20rpx;
+					font-weight: bold;
+					color: #999999;
+				}
+			}
+		}
+	}
+</style>

File diff suppressed because it is too large
+ 745 - 641
pages/goods/order_confirm/index.vue


+ 38 - 18
pages/goods_details/index.vue

@@ -170,16 +170,23 @@
 													<view>预售结束后{{ storeInfo.presale_day }}天内发货</view>
 												</view>
 												<view class="label acea-row row-middle skeleton-rect"
-													v-if="!storeInfo.is_presale_product">
-													<view class="item" v-text="'原价:¥' + (storeInfo.ot_price || 0)"
-														v-if="diyProduct.is_ot_price"></view>
-													<view class="item" :class="diyProduct.is_ot_price?'stock':''"
-														v-text="'库存:' + (storeInfo.stock || 0) + (storeInfo.unit_name || '')"
-														v-if="diyProduct.is_stock"></view>
-													<view class="item"
-														:class="diyProduct.is_ot_price && diyProduct.is_stock?'sales':''"
-														v-text="'销量:' + (storeInfo.fsales || 0) + (storeInfo.unit_name || '')"
-														v-if="diyProduct.is_sales"></view>
+													v-if="!storeInfo.is_presale_product ">
+													<template v-if="storeInfo.product_type !== 6">
+														<view class="item" v-text="'原价:¥' + (storeInfo.ot_price || 0)"
+															v-if="diyProduct.is_ot_price"></view>
+														<view class="item" :class="diyProduct.is_ot_price?'stock':''"
+															v-text="'库存:' + (storeInfo.stock || 0) + (storeInfo.unit_name || '')"
+															v-if="diyProduct.is_stock"></view>
+														<view class="item"
+															:class="diyProduct.is_ot_price && diyProduct.is_stock?'sales':''"
+															v-text="'销量:' + (storeInfo.fsales || 0) + (storeInfo.unit_name || '')"
+															v-if="diyProduct.is_sales"></view>
+													</template>
+													<!-- <template v-else>
+														<view class="item"
+															v-text="'时长:' + storeInfo.unit_name"
+															></view>
+													</template> -->
 												</view>
 												<view v-if="!is_money_level && storeInfo.vip_price && storeInfo.is_vip"
 													class="svipCon acea-row row-between-wrapper skeleton-rect"
@@ -562,7 +569,8 @@
 		postCartAdd,
 		newcomerDetail,
 		diyProduct,
-		getProductStoreDetail
+		getProductStoreDetail,
+		getServeItemDetail
 	} from '@/api/store.js';
 	import {
 		getUserInfo,
@@ -639,6 +647,8 @@
 		data() {
 			let that = this;
 			return {
+				cardInfo: {},//对应的服务卡信息
+				itemInfo: {},//对应的项目信息
 				showSkeleton: true, //骨架屏显示隐藏
 				isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
 				//属性是否打开
@@ -784,7 +794,8 @@
 				activityBg:'',
 				posterTitle:'',
 				is_store_buy:1, //判断平台是否有库存(0:平台有库存;1:平台没有库存)
-				storeList:{}
+				storeList:{},
+				btype: 0,//3->服务项目
 			};
 		},
 		computed: mapGetters(['isLogin']),
@@ -825,6 +836,7 @@
 			// #ifndef MP
 			that.navH = 96;
 			// #endif
+			this.btype = options.btype;
 			that.id = options.id;
 			that.isShow = options.isShow;
 			that.promotions_type = options.promotions_type || 0;
@@ -1491,6 +1503,13 @@
 					})
 					.then(res => {
 						let storeInfo = res.data.storeInfo;
+						console.log('storeInfo.price_type',storeInfo.product_type)
+						if(storeInfo.product_type == 5) {
+							this.cardInfo = res.data.card
+							console.log(this.cardInfo,'this.cardInfo')
+						}else if(storeInfo.product_type == 6) {
+							this.itemInfo = res.data.Project
+						}
 						if(storeInfo.type == 1){
 						  if(storeInfo.delivery_type.indexOf('1') !=-1){//在门店首页确保选择门店配送或是自提
 							  storeInfo.delivery_type.sort((x, y) => x - y);
@@ -1895,15 +1914,16 @@
 					cartNum: that.attr.productSelect.cart_num,
 					new: news === undefined ? 0 : 1,
 					uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '',
-					store_id: this.store_id,
-					addressId: this.addressId,
-					delivery_type: this.delivery_type,
-					ServiceCardId: this.storeInfo.product_type == 5 ? this.storeInfo.id : 0
+					store_id: that.store_id,
+					addressId: that.addressId,
+					delivery_type: that.delivery_type,
+					ServiceCardId: that.storeInfo.product_type == 5 ? that.cardInfo.id : 0,
+					projectId: that.storeInfo.product_type == 6 ? that.itemInfo.id: 0
 				};
 				if (that.fromPage) {
 					q.productId = that.storeInfo.product_id;
 					q.newcomerId = that.id;
-				} else if(that.is_store_buy || this.delivery_type == 2 || this.delivery_type == 3){
+				} else if(that.is_store_buy || that.delivery_type == 2 || that.delivery_type == 3){
 					q.productId = that.storeInfo.id; //重新调用门店详情后的赋值id
 				} else {
 					q.productId = that.id;
@@ -1918,7 +1938,7 @@
 								url: '/pages/goods/order_confirm/index?new=1&cartId=' + res.data.cartId +
 									'&delivery_type=' + delivery_type + '&addressId=' + that.addressId +
 									'&store_id=' + that.store_id + '&store_name=' + that.store_name +
-									'&product_id=' + that.storeInfo.id
+									'&product_id=' + that.storeInfo.id + '&product_type=' + that.storeInfo.product_type
 							});
 						} else {
 							that.$util.Tips({

+ 156 - 0
pages/users/user_order/index.vue

@@ -0,0 +1,156 @@
+<template>
+	<view  style="height: 100vh">
+		<view class="content">
+			<view class="dyquan-wrap" v-for="(item,index) in list" :key="index">
+				<view class="showtime">
+					<text class="float_left order-no-text">{{ item.createTime|| '' }}</text>
+				</view>
+				<view class="item-info">
+					<image :src="item.image" mode=""></image>
+					<view class="info-info">
+						<view class="clamp2">
+							{{item.name || ''}}
+						</view>
+						<view class="info-cs">
+							剩余使用次数:{{item.number || ''}}
+						</view>
+					</view>
+				</view>
+			</view>
+
+			<u-loadmore :status="loadingType" />
+		</view>
+	</view>
+</template>
+
+<script>
+	import { getMyServeList} from "@/api/user.js"
+	export default {
+		data() {
+			return {
+				page: 1,
+				pageSize: 10,
+				loaded: false,
+				loadingType: 'loadmore',
+				list: []
+			}
+		},
+		onLoad(opt) {
+
+		},
+		onShow() {
+			this.getList()
+		},
+		onReachBottom() {
+			this.getList()
+		},
+		onReady() {
+
+		},
+		methods: {
+			tabClick(item, index) {
+				this.tabCurrentIndex = index;
+			},
+			getList(type) {
+				let that = this
+				if (type == 'reload') {
+					// item.list
+					return
+				}
+				if (type == 'tab' && that.loaded) {
+					return
+				}
+				if (that.loadingType == 'loading' || that.loadingType == 'nomore') {
+					return
+				}
+				that.loadingType = 'loading'
+
+				getMyServeList({
+					page: that.page,
+					pageSize: that.pageSize,
+					name: ''
+				}).then(({
+					data
+				}) => {
+					that.list = that.list.concat(data)
+					that.page++
+					if (data.length == that.pageSize) {
+						that.loadingType = 'loadmore'
+					} else {
+						that.loadingType = 'nomore'
+					}
+				})
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.content {
+		background-color:#f8f6f6 ;
+		height: auto;
+		min-height: 100%;
+		
+	}
+	.dyquan-wrap {
+		padding: 20rpx;
+		background-color: #fff;
+		margin-bottom: 15rpx;
+		.showtime {
+			height: 50rpx;
+		}
+		.item-info {
+			width: 750rpx;
+			height: 205rpx;
+			background: #F7F7F7;
+			display: flex;
+			justify-content: flex-start;
+			align-items: center;
+			
+			image {
+				width: 160rpx;
+				height: 160rpx;
+				margin-right: 30rpx;
+			}
+
+			.info-info {
+				height: 160rpx;
+				padding: 15rpx 0;
+				padding-right: 50rpx;
+				font-size: 30rpx;
+				font-weight: 500;
+				color: #666666;
+				display: flex;
+				flex-direction: column;
+				justify-content: space-between;
+				align-items: flex-start;
+				.info-cs {
+					font-size: 26rpx;
+					font-weight: 500;
+					color: #999999;
+				}
+			}
+		}
+
+		.btm {
+			width: 100%;
+			height: 95rpx;
+			background-color: #fff;
+			display: flex;
+			justify-content: flex-end;
+			align-items: center;
+
+			.btn {
+				width: 144rpx;
+				height: 55rpx;
+				border-radius: 28rpx;
+				font-size: 26rpx;
+				font-weight: 500;
+				color: #FFFFFF;
+				line-height: 55rpx;
+				text-align: center;
+			}
+		}
+	}
+</style>

+ 43 - 0
uni_modules/buuug7-simple-datetime-picker_0.7.0/changelog.md

@@ -0,0 +1,43 @@
+# CHANGELOG
+
+## 0.7.0(2023-07-11)
+- 增加`time-init`属性, 自定义初始时间, 默认为当前时间, 值为时间戳
+## 0.6.0(2023-07-11)
+
+- 增加对秒的选择
+- 增加`timeHidden`属性, 自定义年月日时分秒自由显示
+- 增加`timeLabel`属性, 自定义界面时间单位,默认为 `["年", "月", "日", "时", "分", "秒"]`
+- 修复微信小程序中无法定位到当前时间
+
+## 0.5.0(2021-08-17)
+
+- refactor
+
+## 0.4.1(2021-08-17)
+
+- update readme.md
+
+## 0.4.0(2021-08-17)
+
+- 移除组件 `color` 属性
+- update readme.md
+
+## 0.3.3(2021-08-15)
+
+- 修改插件基本信息
+
+## 0.3.2(2021-08-15)
+
+- 更新文档
+
+## 0.3.1(2021-08-15)
+
+- fix
+
+## 0.3.0(2019-07-22)
+
+- 增加 color 属性,可以更换按钮颜色
+
+## 0.0.4(2019-07-17)
+
+- 增加从 npm 安装方式

+ 342 - 0
uni_modules/buuug7-simple-datetime-picker_0.7.0/components/buuug7-simple-datetime-picker/buuug7-simple-datetime-picker.vue

@@ -0,0 +1,342 @@
+<template>
+  <view class="buuug7-simple-datetime-picker" v-if="done">
+    <view
+      class="mask"
+      :class="{ show: open }"
+      @touchmove.stop.prevent
+      catchtouchmove="true"
+    >
+    </view>
+    <view class="wrap" :class="{ show: open }">
+      <view class="picker-header" @touchmove.stop.prevent catchtouchmove="true">
+        <view class="btn-picker cancel" @click="open = false">取消</view>
+        <view class="btn-picker submit" @click="_onSubmit">确定</view>
+      </view>
+      <view class="picker-body">
+        <picker-view :value="value" @change="_onChange">
+          <picker-view-column v-if="timeHide[0]">
+            <view class="column-item" v-for="item in years" :key="item">
+              {{ item + timeLabel[0] }}
+            </view>
+          </picker-view-column>
+          <picker-view-column v-if="timeHide[1]">
+            <view class="column-item" v-for="item in months" :key="item">
+              {{ formatNum(item) + timeLabel[1] }}
+            </view>
+          </picker-view-column>
+          <picker-view-column v-if="timeHide[2]">
+            <view class="column-item" v-for="item in days" :key="item">
+              {{ formatNum(item) + timeLabel[2] }}
+            </view>
+          </picker-view-column>
+          <picker-view-column v-if="timeHide[3]">
+            <view class="column-item" v-for="item in hours" :key="item">
+              {{ formatNum(item) + timeLabel[3] }}
+            </view>
+          </picker-view-column>
+          <picker-view-column v-if="timeHide[4]">
+            <view class="column-item" v-for="item in minutes" :key="item">
+              {{ formatNum(item) + timeLabel[4] }}
+            </view>
+          </picker-view-column>
+          <picker-view-column v-if="timeHide[5]">
+            <view class="column-item" v-for="item in seconds" :key="item">
+              {{ formatNum(item) + timeLabel[5] }}
+            </view>
+          </picker-view-column>
+        </picker-view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: "buuug7-simple-datetime-picker",
+  props: {
+    startYear: {
+      type: Number,
+      default: 2000,
+    },
+    endYear: {
+      type: Number,
+      default: 2099,
+    },
+    timeLabel: {
+      type: Array,
+      default: () => ["年", "月", "日", "时", "分", "秒"],
+    },
+    timeHide: {
+      type: Array,
+      default: () => [true, true, true, true, true, false],
+    },
+    timeInit: {
+      type: Number,
+      default: new Date().valueOf(),
+    },
+  },
+
+  data() {
+    return {
+      open: false,
+      years: [],
+      months: [],
+      days: [],
+      hours: [],
+      minutes: [],
+      seconds: [],
+      year: "",
+      month: "",
+      day: "",
+      hour: "",
+      minute: "",
+      second: "",
+      value: [0, 0, 0, 0, 0, 0],
+      done: false,
+    };
+  },
+
+  computed: {
+    currentDatetime() {
+      return new Date(this.timeInit);
+    },
+  },
+
+  mounted() {
+    this.init();
+  },
+
+  watch: {
+    month() {
+      this.initDays();
+    },
+  },
+
+  methods: {
+    init() {
+      this.initYears();
+      this.initMonths();
+      this.initDays();
+      this.initHours();
+      this.initMinutes();
+      this.initSeconds();
+      this.setSelectValue();
+      this.done = true;
+    },
+
+    initYears() {
+      const years = [];
+      for (let year = this.startYear; year <= this.endYear; year++) {
+        years.push(year);
+        if (this.currentDatetime.getFullYear() === year) {
+          this.$set(this.value, 0, year - this.startYear);
+        }
+      }
+      this.years = years;
+    },
+
+    initMonths() {
+      const months = [];
+      for (let month = 1; month <= 12; month++) {
+        months.push(month);
+        if (this.currentDatetime.getMonth() + 1 === month) {
+          this.$set(this.value, 1, month - 1);
+        }
+      }
+      this.months = months;
+    },
+
+    initDays() {
+      const value = this.value;
+      const selectedYear = this.years[value[0]];
+      const selectedMonth = this.months[value[1]];
+      const days = [];
+      const totalDays = new Date(selectedYear, selectedMonth, 0).getDate();
+      for (let day = 1; day <= totalDays; day++) {
+        days.push(day);
+        if (this.currentDatetime.getDate() === day) {
+          this.$set(value, 2, day - 1);
+        }
+      }
+      this.days = days;
+    },
+
+    initHours() {
+      const hours = [];
+      for (let hour = 0; hour <= 23; hour++) {
+        hours.push(hour);
+        if (this.currentDatetime.getHours() === hour) {
+          this.$set(this.value, 3, hour);
+        }
+      }
+      this.hours = hours;
+    },
+
+    initMinutes() {
+      const minutes = [];
+      for (let minute = 0; minute < 60; minute++) {
+        minutes.push(minute);
+        if (this.currentDatetime.getMinutes() === minute) {
+          this.$set(this.value, 4, minute);
+        }
+      }
+      this.minutes = minutes;
+    },
+
+    initSeconds() {
+      const seconds = [];
+      for (let second = 0; second < 60; second++) {
+        seconds.push(second);
+        if (this.currentDatetime.getSeconds() === second) {
+          this.$set(this.value, 5, second);
+        }
+      }
+      this.seconds = seconds;
+    },
+
+    show() {
+      this.open = true;
+    },
+
+    hide() {
+      this.open = false;
+    },
+
+    _onChange(e) {
+      this.value = e.detail.value;
+      this.setSelectValue();
+    },
+
+    setSelectValue() {
+      const v = this.value;
+
+      this.year = this.years[v[0]];
+      this.month = this.months[v[1]];
+      this.day = this.days[v[2]];
+      this.hour = this.hours[v[3]];
+      this.minute = this.minutes[v[4]];
+      this.second = this.seconds[v[5]];
+    },
+
+    _onSubmit() {
+      const {
+        year,
+        month,
+        day,
+        hour,
+        minute,
+        second,
+        formatNum,
+        timeHide,
+        timeLabel,
+      } = this;
+      const result = {
+        year: timeHide[0] ? formatNum(year) : "",
+        month: timeHide[1] ? formatNum(month) : "",
+        day: timeHide[2] ? formatNum(day) : "",
+        hour: timeHide[3] ? formatNum(hour) : "",
+        minute: timeHide[4] ? formatNum(minute) : "",
+        second: timeHide[5] ? formatNum(second) : "",
+      };
+		let yytime = `${result.year}-${result.month}-${result.day} ${result.hour}:${result.minute}`;
+		let newTime = new Date()
+		let date = new Date(yytime)
+		if(date.getTime() < newTime.getTime() ) {
+			this.$emit("err");				   
+		}else {
+			this.$emit("submit", result);
+			this.hide();
+		}
+     
+    },
+
+    formatNum(num) {
+      return num < 10 ? "0" + num : num + "";
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+$transition: all 0.3s ease;
+$primary: #488ee9;
+
+.buuug7-simple-datetime-picker {
+  position: relative;
+  z-index: 999;
+  picker-view {
+    height: 100%;
+  }
+  .mask {
+    position: fixed;
+    z-index: 1000;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    background-color: rgba(0, 0, 0, 0.4);
+    visibility: hidden;
+    opacity: 0;
+    transition: $transition;
+    &.show {
+      visibility: visible;
+      opacity: 1;
+    }
+  }
+  .wrap {
+    z-index: 1001;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    transition: $transition;
+    transform: translateY(100%);
+    &.show {
+      transform: translateY(0);
+    }
+  }
+  .picker-header {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    padding: 8px 8px;
+    background-color: darken(#fff, 2%);
+    background-color: #fff;
+  }
+  .picker-body {
+    width: 100%;
+    height: 420rpx;
+    overflow: hidden;
+    background-color: #fff;
+  }
+  .column-item {
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+  .btn-picker {
+    position: relative;
+    display: inline-block;
+    padding-left: 10px;
+    padding-right: 10px;
+    box-sizing: border-box;
+    text-align: center;
+    text-decoration: none;
+    line-height: 2;
+    -webkit-tap-highlight-color: transparent;
+    overflow: hidden;
+    background-color: #eee;
+    font-size: 14px;
+    border-radius: 3px;
+    color: #000;
+    cursor: pointer;
+  }
+  .btn-picker.submit {
+    background-color: $primary;
+    color: #fff;
+  }
+}
+</style>

+ 77 - 0
uni_modules/buuug7-simple-datetime-picker_0.7.0/package.json

@@ -0,0 +1,77 @@
+{
+  "id": "buuug7-simple-datetime-picker",
+  "displayName": "简单的日期时间选择器",
+  "version": "0.7.0",
+  "description": "uniApp 简单的日期时间选择器, 可选择年, 月, 日, 时, 分, 秒",
+  "keywords": [
+    "时间",
+    "日期",
+    "时间选择器",
+    "日期时间选择器",
+    "datetime"
+],
+  "repository": "",
+  "engines": {
+    "HBuilderX": "^3.6.1"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": "3190136675"
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "n",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "u",
+          "QQ": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 97 - 0
uni_modules/buuug7-simple-datetime-picker_0.7.0/readme.md

@@ -0,0 +1,97 @@
+# uniApp 简单的日期时间选择器
+
+uniApp 日期时间选择器, 可选择年, 月, 日, 时, 分, 秒.
+
+## screenshot
+
+<p>
+  <img align=top src="https://img-cdn-aliyun.dcloud.net.cn/stream/plugin_screens/19363640-a869-11e9-a6c7-7fb99abe2bbf_0.png?1629144139" width="300px" height="auto">
+</p>
+
+## 安装
+
+推荐从[dcloud 插件市场](https://ext.dcloud.net.cn/plugin?id=592) 安装.
+
+## 用法
+
+在 template 中:
+
+```vue
+<template>
+  <view>
+    <button type="default" @click="openDatetimePicker">open picker</button>
+    <buuug7-simple-datetime-picker
+      ref="myPicker"
+      @submit="handleSubmit"
+      :start-year="2000"
+      :end-year="2099"
+      :time-init="1688860800000"
+      :time-hide="[true, true, true, true, true, false]"
+      :time-label="['年', '月', '日', '时', '分', '秒']"
+    />
+  </view>
+</template>
+```
+
+在 script 中:
+
+- 该插件遵循 easycom 规范, 不用显式导入就可以使用 `<buuug7-simple-datetime-picker />`
+- 如需显式导入可以使用`import SimpleDateTimePicker from "uni_modules/buuug7-simple-datetime-picker/components/buuug7-simple-datetime-picker/buuug7-simple-datetime-picker.vue";`
+
+```javascript
+export default {
+  data() {
+    return {
+      birthday: "",
+    };
+  },
+  methods: {
+    // 打开picker
+    openDatetimePicker() {
+      this.$refs.myPicker.show();
+    },
+
+    // 关闭picker
+    closeDatetimePicker() {
+      this.$refs.myPicker.hide();
+    },
+
+    handleSubmit(e) {
+      // console.log(e);
+      // {year: "2023", month: "07", day: "11", hour: "15", minute: "21", seconds: '55'}
+      this.birthday = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${seconds}`;
+    },
+  },
+};
+```
+
+> Note: 不要把组件放 swiper 里面或者 v-for 里面等, 最好放在页面根部. 通常情况下打开 picker 需要调用`this.$refs.refName.show()`, 在选择完毕后 picker 会自动隐藏,不需要调用`this.$refs.refName.hide()`来手动隐藏。
+
+## 属性说明
+
+#### start-year
+
+类型 `Number`,选择开始年份
+
+#### end-year
+
+类型 `Number`, 选择结束年份
+
+#### time-init
+
+类型`Number`, 自定义初始时间, 默认为当前时间, 值为时间戳
+
+#### time-hidden
+
+类型 `Array`, 自定义时间列显示,默认显示年月日日分 `[true, true, true, true, true, false]`
+
+- 只显示年月日, 则可以设置为`[true, true, true, false, false, false]`
+- 时分秒, 则可以设置为`[false, false, false, true, true, true]`
+
+#### time-label
+
+类型 `Array`, 自定义各个时间单位,默认为 `['年', '月', '日', '时', '分', '秒']`, 比如想切换成显示英文的年月日, 可以设置 `['year', 'month', 'day', 'hour', 'minute', 'second']`
+
+#### @submit
+
+类型 `function`, 监听选择事件, 回调函数的第一个参数包含了选择时间的完整信息

BIN
uni_modules/buuug7-simple-datetime-picker_0.7.0/screenshot_1.png


Some files were not shown because too many files changed in this diff