Merge remote-tracking branch 'refs/remotes/yudao/develop'
commit
92e89bae34
21
.env
21
.env
|
@ -1,28 +1,31 @@
|
||||||
# 版本号
|
# 版本号
|
||||||
SHOPRO_VERSION = v1.8.3
|
SHOPRO_VERSION=v2.3.0
|
||||||
|
|
||||||
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development)
|
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development)
|
||||||
SHOPRO_BASE_URL = http://api-dashboard.yudao.iocoder.cn
|
SHOPRO_BASE_URL=http://api-dashboard.yudao.iocoder.cn
|
||||||
|
|
||||||
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development)
|
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development)
|
||||||
SHOPRO_DEV_BASE_URL = http://127.0.0.1:48080
|
SHOPRO_DEV_BASE_URL=http://127.0.0.1:48080
|
||||||
### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
|
### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
|
||||||
|
|
||||||
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
|
SHOPRO_UPLOAD_TYPE=server
|
||||||
|
|
||||||
# 后端接口前缀(一般不建议调整)
|
# 后端接口前缀(一般不建议调整)
|
||||||
SHOPRO_API_PATH = /app-api
|
SHOPRO_API_PATH=/app-api
|
||||||
|
|
||||||
# 后端 websocket 接口前缀
|
# 后端 websocket 接口前缀
|
||||||
SHOPRO_WEBSOCKET_PATH = /infra/ws
|
SHOPRO_WEBSOCKET_PATH=/infra/ws
|
||||||
|
|
||||||
# 开发环境运行端口
|
# 开发环境运行端口
|
||||||
SHOPRO_DEV_PORT = 3000
|
SHOPRO_DEV_PORT=3000
|
||||||
|
|
||||||
# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀
|
# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀
|
||||||
SHOPRO_STATIC_URL = http://test.yudao.iocoder.cn
|
SHOPRO_STATIC_URL=http://test.yudao.iocoder.cn
|
||||||
### SHOPRO_STATIC_URL = https://file.sheepjs.com
|
### SHOPRO_STATIC_URL = https://file.sheepjs.com
|
||||||
|
|
||||||
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
|
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
|
||||||
SHOPRO_MPLIVE_ON = 0
|
SHOPRO_MPLIVE_ON=0
|
||||||
|
|
||||||
# 租户ID 默认 1
|
# 租户ID 默认 1
|
||||||
SHOPRO_TENANT_ID = 1
|
SHOPRO_TENANT_ID=1
|
||||||
|
|
|
@ -218,7 +218,7 @@
|
||||||
"template": "index.html",
|
"template": "index.html",
|
||||||
"router": {
|
"router": {
|
||||||
"mode": "history",
|
"mode": "history",
|
||||||
"base": "./"
|
"base": "/"
|
||||||
},
|
},
|
||||||
"sdkConfigs": {
|
"sdkConfigs": {
|
||||||
"maps": {}
|
"maps": {}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "shopro",
|
"id": "shopro",
|
||||||
"name": "shopro",
|
"name": "shopro",
|
||||||
"displayName": "芋道商城",
|
"displayName": "芋道商城",
|
||||||
"version": "2.2.0",
|
"version": "2.3.0",
|
||||||
"description": "芋道商城,一套代码,同时发行到iOS、Android、H5、微信小程序多个平台,请使用手机扫码快速体验强大功能",
|
"description": "芋道商城,一套代码,同时发行到iOS、Android、H5、微信小程序多个平台,请使用手机扫码快速体验强大功能",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prettier": "prettier --write \"{pages,sheep}/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
|
"prettier": "prettier --write \"{pages,sheep}/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
:scroll-with-animation="false"
|
:scroll-with-animation="false"
|
||||||
:enable-back-to-top="true"
|
:enable-back-to-top="true"
|
||||||
>
|
>
|
||||||
<s-point-card ref="sPointCardRef" class="ss-p-x-20 ss-m-t-20"/>
|
<s-point-card ref="sPointCardRef" class="ss-p-x-20 ss-m-t-20" />
|
||||||
<s-empty
|
<s-empty
|
||||||
v-if="activityTotal === 0"
|
v-if="activityTotal === 0"
|
||||||
icon="/static/goods-empty.png"
|
icon="/static/goods-empty.png"
|
||||||
|
@ -18,8 +18,8 @@
|
||||||
v-if="activityTotal > 0"
|
v-if="activityTotal > 0"
|
||||||
:status="loadStatus"
|
:status="loadStatus"
|
||||||
:content-text="{
|
:content-text="{
|
||||||
contentdown: '上拉加载更多',
|
contentdown: '上拉加载更多',
|
||||||
}"
|
}"
|
||||||
@tap="loadMore"
|
@tap="loadMore"
|
||||||
/>
|
/>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
|
|
||||||
// 加载更多
|
// 加载更多
|
||||||
function loadMore() {
|
function loadMore() {
|
||||||
if (state.loadStatus !== 'noMore') {
|
if (loadStatus !== 'noMore') {
|
||||||
activityPageParams.pageNo += 1;
|
activityPageParams.pageNo += 1;
|
||||||
getActivityList();
|
getActivityList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<view class="item" v-for="(item, index) in state.signConfigList" :key="index">
|
<view class="item" v-for="(item, index) in state.signConfigList" :key="index">
|
||||||
<view
|
<view
|
||||||
:class="
|
:class="
|
||||||
(index === state.signConfigList.length ? 'reward' : '') +
|
(index === state.signConfigList.length ? 'reward' : '') +
|
||||||
' ' +
|
' ' +
|
||||||
(state.signInfo.continuousDay >= item.day ? 'rewardTxt' : '')
|
(state.signInfo.continuousDay >= item.day ? 'rewardTxt' : '')
|
||||||
"
|
"
|
||||||
|
@ -62,13 +62,14 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 签到说明 TODO @芋艿:【签到】这里改成【已累计签到】;改版,接入 sheepjs -->
|
<!-- 签到说明 TODO @科举:这里改成【已累计签到】 -->
|
||||||
<view class="bg-white ss-m-t-16 ss-p-t-30 ss-p-b-60 ss-p-x-40">
|
<view class="bg-white ss-m-t-16 ss-p-t-30 ss-p-b-60 ss-p-x-40">
|
||||||
<view class="activity-title ss-m-b-30">签到说明</view>
|
<view class="activity-title ss-m-b-30">签到说明</view>
|
||||||
<view class="activity-des">1、已累计签到{{state.signInfo.totalDay}}天</view>
|
<view class="activity-des">1.已累计签到{{ state.signInfo.totalDay }}天</view>
|
||||||
<view class="activity-des">
|
<view class="activity-des">
|
||||||
2、据说连续签到第 {{ state.maxDay }} 天可获得超额积分,一定要坚持签到哦~~~
|
2.据说连续签到第 {{ state.maxDay }} 天可获得超额积分,要坚持签到哦~~
|
||||||
</view>
|
</view>
|
||||||
|
<view class="activity-des"> 3.积分可以在购物时抵现金结算的哦 ~~</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -347,8 +348,7 @@
|
||||||
.title {
|
.title {
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
// color: var(--ui-BG-Main);
|
color: var(--ui-BG-Main-TC);
|
||||||
color: #ff6000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitle {
|
.subtitle {
|
||||||
|
@ -410,12 +410,10 @@
|
||||||
background-color: #f4b409;
|
background-color: #f4b409;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
color: #a57d3f;
|
color: var(--ui-BG-Main-TC);
|
||||||
line-height: 32rpx;
|
line-height: 32rpx;
|
||||||
}
|
text-align: center;
|
||||||
|
padding: 2rpx;
|
||||||
.venusSelect {
|
|
||||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYA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gsTLTCICfMs683gb1tbchiNjgt0TfYFkym7JQkyl8nkoixkMesiGzT1Q19q20t+0dTvwnU/A0iQSDYeoNinBQLOTE/2BjUcvCE5rMoJ2XcSYYBr3FOPmoHHLU+APdtJMpvg7bp8XAr19mKJ1weK9u5CJxUDpMt+HxfJ2HbsoVLzwa1aT4fw8dD3/Au43lv7YYjQF19gAHXv6UYMJa7UepQZFJzMT9fp9lJidorCvgbfkSRXbBB2UDRX5MdREnZYNwZECRcxQXLUnl8s5KPw6MNFsdBFzzdaaE8xGwrUx0eXZORrw3c1NNdEk0ZwUi2OQn7fvZBz9fEZKDjNzFLqn7dYApnVtNtKvecx5oxVfHCsmSt4ts/0rrxiO5NO6jvUWyC0guZgT+SPllu4Jzjr9AT0bjqKWQ1qH0RWQfvKcwzm+s6BB01X6RC1pHIf82w02NRmnsng7WjX28iJqLu5Ec4XXSE5XYg+S91A+UlHS/H2riXfq1n3N8mM2HKOOgutsodkNqZKIMxGQokvFw40jhnFMoZZ70CzyrpLd2S0kb00Oa5KMJDC8LAHL4QEmK4HGKYaSq+/bJFTyZ/GyX+VK3pzUStA1SRJrkTNZrWHG1e8IGuMZt5eqrUH9U8iwUbVci1w1BKnW65RWSVaVnBomAKoI3E9IQEEipX3jap9Q1hxmBElBocp/AmIYcQaRQSQQ36r/E8odvepOxoa5khfRT1pf+8q0/wUYAFU/P0XyeZQPAAAAAElFTkSuQmCC');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.venus {
|
.venus {
|
||||||
|
@ -424,7 +422,11 @@
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
width: 56rpx;
|
width: 56rpx;
|
||||||
height: 56rpx;
|
height: 56rpx;
|
||||||
margin: 10rpx 0;
|
margin: 10rpx auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.venusSelect {
|
||||||
|
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAGXRFWHRTb2Z0d2FyZ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kym7JQkyl8nkoixkMesiGzT1Q19q20t+0dTvwnU/A0iQSDYeoNinBQLOTE/2BjUcvCE5rMoJ2XcSYYBr3FOPmoHHLU+APdtJMpvg7bp8XAr19mKJ1weK9u5CJxUDpMt+HxfJ2HbsoVLzwa1aT4fw8dD3/Au43lv7YYjQF19gAHXv6UYMJa7UepQZFJzMT9fp9lJidorCvgbfkSRXbBB2UDRX5MdREnZYNwZECRcxQXLUnl8s5KPw6MNFsdBFzzdaaE8xGwrUx0eXZORrw3c1NNdEk0ZwUi2OQn7fvZBz9fEZKDjNzFLqn7dYApnVtNtKvecx5oxVfHCsmSt4ts/0rrxiO5NO6jvUWyC0guZgT+SPllu4Jzjr9AT0bjqKWQ1qH0RWQfvKcwzm+s6BB01X6RC1pHIf82w02NRmnsng7WjX28iJqLu5Ec4XXSE5XYg+S91A+UlHS/H2riXfq1n3N8mM2HKOOgutsodkNqZKIMxGQokvFw40jhnFMoZZ70CzyrpLd2S0kb00Oa5KMJDC8LAHL4QEmK4HGKYaSq+/bJFTyZ/GyX+VK3pzUStA1SRJrkTNZrWHG1e8IGuMZt5eqrUH9U8iwUbVci1w1BKnW65RWSVaVnBomAKoI3E9IQEEipX3jap9Q1hxmBElBocp/AmIYcQaRQSQQ36r/E8odvepOxoa5khfRT1pf+8q0/wUYAFU/P0XyeZQPAAAAAElFTkSuQmCC');
|
||||||
}
|
}
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
|
@ -435,7 +437,7 @@
|
||||||
.item {
|
.item {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 1px solid #eee;
|
flex-direction: column;
|
||||||
height: 130rpx;
|
height: 130rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,6 +448,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.on {
|
.on {
|
||||||
background-color: #999 !important;
|
color: #f4b409;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -45,7 +45,8 @@
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
methods: { // 开启的提现方式
|
methods: {
|
||||||
|
// 开启的提现方式
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
|
@ -57,7 +58,7 @@
|
||||||
|
|
||||||
const typeList = [
|
const typeList = [
|
||||||
{
|
{
|
||||||
// icon: '/static/img/shop/pay/wechat.png', // TODO 芋艿:后续给个 icon
|
icon: '/static/img/shop/pay/wechat.png',
|
||||||
title: '钱包余额',
|
title: '钱包余额',
|
||||||
value: '1',
|
value: '1',
|
||||||
},
|
},
|
||||||
|
@ -68,14 +69,19 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: '/static/img/shop/pay/wechat.png',
|
icon: '/static/img/shop/pay/wechat.png',
|
||||||
title: '微信零钱',
|
title: '微信账户', // 微信手动转账
|
||||||
value: '3',
|
value: '3',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: '/static/img/shop/pay/alipay.png',
|
icon: '/static/img/shop/pay/alipay.png',
|
||||||
title: '支付宝账户',
|
title: '支付宝账户',
|
||||||
value: '4',
|
value: '4',
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
icon: '/static/img/shop/pay/wechat.png',
|
||||||
|
title: '微信零钱', // 微信 API 转账
|
||||||
|
value: '5',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
function onChange(e) {
|
function onChange(e) {
|
||||||
|
@ -89,7 +95,7 @@
|
||||||
}
|
}
|
||||||
// 赋值
|
// 赋值
|
||||||
emits('update:modelValue', {
|
emits('update:modelValue', {
|
||||||
type: state.currentValue
|
type: state.currentValue,
|
||||||
});
|
});
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
emits('close');
|
emits('close');
|
||||||
|
|
|
@ -31,9 +31,10 @@
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
// 用户资料卡片
|
// 用户资料卡片
|
||||||
.user-card {
|
.user-card {
|
||||||
width: 690rpx;
|
width: 700rpx;
|
||||||
height: 192rpx;
|
height: 192rpx;
|
||||||
margin: -88rpx 20rpx 0 20rpx;
|
margin: 0 auto;
|
||||||
|
margin-top: -88rpx;
|
||||||
padding-top: 88rpx;
|
padding-top: 88rpx;
|
||||||
background: v-bind(headerBg) no-repeat;
|
background: v-bind(headerBg) no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 1,
|
pageSize: 8,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 1,
|
pageSize: 8,
|
||||||
},
|
},
|
||||||
loadStatus: '',
|
loadStatus: '',
|
||||||
shareInfo: {},
|
shareInfo: {},
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 1,
|
pageSize: 8,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.PromoterRank .header .nav {
|
.PromoterRank .header .nav {
|
||||||
width: 450rpx;
|
width: 440rpx;
|
||||||
height: 66rpx;
|
height: 66rpx;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
border-radius: 33rpx;
|
border-radius: 33rpx;
|
||||||
|
|
|
@ -168,7 +168,7 @@
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 1,
|
pageSize: 8,
|
||||||
},
|
},
|
||||||
loadStatus: '',
|
loadStatus: '',
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,9 @@
|
||||||
<view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
|
<view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
|
||||||
<view v-if="state.accountInfo.type === '1'" class="empty-text">钱包余额</view>
|
<view v-if="state.accountInfo.type === '1'" class="empty-text">钱包余额</view>
|
||||||
<view v-if="state.accountInfo.type === '2'" class="empty-text">银行卡转账</view>
|
<view v-if="state.accountInfo.type === '2'" class="empty-text">银行卡转账</view>
|
||||||
<view v-if="state.accountInfo.type === '3'" class="empty-text">微信零钱</view>
|
<view v-if="state.accountInfo.type === '3'" class="empty-text">微信账户</view>
|
||||||
<view v-if="state.accountInfo.type === '4'" class="empty-text">支付宝账户</view>
|
<view v-if="state.accountInfo.type === '4'" class="empty-text">支付宝账户</view>
|
||||||
|
<view v-if="state.accountInfo.type === '5'" class="empty-text">微信零钱</view>
|
||||||
<text class="cicon-forward" />
|
<text class="cicon-forward" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -48,7 +49,7 @@
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<!-- 提现账号 -->
|
<!-- 提现账号 -->
|
||||||
<view class="card-title" v-show="['2', '3', '4'].includes(state.accountInfo.type)">
|
<view class="card-title" v-show="['2', '3', '4', '5'].includes(state.accountInfo.type)">
|
||||||
提现账号
|
提现账号
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 1,
|
pageSize: 8,
|
||||||
},
|
},
|
||||||
categoryId: 0, // 选中的商品分类编号
|
categoryId: 0, // 选中的商品分类编号
|
||||||
tabMaps: [], // 指定分类时,每个分类构成一个 tab
|
tabMaps: [], // 指定分类时,每个分类构成一个 tab
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 1,
|
pageSize: 8,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
<detailSkeleton v-if="state.skeletonLoading" />
|
<detailSkeleton v-if="state.skeletonLoading" />
|
||||||
<!-- 下架/售罄提醒 -->
|
<!-- 下架/售罄提醒 -->
|
||||||
<s-empty
|
<s-empty
|
||||||
v-else-if="state.goodsInfo === null || state.goodsInfo.activity_type !== 'seckill'"
|
v-else-if="
|
||||||
|
state.goodsInfo === null || state.goodsInfo.activity_type !== 'seckill' || endTime.ms <= 0
|
||||||
|
"
|
||||||
text="活动不存在或已结束"
|
text="活动不存在或已结束"
|
||||||
icon="/static/soldout-empty.png"
|
icon="/static/soldout-empty.png"
|
||||||
showAction
|
showAction
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="flex flex-wrap">
|
<view class="flex flex-wrap">
|
||||||
<text class="default font-color" v-if="state.addressInfo.defaultStatus">[默认]</text>
|
<text class="default font-color" v-if="state.addressInfo.defaultStatus">[默认]</text>
|
||||||
<text class="line2"
|
<text class="line2">
|
||||||
>{{ state.addressInfo.areaName }} {{ state.addressInfo.detailAddress }}</text
|
{{ state.addressInfo.areaName }} {{ state.addressInfo.detailAddress }}
|
||||||
>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="addressCon" v-else>
|
<view class="addressCon" v-else>
|
||||||
|
@ -44,7 +44,11 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 情况二:门店的选择 -->
|
<!-- 情况二:门店的选择 -->
|
||||||
<view class="address flex flex-wrap flex-center ss-row-between" v-else @tap="onSelectAddress">
|
<view
|
||||||
|
class="address flex flex-wrap flex-center ss-row-between"
|
||||||
|
v-if="state.deliveryType === 2"
|
||||||
|
@tap="onSelectAddress"
|
||||||
|
>
|
||||||
<view class="addressCon" v-if="state.pickUpInfo.name">
|
<view class="addressCon" v-if="state.pickUpInfo.name">
|
||||||
<view class="name"
|
<view class="name"
|
||||||
>{{ state.pickUpInfo.name }}
|
>{{ state.pickUpInfo.name }}
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '申请成功',
|
title: '申请成功',
|
||||||
});
|
});
|
||||||
sheep.$router.go('/pages/order/aftersale/list');
|
sheep.$router.redirect('/pages/order/aftersale/list');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,10 @@
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="state.orderPayload.pointActivityId" class="order-item ss-flex ss-col-center ss-row-between">
|
<view
|
||||||
|
v-if="state.orderPayload.pointActivityId"
|
||||||
|
class="order-item ss-flex ss-col-center ss-row-between"
|
||||||
|
>
|
||||||
<view class="item-title">兑换积分</view>
|
<view class="item-title">兑换积分</view>
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<image
|
<image
|
||||||
|
@ -241,7 +244,7 @@
|
||||||
|
|
||||||
const addressState = ref({
|
const addressState = ref({
|
||||||
addressInfo: {}, // 选择的收货地址
|
addressInfo: {}, // 选择的收货地址
|
||||||
deliveryType: 1, // 收货方式:1-快递配送,2-门店自提
|
deliveryType: undefined, // 收货方式:1-快递配送,2-门店自提
|
||||||
isPickUp: true, // 门店自提是否开启
|
isPickUp: true, // 门店自提是否开启
|
||||||
pickUpInfo: {}, // 选择的自提门店信息
|
pickUpInfo: {}, // 选择的自提门店信息
|
||||||
receiverName: '', // 收件人名称
|
receiverName: '', // 收件人名称
|
||||||
|
@ -317,9 +320,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到支付页面
|
// 跳转到支付页面
|
||||||
sheep.$router.redirect('/pages/pay/index', {
|
if (data.payOrderId && data.payOrderId > 0) {
|
||||||
id: data.payOrderId,
|
sheep.$router.redirect('/pages/pay/index', {
|
||||||
});
|
id: data.payOrderId,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sheep.$router.redirect('/pages/order/detail', {
|
||||||
|
id: data.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查库存 & 计算订单价格
|
// 检查库存 & 计算订单价格
|
||||||
|
@ -340,7 +349,7 @@
|
||||||
pointActivityId: state.orderPayload.pointActivityId,
|
pointActivityId: state.orderPayload.pointActivityId,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return code;
|
||||||
}
|
}
|
||||||
state.orderInfo = data;
|
state.orderInfo = data;
|
||||||
state.couponInfo = data.coupons || [];
|
state.couponInfo = data.coupons || [];
|
||||||
|
@ -348,20 +357,41 @@
|
||||||
if (state.orderInfo.address) {
|
if (state.orderInfo.address) {
|
||||||
addressState.value.addressInfo = state.orderInfo.address;
|
addressState.value.addressInfo = state.orderInfo.address;
|
||||||
}
|
}
|
||||||
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
|
// 解析参数
|
||||||
if (!options.data) {
|
if (!options.data) {
|
||||||
sheep.$helper.toast('参数不正确,请检查!');
|
sheep.$helper.toast('参数不正确,请检查!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.orderPayload = JSON.parse(options.data);
|
state.orderPayload = JSON.parse(options.data);
|
||||||
await getOrderInfo();
|
|
||||||
// 获取交易配置
|
// 获取交易配置
|
||||||
const { data, code } = await TradeConfigApi.getTradeConfig();
|
const { data, code } = await TradeConfigApi.getTradeConfig();
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
addressState.value.isPickUp = data.deliveryPickUpEnabled;
|
addressState.value.isPickUp = data.deliveryPickUpEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 价格计算
|
||||||
|
// 情况一:先自动选择“快递物流”
|
||||||
|
addressState.value.deliveryType = 1;
|
||||||
|
let orderCode = await getOrderInfo();
|
||||||
|
if (orderCode === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 情况二:失败,再自动选择“门店自提”
|
||||||
|
if (addressState.value.isPickUp) {
|
||||||
|
addressState.value.deliveryType = 2;
|
||||||
|
let orderCode = await getOrderInfo();
|
||||||
|
if (orderCode === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 情况三:都失败,则不选择
|
||||||
|
addressState.value.deliveryType = undefined;
|
||||||
|
await getOrderInfo();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 使用 watch 监听地址和配送方式的变化
|
// 使用 watch 监听地址和配送方式的变化
|
||||||
|
|
|
@ -260,7 +260,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { isEmpty } from 'lodash-es';
|
import { isEmpty } from 'lodash-es';
|
||||||
import {
|
import {
|
||||||
|
@ -345,11 +345,20 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 正常的确认收货流程
|
uni.showModal({
|
||||||
const { code } = await OrderApi.receiveOrder(orderId);
|
title: '提示',
|
||||||
if (code === 0) {
|
content: '确认收货吗?',
|
||||||
await getOrderDetail(orderId);
|
success: async function (res) {
|
||||||
}
|
if (!res.confirm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 正常的确认收货流程
|
||||||
|
const { code } = await OrderApi.receiveOrder(orderId);
|
||||||
|
if (code === 0) {
|
||||||
|
await getOrderDetail(orderId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
@ -420,6 +429,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onShow(async () => {
|
||||||
|
//onShow中获取订单列表,保证跳转后页面为最新状态
|
||||||
|
await getOrderDetail(state.orderInfo.id);
|
||||||
|
})
|
||||||
|
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
let id = 0;
|
let id = 0;
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
|
@ -430,7 +444,7 @@
|
||||||
if (state.comeinType === 'wechat') {
|
if (state.comeinType === 'wechat') {
|
||||||
state.merchantTradeNo = options.merchant_trade_no;
|
state.merchantTradeNo = options.merchant_trade_no;
|
||||||
}
|
}
|
||||||
await getOrderDetail(id);
|
state.orderInfo.id = id
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -223,12 +223,21 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 正常的确认收货流程
|
uni.showModal({
|
||||||
const { code } = await OrderApi.receiveOrder(order.id);
|
title: '提示',
|
||||||
if (code === 0) {
|
content: '确认收货吗?',
|
||||||
resetPagination(state.pagination);
|
success: async function (res) {
|
||||||
await getOrderList();
|
if (!res.confirm) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
// 正常的确认收货流程
|
||||||
|
const { code } = await OrderApi.receiveOrder(order.id);
|
||||||
|
if (code === 0) {
|
||||||
|
resetPagination(state.pagination);
|
||||||
|
await getOrderList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
|
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
|
||||||
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const FileApi = {
|
const FileApi = {
|
||||||
// 上传文件
|
// 上传文件
|
||||||
|
@ -40,6 +41,26 @@ const FileApi = {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取文件预签名地址
|
||||||
|
getFilePresignedUrl: (path) => {
|
||||||
|
return request({
|
||||||
|
url: '/infra/file/presigned-url',
|
||||||
|
method: 'GET',
|
||||||
|
params: {
|
||||||
|
path,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 创建文件
|
||||||
|
createFile: (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/infra/file/create', // 请求的 URL
|
||||||
|
method: 'POST', // 请求方法
|
||||||
|
data: data, // 要发送的数据
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FileApi;
|
export default FileApi;
|
||||||
|
|
|
@ -6,6 +6,9 @@ const TradeConfigApi = {
|
||||||
return request({
|
return request({
|
||||||
url: `/trade/config/get`,
|
url: `/trade/config/get`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,6 +35,9 @@ const OrderApi = {
|
||||||
if (!(data.pointActivityId > 0)) {
|
if (!(data.pointActivityId > 0)) {
|
||||||
delete data2.pointActivityId;
|
delete data2.pointActivityId;
|
||||||
}
|
}
|
||||||
|
if (!(data.deliveryType > 0)) {
|
||||||
|
delete data2.deliveryType;
|
||||||
|
}
|
||||||
// 解决 SpringMVC 接受 List<Item> 参数的问题
|
// 解决 SpringMVC 接受 List<Item> 参数的问题
|
||||||
delete data2.items;
|
delete data2.items;
|
||||||
for (let i = 0; i < data.items.length; i++) {
|
for (let i = 0; i < data.items.length; i++) {
|
||||||
|
|
|
@ -57,8 +57,9 @@
|
||||||
<view class="ss-m-b-24 cotBu-txt">
|
<view class="ss-m-b-24 cotBu-txt">
|
||||||
{{
|
{{
|
||||||
item.validityType == 1
|
item.validityType == 1
|
||||||
? sheep.$helper.timeFormat(item.validStartTime, 'yyyy.mm.dd') -
|
? sheep.$helper.timeFormat(item.validStartTime, 'yyyy-mm-dd') +
|
||||||
sheep.$helper.timeFormat(item.validEndTime, 'yyyy.mm.dd')
|
'-' +
|
||||||
|
sheep.$helper.timeFormat(item.validEndTime, 'yyyy-mm-dd')
|
||||||
: '领取后' + item.fixedStartTerm + '-' + item.fixedEndTerm + '天可用'
|
: '领取后' + item.fixedStartTerm + '-' + item.fixedEndTerm + '天可用'
|
||||||
}}
|
}}
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
>
|
>
|
||||||
<view v-for="(item, index) in state.orderInfo.promotions" :key="index">
|
<view v-for="(item, index) in state.orderInfo.promotions" :key="index">
|
||||||
<!-- 不展示积分、优惠劵、会员折扣,因为它们已经单独展示了 -->
|
<!-- 不展示积分、优惠劵、会员折扣,因为它们已经单独展示了 -->
|
||||||
<view class="ss-flex ss-m-b-40 subtitle" v-if="[1, 2, 3, 4, 5, 6].includes(item.type)">
|
<view class="ss-flex ss-m-b-40 subtitle" v-if="[1, 2, 3, 4, 5].includes(item.type)">
|
||||||
<view> {{ item.description }} </view>
|
<view> {{ item.description }} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -261,6 +261,9 @@
|
||||||
// 查找对应的 spu 并更新价格
|
// 查找对应的 spu 并更新价格
|
||||||
const spu = state.spuList.find((spu) => activity.spuId === spu.id);
|
const spu = state.spuList.find((spu) => activity.spuId === spu.id);
|
||||||
if (spu) {
|
if (spu) {
|
||||||
|
// 赋值活动名称
|
||||||
|
// TODO 芋艿:暂定活动名。会在调研一些类似有赞、淘宝、京东的选择
|
||||||
|
spu.name = activity.name;
|
||||||
// 赋值最低价格
|
// 赋值最低价格
|
||||||
spu.price = Math.min(combinationPrice, spu.price);
|
spu.price = Math.min(combinationPrice, spu.price);
|
||||||
// 赋值活动ID,为了点击跳转详情页
|
// 赋值活动ID,为了点击跳转详情页
|
||||||
|
|
|
@ -261,6 +261,9 @@
|
||||||
// 查找对应的 spu 并更新价格
|
// 查找对应的 spu 并更新价格
|
||||||
const spu = state.spuList.find((spu) => activity.spuId === spu.id);
|
const spu = state.spuList.find((spu) => activity.spuId === spu.id);
|
||||||
if (spu) {
|
if (spu) {
|
||||||
|
// 赋值活动名称
|
||||||
|
// TODO 芋艿:暂定活动名。会在调研一些类似有赞、淘宝、京东的选择
|
||||||
|
spu.name = activity.name;
|
||||||
// 赋值最低价格
|
// 赋值最低价格
|
||||||
spu.price = Math.min(seckillPrice, spu.price);
|
spu.price = Math.min(seckillPrice, spu.price);
|
||||||
// 赋值活动ID,为了点击跳转详情页
|
// 赋值活动ID,为了点击跳转详情页
|
||||||
|
|
|
@ -1,108 +1,111 @@
|
||||||
<!-- 装修商品组件:标题栏 -->
|
<!-- 装修商品组件:标题栏 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="ss-title-wrap ss-flex ss-col-center" :class="[state.typeMap[data.textAlign]]" :style="[bgStyle, { marginLeft: `${data.space}px` }]">
|
<view
|
||||||
<view class="title-content">
|
class="ss-title-wrap ss-flex ss-col-center"
|
||||||
<!-- 主标题 -->
|
:class="[state.typeMap[data.textAlign]]"
|
||||||
<view v-if="data.title" class="title-text" :style="[titleStyles]">{{ data.title }}</view>
|
:style="[bgStyle, { marginLeft: `${data.space}px` }]"
|
||||||
<!-- 副标题 -->
|
>
|
||||||
<view v-if="data.description" :style="[descStyles]" class="sub-title-text">{{ data.description }}</view>
|
<view class="title-content">
|
||||||
</view>
|
<!-- 主标题 -->
|
||||||
<!-- 查看更多 -->
|
<view v-if="data.title" class="title-text" :style="[titleStyles]">{{ data.title }}</view>
|
||||||
<view v-if="data.more?.show" class="more-box ss-flex ss-col-center" @tap="sheep.$router.go(data.more.url)"
|
<!-- 副标题 -->
|
||||||
:style="{color: data.descriptionColor}">
|
<view v-if="data.description" :style="[descStyles]" class="sub-title-text">{{
|
||||||
<view class="more-text" v-if="data.more.type !== 'icon'">{{ data.more.text }} </view>
|
data.description
|
||||||
<text class="_icon-forward" v-if="data.more.type !== 'text'"></text>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<!-- 查看更多 -->
|
||||||
|
<view
|
||||||
|
v-if="data.more?.show"
|
||||||
|
class="more-box ss-flex ss-col-center"
|
||||||
|
@tap="sheep.$router.go(data.more.url)"
|
||||||
|
:style="{ color: data.descriptionColor }"
|
||||||
|
>
|
||||||
|
<view class="more-text" v-if="data.more.type !== 'icon'">{{ data.more.text }} </view>
|
||||||
|
<text class="_icon-forward" v-if="data.more.type !== 'text'"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* 标题栏
|
* 标题栏
|
||||||
*/
|
*/
|
||||||
import {
|
import { reactive, computed } from 'vue';
|
||||||
reactive,
|
import sheep from '@/sheep';
|
||||||
computed
|
|
||||||
} from 'vue';
|
|
||||||
import sheep from '@/sheep';
|
|
||||||
|
|
||||||
// 数据
|
// 数据
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
typeMap: {
|
typeMap: {
|
||||||
left: 'ss-row-left',
|
left: 'ss-row-left',
|
||||||
center: 'ss-row-center',
|
center: 'ss-row-center',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// 接收参数
|
// 接收参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 装修数据
|
// 装修数据
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
// 装修样式
|
// 装修样式
|
||||||
styles: {
|
styles: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// 设置背景样式
|
// 设置背景样式
|
||||||
const bgStyle = computed(() => {
|
const bgStyle = computed(() => {
|
||||||
// 直接从 props.styles 解构
|
// 直接从 props.styles 解构
|
||||||
const {
|
const { bgType, bgImg, bgColor } = props.styles;
|
||||||
bgType,
|
|
||||||
bgImg,
|
|
||||||
bgColor
|
|
||||||
} = props.styles;
|
|
||||||
|
|
||||||
// 根据 bgType 返回相应的样式
|
// 根据 bgType 返回相应的样式
|
||||||
return {
|
return {
|
||||||
background: bgType === 'img' ? `url(${bgImg}) no-repeat top center / 100% 100%` : bgColor
|
background: bgType === 'img' ? `url(${bgImg}) no-repeat top center / 100% 100%` : bgColor,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// 标题样式
|
// 标题样式
|
||||||
const titleStyles = {
|
const titleStyles = {
|
||||||
color: props.data.titleColor,
|
color: props.data.titleColor,
|
||||||
fontSize: `${props.data.titleSize}px`,
|
fontSize: `${props.data.titleSize}px`,
|
||||||
textAlign: props.data.textAlign
|
textAlign: props.data.textAlign,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 副标题
|
// 副标题
|
||||||
const descStyles = {
|
const descStyles = {
|
||||||
color: props.data.descriptionColor,
|
color: props.data.descriptionColor,
|
||||||
textAlign: props.data.textAlign,
|
textAlign: props.data.textAlign,
|
||||||
fontSize: `${props.data.descriptionSize}px`,
|
fontSize: `${props.data.descriptionSize}px`,
|
||||||
fontWeight: `${props.data.descriptionWeight}px`,
|
fontWeight: `${props.data.descriptionWeight}`,
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.ss-title-wrap {
|
.ss-title-wrap {
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.title-content {
|
.title-content {
|
||||||
.title-text {
|
.title-text {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-title-text {
|
.sub-title-text {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-box {
|
.more-box {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
right: 20rpx;
|
right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -116,6 +116,28 @@ function normalizeChooseAndUploadFileRes(res, fileType) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function convertToArrayBuffer(uniFile) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const fs = uni.getFileSystemManager();
|
||||||
|
|
||||||
|
fs.readFile({
|
||||||
|
filePath: uniFile.path, // 确保路径正确
|
||||||
|
success: (fileRes) => {
|
||||||
|
try {
|
||||||
|
// 将读取的内容转换为 ArrayBuffer
|
||||||
|
const arrayBuffer = new Uint8Array(fileRes.data).buffer;
|
||||||
|
resolve(arrayBuffer);
|
||||||
|
} catch (error) {
|
||||||
|
reject(new Error(`转换为 ArrayBuffer 失败: ${error.message}`));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
reject(new Error(`读取文件失败: ${error.errMsg}`));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function uploadCloudFiles(files, max = 5, onUploadProgress) {
|
function uploadCloudFiles(files, max = 5, onUploadProgress) {
|
||||||
files = JSON.parse(JSON.stringify(files));
|
files = JSON.parse(JSON.stringify(files));
|
||||||
const len = files.length;
|
const len = files.length;
|
||||||
|
@ -165,36 +187,58 @@ function uploadCloudFiles(files, max = 5, onUploadProgress) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) {
|
async function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) {
|
||||||
return choosePromise
|
// 获取选择的文件
|
||||||
.then((res) => {
|
const res = await choosePromise;
|
||||||
if (onChooseFile) {
|
// 处理文件选择回调
|
||||||
const customChooseRes = onChooseFile(res);
|
let files = res.tempFiles || [];
|
||||||
if (typeof customChooseRes !== 'undefined') {
|
if (onChooseFile) {
|
||||||
return Promise.resolve(customChooseRes).then((chooseRes) =>
|
const customChooseRes = onChooseFile(res);
|
||||||
typeof chooseRes === 'undefined' ? res : chooseRes,
|
if (typeof customChooseRes !== 'undefined') {
|
||||||
);
|
files = await Promise.resolve(customChooseRes);
|
||||||
}
|
if (typeof files === 'undefined') {
|
||||||
|
files = res.tempFiles || []; // Fallback
|
||||||
}
|
}
|
||||||
return res;
|
}
|
||||||
})
|
}
|
||||||
.then((res) => {
|
|
||||||
if (res === false) {
|
// 如果是前端直连上传
|
||||||
return {
|
if (UPLOAD_TYPE.CLIENT === import.meta.env.SHOPRO_UPLOAD_TYPE) {
|
||||||
errMsg: ERR_MSG_OK,
|
for (const file of files) {
|
||||||
tempFilePaths: [],
|
// 1.1 获取文件预签名地址
|
||||||
tempFiles: [],
|
const { data: presignedInfo } = await FileApi.getFilePresignedUrl(file.name);
|
||||||
};
|
// 1.2 获取二进制文件对象
|
||||||
}
|
const fileBuffer = await convertToArrayBuffer(file);
|
||||||
return res;
|
// 1.3 上传文件
|
||||||
})
|
await uni.request({
|
||||||
.then(async (files) => {
|
url: presignedInfo.uploadUrl, // 预签名的上传 URL
|
||||||
for (let file of files.tempFiles) {
|
method: 'PUT', // 使用 PUT 方法
|
||||||
const { data } = await FileApi.uploadFile(file.path);
|
header: {
|
||||||
file.url = data;
|
'Content-Type': file.fileType + '/' + file.name.substring(file.name.lastIndexOf('.') + 1), // 设置内容类型
|
||||||
}
|
},
|
||||||
return files;
|
data: fileBuffer, // 文件的路径,适用于小程序
|
||||||
});
|
success: (res) => {
|
||||||
|
// 1.4. 记录文件信息到后端(异步)
|
||||||
|
createFile(presignedInfo, file);
|
||||||
|
// 1.5. 重新赋值
|
||||||
|
file.url = presignedInfo.url;
|
||||||
|
console.log('上传成功:', res);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('上传失败:', err);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return files;
|
||||||
|
} else {
|
||||||
|
// 后端上传
|
||||||
|
for (let file of files) {
|
||||||
|
const { data } = await FileApi.uploadFile(file.path);
|
||||||
|
file.url = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return files;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function chooseAndUploadFile(
|
function chooseAndUploadFile(
|
||||||
|
@ -210,4 +254,32 @@ function chooseAndUploadFile(
|
||||||
return uploadFiles(chooseAll(opts), opts);
|
return uploadFiles(chooseAll(opts), opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建文件信息
|
||||||
|
* @param vo 文件预签名信息
|
||||||
|
* @param file 文件
|
||||||
|
*/
|
||||||
|
function createFile(vo, file) {
|
||||||
|
const fileVo = {
|
||||||
|
configId: vo.configId,
|
||||||
|
url: vo.url,
|
||||||
|
path: file.name,
|
||||||
|
name: file.name,
|
||||||
|
type: file.fileType,
|
||||||
|
size: file.size,
|
||||||
|
};
|
||||||
|
FileApi.createFile(fileVo);
|
||||||
|
return fileVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传类型
|
||||||
|
*/
|
||||||
|
const UPLOAD_TYPE = {
|
||||||
|
// 客户端直接上传(只支持S3服务)
|
||||||
|
CLIENT: 'client',
|
||||||
|
// 客户端发送到后端上传
|
||||||
|
SERVER: 'server',
|
||||||
|
};
|
||||||
|
|
||||||
export { chooseAndUploadFile, uploadCloudFiles };
|
export { chooseAndUploadFile, uploadCloudFiles };
|
||||||
|
|
|
@ -369,7 +369,7 @@
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.setSuccessAndError(result.tempFiles);
|
this.setSuccessAndError(result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log('选择失败', err);
|
console.log('选择失败', err);
|
||||||
|
@ -453,7 +453,7 @@
|
||||||
|
|
||||||
if (index === -1 || !this.files) break;
|
if (index === -1 || !this.files) break;
|
||||||
if (item.errMsg === 'request:fail') {
|
if (item.errMsg === 'request:fail') {
|
||||||
this.files[index].url = item.path;
|
this.files[index].url = item.url;
|
||||||
this.files[index].status = 'error';
|
this.files[index].status = 'error';
|
||||||
this.files[index].errMsg = item.errMsg;
|
this.files[index].errMsg = item.errMsg;
|
||||||
// this.files[index].progress = -1
|
// this.files[index].progress = -1
|
||||||
|
@ -587,7 +587,7 @@
|
||||||
path: v.path,
|
path: v.path,
|
||||||
size: v.size,
|
size: v.size,
|
||||||
fileID: v.fileID,
|
fileID: v.fileID,
|
||||||
url: v.url,
|
url: v.path,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return newFilesData;
|
return newFilesData;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { onBeforeUnmount, reactive, ref } from 'vue';
|
import { onBeforeUnmount, reactive, ref } from 'vue';
|
||||||
import { baseUrl, websocketPath } from '@/sheep/config';
|
import { baseUrl, websocketPath } from '@/sheep/config';
|
||||||
import { copyValueToTarget } from '@/sheep/util';
|
import { copyValueToTarget } from '@/sheep/util';
|
||||||
|
import { getRefreshToken } from '@/sheep/request';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebSocket 创建 hook
|
* WebSocket 创建 hook
|
||||||
|
@ -8,12 +9,8 @@ import { copyValueToTarget } from '@/sheep/util';
|
||||||
* @return {{options: *}}
|
* @return {{options: *}}
|
||||||
*/
|
*/
|
||||||
export function useWebSocket(opt) {
|
export function useWebSocket(opt) {
|
||||||
const getAccessToken = () => {
|
|
||||||
return uni.getStorageSync('token');
|
|
||||||
};
|
|
||||||
|
|
||||||
const options = reactive({
|
const options = reactive({
|
||||||
url: (baseUrl + websocketPath).replace('http', 'ws') + '?token=' + getAccessToken(), // ws 地址
|
url: (baseUrl + websocketPath).replace('http', 'ws') + '?token=' + getRefreshToken(), // ws 地址
|
||||||
isReconnecting: false, // 正在重新连接
|
isReconnecting: false, // 正在重新连接
|
||||||
reconnectInterval: 3000, // 重连间隔,单位毫秒
|
reconnectInterval: 3000, // 重连间隔,单位毫秒
|
||||||
heartBeatInterval: 5000, // 心跳间隔,单位毫秒
|
heartBeatInterval: 5000, // 心跳间隔,单位毫秒
|
||||||
|
@ -22,12 +19,9 @@ export function useWebSocket(opt) {
|
||||||
destroy: false, // 是否销毁
|
destroy: false, // 是否销毁
|
||||||
pingTimeout: null, // 心跳检测定时器
|
pingTimeout: null, // 心跳检测定时器
|
||||||
reconnectTimeout: null, // 重连定时器ID的属性
|
reconnectTimeout: null, // 重连定时器ID的属性
|
||||||
onConnected: () => {
|
onConnected: () => {}, // 连接成功时触发
|
||||||
}, // 连接成功时触发
|
onClosed: () => {}, // 连接关闭时触发
|
||||||
onClosed: () => {
|
onMessage: (data) => {}, // 收到消息
|
||||||
}, // 连接关闭时触发
|
|
||||||
onMessage: (data) => {
|
|
||||||
}, // 收到消息
|
|
||||||
});
|
});
|
||||||
const SocketTask = ref(null); // SocketTask 由 uni.connectSocket() 接口创建
|
const SocketTask = ref(null); // SocketTask 由 uni.connectSocket() 接口创建
|
||||||
|
|
||||||
|
@ -58,7 +52,8 @@ export function useWebSocket(opt) {
|
||||||
// 情况一:实例销毁
|
// 情况一:实例销毁
|
||||||
if (options.destroy) {
|
if (options.destroy) {
|
||||||
options.onClosed();
|
options.onClosed();
|
||||||
} else { // 情况二:连接失败重连
|
} else {
|
||||||
|
// 情况二:连接失败重连
|
||||||
// 停止心跳检查
|
// 停止心跳检查
|
||||||
stopHeartBeat();
|
stopHeartBeat();
|
||||||
// 重连
|
// 重连
|
||||||
|
@ -140,10 +135,8 @@ export function useWebSocket(opt) {
|
||||||
copyValueToTarget(options, opt);
|
copyValueToTarget(options, opt);
|
||||||
SocketTask.value = uni.connectSocket({
|
SocketTask.value = uni.connectSocket({
|
||||||
url: options.url,
|
url: options.url,
|
||||||
complete: () => {
|
complete: () => {},
|
||||||
},
|
success: () => {},
|
||||||
success: () => {
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
initEventListeners();
|
initEventListeners();
|
||||||
};
|
};
|
||||||
|
|
|
@ -140,7 +140,7 @@ const decryptSpm = (spm) => {
|
||||||
query = shareParamsArray[2].split(',');
|
query = shareParamsArray[2].split(',');
|
||||||
shareParams.query = {
|
shareParams.query = {
|
||||||
id: query[0],
|
id: query[0],
|
||||||
activity_id: query[1], // TODO 芋艿:接入分享后,应该统一成 id 参数
|
activity_id: query[1],
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case '4':
|
case '4':
|
||||||
|
|
|
@ -12,224 +12,226 @@ import AuthUtil from '@/sheep/api/member/auth';
|
||||||
import { getTerminal } from '@/sheep/util/const';
|
import { getTerminal } from '@/sheep/util/const';
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
// 显示操作成功消息 默认不显示
|
// 显示操作成功消息 默认不显示
|
||||||
showSuccess: false,
|
showSuccess: false,
|
||||||
// 成功提醒 默认使用后端返回值
|
// 成功提醒 默认使用后端返回值
|
||||||
successMsg: '',
|
successMsg: '',
|
||||||
// 显示失败消息 默认显示
|
// 显示失败消息 默认显示
|
||||||
showError: true,
|
showError: true,
|
||||||
// 失败提醒 默认使用后端返回信息
|
// 失败提醒 默认使用后端返回信息
|
||||||
errorMsg: '',
|
errorMsg: '',
|
||||||
// 显示请求时loading模态框 默认显示
|
// 显示请求时loading模态框 默认显示
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
// loading提醒文字
|
// loading提醒文字
|
||||||
loadingMsg: '加载中',
|
loadingMsg: '加载中',
|
||||||
// 需要授权才能请求 默认放开
|
// 需要授权才能请求 默认放开
|
||||||
auth: false,
|
auth: false,
|
||||||
// ...
|
// ...
|
||||||
};
|
};
|
||||||
|
|
||||||
// Loading全局实例
|
// Loading全局实例
|
||||||
let LoadingInstance = {
|
let LoadingInstance = {
|
||||||
target: null,
|
target: null,
|
||||||
count: 0,
|
count: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭loading
|
* 关闭loading
|
||||||
*/
|
*/
|
||||||
function closeLoading() {
|
function closeLoading() {
|
||||||
if (LoadingInstance.count > 0) LoadingInstance.count--;
|
if (LoadingInstance.count > 0) LoadingInstance.count--;
|
||||||
if (LoadingInstance.count === 0) uni.hideLoading();
|
if (LoadingInstance.count === 0) uni.hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 请求基础配置 可直接使用访问自定义请求
|
* @description 请求基础配置 可直接使用访问自定义请求
|
||||||
*/
|
*/
|
||||||
const http = new Request({
|
const http = new Request({
|
||||||
baseURL: baseUrl + apiPath,
|
baseURL: baseUrl + apiPath,
|
||||||
timeout: 8000,
|
timeout: 8000,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
header: {
|
header: {
|
||||||
Accept: 'text/json',
|
Accept: 'text/json',
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
platform: $platform.name,
|
platform: $platform.name,
|
||||||
},
|
},
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
sslVerify: false,
|
sslVerify: false,
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// 跨域请求时是否携带凭证(cookies)仅H5支持(HBuilderX 2.6.15+)
|
// 跨域请求时是否携带凭证(cookies)仅H5支持(HBuilderX 2.6.15+)
|
||||||
withCredentials: false,
|
withCredentials: false,
|
||||||
// #endif
|
// #endif
|
||||||
custom: options,
|
custom: options,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 请求拦截器
|
* @description 请求拦截器
|
||||||
*/
|
*/
|
||||||
http.interceptors.request.use(
|
http.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
// 自定义处理【auth 授权】:必须登录的接口,则跳出 AuthModal 登录弹窗
|
// 自定义处理【auth 授权】:必须登录的接口,则跳出 AuthModal 登录弹窗
|
||||||
if (config.custom.auth && !$store('user').isLogin) {
|
if (config.custom.auth && !$store('user').isLogin) {
|
||||||
showAuthModal();
|
showAuthModal();
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自定义处理【loading 加载中】:如果需要显示 loading,则显示 loading
|
// 自定义处理【loading 加载中】:如果需要显示 loading,则显示 loading
|
||||||
if (config.custom.showLoading) {
|
if (config.custom.showLoading) {
|
||||||
LoadingInstance.count++;
|
LoadingInstance.count++;
|
||||||
LoadingInstance.count === 1 &&
|
LoadingInstance.count === 1 &&
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: config.custom.loadingMsg,
|
title: config.custom.loadingMsg,
|
||||||
mask: true,
|
mask: true,
|
||||||
fail: () => {
|
fail: () => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 增加 token 令牌、terminal 终端、tenant 租户的请求头
|
// 增加 token 令牌、terminal 终端、tenant 租户的请求头
|
||||||
const token = getAccessToken();
|
const token = getAccessToken();
|
||||||
if (token) {
|
if (token) {
|
||||||
config.header['Authorization'] = token;
|
config.header['Authorization'] = token;
|
||||||
}
|
}
|
||||||
config.header['terminal'] = getTerminal();
|
config.header['terminal'] = getTerminal();
|
||||||
|
|
||||||
config.header['Accept'] = '*/*';
|
config.header['Accept'] = '*/*';
|
||||||
config.header['tenant-id'] = tenantId;
|
config.header['tenant-id'] = tenantId;
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 响应拦截器
|
* @description 响应拦截器
|
||||||
*/
|
*/
|
||||||
http.interceptors.response.use(
|
http.interceptors.response.use(
|
||||||
(response) => {
|
(response) => {
|
||||||
// 约定:如果是 /auth/ 下的 URL 地址,并且返回了 accessToken 说明是登录相关的接口,则自动设置登陆令牌
|
// 约定:如果是 /auth/ 下的 URL 地址,并且返回了 accessToken 说明是登录相关的接口,则自动设置登陆令牌
|
||||||
if (response.config.url.indexOf('/member/auth/') >= 0 && response.data?.data?.accessToken) {
|
if (response.config.url.indexOf('/member/auth/') >= 0 && response.data?.data?.accessToken) {
|
||||||
$store('user').setToken(response.data.data.accessToken, response.data.data.refreshToken);
|
$store('user').setToken(response.data.data.accessToken, response.data.data.refreshToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自定处理【loading 加载中】:如果需要显示 loading,则关闭 loading
|
// 自定处理【loading 加载中】:如果需要显示 loading,则关闭 loading
|
||||||
response.config.custom.showLoading && closeLoading();
|
response.config.custom.showLoading && closeLoading();
|
||||||
|
|
||||||
// 自定义处理【error 错误提示】:如果需要显示错误提示,则显示错误提示
|
// 自定义处理【error 错误提示】:如果需要显示错误提示,则显示错误提示
|
||||||
if (response.data.code !== 0) {
|
if (response.data.code !== 0) {
|
||||||
// 特殊:如果 401 错误码,则跳转到登录页 or 刷新令牌
|
// 特殊:如果 401 错误码,则跳转到登录页 or 刷新令牌
|
||||||
if (response.data.code === 401) {
|
if (response.data.code === 401) {
|
||||||
return refreshToken(response.config);
|
return refreshToken(response.config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 错误提示
|
// 错误提示
|
||||||
if (response.config.custom.showError) {
|
if (response.config.custom.showError) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: response.data.msg || '服务器开小差啦,请稍后再试~',
|
title: response.data.msg || '服务器开小差啦,请稍后再试~',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自定义处理【showSuccess 成功提示】:如果需要显示成功提示,则显示成功提示
|
// 自定义处理【showSuccess 成功提示】:如果需要显示成功提示,则显示成功提示
|
||||||
if (response.config.custom.showSuccess
|
if (
|
||||||
&& response.config.custom.successMsg !== ''
|
response.config.custom.showSuccess &&
|
||||||
&& response.data.code === 0) {
|
response.config.custom.successMsg !== '' &&
|
||||||
|
response.data.code === 0
|
||||||
|
) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: response.config.custom.successMsg,
|
title: response.config.custom.successMsg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回结果:包括 code + data + msg
|
// 返回结果:包括 code + data + msg
|
||||||
return Promise.resolve(response.data);
|
return Promise.resolve(response.data);
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
const userStore = $store('user');
|
const userStore = $store('user');
|
||||||
const isLogin = userStore.isLogin;
|
const isLogin = userStore.isLogin;
|
||||||
let errorMessage = '网络请求出错';
|
let errorMessage = '网络请求出错';
|
||||||
if (error !== undefined) {
|
if (error !== undefined) {
|
||||||
switch (error.statusCode) {
|
switch (error.statusCode) {
|
||||||
case 400:
|
case 400:
|
||||||
errorMessage = '请求错误';
|
errorMessage = '请求错误';
|
||||||
break;
|
break;
|
||||||
case 401:
|
case 401:
|
||||||
errorMessage = isLogin ? '您的登陆已过期' : '请先登录';
|
errorMessage = isLogin ? '您的登陆已过期' : '请先登录';
|
||||||
// 正常情况下,后端不会返回 401 错误,所以这里不处理 handleAuthorized
|
// 正常情况下,后端不会返回 401 错误,所以这里不处理 handleAuthorized
|
||||||
break;
|
break;
|
||||||
case 403:
|
case 403:
|
||||||
errorMessage = '拒绝访问';
|
errorMessage = '拒绝访问';
|
||||||
break;
|
break;
|
||||||
case 404:
|
case 404:
|
||||||
errorMessage = '请求出错';
|
errorMessage = '请求出错';
|
||||||
break;
|
break;
|
||||||
case 408:
|
case 408:
|
||||||
errorMessage = '请求超时';
|
errorMessage = '请求超时';
|
||||||
break;
|
break;
|
||||||
case 429:
|
case 429:
|
||||||
errorMessage = '请求频繁, 请稍后再访问';
|
errorMessage = '请求频繁, 请稍后再访问';
|
||||||
break;
|
break;
|
||||||
case 500:
|
case 500:
|
||||||
errorMessage = '服务器开小差啦,请稍后再试~';
|
errorMessage = '服务器开小差啦,请稍后再试~';
|
||||||
break;
|
break;
|
||||||
case 501:
|
case 501:
|
||||||
errorMessage = '服务未实现';
|
errorMessage = '服务未实现';
|
||||||
break;
|
break;
|
||||||
case 502:
|
case 502:
|
||||||
errorMessage = '网络错误';
|
errorMessage = '网络错误';
|
||||||
break;
|
break;
|
||||||
case 503:
|
case 503:
|
||||||
errorMessage = '服务不可用';
|
errorMessage = '服务不可用';
|
||||||
break;
|
break;
|
||||||
case 504:
|
case 504:
|
||||||
errorMessage = '网络超时';
|
errorMessage = '网络超时';
|
||||||
break;
|
break;
|
||||||
case 505:
|
case 505:
|
||||||
errorMessage = 'HTTP 版本不受支持';
|
errorMessage = 'HTTP 版本不受支持';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (error.errMsg.includes('timeout')) errorMessage = '请求超时';
|
if (error.errMsg.includes('timeout')) errorMessage = '请求超时';
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (error.errMsg.includes('Network'))
|
if (error.errMsg.includes('Network'))
|
||||||
errorMessage = window.navigator.onLine ? '服务器异常' : '请检查您的网络连接';
|
errorMessage = window.navigator.onLine ? '服务器异常' : '请检查您的网络连接';
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error && error.config) {
|
if (error && error.config) {
|
||||||
if (error.config.custom.showError === false) {
|
if (error.config.custom.showError === false) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.data?.msg || errorMessage,
|
title: error.data?.msg || errorMessage,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
error.config.custom.showLoading && closeLoading();
|
error.config.custom.showLoading && closeLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Axios 无感知刷新令牌,参考 https://www.dashingdog.cn/article/11 与 https://segmentfault.com/a/1190000020210980 实现
|
// Axios 无感知刷新令牌,参考 https://www.dashingdog.cn/article/11 与 https://segmentfault.com/a/1190000020210980 实现
|
||||||
let requestList = [] // 请求队列
|
let requestList = []; // 请求队列
|
||||||
let isRefreshToken = false // 是否正在刷新中
|
let isRefreshToken = false; // 是否正在刷新中
|
||||||
const refreshToken = async (config) => {
|
const refreshToken = async (config) => {
|
||||||
// 如果当前已经是 refresh-token 的 URL 地址,并且还是 401 错误,说明是刷新令牌失败了,直接返回 Promise.reject(error)
|
// 如果当前已经是 refresh-token 的 URL 地址,并且还是 401 错误,说明是刷新令牌失败了,直接返回 Promise.reject(error)
|
||||||
if (config.url.indexOf('/member/auth/refresh-token') >= 0) {
|
if (config.url.indexOf('/member/auth/refresh-token') >= 0) {
|
||||||
return Promise.reject('error')
|
return Promise.reject('error');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果未认证,并且未进行刷新令牌,说明可能是访问令牌过期了
|
// 如果未认证,并且未进行刷新令牌,说明可能是访问令牌过期了
|
||||||
if (!isRefreshToken) {
|
if (!isRefreshToken) {
|
||||||
isRefreshToken = true
|
isRefreshToken = true;
|
||||||
// 1. 如果获取不到刷新令牌,则只能执行登出操作
|
// 1. 如果获取不到刷新令牌,则只能执行登出操作
|
||||||
const refreshToken = getRefreshToken()
|
const refreshToken = getRefreshToken();
|
||||||
if (!refreshToken) {
|
if (!refreshToken) {
|
||||||
return handleAuthorized()
|
return handleAuthorized();
|
||||||
}
|
}
|
||||||
// 2. 进行刷新访问令牌
|
// 2. 进行刷新访问令牌
|
||||||
try {
|
try {
|
||||||
|
@ -240,34 +242,34 @@ const refreshToken = async (config) => {
|
||||||
throw new Error('刷新令牌失败');
|
throw new Error('刷新令牌失败');
|
||||||
}
|
}
|
||||||
// 2.1 刷新成功,则回放队列的请求 + 当前请求
|
// 2.1 刷新成功,则回放队列的请求 + 当前请求
|
||||||
config.header.Authorization = 'Bearer ' + getAccessToken()
|
config.header.Authorization = 'Bearer ' + getAccessToken();
|
||||||
requestList.forEach((cb) => {
|
requestList.forEach((cb) => {
|
||||||
cb()
|
cb();
|
||||||
})
|
});
|
||||||
requestList = []
|
requestList = [];
|
||||||
return request(config)
|
return request(config);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。
|
// 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。
|
||||||
// 2.2 刷新失败,只回放队列的请求
|
// 2.2 刷新失败,只回放队列的请求
|
||||||
requestList.forEach((cb) => {
|
requestList.forEach((cb) => {
|
||||||
cb()
|
cb();
|
||||||
})
|
});
|
||||||
// 提示是否要登出。即不回放当前请求!不然会形成递归
|
// 提示是否要登出。即不回放当前请求!不然会形成递归
|
||||||
return handleAuthorized()
|
return handleAuthorized();
|
||||||
} finally {
|
} finally {
|
||||||
requestList = []
|
requestList = [];
|
||||||
isRefreshToken = false
|
isRefreshToken = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 添加到队列,等待刷新获取到新的令牌
|
// 添加到队列,等待刷新获取到新的令牌
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
requestList.push(() => {
|
requestList.push(() => {
|
||||||
config.header.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
config.header.Authorization = 'Bearer ' + getAccessToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||||
resolve(request(config))
|
resolve(request(config));
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理 401 未登录的错误
|
* 处理 401 未登录的错误
|
||||||
|
@ -279,22 +281,22 @@ const handleAuthorized = () => {
|
||||||
// 登录超时
|
// 登录超时
|
||||||
return Promise.reject({
|
return Promise.reject({
|
||||||
code: 401,
|
code: 401,
|
||||||
msg: userStore.isLogin ? '您的登陆已过期' : '请先登录'
|
msg: userStore.isLogin ? '您的登陆已过期' : '请先登录',
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 获得访问令牌 */
|
/** 获得访问令牌 */
|
||||||
const getAccessToken = () => {
|
export const getAccessToken = () => {
|
||||||
return uni.getStorageSync('token');
|
return uni.getStorageSync('token');
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 获得刷新令牌 */
|
/** 获得刷新令牌 */
|
||||||
const getRefreshToken = () => {
|
export const getRefreshToken = () => {
|
||||||
return uni.getStorageSync('refresh-token');
|
return uni.getStorageSync('refresh-token');
|
||||||
}
|
};
|
||||||
|
|
||||||
const request = (config) => {
|
const request = (config) => {
|
||||||
return http.middleware(config);
|
return http.middleware(config);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default request;
|
export default request;
|
||||||
|
|
|
@ -43,7 +43,7 @@ const app = defineStore({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
shareInfo: {}, // 全局分享信息
|
shareInfo: {}, // 全局分享信息
|
||||||
has_wechat_trade_managed: 0 // 小程序发货信息管理 0 没有 || 1 有
|
has_wechat_trade_managed: 0, // 小程序发货信息管理 0 没有 || 1 有
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
// 获取Shopro应用配置和模板
|
// 获取Shopro应用配置和模板
|
||||||
|
@ -55,14 +55,14 @@ const app = defineStore({
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载装修配置
|
// 加载装修配置
|
||||||
await adaptTemplate(this.template, templateId)
|
await adaptTemplate(this.template, templateId);
|
||||||
|
|
||||||
// TODO 芋艿:未来支持管理后台可配;对应 https://api.shopro.sheepjs.com/shop/api/init
|
// TODO 芋艿:未来支持管理后台可配;对应 https://api.shopro.sheepjs.com/shop/api/init
|
||||||
if (true) {
|
if (true) {
|
||||||
this.info = {
|
this.info = {
|
||||||
name: '芋道商城',
|
name: '芋道商城',
|
||||||
logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png',
|
logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png',
|
||||||
version: '2.2.0',
|
version: '2.3.0',
|
||||||
copyright: '全部开源,个人与企业可 100% 免费使用',
|
copyright: '全部开源,个人与企业可 100% 免费使用',
|
||||||
copytime: 'Copyright© 2018-2024',
|
copytime: 'Copyright© 2018-2024',
|
||||||
|
|
||||||
|
@ -71,15 +71,15 @@ const app = defineStore({
|
||||||
};
|
};
|
||||||
this.platform = {
|
this.platform = {
|
||||||
share: {
|
share: {
|
||||||
methods: ["poster", "link"],
|
methods: ['poster', 'link'],
|
||||||
linkAddress: "http://127.0.0.1:3000", // TODO 芋艿:可以考虑改到 .env 那
|
linkAddress: 'http://127.0.0.1:3000', // TODO 芋艿:可以考虑改到 .env 那
|
||||||
posterInfo: {
|
posterInfo: {
|
||||||
"user_bg": "/static/img/shop/config/user-poster-bg.png",
|
user_bg: '/static/img/shop/config/user-poster-bg.png',
|
||||||
"goods_bg": "/static/img/shop/config/goods-poster-bg.png",
|
goods_bg: '/static/img/shop/config/goods-poster-bg.png',
|
||||||
"groupon_bg": "/static/img/shop/config/groupon-poster-bg.png"
|
groupon_bg: '/static/img/shop/config/groupon-poster-bg.png',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
bind_mobile: 0
|
bind_mobile: 0,
|
||||||
};
|
};
|
||||||
this.has_wechat_trade_managed = 0;
|
this.has_wechat_trade_managed = 0;
|
||||||
|
|
||||||
|
@ -111,24 +111,24 @@ const app = defineStore({
|
||||||
// todo: @owen 先做数据适配,后期重构
|
// todo: @owen 先做数据适配,后期重构
|
||||||
const adaptTemplate = async (appTemplate, templateId) => {
|
const adaptTemplate = async (appTemplate, templateId) => {
|
||||||
const { data: diyTemplate } = templateId
|
const { data: diyTemplate } = templateId
|
||||||
// 查询指定模板,一般是预览时使用
|
? // 查询指定模板,一般是预览时使用
|
||||||
? await DiyApi.getDiyTemplate(templateId)
|
await DiyApi.getDiyTemplate(templateId)
|
||||||
: await DiyApi.getUsedDiyTemplate();
|
: await DiyApi.getUsedDiyTemplate();
|
||||||
// 模板不存在
|
// 模板不存在
|
||||||
if (!diyTemplate) {
|
if (!diyTemplate) {
|
||||||
$router.error('TemplateError');
|
$router.error('TemplateError');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tabBar = diyTemplate?.property?.tabBar;
|
const tabBar = diyTemplate?.property?.tabBar;
|
||||||
if (tabBar) {
|
if (tabBar) {
|
||||||
appTemplate.basic.tabbar = tabBar
|
appTemplate.basic.tabbar = tabBar;
|
||||||
if (tabBar?.theme) {
|
if (tabBar?.theme) {
|
||||||
appTemplate.basic.theme = tabBar?.theme;
|
appTemplate.basic.theme = tabBar?.theme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appTemplate.home = diyTemplate?.home;
|
appTemplate.home = diyTemplate?.home;
|
||||||
appTemplate.user = diyTemplate?.user;
|
appTemplate.user = diyTemplate?.user;
|
||||||
}
|
};
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
|
Loading…
Reference in New Issue