细节修改

This commit is contained in:
18631081161 2026-03-02 00:20:01 +08:00
parent 0f09858835
commit f597480500
24 changed files with 763 additions and 293 deletions

View File

@ -27,7 +27,7 @@
{
"path": "pages/order/submit",
"style": {
"navigationBarTitleText": "提交订单"
"navigationStyle": "custom"
}
},
{

View File

@ -43,6 +43,11 @@
<text class="menu-item__label">隐私协议</text>
<text class="menu-item__arrow"></text>
</view>
<view v-if="isLoggedIn" class="menu-item" @click="handleLogout">
<image class="menu-item__icon" src="/static/ic_about.png" mode="aspectFit" />
<text class="menu-item__label">退出登录</text>
<text class="menu-item__arrow"></text>
</view>
</view>
<!-- 客服二维码弹窗 -->
@ -113,6 +118,24 @@ function showAgreement(type: 'user' | 'privacy') {
confirmText: '我知道了',
})
}
function handleLogout() {
uni.showModal({
title: '提示',
content: '确定要退出登录吗?',
success: (res) => {
if (res.confirm) {
userStore.logout()
isLoggedIn.value = false
orderCount.value = 0
uni.showToast({ title: '已退出登录', icon: 'success' })
setTimeout(() => {
uni.switchTab({ url: '/pages/index/index' })
}, 1000)
}
}
})
}
</script>
<style scoped>

View File

