uniapp小程序订单页面UI

简介: uniapp小程序订单页面UI

前言

之前用模板写了订单页面,由于需求改了导致这个页面做更新麻烦,弄了一下午,索性全部删除了自己写了,上面的tabs用的是b-ui框架写的,其他的都是原生写法。

🙏如果这篇文章对你有帮助还请收藏点赞+关注🙏

分析

根据我的需求,通过订单号查一个群组的商品数据,然后将订单状态以及点击事件、创建时间,商品数量总计 显示出来,在开发时,需要先了解uniapp小程序的开发流程和基本UI组件,以及订单页面的设计原则和需求分析。

布局

首先确定订单页面的整体布局,包括订单信息、商品列表、价格总计等内容。 通过颜色将大致的轮廓勾勒出来,可以使用不同的颜色来区分不同的内容区域,比如订单信息区域使用灰色背景,商品列表区域使用白色背景等。调整好每一本书的距离,可以使用margin和padding属性来控制每个商品之间的距离,保证页面整体美观。 对于商品列表中的每个商品,可以使用flex布局来实现自适应排列,同时使用图片和文字来展示商品信息。最后,根据实际需求添加一些交互效果,比如点击商品可以跳转到商品详情页面等。

代码:

由于我习惯先写在调整样式,所以现在看上去乱糟糟的,但这不是最终版

<template>
  <view>
    <view class="b-bg-white b-text-black-d">
      <!-- tabs -->
      <view class="b-tabs">
        <scroll-view scroll-x>
          <view class="b-tabs-container">
            <view class="b-tabs-item" v-for="(item,index) in tabs1" :key="index"
              :class="{'b-tabs-active':tabs1Current == index}"
              @click="tabs1Current = index"
            >
              {{item}}
            </view>
          </view>
        </scroll-view>
      </view>
      <!-- tabs -->
      <view style="width: 735rpx;height: 350rpx;background-color: yellowgreen;margin-top: 10rpx;margin-left: 10rpx;border-radius: 10rpx;display: flex;flex-direction: column;">
        <view style="width: 735rpx;height: 80rpx;background-color: yellowgreen;display: flex;flex-direction: row;align-items: center;justify-items: center;">
          <text>订单号:xxxx</text>
          <text style="margin-left: 450rpx;">待取件</text>
        </view>
        <span style="border: 1rpx solid #ccc;"></span>
        <view style="width: 735rpx;height: 208rpx;background-color: bisque;display: flex;flex-direction: row;align-items: center;">
          <image src="/static/logo.png"  style="height: 100rpx;width: 100rpx;margin-left: 10rpx;"></image>
          <image src="/static/logo.png"  style="height: 100rpx;width: 100rpx;margin-left: 10rpx;"></image>
          <image src="/static/logo.png"  style="height: 100rpx;width: 100rpx;margin-left: 10rpx;"></image>
          <image src="/static/logo.png"  style="height: 100rpx;width: 100rpx;margin-left: 10rpx;"></image>
          <image src="/static/logo.png"  style="height: 100rpx;width: 100rpx;margin-left: 10rpx;"></image>
          <image src="/static/slh.png"  style="height: 100rpx;width: 100rpx;margin-left: 10rpx;"></image>
        </view>
        <view style="width: 735rpx;height: 62rpx;background-color: beige;display: flex;flex-direction: row;align-items: center;">
          <text>2023-06-13</text>
          <text style="margin-left: 450rpx;">共三本</text>
        </view>
      </view>
    </view>
    </view>
</template>
<script>
  export default {
    data() {
      return {
        tabs1:["全部","待初审","待取件","待审核","待打款"],
        tabs1Current:0,
      }
    },
    onLoad() {
    },
    methods: {
    }
  }
</script>
<style lang="scss">
// 头像性别标签
.avatar-tags-sex{
  position: absolute;
  z-index: 1;
  width: 40rpx;
  height: 40rpx;
  right: 0;
  bottom: 0;
  border-radius: 50%;
}
// 头像VIP标签
.avatar-tags-vip{
  position: absolute;
  z-index: 1;
  width: 40rpx;
  height: 40rpx;
  right: 0;
  top: 0;
  border-radius: 50%;
}
</style>

