Commit 734a8506 authored by June_Q's avatar June_Q

fix:修复消息中心name为空的null;feat:订单物流

parent 4d34000d
import { request } from "@/lib/service"
export function orderLogistics(orderid) {
return request({
url: 'zsxcx/getOrderDeliveryByOrderIdZS.htm',
method: 'post',
data: {
order_id: orderid
}
})
}
\ No newline at end of file
...@@ -2,13 +2,13 @@ import { request } from "@/lib/service" ...@@ -2,13 +2,13 @@ import { request } from "@/lib/service"
/** /**
* @desc 消息列表 * @desc 消息列表
*/ */
export function newsList({pageNum = 1, pageSize = 10}) { export function newsList({page = 1, pagenum = 10}) {
return request({ return request({
url: 'zsxcx/getInformationUserZS.htm', url: 'zsxcx/getInformationUserZS.htm',
method: 'post', method: 'post',
data: { data: {
pageNum, page,
pageSize pagenum
}, },
needMask: true needMask: true
}) })
......
...@@ -6,10 +6,11 @@ export default function Modal(options) { ...@@ -6,10 +6,11 @@ export default function Modal(options) {
icon: "none" icon: "none"
}) })
} }
uni.showModal({ console.log(options)
return uni.showModal({
title: options.title || '提示', title: options.title || '提示',
content: options.content, content: options.content,
showCancel: options.showCancel || true, showCancel: options.showCancel === false ? options.showCancel : true,
cancelText: options.cancelText || '取消', cancelText: options.cancelText || '取消',
cancelColor: options.cancelColor || '#000000', cancelColor: options.cancelColor || '#000000',
confirmText: options.confirmText || '确定', confirmText: options.confirmText || '确定',
......
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import store from './store' import store from './store'
import "@/utils/vue_extend.js" // 常用方法 import "@/utils/vue_extend.js" // 常用方法
// 全局组件 // 全局组件
...@@ -13,7 +12,6 @@ Vue.component('uni-popup', uniPopup) ...@@ -13,7 +12,6 @@ Vue.component('uni-popup', uniPopup)
Vue.component('c-nav_bar' , cNav_bar) Vue.component('c-nav_bar' , cNav_bar)
Vue.prototype.$store = store Vue.prototype.$store = store
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
......
...@@ -198,6 +198,13 @@ ...@@ -198,6 +198,13 @@
"style": { "style": {
"navigationBarTitleText": "消息详情" "navigationBarTitleText": "消息详情"
} }
},
{
"path": "logisticsInfo/index",
"style": {
"navigationBarTitleText": "物流详情",
"enablePullDownRefresh": true
}
} }
] ]
}, },
......
This diff is collapsed.
...@@ -51,7 +51,10 @@ ...@@ -51,7 +51,10 @@
</view> </view>
<view class="mt-2 box" v-if="order_detail.order.shipping_type === '1'"> <view class="mt-2 box" v-if="order_detail.order.shipping_type === '1'">
<view class="item font-32 mb-3">配送信息</view> <view class="item font-32 mb-3 flex j-between a-center">
<span>配送信息</span>
<span v-if="order_detail.order.deliverycount" class="font-28 font-bold" style="color: #FF661A" @click.stop="handleLogistics">查看物流</span>
</view>
<view class="mt-3">配送方式:商家配送<text class="primary ml-1" @click="makePhoneCall()">联系商家</text></view> <view class="mt-3">配送方式:商家配送<text class="primary ml-1" @click="makePhoneCall()">联系商家</text></view>
<view class="item mt-3 w-100 flex j-start a-start"> <view class="item mt-3 w-100 flex j-start a-start">
<view class="hd">配送地址:</view> <view class="hd">配送地址:</view>
...@@ -163,7 +166,12 @@ ...@@ -163,7 +166,12 @@
:style="{bottom: isIphoneX + 'px'}" :style="{bottom: isIphoneX + 'px'}"
v-if="!['0', '2', '5'].includes(order_detail.order.order_status)" v-if="!['0', '2', '5'].includes(order_detail.order.order_status)"
> >
<order-btn :item="order_detail.order" :otherData="order_detail" @changeData='changeData'></order-btn> <order-btn
:item="order_detail.order"
:otherData="order_detail"
:showLogistics="false"
@changeData='changeData'
/>
</view> </view>
</view> </view>
...@@ -297,7 +305,15 @@ export default { ...@@ -297,7 +305,15 @@ export default {
current: link, // 当前显示图片的http链接 current: link, // 当前显示图片的http链接
urls: [link] // 需要预览的图片http链接列表 urls: [link] // 需要预览的图片http链接列表
}) })
} },
handleLogistics() {
const orderid = this.order_detail.order.order_id
if(!orderid) return
uni.navigateTo({
url: '/subPages/logisticsInfo/index?order_id=' + orderid
})
},
} }
} }
</script> </script>
......
<template>
<view class="wrapper" @click="onClick">
<view
class="logistics-item font-28"
v-for="(logistic, logisticidx) in list"
:key="logistic.id"
>
<view class="flex j-start a-center">
<span>物流公司: {{logistic.express_name}}</span>
<image
v-if="'1' === logistic.is_coldchain"
class="icon ml-1" src="/static/images/common/icon-geli.png"
mode="widthFix"
/>
</view>
<view class="flex j-between a-center mt-2">
<span>运单号码: {{logistic.express_no}}</span>
<span
style="color: #FF661A;"
data-type="copy"
:data-waybillsn="logistic.express_no"
>复制</span>
</view>
<view class="mt-2">发货时间: {{logistic.add_time | parseTime}}</view>
<!-- <scroll-view
v-if="logistic.goodsimglist && logistic.goodsimglist.length > 4"
scroll-x class="mt-2 flex j-start a-center"
style="white-space: nowrap;"
>
<image
class="imgs"
v-for="(img, idx) in logistic.goodsimglist"
:src="baseUrl + '/' + img.goods_thumb"
:key="idx"
mode="aspectFit"
/>
</scroll-view> -->
<view class="mt-2 img-box">
<image
class="imgs"
v-for="(img, idx) in logistic.goodsimglist"
:src="baseUrl + '/' + img.goods_thumb"
:key="idx"
:data-logisticidx="logisticidx"
:data-imgidx="idx"
data-type="previewImg"
mode="aspectFit"
/>
</view>
</view>
</view>
</template>
<script>
import Modal from '@/lib/modal/index.js';
import { orderLogistics } from '@/apis/logistics.js';
export default {
data() {
return {
list: []
}
},
onLoad(ops) {
const { order_id } = ops
if(!order_id) return Modal({
content: '订单id缺失',
showCancel: false,
cb: () => {
uni.navigateBack()
}
})
this.order_id = order_id
this.getLogistics()
},
onPullDownRefresh() {
uni.showLoading({
title: '刷新中...',
mask: true
})
this.getLogistics()
let timer = setTimeout(() => {
uni.stopPullDownRefresh()
uni.hideLoading()
clearTimeout(timer);
timer = null;
}, 500)
},
methods: {
getLogistics() {
orderLogistics(this.order_id)
.then(({status, data}) => {
if(status) {
this.list = data
}
})
},
onClick(e) {
const { type, waybillsn, logisticidx, imgidx } = e.target.dataset;
switch(type) {
case 'copy':
waybillsn && uni.setClipboardData({
data: waybillsn,
success: this.$toast({title: "复制成功"})
})
break;
case 'previewImg':
('undefined' !== logisticidx) && uni.previewImage({
current: imgidx,
urls: this.list[logisticidx].goodsimglist.map(i => this.baseUrl + '/' + i.goods_thumb)
})
break;
default:
this.$toast({title: '可复制运单号前往对应物流公司官网查询物流跟踪'})
break;
}
}
}
}
</script>
<style lang="scss" scoped>
.wrapper {
.logistics-item {
@include borderBox(30rpx, 20rpx);
width: 680rpx;
margin: 20rpx auto 0;
border-radius: 12rpx;
background-color: #fff;
.icon {
display: inline-block;
width: 34rpx;
height: 34rpx;
}
.img-box {
white-space: nowrap;
overflow-x: auto;
.imgs {
display: inline-block;
width: 155rpx;
height: 155rpx;
margin-right: 10rpx;
border-radius: 12rpx;
overflow: hidden;
&:last-child {
margin-right: 0;
}
}
}
}
}
</style>
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<!-- introduct info --> <!-- introduct info -->
<view class="descColor font-24 mb-2 flex j-between a-center"> <view class="descColor font-24 mb-2 flex j-between a-center">
<view> <view>
<span class="mr-2">{{detail.name}}</span> <span class="mr-2">{{detail.name || ''}}</span>
<span>{{detail.type}}</span> <span>{{detail.type || ''}}</span>
</view> </view>
<view class="">{{detail.send_time | parseTime}}</view> <view class="">{{detail.send_time | parseTime}}</view>
</view> </view>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
:src="news.icon ? baseUrl + '/' + news.icon : '/static/images/common/default-avatar.png'" :src="news.icon ? baseUrl + '/' + news.icon : '/static/images/common/default-avatar.png'"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<text class="shop-name">{{news.name}}</text> <text class="shop-name">{{news.name || ''}}</text>
</view> </view>
<view class="time font-24 descColor">{{news.send_time | parseTime}}</view> <view class="time font-24 descColor">{{news.send_time | parseTime}}</view>
</view> </view>
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
async getList() { async getList() {
const { status, data } = await this.loadMore.getList({}, newsList) const { status, data } = await this.loadMore.getList({}, newsList)
if(status) { if(status) {
this.list = data this.list = [...this.list, ...data]
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment