From c34e10cdc5d9e4e228c4cff17b48423b1cde6145 Mon Sep 17 00:00:00 2001 From: kele <1184860403@qq.com> Date: Fri, 10 Mar 2023 16:32:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9B=BE=E7=89=87=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=8C=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=A0=E8=BE=93=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?h5=E3=80=81app=E8=B7=B3=E8=BD=AC=E7=9B=B4=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/dispatch/content.vue | 7 ++----- pages/pay/index.vue | 10 +++------- sheep/api/app.js | 5 +++++ sheep/api/order.js | 5 ++--- .../components/s-goods-item/s-goods-item.vue | 2 +- .../components/s-live-block/s-live-block.vue | 20 +++++++++++++++++-- sheep/platform/pay.js | 4 ++-- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/pages/order/dispatch/content.vue b/pages/order/dispatch/content.vue index 972d4d19..5095c6c0 100644 --- a/pages/order/dispatch/content.vue +++ b/pages/order/dispatch/content.vue @@ -36,15 +36,12 @@ data: [], }); async function getDetail(id, item_id) { - const { error, data } = await sheep.$api.order.itemDetail({ - id: id, - item_id: item_id, - }); + const { error, data } = await sheep.$api.order.itemDetail(id,item_id); if (error === 0) { state.data = data; } } - onLoad(async (options) => { + onLoad((options) => { getDetail(options.id, options.item_id); }); diff --git a/pages/pay/index.vue b/pages/pay/index.vue index f44d3db6..84ad5fda 100644 --- a/pages/pay/index.vue +++ b/pages/pay/index.vue @@ -13,11 +13,7 @@ 选择支付方式 - + + request({ + url: 'app/mplive/getMpLink', + method: 'GET' + }), }, //上传 diff --git a/sheep/api/order.js b/sheep/api/order.js index 0f91c205..87bc4219 100644 --- a/sheep/api/order.js +++ b/sheep/api/order.js @@ -22,11 +22,10 @@ export default { showLoading: false, }, }), - itemDetail: (params) => + itemDetail: (id,itemId) => request({ - url: 'order/order/itemDetail', + url: 'order/order/itemDetail/'+ id + '/' + itemId, method: 'GET', - params, custom: { showLoading: false, }, diff --git a/sheep/components/s-goods-item/s-goods-item.vue b/sheep/components/s-goods-item/s-goods-item.vue index 35a2062c..d599f28e 100644 --- a/sheep/components/s-goods-item/s-goods-item.vue +++ b/sheep/components/s-goods-item/s-goods-item.vue @@ -73,7 +73,7 @@ }, title: { type: String, - default: '这是商品标题这是商品标题这是商品标题这是商品标题这是商品标题', + default: '', }, titleWidth: { type: Number, diff --git a/sheep/components/s-live-block/s-live-block.vue b/sheep/components/s-live-block/s-live-block.vue index d3b6fb3d..b7fcc92d 100644 --- a/sheep/components/s-live-block/s-live-block.vue +++ b/sheep/components/s-live-block/s-live-block.vue @@ -58,6 +58,7 @@ const state = reactive({ liveList: [], + mpLink: '', }); const props = defineProps({ data: { @@ -73,21 +74,36 @@ const { marginLeft, marginRight } = props.styles ?? {}; async function getLiveListByIds(ids) { - let { data } = await sheep.$api.app.mplive.getRoomList(ids); + const { data } = await sheep.$api.app.mplive.getRoomList(ids); return data; } function goRoom(id) { // wx.navigateTo({ // url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}&custom_params=${customParams}`, // }); + // #ifdef H5 + window.location = state.mpLink; + // #endif + // #ifdef APP-PLUS + plus.runtime.openURL(state.mpLink); + // #endif + // #ifdef MP-WEIXIN wx.navigateTo({ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${id}`, }); + // #endif + } + + async function getMpLink() { + const { error, data } = await sheep.$api.app.mplive.getMpLink(); + if (error === 0) { + state.mpLink = data; + } } onMounted(async () => { state.liveList = await getLiveListByIds(mpliveIds); - console.log(state.liveList, 'state.liveList'); + getMpLink(); });