Browse Source

h5端屏蔽复制按钮

master
Gao xiaosong 4 years ago
parent
commit
a2042820b9
  1. 118
      pages/order/Logistics/index.vue
  2. 2
      pages/order/OrderDetails/index.vue
  3. 313
      pages/orderAdmin/AdminOrder/index.vue

118
pages/order/Logistics/index.vue

@ -27,10 +27,9 @@
</view>
</view>
</view>
<view
class="copy acea-row row-center-wrapper copy-data"
@click="copyClipboard(orderInfo.deliveryId)"
>复制单号</view>
<!-- #ifndef H5 -->
<view class="copy acea-row row-center-wrapper copy-data" @click="copyClipboard(orderInfo.deliveryId)">复制单号</view>
<!-- #endif -->
</view>
<view class="item" v-for="(express, expressListIndex) in expressList" :key="expressListIndex">
<view class="circular" :class="expressListIndex === 0 ? 'on' : ''"></view>
@ -45,10 +44,7 @@
<view class="div-bg bg-white" style="font-size:12px; background:#fff;">
<!--物流跟踪-->
<view style="margin-bottom:5px;">
<view
class="bg-white"
style="width: 92%; margin-left: 4%;margin: auto;padding-left: 15px;padding-right: 15px;padding-top: 10px"
>
<view class="bg-white" style="width: 92%; margin-left: 4%;margin: auto;padding-left: 15px;padding-right: 15px;padding-top: 10px">
<view style="font-size: 26rpx;color: #111111; margin: 5px 0">
物流跟踪
<!--物流跟踪-->
@ -57,29 +53,23 @@
<view class="track-rcol">
<view class="track-list">
<view>
<view
class="track-list-item"
v-for="(item,logisticsListindex) in logisticsList"
:key="logisticsListindex"
>
<view class="active" v-if="logisticsListindex===0">
<view class="track-list-item" v-for="(item, logisticsListindex) in logisticsList" :key="logisticsListindex">
<view class="active" v-if="logisticsListindex === 0">
<view></view>
<i class="node-icon"></i>
<text class="txt">{{item.acceptStation}}</text>
<text class="time">{{item.acceptTime}}</text>
<text class="txt">{{ item.acceptStation }}</text>
<text class="time">{{ item.acceptTime }}</text>
</view>
<view
v-if="logisticsListindex > 0 && logisticsListindex !== logisticsList.length-1"
>
<view v-if="logisticsListindex > 0 && logisticsListindex !== logisticsList.length - 1">
<i class="node-icon"></i>
<text class="txt">{{item.acceptStation}}</text>
<text class="time">{{item.acceptTime}}</text>
<text class="txt">{{ item.acceptStation }}</text>
<text class="time">{{ item.acceptTime }}</text>
</view>
<view v-if="logisticsListindex === logisticsList.length-1" class="finall">
<view v-if="logisticsListindex === logisticsList.length - 1" class="finall">
<i class="div-spilander"></i>
<i class="node-icon"></i>
<text class="txt">{{item.acceptStation}}</text>
<text class="time">{{item.acceptTime}}</text>
<text class="txt">{{ item.acceptStation }}</text>
<text class="time">{{ item.acceptTime }}</text>
</view>
</view>
</view>
@ -97,43 +87,43 @@
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
import { express, orderDetail } from "@/api/order";
import { copyClipboard } from "@/utils";
import Recommend from '@/components/Recommend'
import { express, orderDetail } from '@/api/order'
import { copyClipboard } from '@/utils'
const NAME = "Logistics";
const NAME = 'Logistics'
export default {
name: NAME,
components: {
Recommend
Recommend,
},
data: function() {
return {
id: "",
id: '',
cartInfo: [],
orderInfo: {},
expressList: [],
loaded: false,
logisticsList: [
{
message: "暂无数据",
messageDate: ""
message: '暂无数据',
messageDate: '',
},
],
}
]
};
},
watch: {
$yroute(n) {
if (n.name === NAME && this.$yroute.query.id !== this.id) {
this.id = this.$yroute.query.id;
this.getExpress();
}
this.id = this.$yroute.query.id
this.getExpress()
}
},
},
mounted: function() {
this.id = this.$yroute.query.id;
this.getExpress();
this.id = this.$yroute.query.id
this.getExpress()
},
methods: {
copyClipboard,
@ -141,39 +131,38 @@ export default {
let params = {
orderCode: this.id,
shipperCode: this.orderInfo.deliverySn,
logisticCode: this.orderInfo.deliveryId
};
logisticCode: this.orderInfo.deliveryId,
}
express(params)
.then(res => {
this.logisticsList = res.data.traces.reverse();
this.logisticsList = res.data.traces.reverse()
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none',
duration: 2000,
})
})
},
getExpress() {
if (!this.id) {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
return;
icon: 'none',
duration: 2000,
})
return
}
this.loaded = false;
this.loaded = false
orderDetail(this.id)
.then(res => {
this.orderInfo = {
deliveryId: res.data.deliveryId,
deliveryName: res.data.deliveryName,
deliverySn: res.data.deliverySn
};
this.getExpressInfo();
deliverySn: res.data.deliverySn,
}
this.getExpressInfo()
// const result = res.data.express.result || {};
// this.cartInfo = res.data.order.cartInfo;
// this.expressList = result.list || [];
@ -181,15 +170,14 @@ export default {
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
};
title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none',
duration: 2000,
})
})
},
},
}
</script>
<style scoped lang="less">

