Feat:香小智对接

This commit is contained in:
lifizer
2023-10-10 23:15:58 +08:00
parent 2d73c2fe46
commit 450da2c79a
10 changed files with 208 additions and 32 deletions
+63 -14
View File
@@ -1,6 +1,7 @@
<script setup>
<script>
import {getSeason, getSeasonPoster} from "@/api/product";
import cookie from "@/utils/store/cookie";
import {getUrlParam} from "@/utils/common.js";
export default {
data() {
@@ -48,6 +49,42 @@ export default {
this.current++;
},
saveImg() {
let that = this;
uni.getSetting({
success: getRes => {
if (getRes.authSetting["scope.writePhotosAlbum"]) {
that.downloadImage();
} else {
uni.authorize({
scope: "scope.writePhotosAlbum",
success: () => {
that.downloadImage();
},
fail: () => {
console.log("authorize fail")
uni.openSetting({
success: openRes => {
console.log(typeof openRes, openRes)
},
fail: () => {
uni.showToast({
title: "请在设置中打开对应权限",
icon: "none"
})
}
})
}
})
}
},
fail: (err) => {
console.log(err, 2)
}
})
},
downloadImage() {
let that = this;
const randomID = () => Math.random().toString(36).substring(2);
@@ -108,8 +145,8 @@ export default {
</view>
</u-popup>
<view class="scroll-item section">
<u-swiper :autoplay="false" :current="current" :list="info.swiper" height="100vh" indicator
<view class="scroll-item">
<u-swiper :autoplay="false" :current="current" :list="info.swiper" height="1200rpx" radius="0" indicator
imgMode="scaleToFill"></u-swiper>
<image class="icon-direction icon-left" :src="webUrl+'/20230911105736198247.png'" mode="scaleToFill"
@click="tapLeft"/>
@@ -118,8 +155,10 @@ export default {
</view>
<view class="scroll-item">
<scroll-view scroll-y class="product-list" :style="{backgroundImage:'url(' + info.productImage + ')'}">
<image class="item" :src="item.image" mode="scaleToFill" @click="$global.navToGoods(item.id)"
<image class="bg-img" :src="info.productImage" mode="widthFix"/>
<!-- <scroll-view scroll-y class="product-list" :style="{backgroundImage:'url(' + info.productImage + ')'}">-->
<scroll-view scroll-y class="product-list">
<image class="item" :src="item.image" mode="widthFix" @click="$global.navToGoods(item.id)"
v-for="(item,index) in info.products" :key="index"/>
</scroll-view>
</view>
@@ -143,11 +182,6 @@ export default {
box-sizing: border-box;
}
.section {
width: 100vw;
height: 100vh;
}
.img-top {
width: 100vw;
}
@@ -171,6 +205,17 @@ export default {
}
}
.box-share{
.box-img{
width: 500rpx;
height: 889.5rpx;
}
.main-img{
width: 500rpx;
height: 889.5rpx;
}
}
.icon-direction {
position: absolute;
top: 50%;
@@ -187,15 +232,19 @@ export default {
}
.product-list {
padding: 200rpx 32rpx 0;
background-size: 100vw auto;
position: absolute;
top: 0;
left: 0;
padding: 280rpx 32rpx 0;
.item {
width: 686rpx;
height: 400rpx;
margin-bottom: 46rpx;
border-radius: 20rpx;
}
}
.bg-img {
width: 100vw;
}
}
</style>
+7 -6
View File
@@ -36,7 +36,7 @@ export default {
<text class="type-name" :class="{'choose-name':typeIndex===index}">{{ item.name }}</text>
</u-grid-item>
<u-grid-item>
<image class="icon-logo" :src="webUrl+'/20230913155700903114.png'" mode="scaleToFill"/>
<image class="icon-logo" :src="webUrl+'/20231010130532811085.png'" mode="scaleToFill"/>
<text class="type-name">全部</text>
</u-grid-item>
</u-grid>
@@ -77,11 +77,11 @@ export default {
}
.type-box {
padding: 32rpx 62rpx 0;
padding: 32rpx 32rpx 0;
.icon-logo {
width: 80rpx;
height: 80rpx;
width: 120rpx;
height: 120rpx;
}
.type-name {
@@ -90,8 +90,8 @@ export default {
}
.choose-icon {
width: 90rpx;
height: 90rpx;
width: 160rpx;
height: 160rpx;
}
.choose-name {
@@ -166,6 +166,7 @@ export default {
.more-t {
width: 100%;
margin-top: 10rpx;
color: #FFFFFF;
font-size: 26rpx;
line-height: 38rpx;
text-align: left;