update: 动态计算公众号组件位置,接入确认收货组件但是无法拉起微信收货面板

This commit is contained in:
mixtan 2025-09-13 20:00:11 +08:00
parent 65c5ada66f
commit f37335925b
3 changed files with 126 additions and 35 deletions

View File

@ -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;

View File

@ -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";
@ -1255,4 +1342,4 @@ export default {
}
}
}
</style>
</style>

View File

@ -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;