This commit is contained in:
xvv 2024-09-22 14:12:52 +08:00
parent d108e3b5de
commit 1d05d86d63
4 changed files with 369 additions and 528 deletions

View File

@ -320,8 +320,8 @@
{
"path": "myorder/myorder",
"style": {
"navigationBarTitleText": "我的订单",
"navigationStyle": "custom"
"navigationBarTitleText": "消费记录"
}
},
{
@ -393,4 +393,4 @@
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {}
}
}

View File

@ -30,7 +30,7 @@
<view class="user-name">手机号: xxxxxxxxxxxx</view>
</view>
</view>
<view class="">
<view class="" @click="goMypages(2)">
<image src="@/static/icon/erwm.png" style="width: 25px; height: 25px; "></image>
</view>
</view>
@ -56,7 +56,7 @@
<view class="jg-box-nmb">{{myPoints || 0 }}</view>
</view>
</view>
<view class="center_ban">
<view class="center_ban" @click="goMypages(1)">
<image src="@/static/icon/icon/newmyc.png" mode=""></image>
</view>
@ -71,7 +71,7 @@
每日签到
</view>
</view>
<view class="centenr-sx">
<view class="centenr-sx" @click="goPagesmy(2)">
<view class="centenr-img">
<image src="@/static/icon/icon/newmy2.png"></image>
</view>
@ -220,12 +220,34 @@
this.getAllOrderList();
},
methods: {
goMypages(num) {
if (num == 1) {
uni.navigateTo({
url: '/pagesHome/certificate/index'
})
}
if (num == 2) {
uni.navigateTo({
url: '/pagesHome/QRcode/QRcode'
})
}
},
goPagesmy(num) {
//
if (num == 1) {
uni.navigateTo({
url: '/pagesMy/signIn/index'
})
}
//
if (num == 2) {
uni.navigateTo({
url: '/pagesMy/myorder/myorder'
})
}
},
//
getAllOrderList() {
@ -298,12 +320,12 @@
},
goOil() {
uni.navigateTo({
url: '/pagesMy/oilBalance/oilBalance'
url: '/pagesHome/cardDetails/detailed?type=oilCard'
})
},
goMony() {
uni.navigateTo({
url: '/pagesMy/moneyBalance/moneyBalance'
url: '/pagesHome/cardDetails/detailed?type=balance'
})
},
goSetup() {

View File

@ -1,124 +1,82 @@
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">我的订单</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="top-box">
<view class="top-input">
<u-icon name="search" size="28"></u-icon>
<input type="text" placeholder="搜索我的订单" v-model="query" @confirm="queryOrder" />
</view>
<view class="" @click="queryOrder">搜索</view>
</view>
<!-- tap -->
<view class="tap-box">
<view class="box-fv" :class="{'actbox' : tapindex == index }" v-for="(item,index) in tapList"
:key="index" @click="getTapIndex(index)">
<view class="">{{item.text}}</view>
<view class="gang" :class="{'actg' : tapindex == index }"></view>
</view>
</view>
<view class="centenr">
<view class="Candywrapper">
<view class="card_box">
<view>
<scroll-view scroll-y="true" :scroll-top="scrollTop" id="scrollList" style="height: 78vh;"
@scrolltolower="scrolltolower">
<!-- 油品订单列表 -->
<view class="box-order" v-for="(item,index) in list" :key="index">
<view class="or-box-top" @click="goOrderInfo(item.orderNo)">
<view class="">{{getStoreName(storeList,item.storeId)}}</view>
<!-- <view class="chengg">{{getPayName(payList,item.orderStatus)}}</view> -->
<view class="chengg" v-if="item.orderStatus=='paid'">已支付</view>
<view class="chengg" v-else-if="item.orderStatus=='payFail'">支付失败</view>
<view class="chengg" v-else-if="item.orderStatus=='refund'">已退款</view>
<view class="chengg" v-else-if="item.orderStatus=='refunding'">退款中</view>
<view class="chengg" v-else>未支付</view>
</view>
<!-- <view class="but-box">
<view class="huis">订单类型</view>
<view class="">油品订单</view>
</view> -->
<view class="but-box" @click="goOrderInfo(item.orderNo)">
<view class="huis">订单金额</view>
<view class="">{{item.orderAmount}}</view>
</view>
<view class="but-box" @click="goOrderInfo(item.orderNo)">
<view class="huis">优惠合计</view>
<view class="reds">{{item.discountAmount}}</view>
</view>
<view class="but-box" @click="goOrderInfo(item.orderNo)">
<view class="huis">订单时间</view>
<view class="" v-if="item.orderStatus=='paid'">{{item.payTime}}</view>
<view class="" v-else>{{item.createTime}}</view>
</view>
<view v-if="item.orderStatus=='paid' && item.remark==null" class="end-box" @click="goComment(item.id)">
<view class="anniu">
<text>去评价</text>
</view>
</view>
<view v-if="item.orderStatus=='paid' && item.remark==''" class="end-box" @click="goComment(item.id)">
<view class="anniu">
<text>去评价</text>
</view>
</view>
<view v-if="item.orderStatus=='paid' && item.remark!='' && item.remark!=null" class="end-box">
<view>
<text>已评价</text>
</view>
</view>
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment(item.orderNo)">
<view class="anniu">
<text>去支付</text>
</view>
</view>
<view v-else class="end-box">
<!-- <view class="anniu">
<text>去支付</text>
</view> -->
</view>
<view style="margin: 13px 0px;">当前积分</view>
<view class="r-num">{{cardBalance.points || 0}}</view>
</view>
<view class="tab-bs">
<view class="w_box" @click="show1 = true">类型筛选 <u-icon name="arrow-down-fill"></u-icon> </view>
<view class="w_box" @click="show = true">全部时间 <u-icon name="arrow-down-fill"></u-icon> </view>
</view>
<view class="bai_box" v-for="(item,index) in pointsList" :key="index">
<view class="left-img">
<!-- <image src="../../static/icon/hyxf.png" mode=""></image> -->
<image src="../../static/icon/jfdh.png" mode=""></image>
</view>
<view style="width: 85%;">
<view class="right-box">
<view class="l-text">{{item.changeReason}}</view>
<view class="r-text" v-if="item.changeType==1">{{item.pointsChange}}</view>
<view class="r-text" v-else-if="item.changeType==0">-{{item.pointsChange}}</view>
<view class="r-text" v-else>0</view>
</view>
<!-- 储值卡订单列表 -->
<!-- <view class="box-order" v-for="(item,index) in balanceList" :key="index">
<view class="or-box-top">
<view class="">{{getStoreName(storeList,item.storeId)}}</view>
<view class="chengg">{{getPayName(payList,item.status)}}</view>
</view>
<view class="but-box">
<view class="huis">订单类型</view>
<view class="">储值卡订单</view>
</view>
<view class="but-box">
<view class="huis">订单金额</view>
<view class="">{{item.amount}}</view>
</view>
<view class="but-box">
<view class="huis">优惠合计</view>
<view class="reds">{{item.discount}}</view>
</view>
<view class="but-box">
<view class="huis">订单时间</view>
<view class="" v-if="item.status=='paid'">{{parseTime(item.payTime)}}</view>
<view class="" v-else>{{parseTime(item.createTime)}}</view>
</view>
<view class="end-box" @click="goComment()">
<view class="anniu">
<text>评价有礼</text>
</view>
</view>
</view> -->
<!-- 状态加载更多没有更多了... -->
<!-- <u-load-more :status="status"></u-load-more> -->
<u-empty v-if="list.length == 0" mode="coupon" text="内容为空"
icon="http://cdn.uviewui.com/uview/empty/coupon.png">
</u-empty>
</scroll-view>
<view class="right-box">
<view class="">会员积分</view>
<view class="">余额{{item.currentPoints || 0}}</view>
</view>
<view class="right-box">
<view class="">{{item.storeName}}</view>
<view class="">{{item.createTime}}</view>
</view>
</view>
</view>
<view v-if="!pointsList || pointsList.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
<!-- <view class="bai_box">
<view class="left-img">
<image src="../../static/icon/hycz.png" mode=""></image>
</view>
<view style="width: 85%;">
<view class="right-box">
<view class="l-text">会员消费</view>
<view class="r-text">-199.00</view>
</view>
<view class="right-box">
<view class="">储值卡</view>
<view class="">余额123456.98</view>
</view>
<view class="right-box">
<view class="">中建锦绣二期站</view>
<view class="">2024-09-09 16:45:09</view>
</view>
</view>
</view>
<view class="bai_box">
<view class="left-img">
<image src="../../static/icon/jfdh.png" mode=""></image>
</view>
<view style="width: 85%;">
<view class="right-box">
<view class="l-text">会员消费</view>
<view class="r-text">-199.00</view>
</view>
<view class="right-box">
<view class="">储值卡</view>
<view class="">余额123456.98</view>
</view>
<view class="right-box">
<view class="">中建锦绣二期站</view>
<view class="">2024-09-09 16:45:09</view>
</view>
</view>
</view> -->
<u-datetime-picker :show="show" v-model="value1" mode="year-month" @cancel="cancel1"
@confirm="confirm1"></u-datetime-picker>
<u-picker :show="show1" :columns="columns" @cancel="cancel" @confirm="confirm"></u-picker>
</view>
</view>
</template>
@ -128,460 +86,213 @@
export default {
data() {
return {
title: '',
tapindex: 0,
tapList: [{
text: '全部'
},
{
text: '待支付'
},
{
text: '已完成'
},
{
text: '待评价'
},
query: {
chainStoreId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
pageSize: 10
},
cardBalance: {},
show: false,
show1: false,
value1: Number(new Date()),
columns: [
['全部类型', '消费有礼', '充值有礼', '积分兑换', '开卡有礼', '邀请有礼', '生日有礼', '推荐会员充值有礼',
'推荐会员推荐有礼', '每日签到', '大转盘抽奖', '九宫格抽奖'
]
],
//
orderList: [],
list: [],
//
balanceList:[],
list1: [],
map: {
page: 1,
pageSize: 10,
queryParams: {
pageNo: 1,
pageSize: 30,
type: "",
storeId: uni.getStorageSync("storeId"),
orderStatus: "",
remark: "",
payType:uni.getStorageSync("appltType")
changeReason: "",
startTime: ""
},
map1: {
page: 1,
pageSize: 10,
status: "",
},
//
total: 0,
total1: 0,
//
storeList: [],
//
payList: [],
query: "",
status: 'more', // -
scrollTop: 0,
pointsList: [],
total: 0
}
},
onLoad(option) {
this.tapindex = option.id
this.getTapIndex(option.id)
// this.getMyOrder()
this.getStores()
// this.getPayList()
},
onShow() {
this.getTapIndex(0)
this.query.chainStoreId = uni.getStorageSync('chainStoreId');
this.getUserBalance()
this.getList()
},
components: {
onPullDownRefresh() {
console.log("刷新");
this.pointsList = []
this.queryParams = {
pageNo: 1,
pageSize: 30,
type: "",
storeId: uni.getStorageSync("storeId"),
changeReason: "",
startTime: ""
}
this.getList()
},
onReachBottom() {
//
if (this.pointsList.length < this.total) {
this.queryParams.pageNo++
this.getList()
}
},
methods: {
//
queryOrder() {
let _this = this;
_this.list = [];
_this.list1 = [];
if (_this.query == "") {
_this.list = _this.orderList
} else {
_this.storeList.forEach(item => {
_this.orderList.forEach(item1 => {
if (item.name.includes(_this.query)) {
if (item1.storeId == item.id) {
_this.list.push(item1)
}
return
}
if (item.name.includes(_this.query)) {
if (item1.storeId == item.id) {
_this.list.push(item1)
}
}
})
})
_this.storeList.forEach(item => {
_this.balanceList.forEach(item1 => {
if (item.name.includes(_this.query)) {
if (item1.storeId == item.id) {
_this.list1.push(item1)
}
return
}
if (item.name.includes(_this.query)) {
if (item1.storeId == item.id) {
_this.list1.push(item1)
}
}
})
})
}
},
parseTime(dateTime) {
let date = new Date(dateTime);
let y = date.getFullYear() + "-";
let mon = ((date.getMonth() + 1 < 10) ? ('0' + date.getMonth()) : date.getMonth()) + "-";
let d = ((date.getDate() < 10) ? ('0' + date.getDate()) : date.getDate()) + " ";
let h = ((date.getHours() < 10) ? ('0' + date.getHours()) : date.getHours()) + ":";
let m = ((date.getMinutes() < 10) ? ('0' + date.getMinutes()) : date.getMinutes()) + ":";
let s = ((date.getSeconds() < 10) ? ('0' + date.getSeconds()) : date.getSeconds());
return y + mon + d + h + m + s;
},
getStoreName(list, id) {
let name = "";
list.forEach(item => {
if (item.id == id) {
if (item.description != "" && item.description != null) {
name = item.name + "(" + item.description + ")"
} else {
name = item.name
}
}
})
return name;
},
getPayName(list, type) {
let name = "";
list.forEach(item => {
if (item.dictValue == type) {
name = item.dictLabel
}
})
return name;
},
//
getPayList() {
let _this = this;
//
getUserBalance() {
request({
url: "system/dict/data/type/pay_status",
url: '/business/userManager/user/getUserBalanceApplet',
method: 'get',
}).then((res) => {
console.log(res);
_this.payList = res.data
})
},
//
getStores() {
let _this = this;
request({
url: "business/storeInformation/store/list",
method: 'get',
}).then((res) => {
_this.storeList = res.data
})
},
//
scrolltolower() {
if (this.orderList.length < this.total) {
this.map.page++;
this.getMyOrder()
} else {
this.status = "no-more"
}
// if (this.balanceList.length < this.total1) {
// this.map1.page++;
// this.getBalanceOrder()
// } else {
// this.status = "no-more"
// }
},
//
getMyOrder() {
let _this = this;
_this.map.storeId = uni.getStorageSync("storeId")
request({
url: "business/oilOrder/userOrders",
method: 'get',
params: _this.map,
}).then((res) => {
uni.showLoading({
title: '加载中'
});
params: this.query
}).then(res => {
if (res.code == 200) {
if (_this.map.page == 1) {
_this.orderList = res.data.records
_this.list = res.data.records
} else {
_this.orderList = _this.orderList.concat(res.data.records)
_this.list = _this.list.concat(res.data.records)
}
_this.total = res.data.total
uni.hideLoading();
this.cardBalance = res.data
}
})
},
//
getBalanceOrder() {
let _this = this;
getList() {
request({
url: "business/marketingActivity/activeExchange/cardValueOrders/list",
url: '/business/integral/integralDetail/queryByPageUni',
method: 'get',
params: _this.map1,
}).then((res) => {
console.log(res,uni.getStorageSync("userId"))
uni.showLoading({
title: '加载中'
});
params: this.queryParams
}).then(res => {
if (res.code == 200) {
if (_this.map1.page == 1) {
_this.balanceList = res.data.records
_this.list1 = res.data.records
} else {
_this.balanceList = _this.balanceList.concat(res.data.records)
_this.list1 = _this.list.concat(res.data.records)
}
_this.total1 = res.data.total
uni.hideLoading();
this.pointsList = res.data.records
this.total = res.data.total
}
})
},
getTapIndex(index) {
this.orderList = []
this.list = []
this.total = 0
this.tapindex = index
if (this.tapindex == 0) {
this.map = {
page: 1,
pageSize: 10,
storeId: "",
orderStatus: "",
remark: "",
payType:uni.getStorageSync("appltType")
}
this.getMyOrder()
// this.map1 = {
// page: 1,
// pageSize: 10,
// status: "",
// }
// this.getBalanceOrder()
} else if (this.tapindex == 1) {
this.map = {
page: 1,
pageSize: 10,
storeId: "",
orderStatus: "unpaid",
remark: "",
payType:uni.getStorageSync("appltType")
}
this.getMyOrder()
// this.map1 = {
// page: 1,
// pageSize: 10,
// status: "unpaid",
// }
// this.getBalanceOrder()
} else if (this.tapindex == 2) {
this.map = {
page: 1,
pageSize: 10,
storeId: "",
orderStatus: "paid",
remark: "",
payType:uni.getStorageSync("appltType")
}
this.getMyOrder()
// this.map1 = {
// page: 1,
// pageSize: 10,
// status: "paid",
// }
// this.getBalanceOrder()
confirm(e) {
this.queryParams.pageNo = 1
if (e.value[0] == '全部类型') {
this.queryParams.type = ""
} else {
this.map = {
page: 1,
pageSize: 10,
storeId: "",
orderStatus: "paid",
remark: "1",
payType:uni.getStorageSync("appltType")
}
this.getMyOrder()
// this.map1 = {
// page: 1,
// pageSize: 10,
// status: "paid",
// }
// this.getBalanceOrder()
this.queryParams.type = e.value[0]
}
this.getList()
this.show1 = false
},
goPayment(orderNo){
uni.navigateTo({
url: '/pagesRefuel/orderDetail/index?orderNo=' + orderNo,
})
cancel() {
this.show1 = false
},
goOrderInfo(orderNo){
uni.navigateTo({
url: '/pagesMy/details/details?orderNo=' + orderNo,
})
timestampToString(timestamp) {
// Date
const date = new Date(timestamp);
// 使toLocaleDateStringtoLocaleTimeString
const dateString = date.toLocaleDateString()
const timeString = date.toLocaleTimeString();
//
return date.getFullYear() + '-' + (date.getMonth() + 1);
},
goComment(orderId) {
uni.navigateTo({
url: "/pagesMy/comment/comment?orderId=" + orderId,
})
confirm1(e) {
this.queryParams.startTime = this.timestampToString(e.value)
this.queryParams.pageNo = 1
this.getList()
this.show = false
},
goBack() {
uni.navigateBack()
cancel1() {
this.show = false
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
.centenr {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
background: #F9F9F9;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.top-box {
background-color: #ffffff;
padding: 10px;
width: 100%;
display: flex;
align-items: center;
.top-input {
width: 80%;
height: 35px;
background: #F3F3F3;
border-radius: 33px;
margin-right: 15px;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0px 15px;
}
}
.tap-box {
width: 100%;
display: flex;
align-items: center;
background: #ffffff;
}
.box-fv {
color: #666666;
width: 25%;
text-align: center;
}
.gang {
width: 30px;
height: 5px;
margin: 5px auto;
// background: #339DFF;
border-radius: 5px;
}
.actg {
background: #339DFF;
}
.actbox {
font-weight: bold !important;
color: #000 !important;
}
.box-order {
width: 95%;
border-radius: 8px;
background: #ffffff;
.Candywrapper {
background: #F9F9F9;
box-sizing: border-box;
padding: 10px;
margin: 10px auto;
}
.or-box-top {
.card_box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
height: 90px;
background: url('../../static/imgs/jf.png') no-repeat;
background-size: 100% 100%;
box-sizing: border-box;
padding: 5px 0px;
border-bottom: 1px solid #e5e5e5;
}
.chengg {
color: #1678ff;
}
.but-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
color: #fff;
font-size: 14px;
margin: 5px 0px;
}
.reds {
color: red;
}
.huis {
color: #666666;
}
.end-box {
.r-size {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.anniu {
width: 70px;
height: 25px;
background-color: #1678ff;
color: #ffffff;
.r-num {
font-weight: 600;
font-size: 20px;
color: #FFFFFF;
}
.tab-bs {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
margin: 15px auto;
}
.w_box {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
border-radius: 15px;
box-sizing: border-box;
padding: 15px;
}
.bai_box {
width: 100%;
box-sizing: border-box;
padding: 15px 10px;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
}
.left-img {
margin-right: 10px;
image {
width: 40px;
height: 40px;
}
}
.right-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #666666;
}
.l-text {
font-size: 16px;
color: #333333;
margin-bottom: 5px;
font-weight: bold;
}
.r-text {
font-size: 16px;
color: #333333;
margin-bottom: 5px;
font-weight: bold;
}
</style>

View File

@ -10,15 +10,50 @@
<view class="or-size"></view>
</view>
<view class="wrap-box">
<view class="w_box" v-for="(item,index) in 30" :key="index" :class="{'acv_w' : wIndex == index }">
<view class="w_box" v-for="(item,index) in 30" :key="index" @click="setIndex(index)"
:class="{'acv_w' : wIndex == index }">
<view class="">第6天</view>
<image src="@/static/imgs/jinbi.png" style="width: 25px; height: 25px; "></image>
<view class="">5积分</view>
</view>
</view>
<view class="bottom_bs" @click="equityShow = true">
<view class="">连续签到获得更多积分</view>
<view class="d-s"> <u-icon name="info-circle" size="14px"></u-icon>
<view style="font-size: 14px; color: #333; margin-left: 5px; ">签到规则</view>
</view>
</view>
<view class="anniu">
签到
</view>
<u-overlay :show="show" @click="show = false">
<view class="box_">
<view class="r_size">+10积分</view>
</view>
</u-overlay>
<u-popup :show="equityShow" :closeable="true" :round="10" mode="bottom" @close="equityclose">
<view class="_tbox">
<view class="_btop">签到规则</view>
<view class="_bbox">
<!-- <view class="b_title">获取您的位置信息</view> -->
<view class="">
1.签到时间
全天可签到不限制具体时间段
2.签到方式
用户通过小程序的签到入口进行点击签到
3签到奖励
为鼓励用户签到我们设置了签到奖励积分
签到奖励可能随着连续签到天数的增加而增加形成签到
激励机制
4补签与断签
不允许用户进行补签以恢复连续签到天数
断签后用户需重新开始计算连续签到天数
</view>
</view>
</view>
</u-popup>
</view>
</template>
@ -27,8 +62,9 @@
export default {
data() {
return {
wIndex: 0,
show: false,
equityShow: false
}
},
onLoad() {
@ -57,6 +93,13 @@
},
methods: {
equityclose() {
this.equityShow = false
},
setIndex(index) {
this.wIndex = index
this.show = true
},
//
resetting() {
this.pageNo = 1
@ -170,9 +213,74 @@
color: #fff;
border-radius: 50px;
margin: 25px auto;
}
.acv_w {
background: #FF9655 !important;
color: #fff !important;
}
.bottom_bs {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 10px;
font-size: 14px;
color: #999999;
}
.d-s {
display: flex;
align-items: center;
}
.box_ {
width: 230px;
height: 200px;
background: url('http://47.94.122.58:83/qdcg.png') no-repeat;
background-size: 100% 100%;
position: relative;
left: 50%;
transform: translate(-50%, 150%);
bottom: 10%;
}
.r_size {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
bottom: 10%;
color: #FA6400;
}
._tbox {
border-radius: 10px;
background: #fff;
width: 100%;
}
._btop {
box-sizing: border-box;
padding: 15px;
border-bottom: 1px solid #EEEEEE;
text-align: center;
font-weight: 600;
font-size: 14px;
color: #333333;
}
._bbox {
box-sizing: border-box;
padding: 15px;
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 18px;
}
</style>