update: 动态计算公众号组件位置,接入确认收货组件但是无法拉起微信收货面板
This commit is contained in:
parent
65c5ada66f
commit
f37335925b
@ -298,7 +298,7 @@
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<view v-if="item.eltmType == 8" class="mTel" :style="{ 'background-color': item.bgColor }"
|
||||
<view v-if="item.eltmType == 8" class="mTel" :style="{ 'background-color': item.bgColor, top: initY + 'px' }"
|
||||
:data-tel="item.eltm8.tel" @tap="callTel">
|
||||
<label class="iconfont icon-dianhua--copy"
|
||||
:style="{ 'font-size': '30px', color: item.eltm8.fontColor }"></label>
|
||||
@ -333,7 +333,7 @@
|
||||
</uni-nav-bar>
|
||||
|
||||
<movable-area class="movableAreaIM" v-if="item.eltmType == 11 && hasLogin && chatUrl">
|
||||
<movable-view class="movableView" @touchmove.stop.prevent="doNothing" direction="all" :x="initX" :y="initY">
|
||||
<movable-view class="movableView" @touchmove.stop.prevent="doNothing" direction="all" :x="initX" :y="initY + 44 + 10">
|
||||
<view class="mCS" :style="{
|
||||
'background-color': item.bgColor,
|
||||
borderTopLeftRadius: (item.borderTopLeftRadius || 0) + 'px',
|
||||
@ -1006,8 +1006,8 @@ export default {
|
||||
(data) => {
|
||||
if (data) {
|
||||
that.setData({
|
||||
initX: data.width,
|
||||
initY: data.height - 100,
|
||||
initX: data.width - 50,
|
||||
initY: data.height / 2,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1532,6 +1532,10 @@ uni-page-body {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.mCS{
|
||||
position: initial;
|
||||
}
|
||||
|
||||
.diyPage {
|
||||
// padding-bottom: 8rpx;
|
||||
clear: both;
|
||||
|
||||
@ -354,7 +354,7 @@
|
||||
items.order_state_id == StateCode.ORDER_STATE_SHIPPED
|
||||
"
|
||||
class="u-link-btn"
|
||||
@click="confirmReceipt"
|
||||
@click="confirmReceipt(items, $event)"
|
||||
>{{ __("确认收货") }}</view
|
||||
>
|
||||
<view
|
||||
@ -440,7 +440,6 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import paymentBox from "../../components/payment-box.vue";
|
||||
|
||||
@ -793,37 +792,126 @@ export default {
|
||||
true
|
||||
);
|
||||
},
|
||||
confirmReceipt: function (obj) {
|
||||
confirmReceipt: function (data, obj) {
|
||||
var params = {
|
||||
order_id: obj.currentTarget.dataset.on,
|
||||
};
|
||||
|
||||
var that = this;
|
||||
that.$.confirm(
|
||||
that.__("是否确认收货?"),
|
||||
function (e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_receive,
|
||||
data: params,
|
||||
success: function (data, status, msg, code) {
|
||||
if (status == 200) {
|
||||
that.$.alert(that.__("收货成功!"), function () {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
|
||||
//拉起确认收货组件
|
||||
if (wx.openBusinessView) {
|
||||
wx.openBusinessView({
|
||||
businessType: "weappOrderConfirm",
|
||||
extraData: {
|
||||
merchant_id: data.lkl_merchant_no,//用户交易商户号
|
||||
merchant_trade_no: data.order_id,//商户订单号
|
||||
// transaction_id: data.lkl_trade_no, //用户交易单号
|
||||
},
|
||||
success: (e) => {
|
||||
console.log("e1", e);
|
||||
if (e.extraData.status === "success") {
|
||||
// 用户确认收货成功,再执行自己的代码
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_receive,
|
||||
data: params,
|
||||
success: function (data, status, msg, code) {
|
||||
if (status == 200) {
|
||||
that.$.alert(that.__("收货成功!"), function () {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
});
|
||||
setTimeout(function () {
|
||||
that.getOrderlist();
|
||||
}, 1000);
|
||||
});
|
||||
setTimeout(function () {
|
||||
that.getOrderlist();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
} else if (e.extraData.status === "fail") {
|
||||
// 用户确认收货失败
|
||||
uni.showToast({
|
||||
title: "确认收货失败",
|
||||
icon: "none",
|
||||
});
|
||||
} else if (e.extraData.status === "cancel") {
|
||||
// 用户取消
|
||||
uni.showToast({
|
||||
title: "取消确认收货",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log("e2", e);
|
||||
uni.showToast({
|
||||
title: "确认收货失败",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
},
|
||||
complete: (e) => {
|
||||
console.log("e3", e);
|
||||
console.log("无论是否成功都会执行");
|
||||
},
|
||||
});
|
||||
} else {
|
||||
//引导用户升级微信版本
|
||||
uni.showToast({
|
||||
title: "请升级微信版本",
|
||||
icon: "none",
|
||||
});
|
||||
that.$.confirm(
|
||||
that.__("是否确认收货?"),
|
||||
function (e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_receive,
|
||||
data: params,
|
||||
success: function (data, status, msg, code) {
|
||||
if (status == 200) {
|
||||
that.$.alert(that.__("收货成功!"), function () {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
});
|
||||
setTimeout(function () {
|
||||
that.getOrderlist();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// that.$.confirm(
|
||||
// that.__("是否确认收货?"),
|
||||
// function (e) {
|
||||
// if (e.confirm) {
|
||||
// that.$.request({
|
||||
// url: that.Config.URL.user.order_receive,
|
||||
// data: params,
|
||||
// success: function (data, status, msg, code) {
|
||||
// if (status == 200) {
|
||||
// that.$.alert(that.__("收货成功!"), function () {
|
||||
// that.setData({
|
||||
// orderlist: [],
|
||||
// page: 1,
|
||||
// });
|
||||
// setTimeout(function () {
|
||||
// that.getOrderlist();
|
||||
// }, 1000);
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// true
|
||||
// );
|
||||
},
|
||||
placeAnOrder: function (obj) {
|
||||
var params = {
|
||||
@ -910,7 +998,6 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../styles/_variables";
|
||||
|
||||
|
||||
@ -1863,9 +1863,9 @@ export default {
|
||||
|
||||
.back-to-top {
|
||||
position: fixed;
|
||||
top: 75%;
|
||||
top: 80%;
|
||||
transform: translateY(-75%);
|
||||
right: 20rpx;
|
||||
right: 14rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
text-align: center;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user