123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view v-show="!is_loading">
- <!-- 胶囊 -->
- <mvBar :mysNavConfig="mysNavConfig"></mvBar>
- <view :style="{paddingTop:navH}" style="background-color: #fff;"></view>
- <view class="address">
- <view class="address_icon">
- <image style="width: 50rpx;height: 50rpx;" :src="picture.icon_loc" mode="">
- </image>
- </view>
- <view style="width: 70%;">
- <view style="display: flex;">
- <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
- <p class='ipon'>{{address.phone_number}}</p>
- </view>
- <p class='ipon'>{{address.full_detail_addr}}</p>
- </view>
- </view>
- <view class="logistics1">
- <view>
- <p style="margin-bottom: 10rpx;">物流公司:{{logistics_company}}</p>
- <p>物流单号:{{logistics_number}}
- <image :src="picture.icon_copy" mode="" class="copy-img" @click="handleCopy(logistics_number)" />
- </p>
- </view>
- </view>
- <view class="logistics-detail" v-for="item in logisticsData">
- <view class="logistics-item">
- <p>{{ item.context }}</p>
- <p>{{ item.time }}</p>
- </view>
- </view>
- <view style="height: 100rpx;"></view>
- </view>
- </template>
- <script>
- import region from '@/components/pca-code.json';
- import mvBar from "@/components/mys_navBar/mysNavBar";
- export default {
- components: {
- mvBar,
- },
- data() {
- return {
- navH: getApp().globalData.navHeight,
- picture: getApp().globalData.picture,
- mysNavConfig: {
- /* 开启单页显示首页图标 */
- isHome: true,
- /* 固定导航 */
- navFixed: true,
- /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
- navTitle: {
- text: "物流信息",
- color: "",
- fontSize: "32rpx", // px upx rpx
- fontWeight: "normal", // 100 - 700
- },
- btnType: "type2",
- onLeftClick: '',
- /* type2 按钮 */
- type2Config: {
- // 左图标
- leftPath: "/static/img/png2.png",
- // 右图标
- rightPath: "/static/img/png4.png",
- // 圆角
- radius: "40rpx",
- },
- },
- task_id: "",
- logistics_number: "",
- logistics_company: "",
- logisticsData: [{
- context: "",
- time: ""
- }],
- address: {},
- is_loading: true,
- }
- },
- async onLoad(options) {
- let data = options.textObj.replace(/""/g, "");
- data = JSON.parse(decodeURIComponent(data))
- this.task_id = data.taskId
- uni.showLoading({
- title: '加载中'
- });
- this.is_loading = true
- await this.getLogisticsDetail(this.task_id)
- this.is_loading = false
- uni.hideLoading();
- },
- methods: {
- getLogisticsDetail(secTaskId) {
- // 获取物流信息
- return this.$https.get('/youngee/c/api/t/secTask/logistics/detail?task_id=' + secTaskId).then(res => {
- console.log(res)
- let resData = res.data.data
- this.logistics_number = resData.logistics_number
- this.logistics_company = resData.logistics_company
- this.logisticsData = resData.logistics_context.data
- // 地址解析
- this.address = JSON.parse(resData.address_snap);
- let a = this.address.region_code.toString().slice(0, 2)
- let b = this.address.region_code.toString().slice(0, 4)
- let c = 0
- for (var i = 0; i < region.length; i++) {
- if (region[i].code == a) {
- a = region[i].name
- for (var j = 0; j < region[i].children.length; j++) {
- if (region[i].children[j].code == b) {
- b = region[i].children[j].name
- for (var o = 0; o < region[i].children[j].children.length; o++) {
- if (region[i].children[j].children[o].code == this.address
- .region_code) {
- c = region[i].children[j].children[o].name
- }
- }
- }
- }
- }
- }
- this.address.full_detail_addr = a + b + c + this.address.detail_addr
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- p {
- font-size: 30rpx;
- }
- .address {
- display: flex;
- margin: 20rpx 0;
- // padding: 20rpx 20rpx;
- background-color: #FFFFFF;
- justify-content: flex-start;
- align-items: center;
- .address_icon {
- width: 15%;
- vertical-align: middle;
- display: flex;
- justify-content: center;
- }
- .address_edit {
- width: 15%;
- }
- .address_edit image {
- vertical-align: middle;
- width: 50rpx;
- height: 50rpx;
- display: inline-block;
- padding-right: 14rpx;
- }
- .ipon {
- color: #333333;
- font-size: 30rpx;
- font-weight: 500;
- margin-bottom: 10rpx;
- }
- }
- .logistics1 {
- margin: 50rpx;
- display: flex;
- flex-flow: column;
- align-items: flex-start;
- justify-content: center;
- }
- .logistics-detail {
- padding: 20rpx 30rpx;
- }
- .logistics-item {
- background-color: #f1f1f1;
- padding: 10rpx 30rpx;
- }
- </style>
|