3
0
Fork 0

fix(order): 订单详情添加规格, 添加代码格式化

This commit is contained in:
woody 2025-05-23 17:40:13 +08:00
parent f214679ace
commit 30558bbeae
6 changed files with 1936 additions and 374 deletions

View File

@ -19,9 +19,21 @@ yarn.lock
# uni-app specific # uni-app specific
uni_modules/ uni_modules/
.hbuilderx/
# Logs # Logs
*.log *.log
# Docs # Docs
docs/ docs/
# IDE settings
.vscode/
.idea/
# Temporary files
*.tmp
*.temp
# Configuration files that shouldn't be formatted
manifest.json

1447
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,10 @@
"weixin-js-sdk": "^1.6.0" "weixin-js-sdk": "^1.6.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/eslint-config-prettier": "^8.0.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-vue": "^9.33.0",
"less": "^3.13.1", "less": "^3.13.1",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"prettier": "^3.5.3" "prettier": "^3.5.3"
@ -25,7 +29,11 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write .", "format": "prettier --write .",
"check-format": "prettier --check ." "check-format": "prettier --check .",
"lint": "eslint --ext .js,.vue .",
"lint:fix": "eslint --ext .js,.vue . --fix",
"format:check": "prettier --check \"**/*.{js,vue,json,md}\"",
"format:write": "prettier --write \"**/*.{js,vue,json,md}\""
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
@ -52,4 +60,4 @@
} }
} }
} }
} }

View File

