2025008071805
This commit is contained in:
parent
16588b6d5b
commit
840e32f7ca
|
|
@ -732,32 +732,44 @@ public class AppletController extends BaseController {
|
|||
}
|
||||
}
|
||||
orderData.put("product", goodsOrderListDATA);
|
||||
// // 查询并添加商品详细信息
|
||||
// if (order.getProductId() != null) {
|
||||
// ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId());
|
||||
// if (serviceGoods != null) {
|
||||
// Map<String, Object> productInfo = new HashMap<>();
|
||||
// productInfo.put("id", serviceGoods.getId());
|
||||
// productInfo.put("title", serviceGoods.getTitle());
|
||||
// productInfo.put("sub_title", serviceGoods.getSubTitle());
|
||||
// productInfo.put("icon", AppletControllerUtil.buildImageUrl(serviceGoods.getIcon()));
|
||||
// productInfo.put("price", order.getTotalPrice() != null ? order.getTotalPrice().toString() : "0.00");
|
||||
// productInfo.put("num", order.getNum());
|
||||
//
|
||||
// orderData.put("product", productInfo);
|
||||
// }
|
||||
// }
|
||||
resultList.add(orderData);
|
||||
}
|
||||
// 8. 构建分页信息
|
||||
|
||||
|
||||
|
||||
// 6. 构建分页信息
|
||||
// PageInfo<ServiceGoods> pageInfo = new PageInfo<>(orderList);
|
||||
PageInfo<GoodsOrder> pageInfo = new PageInfo<>(orderList);
|
||||
// 9. 构建返回数据格式(简化版本,更适合小程序)
|
||||
// 7. 构建返回数据格式
|
||||
Map<String, Object> responseData = new HashMap<>();
|
||||
responseData.put("current_page", pageInfo.getPageNum());
|
||||
responseData.put("data", resultList);
|
||||
responseData.put("total", pageInfo.getTotal());
|
||||
responseData.put("per_page", pageInfo.getPageSize());
|
||||
responseData.put("from", pageInfo.getStartRow());
|
||||
responseData.put("last_page", pageInfo.getPages());
|
||||
responseData.put("per_page", pageInfo.getPageSize());
|
||||
responseData.put("to", pageInfo.getEndRow());
|
||||
responseData.put("total", pageInfo.getTotal());
|
||||
|
||||
// 构建分页链接信息
|
||||
String baseUrl = "https://www.huafurenjia.cn/api/goods/order/lst/";
|
||||
responseData.put("first_page_url", baseUrl + "?page=1");
|
||||
responseData.put("last_page_url", baseUrl + "?page=" + pageInfo.getPages());
|
||||
responseData.put("next_page_url", pageInfo.isHasNextPage() ?
|
||||
baseUrl + "?page=" + pageInfo.getNextPage() : null);
|
||||
responseData.put("prev_page_url", pageInfo.isHasPreviousPage() ?
|
||||
baseUrl + "?page=" + pageInfo.getPrePage() : null);
|
||||
responseData.put("path", baseUrl);
|
||||
|
||||
//
|
||||
// // 8. 构建分页信息
|
||||
// PageInfo<GoodsOrder> pageInfo = new PageInfo<>(orderList);
|
||||
// // 9. 构建返回数据格式(简化版本,更适合小程序)
|
||||
// Map<String, Object> responseData = new HashMap<>();
|
||||
// responseData.put("current_page", pageInfo.getPageNum());
|
||||
// responseData.put("data", resultList);
|
||||
// responseData.put("total", pageInfo.getTotal());
|
||||
// responseData.put("per_page", pageInfo.getPageSize());
|
||||
// responseData.put("last_page", pageInfo.getPages());
|
||||
|
||||
return AppletControllerUtil.appletSuccess(responseData);
|
||||
|
||||
|
|
@ -4691,6 +4703,10 @@ public class AppletController extends BaseController {
|
|||
if (order.getAddressId() != null) {
|
||||
address = userAddressService.selectUserAddressById(order.getAddressId());
|
||||
}
|
||||
// else{
|
||||
// address.setAddressName();
|
||||
// address.
|
||||
// }
|
||||
// 5. 查询商品信息
|
||||
ServiceGoods product = null;
|
||||
if (order.getProductId() != null) {
|
||||
|
|
@ -6298,7 +6314,12 @@ public class AppletController extends BaseController {
|
|||
}
|
||||
BigDecimal reductionPrice = BigDecimal.ZERO;
|
||||
String reduction = params.get("reduction").toString();
|
||||
String reamk = params.get("reamk").toString();
|
||||
String reamk = null;
|
||||
if (params.get("reamk") != null){
|
||||
reamk =params.get("reamk").toString();
|
||||
}
|
||||
|
||||
|
||||
if (reduction != null && !reduction.trim().isEmpty()) {
|
||||
reductionPrice = new BigDecimal(reduction);
|
||||
// totalPrice = totalPrice.subtract(reductionPrice);
|
||||
|
|
|
|||
|
|
@ -143,6 +143,10 @@ public class Order extends BaseEntity
|
|||
@Excel(name = "备注")
|
||||
private String mark;
|
||||
|
||||
/** 备注 */
|
||||
// @Excel(name = "备注")
|
||||
private String adressjson;
|
||||
|
||||
/** 关联地址 */
|
||||
// @Excel(name = "关联地址")
|
||||
private Long addressId;
|
||||
|
|
@ -1036,6 +1040,14 @@ public class Order extends BaseEntity
|
|||
this.workerdel = workerdel;
|
||||
}
|
||||
|
||||
public String getAdressjson() {
|
||||
return adressjson;
|
||||
}
|
||||
|
||||
public void setAdressjson(String adressjson) {
|
||||
this.adressjson = adressjson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
<result property="cartid" column="cartid"/>
|
||||
<result property="bigtype" column="bigtype"/>
|
||||
<result property="workerdel" column="workerdel"/>
|
||||
<result property="adressjson" column="adressjson"/>
|
||||
|
||||
|
||||
<result property="totalPrice" column="total_price"/>
|
||||
|
|
@ -67,6 +68,8 @@
|
|||
<resultMap type="OrderApple" id="OrderAppleResult">
|
||||
<result property="created_at" column="deleted_at"/>
|
||||
<result property="reamk" column="reamk"/>
|
||||
<result property="adressjson" column="adressjson"/>
|
||||
|
||||
<result property="id" column="id"/>
|
||||
<result property="odertype" column="odertype"/>
|
||||
<result property="is_comment" column="is_comment"/>
|
||||
|
|
@ -97,6 +100,7 @@
|
|||
transaction_id,
|
||||
create_type,
|
||||
create_phone,
|
||||
adressjson,
|
||||
uid,
|
||||
workerdel,
|
||||
cartid,
|
||||
|
|
@ -466,6 +470,9 @@
|
|||
<if test="workerdel != null">
|
||||
workerdel,
|
||||
</if>
|
||||
<if test="adressjson != null">
|
||||
adressjson,
|
||||
</if>
|
||||
|
||||
created_at,
|
||||
updated_at
|
||||
|
|
@ -618,6 +625,9 @@
|
|||
<if test="workerdel != null">
|
||||
#{workerdel},
|
||||
</if>
|
||||
<if test="adressjson != null">
|
||||
#{adressjson},
|
||||
</if>
|
||||
|
||||
NOW(),
|
||||
NOW()
|
||||
|
|
@ -775,6 +785,9 @@
|
|||
<if test="workerdel != null">
|
||||
workerdel = #{workerdel},
|
||||
</if>
|
||||
<if test="adressjson != null">
|
||||
adressjson = #{adressjson},
|
||||
</if>
|
||||
|
||||
updated_at = NOW()
|
||||
</trim>
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@
|
|||
<i class="el-icon-loading"></i> 加载中...
|
||||
</div>
|
||||
<span v-else-if="workerInfo">{{ workerInfo.phone || '未设置' }}</span>
|
||||
<span v-else>{{ workerInfo.phone || '未设置' }}</span>
|
||||
<span v-else>{{ orderInfo.workerPhone || '未设置' }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="师傅等级">
|
||||
<div v-if="loadingWorkerInfo" class="loading-info">
|
||||
|
|
|
|||
|
|
@ -208,11 +208,14 @@ export default {
|
|||
handler(val) {
|
||||
this.visibleInner = val
|
||||
if (val) {
|
||||
this.$nextTick(() => {
|
||||
this.loadInspectionOptions()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
workerId() { if (this.visibleInner) this.loadInspectionOptions() },
|
||||
orderId() { if (this.visibleInner) this.loadInspectionOptions() },
|
||||
goodId() { if (this.visibleInner) this.loadInspectionOptions() }
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -239,14 +242,16 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
async loadInspectionOptions() {
|
||||
if (!this.workerId || !this.goodId) {
|
||||
// 允许仅凭 goodId 加载(后端支持仅传 goodid 返回基础项目)
|
||||
if (!this.goodId && !this.orderId) {
|
||||
// 缺少必要参数时不请求
|
||||
return
|
||||
}
|
||||
try {
|
||||
this.loadingInspections = true
|
||||
const url = `api/worker/basic/project?id=${this.workerId}&goodid=${this.goodId}`
|
||||
const res = await request.get(url)
|
||||
const res = await request.get('/api/worker/basic/project', {
|
||||
params: { id: this.orderId || undefined, goodid: this.goodId || undefined }
|
||||
})
|
||||
if (res && res.code === 200 && res.data && Array.isArray(res.data.basic)) {
|
||||
this.inspectionOptions = res.data.basic.map((name, idx) => ({ id: idx + 1, name }))
|
||||
this.selectedInspectionIds = []
|
||||
|
|
|
|||
|
|
@ -2075,7 +2075,7 @@
|
|||
<!-- 项目报价弹窗 -->
|
||||
<ProjectQuoteDialog
|
||||
:visible.sync="projectQuoteVisible"
|
||||
:orderId="currentOrderDetail.orderId"
|
||||
:orderId="currentOrderDetail.id"
|
||||
:workerId="currentOrderDetail.workerId"
|
||||
:goodId="currentOrderDetail.productId"
|
||||
@submit="handleProjectQuoteSubmit"
|
||||
|
|
|
|||
Loading…
Reference in New Issue