需要一个普通订单列表跟详情入口

This commit is contained in:
bobobobo
2026-01-29 00:57:07 +08:00
parent 41c1e5ba89
commit 256135f15b
6 changed files with 55 additions and 10 deletions

4
.env
View File

@@ -1,6 +1,6 @@
# API
VITE_SYSTEM_URL = "http://ea252b67.natappfree.cc"
# VITE_SYSTEM_URL = "https://dev.cqjcteach.cn/prod-api"
# VITE_SYSTEM_URL = "http://ea252b67.natappfree.cc"
VITE_SYSTEM_URL = "https://dev.cqjcteach.cn/prod-api"
# 第三方客户 channelId
VITE_CHANNEL_ID = "7b81ec142eca42baa045820793b821bb"

View File

@@ -53,6 +53,15 @@ export const addOrder = data => {
})
}
/** 创建普通订单接口 */
export const createOrder = data => {
return http({
url: '/api/service/order/normal',
method: 'post',
data
})
}
/** 我的拼团列表 */
export const getMyGroupList = data => {
return http({

View File

@@ -2,8 +2,8 @@
"name" : "密谈IM",
"appid" : "__UNI__9EFDC69",
"description" : "",
"versionName" : "1.1.1",
"versionCode" : 110,
"versionName" : "1.1.2",
"versionCode" : 111,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@@ -1,6 +1,6 @@
<script setup>
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getProductDetail, addOrder } from '@/api/mall'
import { getProductDetail, addOrder, createOrder } from '@/api/mall'
import { reactive, ref } from 'vue'
import { formatRMB } from '@/utils'
import { getUserAddress } from '@/api'
@@ -30,7 +30,9 @@
/** 默认地址 */
address: '',
/** 可选数量 */
maxNum: 1
maxNum: 1,
/** 是否发起拼团 */
startGroup: true
})
/** 顶部地址信息 */
const topRessData = reactive({
@@ -140,10 +142,17 @@
skuId: formData.spec
}
tixian.value.close()
if (formData.startGroup) {
const res = await addOrder(data)
await refreshUserInfo()
await showToast('订单提交成功', 'success')
navigateTo('/pages/shop-together/detail', { id: res.data.groupId })
} else {
const res = await createOrder(data)
await refreshUserInfo()
await showToast('订单提交成功', 'success')
navigateBack()
}
}
onShow(() => {
@@ -256,6 +265,29 @@
></image>
</view>
</view>
<view
class="pay-way-item"
@click="formData.startGroup = !formData.startGroup"
>
<view class="icon">
<image
src="/static/images/public/pingtuan.png"
mode="aspectFit"
class="left-icon"
></image>
<text>发起拼团</text>
</view>
<view class="check">
<image
v-show="formData.startGroup"
src="/static/images/public/check-to-confirm.png"
mode="aspectFit"
class="check-icon"
></image>
</view>
</view>
</view>
<!-- 底部按钮 -->

View File

@@ -126,6 +126,10 @@
border-radius: 32rpx;
background: #ffffff;
margin-bottom: 110rpx;
.pay-way-item + .pay-way-item {
border-top: 2rpx solid #e6e6e6;
box-sizing: border-box;
}
.pay-way-item {
padding: 32rpx;
display: flex;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB