Commit 65cd52fb authored by beisir's avatar beisir

feat:upload

parent 24f34329
......@@ -18,7 +18,7 @@
/>
</cr-tab>
</cr-tabs>
<share-pic ref="sharePic" :share-pic-data="sharePicData" @outputPicUrl="outputPicUrl" />
<!-- <cr-action-sheet
v-model="showExpressPopup"
title="请选择物流单号"
......@@ -35,7 +35,9 @@ import List from './components/List';
import { isApp } from '@/service/validation.service';
import localStorage from '@/service/localStorage.service';
import { EventBus } from '@/service/utils.service';
import sharePic from '@/components/sharePic';
import qs from 'qs';
import MpBridge from '@/service/mp';
const commonParams = {
loading: false,
finished: false,
......@@ -46,11 +48,14 @@ const commonParams = {
export default {
name: 'OrderList',
components: {
List
List,
sharePic
},
data() {
return {
isApp,
nativeBridge: null,
sharePicData: {},
showCancelPopup: false,
showExpressPopup: false,
currentTab: 0,
......@@ -82,7 +87,15 @@ export default {
this.getList();
this.onShareEventChange();
},
created() {
this.nativeBridge = new MpBridge();
},
methods: {
outputPicUrl(posterUrl) {
this.nativeBridge.openNewUrl({
newUrl: `/pages/goodshare/index?url=${encodeURIComponent(JSON.stringify(posterUrl))}`
});
},
async getShareData(shareInfo) {
const linkPath = qs.stringify({
h: 0,
......@@ -103,17 +116,11 @@ export default {
},
onShareEventChange() {
const vm = this;
console.log('update');
EventBus.$on('shareClickItem', async function({ ev, nativeBridge }) {
const [res] = await groupBuyApi.getGroupShareInfo('1440884214932389888');
const shareDic = await vm.getShareData(res);
const shareDic = await vm.getShareData(vm.sharePicData);
if (ev === 'pic') {
vm.$refs.sharePic.createAndUploadPic();
// 分享海报跳转小程序海报分享页面
// nativeBridge.openNewUrl({
// newUrl: `/pages/goodshare/index?url=${encodeURIComponent(
// JSON.stringify(shareDic.posterUrl)
// )}`
// });
}
if (ev === 'weixin') {
// const res = await groupBuyApi.getGroupShareInfo(this.shareInfo.order);
......@@ -139,8 +146,14 @@ export default {
handleLoad() {
this.getList();
},
openShareEvent() {
this.$store.dispatch('goods_share_open');
async openShareEvent() {
try {
const [res] = await groupBuyApi.getGroupShareInfo('1440884214932389888');
this.sharePicData = res;
this.$store.dispatch('goods_share_open');
} catch (err) {
console.log(err);
}
},
handleOptionClick(info) {
this.currentOrder = info;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment