123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- <template>
- <view class="container">
- <navbar :config="config" backColor="#666"></navbar>
- <!-- 包裹选项卡 -->
- <view class="packAge" v-if="packAgeList.length">
- <scroll-view scroll-X="true" class="packAge-scoll">
- <view class="every" :class="{'activeTab': currentIndex == index, 'one': packAgeList.length == 1}"
- v-for="(item, index) in packAgeList" :key="index" @click="changeTab(item, index)">
- 包裹{{index + 1}}
- </view>
- </scroll-view>
- </view>
- <!-- 商品信息 -->
- <view class="goods">
- <view class="title">
- 商品信息
- </view>
- <view class="goods-box" v-for="(item, index) in detail.order_package_items" :key="index">
- <view class="goods-img">
- <image :src="item.goods_img" mode="aspectFill"></image>
- </view>
- <view class="goods-info">
- <view class="label">{{item.goods_title}}</view>
- <view class="box sku-box">
- <view class="sku">
- {{item.sku_set_name}}
- </view>
- <view class="sku num">
- x {{item.buy_number}}
- </view>
- </view>
- <view class="box">
- <view class="u-FFF u-font36 priceColor">
- <rich-text :nodes="$mUtil.priceBigSmall(item.sale_price)"></rich-text>
- </view>
- <view class="number">
- 发货数量 x {{item.number}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 物流信息 -->
- <view class="logistics" v-if="detail.express">
- <view class="title">
- 物流信息
- </view>
- <view class="box">
- <text>物流公司:</text>
- <text>{{detail.express.express_name}}</text>
- </view>
- <view class="box">
- <text>物流单号:</text>
- <text>{{detail.express.logistic_code}}</text>
- </view>
- </view>
- <!-- 物流记录 -->
- <view class="">
- <view class="record">
- 物流记录
- </view>
- <view class="shipping u-bg-fff">
- <view class="linehh" :style="'height:'+xiantiaoHeight+'px;top:'+xiantiaoTop+'px;left:'+xiantiaoLeft+'px'">
- </view>
- <view class="ul u-plr30" v-for="(item,index) in shiplist" :key="index">
- <view class="li">
- <!-- <view class="state u-font26 u-flex" :class="{act:index==0}">
- {{item.state}}
- </view> -->
- <view class="mmmm">
- <view class="yuan " :class="{act:index==0,first:index==0,end:index==shiplist.length-1}">
- </view>
- </view>
- <view class="desc">
- <view class="u-font26 u-1A1A1A">{{item.acceptStation}}</view>
- <view class="u-999 u-font24 u-mt10">{{item.acceptTime}}</view>
- </view>
- </view>
- </view>
- <nodata v-if="noData" :config="{top:20,content:'暂无物流数据~'}"></nodata>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- config: {
- back: true, //false是tolbar页面 是则不写
- title: '物流信息',
- color: '#1A1A1A',
- //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
- backgroundColor: [1, "#FFFFFF"],
- statusBarFontColor: '#1A1A1A'
- },
- xiantiaoHeight: 0,
- xiantiaoLeft: 0,
- xiantiaoTop: 0,
- goodsimg: '',
- num: 0,
- code: '',
- shiplist: [],
- noData: false,
- packAgeList: [],
- currentIndex: 0,
- detail: {}
- }
- },
- onLoad(options) {
- if (options.id) {
- this.currentIndex = options.index
- this.getPackAge(options.id, options.index)
- }
- },
- methods: {
- // 包裹信息
- getPackAge(orderId, index=0) {
- this.$http.get(`/order/package/allpackage/${orderId}`).then(res => {
- if (res.code === 200) {
- this.packAgeList = res.list
- this.detail = this.packAgeList[index]
- this.getLogistiscs(this.detail.order_id, this.detail.id)
- }
- })
- },
- changeTab(item, index) {
- if (this.currentIndex == index) {
- return false
- }
- this.currentIndex = index
- this.detail = this.packAgeList[index]
- this.getLogistiscs(this.detail.order_id, this.detail.id)
- },
- getLogistiscs(orderId, id) {
- this.$http.get(`/order/express/select/${orderId}/${id}`)
- .then(res => {
- if (res && res.code == 200) {
- if (!res.data || res.data.traces.length == 0) {
- this.noData = true
- return
- }
- this.shiplist = res.data.traces.reverse()
- this.code = res.data.logisticCode
- }
- })
- },
- getLogistiscsBlack(id) {
- this.$http.get('/rights/express/select/' + id)
- .then(res => {
- if (res && res.code == 200) {
- this.shiplist = res.data.traces.reverse()
- this.code = res.data.logisticCode
- if (res.data.traces.length == 0) {
- this.noData = true
- }
- }
- })
- },
- getHeight() {
- const query = uni.createSelectorQuery();
- query.select('.first').boundingClientRect()
- query.select('.end').boundingClientRect()
- var that = this;
- query.exec(function(res) {
- console.log(res);
- var xiantiaoHeight = 0;
- if (res[1] !== null) {
- xiantiaoHeight = (res[1].top - res[0].top);
- }
- that.xiantiaoHeight = xiantiaoHeight;
- that.xiantiaoLeft = res[0].left + 4;
- that.xiantiaoTop = res[0].top;
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .borderBottom {
- border-bottom: 20rpx solid #eee;
- }
- // 包裹选项卡
- .packAge {
- width: 100%;
- height: 100rpx;
- // margin-bottom: 20rpx;
- padding-left: 30rpx;
- line-height: 100rpx;
- background-color: #fff;
- .packAge-scoll {
- width: 100%;
- height: 100%;
- white-space: nowrap;
- }
- .every {
- display: inline-block;
- width: 180rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- border: 1rpx solid #3775F6;
- border-right: none;
- // border-radius: 10rpx;
- &:first-child {
- border-right: none;
- border-radius: 10rpx 0 0 10rpx;
- }
- &:last-child {
- border-right: 1rpx solid #3775F6;
- border-radius: 0 10rpx 10rpx 0;
- }
- image {
- width: 30rpx;
- height: 30rpx;
- margin-right: 20rpx;
- vertical-align: middle;
- }
- }
- .activeTab {
- background-color: #FA6138;
- color: #fff;
- }
- .one {
- &:first-child {
- border-radius: 10rpx;
- }
- }
- }
- .goods {
- padding: 30rpx;
- padding-bottom: 10rpx;
- background-color: #fff;
- .goods-box {
- display: flex;
- padding: 30rpx 0;
- border-bottom: 1rpx solid #f2f2f2;
- .goods-img {
- width: 150rpx;
- height: 150rpx;
- margin-right: 20rpx;
- border-radius: 20rpx;
- flex-shrink: 0;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .goods-info {
- flex: 1;
- width: 0;
- .label {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- color: #1A1A1A;
- margin-bottom: 10rpx;
- }
- .box {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .sku {
- font-size: 22rpx;
- color: #999;
- margin-right: 10rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .priceColor {
- color: #FA6138;
- font-weight: bold;
- }
- .num {
- flex-shrink: 0;
- }
- .number {
- font-size: 22rpx;
- flex-shrink: 0;
- }
- }
- .sku-box {
- margin-bottom: 20rpx;
- }
- }
- }
- }
- .title {
- font-size: 30rpx;
- font-weight: bold;
- margin-bottom: 20rpx;
- }
- .logistics {
- padding: 30rpx;
- padding-bottom: 10rpx;
- background-color: #fff;
- .box {
- padding-left: 30rpx;
- margin-bottom: 20rpx;
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- .record {
- padding: 30rpx;
- padding-bottom: 10rpx;
- font-size: 30rpx;
- font-weight: bold;
- background-color: #fff;
- }
- .shipping {
- width: 100%;
- margin: 0 auto;
- background-color: #ffffff;
- .linehh {
- position: absolute;
- width: 2rpx;
- margin-left: 16rpx;
- border-left: 2rpx dotted #BEC2CB;
- }
- .ul {
- .li {
- width: 100%;
- display: flex;
- height: auto;
- margin-top: 2rpx;
- .state {
- padding: 20rpx 0rpx;
- &.act {
- color: #FA6138;
- }
- .timeday {
- font-size: 28upx;
- }
- .timeh {
- font-size: 24upx;
- }
- }
- .mmmm {
- position: relative;
- display: flex;
- padding: 0rpx 32rpx 0rpx 36rpx;
- margin-top: 22rpx;
- .yuan {
- position: absolute;
- left: 26rpx;
- width: 25rpx;
- height: 25rpx;
- background: #dedede;
- border-radius: 50%;
- border: 3rpx solid #f2f2f2;
- &.act {
- background-color: #FA6138;
- width: 44rpx;
- height: 44rpx;
- margin-left: -10rpx;
- }
- }
- }
- .desc {
- width: 74%;
- padding: 20rpx 0rpx;
- margin-left: 22rpx;
- }
- }
- }
- }
- </style>
|