Commit 9c1c5b81aafa7906854b7bfde7cf06625179386f

Authored by zhiyangdu
1 parent d3e5c3db

新增h5物流详情的接口

src/components/logisticsBar/logisticsBar.less 0 → 100755
  1 +@charset "UTF-8";
  2 +
  3 +.logistics-bar {
  4 + background-color: #FFFFFF;
  5 + width: 100%;
  6 + height: auto;
  7 + .box {
  8 + display: flex;
  9 + justify-content: space-between;
  10 + align-items: center;
  11 + margin: 0 auto;
  12 + padding: 30rpx 0;
  13 + width: 690rpx;
  14 + height: auto;
  15 + .left-box {
  16 + display: flex;
  17 + justify-content: flex-start;
  18 + align-items: center;
  19 + .logo-box {
  20 + width: 80rpx;
  21 + height: 80rpx;
  22 + .logo-img {
  23 + display: block;
  24 + width: 80rpx;
  25 + height: 80rpx;
  26 + }
  27 + & + .info-box {
  28 + margin-left: 30rpx;
  29 + }
  30 + }
  31 + .info-box {
  32 + .state {
  33 + color: #333333;
  34 + font-size: 28rpx;
  35 + font-weight: 600;
  36 + }
  37 + .com-order-id {
  38 + color: #B4B4B4;
  39 + font-size: 24rpx;
  40 + font-weight: 400;
  41 + }
  42 + }
  43 + }
  44 + .right-box {
  45 + .btn {
  46 + &.btn-active-o {
  47 + color: #941305;
  48 + font-size: 26rpx;
  49 + font-weight: 500;
  50 + padding: 8rpx 22rpx;
  51 + border: 1px solid #941305;
  52 + border-radius: 30rpx;
  53 + }
  54 + }
  55 + }
  56 + }
  57 +}
0 58 \ No newline at end of file
... ...
src/components/logisticsBar/logisticsBar.vue 0 → 100755
  1 +<template>
  2 + <div class="logistics-bar"
  3 + v-if="logistics">
  4 + <div class="box">
  5 + <div class="left-box">
  6 + <div class="logo-box"
  7 + v-if="logistics.express.simg">
  8 + <img :src="logistics.express.simg"
  9 + class="logo-img" />
  10 + </div>
  11 + <div class="info-box">
  12 + <div class="state">{{logistics.order.express_state_title}}</div>
  13 + <div class="com-order-id">{{logistics.express.com}}:{{logistics.order.express_num}}</div>
  14 + </div>
  15 + </div>
  16 + <div class="right-box">
  17 + <div class="btn btn-active-o"
  18 + v-clipboard:copy="logistics.order.express_num"
  19 + v-clipboard:success="success"
  20 + v-clipboard:error="error">复制单号</div>
  21 + </div>
  22 + </div>
  23 + </div>
  24 +</template>
  25 +
  26 +<script>
  27 +
  28 +// 引入组件
  29 +import Vue from 'vue';
  30 +import VueClipboard from 'vue-clipboard2';
  31 +Vue.use(VueClipboard);
  32 +
  33 +export default {
  34 + name: 'logisticsBar',
  35 + data: function () {
  36 + return {
  37 +
  38 + }
  39 + },
  40 + props: ["logistics"],
  41 + methods: {
  42 +
  43 + /**
  44 + * 复制单号成功
  45 + * @param {Object} event [复制剪切板事件]
  46 + */
  47 + success (event) {
  48 + this.showToast('复制单号成功');
  49 + },
  50 +
  51 + /**
  52 + * 复制单号失败
  53 + * @param {Object} event [复制剪切板事件]
  54 + */
  55 + error (event) {
  56 + this.showToast('复制单号失败');
  57 + }
  58 + }
  59 +}
  60 +</script>
  61 +
  62 +<!-- Add "scoped" attribute to limit CSS to this component only -->
  63 +<style rel="stylesheet/less" lang="less">
  64 +@import './logisticsBar';
  65 +</style>
