diff --git a/.env b/.env
index 7e7b528..d69df8d 100644
--- a/.env
+++ b/.env
@@ -17,4 +17,7 @@ MALL_DEV_PORT = 3000
MALL_STATIC_URL = https://file.sheepjs.com
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
-MALL_MPLIVE_ON = 0
\ No newline at end of file
+MALL_MPLIVE_ON = 0
+
+# APP 下载地址
+MALL_APP_DOWNLOAD_PATH = ''
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 6a8eee2..20c9dfa 100644
--- a/pages.json
+++ b/pages.json
@@ -147,7 +147,8 @@
{
"path": "point/loglist",
"style": {
- "navigationBarTitleText": "历史积分"
+ "navigationBarTitleText": "历史积分",
+ "enablePullDownRefresh": true
},
"meta": {
"auth": true
diff --git a/pages/index/index.vue b/pages/index/index.vue
index d196ebc..ee17f3d 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,12 +1,17 @@
-
-
+
+
+
-
- {{ merchantInfo.name }}
- {{ merchantInfo?.contactPhone }}
+
+ {{ merchantInfo.name }}
+ {{ merchantInfo?.contactPhone }}
+
+
+
+
@@ -19,7 +24,7 @@
¥
{{ state.statistic.todayPaymentAmount || 0 }}
-
+
总销售额 {{ state.statistic.totalSalesAmount }} 元 | 成功退款 {{ state.statistic.refundCount }} 笔 |
@@ -110,6 +115,14 @@ async function getStatistic() {
state.value.more[3].value = res.data.deliveryOrderCount
}
+/**
+ * @author Ankkaya
+ * @description 核销
+ * @param {Type} -
+ * @returns {Type}
+ */
+function checkVerifi() {}
+
onShow(() => {
getStatistic()
})
diff --git a/pages/index/my.vue b/pages/index/my.vue
index 842e8d5..57e25c5 100644
--- a/pages/index/my.vue
+++ b/pages/index/my.vue
@@ -1,12 +1,21 @@
-
-
+
+
+
-
- {{ userInfo.nickname }}
- {{ userInfo.mobile }}
+
+ {{ userInfo.nickname }}
+ {{ userInfo.mobile }}
+
+
+
+
diff --git a/pages/user/point/buy.vue b/pages/user/point/buy.vue
index c3fc60a..4ee9d49 100644
--- a/pages/user/point/buy.vue
+++ b/pages/user/point/buy.vue
@@ -1,167 +1,176 @@
-
-
- 购买商城积分
- 订单多多·出单多多
-
-
-
- 积分额度选择
- 专属您的积分
-
-
-
-
-
-
-
-
-
-
-
+
+ 积分额度选择
+ 专属您的积分
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
diff --git a/pages/user/point/loglist.vue b/pages/user/point/loglist.vue
index 8fdb320..2292a37 100644
--- a/pages/user/point/loglist.vue
+++ b/pages/user/point/loglist.vue
@@ -1,105 +1,126 @@
-
-
-
+
+
+
-
-
-
- 积分
- {{ item.date }}
-
-
- {{ item.last }}
- {{ item.income }}
-
+
+
+
+ 积分
+ {{ item.date }}
+
+
+ {{ item.last }}
+ {{ item.income }}
+
+
+
-
-
-
-
+
+
\ No newline at end of file
+
diff --git a/pages/user/point/share.vue b/pages/user/point/share.vue
index e395ba4..942a0c3 100644
--- a/pages/user/point/share.vue
+++ b/pages/user/point/share.vue
@@ -1,124 +1,243 @@
-
-
- 分发积分
- 订单多多·出单多多
-
-
-
-
-
-
-
-
-
-
- 哈哈哈
-
-
-
-
+
+
+ 分发积分
+ 订单多多·出单多多
-
-
-
+
+
+
+
+
+
+
+
+ {{ item.nickname }}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
diff --git a/pages/user/wallet/money.vue b/pages/user/wallet/money.vue
index d5a3420..0cfd144 100644
--- a/pages/user/wallet/money.vue
+++ b/pages/user/wallet/money.vue
@@ -63,10 +63,10 @@
import { computed, reactive } from 'vue'
import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import peach from '@/peach'
-import dayjs from 'dayjs'
import _ from 'lodash'
-import PayWalletApi from '@/peach/api/pay/wallet'
import { fen2yuan } from '@/peach/hooks/useGoods'
+import dayjs from 'dayjs'
+import PayWalletApi from '@/peach/api/pay/wallet'
import { resetPagination } from '@/peach/utils'
const bgStyle = {
diff --git a/peach/api/member/user.js b/peach/api/member/user.js
index 7ce156b..730ad1c 100644
--- a/peach/api/member/user.js
+++ b/peach/api/member/user.js
@@ -24,6 +24,23 @@ const UserUtil = {
method: 'GET',
})
},
+
+ /**
+ * @author Ankkaya
+ * @description 用户列表
+ * @param {String} mobile - 手机号
+ * @param {String} nickname - 用户昵称
+ * @param {Number} pageNo - 页码
+ * @param {Number} pageSize - 每页条数
+ * @returns {Type}
+ */
+ getUserList: (data) => {
+ return request({
+ url: '/particulars/point/page-member',
+ method: 'GET',
+ params: data,
+ })
+ },
}
export default UserUtil
diff --git a/peach/api/pay/point.js b/peach/api/pay/point.js
new file mode 100644
index 0000000..f572d66
--- /dev/null
+++ b/peach/api/pay/point.js
@@ -0,0 +1,28 @@
+import request from '@/peach/request'
+
+const PointApi = {
+ /**
+ * @author Ankkaya
+ * @description 分发积分
+ * @param {String} memberId - 用户 id
+ * @param {Number} point - 积分
+ * @returns {Type}
+ */
+ sendPoint: (data) => {
+ return request({
+ url: '/particulars/point/send-member',
+ method: 'post',
+ data,
+ })
+ },
+
+ getPointList: (data) => {
+ return request({
+ url: '/particulars/point/page-record',
+ method: 'get',
+ params: data,
+ })
+ },
+}
+
+export default PointApi
diff --git a/peach/components/p-menu-tools/p-menu-tools.vue b/peach/components/p-menu-tools/p-menu-tools.vue
new file mode 100644
index 0000000..5119fa9
--- /dev/null
+++ b/peach/components/p-menu-tools/p-menu-tools.vue
@@ -0,0 +1,114 @@
+
+
+
+
+
+ 快捷菜单
+
+
+
+
+ {{ item.title }}
+
+
+
+
+
+
+
+
+
+
diff --git a/peach/helper/index.js b/peach/helper/index.js
index 59eaf61..af7db7b 100644
--- a/peach/helper/index.js
+++ b/peach/helper/index.js
@@ -673,7 +673,34 @@ export function copyText(text) {
// #endif
}
+/**
+ * @desc 函数防抖
+ * @param func 目标函数
+ * @param wait 延迟执行毫秒数
+ * @param immediate true - 立即执行, false - 延迟执行
+ */
+export const debounce = function (func, wait = 1000, immediate = true) {
+ let timer
+ return function () {
+ let context = this,
+ args = arguments
+ if (timer) clearTimeout(timer)
+ if (immediate) {
+ let callNow = !timer
+ timer = setTimeout(() => {
+ timer = null
+ }, wait)
+ if (callNow) func.apply(context, args)
+ } else {
+ timer = setTimeout(() => {
+ func.apply(context, args)
+ }, wait)
+ }
+ }
+}
+
export default {
+ debounce,
range,
getPx,
sleep,
diff --git a/peach/platform/index.js b/peach/platform/index.js
index 6c25afb..8976d59 100644
--- a/peach/platform/index.js
+++ b/peach/platform/index.js
@@ -1,6 +1,42 @@
import share from './share'
+import android from './provider/android'
const device = uni.getSystemInfoSync()
+const os = device.platform
+
+let name = ''
+let provider = ''
+let platform = ''
+let isWechatInstalled = true
+
+// #ifdef APP-PLUS
+name = 'App'
+platform = 'openPlatform'
+
+// 检查微信客户端是否安装,否则 AppleStore 会因此拒绝上架
+if (os === 'ios') {
+ provider = 'ios'
+ isWechatInstalled = plus.ios.import('WXApi').isWXapiInstalled()
+} else {
+ provider = 'android'
+}
+// #endif
+
+function useProvider() {
+ if (provider === 'android') {
+ return android
+ }
+}
+
+/**
+ * @author Ankkaya
+ * @description 检查更新
+ * @param {Type} -
+ * @returns {Type}
+ */
+function checkUpdate() {
+ useProvider().checkUpdate()
+}
/**
* @author Ankkaya
@@ -68,6 +104,7 @@ const _platform = {
navBar,
capsule,
checkNetwork,
+ checkUpdate,
}
export default _platform
diff --git a/peach/platform/provider/android/index.js b/peach/platform/provider/android/index.js
new file mode 100644
index 0000000..b4bc037
--- /dev/null
+++ b/peach/platform/provider/android/index.js
@@ -0,0 +1,95 @@
+const device = uni.getSystemInfoSync()
+
+/**
+ * @author Ankkaya
+ * @description 检查更新
+ * @param {String} newVersion - 最新版本
+ * @returns {Type}
+ */
+function checkUpdate(newVersion) {
+ plus.runtime.getProperty(plus.runtime.appid, (wgtInfo) => {
+ if (String(device.platform).toLowerCase() === 'android') {
+ console.log(wgtInfo)
+ if (wgtInfo.version !== newVersion) {
+ uni.showModal({
+ title: '温馨提示',
+ content: '发现新版本APP,您是否要升级体验?',
+ cancelText: '暂时忽略',
+ confirmText: '立即升级',
+ success: (action) => {
+ if (action.confirm) {
+ // 下载 app
+ downLoadApp()
+ } else {
+ // 忽略
+ }
+ },
+ })
+ }
+ }
+ })
+}
+
+function downLoadApp() {
+ let percent = 0
+ let downnUrl = import.meta.env.MALL_APP_DOWNLOAD_PATH
+ let dtask = plus.downloader.createDownload(downnUrl, {}, (d, status) => {
+ if (status == 200) {
+ let path = d.filename
+ plus.runtime.install(path, {}, () => {})
+ } else {
+ uni.showToast({
+ title: '下载失败',
+ icon: 'none',
+ })
+ }
+ })
+
+ try {
+ dtask.start()
+ let showLoading = plus.nativeUI.showWaiting('正在下载...')
+ dtask.addEventListener('statechanged', (download, status) => {
+ switch (download.state) {
+ case 1:
+ showLoading.setTitle('正在下载...')
+ break
+ case 2:
+ showLoading.setTitle('已连接到服务器')
+ break
+ case 3:
+ percent = parseInt((parseFloat(download.downloadedSize) / parseFloat(download.totalSize)) * 100)
+ showLoading.setTitle(`正在下载` + percent + '%')
+ break
+ case 4:
+ plus.nativeUI.closeWaiting()
+ break
+ }
+ })
+ } catch (e) {
+ plus.nativeUI.closeWaiting()
+ uni.showToast({
+ title: '更新失败!',
+ icon: 'none',
+ })
+ }
+}
+
+/**
+ * @author Ankkaya
+ * @description 本地版本
+ * @param {Type} -
+ * @returns {Type}
+ */
+function getVersion() {
+ let version = ''
+ plus.runtime.getProperty(plus.runtime.appid, (wgtInfo) => {
+ version = wgtInfo.version
+ })
+ return version
+}
+
+export default {
+ checkUpdate,
+ downLoadApp,
+ getVersion,
+}
diff --git a/peach/ui/pb-inner-navbar/pb-inner-navbar.vue b/peach/ui/pb-inner-navbar/pb-inner-navbar.vue
index 33737b8..6af7535 100644
--- a/peach/ui/pb-inner-navbar/pb-inner-navbar.vue
+++ b/peach/ui/pb-inner-navbar/pb-inner-navbar.vue
@@ -1,30 +1,49 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+ {{ props.right }}
+
+
+
+
+
+
-
- {{ title }}
-
-
-
-
-
-
-
+
diff --git a/peach/ui/pb-layout/pb-layout.vue b/peach/ui/pb-layout/pb-layout.vue
index 12929cd..caa66e6 100644
--- a/peach/ui/pb-layout/pb-layout.vue
+++ b/peach/ui/pb-layout/pb-layout.vue
@@ -1,32 +1,47 @@
-
-
-
- emits('search', e)" :defaultSearch="defaultSearch" />
-
-
-
-
+
+
+
+ emits('search', e)"
+ :defaultSearch="defaultSearch"
+ />
+
+
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
diff --git a/static/point.png b/static/point.png
new file mode 100644
index 0000000..5622373
Binary files /dev/null and b/static/point.png differ