新闻列表装修
This commit is contained in:
parent
f1c5ac864a
commit
bab2d48441
@ -82,6 +82,14 @@
|
|||||||
"title": "自定义页面",
|
"title": "自定义页面",
|
||||||
"group": "商城"
|
"group": "商城"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/mulu/mulu",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "详情",
|
||||||
|
"enablePullDownRefresh" : false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [{
|
"subPackages": [{
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
<!-- 拼团订单的详情 -->
|
<!-- 拼团订单的详情 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout title="拼团详情" class="detail-wrap" :navbar="state.data && !state.loading ? 'inner': 'normal'" :onShareAppMessage="shareInfo">
|
<s-layout
|
||||||
|
title="拼团详情"
|
||||||
|
class="detail-wrap"
|
||||||
|
:navbar="state.data && !state.loading ? 'inner' : 'normal'"
|
||||||
|
:onShareAppMessage="shareInfo"
|
||||||
|
>
|
||||||
<view v-if="state.loading"></view>
|
<view v-if="state.loading"></view>
|
||||||
<view v-if="state.data && !state.loading">
|
<view v-if="state.data && !state.loading">
|
||||||
<!-- 团长信息 + 活动信息 -->
|
<!-- 团长信息 + 活动信息 -->
|
||||||
@ -22,7 +27,7 @@
|
|||||||
priceColor="#E1212B"
|
priceColor="#E1212B"
|
||||||
@tap="
|
@tap="
|
||||||
sheep.$router.go('/pages/goods/groupon', {
|
sheep.$router.go('/pages/goods/groupon', {
|
||||||
id: state.data.headRecord.activityId
|
id: state.data.headRecord.activityId,
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
:style="[{ top: Number(statusBarHeight + 108) + 'rpx' }]"
|
:style="[{ top: Number(statusBarHeight + 108) + 'rpx' }]"
|
||||||
@ -71,7 +76,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="countdown-title ss-flex" v-else>
|
<view class="countdown-title ss-flex" v-else>
|
||||||
还差
|
还差
|
||||||
<view class="num">{{ state.data.headRecord.userSize - state.data.headRecord.userCount }}人</view>
|
<view class="num"
|
||||||
|
>{{ state.data.headRecord.userSize - state.data.headRecord.userCount }}人</view
|
||||||
|
>
|
||||||
拼团成功
|
拼团成功
|
||||||
<view class="ss-flex countdown-time">
|
<view class="ss-flex countdown-time">
|
||||||
<view class="countdown-h ss-flex ss-row-center">{{ endTime.h }}</view>
|
<view class="countdown-h ss-flex ss-row-center">{{ endTime.h }}</view>
|
||||||
@ -109,7 +116,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 还有几个坑位 -->
|
<!-- 还有几个坑位 -->
|
||||||
<view class="default-avatar ss-m-r-24 ss-m-b-20" v-for="item in state.remainNumber" :key="item">
|
<view
|
||||||
|
class="default-avatar ss-m-r-24 ss-m-b-20"
|
||||||
|
v-for="item in state.remainNumber"
|
||||||
|
:key="item"
|
||||||
|
>
|
||||||
<image
|
<image
|
||||||
:src="sheep.$url.static('/static/img/shop/avatar/unknown.png')"
|
:src="sheep.$url.static('/static/img/shop/avatar/unknown.png')"
|
||||||
class="avatar-img"
|
class="avatar-img"
|
||||||
@ -154,11 +165,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else class="ss-flex ss-row-center">
|
<view v-else class="ss-flex ss-row-center">
|
||||||
<view v-if="state.data.orderId">
|
<view v-if="state.data.orderId">
|
||||||
<button
|
<button class="ss-reset-button join-btn" :disabled="endTime.ms <= 0" @tap="onShare">
|
||||||
class="ss-reset-button join-btn"
|
|
||||||
:disabled="endTime.ms <= 0"
|
|
||||||
@tap="onShare"
|
|
||||||
>
|
|
||||||
邀请好友来拼团
|
邀请好友来拼团
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -199,7 +206,7 @@
|
|||||||
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
||||||
import { showShareModal } from '@/sheep/hooks/useModal';
|
import { showShareModal } from '@/sheep/hooks/useModal';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import CombinationApi from "@/sheep/api/promotion/combination";
|
import CombinationApi from '@/sheep/api/promotion/combination';
|
||||||
|
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
|
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
|
||||||
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
||||||
@ -295,7 +302,9 @@
|
|||||||
state.remainNumber = remainNumber > 0 ? remainNumber : 0;
|
state.remainNumber = remainNumber > 0 ? remainNumber : 0;
|
||||||
|
|
||||||
// 获取活动信息
|
// 获取活动信息
|
||||||
const { data: activity } = await CombinationApi.getCombinationActivity(data.headRecord.activityId);
|
const { data: activity } = await CombinationApi.getCombinationActivity(
|
||||||
|
data.headRecord.activityId,
|
||||||
|
);
|
||||||
state.activity = activity;
|
state.activity = activity;
|
||||||
} else {
|
} else {
|
||||||
state.data = null;
|
state.data = null;
|
||||||
@ -316,8 +325,7 @@
|
|||||||
.recharge-box {
|
.recharge-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: 120rpx;
|
margin-bottom: 120rpx;
|
||||||
background: v-bind(headerBg) center/750rpx 100%
|
background: v-bind(headerBg) center/750rpx 100% no-repeat,
|
||||||
no-repeat,
|
|
||||||
linear-gradient(115deg, #f44739 0%, #ff6600 100%);
|
linear-gradient(115deg, #f44739 0%, #ff6600 100%);
|
||||||
border-radius: 0 0 5% 5%;
|
border-radius: 0 0 5% 5%;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {formatOrderColor} from "@/sheep/hooks/useGoods";
|
import { formatOrderColor } from '@/sheep/hooks/useGoods';
|
||||||
import { resetPagination } from '@/sheep/util';
|
import { resetPagination } from '@/sheep/util';
|
||||||
import CombinationApi from '@/sheep/api/promotion/combination';
|
import CombinationApi from '@/sheep/api/promotion/combination';
|
||||||
|
|
||||||
@ -121,7 +121,7 @@
|
|||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.pagination.list = _.concat(state.pagination.list, data.list)
|
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||||
state.pagination.total = data.total;
|
state.pagination.total = data.total;
|
||||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
const { code, data } = await SpuApi.getSpuPage({
|
const { code, data } = await SpuApi.getSpuPage({
|
||||||
pageNo: state.pagination.pageNo,
|
pageNo: state.pagination.pageNo,
|
||||||
pageSize: state.pagination.pageSize,
|
pageSize: state.pagination.pageSize,
|
||||||
...params
|
...params,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -8,8 +8,15 @@
|
|||||||
></view>
|
></view>
|
||||||
<!-- 时间段轮播图 -->
|
<!-- 时间段轮播图 -->
|
||||||
<view class="header" v-if="activeTimeConfig?.sliderPicUrls?.length > 0">
|
<view class="header" v-if="activeTimeConfig?.sliderPicUrls?.length > 0">
|
||||||
<swiper indicator-dots="true" autoplay="true" :circular="true" interval="3000" duration="1500"
|
<swiper
|
||||||
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
|
indicator-dots="true"
|
||||||
|
autoplay="true"
|
||||||
|
:circular="true"
|
||||||
|
interval="3000"
|
||||||
|
duration="1500"
|
||||||
|
indicator-color="rgba(255,255,255,0.6)"
|
||||||
|
indicator-active-color="#fff"
|
||||||
|
>
|
||||||
<block v-for="(picUrl, index) in activeTimeConfig.sliderPicUrls" :key="index">
|
<block v-for="(picUrl, index) in activeTimeConfig.sliderPicUrls" :key="index">
|
||||||
<swiper-item class="borRadius14">
|
<swiper-item class="borRadius14">
|
||||||
<image :src="picUrl" class="slide-image borRadius14" lazy-load />
|
<image :src="picUrl" class="slide-image borRadius14" lazy-load />
|
||||||
@ -22,13 +29,24 @@
|
|||||||
<!-- 左侧图标 -->
|
<!-- 左侧图标 -->
|
||||||
<view class="time-icon">
|
<view class="time-icon">
|
||||||
<!-- TODO 芋艿:图片统一维护 -->
|
<!-- TODO 芋艿:图片统一维护 -->
|
||||||
<image class="ss-w-100 ss-h-100" src="http://mall.yudao.iocoder.cn/static/images/priceTag.png" />
|
<image
|
||||||
|
class="ss-w-100 ss-h-100"
|
||||||
|
src="http://mall.yudao.iocoder.cn/static/images/priceTag.png"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="time-list" :scroll-into-view="activeTimeElId" scroll-x scroll-with-animation>
|
<scroll-view
|
||||||
<view v-for="(config, index) in timeConfigList" :key="index"
|
class="time-list"
|
||||||
|
:scroll-into-view="activeTimeElId"
|
||||||
|
scroll-x
|
||||||
|
scroll-with-animation
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-for="(config, index) in timeConfigList"
|
||||||
|
:key="index"
|
||||||
:class="['item', { active: activeTimeIndex === index }]"
|
:class="['item', { active: activeTimeIndex === index }]"
|
||||||
:id="`timeItem${index}`"
|
:id="`timeItem${index}`"
|
||||||
@tap="handleChangeTimeConfig(index)">
|
@tap="handleChangeTimeConfig(index)"
|
||||||
|
>
|
||||||
<!-- 活动起始时间 -->
|
<!-- 活动起始时间 -->
|
||||||
<view class="time">{{ config.startTime }}</view>
|
<view class="time">{{ config.startTime }}</view>
|
||||||
<!-- 活动状态 -->
|
<!-- 活动状态 -->
|
||||||
@ -42,7 +60,10 @@
|
|||||||
<!-- 活动倒计时 -->
|
<!-- 活动倒计时 -->
|
||||||
<view class="content-header ss-flex-col ss-col-center ss-row-center">
|
<view class="content-header ss-flex-col ss-col-center ss-row-center">
|
||||||
<view class="content-header-box ss-flex ss-row-center">
|
<view class="content-header-box ss-flex ss-row-center">
|
||||||
<view class="countdown-box ss-flex" v-if="activeTimeConfig?.status === TimeStatusEnum.STARTED">
|
<view
|
||||||
|
class="countdown-box ss-flex"
|
||||||
|
v-if="activeTimeConfig?.status === TimeStatusEnum.STARTED"
|
||||||
|
>
|
||||||
<view class="countdown-title ss-m-r-12">距结束</view>
|
<view class="countdown-title ss-m-r-12">距结束</view>
|
||||||
<view class="ss-flex countdown-time">
|
<view class="ss-flex countdown-time">
|
||||||
<view class="ss-flex countdown-h">{{ countDown.h }}</view>
|
<view class="ss-flex countdown-h">{{ countDown.h }}</view>
|
||||||
@ -74,12 +95,20 @@
|
|||||||
>
|
>
|
||||||
<!-- 抢购进度 -->
|
<!-- 抢购进度 -->
|
||||||
<template #activity>
|
<template #activity>
|
||||||
<view class="limit">限量 <text class="ss-m-l-5">{{ activity.stock}} {{activity.unitName}}</text></view>
|
<view class="limit"
|
||||||
|
>限量
|
||||||
|
<text class="ss-m-l-5">{{ activity.stock }} {{ activity.unitName }}</text></view
|
||||||
|
>
|
||||||
<su-progress :percentage="activity.percent" strokeWidth="10" textInside isAnimate />
|
<su-progress :percentage="activity.percent" strokeWidth="10" textInside isAnimate />
|
||||||
</template>
|
</template>
|
||||||
<!-- 抢购按钮 -->
|
<!-- 抢购按钮 -->
|
||||||
<template #cart>
|
<template #cart>
|
||||||
<button :class="['ss-reset-button cart-btn', { disabled: activeTimeConfig.status === TimeStatusEnum.END }]">
|
<button
|
||||||
|
:class="[
|
||||||
|
'ss-reset-button cart-btn',
|
||||||
|
{ disabled: activeTimeConfig.status === TimeStatusEnum.END },
|
||||||
|
]"
|
||||||
|
>
|
||||||
<span v-if="activeTimeConfig?.status === TimeStatusEnum.WAIT_START">未开始</span>
|
<span v-if="activeTimeConfig?.status === TimeStatusEnum.WAIT_START">未开始</span>
|
||||||
<span v-else-if="activeTimeConfig?.status === TimeStatusEnum.STARTED">马上抢</span>
|
<span v-else-if="activeTimeConfig?.status === TimeStatusEnum.STARTED">马上抢</span>
|
||||||
<span v-else>已结束</span>
|
<span v-else>已结束</span>
|
||||||
@ -104,14 +133,15 @@
|
|||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
||||||
import SeckillApi from "@/sheep/api/promotion/seckill";
|
import SeckillApi from '@/sheep/api/promotion/seckill';
|
||||||
import dayjs from "dayjs";
|
import dayjs from 'dayjs';
|
||||||
import {TimeStatusEnum} from "@/sheep/util/const";
|
import { TimeStatusEnum } from '@/sheep/util/const';
|
||||||
|
|
||||||
// 计算页面高度
|
// 计算页面高度
|
||||||
const { safeAreaInsets, safeArea } = sheep.$platform.device;
|
const { safeAreaInsets, safeArea } = sheep.$platform.device;
|
||||||
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
||||||
const pageHeight = (safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sheep.$platform.navbar - 350;
|
const pageHeight =
|
||||||
|
(safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sheep.$platform.navbar - 350;
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-header.png');
|
const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-header.png');
|
||||||
|
|
||||||
// 商品控件显示的字段(不显示库存、销量。改为显示自定义的进度条)
|
// 商品控件显示的字段(不显示库存、销量。改为显示自定义的进度条)
|
||||||
@ -124,16 +154,16 @@
|
|||||||
|
|
||||||
//#region 时间段
|
//#region 时间段
|
||||||
// 时间段列表
|
// 时间段列表
|
||||||
const timeConfigList = ref([])
|
const timeConfigList = ref([]);
|
||||||
// 查询时间段
|
// 查询时间段
|
||||||
const getSeckillConfigList = async () => {
|
const getSeckillConfigList = async () => {
|
||||||
const { data } = await SeckillApi.getSeckillConfigList()
|
const { data } = await SeckillApi.getSeckillConfigList();
|
||||||
const now = dayjs();
|
const now = dayjs();
|
||||||
const today = now.format('YYYY-MM-DD')
|
const today = now.format('YYYY-MM-DD');
|
||||||
// 判断时间段的状态
|
// 判断时间段的状态
|
||||||
data.forEach((config, index) => {
|
data.forEach((config, index) => {
|
||||||
const startTime = dayjs(`${today} ${config.startTime}`)
|
const startTime = dayjs(`${today} ${config.startTime}`);
|
||||||
const endTime = dayjs(`${today} ${config.endTime}`)
|
const endTime = dayjs(`${today} ${config.endTime}`);
|
||||||
if (now.isBefore(startTime)) {
|
if (now.isBefore(startTime)) {
|
||||||
config.status = TimeStatusEnum.WAIT_START;
|
config.status = TimeStatusEnum.WAIT_START;
|
||||||
} else if (now.isAfter(endTime)) {
|
} else if (now.isAfter(endTime)) {
|
||||||
@ -142,35 +172,35 @@
|
|||||||
config.status = TimeStatusEnum.STARTED;
|
config.status = TimeStatusEnum.STARTED;
|
||||||
activeTimeIndex.value = index;
|
activeTimeIndex.value = index;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
timeConfigList.value = data
|
timeConfigList.value = data;
|
||||||
// 默认选中进行中的活动
|
// 默认选中进行中的活动
|
||||||
handleChangeTimeConfig(activeTimeIndex.value);
|
handleChangeTimeConfig(activeTimeIndex.value);
|
||||||
// 滚动到进行中的时间段
|
// 滚动到进行中的时间段
|
||||||
scrollToTimeConfig(activeTimeIndex.value)
|
scrollToTimeConfig(activeTimeIndex.value);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 滚动到指定时间段
|
// 滚动到指定时间段
|
||||||
const activeTimeElId = ref('') // 当前选中的时间段的元素ID
|
const activeTimeElId = ref(''); // 当前选中的时间段的元素ID
|
||||||
const scrollToTimeConfig = (index) => {
|
const scrollToTimeConfig = (index) => {
|
||||||
nextTick(() => activeTimeElId.value = `timeItem${index}`)
|
nextTick(() => (activeTimeElId.value = `timeItem${index}`));
|
||||||
}
|
};
|
||||||
|
|
||||||
// 切换时间段
|
// 切换时间段
|
||||||
const activeTimeIndex = ref(0) // 当前选中的时间段的索引
|
const activeTimeIndex = ref(0); // 当前选中的时间段的索引
|
||||||
const activeTimeConfig = computed(() => timeConfigList.value[activeTimeIndex.value]) // 当前选中的时间段
|
const activeTimeConfig = computed(() => timeConfigList.value[activeTimeIndex.value]); // 当前选中的时间段
|
||||||
const handleChangeTimeConfig = (index) => {
|
const handleChangeTimeConfig = (index) => {
|
||||||
activeTimeIndex.value = index
|
activeTimeIndex.value = index;
|
||||||
|
|
||||||
// 查询活动列表
|
// 查询活动列表
|
||||||
activityPageParams.pageNo = 1
|
activityPageParams.pageNo = 1;
|
||||||
activityList.value = []
|
activityList.value = [];
|
||||||
getActivityList();
|
getActivityList();
|
||||||
}
|
};
|
||||||
|
|
||||||
// 倒计时
|
// 倒计时
|
||||||
const countDown = computed(() => {
|
const countDown = computed(() => {
|
||||||
const endTime = activeTimeConfig.value?.endTime
|
const endTime = activeTimeConfig.value?.endTime;
|
||||||
if (endTime) {
|
if (endTime) {
|
||||||
return useDurationTime(`${dayjs().format('YYYY-MM-DD')} ${endTime}`);
|
return useDurationTime(`${dayjs().format('YYYY-MM-DD')} ${endTime}`);
|
||||||
}
|
}
|
||||||
@ -185,17 +215,19 @@
|
|||||||
id: 0, // 时间段 ID
|
id: 0, // 时间段 ID
|
||||||
pageNo: 1, // 页码
|
pageNo: 1, // 页码
|
||||||
pageSize: 5, // 每页数量
|
pageSize: 5, // 每页数量
|
||||||
})
|
});
|
||||||
const activityTotal = ref(0) // 活动总数
|
const activityTotal = ref(0); // 活动总数
|
||||||
const activityList = ref([]) // 活动列表
|
const activityList = ref([]); // 活动列表
|
||||||
const loadStatus = ref('') // 页面加载状态
|
const loadStatus = ref(''); // 页面加载状态
|
||||||
async function getActivityList() {
|
async function getActivityList() {
|
||||||
loadStatus.value = 'loading';
|
loadStatus.value = 'loading';
|
||||||
const { data } = await SeckillApi.getSeckillActivityPage(activityPageParams)
|
const { data } = await SeckillApi.getSeckillActivityPage(activityPageParams);
|
||||||
data.list.forEach(activity => {
|
data.list.forEach((activity) => {
|
||||||
// 计算抢购进度
|
// 计算抢购进度
|
||||||
activity.percent = parseInt(100 * (activity.totalStock - activity.stock) / activity.totalStock);
|
activity.percent = parseInt(
|
||||||
})
|
(100 * (activity.totalStock - activity.stock)) / activity.totalStock,
|
||||||
|
);
|
||||||
|
});
|
||||||
activityList.value = activityList.value.concat(...data.list);
|
activityList.value = activityList.value.concat(...data.list);
|
||||||
activityTotal.value = data.total;
|
activityTotal.value = data.total;
|
||||||
|
|
||||||
@ -205,7 +237,7 @@
|
|||||||
// 加载更多
|
// 加载更多
|
||||||
function loadMore() {
|
function loadMore() {
|
||||||
if (loadStatus.value !== 'noMore') {
|
if (loadStatus.value !== 'noMore') {
|
||||||
activityPageParams.pageNo += 1
|
activityPageParams.pageNo += 1;
|
||||||
getActivityList();
|
getActivityList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,7 +248,7 @@
|
|||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onLoad(async () => {
|
onLoad(async () => {
|
||||||
await getSeckillConfigList()
|
await getSeckillConfigList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
goodsData: {
|
goodsData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -18,4 +17,3 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
:class="{ 'is-active': toolsMode === 'tools' }"
|
:class="{ 'is-active': toolsMode === 'tools' }"
|
||||||
@tap.stop="onTools('tools')"
|
@tap.stop="onTools('tools')"
|
||||||
></text>
|
></text>
|
||||||
<button v-if="message" class="ss-reset-button send-btn" @tap="sendMessage">
|
<button v-if="message" class="ss-reset-button send-btn" @tap="sendMessage"> 发送 </button>
|
||||||
发送
|
|
||||||
</button>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -46,10 +44,9 @@
|
|||||||
},
|
},
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
emits(`update:modelValue`, newValue);
|
emits(`update:modelValue`, newValue);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 打开工具菜单
|
// 打开工具菜单
|
||||||
function onTools(mode) {
|
function onTools(mode) {
|
||||||
emits('onTools', mode);
|
emits('onTools', mode);
|
||||||
|
@ -1,10 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 聊天虚拟列表 -->
|
<!-- 聊天虚拟列表 -->
|
||||||
<z-paging ref="pagingRef" v-model="messageList" use-chat-record-mode use-virtual-list
|
<z-paging
|
||||||
cell-height-mode="dynamic" default-page-size="20" :auto-clean-list-when-reload="false"
|
ref="pagingRef"
|
||||||
safe-area-inset-bottom bottom-bg-color="#f8f8f8" :back-to-top-style="backToTopStyle"
|
v-model="messageList"
|
||||||
:auto-show-back-to-top="showNewMessageTip" @backToTopClick="onBackToTopClick"
|
use-chat-record-mode
|
||||||
@scrolltoupper="onScrollToUpper" @query="queryList">
|
use-virtual-list
|
||||||
|
cell-height-mode="dynamic"
|
||||||
|
default-page-size="20"
|
||||||
|
:auto-clean-list-when-reload="false"
|
||||||
|
safe-area-inset-bottom
|
||||||
|
bottom-bg-color="#f8f8f8"
|
||||||
|
:back-to-top-style="backToTopStyle"
|
||||||
|
:auto-show-back-to-top="showNewMessageTip"
|
||||||
|
@backToTopClick="onBackToTopClick"
|
||||||
|
@scrolltoupper="onScrollToUpper"
|
||||||
|
@query="queryList"
|
||||||
|
>
|
||||||
<template #top>
|
<template #top>
|
||||||
<!-- 撑一下顶部导航 -->
|
<!-- 撑一下顶部导航 -->
|
||||||
<view style="height: 45px"></view>
|
<view style="height: 45px"></view>
|
||||||
@ -14,7 +25,11 @@
|
|||||||
<template #cell="{ item, index }">
|
<template #cell="{ item, index }">
|
||||||
<view style="transform: scaleY(-1)">
|
<view style="transform: scaleY(-1)">
|
||||||
<!-- 消息渲染 -->
|
<!-- 消息渲染 -->
|
||||||
<MessageListItem :message="item" :message-index="index" :message-list="messageList"></MessageListItem>
|
<MessageListItem
|
||||||
|
:message="item"
|
||||||
|
:message-index="index"
|
||||||
|
:message-list="messageList"
|
||||||
|
></MessageListItem>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- 底部聊天输入框 -->
|
<!-- 底部聊天输入框 -->
|
||||||
@ -37,13 +52,13 @@
|
|||||||
const messageList = ref([]); // 消息列表
|
const messageList = ref([]); // 消息列表
|
||||||
const showNewMessageTip = ref(false); // 显示有新消息提示
|
const showNewMessageTip = ref(false); // 显示有新消息提示
|
||||||
const backToTopStyle = reactive({
|
const backToTopStyle = reactive({
|
||||||
'width': '100px',
|
width: '100px',
|
||||||
'background-color': '#fff',
|
'background-color': '#fff',
|
||||||
'border-radius': '30px',
|
'border-radius': '30px',
|
||||||
'box-shadow': '0 2px 4px rgba(0, 0, 0, 0.1)',
|
'box-shadow': '0 2px 4px rgba(0, 0, 0, 0.1)',
|
||||||
'display': 'flex',
|
display: 'flex',
|
||||||
'justifyContent': 'center',
|
justifyContent: 'center',
|
||||||
'alignItems': 'center',
|
alignItems: 'center',
|
||||||
}); // 返回顶部样式
|
}); // 返回顶部样式
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
|
@ -4,12 +4,20 @@
|
|||||||
<view class="message-item ss-flex-col scroll-item">
|
<view class="message-item ss-flex-col scroll-item">
|
||||||
<view class="ss-flex ss-row-center ss-col-center">
|
<view class="ss-flex ss-row-center ss-col-center">
|
||||||
<!-- 日期 -->
|
<!-- 日期 -->
|
||||||
<view v-if="message.contentType !== KeFuMessageContentTypeEnum.SYSTEM && showTime(message, messageIndex)"
|
<view
|
||||||
class="date-message">
|
v-if="
|
||||||
|
message.contentType !== KeFuMessageContentTypeEnum.SYSTEM &&
|
||||||
|
showTime(message, messageIndex)
|
||||||
|
"
|
||||||
|
class="date-message"
|
||||||
|
>
|
||||||
{{ formatDate(message.createTime) }}
|
{{ formatDate(message.createTime) }}
|
||||||
</view>
|
</view>
|
||||||
<!-- 系统消息 -->
|
<!-- 系统消息 -->
|
||||||
<view v-if="message.contentType === KeFuMessageContentTypeEnum.SYSTEM" class="system-message">
|
<view
|
||||||
|
v-if="message.contentType === KeFuMessageContentTypeEnum.SYSTEM"
|
||||||
|
class="system-message"
|
||||||
|
>
|
||||||
{{ message.content }}
|
{{ message.content }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -37,13 +45,16 @@
|
|||||||
></image>
|
></image>
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<template v-if="message.contentType === KeFuMessageContentTypeEnum.TEXT">
|
<template v-if="message.contentType === KeFuMessageContentTypeEnum.TEXT">
|
||||||
<view class="message-box" :class="{'admin': message.senderType === UserTypeEnum.ADMIN}">
|
<view class="message-box" :class="{ admin: message.senderType === UserTypeEnum.ADMIN }">
|
||||||
<mp-html :content="replaceEmoji(message.content)" />
|
<mp-html :content="replaceEmoji(message.content)" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="message.contentType === KeFuMessageContentTypeEnum.IMAGE">
|
<template v-if="message.contentType === KeFuMessageContentTypeEnum.IMAGE">
|
||||||
<view class="message-box" :class="{'admin': message.senderType === UserTypeEnum.ADMIN}"
|
<view
|
||||||
:style="{ width: '200rpx' }">
|
class="message-box"
|
||||||
|
:class="{ admin: message.senderType === UserTypeEnum.ADMIN }"
|
||||||
|
:style="{ width: '200rpx' }"
|
||||||
|
>
|
||||||
<su-image
|
<su-image
|
||||||
class="message-img"
|
class="message-img"
|
||||||
isPreview
|
isPreview
|
||||||
@ -80,8 +91,10 @@
|
|||||||
<image
|
<image
|
||||||
v-if="message.senderType === UserTypeEnum.MEMBER"
|
v-if="message.senderType === UserTypeEnum.MEMBER"
|
||||||
class="chat-avatar ss-m-l-24"
|
class="chat-avatar ss-m-l-24"
|
||||||
:src="sheep.$url.cdn(message.senderAvatar) ||
|
:src="
|
||||||
sheep.$url.static('/static/img/shop/chat/default.png')"
|
sheep.$url.cdn(message.senderAvatar) ||
|
||||||
|
sheep.$url.static('/static/img/shop/chat/default.png')
|
||||||
|
"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
>
|
>
|
||||||
</image>
|
</image>
|
||||||
@ -115,7 +128,7 @@
|
|||||||
messageList: {
|
messageList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const getMessageContent = computed(() => (item) => JSON.parse(item.content)); // 解析消息内容
|
const getMessageContent = computed(() => (item) => JSON.parse(item.content)); // 解析消息内容
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20"
|
<view class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20" :key="orderData.id">
|
||||||
:key="orderData.id">
|
|
||||||
<view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20">
|
<view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20">
|
||||||
<view class="order-no">订单号:{{ orderData.no }}</view>
|
<view class="order-no">订单号:{{ orderData.no }}</view>
|
||||||
<view class="order-state ss-font-26" :class="formatOrderColor(orderData)">
|
<view class="order-state ss-font-26" :class="formatOrderColor(orderData)">
|
||||||
@ -18,10 +17,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20">
|
<view class="pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20">
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<view class="discounts-title pay-color">共 {{ orderData.productCount }} 件商品,总金额:</view>
|
<view class="discounts-title pay-color"
|
||||||
<view class="discounts-money pay-color">
|
>共 {{ orderData.productCount }} 件商品,总金额:</view
|
||||||
¥{{ fen2yuan(orderData.payPrice) }}
|
>
|
||||||
</view>
|
<view class="discounts-money pay-color"> ¥{{ fen2yuan(orderData.payPrice) }} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -48,7 +47,8 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-state {}
|
.order-state {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.pay-box {
|
.pay-box {
|
||||||
.discounts-title {
|
.discounts-title {
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<su-popup
|
<su-popup :show="showTools" @close="handleClose">
|
||||||
:show="showTools"
|
|
||||||
@close="handleClose"
|
|
||||||
>
|
|
||||||
<view class="ss-modal-box ss-flex-col">
|
<view class="ss-modal-box ss-flex-col">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<view class="content ss-flex ss-flex-1">
|
<view class="content ss-flex ss-flex-1">
|
||||||
@ -20,7 +17,8 @@
|
|||||||
<swiper-item v-for="emoji in emojiPage" :key="emoji">
|
<swiper-item v-for="emoji in emojiPage" :key="emoji">
|
||||||
<view class="ss-flex ss-flex-wrap">
|
<view class="ss-flex ss-flex-wrap">
|
||||||
<image
|
<image
|
||||||
v-for="item in emoji" :key="item"
|
v-for="item in emoji"
|
||||||
|
:key="item"
|
||||||
class="emoji-img"
|
class="emoji-img"
|
||||||
:src="sheep.$url.cdn(`/static/img/chat/emoji/${item.file}`)"
|
:src="sheep.$url.cdn(`/static/img/chat/emoji/${item.file}`)"
|
||||||
@tap="onEmoji(item)"
|
@tap="onEmoji(item)"
|
||||||
|
@ -1,17 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-layout class="chat-wrap" :title="!isReconnecting ? '连接客服成功' : '会话重连中'" navbar="inner">
|
<s-layout
|
||||||
|
class="chat-wrap"
|
||||||
|
:title="!isReconnecting ? '连接客服成功' : '会话重连中'"
|
||||||
|
navbar="inner"
|
||||||
|
>
|
||||||
<!-- 覆盖头部导航栏背景颜色 -->
|
<!-- 覆盖头部导航栏背景颜色 -->
|
||||||
<div class="page-bg" :style="{ height: sys_navBar + 'px' }"></div>
|
<div class="page-bg" :style="{ height: sys_navBar + 'px' }"></div>
|
||||||
<!-- 聊天区域 -->
|
<!-- 聊天区域 -->
|
||||||
<MessageList ref="messageListRef">
|
<MessageList ref="messageListRef">
|
||||||
<template #bottom>
|
<template #bottom>
|
||||||
<message-input v-model="chat.msg" @on-tools="onTools" @send-message="onSendMessage"></message-input>
|
<message-input
|
||||||
|
v-model="chat.msg"
|
||||||
|
@on-tools="onTools"
|
||||||
|
@send-message="onSendMessage"
|
||||||
|
></message-input>
|
||||||
</template>
|
</template>
|
||||||
</MessageList>
|
</MessageList>
|
||||||
<!-- 聊天工具 -->
|
<!-- 聊天工具 -->
|
||||||
<tools-popup :show-tools="chat.showTools" :tools-mode="chat.toolsMode" @close="handleToolsClose"
|
<tools-popup
|
||||||
@on-emoji="onEmoji" @image-select="onSelect" @on-show-select="onShowSelect">
|
:show-tools="chat.showTools"
|
||||||
<message-input v-model="chat.msg" @on-tools="onTools" @send-message="onSendMessage"></message-input>
|
:tools-mode="chat.toolsMode"
|
||||||
|
@close="handleToolsClose"
|
||||||
|
@on-emoji="onEmoji"
|
||||||
|
@image-select="onSelect"
|
||||||
|
@on-show-select="onShowSelect"
|
||||||
|
>
|
||||||
|
<message-input
|
||||||
|
v-model="chat.msg"
|
||||||
|
@on-tools="onTools"
|
||||||
|
@send-message="onSendMessage"
|
||||||
|
></message-input>
|
||||||
</tools-popup>
|
</tools-popup>
|
||||||
<!-- 商品订单选择 -->
|
<!-- 商品订单选择 -->
|
||||||
<SelectPopup
|
<SelectPopup
|
||||||
@ -30,7 +48,10 @@
|
|||||||
import ToolsPopup from '@/pages/chat/components/toolsPopup.vue';
|
import ToolsPopup from '@/pages/chat/components/toolsPopup.vue';
|
||||||
import MessageInput from '@/pages/chat/components/messageInput.vue';
|
import MessageInput from '@/pages/chat/components/messageInput.vue';
|
||||||
import SelectPopup from '@/pages/chat/components/select-popup.vue';
|
import SelectPopup from '@/pages/chat/components/select-popup.vue';
|
||||||
import { KeFuMessageContentTypeEnum, WebSocketMessageTypeConstants } from '@/pages/chat/util/constants';
|
import {
|
||||||
|
KeFuMessageContentTypeEnum,
|
||||||
|
WebSocketMessageTypeConstants,
|
||||||
|
} from '@/pages/chat/util/constants';
|
||||||
import FileApi from '@/sheep/api/infra/file';
|
import FileApi from '@/sheep/api/infra/file';
|
||||||
import KeFuApi from '@/sheep/api/promotion/kefu';
|
import KeFuApi from '@/sheep/api/promotion/kefu';
|
||||||
import { useWebSocket } from '@/sheep/hooks/useWebSocket';
|
import { useWebSocket } from '@/sheep/hooks/useWebSocket';
|
||||||
@ -134,8 +155,7 @@
|
|||||||
//======================= 聊天工具相关 end =======================
|
//======================= 聊天工具相关 end =======================
|
||||||
const { options } = useWebSocket({
|
const { options } = useWebSocket({
|
||||||
// 连接成功
|
// 连接成功
|
||||||
onConnected: async () => {
|
onConnected: async () => {},
|
||||||
},
|
|
||||||
// 收到消息
|
// 收到消息
|
||||||
onMessage: async (data) => {
|
onMessage: async (data) => {
|
||||||
const type = data.type;
|
const type = data.type;
|
||||||
@ -160,7 +180,6 @@
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.chat-wrap {
|
.chat-wrap {
|
||||||
|
|
||||||
.page-bg {
|
.page-bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -15,5 +15,5 @@ export const UserTypeEnum = {
|
|||||||
// Promotion 的 WebSocket 消息类型枚举类
|
// Promotion 的 WebSocket 消息类型枚举类
|
||||||
export const WebSocketMessageTypeConstants = {
|
export const WebSocketMessageTypeConstants = {
|
||||||
KEFU_MESSAGE_TYPE: 'kefu_message_type', // 客服消息类型
|
KEFU_MESSAGE_TYPE: 'kefu_message_type', // 客服消息类型
|
||||||
KEFU_MESSAGE_ADMIN_READ: 'kefu_message_read_status_change' // 客服消息管理员已读
|
KEFU_MESSAGE_ADMIN_READ: 'kefu_message_read_status_change', // 客服消息管理员已读
|
||||||
}
|
};
|
||||||
|
File diff suppressed because one or more lines are too long
@ -63,7 +63,7 @@
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
let { code, data } = await BrokerageApi.getBrokerageUserSummary();
|
let { code, data } = await BrokerageApi.getBrokerageUserSummary();
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
state.summary = data || {}
|
state.summary = data || {};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -45,7 +45,8 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
methods: { // 开启的提现方式
|
methods: {
|
||||||
|
// 开启的提现方式
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
@ -89,7 +90,7 @@
|
|||||||
}
|
}
|
||||||
// 赋值
|
// 赋值
|
||||||
emits('update:modelValue', {
|
emits('update:modelValue', {
|
||||||
type: state.currentValue
|
type: state.currentValue,
|
||||||
});
|
});
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
emits('close');
|
emits('close');
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
showMoney: false,
|
showMoney: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -8,14 +8,26 @@
|
|||||||
<text class="cicon-forward" />
|
<text class="cicon-forward" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y="true" @scrolltolower="loadmore" class="scroll-box log-scroll"
|
<scroll-view
|
||||||
scroll-with-animation="true">
|
scroll-y="true"
|
||||||
|
@scrolltolower="loadmore"
|
||||||
|
class="scroll-box log-scroll"
|
||||||
|
scroll-with-animation="true"
|
||||||
|
>
|
||||||
<view v-if="state.pagination.list">
|
<view v-if="state.pagination.list">
|
||||||
<view class="log-item-box ss-flex ss-row-between" v-for="item in state.pagination.list" :key="item.id">
|
<view
|
||||||
|
class="log-item-box ss-flex ss-row-between"
|
||||||
|
v-for="item in state.pagination.list"
|
||||||
|
:key="item.id"
|
||||||
|
>
|
||||||
<view class="log-item-wrap">
|
<view class="log-item-wrap">
|
||||||
<view class="log-item ss-flex ss-ellipsis-1 ss-col-center">
|
<view class="log-item ss-flex ss-ellipsis-1 ss-col-center">
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<image class="log-img" :src="sheep.$url.static('/static/img/shop/avatar/notice.png')" mode="aspectFill" />
|
<image
|
||||||
|
class="log-img"
|
||||||
|
:src="sheep.$url.static('/static/img/shop/avatar/notice.png')"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="log-text ss-ellipsis-1">
|
<view class="log-text ss-ellipsis-1">
|
||||||
{{ item.title }} {{ fen2yuan(item.price) }} 元
|
{{ item.title }} {{ fen2yuan(item.price) }} 元
|
||||||
@ -27,8 +39,12 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" color="#333333"
|
<uni-load-more
|
||||||
@tap="loadmore" />
|
v-if="state.pagination.total > 0"
|
||||||
|
:status="state.loadStatus"
|
||||||
|
color="#333333"
|
||||||
|
@tap="loadmore"
|
||||||
|
/>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -55,7 +71,7 @@
|
|||||||
state.loadStatus = 'loading';
|
state.loadStatus = 'loading';
|
||||||
const { code, data } = await BrokerageApi.getBrokerageRecordPage({
|
const { code, data } = await BrokerageApi.getBrokerageRecordPage({
|
||||||
pageNo: state.pagination.pageNo,
|
pageNo: state.pagination.pageNo,
|
||||||
pageSize: state.pagination.pageSize
|
pageSize: state.pagination.pageSize,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -9,9 +9,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-list ss-flex ss-flex-wrap">
|
<view class="menu-list ss-flex ss-flex-wrap">
|
||||||
<view v-for="(item, index) in state.menuList" :key="index" class="item-box ss-flex-col ss-col-center"
|
<view
|
||||||
@tap="sheep.$router.go(item.path)">
|
v-for="(item, index) in state.menuList"
|
||||||
<image class="menu-icon ss-m-b-10" :src="sheep.$url.static(item.img)" mode="aspectFill"></image>
|
:key="index"
|
||||||
|
class="item-box ss-flex-col ss-col-center"
|
||||||
|
@tap="sheep.$router.go(item.path)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
class="menu-icon ss-m-b-10"
|
||||||
|
:src="sheep.$url.static(item.img)"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
<view>{{ item.title }}</view>
|
<view>{{ item.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -23,7 +31,8 @@
|
|||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
menuList: [{
|
menuList: [
|
||||||
|
{
|
||||||
img: '/static/img/shop/commission/commission_icon1.png',
|
img: '/static/img/shop/commission/commission_icon1.png',
|
||||||
title: '我的团队',
|
title: '我的团队',
|
||||||
path: '/pages/commission/team',
|
path: '/pages/commission/team',
|
||||||
@ -65,7 +74,7 @@
|
|||||||
// img: '/static/img/shop/commission/commission_icon7.png',
|
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||||
title: '佣金排行',
|
title: '佣金排行',
|
||||||
path: '/pages/commission/commission-ranking',
|
path: '/pages/commission/commission-ranking',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -14,12 +14,18 @@
|
|||||||
>
|
>
|
||||||
<template #rightBottom>
|
<template #rightBottom>
|
||||||
<view class="ss-flex ss-row-between">
|
<view class="ss-flex ss-row-between">
|
||||||
<view class="commission-num" v-if="item.brokerageMinPrice === undefined">预计佣金:计算中</view>
|
<view class="commission-num" v-if="item.brokerageMinPrice === undefined"
|
||||||
<view class="commission-num" v-else-if="item.brokerageMinPrice === item.brokerageMaxPrice">
|
>预计佣金:计算中</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="commission-num"
|
||||||
|
v-else-if="item.brokerageMinPrice === item.brokerageMaxPrice"
|
||||||
|
>
|
||||||
预计佣金:{{ fen2yuan(item.brokerageMinPrice) }}
|
预计佣金:{{ fen2yuan(item.brokerageMinPrice) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="commission-num" v-else>
|
<view class="commission-num" v-else>
|
||||||
预计佣金:{{ fen2yuan(item.brokerageMinPrice) }} ~ {{ fen2yuan(item.brokerageMaxPrice) }}
|
预计佣金:{{ fen2yuan(item.brokerageMinPrice) }} ~
|
||||||
|
{{ fen2yuan(item.brokerageMaxPrice) }}
|
||||||
</view>
|
</view>
|
||||||
<button
|
<button
|
||||||
class="ss-reset-button share-btn ui-BG-Main-Gradient"
|
class="ss-reset-button share-btn ui-BG-Main-Gradient"
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<!-- 分销中心 -->
|
<!-- 分销中心 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout navbar="inner" class="index-wrap" title="分销中心" :bgStyle="bgStyle" :onShareAppMessage="shareInfo">
|
<s-layout
|
||||||
|
navbar="inner"
|
||||||
|
class="index-wrap"
|
||||||
|
title="分销中心"
|
||||||
|
:bgStyle="bgStyle"
|
||||||
|
:onShareAppMessage="shareInfo"
|
||||||
|
>
|
||||||
<!-- 分销商信息 -->
|
<!-- 分销商信息 -->
|
||||||
<commission-info />
|
<commission-info />
|
||||||
<!-- 账户信息 -->
|
<!-- 账户信息 -->
|
||||||
@ -25,13 +31,16 @@
|
|||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
|
||||||
const shareInfo = computed(() => {
|
const shareInfo = computed(() => {
|
||||||
return sheep.$platform.share.getShareInfo({
|
return sheep.$platform.share.getShareInfo(
|
||||||
|
{
|
||||||
params: {
|
params: {
|
||||||
page: '6',
|
page: '6',
|
||||||
},
|
},
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
type: 'user',
|
type: 'user',
|
||||||
});
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const bgStyle = {
|
const bgStyle = {
|
||||||
|
@ -41,10 +41,7 @@
|
|||||||
<view class="no-box ss-flex ss-col-center ss-row-between">
|
<view class="no-box ss-flex ss-col-center ss-row-between">
|
||||||
<text class="order-code">订单编号:{{ item.bizId }}</text>
|
<text class="order-code">订单编号:{{ item.bizId }}</text>
|
||||||
<text class="order-state">
|
<text class="order-state">
|
||||||
{{
|
{{ item.status === 0 ? '待结算' : item.status === 1 ? '已结算' : '已取消' }}
|
||||||
item.status === 0 ? '待结算'
|
|
||||||
: item.status === 1 ? '已结算' : '已取消'
|
|
||||||
}}
|
|
||||||
( 佣金 {{ fen2yuan(item.price) }} 元 )
|
( 佣金 {{ fen2yuan(item.price) }} 元 )
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -6,14 +6,22 @@
|
|||||||
<view class="card-box ui-BG-Main ui-Shadow-Main">
|
<view class="card-box ui-BG-Main ui-Shadow-Main">
|
||||||
<view class="card-head ss-flex ss-col-center">
|
<view class="card-head ss-flex ss-col-center">
|
||||||
<view class="card-title ss-m-r-10">当前佣金(元)</view>
|
<view class="card-title ss-m-r-10">当前佣金(元)</view>
|
||||||
<view @tap="state.showMoney = !state.showMoney" class="ss-eye-icon"
|
<view
|
||||||
:class="state.showMoney ? 'cicon-eye' : 'cicon-eye-off'" />
|
@tap="state.showMoney = !state.showMoney"
|
||||||
|
class="ss-eye-icon"
|
||||||
|
:class="state.showMoney ? 'cicon-eye' : 'cicon-eye-off'"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex ss-row-between ss-col-center ss-m-t-30">
|
<view class="ss-flex ss-row-between ss-col-center ss-m-t-30">
|
||||||
<view class="money-num">{{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '*****' }}</view>
|
<view class="money-num">{{
|
||||||
|
state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '*****'
|
||||||
|
}}</view>
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<view class="ss-m-r-20">
|
<view class="ss-m-r-20">
|
||||||
<button class="ss-reset-button withdraw-btn" @tap="sheep.$router.go('/pages/commission/withdraw')">
|
<button
|
||||||
|
class="ss-reset-button withdraw-btn"
|
||||||
|
@tap="sheep.$router.go('/pages/commission/withdraw')"
|
||||||
|
>
|
||||||
提现
|
提现
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -43,7 +51,12 @@
|
|||||||
<su-sticky>
|
<su-sticky>
|
||||||
<!-- 统计 -->
|
<!-- 统计 -->
|
||||||
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
||||||
<uni-datetime-picker v-model="state.date" type="daterange" @change="onChangeTime" :end="state.today">
|
<uni-datetime-picker
|
||||||
|
v-model="state.date"
|
||||||
|
type="daterange"
|
||||||
|
@change="onChangeTime"
|
||||||
|
:end="state.today"
|
||||||
|
>
|
||||||
<button class="ss-reset-button date-btn">
|
<button class="ss-reset-button date-btn">
|
||||||
<text>{{ dateFilterText }}</text>
|
<text>{{ dateFilterText }}</text>
|
||||||
<text class="cicon-drop-down ss-seldate-icon" />
|
<text class="cicon-drop-down ss-seldate-icon" />
|
||||||
@ -56,21 +69,44 @@
|
|||||||
<!-- <view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view> -->
|
<!-- <view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<su-tabs :list="tabMaps" @change="onChangeTab" :scrollable="false" :current="state.currentTab" />
|
<su-tabs
|
||||||
|
:list="tabMaps"
|
||||||
|
@change="onChangeTab"
|
||||||
|
:scrollable="false"
|
||||||
|
:current="state.currentTab"
|
||||||
|
/>
|
||||||
</su-sticky>
|
</su-sticky>
|
||||||
<s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无数据"></s-empty>
|
<s-empty
|
||||||
|
v-if="state.pagination.total === 0"
|
||||||
|
icon="/static/data-empty.png"
|
||||||
|
text="暂无数据"
|
||||||
|
></s-empty>
|
||||||
|
|
||||||
<!-- 转余额弹框 -->
|
<!-- 转余额弹框 -->
|
||||||
<su-popup :show="state.showModal" type="bottom" round="20" @close="state.showModal = false" showClose>
|
<su-popup
|
||||||
|
:show="state.showModal"
|
||||||
|
type="bottom"
|
||||||
|
round="20"
|
||||||
|
@close="state.showModal = false"
|
||||||
|
showClose
|
||||||
|
>
|
||||||
<view class="ss-p-x-20 ss-p-y-30">
|
<view class="ss-p-x-20 ss-p-y-30">
|
||||||
<view class="model-title ss-m-b-30 ss-m-l-20">转余额</view>
|
<view class="model-title ss-m-b-30 ss-m-l-20">转余额</view>
|
||||||
<view class="model-subtitle ss-m-b-100 ss-m-l-20">将您的佣金转到余额中继续消费</view>
|
<view class="model-subtitle ss-m-b-100 ss-m-l-20">将您的佣金转到余额中继续消费</view>
|
||||||
<view class="input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20">
|
<view class="input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20">
|
||||||
<view class="unit">¥</view>
|
<view class="unit">¥</view>
|
||||||
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.price" type="number"
|
<uni-easyinput
|
||||||
placeholder="请输入金额" />
|
:inputBorder="false"
|
||||||
|
class="ss-flex-1 ss-p-l-10"
|
||||||
|
v-model="state.price"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入金额"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<button class="ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main" @tap="onConfirm">
|
<button
|
||||||
|
class="ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main"
|
||||||
|
@tap="onConfirm"
|
||||||
|
>
|
||||||
确定
|
确定
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -78,7 +114,11 @@
|
|||||||
|
|
||||||
<!-- 钱包记录 -->
|
<!-- 钱包记录 -->
|
||||||
<view v-if="state.pagination.total > 0">
|
<view v-if="state.pagination.total > 0">
|
||||||
<view class="wallet-list ss-flex border-bottom" v-for="item in state.pagination.list" :key="item.id">
|
<view
|
||||||
|
class="wallet-list ss-flex border-bottom"
|
||||||
|
v-for="item in state.pagination.list"
|
||||||
|
:key="item.id"
|
||||||
|
>
|
||||||
<view class="list-content">
|
<view class="list-content">
|
||||||
<view class="title-box ss-flex ss-row-between ss-m-b-20">
|
<view class="title-box ss-flex ss-row-between ss-m-b-20">
|
||||||
<text class="title ss-line-1">{{ item.title }}</text>
|
<text class="title ss-line-1">{{ item.title }}</text>
|
||||||
@ -87,15 +127,21 @@
|
|||||||
<text v-else class="minus">{{ fen2yuan(item.price) }}</text>
|
<text v-else class="minus">{{ fen2yuan(item.price) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="time">{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
|
<text class="time">{{
|
||||||
|
sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss')
|
||||||
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <u-gap></u-gap> -->
|
<!-- <u-gap></u-gap> -->
|
||||||
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
|
<uni-load-more
|
||||||
|
v-if="state.pagination.total > 0"
|
||||||
|
:status="state.loadStatus"
|
||||||
|
:content-text="{
|
||||||
contentdown: '上拉加载更多',
|
contentdown: '上拉加载更多',
|
||||||
}" />
|
}"
|
||||||
|
/>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -130,14 +176,15 @@
|
|||||||
showModal: false,
|
showModal: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const tabMaps = [{
|
const tabMaps = [
|
||||||
|
{
|
||||||
name: '分佣',
|
name: '分佣',
|
||||||
value: '1', // BrokerageRecordBizTypeEnum.ORDER
|
value: '1', // BrokerageRecordBizTypeEnum.ORDER
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '提现',
|
name: '提现',
|
||||||
value: '2', // BrokerageRecordBizTypeEnum.WITHDRAW
|
value: '2', // BrokerageRecordBizTypeEnum.WITHDRAW
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const dateFilterText = computed(() => {
|
const dateFilterText = computed(() => {
|
||||||
@ -199,10 +246,10 @@
|
|||||||
state.showModal = false;
|
state.showModal = false;
|
||||||
await getAgentInfo();
|
await getAgentInfo();
|
||||||
onChangeTab({
|
onChangeTab({
|
||||||
index: 1
|
index: 1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +264,8 @@
|
|||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
state.today = dayjs().format('YYYY-MM-DD');
|
state.today = dayjs().format('YYYY-MM-DD');
|
||||||
state.date = [state.today, state.today];
|
state.date = [state.today, state.today];
|
||||||
if (options.type === 2) { // 切换到“提现” tab 下
|
if (options.type === 2) {
|
||||||
|
// 切换到“提现” tab 下
|
||||||
state.currentTab = 1;
|
state.currentTab = 1;
|
||||||
}
|
}
|
||||||
getLogList();
|
getLogList();
|
||||||
|
@ -15,7 +15,10 @@
|
|||||||
<view class="num-title">可提现金额(元)</view>
|
<view class="num-title">可提现金额(元)</view>
|
||||||
<view class="wallet-num">{{ fen2yuan(state.brokerageInfo.brokeragePrice) }}</view>
|
<view class="wallet-num">{{ fen2yuan(state.brokerageInfo.brokeragePrice) }}</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/commission/wallet', { type: 2 })">
|
<button
|
||||||
|
class="ss-reset-button log-btn"
|
||||||
|
@tap="sheep.$router.go('/pages/commission/wallet', { type: 2 })"
|
||||||
|
>
|
||||||
提现记录
|
提现记录
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -215,12 +218,12 @@
|
|||||||
confirmText: '查看记录',
|
confirmText: '查看记录',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
sheep.$router.go('/pages/commission/wallet', { type: 2 })
|
sheep.$router.go('/pages/commission/wallet', { type: 2 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getBrokerageUser();
|
getBrokerageUser();
|
||||||
state.accountInfo = {};
|
state.accountInfo = {};
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -247,8 +250,8 @@
|
|||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
getWithdrawRules();
|
getWithdrawRules();
|
||||||
getBrokerageUser()
|
getBrokerageUser();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -16,13 +16,16 @@
|
|||||||
<view class="title ss-m-t-50 ss-m-b-20 ss-m-x-20">{{ state.coupon.name }}</view>
|
<view class="title ss-m-t-50 ss-m-b-20 ss-m-x-20">{{ state.coupon.name }}</view>
|
||||||
<view class="subtitle ss-m-b-50">
|
<view class="subtitle ss-m-b-50">
|
||||||
满 {{ fen2yuan(state.coupon.usePrice) }} 元,
|
满 {{ fen2yuan(state.coupon.usePrice) }} 元,
|
||||||
{{ state.coupon.discountType === 1
|
{{
|
||||||
|
state.coupon.discountType === 1
|
||||||
? '减 ' + fen2yuan(state.coupon.discountPrice) + ' 元'
|
? '减 ' + fen2yuan(state.coupon.discountPrice) + ' 元'
|
||||||
: '打 ' + state.coupon.discountPercent / 10.0 + ' 折' }}
|
: '打 ' + state.coupon.discountPercent / 10.0 + ' 折'
|
||||||
|
}}
|
||||||
</view>
|
</view>
|
||||||
<button
|
<button
|
||||||
class="ss-reset-button ss-m-b-30"
|
class="ss-reset-button ss-m-b-30"
|
||||||
:class="state.coupon.canTake || state.coupon.status === 1
|
:class="
|
||||||
|
state.coupon.canTake || state.coupon.status === 1
|
||||||
? 'use-btn' // 优惠劵模版(可领取)、优惠劵(可使用)
|
? 'use-btn' // 优惠劵模版(可领取)、优惠劵(可使用)
|
||||||
: 'disable-btn'
|
: 'disable-btn'
|
||||||
"
|
"
|
||||||
@ -31,7 +34,13 @@
|
|||||||
>
|
>
|
||||||
<text v-if="state.id > 0">{{ state.coupon.canTake ? '立即领取' : '已领取' }}</text>
|
<text v-if="state.id > 0">{{ state.coupon.canTake ? '立即领取' : '已领取' }}</text>
|
||||||
<text v-else>
|
<text v-else>
|
||||||
{{ state.coupon.status === 1 ? '立即使用' : state.coupon.status === 2 ? '已使用' : '已过期' }}
|
{{
|
||||||
|
state.coupon.status === 1
|
||||||
|
? '立即使用'
|
||||||
|
: state.coupon.status === 2
|
||||||
|
? '已使用'
|
||||||
|
: '已过期'
|
||||||
|
}}
|
||||||
</text>
|
</text>
|
||||||
</button>
|
</button>
|
||||||
<view class="time ss-m-y-30" v-if="state.coupon.validityType === 2">
|
<view class="time ss-m-y-30" v-if="state.coupon.validityType === 2">
|
||||||
@ -176,7 +185,7 @@
|
|||||||
const { code, data } = await SpuApi.getSpuPage({
|
const { code, data } = await SpuApi.getSpuPage({
|
||||||
categoryId: state.categoryId,
|
categoryId: state.categoryId,
|
||||||
pageNo: state.pagination.pageNo,
|
pageNo: state.pagination.pageNo,
|
||||||
pageSize: state.pagination.pageSize
|
pageSize: state.pagination.pageSize,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
@ -197,7 +206,9 @@
|
|||||||
|
|
||||||
// 获得分类列表
|
// 获得分类列表
|
||||||
async function getCategoryList() {
|
async function getCategoryList() {
|
||||||
const { data, code } = await CategoryApi.getCategoryListByIds(state.coupon.productScopeValues.join(','));
|
const { data, code } = await CategoryApi.getCategoryListByIds(
|
||||||
|
state.coupon.productScopeValues.join(','),
|
||||||
|
);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -225,7 +236,9 @@
|
|||||||
|
|
||||||
// 加载优惠劵信息
|
// 加载优惠劵信息
|
||||||
async function getCouponContent() {
|
async function getCouponContent() {
|
||||||
const { code, data } = state.id > 0 ? await CouponApi.getCouponTemplate(state.id)
|
const { code, data } =
|
||||||
|
state.id > 0
|
||||||
|
? await CouponApi.getCouponTemplate(state.id)
|
||||||
: await CouponApi.getCoupon(state.couponId);
|
: await CouponApi.getCoupon(state.couponId);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -56,9 +56,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
|
<uni-load-more
|
||||||
|
v-if="state.pagination.total > 0"
|
||||||
|
:status="state.loadStatus"
|
||||||
|
:content-text="{
|
||||||
contentdown: '上拉加载更多',
|
contentdown: '上拉加载更多',
|
||||||
}" @tap="loadMore" />
|
}"
|
||||||
|
@tap="loadMore"
|
||||||
|
/>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -78,7 +83,7 @@
|
|||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 5
|
pageSize: 5,
|
||||||
},
|
},
|
||||||
loadStatus: '',
|
loadStatus: '',
|
||||||
});
|
});
|
||||||
@ -106,7 +111,7 @@
|
|||||||
function onTabsChange(e) {
|
function onTabsChange(e) {
|
||||||
state.currentTab = e.index;
|
state.currentTab = e.index;
|
||||||
state.type = e.value;
|
state.type = e.value;
|
||||||
resetPagination(state.pagination)
|
resetPagination(state.pagination);
|
||||||
if (state.currentTab === 0) {
|
if (state.currentTab === 0) {
|
||||||
getData();
|
getData();
|
||||||
} else {
|
} else {
|
||||||
@ -135,7 +140,7 @@
|
|||||||
const { data, code } = await CouponApi.getCouponPage({
|
const { data, code } = await CouponApi.getCouponPage({
|
||||||
pageNo: state.pagination.pageNo,
|
pageNo: state.pagination.pageNo,
|
||||||
pageSize: state.pagination.pageSize,
|
pageSize: state.pagination.pageSize,
|
||||||
status: state.type
|
status: state.type,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -27,13 +27,23 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 评价 -->
|
<!-- 评价 -->
|
||||||
<view class="area-box">
|
<view class="area-box">
|
||||||
<uni-easyinput :inputBorder="false" type="textarea" maxlength="120" autoHeight
|
<uni-easyinput
|
||||||
|
:inputBorder="false"
|
||||||
|
type="textarea"
|
||||||
|
maxlength="120"
|
||||||
|
autoHeight
|
||||||
v-model="state.commentList[index].content"
|
v-model="state.commentList[index].content"
|
||||||
placeholder="宝贝满足你的期待吗?说说你的使用心得,分享给想买的他们吧~" />
|
placeholder="宝贝满足你的期待吗?说说你的使用心得,分享给想买的他们吧~"
|
||||||
|
/>
|
||||||
<!-- TODO 芋艿:文件上传 -->
|
<!-- TODO 芋艿:文件上传 -->
|
||||||
<view class="img-box">
|
<view class="img-box">
|
||||||
<s-uploader v-model:url="state.commentList[index].images" fileMediatype="image"
|
<s-uploader
|
||||||
limit="9" mode="grid" :imageStyles="{ width: '168rpx', height: '168rpx' }" />
|
v-model:url="state.commentList[index].images"
|
||||||
|
fileMediatype="image"
|
||||||
|
limit="9"
|
||||||
|
mode="grid"
|
||||||
|
:imageStyles="{ width: '168rpx', height: '168rpx' }"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -61,7 +71,7 @@
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
orderInfo: {},
|
orderInfo: {},
|
||||||
commentList: [],
|
commentList: [],
|
||||||
id: null
|
id: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
@ -76,14 +86,14 @@
|
|||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
if (!options.id) {
|
if (!options.id) {
|
||||||
sheep.$helper.toast(`缺少订单信息,请检查`);
|
sheep.$helper.toast(`缺少订单信息,请检查`);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
state.id = options.id;
|
state.id = options.id;
|
||||||
|
|
||||||
const { code, data } = await OrderApi.getOrder(state.id);
|
const { code, data } = await OrderApi.getOrder(state.id);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
sheep.$helper.toast('无待评价订单');
|
sheep.$helper.toast('无待评价订单');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
// 处理评论
|
// 处理评论
|
||||||
data.items.forEach((item) => {
|
data.items.forEach((item) => {
|
||||||
@ -93,7 +103,7 @@
|
|||||||
descriptionScores: 5,
|
descriptionScores: 5,
|
||||||
benefitScores: 5,
|
benefitScores: 5,
|
||||||
content: '',
|
content: '',
|
||||||
picUrls: []
|
picUrls: [],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
state.orderInfo = data;
|
state.orderInfo = data;
|
||||||
|
@ -42,14 +42,13 @@
|
|||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default() {
|
||||||
return [];
|
return [];
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
function onActivity(activity) {
|
function onActivity(activity) {
|
||||||
const type = activity.type;
|
const type = activity.type;
|
||||||
const typePath = type === 1 ? 'seckill' :
|
const typePath = type === 1 ? 'seckill' : type === 2 ? 'TODO 拼团' : 'groupon';
|
||||||
type === 2 ? 'TODO 拼团' : 'groupon';
|
|
||||||
sheep.$router.go(`/pages/goods/${typePath}`, {
|
sheep.$router.go(`/pages/goods/${typePath}`, {
|
||||||
id: activity.id,
|
id: activity.id,
|
||||||
});
|
});
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
sku: {
|
sku: {
|
||||||
type: Object
|
type: Object,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const value = computed(() => {
|
const value = computed(() => {
|
||||||
if (!props.sku?.id) {
|
if (!props.sku?.id) {
|
||||||
return '请选择商品规格';
|
return '请选择商品规格';
|
||||||
}
|
}
|
||||||
let str = '';
|
let str = '';
|
||||||
props.sku.properties.forEach(property => {
|
props.sku.properties.forEach((property) => {
|
||||||
str += property.propertyName + ':' + property.valueName + ' ';
|
str += property.propertyName + ':' + property.valueName + ' ';
|
||||||
});
|
});
|
||||||
return str;
|
return str;
|
||||||
|
@ -98,7 +98,8 @@
|
|||||||
|
|
||||||
function getCommentCardNode() {
|
function getCommentCardNode() {
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
uni.createSelectorQuery()
|
uni
|
||||||
|
.createSelectorQuery()
|
||||||
.select('.detail-comment-selector')
|
.select('.detail-comment-selector')
|
||||||
.boundingClientRect((data) => {
|
.boundingClientRect((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
if (props.modelValue.favorite) {
|
if (props.modelValue.favorite) {
|
||||||
const { code } = await FavoriteApi.deleteFavorite(props.modelValue.id);
|
const { code } = await FavoriteApi.deleteFavorite(props.modelValue.id);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
sheep.$helper.toast('取消收藏');
|
sheep.$helper.toast('取消收藏');
|
||||||
props.modelValue.favorite = false;
|
props.modelValue.favorite = false;
|
||||||
@ -127,7 +127,7 @@
|
|||||||
} else {
|
} else {
|
||||||
const { code } = await FavoriteApi.createFavorite(props.modelValue.id);
|
const { code } = await FavoriteApi.createFavorite(props.modelValue.id);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
sheep.$helper.toast('收藏成功');
|
sheep.$helper.toast('收藏成功');
|
||||||
props.modelValue.favorite = true;
|
props.modelValue.favorite = true;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
import { onMounted, reactive } from 'vue';
|
import { onMounted, reactive } from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
||||||
import CombinationApi from "@/sheep/api/promotion/combination";
|
import CombinationApi from '@/sheep/api/promotion/combination';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
@ -7,7 +7,11 @@
|
|||||||
<detailSkeleton v-if="state.skeletonLoading" />
|
<detailSkeleton v-if="state.skeletonLoading" />
|
||||||
<!-- 下架/售罄提醒 -->
|
<!-- 下架/售罄提醒 -->
|
||||||
<s-empty
|
<s-empty
|
||||||
v-else-if="state.goodsInfo === null || state.activity.status !== 0 || state.activity.endTime < new Date().getTime()"
|
v-else-if="
|
||||||
|
state.goodsInfo === null ||
|
||||||
|
state.activity.status !== 0 ||
|
||||||
|
state.activity.endTime < new Date().getTime()
|
||||||
|
"
|
||||||
text="活动不存在或已结束"
|
text="活动不存在或已结束"
|
||||||
icon="/static/soldout-empty.png"
|
icon="/static/soldout-empty.png"
|
||||||
showAction
|
showAction
|
||||||
@ -47,10 +51,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex ss-row-between">
|
<view class="ss-flex ss-row-between">
|
||||||
<view
|
<view class="origin-price ss-flex ss-col-center" v-if="state.goodsInfo.price">
|
||||||
class="origin-price ss-flex ss-col-center"
|
|
||||||
v-if="state.goodsInfo.price"
|
|
||||||
>
|
|
||||||
单买价:
|
单买价:
|
||||||
<view class="origin-price-text">
|
<view class="origin-price-text">
|
||||||
{{ fen2yuan(state.goodsInfo.price) }}
|
{{ fen2yuan(state.goodsInfo.price) }}
|
||||||
@ -123,7 +124,9 @@
|
|||||||
"
|
"
|
||||||
:disabled="state.goodsInfo.stock === 0 || state.activity.status !== 0"
|
:disabled="state.goodsInfo.stock === 0 || state.activity.status !== 0"
|
||||||
>
|
>
|
||||||
<view class="btn-price">{{ fen2yuan(state.activity.price || state.goodsInfo.price) }}</view>
|
<view class="btn-price">{{
|
||||||
|
fen2yuan(state.activity.price || state.goodsInfo.price)
|
||||||
|
}}</view>
|
||||||
<view v-if="state.activity.startTime > new Date().getTime()">未开始</view>
|
<view v-if="state.activity.startTime > new Date().getTime()">未开始</view>
|
||||||
<view v-else-if="state.activity.endTime <= new Date().getTime()">已结束</view>
|
<view v-else-if="state.activity.endTime <= new Date().getTime()">已结束</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
@ -150,14 +153,12 @@
|
|||||||
import detailContentCard from './components/detail/detail-content-card.vue';
|
import detailContentCard from './components/detail/detail-content-card.vue';
|
||||||
import grouponCardList from './components/groupon/groupon-card-list.vue';
|
import grouponCardList from './components/groupon/groupon-card-list.vue';
|
||||||
import { useDurationTime, formatGoodsSwiper, fen2yuan } from '@/sheep/hooks/useGoods';
|
import { useDurationTime, formatGoodsSwiper, fen2yuan } from '@/sheep/hooks/useGoods';
|
||||||
import CombinationApi from "@/sheep/api/promotion/combination";
|
import CombinationApi from '@/sheep/api/promotion/combination';
|
||||||
import SpuApi from "@/sheep/api/product/spu";
|
import SpuApi from '@/sheep/api/product/spu';
|
||||||
|
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/goods/groupon-bg.png');
|
const headerBg = sheep.$url.css('/static/img/shop/goods/groupon-bg.png');
|
||||||
const btnBg = sheep.$url.css('/static/img/shop/goods/groupon-btn.png');
|
const btnBg = sheep.$url.css('/static/img/shop/goods/groupon-btn.png');
|
||||||
const disabledBtnBg = sheep.$url.css(
|
const disabledBtnBg = sheep.$url.css('/static/img/shop/goods/activity-btn-disabled.png');
|
||||||
'/static/img/shop/goods/activity-btn-disabled.png',
|
|
||||||
);
|
|
||||||
const grouponBg = sheep.$url.css('/static/img/shop/goods/groupon-tip-bg.png');
|
const grouponBg = sheep.$url.css('/static/img/shop/goods/groupon-tip-bg.png');
|
||||||
|
|
||||||
onPageScroll(() => {});
|
onPageScroll(() => {});
|
||||||
@ -261,7 +262,7 @@
|
|||||||
// 加载商品信息
|
// 加载商品信息
|
||||||
const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
|
const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
|
||||||
state.goodsId = spu.id;
|
state.goodsId = spu.id;
|
||||||
activity.products.forEach(product => {
|
activity.products.forEach((product) => {
|
||||||
spu.price = Math.min(spu.price, product.combinationPrice); // 设置 SPU 的最低价格
|
spu.price = Math.min(spu.price, product.combinationPrice); // 设置 SPU 的最低价格
|
||||||
});
|
});
|
||||||
// 关闭骨架屏
|
// 关闭骨架屏
|
||||||
@ -475,8 +476,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.groupon-box {
|
.groupon-box {
|
||||||
background: v-bind(grouponBg)
|
background: v-bind(grouponBg) no-repeat;
|
||||||
no-repeat;
|
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,13 +7,26 @@
|
|||||||
<!-- 骨架屏 -->
|
<!-- 骨架屏 -->
|
||||||
<detailSkeleton v-if="state.skeletonLoading" />
|
<detailSkeleton v-if="state.skeletonLoading" />
|
||||||
<!-- 下架/售罄提醒 -->
|
<!-- 下架/售罄提醒 -->
|
||||||
<s-empty v-else-if="state.goodsInfo === null" text="商品不存在或已下架" icon="/static/soldout-empty.png" showAction
|
<s-empty
|
||||||
actionText="再逛逛" actionUrl="/pages/goods/list" />
|
v-else-if="state.goodsInfo === null"
|
||||||
|
text="商品不存在或已下架"
|
||||||
|
icon="/static/soldout-empty.png"
|
||||||
|
showAction
|
||||||
|
actionText="再逛逛"
|
||||||
|
actionUrl="/pages/goods/list"
|
||||||
|
/>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<view class="detail-swiper-selector">
|
<view class="detail-swiper-selector">
|
||||||
<!-- 商品轮播图 -->
|
<!-- 商品轮播图 -->
|
||||||
<su-swiper class="ss-m-b-14" isPreview :list="formatGoodsSwiper(state.goodsInfo.sliderPicUrls)"
|
<su-swiper
|
||||||
otStyle="tag" imageMode="widthFix" dotCur="bg-mask-40" :seizeHeight="750" />
|
class="ss-m-b-14"
|
||||||
|
isPreview
|
||||||
|
:list="formatGoodsSwiper(state.goodsInfo.sliderPicUrls)"
|
||||||
|
otStyle="tag"
|
||||||
|
imageMode="widthFix"
|
||||||
|
dotCur="bg-mask-40"
|
||||||
|
:seizeHeight="750"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 价格+标题 -->
|
<!-- 价格+标题 -->
|
||||||
<view class="title-card detail-card ss-p-y-40 ss-p-x-20">
|
<view class="title-card detail-card ss-p-y-40 ss-p-x-20">
|
||||||
@ -34,16 +47,23 @@
|
|||||||
<!-- 满减送/限时折扣活动的提示 -->
|
<!-- 满减送/限时折扣活动的提示 -->
|
||||||
<div class="tag-content">
|
<div class="tag-content">
|
||||||
<view class="tag-box ss-flex">
|
<view class="tag-box ss-flex">
|
||||||
<view class="tag ss-m-r-10" v-for="promos in state.activityInfo"
|
<view
|
||||||
:key="promos.id" @tap="onActivity">
|
class="tag ss-m-r-10"
|
||||||
|
v-for="promos in state.activityInfo"
|
||||||
|
:key="promos.id"
|
||||||
|
@tap="onActivity"
|
||||||
|
>
|
||||||
{{ promos.name }}
|
{{ promos.name }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 优惠劵 -->
|
<!-- 优惠劵 -->
|
||||||
<view class="get-coupon-box ss-flex ss-col-center ss-m-l-20" @tap="state.showModel = true"
|
<view
|
||||||
v-if="state.couponInfo.length">
|
class="get-coupon-box ss-flex ss-col-center ss-m-l-20"
|
||||||
|
@tap="state.showModel = true"
|
||||||
|
v-if="state.couponInfo.length"
|
||||||
|
>
|
||||||
<view class="discounts-title ss-m-r-8">领券</view>
|
<view class="discounts-title ss-m-r-8">领券</view>
|
||||||
<text class="cicon-forward"></text>
|
<text class="cicon-forward"></text>
|
||||||
</view>
|
</view>
|
||||||
@ -54,30 +74,51 @@
|
|||||||
|
|
||||||
<!-- 功能卡片 -->
|
<!-- 功能卡片 -->
|
||||||
<view class="detail-cell-card detail-card ss-flex-col">
|
<view class="detail-cell-card detail-card ss-flex-col">
|
||||||
<detail-cell-sku v-model="state.selectedSku.goods_sku_text" :sku="state.selectedSku"
|
<detail-cell-sku
|
||||||
@tap="state.showSelectSku = true" />
|
v-model="state.selectedSku.goods_sku_text"
|
||||||
|
:sku="state.selectedSku"
|
||||||
|
@tap="state.showSelectSku = true"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 规格与数量弹框 -->
|
<!-- 规格与数量弹框 -->
|
||||||
<s-select-sku :goodsInfo="state.goodsInfo" :show="state.showSelectSku" @addCart="onAddCart"
|
<s-select-sku
|
||||||
@buy="onBuy" @change="onSkuChange" @close="state.showSelectSku = false" />
|
:goodsInfo="state.goodsInfo"
|
||||||
|
:show="state.showSelectSku"
|
||||||
|
@addCart="onAddCart"
|
||||||
|
@buy="onBuy"
|
||||||
|
@change="onSkuChange"
|
||||||
|
@close="state.showSelectSku = false"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 评价 -->
|
<!-- 评价 -->
|
||||||
<detail-comment-card class="detail-comment-selector" :goodsId="state.goodsId" />
|
<detail-comment-card class="detail-comment-selector" :goodsId="state.goodsId" />
|
||||||
<!-- 详情 -->
|
<!-- 详情 -->
|
||||||
<detail-content-card class="detail-content-selector" :content="state.goodsInfo.description" />
|
<detail-content-card
|
||||||
|
class="detail-content-selector"
|
||||||
|
:content="state.goodsInfo.description"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 活动跳转:拼团/秒杀/砍价活动 -->
|
<!-- 活动跳转:拼团/秒杀/砍价活动 -->
|
||||||
<detail-activity-tip v-if="state.activityList.length > 0" :activity-list="state.activityList" />
|
<detail-activity-tip
|
||||||
|
v-if="state.activityList.length > 0"
|
||||||
|
:activity-list="state.activityList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 详情 tabbar -->
|
<!-- 详情 tabbar -->
|
||||||
<detail-tabbar v-model="state.goodsInfo">
|
<detail-tabbar v-model="state.goodsInfo">
|
||||||
<view class="buy-box ss-flex ss-col-center ss-p-r-20" v-if="state.goodsInfo.stock > 0">
|
<view class="buy-box ss-flex ss-col-center ss-p-r-20" v-if="state.goodsInfo.stock > 0">
|
||||||
<button class="ss-reset-button add-btn ui-Shadow-Main" @tap="state.showSelectSku = true">
|
<button
|
||||||
|
class="ss-reset-button add-btn ui-Shadow-Main"
|
||||||
|
@tap="state.showSelectSku = true"
|
||||||
|
>
|
||||||
加入购物车
|
加入购物车
|
||||||
</button>
|
</button>
|
||||||
<button class="ss-reset-button buy-btn ui-Shadow-Main" @tap="state.showSelectSku = true">
|
<button
|
||||||
|
class="ss-reset-button buy-btn ui-Shadow-Main"
|
||||||
|
@tap="state.showSelectSku = true"
|
||||||
|
>
|
||||||
立即购买
|
立即购买
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -87,12 +128,19 @@
|
|||||||
</detail-tabbar>
|
</detail-tabbar>
|
||||||
|
|
||||||
<!-- 优惠劵弹窗 -->
|
<!-- 优惠劵弹窗 -->
|
||||||
<s-coupon-get v-model="state.couponInfo" :show="state.showModel" @close="state.showModel = false"
|
<s-coupon-get
|
||||||
@get="onGet" />
|
v-model="state.couponInfo"
|
||||||
|
:show="state.showModel"
|
||||||
|
@close="state.showModel = false"
|
||||||
|
@get="onGet"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 满减送/限时折扣活动弹窗 -->
|
<!-- 满减送/限时折扣活动弹窗 -->
|
||||||
<s-activity-pop v-model="state.activityInfo" :show="state.showActivityModel"
|
<s-activity-pop
|
||||||
@close="state.showActivityModel = false" />
|
v-model="state.activityInfo"
|
||||||
|
:show="state.showActivityModel"
|
||||||
|
@close="state.showActivityModel = false"
|
||||||
|
/>
|
||||||
</block>
|
</block>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</view>
|
</view>
|
||||||
@ -154,10 +202,12 @@
|
|||||||
}
|
}
|
||||||
sheep.$router.go('/pages/order/confirm', {
|
sheep.$router.go('/pages/order/confirm', {
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
items: [{
|
items: [
|
||||||
|
{
|
||||||
skuId: e.id,
|
skuId: e.id,
|
||||||
count: e.goods_num
|
count: e.goods_num,
|
||||||
}],
|
},
|
||||||
|
],
|
||||||
// TODO 芋艿:后续清理掉这 2 参数
|
// TODO 芋艿:后续清理掉这 2 参数
|
||||||
deliveryType: 1,
|
deliveryType: 1,
|
||||||
pointStatus: false,
|
pointStatus: false,
|
||||||
@ -187,7 +237,8 @@
|
|||||||
// TODO 芋艿:待测试
|
// TODO 芋艿:待测试
|
||||||
const shareInfo = computed(() => {
|
const shareInfo = computed(() => {
|
||||||
if (isEmpty(state.goodsInfo)) return {};
|
if (isEmpty(state.goodsInfo)) return {};
|
||||||
return sheep.$platform.share.getShareInfo({
|
return sheep.$platform.share.getShareInfo(
|
||||||
|
{
|
||||||
title: state.goodsInfo.name,
|
title: state.goodsInfo.name,
|
||||||
image: sheep.$url.cdn(state.goodsInfo.picUrl),
|
image: sheep.$url.cdn(state.goodsInfo.picUrl),
|
||||||
desc: state.goodsInfo.introduction,
|
desc: state.goodsInfo.introduction,
|
||||||
@ -195,13 +246,15 @@
|
|||||||
page: '2',
|
page: '2',
|
||||||
query: state.goodsInfo.id,
|
query: state.goodsInfo.id,
|
||||||
},
|
},
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
type: 'goods', // 商品海报
|
type: 'goods', // 商品海报
|
||||||
title: state.goodsInfo.name, // 商品名称
|
title: state.goodsInfo.name, // 商品名称
|
||||||
image: sheep.$url.cdn(state.goodsInfo.picUrl), // 商品主图
|
image: sheep.$url.cdn(state.goodsInfo.picUrl), // 商品主图
|
||||||
price: fen2yuan(state.goodsInfo.price), // 商品价格
|
price: fen2yuan(state.goodsInfo.price), // 商品价格
|
||||||
original_price: fen2yuan(state.goodsInfo.marketPrice), // 商品原价
|
original_price: fen2yuan(state.goodsInfo.marketPrice), // 商品原价
|
||||||
});
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getCoupon() {
|
async function getCoupon() {
|
||||||
@ -248,15 +301,18 @@
|
|||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res.data.forEach(activity => {
|
res.data.forEach((activity) => {
|
||||||
if ([1, 2, 3].includes(activity.type)) { // 情况一:拼团/秒杀/砍价
|
if ([1, 2, 3].includes(activity.type)) {
|
||||||
|
// 情况一:拼团/秒杀/砍价
|
||||||
state.activityList.push(activity);
|
state.activityList.push(activity);
|
||||||
} else if (activity.type === 5) { // 情况二:满减送
|
} else if (activity.type === 5) {
|
||||||
|
// 情况二:满减送
|
||||||
state.activityInfo.push(activity);
|
state.activityInfo.push(activity);
|
||||||
} else { // 情况三:限时折扣 TODO 芋艿
|
} else {
|
||||||
|
// 情况三:限时折扣 TODO 芋艿
|
||||||
console.log('待实现!优先级不高');
|
console.log('待实现!优先级不高');
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,12 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-layout navbar="normal" :leftWidth="0" :rightWidth="0" tools="search" :defaultSearch="state.keyword"
|
<s-layout
|
||||||
@search="onSearch">
|
navbar="normal"
|
||||||
|
:leftWidth="0"
|
||||||
|
:rightWidth="0"
|
||||||
|
tools="search"
|
||||||
|
:defaultSearch="state.keyword"
|
||||||
|
@search="onSearch"
|
||||||
|
>
|
||||||
<!-- 筛选 -->
|
<!-- 筛选 -->
|
||||||
<su-sticky bgColor="#fff">
|
<su-sticky bgColor="#fff">
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<view class="ss-flex-1">
|
<view class="ss-flex-1">
|
||||||
<su-tabs :list="state.tabList" :scrollable="false" @change="onTabsChange"
|
<su-tabs
|
||||||
:current="state.currentTab" />
|
:list="state.tabList"
|
||||||
|
:scrollable="false"
|
||||||
|
@change="onTabsChange"
|
||||||
|
:current="state.currentTab"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="list-icon" @tap="state.iconStatus = !state.iconStatus">
|
<view class="list-icon" @tap="state.iconStatus = !state.iconStatus">
|
||||||
<text v-if="state.iconStatus" class="sicon-goods-list" />
|
<text v-if="state.iconStatus" class="sicon-goods-list" />
|
||||||
@ -16,12 +26,23 @@
|
|||||||
</su-sticky>
|
</su-sticky>
|
||||||
|
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<su-popup :show="state.showFilter" type="top" round="10" :space="sys_navBar + 38" backgroundColor="#F6F6F6"
|
<su-popup
|
||||||
:zIndex="10" @close="state.showFilter = false">
|
:show="state.showFilter"
|
||||||
|
type="top"
|
||||||
|
round="10"
|
||||||
|
:space="sys_navBar + 38"
|
||||||
|
backgroundColor="#F6F6F6"
|
||||||
|
:zIndex="10"
|
||||||
|
@close="state.showFilter = false"
|
||||||
|
>
|
||||||
<view class="filter-list-box">
|
<view class="filter-list-box">
|
||||||
<view class="filter-item" v-for="(item, index) in state.tabList[state.currentTab].list"
|
<view
|
||||||
:key="item.value" :class="[{ 'filter-item-active': index === state.curFilter }]"
|
class="filter-item"
|
||||||
@tap="onFilterItem(index)">
|
v-for="(item, index) in state.tabList[state.currentTab].list"
|
||||||
|
:key="item.value"
|
||||||
|
:class="[{ 'filter-item-active': index === state.curFilter }]"
|
||||||
|
@tap="onFilterItem(index)"
|
||||||
|
>
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -29,7 +50,11 @@
|
|||||||
|
|
||||||
<!-- 情况一:单列布局 -->
|
<!-- 情况一:单列布局 -->
|
||||||
<view v-if="state.iconStatus && state.pagination.total > 0" class="goods-list ss-m-t-20">
|
<view v-if="state.iconStatus && state.pagination.total > 0" class="goods-list ss-m-t-20">
|
||||||
<view class="ss-p-l-20 ss-p-r-20 ss-m-b-20" v-for="item in state.pagination.list" :key="item.id">
|
<view
|
||||||
|
class="ss-p-l-20 ss-p-r-20 ss-m-b-20"
|
||||||
|
v-for="item in state.pagination.list"
|
||||||
|
:key="item.id"
|
||||||
|
>
|
||||||
<s-goods-column
|
<s-goods-column
|
||||||
class=""
|
class=""
|
||||||
size="lg"
|
size="lg"
|
||||||
@ -41,8 +66,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 情况二:双列布局 -->
|
<!-- 情况二:双列布局 -->
|
||||||
<view v-if="!state.iconStatus && state.pagination.total > 0"
|
<view
|
||||||
class="ss-flex ss-flex-wrap ss-p-x-20 ss-m-t-20 ss-col-top">
|
v-if="!state.iconStatus && state.pagination.total > 0"
|
||||||
|
class="ss-flex ss-flex-wrap ss-p-x-20 ss-m-t-20 ss-col-top"
|
||||||
|
>
|
||||||
<view class="goods-list-box">
|
<view class="goods-list-box">
|
||||||
<view class="left-list" v-for="item in state.leftGoodsList" :key="item.id">
|
<view class="left-list" v-for="item in state.leftGoodsList" :key="item.id">
|
||||||
<s-goods-column
|
<s-goods-column
|
||||||
@ -78,9 +105,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
|
<uni-load-more
|
||||||
|
v-if="state.pagination.total > 0"
|
||||||
|
:status="state.loadStatus"
|
||||||
|
:content-text="{
|
||||||
contentdown: '上拉加载更多',
|
contentdown: '上拉加载更多',
|
||||||
}" @tap="loadMore" />
|
}"
|
||||||
|
@tap="loadMore"
|
||||||
|
/>
|
||||||
<s-empty v-if="state.pagination.total === 0" icon="/static/soldout-empty.png" text="暂无商品" />
|
<s-empty v-if="state.pagination.total === 0" icon="/static/soldout-empty.png" text="暂无商品" />
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
@ -111,10 +143,12 @@
|
|||||||
iconStatus: false, // true - 单列布局;false - 双列布局
|
iconStatus: false, // true - 单列布局;false - 双列布局
|
||||||
keyword: '',
|
keyword: '',
|
||||||
categoryId: 0,
|
categoryId: 0,
|
||||||
tabList: [{
|
tabList: [
|
||||||
|
{
|
||||||
name: '综合推荐',
|
name: '综合推荐',
|
||||||
list: [{
|
list: [
|
||||||
label: '综合推荐'
|
{
|
||||||
|
label: '综合推荐',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '价格升序',
|
label: '价格升序',
|
||||||
@ -131,12 +165,12 @@
|
|||||||
{
|
{
|
||||||
name: '销量',
|
name: '销量',
|
||||||
sort: 'salesCount',
|
sort: 'salesCount',
|
||||||
order: false
|
order: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '新品优先',
|
name: '新品优先',
|
||||||
value: 'createTime',
|
value: 'createTime',
|
||||||
order: false
|
order: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
loadStatus: '',
|
loadStatus: '',
|
||||||
@ -211,8 +245,10 @@
|
|||||||
const onFilterItem = (val) => {
|
const onFilterItem = (val) => {
|
||||||
// 如果点击的是当前的筛选项,则直接收起筛选项,不要加载数据
|
// 如果点击的是当前的筛选项,则直接收起筛选项,不要加载数据
|
||||||
// 这里选择 tabList[0] 的原因,是目前只有它有 list
|
// 这里选择 tabList[0] 的原因,是目前只有它有 list
|
||||||
if (state.currentSort === state.tabList[0].list[val].sort
|
if (
|
||||||
&& state.currentOrder === state.tabList[0].list[val].order) {
|
state.currentSort === state.tabList[0].list[val].sort &&
|
||||||
|
state.currentOrder === state.tabList[0].list[val].order
|
||||||
|
) {
|
||||||
state.showFilter = false;
|
state.showFilter = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -226,7 +262,7 @@
|
|||||||
// 清空 + 加载数据
|
// 清空 + 加载数据
|
||||||
emptyList();
|
emptyList();
|
||||||
getList();
|
getList();
|
||||||
}
|
};
|
||||||
|
|
||||||
async function getList() {
|
async function getList() {
|
||||||
state.loadStatus = 'loading';
|
state.loadStatus = 'loading';
|
||||||
@ -241,7 +277,7 @@
|
|||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.pagination.list = _.concat(state.pagination.list, data.list)
|
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||||
state.pagination.total = data.total;
|
state.pagination.total = data.total;
|
||||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||||
mountMasonry();
|
mountMasonry();
|
||||||
|
@ -69,10 +69,7 @@
|
|||||||
|
|
||||||
<!-- 功能卡片 -->
|
<!-- 功能卡片 -->
|
||||||
<view class="detail-cell-card detail-card ss-flex-col">
|
<view class="detail-cell-card detail-card ss-flex-col">
|
||||||
<detail-cell-sku
|
<detail-cell-sku :sku="state.selectedSku" @tap="state.showSelectSku = true" />
|
||||||
:sku="state.selectedSku"
|
|
||||||
@tap="state.showSelectSku = true"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 规格与数量弹框 -->
|
<!-- 规格与数量弹框 -->
|
||||||
<s-select-seckill-sku
|
<s-select-seckill-sku
|
||||||
@ -107,7 +104,9 @@
|
|||||||
<button v-else class="ss-reset-button origin-price-btn ss-flex-col">
|
<button v-else class="ss-reset-button origin-price-btn ss-flex-col">
|
||||||
<view
|
<view
|
||||||
class="no-original"
|
class="no-original"
|
||||||
:class="state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED ? '' : ''"
|
:class="
|
||||||
|
state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED ? '' : ''
|
||||||
|
"
|
||||||
>
|
>
|
||||||
秒杀价
|
秒杀价
|
||||||
</view>
|
</view>
|
||||||
@ -148,15 +147,13 @@
|
|||||||
import detailCommentCard from './components/detail/detail-comment-card.vue';
|
import detailCommentCard from './components/detail/detail-comment-card.vue';
|
||||||
import detailContentCard from './components/detail/detail-content-card.vue';
|
import detailContentCard from './components/detail/detail-content-card.vue';
|
||||||
import detailProgress from './components/detail/detail-progress.vue';
|
import detailProgress from './components/detail/detail-progress.vue';
|
||||||
import SeckillApi from "@/sheep/api/promotion/seckill";
|
import SeckillApi from '@/sheep/api/promotion/seckill';
|
||||||
import SpuApi from "@/sheep/api/product/spu";
|
import SpuApi from '@/sheep/api/product/spu';
|
||||||
import {getTimeStatusEnum, TimeStatusEnum} from "@/sheep/util/const";
|
import { getTimeStatusEnum, TimeStatusEnum } from '@/sheep/util/const';
|
||||||
|
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-bg.png');
|
const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-bg.png');
|
||||||
const btnBg = sheep.$url.css('/static/img/shop/goods/seckill-btn.png');
|
const btnBg = sheep.$url.css('/static/img/shop/goods/seckill-btn.png');
|
||||||
const disabledBtnBg = sheep.$url.css(
|
const disabledBtnBg = sheep.$url.css('/static/img/shop/goods/activity-btn-disabled.png');
|
||||||
'/static/img/shop/goods/activity-btn-disabled.png',
|
|
||||||
);
|
|
||||||
const seckillBg = sheep.$url.css('/static/img/shop/goods/seckill-tip-bg.png');
|
const seckillBg = sheep.$url.css('/static/img/shop/goods/seckill-tip-bg.png');
|
||||||
const grouponBg = sheep.$url.css('/static/img/shop/goods/groupon-tip-bg.png');
|
const grouponBg = sheep.$url.css('/static/img/shop/goods/groupon-tip-bg.png');
|
||||||
|
|
||||||
@ -221,36 +218,40 @@
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const activity = ref()
|
const activity = ref();
|
||||||
const timeStatusEnum = ref('')
|
const timeStatusEnum = ref('');
|
||||||
// 查询活动
|
// 查询活动
|
||||||
const getActivity = async (id) => {
|
const getActivity = async (id) => {
|
||||||
const { data } = await SeckillApi.getSeckillActivity(id)
|
const { data } = await SeckillApi.getSeckillActivity(id);
|
||||||
activity.value = data
|
activity.value = data;
|
||||||
timeStatusEnum.value = getTimeStatusEnum(activity.startTime, activity.endTime)
|
timeStatusEnum.value = getTimeStatusEnum(activity.startTime, activity.endTime);
|
||||||
|
|
||||||
// 查询商品
|
// 查询商品
|
||||||
await getSpu(data.spuId)
|
await getSpu(data.spuId);
|
||||||
}
|
};
|
||||||
|
|
||||||
const getSpu = async (id) => {
|
const getSpu = async (id) => {
|
||||||
const { data } = await SpuApi.getSpuDetail(id)
|
const { data } = await SpuApi.getSpuDetail(id);
|
||||||
// 模拟
|
// 模拟
|
||||||
data.activity_type = 'seckill'
|
data.activity_type = 'seckill';
|
||||||
state.goodsInfo = data
|
state.goodsInfo = data;
|
||||||
// 处理轮播图
|
// 处理轮播图
|
||||||
state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.sliderPicUrls);
|
state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.sliderPicUrls);
|
||||||
|
|
||||||
// 默认显示最低价
|
// 默认显示最低价
|
||||||
state.goodsInfo.price = min([state.goodsInfo.price, ...activity.value.products.map(spu => spu.seckillPrice)])
|
state.goodsInfo.price = min([
|
||||||
|
state.goodsInfo.price,
|
||||||
|
...activity.value.products.map((spu) => spu.seckillPrice),
|
||||||
|
]);
|
||||||
|
|
||||||
// 价格、库存使用活动的
|
// 价格、库存使用活动的
|
||||||
data.skus.forEach(sku => {
|
data.skus.forEach((sku) => {
|
||||||
const product = activity.value.products.find(product => product.skuId === sku.id);
|
const product = activity.value.products.find((product) => product.skuId === sku.id);
|
||||||
if (product) {
|
if (product) {
|
||||||
sku.price = product.seckillPrice;
|
sku.price = product.seckillPrice;
|
||||||
sku.stock = Math.min(sku.stock, product.stock);
|
sku.stock = Math.min(sku.stock, product.stock);
|
||||||
} else { // 找不到可能是没配置,则不能发起秒杀
|
} else {
|
||||||
|
// 找不到可能是没配置,则不能发起秒杀
|
||||||
sku.stock = 0;
|
sku.stock = 0;
|
||||||
}
|
}
|
||||||
// 设置限购数量
|
// 设置限购数量
|
||||||
@ -264,7 +265,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
state.skeletonLoading = false;
|
state.skeletonLoading = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
// 非法参数
|
// 非法参数
|
||||||
@ -274,7 +275,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询活动
|
// 查询活动
|
||||||
getActivity(options.id)
|
getActivity(options.id);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-layout title="购物车" tabbar="/pages/index/cart" :bgStyle="{ color: '#fff' }">
|
<s-layout title="购物车" tabbar="/pages/index/cart" :bgStyle="{ color: '#fff' }">
|
||||||
<s-empty v-if="state.list.length === 0" text="购物车空空如也,快去逛逛吧~" icon="/static/cart-empty.png" />
|
<s-empty
|
||||||
|
v-if="state.list.length === 0"
|
||||||
|
text="购物车空空如也,快去逛逛吧~"
|
||||||
|
icon="/static/cart-empty.png"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 头部 -->
|
<!-- 头部 -->
|
||||||
<view class="cart-box ss-flex ss-flex-col ss-row-between" v-if="state.list.length">
|
<view class="cart-box ss-flex ss-flex-col ss-row-between" v-if="state.list.length">
|
||||||
@ -24,15 +28,35 @@
|
|||||||
<view class="goods-box ss-r-10 ss-m-b-14" v-for="item in state.list" :key="item.id">
|
<view class="goods-box ss-r-10 ss-m-b-14" v-for="item in state.list" :key="item.id">
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<label class="check-box ss-flex ss-col-center ss-p-l-10" @tap="onSelectSingle(item.id)">
|
<label class="check-box ss-flex ss-col-center ss-p-l-10" @tap="onSelectSingle(item.id)">
|
||||||
<radio :checked="state.selectedIds.includes(item.id)" color="var(--ui-BG-Main)"
|
<radio
|
||||||
style="transform: scale(0.8)" @tap.stop="onSelectSingle(item.id)" />
|
:checked="state.selectedIds.includes(item.id)"
|
||||||
|
color="var(--ui-BG-Main)"
|
||||||
|
style="transform: scale(0.8)"
|
||||||
|
@tap.stop="onSelectSingle(item.id)"
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
<s-goods-item :title="item.spu.name" :img="item.spu.picUrl || item.goods.image"
|
<s-goods-item
|
||||||
|
:title="item.spu.name"
|
||||||
|
:img="item.spu.picUrl || item.goods.image"
|
||||||
:price="item.sku.price"
|
:price="item.sku.price"
|
||||||
:skuText="item.sku.properties.length>1? item.sku.properties.reduce((items2,items)=>items2.valueName+' '+items.valueName):item.sku.properties[0].valueName"
|
:skuText="
|
||||||
priceColor="#FF3000" :titleWidth="400">
|
item.sku.properties.length > 1
|
||||||
|
? item.sku.properties.reduce(
|
||||||
|
(items2, items) => items2.valueName + ' ' + items.valueName,
|
||||||
|
)
|
||||||
|
: item.sku.properties[0].valueName
|
||||||
|
"
|
||||||
|
priceColor="#FF3000"
|
||||||
|
:titleWidth="400"
|
||||||
|
>
|
||||||
<template v-if="!state.editMode" v-slot:tool>
|
<template v-if="!state.editMode" v-slot:tool>
|
||||||
<su-number-box :min="0" :max="item.sku.stock" :step="1" v-model="item.count" @change="onNumberChange($event, item)" />
|
<su-number-box
|
||||||
|
:min="0"
|
||||||
|
:max="item.sku.stock"
|
||||||
|
:step="1"
|
||||||
|
v-model="item.count"
|
||||||
|
@change="onNumberChange($event, item)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</s-goods-item>
|
</s-goods-item>
|
||||||
</view>
|
</view>
|
||||||
@ -43,8 +67,12 @@
|
|||||||
<view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom">
|
<view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom">
|
||||||
<view class="footer-left ss-flex ss-col-center">
|
<view class="footer-left ss-flex ss-col-center">
|
||||||
<label class="check-box ss-flex ss-col-center ss-p-r-30" @tap="onSelectAll">
|
<label class="check-box ss-flex ss-col-center ss-p-r-30" @tap="onSelectAll">
|
||||||
<radio :checked="state.isAllSelected" color="var(--ui-BG-Main)"
|
<radio
|
||||||
style="transform: scale(0.8)" @tap.stop="onSelectAll" />
|
:checked="state.isAllSelected"
|
||||||
|
color="var(--ui-BG-Main)"
|
||||||
|
style="transform: scale(0.8)"
|
||||||
|
@tap.stop="onSelectAll"
|
||||||
|
/>
|
||||||
<view class="ss-m-l-8"> 全选 </view>
|
<view class="ss-m-l-8"> 全选 </view>
|
||||||
</label>
|
</label>
|
||||||
<text>合计:</text>
|
<text>合计:</text>
|
||||||
@ -53,12 +81,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer-right">
|
<view class="footer-right">
|
||||||
<button v-if="state.editMode" class="ss-reset-button ui-BG-Main-Gradient pay-btn ui-Shadow-Main"
|
<button
|
||||||
@tap="onDelete">
|
v-if="state.editMode"
|
||||||
|
class="ss-reset-button ui-BG-Main-Gradient pay-btn ui-Shadow-Main"
|
||||||
|
@tap="onDelete"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
<button v-else class="ss-reset-button ui-BG-Main-Gradient pay-btn ui-Shadow-Main"
|
<button
|
||||||
@tap="onConfirm">
|
v-else
|
||||||
|
class="ss-reset-button ui-BG-Main-Gradient pay-btn ui-Shadow-Main"
|
||||||
|
@tap="onConfirm"
|
||||||
|
>
|
||||||
去结算
|
去结算
|
||||||
{{ state.selectedIds?.length ? `(${state.selectedIds.length})` : '' }}
|
{{ state.selectedIds?.length ? `(${state.selectedIds.length})` : '' }}
|
||||||
</button>
|
</button>
|
||||||
@ -98,7 +132,7 @@
|
|||||||
|
|
||||||
// 结算
|
// 结算
|
||||||
function onConfirm() {
|
function onConfirm() {
|
||||||
let items = []
|
let items = [];
|
||||||
let goods_list = [];
|
let goods_list = [];
|
||||||
state.selectedList = state.list.filter((item) => state.selectedIds.includes(item.id));
|
state.selectedList = state.list.filter((item) => state.selectedIds.includes(item.id));
|
||||||
state.selectedList.map((item) => {
|
state.selectedList.map((item) => {
|
||||||
@ -107,7 +141,7 @@
|
|||||||
skuId: item.sku.id,
|
skuId: item.sku.id,
|
||||||
count: item.count,
|
count: item.count,
|
||||||
cartId: item.id,
|
cartId: item.id,
|
||||||
})
|
});
|
||||||
goods_list.push({
|
goods_list.push({
|
||||||
// goods_id: item.goods_id,
|
// goods_id: item.goods_id,
|
||||||
goods_id: item.spu.id,
|
goods_id: item.spu.id,
|
||||||
|
@ -1,9 +1,19 @@
|
|||||||
<!-- 首页,支持店铺装修 -->
|
<!-- 首页,支持店铺装修 -->
|
||||||
<template>
|
<template>
|
||||||
<view v-if="template">
|
<view v-if="template">
|
||||||
<s-layout title="首页" navbar="custom" tabbar="/pages/index/index" :bgStyle="template.page"
|
<s-layout
|
||||||
:navbarStyle="template.navigationBar" onShareAppMessage>
|
title="首页"
|
||||||
<s-block v-for="(item, index) in template.components" :key="index" :styles="item.property.style">
|
navbar="custom"
|
||||||
|
tabbar="/pages/index/index"
|
||||||
|
:bgStyle="template.page"
|
||||||
|
:navbarStyle="template.navigationBar"
|
||||||
|
onShareAppMessage
|
||||||
|
>
|
||||||
|
<s-block
|
||||||
|
v-for="(item, index) in template.components"
|
||||||
|
:key="index"
|
||||||
|
:styles="item.property.style"
|
||||||
|
>
|
||||||
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
|
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
|
||||||
</s-block>
|
</s-block>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
@ -11,14 +21,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { computed } from 'vue';
|
||||||
computed
|
import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
onLoad,
|
|
||||||
onPageScroll,
|
|
||||||
onPullDownRefresh
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import $share from '@/sheep/platform/share';
|
import $share from '@/sheep/platform/share';
|
||||||
// 隐藏原生tabBar
|
// 隐藏原生tabBar
|
||||||
@ -47,13 +51,12 @@
|
|||||||
// })
|
// })
|
||||||
// }())
|
// }())
|
||||||
|
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
// 小程序识别二维码
|
// 小程序识别二维码
|
||||||
if (options.scene) {
|
if (options.scene) {
|
||||||
const sceneParams = decodeURIComponent(options.scene).split('=');
|
const sceneParams = decodeURIComponent(options.scene).split('=');
|
||||||
console.log("sceneParams=>",sceneParams);
|
console.log('sceneParams=>', sceneParams);
|
||||||
options[sceneParams[0]] = sceneParams[1];
|
options[sceneParams[0]] = sceneParams[1];
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
const event = options.event;
|
const event = options.event;
|
||||||
const code = options.code;
|
const code = options.code;
|
||||||
const state = options.state;
|
const state = options.state;
|
||||||
if (event === 'login') { // 场景一:登录
|
if (event === 'login') {
|
||||||
|
// 场景一:登录
|
||||||
const res = await sheep.$platform.useProvider().login(code, state);
|
const res = await sheep.$platform.useProvider().login(code, state);
|
||||||
} else if (event === 'bind') { // 场景二:绑定
|
} else if (event === 'bind') {
|
||||||
|
// 场景二:绑定
|
||||||
sheep.$platform.useProvider().bind(code, state);
|
sheep.$platform.useProvider().bind(code, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
page: {},
|
page: {},
|
||||||
});
|
});
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
let id = options.id
|
let id = options.id;
|
||||||
|
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
// 小程序预览自定义页面
|
// 小程序预览自定义页面
|
||||||
|
@ -8,7 +8,11 @@
|
|||||||
:navbarStyle="template.navigationBar"
|
:navbarStyle="template.navigationBar"
|
||||||
onShareAppMessage
|
onShareAppMessage
|
||||||
>
|
>
|
||||||
<s-block v-for="(item, index) in template.components" :key="index" :styles="item.property.style">
|
<s-block
|
||||||
|
v-for="(item, index) in template.components"
|
||||||
|
:key="index"
|
||||||
|
:styles="item.property.style"
|
||||||
|
>
|
||||||
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
|
<s-block-item :type="item.id" :data="item.property" :styles="item.property.style" />
|
||||||
</s-block>
|
</s-block>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
|
@ -98,11 +98,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="modal-content content_box">
|
<view class="modal-content content_box">
|
||||||
<radio-group @change="onChange">
|
<radio-group @change="onChange">
|
||||||
<label
|
<label class="radio ss-flex ss-col-center" v-for="item in state.reasonList" :key="item">
|
||||||
class="radio ss-flex ss-col-center"
|
|
||||||
v-for="item in state.reasonList"
|
|
||||||
:key="item"
|
|
||||||
>
|
|
||||||
<view class="ss-flex-1 ss-p-20">{{ item }}</view>
|
<view class="ss-flex-1 ss-p-20">{{ item }}</view>
|
||||||
<radio
|
<radio
|
||||||
:value="item"
|
:value="item"
|
||||||
@ -152,7 +148,7 @@
|
|||||||
],
|
],
|
||||||
reasonList: [], // 可选的申请原因数组
|
reasonList: [], // 可选的申请原因数组
|
||||||
showModal: false, // 是否显示申请原因弹窗
|
showModal: false, // 是否显示申请原因弹窗
|
||||||
currentValue: '' // 当前选择的售后原因
|
currentValue: '', // 当前选择的售后原因
|
||||||
});
|
});
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
way: '',
|
way: '',
|
||||||
|
@ -3,24 +3,38 @@
|
|||||||
<s-layout title="售后详情" :navbar="!isEmpty(state.info) && state.loading ? 'inner' : 'normal'">
|
<s-layout title="售后详情" :navbar="!isEmpty(state.info) && state.loading ? 'inner' : 'normal'">
|
||||||
<view class="content_box" v-if="!isEmpty(state.info) && state.loading">
|
<view class="content_box" v-if="!isEmpty(state.info) && state.loading">
|
||||||
<!-- 步骤条 -->
|
<!-- 步骤条 -->
|
||||||
<view class="steps-box ss-flex" :style="[
|
<view
|
||||||
|
class="steps-box ss-flex"
|
||||||
|
:style="[
|
||||||
{
|
{
|
||||||
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
||||||
paddingTop: Number(statusBarHeight + 88) + 'rpx',
|
paddingTop: Number(statusBarHeight + 88) + 'rpx',
|
||||||
},
|
},
|
||||||
]">
|
]"
|
||||||
|
>
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<view class="steps-item" v-for="(item, index) in state.list" :key="index">
|
<view class="steps-item" v-for="(item, index) in state.list" :key="index">
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<text class="sicon-circleclose"
|
<text
|
||||||
v-if="state.list.length - 1 === index && [61, 62, 63].includes(state.info.status)" />
|
class="sicon-circleclose"
|
||||||
<text class="sicon-circlecheck" v-else
|
v-if="state.list.length - 1 === index && [61, 62, 63].includes(state.info.status)"
|
||||||
:class="state.active >= index ? 'activity-color' : 'info-color'" />
|
/>
|
||||||
|
<text
|
||||||
|
class="sicon-circlecheck"
|
||||||
|
v-else
|
||||||
|
:class="state.active >= index ? 'activity-color' : 'info-color'"
|
||||||
|
/>
|
||||||
|
|
||||||
<view v-if="state.list.length - 1 !== index" class="line"
|
<view
|
||||||
:class="state.active >= index ? 'activity-bg' : 'info-bg'" />
|
v-if="state.list.length - 1 !== index"
|
||||||
|
class="line"
|
||||||
|
:class="state.active >= index ? 'activity-bg' : 'info-bg'"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="steps-item-title" :class="state.active >= index ? 'activity-color' : 'info-color'">
|
<view
|
||||||
|
class="steps-item-title"
|
||||||
|
:class="state.active >= index ? 'activity-color' : 'info-color'"
|
||||||
|
>
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -28,8 +42,10 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 服务状态 -->
|
<!-- 服务状态 -->
|
||||||
<view class="status-box ss-flex ss-col-center ss-row-between ss-m-x-20"
|
<view
|
||||||
@tap="sheep.$router.go('/pages/order/aftersale/log', { id: state.id })">
|
class="status-box ss-flex ss-col-center ss-row-between ss-m-x-20"
|
||||||
|
@tap="sheep.$router.go('/pages/order/aftersale/log', { id: state.id })"
|
||||||
|
>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="status-text">
|
<view class="status-text">
|
||||||
{{ formatAfterSaleStatusDescription(state.info) }}
|
{{ formatAfterSaleStatusDescription(state.info) }}
|
||||||
@ -86,18 +102,31 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 操作区 -->
|
<!-- 操作区 -->
|
||||||
<s-empty v-if="isEmpty(state.info) && state.loading" icon="/static/order-empty.png" text="暂无该订单售后详情" />
|
<s-empty
|
||||||
|
v-if="isEmpty(state.info) && state.loading"
|
||||||
|
icon="/static/order-empty.png"
|
||||||
|
text="暂无该订单售后详情"
|
||||||
|
/>
|
||||||
<su-fixed bottom placeholder bg="bg-white" v-if="!isEmpty(state.info)">
|
<su-fixed bottom placeholder bg="bg-white" v-if="!isEmpty(state.info)">
|
||||||
<view class="foot_box">
|
<view class="foot_box">
|
||||||
<button class="ss-reset-button btn" v-if="state.info.buttons?.includes('cancel')"
|
<button
|
||||||
@tap="onApply(state.info.id)">
|
class="ss-reset-button btn"
|
||||||
|
v-if="state.info.buttons?.includes('cancel')"
|
||||||
|
@tap="onApply(state.info.id)"
|
||||||
|
>
|
||||||
取消申请
|
取消申请
|
||||||
</button>
|
</button>
|
||||||
<button class="ss-reset-button btn" v-if="state.info.buttons?.includes('delivery')"
|
<button
|
||||||
@tap="sheep.$router.go('/pages/order/aftersale/return-delivery', { id: state.info.id })">
|
class="ss-reset-button btn"
|
||||||
|
v-if="state.info.buttons?.includes('delivery')"
|
||||||
|
@tap="sheep.$router.go('/pages/order/aftersale/return-delivery', { id: state.info.id })"
|
||||||
|
>
|
||||||
填写退货
|
填写退货
|
||||||
</button>
|
</button>
|
||||||
<button class="ss-reset-button contcat-btn btn" @tap="sheep.$router.go('/pages/chat/index')">
|
<button
|
||||||
|
class="ss-reset-button contcat-btn btn"
|
||||||
|
@tap="sheep.$router.go('/pages/chat/index')"
|
||||||
|
>
|
||||||
联系客服
|
联系客服
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -110,7 +139,11 @@
|
|||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import { fen2yuan, formatAfterSaleStatusDescription, handleAfterSaleButtons } from '@/sheep/hooks/useGoods';
|
import {
|
||||||
|
fen2yuan,
|
||||||
|
formatAfterSaleStatusDescription,
|
||||||
|
handleAfterSaleButtons,
|
||||||
|
} from '@/sheep/hooks/useGoods';
|
||||||
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
||||||
|
|
||||||
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
||||||
@ -120,13 +153,17 @@
|
|||||||
info: {}, // 收货信息
|
info: {}, // 收货信息
|
||||||
loading: false,
|
loading: false,
|
||||||
active: 0, // 在 list 的激活位置
|
active: 0, // 在 list 的激活位置
|
||||||
list: [{
|
list: [
|
||||||
|
{
|
||||||
title: '提交申请',
|
title: '提交申请',
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
title: '处理中',
|
title: '处理中',
|
||||||
}, {
|
},
|
||||||
title: '完成'
|
{
|
||||||
}], // 时间轴
|
title: '完成',
|
||||||
|
},
|
||||||
|
], // 时间轴
|
||||||
});
|
});
|
||||||
|
|
||||||
function onApply(id) {
|
function onApply(id) {
|
||||||
@ -175,7 +212,7 @@
|
|||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (!options.id) {
|
if (!options.id) {
|
||||||
sheep.$helper.toast(`缺少订单信息,请检查`);
|
sheep.$helper.toast(`缺少订单信息,请检查`);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
state.id = options.id;
|
state.id = options.id;
|
||||||
getDetail(options.id);
|
getDetail(options.id);
|
||||||
|
@ -3,13 +3,22 @@
|
|||||||
<s-layout title="售后列表">
|
<s-layout title="售后列表">
|
||||||
<!-- tab -->
|
<!-- tab -->
|
||||||
<su-sticky bgColor="#fff">
|
<su-sticky bgColor="#fff">
|
||||||
<su-tabs :list="tabMaps" :scrollable="false" @change="onTabsChange" :current="state.currentTab" />
|
<su-tabs
|
||||||
|
:list="tabMaps"
|
||||||
|
:scrollable="false"
|
||||||
|
@change="onTabsChange"
|
||||||
|
:current="state.currentTab"
|
||||||
|
/>
|
||||||
</su-sticky>
|
</su-sticky>
|
||||||
<s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无数据" />
|
<s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无数据" />
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<view v-if="state.pagination.total > 0">
|
<view v-if="state.pagination.total > 0">
|
||||||
<view class="list-box ss-m-y-20" v-for="order in state.pagination.list" :key="order.id"
|
<view
|
||||||
@tap="sheep.$router.go('/pages/order/aftersale/detail', { id: order.id })">
|
class="list-box ss-m-y-20"
|
||||||
|
v-for="order in state.pagination.list"
|
||||||
|
:key="order.id"
|
||||||
|
@tap="sheep.$router.go('/pages/order/aftersale/detail', { id: order.id })"
|
||||||
|
>
|
||||||
<view class="order-head ss-flex ss-col-center ss-row-between">
|
<view class="order-head ss-flex ss-col-center ss-row-between">
|
||||||
<text class="no">服务单号:{{ order.no }}</text>
|
<text class="no">服务单号:{{ order.no }}</text>
|
||||||
<text class="state">{{ formatAfterSaleStatus(order) }}</text>
|
<text class="state">{{ formatAfterSaleStatus(order) }}</text>
|
||||||
@ -30,15 +39,24 @@
|
|||||||
<view class="tool-btn-box ss-flex ss-col-center ss-row-right ss-p-r-20">
|
<view class="tool-btn-box ss-flex ss-col-center ss-row-right ss-p-r-20">
|
||||||
<!-- TODO 功能缺失:填写退货信息 -->
|
<!-- TODO 功能缺失:填写退货信息 -->
|
||||||
<view>
|
<view>
|
||||||
<button class="ss-reset-button tool-btn" @tap.stop="onApply(order.id)"
|
<button
|
||||||
v-if="order?.buttons.includes('cancel')">取消申请</button>
|
class="ss-reset-button tool-btn"
|
||||||
|
@tap.stop="onApply(order.id)"
|
||||||
|
v-if="order?.buttons.includes('cancel')"
|
||||||
|
>取消申请</button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
|
<uni-load-more
|
||||||
|
v-if="state.pagination.total > 0"
|
||||||
|
:status="state.loadStatus"
|
||||||
|
:content-text="{
|
||||||
contentdown: '上拉加载更多',
|
contentdown: '上拉加载更多',
|
||||||
}" @tap="loadMore" />
|
}"
|
||||||
|
@tap="loadMore"
|
||||||
|
/>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -47,7 +65,11 @@
|
|||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { formatAfterSaleStatus, formatAfterSaleStatusDescription, handleAfterSaleButtons } from '@/sheep/hooks/useGoods';
|
import {
|
||||||
|
formatAfterSaleStatus,
|
||||||
|
formatAfterSaleStatusDescription,
|
||||||
|
handleAfterSaleButtons,
|
||||||
|
} from '@/sheep/hooks/useGoods';
|
||||||
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
||||||
import { resetPagination } from '@/sheep/util';
|
import { resetPagination } from '@/sheep/util';
|
||||||
|
|
||||||
@ -58,13 +80,14 @@
|
|||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
loadStatus: '',
|
loadStatus: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO 芋艿:优化点,增加筛选
|
// TODO 芋艿:优化点,增加筛选
|
||||||
const tabMaps = [{
|
const tabMaps = [
|
||||||
|
{
|
||||||
name: '全部',
|
name: '全部',
|
||||||
value: 'all',
|
value: 'all',
|
||||||
},
|
},
|
||||||
@ -104,7 +127,7 @@
|
|||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data.list.forEach(order => handleAfterSaleButtons(order));
|
data.list.forEach((order) => handleAfterSaleButtons(order));
|
||||||
state.pagination.list = _.concat(state.pagination.list, data.list);
|
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||||
state.pagination.total = data.total;
|
state.pagination.total = data.total;
|
||||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||||
@ -137,7 +160,7 @@
|
|||||||
// 加载更多
|
// 加载更多
|
||||||
function loadMore() {
|
function loadMore() {
|
||||||
if (state.loadStatus === 'noMore') {
|
if (state.loadStatus === 'noMore') {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
state.pagination.pageNo++;
|
state.pagination.pageNo++;
|
||||||
getOrderList();
|
getOrderList();
|
||||||
|
@ -1,29 +1,57 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-layout title="退货物流">
|
<s-layout title="退货物流">
|
||||||
<view>
|
<view>
|
||||||
<form @submit="subRefund" report-submit='true'>
|
<form @submit="subRefund" report-submit="true">
|
||||||
<view class='apply-return'>
|
<view class="apply-return">
|
||||||
<view class='list borRadius14'>
|
<view class="list borRadius14">
|
||||||
<view class='item acea-row row-between-wrapper' style="display: flex;align-items: center;">
|
<view
|
||||||
|
class="item acea-row row-between-wrapper"
|
||||||
|
style="display: flex; align-items: center"
|
||||||
|
>
|
||||||
<view>物流公司</view>
|
<view>物流公司</view>
|
||||||
<view v-if="state.expresses.length > 0" style="flex: 1">
|
<view v-if="state.expresses.length > 0" style="flex: 1">
|
||||||
<picker mode='selector' class='num' @change="bindPickerChange" :value="state.expressIndex"
|
<picker
|
||||||
:range="state.expresses" range-key="name">
|
mode="selector"
|
||||||
<view class="picker acea-row row-between-wrapper" style="display: flex;justify-content: space-between;">
|
class="num"
|
||||||
<view class='reason'>{{ state.expresses[state.expressIndex].name }}</view>
|
@change="bindPickerChange"
|
||||||
<text class='iconfont _icon-forward' />
|
:value="state.expressIndex"
|
||||||
|
:range="state.expresses"
|
||||||
|
range-key="name"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="picker acea-row row-between-wrapper"
|
||||||
|
style="display: flex; justify-content: space-between"
|
||||||
|
>
|
||||||
|
<view class="reason">{{ state.expresses[state.expressIndex].name }}</view>
|
||||||
|
<text class="iconfont _icon-forward" />
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item textarea acea-row row-between' style="display: flex;align-items: center;">
|
<view
|
||||||
|
class="item textarea acea-row row-between"
|
||||||
|
style="display: flex; align-items: center"
|
||||||
|
>
|
||||||
<view>物流单号</view>
|
<view>物流单号</view>
|
||||||
<input placeholder='请填写物流单号' class='num' name="logisticsNo"
|
<input
|
||||||
placeholder-class='placeholder' />
|
placeholder="请填写物流单号"
|
||||||
|
class="num"
|
||||||
|
name="logisticsNo"
|
||||||
|
placeholder-class="placeholder"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<button class='returnBnt bg-color ss-reset-button ui-BG-Main-Gradient sub-btn'
|
<button
|
||||||
|
class="returnBnt bg-color ss-reset-button ui-BG-Main-Gradient sub-btn"
|
||||||
form-type="submit"
|
form-type="submit"
|
||||||
style="background: linear-gradient(90deg,var(--ui-BG-Main),var(--ui-BG-Main-gradient))!important">提交</button>
|
style="
|
||||||
|
background: linear-gradient(
|
||||||
|
90deg,
|
||||||
|
var(--ui-BG-Main),
|
||||||
|
var(--ui-BG-Main-gradient)
|
||||||
|
) !important;
|
||||||
|
"
|
||||||
|
>提交</button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
@ -42,7 +70,7 @@
|
|||||||
id: 0, // 售后编号
|
id: 0, // 售后编号
|
||||||
expressIndex: 0, // 选中的 expresses 下标
|
expressIndex: 0, // 选中的 expresses 下标
|
||||||
expresses: [], // 可选的快递列表
|
expresses: [], // 可选的快递列表
|
||||||
})
|
});
|
||||||
|
|
||||||
function bindPickerChange(e) {
|
function bindPickerChange(e) {
|
||||||
state.expressIndex = e.detail.value;
|
state.expressIndex = e.detail.value;
|
||||||
@ -73,15 +101,15 @@
|
|||||||
state.expresses = data;
|
state.expresses = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(options => {
|
onLoad((options) => {
|
||||||
if (!options.id) {
|
if (!options.id) {
|
||||||
sheep.$helper.toast(`缺少订单信息,请检查`);
|
sheep.$helper.toast(`缺少订单信息,请检查`);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
state.id = options.id;
|
state.id = options.id;
|
||||||
// 获得快递物流列表
|
// 获得快递物流列表
|
||||||
getExpressList();
|
getExpressList();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.apply-return {
|
.apply-return {
|
||||||
|
@ -221,7 +221,7 @@
|
|||||||
pointStatus: false, // TODO 芋艿:需要支持【积分选择】
|
pointStatus: false, // TODO 芋艿:需要支持【积分选择】
|
||||||
combinationActivityId: state.orderPayload.combinationActivityId,
|
combinationActivityId: state.orderPayload.combinationActivityId,
|
||||||
combinationHeadId: state.orderPayload.combinationHeadId,
|
combinationHeadId: state.orderPayload.combinationHeadId,
|
||||||
seckillActivityId: state.orderPayload.seckillActivityId
|
seckillActivityId: state.orderPayload.seckillActivityId,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
@ -247,7 +247,7 @@
|
|||||||
pointStatus: false, // TODO 芋艿:需要支持【积分选择】
|
pointStatus: false, // TODO 芋艿:需要支持【积分选择】
|
||||||
combinationActivityId: state.orderPayload.combinationActivityId,
|
combinationActivityId: state.orderPayload.combinationActivityId,
|
||||||
combinationHeadId: state.orderPayload.combinationHeadId,
|
combinationHeadId: state.orderPayload.combinationHeadId,
|
||||||
seckillActivityId: state.orderPayload.seckillActivityId
|
seckillActivityId: state.orderPayload.seckillActivityId,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -371,7 +371,7 @@
|
|||||||
// 评价
|
// 评价
|
||||||
function onComment(id) {
|
function onComment(id) {
|
||||||
sheep.$router.go('/pages/goods/comment/add', {
|
sheep.$router.go('/pages/goods/comment/add', {
|
||||||
id
|
id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getOrderDetail(id) {
|
async function getOrderDetail(id) {
|
||||||
const { data } = await OrderApi.getOrder(id)
|
const { data } = await OrderApi.getOrder(id);
|
||||||
state.info = data;
|
state.info = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,12 +2,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-layout title="我的订单">
|
<s-layout title="我的订单">
|
||||||
<su-sticky bgColor="#fff">
|
<su-sticky bgColor="#fff">
|
||||||
<su-tabs :list="tabMaps" :scrollable="false" @change="onTabsChange" :current="state.currentTab" />
|
<su-tabs
|
||||||
|
:list="tabMaps"
|
||||||
|
:scrollable="false"
|
||||||
|
@change="onTabsChange"
|
||||||
|
:current="state.currentTab"
|
||||||
|
/>
|
||||||
</su-sticky>
|
</su-sticky>
|
||||||
<s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单" />
|
<s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单" />
|
||||||
<view v-if="state.pagination.total > 0">
|
<view v-if="state.pagination.total > 0">
|
||||||
<view class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20" v-for="order in state.pagination.list"
|
<view
|
||||||
:key="order.id" @tap="onOrderDetail(order.id)">
|
class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20"
|
||||||
|
v-for="order in state.pagination.list"
|
||||||
|
:key="order.id"
|
||||||
|
@tap="onOrderDetail(order.id)"
|
||||||
|
>
|
||||||
<view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20">
|
<view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20">
|
||||||
<view class="order-no">订单号:{{ order.no }}</view>
|
<view class="order-no">订单号:{{ order.no }}</view>
|
||||||
<view class="order-state ss-font-26" :class="formatOrderColor(order)">
|
<view class="order-state ss-font-26" :class="formatOrderColor(order)">
|
||||||
@ -25,45 +34,71 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20">
|
<view class="pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20">
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<view class="discounts-title pay-color">共 {{ order.productCount }} 件商品,总金额:</view>
|
<view class="discounts-title pay-color"
|
||||||
<view class="discounts-money pay-color">
|
>共 {{ order.productCount }} 件商品,总金额:</view
|
||||||
¥{{ fen2yuan(order.payPrice) }}
|
>
|
||||||
|
<view class="discounts-money pay-color"> ¥{{ fen2yuan(order.payPrice) }} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view
|
||||||
<view class="order-card-footer ss-flex ss-col-center ss-p-x-20"
|
class="order-card-footer ss-flex ss-col-center ss-p-x-20"
|
||||||
:class="order.buttons.length > 3 ? 'ss-row-between' : 'ss-row-right'">
|
:class="order.buttons.length > 3 ? 'ss-row-between' : 'ss-row-right'"
|
||||||
|
>
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<button v-if="order.buttons.includes('combination')" class="tool-btn ss-reset-button"
|
<button
|
||||||
@tap.stop="onOrderGroupon(order)">
|
v-if="order.buttons.includes('combination')"
|
||||||
|
class="tool-btn ss-reset-button"
|
||||||
|
@tap.stop="onOrderGroupon(order)"
|
||||||
|
>
|
||||||
拼团详情
|
拼团详情
|
||||||
</button>
|
</button>
|
||||||
<button v-if="order.buttons.length === 0" class="tool-btn ss-reset-button"
|
<button
|
||||||
@tap.stop="onOrderDetail(order.id)">
|
v-if="order.buttons.length === 0"
|
||||||
|
class="tool-btn ss-reset-button"
|
||||||
|
@tap.stop="onOrderDetail(order.id)"
|
||||||
|
>
|
||||||
查看详情
|
查看详情
|
||||||
</button>
|
</button>
|
||||||
<button v-if="order.buttons.includes('confirm')" class="tool-btn ss-reset-button"
|
<button
|
||||||
@tap.stop="onConfirm(order)">
|
v-if="order.buttons.includes('confirm')"
|
||||||
|
class="tool-btn ss-reset-button"
|
||||||
|
@tap.stop="onConfirm(order)"
|
||||||
|
>
|
||||||
确认收货
|
确认收货
|
||||||
</button>
|
</button>
|
||||||
<button v-if="order.buttons.includes('express')" class="tool-btn ss-reset-button"
|
<button
|
||||||
@tap.stop="onExpress(order.id)">
|
v-if="order.buttons.includes('express')"
|
||||||
|
class="tool-btn ss-reset-button"
|
||||||
|
@tap.stop="onExpress(order.id)"
|
||||||
|
>
|
||||||
查看物流
|
查看物流
|
||||||
</button>
|
</button>
|
||||||
<button v-if="order.buttons.includes('cancel')" class="tool-btn ss-reset-button"
|
<button
|
||||||
@tap.stop="onCancel(order.id)">
|
v-if="order.buttons.includes('cancel')"
|
||||||
|
class="tool-btn ss-reset-button"
|
||||||
|
@tap.stop="onCancel(order.id)"
|
||||||
|
>
|
||||||
取消订单
|
取消订单
|
||||||
</button>
|
</button>
|
||||||
<button v-if="order.buttons.includes('comment')" class="tool-btn ss-reset-button"
|
<button
|
||||||
@tap.stop="onComment(order.id)">
|
v-if="order.buttons.includes('comment')"
|
||||||
|
class="tool-btn ss-reset-button"
|
||||||
|
@tap.stop="onComment(order.id)"
|
||||||
|
>
|
||||||
评价
|
评价
|
||||||
</button>
|
</button>
|
||||||
<button v-if="order.buttons.includes('delete')" class="delete-btn ss-reset-button"
|
<button
|
||||||
@tap.stop="onDelete(order.id)">
|
v-if="order.buttons.includes('delete')"
|
||||||
|
class="delete-btn ss-reset-button"
|
||||||
|
@tap.stop="onDelete(order.id)"
|
||||||
|
>
|
||||||
删除订单
|
删除订单
|
||||||
</button>
|
</button>
|
||||||
<button v-if="order.buttons.includes('pay')" class="tool-btn ss-reset-button ui-BG-Main-Gradient"
|
<button
|
||||||
@tap.stop="onPay(order.payOrderId)">
|
v-if="order.buttons.includes('pay')"
|
||||||
|
class="tool-btn ss-reset-button ui-BG-Main-Gradient"
|
||||||
|
@tap.stop="onPay(order.payOrderId)"
|
||||||
|
>
|
||||||
继续支付
|
继续支付
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -72,9 +107,14 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
|
<uni-load-more
|
||||||
|
v-if="state.pagination.total > 0"
|
||||||
|
:status="state.loadStatus"
|
||||||
|
:content-text="{
|
||||||
contentdown: '上拉加载更多',
|
contentdown: '上拉加载更多',
|
||||||
}" @tap="loadMore" />
|
}"
|
||||||
|
@tap="loadMore"
|
||||||
|
/>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -83,13 +123,13 @@
|
|||||||
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
fen2yuan,
|
fen2yuan,
|
||||||
formatOrderColor, formatOrderStatus, handleOrderButtons,
|
formatOrderColor,
|
||||||
|
formatOrderStatus,
|
||||||
|
handleOrderButtons,
|
||||||
} from '@/sheep/hooks/useGoods';
|
} from '@/sheep/hooks/useGoods';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {
|
import { isEmpty } from 'lodash';
|
||||||
isEmpty
|
|
||||||
} from 'lodash';
|
|
||||||
import OrderApi from '@/sheep/api/trade/order';
|
import OrderApi from '@/sheep/api/trade/order';
|
||||||
import { resetPagination } from '@/sheep/util';
|
import { resetPagination } from '@/sheep/util';
|
||||||
|
|
||||||
@ -102,11 +142,12 @@
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
},
|
},
|
||||||
loadStatus: ''
|
loadStatus: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const tabMaps = [{
|
const tabMaps = [
|
||||||
name: '全部'
|
{
|
||||||
|
name: '全部',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '待付款',
|
name: '待付款',
|
||||||
@ -275,13 +316,13 @@
|
|||||||
pageNo: state.pagination.pageNo,
|
pageNo: state.pagination.pageNo,
|
||||||
pageSize: state.pagination.pageSize,
|
pageSize: state.pagination.pageSize,
|
||||||
status: tabMaps[state.currentTab].value,
|
status: tabMaps[state.currentTab].value,
|
||||||
commentStatus: tabMaps[state.currentTab].value === 30 ? false : null
|
commentStatus: tabMaps[state.currentTab].value === 30 ? false : null,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data.list.forEach(order => handleOrderButtons(order));
|
data.list.forEach((order) => handleOrderButtons(order));
|
||||||
state.pagination.list = _.concat(state.pagination.list, data.list)
|
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||||
state.pagination.total = data.total;
|
state.pagination.total = data.total;
|
||||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||||
}
|
}
|
||||||
@ -296,7 +337,7 @@
|
|||||||
// 加载更多
|
// 加载更多
|
||||||
function loadMore() {
|
function loadMore() {
|
||||||
if (state.loadStatus === 'noMore') {
|
if (state.loadStatus === 'noMore') {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
state.pagination.pageNo++;
|
state.pagination.pageNo++;
|
||||||
getOrderList();
|
getOrderList();
|
||||||
@ -380,7 +421,8 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-state {}
|
.order-state {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay-box {
|
.pay-box {
|
||||||
|
@ -135,12 +135,13 @@
|
|||||||
|
|
||||||
// 状态转换:payOrder.status => payStatus
|
// 状态转换:payOrder.status => payStatus
|
||||||
function checkPayStatus() {
|
function checkPayStatus() {
|
||||||
if (state.orderInfo.status === 10
|
if (state.orderInfo.status === 10 || state.orderInfo.status === 20) {
|
||||||
|| state.orderInfo.status === 20 ) { // 支付成功
|
// 支付成功
|
||||||
state.payStatus = 2;
|
state.payStatus = 2;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state.orderInfo.status === 30) { // 支付关闭
|
if (state.orderInfo.status === 30) {
|
||||||
|
// 支付关闭
|
||||||
state.payStatus = -1;
|
state.payStatus = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -169,17 +170,19 @@
|
|||||||
|
|
||||||
// 获得支付方式
|
// 获得支付方式
|
||||||
async function setPayMethods() {
|
async function setPayMethods() {
|
||||||
const { data, code } = await PayChannelApi.getEnableChannelCodeList(state.orderInfo.appId)
|
const { data, code } = await PayChannelApi.getEnableChannelCodeList(state.orderInfo.appId);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
state.payMethods = getPayMethods(data)
|
state.payMethods = getPayMethods(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (sheep.$platform.name === 'WechatOfficialAccount'
|
if (
|
||||||
&& sheep.$platform.os === 'ios'
|
sheep.$platform.name === 'WechatOfficialAccount' &&
|
||||||
&& !sheep.$platform.landingPage.includes('pages/pay/index')) {
|
sheep.$platform.os === 'ios' &&
|
||||||
|
!sheep.$platform.landingPage.includes('pages/pay/index')
|
||||||
|
) {
|
||||||
location.reload();
|
location.reload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -208,7 +211,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
padding: 60rpx 20rpx 40rpx;
|
padding: 60rpx 20rpx 40rpx;
|
||||||
|
|
||||||
|
|
||||||
.money-text {
|
.money-text {
|
||||||
color: $red;
|
color: $red;
|
||||||
font-size: 46rpx;
|
font-size: 46rpx;
|
||||||
|
@ -30,7 +30,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="time-box item ss-flex ss-col-center ss-row-between">
|
<view class="time-box item ss-flex ss-col-center ss-row-between">
|
||||||
<text class="item-title">充值时间</text>
|
<text class="item-title">充值时间</text>
|
||||||
<view class="time"> {{ sheep.$helper.timeFormat(item.payTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
|
<view class="time">
|
||||||
|
{{ sheep.$helper.timeFormat(item.payTime, 'yyyy-mm-dd hh:MM:ss') }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
<!-- 充值界面 -->
|
<!-- 充值界面 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout title="充值" class="withdraw-wrap" navbar="inner">
|
<s-layout title="充值" class="withdraw-wrap" navbar="inner">
|
||||||
<view class="wallet-num-box ss-flex ss-col-center ss-row-between" :style="[
|
<view
|
||||||
|
class="wallet-num-box ss-flex ss-col-center ss-row-between"
|
||||||
|
:style="[
|
||||||
{
|
{
|
||||||
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
||||||
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
||||||
},
|
},
|
||||||
]">
|
]"
|
||||||
|
>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="num-title">当前余额(元)</view>
|
<view class="num-title">当前余额(元)</view>
|
||||||
<view class="wallet-num">{{ fen2yuan(userWallet.balance) }}</view>
|
<view class="wallet-num">{{ fen2yuan(userWallet.balance) }}</view>
|
||||||
@ -20,20 +23,31 @@
|
|||||||
<view class="input-label ss-m-b-50">充值金额</view>
|
<view class="input-label ss-m-b-50">充值金额</view>
|
||||||
<view class="input-box ss-flex border-bottom ss-p-b-20">
|
<view class="input-box ss-flex border-bottom ss-p-b-20">
|
||||||
<view class="unit">¥</view>
|
<view class="unit">¥</view>
|
||||||
<uni-easyinput v-model="state.recharge_money" type="digit" placeholder="请输入充值金额"
|
<uni-easyinput
|
||||||
:inputBorder="false" />
|
v-model="state.recharge_money"
|
||||||
|
type="digit"
|
||||||
|
placeholder="请输入充值金额"
|
||||||
|
:inputBorder="false"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="face-value-box ss-flex ss-flex-wrap ss-m-y-40">
|
<view class="face-value-box ss-flex ss-flex-wrap ss-m-y-40">
|
||||||
<button class="ss-reset-button face-value-btn" v-for="item in state.packageList" :key="item.money"
|
<button
|
||||||
|
class="ss-reset-button face-value-btn"
|
||||||
|
v-for="item in state.packageList"
|
||||||
|
:key="item.money"
|
||||||
:class="[{ 'btn-active': state.recharge_money === fen2yuan(item.payPrice) }]"
|
:class="[{ 'btn-active': state.recharge_money === fen2yuan(item.payPrice) }]"
|
||||||
@tap="onCard(item.payPrice)">
|
@tap="onCard(item.payPrice)"
|
||||||
|
>
|
||||||
<text class="face-value-title">{{ fen2yuan(item.payPrice) }}</text>
|
<text class="face-value-title">{{ fen2yuan(item.payPrice) }}</text>
|
||||||
<view v-if="item.bonusPrice" class="face-value-tag">
|
<view v-if="item.bonusPrice" class="face-value-tag">
|
||||||
送 {{ fen2yuan(item.bonusPrice) }} 元
|
送 {{ fen2yuan(item.bonusPrice) }} 元
|
||||||
</view>
|
</view>
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<button class="ss-reset-button save-btn ui-BG-Main-Gradient ss-m-t-60 ui-Shadow-Main" @tap="onConfirm">
|
<button
|
||||||
|
class="ss-reset-button save-btn ui-BG-Main-Gradient ss-m-t-60 ui-Shadow-Main"
|
||||||
|
@tap="onConfirm"
|
||||||
|
>
|
||||||
确认充值
|
确认充值
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -74,8 +88,9 @@
|
|||||||
// 发起支付
|
// 发起支付
|
||||||
async function onConfirm() {
|
async function onConfirm() {
|
||||||
const { code, data } = await PayWalletApi.createWalletRecharge({
|
const { code, data } = await PayWalletApi.createWalletRecharge({
|
||||||
packageId: state.packageList.find((item) => fen2yuan(item.payPrice) === state.recharge_money)?.id,
|
packageId: state.packageList.find((item) => fen2yuan(item.payPrice) === state.recharge_money)
|
||||||
payPrice: state.recharge_money * 100
|
?.id,
|
||||||
|
payPrice: state.recharge_money * 100,
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
@ -85,7 +100,7 @@
|
|||||||
// #endif
|
// #endif
|
||||||
sheep.$router.go('/pages/pay/index', {
|
sheep.$router.go('/pages/pay/index', {
|
||||||
id: data.payOrderId,
|
id: data.payOrderId,
|
||||||
orderType: 'recharge'
|
orderType: 'recharge',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
if (true) {
|
if (true) {
|
||||||
sheep.$router.go('/pages/public/richtext', {
|
sheep.$router.go('/pages/public/richtext', {
|
||||||
title: '常见问题',
|
title: '常见问题',
|
||||||
})
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getFaqList();
|
getFaqList();
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
}
|
}
|
||||||
getRichTextContent(options.id, options.title);
|
getRichTextContent(options.id, options.title);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
class="list-border"
|
class="list-border"
|
||||||
@tap="
|
@tap="
|
||||||
sheep.$router.go('/pages/public/richtext', {
|
sheep.$router.go('/pages/public/richtext', {
|
||||||
title: '关于我们'
|
title: '关于我们',
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
class="tcp-text"
|
class="tcp-text"
|
||||||
@tap="
|
@tap="
|
||||||
sheep.$router.go('/pages/public/richtext', {
|
sheep.$router.go('/pages/public/richtext', {
|
||||||
title: '用户协议'
|
title: '用户协议',
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
@ -70,7 +70,7 @@
|
|||||||
class="tcp-text"
|
class="tcp-text"
|
||||||
@tap="
|
@tap="
|
||||||
sheep.$router.go('/pages/public/richtext', {
|
sheep.$router.go('/pages/public/richtext', {
|
||||||
title: '隐私协议'
|
title: '隐私协议',
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -1,34 +1,70 @@
|
|||||||
<!-- 收货地址的新增/编辑 -->
|
<!-- 收货地址的新增/编辑 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout :title="state.model.id ? '编辑地址' : '新增地址'">
|
<s-layout :title="state.model.id ? '编辑地址' : '新增地址'">
|
||||||
<uni-forms ref="addressFormRef" v-model="state.model" :rules="rules" validateTrigger="bind"
|
<uni-forms
|
||||||
labelWidth="160" labelAlign="left" border :labelStyle="{ fontWeight: 'bold' }">
|
ref="addressFormRef"
|
||||||
|
v-model="state.model"
|
||||||
|
:rules="rules"
|
||||||
|
validateTrigger="bind"
|
||||||
|
labelWidth="160"
|
||||||
|
labelAlign="left"
|
||||||
|
border
|
||||||
|
:labelStyle="{ fontWeight: 'bold' }"
|
||||||
|
>
|
||||||
<view class="bg-white form-box ss-p-x-30">
|
<view class="bg-white form-box ss-p-x-30">
|
||||||
<uni-forms-item name="name" label="收货人" class="form-item">
|
<uni-forms-item name="name" label="收货人" class="form-item">
|
||||||
<uni-easyinput v-model="state.model.name" placeholder="请填写收货人姓名" :inputBorder="false"
|
<uni-easyinput
|
||||||
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal" />
|
v-model="state.model.name"
|
||||||
|
placeholder="请填写收货人姓名"
|
||||||
|
:inputBorder="false"
|
||||||
|
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
|
||||||
|
/>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
|
||||||
<uni-forms-item name="mobile" label="手机号" class="form-item">
|
<uni-forms-item name="mobile" label="手机号" class="form-item">
|
||||||
<uni-easyinput v-model="state.model.mobile" type="number" placeholder="请输入手机号" :inputBorder="false"
|
<uni-easyinput
|
||||||
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal">
|
v-model="state.model.mobile"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
:inputBorder="false"
|
||||||
|
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
|
||||||
|
>
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item name="areaName" label="省市区" @tap="state.showRegion = true" class="form-item">
|
<uni-forms-item
|
||||||
<uni-easyinput v-model="state.model.areaName" disabled :inputBorder="false"
|
name="areaName"
|
||||||
|
label="省市区"
|
||||||
|
@tap="state.showRegion = true"
|
||||||
|
class="form-item"
|
||||||
|
>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="state.model.areaName"
|
||||||
|
disabled
|
||||||
|
:inputBorder="false"
|
||||||
:styles="{ disableColor: '#fff', color: '#333' }"
|
:styles="{ disableColor: '#fff', color: '#333' }"
|
||||||
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
|
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
|
||||||
placeholder="请选择省市区">
|
placeholder="请选择省市区"
|
||||||
|
>
|
||||||
<template v-slot:right>
|
<template v-slot:right>
|
||||||
<uni-icons type="right" />
|
<uni-icons type="right" />
|
||||||
</template>
|
</template>
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item name="detailAddress" label="详细地址" :formItemStyle="{ alignItems: 'flex-start' }"
|
<uni-forms-item
|
||||||
:labelStyle="{ lineHeight: '5em' }" class="textarea-item">
|
name="detailAddress"
|
||||||
<uni-easyinput :inputBorder="false" type="textarea" v-model="state.model.detailAddress"
|
label="详细地址"
|
||||||
|
:formItemStyle="{ alignItems: 'flex-start' }"
|
||||||
|
:labelStyle="{ lineHeight: '5em' }"
|
||||||
|
class="textarea-item"
|
||||||
|
>
|
||||||
|
<uni-easyinput
|
||||||
|
:inputBorder="false"
|
||||||
|
type="textarea"
|
||||||
|
v-model="state.model.detailAddress"
|
||||||
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
|
placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
|
||||||
placeholder="请输入详细地址" clearable />
|
placeholder="请输入详细地址"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-m-y-20 bg-white ss-p-x-30 ss-flex ss-row-between ss-col-center default-box">
|
<view class="ss-m-y-20 bg-white ss-p-x-30 ss-flex ss-row-between ss-col-center default-box">
|
||||||
@ -48,7 +84,11 @@
|
|||||||
</su-fixed>
|
</su-fixed>
|
||||||
|
|
||||||
<!-- 省市区弹窗 -->
|
<!-- 省市区弹窗 -->
|
||||||
<su-region-picker :show="state.showRegion" @cancel="state.showRegion = false" @confirm="onRegionConfirm" />
|
<su-region-picker
|
||||||
|
:show="state.showRegion"
|
||||||
|
@cancel="state.showRegion = false"
|
||||||
|
@confirm="onRegionConfirm"
|
||||||
|
/>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -85,22 +125,26 @@
|
|||||||
},
|
},
|
||||||
mobile,
|
mobile,
|
||||||
detailAddress: {
|
detailAddress: {
|
||||||
rules: [{
|
rules: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
errorMessage: '请输入详细地址',
|
errorMessage: '请输入详细地址',
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
areaName: {
|
areaName: {
|
||||||
rules: [{
|
rules: [
|
||||||
|
{
|
||||||
required: true,
|
required: true,
|
||||||
errorMessage: '请选择您的位置'
|
errorMessage: '请选择您的位置',
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 确认选择地区
|
// 确认选择地区
|
||||||
const onRegionConfirm = (e) => {
|
const onRegionConfirm = (e) => {
|
||||||
state.model.areaName = `${e.province_name} ${e.city_name} ${e.district_name}`
|
state.model.areaName = `${e.province_name} ${e.city_name} ${e.district_name}`;
|
||||||
state.model.areaId = e.district_id;
|
state.model.areaId = e.district_id;
|
||||||
state.showRegion = false;
|
state.showRegion = false;
|
||||||
};
|
};
|
||||||
@ -130,9 +174,11 @@
|
|||||||
|
|
||||||
// 提交请求
|
// 提交请求
|
||||||
const formData = {
|
const formData = {
|
||||||
...state.model
|
...state.model,
|
||||||
}
|
};
|
||||||
const {code } = state.model.id > 0 ? await AddressApi.updateAddress(formData)
|
const { code } =
|
||||||
|
state.model.id > 0
|
||||||
|
? await AddressApi.updateAddress(formData)
|
||||||
: await AddressApi.createAddress(formData);
|
: await AddressApi.createAddress(formData);
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
sheep.$router.back();
|
sheep.$router.back();
|
||||||
@ -171,7 +217,7 @@
|
|||||||
if (options.data) {
|
if (options.data) {
|
||||||
let data = JSON.parse(options.data);
|
let data = JSON.parse(options.data);
|
||||||
const areaData = uni.getStorageSync('areaData');
|
const areaData = uni.getStorageSync('areaData');
|
||||||
const findAreaByName = (areas, name) => areas.find(item => item.name === name);
|
const findAreaByName = (areas, name) => areas.find((item) => item.name === name);
|
||||||
|
|
||||||
let provinceObj = findAreaByName(areaData, data.province_name);
|
let provinceObj = findAreaByName(areaData, data.province_name);
|
||||||
let cityObj = provinceObj ? findAreaByName(provinceObj.children, data.city_name) : undefined;
|
let cityObj = provinceObj ? findAreaByName(provinceObj.children, data.city_name) : undefined;
|
||||||
@ -181,7 +227,9 @@
|
|||||||
state.model = {
|
state.model = {
|
||||||
...state.model,
|
...state.model,
|
||||||
areaId,
|
areaId,
|
||||||
areaName: [data.province_name, data.city_name, data.district_name].filter(Boolean).join(" "),
|
areaName: [data.province_name, data.city_name, data.district_name]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(' '),
|
||||||
defaultStatus: false,
|
defaultStatus: false,
|
||||||
detailAddress: data.address,
|
detailAddress: data.address,
|
||||||
mobile: data.mobile,
|
mobile: data.mobile,
|
||||||
|
@ -2,26 +2,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-layout title="收货地址" :bgStyle="{ color: '#FFF' }">
|
<s-layout title="收货地址" :bgStyle="{ color: '#FFF' }">
|
||||||
<view v-if="state.list.length">
|
<view v-if="state.list.length">
|
||||||
<s-address-item hasBorderBottom v-for="item in state.list" :key="item.id" :item="item"
|
<s-address-item
|
||||||
@tap="onSelect(item)" />
|
hasBorderBottom
|
||||||
|
v-for="item in state.list"
|
||||||
|
:key="item.id"
|
||||||
|
:item="item"
|
||||||
|
@tap="onSelect(item)"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<su-fixed bottom placeholder>
|
<su-fixed bottom placeholder>
|
||||||
<view class="footer-box ss-flex ss-row-between ss-p-20">
|
<view class="footer-box ss-flex ss-row-between ss-p-20">
|
||||||
<!-- 微信小程序和微信H5 -->
|
<!-- 微信小程序和微信H5 -->
|
||||||
<button v-if="['WechatMiniProgram', 'WechatOfficialAccount'].includes(sheep.$platform.name)"
|
<button
|
||||||
|
v-if="['WechatMiniProgram', 'WechatOfficialAccount'].includes(sheep.$platform.name)"
|
||||||
@tap="importWechatAddress"
|
@tap="importWechatAddress"
|
||||||
class="border ss-reset-button sync-wxaddress ss-m-20 ss-flex ss-row-center ss-col-center">
|
class="border ss-reset-button sync-wxaddress ss-m-20 ss-flex ss-row-center ss-col-center"
|
||||||
|
>
|
||||||
<text class="cicon-weixin ss-p-r-10" style="color: #09bb07; font-size: 40rpx"></text>
|
<text class="cicon-weixin ss-p-r-10" style="color: #09bb07; font-size: 40rpx"></text>
|
||||||
导入微信地址
|
导入微信地址
|
||||||
</button>
|
</button>
|
||||||
<button class="add-btn ss-reset-button ui-Shadow-Main"
|
<button
|
||||||
@tap="sheep.$router.go('/pages/user/address/edit')">
|
class="add-btn ss-reset-button ui-Shadow-Main"
|
||||||
|
@tap="sheep.$router.go('/pages/user/address/edit')"
|
||||||
|
>
|
||||||
新增收货地址
|
新增收货地址
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</su-fixed>
|
</su-fixed>
|
||||||
<s-empty v-if="state.list.length === 0 && !state.loading" text="暂无收货地址" icon="/static/data-empty.png" />
|
<s-empty
|
||||||
|
v-if="state.list.length === 0 && !state.loading"
|
||||||
|
text="暂无收货地址"
|
||||||
|
icon="/static/data-empty.png"
|
||||||
|
/>
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
<!-- 头部 -->
|
<!-- 头部 -->
|
||||||
<view class="cart-header ss-flex ss-col-center ss-row-between ss-p-x-30">
|
<view class="cart-header ss-flex ss-col-center ss-row-between ss-p-x-30">
|
||||||
<view class="header-left ss-flex ss-col-center ss-font-26">
|
<view class="header-left ss-flex ss-col-center ss-font-26">
|
||||||
共 <text class="goods-number ui-TC-Main ss-flex">{{ state.pagination.total }}</text> 件商品
|
共
|
||||||
|
<text class="goods-number ui-TC-Main ss-flex">{{ state.pagination.total }}</text> 件商品
|
||||||
</view>
|
</view>
|
||||||
<view class="header-right">
|
<view class="header-right">
|
||||||
<button
|
<button
|
||||||
@ -77,7 +78,8 @@
|
|||||||
<view class="footer-right">
|
<view class="footer-right">
|
||||||
<button
|
<button
|
||||||
class="ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main"
|
class="ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main"
|
||||||
@tap="onCancel">
|
@tap="onCancel"
|
||||||
|
>
|
||||||
取消收藏
|
取消收藏
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@ -129,7 +131,7 @@
|
|||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.pagination.list = _.concat(state.pagination.list, data.list)
|
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||||
state.pagination.total = data.total;
|
state.pagination.total = data.total;
|
||||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||||
}
|
}
|
||||||
@ -174,7 +176,7 @@
|
|||||||
// 加载更多
|
// 加载更多
|
||||||
function loadMore() {
|
function loadMore() {
|
||||||
if (state.loadStatus === 'noMore') {
|
if (state.loadStatus === 'noMore') {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
state.pagination.pageNo++;
|
state.pagination.pageNo++;
|
||||||
getData();
|
getData();
|
||||||
|
@ -81,11 +81,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="footer-right ss-flex">
|
<view class="footer-right ss-flex">
|
||||||
<button
|
<button
|
||||||
:class="['ss-reset-button pay-btn ss-font-28 ',
|
:class="[
|
||||||
|
'ss-reset-button pay-btn ss-font-28 ',
|
||||||
{
|
{
|
||||||
'ui-BG-Main-Gradient': state.selectedSpuIdList.length > 0,
|
'ui-BG-Main-Gradient': state.selectedSpuIdList.length > 0,
|
||||||
'ui-Shadow-Main': state.selectedSpuIdList.length > 0
|
'ui-Shadow-Main': state.selectedSpuIdList.length > 0,
|
||||||
}]"
|
},
|
||||||
|
]"
|
||||||
@tap="onDelete"
|
@tap="onDelete"
|
||||||
>
|
>
|
||||||
删除足迹
|
删除足迹
|
||||||
@ -121,8 +123,8 @@
|
|||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import SpuHistoryApi from "@/sheep/api/product/history";
|
import SpuHistoryApi from '@/sheep/api/product/history';
|
||||||
import {cloneDeep} from "@/sheep/helper/utils";
|
import { cloneDeep } from '@/sheep/helper/utils';
|
||||||
|
|
||||||
const sys_navBar = sheep.$platform.navbar;
|
const sys_navBar = sheep.$platform.navbar;
|
||||||
const pagination = {
|
const pagination = {
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
<button
|
<button
|
||||||
class="ss-reset-button avatar-action-btn"
|
class="ss-reset-button avatar-action-btn"
|
||||||
open-type="chooseAvatar"
|
open-type="chooseAvatar"
|
||||||
@chooseavatar="onChooseAvatar">
|
@chooseavatar="onChooseAvatar"
|
||||||
|
>
|
||||||
修改
|
修改
|
||||||
</button>
|
</button>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
@ -154,10 +155,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<view class="info ss-flex ss-col-center" v-if="state.thirdInfo">
|
<view class="info ss-flex ss-col-center" v-if="state.thirdInfo">
|
||||||
<image
|
<image class="avatar ss-m-r-20" :src="sheep.$url.cdn(state.thirdInfo.avatar)" />
|
||||||
class="avatar ss-m-r-20"
|
|
||||||
:src="sheep.$url.cdn(state.thirdInfo.avatar)"
|
|
||||||
/>
|
|
||||||
<text class="name">{{ state.thirdInfo.nickname }}</text>
|
<text class="name">{{ state.thirdInfo.nickname }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bind-box ss-m-l-20">
|
<view class="bind-box ss-m-l-20">
|
||||||
@ -198,14 +196,15 @@
|
|||||||
|
|
||||||
const placeholderStyle = 'color:#BBBBBB;font-size:28rpx;line-height:normal';
|
const placeholderStyle = 'color:#BBBBBB;font-size:28rpx;line-height:normal';
|
||||||
|
|
||||||
const sexRadioMap = [{
|
const sexRadioMap = [
|
||||||
|
{
|
||||||
name: '男',
|
name: '男',
|
||||||
value: '1',
|
value: '1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '女',
|
name: '女',
|
||||||
value: '2',
|
value: '2',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex ss-row-between ss-col-center ss-m-t-64">
|
<view class="ss-flex ss-row-between ss-col-center ss-m-t-64">
|
||||||
<view class="money-num">{{ state.showMoney ? fen2yuan(userWallet.balance) : '*****' }}</view>
|
<view class="money-num">{{
|
||||||
|
state.showMoney ? fen2yuan(userWallet.balance) : '*****'
|
||||||
|
}}</view>
|
||||||
<button class="ss-reset-button topup-btn" @tap="sheep.$router.go('/pages/pay/recharge')">
|
<button class="ss-reset-button topup-btn" @tap="sheep.$router.go('/pages/pay/recharge')">
|
||||||
充值
|
充值
|
||||||
</button>
|
</button>
|
||||||
@ -24,7 +26,12 @@
|
|||||||
<su-sticky>
|
<su-sticky>
|
||||||
<!-- 统计 -->
|
<!-- 统计 -->
|
||||||
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
||||||
<uni-datetime-picker v-model="state.data" type="daterange" @change="onChangeTime" :end="state.today">
|
<uni-datetime-picker
|
||||||
|
v-model="state.data"
|
||||||
|
type="daterange"
|
||||||
|
@change="onChangeTime"
|
||||||
|
:end="state.today"
|
||||||
|
>
|
||||||
<button class="ss-reset-button date-btn">
|
<button class="ss-reset-button date-btn">
|
||||||
<text>{{ dateFilterText }}</text>
|
<text>{{ dateFilterText }}</text>
|
||||||
<text class="cicon-drop-down ss-seldate-icon"></text>
|
<text class="cicon-drop-down ss-seldate-icon"></text>
|
||||||
@ -98,7 +105,7 @@
|
|||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 8
|
pageSize: 8,
|
||||||
},
|
},
|
||||||
summary: {
|
summary: {
|
||||||
totalIncome: 0,
|
totalIncome: 0,
|
||||||
@ -155,7 +162,7 @@
|
|||||||
// 获得钱包统计
|
// 获得钱包统计
|
||||||
async function getSummary() {
|
async function getSummary() {
|
||||||
const { data, code } = await PayWalletApi.getWalletTransactionSummary({
|
const { data, code } = await PayWalletApi.getWalletTransactionSummary({
|
||||||
'createTime': [state.date[0] + ' 00:00:00', state.date[1] + ' 23:59:59'],
|
createTime: [state.date[0] + ' 00:00:00', state.date[1] + ' 23:59:59'],
|
||||||
});
|
});
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
@ -226,8 +233,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
background: v-bind(headerBg)
|
background: v-bind(headerBg) no-repeat;
|
||||||
no-repeat;
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,12 @@
|
|||||||
<su-sticky :customNavHeight="sys_navBar">
|
<su-sticky :customNavHeight="sys_navBar">
|
||||||
<!-- 统计 -->
|
<!-- 统计 -->
|
||||||
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
||||||
<uni-datetime-picker v-model="state.date" type="daterange" @change="onChangeTime" :end="state.today">
|
<uni-datetime-picker
|
||||||
|
v-model="state.date"
|
||||||
|
type="daterange"
|
||||||
|
@change="onChangeTime"
|
||||||
|
:end="state.today"
|
||||||
|
>
|
||||||
<button class="ss-reset-button date-btn">
|
<button class="ss-reset-button date-btn">
|
||||||
<text>{{ dateFilterText }}</text>
|
<text>{{ dateFilterText }}</text>
|
||||||
<text class="cicon-drop-down ss-seldate-icon"></text>
|
<text class="cicon-drop-down ss-seldate-icon"></text>
|
||||||
|
@ -5,7 +5,7 @@ const AddressApi = {
|
|||||||
getAddressList: () => {
|
getAddressList: () => {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/address/list',
|
url: '/member/address/list',
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 创建用户收件地址
|
// 创建用户收件地址
|
||||||
@ -16,7 +16,7 @@ const AddressApi = {
|
|||||||
data,
|
data,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '保存成功'
|
successMsg: '保存成功',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -28,7 +28,7 @@ const AddressApi = {
|
|||||||
data,
|
data,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '更新成功'
|
successMsg: '更新成功',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -37,7 +37,7 @@ const AddressApi = {
|
|||||||
return request({
|
return request({
|
||||||
url: '/member/address/get',
|
url: '/member/address/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { id }
|
params: { id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 删除用户收件地址
|
// 删除用户收件地址
|
||||||
@ -45,7 +45,24 @@ const AddressApi = {
|
|||||||
return request({
|
return request({
|
||||||
url: '/member/address/delete',
|
url: '/member/address/delete',
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
params: { id }
|
params: { id },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 文章列表
|
||||||
|
textList: (id) => {
|
||||||
|
return request({
|
||||||
|
url: '/promotion/article/list',
|
||||||
|
method: 'GET',
|
||||||
|
params: { id },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 文章列表详情
|
||||||
|
textListDetail: (id) => {
|
||||||
|
return request({
|
||||||
|
url: '/promotion/article/get',
|
||||||
|
method: 'GET',
|
||||||
|
params: { id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -56,7 +56,7 @@ const AuthUtil = {
|
|||||||
url: '/member/auth/refresh-token',
|
url: '/member/auth/refresh-token',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
params: {
|
params: {
|
||||||
refreshToken
|
refreshToken,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
loading: false, // 不用加载中
|
loading: false, // 不用加载中
|
||||||
@ -103,7 +103,7 @@ const AuthUtil = {
|
|||||||
data: {
|
data: {
|
||||||
phoneCode,
|
phoneCode,
|
||||||
loginCode,
|
loginCode,
|
||||||
state
|
state,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
@ -118,13 +118,13 @@ const AuthUtil = {
|
|||||||
url: '/member/auth/create-weixin-jsapi-signature',
|
url: '/member/auth/create-weixin-jsapi-signature',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
params: {
|
params: {
|
||||||
url
|
url,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
showError: false,
|
showError: false,
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ const PointApi = {
|
|||||||
// 获得用户积分记录分页
|
// 获得用户积分记录分页
|
||||||
getPointRecordPage: (params) => {
|
getPointRecordPage: (params) => {
|
||||||
if (params.addStatus === undefined) {
|
if (params.addStatus === undefined) {
|
||||||
delete params.addStatus
|
delete params.addStatus;
|
||||||
}
|
}
|
||||||
const queryString = Object.keys(params)
|
const queryString = Object.keys(params)
|
||||||
.map((key) => encodeURIComponent(key) + '=' + params[key])
|
.map((key) => encodeURIComponent(key) + '=' + params[key])
|
||||||
@ -13,7 +13,7 @@ const PointApi = {
|
|||||||
url: `/member/point/record/page?${queryString}`,
|
url: `/member/point/record/page?${queryString}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PointApi;
|
export default PointApi;
|
||||||
|
@ -7,7 +7,7 @@ const SocialApi = {
|
|||||||
url: '/member/social-user/get',
|
url: '/member/social-user/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
type
|
type,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
@ -22,7 +22,7 @@ const SocialApi = {
|
|||||||
data: {
|
data: {
|
||||||
type,
|
type,
|
||||||
code,
|
code,
|
||||||
state
|
state,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
custom: {
|
custom: {
|
||||||
@ -40,7 +40,7 @@ const SocialApi = {
|
|||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
data: {
|
data: {
|
||||||
type,
|
type,
|
||||||
openid
|
openid,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
|
@ -21,7 +21,7 @@ const UserApi = {
|
|||||||
custom: {
|
custom: {
|
||||||
auth: true,
|
auth: true,
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '更新成功'
|
successMsg: '更新成功',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -34,7 +34,7 @@ const UserApi = {
|
|||||||
custom: {
|
custom: {
|
||||||
loadingMsg: '验证中',
|
loadingMsg: '验证中',
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '修改成功'
|
successMsg: '修改成功',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -44,12 +44,12 @@ const UserApi = {
|
|||||||
url: '/member/user/update-mobile-by-weixin',
|
url: '/member/user/update-mobile-by-weixin',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: {
|
data: {
|
||||||
code
|
code,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
loadingMsg: '获取中',
|
loadingMsg: '获取中',
|
||||||
successMsg: '修改成功'
|
successMsg: '修改成功',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -62,7 +62,7 @@ const UserApi = {
|
|||||||
custom: {
|
custom: {
|
||||||
loadingMsg: '验证中',
|
loadingMsg: '验证中',
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '修改成功'
|
successMsg: '修改成功',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -75,11 +75,10 @@ const UserApi = {
|
|||||||
custom: {
|
custom: {
|
||||||
loadingMsg: '验证中',
|
loadingMsg: '验证中',
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '修改成功'
|
successMsg: '修改成功',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default UserApi;
|
export default UserApi;
|
||||||
|
@ -10,12 +10,12 @@ export default {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
ids: ids.join(','),
|
ids: ids.join(','),
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
getMpLink: () =>
|
getMpLink: () =>
|
||||||
request({
|
request({
|
||||||
url: 'app/mplive/getMpLink',
|
url: 'app/mplive/getMpLink',
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@ const PayChannelApi = {
|
|||||||
return request({
|
return request({
|
||||||
url: '/pay/channel/get-enable-code-list',
|
url: '/pay/channel/get-enable-code-list',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { appId }
|
params: { appId },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@ const PayOrderApi = {
|
|||||||
return request({
|
return request({
|
||||||
url: '/pay/order/get',
|
url: '/pay/order/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { id }
|
params: { id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 提交支付订单
|
// 提交支付订单
|
||||||
@ -14,9 +14,9 @@ const PayOrderApi = {
|
|||||||
return request({
|
return request({
|
||||||
url: '/pay/order/submit',
|
url: '/pay/order/submit',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data
|
data,
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PayOrderApi;
|
export default PayOrderApi;
|
||||||
|
@ -31,7 +31,7 @@ const SpuHistoryApi = {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
data,
|
data,
|
||||||
custom: {
|
custom: {
|
||||||
showLoading: false
|
showLoading: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,7 @@ export default {
|
|||||||
return request({
|
return request({
|
||||||
url: '/promotion/article/get',
|
url: '/promotion/article/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { id, title }
|
params: { id, title },
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
@ -47,9 +47,9 @@ const CombinationApi = {
|
|||||||
// 获得我的拼团记录分页
|
// 获得我的拼团记录分页
|
||||||
getCombinationRecordPage: (params) => {
|
getCombinationRecordPage: (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: "/promotion/combination-record/page",
|
url: '/promotion/combination-record/page',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params
|
params,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ const CouponApi = {
|
|||||||
showLoading: false, // 避免影响 settlementOrder 结算的结果
|
showLoading: false, // 避免影响 settlementOrder 结算的结果
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CouponApi;
|
export default CouponApi;
|
||||||
|
@ -16,7 +16,7 @@ const DiyApi = {
|
|||||||
url: '/promotion/diy-template/get',
|
url: '/promotion/diy-template/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
id
|
id,
|
||||||
},
|
},
|
||||||
custom: {
|
custom: {
|
||||||
showError: false,
|
showError: false,
|
||||||
@ -29,8 +29,8 @@ const DiyApi = {
|
|||||||
url: '/promotion/diy-page/get',
|
url: '/promotion/diy-page/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
id
|
id,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,7 @@ const RewardActivityApi = {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { id },
|
params: { id },
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default RewardActivityApi;
|
export default RewardActivityApi;
|
@ -1,4 +1,4 @@
|
|||||||
import request from "@/sheep/request";
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const SeckillApi = {
|
const SeckillApi = {
|
||||||
// 获得秒杀时间段列表
|
// 获得秒杀时间段列表
|
||||||
@ -25,9 +25,9 @@ const SeckillApi = {
|
|||||||
return request({
|
return request({
|
||||||
url: 'promotion/seckill-activity/get-detail',
|
url: 'promotion/seckill-activity/get-detail',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { id }
|
params: { id },
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
export default SeckillApi;
|
export default SeckillApi;
|
||||||
|
@ -5,7 +5,7 @@ const AreaApi = {
|
|||||||
getAreaTree: () => {
|
getAreaTree: () => {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/area/tree',
|
url: '/system/area/tree',
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -57,7 +57,7 @@ const AfterSaleApi = {
|
|||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AfterSaleApi;
|
export default AfterSaleApi;
|
||||||
|
@ -6,14 +6,14 @@ const BrokerageApi = {
|
|||||||
return request({
|
return request({
|
||||||
url: '/trade/brokerage-user/bind',
|
url: '/trade/brokerage-user/bind',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data
|
data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得个人分销信息
|
// 获得个人分销信息
|
||||||
getBrokerageUser: () => {
|
getBrokerageUser: () => {
|
||||||
return request({
|
return request({
|
||||||
url: '/trade/brokerage-user/get',
|
url: '/trade/brokerage-user/get',
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得个人分销统计
|
// 获得个人分销统计
|
||||||
@ -24,12 +24,12 @@ const BrokerageApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得分销记录分页
|
// 获得分销记录分页
|
||||||
getBrokerageRecordPage: params => {
|
getBrokerageRecordPage: (params) => {
|
||||||
if (params.status === undefined) {
|
if (params.status === undefined) {
|
||||||
delete params.status
|
delete params.status;
|
||||||
}
|
}
|
||||||
const queryString = Object.keys(params)
|
const queryString = Object.keys(params)
|
||||||
.map(key => encodeURIComponent(key) + '=' + params[key])
|
.map((key) => encodeURIComponent(key) + '=' + params[key])
|
||||||
.join('&');
|
.join('&');
|
||||||
return request({
|
return request({
|
||||||
url: `/trade/brokerage-record/page?${queryString}`,
|
url: `/trade/brokerage-record/page?${queryString}`,
|
||||||
@ -37,7 +37,7 @@ const BrokerageApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 创建分销提现
|
// 创建分销提现
|
||||||
createBrokerageWithdraw: data => {
|
createBrokerageWithdraw: (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/trade/brokerage-withdraw/create',
|
url: '/trade/brokerage-withdraw/create',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -45,15 +45,15 @@ const BrokerageApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得商品的分销金额
|
// 获得商品的分销金额
|
||||||
getProductBrokeragePrice: spuId => {
|
getProductBrokeragePrice: (spuId) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/trade/brokerage-record/get-product-brokerage-price',
|
url: '/trade/brokerage-record/get-product-brokerage-price',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { spuId }
|
params: { spuId },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得分销用户排行(基于佣金)
|
// 获得分销用户排行(基于佣金)
|
||||||
getRankByPrice: params => {
|
getRankByPrice: (params) => {
|
||||||
const queryString = `times=${params.times[0]}×=${params.times[1]}`;
|
const queryString = `times=${params.times[0]}×=${params.times[1]}`;
|
||||||
return request({
|
return request({
|
||||||
url: `/trade/brokerage-user/get-rank-by-price?${queryString}`,
|
url: `/trade/brokerage-user/get-rank-by-price?${queryString}`,
|
||||||
@ -61,9 +61,9 @@ const BrokerageApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得分销用户排行分页(基于佣金)
|
// 获得分销用户排行分页(基于佣金)
|
||||||
getBrokerageUserChildSummaryPageByPrice: params => {
|
getBrokerageUserChildSummaryPageByPrice: (params) => {
|
||||||
const queryString = Object.keys(params)
|
const queryString = Object.keys(params)
|
||||||
.map(key => encodeURIComponent(key) + '=' + params[key])
|
.map((key) => encodeURIComponent(key) + '=' + params[key])
|
||||||
.join('&');
|
.join('&');
|
||||||
return request({
|
return request({
|
||||||
url: `/trade/brokerage-user/rank-page-by-price?${queryString}`,
|
url: `/trade/brokerage-user/rank-page-by-price?${queryString}`,
|
||||||
@ -71,9 +71,9 @@ const BrokerageApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得分销用户排行分页(基于用户量)
|
// 获得分销用户排行分页(基于用户量)
|
||||||
getBrokerageUserRankPageByUserCount: params => {
|
getBrokerageUserRankPageByUserCount: (params) => {
|
||||||
const queryString = Object.keys(params)
|
const queryString = Object.keys(params)
|
||||||
.map(key => encodeURIComponent(key) + '=' + params[key])
|
.map((key) => encodeURIComponent(key) + '=' + params[key])
|
||||||
.join('&');
|
.join('&');
|
||||||
return request({
|
return request({
|
||||||
url: `/trade/brokerage-user/rank-page-by-user-count?${queryString}`,
|
url: `/trade/brokerage-user/rank-page-by-user-count?${queryString}`,
|
||||||
@ -81,13 +81,13 @@ const BrokerageApi = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获得下级分销统计分页
|
// 获得下级分销统计分页
|
||||||
getBrokerageUserChildSummaryPage: params => {
|
getBrokerageUserChildSummaryPage: (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/trade/brokerage-user/child-summary-page',
|
url: '/trade/brokerage-user/child-summary-page',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params,
|
params,
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
export default BrokerageApi
|
export default BrokerageApi;
|
||||||
|
@ -9,21 +9,21 @@ const CartApi = {
|
|||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '已添加到购物车~',
|
successMsg: '已添加到购物车~',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateCartCount: (data) => {
|
updateCartCount: (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/trade/cart/update-count',
|
url: '/trade/cart/update-count',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: data
|
data: data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateCartSelected: (data) => {
|
updateCartSelected: (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/trade/cart/update-selected',
|
url: '/trade/cart/update-selected',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: data
|
data: data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteCart: (ids) => {
|
deleteCart: (ids) => {
|
||||||
@ -31,8 +31,8 @@ const CartApi = {
|
|||||||
url: '/trade/cart/delete',
|
url: '/trade/cart/delete',
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
params: {
|
params: {
|
||||||
ids
|
ids,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getCartList: () => {
|
getCartList: () => {
|
||||||
|
@ -7,7 +7,7 @@ const DeliveryApi = {
|
|||||||
url: `/trade/delivery/express/list`,
|
url: `/trade/delivery/express/list`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DeliveryApi;
|
export default DeliveryApi;
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
const emits = defineEmits(['close']);
|
const emits = defineEmits(['close']);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
activityInfo: computed(() => props.modelValue),
|
activityInfo: computed(() => props.modelValue),
|
||||||
activityMap: {}
|
activityMap: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@ -51,13 +51,13 @@
|
|||||||
() => {
|
() => {
|
||||||
// 展示的情况下,加载每个活动的详细信息
|
// 展示的情况下,加载每个活动的详细信息
|
||||||
if (props.show) {
|
if (props.show) {
|
||||||
state.activityInfo?.forEach(activity => {
|
state.activityInfo?.forEach((activity) => {
|
||||||
RewardActivityApi.getRewardActivity(activity.id).then(res => {
|
RewardActivityApi.getRewardActivity(activity.id).then((res) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.activityMap[activity.id] = res.data;
|
state.activityMap[activity.id] = res.data;
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -18,9 +18,7 @@
|
|||||||
<view class="address-text">
|
<view class="address-text">
|
||||||
{{ props.item.detailAddress }}
|
{{ props.item.detailAddress }}
|
||||||
</view>
|
</view>
|
||||||
<view class="person-text">
|
<view class="person-text"> {{ props.item.name }} {{ props.item.mobile }} </view>
|
||||||
{{ props.item.name }} {{ props.item.mobile }}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<view class="address-text ss-m-b-10">请选择收货地址</view>
|
<view class="address-text ss-m-b-10">请选择收货地址</view>
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
|
|
||||||
// 同意协议
|
// 同意协议
|
||||||
if (!props.agreeStatus) {
|
if (!props.agreeStatus) {
|
||||||
emits('onConfirm', true)
|
emits('onConfirm', true);
|
||||||
sheep.$helper.toast('请勾选同意');
|
sheep.$helper.toast('请勾选同意');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,7 @@
|
|||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
|
|
||||||
<button class="ss-reset-button type-btn" @tap="closeAuthModal">
|
<button class="ss-reset-button type-btn" @tap="closeAuthModal"> 取消修改 </button>
|
||||||
取消修改
|
|
||||||
</button>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 成功后,用户重新登录
|
// 成功后,用户重新登录
|
||||||
showAuthModal('accountLogin')
|
showAuthModal('accountLogin');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!props.agreeStatus) {
|
if (!props.agreeStatus) {
|
||||||
emits('onConfirm', true)
|
emits('onConfirm', true);
|
||||||
sheep.$helper.toast('请勾选同意');
|
sheep.$helper.toast('请勾选同意');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,11 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 2. 短信登录 smsLogin -->
|
<!-- 2. 短信登录 smsLogin -->
|
||||||
<sms-login v-if="authType === 'smsLogin'" :agreeStatus="state.protocol" @onConfirm="onConfirm" />
|
<sms-login
|
||||||
|
v-if="authType === 'smsLogin'"
|
||||||
|
:agreeStatus="state.protocol"
|
||||||
|
@onConfirm="onConfirm"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 3. 忘记密码 resetPassword-->
|
<!-- 3. 忘记密码 resetPassword-->
|
||||||
<reset-password v-if="authType === 'resetPassword'" />
|
<reset-password v-if="authType === 'resetPassword'" />
|
||||||
@ -32,7 +36,11 @@
|
|||||||
<!-- 7.1 微信小程序的快捷登录 -->
|
<!-- 7.1 微信小程序的快捷登录 -->
|
||||||
<view v-if="sheep.$platform.name === 'WechatMiniProgram'" class="ss-flex register-box">
|
<view v-if="sheep.$platform.name === 'WechatMiniProgram'" class="ss-flex register-box">
|
||||||
<view class="register-title">还没有账号?</view>
|
<view class="register-title">还没有账号?</view>
|
||||||
<button class="ss-reset-button login-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
<button
|
||||||
|
class="ss-reset-button login-btn"
|
||||||
|
open-type="getPhoneNumber"
|
||||||
|
@getphonenumber="getPhoneNumber"
|
||||||
|
>
|
||||||
快捷登录
|
快捷登录
|
||||||
</button>
|
</button>
|
||||||
<view class="circle" />
|
<view class="circle" />
|
||||||
@ -81,13 +89,9 @@
|
|||||||
/>
|
/>
|
||||||
<view class="agreement-text ss-flex ss-col-center ss-m-l-8">
|
<view class="agreement-text ss-flex ss-col-center ss-m-l-8">
|
||||||
我已阅读并遵守
|
我已阅读并遵守
|
||||||
<view class="tcp-text" @tap.stop="onProtocol('用户协议')">
|
<view class="tcp-text" @tap.stop="onProtocol('用户协议')"> 《用户协议》 </view>
|
||||||
《用户协议》
|
|
||||||
</view>
|
|
||||||
<view class="agreement-text">与</view>
|
<view class="agreement-text">与</view>
|
||||||
<view class="tcp-text" @tap.stop="onProtocol('隐私协议')">
|
<view class="tcp-text" @tap.stop="onProtocol('隐私协议')"> 《隐私协议》 </view>
|
||||||
《隐私协议》
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</label>
|
</label>
|
||||||
</view>
|
</view>
|
||||||
|
@ -44,7 +44,24 @@
|
|||||||
<!-- 营销组件:优惠券 -->
|
<!-- 营销组件:优惠券 -->
|
||||||
<s-coupon-block v-if="type === 'CouponCard'" :data="data" :styles="styles" />
|
<s-coupon-block v-if="type === 'CouponCard'" :data="data" :styles="styles" />
|
||||||
<!-- 营销组件:文章 -->
|
<!-- 营销组件:文章 -->
|
||||||
<s-richtext-block v-if="type === 'PromotionArticle'" :data="data" :styles="styles" />
|
<!-- <s-richtext-block v-if="type === 'PromotionArticle'" :data="data" :styles="styles" /> -->
|
||||||
|
<view class="floxt" v-if="type === 'PromotionArticle'" >
|
||||||
|
<view class="addClass" v-for="(item, index) in state.model" @click="path(item.id)">
|
||||||
|
<view class="image">
|
||||||
|
<image
|
||||||
|
:src="item.picUrl"
|
||||||
|
alt="" />
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
<view class="top">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="bottom">
|
||||||
|
{{item.createTime}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 用户组件:用户卡片 -->
|
<!-- 用户组件:用户卡片 -->
|
||||||
<s-user-card v-if="type === 'UserCard'" />
|
<s-user-card v-if="type === 'UserCard'" />
|
||||||
@ -58,6 +75,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { ref, reactive, unref } from 'vue';
|
||||||
|
import AddressApi from '@/sheep/api/member/address';
|
||||||
|
const state = reactive({
|
||||||
|
model: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const ff = async (id) => {
|
||||||
|
let { code, data } = await AddressApi.textList();
|
||||||
|
state.model = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
ff();
|
||||||
/**
|
/**
|
||||||
* 装修组件 - 组件集
|
* 装修组件 - 组件集
|
||||||
*/
|
*/
|
||||||
@ -75,7 +104,49 @@
|
|||||||
default () {},
|
default () {},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
function onSearch() {}
|
|
||||||
|
function path(id) {
|
||||||
|
// $u.route({url:'/pages/goods/index',params:{id:'14'}})
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/mulu/mulu?id=${id}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style scoped lang="scss">
|
||||||
|
.floxt {
|
||||||
|
width: 100%;
|
||||||
|
.addClass {
|
||||||
|
background:white;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
margin:20rpx 0;
|
||||||
|
// padding: 40rpx;
|
||||||
|
// padding-right: 0;
|
||||||
|
// height: 200rpx;
|
||||||
|
.image {
|
||||||
|
width: 250rpx;
|
||||||
|
height: 156rpx;
|
||||||
|
margin-right: 18rpx;
|
||||||
|
padding:20rpx 20rpx;
|
||||||
|
image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
// text-align: center;
|
||||||
|
padding:20rpx 20rpx;
|
||||||
|
flex:1;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -21,8 +21,7 @@
|
|||||||
|
|
||||||
const elBackground = computed(() => {
|
const elBackground = computed(() => {
|
||||||
if (props.styles) {
|
if (props.styles) {
|
||||||
if (props.styles.bgType === 'color')
|
if (props.styles.bgType === 'color') return { background: props.styles.bgColor };
|
||||||
return { background: props.styles.bgColor };
|
|
||||||
if (props.styles.bgType === 'img')
|
if (props.styles.bgType === 'img')
|
||||||
return {
|
return {
|
||||||
background: `url(${sheep.$url.cdn(
|
background: `url(${sheep.$url.cdn(
|
||||||
|
@ -1,76 +1,106 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="time" :style="justifyLeft">
|
<view class="time" :style="justifyLeft">
|
||||||
<text class="" v-if="tipText">{{ tipText }}</text>
|
<text class="" v-if="tipText">{{ tipText }}</text>
|
||||||
<text class="styleAll p6" v-if="isDay === true"
|
<text
|
||||||
:style="{background:bgColor.bgColor,color:bgColor.Color}">{{ day }}{{bgColor.isDay?'天':''}}</text>
|
class="styleAll p6"
|
||||||
<text class="timeTxt" v-if="dayText"
|
v-if="isDay === true"
|
||||||
:style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ dayText }}</text>
|
:style="{ background: bgColor.bgColor, color: bgColor.Color }"
|
||||||
<text class="styleAll" :class='isCol?"timeCol":""'
|
>{{ day }}{{ bgColor.isDay ? '天' : '' }}</text
|
||||||
:style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ hour }}</text>
|
>
|
||||||
<text class="timeTxt" v-if="hourText" :class='isCol?"whit":""'
|
<text
|
||||||
:style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ hourText }}</text>
|
class="timeTxt"
|
||||||
<text class="styleAll" :class='isCol?"timeCol":""'
|
v-if="dayText"
|
||||||
:style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ minute }}</text>
|
:style="{ width: bgColor.timeTxtwidth, color: bgColor.bgColor }"
|
||||||
<text class="timeTxt" v-if="minuteText" :class='isCol?"whit":""'
|
>{{ dayText }}</text
|
||||||
:style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ minuteText }}</text>
|
>
|
||||||
<text class="styleAll" :class='isCol?"timeCol":""'
|
<text
|
||||||
:style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ second }}</text>
|
class="styleAll"
|
||||||
|
:class="isCol ? 'timeCol' : ''"
|
||||||
|
:style="{ background: bgColor.bgColor, color: bgColor.Color, width: bgColor.width }"
|
||||||
|
>{{ hour }}</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="timeTxt"
|
||||||
|
v-if="hourText"
|
||||||
|
:class="isCol ? 'whit' : ''"
|
||||||
|
:style="{ width: bgColor.timeTxtwidth, color: bgColor.bgColor }"
|
||||||
|
>{{ hourText }}</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="styleAll"
|
||||||
|
:class="isCol ? 'timeCol' : ''"
|
||||||
|
:style="{ background: bgColor.bgColor, color: bgColor.Color, width: bgColor.width }"
|
||||||
|
>{{ minute }}</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="timeTxt"
|
||||||
|
v-if="minuteText"
|
||||||
|
:class="isCol ? 'whit' : ''"
|
||||||
|
:style="{ width: bgColor.timeTxtwidth, color: bgColor.bgColor }"
|
||||||
|
>{{ minuteText }}</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="styleAll"
|
||||||
|
:class="isCol ? 'timeCol' : ''"
|
||||||
|
:style="{ background: bgColor.bgColor, color: bgColor.Color, width: bgColor.width }"
|
||||||
|
>{{ second }}</text
|
||||||
|
>
|
||||||
<text class="timeTxt" v-if="secondText">{{ secondText }}</text>
|
<text class="timeTxt" v-if="secondText">{{ secondText }}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "countDown",
|
name: 'countDown',
|
||||||
props: {
|
props: {
|
||||||
justifyLeft: {
|
justifyLeft: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: '',
|
||||||
},
|
},
|
||||||
//距离开始提示文字
|
//距离开始提示文字
|
||||||
tipText: {
|
tipText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "倒计时"
|
default: '倒计时',
|
||||||
},
|
},
|
||||||
dayText: {
|
dayText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "天"
|
default: '天',
|
||||||
},
|
},
|
||||||
hourText: {
|
hourText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "时"
|
default: '时',
|
||||||
},
|
},
|
||||||
minuteText: {
|
minuteText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "分"
|
default: '分',
|
||||||
},
|
},
|
||||||
secondText: {
|
secondText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "秒"
|
default: '秒',
|
||||||
},
|
},
|
||||||
datatime: {
|
datatime: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0,
|
||||||
},
|
},
|
||||||
isDay: {
|
isDay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
},
|
},
|
||||||
isCol: {
|
isCol: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
},
|
},
|
||||||
bgColor: {
|
bgColor: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
day: "00",
|
day: '00',
|
||||||
hour: "00",
|
hour: '00',
|
||||||
minute: "00",
|
minute: '00',
|
||||||
second: "00"
|
second: '00',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
@ -97,29 +127,25 @@
|
|||||||
}
|
}
|
||||||
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
|
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
|
||||||
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
|
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
|
||||||
second =
|
second = Math.floor(intDiff) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60;
|
||||||
Math.floor(intDiff) -
|
if (hour <= 9) hour = '0' + hour;
|
||||||
day * 24 * 60 * 60 -
|
if (minute <= 9) minute = '0' + minute;
|
||||||
hour * 60 * 60 -
|
if (second <= 9) second = '0' + second;
|
||||||
minute * 60;
|
|
||||||
if (hour <= 9) hour = "0" + hour;
|
|
||||||
if (minute <= 9) minute = "0" + minute;
|
|
||||||
if (second <= 9) second = "0" + second;
|
|
||||||
that.day = day;
|
that.day = day;
|
||||||
that.hour = hour;
|
that.hour = hour;
|
||||||
that.minute = minute;
|
that.minute = minute;
|
||||||
that.second = second;
|
that.second = second;
|
||||||
} else {
|
} else {
|
||||||
that.day = "00";
|
that.day = '00';
|
||||||
that.hour = "00";
|
that.hour = '00';
|
||||||
that.minute = "00";
|
that.minute = '00';
|
||||||
that.second = "00";
|
that.second = '00';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
runTime();
|
runTime();
|
||||||
setInterval(runTime, 1000);
|
setInterval(runTime, 1000);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -168,6 +194,6 @@
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
font-size: 24rpx; */
|
font-size: 24rpx; */
|
||||||
color: #E93323;
|
color: #e93323;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -47,8 +47,8 @@
|
|||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import CouponApi from '@/sheep/api/promotion/coupon';
|
import CouponApi from '@/sheep/api/promotion/coupon';
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { CouponTemplateValidityTypeEnum, PromotionDiscountTypeEnum } from "@/sheep/util/const";
|
import { CouponTemplateValidityTypeEnum, PromotionDiscountTypeEnum } from '@/sheep/util/const';
|
||||||
import { floatToFixed2, formatDate } from "@/sheep/util";
|
import { floatToFixed2, formatDate } from '@/sheep/util';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
@ -61,7 +61,7 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const { columns, button } = props.data;
|
const { columns, button } = props.data;
|
||||||
const SIZE_LIST = ['lg', 'md', 'xs']
|
const SIZE_LIST = ['lg', 'md', 'xs'];
|
||||||
const couponBg = {
|
const couponBg = {
|
||||||
background: `url(${sheep.$url.cdn(props.data.bgImg)}) no-repeat top center / 100% 100%`,
|
background: `url(${sheep.$url.cdn(props.data.bgImg)}) no-repeat top center / 100% 100%`,
|
||||||
};
|
};
|
||||||
@ -73,35 +73,35 @@
|
|||||||
// 格式化【折扣类型】
|
// 格式化【折扣类型】
|
||||||
const formatCouponDiscountType = (coupon) => {
|
const formatCouponDiscountType = (coupon) => {
|
||||||
if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
|
if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
|
||||||
return 'reduce'
|
return 'reduce';
|
||||||
}
|
}
|
||||||
if (coupon.discountType === PromotionDiscountTypeEnum.PERCENT.type) {
|
if (coupon.discountType === PromotionDiscountTypeEnum.PERCENT.type) {
|
||||||
return 'percent'
|
return 'percent';
|
||||||
}
|
|
||||||
return `未知【${coupon.discountType}】`
|
|
||||||
}
|
}
|
||||||
|
return `未知【${coupon.discountType}】`;
|
||||||
|
};
|
||||||
|
|
||||||
// 格式化【折扣】
|
// 格式化【折扣】
|
||||||
const formatCouponDiscountValue = (coupon) => {
|
const formatCouponDiscountValue = (coupon) => {
|
||||||
if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
|
if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
|
||||||
return floatToFixed2(coupon.discountPrice)
|
return floatToFixed2(coupon.discountPrice);
|
||||||
}
|
}
|
||||||
if (coupon.discountType === PromotionDiscountTypeEnum.PERCENT.type) {
|
if (coupon.discountType === PromotionDiscountTypeEnum.PERCENT.type) {
|
||||||
return coupon.discountPercent
|
return coupon.discountPercent;
|
||||||
}
|
|
||||||
return `未知【${coupon.discountType}】`
|
|
||||||
}
|
}
|
||||||
|
return `未知【${coupon.discountType}】`;
|
||||||
|
};
|
||||||
|
|
||||||
// 格式化【有效期限】
|
// 格式化【有效期限】
|
||||||
const formatValidityType = (row) => {
|
const formatValidityType = (row) => {
|
||||||
if (row.validityType === CouponTemplateValidityTypeEnum.DATE.type) {
|
if (row.validityType === CouponTemplateValidityTypeEnum.DATE.type) {
|
||||||
return `${formatDate(row.validStartTime)} 至 ${formatDate(row.validEndTime)}`
|
return `${formatDate(row.validStartTime)} 至 ${formatDate(row.validEndTime)}`;
|
||||||
}
|
}
|
||||||
if (row.validityType === CouponTemplateValidityTypeEnum.TERM.type) {
|
if (row.validityType === CouponTemplateValidityTypeEnum.TERM.type) {
|
||||||
return `领取后第 ${row.fixedStartTerm} - ${row.fixedEndTerm} 天内可用`
|
return `领取后第 ${row.fixedStartTerm} - ${row.fixedEndTerm} 天内可用`;
|
||||||
}
|
|
||||||
return '未知【' + row.validityType + '】'
|
|
||||||
}
|
}
|
||||||
|
return '未知【' + row.validityType + '】';
|
||||||
|
};
|
||||||
|
|
||||||
const couponList = ref([]);
|
const couponList = ref([]);
|
||||||
// 立即领取优惠券
|
// 立即领取优惠券
|
||||||
@ -112,16 +112,16 @@
|
|||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
await getCouponTemplateList()
|
await getCouponTemplateList();
|
||||||
}
|
}
|
||||||
const getCouponTemplateList = async () => {
|
const getCouponTemplateList = async () => {
|
||||||
const { data } = await CouponApi.getCouponTemplateListByIds(props.data.couponIds.join(','));
|
const { data } = await CouponApi.getCouponTemplateListByIds(props.data.couponIds.join(','));
|
||||||
couponList.value = data;
|
couponList.value = data;
|
||||||
}
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getCouponTemplateList()
|
getCouponTemplateList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
<!-- 装修用户组件:用户卡券 -->
|
<!-- 装修用户组件:用户卡券 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="ss-coupon-menu-wrap ss-flex ss-col-center">
|
<view class="ss-coupon-menu-wrap ss-flex ss-col-center">
|
||||||
<view class="menu-item ss-flex-col ss-row-center ss-col-center" v-for="item in props.list" :key="item.title"
|
<view
|
||||||
|
class="menu-item ss-flex-col ss-row-center ss-col-center"
|
||||||
|
v-for="item in props.list"
|
||||||
|
:key="item.title"
|
||||||
@tap="sheep.$router.go(item.path, { type: item.type })"
|
@tap="sheep.$router.go(item.path, { type: item.type })"
|
||||||
:class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'">
|
:class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'"
|
||||||
|
>
|
||||||
<image class="item-icon" :src="sheep.$url.static(item.icon)" mode="aspectFit"></image>
|
<image class="item-icon" :src="sheep.$url.static(item.icon)" mode="aspectFit"></image>
|
||||||
<view class="menu-title ss-m-t-28">{{ item.title }}</view>
|
<view class="menu-title ss-m-t-28">{{ item.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -21,7 +25,8 @@
|
|||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default() {
|
||||||
return [{
|
return [
|
||||||
|
{
|
||||||
title: '已领取',
|
title: '已领取',
|
||||||
value: '0',
|
value: '0',
|
||||||
icon: '/static/img/shop/order/nouse_coupon.png',
|
icon: '/static/img/shop/order/nouse_coupon.png',
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
const emits = defineEmits(['get', 'close']);
|
const emits = defineEmits(['get', 'close']);
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
couponInfo: computed(() => props.modelValue)
|
couponInfo: computed(() => props.modelValue),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 领取优惠劵
|
// 领取优惠劵
|
||||||
|
@ -42,18 +42,11 @@
|
|||||||
>
|
>
|
||||||
有效期:领取后 {{ data.fixedEndTerm }} 天内可用
|
有效期:领取后 {{ data.fixedEndTerm }} 天内可用
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="sellby-text" :class="isDisable ? 'disabled-color' : 'subtitle-color'" v-else>
|
||||||
class="sellby-text"
|
|
||||||
:class=" isDisable ? 'disabled-color' : 'subtitle-color'"
|
|
||||||
v-else
|
|
||||||
>
|
|
||||||
有效期: {{ sheep.$helper.timeFormat(data.validStartTime, 'yyyy-mm-dd') }} 至
|
有效期: {{ sheep.$helper.timeFormat(data.validStartTime, 'yyyy-mm-dd') }} 至
|
||||||
{{ sheep.$helper.timeFormat(data.validEndTime, 'yyyy-mm-dd') }}
|
{{ sheep.$helper.timeFormat(data.validEndTime, 'yyyy-mm-dd') }}
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="value-enough" :class="isDisable ? 'disabled-color' : 'subtitle-color'">
|
||||||
class="value-enough"
|
|
||||||
:class="isDisable ? 'disabled-color' : 'subtitle-color'"
|
|
||||||
>
|
|
||||||
满 {{ fen2yuan(data.usePrice) }} 可用
|
满 {{ fen2yuan(data.usePrice) }} 可用
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -55,7 +55,8 @@
|
|||||||
import { computed, reactive } from 'vue';
|
import { computed, reactive } from 'vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: { // 优惠劵列表
|
modelValue: {
|
||||||
|
// 优惠劵列表
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {},
|
default() {},
|
||||||
},
|
},
|
||||||
@ -84,7 +85,7 @@
|
|||||||
// 确认优惠劵
|
// 确认优惠劵
|
||||||
const onConfirm = () => {
|
const onConfirm = () => {
|
||||||
emits('confirm', state.couponId);
|
emits('confirm', state.couponId);
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep() {
|
:deep() {
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
background:
|
background:
|
||||||
props.data.bgType === 'img' && props.data.bgImg
|
props.data.bgType === 'img' && props.data.bgImg
|
||||||
? `url(${sheep.$url.cdn(props.data.bgImg)}) no-repeat top center / 100% 100%`
|
? `url(${sheep.$url.cdn(props.data.bgImg)}) no-repeat top center / 100% 100%`
|
||||||
: props.data.bgColor
|
: props.data.bgColor,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
// 左侧按钮:返回上一页或首页
|
// 左侧按钮:返回上一页或首页
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {},
|
default() {},
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
// 悬浮按钮配置: https://uniapp.dcloud.net.cn/component/uniui/uni-fab.html#fab-props
|
// 悬浮按钮配置: https://uniapp.dcloud.net.cn/component/uniui/uni-fab.html#fab-props
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@ -46,7 +46,7 @@
|
|||||||
state.direction = props.data.direction;
|
state.direction = props.data.direction;
|
||||||
props.data?.list.forEach((item) => {
|
props.data?.list.forEach((item) => {
|
||||||
// 按钮文字
|
// 按钮文字
|
||||||
const text = props.data?.showText ? item.text : ''
|
const text = props.data?.showText ? item.text : '';
|
||||||
// 生成内容配置项
|
// 生成内容配置项
|
||||||
state.content.push({ iconPath: sheep.$url.cdn(item.imgUrl), url: item.url, text });
|
state.content.push({ iconPath: sheep.$url.cdn(item.imgUrl), url: item.url, text });
|
||||||
// 生成样式配置项
|
// 生成样式配置项
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user