0 66 \ No newline at end of file
... ...
src/components/logisticsListCom/logisticsListCom.less 0 → 100755
  1 +@charset "UTF-8";
  2 +
  3 +.logistics-list-com {
  4 + background-color: #FFFFFF;
  5 + width: 100%;
  6 + height: auto;
  7 + .box {
  8 + margin: 0 auto;
  9 + padding: 42rpx 0 82rpx 0;
  10 + width: 690rpx;
  11 + height: auto;
  12 + .item {
  13 + display: flex;
  14 + justify-content: flex-start;
  15 + align-items: flex-start;
  16 + width: 100%;
  17 + height: auto;
  18 + .time-box {
  19 + width: 96rpx;
  20 + text-align: right;
  21 + .date {
  22 + color: #333333;
  23 + font-size: 24rpx;
  24 + font-weight: 400;
  25 + }
  26 + .time {
  27 + color: #B4B4B4;
  28 + font-size: 20rpx;
  29 + font-weight: 400;
  30 + }
  31 + }
  32 + .line-box {
  33 + position: relative;
  34 + margin: 0 42rpx 0 32rpx;
  35 + width: 0;
  36 + height: 100%;
  37 + min-height: 230rpx;
  38 + border-left: 1px solid #DCDCDC;
  39 + .dot {
  40 + position: absolute;
  41 + top: 18rpx;
  42 + left: -6rpx;
  43 + z-index: 1;
  44 + background-color: #DCDCDC;
  45 + width: 10rpx;
  46 + height: 10rpx;
  47 + border-radius: 50%;
  48 + }
  49 + }
  50 + .content-box {
  51 + width: 515rpx;
  52 + .value {
  53 + color: #B4B4B4;
  54 + font-size: 24rpx;
  55 + font-weight: 400;
  56 + }
  57 + }
  58 + &.active {
  59 + .line-box {
  60 + .dot {
  61 + position: absolute;
  62 + top: 8rpx;
  63 + left: -14rpx;
  64 + z-index: 1;
  65 + background-color: #941305;
  66 + width: 26rpx;
  67 + height: 26rpx;
  68 + border-radius: 50%;
  69 + }
  70 + }
  71 + .content-box {
  72 + .value {
  73 + color: #333333;
  74 + font-weight: 600;
  75 + }
  76 + }
  77 + }
  78 + }
  79 + .order-address-box {
  80 + .item {
  81 + .line-box {
  82 + border-left: 1px dashed #DCDCDC;
  83 + }
  84 + .content-box {
  85 + .value {
  86 + color: #333333;
  87 + font-weight: 600;
  88 + }
  89 + }
  90 + }
  91 + }
  92 + }
  93 +}
0 94 \ No newline at end of file
... ...
src/components/logisticsListCom/logisticsListCom.vue 0 → 100755
  1 +<template>
  2 + <div class="logistics-list-com"
  3 + v-if="logistics">
  4 + <div class="box">
  5 +
  6 + <!-- 收货地址 -->
  7 + <div class="order-address-box"
  8 + v-if="logistics.order.address">
  9 + <div class="item">
  10 + <div class="time-box"></div>
  11 + <div class="line-box">
  12 + <div class="dot"></div>
  13 + </div>
  14 + <div class="content-box">
  15 + <div class="value">[收货地址]{{logistics.order.address}}</div>
  16 + </div>
  17 + </div>
  18 + </div>
  19 +
  20 + <!-- 物流详情 -->
  21 + <template v-if="logistics.data && logistics.data.length">
  22 + <div class="logistics-list-box">
  23 + <div class="item"
  24 + :class="{'active': index === 0}"
  25 + v-for="(item, index) in logistics.data"
  26 + :key="index">
  27 + <div class="time-box">
  28 + <div class="date">{{item.accept_time | datetime('MM-dd')}}</div>
  29 + <div class="time">{{item.accept_time | datetime('HH:mm:ss')}}</div>
  30 + </div>
  31 + <div class="line-box">
  32 + <div class="dot"></div>
  33 + </div>
  34 + <div class="content-box">
  35 + <div class="value">{{item.AcceptStation}}</div>
  36 + </div>
  37 + </div>
  38 + </div>
  39 + </template>
  40 + </div>
  41 + </div>
  42 +</template>
  43 +
  44 +<script>
  45 +export default {
  46 + name: 'logisticsListCom',
  47 + data: function () {
  48 + return {
  49 +
  50 + }
  51 + },
  52 + props: ["logistics"],
  53 + methods: {
  54 +
  55 +
  56 + }
  57 +}
  58 +</script>
  59 +
  60 +<!-- Add "scoped" attribute to limit CSS to this component only -->
  61 +<style rel="stylesheet/less" lang="less">
  62 +@import './logisticsListCom';
  63 +</style>
0 64 \ No newline at end of file
... ...
src/pages/logistics/logistics.less 0 → 100755
  1 +@charset "UTF-8";
  2 +
  3 +page {
  4 + background-color: #F5F5F5;
  5 + width: 100%;
  6 + height: 100%;
  7 +}
  8 +
  9 +.logistics-page {
  10 + @supports (padding-bottom: env(safe-area-inset-bottom)) {
  11 + & {
  12 + padding-bottom: env(safe-area-inset-bottom);
  13 + }
  14 + }
  15 + .nav {
  16 + position: fixed;
  17 + top: 0;
  18 + z-index: 100;
  19 + background-color: #FFFFFF;
  20 + width: 100%;
  21 + .nav-bar {
  22 + position: unset;
  23 + background-color: #FFFFFF;
  24 + border-bottom: 1px solid #E6E6E6;
  25 + }
  26 + }
  27 + .pl {
  28 + background-color: transparent;
  29 + width: 100%;
  30 + &.is-cnlive {
  31 + height: 44px;
  32 + }
  33 + &.not-is-cnlive {
  34 + height: 0;
  35 + &.is-open-app {
  36 + // height: 124rpx;
  37 + }
  38 + }
  39 + &.not-is-cnlive {
  40 + &.not-is-wechat {
  41 + height: 44px;
  42 + }
  43 + }
  44 + }
  45 + .main-box {
  46 + .logistics-bar {
  47 + margin-bottom: 10rpx;
  48 + }
  49 + .logistics-list-com {
  50 +
  51 + }
  52 + }
  53 +}
0 54 \ No newline at end of file
... ...
src/pages/logistics/logistics.vue 0 → 100755
  1 +<template>
  2 + <div class="logistics-page">
  3 +
  4 + <!-- 导航栏 -->
  5 + <div class="nav"
  6 + :style="{'paddingTop': top.value + 'px'}">
  7 +
  8 + <!-- navBar -->
  9 + <nav-bar v-if="!isWeChat.value"
  10 + @back="back"
  11 + :navs="navs">
  12 + </nav-bar>
  13 + </div>
  14 +
  15 + <div class="pl"
  16 + :class="{'is-cnlive': isCNLive2.value, 'not-is-wechat': !isWeChat.value, 'not-is-cnlive': !isCNLive2.value, 'is-open-app': isOpenApp.value}"
  17 + :style="{'paddingTop': top.value + 'px'}"></div>
  18 +
  19 + <!-- 主区域 -->
  20 + <div class="main-box">
  21 +
  22 + <!-- 物流单号信息 -->
  23 + <logistics-bar :logistics="datas">
  24 + </logistics-bar>
  25 +
  26 + <!-- 物流详细信息列表 -->
  27 + <logistics-list-com :logistics="datas">
  28 + </logistics-list-com>
  29 + </div>
  30 + </div>
  31 +</template>
  32 +
  33 +<script>
  34 +
  35 +// 引入组件
  36 +import navBar from '@/components/navBar/navBar';
  37 +import logisticsBar from '@/components/logisticsBar/logisticsBar';
  38 +import logisticsListCom from '@/components/logisticsListCom/logisticsListCom';
  39 +
  40 +export default {
  41 + name: 'logisticsPage',
  42 + data () {
  43 + return {
  44 + title: "",
  45 + query: {},
  46 + navs: null, // navBar配置参数
  47 + datas: null // 数据
  48 + }
  49 + },
  50 + components: {
  51 + navBar,
  52 + logisticsBar,
  53 + logisticsListCom
  54 + },
  55 + created (options) {
  56 +
  57 + // 设置标题
  58 + this.$set(this, 'title', '物流详情');
  59 +
  60 + // 设置地址栏请求参数
  61 + this.$set(this, "query", options);
  62 +
  63 + this.$set(this, "navs", {
  64 + back: {
  65 + img: "/static/img/icon_back.png"
  66 + },
  67 + title: this.title
  68 + });
  69 +
  70 + // 活动物流查询
  71 + this.luckDrawExpress();
  72 + // #ifdef H5 || APP-PLUS
  73 +
  74 + // 更新页面title
  75 + this.$emit("updateHead");
  76 +
  77 + // #endif
  78 + },
  79 +
  80 +
  81 + // #endif
  82 +
  83 + methods: {
  84 +
  85 + /**
  86 + * 活动物流查询
  87 + */
  88 + luckDrawExpress () {
  89 +
  90 + // 必要参数
  91 + if (this.query.orderId && this.query.orderId != '0' && this.query.orderId != '000') {
  92 +
  93 + // 显示loading
  94 + uni.showLoading({
  95 + title: "",
  96 + mask: true
  97 + });
  98 +
  99 + // 请求接口
  100 + this.http("/Api/" + (this.getApiVersion().luckdraw) + "/luckDrawExpress", {
  101 + id: this.query.orderId
  102 + }, this.luckDrawExpressCallback, {
  103 + method: "POST"
  104 + });
  105 + } else {
  106 +
  107 + // 订单号错误提示
  108 + this.showToast('订单号错误~');
  109 +
  110 + // 定时返回
  111 + setTimeout(() => {
  112 +
  113 + // 后退
  114 + this.back();
  115 + }, 2000);
  116 + }
  117 + },
  118 +
  119 + /**
  120 + * 活动物流查询回调
  121 + * @param {Object} res [服务器返回数据]
  122 + * @param {Object} res [扩展参数]
  123 + */
  124 + luckDrawExpressCallback (res, ext) {
  125 +
  126 + // 隐藏loading
  127 + uni.hideLoading();
  128 +
  129 + // 返回处理
  130 + if (res.statusCode === 200 && res.data.code == 200) {
  131 +
  132 + // 解构数据
  133 + let { data: datas } = res.data;
  134 +
  135 + // 设置参数
  136 + this.$set(this, 'datas', datas);
  137 + } else if (res.statusCode === 200 && res.data.code == 400) {
  138 +
  139 + // 获取地址列表出错
  140 + this.showToast(res.data.message);
  141 +
  142 + // 定时返回
  143 + setTimeout(() => {
  144 +
  145 + // 后退
  146 + this.back();
  147 + }, 2000);
  148 + } else {
  149 +
  150 + // 获取地址列表出错
  151 + this.showToast("获取物流详情出错");
  152 +
  153 + // 定时返回
  154 + setTimeout(() => {
  155 +
  156 + // 后退
  157 + this.back();
  158 + }, 2000);
  159 + }
  160 + },
  161 +
  162 + /**
  163 + * 返回
  164 + */
  165 + back () {
  166 +
  167 + // 判断是否有返回函数
  168 + if (typeof this.helper.$Apps2 === 'object' && typeof this.helper.$Apps2.back === 'function') {
  169 +
  170 + // 调用返回
  171 + this.helper.$Apps2.back();
  172 + } else {
  173 +
  174 + // 后退
  175 + uni.navigateBack({
  176 + delta: 1
  177 + });
  178 + }
  179 + }
  180 + },
  181 + head: {
  182 + title () {
  183 + return {
  184 + inner: this.title
  185 + }
  186 + }
  187 + },
  188 + watch: {
  189 +
  190 + /**
  191 + * 设置页面标题
  192 + * @param {Object} newVal [标题新值]
  193 + */
  194 + title (newVal) {
  195 +
  196 + /* 设置页面标题 开始 */
  197 + this.setTitle(newVal);
  198 + /* 设置页面标题 结束 */
  199 + }
  200 + }
  201 +}
  202 +</script>
  203 +
  204 +<style rel="stylesheet/less" lang="less">
  205 +@import './logistics';
  206 +</style>
