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(); });