Pre Merge pull request !79 from puhui999/master

pull/79/MERGE
puhui999 2024-08-14 03:51:35 +00:00 committed by Gitee
commit 9046786888
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 255 additions and 259 deletions

View File

@ -68,10 +68,7 @@
"schemes" : "shopro"
},
"ios" : {
"urlschemewhitelist": [
"baidumap",
"iosamap"
],
"urlschemewhitelist" : [ "baidumap", "iosamap" ],
"dSYMs" : false,
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目",
@ -82,9 +79,7 @@
"urltypes" : "shopro",
"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains": [
"applinks:shopro.sheepjs.com"
]
"com.apple.developer.associated-domains" : [ "applinks:shopro.sheepjs.com" ]
}
},
"idfa" : true
@ -103,18 +98,12 @@
},
"payment" : {
"weixin" : {
"__platform__": [
"ios",
"android"
],
"__platform__" : [ "ios", "android" ],
"appid" : "wxae7a0c156da9383b",
"UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
},
"alipay" : {
"__platform__": [
"ios",
"android"
]
"__platform__" : [ "ios", "android" ]
}
},
"share" : {
@ -124,9 +113,7 @@
}
}
},
"orientation": [
"portrait-primary"
],
"orientation" : [ "portrait-primary" ],
"splashscreen" : {
"androidStyle" : "common",
"iosStyle" : "common",
@ -197,9 +184,7 @@
"lazyCodeLoading" : "requiredComponents",
"usingComponents" : {},
"permission" : {},
"requiredPrivateInfos": [
"chooseAddress"
]
"requiredPrivateInfos" : [ "chooseAddress" ]
},
"mp-alipay" : {
"usingComponents" : true
@ -216,7 +201,7 @@
"h5" : {
"template" : "index.html",
"router" : {
"mode": "hash",
"mode" : "history",
"base" : "./"
},
"sdkConfigs" : {

View File

@ -181,11 +181,11 @@
</view>
</view>
<!-- TODO 芋艿这里暂时没接入 -->
<view v-if="state.data.goods">
<view v-if="!isEmpty(state.goodsInfo)">
<!-- 规格与数量弹框 -->
<s-select-groupon-sku
:show="state.showSelectSku"
:goodsInfo="state.data.goods"
:goodsInfo="state.goodsInfo"
:grouponAction="state.grouponAction"
:grouponNum="state.grouponNum"
@buy="onBuy"
@ -193,6 +193,7 @@
@close="state.showSelectSku = false"
/>
</view>
</view>
<s-empty v-if="!state.data && !state.loading" icon="/static/goods-empty.png" />
@ -203,25 +204,28 @@
import { computed, reactive } from 'vue';
import sheep from '@/sheep';
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 { isEmpty } from 'lodash-es';
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 statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
const state = reactive({
data: {}, //
loading: true,
grouponAction: 'create',
showSelectSku: false,
grouponNum: 0,
number: 0,
activity: {},
goodsId: 0, // ID
goodsInfo: {}, //
showSelectSku: false, //
selectedSkuPrice: {}, //
activity: {}, //
grouponId: 0, // ID
grouponNum: 0, //
grouponAction: 'create', //
combinationHeadId: null, //
loading: true,
});
// todo
const shareInfo = computed(() => {
if (isEmpty(state.data)) return {};
return sheep.$platform.share.getShareInfo(
@ -231,15 +235,14 @@
desc: state.data.goods?.subtitle,
params: {
page: '5',
query: state.data.id,
query: state.data.headRecord.id,
},
},
{
type: 'groupon', //
title: state.data.headRecord.spuName, //
image: sheep.$url.cdn(state.data.headRecord.picUrl), //
price: state.data.goods?.price, //
original_price: state.data.goods?.original_price, //
price: fen2yuan(state.data.headRecord.combinationPrice), //
},
);
});
@ -251,33 +254,33 @@
});
}
// TODO
//
function onCreateGroupon() {
state.grouponAction = 'create';
state.grouponId = 0;
state.showSelectSku = true;
}
// TODO
//
function onSkuChange(e) {
state.selectedSkuPrice = e;
}
// TODO
//
function onJoinGroupon() {
state.grouponAction = 'join';
state.grouponId = state.data.activityId;
state.combinationHeadId = state.data.id;
state.grouponNum = state.data.num;
state.grouponId = state.data.headRecord.activityId;
state.combinationHeadId = state.data.headRecord.id;
state.grouponNum = state.data.headRecord.userSize;
state.showSelectSku = true;
}
// TODO
//
function onBuy(sku) {
sheep.$router.go('/pages/order/confirm', {
data: JSON.stringify({
order_type: 'goods',
combinationActivityId: state.data.activity.id,
combinationActivityId: state.activity.id,
combinationHeadId: state.combinationHeadId,
items: [
{
@ -306,6 +309,14 @@
data.headRecord.activityId,
);
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 {
state.data = null;
}

View File

@ -66,7 +66,7 @@
css: {
//
width: sheep.$platform.device.windowWidth * 0.9,
height: 550,
height: 600,
},
views: [],
});

View File

@ -82,12 +82,12 @@ const groupon = async (poster) => {
type: 'text',
text: '2人团',
css: {
color: '#ff0000',
fontSize: 30,
color: '#fff',
fontSize: 12,
fontFamily: 'OPPOSANS',
position: 'fixed',
left: width * 0.3,
top: width * 1.32,
left: width * 0.84,
top: width * 1.3,
},
},
// #ifndef MP-WEIXIN
@ -96,7 +96,7 @@ const groupon = async (poster) => {
text: poster.shareInfo.link,
css: {
position: 'fixed',
left: width * 0.75,
left: width * 0.5,
top: width * 1.3,
width: width * 0.2,
height: width * 0.2,