合并代码

This commit is contained in:
sx 2025-01-21 09:39:21 +08:00
parent 5f802e60ac
commit 6e9ca6a925
12 changed files with 307 additions and 123 deletions

View File

@ -5,18 +5,17 @@ const config = {
host: 'http://localhost:5173', host: 'http://localhost:5173',
// #endif // #endif
// #ifndef H5 // #ifndef H5
host: 'https://539c1514.r24.cpolar.top', host: 'http://2h34ni.natappfree.cc',
// host: 'http://gfjds5.natappfree.cc',
// #endif // #endif
// 支付方式配置 // 支付方式配置
payType: { payType: {
score: { score: {
name: '积分', name: '积分',
img: '/static/images/pay/wechat.png', img: '/static/score.png',
}, },
balance: { balance: {
name: '余额', name: '余额',
img: '/static/images/pay/wechat.png', img: '/static/balance.png',
}, },
}, },
// 腾讯im聊天 // 腾讯im聊天

View File

@ -5,19 +5,22 @@ import api from '@/api/index.js'
const order = { const order = {
/** /**
* 订单支付 * 订单取消
* @param {Object} event 事件对象 * @param {Object} event 事件对象
*/ */
orderPay: (event) => { orderCancel: (event) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
api.shop.orderPay({ util.alert({
content: '取消订单后不可恢复,确认取消订单?',
}).then(res => {
if (!res.confirm) return
//
return api.shop.orderCancel({
query: { query: {
...event.query, id: event.orderId,
}, },
data: [ })
event.orderId, }).then(res => {
],
}).then(rs => {
if (res.code == 200) { if (res.code == 200) {
resolve(res.data) resolve(res.data)
return return
@ -28,6 +31,18 @@ const order = {
}) })
}) })
}) })
},
/**
* 订单支付
* @param {Object} event 事件对象
*/
orderPay(event) {
uni.navigateTo({
url: util.setUrl('/pages/shop/commodity/payment', {
orderId: event.id,
})
})
} }
} }

View File

@ -1804,11 +1804,6 @@ const util = {
}) })
}) })
}, },
// 分页
paging: {
//
},
} }
export default util export default util

View File

@ -3,23 +3,55 @@
* 物流入口 * 物流入口
*/ */
import {
ref,
reactive,
defineProps,
computed
} from 'vue'
import {
onLoad,
} from '@dcloudio/uni-app';
//
import util from '@/common/js/util.js'
// api
import api from '@/api/index.js'
//
//
const props = defineProps({
detail: {
type: Object,
default: () => ({})
},
logistics: {
type: Object,
default: () => ({})
}
})
//
const productImg = computed(() => props.detail.orderDetailList[0]?.productInfo?.sliderImage.split(',')[0])
onLoad(() => {
//
})
// //
function link(url) { function link(url) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/shop/order/logistics' url: util.setUrl('/pages/shop/order/logistics', {
//
})
}) })
} }
</script> </script>
<template> <template>
<view class="detail rows oh ptb20 plr30 bfff" @click="link"> <view class="detail rows oh ptb20 plr30 bfff" @click="link" v-if="logistics">
<image class="wh100 br10" <image class="wh100 br10" :src="productImg" mode="aspectFill" />
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif"
mode="aspectFill" />
<view class="col f1 ml20 f28"> <view class="col oh f1 ml20 f28">
<view class="c999">2024.12.10 18:00</view> <view class="c999">{{logistics.theLastTime}}</view>
<view class="mt10 f30">你的快递正在路上请耐心等待</view> <view class="mt10 thd f30">{{logistics.theLastMessage}}</view>
</view> </view>
<uni-icons type="right" color="#999" size="30rpx" /> <uni-icons type="right" color="#999" size="30rpx" />

View File

