Browse Source

h5端屏蔽复制按钮

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

100
pages/order/Logistics/index.vue

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

2
pages/order/OrderDetails/index.vue

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

303
pages/orderAdmin/AdminOrder/index.vue

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

Loading…
Cancel
Save