Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-mobile-react-cloud
# Conflicts: # .env # src/pages.json
This commit is contained in:
commit
1fdbb9bac9
18 files changed
+685
-251
No files matched your search
@@ -21,14 +21,14 @@ VITE_OAUTH2_APP_CLIENT='mini:mini'
|
||||
# VITE_IMAGE_BASE_PATH = http://192.168.101.64:9999 # 邓-本地
|
||||
# VITE_IMAGE_BASE_PATH = https://123.156.230.15:8089/api # 线上
|
||||
# VITE_IMAGE_BASE_PATH = http://220.191.229.171:8090/api # 线上
|
||||
VITE_IMAGE_BASE_PATH = https://stgl.pj.gov.cn/api # 线上
|
||||
# VITE_IMAGE_BASE_PATH = https://stgl.pj.gov.cn/api # 线上
|
||||
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc # 张
|
||||
#VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api # 信创线上
|
||||
VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api # 信创线上
|
||||
|
||||
# ******************** start 开发环境 start ********************
|
||||
# VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上
|
||||
VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api
|
||||
#VITE_APP_DEV_SERVICE = http://192.168.101.64:9999 # 邓-本地
|
||||
VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上
|
||||
# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/app-api
|
||||
# VITE_APP_DEV_SERVICE = http://192.168.101.64:9999 # 邓-本地
|
||||
# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999
|
||||
# VITE_APP_DEV_SERVICE = http://123.156.230.15:8089/api/ # 线上
|
||||
# VITE_APP_DEV_SERVICE = http://220.191.229.171:8090/api # 线上
|
||||
@@ -38,9 +38,10 @@ VITE_OAUTH2_APP_CLIENT='mini:mini'
|
||||
# ******************** start 生产环境 start ****************
|
||||
#VITE_APP_PROD_SERVICE = http://123.156.228.134:48080/app-api
|
||||
#VITE_APP_PROD_SERVICE = http://59.202.170.152:81/api
|
||||
VITE_APP_PROD_SERVICE = https://stgl.pj.gov.cn/api
|
||||
# VITE_APP_PROD_SERVICE = https://stgl.pj.gov.cn/api
|
||||
# VITE_APP_PROD_SERVICE = http://220.191.229.171:8090/api
|
||||
#VITE_APP_PROD_SERVICE = http://59.202.170.152:81/api # 信创线上
|
||||
VITE_APP_PROD_SERVICE = http://59.202.170.152:81/api # 信创线上
|
||||
# ******************** end 生产环境 end ********************
|
||||
VITE_DEV_ENV = dev
|
||||
# VITE_DEV_ENV = prod
|
||||
|
||||
# VITE_DEV_ENV = dev
|
||||
# VITE_DEV_ENV = prod
|
||||
+113
-5
@@ -1,8 +1,116 @@
|
||||
<script setup lang="ts">
|
||||
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"
|
||||
onLaunch(() => {})
|
||||
onShow(() => {})
|
||||
onHide(() => {})
|
||||
<script lang="ts">
|
||||
// import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"
|
||||
// onLaunch(() => {})
|
||||
// onShow(() => {})
|
||||
// onHide(() => {})
|
||||
|
||||
// zhezhengding:浙政钉 | shihua:诗画
|
||||
const tabbar = [
|
||||
{
|
||||
pagePath: "pages/tabbar/canteen",
|
||||
text: "食堂",
|
||||
iconPath: "/static/tabbar/canteen.png",
|
||||
selectedIconPath: "/static/tabbar/canteen-select.png",
|
||||
auth: ["zhezhengding", "shihua"],
|
||||
},
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/shop",
|
||||
// "text": "超市",
|
||||
// "iconPath": "/static/tabbar/shop.png",
|
||||
// "selectedIconPath": "/static/tabbar/shop-select.png"
|
||||
// },
|
||||
{
|
||||
pagePath: "pages/tabbar/order",
|
||||
text: "订单",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
auth: ["zhezhengding"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/flowStatistics",
|
||||
text: "流水统计",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
auth: ["shihua"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/individualOrder",
|
||||
text: "订单",
|
||||
iconPath: "/static/tabbar/order.png",
|
||||
selectedIconPath: "/static/tabbar/order-select.png",
|
||||
auth: ["shihua"],
|
||||
},
|
||||
{
|
||||
pagePath: "pages/tabbar/my",
|
||||
text: "我的",
|
||||
iconPath: "/static/tabbar/my.png",
|
||||
selectedIconPath: "/static/tabbar/my-select.png",
|
||||
auth: ["zhezhengding", "shihua"],
|
||||
},
|
||||
]
|
||||
|
||||
export default {
|
||||
onLaunch() {},
|
||||
onShow() {},
|
||||
onHide() {},
|
||||
|
||||
methods: {
|
||||
_initTabbar() {
|
||||
console.log("环境判断")
|
||||
|
||||
let appEnv = 1 // 1:浙政钉 2:诗画
|
||||
|
||||
switch (appEnv) {
|
||||
case 1:
|
||||
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, auth }, index) => {
|
||||
if (auth.includes("zhezhengding")) {
|
||||
uni.setTabBarItem({
|
||||
index,
|
||||
pagePath,
|
||||
text,
|
||||
iconPath,
|
||||
selectedIconPath,
|
||||
visible: true,
|
||||
})
|
||||
} else {
|
||||
uni.setTabBarItem({
|
||||
index,
|
||||
pagePath,
|
||||
text,
|
||||
iconPath,
|
||||
selectedIconPath,
|
||||
visible: false,
|
||||
})
|
||||
}
|
||||
})
|
||||
break
|
||||
case 2:
|
||||
tabbar.forEach(({ pagePath, text, iconPath, selectedIconPath, auth }, index) => {
|
||||
if (auth.includes("shihua")) {
|
||||
uni.setTabBarItem({
|
||||
index,
|
||||
pagePath,
|
||||
text,
|
||||
iconPath,
|
||||
selectedIconPath,
|
||||
visible: true,
|
||||
})
|
||||
} else {
|
||||
uni.setTabBarItem({
|
||||
index,
|
||||
pagePath,
|
||||
text,
|
||||
iconPath,
|
||||
selectedIconPath,
|
||||
visible: false,
|
||||
})
|
||||
}
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
+82
-42
@@ -10,19 +10,19 @@
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/tabbar/home",
|
||||
"path": "pages/tabbar/canteen",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页",
|
||||
"navigationBarTitleText": "食堂",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/shop",
|
||||
"style": {
|
||||
"navigationBarTitleText": "超市",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "pages/tabbar/shop",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "超市",
|
||||
// "disableScroll": true
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/tabbar/order",
|
||||
"style": {
|
||||
@@ -30,20 +30,20 @@
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "pages/tabbar/flowStatistics",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "流水统计",
|
||||
// "disableScroll": true
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "pages/tabbar/individualOrder",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "订单",
|
||||
// "disableScroll": true
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/tabbar/flowStatistics",
|
||||
"style": {
|
||||
"navigationBarTitleText": "流水统计",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/individualOrder",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/my",
|
||||
"style": {
|
||||
@@ -294,41 +294,81 @@
|
||||
"tabBar": {
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/tabbar/home",
|
||||
"text": "首页",
|
||||
"iconPath": "static/tabbar/home.png",
|
||||
"selectedIconPath": "static/tabbar/home-select.png"
|
||||
"pagePath": "pages/tabbar/canteen",
|
||||
"text": "",
|
||||
"iconPath": "",
|
||||
"selectedIconPath": ""
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/shop",
|
||||
"text": "超市",
|
||||
"iconPath": "static/tabbar/shop.png",
|
||||
"selectedIconPath": "static/tabbar/shop-select.png"
|
||||
},
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/shop",
|
||||
// "text": "",
|
||||
// "iconPath": "",
|
||||
// "selectedIconPath": ""
|
||||
// },
|
||||
{
|
||||
"pagePath": "pages/tabbar/order",
|
||||
"text": "订单",
|
||||
"iconPath": "static/tabbar/order.png",
|
||||
"selectedIconPath": "static/tabbar/order-select.png"
|
||||
"text": "",
|
||||
"iconPath": "",
|
||||
"selectedIconPath": ""
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/flowStatistics",
|
||||
"text": "",
|
||||
"iconPath": "",
|
||||
"selectedIconPath": ""
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/individualOrder",
|
||||
"text": "",
|
||||
"iconPath": "",
|
||||
"selectedIconPath": ""
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tabbar/my",
|
||||
"text": "",
|
||||
"iconPath": "",
|
||||
"selectedIconPath": ""
|
||||
}
|
||||
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/canteen",
|
||||
// "text": "食堂",
|
||||
// "iconPath": "static/tabbar/canteen.png",
|
||||
// "selectedIconPath": "static/tabbar/canteen-select.png"
|
||||
// },
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/shop",
|
||||
// "text": "超市",
|
||||
// "iconPath": "static/tabbar/shop.png",
|
||||
// "selectedIconPath": "static/tabbar/shop-select.png"
|
||||
// },
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/order",
|
||||
// "text": "订单",
|
||||
// "iconPath": "static/tabbar/order.png",
|
||||
// "selectedIconPath": "static/tabbar/order-select.png"
|
||||
// },
|
||||
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/flowStatistics",
|
||||
// "text": "流水统计",
|
||||
// "iconPath": "static/tabbar/order.png",
|
||||
// "selectedIconPath": "static/tabbar/order-select.png"
|
||||
// },
|
||||
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/individualOrder",
|
||||
// "text": "订单",
|
||||
// "iconPath": "static/tabbar/order.png",
|
||||
// "selectedIconPath": "static/tabbar/order-select.png"
|
||||
// },
|
||||
{
|
||||
"pagePath": "pages/tabbar/my",
|
||||
"text": "我的",
|
||||
"iconPath": "static/tabbar/my.png",
|
||||
"selectedIconPath": "static/tabbar/my-select.png"
|
||||
}
|
||||
|
||||
// {
|
||||
// "pagePath": "pages/tabbar/my",
|
||||
// "text": "我的",
|
||||
// "iconPath": "static/tabbar/my.png",
|
||||
// "selectedIconPath": "static/tabbar/my-select.png"
|
||||
// },
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -154,11 +154,11 @@ const doProduct = (v: any) => {
|
||||
<view class="sub-text-28 show-line">{{ item.name }}</view>
|
||||
<view class="m-t-10rpx flex-row items-center">
|
||||
<view class="second-text-32 color-#f63a36!"> ¥{{ hooks.useMoney(item.price) }} </view>
|
||||
<view class="m-l-20rpx second-text-24 line-through"> ¥{{ hooks.useMoney(item.marketPrice) }} </view>
|
||||
<view class="m-l-20rpx mt-1 second-text-24 line-through">¥{{ hooks.useMoney(item.marketPrice) }}</view>
|
||||
</view>
|
||||
<view class="flex-row items-center">
|
||||
<view class="flex-col items-start">
|
||||
<view class="second-text-24">{{ hooks.useFormatNum("库存", "", item.stock) }}</view>
|
||||
<view class="w-1px h-20rpx m-x-5rpx bg-#999" />
|
||||
<!-- <view class="w-1px h-20rpx m-x-5rpx bg-#999" /> -->
|
||||
<view class="second-text-24">{{ hooks.useFormatNum("销量", "", item.salesCount) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -149,7 +149,7 @@ const handlePay = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// handle pay
|
||||
// 支付
|
||||
const pay = async () => {
|
||||
try {
|
||||
uni.showLoading({ title: "支付中...", mask: true })
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue"
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { hooks, router } from "@@/index"
|
||||
import { merchantApi } from "@@/api"
|
||||
import { filePath } from "@@/utils/file"
|
||||
@@ -12,6 +12,10 @@ const state = reactive<any>({
|
||||
},
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
const app = getApp()
|
||||
app._initTabbar()
|
||||
})
|
||||
onShow(() => {
|
||||
if (pageRef.value) {
|
||||
pageRef.value.reload(false)
|
||||
@@ -17,14 +17,15 @@
|
||||
<view class="h-30rpx" />
|
||||
<view class="bg-white rounded-12rpx p-20rpx flex justify-between items-center">
|
||||
<text class="text-30 font-600">流水统计</text>
|
||||
<tm-text color="#999999">{{ state.nowVal }}</tm-text>
|
||||
<tm-text color="#999999">{{ formatVal }}</tm-text>
|
||||
<view class="flex items-center cursor-pointer">
|
||||
<tm-between-time
|
||||
start="2020-1-1"
|
||||
end="2040-1-1"
|
||||
v-model="state.newdata"
|
||||
v-model:model-str="state.nowVal"
|
||||
v-model="state.date"
|
||||
v-model:model-str="state.formatVal"
|
||||
@confirm="datePickerConfirm"
|
||||
format="YYYY-MM-DD"
|
||||
>
|
||||
<svg
|
||||
t="1742280333491"
|
||||
@@ -49,39 +50,43 @@
|
||||
|
||||
<view class="h-20rpx" />
|
||||
|
||||
<view class="bg-white rounded-16rpx p-2 mb-2 shadow-md" v-for="(v, i) in list" :key="i">
|
||||
<view class="text-28 text-gray-800 font-medium px-2 mb-2">
|
||||
{{ "2022-01-01" }}
|
||||
<view class="bg-white rounded-16rpx p-2 mb-1 shadow-md" v-for="(v, i) in list" :key="i">
|
||||
<view class="flex justify-between items-center text-sm text-gray-800 mb-1">
|
||||
<view class="flex items-center">
|
||||
<image class="w-50rpx h-50rpx rounded-8rpx" :src="filePath(v.logoPic)" mode="aspectFill" />
|
||||
<view class="ml-2">{{ v.merchantName }}</view>
|
||||
</view>
|
||||
<view>{{ v.day }}</view>
|
||||
</view>
|
||||
<view class="bg-gray-100 rounded-12rpx p-2">
|
||||
<view class="flex justify-between mb-2">
|
||||
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx mr-1">
|
||||
<text class="flex-1 text-center text-gray-600">流水金额</text>
|
||||
<text class="flex-1 text-center text-26 text-gray-800 font-medium">¥{{ 1145 }}</text>
|
||||
<view class="bg-gray-100 rounded-12rpx p-1">
|
||||
<view class="flex justify-between mb-1">
|
||||
<view class="flex-1 flex items-center p-1 bg-white rounded-8rpx">
|
||||
<text class="flex-1 text-sm text-center text-gray-600">流水金额</text>
|
||||
<text class="flex-1 text-sm text-center text-gray-800">¥ {{ hooks.useMoney(v.totalPayPrice) }}</text>
|
||||
</view>
|
||||
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx ml-1">
|
||||
<text class="flex-1 text-center text-gray-600">流水次数</text>
|
||||
<text class="flex-1 text-center text-26 text-gray-800 font-medium">{{ 1145 }}</text>
|
||||
<view class="flex-1 flex items-center p-1 bg-white rounded-8rpx ml-1">
|
||||
<text class="flex-1 text-sm text-center text-gray-600">流水次数</text>
|
||||
<text class="flex-1 text-sm text-center text-gray-800">{{ v.totalPayCount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between mb-2">
|
||||
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx mr-1">
|
||||
<text class="flex-1 text-center text-gray-600">退款金额</text>
|
||||
<text class="flex-1 text-center text-26 text-red-500 font-medium">¥{{ 1145 }}</text>
|
||||
<view class="flex justify-between mb-1">
|
||||
<view class="flex-1 flex items-center p-1 bg-white rounded-8rpx">
|
||||
<text class="flex-1 text-sm text-center text-gray-600">盈利金额</text>
|
||||
<text class="flex-1 text-sm text-center text-green-500">¥ {{ hooks.useMoney(v.totalProfitPrice) }}</text>
|
||||
</view>
|
||||
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx ml-1">
|
||||
<text class="flex-1 text-center text-gray-600">退款次数</text>
|
||||
<text class="flex-1 text-center text-26 text-red-500 font-medium">{{ 1145 }}</text>
|
||||
<view class="flex-1 flex items-center p-1 bg-white rounded-8rpx ml-1">
|
||||
<text class="flex-1 text-sm text-center text-gray-600">盈利次数</text>
|
||||
<text class="flex-1 text-sm text-center text-green-500">{{ v.totalProfitCount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between mb-0">
|
||||
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx mr-1">
|
||||
<text class="flex-1 text-center text-gray-600">盈利金额</text>
|
||||
<text class="flex-1 text-center text-26 text-green-500 font-medium">¥{{ 1145 }}</text>
|
||||
<view class="flex-1 flex items-center p-1 bg-white rounded-8rpx">
|
||||
<text class="flex-1 text-sm text-center text-gray-600">退款金额</text>
|
||||
<text class="flex-1 text-sm text-center text-red-500">¥ {{ hooks.useMoney(v.totalRefundPrice) }}</text>
|
||||
</view>
|
||||
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx ml-1">
|
||||
<text class="flex-1 text-center text-gray-600">盈利次数</text>
|
||||
<text class="flex-1 text-center text-26 text-green-500 font-medium">{{ 1145 }}</text>
|
||||
<view class="flex-1 flex items-center p-1 bg-white rounded-8rpx ml-1">
|
||||
<text class="flex-1 text-sm text-center text-gray-600">退款次数</text>
|
||||
<text class="flex-1 text-sm text-center text-red-500">{{ v.totalRefundCount || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -91,35 +96,44 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue"
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
import { ref, reactive, computed } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { hooks } from "@@/index"
|
||||
import { orderApi } from "@@/api"
|
||||
import { filePath } from "@@/utils/file"
|
||||
import { flowStatisticsApi } from "@@/api"
|
||||
|
||||
const pageRef = ref<any>(null)
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
payTimeList: [],
|
||||
createTimeList: [],
|
||||
},
|
||||
nowVal: "",
|
||||
newdata: "",
|
||||
formatVal: "",
|
||||
date: "",
|
||||
})
|
||||
const { list, startPage, scroll } = hooks.usePage(pageRef, orderApi.page, null, "data.records")
|
||||
const formatVal = computed(() => (state.date.length === 2 ? state.formatVal : ""))
|
||||
const { list, startPage, scroll } = hooks.usePage(pageRef, flowStatisticsApi.page, null, "data")
|
||||
|
||||
onLoad(() => {
|
||||
const app = getApp()
|
||||
app._initTabbar()
|
||||
})
|
||||
onShow(() => {
|
||||
// const isLogin = await hooks.useCheckLogin()
|
||||
// if (!isLogin) return
|
||||
const isLogin = hooks.useCheckLogin()
|
||||
if (!isLogin) return
|
||||
if (pageRef.value) {
|
||||
pageRef.value.reload(false)
|
||||
}
|
||||
})
|
||||
|
||||
const query = (page: number, pagesize: number) => {
|
||||
// const isLogin = hooks.useStaticCheckLogin()
|
||||
// if (!isLogin) return
|
||||
const isLogin = hooks.useStaticCheckLogin()
|
||||
if (!isLogin) return
|
||||
startPage(page, pagesize, false, state.pa)
|
||||
}
|
||||
|
||||
// 时间范围选择器确认
|
||||
const datePickerConfirm = (date: any) => {
|
||||
state.pa.payTimeList = state.newdata
|
||||
state.pa.createTimeList = date.map((v: any) => hooks.useTime(v, "{y}-{m}-{d}"))
|
||||
pageRef.value.reload(false)
|
||||
}
|
||||
</script>
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<view class="h-20rpx" />
|
||||
|
||||
<view class="flex-col justify-center card p-x-15rpx p-y-25rpx m-b-20rpx" v-for="(v, i) in list" :key="i">
|
||||
<view class="flex-col justify-center card p-x-15rpx p-y-25rpx m-b-10rpx" v-for="(v, i) in list" :key="i">
|
||||
<view class="flex-row items-center">
|
||||
<image class="w-100rpx h-100rpx rounded-8rpx" :src="filePath(v.logoPic)" mode="aspectFill" />
|
||||
<view class="flex-1 flex-col m-l-20rpx">
|
||||
@@ -31,14 +31,16 @@
|
||||
<view class="main-text-28">{{ v.merchantName }}</view>
|
||||
<view v-if="false" class="m-l-15rpx color-#999 font-size-26rpx! iconfont icon-youjiantou" />
|
||||
</view>
|
||||
<tm-tag v-if="v.orderStatus !== 1" color="success" size="xs">已支付</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 2" color="info" size="xs">售后</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 1" color="info" size="xs">未支付</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 5" color="success" size="xs">已支付</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 10" color="error" size="xs">售后</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 20" size="xs">已核销</tm-tag>
|
||||
</view>
|
||||
<view class="flex justify-between items-end m-t-5rpx">
|
||||
<view class="flex flex-col m-t-5rpx">
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="flex flex-col">
|
||||
<view class="second-text-20">
|
||||
<text>{{ "某个人" }}</text>
|
||||
<text class="m-l-10rpx">{{ "13155555555" }}</text>
|
||||
<text>{{ v.username }}</text>
|
||||
<text class="m-l-10rpx">{{ v.userMobile }}</text>
|
||||
</view>
|
||||
<view class="second-text-20">
|
||||
<text>下单时间</text>
|
||||
@@ -47,77 +49,211 @@
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-row">
|
||||
<view class="m-t-14rpx m-r-20rpx second-text-26">共 {{ v.carList.length }} 件</view>
|
||||
<view class="m-t-10rpx main-text-30 color-red!">¥ {{ hooks.useMoney(v.totalPrice) }}</view>
|
||||
<view class="flex flex-col items-end justify-center m-t-5rpx">
|
||||
<view class="second-text-22">{{ hooks.useEnum("hardwareRefundStatusEnum", v.refundStatus) }}</view>
|
||||
<view class="flex">
|
||||
<view v-if="v.carList?.length" class="m-t-4rpx m-r-10rpx second-text-26">共 {{ v.carList.length }} 件</view>
|
||||
<view class="main-text-30 color-red!">¥ {{ hooks.useMoney(v.totalPrice) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="h-20rpx m-t-[-10rpx] flex justify-end items-center">
|
||||
<!-- <view class="absolute top-0 right-0 bottom-0 left-0 h-180rpx">
|
||||
<scroll-view scroll-x class="flex-row-center whitespace-nowrap">
|
||||
<view class="flex-row items-center">
|
||||
<view
|
||||
class="inline-flex! flex-col justify-center h-180rpx m-r-20rpx"
|
||||
v-for="(pV, pI) in v.carList"
|
||||
:key="pI"
|
||||
@tap.stop="
|
||||
router.jump('/pages/merchant/product-detail', {
|
||||
id: pV.productId,
|
||||
})
|
||||
"
|
||||
>
|
||||
<image class="w-160rpx h-120rpx rounded-8rpx" :src="filePath(pV.productPic)" mode="aspectFill" />
|
||||
<view class="w-160rpx m-t-10rpx sub-text-24 show-line text-center">
|
||||
{{ pV.productName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="inline-flex! h-180rpx">
|
||||
<view class="w-160rpx h-full" />
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex-row items-center justify-end">
|
||||
<view class="botder_btn" @tap.stop="">退款</view>
|
||||
<view v-if="v.orderStatus == 10 && v.refundStatus == 0" class="h-50rpx mt-1 flex justify-end items-center">
|
||||
<view class="botder_btn" @tap.stop="doIndividualRefund(v)">退款</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
|
||||
<!-- <tm-drawer ref="calendarView" placement="bottom" v-model:show="state.showDrawer">
|
||||
<view style="height: 1800rpx"></view>
|
||||
</tm-drawer> -->
|
||||
<tm-drawer title="退款" :showClose="true" size="90%" placement="bottom" bgColor="#EBF6FF" v-model:show="state.showDrawer" zIndex="999">
|
||||
<view class="bg-white rounded-16rpx px-10rpx m-b-10rpx animate-both">
|
||||
<z-tabs
|
||||
:list="['同意退款', '拒绝退款']"
|
||||
bar-width="300"
|
||||
bar-height="0"
|
||||
:active-style="{
|
||||
width: '300rpx',
|
||||
height: '70rpx',
|
||||
backgroundColor: '#0779FDdd',
|
||||
color: '#000000',
|
||||
textAlign: 'center',
|
||||
lineHeight: '70rpx',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '30rpx',
|
||||
borderRadius: '10rpx',
|
||||
marginTop: '10rpx',
|
||||
}"
|
||||
:inactive-style="{
|
||||
width: '300rpx',
|
||||
height: '70rpx',
|
||||
color: '#000000',
|
||||
textAlign: 'center',
|
||||
lineHeight: '70rpx',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '30rpx',
|
||||
borderRadius: '10rpx',
|
||||
marginTop: '10rpx',
|
||||
}"
|
||||
@change="refundTabChange"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="flex-col justify-center card p-x-15rpx p-y-25rpx m-b-10rpx">
|
||||
<view class="flex-row items-center">
|
||||
<image class="w-100rpx h-100rpx rounded-8rpx" :src="filePath(state.curOrder.logoPic)" mode="aspectFill" />
|
||||
<view class="flex-1 flex-col m-l-20rpx">
|
||||
<view class="flex-row items-center justify-between">
|
||||
<view class="flex-row items-center">
|
||||
<view class="main-text-28">{{ state.curOrder.merchantName }}</view>
|
||||
<view v-if="false" class="m-l-15rpx color-#999 font-size-26rpx! iconfont icon-youjiantou" />
|
||||
</view>
|
||||
<tm-tag v-if="state.curOrder.orderStatus == 1" color="info" size="xs">未支付</tm-tag>
|
||||
<tm-tag v-if="state.curOrder.orderStatus == 5" color="success" size="xs">已支付</tm-tag>
|
||||
<tm-tag v-if="state.curOrder.orderStatus == 10" color="error" size="xs">售后</tm-tag>
|
||||
<tm-tag v-if="state.curOrder.orderStatus == 20" size="xs">已核销</tm-tag>
|
||||
</view>
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="flex flex-col">
|
||||
<view class="second-text-20">
|
||||
<text>{{ state.curOrder.username }}</text>
|
||||
<text class="m-l-10rpx">{{ state.curOrder.userMobile }}</text>
|
||||
</view>
|
||||
<view class="second-text-20">
|
||||
<text>下单时间</text>
|
||||
<text class="m-l-10rpx">
|
||||
{{ hooks.useTime(state.curOrder.createTime, "{y}-{m}-{d} {h}:{i}:{s}") }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-col items-end justify-center m-t-5rpx">
|
||||
<view class="second-text-22">{{ hooks.useEnum("hardwareRefundStatusEnum", state.curOrder.refundStatus) }}</view>
|
||||
<view class="flex">
|
||||
<view v-if="state.curOrder.carList?.length" class="m-t-4rpx m-r-10rpx second-text-26"
|
||||
>共 {{ state.curOrder.carList.length }} 件</view
|
||||
>
|
||||
<view class="main-text-30 color-red!">¥ {{ hooks.useMoney(state.curOrder.totalPrice) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex-col justify-center card p-x-20rpx p-y-30rpx m-b-10rpx">
|
||||
<view class="flex-row items-center justify-between">
|
||||
<view class="sub-text-28">实付款</view>
|
||||
<view class="flex-row items-end">
|
||||
<view class="sub-text-28">¥</view>
|
||||
<view class="m-l-5rpx sub-text-28">{{ hooks.useMoney(state.curOrder.payPrice) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-10rpx">
|
||||
<view class="sub-text-28">退款金额</view>
|
||||
<view class="sub-text-28 color-red!">¥{{ hooks.useMoney(state.curOrder.payPrice) }}</view>
|
||||
</view>
|
||||
<view class="card p-x-20rpx p-y-30rpx space-y-10rpx m-b-10rpx second-text-24">
|
||||
<view class="flex-row items-center">
|
||||
<view>服务单号:</view>
|
||||
<view>{{ state.refundDetail.no }}</view>
|
||||
</view>
|
||||
<view class="flex-row items-center">
|
||||
<view>申请时间:</view>
|
||||
<view>{{ hooks.useTime(state.refundDetail.createTime, "") }}</view>
|
||||
</view>
|
||||
<view class="flex-row items-center">
|
||||
<view>售后类型:</view>
|
||||
<view>{{ state.refundDetail.applyReason }}</view>
|
||||
</view>
|
||||
<view class="flex-row items-center">
|
||||
<view>相关描述:</view>
|
||||
<view>{{ state.refundDetail.applyDescription }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="state.refundDetail.status == 62" class="card p-x-20rpx p-y-30rpx space-y-10rpx m-b-10rpx second-text-24">
|
||||
<view class="flex-row items-center">
|
||||
<view>审核人:</view>
|
||||
<view>{{ state.refundDetail.auditUsername }}</view>
|
||||
</view>
|
||||
<view class="flex-row items-center">
|
||||
<view>审核时间:</view>
|
||||
<view>{{ hooks.useTime(state.refundDetail.auditTime, "") }}</view>
|
||||
</view>
|
||||
<view class="flex-row items-center">
|
||||
<view>拒绝原因:</view>
|
||||
<view>{{ state.refundDetail.auditReason }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="state.refundScene === 1" class="flex-col justify-center card p-x-20rpx p-y-30rpx m-b-10rpx">
|
||||
<view class="sub-text-28">拒绝原因</view>
|
||||
<view class="m-t-20rpx">
|
||||
<tm-input v-model="state.remark" type="textarea" :showClear="false" placeholder="请描述拒绝原因" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="h-270rpx" />
|
||||
<view class="flex">
|
||||
<tm-modal
|
||||
v-if="state.refundScene === 0"
|
||||
style="flex: 1"
|
||||
height="250"
|
||||
title="确定同意退款吗?"
|
||||
:show-footer="true"
|
||||
@confirm="doAgreeRefund()"
|
||||
>
|
||||
<template v-slot:trigger><tm-button block>同意退款</tm-button></template>
|
||||
</tm-modal>
|
||||
<tm-modal
|
||||
v-if="state.refundScene === 1"
|
||||
style="flex: 1"
|
||||
height="250"
|
||||
title="确定拒绝退款吗?"
|
||||
:show-footer="true"
|
||||
@confirm="doRefuseRefund()"
|
||||
>
|
||||
<template v-slot:trigger><tm-button block color="danger">拒绝退款</tm-button></template>
|
||||
</tm-modal>
|
||||
</view>
|
||||
</tm-drawer>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue"
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { hooks } from "@@/index"
|
||||
import { filePath } from "@@/utils/file"
|
||||
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
|
||||
import { orderApi } from "@@/api"
|
||||
import { individualOrderApi, refundApi } from "@@/api"
|
||||
|
||||
const pageRef = ref<any>(null)
|
||||
// 选项卡
|
||||
const tabs = [
|
||||
{ id: null, name: "全部", disabled: false },
|
||||
{ id: 1, name: "已支付", disabled: false },
|
||||
{ id: 2, name: "售后", disabled: false },
|
||||
{ id: 5, name: "已支付", disabled: false },
|
||||
{ id: 10, name: "售后", disabled: false },
|
||||
]
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
orderStatus: tabs[0].id,
|
||||
},
|
||||
// showDrawer: false,
|
||||
showDrawer: false,
|
||||
refundScene: 0,
|
||||
curOrder: {},
|
||||
refundDetail: {},
|
||||
remark: "",
|
||||
})
|
||||
const { list, startPage, scroll } = hooks.usePage(pageRef, orderApi.page, null, "data.records")
|
||||
const { list, startPage, scroll } = hooks.usePage(pageRef, individualOrderApi.page, null, "data.records")
|
||||
|
||||
onLoad(() => {
|
||||
const app = getApp()
|
||||
app._initTabbar()
|
||||
})
|
||||
onShow(() => {
|
||||
// const isLogin = await hooks.useCheckLogin()
|
||||
// if (!isLogin) return
|
||||
const isLogin = hooks.useCheckLogin()
|
||||
if (!isLogin) return
|
||||
// if (pageRef.value) {
|
||||
// pageRef.value.reload(false)
|
||||
// }
|
||||
})
|
||||
|
||||
// 切换选项卡
|
||||
@@ -132,8 +268,85 @@ const query = (page: number, pagesize: number) => {
|
||||
startPage(page, pagesize, false, state.pa)
|
||||
}
|
||||
|
||||
// 重置状态
|
||||
const resetState = () => {
|
||||
state.refundScene = 0
|
||||
state.curOrder = {}
|
||||
state.refundDetail = {}
|
||||
state.remark = ""
|
||||
}
|
||||
|
||||
// 点击退款
|
||||
// const tabRefund = (v: any) => {
|
||||
// state.showDrawer = true
|
||||
// }
|
||||
const doIndividualRefund = async (v: any) => {
|
||||
if (!v.id) return uni.showToast({ title: "订单id不存在", icon: "none" })
|
||||
|
||||
resetState()
|
||||
|
||||
state.curOrder = v
|
||||
state.showDrawer = true
|
||||
uni.showLoading({ title: "加载中...", mask: true })
|
||||
try {
|
||||
const res: any = await refundApi.get({ id: v.id })
|
||||
if (res.code == 0) {
|
||||
state.refundDetail = res.data
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || "加载退款详情失败", icon: "none" })
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({ title: "错误", icon: "none" })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 退款切换选项卡
|
||||
const refundTabChange = (e: number) => {
|
||||
state.refundScene = e
|
||||
}
|
||||
|
||||
// 同意退款
|
||||
const doAgreeRefund = async () => {
|
||||
if (!state.refundDetail.id) {
|
||||
return uni.showToast({ title: "订单不存在", icon: "none" })
|
||||
}
|
||||
|
||||
uni.showLoading({ title: "操作中...", mask: true })
|
||||
try {
|
||||
const res: any = await individualOrderApi.agreeRefund({ id: state.refundDetail.id })
|
||||
if (res.code == 0) {
|
||||
uni.showToast({ title: "操作成功", icon: "success" })
|
||||
state.showDrawer = false
|
||||
pageRef.value.reload(true)
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || "退款失败", icon: "none" })
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({ title: "错误", icon: "none" })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 拒绝退款
|
||||
const doRefuseRefund = async () => {
|
||||
if (!state.refundDetail.id) {
|
||||
return uni.showToast({ title: "订单不存在", icon: "none" })
|
||||
}
|
||||
|
||||
uni.showLoading({ title: "操作中...", mask: true })
|
||||
try {
|
||||
const res: any = await individualOrderApi.refuseRefund({ id: state.refundDetail.id, auditReason: state.remark })
|
||||
if (res.code == 0) {
|
||||
uni.showToast({ title: "操作成功", icon: "success" })
|
||||
state.showDrawer = false
|
||||
pageRef.value.reload(true)
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || "拒绝退款失败", icon: "none" })
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({ title: "错误", icon: "none" })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+14
-8
@@ -132,12 +132,9 @@ const doLogin = async (loginType: number, token: string, accountId: string | nul
|
||||
case 2:
|
||||
if (isEmpty(tokenStorage) || isEmpty(userStorage)) {
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: "登录中...",
|
||||
mask: true,
|
||||
})
|
||||
uni.showLoading({ title: "登录中...", mask: true })
|
||||
const res = await userApi.auth(token)
|
||||
if (res?.code === 0) {
|
||||
if (res.code == 0) {
|
||||
uni.setStorageSync(tokenKey, res.data)
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: "登录成功", icon: "none" })
|
||||
@@ -179,9 +176,15 @@ const doLogout = async () => {
|
||||
const doScanCode = async () => {
|
||||
usePayStore().setPayData({})
|
||||
try {
|
||||
const res: any = await (window as any).dd.scan({ type: "all", sourceType: ["camera"], scanType: ["cameraScan"] })
|
||||
// const decodedString = decodeBase64("eyJpZCI6IjE4ODk0ODM5Mzg0ODQ1MzEyMDEiLCJuYW1lIjoi5rWL6K+V6LaF5biCIn0=")
|
||||
const decodedString = decodeBase64(res.text)
|
||||
let decodedString: string | undefined = ""
|
||||
if (isDevEnv()) {
|
||||
decodedString = decodeBase64("eyJpZCI6IjE4ODk0ODM5Mzg0ODQ1MzEyMDEiLCJuYW1lIjoi5rWL6K+V6LaF5biCIn0=")
|
||||
uni.showToast({ title: "开发环境不是浙政钉环境,扫码仅供测试", icon: "none" })
|
||||
} else {
|
||||
const res: any = await (window as any).dd.scan({ type: "all" })
|
||||
decodedString = decodeBase64(res.text)
|
||||
}
|
||||
|
||||
if (decodedString) {
|
||||
const decodedJson = JSON.parse(decodedString)
|
||||
if (decodedJson?.id && decodedJson?.name) {
|
||||
@@ -258,6 +261,9 @@ const getStorageUserInfo = () => {
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
const app = getApp()
|
||||
app._initTabbar()
|
||||
|
||||
isDevEnv()
|
||||
? state.menuList.push({
|
||||
text: "测试登录",
|
||||
|
||||
+11
-12
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue"
|
||||
import { ref, reactive, computed } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
|
||||
import { hooks, router } from "@@/index"
|
||||
@@ -24,13 +24,16 @@ const state = reactive<any>({
|
||||
},
|
||||
})
|
||||
|
||||
onLoad(() => {})
|
||||
onLoad(() => {
|
||||
const app = getApp()
|
||||
app._initTabbar()
|
||||
})
|
||||
onShow(async () => {
|
||||
const isLogin = await hooks.useCheckLogin()
|
||||
if (!isLogin) return
|
||||
if (pageRef.value) {
|
||||
pageRef.value.reload(false)
|
||||
}
|
||||
// if (pageRef.value) {
|
||||
// pageRef.value.reload(false)
|
||||
// }
|
||||
})
|
||||
const doTab = (e: any) => {
|
||||
const target = data.tabs[e]
|
||||
@@ -97,7 +100,7 @@ const doRefund = (v: any) => {
|
||||
<!-- <view class="m-l-15rpx color-#999 font-size-26rpx! iconfont icon-youjiantou" /> -->
|
||||
</view>
|
||||
<tm-tag v-if="v.orderStatus == 1" color="info" size="xs">未支付</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 5" color="success" size="xs">待核销</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 5" color="success" size="xs">已支付</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 10" color="error" size="xs">售后</tm-tag>
|
||||
<tm-tag v-if="v.orderStatus == 20" size="xs">已核销</tm-tag>
|
||||
</view>
|
||||
@@ -108,13 +111,11 @@ const doRefund = (v: any) => {
|
||||
{{ hooks.useTime(v.createTime, "{y}-{m}-{d} {h}:{i}:{s}") }}
|
||||
</text>
|
||||
</view>
|
||||
<!-- <view class="second-text-22">
|
||||
{{ hooks.useEnum("hardwareRefundStatusEnum", v.refundStatus) }}
|
||||
</view> -->
|
||||
<view class="second-text-22">{{ hooks.useEnum("hardwareRefundStatusEnum", v.refundStatus) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative h-0rpx m-t-[-10rpx] flex justify-end items-center">
|
||||
<view class="relative h-0rpx m-t-[20rpx] flex justify-end items-center">
|
||||
<!-- <view class="absolute top-0 right-0 bottom-0 left-0 h-180rpx">
|
||||
<scroll-view scroll-x class="flex-row-center whitespace-nowrap">
|
||||
<view class="flex-row items-center">
|
||||
@@ -152,5 +153,3 @@ const doRefund = (v: any) => {
|
||||
</z-paging>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue"
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { merchantApi } from "@@/api"
|
||||
import { hooks, router } from "@@/index"
|
||||
import { filePath } from "@@/utils/file"
|
||||
@@ -18,6 +18,10 @@ const query = (page: number, pagesize: number) => {
|
||||
startPage(page, pagesize, false, state.pa)
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
const app = getApp()
|
||||
app._initTabbar()
|
||||
})
|
||||
onShow(() => {
|
||||
pageRef.value && pageRef.value.reload(false)
|
||||
})
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import request from "@/sheep/utils/request"
|
||||
|
||||
export default {
|
||||
page: (params: any) =>
|
||||
request({
|
||||
url: "/hard/hard-total/app/mch-water-day",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
}
|
||||
+17
-13
@@ -1,25 +1,29 @@
|
||||
export { default as applyApi } from "./apply";
|
||||
export { default as applyApi } from "./apply"
|
||||
|
||||
export { default as boxesApi } from "./boxes";
|
||||
export { default as boxesApi } from "./boxes"
|
||||
|
||||
export { default as commonApi } from "./common";
|
||||
export { default as commonApi } from "./common"
|
||||
|
||||
export { default as foodApi } from "./food";
|
||||
export { default as foodApi } from "./food"
|
||||
|
||||
export { default as merchantApi } from "./merchant";
|
||||
export { default as merchantApi } from "./merchant"
|
||||
|
||||
export { default as orderApi } from "./order";
|
||||
export { default as orderApi } from "./order"
|
||||
|
||||
export { default as payApi } from "./pay";
|
||||
export { default as payApi } from "./pay"
|
||||
|
||||
export { default as productApi } from "./product";
|
||||
export { default as productApi } from "./product"
|
||||
|
||||
export { default as refundApi } from "./refund";
|
||||
export { default as refundApi } from "./refund"
|
||||
|
||||
export { default as userApi } from "./user";
|
||||
export { default as userApi } from "./user"
|
||||
|
||||
export { default as walletApi } from "./wallet";
|
||||
export { default as walletApi } from "./wallet"
|
||||
|
||||
export { default as faceApi } from "./face";
|
||||
export { default as faceApi } from "./face"
|
||||
|
||||
export { default as shopApi } from "./shop";
|
||||
export { default as shopApi } from "./shop"
|
||||
|
||||
export { default as flowStatisticsApi } from "./flowStatistics"
|
||||
|
||||
export { default as individualOrderApi } from "./individualOrder"
|
||||
@@ -0,0 +1,30 @@
|
||||
import request from "@/sheep/utils/request"
|
||||
|
||||
export default {
|
||||
page: (params: any) =>
|
||||
request({
|
||||
url: "/hard/hard-order/app/mch-page-join",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
refuseRefund: (data: { id: string; auditReason: string }) =>
|
||||
request({
|
||||
url: "/hard/hard-after-sale/app/mch-disagree",
|
||||
method: "POST",
|
||||
data,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
agreeRefund: (params: { id: string }) =>
|
||||
request({
|
||||
url: `/hard/hard-after-sale/app/mch-agree?id=${params.id}`,
|
||||
method: "POST",
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
}
|
||||
+60
-64
@@ -1,70 +1,66 @@
|
||||
export const useMoney = (num) => {
|
||||
if (typeof num === "undefined") return "0.00";
|
||||
const parsedNumber = typeof num === "string" ? parseFloat(num) : num;
|
||||
return (parsedNumber / 100.0).toFixed(1);
|
||||
};
|
||||
if (typeof num === "undefined") return "0.00"
|
||||
const parsedNumber = typeof num === "string" ? parseFloat(num) : num
|
||||
return (parsedNumber / 100.0).toFixed(2)
|
||||
}
|
||||
|
||||
export function useFormatNum(
|
||||
prefix: string,
|
||||
type: "exact" | string,
|
||||
num: number
|
||||
) {
|
||||
num = num || 0;
|
||||
if (type === "exact") {
|
||||
return prefix + num;
|
||||
}
|
||||
if (num < 10) {
|
||||
return `${prefix}≤10`;
|
||||
}
|
||||
// 情况三:大于 10,除第一位外,其它位都显示为0
|
||||
// 例如:100 - 199 显示为 100+
|
||||
// 9000 - 9999 显示为 9000+
|
||||
const numStr = num.toString();
|
||||
const first = numStr[0];
|
||||
const other = "0".repeat(numStr.length - 1);
|
||||
return `${prefix}${first}${other}+`;
|
||||
export function useFormatNum(prefix: string, type: "exact" | string, num: number) {
|
||||
num = num || 0
|
||||
if (type === "exact") {
|
||||
return prefix + num
|
||||
}
|
||||
if (num < 10) {
|
||||
return `${prefix}≤10`
|
||||
}
|
||||
// 情况三:大于 10,除第一位外,其它位都显示为0
|
||||
// 例如:100 - 199 显示为 100+
|
||||
// 9000 - 9999 显示为 9000+
|
||||
const numStr = num.toString()
|
||||
const first = numStr[0]
|
||||
const other = "0".repeat(numStr.length - 1)
|
||||
return `${prefix}${first}${other}+`
|
||||
}
|
||||
|
||||
export function useTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null;
|
||||
}
|
||||
const format = pattern || "{y}-{m}-{d} {h}:{i}:{s}";
|
||||
let date;
|
||||
if (typeof time === "object") {
|
||||
date = time;
|
||||
} else {
|
||||
if (typeof time === "string" && /^[0-9]+$/.test(time)) {
|
||||
time = parseInt(time);
|
||||
} else if (typeof time === "string") {
|
||||
time = time
|
||||
.replace(new RegExp(/-/gm), "/")
|
||||
.replace("T", " ")
|
||||
.replace(new RegExp(/\.[\d]{3}/gm), "");
|
||||
}
|
||||
if (typeof time === "number" && time.toString().length === 10) {
|
||||
time = time * 1000;
|
||||
}
|
||||
date = new Date(time);
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay(),
|
||||
};
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key];
|
||||
if (key === "a") {
|
||||
return ["日", "一", "二", "三", "四", "五", "六"][value];
|
||||
}
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = "0" + value;
|
||||
}
|
||||
return value || 0;
|
||||
});
|
||||
return time_str;
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || "{y}-{m}-{d} {h}:{i}:{s}"
|
||||
let date
|
||||
if (typeof time === "object") {
|
||||
date = time
|
||||
} else {
|
||||
if (typeof time === "string" && /^[0-9]+$/.test(time)) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === "string") {
|
||||
time = time
|
||||
.replace(new RegExp(/-/gm), "/")
|
||||
.replace("T", " ")
|
||||
.replace(new RegExp(/\.[\d]{3}/gm), "")
|
||||
}
|
||||
if (typeof time === "number" && time.toString().length === 10) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay(),
|
||||
}
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
if (key === "a") {
|
||||
return ["日", "一", "二", "三", "四", "五", "六"][value]
|
||||
}
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = "0" + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
@@ -113,6 +113,8 @@ const checkAndRefreshToken = async (tokenStorage: any) => {
|
||||
|
||||
// 请求拦截器
|
||||
http.interceptors.request.use(async (config) => {
|
||||
console.log("请求之前")
|
||||
|
||||
const tokenStorage = uni.getStorageSync(TOKEN_KEY)
|
||||
const config_header: any = config?.header || {}
|
||||
|
||||
@@ -157,7 +159,7 @@ http.interceptors.request.use(async (config) => {
|
||||
try {
|
||||
uni.showLoading({ title: "加载中...", mask: true })
|
||||
const res = await userApi.auth(token)
|
||||
if (res?.code === 0) {
|
||||
if (res.code == 0) {
|
||||
uni.setStorageSync(TOKEN_KEY, res.data)
|
||||
const { data: userData } = await userApi.userInfo()
|
||||
uni.setStorageSync(USER_INFO_KEY, userData)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Reference in new issue
Block a user