作者 韩昌

修改11.32修改bug

... ... @@ -5,12 +5,17 @@
<image :src="it.image" mode=""></image>
</view>
<view class="info">
<view class="shopTitle ellipsis">{{ it.goods_name }}</view>
<view class="desc ellipsis">{{ it.describe }}</view>
<view class="num ellipsis">x{{ it.total_num }}</view>
<view class="topBox">
<view class="shopTitle ellipsis">{{ it.goods_name }}</view>
<view class="desc ellipsis">{{ it.describe }}</view>
<view class="num ellipsis" v-if="![2].includes(shop.order_status)">x{{ it.total_num }}</view>
</view>
<!-- 非积分商品 -->
<view class="priceBox flexJ" v-if="it.goodstatus != 3">
<text>¥{{ it.total_price }}</text>
<view class="flexA">
<text>¥{{ it.total_price }}</text>
<text v-if="shop.goodstatus_text === 2" class="linePrice">122</text>
</view>
<view class="reality flexA">
<view class="shi">{{ textHandler(shop.order_status) }}</view>
<text>¥</text>
... ... @@ -19,10 +24,23 @@
</view>
<!-- 积分商品 -->
<view class="pointsShop" v-else>
<text>{{ textHandler(shop.order_status) }}</text>
<image src="/static/shopCarIc/pointsIc.png" mode=""></image>
<view class="points">{{ it.coscore }}</view>
<view class="pointsPrice">¥{{ it.diff_price }}</view>
<!-- 待发货 -->
<template v-if="[2].includes(shop.order_status)">
<div class="flexJ" style="flex: 1">
<view class="flexA">
<image src="/static/shopCarIc/pointsIc.png" mode=""></image>
<view class="pointsPrice">{{ shop.score }}</view>
</view>
<view class="num ellipsis">x{{ it.total_num }}</view>
</div>
</template>
<template v-else>
<text>{{ textHandler(shop.order_status) }}</text>
<image src="/static/shopCarIc/pointsIc.png" mode=""></image>
<view class="points">{{ it.coscore }}</view>
<view class="pointsPrice">¥{{ it.diff_price }}</view>
</template>
</view>
</view>
</view>
... ... @@ -67,6 +85,9 @@ onMounted(() => {
.info {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.shopTitle {
color: #323233ff;
... ... @@ -149,4 +170,8 @@ onMounted(() => {
}
}
}
.linePrice {
text-decoration: line-through;
color: rgba($color: #000000, $alpha: 0.3) !important;
}
</style>
... ...
... ... @@ -39,14 +39,14 @@
<view @click.stop="operateOrder(item, 2)" v-if="item.order_status == 2" class="orange flexC">申请退款</view>
<!-- 待收货 -->
<view class="flexA" v-if="item.order_status == 3">
<view v-if="item.order_status == 3 && item.goodstatus_text == ''" class="cancel flexC">
<view v-if="item.order_status == 3 && item.goodstatus_text == ''" class="cancel flexC" @click.stop="true">
<button open-type="contact"></button>
联系客服
</view>
<view @click.stop="operateOrder(item, 3)" class="orange flexC">确认收货</view>
</view>
<!-- 待评价 -->
<view @click.stop="operateOrder(item, 4)" v-if="item.order_status == 4" class="orange flexC">评价</view>
<view @click.stop="operateOrder(item, 4)" v-if="item.order_status == 5" class="orange flexC">评价</view>
<!-- 售后 -->
<view @click.stop="operateOrder(item, 5)" v-if="item.order_status == 21" class="orange flexC">查看详情</view>
</view>
... ... @@ -132,7 +132,7 @@ const copy = text => {
// tabs切换
const click = e => {
console.log(e)
getOrderLists(e.index == 5 ? 21 : e.index)
getOrderLists(e.index == 5 ? 21 : e.index == 4 ? 5 : e.index)
}
//订单状态: 0=全部,1=待付款,2=待发货,3=待收货,4=待评价,11=已取消,21=售后
const getOrderLists = async status => {
... ...
<template>
<!-- 我的积分 我的余额-->
<view class="">
<u-navbar placeholder :title=" type==0 ? '我的余额' : '我的积分' " bgColor="#F6F8FA" :autoBack="true"></u-navbar>
<view class="mainBox">
<view class="redBg flexV">
<view class="title">{{type==0 ? '余额' :'积分'}}</view>
<view class="price flexV" v-if="type==0">
<text>{{integral}}</text>
<view class="btn flexC" @click="toRecharge">立即充值</view>
</view>
<view class="num flexA" v-else>
<image src="/static/shopCarIc/pointsIc.png" mode=""></image>
{{integral}}
</view>
</view>
<view class="detailBox">
<view class="detailTitle">{{type==0 ? '余额明细' : '积分明细'}}</view>
<view class="time flexJ" v-for="item in recordList" :key="item.id">
<text>{{item.createtime}}</text>
<text>{{item.before*1 - item.after*1 >0 ? '-' : '+'}}{{ type==0? item.money : item.score}}</text>
</view>
</view>
</view>
</view>
<!-- 我的积分 我的余额-->
<view class="">
<u-navbar placeholder :title="type == 0 ? '我的余额' : '我的积分'" bgColor="#F6F8FA" :autoBack="true"></u-navbar>
<view class="mainBox">
<view class="redBg flexV">
<view class="title">{{ type == 0 ? '余额' : '积分' }}</view>
<view class="price flexV" v-if="type == 0">
<text>{{ integral }}</text>
<view class="btn flexC" @click="toRecharge">立即充值</view>
</view>
<view class="num flexA" v-else>
<image src="/static/shopCarIc/pointsIc.png" mode=""></image>
{{ integral }}
</view>
</view>
<view class="detailBox">
<view class="detailTitle">{{ type == 0 ? '余额明细' : '积分明细' }}</view>
<view class="time flexJ" v-for="item in recordList" :key="item.id">
<text>{{ item.createtime }}</text>
<text>{{ item.before * 1 - item.after * 1 > 0 ? '-' : '+' }}{{ type == 0 ? item.money : item.score }}</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onShow,onLoad } from '@dcloudio/uni-app'
import { getyue,getMoneyDetail,getMyScore,getScoreDetail } from '@/api/'
onLoad((e)=> {
//console.log(11111,e.type) //0余额 1积分
type.value = e.type //0余额 1积分
if(e.type == 0) {
getyues() // 我的余额
getMoneyDetails() //余额明细
} else {
getMyScores() //我的积分
getScoreDetails() //我的积分明细
}
})
const toRecharge = ()=> {
uni.navigateTo({
url:'/pages/mine/recharge'
})
}
let integral = ref(0) //积分 //余额
let recordList = ref([]) //明细
let type = ref(0) //0 余额 1积分
// 我的余额
const getyues = async ()=> {
try {
const res = await getyue()
integral.value = res.money
uni.setStorageSync('balance',res.money)
console.log('getyue', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getyue', err)
}
}
// 余额明细
const getMoneyDetails = async ()=> {
try {
const res = await getMoneyDetail()
recordList.value = res.mingxi
console.log('getMoneyDetail', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getMoneyDetail', err)
}
}
// 我的积分
const getMyScores = async ()=> {
try {
const res = await getMyScore()
integral.value = res.score
uni.setStorageSync('myPoints',res.score)
console.log('getMyScore', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getMyScore', err)
}
}
// 积分明细
const getScoreDetails = async ()=> {
try {
const res = await getScoreDetail()
recordList.value = res.mingxi
console.log('getScoreDetail', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getScoreDetail', err)
}
}
import { ref } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { getyue, getMoneyDetail, getMyScore, getScoreDetail } from '@/api/'
onLoad(e => {
//console.log(11111,e.type) //0余额 1积分
type.value = e.type //0余额 1积分
if (e.type == 0) {
getyues() // 我的余额
getMoneyDetails() //余额明细
} else {
getMyScores() //我的积分
getScoreDetails() //我的积分明细
}
})
const toRecharge = () => {
uni.navigateTo({
url: '/pages/mine/recharge'
})
}
let integral = ref(0) //积分 //余额
let recordList = ref([]) //明细
let type = ref(0) //0 余额 1积分
// 我的余额
const getyues = async () => {
try {
const res = await getyue()
integral.value = res.money
uni.setStorageSync('balance', res.money)
console.log('getyue', res)
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
console.log('getyue', err)
}
}
// 余额明细
const getMoneyDetails = async () => {
try {
const res = await getMoneyDetail()
recordList.value = res.mingxi
console.log('getMoneyDetail', res)
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
console.log('getMoneyDetail', err)
}
}
// 我的积分
const getMyScores = async () => {
try {
const res = await getMyScore()
integral.value = res.score
uni.setStorageSync('myPoints', res.score)
console.log('getMyScore', res)
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
console.log('getMyScore', err)
}
}
// 积分明细
const getScoreDetails = async () => {
try {
const res = await getScoreDetail()
recordList.value = res
console.log('getScoreDetail', res)
// 保存数据
} catch (err) {
uni.showToast({ title: err, icon: 'none' })
console.log('getScoreDetail', err)
}
}
</script>
<style lang="scss">
.mainBox {
padding: 24rpx;
.mainBox {
padding: 24rpx;
.redBg {
padding: 36rpx 0 40rpx;
width: 702rpx;
border-radius: 16rpx;
opacity: 1;
background: #fb4c3cff;
.redBg {
padding: 36rpx 0 40rpx;
width: 702rpx;
border-radius: 16rpx;
opacity: 1;
background: #fb4c3cff;
.title {
color: #ffffffff;
font-size: 40rpx;
font-weight: 700;
}
.title {
color: #ffffffff;
font-size: 40rpx;
font-weight: 700;
}
.price {
margin-top: 16rpx;
.price {
margin-top: 16rpx;
text {
color: #ffffffff;
font-size: 64rpx;
margin-bottom: 24rpx;
}
text {
color: #ffffffff;
font-size: 64rpx;
margin-bottom: 24rpx;
}
.btn {
width: 256rpx;
height: 80rpx;
border-radius: 80rpx;
color: #000000ff;
font-size: 32rpx;
font-weight: 700;
background: #fff1f0ff;
}
}
.btn {
width: 256rpx;
height: 80rpx;
border-radius: 80rpx;
color: #000000ff;
font-size: 32rpx;
font-weight: 700;
background: #fff1f0ff;
}
}
.num {
margin-top: 28rpx;
color: #ffffffff;
font-size: 64rpx;
.num {
margin-top: 28rpx;
color: #ffffffff;
font-size: 64rpx;
image {
margin-right: 22rpx;
width: 64rpx;
height: 64rpx;
}
}
}
image {
margin-right: 22rpx;
width: 64rpx;
height: 64rpx;
}
}
}
.detailBox {
margin-top: 24rpx;
padding: 24rpx;
background: #fff;
border-radius: 16rpx;
.detailBox {
margin-top: 24rpx;
padding: 24rpx;
background: #fff;
border-radius: 16rpx;
.detailTitle {
color: #000000ff;
font-size: 32rpx;
font-weight: 700;
margin-bottom: 16rpx;
}
.detailTitle {
color: #000000ff;
font-size: 32rpx;
font-weight: 700;
margin-bottom: 16rpx;
}
.time {
margin-bottom: 24rpx;
color: #000000e6;
font-size: 28rpx;
}
}
}
.time {
margin-bottom: 24rpx;
color: #000000e6;
font-size: 28rpx;
}
}
}
</style>
... ...
... ... @@ -21,21 +21,31 @@ const _sfc_main = {
return common_vendor.e({
a: it.image,
b: common_vendor.t(it.goods_name),
c: common_vendor.t(it.describe),
d: common_vendor.t(it.total_num),
c: common_vendor.t(it.describe)
}, ![2].includes(__props.shop.order_status) ? {
d: common_vendor.t(it.total_num)
} : {}, {
e: it.goodstatus != 3
}, it.goodstatus != 3 ? {
}, it.goodstatus != 3 ? common_vendor.e({
f: common_vendor.t(it.total_price),
g: common_vendor.t(textHandler(__props.shop.order_status)),
h: common_vendor.t(it.total_price)
g: __props.shop.goodstatus_text === 2
}, __props.shop.goodstatus_text === 2 ? {} : {}, {
h: common_vendor.t(textHandler(__props.shop.order_status)),
i: common_vendor.t(it.total_price)
}) : common_vendor.e({
j: [2].includes(__props.shop.order_status)
}, [2].includes(__props.shop.order_status) ? {
k: common_vendor.t(__props.shop.score),
l: common_vendor.t(it.total_num)
} : {
i: common_vendor.t(textHandler(__props.shop.order_status)),
j: common_vendor.t(it.coscore),
k: common_vendor.t(it.diff_price)
}, {
l: it.id
m: common_vendor.t(textHandler(__props.shop.order_status)),
n: common_vendor.t(it.coscore),
o: common_vendor.t(it.diff_price)
}), {
p: it.id
});
})
}),
b: ![2].includes(__props.shop.order_status)
};
};
}
... ...
<view wx:for="{{a}}" wx:for-item="it" wx:key="l" class="shop"><view class="shopPhoto"><image src="{{it.a}}" mode=""></image></view><view class="info"><view class="shopTitle ellipsis">{{it.b}}</view><view class="desc ellipsis">{{it.c}}</view><view class="num ellipsis">x{{it.d}}</view><view wx:if="{{it.e}}" class="priceBox flexJ"><text>¥{{it.f}}</text><view class="reality flexA"><view class="shi">{{it.g}}</view><text>¥</text><view class="price">{{it.h}}</view></view></view><view wx:else class="pointsShop"><text>{{it.i}}</text><image src="/static/shopCarIc/pointsIc.png" mode=""></image><view class="points">{{it.j}}</view><view class="pointsPrice">¥{{it.k}}</view></view></view></view>
\ No newline at end of file
<view wx:for="{{a}}" wx:for-item="it" wx:key="p" class="shop"><view class="shopPhoto"><image src="{{it.a}}" mode=""></image></view><view class="info"><view class="topBox"><view class="shopTitle ellipsis">{{it.b}}</view><view class="desc ellipsis">{{it.c}}</view><view wx:if="{{b}}" class="num ellipsis">x{{it.d}}</view></view><view wx:if="{{it.e}}" class="priceBox flexJ"><view class="flexA"><text>¥{{it.f}}</text><text wx:if="{{it.g}}" class="linePrice">122</text></view><view class="reality flexA"><view class="shi">{{it.h}}</view><text>¥</text><view class="price">{{it.i}}</view></view></view><view wx:else class="pointsShop"><block wx:if="{{it.j}}"><view class="flexJ" style="flex:1"><view class="flexA"><image src="/static/shopCarIc/pointsIc.png" mode=""></image><view class="pointsPrice">{{it.k}}</view></view><view class="num ellipsis">x{{it.l}}</view></view></block><block wx:else><text>{{it.m}}</text><image src="/static/shopCarIc/pointsIc.png" mode=""></image><view class="points">{{it.n}}</view><view class="pointsPrice">¥{{it.o}}</view></block></view></view></view>
\ No newline at end of file
... ...
... ... @@ -41,6 +41,9 @@
}
.shop .info {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.shop .info .shopTitle {
color: #323233ff;
... ... @@ -107,4 +110,8 @@
.shop .info .pointsShop .pointsPrice {
color: #ff3d3dff;
font-size: 26rpx;
}
.linePrice {
text-decoration: line-through;
color: rgba(0, 0, 0, 0.3) !important;
}
\ No newline at end of file
... ...
... ... @@ -74,7 +74,7 @@ const _sfc_main = {
};
const click = (e) => {
console.log(e);
getOrderLists(e.index == 5 ? 21 : e.index);
getOrderLists(e.index == 5 ? 21 : e.index == 4 ? 5 : e.index);
};
const getOrderLists = async (status) => {
try {
... ... @@ -185,19 +185,21 @@ const _sfc_main = {
q: item.order_status == 3
}, item.order_status == 3 ? common_vendor.e({
r: item.order_status == 3 && item.goodstatus_text == ""
}, item.order_status == 3 && item.goodstatus_text == "" ? {} : {}, {
s: common_vendor.o(($event) => operateOrder(item, 3))
}, item.order_status == 3 && item.goodstatus_text == "" ? {
s: common_vendor.o(($event) => true)
} : {}, {
t: common_vendor.o(($event) => operateOrder(item, 3))
}) : {}, {
t: item.order_status == 4
}, item.order_status == 4 ? {
v: common_vendor.o(($event) => operateOrder(item, 4))
v: item.order_status == 5
}, item.order_status == 5 ? {
w: common_vendor.o(($event) => operateOrder(item, 4))
} : {}, {
w: item.order_status == 21
x: item.order_status == 21
}, item.order_status == 21 ? {
x: common_vendor.o(($event) => operateOrder(item, 5))
y: common_vendor.o(($event) => operateOrder(item, 5))
} : {}, {
y: item.id,
z: common_vendor.o(($event) => toDetaile(item.id), item.id)
z: item.id,
A: common_vendor.o(($event) => toDetaile(item.id), item.id)
});
}),
e: !common_vendor.unref(orderList).length
... ...
<view><u-navbar wx:if="{{a}}" u-i="67be9ace-0" bind:__l="__l" u-p="{{a}}"></u-navbar><view class="tabs"><u-tabs wx:if="{{c}}" bindclick="{{b}}" u-i="67be9ace-1" bind:__l="__l" u-p="{{c}}"></u-tabs></view><view class="mainBox"><view wx:for="{{d}}" wx:for-item="item" wx:key="y" class="orderBox" bindtap="{{item.z}}"><view wx:if="{{item.a}}" class="downTime"><u-count-down wx:if="{{item.c}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"></u-count-down></view><view wx:if="{{item.d}}" class="orderNoBox flexJ"><view class="orderNo">快递单号 {{item.e}}</view><view catchtap="{{item.f}}" class="copy">复制</view></view><order-shop wx:if="{{item.h}}" u-i="{{item.g}}" bind:__l="__l" u-p="{{item.h}}"></order-shop><view class="orderBtn"><view wx:if="{{item.i}}" class="flexA"><view catchtap="{{item.k}}" class="cancel flexC">{{item.j}}</view><view wx:if="{{item.l}}" catchtap="{{item.n}}" class="orange flexC">{{item.m}}</view></view><view wx:if="{{item.o}}" catchtap="{{item.p}}" class="orange flexC">申请退款</view><view wx:if="{{item.q}}" class="flexA"><view wx:if="{{item.r}}" class="cancel flexC"><button open-type="contact"></button> 联系客服 </view><view catchtap="{{item.s}}" class="orange flexC">确认收货</view></view><view wx:if="{{item.t}}" catchtap="{{item.v}}" class="orange flexC">评价</view><view wx:if="{{item.w}}" catchtap="{{item.x}}" class="orange flexC">查看详情</view></view></view></view><view wx:if="{{e}}" class="null flexV"><image src="/static/mineIc/orderNull.png" mode=""></image> 暂无订单 </view><pay-mode wx:if="{{g}}" bindcanclePop="{{f}}" u-i="67be9ace-4" bind:__l="__l" u-p="{{g}}"></pay-mode><tip-pops wx:if="{{i}}" bindpointsBtns="{{h}}" u-i="67be9ace-5" bind:__l="__l" u-p="{{i}}"></tip-pops></view>
\ No newline at end of file
<view><u-navbar wx:if="{{a}}" u-i="67be9ace-0" bind:__l="__l" u-p="{{a}}"></u-navbar><view class="tabs"><u-tabs wx:if="{{c}}" bindclick="{{b}}" u-i="67be9ace-1" bind:__l="__l" u-p="{{c}}"></u-tabs></view><view class="mainBox"><view wx:for="{{d}}" wx:for-item="item" wx:key="z" class="orderBox" bindtap="{{item.A}}"><view wx:if="{{item.a}}" class="downTime"><u-count-down wx:if="{{item.c}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"></u-count-down></view><view wx:if="{{item.d}}" class="orderNoBox flexJ"><view class="orderNo">快递单号 {{item.e}}</view><view catchtap="{{item.f}}" class="copy">复制</view></view><order-shop wx:if="{{item.h}}" u-i="{{item.g}}" bind:__l="__l" u-p="{{item.h}}"></order-shop><view class="orderBtn"><view wx:if="{{item.i}}" class="flexA"><view catchtap="{{item.k}}" class="cancel flexC">{{item.j}}</view><view wx:if="{{item.l}}" catchtap="{{item.n}}" class="orange flexC">{{item.m}}</view></view><view wx:if="{{item.o}}" catchtap="{{item.p}}" class="orange flexC">申请退款</view><view wx:if="{{item.q}}" class="flexA"><view wx:if="{{item.r}}" class="cancel flexC" catchtap="{{item.s}}"><button open-type="contact"></button> 联系客服 </view><view catchtap="{{item.t}}" class="orange flexC">确认收货</view></view><view wx:if="{{item.v}}" catchtap="{{item.w}}" class="orange flexC">评价</view><view wx:if="{{item.x}}" catchtap="{{item.y}}" class="orange flexC">查看详情</view></view></view></view><view wx:if="{{e}}" class="null flexV"><image src="/static/mineIc/orderNull.png" mode=""></image> 暂无订单 </view><pay-mode wx:if="{{g}}" bindcanclePop="{{f}}" u-i="67be9ace-4" bind:__l="__l" u-p="{{g}}"></pay-mode><tip-pops wx:if="{{i}}" bindpointsBtns="{{h}}" u-i="67be9ace-5" bind:__l="__l" u-p="{{i}}"></tip-pops></view>
\ No newline at end of file
... ...
... ... @@ -65,7 +65,7 @@ const _sfc_main = {
const getScoreDetails = async () => {
try {
const res = await api_index.getScoreDetail();
recordList.value = res.mingxi;
recordList.value = res;
console.log("getScoreDetail", res);
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
... ...
... ... @@ -16,7 +16,24 @@
"libVersion": "2.32.3",
"appid": "wxd6feb65ac83ce679",
"projectname": "healthMall",
"condition": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
... ...
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"condition": {
"miniprogram": {
"list": [
{
"name": "",
"pathName": "pages/mine/orderDetail",
"query": "id=197",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/mine/myOrder",
"query": "status=0",
"launchMode": "default",
"scene": null
}
]
}
}
}
\ No newline at end of file
... ...