diff --git a/README.md b/README.md
index ad370f6..01610ff 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,73 @@
- 茶址
+ 茶址
- 使用Unibest开发,版本号3.8.2
-
\ No newline at end of file
+ 使用Unibest开发,版本号3.8.2
+
+
+开发规范
+1. 页面或组件添加方法的时候前面加上handle关键字
+ handleConfirmHour: () => {
+ if (totalHour.value <= 0) {
+ toast.info('至少起订N小时')
+ return
+ }
+ showReservePopup.value = false
+ },
+2. 页面或组件传创建的方法需要以当前文件名称作为对象按照驼峰命名
+ const detail = {
+ handleConfirmHour: () => {
+ if (totalHour.value <= 0) {
+ toast.info('至少起订N小时')
+ return
+ }
+ showReservePopup.value = false
+ }
+ }
+3. 页面或组件传创建的内部方法需要放在函数最下面,这种方法前面不需要加上handle
+ const detail = {
+ handleConfirmHour: () => {
+ if (totalHour.value <= 0) {
+ toast.info('至少起订N小时')
+ return
+ }
+ showReservePopup.value = false
+ },
+
+ // 格式化时间
+ formatDate: (timestamp: number) => {
+ const date = new Date(timestamp)
+ const year = date.getFullYear()
+ const month = String(date.getMonth() + 1).padStart(2, '0')
+ const day = String(date.getDate()).padStart(2, '0')
+ const hour = String(date.getHours()).padStart(2, '0')
+ const minute = String(date.getMinutes()).padStart(2, '0')
+
+ return `${year}-${month}-${day} ${hour}:${minute}`
+ }
+ }
+4. 如果组件名称与定义的对象函数名冲突,则对象函数名后面加上s
+ import coupon from '@/components/coupon/coupon.vue'
+ const coupons = {
+ handleConfirmHour: () => {
+ if (totalHour.value <= 0) {
+ toast.info('至少起订N小时')
+ return
+ }
+ showReservePopup.value = false
+ },
+
+ // 格式化时间
+ formatDate: (timestamp: number) => {
+ const date = new Date(timestamp)
+ const year = date.getFullYear()
+ const month = String(date.getMonth() + 1).padStart(2, '0')
+ const day = String(date.getDate()).padStart(2, '0')
+ const hour = String(date.getHours()).padStart(2, '0')
+ const minute = String(date.getMinutes()).padStart(2, '0')
+
+ return `${year}-${month}-${day} ${hour}:${minute}`
+ }
+ }
\ No newline at end of file
diff --git a/src/bundle/coupon/coupon.vue b/src/bundle/coupon/coupon.vue
new file mode 100644
index 0000000..c8dbc8a
--- /dev/null
+++ b/src/bundle/coupon/coupon.vue
@@ -0,0 +1,158 @@
+
+{
+ "layout": "default",
+ "style": {
+ "navigationStyle": "custom"
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 可用优惠券
+ 2张
+
+
+
+
+
+
+
+
+
+ 不可用优惠券
+ 2张
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 可用团购券
+ 2张
+
+
+
+
+
+
+
+
+
+ 不可用团购券
+ 2张
+
+
+
+
+
+
+
+
+
+
+
+
+ 已选择1张
+
+ 确定
+
+
+
+
+
+
+
+
diff --git a/src/pages-sub/demo/components/request.vue b/src/bundle/demo/components/request.vue
similarity index 100%
rename from src/pages-sub/demo/components/request.vue
rename to src/bundle/demo/components/request.vue
diff --git a/src/pages-sub/demo/index.vue b/src/bundle/demo/index.vue
similarity index 91%
rename from src/pages-sub/demo/index.vue
rename to src/bundle/demo/index.vue
index 1d6abdd..1d09d9b 100644
--- a/src/pages-sub/demo/index.vue
+++ b/src/bundle/demo/index.vue
@@ -15,7 +15,7 @@ import RequestComp from './components/request.vue'
- http://localhost:9000/#/pages-sub/demo/index
+ http://localhost:9000/#/bundle/demo/index
分包页面demo
diff --git a/src/pages-sub/reserve-room/detail.vue b/src/bundle/reserve-room/detail.vue
similarity index 91%
rename from src/pages-sub/reserve-room/detail.vue
rename to src/bundle/reserve-room/detail.vue
index e64ae07..e666673 100644
--- a/src/pages-sub/reserve-room/detail.vue
+++ b/src/bundle/reserve-room/detail.vue
@@ -11,11 +11,11 @@
-
+
+ @click="detail.handleClick" mode="aspectFit">
@@ -76,7 +76,7 @@
-
+
优惠券
优惠券
@@ -111,7 +111,7 @@
-
+
更多支付(团购券)
1张可用
@@ -198,8 +198,8 @@
:maxDate='maxTimestamp'
type="datetime"
v-model="startTimeValue"
- :formatter="reserveRoom.formatStartTime"
- @change="reserveRoom.startTimePickend"
+ :formatter="detail.handleFormatTime"
+ @change="detail.handleStartTimePicker"
/>
@@ -208,15 +208,15 @@
:maxDate='maxTimestamp'
type="datetime"
v-model="endTimeValue"
- :formatter="reserveRoom.formatStartTime"
- @change="reserveRoom.endTimePickend"
+ :formatter="detail.handleFormatTime"
+ @change="detail.handleEndTimePicker"
/>
- 重置
- 确定({{ totalHour }}小时)
+ 重置
+ 确定({{ totalHour }}小时)
@@ -291,17 +291,16 @@
- 确定付款
+ 确定付款
diff --git a/src/components/coupon/group-coupon.vue b/src/components/coupon/group-coupon.vue
index e69de29..8cfaa22 100644
--- a/src/components/coupon/group-coupon.vue
+++ b/src/components/coupon/group-coupon.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+ 这是团购券套餐名称这是团购券套餐名称
+
+ 这是商家名称这是商家名称这是商家名称这是商家名称这是商家名称
+ |
+ {{ coupon.limit }}小时
+
+ 有效期:2025-01-01至2025-05-05
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/navbar.vue b/src/components/navbar.vue
index 360543c..5fddbb3 100644
--- a/src/components/navbar.vue
+++ b/src/components/navbar.vue
@@ -1,7 +1,7 @@
-
-
+
+
@@ -20,7 +20,7 @@
-
+
-
-
diff --git a/src/pages.json b/src/pages.json
index 59ac520..2986f47 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -116,7 +116,7 @@
],
"subPackages": [
{
- "root": "pages-sub",
+ "root": "bundle",
"pages": [
{
"path": "coupon/coupon",
diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue
index a01efdb..88afbd7 100644
--- a/src/pages/about/about.vue
+++ b/src/pages/about/about.vue
@@ -29,7 +29,7 @@ function gotoVueQuery() {
}
function gotoSubPage() {
uni.navigateTo({
- url: '/pages-sub/demo/index',
+ url: '/bundle/demo/index',
})
}
// uniLayout里面的变量通过 expose 暴露出来后可以在 onReady 钩子获取到(onLoad 钩子不行)
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 617a4ad..20c27a4 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -107,13 +107,13 @@