feat:迁移
This commit is contained in:
1 parent
d87d1b5f8d
commit
3f4e389b33
63 files changed
+502
-108
No files matched your search
@@ -18,6 +18,7 @@ export { default as maintenanceApi } from "./maintenance"
|
||||
export { default as meetingRoomApi } from "./meeting-room"
|
||||
export { default as merchantApi } from "./merchant"
|
||||
export { default as miniPlatformApi } from "./mini-platform"
|
||||
export * from "./mini-platform"
|
||||
export { default as noticeApi } from "./notice"
|
||||
export { default as orderApi } from "./order"
|
||||
export { default as payApi } from "./pay"
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
import request from "@/sheep/utils/request"
|
||||
|
||||
type AutoAdminLoginDto = {
|
||||
export type AutoAdminLoginDto = {
|
||||
miniPlatformType?: string
|
||||
phoneCode?: string
|
||||
userCode?: string
|
||||
}
|
||||
|
||||
export type GetUniqueCodeDto = {
|
||||
miniPlatformType?: string
|
||||
code: string
|
||||
userId?: string
|
||||
}
|
||||
|
||||
export type MiniPayDto = {
|
||||
bizType: "MINI_APP_WALLET_RECHARGE"
|
||||
bizId: string
|
||||
miniPlatformType: string
|
||||
amount?: number
|
||||
openId: string
|
||||
}
|
||||
|
||||
export default {
|
||||
autoAdminLogin: (data: AutoAdminLoginDto) =>
|
||||
request({
|
||||
@@ -13,4 +27,18 @@ export default {
|
||||
method: "POST",
|
||||
data,
|
||||
}),
|
||||
|
||||
getUniqueCode: (data: GetUniqueCodeDto) =>
|
||||
request({
|
||||
url: "/third/third-mini-app-oath/get-unique",
|
||||
method: "POST",
|
||||
data,
|
||||
}),
|
||||
|
||||
miniPay: (data: MiniPayDto) =>
|
||||
request({
|
||||
url: "/third/third-mini-app-pay/app/pay",
|
||||
method: "POST",
|
||||
data,
|
||||
}),
|
||||
}
|
||||
@@ -35,7 +35,7 @@ defineExpose({
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="showPhoneText" class="w-full second-text-26 text-center mb-16rpx mt-80rpx" @tap="doServiceText">
|
||||
<view v-if="showPhoneText" class="w-full second-text-26 text-center mb-2 mt-10" @tap="doServiceText">
|
||||
<text>联系热线</text>
|
||||
</view>
|
||||
<tm-drawer :show="state.showModal" title="联系热线" size="30%" position="bottom" @close="state.showModal = false">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<node-tree v-model="selectedNodeId" :node-data="categoryTree" @currentNode="currentNode" />
|
||||
<view v-if="categoryTree.length === 0" class="text-center text-#888 py-40rpx">暂无数据</view>
|
||||
</view>
|
||||
<view class="px-20rpx py-16rpx flex justify-between sticky bottom-0 bg-white">
|
||||
<view class="px-20rpx py-2 flex justify-between sticky bottom-0 bg-white">
|
||||
<tm-button skin="thin" block @click="emit('cancel')">取消</tm-button>
|
||||
|
||||
<tm-button block :disabled="!selectedNode" @click="onConfirm">确定</tm-button>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{ item.time.slice(0, 5) }}
|
||||
</tm-button>
|
||||
</view>
|
||||
<view class="px-20rpx py-16rpx flex justify-between">
|
||||
<view class="px-20rpx py-2 flex justify-between">
|
||||
<tm-button skin="thin" block @click="emit('cancel')">取消</tm-button>
|
||||
|
||||
<tm-button block @click="onConfirm">确定</tm-button>
|
||||
|
||||
@@ -3,3 +3,5 @@ export { default as serviceEnum } from "./service-enum"
|
||||
export { default as storageConstant } from "./storage-constant"
|
||||
|
||||
export { default as APPENV } from "./app-env"
|
||||
|
||||
export * from "./service-image"
|
||||
@@ -0,0 +1,10 @@
|
||||
export const SERVICE_IMAGE = {
|
||||
// 宁波银行
|
||||
happyMall: "/admin/sys-file/oss/file?fileName=11a0f8629aa44cbfbfa28448632141b2.png",
|
||||
// 空购物车
|
||||
carEmpty: "/admin/sys-file/oss/file?fileName=76c9a53b13a24b52995714ba9399d141.png",
|
||||
// 蓝色背景
|
||||
blueBg: "/admin/sys-file/oss/file?fileName=ab8823b0abb045a7b9ce7a52d91eea8f.png",
|
||||
// 生日海报
|
||||
birthdayCoupon: "/admin/sys-file/oss/file?fileName=d723089fccec4f598e86459e8899b0de.jpg",
|
||||
}
|
||||
@@ -6,4 +6,5 @@ export default {
|
||||
VERSION_OBJ: "version_obj",
|
||||
USER_SETTING: "user_setting",
|
||||
REMEMBER_USER: "remember_user",
|
||||
UNIQUE_CODE: "unique_code",
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { storageConstant } from "@/sheep/constant/index"
|
||||
import { miniPlatformApi } from "@/sheep/api"
|
||||
|
||||
import { getAppInfo } from "./app"
|
||||
|
||||
// 获取小程序唯一编码
|
||||
export async function getMiniUniqueCode(forceGet = false) {
|
||||
let uniqueCode = uni.getStorageSync(storageConstant.UNIQUE_CODE)
|
||||
if (uniqueCode && !forceGet) {
|
||||
return uniqueCode
|
||||
}
|
||||
const appEnv = await getAppInfo()
|
||||
try {
|
||||
const res = await uni.login({
|
||||
provider: "weixin",
|
||||
})
|
||||
if (!res?.code) {
|
||||
throw new Error("登录失败")
|
||||
}
|
||||
const { data, code }: any = await miniPlatformApi.getUniqueCode({
|
||||
miniPlatformType: appEnv,
|
||||
code: res.code,
|
||||
})
|
||||
if (code != 0 || !data) {
|
||||
throw new Error("获取小程序唯一编码失败")
|
||||
}
|
||||
uniqueCode = data
|
||||
uni.setStorageSync(storageConstant.UNIQUE_CODE, uniqueCode)
|
||||
return uniqueCode || ""
|
||||
} catch (error) {
|
||||
if (uniqueCode) {
|
||||
return uniqueCode
|
||||
} else {
|
||||
uni.removeStorageSync(storageConstant.UNIQUE_CODE)
|
||||
}
|
||||
console.log("获取小程序唯一编码失败", error)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user