@ -21,8 +21,6 @@
import api from '@/api/index.js' import api from '@/api/index.js'
// util // util
import util from '@/common/js/util'; import util from '@/common/js/util';
//
import order from '@/common/js/order.js'
// //
import secondPwd from '@/components/mine/payPwd.vue' import secondPwd from '@/components/mine/payPwd.vue'
const { const {

View File

@ -1,41 +1,127 @@
<script setup> <script setup>
// //
import { import {
ref ref,
reactive,
computed,
} from 'vue'; } from 'vue';
import {
onLoad,
onUnload,
onReachBottom,
onPullDownRefresh,
onPageScroll
} from '@dcloudio/uni-app';
//
import order from '@/common/js/order.js'
// api
import api from '@/api/index.js'
// util
import util from '@/common/js/util';
// //
import productList from '@/components/shop/productList/productList' import productList from '@/components/shop/productList/productList'
// //
import logistics from '@/components/shop/order/logistics'; import logisticsVue from '@/components/shop/order/logistics';
//
import JyCommodityAddress from '@/components/public/jy-commodity-address'
// //
const detail = ref({ const detail = reactive({
status: 1, createTime: '',
statusText: '待发货', coutDownTime: '',
//
orderDetailList: [],
//
logistics: {
info: [],
},
}) })
// id
const orderId = ref('')
//
const showOrderDetail = ref(false)
//
const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {})
onLoad((option) => {
if (option.orderId) orderId.value = option.orderId
//
getDetail()
//
addListener()
})
onUnload(() => {
//
removeListener()
})
//
function addListener() {
uni.$on('updateOrderDetail', () => {
//
getDetail()
})
}
//
function removeListener() {
uni.$off('updateOrderDetail')
}
//
function getDetail() {
api.shop.getOrderDetail({
query: {
id: orderId.value
}
}).then(res => {
if (res.code == 200) {
let result = res.data
result.status = Number(result.status)
Object.assign(detail, {}, result)
return
}
util.alert({
content: res.msg,
showCancel: false,
})
})
}
/**
* 文本复制
* @param {Object} text
*/
function handleCopy(text) {
util.copyText(text)
}
//
function handleCancel() {
order.orderCancel({
orderId: orderId.value
}).then(res => {
uni.$emit('updateOrderList')
//
getDetail()
return
})
}
</script> </script>
<template> <template>
<view class="app"> <view class="app">
<!-- 物流状态 --> <!-- 物流状态 -->
<view class="detail"> <view class="detail">
<logistics /> <logisticsVue :detail="detail" :logistics="logistics" />
</view> </view>
<!-- 地址详情 --> <!-- 地址详情 -->
<view class="address rows mtb20 ptb15 plr30 bfff"> <view class="bfff mtb20 p25">
<image class="wh30 oh fs0" src="/static/address.png" mode="aspectFill" /> <!-- 地址 -->
<!-- --> <JyCommodityAddress v-model:address="detail.address" :shopEdit="[0,1].includes(detail.status)" />
<view class="f1 mlr20">
<view class="f30">山东省济南市槐荫区绿地新城商务大厦</view>
<view class="mt10 c999 f26">
<text>海棠的秋</text>
<text class="ml10">15666006592</text>
</view>
</view>
<!-- 修改地址 -->
<view class="btn ti warmHollow plr10 bs0">修改地址</view>
</view> </view>
<!-- 商品信息 --> <!-- 商品信息 -->
@ -43,64 +129,66 @@
<view class="header line rows ptb20 f28"> <view class="header line rows ptb20 f28">
<!-- 店铺 --> <!-- 店铺 -->
<view class="store df aic thd f1"> <view class="store df aic thd f1">
<image class="wh50 br10" <image class="wh50 br10" :src="detail.merImg" mode="aspectFill" />
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif" <view class="name ml10 c333">{{detail.merName}}</view>
mode="aspectFill" />
<view class="name ml10 c333">家纺专营店</view>
</view> </view>
</view> </view>
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="product line df ptb20"> <view class="goods mtb20 plr10 df" v-for="(item,index) in detail.orderDetailList">
<view class="poster wh160"> <!-- 产品图 -->
<image class="wh160 br10" <image class="wh180 br10" :src="item.productInfo.sliderImage.split(',')[0]" mode="aspectFill" />
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif" <!-- 产品信息 -->
mode="aspectFill" /> <view class="f1 ml20 mr10">
<view class="name f30 t2hd">{{item.productName}}</view>
<view class="spec mt10 c999 f26">升级款 {{item.sku}}</view>
</view> </view>
<!-- 其他 -->
<!-- 产品名称 购买的规格 -->
<view class="info mlr20 f1">
<view class="name c333 f28">靠枕 纯棉靠枕 车载居家 纯棉100% 卡通靠枕 人体工学</view>
<view class="spec mt10 c999 f26">款式普通款 小熊</view>
</view>
<!-- 单价 数量 -->
<view class="tar"> <view class="tar">
<view class="price c666"> <view class="price">
<text class="f20"></text> <text class="f20"></text>
<text class="f26">89</text> <text class="f30">{{item.price}}</text>
</view> </view>
<view class="number f24 c999">x 1</view> <view class="c999 f28">x{{item.payNum}}</view>
</view> </view>
</view> </view>
<!-- 订单信息 --> <!-- 订单信息 -->
<view class="order mt30 f26 c999"> <view class="order mt30 f26 c999">
<view class="line mtb20 rows"> <view class="line mtb20 rows">
<text>订单编号251547812138</text> <text>订单编号{{detail.orderNo}}</text>
<view class="btn ti closeHollow plr20">复制</view> <view class="btn ti closeHollow plr20" @click="handleCopy(detail.orderNo)">复制</view>
</view> </view>
<template v-if="showOrderDetail">
<view class="line mtb20"> <view class="line mtb20">
<text>支付方式微信支付</text> <text>支付方式微信支付</text>
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<text>物流公司普通快递</text> <text>物流公司{{logistics.logisticsCompanyName}}</text>
</view> </view>
<view class="line mtb20 rows"> <view class="line mtb20 rows">
<view class="f1">快递单号251547812138</view> <view class="f1">快递单号{{detail.logistics.orderNo}}</view>
<view class="btn ti closeHollow plr20">复制</view> <view class="btn ti closeHollow plr20" @click="handleCopy(detail.logistics.orderNo)">复制</view>
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<text>下单时间2024-12-10 12:00</text> <text>下单时间{{detail.createTime}}</text>
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<text>发货时间2024-12-10 18:00</text> <text>发货时间2024-12-10 18:00</text>
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<text>收货时间2024-12-15 17:00</text> <text>收货时间2024-12-15 17:00</text>
</view> </view>
<view class="mtb30 fmid"> </template>
<template v-if="0">
<view class="mtb30 fmid" @click="showOrderDetail = !showOrderDetail">
<template v-if="!showOrderDetail">
<text>查看更多订单信息</text> <text>查看更多订单信息</text>
<uni-icons type="bottom" color="" /> <uni-icons type="bottom" color="" />
</template> </template>
@ -118,14 +206,14 @@
</view> </view>
<view class="fill"></view> <view class="fill"></view>
<view class="footer df jcr plr30 bfff shadow"> <view class="footer df jcr plr30 bfff shadow" v-if="[0,1].includes(detail.status)">
<template v-if="detail.status == 1"> <template v-if="detail.status == 0">
<view class="btn bar closeHollow plr30">取消订单</view> <view class="btn bar closeHollow plr30" @click="handleCancel">取消订单</view>
<view class="btn bar warmHollow plr30">继续付款</view> <view class="btn bar warmHollow plr30" @click="order.orderPay(detail)">继续付款</view>
</template> </template>
<template v-if="detail.status == 2"> <template v-if="detail.status == 1">
<view class="btn bar closeHollow plr30">申请退款</view> <view class="btn bar closeHollow plr30">申请退款</view>
<view class="btn bar warmHollow plr30">催发货</view> <!-- <view class="btn bar warmHollow plr30">催发货</view> -->
</template> </template>
<template v-if="detail.status == 3"> <template v-if="detail.status == 3">
<view class="btn bar closeHollow plr30">申请退款</view> <view class="btn bar closeHollow plr30">申请退款</view>
@ -145,6 +233,6 @@
</view> </view>
</template> </template>
<style> <style lang="scss">
</style>7 </style>

View File

@ -13,15 +13,17 @@
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
// //
import apex from '@/components/header/apex.vue' import apex from '@/components/header/apex.vue'
// //
import JyShopNavigation from '@/components/public/jy-shop-navigation' import JyShopNavigation from '@/components/public/jy-shop-navigation'
// //
// import JyOrderCard from '@/components/public/jy-order-card'
import orderItem from '@/components/shop/order/item.vue'; import orderItem from '@/components/shop/order/item.vue';
// //
import util from '@/common/js/util'; import util from '@/common/js/util';
// api // api
import api from '@/api/index.js'; import api from '@/api/index.js';
//
import order from '@/common/js/order.js'
// tabs // tabs
const tabs = reactive([{ const tabs = reactive([{
id: '', id: '',
@ -51,13 +53,10 @@
name: '已取消' name: '已取消'
} }
]) ])
//
const params = reactive({
currentTab: 0,
search: ''
})
// //
const list = reactive({ const list = reactive({
status: '',
search: '',
data: [], data: [],
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
@ -114,7 +113,7 @@
// //
function getMoreList() { function getMoreList() {
if (listlist.data.length >= list.total) return if (list.data.length >= list.total) return
list.pageNum++ list.pageNum++
getList() getList()
} }
@ -123,6 +122,8 @@
function getList() { function getList() {
api.shop.getOrderList({ api.shop.getOrderList({
query: { query: {
searchStr: list.search,
status: list.status,
pageNum: list.pageNum, pageNum: list.pageNum,
pageSize: list.pageSize, pageSize: list.pageSize,
}, },
@ -149,7 +150,9 @@
*/ */
function handleItem(ev) { function handleItem(ev) {
uni.navigateTo({ uni.navigateTo({
url: util.setUrl('/pages/shop/order/detail') url: util.setUrl('/pages/shop/order/detail', {
orderId: ev.id,
})
}) })
} }
@ -163,14 +166,15 @@
} }
/** /**
* 支付 * 取消订单
* @param {Object} item 订单 * @param {Object} item 订单
*/ */
function handlePay(item) { function handleCancel(item) {
uni.navigateTo({ order.orderCancel({
url: util.setUrl('/pages/shop/commodity/payment', {
orderId: item.id, orderId: item.id,
}) }).then(res => {
//
refreshList()
}) })
} }
</script> </script>
@ -180,7 +184,7 @@
<template #content> <template #content>
<view class="search rows f1 mr30 plr20 bf8f8f8 br10"> <view class="search rows f1 mr30 plr20 bf8f8f8 br10">
<uni-icons type="search" color="#999" /> <uni-icons type="search" color="#999" />
<input class="input ml20" type="text" placeholder="搜索内容" /> <input class="input ml20" v-model="list.search" type="text" placeholder="搜索内容" @confirm="refreshList" />
</view> </view>
</template> </template>
</apex> </apex>
@ -189,7 +193,7 @@
<view class="shopHeaderBg bgColor"></view> <view class="shopHeaderBg bgColor"></view>
<view class="f1 pr"> <view class="f1 pr">
<JyShopNavigation :current="params.currentTab" :list="tabs" @tabItemClick="itemClick" marright="25px" <JyShopNavigation :current="list.status" :list="tabs" @tabItemClick="itemClick" marright="25px"
activeWeight='600' activeColor="#333333" activeBarColor="initial" /> activeWeight='600' activeColor="#333333" activeBarColor="initial" />
</view> </view>
@ -202,13 +206,14 @@
<template #menu="scope"> <template #menu="scope">
<view class="menu ptb20 df jcr" v-if="[0,1,4,5,6].includes(scope.item.status)"> <view class="menu ptb20 df jcr" v-if="[0,1,4,5,6].includes(scope.item.status)">
<template v-if="scope.item.status == 0"> <template v-if="scope.item.status == 0">
<view class="btn bar closeHollow plr30">取消订单</view> <view class="btn bar closeHollow plr30" @click.stop="handleCancel(scope.item)">
<view class="btn bar warmHollow plr30" @click.stop="handlePay(scope.item)">继续付款 取消订单</view>
<view class="btn bar warmHollow plr30" @click.stop="order.orderPay(item)">继续付款
</view> </view>
</template> </template>
<template v-if="scope.item.status == 1"> <template v-if="scope.item.status == 1">
<view class="btn bar closeHollow plr30">申请退款</view> <view class="btn bar closeHollow plr30">申请退款</view>
<view class="btn bar warmHollow plr30">催发货</view> <!-- <view class="btn bar warmHollow plr30">催发货</view> -->
</template> </template>
<template v-if="scope.item.status == 3"> <template v-if="scope.item.status == 3">
<view class="btn bar closeHollow plr30">申请退款</view> <view class="btn bar closeHollow plr30">申请退款</view>

View File

@ -3,10 +3,30 @@
import { import {
ref, ref,
reactive, reactive,
computed computed,
} from 'vue'; } from 'vue';
// //
import productList from '@/components/shop/productList/productList.vue'; import productList from '@/components/shop/productList/productList.vue';
import {
onLoad,
onUnload,
} from '@dcloudio/uni-app';
//
const detail = reactive({
createTime: '',
coutDownTime: '',
//
orderDetailList: [],
//
logistics: {
info: [],
},
})
//
const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {})
// id
const orderId = ref('')
// //
const flow = reactive([{ const flow = reactive([{
@ -31,6 +51,40 @@
if (!showMore.value) result.length = Math.min(flow.length, 2) if (!showMore.value) result.length = Math.min(flow.length, 2)
return result return result
}) })
onLoad((option) => {
if (option.orderId) orderId.value = option.orderId
//
getDetail()
})
//
function getDetail() {
api.shop.getOrderDetail({
query: {
id: orderId.value
}
}).then(res => {
if (res.code == 200) {
let result = res.data
result.status = Number(result.status)
Object.assign(detail, {}, result)
return
}
util.alert({
content: res.msg,
showCancel: false,
})
})
}
/**
* 文本复制
* @param {Object} text
*/
function handleCopy(text) {
util.copyText(text)
}
</script> </script>
<template> <template>

View File

@ -387,5 +387,3 @@ likeType
9已取消 9已取消
1737292587952
1737378810000

BIN
jiuyi2/static/balance.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
jiuyi2/static/score.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -5,7 +5,7 @@ import uni from '@dcloudio/vite-plugin-uni';
// //
// let target = 'http://101.35.80.139:8080' // let target = 'http://101.35.80.139:8080'
let target = 'http://2hs9aj.natappfree.cc' let target = 'http://2h34ni.natappfree.cc'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],