diff --git a/manifest.json b/manifest.json index 2dfab7c7..7e3aa40f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,239 +1,224 @@ { - "name": "芋道商城", - "appid": "__UNI__460BC4C", - "description": "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。", - "versionName": "2.1.0", - "versionCode": 183, - "transformPx": false, - "app-plus": { - "usingComponents": true, - "nvueCompiler": "uni-app", - "nvueStyleCompiler": "uni-app", - "compilerVersion": 3, - "nvueLaunchMode": "fast", - "splashscreen": { - "alwaysShowBeforeRender": true, - "waiting": true, - "autoclose": true, - "delay": 0 - }, - "safearea": { - "bottom": { - "offset": "none" - } - }, - "modules": { - "Payment": {}, - "Share": {}, - "VideoPlayer": {}, - "OAuth": {} - }, - "distribute": { - "android": { - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "minSdkVersion": 21, - "schemes": "shopro" - }, - "ios": { - "urlschemewhitelist": [ - "baidumap", - "iosamap" - ], - "dSYMs": false, - "privacyDescription": { - "NSPhotoLibraryUsageDescription": "需要同意访问您的相册选取图片才能完善该条目", - "NSPhotoLibraryAddUsageDescription": "需要同意访问您的相册才能保存该图片", - "NSCameraUsageDescription": "需要同意访问您的摄像头拍摄照片才能完善该条目", - "NSUserTrackingUsageDescription": "开启追踪并不会获取您在其它站点的隐私信息,该行为仅用于标识设备,保障服务安全和提升浏览体验" + "name" : "芋道商城", + "appid" : "__UNI__460BC4C", + "description" : "基于 uni-app + Vue3 技术驱动的在线商城系统,内含诸多功能与丰富的活动,期待您的使用和反馈。", + "versionName" : "2.1.0", + "versionCode" : 183, + "transformPx" : false, + "app-plus" : { + "usingComponents" : true, + "nvueCompiler" : "uni-app", + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "nvueLaunchMode" : "fast", + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 }, - "urltypes": "shopro", - "capabilities": { - "entitlements": { - "com.apple.developer.associated-domains": [ - "applinks:shopro.sheepjs.com" - ] - } + "safearea" : { + "bottom" : { + "offset" : "none" + } }, - "idfa": true - }, - "sdkConfigs": { - "speech": { - "ifly": {} + "modules" : { + "Payment" : {}, + "Share" : {}, + "VideoPlayer" : {}, + "OAuth" : {} }, - "ad": {}, - "oauth": { - "apple": {}, - "weixin": { - "appid": "wxae7a0c156da9383b", - "UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/" - } - }, - "payment": { - "weixin": { - "__platform__": [ - "ios", - "android" - ], - "appid": "wxae7a0c156da9383b", - "UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/" - }, - "alipay": { - "__platform__": [ - "ios", - "android" - ] - } - }, - "share": { - "weixin": { - "appid": "wxae7a0c156da9383b", - "UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/" - } + "distribute" : { + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "minSdkVersion" : 21, + "schemes" : "shopro" + }, + "ios" : { + "urlschemewhitelist" : [ "baidumap", "iosamap" ], + "dSYMs" : false, + "privacyDescription" : { + "NSPhotoLibraryUsageDescription" : "需要同意访问您的相册选取图片才能完善该条目", + "NSPhotoLibraryAddUsageDescription" : "需要同意访问您的相册才能保存该图片", + "NSCameraUsageDescription" : "需要同意访问您的摄像头拍摄照片才能完善该条目", + "NSUserTrackingUsageDescription" : "开启追踪并不会获取您在其它站点的隐私信息,该行为仅用于标识设备,保障服务安全和提升浏览体验" + }, + "urltypes" : "shopro", + "capabilities" : { + "entitlements" : { + "com.apple.developer.associated-domains" : [ "applinks:shopro.sheepjs.com" ] + } + }, + "idfa" : true + }, + "sdkConfigs" : { + "speech" : { + "ifly" : {} + }, + "ad" : {}, + "oauth" : { + "apple" : {}, + "weixin" : { + "appid" : "wxae7a0c156da9383b", + "UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/" + } + }, + "payment" : { + "weixin" : { + "__platform__" : [ "ios", "android" ], + "appid" : "wxae7a0c156da9383b", + "UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/" + }, + "alipay" : { + "__platform__" : [ "ios", "android" ] + } + }, + "share" : { + "weixin" : { + "appid" : "wxae7a0c156da9383b", + "UniversalLinks" : "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/" + } + } + }, + "orientation" : [ "portrait-primary" ], + "splashscreen" : { + "androidStyle" : "common", + "iosStyle" : "common", + "useOriginalMsgbox" : true + }, + "icons" : { + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png" + }, + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png" + } + } + } } - }, - "orientation": [ - "portrait-primary" - ], - "splashscreen": { - "androidStyle": "common", - "iosStyle": "common", - "useOriginalMsgbox": true - }, - "icons": { - "android": { - "hdpi": "unpackage/res/icons/72x72.png", - "xhdpi": "unpackage/res/icons/96x96.png", - "xxhdpi": "unpackage/res/icons/144x144.png", - "xxxhdpi": "unpackage/res/icons/192x192.png" + }, + "quickapp" : {}, + "quickapp-native" : { + "icon" : "/static/logo.png", + "package" : "com.example.demo", + "features" : [ + { + "name" : "system.clipboard" + } + ] + }, + "quickapp-webview" : { + "icon" : "/static/logo.png", + "package" : "com.example.demo", + "minPlatformVersion" : 1070, + "versionName" : "1.0.0", + "versionCode" : 100 + }, + "mp-weixin" : { + "appid" : "wx66186af0759f47c9", + "setting" : { + "urlCheck" : false, + "minified" : true, + "postcss" : true }, - "ios": { - "appstore": "unpackage/res/icons/1024x1024.png", - "ipad": { - "app": "unpackage/res/icons/76x76.png", - "app@2x": "unpackage/res/icons/152x152.png", - "notification": "unpackage/res/icons/20x20.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "proapp@2x": "unpackage/res/icons/167x167.png", - "settings": "unpackage/res/icons/29x29.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "spotlight": "unpackage/res/icons/40x40.png", - "spotlight@2x": "unpackage/res/icons/80x80.png" - }, - "iphone": { - "app@2x": "unpackage/res/icons/120x120.png", - "app@3x": "unpackage/res/icons/180x180.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "notification@3x": "unpackage/res/icons/60x60.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "settings@3x": "unpackage/res/icons/87x87.png", - "spotlight@2x": "unpackage/res/icons/80x80.png", - "spotlight@3x": "unpackage/res/icons/120x120.png" - } + "optimization" : { + "subPackages" : true + }, + "plugins" : {}, + "lazyCodeLoading" : "requiredComponents", + "usingComponents" : {}, + "permission" : {}, + "requiredPrivateInfos" : [ "chooseAddress" ] + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "mp-jd" : { + "usingComponents" : true + }, + "h5" : { + "template" : "index.html", + "router" : { + "mode" : "history", + "base" : "./" + }, + "sdkConfigs" : { + "maps" : {} + }, + "async" : { + "timeout" : 20000 + }, + "title" : "芋道商城", + "optimization" : { + "treeShaking" : { + "enable" : true + } } - } - } - }, - "quickapp": {}, - "quickapp-native": { - "icon": "/static/logo.png", - "package": "com.example.demo", - "features": [ - { - "name": "system.clipboard" - } - ] - }, - "quickapp-webview": { - "icon": "/static/logo.png", - "package": "com.example.demo", - "minPlatformVersion": 1070, - "versionName": "1.0.0", - "versionCode": 100 - }, - "mp-weixin": { - "appid": "wx66186af0759f47c9", - "setting": { - "urlCheck": false, - "minified": true, - "postcss": true }, - "optimization": { - "subPackages": true - }, - "plugins": {}, - "lazyCodeLoading": "requiredComponents", - "usingComponents": {}, - "permission": {}, - "requiredPrivateInfos": [ - "chooseAddress" - ] - }, - "mp-alipay": { - "usingComponents": true - }, - "mp-baidu": { - "usingComponents": true - }, - "mp-toutiao": { - "usingComponents": true - }, - "mp-jd": { - "usingComponents": true - }, - "h5": { - "template": "index.html", - "router": { - "mode": "hash", - "base": "./" - }, - "sdkConfigs": { - "maps": {} - }, - "async": { - "timeout": 20000 - }, - "title": "芋道商城", - "optimization": { - "treeShaking": { - "enable": true - } - } - }, - "vueVersion": "3", - "_spaceID": "192b4892-5452-4e1d-9f09-eee1ece40639", - "locale": "zh-Hans", - "fallbackLocale": "zh-Hans" -} \ No newline at end of file + "vueVersion" : "3", + "_spaceID" : "192b4892-5452-4e1d-9f09-eee1ece40639", + "locale" : "zh-Hans", + "fallbackLocale" : "zh-Hans" +} diff --git a/pages/activity/groupon/detail.vue b/pages/activity/groupon/detail.vue index 86daff20..66976f3c 100644 --- a/pages/activity/groupon/detail.vue +++ b/pages/activity/groupon/detail.vue @@ -181,11 +181,11 @@ - - + + + @@ -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; } diff --git a/sheep/components/s-share-modal/canvas-poster/index.vue b/sheep/components/s-share-modal/canvas-poster/index.vue index 87ee562a..9e67943b 100644 --- a/sheep/components/s-share-modal/canvas-poster/index.vue +++ b/sheep/components/s-share-modal/canvas-poster/index.vue @@ -66,7 +66,7 @@ css: { // 根节点若无尺寸,自动获取父级节点 width: sheep.$platform.device.windowWidth * 0.9, - height: 550, + height: 600, }, views: [], }); diff --git a/sheep/components/s-share-modal/canvas-poster/poster/groupon.js b/sheep/components/s-share-modal/canvas-poster/poster/groupon.js index d1b6b78a..4b33c8ca 100644 --- a/sheep/components/s-share-modal/canvas-poster/poster/groupon.js +++ b/sheep/components/s-share-modal/canvas-poster/poster/groupon.js @@ -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,