通过短时间的修改,勉强能看得过去

实现

成品图:

这里我已经通过js事件将视图层渲染了一遍,有很多不足的地方在慢慢调整,由于功能急需上架,ui只能等后面调整了

<template>
  <view class="page">
    <view class="b-bg-white b-text-black-d">
      <!-- tabs -->
      <view class="b-tabs">
        <scroll-view scroll-x>
          <view class="b-tabs-container">
            <view class="b-tabs-item" v-for="(item,index) in tabs1" :key="index"
              :class="{'b-tabs-active':tabs1Current == index}"
              @click="tabs1Current = index"
            >
              {{item}}
            </view>
          </view>
        </scroll-view>
      </view>
      <!-- tabs -->
        <view class="card" v-for="(item,index) in menuLists" :key="index">
          <view class="card_in_top">
          </view>
        <view class="card_in_center">
            <text style="margin-left: 10rpx;">订单号:{{item.sell_order_num}}</text>
            <text style="margin-left: 330rpx;color: #38dd5b;">待取件</text>
          </view>
          <span style="border: 1rpx solid #e1e1e1;"></span>
          <view class="card_in_b">
            <block v-for="(item2,index2) in item.book_data" :key="index2" v-if="index2 < 5">
              <view style="height: 180rpx;width: 140rpx;background-color: #ececec;margin-left: 15rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;justify-self: center;">
                <image :src="item2.book_cover"  style="height: 145rpx;width: 120rpx;"></image>
              </view>
            </block>
            <!-- <image src="/static/slh.png"  style="height: 100rpx;width: 100rpx;margin-left: 10rpx;"></image> -->
          </view>
          <view class="result">
            <text style="margin-left: 10rpx;">{{item.cre_time}}</text>
            <text style="margin-left: 450rpx;">共{{item.book_data.length}}本</text>
          </view>
        </view>
      </view>
    </view>
</template>
<script>
  export default {
    data() {
      return {
        menuLists: [],  
        tabs1:["全部","待初审","待取件","待审核","待打款"],
        tabs1Current:0,
      }
    },
    onLoad() {
    },
    methods: {
    }
  }
</script>
<style lang="scss">
  .page{
    // background-color: #f5f5f5;
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
  }
  .card{
    width: 750rpx;height: 380rpx;border-radius: 20rpx;display: flex;flex-direction: column;
  }
  .card_in_top{
    width: 100%;height: 30rpx;background-color: #f5f5f5;
  }
  .card_in_center{
    width: 735rpx;height: 80rpx;background-color: #ffffff;display: flex;flex-direction: row;align-items: center;justify-items: center;
  }
  .card_in_b{
    width: 735rpx;height: 208rpx;background-color: #ffffff;display: flex;flex-direction: row;align-items: center;
  }
  .result{
    width: 735rpx;height: 62rpx;background-color: #ffffff;display: flex;flex-direction: row;align-items: center;
  }
</style>

总结

在本文中,我们介绍了如何使用uniapp框架开发小程序订单页面UI。我们首先讲解了订单页面的设计原则和注意事项,然后介绍了uniapp框架的基本使用方法。接着,我们详细讲解了订单页面的UI设计,包括订单列表、订单详情、订单支付等。最后,我们总结了本文的主要内容,强调了订单页面UI设计的重要性,并提供了一些优化建议,希望能够帮助开发者更好地设计和开发小程序订单页面。

