✨ 全局:清理多余的 request2.js
This commit is contained in:
@@ -102,25 +102,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import _ from 'lodash';
|
||||
import {
|
||||
onLoad,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
useDurationTime
|
||||
} from '@/sheep/hooks/useGoods';
|
||||
import {
|
||||
showShareModal
|
||||
} from '@/sheep/hooks/useModal';
|
||||
import {
|
||||
isEmpty
|
||||
} from 'lodash';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import BargainApi from '@/sheep/api/promotion/bargain'
|
||||
|
||||
const state = reactive({
|
||||
id: '',
|
||||
@@ -142,7 +127,7 @@
|
||||
let {
|
||||
data,
|
||||
code
|
||||
} = await sheep.$api.activity.getBargainActivityDetail({
|
||||
} = await BargainApi.getBargainActivityDetail({
|
||||
id: state.id
|
||||
})
|
||||
if (code == 0) {
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
import {
|
||||
fen2yuan
|
||||
} from '@/sheep/hooks/useGoods';
|
||||
import BargainApi from '@/sheep/api/activity'
|
||||
import BargainApi from '@/sheep/api/promotion/bargain'
|
||||
const state = reactive({
|
||||
navH: '',
|
||||
returnShow: true,
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<view class="order-card-footer ss-flex ss-row-right ss-p-x-20">
|
||||
<button
|
||||
class="detail-btn ss-reset-button"
|
||||
@tap="sheep.$router.go('/pages/order/detail', { id: record.id })"
|
||||
@tap="sheep.$router.go('/pages/order/detail', { id: record.orderId })"
|
||||
>
|
||||
订单详情
|
||||
</button>
|
||||
|
||||
@@ -32,11 +32,12 @@
|
||||
|
||||
<script setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import _ from 'lodash';
|
||||
import GoodsItem from './goods.vue';
|
||||
import OrderItem from './order.vue';
|
||||
import OrderApi from '@/sheep/api/trade/order';
|
||||
import SpuHistoryApi from '@/sheep/api/product/history';
|
||||
|
||||
const emits = defineEmits(['select', 'close']);
|
||||
const props = defineProps({
|
||||
@@ -74,11 +75,11 @@
|
||||
state.loadStatus = 'loading';
|
||||
const res =
|
||||
props.mode == 'goods'
|
||||
? await sheep.$api.user.view.list({
|
||||
? await SpuHistoryApi.getBrowseHistoryPage({
|
||||
page,
|
||||
list_rows,
|
||||
})
|
||||
: await sheep.$api.order.list({
|
||||
: await OrderApi.getOrderPage({
|
||||
page,
|
||||
list_rows,
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
text="暂无优惠券"
|
||||
/>
|
||||
<!-- 情况一:领劵中心 -->
|
||||
<template v-if="state.currentTab === '0'">
|
||||
<template v-if="state.currentTab === 0">
|
||||
<view v-for="item in state.pagination.list" :key="item.id">
|
||||
<s-coupon-list
|
||||
:data="item"
|
||||
@@ -40,11 +40,7 @@
|
||||
<s-coupon-list
|
||||
:data="item"
|
||||
type="user"
|
||||
@tap="
|
||||
sheep.$router.go('/pages/coupon/detail', {
|
||||
data: JSON.stringify(item),
|
||||
})
|
||||
"
|
||||
@tap="sheep.$router.go('/pages/coupon/detail', { couponId: item.id })"
|
||||
>
|
||||
<template #default>
|
||||
<button
|
||||
@@ -183,12 +179,12 @@
|
||||
getData();
|
||||
// 我的优惠劵
|
||||
} else {
|
||||
state.type = Option.type;
|
||||
Option.type === 'geted'
|
||||
? (state.currentTab = 1)
|
||||
: Option.type === 'used'
|
||||
? (state.currentTab = 2)
|
||||
: (state.currentTab = 3);
|
||||
state.type = state.currentTab;
|
||||
getCoupon();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
state.id = options.id;
|
||||
|
||||
const { code, data } = await sheep.$api.order.detail(state.id);
|
||||
const { code, data } = await OrderApi.getOrder(state.id);
|
||||
if (code !== 0) {
|
||||
sheep.$helper.toast('无待评价订单');
|
||||
return
|
||||
|
||||
@@ -87,13 +87,11 @@
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app';
|
||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import _ from 'lodash';
|
||||
import { resetPagination } from '@/sheep/util';
|
||||
import SpuApi from '@/sheep/api/product/spu';
|
||||
|
||||
const sys_navBar = sheep.$platform.navbar;
|
||||
const emits = defineEmits(['close', 'change']);
|
||||
@@ -232,7 +230,7 @@
|
||||
|
||||
async function getList() {
|
||||
state.loadStatus = 'loading';
|
||||
const { code, data } = await sheep.$api.goods.list({
|
||||
const { code, data } = await SpuApi.getSpuPage({
|
||||
pageNo: state.pagination.pageNo,
|
||||
pageSize: state.pagination.pageSize,
|
||||
sortField: state.currentSort,
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
// 获取售后列表
|
||||
async function getOrderList() {
|
||||
state.loadStatus = 'loading';
|
||||
let { data, code } = await sheep.$api.order.aftersale.list({
|
||||
let { data, code } = await AfterSaleApi.getAfterSalePage({
|
||||
// type: tabMaps[state.currentTab].value,
|
||||
pageNo: state.pagination.pageNo,
|
||||
pageSize: state.pagination.pageSize,
|
||||
|
||||
@@ -372,7 +372,8 @@
|
||||
// 对详情数据进行适配
|
||||
let res;
|
||||
if (state.comeinType === 'wechat') {
|
||||
res = await sheep.$api.order.detail(id, {
|
||||
// TODO 芋艿:微信场景下
|
||||
res = await OrderApi.getOrder(id, {
|
||||
merchant_trade_no: state.merchantTradeNo,
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user