Commit 760d2df7 authored by beisir's avatar beisir

feat:update config

parent 099dfc16
......@@ -64,6 +64,7 @@ export default {
});
},
shareDialogConfirm() {
this.$store.dispatch('goods_share_close');
this.$dialog({
message: '请点击小程序右上角更多进行分享~',
showCancelButton: false,
......
......@@ -10,6 +10,7 @@ const shenceHost = 'https://bn.xyqb.com/sa?project=default'; // 测试地址
const talosHost = 'https://talos-vcc3.liangkebang.net';
const faceHost = 'https://auth-vcc3.liangkebang.net';
const kdspHost = 'https://kdsp-api-vcc3.liangkebang.net';
const localHost = 'https://group-buy-vcc3.liangkebang.net'; // 测试环境页面地址
// const talosHost = 'http://192.168.29.89:8098'; // 唐峰
// const talosHost = 'http://192.168.25.210:8080'; // 张超
// const talosHost = 'http://192.168.28.83:80'; // 董彪
......@@ -21,6 +22,7 @@ const TERMINAL = 'H5';
const VERSION = '7.9.00';
// const talosHost = protocol + '//talos.xyqb.com';
export default {
localHost,
faceHost,
talosHost,
test: true,
......
......@@ -8,8 +8,9 @@ const TERMINAL = 'H5';
const VERSION = '7.9.00';
const kdspHost = 'https://kdsp-api.q-gp.com';
const opapiHost = `${protocol}//opapi.xyqb.com`;
const localHost = 'https://mall.q-gp.com/group-buying'; // 正式环境页面地址
export default {
localHost,
// apiHost,
faceHost,
test: false,
......
......@@ -88,8 +88,9 @@ export default {
handleProgressByStatus(item) {
if (!item) return 0;
let percentage = 0;
const { goodsCount, activitySkuTotalCount } = item;
percentage = (goodsCount / activitySkuTotalCount) * 100;
// saleCount / activitySkuTotalCount
const { saleCount, activitySkuTotalCount } = item;
percentage = (saleCount / activitySkuTotalCount) * 100;
percentage = percentage < 0 ? 0 : percentage;
percentage = this.btnByStatus.d ? 0 : percentage;
return Math.round(percentage * 100) / 100;
......
......@@ -84,7 +84,8 @@ import localStorage from '@/service/localStorage.service';
import goodsCheckMixin from '@/mixins/goodsCheck.mixin';
import { setAppTitleColor, EventBus } from '@/service/utils.service';
import { registeredEvents } from '@/service/sa.service';
console.log(EventBus);
import config from '@/config';
console.log(config.localHost);
export default {
// eslint-disable-next-line vue/name-property-casing
name: 'groupBuyList',
......@@ -151,7 +152,7 @@ export default {
deactivated() {
clearTimeout((this.$refs.swipeRota && this.$refs.swipeRota.timer) || null);
this.showLoops = false;
// EventBus.$off();
EventBus.$off('shareClickItem');
},
activated() {
this.showLoops = true;
......@@ -188,8 +189,9 @@ export default {
});
},
onShareEventChange() {
const vm = this;
EventBus.$on('shareClickItem', async function({ ev, nativeBridge }) {
let shareDic = await this.getShareData();
let shareDic = await vm.getShareData();
if (ev === 'pic') {
// 分享海报跳转小程序海报分享页面
nativeBridge.openNewUrl({
......@@ -199,6 +201,7 @@ export default {
});
}
if (ev === 'weixin') {
console.log(shareDic);
// 分享朋友派发微信postMessage事件
nativeBridge.run({
event: 'showShareView',
......@@ -212,11 +215,11 @@ export default {
async getShareData() {
const { sharePosterTemplateUrl, shareTitle, shareSubTitle, shareIconUrl } = this.goodsTemp;
const link = window.location.href;
const link = `${config.localHost}/groupBuy/list?activityId=${this.activityId}`;
return Promise.resolve({
title: shareTitle,
desc: shareSubTitle,
link: `pages/webview/webview?url=${link}/`, // 页面地址
link: `pages/webview/webview?url=${encodeURIComponent(JSON.stringify(link))}`, // 页面地址
imgUrl: shareIconUrl, // 图片地
posterUrl: sharePosterTemplateUrl
});
......@@ -297,8 +300,8 @@ async function getActivityList(urlQuery, next) {
if (result?.templateInfo) {
let t = result.templateInfo;
// 即将开始
t.startTime = '2021-09-23 20:00:00';
t.endTime = '2021-09-23 20:02:00';
// t.startTime = '2021-09-23 20:00:00';
// t.endTime = '2021-09-23 20:02:00';
// 正在活动中
// t.startTime = '2021-09-23 00:00:00';
// t.endTime = '2021-09-25 00:00:00';
......
......@@ -87,6 +87,9 @@ export default {
this.getList();
this.onShareEventChange();
},
beforeDestroy() {
EventBus.$off('shareClickItem');
},
created() {
this.nativeBridge = new MpBridge();
},
......@@ -106,11 +109,10 @@ export default {
templateId: shareInfo.templateId,
templateDetailId: shareInfo.templateId
});
const detailUrl = `${window.location.origin}/groupBuy/skuInfoSmallPic?${linkPath}`;
return Promise.resolve({
title: shareInfo.skuName,
link: `pages/webview/webview?url=${window.location.origin}/${encodeURIComponent(
JSON.stringify(linkPath)
)}`, // 页面地址
link: `pages/webview/webview?url=${encodeURIComponent(JSON.stringify(detailUrl))}`, // 页面地址
imgUrl: shareInfo.skuImg // 图片地
});
},
......@@ -118,6 +120,7 @@ export default {
const vm = this;
EventBus.$on('shareClickItem', async function({ ev, nativeBridge }) {
const shareDic = await vm.getShareData(vm.sharePicData);
console.log(shareDic);
if (ev === 'pic') {
vm.$refs.sharePic.createAndUploadPic();
// 分享海报跳转小程序海报分享页面
......@@ -149,6 +152,7 @@ export default {
async openShareEvent() {
try {
const [res] = await groupBuyApi.getGroupShareInfo('1440884214932389888');
console.log(res);
this.sharePicData = res;
this.$store.dispatch('goods_share_open');
} catch (err) {
......@@ -156,6 +160,7 @@ export default {
}
},
handleOptionClick(info) {
console.log(info);
this.currentOrder = info;
switch (info.eventType) {
case 'share':
......
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