From b2facaefb9954750cec141929ab4fc798a3ffdb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=AE=87?= <2020377497@qq.com>
Date: Wed, 10 Jan 2024 08:53:08 +0800
Subject: [PATCH 1/4] upda
---
components/{myList => yList}/index.vue | 4 ++--
components/{myTable => yTable}/index.vue | 2 +-
.../{myUpload => yUpload}/index copy.vue | 12 +++++------
components/{myUpload => yUpload}/index.vue | 16 +++++++-------
store/afterSale/index.vue | 12 +++++------
store/cat/edit.vue | 4 ++--
store/goods/components/skuEdit.vue | 18 ++++++++--------
store/goods/edit.vue | 6 +++---
store/goods/index.vue | 10 ++++-----
store/index/index.vue | 20 +++++++++++++-----
store/order/index.vue | 21 ++++++++++++-------
store/setup/index.vue | 12 +++++------
store/shop/edit.vue | 14 ++++++-------
store/user/edit.vue | 10 ++++-----
store/user/list.vue | 12 +++++------
15 files changed, 95 insertions(+), 78 deletions(-)
rename components/{myList => yList}/index.vue (97%)
rename components/{myTable => yTable}/index.vue (99%)
rename components/{myUpload => yUpload}/index copy.vue (94%)
rename components/{myUpload => yUpload}/index.vue (95%)
diff --git a/components/myList/index.vue b/components/yList/index.vue
similarity index 97%
rename from components/myList/index.vue
rename to components/yList/index.vue
index d1bd651..8be3820 100644
--- a/components/myList/index.vue
+++ b/components/yList/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -144,7 +144,7 @@ defineExpose({
diff --git a/components/yUpload/index.vue b/components/yUpload/index.vue
index 477cf22..87830e4 100644
--- a/components/yUpload/index.vue
+++ b/components/yUpload/index.vue
@@ -16,7 +16,7 @@
-
+
@@ -29,7 +29,7 @@
- 已选择 ({{ LArr.length }} 张)
+ 已选择 ( {{ LArr.length || 0 }} / {{ size }} 张)
diff --git a/hooks/useApi.js b/hooks/useApi.js
new file mode 100644
index 0000000..0b86e4d
--- /dev/null
+++ b/hooks/useApi.js
@@ -0,0 +1,58 @@
+import { ref } from "vue"
+
+/**
+ * 用于执行 API 请求和管理相关状态的自定义钩子。
+ *
+ * @param {Function} apiF - 表示 API 请求的异步函数。
+ * @param {Object} [opt={}] - 可选配置选项。
+ * @param {Ref} [opt.loading=false] - 可选的 loading 状态变量。
+ *
+ * @returns {Object} - 包含响应式变量和 fetchData 函数的对象。
+ * @property {Ref} loading - 表示 API 请求加载状态的 ref。
+ * @property {Ref} result - 表示 API 请求结果的 ref。
+ * @property {Ref} error - 表示 API 请求失败时的错误的 ref。
+ * @property {Function} fetchData - 用于执行 API 请求并更新状态变量的函数。
+ */
+export const useApi = (apiF, opt = {}) => {
+ // 使用 ref 包装状态变量
+ const loading = opt.loading || ref(false)
+ const result = ref(null)
+ const error = ref(null)
+
+ /**
+ * 执行 API 请求并更新状态的函数。
+ *
+ * @param {*} p - 用于 API 请求的参数。
+ * @returns {Promise} - 包含 API 响应对象的 Promise。
+ */
+ const fetchData = async (p) => {
+ try {
+ // 开始请求,设置 loading 为 true
+ loading.value = true
+ // 执行异步 API 请求
+ const res = await apiF(p)
+
+ // 根据返回的 code 判断请求是否成功
+ if (res.code === 0) {
+ // 请求成功,更新 result 变量
+ result.value = res
+ } else {
+ // 请求失败,更新 error 变量
+ error.value = res
+ }
+
+ // 返回 API 响应对象
+ return res
+ } catch (err) {
+ // 捕获异常,更新 error 变量并抛出错误
+ error.value = err
+ throw err
+ } finally {
+ // 无论请求成功或失败,都会在最终阶段设置 loading 为 false
+ loading.value = false
+ }
+ }
+
+ // 返回包含状态变量和 fetchData 函数的对象
+ return { loading, result, error, fetchData }
+}
diff --git a/pages.json b/pages.json
index 5d4accf..8cceabd 100644
--- a/pages.json
+++ b/pages.json
@@ -161,6 +161,42 @@
}
}
},
+ {
+ "path": "user/memberList",
+ "style": {
+ "navigationBarTitleText": "用户等级",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "user/editMember",
+ "style": {
+ "navigationBarTitleText": "等级编辑",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "user/editGoods",
+ "style": {
+ "navigationBarTitleText": "折扣编辑",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
{
"path": "user/edit",
"style": {
@@ -172,6 +208,30 @@
"gestureBack": "YES"
}
}
+ },
+ {
+ "path": "user/setUp",
+ "style": {
+ "navigationBarTitleText": "页面配置",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "check/list",
+ "style": {
+ "navigationBarTitleText": "核销记录",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
}
]
}
diff --git a/store/check/edit.vue b/store/check/edit.vue
new file mode 100644
index 0000000..0208378
--- /dev/null
+++ b/store/check/edit.vue
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 掌优4G云喇叭编号
+
+
+
+
+
+ 非营业时间下单
+
+
+
+
+
+
+ 状态
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
diff --git a/store/check/list.vue b/store/check/list.vue
new file mode 100644
index 0000000..e88f6ae
--- /dev/null
+++ b/store/check/list.vue
@@ -0,0 +1,174 @@
+
+
+
+
+
+ { search({ value: '' }) }"
+ v-model="params.keywords" hide-cancel>
+
+
+ 门店名称
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ order.shop?.name || '--' }}
+
+
+ 核销编号: {{ order.order_no }}
+
+
+
+
+ 核销编码: {{ order.check_code }}
+
+
+
+
+
+
+
+
+ --
+
+
+
+
+
+ {{ i.goods.name }}
+
+
+
数量:{{ i.num }}
+
金额:{{ i.original_amount }}
+
+
+
+
+
+
+
+
+ 核销码:点我复制
+
+ 核销时间:{{ order.create_time }}
+
+
+
+
+ 核销平台:{{ ["自提核销", "抖音商品券", "抖音金额券",
+ "支付宝团购"][order.type] }}
+
+
+
+ 核销方式:
+ {{ ["pos机核销",
+ "手机端核销"][order.check_origin]
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/store/goods/index.vue b/store/goods/index.vue
index a5030d6..37a44bd 100644
--- a/store/goods/index.vue
+++ b/store/goods/index.vue
@@ -26,7 +26,7 @@
- 库存:{{ item.stock_num }}
+ 库存:{{ item.stock_num || 0 }}
商品库存不足
diff --git a/store/index/index.vue b/store/index/index.vue
index c3cf118..eed248f 100644
--- a/store/index/index.vue
+++ b/store/index/index.vue
@@ -11,6 +11,32 @@
+
+
+ 用户管理
+
+
+
+
+
+
+
+
+
+
+ 等级管理
+
+
+
+
+
+
+
+
+
分类管理
@@ -18,7 +44,7 @@
-
+
@@ -30,7 +56,7 @@
-
+
@@ -42,11 +68,25 @@
-
+
+
+ 核销记录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
+
diff --git a/store/user/editMember.vue b/store/user/editMember.vue
new file mode 100644
index 0000000..c7f8c75
--- /dev/null
+++ b/store/user/editMember.vue
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+
+
+
+ 数字越大等级越高
+
+
+
+ 会员满足条件等级从低到高自动升级,高等级不会自动降级
+
+
+
+ 如需个别调整,请前往会员列表调整
+
+
+
+
+
+
+
+
+ 累计完成订单金额满:
+ 元
+
+
+ 成长值:
+
+
+
+ 会员升级条件
+
+
+
+
+
+
+
+
+ 元
+
+
+
+ 输入0 会员将不可购买
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
+
diff --git a/store/user/list.vue b/store/user/list.vue
index 3f08829..5963953 100644
--- a/store/user/list.vue
+++ b/store/user/list.vue
@@ -9,19 +9,24 @@
-->
-
-
-
-
-
-
- {{ searchType }}
-
-
-
-
-
+
+
+
+
+
+
+ {{ searchType }}
+
+
+
+
+
+
+
+
+ 用户等级
+
diff --git a/store/user/memberList.vue b/store/user/memberList.vue
new file mode 100644
index 0000000..39aea9b
--- /dev/null
+++ b/store/user/memberList.vue
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+
+ 新增等级
+ 页面配置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ member.name }} ¥{{ member.price }}
+
+
+
+ 消费:{{ member.money }}
+ 元
+ {{ member.growth }} 成长值
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ user.name }}
+
+ 折扣 {{ user.discount }}
+
+
+
+
+
+ 状态:
+ 开启
+ 关闭
+
+ 折扣商品:{{ user?.goods_list?.length || 0 }}
+
+
+
+
+
+ 优惠时间:
+ {{ utils.dateFormat(user.start_time * 1000) }} - {{
+ utils.dateFormat(user.end_time * 1000) }}
+
+
+
+
+
+
+
+
+ 编辑
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/store/user/setUp.vue b/store/user/setUp.vue
new file mode 100644
index 0000000..932db4b
--- /dev/null
+++ b/store/user/setUp.vue
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/wot-design-uni/changelog.md b/uni_modules/wot-design-uni/changelog.md
index 638fdcc..e9fc741 100644
--- a/uni_modules/wot-design-uni/changelog.md
+++ b/uni_modules/wot-design-uni/changelog.md
@@ -1,15 +1,79 @@
-## 0.2.5(2023-12-28)
-## [0.2.5](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.4...v0.2.5) (2023-12-28)
+## 0.2.11(2024-01-09)
+### [0.2.11](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.10...v0.2.11) (2024-01-09)
### Bug Fixes | Bug 修复
-* 修复 Form 导入FormRules、ErrorMessage时未指定为type的问题 ([c88c84e](https://github.com/Moonofweisheng/wot-design-uni/commit/c88c84e8b71fc2404643a623c28f4953ffe36e71))
-* 修复 SwipeAction 组件在H5端导致页面无法上下滚动的问题 ([1f68ce1](https://github.com/Moonofweisheng/wot-design-uni/commit/1f68ce13c8109dd92ca4bf055f66aa8dff24c83d)), closes [#149](https://github.com/Moonofweisheng/wot-design-uni/issues/149)
+* 修复 Overlay 类型声明错误的问题 ([930e59a](https://github.com/Moonofweisheng/wot-design-uni/commit/930e59a9b09aee535ec4c316e44ed3c0e31be628))
+
+
+### Documentation | 文档
+
+* 提供托管在Giteee上的文档网站 ([6d62e9e](https://github.com/Moonofweisheng/wot-design-uni/commit/6d62e9e7ddda0bd9f51f2ad9e2893f1ed3709c63))
# 更新日志
+### [0.2.11](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.10...v0.2.11) (2024-01-09)
+
+
+### 🐛 Bug Fixes | Bug 修复
+
+* 🐛 修复 Overlay 类型声明错误的问题 ([930e59a](https://github.com/Moonofweisheng/wot-design-uni/commit/930e59a9b09aee535ec4c316e44ed3c0e31be628))
+
+
+### ✏️ Documentation | 文档
+
+* ✏️ 提供托管在Giteee上的文档网站 ([6d62e9e](https://github.com/Moonofweisheng/wot-design-uni/commit/6d62e9e7ddda0bd9f51f2ad9e2893f1ed3709c63))
+
+### [0.2.10](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.9...v0.2.10) (2024-01-08)
+
+
+### 🐛 Bug Fixes | Bug 修复
+
+* 🐛 修复 col-picker 暗黑模式下标题文字颜色不清楚的问题 ([217ffb7](https://github.com/Moonofweisheng/wot-design-uni/commit/217ffb7dacb66b2017145c6e43fc8c873a6e9dd2))
+* 🐛 修复 steps 组件自定义图标显示异常的问题 ([0300f63](https://github.com/Moonofweisheng/wot-design-uni/commit/0300f63f35a5afcd278aba3b4ab721f498716d94))
+* 🐛 修复支付宝小程序暗黑模式下 Input、Textarea 组件显示异常的问题 ([8a9c344](https://github.com/Moonofweisheng/wot-design-uni/commit/8a9c344872bfcd81a73f71520f51b6b849f516d5))
+
+### [0.2.9](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.8...v0.2.9) (2024-01-07)
+
+
+### 🐛 Bug Fixes | Bug 修复
+
+* 🐛 修复 col-picker 组件首次打开指示线位置异常的问题 ([323fb00](https://github.com/Moonofweisheng/wot-design-uni/commit/323fb00942b7032b678d92ab03360dc7bb8faae8))
+
+### [0.2.8](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.7...v0.2.8) (2024-01-06)
+
+
+### ✏️ Documentation | 文档
+
+* ✏️ 展示netlify支持 ([410b180](https://github.com/Moonofweisheng/wot-design-uni/commit/410b180ec9c660ab9c49d6eb203d53c35919c512))
+
+### [0.2.7](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.5...v0.2.7) (2024-01-06)
+
+
+### ✨ Features | 新功能
+
+* ✨ 优化provide/inject的使用方式 ([892f467](https://github.com/Moonofweisheng/wot-design-uni/commit/892f4675a848ee3d4c965c36d5c4034aa5806b6d))
+
+
+### ✏️ Documentation | 文档
+
+* ✏️ 文档网站增加自定义footer ([dd8bc00](https://github.com/Moonofweisheng/wot-design-uni/commit/dd8bc003eedcdc43cdd60bb896c897d108dd4a51))
+* ✏️ 修复vitepress自定义footer展示错误的问题 ([c0701d5](https://github.com/Moonofweisheng/wot-design-uni/commit/c0701d584e5d9b84e6d913dd23666b80d803407b))
+
+### [0.2.6](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.5...v0.2.6) (2024-01-06)
+
+
+### ✨ Features | 新功能
+
+* ✨ 优化provide/inject的使用方式 ([892f467](https://github.com/Moonofweisheng/wot-design-uni/commit/892f4675a848ee3d4c965c36d5c4034aa5806b6d))
+
+
+### ✏️ Documentation | 文档
+
+* ✏️ 文档网站增加自定义footer ([dd8bc00](https://github.com/Moonofweisheng/wot-design-uni/commit/dd8bc003eedcdc43cdd60bb896c897d108dd4a51))
+
### [0.2.5](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.4...v0.2.5) (2023-12-28)
diff --git a/uni_modules/wot-design-uni/components/common/abstracts/variable.scss b/uni_modules/wot-design-uni/components/common/abstracts/variable.scss
index d45a767..0417fb4 100644
--- a/uni_modules/wot-design-uni/components/common/abstracts/variable.scss
+++ b/uni_modules/wot-design-uni/components/common/abstracts/variable.scss
@@ -83,8 +83,8 @@ $-color-icon: var(--wot-color-icon, #d9d9d9) !default; // icon颜色
$-color-icon-active: var(--wot-color-icon-active, #eee) !default; // icon颜色hover
$-color-icon-disabled: var(--wot-color-icon-disabled, #a7a7a7) !default; // icon颜色disabled
/* overlay */
-$-overlay-bg: rgba(0, 0, 0, 0.65) !default;
-$-overlay-bg-dark: rgba(0, 0, 0, 0.75) !default;
+$-overlay-bg: var(--wot-overlay-bg, rgba(0, 0, 0, 0.65)) !default;
+$-overlay-bg-dark: var(--wot-overlay-bg-dark, rgba(0, 0, 0, 0.75)) !default;
/*----------------------------------------- Theme color. end -------------------------------------------*/
diff --git a/uni_modules/wot-design-uni/components/composables/useCell.ts b/uni_modules/wot-design-uni/components/composables/useCell.ts
index e5d4f60..d245312 100644
--- a/uni_modules/wot-design-uni/components/composables/useCell.ts
+++ b/uni_modules/wot-design-uni/components/composables/useCell.ts
@@ -1,45 +1,13 @@
-import { getCurrentInstance, inject, onBeforeMount, ref, watch } from 'vue'
+import { computed } from 'vue'
+import { useParent } from './useParent'
+import { CELL_GROUP_KEY } from '../wd-cell-group/types'
export function useCell() {
- const border = ref
(false) // 是否展示边框
- const cellGroup: any = inject('cell-group', null) || {}
- const cellList: any = inject('cell-list', null) || ref([])
- const { proxy } = getCurrentInstance() as any
+ const { parent: cellGroup, index } = useParent(CELL_GROUP_KEY)
- watch(
- () => cellGroup.border,
- (newVal) => {
- setIndexAndStatus(Boolean(newVal), proxy.$.uid)
- },
- {
- deep: true,
- immediate: true
- }
- )
-
- onBeforeMount(() => {
- cellList.value = [...cellList.value.concat([{ uid: proxy.$.uid }])]
- setIndexAndStatus(cellGroup.border, proxy.$.uid)
+ const border = computed(() => {
+ return cellGroup && cellGroup.props.border && index.value
})
- /**
- * @description 从cellGroup获取此组件的索引
- * @return {Number} 此组件的索引
- */
- function getIndex(uuid: string) {
- if (!cellList || !cellList.value) return
- return cellList.value.findIndex((cell) => {
- return cell.uid === uuid
- })
- }
-
- /**
- * @description 为所有索引非0的组件设置刘海线,此方法由cellGroup调用
- */
- function setIndexAndStatus(isBorder: boolean, uuid: string) {
- const index = getIndex(uuid)
- border.value = isBorder && index
- }
-
- return { border, cellGroup, cellList, setIndexAndStatus, getIndex }
+ return { border }
}
diff --git a/uni_modules/wot-design-uni/components/wd-calendar-view/types.ts b/uni_modules/wot-design-uni/components/wd-calendar-view/types.ts
new file mode 100644
index 0000000..7e1170c
--- /dev/null
+++ b/uni_modules/wot-design-uni/components/wd-calendar-view/types.ts
@@ -0,0 +1,5 @@
+import type { ComponentPublicInstance } from 'vue'
+
+export type CalendarViewInstance = ComponentPublicInstance<{
+ scrollIntoView: () => void
+}>
diff --git a/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue b/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue
index 6e41888..6b13416 100644
--- a/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue
+++ b/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue
@@ -353,8 +353,8 @@ const errorMessage = computed(() => {
// 是否展示必填
const isRequired = computed(() => {
let formRequired = false
- if (form && form.rules) {
- const rules = form.rules
+ if (form && form.props.rules) {
+ const rules = form.props.rules
for (const key in rules) {
if (Object.prototype.hasOwnProperty.call(rules, key) && key === props.prop && Array.isArray(rules[key])) {
formRequired = rules[key].some((rule: FormItemRule) => rule.required)
diff --git a/uni_modules/wot-design-uni/components/wd-cell-group/types.ts b/uni_modules/wot-design-uni/components/wd-cell-group/types.ts
new file mode 100644
index 0000000..8590fa2
--- /dev/null
+++ b/uni_modules/wot-design-uni/components/wd-cell-group/types.ts
@@ -0,0 +1,18 @@
+/*
+ * @Author: weisheng
+ * @Date: 2023-12-14 11:21:58
+ * @LastEditTime: 2024-01-03 21:51:36
+ * @LastEditors: weisheng
+ * @Description:
+ * @FilePath: /wot-design-uni/src/uni_modules/wot-design-uni/components/wd-cell-group/types.ts
+ * 记得注释
+ */
+import { type InjectionKey } from 'vue'
+
+export type CelllGroupProvide = {
+ props: {
+ border?: boolean
+ }
+}
+
+export const CELL_GROUP_KEY: InjectionKey = Symbol('wd-cell-group')
diff --git a/uni_modules/wot-design-uni/components/wd-cell-group/wd-cell-group.vue b/uni_modules/wot-design-uni/components/wd-cell-group/wd-cell-group.vue
index 1658b57..f0dd56b 100644
--- a/uni_modules/wot-design-uni/components/wd-cell-group/wd-cell-group.vue
+++ b/uni_modules/wot-design-uni/components/wd-cell-group/wd-cell-group.vue
@@ -30,7 +30,8 @@ export default {
diff --git a/uni_modules/wot-design-uni/components/wd-tabs/types.ts b/uni_modules/wot-design-uni/components/wd-tabs/types.ts
new file mode 100644
index 0000000..6517746
--- /dev/null
+++ b/uni_modules/wot-design-uni/components/wd-tabs/types.ts
@@ -0,0 +1,9 @@
+import { type InjectionKey } from 'vue'
+
+export type TabsProvide = {
+ state: {
+ activeIndex: number
+ }
+}
+
+export const TABS_KEY: InjectionKey = Symbol('wd-tabs')
diff --git a/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue b/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue
index f1fd302..6e340ca 100644
--- a/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue
+++ b/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue
@@ -15,8 +15,8 @@
@click="handleSelect(index)"
v-for="(item, index) in items"
:key="index"
- :class="`wd-tabs__nav-item ${activeIndex === index ? 'is-active' : ''} ${item.disabled ? 'is-disabled' : ''}`"
- :style="activeIndex === index ? (color ? 'color:' + color : '') : inactiveColor ? 'color:' + inactiveColor : ''"
+ :class="`wd-tabs__nav-item ${state.activeIndex === index ? 'is-active' : ''} ${item.disabled ? 'is-disabled' : ''}`"
+ :style="state.activeIndex === index ? (color ? 'color:' + color : '') : inactiveColor ? 'color:' + inactiveColor : ''"
>
{{ item.title }}
@@ -36,9 +36,9 @@
{{ item.title }}
@@ -100,7 +100,7 @@
-
+
{{ item.title }}
@@ -131,9 +131,11 @@ export default {
}
-
+
diff --git a/store/order/index.vue b/store/order/index.vue
index 5fef050..7255306 100644
--- a/store/order/index.vue
+++ b/store/order/index.vue
@@ -136,14 +136,14 @@
-
+
应付: {{ (Number(item.total_price) + Number(item.delivery_money)).toFixed(2) }} 元
余额支付: {{ item.pay_balance }} 元
优惠: {{ ((Number(item.total_price) + Number(item.delivery_money)) -
item.pay_price).toFixed(2) }} 元
-
+ 占位
实付: {{ item.pay_price }} 元
diff --git a/store/setup/index.vue b/store/setup/index.vue
index e18741e..4c1bfde 100644
--- a/store/setup/index.vue
+++ b/store/setup/index.vue
@@ -36,9 +36,9 @@
+ text: 'name',
+ value: 'id',
+ }" v-model="storeData.district" @change="select">
@@ -279,6 +279,9 @@ export default {
-
diff --git a/store/shop/list.vue b/store/shop/list.vue
index d39975b..83b7972 100644
--- a/store/shop/list.vue
+++ b/store/shop/list.vue
@@ -48,9 +48,10 @@
-
-
-
+
+
+
+
@@ -89,7 +90,7 @@ const user_info = uni.getStorageSync("user_info");
const shopList = ref({});
const changeS = async (row) => {
- const { fetchData } = await useApi(shop.editStatus, { loading })
+ const { fetchData, result } = await useApi(shop.editStatus, { loading })
fetchData({
id: row.id,
diff --git a/store/user/edit.vue b/store/user/edit.vue
index 34d6bcc..9fd27b8 100644
--- a/store/user/edit.vue
+++ b/store/user/edit.vue
@@ -18,7 +18,15 @@
- {{ userInfo.nickname }}
+
+ {{ userInfo.nickname }}
+
+
+ v {{ userInfo.user_merge.member_level }}
+
+
+ 修改等级
+
@@ -116,6 +124,9 @@
+
+
+
@@ -125,9 +136,11 @@
import { ref } from 'vue';
import utils from '@/utils/utils.js';
import user from '@/api/store/user.js';
+import userMembers from '@/api/store/userMembers.js';
import yList from "/components/yList/index.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni'
+import { useApi } from "@/hooks/useApi.js"
const message = useMessage()
import {
@@ -255,6 +268,43 @@ onLoad(async (e) => {
loading.value = false
})
+const showLv = ref(false);
+const actionsLv = ref([])
+
+const changeLevel = e => {
+ console.log(e);
+ loading.value = true
+ user.UpdateLevel({
+ user_merge_id: userInfo.value.user_merge.id,
+ level: e.item.level,
+ }).then(async (res) => {
+ loading.value = true
+ const data = await user.userItem({ id: userInfo.value.id });
+ userInfo.value = data.data
+ loading.value = false
+
+ })
+}
+
+/**
+ * 获取数据的函数
+ */
+const getmemberList = async () => {
+ const { fetchData } = await useApi(userMembers.LevelShow, { loading })
+
+ fetchData().then(res => {
+ actionsLv.value = res.data.map(item => {
+ return {
+ ...item,
+ subname: `等级 ${item.level}`
+ }
+ });
+ actionsLv.value.ok = true;
+ })
+};
+
+getmemberList()
+
\ No newline at end of file
diff --git a/mall/cat/index.vue b/mall/cat/index.vue
new file mode 100644
index 0000000..122b368
--- /dev/null
+++ b/mall/cat/index.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+ 新增
+
+
+ {{ cat.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mall/check/list.vue b/mall/check/list.vue
new file mode 100644
index 0000000..0f3a333
--- /dev/null
+++ b/mall/check/list.vue
@@ -0,0 +1,174 @@
+
+
+
+
+
+ { search({ value: '' }) }"
+ v-model="params.keywords" hide-cancel>
+
+
+ 门店名称
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ order.shop?.name || '--' }}
+
+
+ 核销编号: {{ order.order_no }}
+
+
+
+
+ 核销编码: {{ order.check_code }}
+
+
+
+
+
+
+
+
+ --
+
+
+
+
+
+ {{ i.goods.name }}
+
+
+
数量:{{ i.num }}
+
金额:{{ i.original_amount }}
+
+
+
+
+
+
+
+
+ 核销码:点我复制
+
+ 核销时间:{{ order.create_time }}
+
+
+
+
+ 核销平台:{{ ["自提核销", "抖音商品券", "抖音金额券",
+ "支付宝团购"][order.type] }}
+
+
+
+ 核销方式:
+ {{ ["pos机核销",
+ "手机端核销"][order.check_origin]
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mall/components/bar/bar.vue b/mall/components/bar/bar.vue
new file mode 100644
index 0000000..43ba611
--- /dev/null
+++ b/mall/components/bar/bar.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mall/components/myTabbar/index.vue b/mall/components/myTabbar/index.vue
new file mode 100644
index 0000000..5f50bf1
--- /dev/null
+++ b/mall/components/myTabbar/index.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mall/goods/components/skuEdit.vue b/mall/goods/components/skuEdit.vue
new file mode 100644
index 0000000..8510cbd
--- /dev/null
+++ b/mall/goods/components/skuEdit.vue
@@ -0,0 +1,374 @@
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
规格设置
+
+
+
+
+ 添加规格组
+
+
+
+
+
+
规格组
+
+
+
+
+ {{
+ item.name }}
+
+
+
+
+
添加规格
+
+
+
规格:
+
+ {{ value.name
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mall/goods/components/uni-data-picker/changelog.md b/mall/goods/components/uni-data-picker/changelog.md
new file mode 100644
index 0000000..486eedc
--- /dev/null
+++ b/mall/goods/components/uni-data-picker/changelog.md
@@ -0,0 +1,56 @@
+## 1.0.3(2022-02-25)
+- 修复 nvue 不支持的 v-show 的 bug
+## 1.0.2(2022-02-25)
+- 修复 条件编译 nvue 不支持的 css 样式
+## 1.0.1(2021-11-23)
+- 修复 由上个版本引发的map、v-model等属性不生效的bug
+## 1.0.0(2021-11-19)
+- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-picker](https://uniapp.dcloud.io/component/uniui/uni-data-picker)
+## 0.4.9(2021-10-28)
+- 修复 VUE2 v-model 概率无效的 bug
+## 0.4.8(2021-10-27)
+- 修复 v-model 概率无效的 bug
+## 0.4.7(2021-10-25)
+- 新增 属性 spaceInfo 服务空间配置 HBuilderX 3.2.11+
+- 修复 树型 uniCloud 数据类型为 int 时报错的 bug
+## 0.4.6(2021-10-19)
+- 修复 非 VUE3 v-model 为 0 时无法选中的 bug
+## 0.4.5(2021-09-26)
+- 新增 清除已选项的功能(通过 clearIcon 属性配置是否显示按钮),同时提供 clear 方法以供调用,二者等效
+- 修复 readonly 为 true 时报错的 bug
+## 0.4.4(2021-09-26)
+- 修复 上一版本造成的 map 属性失效的 bug
+- 新增 ellipsis 属性,支持配置 tab 选项长度过长时是否自动省略
+## 0.4.3(2021-09-24)
+- 修复 某些情况下级联未触发的 bug
+## 0.4.2(2021-09-23)
+- 新增 提供 show 和 hide 方法,开发者可以通过 ref 调用
+- 新增 选项内容过长自动添加省略号
+## 0.4.1(2021-09-15)
+- 新增 map 属性 字段映射,将 text/value 映射到数据中的其他字段
+## 0.4.0(2021-07-13)
+- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.3.5(2021-06-04)
+- 修复 无法加载云端数据的问题
+## 0.3.4(2021-05-28)
+- 修复 v-model 无效问题
+- 修复 loaddata 为空数据组时加载时间过长问题
+- 修复 上个版本引出的本地数据无法选择带有 children 的 2 级节点
+## 0.3.3(2021-05-12)
+- 新增 组件示例地址
+## 0.3.2(2021-04-22)
+- 修复 非树形数据有 where 属性查询报错的问题
+## 0.3.1(2021-04-15)
+- 修复 本地数据概率无法回显时问题
+## 0.3.0(2021-04-07)
+- 新增 支持云端非树形表结构数据
+- 修复 根节点 parent_field 字段等于 null 时选择界面错乱问题
+## 0.2.0(2021-03-15)
+- 修复 nodeclick、popupopened、popupclosed 事件无法触发的问题
+## 0.1.9(2021-03-09)
+- 修复 微信小程序某些情况下无法选择的问题
+## 0.1.8(2021-02-05)
+- 优化 部分样式在 nvue 上的兼容表现
+## 0.1.7(2021-02-05)
+- 调整为 uni_modules 目录规范
diff --git a/mall/goods/components/uni-data-picker/components/uni-data-picker/keypress.js b/mall/goods/components/uni-data-picker/components/uni-data-picker/keypress.js
new file mode 100644
index 0000000..6ef26a2
--- /dev/null
+++ b/mall/goods/components/uni-data-picker/components/uni-data-picker/keypress.js
@@ -0,0 +1,45 @@
+// #ifdef H5
+export default {
+ name: 'Keypress',
+ props: {
+ disable: {
+ type: Boolean,
+ default: false
+ }
+ },
+ mounted () {
+ const keyNames = {
+ esc: ['Esc', 'Escape'],
+ tab: 'Tab',
+ enter: 'Enter',
+ space: [' ', 'Spacebar'],
+ up: ['Up', 'ArrowUp'],
+ left: ['Left', 'ArrowLeft'],
+ right: ['Right', 'ArrowRight'],
+ down: ['Down', 'ArrowDown'],
+ delete: ['Backspace', 'Delete', 'Del']
+ }
+ const listener = ($event) => {
+ if (this.disable) {
+ return
+ }
+ const keyName = Object.keys(keyNames).find(key => {
+ const keyName = $event.key
+ const value = keyNames[key]
+ return value === keyName || (Array.isArray(value) && value.includes(keyName))
+ })
+ if (keyName) {
+ // 避免和其他按键事件冲突
+ setTimeout(() => {
+ this.$emit(keyName, {})
+ }, 0)
+ }
+ }
+ document.addEventListener('keyup', listener)
+ this.$once('hook:beforeDestroy', () => {
+ document.removeEventListener('keyup', listener)
+ })
+ },
+ render: () => {}
+}
+// #endif
diff --git a/mall/goods/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue b/mall/goods/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
new file mode 100644
index 0000000..6014efe
--- /dev/null
+++ b/mall/goods/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
@@ -0,0 +1,598 @@
+
+
+
+
+
+ {{
+ errorMessage
+ }}
+
+
+
+
+
+
+ {{ item.text }}{{ split }}
+
+
+
+ {{
+ placeholder
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ popupTitle }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mall/goods/components/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js b/mall/goods/components/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
new file mode 100644
index 0000000..c12fd54
--- /dev/null
+++ b/mall/goods/components/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
@@ -0,0 +1,563 @@
+export default {
+ props: {
+ localdata: {
+ type: [Array, Object],
+ default () {
+ return []
+ }
+ },
+ spaceInfo: {
+ type: Object,
+ default () {
+ return {}
+ }
+ },
+ collection: {
+ type: String,
+ default: ''
+ },
+ action: {
+ type: String,
+ default: ''
+ },
+ field: {
+ type: String,
+ default: ''
+ },
+ orderby: {
+ type: String,
+ default: ''
+ },
+ where: {
+ type: [String, Object],
+ default: ''
+ },
+ pageData: {
+ type: String,
+ default: 'add'
+ },
+ pageCurrent: {
+ type: Number,
+ default: 1
+ },
+ pageSize: {
+ type: Number,
+ default: 20
+ },
+ getcount: {
+ type: [Boolean, String],
+ default: false
+ },
+ getone: {
+ type: [Boolean, String],
+ default: false
+ },
+ gettree: {
+ type: [Boolean, String],
+ default: false
+ },
+ manual: {
+ type: Boolean,
+ default: false
+ },
+ value: {
+ type: [Array, String, Number],
+ default () {
+ return []
+ }
+ },
+ modelValue: {
+ type: [Array, String, Number],
+ default () {
+ return []
+ }
+ },
+ preload: {
+ type: Boolean,
+ default: false
+ },
+ stepSearh: {
+ type: Boolean,
+ default: true
+ },
+ selfField: {
+ type: String,
+ default: ''
+ },
+ parentField: {
+ type: String,
+ default: ''
+ },
+ multiple: {
+ type: Boolean,
+ default: false
+ },
+ map: {
+ type: Object,
+ default() {
+ return {
+ text: "text",
+ value: "value"
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ loading: false,
+ errorMessage: '',
+ loadMore: {
+ contentdown: '',
+ contentrefresh: '',
+ contentnomore: ''
+ },
+ dataList: [],
+ selected: [],
+ selectedIndex: 0,
+ page: {
+ current: this.pageCurrent,
+ size: this.pageSize,
+ count: 0
+ }
+ }
+ },
+ computed: {
+ isLocaldata() {
+ return !this.collection.length
+ },
+ postField() {
+ let fields = [this.field];
+ if (this.parentField) {
+ fields.push(`${this.parentField} as parent_value`);
+ }
+ return fields.join(',');
+ },
+ dataValue() {
+ let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null || this.modelValue !== undefined)
+ return isModelValue ? this.modelValue : this.value
+ },
+ hasValue() {
+ if (typeof this.dataValue === 'number') {
+ return true
+ }
+ return (this.dataValue != null) && (this.dataValue.length > 0)
+ }
+ },
+ created() {
+ this.$watch(() => {
+ var al = [];
+ ['pageCurrent',
+ 'pageSize',
+ 'spaceInfo',
+ 'value',
+ 'modelValue',
+ 'localdata',
+ 'collection',
+ 'action',
+ 'field',
+ 'orderby',
+ 'where',
+ 'getont',
+ 'getcount',
+ 'gettree'
+ ].forEach(key => {
+ al.push(this[key])
+ });
+ return al
+ }, (newValue, oldValue) => {
+ let needReset = false
+ for (let i = 2; i < newValue.length; i++) {
+ if (newValue[i] != oldValue[i]) {
+ needReset = true
+ break
+ }
+ }
+ if (newValue[0] != oldValue[0]) {
+ this.page.current = this.pageCurrent
+ }
+ this.page.size = this.pageSize
+
+ this.onPropsChange()
+ })
+ this._treeData = []
+ },
+ methods: {
+ onPropsChange() {
+ this._treeData = []
+ },
+ getCommand(options = {}) {
+ /* eslint-disable no-undef */
+ let db = uniCloud.database(this.spaceInfo)
+
+ const action = options.action || this.action
+ if (action) {
+ db = db.action(action)
+ }
+
+ const collection = options.collection || this.collection
+ db = db.collection(collection)
+
+ const where = options.where || this.where
+ if (!(!where || !Object.keys(where).length)) {
+ db = db.where(where)
+ }
+
+ const field = options.field || this.field
+ if (field) {
+ db = db.field(field)
+ }
+
+ const orderby = options.orderby || this.orderby
+ if (orderby) {
+ db = db.orderBy(orderby)
+ }
+
+ const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
+ const size = options.pageSize !== undefined ? options.pageSize : this.page.size
+ const getCount = options.getcount !== undefined ? options.getcount : this.getcount
+ const getTree = options.gettree !== undefined ? options.gettree : this.gettree
+
+ const getOptions = {
+ getCount,
+ getTree
+ }
+ if (options.getTreePath) {
+ getOptions.getTreePath = options.getTreePath
+ }
+
+ db = db.skip(size * (current - 1)).limit(size).get(getOptions)
+
+ return db
+ },
+ getNodeData(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+ this.getCommand({
+ field: this.postField,
+ where: this._pathWhere()
+ }).then((res) => {
+ this.loading = false
+ this.selected = res.result.data
+ callback && callback()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ getTreePath(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ getTreePath: {
+ startWith: `${this.selfField}=='${this.dataValue}'`
+ }
+ }).then((res) => {
+ this.loading = false
+ let treePath = []
+ this._extractTreePath(res.result.data, treePath)
+ this.selected = treePath
+ callback && callback()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ loadData() {
+ if (this.isLocaldata) {
+ this._processLocalData()
+ return
+ }
+
+ if (this.dataValue != null) {
+ this._loadNodeData((data) => {
+ this._treeData = data
+ this._updateBindData()
+ this._updateSelected()
+ })
+ return
+ }
+
+ if (this.stepSearh) {
+ this._loadNodeData((data) => {
+ this._treeData = data
+ this._updateBindData()
+ })
+ } else {
+ this._loadAllData((data) => {
+ this._treeData = []
+ this._extractTree(data, this._treeData, null)
+ this._updateBindData()
+ })
+ }
+ },
+ _loadAllData(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ gettree: true,
+ startwith: `${this.selfField}=='${this.dataValue}'`
+ }).then((res) => {
+ this.loading = false
+ callback(res.result.data)
+ this.onDataChange()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ _loadNodeData(callback, pw) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ where: pw || this._postWhere(),
+ pageSize: 500
+ }).then((res) => {
+ this.loading = false
+ callback(res.result.data)
+ this.onDataChange()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ _pathWhere() {
+ let result = []
+ let where_field = this._getParentNameByField();
+ if (where_field) {
+ result.push(`${where_field} == '${this.dataValue}'`)
+ }
+
+ if (this.where) {
+ return `(${this.where}) && (${result.join(' || ')})`
+ }
+
+ return result.join(' || ')
+ },
+ _postWhere() {
+ let result = []
+ let selected = this.selected
+ let parentField = this.parentField
+ if (parentField) {
+ result.push(`${parentField} == null || ${parentField} == ""`)
+ }
+ if (selected.length) {
+ for (var i = 0; i < selected.length - 1; i++) {
+ result.push(`${parentField} == '${selected[i].value}'`)
+ }
+ }
+
+ let where = []
+ if (this.where) {
+ where.push(`(${this.where})`)
+ }
+ if (result.length) {
+ where.push(`(${result.join(' || ')})`)
+ }
+
+ return where.join(' && ')
+ },
+ _nodeWhere() {
+ let result = []
+ let selected = this.selected
+ if (selected.length) {
+ result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`)
+ }
+
+ if (this.where) {
+ return `(${this.where}) && (${result.join(' || ')})`
+ }
+
+ return result.join(' || ')
+ },
+ _getParentNameByField() {
+ const fields = this.field.split(',');
+ let where_field = null;
+ for (let i = 0; i < fields.length; i++) {
+ const items = fields[i].split('as');
+ if (items.length < 2) {
+ continue;
+ }
+ if (items[1].trim() === 'value') {
+ where_field = items[0].trim();
+ break;
+ }
+ }
+ return where_field
+ },
+ _isTreeView() {
+ return (this.parentField && this.selfField)
+ },
+ _updateSelected() {
+ var dl = this.dataList
+ var sl = this.selected
+ let textField = this.map.text
+ let valueField = this.map.value
+ for (var i = 0; i < sl.length; i++) {
+ var value = sl[i].value
+ var dl2 = dl[i]
+ for (var j = 0; j < dl2.length; j++) {
+ var item2 = dl2[j]
+ if (item2[valueField] === value) {
+ sl[i].text = item2[textField]
+ break
+ }
+ }
+ }
+ },
+ _updateBindData(node) {
+ const {
+ dataList,
+ hasNodes
+ } = this._filterData(this._treeData, this.selected)
+
+ let isleaf = this._stepSearh === false && !hasNodes
+
+ if (node) {
+ node.isleaf = isleaf
+ }
+
+ this.dataList = dataList
+ this.selectedIndex = dataList.length - 1
+
+ if (!isleaf && this.selected.length < dataList.length) {
+ this.selected.push({
+ value: null,
+ text: "请选择"
+ })
+ }
+
+ return {
+ isleaf,
+ hasNodes
+ }
+ },
+ _filterData(data, paths) {
+ let dataList = []
+ let hasNodes = true
+
+ dataList.push(data.filter((item) => {
+ return (item.parent_value === null || item.parent_value === undefined || item.parent_value === '')
+ }))
+ for (let i = 0; i < paths.length; i++) {
+ var value = paths[i].value
+ var nodes = data.filter((item) => {
+ return item.parent_value === value
+ })
+
+ if (nodes.length) {
+ dataList.push(nodes)
+ } else {
+ hasNodes = false
+ }
+ }
+
+ return {
+ dataList,
+ hasNodes
+ }
+ },
+ _extractTree(nodes, result, parent_value) {
+ let list = result || []
+ let valueField = this.map.value
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+
+ let child = {}
+ for (let key in node) {
+ if (key !== 'children') {
+ child[key] = node[key]
+ }
+ }
+ if (parent_value !== null && parent_value !== undefined && parent_value !== '') {
+ child.parent_value = parent_value
+ }
+ result.push(child)
+
+ let children = node.children
+ if (children) {
+ this._extractTree(children, result, node[valueField])
+ }
+ }
+ },
+ _extractTreePath(nodes, result) {
+ let list = result || []
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+
+ let child = {}
+ for (let key in node) {
+ if (key !== 'children') {
+ child[key] = node[key]
+ }
+ }
+ result.push(child)
+
+ let children = node.children
+ if (children) {
+ this._extractTreePath(children, result)
+ }
+ }
+ },
+ _findNodePath(key, nodes, path = []) {
+ let textField = this.map.text
+ let valueField = this.map.value
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+ let children = node.children
+ let text = node[textField]
+ let value = node[valueField]
+
+ path.push({
+ value,
+ text
+ })
+
+ if (value === key) {
+ return path
+ }
+
+ if (children) {
+ const p = this._findNodePath(key, children, path)
+ if (p.length) {
+ return p
+ }
+ }
+
+ path.pop()
+ }
+ return []
+ },
+ _processLocalData() {
+ this._treeData = []
+ this._extractTree(this.localdata, this._treeData)
+
+ var inputValue = this.dataValue
+ if (inputValue === undefined) {
+ return
+ }
+
+ if (Array.isArray(inputValue)) {
+ inputValue = inputValue[inputValue.length - 1]
+ if (typeof inputValue === 'object' && inputValue[this.map.value]) {
+ inputValue = inputValue[this.map.value]
+ }
+ }
+
+ this.selected = this._findNodePath(inputValue, this.localdata)
+ }
+ }
+}
diff --git a/mall/goods/components/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue b/mall/goods/components/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
new file mode 100644
index 0000000..d4882f1
--- /dev/null
+++ b/mall/goods/components/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
@@ -0,0 +1,364 @@
+
+
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+
+
+
+ {{
+ item[map.text]
+ }}
+
+
+
+
+
+
+
+
+
+ {{ errorMessage }}
+
+
+
+
+
+
+
diff --git a/mall/goods/components/uni-data-picker/package.json b/mall/goods/components/uni-data-picker/package.json
new file mode 100644
index 0000000..d4925ef
--- /dev/null
+++ b/mall/goods/components/uni-data-picker/package.json
@@ -0,0 +1,92 @@
+{
+ "id": "uni-data-picker",
+ "displayName": "uni-data-picker 数据驱动的picker选择器",
+ "version": "1.0.3",
+ "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "picker",
+ "级联",
+ "省市区",
+ ""
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "前端组件",
+ "通用组件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-load-more",
+ "uni-icons",
+ "uni-scss"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "y"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/mall/goods/components/uni-data-picker/readme.md b/mall/goods/components/uni-data-picker/readme.md
new file mode 100644
index 0000000..6cda224
--- /dev/null
+++ b/mall/goods/components/uni-data-picker/readme.md
@@ -0,0 +1,22 @@
+## DataPicker 级联选择
+> **组件名:uni-data-picker**
+> 代码块: `uDataPicker`
+> 关联组件:`uni-data-pickerview`、`uni-load-more`。
+
+
+`` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)。
+
+支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
+
+候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。
+
+`` 组件尤其适用于地址选择、分类选择等选择类。
+
+`` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。
+
+`` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。
+
+在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
diff --git a/mall/goods/edit.vue b/mall/goods/edit.vue
new file mode 100644
index 0000000..2da475c
--- /dev/null
+++ b/mall/goods/edit.vue
@@ -0,0 +1,429 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 商品名称
+
+
+
+
+
+
+
+
+ 商品分类
+
+
+
+
+
+
+ {{ cat.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 商品重量
+
+
+ 千克
+
+
+
+
+
+
+
+
+
+ 商品状态
+
+
+
+
+
+
+
+
+ 规格
+
+
+ 单规格
+ 多规格
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mall/goods/index.vue b/mall/goods/index.vue
new file mode 100644
index 0000000..21ba325
--- /dev/null
+++ b/mall/goods/index.vue
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+ {{ searchType }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 库存:{{ item.stock_num || 0 }}
+
+
+ 商品库存不足
+
+
+
+
+
+
+ {{ item.name }}
+ ¥{{ item.price_min }}
+
+
+
+
+
+ 下架
+ 上架
+ 编辑
+
+
+
+
+
+
+
+
+
+ 分类
+ 发布商品
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mall/index/index.vue b/mall/index/index.vue
new file mode 100644
index 0000000..2a64e6e
--- /dev/null
+++ b/mall/index/index.vue
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 分类管理
+
+
+
+
+
+
+
+
+
+
+ 商品管理
+
+
+
+
+
+
+
+
+
+
+ 订单管理
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item }}
+
+ {{ orderProfit.series[0].data[index] }}
+
+
+
+ 售后订单
+ ∞
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item }}
+
+ {{ orderGood.series[0].data[index] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mall/order/index.vue b/mall/order/index.vue
new file mode 100644
index 0000000..73a73c1
--- /dev/null
+++ b/mall/order/index.vue
@@ -0,0 +1,511 @@
+
+
+
+
+
+
+
+
+
+
+ 快递发货
+ 无需物流
+
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ searchType }}
+
+
+
+
+
+
+
+
+
+
+ {
+ params.status = e.index;
+ search({ value: params.keywords })
+ }" v-model="params.status">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.shop.name }}
+ 商城自营
+ ({{ status[item.status + 1].content }})
+
+
+
+ 单号:{{ item.order_no }}
+
+
+
+
+
+
+
+ {{ subItem.goods_name }}
+
+ 小计: {{ subItem.price }} 元 ({{
+ subItem.num }}) 件
+
+
+ {{ sku.group_name }}:{{ sku.name }}
+
+
+
+
+
+
+
+ 下单用户:{{ item.user.nickname }}
+
+ ( 会员ID:{{ item.user.id }} )
+
+
+
+ 收货人:{{ item.receiver_name }} 电话:{{ item.receiver_phone }}
+ 收货地址:{{ item.delivery_address }} {{
+ item.delivery_address_detail }}
+
+
+
+
+
+
+
+
+ 配送方式:
+
+ {{ ["", "快递配送", "到店自提"][item.delivery_type] }}
+
+
+
+
+ 运费: {{ item.delivery_money }}元
+
+
+
+
+
+
+
+
+ 应付: {{ (Number(item.total_price) + Number(item.delivery_money)).toFixed(2) }} 元
+ 余额支付: {{ item.pay_balance }} 元
+ 优惠: {{ ((Number(item.total_price) + Number(item.delivery_money)) -
+ item.pay_price).toFixed(2) }} 元
+
+ 占位
+
+ 实付: {{ item.pay_price }} 元
+
+
+
+ 退款
+
+
+
+ 小票打印
+
+
+ 备注
+
+
+ 发货
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages.json b/pages.json
index 8cceabd..feaeb21 100644
--- a/pages.json
+++ b/pages.json
@@ -65,6 +65,18 @@
}
}
},
+ {
+ "path": "inpersonPay/index",
+ "style": {
+ "navigationBarTitleText": "当面付订单",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
{
"path": "afterSale/index",
"style": {
@@ -234,6 +246,95 @@
}
}
]
+ },
+ {
+ "root": "mall",
+ "pages": [
+ {
+ "path": "index/index",
+ "style": {
+ "navigationBarTitleText": "门店首页",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "goods/index",
+ "style": {
+ "navigationBarTitleText": "商品管理",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "goods/edit",
+ "style": {
+ "navigationBarTitleText": "修改商品",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "cat/index",
+ "style": {
+ "navigationBarTitleText": "分类管理",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "cat/edit",
+ "style": {
+ "navigationBarTitleText": "分类编辑",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "check/list",
+ "style": {
+ "navigationBarTitleText": "核销记录",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ },
+ {
+ "path": "order/index",
+ "style": {
+ "navigationBarTitleText": "订单管理",
+ "enablePullDownRefresh": false,
+ "mp-alipay": {
+ "transparentTitle": "always",
+ "titlePenetrate": "YES",
+ "gestureBack": "YES"
+ }
+ }
+ }
+ ]
}
],
"globalStyle": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index ef5bfd9..7499ec8 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -11,6 +11,10 @@ if (token) {
const user_info = uni.getStorageSync("user_info");
if (user_info.type == 1) {
utils.toUrl("/store/index/index", "redirectTo")
+ } else if (user_info.type == 3) {
+ utils.toUrl("/mall/index/index", "redirectTo")
+ } else {
+
}
} else {
utils.toUrl("/pages/login/index", "redirectTo")
diff --git a/pages/login/index.vue b/pages/login/index.vue
index acac5e6..e9a3318 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -59,6 +59,8 @@ function handleSubmit() {
if (res.data.user_info.type == 1) {
utils.toUrl("/store/index/index", "redirectTo")
+ } else if (res.data.user_info.type == 3) {
+ utils.toUrl("/mall/index/index", "redirectTo")
} else {
uni.showToast({
title: '登录平台开发中 ···',
diff --git a/store/index/index.vue b/store/index/index.vue
index b952d13..3b3c1ce 100644
--- a/store/index/index.vue
+++ b/store/index/index.vue
@@ -24,7 +24,7 @@
-
等级管理
@@ -35,7 +35,7 @@
-
+ -->
@@ -85,6 +85,20 @@
+
+ 当面付订单
+
+
+
+
+
+
+
+
+
+
diff --git a/store/inpersonPay/index.vue b/store/inpersonPay/index.vue
new file mode 100644
index 0000000..70ddbf5
--- /dev/null
+++ b/store/inpersonPay/index.vue
@@ -0,0 +1,289 @@
+
+
+
+
+
+
+
+
+
+ {{ searchType }}
+
+
+
+
+
+
+
+ 付款码
+
+
+
+ {
+ params.status = (e.index == 3 ? 5 : e.index);
+ search({ value: params.keywords })
+ }" v-model="params.status">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 用户:{{ item?.user?.nickname }}
+
+
+
+ 单号:{{ item.order_no }}
+
+
+
+
+
+ 原价:¥ {{ item.total_price || 0 }}
+ 支付金额:¥ {{ item.pay_price || 0 }}
+
+ 支付方式:
+
+ {{ [
+ "", "支付宝", "微信", "余额", "货到付款", "先就餐后支付"
+ ][item.pay_type] }}
+
+
+
+
+
+
+
+
+
+
+ 支付状态:
+ {{ ["未支付", "已支付", "已取消"][item.status] || "已取消" }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/store/user/memberList.vue b/store/user/memberList.vue
index 24fe5d4..fe85a71 100644
--- a/store/user/memberList.vue
+++ b/store/user/memberList.vue
@@ -24,7 +24,6 @@
-
@@ -34,11 +33,9 @@
style="width: 60px;height: 60px;min-width: 60px;border-radius: 100px; " />
-
-
+
{{ member.name }} ¥{{ member.price }}
@@ -88,7 +85,7 @@
-
+
状态:
开启
关闭
@@ -96,14 +93,16 @@
折扣商品:{{ user?.goods_list?.length || 0 }}
+
+ 优惠时间:
+ {{ utils.dateFormat(user.start_time * 1000) }} - {{
+ utils.dateFormat(user.end_time * 1000) }}
+
+
+
-
- 优惠时间:
- {{ utils.dateFormat(user.start_time * 1000) }} - {{
- utils.dateFormat(user.end_time * 1000) }}
-
-
+