@ -1,6 +1,6 @@
<!-- <!--
* @Descripttion: * @Descripttion:
* @version: * @version:
* @Author: kBank * @Author: kBank
* @Date: 2022-11-21 15:11:22 * @Date: 2022-11-21 15:11:22
--> -->
@ -8,155 +8,162 @@
<view class="content"> <view class="content">
<backIcon></backIcon> <backIcon></backIcon>
<view class="index_header"> <view class="index_header">
<view>{{'我的订单'}}</view> <view>{{ '我的订单' }}</view>
</view> </view>
<!-- <view class="clearFilter" @click="clearFilter"> <!-- <view class="clearFilter" @click="clearFilter">
清除筛选 清除筛选
</view> --> </view> -->
<view <view class="shareImg" @click="rightOpen">
class="shareImg" <img src="@/static/images/serach_999.png" alt="" />
@click="rightOpen"
>
<img
src="@/static/images/serach_999.png"
alt=""
/>
</view> </view>
<view class="zhan1"></view> <view class="zhan1"></view>
<view class="con_top"> <view class="con_top">
<view class="tab"> <view class="tab">
<view v-for="(item, index) in orderStatusList" <view
:key="index" v-for="(item, index) in orderStatusList"
@click="isTab = item.value" :key="index"
class="tab_i"> @click="isTab = item.value"
class="tab_i"
>
<view>{{ item.label }}</view> <view>{{ item.label }}</view>
<view :class="isTab===item.value?'heng':'heng1'"> <view :class="isTab === item.value ? 'heng' : 'heng1'"> </view>
</view>
</view> </view>
</view> </view>
<view class="hui"></view> <view class="hui"></view>
</view> </view>
<view class="zhan"></view> <view class="zhan"></view>
<view v-for="(item, index) in orderLists" <view v-for="(item, index) in orderLists" :key="index" class="orderList_i">
:key="index"
class="orderList_i">
<view @click.stop="getDetails(item)"> <view @click.stop="getDetails(item)">
<view class="disFlex atm just mbt10"> <view class="disFlex atm just mbt10">
<view class="disFlex atm"> <view class="disFlex atm">
<view class="quan">{{ item.orderTypeVal }}</view> <view class="quan">{{ item.orderTypeVal }}</view>
<view class="tit1">{{'订单编号'}}{{ item.orderCode }}</view> <view class="tit1">{{ '订单编号' }}{{ item.orderCode }}</view>
</view> </view>
<view class="tit2"> <view class="tit2">
{{ item.orderStatusVal }} {{ item.orderStatusVal }}
</view> </view>
</view> </view>
<view v-for="ctem,cndex in item.itemList" <view
:key="cndex" v-for="(ctem, cndex) in item.itemList"
class="disFlex atm just mbt10"> :key="cndex"
class="disFlex atm just mbt10"
>
<view class="disFlex atm"> <view class="disFlex atm">
<img :src="ctem.cover" <img :src="ctem.cover" alt="" />
alt="">
<view class="tit3"> <view class="tit3">
{{ ctem.productName }} {{ ctem.productName }}
</view> </view>
</view> </view>
<view style="text-align:right"> <view style="text-align: right">
<view class="tit4"> <view class="tit4">
{{ ctem.price | numberToCurrency | isLocal}} {{ ctem.price | numberToCurrency | isLocal }}
</view>
<view class="tit5">
x{{ ctem.quantity }}
</view> </view>
<view class="tit5"> x{{ ctem.quantity }} </view>
</view> </view>
</view>
<view class="tit1">
{{'创建时间'}}{{ item.creationTime }}
</view> </view>
<view class="tit1"> {{ '创建时间' }}{{ item.creationTime }} </view>
</view> </view>
<view class="xian"></view> <view class="xian"></view>
<view class="disFlex"> <view class="disFlex">
<view style="flex: 1;"></view> <view style="flex: 1"></view>
<view class="disFlex"> <view class="disFlex">
<u-button type="primary" <u-button
class="lBtn" type="primary"
:plain="true" class="lBtn"
shape="circle" :plain="true"
text="备注" shape="circle"
@click="openRemark(item)" text="备注"
v-if="item.remark" @click="openRemark(item)"
color="#999"></u-button> v-if="item.remark"
<u-button type="primary" color="#999"
v-if="item.orderStatus == 0" ></u-button>
class="lBtn" <u-button
:plain="true" type="primary"
shape="circle" v-if="item.orderStatus == 0"
:text="'撤销订单'" class="lBtn"
@click="cancelPay(item)" :plain="true"
color="#999"></u-button> shape="circle"
<u-button type="primary" :text="'撤销订单'"
v-if="item.orderStatus == 0" @click="cancelPay(item)"
shape="circle" color="#999"
@click="goPay(item)" ></u-button>
:text="'支付'" <u-button
color="#005BAC"></u-button> type="primary"
<u-button type="primary" v-if="item.orderStatus == 0"
v-if="item.orderStatus == 3||item.orderStatus == 5" shape="circle"
@click="openWl(item)" @click="goPay(item)"
shape="circle" :text="'支付'"
:text="'查看物流'" color="#005BAC"
color="#E03030"></u-button> ></u-button>
<u-button
type="primary"
v-if="item.orderStatus == 3 || item.orderStatus == 5"
@click="openWl(item)"
shape="circle"
:text="'查看物流'"
color="#E03030"
></u-button>
</view> </view>
</view> </view>
</view> </view>
<view class="timePicker"> <view class="timePicker">
<u-datetime-picker :closeOnClickOverlay="true" <u-datetime-picker
@close="dataShow = false" :closeOnClickOverlay="true"
@cancel="dataShow = false" @close="dataShow = false"
@confirm="getDate" @cancel="dataShow = false"
:show="dataShow" @confirm="getDate"
v-model="value1" :show="dataShow"
mode="date"></u-datetime-picker> v-model="value1"
<u-datetime-picker :closeOnClickOverlay="true" mode="date"
@close="dataShow1 = false" ></u-datetime-picker>
@cancel="dataShow1 = false" <u-datetime-picker
@confirm="getDate1" :closeOnClickOverlay="true"
:show="dataShow1" @close="dataShow1 = false"
v-model="value2" @cancel="dataShow1 = false"
mode="date"></u-datetime-picker> @confirm="getDate1"
:show="dataShow1"
v-model="value2"
mode="date"
></u-datetime-picker>
</view> </view>
<u-popup class="pop" <u-popup
:show="detailsShow" class="pop"
closeable :show="detailsShow"
:round="10" closeable
mode="center" :round="10"
@close="detailsShow= false"> mode="center"
@close="detailsShow = false"
>
<view class="pop_a"> <view class="pop_a">
<view class="t_tit"> <view class="t_tit">
{{'订单详情'}} {{ '订单详情' }}
</view> </view>
<view class="pop_t">{{'商品信息'}}</view> <view class="pop_t">{{ '商品信息' }}</view>
<view class="xian"></view> <view class="xian"></view>
<view class="orderList_a"> <view class="orderList_a">
<view v-for="ctem,cndex in details.itemList" <view
:key="cndex" v-for="(ctem, cndex) in details.itemList"
class="disFlex atm just mbt10"> :key="cndex"
<view class="disFlex just" class="disFlex atm just mbt10"
style="flex:1"> >
<img :src="ctem.cover" <view class="disFlex just" style="flex: 1">
alt=""> <img :src="ctem.cover" alt="" />
<view style="flex:1"> <view style="flex: 1">
<view class="disFlex atm just"> <view class="disFlex atm just">
<view class="tit3"> <view class="tit3">
{{ ctem.productName }} {{ ctem.productName }}
</view> </view>
<view class="tit5"> <view class="tit5"> x{{ ctem.quantity }} </view>
x{{ ctem.quantity }} </view>
</view> <view
class="tit3"
style="color: #999; font-size: 24rpx; margin-top: 6rpx"
>
{{ ctem.specsName }}
</view> </view>
<view class="tit4"> <view class="tit4">
{{ ctem.price | numberToCurrency | isLocal}} {{ ctem.price | numberToCurrency | isLocal }}
</view> </view>
</view> </view>
</view> </view>
@ -164,18 +171,16 @@
</view> </view>
<view class="disFlex atm just mbt10"> <view class="disFlex atm just mbt10">
<view class="tit1"> <view class="tit1">
{{'订单金额'}} {{ '订单金额' }}
</view> </view>
<view class="tit6"> <view class="tit6">
{{ details.orderAmount |toThousandthAndKeepDecimal}} {{ details.orderAmount | toThousandthAndKeepDecimal }}
</view> </view>
</view> </view>
<view class="disFlex atm just mbt10"> <view class="disFlex atm just mbt10">
<view class="tit1"> <view class="tit1"> {{ '订单业绩' }}(PV) </view>
{{'订单业绩'}}(PV)
</view>
<view class="tit6"> <view class="tit6">
{{ details.orderAchieve |toThousandthAndKeepDecimal}} {{ details.orderAchieve | toThousandthAndKeepDecimal }}
</view> </view>
</view> </view>
<!-- <view class="disFlex atm just mbt10"> <!-- <view class="disFlex atm just mbt10">
@ -188,7 +193,7 @@
</view> --> </view> -->
<view class="xian"></view> <view class="xian"></view>
<view class="pop_t mbt10"> <view class="pop_t mbt10">
{{'收货人信息'}} {{ '收货人信息' }}
</view> </view>
<view class="disFlex atm mbt10 tit6"> <view class="disFlex atm mbt10 tit6">
<view> <view>
@ -199,104 +204,112 @@
</view> </view>
</view> </view>
<view class="mbt10 tit1"> <view class="mbt10 tit1">
{{ details.recProvince }} {{ details.recCity }} {{ details.recCounty }} {{ details.address }} {{ details.recProvince }} {{ details.recCity }}
{{ details.recCounty }} {{ details.address }}
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-modal :show="cancleOrder" <u-modal
showConfirmButton :show="cancleOrder"
showCancelButton showConfirmButton
:content='content' showCancelButton
confirmColor='#DE3932' :content="content"
@confirm="toCancel" confirmColor="#DE3932"
@cancel="cancleOrder=false" @confirm="toCancel"
ref="uModal" @cancel="cancleOrder = false"
:asyncClose="true"></u-modal> ref="uModal"
:asyncClose="true"
></u-modal>
<u-modal :show="isRemark" <u-modal
showConfirmButton :show="isRemark"
:content='remarkEd' showConfirmButton
confirmColor='#DE3932' :content="remarkEd"
@confirm="isRemark=false" confirmColor="#DE3932"
ref="uModal" @confirm="isRemark = false"
:asyncClose="true"></u-modal> ref="uModal"
:asyncClose="true"
></u-modal>
<view class="contain"> <view class="contain">
<u-popup :show="rightShow" <u-popup
mode="right" :show="rightShow"
@close="rightShow = false" mode="right"
:closeOnClickOverlay="false"> @close="rightShow = false"
:closeOnClickOverlay="false"
>
<view class="rightPopup"> <view class="rightPopup">
<view class="popup_top"> <view class="popup_top">
<view>{{'筛选'}}</view> <view>{{ '筛选' }}</view>
<view class="top_red" <view class="top_red" @click="rightShow = false">{{ '返回' }}</view>
@click="rightShow = false">{{'返回'}}</view>
</view> </view>
<view class="typesBox"> <view class="typesBox">
<view class="typeTitle"> <view class="typeTitle">
{{'订单编号'}} {{ '订单编号' }}
</view> </view>
<view class="choiceBox"> <view class="choiceBox">
<view class="flex_btn"> <view class="flex_btn">
<u--input :placeholder="'请输入'" <u--input
v-model="select.orderCode" :placeholder="'请输入'"
border="none"></u--input> v-model="select.orderCode"
border="none"
></u--input>
</view> </view>
</view> </view>
</view> </view>
<view class="typesBox"> <view class="typesBox">
<view class="typeTitle"> <view class="typeTitle">
{{'会员编号'}} {{ '会员编号' }}
</view> </view>
<view class="choiceBox"> <view class="choiceBox">
<view class="flex_btn"> <view class="flex_btn">
<u--input :placeholder="'请输入'" <u--input
v-model="select.memberCode" :placeholder="'请输入'"
border="none"></u--input> v-model="select.memberCode"
border="none"
></u--input>
</view> </view>
</view> </view>
</view> </view>
<view class="typesBox"> <view class="typesBox">
<view class="typeTitle"> <view class="typeTitle">
{{'订单类型'}} {{ '订单类型' }}
</view> </view>
<view class="choiceBox1"> <view class="choiceBox1">
<view class="flex_btn" <view
@click="clickType(item)" class="flex_btn"
v-for="(item,index) in orderTypes" @click="clickType(item)"
:key="index" v-for="(item, index) in orderTypes"
:class="select.orderType==item.value?'selectbtn':''"> :key="index"
{{item.label}} :class="select.orderType == item.value ? 'selectbtn' : ''"
>
{{ item.label }}
</view> </view>
</view> </view>
</view> </view>
<view class="typesBox"> <view class="typesBox">
<view class="typeTitle"> <view class="typeTitle">
{{'日期区间'}} {{ '日期区间' }}
</view> </view>
<view class="choiceBox1"> <view class="choiceBox1">
<view class="flex_btn" <view class="flex_btn" style="flex: 1" @click="openDate">
style="flex:1" {{
@click="openDate"> select.creationTimeStart
{{select.creationTimeStart?select.creationTimeStart:'开始时间'}} ? select.creationTimeStart
: '开始时间'
}}
</view> </view>
<view style="color: #666;"> <view style="color: #666"> </view>
<view class="flex_btn" style="flex: 1" @click="openDate1">
</view> {{
<view class="flex_btn" select.creationTimeEnd ? select.creationTimeEnd : '结束时间'
style="flex:1" }}
@click="openDate1">
{{select.creationTimeEnd?select.creationTimeEnd:'结束时间'}}
</view> </view>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="footer_l" <view class="footer_l" @tap="reset">{{ '清空筛选条件' }}</view>
@tap="reset">{{'清空筛选条件'}}</view> <view class="footer_r" @tap="getDataList(1)">{{ '确定' }}</view>
<view class="footer_r"
@tap="getDataList(1)">{{'确定'}}</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
@ -378,7 +391,7 @@ export default {
this.select.orderType = item.value this.select.orderType = item.value
}, },
getOrderType() { getOrderType() {
api.orderType().then((res) => { api.orderType().then(res => {
res.data.unshift({ res.data.unshift({
label: '全部', label: '全部',
value: '', value: '',
@ -400,18 +413,18 @@ export default {
}, },
goPay(item) { goPay(item) {
let orderItemsParams = [] let orderItemsParams = []
item.itemList.forEach((ctem) => { item.itemList.forEach(ctem => {
if(ctem.waresCode){ if (ctem.waresCode) {
orderItemsParams.push({ orderItemsParams.push({
waresCode: ctem.waresCode, waresCode: ctem.waresCode,
}) })
} }
}) })
let checkObj = { let checkObj = {
specialArea: item.orderType, specialArea: item.orderType,
orderItemsParams: orderItemsParams, orderItemsParams: orderItemsParams,
} }
api.payCheck(item.orderCode).then((res) => { api.payCheck(item.orderCode).then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.navigateTo({ uni.navigateTo({
url: url:
@ -435,7 +448,7 @@ export default {
// }) // })
}, },
toCancel() { toCancel() {
api.cancelOrder(this.cancelCode).then((res) => { api.cancelOrder(this.cancelCode).then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '订单已取消', title: '订单已取消',
@ -454,9 +467,10 @@ export default {
this.cancleOrder = true this.cancleOrder = true
}, },
getDetails(item) { getDetails(item) {
api.orderDetails(item.orderCode).then((res) => { api.orderDetails(item.orderCode).then(res => {
this.details = res.data this.details = res.data
this.detailsShow = true this.detailsShow = true
console.log(this.details, '....this.details')
}) })
}, },
getDate(e) { getDate(e) {
@ -474,7 +488,7 @@ export default {
this.dataShow1 = true this.dataShow1 = true
}, },
getOrderStatus() { getOrderStatus() {
api.orderStatus().then((res) => { api.orderStatus().then(res => {
res.data.unshift({ res.data.unshift({
label: '全部', label: '全部',
value: '', value: '',
@ -490,7 +504,7 @@ export default {
this.rightShow = false this.rightShow = false
api api
.orderList(Object.assign({}, this.queryParams, this.select)) .orderList(Object.assign({}, this.queryParams, this.select))
.then((res) => { .then(res => {
this.orderLists = this.orderLists.concat(res.rows) this.orderLists = this.orderLists.concat(res.rows)
this.total = res.total this.total = res.total
}) })
@ -503,7 +517,9 @@ export default {
.index_header { .index_header {
background: #fff; background: #fff;
font-size: 18px; font-size: 18px;
font-family: PingFang SC-Semibold, PingFang SC; font-family:
PingFang SC-Semibold,
PingFang SC;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
text-align: center; text-align: center;
@ -554,7 +570,7 @@ export default {
background: #f5f6f8; // margin-right: 40rpx; background: #f5f6f8; // margin-right: 40rpx;
} }
.seatch_r { .seatch_r {
background: #005BAC; background: #005bac;
border-radius: 50%; border-radius: 50%;
padding: 8rpx; padding: 8rpx;
margin-left: 24rpx; margin-left: 24rpx;
@ -610,7 +626,7 @@ export default {
.heng { .heng {
width: 24px; width: 24px;
height: 2px; height: 2px;
background: #005BAC; background: #005bac;
border-radius: 1px 1px 1px 1px; border-radius: 1px 1px 1px 1px;
margin-top: 4rpx; margin-top: 4rpx;
} }
@ -767,7 +783,7 @@ export default {
width: 645rpx; width: 645rpx;
.popup_top { .popup_top {
padding: 25rpx; padding: 25rpx;
background-color: rgba(176, 196, 222, .45); background-color: rgba(176, 196, 222, 0.45);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -777,7 +793,7 @@ export default {
color: #333333; color: #333333;
border-bottom: 2rpx solid #eeeeee; border-bottom: 2rpx solid #eeeeee;
.top_red { .top_red {
color: #005BAC; color: #005bac;
} }
} }
.typesBox { .typesBox {
@ -809,7 +825,7 @@ export default {
width: 100%; width: 100%;
} }
.selectbtn { .selectbtn {
background-color: #005BAC; background-color: #005bac;
color: #ffffff; color: #ffffff;
} }
} }
@ -820,7 +836,7 @@ export default {
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
.flex_btn { .flex_btn {
background-color: rgba(176, 196, 222, .45); background-color: rgba(176, 196, 222, 0.45);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -833,7 +849,7 @@ export default {
margin: 17rpx 5rpx; margin: 17rpx 5rpx;
} }
.selectbtn { .selectbtn {
background-color: #005BAC; background-color: #005bac;
color: #ffffff; color: #ffffff;
} }
} }
@ -854,7 +870,7 @@ export default {
.footer_r { .footer_r {
width: 327rpx; width: 327rpx;
text-align: center; text-align: center;
background: #005BAC; background: #005bac;
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;

View File

@ -1,135 +1,143 @@
<!-- <!--
* @Descripttion: * @Descripttion: 订单撤销页面
* @version: * @version: 1.0.0
* @Author: kBank * @Author: kBank
* @Date: 2022-11-21 15:11:22 * @Date: 2022-11-21 15:11:22
--> -->
<template> <template>
<view class="content"> <view class="content">
<view v-for="(item, index) in orderLists" <view
class="orderList_i"> v-for="(item, index) in orderLists"
:key="`order-${item.orderCode || index}`"
class="orderList_i"
>
<view @click.stop="getDetails(item)"> <view @click.stop="getDetails(item)">
<view class="disFlex atm just mbt10"> <view class="disFlex atm just mbt10">
<view class="disFlex atm"> <view class="disFlex atm">
<view class="quan">{{ item.orderTypeVal }}</view> <view class="quan">{{ item.orderTypeVal }}</view>
<view class="tit1">{{'订单编号'}}{{ item.orderCode }}</view> <view class="tit1">订单编号{{ item.orderCode }}</view>
</view> </view>
<view class="tit2"> <view class="tit2">
{{ item.orderStatusVal }} {{ item.orderStatusVal }}
</view> </view>
</view> </view>
<view v-for="ctem,cndex in item.itemList"
:key="cndex" <view
class="disFlex atm just mbt10"> v-for="(ctem, cndex) in item.itemList"
:key="`item-${ctem.productName || cndex}`"
class="disFlex atm just mbt10"
>
<view class="disFlex atm"> <view class="disFlex atm">
<img :src="ctem.cover" <img :src="ctem.cover" alt="商品图片" />
alt="">
<view class="tit3"> <view class="tit3">
{{ ctem.productName }} {{ ctem.productName }}
</view> </view>
</view> </view>
<view style="text-align:right"> <view style="text-align: right">
<view class="tit4"> <view class="tit4">
{{ ctem.price | numberToCurrency | isLocal}} {{ formatPrice(ctem.price) }}
</view>
<view class="tit5">
x{{ ctem.quantity }}
</view> </view>
<view class="tit5">x{{ ctem.quantity }}</view>
</view> </view>
</view>
</view> <view class="tit1">创建时间{{ item.creationTime }}</view>
<view class="tit1">
{{'创建时间'}}{{ item.creationTime }}
</view>
</view> </view>
<view class="xian"></view> <view class="xian"></view>
<view class="disFlex"> <view class="disFlex">
<view style="flex: 1;"></view> <view style="flex: 1"></view>
<view class="disFlex"> <view class="disFlex">
<u-button type="primary" <u-button
class="lBtn" type="primary"
:plain="true" class="lBtn"
shape="circle" :plain="true"
:text="'撤销订单'" shape="circle"
@click="cancleOrder(item)" text="撤销订单"
color="#999"></u-button> color="#999"
@click="cancleOrder(item)"
></u-button>
</view> </view>
</view> </view>
</view> </view>
<u-popup class="pop"
:show="detailsShow" <!-- 订单详情弹窗 -->
closeable <u-popup
:round="10" v-model="detailsShow"
mode="center" class="pop"
@close="detailsShow= false"> closeable
:round="10"
mode="center"
@close="detailsShow = false"
>
<view class="pop_a"> <view class="pop_a">
<view class="t_tit"> <view class="t_tit">订单详情</view>
{{'订单详情'}} <view class="pop_t">商品信息</view>
</view>
<view class="pop_t">{{'商品信息'}}</view>
<view class="xian"></view> <view class="xian"></view>
<view class="orderList_a"> <view class="orderList_a">
<view v-for="ctem,cndex in details.itemList" <view
:key="cndex" v-for="(ctem, cndex) in details.itemList"
class="disFlex atm just mbt10"> :key="`detail-item-${ctem.productName || cndex}`"
<view class="disFlex just" class="disFlex atm just mbt10"
style="flex:1"> >
<img :src="ctem.cover" <view class="disFlex just" style="flex: 1">
alt=""> <img :src="ctem.cover" alt="商品图片" />
<view style="flex:1"> <view style="flex: 1">
<view class="disFlex atm just"> <view class="disFlex atm just">
<view class="tit3"> <view class="tit3">
{{ ctem.productName }} {{ ctem.productName }}
</view> </view>
<view class="tit5"> <view class="tit5">x{{ ctem.quantity }}</view>
x{{ ctem.quantity }} </view>
</view> <view
class="tit3"
style="color: #999; font-size: 24rpx; margin-top: 6rpx"
>
{{ ctem.specsName }}
</view> </view>
<view class="tit4"> <view class="tit4">
{{ ctem.price | numberToCurrency | isLocal}} {{ formatPrice(ctem.price) }}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="disFlex atm just mbt10"> <view class="disFlex atm just mbt10">
<view class="tit1"> <view class="tit1">订单金额</view>
{{'订单金额'}}
</view>
<view class="tit6"> <view class="tit6">
{{ details.orderAmount |toThousandthAndKeepDecimal}} {{ formatCurrency(details.orderAmount) }}
</view> </view>
</view> </view>
<view class="disFlex atm just mbt10"> <view class="disFlex atm just mbt10">
<view class="tit1"> <view class="tit1">订单业绩(PV)</view>
{{'订单业绩'}}(PV)
</view>
<view class="tit6"> <view class="tit6">
{{ details.orderAchieve |toThousandthAndKeepDecimal}} {{ formatCurrency(details.orderAchieve) }}
</view> </view>
</view> </view>
<!-- <view class="disFlex atm just mbt10">
<view class="tit1"> <!-- 暂时注释的订单业绩(BV)
{{'订单业绩'}}(BV) <view class="disFlex atm just mbt10">
</view> <view class="tit1">订单业绩(BV)</view>
<view class="tit6"> <view class="tit6">
{{ details.orderAssAchieve |toThousandthAndKeepDecimal}} {{ formatCurrency(details.orderAssAchieve) }}
</view> </view>
</view> --> </view>
-->
<view class="xian"></view> <view class="xian"></view>
<view class="pop_t mbt10">
{{'收货人信息'}} <view class="pop_t mbt10">收货人信息</view>
</view>
<view class="disFlex atm mbt10 tit6"> <view class="disFlex atm mbt10 tit6">
<view> <view>{{ details.recName }}</view>
{{ details.recName }} <view>{{ details.recPhone }}</view>
</view>
<view>
{{ details.recPhone }}
</view>
</view> </view>
<view class="mbt10 tit1"> <view class="mbt10 tit1">
{{ details.recProvince }} {{ details.recCity }} {{ details.recCounty }} {{ details.address }} {{ details.recProvince }} {{ details.recCity }}
{{ details.recCounty }} {{ details.address }}
</view> </view>
</view> </view>
</u-popup> </u-popup>
@ -138,7 +146,9 @@
<script> <script>
import * as api from '@/config/order.js' import * as api from '@/config/order.js'
export default { export default {
name: 'CancelOrder',
data() { data() {
return { return {
orderTypes: [], orderTypes: [],
@ -147,7 +157,7 @@ export default {
content: '确认取消订单?', content: '确认取消订单?',
isRemark: false, isRemark: false,
cancelCode: '', cancelCode: '',
details: '', details: {},
orderStatusList: [], orderStatusList: [],
detailsShow: false, detailsShow: false,
isTab: -1, isTab: -1,
@ -166,69 +176,176 @@ export default {
onLoad() { onLoad() {
this.getDataList() this.getDataList()
}, },
onShow() {}, onShow() {},
onReachBottom() { onReachBottom() {
this.queryParams.pageNum++ this.queryParams.pageNum++
this.getDataList() this.getDataList()
}, },
methods: { methods: {
/**
* 格式化价格显示
*/
formatPrice(price) {
if (!price && price !== 0) return ''
//
return this.numberToCurrency(this.isLocal(price))
},
/**
* 格式化货币显示
*/
formatCurrency(amount) {
if (!amount && amount !== 0) return ''
return this.toThousandthAndKeepDecimal(amount)
},
/**
* 数字转货币格式 - 替代原来的filter
*/
numberToCurrency(num) {
// filter
if (!num && num !== 0) return ''
return parseFloat(num).toFixed(2)
},
/**
* 本地化处理 - 替代原来的filter
*/
isLocal(value) {
// filter
return value
},
/**
* 千分位格式化 - 替代原来的filter
*/
toThousandthAndKeepDecimal(num) {
if (!num && num !== 0) return '0.00'
return parseFloat(num)
.toFixed(2)
.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
},
/**
* 撤销订单
*/
cancleOrder(item) { cancleOrder(item) {
let that = this const that = this
uni.showModal({ uni.showModal({
title: '确定撤销订单?', title: '确定撤销订单?',
success: function (response) { success: function (response) {
if (response.confirm) { if (response.confirm) {
api.selfRevokeListCheck(item).then((res) => { api
if (res.code == 200) { .selfRevokeListCheck(item)
api.selfRevokeOrder(item).then((res) => { .then(res => {
if (res.code == 200) { if (res.code === 200) {
uni.showToast({ api
title: res.msg, .selfRevokeOrder(item)
icon: 'none', .then(res => {
duration: 1500, if (res.code === 200) {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1500,
})
that.orderLists = []
that.getDataList()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1500,
})
}
}) })
that.orderLists = [] .catch(error => {
that.getDataList() console.error('撤销订单失败:', error)
} else { uni.showToast({
uni.showToast({ title: '撤销订单失败',
title: res.msg, icon: 'none',
icon: 'none', duration: 1500,
duration: 1500, })
}) })
} } else {
}) uni.showToast({
} else { title: res.msg,
icon: 'none',
duration: 1500,
})
}
})
.catch(error => {
console.error('检查撤销条件失败:', error)
uni.showToast({ uni.showToast({
title: res.msg, title: '操作失败,请重试',
icon: 'none', icon: 'none',
duration: 1500, duration: 1500,
}) })
} })
})
} }
}, },
}) })
}, },
/**
* 获取订单详情
*/
getDetails(item) { getDetails(item) {
api.orderDetails(item.orderCode).then((res) => { api
this.details = res.data .orderDetails(item.orderCode)
this.detailsShow = true .then(res => {
}) this.details = res.data || {}
}, this.detailsShow = true
getOrderStatus() { })
api.orderStatus().then((res) => { .catch(error => {
res.data.unshift({ console.error('获取订单详情失败:', error)
label: '全部', uni.showToast({
value: '', title: '获取订单详情失败',
icon: 'none',
duration: 1500,
})
}) })
this.orderStatusList = res.data
})
}, },
getDataList(index) {
api.selfRevokeList(Object.assign({}, this.queryParams)).then((res) => { /**
this.orderLists = this.orderLists.concat(res.rows) * 获取订单状态列表
this.total = res.total */
}) getOrderStatus() {
api
.orderStatus()
.then(res => {
res.data.unshift({
label: '全部',
value: '',
})
this.orderStatusList = res.data
})
.catch(error => {
console.error('获取订单状态失败:', error)
})
},
/**
* 获取数据列表
*/
getDataList() {
api
.selfRevokeList(Object.assign({}, this.queryParams))
.then(res => {
this.orderLists = this.orderLists.concat(res.rows || [])
this.total = res.total
})
.catch(error => {
console.error('获取订单列表失败:', error)
uni.showToast({
title: '获取订单列表失败',
icon: 'none',
duration: 1500,
})
})
}, },
}, },
} }
@ -238,7 +355,9 @@ export default {
.index_header { .index_header {
background: #fff; background: #fff;
font-size: 18px; font-size: 18px;
font-family: PingFang SC-Semibold, PingFang SC; font-family:
PingFang SC-Semibold,
PingFang SC;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
text-align: center; text-align: center;
@ -254,6 +373,7 @@ export default {
z-index: 1000000000; z-index: 1000000000;
right: 10rpx; right: 10rpx;
top: 10rpx; top: 10rpx;
img { img {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
@ -273,15 +393,16 @@ export default {
align-items: center; align-items: center;
position: relative; position: relative;
border-bottom: 2rpx solid #eee; border-bottom: 2rpx solid #eee;
.seach_i { .seach_i {
padding: 0 20rpx; padding: 0 20rpx;
border-radius: 34rpx; border-radius: 34rpx;
background: #fff; background: #f5f6f8;
flex: 1; flex: 1;
background: #f5f6f8; // margin-right: 40rpx;
} }
.seatch_r { .seatch_r {
background: #005BAC; background: #005bac;
border-radius: 50%; border-radius: 50%;
padding: 8rpx; padding: 8rpx;
margin-left: 24rpx; margin-left: 24rpx;
@ -292,14 +413,16 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 38rpx 26rpx; padding: 38rpx 26rpx;
.timeA { .timeA {
font-size: 26rpx; font-size: 26rpx;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #333; color: #333;
margin-right: 46rpx; margin-right: 46rpx;
border-bottom: 2rpx solid #fff; // padding-bottom: 10rpx; border-bottom: 2rpx solid #fff;
} }
.timeB { .timeB {
width: 158rpx; width: 158rpx;
font-size: 24rpx; font-size: 24rpx;
@ -307,7 +430,7 @@ export default {
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
margin-right: 46rpx; margin-right: 46rpx;
border-bottom: 2rpx solid #eee; // padding-bottom: 10rpx; border-bottom: 2rpx solid #eee;
text-align: center; text-align: center;
} }
} }
@ -322,12 +445,11 @@ export default {
} }
.tab_i { .tab_i {
// width: 120rpx;
text-align: center; text-align: center;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #333333; // margin-right: 28rpx; color: #333333;
white-space: nowrap; white-space: nowrap;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -386,6 +508,7 @@ export default {
padding: 25rpx; padding: 25rpx;
border-bottom: 22rpx solid #eee; border-bottom: 22rpx solid #eee;
background: #fff; background: #fff;
img { img {
width: 124rpx; width: 124rpx;
height: 124rpx; height: 124rpx;
@ -439,7 +562,7 @@ export default {
font-size: 24rpx; font-size: 24rpx;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #005BAC; color: #005bac;
} }
.tit5 { .tit5 {
@ -482,19 +605,20 @@ export default {
color: #333333; color: #333333;
} }
::v-deep .u-popup__content { :deep(.u-popup__content) {
// width: 90%; // width: 90%;
} }
.pop ::v-deep .u-popup__content { .pop :deep(.u-popup__content) {
width: 90%; width: 90%;
} }
.rightPopup { .rightPopup {
width: 645rpx; width: 645rpx;
.popup_top { .popup_top {
padding: 25rpx; padding: 25rpx;
background-color: rgba(176, 196, 222, .45); background-color: rgba(176, 196, 222, 0.45);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -503,12 +627,15 @@ export default {
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
border-bottom: 2rpx solid #eeeeee; border-bottom: 2rpx solid #eeeeee;
.top_red { .top_red {
color: #005BAC; color: #005bac;
} }
} }
.typesBox { .typesBox {
margin-top: 40rpx; margin-top: 40rpx;
.typeTitle { .typeTitle {
padding: 0 24rpx; padding: 0 24rpx;
font-size: 30rpx; font-size: 30rpx;
@ -516,11 +643,13 @@ export default {
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
} }
.choiceBox { .choiceBox {
padding: 0 12rpx; padding: 0 12rpx;
display: flex; display: flex;
margin-top: 17rpx; margin-top: 17rpx;
align-items: center; // flex-wrap: wrap; align-items: center;
.flex_btn { .flex_btn {
background-color: #f4f4f4; background-color: #f4f4f4;
display: flex; display: flex;
@ -535,19 +664,22 @@ export default {
margin: 17rpx 5rpx; margin: 17rpx 5rpx;
width: 100%; width: 100%;
} }
.selectbtn { .selectbtn {
background-color: #005BAC; background-color: #005bac;
color: #ffffff; color: #ffffff;
} }
} }
.choiceBox1 { .choiceBox1 {
padding: 0 12rpx; padding: 0 12rpx;
display: flex; display: flex;
margin-top: 17rpx; margin-top: 17rpx;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
.flex_btn { .flex_btn {
background-color: rgba(176, 196, 222, .45); background-color: rgba(176, 196, 222, 0.45);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -559,18 +691,21 @@ export default {
color: #333333; color: #333333;
margin: 17rpx 5rpx; margin: 17rpx 5rpx;
} }
.selectbtn { .selectbtn {
background-color: #005BAC; background-color: #005bac;
color: #ffffff; color: #ffffff;
} }
} }
} }
.footer { .footer {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
.footer_l { .footer_l {
width: 327rpx; width: 327rpx;
text-align: center; text-align: center;
@ -578,10 +713,11 @@ export default {
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
} }
.footer_r { .footer_r {
width: 327rpx; width: 327rpx;
text-align: center; text-align: center;
background: #005BAC; background: #005bac;
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
@ -589,11 +725,11 @@ export default {
} }
} }
.contain ::v-deep .u-transition { .contain :deep(.u-transition) {
top: 45px !important; top: 45px !important;
} }
.timePicker ::v-deep .u-transition { .timePicker :deep(.u-transition) {
z-index: 10076 !important; z-index: 10076 !important;
} }
</style> </style>

View File

@ -13,29 +13,27 @@
:rules="rules" :rules="rules"
ref="uForm" ref="uForm"
> >
<u-form-item required <u-form-item required label-width="180rpx" :label="'证件(正面)'">
label-width="180rpx" <uploadImg
:label="'证件(正面)'"> :ifsfz="true"
<uploadImg :ifsfz='true' @imageUploaded="imageUploaded1"
@imageUploaded='imageUploaded1' prop="idFront"
prop="idFront" ref="uploadImg1"
ref="uploadImg1" style="margin-right: 30rpx"
style="margin-right: 30rpx;" :bgimg="`../../../static/images/idCard1.png`"
:bgimg="`../../../static/images/idCard1.png`" v-model="dataForm.idFront"
v-model="dataForm.idFront"></uploadImg> ></uploadImg>
</u-form-item> </u-form-item>
<u-form-item required <u-form-item required label-width="180rpx" :label="'证件(反面)'">
label-width="180rpx" <uploadImg
:label="'证件(反面)'"> :ifsfz="true"
<uploadImg :ifsfz='true' @imageUploaded="imageUploaded2"
@imageUploaded='imageUploaded2' prop="idBack"
prop="idBack" ref="uploadImg2"
ref="uploadImg2" style="margin-right: 30rpx"
style="margin-right: 30rpx;" :bgimg="`../../../static/images/idCard2.png`"
:bgimg="`../../../static/images/idCard2.png`" v-model="dataForm.idBack"
v-model="dataForm.idBack"></uploadImg> ></uploadImg>
</u-form-item> </u-form-item>
<u-form-item <u-form-item
required required
@ -196,7 +194,6 @@
</template> </template>
</u--input> </u--input>
</u-form-item> </u-form-item>
<u-code <u-code
:seconds="seconds" :seconds="seconds"
@ -228,7 +225,7 @@
<view class="tit2" <view class="tit2"
@click="toAgree"> 推广人员服务协议</view> @click="toAgree"> 推广人员服务协议</view>
</view> --> </view> -->
<view class="btnbox" style="padding-bottom: 180rpx;"> <view class="btnbox" style="padding-bottom: 180rpx">
<u-button class="subbtn" @click="submit">{{ '确定' }}</u-button> <u-button class="subbtn" @click="submit">{{ '确定' }}</u-button>
</view> </view>
</view> </view>
@ -256,7 +253,7 @@
</view> </view>
<!-- <view class="footer"> <!-- <view class="footer">
</view> --> </view> -->
</view> </view>
@ -449,7 +446,7 @@ export default {
} }
}) })
}, },
getIdCardInfo(n) { getIdCardInfo(n) {
ban ban
.ocrIdCard({ .ocrIdCard({
@ -538,7 +535,9 @@ export default {
uni.$u.toast('倒计时结束后再发送') uni.$u.toast('倒计时结束后再发送')
} }
} else { } else {
uni.$u.toast(this.dataForm.phone ? '手机号格式不正确' : '请先输入手机号') uni.$u.toast(
this.dataForm.phone ? '手机号格式不正确' : '请先输入手机号'
)
return return
} }
}, },
@ -624,7 +623,7 @@ export default {
padding: 0 20rpx; padding: 0 20rpx;
.subbtn { .subbtn {
background: #005BAC; background: #005bac;
border-radius: 46rpx; border-radius: 46rpx;
font-size: 30rpx; font-size: 30rpx;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
@ -656,7 +655,7 @@ export default {
font-size: 26rpx; font-size: 26rpx;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
font-weight: bold; font-weight: bold;
color: #005BAC; color: #005bac;
} }
.tit3 { .tit3 {