This commit is contained in:
2026-04-10 16:50:22 +08:00
parent a2fadc57b8
commit 4002f91a54
4 changed files with 157 additions and 520 deletions

View File

@ -3,8 +3,8 @@ export default {
appName: "Wagoo",
appShareName: "Wagoo",
appId: "wx00e2dcdc7c02b23a",
// apiBaseUrl: "https://api.wagoo.me/api/v1", // 服务端测试地址
apiBaseUrl: "https://api.wagoo.pet/api/v1", // 服务端生产地址
apiBaseUrl: "https://api.wagoo.me/api/v1", // 服务端测试地址
// apiBaseUrl: "https://api.wagoo.pet/api/v1", // 服务端生产地址
// apiBaseUrl: "http:192.168.30.79", //本地接口
tencentMapKey: "WSBBZ-7OXK4-46QUC-KFB7B-4N3W7-M2BXM",
tencentSecret: "vb7D0PGj7xUvmOLuJz2Jd7ykTMpjiWRJ",

View File

@ -643,7 +643,7 @@ export default {
justify-content: flex-start;
align-items: flex-start;
margin-top: 20rpx;
padding: 0 20rpx;
padding: 0 20rpx 120rpx;
.goods-list-item {
flex: 1;

View File

@ -1,17 +1,18 @@
<template>
<view class="flex-row-start info-cell good-info" :class="{'good-info-multi' : data.length > 1}">
<template v-if="data.length === 1">
<view class="good-wrapper">
<image class="good-icon" :src="data[0].product_pic" mode="aspectFill" @click="$emit('clickGoodImg', data[0])" />
<view class="good-content" @click="$emit('clickGoodInfo', data[0])">
<view class="goods-row-first">
<view class="goods-name">{{ data[0].goods_name || "" }}</view>
<text class="goods-price">¥{{ data[0].goods_price || data[0].product_actual_price }}</text>
<view class="price-section">
<view class="price-left">
<text class="hand-price-tag">到手价</text>
<text class="current-price">¥{{ data[0].goods_price || data[0].product_actual_price }}</text>
<text class="origin-price" v-if="data[0].product_original_price">原价¥{{ data[0].product_original_price }}</text>
</view>
<view class="goods-row-second">
<view class="goods-spec">
{{ data[0].shuxing_name || "" }}{{ data[0].shuxing_name && data[0].price_name ? ";" : "" }}{{ data[0].price_name || "" }}
<text class="goods-count">已售{{ data[0].number || 1 }}</text>
</view>
<text class="goods-count">{{ data[0].number || 1 }}</text>
<view class="goods-name" @click="$emit('clickGoodInfo', data[0])">
{{ data[0].goods_name || "" }}
</view>
</view>
</template>
@ -81,70 +82,66 @@
&.good-info {
padding-top: 20rpx;
align-items: center;
align-items: flex-start;
.good-icon {
width: 100rpx;
height: 100rpx;
border-radius: 8rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.good-content {
flex: 1;
min-width: 0;
overflow: hidden;
.good-wrapper {
width: 100%;
display: flex;
flex-direction: column;
min-height: 100rpx;
}
.goods-row-first {
.good-icon {
width: 100%;
height: 400rpx;
border-radius: 16rpx;
background: #f5f5f5;
}
.price-section {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8rpx;
align-items: baseline;
margin-top: 20rpx;
.goods-name {
flex: 1;
font-size: 28rpx;
color: #3D3D3D;
line-height: 40rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 20rpx;
}
.goods-price {
flex-shrink: 0;
font-size: 28rpx;
color: #3D3D3D;
font-weight: 500;
}
}
.goods-row-second {
.price-left {
display: flex;
align-items: center;
justify-content: space-between;
align-items: baseline;
.goods-spec {
flex: 1;
.hand-price-tag {
font-size: 24rpx;
color: #fff;
background: linear-gradient(135deg, #FF19A0, #FF6B35);
padding: 4rpx 12rpx;
border-radius: 4rpx;
margin-right: 12rpx;
}
.current-price {
font-size: 40rpx;
color: #FF19A0;
font-weight: bold;
}
.origin-price {
font-size: 24rpx;
color: #999;
margin-right: 20rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-decoration: line-through;
margin-left: 12rpx;
}
}
.goods-count {
flex-shrink: 0;
font-size: 24rpx;
color: #999;
}
}
.goods-name {
font-size: 32rpx;
color: #3D3D3D;
line-height: 44rpx;
font-weight: bold;
margin-top: 16rpx;
}
}

View File

@ -1,4 +1,5 @@
<template>
<view class="page-container">
<view class="order-create-container">
<!-- 商品信息 -->
<view class="info-cell goods-info-cell">
@ -20,67 +21,55 @@
<view class="price-wrapper">
<text class="final-price-label">到手价</text>
<text class="final-price">¥{{ item.product_price || item.goods_price }}</text>
<text class="original-price">
¥{{ item.original_price || (item.product_price * 1.5).toFixed(2) }}
</text>
</view>
<view class="sales-info">
<text class="sales-count">已售0件</text>
<text class="sales-count">{{ item.goods_name }}</text>
</view>
</view>
</view>
</template>
</view>
<!-- <view class="info-cell pay-cell">
<view class="flex-row-between pay-info">
<text class="pay-label">商品金额</text>
<text class="pay-value">{{ payPrice }}</text>
</view>
<view
v-if="couponList.length"
class="flex-row-between pay-info coupon-row"
@click="showCouponModal = true"
>
<text class="pay-label">优惠券</text>
<view class="flex-row-end">
<text class="coupon-price">
{{ couponFee ? `- ¥${couponFee}` : "请选择" }}
</text>
<!-- 图片撑满屏幕宽度 -->
<image
class="arrow-icon"
src="@/static/images/arrow_right_black.png"
class="full-width-img"
src="https://static.wagoo.pet/statics/1.png"
mode="widthFix"
/>
<image
class="full-width-img"
src="https://static.wagoo.pet/statics/2.png"
mode="widthFix"
/>
<image
class="full-width-img"
src="https://static.wagoo.pet/statics/3.png"
mode="widthFix"
/>
<image
class="full-width-img"
src="https://static.wagoo.pet/statics/4.png"
mode="widthFix"
/>
<image
class="full-width-img"
src="https://static.wagoo.pet/statics/5.png"
mode="widthFix"
/>
<image
class="full-width-img"
src="https://static.wagoo.pet/statics/6.png"
mode="widthFix"
/>
</view>
</view>
<view class="flex-row-between pay-price">
<text class="pay-label">需付款</text>
<text class="pay-total">{{ payPrice }}</text>
</view>
</view> -->
<!-- <view class="info-cell payment-method-cell">
<view class="payment-item" @click.stop="selectOption1('1')">
<view class="payment-left">
<image class="payment-icon" src="@/static/images/douy.png" mode="widthFix" />
<text class="payment-text">抖音支付</text>
</view>
<image class="payment-check"
:src="selected2 ? require('@/static/images/cart_checked.png') : require('@/static/images/unchecked.png')"
mode="widthFix" />
</view>
</view> -->
<view class="order-create-container">
<!-- 可拖动联系客服组件 -->
<DraggableContact ref="draggableContact" :onClick="handleContactBtnClick" />
<view class="place-view"></view>
<view class="order-create-bottom">
<!-- <view class="cancel-btn" @click="cancelOrder">
<text class="cancel-btn-text">取消订单</text>
</view> -->
<view class="pay-btn" @click="createOrder">
<text class="pay-btn-text">立即支付</text>
</view>
@ -92,6 +81,7 @@
@close="showGoodInfoModal = false"
/>
</view>
</view>
</template>
<script>
@ -193,7 +183,7 @@ export default {
const eventChannel = this.getOpenerEventChannel();
eventChannel.on("createOrder", (data) => {
// Helper function to extract first image from image_list
console.log(data,'--=?')
const extractFirstImage = (imageList) => {
if (!imageList) return "";
try {
@ -209,10 +199,8 @@ export default {
};
this.orderData = (data?.goodList || []).map((item) => {
// Check if product_pic is actually an image_list that needs parsing
let processedItem = { ...item };
if (processedItem.product_pic) {
// If product_pic looks like an array or JSON string, try to parse it
if (
typeof processedItem.product_pic === "string" &&
(processedItem.product_pic.startsWith("[") ||
@ -262,68 +250,11 @@ export default {
createCartOrder(params)
.then((res) => {
// Check if tt and requirePlugin are available
if (typeof tt !== "undefined" && tt.requirePlugin) {
try {
const plugin = tt.requirePlugin("lifeServicePlugin");
if (plugin && plugin.createOrder) {
// 先隐藏之前的loading让插件显示自己的弹窗
uni.hideLoading();
// let res1 = {
// data: {
// businessLine: 1,
// skuList: [
// {
// quantity: 1,
// skuId: "1861281775887367",
// skuType: 1,
// price: 12000,
// goodsInfo: {
// goodsName:
// "狗狗移动上门赛级洗护| 狗狗洗澡| 体重【5-10kg】",
// goodsPhoto:
// "https://static.wagoo.pet/statics/dog5to10base.png",
// goodsId: "7625864573682075667",
// goodsType: 1,
// },
// },
// ],
// bookInfo: {
// itemBookInfoList: [
// {
// poiId: "7620725019240319028",
// shopName: "WAGOO·上海市",
// outShopId: "life_7620725019240319028",
// goodsId: "7625864573682075667",
// bookStartTime: 1775613600000,
// bookEndTime: 1775622600000,
// },
// ],
// },
// payment: {
// totalAmount: 12000,
// },
// contactInfo: {
// phoneNumber: "13773726377",
// contactName: "老王",
// },
// storeInfo: {
// storeName: "WAGOO·上海市",
// },
// callbackData: {
// douyin_product_id: "7625864573682075667",
// douyin_sku_id: "1861281775887367",
// goods_id: 183,
// order_date: "2026-04-08",
// period_id: 1,
// test: 999999,
// },
// tradeOption: {
// life_trade_flag: 1,
// },
// },
// };
// console.log(res.data,'???')
plugin.createOrder({
skuList: res.data.skuList,
bookInfo: res.data.bookInfo,
@ -332,14 +263,10 @@ export default {
storeInfo: res.data.storeInfo,
tradeOption: res.data.tradeOption,
payment: res.data.payment,
// callbackData:res.data.callbackData,
// tradeOption:res.data.tradeOption,
// goodsList:res.data.goodsList,
success: (res) => {
const { orderId, outOrderNo } = res;
console.log("success res", res);
console.log("orderId", orderId, "outOrderNo", outOrderNo);
// Update data the Vue way
this.orderId = orderId;
this.outOrderNo = outOrderNo;
uni.navigateTo({
@ -348,22 +275,6 @@ export default {
},
fail: (res) => {
console.log("fail res", res);
const { orderId, outOrderNo, errNo, errMsg, errLogId } =
res;
if (errLogId) {
console.log("预下单失败", errNo, errMsg, errLogId);
}
if (orderId || outOrderNo) {
console.log(
"支付失败",
errNo,
errMsg,
orderId,
outOrderNo
);
}
console.log(errNo, errMsg);
// 隐藏抖音的报错信息,显示自定义中文提示
uni.showToast({
title: "支付失败",
icon: "none",
@ -410,8 +321,12 @@ export default {
</script>
<style lang="scss" scoped>
.page-container {
min-height: 100%;
background: #f7f8fa;
}
.order-create-container {
height: 100%;
padding: 20rpx;
box-sizing: border-box;
background: #f7f8fa;
@ -423,99 +338,13 @@ export default {
box-sizing: border-box;
margin-bottom: 20rpx;
.arrow-icon {
width: 11rpx;
height: 18rpx;
flex-shrink: 0;
}
&.address-info-cell {
.address-content {
display: flex;
flex-direction: column;
width: 100%;
position: relative;
}
.address-row-first {
display: flex;
align-items: center;
width: 100%;
margin-bottom: 10rpx;
}
.address-row-second {
display: flex;
width: 100%;
}
.address-icon {
width: 24rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 12rpx;
}
.address-placeholder {
font-size: 24rpx;
color: #3d3d3d;
padding: 20rpx 0rpx;
padding-bottom: 10rpx;
}
.address-name {
font-size: 28rpx;
color: #3d3d3d;
.address-phone {
margin-left: 8rpx;
}
}
.address-details {
font-size: 24rpx;
color: #999;
margin-left: 36rpx;
}
.arrow-icon {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 11rpx;
height: 18rpx;
flex-shrink: 0;
}
}
&.sliver-info-cell {
.sliver-content {
display: flex;
align-items: center;
width: 100%;
}
.sliver-icon {
width: 34rpx;
height: 34rpx;
flex-shrink: 0;
}
.sliver-text {
flex: 1;
margin-left: 20rpx;
font-size: 24rpx;
color: #3d3d3d;
}
}
&.goods-info-cell {
padding: 0;
.goods-item {
display: flex;
align-items: flex-start;
flex-direction: column;
width: 100%;
padding: 24rpx 20rpx;
box-sizing: border-box;
@ -526,8 +355,8 @@ export default {
}
.goods-img {
width: 200rpx;
height: 200rpx;
width: 100%;
height: 355px;
border-radius: 16rpx;
margin-right: 20rpx;
flex-shrink: 0;
@ -576,165 +405,18 @@ export default {
font-weight: 700;
margin-right: 12rpx;
}
.original-price {
font-size: 24rpx;
color: #999;
text-decoration: line-through;
}
}
.sales-info {
.sales-count {
font-size: 24rpx;
color: #999;
}
}
}
}
.goods-multi {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
.goods-imgs {
display: flex;
align-items: center;
flex: 1;
.goods-img-small {
width: 100rpx;
height: 100rpx;
margin-right: 8rpx;
border-radius: 16rpx;
flex-shrink: 0;
}
}
.goods-count-wrapper {
flex-shrink: 0;
.goods-count-text {
font-size: 24rpx;
color: #999;
}
}
}
}
&.pay-cell {
.pay-info {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16rpx 0;
.pay-label {
font-size: 24rpx;
color: #9b939a;
}
.pay-value {
font-size: 24rpx;
color: #3d3d3d;
}
}
.coupon-row {
.coupon-price {
font-size: 28rpx;
color: #ff19a0;
margin-right: 12rpx;
}
}
.pay-price {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 16rpx;
margin-top: 16rpx;
border-top: 1rpx solid #e5e5e5;
.pay-label {
font-size: 28rpx;
color: #3d3d3d;
}
.pay-total {
font-size: 28rpx;
color: #ff19a0;
font-size: 20px;
font-weight: 500;
line-height: 20px;
text-align: justify;
color: #3D3D3D;
}
}
}
&.payment-method-cell {
.payment-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 0;
&:not(:last-child) {
border-bottom: 1rpx solid #e5e5e5;
}
.payment-left {
display: flex;
align-items: center;
.payment-icon {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
.payment-text {
font-size: 24rpx;
color: #3d3d3d;
}
}
.payment-check {
width: 36rpx;
height: 36rpx;
flex-shrink: 0;
}
}
}
&.pay-type {
.pay-icon {
width: 52rpx;
height: 52rpx;
margin-right: 18rpx;
}
.pay-select-icon {
width: 36rpx;
height: 36rpx;
}
.pay-type-text {
flex: 1;
}
}
&.good-list {
padding: 20rpx;
.good-img {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
border-radius: 20rpx;
}
.good-num {
margin-right: 12rpx;
}
}
}
@ -759,23 +441,6 @@ export default {
gap: 20rpx;
box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.05);
.cancel-btn {
flex: 1;
height: 92rpx;
border-radius: 92rpx;
border: 2rpx solid #ff19a0;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
.cancel-btn-text {
font-size: 30rpx;
color: #ff19a0;
font-weight: 500;
}
}
.pay-btn {
flex: 1;
height: 92rpx;
@ -792,35 +457,10 @@ export default {
}
}
}
.sliver-content {
padding: 16rpx 0;
.sliver-item {
padding: 52rpx 0;
margin: 0 52rpx;
width: calc(100% - 52rpx * 2);
box-sizing: border-box;
border-bottom: 1rpx solid #f7f3f7;
&.disabled {
opacity: 0.5;
}
.select-icon {
width: 32rpx;
height: 32rpx;
margin-left: 20rpx;
}
}
.sliver-btn {
width: 630rpx;
height: 92rpx;
background: #fe019b;
border-radius: 92rpx;
margin: 18rpx auto 10rpx;
}
}
.full-width-img {
width: 100%;
display: block;
}
</style>