2
pages/order/OrderDetails/index.vue

@ -120,7 +120,9 @@
<view>订单编号</view>
<view class="conter acea-row row-middle row-right">
{{ orderInfo.orderId }}
<!-- #ifndef H5 -->
<text class="copy copy-data" @click="copyClipboard(orderInfo.orderId)">复制</text>
<!-- #endif -->
</view>
</view>
<view class="item acea-row row-between">

313
pages/orderAdmin/AdminOrder/index.vue

@ -14,7 +14,7 @@
<view class="orderingUser acea-row row-middle">{{ orderInfo.nickname }}</view>
<view class="address">
<view class="name">
{{ orderInfo.realName}}
{{ orderInfo.realName }}
<text class="phone">{{ orderInfo.userPhone }}</text>
</view>
<view>{{ orderInfo.userAddress }}</view>
@ -23,11 +23,7 @@
<image :src="`${$VUE_APP_RESOURCES_URL}/images/line.jpg`" />
</view>
<view class="pos-order-goods">
<view
class="goods acea-row row-between-wrapper"
v-for="(item, orderInfoIndex) in orderInfo.cartInfo"
:key="orderInfoIndex"
>
<view class="goods acea-row row-between-wrapper" v-for="(item, orderInfoIndex) in orderInfo.cartInfo" :key="orderInfoIndex">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.productInfo.image" />
@ -47,21 +43,16 @@
<view class="public-total">
{{ orderInfo.totalNum }}件商品应支付
<text class="money">{{ orderInfo.payPrice }}</text>
( 邮费 ¥{{
orderInfo.payPostage
}}
)
( 邮费 ¥{{ orderInfo.payPostage }})
</view>
<view class="wrapper">
<view class="item acea-row row-between">
<view>订单编号</view>
<view class="conter acea-row row-middle row-right">
{{ orderInfo.orderId
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.orderId)"
>复制</text>
{{ orderInfo.orderId }}
<!-- #ifndef H5 -->
<text class="copy copy-data" @click="copyClipboard(orderInfo.orderId)">复制</text>
<!-- #endif -->
</view>
</view>
<view class="item acea-row row-between">
@ -73,7 +64,7 @@
</view>
<view class="item acea-row row-between">
<view>支付状态</view>
<view class="conter">{{ orderInfo.paid == 1 ? "已支付" : "未支付" }}</view>
<view class="conter">{{ orderInfo.paid == 1 ? '已支付' : '未支付' }}</view>
</view>
<view class="item acea-row row-between">
<view>支付方式</view>
@ -98,10 +89,7 @@
<text class="money font-color-red">{{ orderInfo.payPrice }}</text>
</view>
</view>
<view
class="wrapper"
v-if="orderInfo.delivery_type != 'fictitious' && orderInfo._status._type === 2"
>
<view class="wrapper" v-if="orderInfo.delivery_type != 'fictitious' && orderInfo._status._type === 2">
<view class="item acea-row row-between">
<view>配送方式</view>
<view class="conter" v-if="orderInfo.delivery_type === 'express'">快递</view>
@ -116,12 +104,10 @@
<view v-if="orderInfo.delivery_type === 'express'">快递单号</view>
<view v-if="orderInfo.delivery_type === 'send'">送货人电话</view>
<view class="conter">
{{ orderInfo.delivery_id
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.delivery_id)"
>复制</text>
{{ orderInfo.delivery_id }}
<!-- #ifndef H5 -->
<text class="copy copy-data" @click="copyClipboard(orderInfo.delivery_id)">复制</text>
<!-- #endif -->
</view>
</view>
</view>
@ -130,208 +116,186 @@
<view class="more"></view>
<view class="bnt cancel" @click="modify(0)" v-if="types == 0">一键改价</view>
<view class="bnt cancel" @click="modify(0)" v-if="types == -1">立即退款</view>
<view
class="bnt cancel"
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
@click="offlinePay"
>确认付款</view>
<view class="bnt delivery" v-if="title=='未发货' && types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
<view class="bnt quick" v-if="title=='待核销' && types == 1" @click="storeCancellation(0)">快速核销</view>
<view class="bnt delivery" v-if="title=='待核销' && types == 1" @click="storeCancellation(1)">立即核销</view>
<view class="bnt cancel" v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0" @click="offlinePay">确认付款</view>
<view class="bnt delivery" v-if="title == '未发货' && types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
<view class="bnt quick" v-if="title == '待核销' && types == 1" @click="storeCancellation(0)">快速核销</view>
<view class="bnt delivery" v-if="title == '待核销' && types == 1" @click="storeCancellation(1)">立即核销</view>
</view>
<PriceChange
:change="change"
:orderInfo="orderInfo"
v-on:closechange="changeclose($event)"
v-on:savePrice="savePrice"
:status="status"
></PriceChange>
<PriceChange :change="change" :orderInfo="orderInfo" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice" :status="status"></PriceChange>
</view>
</template>
<script>
import PriceChange from "@/components/PriceChange";
import DataFormat from "@/components/DataFormat";
import {
getAdminOrderDetail,
setAdminOrderPrice,
setAdminOrderRemark,
setOfflinePay,
setOrderRefund
} from "@/api/admin";
import {orderVerific} from "@/api/order";
import { required, num } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog";
import { copyClipboard } from "@/utils";
import PriceChange from '@/components/PriceChange'
import DataFormat from '@/components/DataFormat'
import { getAdminOrderDetail, setAdminOrderPrice, setAdminOrderRemark, setOfflinePay, setOrderRefund } from '@/api/admin'
import { orderVerific } from '@/api/order'
import { required, num } from '@/utils/validate'
import { validatorDefaultCatch } from '@/utils/dialog'
import { copyClipboard } from '@/utils'
export default {
name: "AdminOrder",
name: 'AdminOrder',
components: {
PriceChange,
DataFormat
DataFormat,
},
props: {},
data: function() {
return {
order: false,
change: false,
order_id: "",
order_id: '',
orderInfo: {
_status: {}
_status: {},
},
status: "",
title: "",
payType: "",
types: ""
};
status: '',
title: '',
payType: '',
types: '',
}
},
watch: {
"$yroute.query.oid": function(newVal) {
let that = this;
'$yroute.query.oid': function(newVal) {
let that = this
if (newVal != undefined) {
that.order_id = newVal;
that.getIndex();
}
that.order_id = newVal
that.getIndex()
}
},
},
onShow: function() {
this.order_id = this.$yroute.query.oid;
this.getIndex();
this.order_id = this.$yroute.query.oid
this.getIndex()
},
methods: {
goGoodsDeliver(orderInfo) {
this.$yrouter.push({
path: "/pages/orderAdmin/GoodsDeliver/index",
query: { oid: orderInfo.orderId }
});
path: '/pages/orderAdmin/GoodsDeliver/index',
query: { oid: orderInfo.orderId },
})
},
copyClipboard,
more: function() {
this.order = !this.order;
this.order = !this.order
},
modify: function(status) {
this.change = true;
this.status = status;
this.change = true
this.status = status
},
changeclose: function(msg) {
this.change = msg;
this.change = msg
},
getIndex: function() {
let that = this;
let that = this
getAdminOrderDetail(that.order_id).then(
res => {
that.orderInfo = res.data;
that.types = res.data._status._type;
that.title = res.data._status._title;
that.payType = res.data._status._payType;
that.orderInfo = res.data
that.types = res.data._status._type
that.title = res.data._status._title
that.payType = res.data._status._payType
},
err => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
icon: 'none',
duration: 2000,
})
}
);
)
},
async savePrice(opt) {
let that = this,
data = {},
price = opt.price,
remark = opt.remark,
refund_price = opt.refund_price.toString();
data.orderId = that.orderInfo.orderId;
refund_price = opt.refund_price.toString()
data.orderId = that.orderInfo.orderId
if (that.status == 0 && that.orderInfo.refundStatus === 0) {
try {
await this.$validator({
price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({ price });
price: [required(required.message('金额')), num(num.message('金额'))],
}).validate({ price })
} catch (e) {
return validatorDefaultCatch(e);
return validatorDefaultCatch(e)
}
data.price = price;
data.price = price
setAdminOrderPrice(data).then(
function() {
that.change = false;
that.change = false
uni.showToast({
title: "改价成功",
icon: "success",
duration: 2000
});
that.getIndex();
title: '改价成功',
icon: 'success',
duration: 2000,
})
that.getIndex()
},
function() {
that.change = false;
that.change = false
uni.showToast({
title: "改价失败",
icon: "none",
duration: 2000
});
title: '改价失败',
icon: 'none',
duration: 2000,
})
}
);
)
} else if (that.status == 0 && that.orderInfo.refundStatus === 1) {
try {
await this.$validator({
refund_price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({ refund_price });
refund_price: [required(required.message('金额')), num(num.message('金额'))],
}).validate({ refund_price })
} catch (e) {
return validatorDefaultCatch(e);
return validatorDefaultCatch(e)
}
data.price = refund_price;
data.type = opt.type;
data.price = refund_price
data.type = opt.type
setOrderRefund(data).then(
res => {
that.change = false;
that.change = false
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
icon: 'none',
duration: 2000,
})
that.getIndex()
},
err => {
that.change = false;
that.change = false
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
icon: 'none',
duration: 2000,
})
that.getIndex()
}
);
)
} else {
try {
await this.$validator({
remark: [required(required.message("备注"))]
}).validate({ remark });
remark: [required(required.message('备注'))],
}).validate({ remark })
} catch (e) {
return validatorDefaultCatch(e);
return validatorDefaultCatch(e)
}
data.remark = remark;
data.remark = remark
setAdminOrderRemark(data).then(
res => {
that.change = false;
that.change = false
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
icon: 'none',
duration: 2000,
})
that.getIndex()
},
err => {
that.change = false;
that.change = false
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
icon: 'none',
duration: 2000,
})
}
);
)
}
},
offlinePay: function() {
@ -339,76 +303,75 @@ export default {
res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.getIndex();
icon: 'none',
duration: 2000,
})
this.getIndex()
},
err => {
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
});
icon: 'none',
duration: 2000,
})
}
);
)
},
storeCancellation(index) {
const that = this;
that.check = true;
const that = this
that.check = true
if (index == 0) {
uni.showModal({
title: "确定核销订单?",
content: "注意:请务必核对核销码的与客户正确性",
title: '确定核销订单?',
content: '注意:请务必核对核销码的与客户正确性',
success(res) {
if (res.confirm) {
uni.showLoading({
title: "查询中"
});
title: '查询中',
})
orderVerific(that.orderInfo.verifyCode, 1)
.then(res => {
console.log(res)
uni.hideLoading();
that.iShidden = false;
uni.hideLoading()
that.iShidden = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
});
duration: 1000,
})
//
setTimeout(function() {
uni.navigateBack({
delta: 1, //
success: function() {
console.log('成功!')
}
},
})
}, 1000);
}, 1000)
})
.catch((err) => {
.catch(err => {
console.log(err)
uni.hideLoading();
uni.hideLoading()
uni.showToast({
title: err.data.msg,
icon: "none",
duration: 2000
});
});
}
icon: 'none',
duration: 2000,
})
})
}
});
},
})
} else {
that.$yrouter.push({
path: '/pages/orderAdmin/OrderCancellation/index'
path: '/pages/orderAdmin/OrderCancellation/index',
})
}
}
}
};
},
},
}
</script>
<style lang="less">
.quick {
background: #F25555;
background: #f25555;
}
</style>

Loading…
Cancel
Save