0 207 \ No newline at end of file
... ...
src/router/index.js
... ... @@ -146,9 +146,7 @@ const router = new Router({
146 146 path: "/shopList",
147 147 name: "shopList",
148 148 component: resolve => {
149   - require([
150   - "@/pages/shopList/shopList"
151   - ], resolve);
  149 + require(["@/pages/shopList/shopList"], resolve);
152 150 },
153 151 meta: {
154 152 requireAuth: false
... ... @@ -159,9 +157,7 @@ const router = new Router({
159 157 path: "/welfareList",
160 158 name: "welfareList",
161 159 component: resolve => {
162   - require([
163   - "@/pages/welfareList/welfareList"
164   - ], resolve);
  160 + require(["@/pages/welfareList/welfareList"], resolve);
165 161 },
166 162 meta: {
167 163 requireAuth: false
... ... @@ -172,9 +168,7 @@ const router = new Router({
172 168 path: "/actList",
173 169 name: "actList",
174 170 component: resolve => {
175   - require([
176   - "@/pages/actList/actList"
177   - ], resolve);
  171 + require(["@/pages/actList/actList"], resolve);
178 172 },
179 173 meta: {
180 174 requireAuth: false
... ... @@ -338,6 +332,17 @@ const router = new Router({
338 332 requireAuth: false
339 333 }
340 334 },
  335 + {
  336 + // 查看兑换商品物流
  337 + path: "/logistics",
  338 + name: "logistics",
  339 + component: resolve => {
  340 + require(["@/pages/logistics/logistics"], resolve);
  341 + },
  342 + meta: {
  343 + requireAuth: false
  344 + }
  345 + },
341 346 /* 积分商城结束 */
342 347  
343 348 /* 健步走健康值商城开始 */
... ... @@ -379,8 +384,8 @@ const router = new Router({
379 384 requireAuth: false
380 385 }
381 386 },
382   - /* H5地址开始 */
383   - {
  387 + /* H5地址开始 */
  388 + {
384 389 // 创建地址
385 390 path: "/addressCreate",
386 391 name: "addressCreate",
... ...