@ -1,92 +1,135 @@
<template>
<view class="order-submit">
<!-- 自定义导航栏 -->
<view class="navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="navbar__content" :style="{ height: navBarHeight + 'px' }">
<view class="navbar__back" @click="goBack">
<image src="/static/ic_back.png" class="navbar__back-icon" mode="aspectFit" />
</view>
<text class="navbar__title">订单提交</text>
<view class="navbar__placeholder"></view>
</view>
</view>
<view :style="{ height: (statusBarHeight + navBarHeight) + 'px' }"></view>
<!-- 公司地址 -->
<view class="section">
<view class="section__title">公司地址</view>
<view class="section__content">
<text class="company-address">广东省深圳市罗湖区水贝珠宝交易中心</text>
<view class="address-section">
<view class="address-section__header">
<image src="/static/ic_address.png" class="address-section__icon" mode="aspectFit" />
<text class="address-section__title">公司地址</text>
</view>
<view class="address-section__content">
<text class="address-section__name">叶生珠宝-空托之城</text>
<text class="address-section__detail">广东省深圳市罗湖区水贝2路贝丽花园21栋108#生珠宝</text>
<text class="address-section__phone">15920028399</text>
<text class="address-section__contact">联系电话:空托之城 叶生15920028399</text>
</view>
</view>
<!-- 用户发货信息 -->
<view class="section">
<view class="section__title">收货信息</view>
<view class="form-item">
<text class="form-item__label">收货人</text>
<input class="form-item__input" v-model="receiverName" placeholder="请输入收货人姓名" />
<!-- 您的信息 -->
<view class="info-section">
<view class="info-section__header">
<image src="/static/ic_tip.png" class="info-section__icon" mode="aspectFit" />
<text class="info-section__title">您的信息</text>
<text class="info-section__subtitle">请留下您的联系方式</text>
</view>
<view class="form-item">
<text class="form-item__label">联系电话</text>
<input class="form-item__input" v-model="receiverPhone" type="number" placeholder="请输入联系电话" />
<text class="form-item__label required">姓名</text>
<input class="form-item__input" v-model="receiverName" placeholder="请输入真实姓名" />
</view>
<view class="form-item">
<text class="form-item__label">收货地址</text>
<input class="form-item__input" v-model="receiverAddress" placeholder="请输入详细收货地址" />
<text class="form-item__label required">电话</text>
<input class="form-item__input" v-model="receiverPhone" type="number" placeholder="请输入电话" />
</view>
<view class="form-item">
<text class="form-item__label required">地址</text>
<input class="form-item__input" v-model="receiverAddress" placeholder="请输入收货地址" />
</view>
<view class="form-item">
<text class="form-item__label">备注</text>
<input class="form-item__input" v-model="remark" placeholder="请输入备注信息" />
</view>
</view>
<!-- 发货时间提醒 -->
<view class="section notice-section">
<text class="notice-text">温馨提示订单确认后预计3-7个工作日内发货具体以客服通知为准</text>
<!-- 发货时间 -->
<view class="delivery-section">
<view class="delivery-section__header">
<image src="/static/ic_time.png" class="delivery-section__icon" mode="aspectFit" />
<text class="delivery-section__title">发货时间</text>
</view>
<text class="delivery-section__content">上班时间9:30-20:30下单15分钟即可出货镶嵌主石每天18:00正常情况当天出货</text>
</view>
<!-- 商品列表 -->
<view class="section">
<view class="section__title">商品列表</view>
<view class="order-item" v-for="item in orderItems" :key="item.id">
<image class="order-item__img" :src="item.product.bannerImages[0] || ''" mode="aspectFill" />
<view class="order-item__info">
<text class="order-item__name">{{ item.product.name }}</text>
<text class="order-item__spec">{{ item.specData.modelName }} {{ item.specData.fineness }}</text>
<view class="order-item__bottom">
<text class="order-item__price">¥{{ item.specData.totalPrice }}</text>
<text class="order-item__qty">x{{ item.quantity }}</text>
<view class="product-section">
<view class="product-item" v-for="item in orderItems" :key="item.id">
<image class="product-item__img" :src="fullUrl(item.product.thumb || item.product.bannerImages?.[0] || '')" mode="aspectFill" />
<view class="product-item__info">
<text class="product-item__name">{{ item.product.name }}</text>
<view class="product-item__specs">
<text class="product-item__spec">款号:{{ item.specData.modelName || 'B2022' }}</text>
<text class="product-item__spec">商品型号:{{ item.specData.fineness || '2606' }}</text>
<text class="product-item__spec">成色:{{ item.specData.fineness || '30' }}</text>
<text class="product-item__spec">主石:{{ item.specData.mainStone || '13.00#' }}</text>
<text class="product-item__spec">手寸:{{ item.specData.ringSize || '13.00#' }}</text>
<text class="product-item__spec">金料总重:{{ item.specData.goldTotalWeight || '236' }}</text>
</view>
<text class="product-item__price">¥{{ item.specData.totalPrice }}</text>
</view>
</view>
</view>
<!-- 总价 -->
<view class="total-bar">
<text>合计</text>
<text class="total-bar__price">¥{{ totalPrice }}</text>
</view>
<!-- 贵重物品不退换提醒 -->
<view class="agreement" @click="agreed = !agreed">
<view class="agreement__checkbox" :class="{ 'agreement__checkbox--checked': agreed }">
<text v-if="agreed"></text>
</view>
<text class="agreement__text">我已知晓贵重物品售出后不支持退换</text>
<image :src="agreed ? '/static/ic_check_s.png' : '/static/ic_check.png'" class="agreement__checkbox" mode="aspectFit" />
<text class="agreement__text">因珠宝产品属于贵重物品一旦出货产品无质量问题不支持退换!</text>
</view>
<!-- 提交按钮 -->
<!-- 底部提交栏 -->
<view class="submit-bar">
<view class="submit-bar__left">
<text class="submit-bar__label">合计</text>
<text class="submit-bar__price">¥{{ totalPrice }}</text>
</view>
<view
class="submit-btn"
:class="{ 'submit-btn--disabled': !canSubmit }"
class="submit-bar__btn"
:class="{ 'submit-bar__btn--disabled': !canSubmit }"
@click="handleSubmit"
>
提交订
开始下
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ref, computed, onMounted } from 'vue'
import { useCartStore } from '../../store/cart'
import { createOrder } from '../../api/order'
import { BASE_URL } from '../../utils/request'
import type { CartItem } from '../../types'
const cartStore = useCartStore()
const statusBarHeight = ref(0)
const navBarHeight = ref(44)
const receiverName = ref('')
const receiverPhone = ref('')
const receiverAddress = ref('')
const remark = ref('')
const agreed = ref(false)
const submitting = ref(false)
function fullUrl(path: string): string {
if (!path) return ''
if (path.startsWith('http')) return path
return BASE_URL + path
}
function goBack() {
uni.navigateBack()
}
/** 从购物车获取已勾选的商品作为订单项 */
const orderItems = computed<CartItem[]>(() => cartStore.checkedItems)
@ -138,6 +181,13 @@ async function handleSubmit() {
submitting.value = false
}
}
onMounted(() => {
const sysInfo = uni.getSystemInfoSync()
statusBarHeight.value = sysInfo.statusBarHeight || 0
const menuBtn = uni.getMenuButtonBoundingClientRect()
navBarHeight.value = menuBtn.height + (menuBtn.top - (sysInfo.statusBarHeight || 0)) * 2
})
</script>
<style scoped>
@ -146,135 +196,226 @@ async function handleSubmit() {
background: #f5f5f5;
padding-bottom: 140rpx;
}
.section {
/* 导航栏 */
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
background: linear-gradient(135deg, #FFCFDE 0%, #FFA6C4 100%);
}
.navbar__content {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24rpx;
}
.navbar__back {
padding: 10rpx;
}
.navbar__back-icon {
width: 40rpx;
height: 40rpx;
}
.navbar__title {
font-size: 34rpx;
font-weight: 600;
color: #000;
}
.navbar__placeholder {
width: 60rpx;
}
/* 公司地址 */
.address-section {
background: #fff;
margin-bottom: 16rpx;
margin: 16rpx 24rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.section__title {
font-size: 30rpx;
font-weight: bold;
color: #333;
.address-section__header {
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.section__content {
font-size: 26rpx;
color: #666;
.address-section__icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.company-address {
font-size: 26rpx;
.address-section__title {
font-size: 28rpx;
color: #e91e63;
font-weight: 600;
}
.address-section__content {
display: flex;
flex-direction: column;
gap: 8rpx;
}
.address-section__name {
font-size: 28rpx;
color: #333;
font-weight: 600;
}
.address-section__detail,
.address-section__phone,
.address-section__contact {
font-size: 24rpx;
color: #666;
line-height: 36rpx;
}
/* 您的信息 */
.info-section {
background: #fff;
margin: 0 24rpx 16rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.info-section__header {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.info-section__icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.info-section__title {
font-size: 28rpx;
color: #e91e63;
font-weight: 600;
margin-right: 12rpx;
}
.info-section__subtitle {
font-size: 24rpx;
color: #999;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item:last-child {
border-bottom: none;
}
.form-item__label {
font-size: 28rpx;
font-size: 26rpx;
color: #333;
width: 160rpx;
width: 100rpx;
flex-shrink: 0;
}
.form-item__label.required::before {
content: '*';
color: #e91e63;
margin-right: 4rpx;
}
.form-item__input {
flex: 1;
font-size: 28rpx;
font-size: 26rpx;
color: #333;
}
.notice-section {
background: #fffbe6;
/* 发货时间 */
.delivery-section {
background: #fff;
margin: 0 24rpx 16rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.notice-text {
font-size: 24rpx;
color: #faad14;
}
.order-item {
.delivery-section__header {
display: flex;
padding: 16rpx 0;
border-bottom: 1rpx solid #f0f0f0;
align-items: center;
margin-bottom: 12rpx;
}
.order-item__img {
.delivery-section__icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.delivery-section__title {
font-size: 28rpx;
color: #e91e63;
font-weight: 600;
}
.delivery-section__content {
font-size: 24rpx;
color: #e91e63;
line-height: 36rpx;
}
/* 商品列表 */
.product-section {
background: #fff;
margin: 0 24rpx 16rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.product-item {
display: flex;
gap: 20rpx;
}
.product-item__img {
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
border-radius: 12rpx;
flex-shrink: 0;
background: #f5f5f5;
}
.order-item__info {
.product-item__info {
flex: 1;
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.order-item__name {
.product-item__name {
font-size: 28rpx;
color: #333;
font-weight: 600;
margin-bottom: 8rpx;
}
.order-item__spec {
font-size: 24rpx;
color: #999;
margin-top: 8rpx;
.product-item__specs {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8rpx;
margin-bottom: 12rpx;
}
.order-item__bottom {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 8rpx;
}
.order-item__price {
font-size: 28rpx;
color: #e4393c;
font-weight: bold;
}
.order-item__qty {
font-size: 24rpx;
color: #999;
}
.total-bar {
background: #fff;
padding: 24rpx;
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 28rpx;
color: #333;
margin-bottom: 16rpx;
}
.total-bar__price {
font-size: 36rpx;
color: #e4393c;
font-weight: bold;
margin-left: 8rpx;
}
.agreement {
background: #fff;
padding: 24rpx;
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.agreement__checkbox {
width: 40rpx;
height: 40rpx;
border: 2rpx solid #ddd;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16rpx;
font-size: 24rpx;
color: #fff;
}
.agreement__checkbox--checked {
background: #e4393c;
border-color: #e4393c;
}
.agreement__text {
font-size: 26rpx;
.product-item__spec {
font-size: 22rpx;
color: #666;
}
.product-item__price {
font-size: 30rpx;
color: #e91e63;
font-weight: 700;
}
/* 协议 */
.agreement {
background: #fffbe6;
margin: 0 24rpx 16rpx;
padding: 20rpx 24rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
}
.agreement__checkbox {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
flex-shrink: 0;
}
.agreement__text {
font-size: 24rpx;
color: #333;
line-height: 36rpx;
}
/* 底部提交栏 */
.submit-bar {
position: fixed;
bottom: 0;
@ -283,16 +424,32 @@ async function handleSubmit() {
background: #fff;
padding: 16rpx 24rpx;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
justify-content: space-between;
}
.submit-btn {
background: #e4393c;
.submit-bar__left {
display: flex;
align-items: baseline;
}
.submit-bar__label {
font-size: 26rpx;
color: #333;
}
.submit-bar__price {
font-size: 36rpx;
color: #e91e63;
font-weight: 700;
}
.submit-bar__btn {
background: linear-gradient(135deg, #FF6D9B, #FF4081);
color: #fff;
text-align: center;
padding: 20rpx 0;
padding: 20rpx 60rpx;
border-radius: 44rpx;
font-size: 30rpx;
font-size: 28rpx;
font-weight: 600;
}
.submit-btn--disabled {
.submit-bar__btn--disabled {
background: #ccc;
pointer-events: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -19,6 +19,7 @@ export interface Order {
shippingNo?: string
createdAt: string
updatedAt: string
items?: OrderItem[]
}
/** 订单商品项 */

View File

@ -1 +1 @@
{"version":3,"file":"assets.js","sources":["static/ic_search.png","static/ic_back.png","static/ic_none.png","static/ic_customer.png","static/tab/car.png","static/tab/me_s.png","static/ic_address.png","static/ic_about.png","static/ic_agreement1.png","static/ic_agreement2.png","static/logo.png","static/ic_notice.png"],"sourcesContent":["export default \"__VITE_ASSET__cb299f1c__\"","export default \"__VITE_ASSET__a09e4f4f__\"","export default \"__VITE_ASSET__c88a49dc__\"","export default \"__VITE_ASSET__834c867b__\"","export default \"__VITE_ASSET__de453aec__\"","export default \"__VITE_ASSET__0724ec6f__\"","export default \"__VITE_ASSET__2fa96069__\"","export default \"__VITE_ASSET__53f234dc__\"","export default \"__VITE_ASSET__a736f8f4__\"","export default \"__VITE_ASSET__a25b5e1b__\"","export default \"__VITE_ASSET__46719607__\"","export default \"__VITE_ASSET__abe1da0c__\""],"names":[],"mappings":";AAAA,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;;;;;;;;;;;;;"}
{"version":3,"file":"assets.js","sources":["static/ic_search.png","static/ic_back.png","static/ic_none.png","static/ic_customer.png","static/tab/car.png","static/ic_address.png","static/ic_tip.png","static/ic_time.png","static/tab/me_s.png","static/ic_about.png","static/ic_agreement1.png","static/ic_agreement2.png","static/logo.png","static/ic_notice.png"],"sourcesContent":["export default \"__VITE_ASSET__cb299f1c__\"","export default \"__VITE_ASSET__a09e4f4f__\"","export default \"__VITE_ASSET__c88a49dc__\"","export default \"__VITE_ASSET__834c867b__\"","export default \"__VITE_ASSET__de453aec__\"","export default \"__VITE_ASSET__2fa96069__\"","export default \"__VITE_ASSET__59ade930__\"","export default \"__VITE_ASSET__7a5d0bff__\"","export default \"__VITE_ASSET__0724ec6f__\"","export default \"__VITE_ASSET__53f234dc__\"","export default \"__VITE_ASSET__a736f8f4__\"","export default \"__VITE_ASSET__a25b5e1b__\"","export default \"__VITE_ASSET__46719607__\"","export default \"__VITE_ASSET__abe1da0c__\""],"names":[],"mappings":";AAAA,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;;;;;;;;;;;;;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +0,0 @@
"use strict";
const utils_request = require("../utils/request.js");
const getMoldList = (params) => utils_request.get("/api/molds", params);
exports.getMoldList = getMoldList;
//# sourceMappingURL=../../.sourcemap/mp-weixin/api/mold.js.map

View File

@ -2,10 +2,12 @@
const _imports_0$5 = "/static/ic_search.png";
const _imports_0$4 = "/static/ic_back.png";
const _imports_0$3 = "/static/ic_none.png";
const _imports_2$1 = "/static/ic_customer.png";
const _imports_2 = "/static/tab/car.png";
const _imports_0$2 = "/static/tab/me_s.png";
const _imports_2$2 = "/static/ic_customer.png";
const _imports_2$1 = "/static/tab/car.png";
const _imports_1 = "/static/ic_address.png";
const _imports_2 = "/static/ic_tip.png";
const _imports_3$1 = "/static/ic_time.png";
const _imports_0$2 = "/static/tab/me_s.png";
const _imports_3 = "/static/ic_about.png";
const _imports_4 = "/static/ic_agreement1.png";
const _imports_5 = "/static/ic_agreement2.png";
@ -18,9 +20,11 @@ exports._imports_0$3 = _imports_0$2;
exports._imports_0$4 = _imports_0$1;
exports._imports_0$5 = _imports_0;
exports._imports_1 = _imports_1;
exports._imports_2 = _imports_2$1;
exports._imports_2$1 = _imports_2;
exports._imports_3 = _imports_3;
exports._imports_2 = _imports_2$2;
exports._imports_2$1 = _imports_2$1;
exports._imports_2$2 = _imports_2;
exports._imports_3 = _imports_3$1;
exports._imports_3$1 = _imports_3;
exports._imports_4 = _imports_4;
exports._imports_5 = _imports_5;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/assets.js.map

View File

@ -7041,7 +7041,7 @@ function isConsoleWritable() {
function initRuntimeSocketService() {
const hosts = "172.31.144.1,192.168.21.7,192.168.195.32,127.0.0.1";
const port = "8090";
const id = "mp-weixin_930-_N";
const id = "mp-weixin_tvZruD";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();

View File

@ -51,6 +51,23 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
confirmText: "我知道了"
});
}
function handleLogout() {
common_vendor.index.showModal({
title: "提示",
content: "确定要退出登录吗?",
success: (res) => {
if (res.confirm) {
userStore.logout();
isLoggedIn.value = false;
orderCount.value = 0;
common_vendor.index.showToast({ title: "已退出登录", icon: "success" });
setTimeout(() => {
common_vendor.index.switchTab({ url: "/pages/index/index" });
}, 1e3);
}
}
});
}
return (_ctx, _cache) => {
var _a, _b;
return common_vendor.e({
@ -64,25 +81,30 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
h: common_vendor.o(($event) => navigateTo("/pages/address/index")),
i: common_assets._imports_2,
j: common_vendor.o(($event) => showQrCode.value = true),
k: common_assets._imports_3,
k: common_assets._imports_3$1,
l: common_vendor.o(($event) => showAbout.value = true),
m: common_assets._imports_4,
n: common_vendor.o(($event) => showAgreement("user")),
o: common_assets._imports_5,
p: common_vendor.o(($event) => showAgreement("privacy")),
q: showQrCode.value
q: isLoggedIn.value
}, isLoggedIn.value ? {
r: common_assets._imports_3$1,
s: common_vendor.o(handleLogout)
} : {}, {
t: showQrCode.value
}, showQrCode.value ? {
r: common_vendor.o(($event) => showQrCode.value = false),
s: common_vendor.p({
v: common_vendor.o(($event) => showQrCode.value = false),
w: common_vendor.p({
mode: "qrcode"
})
} : {}, {
t: showAbout.value
x: showAbout.value
}, showAbout.value ? {
v: common_vendor.o(($event) => showAbout.value = false),
w: common_vendor.o(() => {
y: common_vendor.o(($event) => showAbout.value = false),
z: common_vendor.o(() => {
}),
x: common_vendor.o(($event) => showAbout.value = false)
A: common_vendor.o(($event) => showAbout.value = false)
} : {});
};
}

View File

@ -1 +1 @@
<view class="mine-page data-v-569e925a"><view class="user-card data-v-569e925a" bindtap="{{c}}"><image class="user-card__avatar data-v-569e925a" src="{{a}}" mode="aspectFill"/><view class="user-card__info data-v-569e925a"><text class="user-card__name data-v-569e925a">{{b}}</text></view><text class="user-card__arrow data-v-569e925a"></text></view><view class="order-entry data-v-569e925a" bindtap="{{f}}"><image class="order-entry__icon data-v-569e925a" src="{{d}}" mode="aspectFit"/><text class="order-entry__text data-v-569e925a">我的订单 {{e}}</text><text class="order-entry__arrow data-v-569e925a"></text></view><view class="menu-group data-v-569e925a"><view class="menu-item data-v-569e925a" bindtap="{{h}}"><image class="menu-item__icon data-v-569e925a" src="{{g}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">收货地址</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{j}}"><image class="menu-item__icon data-v-569e925a" src="{{i}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">联系客服</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{l}}"><image class="menu-item__icon data-v-569e925a" src="{{k}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">关于我们</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{n}}"><image class="menu-item__icon data-v-569e925a" src="{{m}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">用户协议</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{p}}"><image class="menu-item__icon data-v-569e925a" src="{{o}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">隐私协议</text><text class="menu-item__arrow data-v-569e925a"></text></view></view><customer-service-btn wx:if="{{q}}" class="data-v-569e925a" bindclose="{{r}}" u-i="569e925a-0" bind:__l="__l" u-p="{{s}}"/><view wx:if="{{t}}" class="modal-mask data-v-569e925a" bindtap="{{x}}"><view class="modal-popup data-v-569e925a" catchtap="{{w}}"><text class="modal-popup__title data-v-569e925a">关于我们</text><text class="modal-popup__content data-v-569e925a">珠宝商城 —— 专注珠宝零售,为您提供优质珠宝商品和贴心服务。</text><view class="modal-popup__close data-v-569e925a" bindtap="{{v}}">关闭</view></view></view></view>
<view class="mine-page data-v-569e925a"><view class="user-card data-v-569e925a" bindtap="{{c}}"><image class="user-card__avatar data-v-569e925a" src="{{a}}" mode="aspectFill"/><view class="user-card__info data-v-569e925a"><text class="user-card__name data-v-569e925a">{{b}}</text></view><text class="user-card__arrow data-v-569e925a"></text></view><view class="order-entry data-v-569e925a" bindtap="{{f}}"><image class="order-entry__icon data-v-569e925a" src="{{d}}" mode="aspectFit"/><text class="order-entry__text data-v-569e925a">我的订单 {{e}}</text><text class="order-entry__arrow data-v-569e925a"></text></view><view class="menu-group data-v-569e925a"><view class="menu-item data-v-569e925a" bindtap="{{h}}"><image class="menu-item__icon data-v-569e925a" src="{{g}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">收货地址</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{j}}"><image class="menu-item__icon data-v-569e925a" src="{{i}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">联系客服</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{l}}"><image class="menu-item__icon data-v-569e925a" src="{{k}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">关于我们</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{n}}"><image class="menu-item__icon data-v-569e925a" src="{{m}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">用户协议</text><text class="menu-item__arrow data-v-569e925a"></text></view><view class="menu-item data-v-569e925a" bindtap="{{p}}"><image class="menu-item__icon data-v-569e925a" src="{{o}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">隐私协议</text><text class="menu-item__arrow data-v-569e925a"></text></view><view wx:if="{{q}}" class="menu-item data-v-569e925a" bindtap="{{s}}"><image class="menu-item__icon data-v-569e925a" src="{{r}}" mode="aspectFit"/><text class="menu-item__label data-v-569e925a">退出登录</text><text class="menu-item__arrow data-v-569e925a"></text></view></view><customer-service-btn wx:if="{{t}}" class="data-v-569e925a" bindclose="{{v}}" u-i="569e925a-0" bind:__l="__l" u-p="{{w}}"/><view wx:if="{{x}}" class="modal-mask data-v-569e925a" bindtap="{{A}}"><view class="modal-popup data-v-569e925a" catchtap="{{z}}"><text class="modal-popup__title data-v-569e925a">关于我们</text><text class="modal-popup__content data-v-569e925a">珠宝商城 —— 专注珠宝零售,为您提供优质珠宝商品和贴心服务。</text><view class="modal-popup__close data-v-569e925a" bindtap="{{y}}">关闭</view></view></view></view>

View File

@ -1,16 +1,31 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const store_cart = require("../../store/cart.js");
const api_order = require("../../api/order.js");
const utils_request = require("../../utils/request.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "submit",
setup(__props) {
const cartStore = store_cart.useCartStore();
const statusBarHeight = common_vendor.ref(0);
const navBarHeight = common_vendor.ref(44);
const receiverName = common_vendor.ref("");
const receiverPhone = common_vendor.ref("");
const receiverAddress = common_vendor.ref("");
const remark = common_vendor.ref("");
const agreed = common_vendor.ref(false);
const submitting = common_vendor.ref(false);
function fullUrl(path) {
if (!path)
return "";
if (path.startsWith("http"))
return path;
return utils_request.BASE_URL + path;
}
function goBack() {
common_vendor.index.navigateBack();
}
const orderItems = common_vendor.computed(() => cartStore.checkedItems);
const totalPrice = common_vendor.computed(
() => orderItems.value.reduce((sum, item) => sum + item.specData.totalPrice * item.quantity, 0)
@ -54,33 +69,51 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
submitting.value = false;
}
}
common_vendor.onMounted(() => {
const sysInfo = common_vendor.index.getSystemInfoSync();
statusBarHeight.value = sysInfo.statusBarHeight || 0;
const menuBtn = common_vendor.index.getMenuButtonBoundingClientRect();
navBarHeight.value = menuBtn.height + (menuBtn.top - (sysInfo.statusBarHeight || 0)) * 2;
});
return (_ctx, _cache) => {
return common_vendor.e({
a: receiverName.value,
b: common_vendor.o(($event) => receiverName.value = $event.detail.value),
c: receiverPhone.value,
d: common_vendor.o(($event) => receiverPhone.value = $event.detail.value),
e: receiverAddress.value,
f: common_vendor.o(($event) => receiverAddress.value = $event.detail.value),
g: common_vendor.f(orderItems.value, (item, k0, i0) => {
return {
a: common_assets._imports_0$2,
b: common_vendor.o(goBack),
c: navBarHeight.value + "px",
d: statusBarHeight.value + "px",
e: statusBarHeight.value + navBarHeight.value + "px",
f: common_assets._imports_1,
g: common_assets._imports_2$2,
h: receiverName.value,
i: common_vendor.o(($event) => receiverName.value = $event.detail.value),
j: receiverPhone.value,
k: common_vendor.o(($event) => receiverPhone.value = $event.detail.value),
l: receiverAddress.value,
m: common_vendor.o(($event) => receiverAddress.value = $event.detail.value),
n: remark.value,
o: common_vendor.o(($event) => remark.value = $event.detail.value),
p: common_assets._imports_3,
q: common_vendor.f(orderItems.value, (item, k0, i0) => {
var _a;
return {
a: item.product.bannerImages[0] || "",
a: fullUrl(item.product.thumb || ((_a = item.product.bannerImages) == null ? void 0 : _a[0]) || ""),
b: common_vendor.t(item.product.name),
c: common_vendor.t(item.specData.modelName),
d: common_vendor.t(item.specData.fineness),
e: common_vendor.t(item.specData.totalPrice),
f: common_vendor.t(item.quantity),
g: item.id
c: common_vendor.t(item.specData.modelName || "B2022"),
d: common_vendor.t(item.specData.fineness || "2606"),
e: common_vendor.t(item.specData.fineness || "30"),
f: common_vendor.t(item.specData.mainStone || "13.00#"),
g: common_vendor.t(item.specData.ringSize || "13.00#"),
h: common_vendor.t(item.specData.goldTotalWeight || "236"),
i: common_vendor.t(item.specData.totalPrice),
j: item.id
};
}),
h: common_vendor.t(totalPrice.value),
i: agreed.value
}, agreed.value ? {} : {}, {
j: agreed.value ? 1 : "",
k: common_vendor.o(($event) => agreed.value = !agreed.value),
l: !canSubmit.value ? 1 : "",
m: common_vendor.o(handleSubmit)
});
r: agreed.value ? "/static/ic_check_s.png" : "/static/ic_check.png",
s: common_vendor.o(($event) => agreed.value = !agreed.value),
t: common_vendor.t(totalPrice.value),
v: !canSubmit.value ? 1 : "",
w: common_vendor.o(handleSubmit)
};
};
}
});

View File

@ -1,4 +1,4 @@
{
"navigationBarTitleText": "提交订单",
"navigationStyle": "custom",
"usingComponents": {}
}

View File

@ -1 +1 @@
<view class="order-submit data-v-c3fa8b8a"><view class="section data-v-c3fa8b8a"><view class="section__title data-v-c3fa8b8a">公司地址</view><view class="section__content data-v-c3fa8b8a"><text class="company-address data-v-c3fa8b8a">广东省深圳市罗湖区水贝珠宝交易中心</text></view></view><view class="section data-v-c3fa8b8a"><view class="section__title data-v-c3fa8b8a">收货信息</view><view class="form-item data-v-c3fa8b8a"><text class="form-item__label data-v-c3fa8b8a">收货人</text><input class="form-item__input data-v-c3fa8b8a" placeholder="请输入收货人姓名" value="{{a}}" bindinput="{{b}}"/></view><view class="form-item data-v-c3fa8b8a"><text class="form-item__label data-v-c3fa8b8a">联系电话</text><input class="form-item__input data-v-c3fa8b8a" type="number" placeholder="请输入联系电话" value="{{c}}" bindinput="{{d}}"/></view><view class="form-item data-v-c3fa8b8a"><text class="form-item__label data-v-c3fa8b8a">收货地址</text><input class="form-item__input data-v-c3fa8b8a" placeholder="请输入详细收货地址" value="{{e}}" bindinput="{{f}}"/></view></view><view class="section notice-section data-v-c3fa8b8a"><text class="notice-text data-v-c3fa8b8a">温馨提示订单确认后预计3-7个工作日内发货具体以客服通知为准。</text></view><view class="section data-v-c3fa8b8a"><view class="section__title data-v-c3fa8b8a">商品列表</view><view wx:for="{{g}}" wx:for-item="item" wx:key="g" class="order-item data-v-c3fa8b8a"><image class="order-item__img data-v-c3fa8b8a" src="{{item.a}}" mode="aspectFill"/><view class="order-item__info data-v-c3fa8b8a"><text class="order-item__name data-v-c3fa8b8a">{{item.b}}</text><text class="order-item__spec data-v-c3fa8b8a">{{item.c}} {{item.d}}</text><view class="order-item__bottom data-v-c3fa8b8a"><text class="order-item__price data-v-c3fa8b8a">¥{{item.e}}</text><text class="order-item__qty data-v-c3fa8b8a">x{{item.f}}</text></view></view></view></view><view class="total-bar data-v-c3fa8b8a"><text class="data-v-c3fa8b8a">合计:</text><text class="total-bar__price data-v-c3fa8b8a">¥{{h}}</text></view><view class="agreement data-v-c3fa8b8a" bindtap="{{k}}"><view class="{{['agreement__checkbox', 'data-v-c3fa8b8a', j && 'agreement__checkbox--checked']}}"><text wx:if="{{i}}" class="data-v-c3fa8b8a">✓</text></view><text class="agreement__text data-v-c3fa8b8a">我已知晓贵重物品售出后不支持退换</text></view><view class="submit-bar data-v-c3fa8b8a"><view class="{{['submit-btn', 'data-v-c3fa8b8a', l && 'submit-btn--disabled']}}" bindtap="{{m}}"> 提交订单 </view></view></view>
<view class="order-submit data-v-c3fa8b8a"><view class="navbar data-v-c3fa8b8a" style="{{'padding-top:' + d}}"><view class="navbar__content data-v-c3fa8b8a" style="{{'height:' + c}}"><view class="navbar__back data-v-c3fa8b8a" bindtap="{{b}}"><image src="{{a}}" class="navbar__back-icon data-v-c3fa8b8a" mode="aspectFit"/></view><text class="navbar__title data-v-c3fa8b8a">订单提交</text><view class="navbar__placeholder data-v-c3fa8b8a"></view></view></view><view class="data-v-c3fa8b8a" style="{{'height:' + e}}"></view><view class="address-section data-v-c3fa8b8a"><view class="address-section__header data-v-c3fa8b8a"><image src="{{f}}" class="address-section__icon data-v-c3fa8b8a" mode="aspectFit"/><text class="address-section__title data-v-c3fa8b8a">公司地址</text></view><view class="address-section__content data-v-c3fa8b8a"><text class="address-section__name data-v-c3fa8b8a">叶生珠宝-空托之城</text><text class="address-section__detail data-v-c3fa8b8a">广东省深圳市罗湖区水贝2路贝丽花园21栋108#生珠宝</text><text class="address-section__phone data-v-c3fa8b8a">15920028399</text><text class="address-section__contact data-v-c3fa8b8a">联系电话:空托之城 叶生15920028399</text></view></view><view class="info-section data-v-c3fa8b8a"><view class="info-section__header data-v-c3fa8b8a"><image src="{{g}}" class="info-section__icon data-v-c3fa8b8a" mode="aspectFit"/><text class="info-section__title data-v-c3fa8b8a">您的信息</text><text class="info-section__subtitle data-v-c3fa8b8a">请留下您的联系方式</text></view><view class="form-item data-v-c3fa8b8a"><text class="form-item__label required data-v-c3fa8b8a">姓名</text><input class="form-item__input data-v-c3fa8b8a" placeholder="请输入真实姓名" value="{{h}}" bindinput="{{i}}"/></view><view class="form-item data-v-c3fa8b8a"><text class="form-item__label required data-v-c3fa8b8a">电话</text><input class="form-item__input data-v-c3fa8b8a" type="number" placeholder="请输入电话" value="{{j}}" bindinput="{{k}}"/></view><view class="form-item data-v-c3fa8b8a"><text class="form-item__label required data-v-c3fa8b8a">地址</text><input class="form-item__input data-v-c3fa8b8a" placeholder="请输入收货地址" value="{{l}}" bindinput="{{m}}"/></view><view class="form-item data-v-c3fa8b8a"><text class="form-item__label data-v-c3fa8b8a">备注</text><input class="form-item__input data-v-c3fa8b8a" placeholder="请输入备注信息" value="{{n}}" bindinput="{{o}}"/></view></view><view class="delivery-section data-v-c3fa8b8a"><view class="delivery-section__header data-v-c3fa8b8a"><image src="{{p}}" class="delivery-section__icon data-v-c3fa8b8a" mode="aspectFit"/><text class="delivery-section__title data-v-c3fa8b8a">发货时间</text></view><text class="delivery-section__content data-v-c3fa8b8a">上班时间9:30-20:30分下单15分钟即可出货。镶嵌主石每天18:00前正常情况当天出货。</text></view><view class="product-section data-v-c3fa8b8a"><view wx:for="{{q}}" wx:for-item="item" wx:key="j" class="product-item data-v-c3fa8b8a"><image class="product-item__img data-v-c3fa8b8a" src="{{item.a}}" mode="aspectFill"/><view class="product-item__info data-v-c3fa8b8a"><text class="product-item__name data-v-c3fa8b8a">{{item.b}}</text><view class="product-item__specs data-v-c3fa8b8a"><text class="product-item__spec data-v-c3fa8b8a">款号:{{item.c}}</text><text class="product-item__spec data-v-c3fa8b8a">商品型号:{{item.d}}</text><text class="product-item__spec data-v-c3fa8b8a">成色:{{item.e}}</text><text class="product-item__spec data-v-c3fa8b8a">主石:{{item.f}}</text><text class="product-item__spec data-v-c3fa8b8a">手寸:{{item.g}}</text><text class="product-item__spec data-v-c3fa8b8a">金料总重:{{item.h}}</text></view><text class="product-item__price data-v-c3fa8b8a">¥{{item.i}}元</text></view></view></view><view class="agreement data-v-c3fa8b8a" bindtap="{{s}}"><image src="{{r}}" class="agreement__checkbox data-v-c3fa8b8a" mode="aspectFit"/><text class="agreement__text data-v-c3fa8b8a">因珠宝产品属于贵重物品,一旦出货,产品无质量问题不支持退换!</text></view><view class="submit-bar data-v-c3fa8b8a"><view class="submit-bar__left data-v-c3fa8b8a"><text class="submit-bar__label data-v-c3fa8b8a">合计:</text><text class="submit-bar__price data-v-c3fa8b8a">¥{{t}}</text></view><view class="{{['submit-bar__btn', 'data-v-c3fa8b8a', v && 'submit-bar__btn--disabled']}}" bindtap="{{w}}"> 开始下单 </view></view></view>

View File

@ -4,135 +4,226 @@
background: #f5f5f5;
padding-bottom: 140rpx;
}
.section.data-v-c3fa8b8a {
/* 导航栏 */
.navbar.data-v-c3fa8b8a {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
background: linear-gradient(135deg, #FFCFDE 0%, #FFA6C4 100%);
}
.navbar__content.data-v-c3fa8b8a {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24rpx;
}
.navbar__back.data-v-c3fa8b8a {
padding: 10rpx;
}
.navbar__back-icon.data-v-c3fa8b8a {
width: 40rpx;
height: 40rpx;
}
.navbar__title.data-v-c3fa8b8a {
font-size: 34rpx;
font-weight: 600;
color: #000;
}
.navbar__placeholder.data-v-c3fa8b8a {
width: 60rpx;
}
/* 公司地址 */
.address-section.data-v-c3fa8b8a {
background: #fff;
margin-bottom: 16rpx;
margin: 16rpx 24rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.section__title.data-v-c3fa8b8a {
font-size: 30rpx;
font-weight: bold;
color: #333;
.address-section__header.data-v-c3fa8b8a {
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.section__content.data-v-c3fa8b8a {
font-size: 26rpx;
color: #666;
.address-section__icon.data-v-c3fa8b8a {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.company-address.data-v-c3fa8b8a {
font-size: 26rpx;
.address-section__title.data-v-c3fa8b8a {
font-size: 28rpx;
color: #e91e63;
font-weight: 600;
}
.address-section__content.data-v-c3fa8b8a {
display: flex;
flex-direction: column;
gap: 8rpx;
}
.address-section__name.data-v-c3fa8b8a {
font-size: 28rpx;
color: #333;
font-weight: 600;
}
.address-section__detail.data-v-c3fa8b8a,
.address-section__phone.data-v-c3fa8b8a,
.address-section__contact.data-v-c3fa8b8a {
font-size: 24rpx;
color: #666;
line-height: 36rpx;
}
/* 您的信息 */
.info-section.data-v-c3fa8b8a {
background: #fff;
margin: 0 24rpx 16rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.info-section__header.data-v-c3fa8b8a {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.info-section__icon.data-v-c3fa8b8a {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.info-section__title.data-v-c3fa8b8a {
font-size: 28rpx;
color: #e91e63;
font-weight: 600;
margin-right: 12rpx;
}
.info-section__subtitle.data-v-c3fa8b8a {
font-size: 24rpx;
color: #999;
}
.form-item.data-v-c3fa8b8a {
display: flex;
align-items: center;
padding: 16rpx 0;
padding: 20rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item.data-v-c3fa8b8a:last-child {
border-bottom: none;
}
.form-item__label.data-v-c3fa8b8a {
font-size: 28rpx;
font-size: 26rpx;
color: #333;
width: 160rpx;
width: 100rpx;
flex-shrink: 0;
}
.form-item__label.required.data-v-c3fa8b8a::before {
content: '*';
color: #e91e63;
margin-right: 4rpx;
}
.form-item__input.data-v-c3fa8b8a {
flex: 1;
font-size: 28rpx;
font-size: 26rpx;
color: #333;
}
.notice-section.data-v-c3fa8b8a {
background: #fffbe6;
/* 发货时间 */
.delivery-section.data-v-c3fa8b8a {
background: #fff;
margin: 0 24rpx 16rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.notice-text.data-v-c3fa8b8a {
font-size: 24rpx;
color: #faad14;
}
.order-item.data-v-c3fa8b8a {
.delivery-section__header.data-v-c3fa8b8a {
display: flex;
padding: 16rpx 0;
border-bottom: 1rpx solid #f0f0f0;
align-items: center;
margin-bottom: 12rpx;
}
.order-item__img.data-v-c3fa8b8a {
.delivery-section__icon.data-v-c3fa8b8a {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.delivery-section__title.data-v-c3fa8b8a {
font-size: 28rpx;
color: #e91e63;
font-weight: 600;
}
.delivery-section__content.data-v-c3fa8b8a {
font-size: 24rpx;
color: #e91e63;
line-height: 36rpx;
}
/* 商品列表 */
.product-section.data-v-c3fa8b8a {
background: #fff;
margin: 0 24rpx 16rpx;
padding: 24rpx;
border-radius: 16rpx;
}
.product-item.data-v-c3fa8b8a {
display: flex;
gap: 20rpx;
}
.product-item__img.data-v-c3fa8b8a {
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
border-radius: 12rpx;
flex-shrink: 0;
background: #f5f5f5;
}
.order-item__info.data-v-c3fa8b8a {
.product-item__info.data-v-c3fa8b8a {
flex: 1;
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.order-item__name.data-v-c3fa8b8a {
.product-item__name.data-v-c3fa8b8a {
font-size: 28rpx;
color: #333;
font-weight: 600;
margin-bottom: 8rpx;
}
.order-item__spec.data-v-c3fa8b8a {
font-size: 24rpx;
color: #999;
margin-top: 8rpx;
.product-item__specs.data-v-c3fa8b8a {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8rpx;
margin-bottom: 12rpx;
}
.order-item__bottom.data-v-c3fa8b8a {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 8rpx;
}
.order-item__price.data-v-c3fa8b8a {
font-size: 28rpx;
color: #e4393c;
font-weight: bold;
}
.order-item__qty.data-v-c3fa8b8a {
font-size: 24rpx;
color: #999;
}
.total-bar.data-v-c3fa8b8a {
background: #fff;
padding: 24rpx;
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 28rpx;
color: #333;
margin-bottom: 16rpx;
}
.total-bar__price.data-v-c3fa8b8a {
font-size: 36rpx;
color: #e4393c;
font-weight: bold;
margin-left: 8rpx;
}
.agreement.data-v-c3fa8b8a {
background: #fff;
padding: 24rpx;
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.agreement__checkbox.data-v-c3fa8b8a {
width: 40rpx;
height: 40rpx;
border: 2rpx solid #ddd;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16rpx;
font-size: 24rpx;
color: #fff;
}
.agreement__checkbox--checked.data-v-c3fa8b8a {
background: #e4393c;
border-color: #e4393c;
}
.agreement__text.data-v-c3fa8b8a {
font-size: 26rpx;
.product-item__spec.data-v-c3fa8b8a {
font-size: 22rpx;
color: #666;
}
.product-item__price.data-v-c3fa8b8a {
font-size: 30rpx;
color: #e91e63;
font-weight: 700;
}
/* 协议 */
.agreement.data-v-c3fa8b8a {
background: #fffbe6;
margin: 0 24rpx 16rpx;
padding: 20rpx 24rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
}
.agreement__checkbox.data-v-c3fa8b8a {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
flex-shrink: 0;
}
.agreement__text.data-v-c3fa8b8a {
font-size: 24rpx;
color: #333;
line-height: 36rpx;
}
/* 底部提交栏 */
.submit-bar.data-v-c3fa8b8a {
position: fixed;
bottom: 0;
@ -141,16 +232,32 @@
background: #fff;
padding: 16rpx 24rpx;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
justify-content: space-between;
}
.submit-btn.data-v-c3fa8b8a {
background: #e4393c;
.submit-bar__left.data-v-c3fa8b8a {
display: flex;
align-items: baseline;
}
.submit-bar__label.data-v-c3fa8b8a {
font-size: 26rpx;
color: #333;
}
.submit-bar__price.data-v-c3fa8b8a {
font-size: 36rpx;
color: #e91e63;
font-weight: 700;
}
.submit-bar__btn.data-v-c3fa8b8a {
background: linear-gradient(135deg, #FF6D9B, #FF4081);
color: #fff;
text-align: center;
padding: 20rpx 0;
padding: 20rpx 60rpx;
border-radius: 44rpx;
font-size: 30rpx;
font-size: 28rpx;
font-weight: 600;
}
.submit-btn--disabled.data-v-c3fa8b8a {
.submit-bar__btn--disabled.data-v-c3fa8b8a {
background: #ccc;
pointer-events: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -6,6 +6,21 @@ const ENV_BASE_URL = {
// 部署时替换为真实域名
};
const BASE_URL = ENV_BASE_URL["development"];
function toCamelCase(obj) {
if (obj === null || typeof obj !== "object")
return obj;
if (Array.isArray(obj)) {
return obj.map((item) => toCamelCase(item));
}
const result = {};
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
const camelKey = key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
result[camelKey] = toCamelCase(obj[key]);
}
}
return result;
}
function getToken() {
return common_vendor.index.getStorageSync("token") || "";
}
@ -34,7 +49,8 @@ function request(options) {
if (statusCode >= 200 && statusCode < 300) {
const body = res.data;
if (body.code === 0) {
resolve(body.data);
const camelData = toCamelCase(body.data);
resolve(camelData);
} else {
common_vendor.index.showToast({ title: body.message || "请求失败", icon: "none" });
reject(new Error(body.message));
@ -66,16 +82,16 @@ function autoLogin() {
common_vendor.index.setStorageSync("token", data.token);
resolve();
} catch (err) {
common_vendor.index.__f__("error", "at utils/request.ts:89", "登录接口调用失败:", err);
common_vendor.index.__f__("error", "at utils/request.ts:109", "登录接口调用失败:", err);
reject(err);
}
} else {
common_vendor.index.__f__("error", "at utils/request.ts:93", "微信登录获取 code 失败");
common_vendor.index.__f__("error", "at utils/request.ts:113", "微信登录获取 code 失败");
reject(new Error("获取微信 code 失败"));
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at utils/request.ts:98", "uni.login 失败:", err);
common_vendor.index.__f__("error", "at utils/request.ts:118", "uni.login 失败:", err);
reject(err);
}
});

View File

@ -22,6 +22,24 @@ interface ApiResponse<T = unknown> {
message: string
}
/** 将下划线命名转换为驼峰命名 */
function toCamelCase(obj: any): any {
if (obj === null || typeof obj !== 'object') return obj
if (Array.isArray(obj)) {
return obj.map(item => toCamelCase(item))
}
const result: any = {}
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
const camelKey = key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase())
result[camelKey] = toCamelCase(obj[key])
}
}
return result
}
function getToken(): string {
return uni.getStorageSync('token') || ''
}
@ -52,7 +70,9 @@ export function request<T = unknown>(options: RequestOptions): Promise<T> {
if (statusCode >= 200 && statusCode < 300) {
const body = res.data as ApiResponse<T>
if (body.code === 0) {
resolve(body.data)
// 将下划线命名转换为驼峰命名
const camelData = toCamelCase(body.data)
resolve(camelData)
} else {
uni.showToast({ title: body.message || '请求失败', icon: 'none' })
reject(new Error(body.message))

View File

@ -85,13 +85,65 @@ export async function createOrder(req: AuthRequest, res: Response): Promise<void
// GET /api/orders - 获取用户订单列表
export async function getOrders(req: AuthRequest, res: Response): Promise<void> {
try {
const [rows] = await pool.execute<RowDataPacket[]>(
`SELECT id, order_no, status, total_price, created_at, updated_at
const [orderRows] = await pool.execute<RowDataPacket[]>(
`SELECT id, order_no, status, total_price, receiver_name, receiver_phone, receiver_address, created_at, updated_at
FROM orders WHERE user_id = ?
ORDER BY created_at DESC`,
[req.userId]
)
res.json({ code: 0, data: rows })
// 为每个订单获取商品信息
const ordersWithItems = await Promise.all(
orderRows.map(async (order) => {
const [itemRows] = await pool.execute<RowDataPacket[]>(
`SELECT oi.id, oi.product_id, oi.spec_data_id, oi.quantity, oi.unit_price,
p.name as product_name, p.thumb, p.banner_images,
sd.model_name, sd.fineness, sd.main_stone, sd.ring_size
FROM order_items oi
JOIN products p ON oi.product_id = p.id
JOIN spec_data sd ON oi.spec_data_id = sd.id
WHERE oi.order_id = ?`,
[order.id]
)
// 格式化商品数据
const items = itemRows.map((item) => ({
id: item.id,
productId: item.product_id,
specDataId: item.spec_data_id,
quantity: item.quantity,
unitPrice: item.unit_price,
product: {
name: item.product_name,
thumb: item.thumb,
bannerImages: item.banner_images ? JSON.parse(item.banner_images) : [],
},
specData: {
modelName: item.model_name,
fineness: item.fineness,
mainStone: item.main_stone,
ringSize: item.ring_size,
},
}))
// 转换为驼峰格式
return {
id: order.id,
orderNo: order.order_no,
userId: order.user_id,
status: order.status,
totalPrice: order.total_price,
receiverName: order.receiver_name,
receiverPhone: order.receiver_phone,
receiverAddress: order.receiver_address,
createdAt: order.created_at,
updatedAt: order.updated_at,
items,
}
})
)
res.json({ code: 0, data: ordersWithItems })
} catch (err) {
console.error('getOrders error:', err)
res.status(500).json({ code: 500, message: '获取订单列表失败' })
@ -117,6 +169,8 @@ export async function getOrderDetail(req: AuthRequest, res: Response): Promise<v
return
}
const order = orderRows[0]
const [itemRows] = await pool.execute<RowDataPacket[]>(
`SELECT oi.id, oi.product_id, oi.spec_data_id, oi.quantity, oi.unit_price,
p.name as product_name, p.banner_images,
@ -128,7 +182,45 @@ export async function getOrderDetail(req: AuthRequest, res: Response): Promise<v
[id]
)
res.json({ code: 0, data: { ...orderRows[0], items: itemRows } })
// 格式化商品数据
const items = itemRows.map((item) => ({
id: item.id,
productId: item.product_id,
specDataId: item.spec_data_id,
quantity: item.quantity,
unitPrice: item.unit_price,
product: {
name: item.product_name,
bannerImages: item.banner_images ? JSON.parse(item.banner_images) : [],
},
specData: {
modelName: item.model_name,
fineness: item.fineness,
mainStone: item.main_stone,
ringSize: item.ring_size,
},
}))
// 转换为驼峰格式
const orderDetail = {
id: order.id,
orderNo: order.order_no,
userId: order.user_id,
status: order.status,
totalPrice: order.total_price,
receiverName: order.receiver_name,
receiverPhone: order.receiver_phone,
receiverAddress: order.receiver_address,
paymentTime: order.payment_time,
paymentProof: order.payment_proof,
shippingCompany: order.shipping_company,
shippingNo: order.shipping_no,
createdAt: order.created_at,
updatedAt: order.updated_at,
items,
}
res.json({ code: 0, data: orderDetail })
} catch (err) {
console.error('getOrderDetail error:', err)
res.status(500).json({ code: 500, message: '获取订单详情失败' })