相关文章
|
5月前
|
监控 前端开发 小程序
陪练,代练,护航,代打小程序源码/前端UNIAPP-VUE2.0开发 后端Thinkphp6管理/具备家政服务的综合型平台
这款APP通过技术创新,将代练、家政、娱乐社交等场景融合,打造“全能型生活服务生态圈”。以代练为切入点,提供模块化代码支持快速搭建平台,结合智能匹配与技能审核机制,拓展家政服务和商业管理功能。技术架构具备高安全性和扩展性,支持多业务复用,如押金冻结、录屏监控等功能跨领域应用。商业模式多元,包括交易抽成、增值服务及广告联名,同时设计跨领域积分体系提升用户粘性,实现生态共生与B端赋能。
416 12
|
6月前
|
机器学习/深度学习 算法 搜索推荐
UniApp+ThinkPHP6助阵陪玩系统/ 订单智能匹配引擎的技术方案/源码/二开
本文探讨基于UniApp和ThinkPHP6的陪玩系统技术方案,聚焦订单智能匹配引擎的核心逻辑与应用前景。UniApp实现多端适配,降低开发成本;ThinkPHP6提供高效后端支持,确保系统稳定。匹配引擎通过用户画像、陪玩师能力评估及实时算法,精准对接供需。市场分析显示陪玩服务需求持续增长,但面临信任、竞争与政策挑战。未来可通过AI、VR等技术升级,拓展生态合作与全球化布局,助力陪玩服务成为游戏产业重要板块。
183 2
|
7月前
|
缓存 小程序 API
微信小程序页面导航与路由:实现多页面跳转与数据传递
本文深入探讨微信小程序的页面导航与路由机制,介绍多种页面跳转方式如`wx.navigateTo`、`wx.redirectTo`、`wx.switchTab`等,并讲解通过URL、全局变量和事件传递数据的方法。结合案例实现多页面跳转与数据传递,帮助开发者掌握这一重要技能。
|
8月前
|
移动开发 小程序
thinkphp+uniapp开发的多端商城系统源码/H5/小程序/APP支持DIY模板直播分销
thinkphp+uniapp开发的多端商城系统源码/H5/小程序/APP支持DIY模板直播分销
274 0
|
10月前
|
人工智能 小程序 搜索推荐
uni app下开发AI运动小程序解决方案
本文介绍了在小程序中实现AI运动识别的解决方案。该方案依托于UNI平台,通过高效便捷的插件形式,实现包括相机抽帧控制、人体识别、姿态识别等在内的多项功能,无需依赖后台服务器,大幅提高识别效率和用户体验。方案内置多种运动模式,支持自定义扩展,适用于AI健身、云上赛事、AI体测等多场景,适合新开发和存量改造项目。
|
10月前
|
小程序 前端开发 JavaScript
在线课堂+工具组件小程序uniapp移动端源码
在线课堂+工具组件小程序uniapp移动端源码
196 0
在线课堂+工具组件小程序uniapp移动端源码
|
11月前
|
小程序 前端开发 开发者
小程序的页面如何布局?
【10月更文挑战第16天】小程序的页面如何布局?
689 1
|
11月前
|
移动开发 小程序 数据可视化
基于npm CLI脚手架的uniapp项目创建、运行与打包全攻略(微信小程序、H5、APP全覆盖)
基于npm CLI脚手架的uniapp项目创建、运行与打包全攻略(微信小程序、H5、APP全覆盖)
1719 3
|
11月前
|
数据可视化 API
低代码可视化-uniapp购物车页面-代码生成器
低代码可视化-uniapp购物车页面-代码生成器
181 1
|
11月前
|
小程序 API
微信小程序更新提醒uniapp
在小程序开发中,版本更新至关重要。本方案利用 `uni-app` 的 `uni.getUpdateManager()` API 在启动时检测版本更新,提示用户并提供立即更新选项,自动下载更新内容,并在更新完成后重启小程序以应用新版本。适用于微信小程序,确保用户始终使用最新版本。以下是实现步骤: ### 实现步骤 1. **创建更新方法**:在 `App.vue` 中创建 `updateApp` 方法用于检查小程序是否有新版本。 2. **测试**:添加编译模式并选择成功状态进行模拟测试。
282 0
微信小程序更新提醒uniapp

热门文章

最新文章