commit
ed7258b577
|
|
@ -68,10 +68,7 @@
|
||||||
"schemes" : "shopro"
|
"schemes" : "shopro"
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"urlschemewhitelist": [
|
"urlschemewhitelist" : [ "baidumap", "iosamap" ],
|
||||||
"baidumap",
|
|
||||||
"iosamap"
|
|
||||||
],
|
|
||||||
"dSYMs" : false,
|
"dSYMs" : false,
|
||||||
"privacyDescription" : {
|
"privacyDescription" : {
|
||||||
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
|
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
|
||||||
|
|
@ -82,9 +79,7 @@
|
||||||
"urltypes" : "shopro",
|
"urltypes" : "shopro",
|
||||||
"capabilities" : {
|
"capabilities" : {
|
||||||
"entitlements" : {
|
"entitlements" : {
|
||||||
"com.apple.developer.associated-domains": [
|
"com.apple.developer.associated-domains" : [ "applinks:shopro.sheepjs.com" ]
|
||||||
"applinks:shopro.sheepjs.com"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"idfa" : true
|
"idfa" : true
|
||||||
|
|
@ -103,18 +98,12 @@
|
||||||
},
|
},
|
||||||
"payment" : {
|
"payment" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__": [
|
"__platform__" : [ "ios", "android" ],
|
||||||
"ios",
|
|
||||||
"android"
|
|
||||||
],
|
|
||||||
"appid" : "wxae7a0c156da9383b",
|
"appid" : "wxae7a0c156da9383b",
|
||||||
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
|
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
|
||||||
},
|
},
|
||||||
"alipay" : {
|
"alipay" : {
|
||||||
"__platform__": [
|
"__platform__" : [ "ios", "android" ]
|
||||||
"ios",
|
|
||||||
"android"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"share" : {
|
"share" : {
|
||||||
|
|
@ -124,9 +113,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"orientation": [
|
"orientation" : [ "portrait-primary" ],
|
||||||
"portrait-primary"
|
|
||||||
],
|
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"androidStyle" : "common",
|
"androidStyle" : "common",
|
||||||
"iosStyle" : "common",
|
"iosStyle" : "common",
|
||||||
|
|
@ -197,9 +184,7 @@
|
||||||
"lazyCodeLoading" : "requiredComponents",
|
"lazyCodeLoading" : "requiredComponents",
|
||||||
"usingComponents" : {},
|
"usingComponents" : {},
|
||||||
"permission" : {},
|
"permission" : {},
|
||||||
"requiredPrivateInfos": [
|
"requiredPrivateInfos" : [ "chooseAddress" ]
|
||||||
"chooseAddress"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"mp-alipay" : {
|
"mp-alipay" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true
|
||||||
|
|
@ -216,7 +201,7 @@
|
||||||
"h5" : {
|
"h5" : {
|
||||||
"template" : "index.html",
|
"template" : "index.html",
|
||||||
"router" : {
|
"router" : {
|
||||||
"mode": "hash",
|
"mode" : "history",
|
||||||
"base" : "./"
|
"base" : "./"
|
||||||
},
|
},
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
|
|
|
||||||
|
|
@ -181,11 +181,11 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- TODO 芋艿:这里暂时没接入 -->
|
<view v-if="!isEmpty(state.goodsInfo)">
|
||||||
<view v-if="state.data.goods">
|
<!-- 规格与数量弹框 -->
|
||||||
<s-select-groupon-sku
|
<s-select-groupon-sku
|
||||||
:show="state.showSelectSku"
|
:show="state.showSelectSku"
|
||||||
:goodsInfo="state.data.goods"
|
:goodsInfo="state.goodsInfo"
|
||||||
:grouponAction="state.grouponAction"
|
:grouponAction="state.grouponAction"
|
||||||
:grouponNum="state.grouponNum"
|
:grouponNum="state.grouponNum"
|
||||||
@buy="onBuy"
|
@buy="onBuy"
|
||||||
|
|
@ -193,6 +193,7 @@
|
||||||
@close="state.showSelectSku = false"
|
@close="state.showSelectSku = false"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<s-empty v-if="!state.data && !state.loading" icon="/static/goods-empty.png" />
|
<s-empty v-if="!state.data && !state.loading" icon="/static/goods-empty.png" />
|
||||||
|
|
@ -203,25 +204,28 @@
|
||||||
import { computed, reactive } from 'vue';
|
import { computed, reactive } from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { useDurationTime } from '@/sheep/hooks/useGoods';
|
import { fen2yuan, useDurationTime } from '@/sheep/hooks/useGoods';
|
||||||
import { showShareModal } from '@/sheep/hooks/useModal';
|
import { showShareModal } from '@/sheep/hooks/useModal';
|
||||||
import { isEmpty } from 'lodash-es';
|
import { isEmpty } from 'lodash-es';
|
||||||
import CombinationApi from '@/sheep/api/promotion/combination';
|
import CombinationApi from '@/sheep/api/promotion/combination';
|
||||||
|
import SpuApi from '@/sheep/api/product/spu';
|
||||||
|
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
|
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
|
||||||
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
data: {}, // 拼团详情
|
data: {}, // 拼团详情
|
||||||
loading: true,
|
goodsId: 0, // 商品ID
|
||||||
grouponAction: 'create',
|
goodsInfo: {}, // 商品信息
|
||||||
showSelectSku: false,
|
showSelectSku: false, // 显示规格弹框
|
||||||
grouponNum: 0,
|
selectedSkuPrice: {}, // 选中的规格价格
|
||||||
number: 0,
|
activity: {}, // 团购活动
|
||||||
activity: {},
|
grouponId: 0, // 团购ID
|
||||||
|
grouponNum: 0, // 团购人数
|
||||||
|
grouponAction: 'create', // 团购操作
|
||||||
combinationHeadId: null, // 拼团团长编号
|
combinationHeadId: null, // 拼团团长编号
|
||||||
|
loading: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// todo 芋艿:分享要再接下
|
|
||||||
const shareInfo = computed(() => {
|
const shareInfo = computed(() => {
|
||||||
if (isEmpty(state.data)) return {};
|
if (isEmpty(state.data)) return {};
|
||||||
return sheep.$platform.share.getShareInfo(
|
return sheep.$platform.share.getShareInfo(
|
||||||
|
|
@ -231,15 +235,14 @@
|
||||||
desc: state.data.goods?.subtitle,
|
desc: state.data.goods?.subtitle,
|
||||||
params: {
|
params: {
|
||||||
page: '5',
|
page: '5',
|
||||||
query: state.data.id,
|
query: state.data.headRecord.id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'groupon', // 邀请拼团海报
|
type: 'groupon', // 邀请拼团海报
|
||||||
title: state.data.headRecord.spuName, // 商品标题
|
title: state.data.headRecord.spuName, // 商品标题
|
||||||
image: sheep.$url.cdn(state.data.headRecord.picUrl), // 商品主图
|
image: sheep.$url.cdn(state.data.headRecord.picUrl), // 商品主图
|
||||||
price: state.data.goods?.price, // 商品价格
|
price: fen2yuan(state.data.headRecord.combinationPrice), // 商品价格
|
||||||
original_price: state.data.goods?.original_price, // 商品原价
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
@ -251,33 +254,33 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去开团 TODO 芋艿:这里没接入
|
// 去开团
|
||||||
function onCreateGroupon() {
|
function onCreateGroupon() {
|
||||||
state.grouponAction = 'create';
|
state.grouponAction = 'create';
|
||||||
state.grouponId = 0;
|
state.grouponId = 0;
|
||||||
state.showSelectSku = true;
|
state.showSelectSku = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 规格变更 TODO 芋艿:这里没接入
|
// 规格变更
|
||||||
function onSkuChange(e) {
|
function onSkuChange(e) {
|
||||||
state.selectedSkuPrice = e;
|
state.selectedSkuPrice = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 立即参团 TODO 芋艿:这里没接入
|
// 立即参团
|
||||||
function onJoinGroupon() {
|
function onJoinGroupon() {
|
||||||
state.grouponAction = 'join';
|
state.grouponAction = 'join';
|
||||||
state.grouponId = state.data.activityId;
|
state.grouponId = state.data.headRecord.activityId;
|
||||||
state.combinationHeadId = state.data.id;
|
state.combinationHeadId = state.data.headRecord.id;
|
||||||
state.grouponNum = state.data.num;
|
state.grouponNum = state.data.headRecord.userSize;
|
||||||
state.showSelectSku = true;
|
state.showSelectSku = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 立即购买 TODO 芋艿:这里没接入
|
// 立即购买
|
||||||
function onBuy(sku) {
|
function onBuy(sku) {
|
||||||
sheep.$router.go('/pages/order/confirm', {
|
sheep.$router.go('/pages/order/confirm', {
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
order_type: 'goods',
|
order_type: 'goods',
|
||||||
combinationActivityId: state.data.activity.id,
|
combinationActivityId: state.activity.id,
|
||||||
combinationHeadId: state.combinationHeadId,
|
combinationHeadId: state.combinationHeadId,
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
|
@ -306,6 +309,14 @@
|
||||||
data.headRecord.activityId,
|
data.headRecord.activityId,
|
||||||
);
|
);
|
||||||
state.activity = activity;
|
state.activity = activity;
|
||||||
|
state.grouponNum = activity.userSize;
|
||||||
|
// 加载商品信息
|
||||||
|
const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
|
||||||
|
state.goodsId = spu.id;
|
||||||
|
activity.products.forEach((product) => {
|
||||||
|
spu.price = Math.min(spu.price, product.combinationPrice); // 设置 SPU 的最低价格
|
||||||
|
});
|
||||||
|
state.goodsInfo = spu;
|
||||||
} else {
|
} else {
|
||||||
state.data = null;
|
state.data = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
css: {
|
css: {
|
||||||
// 根节点若无尺寸,自动获取父级节点
|
// 根节点若无尺寸,自动获取父级节点
|
||||||
width: sheep.$platform.device.windowWidth * 0.9,
|
width: sheep.$platform.device.windowWidth * 0.9,
|
||||||
height: 550,
|
height: 600,
|
||||||
},
|
},
|
||||||
views: [],
|
views: [],
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -82,12 +82,12 @@ const groupon = async (poster) => {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
text: '2人团',
|
text: '2人团',
|
||||||
css: {
|
css: {
|
||||||
color: '#ff0000',
|
color: '#fff',
|
||||||
fontSize: 30,
|
fontSize: 12,
|
||||||
fontFamily: 'OPPOSANS',
|
fontFamily: 'OPPOSANS',
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
left: width * 0.3,
|
left: width * 0.84,
|
||||||
top: width * 1.32,
|
top: width * 1.3,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN
|
||||||
|
|
@ -96,7 +96,7 @@ const groupon = async (poster) => {
|
||||||
text: poster.shareInfo.link,
|
text: poster.shareInfo.link,
|
||||||
css: {
|
css: {
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
left: width * 0.75,
|
left: width * 0.5,
|
||||||
top: width * 1.3,
|
top: width * 1.3,
|
||||||
width: width * 0.2,
|
width: width * 0.2,
|
||||||
height: width * 0.2,
|
height: width * 0.2,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue