小程序订单页面优化

pull/56/head
Suk1No 1 month ago
parent 1a31c16083
commit 58ff637238

@ -12,13 +12,11 @@
<view class="u-m-t-20"> <view class="u-m-t-20">
<u-cell-group> <u-cell-group>
<u-cell-item icon="star" title="我的收藏"></u-cell-item> <u-cell-item @click="toOrder" icon="star" title="我的订单"></u-cell-item>
<u-cell-item icon="photo" title="我的订单"></u-cell-item> <u-cell-item icon="photo" title="我的收藏"></u-cell-item>
<u-cell-item icon="coupon" title="我的地址"></u-cell-item> <u-cell-item icon="coupon" title="我的地址"></u-cell-item>
</u-cell-group> </u-cell-group>
</view> </view>
</view> </view>
</template> </template>
@ -29,6 +27,9 @@
import { import {
ref ref
} from 'vue' } from 'vue'
import {
userLogin
} from '../../api/user.js'
// //
const nickName = ref('大幕孤烟直') const nickName = ref('大幕孤烟直')
// //
@ -52,7 +53,16 @@
}) })
} }
} }
//
const toOrder = () => {
getUserInfo()
//details.vue
uni.navigateTo({
url: '../order/order'
});
}
onShow(() => { onShow(() => {
userLogin()
getUserInfo() getUserInfo()
}) })
</script> </script>

@ -17,7 +17,10 @@
<view class="store">{{ res.userName }}</view> <view class="store">{{ res.userName }}</view>
<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon> <u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
</view> </view>
<view class="right">{{ res.phone }}</view> <view style="margin-left: 6px;;" class="right">{{ res.phone }}</view>
</view>
<view class="">
{{res.address}}
</view> </view>
<view class="item" v-for="(item, index) in res.goodsList" :key="index"> <view class="item" v-for="(item, index) in res.goodsList" :key="index">
<view class="left"> <view class="left">
@ -44,12 +47,8 @@
</text> </text>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="more"> <view v-if="res.status == '0'" class="exchange btn"></view>
<u-icon name="more-dot-fill" color="rgb(203,203,203)"></u-icon> <view v-if="res.status == '2'" class="evaluate btn"></view>
</view>
<view class="logistics btn">查看物流</view>
<view class="exchange btn">卖了换钱</view>
<view class="evaluate btn">评价</view>
</view> </view>
</view> </view>
<u-loadmore :status="loadStatus[index]" bgColor="#f2f2f2"></u-loadmore> <u-loadmore :status="loadStatus[index]" bgColor="#f2f2f2"></u-loadmore>
@ -150,7 +149,7 @@
const getOrderList = async (idx) => { const getOrderList = async (idx) => {
let res = await getOrderListApi({ let res = await getOrderListApi({
openid: uni.getStorageSync("openid"), openid: uni.getStorageSync("openid"),
type: idx == 0 ? '' : idx, type: idx == 0 ? '' : idx - 1,
currentPage: currentPage.value, currentPage: currentPage.value,
pageSize: pageSize.value pageSize: pageSize.value
}) })
@ -189,7 +188,7 @@
.order { .order {
width: 710rpx; width: 710rpx;
background-color: #ffffff; background-color: #ffffff;
margin: 20rpx auto; margin: 10rpx auto;
border-radius: 20rpx; border-radius: 20rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx; padding: 20rpx;
@ -197,8 +196,8 @@
.top { .top {
display: flex; display: flex;
justify-content: space-between;
// justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
@ -223,8 +222,8 @@
margin-right: 20rpx; margin-right: 20rpx;
image { image {
width: 200rpx; width: 140rpx;
height: 200rpx; height: 140rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
} }
@ -278,7 +277,7 @@
display: flex; display: flex;
margin-top: 40rpx; margin-top: 40rpx;
padding: 0 10rpx; padding: 0 10rpx;
justify-content: space-between; justify-content: flex-end;
align-items: center; align-items: center;
.btn { .btn {

Loading…
Cancel
Save