202507031743

This commit is contained in:
张潘 2025-07-03 17:43:38 +08:00
parent b3eeffe6ad
commit 9badb89994
13 changed files with 292 additions and 34 deletions

View File

@ -131,6 +131,9 @@ public class AppletController extends BaseController {
private IUsersInvoiceInfoService usersInvoiceInfoService; private IUsersInvoiceInfoService usersInvoiceInfoService;
@Autowired @Autowired
private IUserGroupBuyingService userGroupBuyingService; private IUserGroupBuyingService userGroupBuyingService;
@Autowired
private IUserSecondaryCardService userSecondaryCardService;
/** /**
* 获取服务分类列表 * 获取服务分类列表
* *
@ -6901,11 +6904,71 @@ public AjaxResult checkUserDefault(HttpServletRequest request) {
@GetMapping("/api/secondary/classification")
public AjaxResult classification(HttpServletRequest request) {
try {
List<ServiceCate> list = serviceCateService.selectServiceCateCiKaList();
return AppletControllerUtil.appletSuccess(list);
} catch (Exception e) {
System.err.println("验证用户图像和昵称异常:" + e.getMessage());
return AppletControllerUtil.appletError("验证失败:" + e.getMessage());
}
}
/** /**
* 拼团支付接口 * 拼团支付接口
* IUserGroupBuyingService userGroupBuyingService; * IUserGroupBuyingService userGroupBuyingService;
*/ */
@PostMapping("/api/secondary/card/list")
public AjaxResult getSecondaryCardList(@RequestBody Map<String, Object> params, HttpServletRequest request) {
try {
// 1. 获取并验证分页参数
int page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) : 1;
int limit = params.get("limit") != null ? Integer.parseInt(params.get("limit").toString()) : 15;
Map<String, Object> pageValidation = PageUtil.validatePageParams(page, limit);
if (!(Boolean) pageValidation.get("valid")) {
return AppletControllerUtil.appletWarning((String) pageValidation.get("message"));
}
// 2. 获取type参数
Long type = params.get("type") != null ? Long.parseLong(params.get("type").toString()) : null;
// 3. 创建查询对象
UserSecondaryCard queryParams = new UserSecondaryCard();
queryParams.setStatus(1L); // 只查询状态为1的数据
if (type != null) {
queryParams.setType(type);
}
// 4. 设置分页参数
PageHelper.startPage(page, limit);
// 5. 执行查询
List<UserSecondaryCard> list = userSecondaryCardService.selectUserSecondaryCardList(queryParams);
for (UserSecondaryCard card : list) {
List<String> idsList = com.alibaba.fastjson2.JSONArray.parseArray(card.getGoodsids(), String.class);
card.setServiceDetail(serviceGoodsService.selectServiceGoodsfrocikaList(idsList));
}
// 6. 获取分页信息并构建响应
TableDataInfo tableDataInfo = getDataTable(list);
// 7. 构建符合要求的分页响应格式
Map<String, Object> pageData = PageUtil.buildPageResponse(tableDataInfo, page, limit);
return AppletControllerUtil.appletSuccess(pageData);
} catch (Exception e) {
System.err.println("查询次卡列表异常:" + e.getMessage());
return AppletControllerUtil.appletError("获取次卡列表失败:" + e.getMessage());
}
}
@PostMapping("api/group/once_pay") @PostMapping("api/group/once_pay")
public AjaxResult apigroupOncePay(@RequestBody Map<String, Object> params, HttpServletRequest request) { public AjaxResult apigroupOncePay(@RequestBody Map<String, Object> params, HttpServletRequest request) {
// 1. 验证用户登录状态 // 1. 验证用户登录状态

View File

@ -8,6 +8,8 @@ import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.ruoyi.system.ControllerUtil.GenerateCustomCode; import com.ruoyi.system.ControllerUtil.GenerateCustomCode;
import com.ruoyi.system.domain.QuoteMaterial; import com.ruoyi.system.domain.QuoteMaterial;
import com.ruoyi.system.domain.ServiceCate;
import com.ruoyi.system.service.IServiceCateService;
import com.ruoyi.system.service.IServiceGoodsService; import com.ruoyi.system.service.IServiceGoodsService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -44,6 +46,9 @@ public class UserSecondaryCardController extends BaseController
@Autowired @Autowired
private IServiceGoodsService serviceGoodsService; private IServiceGoodsService serviceGoodsService;
@Autowired
private IServiceCateService serviceCateService;
/** /**
@ -60,6 +65,11 @@ public class UserSecondaryCardController extends BaseController
for(UserSecondaryCard t:list){ for(UserSecondaryCard t:list){
List<String> idsList = com.alibaba.fastjson2.JSONArray.parseArray(t.getGoodsids(), String.class); List<String> idsList = com.alibaba.fastjson2.JSONArray.parseArray(t.getGoodsids(), String.class);
t.setGoodsname(serviceGoodsService.selectTitlesJSONArrayByIds(idsList)); t.setGoodsname(serviceGoodsService.selectTitlesJSONArrayByIds(idsList));
ServiceCate serviceCate = serviceCateService.selectServiceCateById(t.getType());
if(serviceCate!=null){
t.setTypename(serviceCate.getTitle());
}
} }
return getDataTable(list); return getDataTable(list);
} }

View File

@ -69,6 +69,13 @@ public class UserMemnerConsumptionLog extends BaseEntity
@Excel(name = "删除标记") @Excel(name = "删除标记")
private Integer del; private Integer del;
/** 删除标记 */
@Excel(name = "数据类别 1:收入 2:支出")
private Integer type;
public void setId(Integer id) public void setId(Integer id)
{ {
this.id = id; this.id = id;
@ -199,6 +206,14 @@ public class UserMemnerConsumptionLog extends BaseEntity
return del; return del;
} }
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -2,6 +2,9 @@ package com.ruoyi.system.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -37,6 +40,13 @@ public class UserSecondaryCard extends BaseEntity
@Excel(name = "服务名称") @Excel(name = "服务名称")
private String goodsname; private String goodsname;
/** 服务id */
@Excel(name = "简介")
private String introduction;
/** 展示价格 */ /** 展示价格 */
@Excel(name = "展示价格") @Excel(name = "展示价格")
private BigDecimal showMoney; private BigDecimal showMoney;
@ -70,10 +80,19 @@ public class UserSecondaryCard extends BaseEntity
@Excel(name = "分类") @Excel(name = "分类")
private Long type; private Long type;
/** 分类 */
@Excel(name = "分类名称")
private String typename;
/** 可提供服务数 */ /** 可提供服务数 */
@Excel(name = "可提供服务数") @Excel(name = "可提供服务数")
private Long num; private Long num;
/** 可提供服务数 */
@Excel(name = "服务详情")
private List<ServiceGoods> ServiceDetail;
/** 总服务数 */ /** 总服务数 */
@Excel(name = "总服务数") @Excel(name = "总服务数")
private Long allnum; private Long allnum;
@ -227,6 +246,30 @@ public class UserSecondaryCard extends BaseEntity
this.goodsname = goodsname; this.goodsname = goodsname;
} }
public String getTypename() {
return typename;
}
public void setTypename(String typename) {
this.typename = typename;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public List<ServiceGoods> getServiceDetail() {
return ServiceDetail;
}
public void setServiceDetail(List<ServiceGoods> serviceDetail) {
ServiceDetail = serviceDetail;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -27,6 +27,10 @@ public interface ServiceCateMapper
*/ */
public List<ServiceCate> selectServiceCateList(ServiceCate serviceCate); public List<ServiceCate> selectServiceCateList(ServiceCate serviceCate);
public List<ServiceCate> selectServiceCateCiKaList();
/** /**
* 新增服务分类 * 新增服务分类
* *

View File

@ -19,6 +19,9 @@ public interface IServiceCateService
*/ */
public ServiceCate selectServiceCateById(Long id); public ServiceCate selectServiceCateById(Long id);
public List<ServiceCate> selectServiceCateCiKaList();
/** /**
* 查询服务分类列表 * 查询服务分类列表
* *

View File

@ -31,6 +31,10 @@ public class ServiceCateServiceImpl implements IServiceCateService
return serviceCateMapper.selectServiceCateById(id); return serviceCateMapper.selectServiceCateById(id);
} }
public List<ServiceCate> selectServiceCateCiKaList(){
return serviceCateMapper.selectServiceCateCiKaList();
}
/** /**
* 查询服务分类列表 * 查询服务分类列表
* *

View File

@ -27,10 +27,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if> <if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if>
<if test="status != null and status != ''"> and status=#{status}</if> <if test="status != null and status != ''"> and status=#{status}</if>
<if test="type != null and type != ''"> and type=#{type}</if> <if test="type != null and type != ''"> and type=#{type}</if>
</where> </where>
order by sort ASC order by sort ASC
</select> </select>
<select id="selectServiceCateCiKaList" resultMap="ServiceCateResult">
<include refid="selectServiceCateVo"/>
where id in (select card.type from user_secondary_card card where card.status='1' )
order by sort ASC
</select>
<select id="selectServiceCateById" parameterType="Long" resultMap="ServiceCateResult"> <select id="selectServiceCateById" parameterType="Long" resultMap="ServiceCateResult">
<include refid="selectServiceCateVo"/> <include refid="selectServiceCateVo"/>
where id = #{id} where id = #{id}

View File

@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectServiceGoodsfrocikaList" parameterType="java.util.List" resultMap="ServiceGoodsResult"> <select id="selectServiceGoodsfrocikaList" parameterType="java.util.List" resultMap="ServiceGoodsResult">
<include refid="selectServiceGoodsVo"/> <include refid="selectServiceGoodsVo"/>
id IN where id IN
<foreach collection="ids" item="id" open="(" separator="," close=")"> <foreach collection="ids" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

View File

@ -15,13 +15,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="aftermoney" column="aftermoney" /> <result property="aftermoney" column="aftermoney" />
<result property="nowmoney" column="nowmoney" /> <result property="nowmoney" column="nowmoney" />
<result property="createdAt" column="created_at" /> <result property="createdAt" column="created_at" />
<result property="type" column="type" />
<result property="updatedAt" column="updated_at" /> <result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" /> <result property="deletedAt" column="deleted_at" />
<result property="del" column="del" /> <result property="del" column="del" />
</resultMap> </resultMap>
<sql id="selectUserMemnerConsumptionLogVo"> <sql id="selectUserMemnerConsumptionLogVo">
select id, uid, consumptiontype, consumptiontime, consumptionmoney, reamk, beformoney, aftermoney, nowmoney, created_at, updated_at, deleted_at, del from user_memner_consumption_log select id, uid, consumptiontype, consumptiontime, consumptionmoney,type, reamk, beformoney, aftermoney, nowmoney, created_at, updated_at, deleted_at, del from user_memner_consumption_log
</sql> </sql>
<select id="selectUserMemnerConsumptionLogList" parameterType="UserMemnerConsumptionLog" resultMap="UserMemnerConsumptionLogResult"> <select id="selectUserMemnerConsumptionLogList" parameterType="UserMemnerConsumptionLog" resultMap="UserMemnerConsumptionLogResult">
@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nowmoney != null">nowmoney,</if> <if test="nowmoney != null">nowmoney,</if>
<if test="deletedAt != null">deleted_at,</if> <if test="deletedAt != null">deleted_at,</if>
<if test="del != null">del,</if> <if test="del != null">del,</if>
<if test="type != null">type,</if>
created_at, created_at,
updated_at updated_at
</trim> </trim>
@ -65,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nowmoney != null">#{nowmoney},</if> <if test="nowmoney != null">#{nowmoney},</if>
<if test="deletedAt != null">#{deletedAt},</if> <if test="deletedAt != null">#{deletedAt},</if>
<if test="del != null">#{del},</if> <if test="del != null">#{del},</if>
<if test="type != null">#{type},</if>
NOW(), NOW(),
NOW() NOW()
</trim> </trim>
@ -81,9 +85,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="beformoney != null">beformoney = #{beformoney},</if> <if test="beformoney != null">beformoney = #{beformoney},</if>
<if test="aftermoney != null">aftermoney = #{aftermoney},</if> <if test="aftermoney != null">aftermoney = #{aftermoney},</if>
<if test="nowmoney != null">nowmoney = #{nowmoney},</if> <if test="nowmoney != null">nowmoney = #{nowmoney},</if>
updated_at = NOW(),
<if test="deletedAt != null">deleted_at = #{deletedAt},</if> <if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="del != null">del = #{del},</if> <if test="del != null">del = #{del},</if>
<if test="type != null">type = #{type},</if>
updated_at = NOW(),
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -18,11 +18,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updatedAt" column="updated_at" /> <result property="updatedAt" column="updated_at" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="num" column="num" /> <result property="num" column="num" />
<result property="introduction" column="introduction" />
<result property="allnum" column="allnum" /> <result property="allnum" column="allnum" />
</resultMap> </resultMap>
<sql id="selectUserSecondaryCardVo"> <sql id="selectUserSecondaryCardVo">
select id, orderid, title, goodsids, show_money, real_money, showimage, status, creattime, created_at, updated_at, type, num, allnum from user_secondary_card select id, orderid, title, goodsids, show_money, real_money, introduction,showimage, status, creattime, created_at, updated_at, type, num, allnum from user_secondary_card
</sql> </sql>
<select id="selectUserSecondaryCardList" parameterType="UserSecondaryCard" resultMap="UserSecondaryCardResult"> <select id="selectUserSecondaryCardList" parameterType="UserSecondaryCard" resultMap="UserSecondaryCardResult">
@ -36,8 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="showimage != null and showimage != ''"> and showimage = #{showimage}</if> <if test="showimage != null and showimage != ''"> and showimage = #{showimage}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
<if test="creattime != null "> and creattime = #{creattime}</if> <if test="creattime != null "> and creattime = #{creattime}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="type != null "> and type = #{type}</if> <if test="type != null "> and type = #{type}</if>
<if test="num != null "> and num = #{num}</if> <if test="num != null "> and num = #{num}</if>
<if test="allnum != null "> and allnum = #{allnum}</if> <if test="allnum != null "> and allnum = #{allnum}</if>
@ -60,11 +59,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="showimage != null">showimage,</if> <if test="showimage != null">showimage,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="creattime != null">creattime,</if> <if test="creattime != null">creattime,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="type != null">type,</if> <if test="type != null">type,</if>
<if test="num != null">num,</if> <if test="num != null">num,</if>
<if test="allnum != null">allnum,</if> <if test="allnum != null">allnum,</if>
<if test="introduction != null">introduction,</if>
created_at,
updated_at
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderid != null">#{orderid},</if> <if test="orderid != null">#{orderid},</if>
@ -75,11 +76,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="showimage != null">#{showimage},</if> <if test="showimage != null">#{showimage},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="creattime != null">#{creattime},</if> <if test="creattime != null">#{creattime},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="type != null">#{type},</if> <if test="type != null">#{type},</if>
<if test="num != null">#{num},</if> <if test="num != null">#{num},</if>
<if test="allnum != null">#{allnum},</if> <if test="allnum != null">#{allnum},</if>
<if test="introduction != null">#{introduction},</if>
NOW(),
NOW()
</trim> </trim>
</insert> </insert>
@ -94,11 +97,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="showimage != null">showimage = #{showimage},</if> <if test="showimage != null">showimage = #{showimage},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="creattime != null">creattime = #{creattime},</if> <if test="creattime != null">creattime = #{creattime},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
<if test="num != null">num = #{num},</if> <if test="num != null">num = #{num},</if>
<if test="allnum != null">allnum = #{allnum},</if> <if test="allnum != null">allnum = #{allnum},</if>
<if test="introduction != null">introduction = #{introduction},</if>
updated_at = NOW(),
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserUseSecondaryCardVo"> <sql id="selectUserUseSecondaryCardVo">
select id, uid, carid, goodsids, num, usenum, orderid, transaction_id, paymoney, status, created_at, updated_at from user_use_secondary_card select id, uid, carid, goodsids, num, usenum, orderid, introduction,transaction_id, paymoney, status, created_at, updated_at from user_use_secondary_card
</sql> </sql>
<select id="selectUserUseSecondaryCardList" parameterType="UserUseSecondaryCard" resultMap="UserUseSecondaryCardResult"> <select id="selectUserUseSecondaryCardList" parameterType="UserUseSecondaryCard" resultMap="UserUseSecondaryCardResult">
@ -57,8 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="transactionId != null">transaction_id,</if> <if test="transactionId != null">transaction_id,</if>
<if test="paymoney != null">paymoney,</if> <if test="paymoney != null">paymoney,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="createdAt != null">created_at,</if> created_at,
<if test="updatedAt != null">updated_at,</if> updated_at
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">#{uid},</if> <if test="uid != null">#{uid},</if>
@ -70,8 +71,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="transactionId != null">#{transactionId},</if> <if test="transactionId != null">#{transactionId},</if>
<if test="paymoney != null">#{paymoney},</if> <if test="paymoney != null">#{paymoney},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="createdAt != null">#{createdAt},</if> NOW(),
<if test="updatedAt != null">#{updatedAt},</if> NOW()
</trim> </trim>
</insert> </insert>
@ -87,8 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="transactionId != null">transaction_id = #{transactionId},</if> <if test="transactionId != null">transaction_id = #{transactionId},</if>
<if test="paymoney != null">paymoney = #{paymoney},</if> <if test="paymoney != null">paymoney = #{paymoney},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="createdAt != null">created_at = #{createdAt},</if> updated_at = NOW(),
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -79,31 +79,77 @@
<el-table v-loading="loading" :data="UserSecondaryCardList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="UserSecondaryCardList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" /> <el-table-column label="ID" align="center" prop="id" width="80" />
<el-table-column label="订单id" align="center" prop="orderid" /> <el-table-column label="订单ID" align="center" prop="orderid" width="100">
<el-table-column label="标题" align="center" prop="title" />
<el-table-column label="服务项目" align="center" prop="goodsname" />
<el-table-column label="展示价格" align="center" prop="showMoney" />
<el-table-column label="真实付款价格" align="center" prop="realMoney" />
<el-table-column label="展示图片" align="center" prop="showimage" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<image-preview :src="scope.row.showimage" :width="50" :height="50"/> <span>{{ scope.row.orderid || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="标题" align="center" prop="title" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.cika" :value="scope.row.status"/> <el-tooltip :content="scope.row.title || ''" placement="top" :disabled="!scope.row.title || scope.row.title.length <= 20">
<span>{{ scope.row.title ? (scope.row.title.length > 20 ? scope.row.title.substr(0, 20) + '...' : scope.row.title) : '-' }}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="简介" align="center" prop="title" min-width="150">
<template slot-scope="scope">
<el-tooltip :content="scope.row.introduction || ''" placement="top" :disabled="!scope.row.introduction || scope.row.title.length <= 50">
<span>{{ scope.row.introduction ? (scope.row.introduction.length > 50 ? scope.row.introduction.substr(0, 50) + '...' : scope.row.introduction) : '-' }}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="服务项目" align="center" prop="goodsname" min-width="150">
<template slot-scope="scope">
<el-tooltip :content="scope.row.goodsname || ''" placement="top" :disabled="!scope.row.goodsname || scope.row.goodsname.length <= 20">
<span>{{ scope.row.goodsname ? (scope.row.goodsname.length > 20 ? scope.row.goodsname.substr(0, 20) + '...' : scope.row.goodsname) : '-' }}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="展示价格" align="center" width="120">
<template slot-scope="scope">
<span class="price-text">¥ {{ scope.row.showMoney !== undefined && scope.row.showMoney !== null ? parseFloat(scope.row.showMoney).toFixed(2) : '0.00' }}</span>
</template>
</el-table-column>
<el-table-column label="实付价格" align="center" width="120">
<template slot-scope="scope">
<span class="price-text price-highlight">¥ {{ scope.row.realMoney !== undefined && scope.row.realMoney !== null ? parseFloat(scope.row.realMoney).toFixed(2) : '0.00' }}</span>
</template>
</el-table-column>
<el-table-column label="展示图片" align="center" prop="showimage" width="100">
<template slot-scope="scope">
<image-preview v-if="scope.row.showimage" :src="scope.row.showimage" :width="50" :height="50"/>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template slot-scope="scope">
<dict-tag v-if="scope.row.status !== undefined && scope.row.status !== null" :options="dict.type.cika" :value="scope.row.status" class="status-tag"/>
<span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="creattime" width="180"> <el-table-column label="创建时间" align="center" prop="creattime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.creattime, '{y}-{m}-{d}') }}</span> <span>{{ scope.row.creattime ? parseTime(scope.row.creattime, '{y}-{m}-{d}') : '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="分类" align="center" prop="type" /> <el-table-column label="分类" align="center" prop="typename" width="120">
<el-table-column label="可提供服务数" align="center" prop="num" /> <template slot-scope="scope">
<el-table-column label="总服务数" align="center" prop="allnum" /> <span>{{ scope.row.typename || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="可用/总数" align="center" width="120">
<template slot-scope="scope">
<el-tooltip content="可提供服务数/总服务数" placement="top">
<span class="service-count">
<span class="available-count">{{ scope.row.num !== undefined && scope.row.num !== null ? scope.row.num : 0 }}</span>
<span class="count-separator">/</span>
<span class="total-count">{{ scope.row.allnum !== undefined && scope.row.allnum !== null ? scope.row.allnum : 0 }}</span>
</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -139,6 +185,10 @@
<el-form-item label="标题" prop="title"> <el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入标题" /> <el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item> </el-form-item>
<el-form-item label="简介" prop="introduction">
<el-input v-model="form.introduction" placeholder="请输入简介" />
</el-form-item>
<el-form-item label="服务项目" prop="goodsids"> <el-form-item label="服务项目" prop="goodsids">
<el-select <el-select
v-model="form.goodsids" v-model="form.goodsids"
@ -278,6 +328,18 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
title: [
{ required: true, message: '请输入标题', trigger: 'blur' }
],
introduction: [
{ required: true, message: '请输入简介', trigger: 'blur' }
],
goodsids: [
{ required: true, message: '请选择服务项目', trigger: 'change' }
],
type: [
{ required: true, message: '请选择分类', trigger: 'change' }
],
showMoney: [ showMoney: [
{ required: true, message: '请输入展示价格', trigger: 'blur' }, { required: true, message: '请输入展示价格', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{1,2})?$/, message: '请输入正确的金额(最多两位小数)', trigger: 'blur' } { pattern: /^(0|[1-9]\d*)(\.\d{1,2})?$/, message: '请输入正确的金额(最多两位小数)', trigger: 'blur' }
@ -286,6 +348,12 @@ export default {
{ required: true, message: '请输入真实付款价格', trigger: 'blur' }, { required: true, message: '请输入真实付款价格', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d{1,2})?$/, message: '请输入正确的金额(最多两位小数)', trigger: 'blur' } { pattern: /^(0|[1-9]\d*)(\.\d{1,2})?$/, message: '请输入正确的金额(最多两位小数)', trigger: 'blur' }
], ],
showimage: [
{ required: true, message: '请上传展示图片', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
num: [ num: [
{ required: true, message: '请输入可提供服务数', trigger: 'blur' }, { required: true, message: '请输入可提供服务数', trigger: 'blur' },
{ pattern: /^[1-9]\d*$/, message: '请输入正整数', trigger: 'blur' } { pattern: /^[1-9]\d*$/, message: '请输入正整数', trigger: 'blur' }
@ -330,6 +398,7 @@ export default {
creattime: null, creattime: null,
createdAt: null, createdAt: null,
updatedAt: null, updatedAt: null,
introduction: null,
type: null, type: null,
num: null, num: null,
allnum: null allnum: null
@ -452,3 +521,32 @@ export default {
} }
} }
</script> </script>
<style scoped>
.price-text {
font-family: Arial, sans-serif;
color: #606266;
font-weight: bold;
}
.price-highlight {
color: #f56c6c;
}
.service-count {
display: inline-flex;
align-items: center;
gap: 4px;
}
.available-count {
color: #67c23a;
font-weight: bold;
}
.count-separator {
color: #909399;
}
.total-count {
color: #606266;
}
.status-tag {
font-weight: bold;
}
</style>