Commit 7e6ee66d authored by beisir's avatar beisir

feat:更改打开小程序方式

parent fdde41eb
......@@ -60,5 +60,13 @@ export default {
},
getGroupShareInfo(orderNo) {
return http.get(`${talosHost}/api/kdsp/groupShareInfo?orderNo=${orderNo}`);
},
getPlayBillUrl(m) {
return http.get(`http://192.168.25.122/api/kdsp/playBill/getPlayBillUrl?m=${m}`);
},
makePlayBillPicUrl(activityInfoId) {
return http.get(
`http://192.168.25.122/api/kdsp/activity/activity-info/makePlayBillPicUrl?activityInfoId=${activityInfoId}`
);
}
};
......@@ -4,6 +4,7 @@ const jsBridge = new Bridge();
import Vue from 'vue';
import config from '@/config';
export const EventBus = new Vue();
import qs from 'qs';
/**
* 替换邮箱字符
* @param {String} email 输入字符串
......@@ -366,15 +367,15 @@ export function setAppTitleColor(bgcolor = '#fff') {
}
export function paramsParentheses(pointer) {
const params = pointer.$route.query;
let params = pointer.$route.query;
const path = pointer.$route.path;
let tempString = '';
for (let key in params) {
let option = `${key}=${params[key]}`;
tempString += `$${option}`;
}
if (tempString.length) {
tempString = `${config.localHost}${path}!` + tempString.slice(1);
}
return tempString;
const paramsString = qs.stringify(params);
// for (let key in params) {
// let option = `${key}=${params[key]}`;
// tempString += `$${option}`;
// }
// if (tempString.length) {
// tempString = `${config.localHost}${path}!` + tempString.slice(1);
// }
return `${config.localHost}${path}?` + paramsString;
}
......@@ -104,10 +104,10 @@ const mutations = {
// todo 跳转到小程序
let getScheme = async function() {
const [res] = await groupBuy.getScheme({
miniUrl: 'pages/groupbuy/webview',
// miniUrl: 'pages/product/goodDetail',
// miniUrl: 'pages/groupbuy/webview',
miniUrl: 'pages/product/goodDetail',
params: `from=groupBuy&url=${encodeURIComponent(
JSON.stringify(paramsParentheses(pointer))
JSON.stringify(paramsParentheses(pointer) + '&vccToken={token}')
)}`
});
const url = res;
......
......@@ -164,7 +164,9 @@ export default {
else if (isWxMp) this.nativeBridge = new MpBridge();
},
methods: {
finishTimeChange() {},
finishTimeChange() {
this.$emit('finish-time');
},
goGroupBuyList(itemInfo) {
this.$router.replace({
path: '/groupBuy/list',
......
......@@ -15,6 +15,7 @@
:finished="item.finished"
@load="handleLoad"
@option-click="handleOptionClick"
@finish-time="finishTimeChange"
/>
</cr-tab>
</cr-tabs>
......@@ -68,6 +69,11 @@ export default {
this.getList();
},
methods: {
finishTimeChange() {
// 倒计时结束之后刷新
window.location.reload();
// this.getList();
},
getstatusQuery() {
const { status } = this.$route.params || {};
status && (this.currentTab = Number(status));
......
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