feat: 启动页

This commit is contained in:
2025-12-17 16:22:19 +08:00
parent 97f2bfe14b
commit 761f273a5d
8 changed files with 1647 additions and 1413 deletions
+5
View File
@@ -10,6 +10,11 @@
{ {
"playground" : "standard", "playground" : "standard",
"type" : "uni-app:app-ios" "type" : "uni-app:app-ios"
},
{
"customPlaygroundType" : "device",
"playground" : "standard",
"type" : "uni-app:app-ios_simulator"
} }
] ]
} }
+247 -198
View File
@@ -1,207 +1,256 @@
<script> <script>
export default { export default {
onLaunch: function() { globalData: {
console.log('App Launch') launchShown: false, // 内存标记,杀进程就清空
const res = uni.getSystemInfoSync(); },
uni.setStorageSync('platform', res.platform);
// #ifdef APP-PLUS          onLaunch: function () {
// 获取应用版本信息 console.log("App Launch");
plus.runtime.getProperty(plus.runtime.appid, function(inf) { const res = uni.getSystemInfoSync();
console.log("版本信息",inf.versionCode) uni.setStorageSync("platform", res.platform);
uni.setStorageSync('version-1', inf.version); // 大版本号 // #ifdef APP-PLUS
uni.setStorageSync('versionCode', inf.versionCode); // 小版本号 plus.navigator.closeSplashscreen(); // 立即关闭原生闪屏
});
let uuid = plus.device.uuid; // 获取应用版本信息
// #endif plus.runtime.getProperty(plus.runtime.appid, function (inf) {
}, console.log("版本信息", inf.versionCode);
onShow: function() { uni.setStorageSync("version-1", inf.version); // 大版本号
console.log('App Show') uni.setStorageSync("versionCode", inf.versionCode); // 小版本号
// 隐藏原生tabbar });
/*#ifdef APP-PLUS*/ let uuid = plus.device.uuid;
uni.hideTabBar({ // #endif
animation: false },
}) onShow: function () {
/*#endif*/ console.log("App Show");
}, // 隐藏原生tabbar
onHide: function() { /*#ifdef APP-PLUS*/
console.log('App Hide') uni.hideTabBar({
} animation: false,
} });
/*#endif*/
},
onHide: function () {
console.log("App Hide");
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
@import "@/uni_modules/uview-plus/index.scss"; @import "@/uni_modules/uview-plus/index.scss";
@import '@/uni.scss'; @import "@/uni.scss";
@import '@/common.scss'; @import "@/common.scss";
.container {
padding: 15px;
}
.container {
padding: 15px;
}
.content { .content {
display: flex; display: flex;
min-width: 750rpx; min-width: 750rpx;
max-width: 750rpx; max-width: 750rpx;
height: 100vh; height: 100vh;
padding: 0; padding: 0;
margin: 0; margin: 0;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background-color: $app-bj; background-color: $app-bj;
}
.content-one {
display: flex;
min-width: 750rpx;
max-width: 750rpx;
height: calc(100vh - 100rpx);
padding: 0;
margin: 0;
flex-direction: column;
align-items: center;
position: relative;
overflow: hidden;
background-color: $app-bj;
}
.flex-r-lr{
display: flex;
flex-direction: row;
justify-content: space-between;
}
.flex-c-lr{
display: flex;
flex-direction: column;
justify-content: space-between;
}
.flex-c{
display: flex;
align-items: center;
justify-content: center;
}
.flex-r-e{
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.flex-r{
display: flex;
flex-direction: row;
align-items: center;
}
.flex-col{
display: flex;
flex-direction: column;
}
.text-w-400{
font-weight: 400;
}
.text-white{
color:#fff;
}
.text-zi{
color:#7934F6;
}
.text-zu{
color:#000;
}
.text-zu1{
color:#333;
}
.text-fu{
color:#666;
}
.text-fu1{
color:#999;
}
.text-lu{
color:#00A776;
}
.mt-12{
margin-top:12rpx;
}
.mt-24{
margin-top:24rpx;
}
.mb-32{
margin-bottom:32rpx;
}
.mt-32{
margin-top:32rpx;
}
.mt-48{
margin-top:48rpx;
}
.mt-88{
margin-top:88rpx;
}
.text-20{
font-size:20rpx;
}
.text-24{
font-size:24rpx;
}
.text-26{
font-size:26rpx;
}
.text-28{
font-size:28rpx;
}
.text-30{
font-size:30rpx;
}
.text-32{
font-size:32rpx;
}
.text-36{
font-size:36rpx;
}
.text-38{
font-size:38rpx;
}
.text-44{
font-size:44rpx;
}
.text-48{
font-size:48rpx;
}
.text-52{
font-size:52rpx;
}
.text-64{
font-size:64rpx;
}
.text-88{
font-size:88rpx;
}
.text-bold{
font-weight:bold;
}
.line-h{
line-height:1.2
}
.mr-32{
margin-right:32rpx;
}
.text-overflow1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.text-d{
text-decoration: line-through;
}
.text-space{
white-space: nowrap;
} }
button { .content-one {
margin-bottom: 15px; display: flex;
} min-width: 750rpx;
img { max-width: 750rpx;
width: 100%; height: calc(100vh - 100rpx);
height: auto; /* 保持图片比例 */ padding: 0;
} margin: 0;
flex-direction: column;
align-items: center;
position: relative;
overflow: hidden;
background-color: $app-bj;
}
.flex-r-lr {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.flex-c-lr {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.flex-c {
display: flex;
align-items: center;
justify-content: center;
}
.flex-r-e {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.flex-r {
display: flex;
flex-direction: row;
align-items: center;
}
.flex-col {
display: flex;
flex-direction: column;
}
.text-w-400 {
font-weight: 400;
}
.text-white {
color: #fff;
}
.text-zi {
color: #7934f6;
}
.text-zu {
color: #000;
}
.text-zu1 {
color: #333;
}
.text-fu {
color: #666;
}
.text-fu1 {
color: #999;
}
.text-lu {
color: #00a776;
}
.mt-12 {
margin-top: 12rpx;
}
.mt-24 {
margin-top: 24rpx;
}
.mb-32 {
margin-bottom: 32rpx;
}
.mt-32 {
margin-top: 32rpx;
}
.mt-48 {
margin-top: 48rpx;
}
.mt-88 {
margin-top: 88rpx;
}
.text-20 {
font-size: 20rpx;
}
.text-24 {
font-size: 24rpx;
}
.text-26 {
font-size: 26rpx;
}
.text-28 {
font-size: 28rpx;
}
.text-30 {
font-size: 30rpx;
}
.text-32 {
font-size: 32rpx;
}
.text-36 {
font-size: 36rpx;
}
.text-38 {
font-size: 38rpx;
}
.text-44 {
font-size: 44rpx;
}
.text-48 {
font-size: 48rpx;
}
.text-52 {
font-size: 52rpx;
}
.text-64 {
font-size: 64rpx;
}
.text-88 {
font-size: 88rpx;
}
.text-bold {
font-weight: bold;
}
.line-h {
line-height: 1.2;
}
.mr-32 {
margin-right: 32rpx;
}
.text-overflow1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.text-d {
text-decoration: line-through;
}
.text-space {
white-space: nowrap;
}
button {
margin-bottom: 15px;
}
img {
width: 100%;
height: auto;
/* 保持图片比例 */
}
</style> </style>
+1
View File
@@ -134,3 +134,4 @@ export function checkAppVersion(data) {
data, data,
}); });
} }
+3 -2
View File
@@ -17,8 +17,9 @@
"splashscreen" : { "splashscreen" : {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender" : true,
"waiting" : true, "waiting" : true,
"autoclose" : true, "delay" : 0,
"delay" : 0 "duration": 0,
"autoclose": false
}, },
/* 模块配置 */ /* 模块配置 */
"modules" : { "modules" : {
+7
View File
@@ -10,6 +10,13 @@
}, },
"pages": [ "pages": [
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/order_package/launch_page/launch_page",
"style": {
"navigationStyle": "custom"
}
},
{ {
"path": "pages/home/home", "path": "pages/home/home",
"style": { "style": {
+847 -809
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,108 @@
<template>
<view class="splash" v-if="show">
<!-- 宽度 = 屏幕宽,高度自适应 -->
<image
class="splash__bg"
:src="sharePoster.posterUrl"
mode="widthFix"
@tap="goDetail"
/>
<view class="splash__count" @tap.stop="goHome"> {{ count }}s 后跳过 </view>
</view>
</template>
<script>
import { getSharePoster } from "@/api/common.js";
export default {
data() {
return {
show: true, // 控制整个假启动页销毁
count: 3,
timer: null,
sharePoster: {},
};
},
async onLoad() {
const hasShown = getApp().globalData.launchShown;
if (hasShown) {
uni.switchTab({ url: "/pages/home/home" });
return;
}
getApp().globalData.launchShown = true; // 置为已展示
await this.getPoster();
this.startCountdown();
},
onUnload() {
this.clearTimer();
},
methods: {
/* 拉取海报 */
async getPoster() {
const { bizcode, data } = await getSharePoster({ type: 0 });
if (bizcode === 100 && data.length) {
this.sharePoster = data[0];
} else {
uni.switchTab({ url: "/pages/home/home" });
}
},
/* 倒计时 */
startCountdown() {
this.timer = setInterval(() => {
this.count--;
if (this.count <= 0) this.goHome();
}, 1000);
},
clearTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
/* 业务跳转 */
goHome() {
this.clearTimer();
uni.switchTab({ url: "/pages/home/home" });
},
goDetail() {
this.clearTimer();
if (this.sharePoster.id) {
uni.navigateTo({
url: `/pages/other_package/productInfo/productInfo?id=${this.sharePoster.id}&isSplash=true`,
});
} else {
uni.switchTab({ url: "/pages/home/home" });
}
},
},
};
</script>
<style scoped lang="scss">
.splash {
position: fixed;
inset: 0;
background: #000; // 防止图片透明区域露白
display: flex;
align-items: center; // 图片上下居中
justify-content: center;
&__bg {
width: 100%; // 宽度 = 屏幕宽
height: auto; // 高度自适应
display: block; // 去掉图片底部空隙
}
&__count {
position: absolute;
right: 40rpx;
top: 80rpx;
color: #fff;
font-size: 26rpx;
padding: 6rpx 16rpx;
background: rgba(0, 0, 0, 0.35);
border-radius: 20rpx;
}
}
</style>
+402 -377
View File
@@ -1,6 +1,6 @@
<template> <template>
<view class="product_info_warp"> <view class="product_info_warp">
<!-- <image v-if="tmpImg" :src="tmpImg" style="width:620rpx;height:960rpx"></image> --> <!-- <image v-if="tmpImg" :src="tmpImg" style="width:620rpx;height:960rpx"></image> -->
<!-- 头部产品描述图 --> <!-- 头部产品描述图 -->
<view class="product_info_header_warp"> <view class="product_info_header_warp">
<up-swiper <up-swiper
@@ -23,13 +23,13 @@
width="30" width="30"
height="30" height="30"
bgColor="#f1f6ff00" bgColor="#f1f6ff00"
v-if="!isShareUrl" v-if="!isShareUrl"
@click="jumpLeft" @click="jumpLeft"
></up-image> ></up-image>
</view> </view>
<view class="img_comm right_warp"> <view class="img_comm right_warp">
<up-image <up-image
v-if="!isShareUrl" v-if="!isShareUrl"
src="/static/common/share_st.png" src="/static/common/share_st.png"
width="30" width="30"
height="30" height="30"
@@ -79,7 +79,7 @@
<!-- 暂时隐藏 --> <!-- 暂时隐藏 -->
<view></view> <view></view>
<!-- 销量还需要改 --> <!-- 销量还需要改 -->
<view>销量{{ orderInfo.sales }}件</view> <view>销量{{ limit999(orderInfo.sales) }}件</view>
</view> </view>
</view> </view>
@@ -126,7 +126,9 @@
<view class="concrete_item_value"> <view class="concrete_item_value">
<view class="address_warp"> <view class="address_warp">
<!-- <view style="margin-left: 10rpx">包邮</view> --> <!-- <view style="margin-left: 10rpx">包邮</view> -->
<view style="margin-left: 10rpx">{{ postage ? `¥${postage}元` : '包邮'}}</view> <view style="margin-left: 10rpx">{{
postage ? `¥${postage}元` : "包邮"
}}</view>
</view> </view>
</view> </view>
</view> </view>
@@ -159,17 +161,19 @@
</view> </view>
</view> </view>
<view class="tui-view"> <view class="tui-view">
<text class="text-32 text-zu">退货提示</text> <text class="text-32 text-zu">退货提示</text>
<text class="text-28 text-fu1" >拆封后影响品质”或“影响二次销售的”不予退货。</text> <text class="text-28 text-fu1"
<view class="tui-list"> >拆封后影响品质”或“影响二次销售的”不予退货。</text
<view class="tui-box" :key="index" v-for="(item,index) in tuiList"> >
<image :src="`/static/new/tui_${index}.png`"></image> <view class="tui-list">
<text class="text-24 text-zu1">{{item}}</text> <view class="tui-box" :key="index" v-for="(item, index) in tuiList">
</view> <image :src="`/static/new/tui_${index}.png`"></image>
<!-- tuiList --> <text class="text-24 text-zu1">{{ item }}</text>
</view> </view>
</view> <!-- tuiList -->
</view>
</view>
<!-- 商品详情 --> <!-- 商品详情 -->
<view class="content_details"> <view class="content_details">
@@ -226,7 +230,13 @@
>立即购买</view >立即购买</view
> >
</view> </view>
<MyBtn v-if="isShareUrl" mh="88rpx" text="打开APP" wd="200rpx" @ok="onOpenApp"></MyBtn> <MyBtn
v-if="isShareUrl"
mh="88rpx"
text="打开APP"
wd="200rpx"
@ok="onOpenApp"
></MyBtn>
</view> </view>
<!-- 选择规格的弹框 --> <!-- 选择规格的弹框 -->
<up-popup <up-popup
@@ -436,25 +446,27 @@
<view class="popup_but" @click="addressOk"> 确认 </view> <view class="popup_but" @click="addressOk"> 确认 </view>
</view> </view>
</up-popup> </up-popup>
<SharePopup <SharePopup
ref="share" ref="share"
v-if="shareOpen" v-if="shareOpen"
:show="shareShow" :show="shareShow"
@close="onClose" @close="onClose"
@share="onShare" @share="onShare"
:id="id" :id="id"
:text="orderInfo.name ? orderInfo.name : ''" :text="orderInfo.name ? orderInfo.name : ''"
:price="orderInfo.minPrice ? orderInfo.minPrice : ''" :price="orderInfo.minPrice ? orderInfo.minPrice : ''"
:tu="swiperList.length && swiperList[0]"></SharePopup> :tu="swiperList.length && swiperList[0]"
<view class="hideCanvasView"> ></SharePopup>
<canvas <view class="hideCanvasView">
id="myCanvas" <canvas
canvas-id="myCanvas" id="myCanvas"
:style="{ canvas-id="myCanvas"
height: ((bgObj.height) + 'px'), :style="{
width: ((bgObj.width) + 'px') height: bgObj.height + 'px',
}"></canvas> width: bgObj.width + 'px',
</view> }"
></canvas>
</view>
</view> </view>
</template> </template>
@@ -462,12 +474,12 @@
import { getGoodsDetail, addGoods, getGoodsSpecs } from "@/api/product.js"; import { getGoodsDetail, addGoods, getGoodsSpecs } from "@/api/product.js";
import { getValue, PRODUCT_DELIVERY_TIME } from "@/utils/enumUtils.js"; import { getValue, PRODUCT_DELIVERY_TIME } from "@/utils/enumUtils.js";
import { copyData } from "@/utils/index.js"; import { copyData } from "@/utils/index.js";
import SharePopup from "@/pages/other_package/components/share-popup.vue" import SharePopup from "@/pages/other_package/components/share-popup.vue";
import MyBtn from '@/components/common/my-btn.vue' import MyBtn from "@/components/common/my-btn.vue";
import { getPostageQuery } from "@/api/cart.js"; import { getPostageQuery } from "@/api/cart.js";
import { assembleAddress } from "@/utils/index.js"; import { assembleAddress } from "@/utils/index.js";
// const QSCanvas = require('qs-canvas') // const QSCanvas = require('qs-canvas')
import QSCanvas from 'qs-canvas'; import QSCanvas from "qs-canvas";
// import {getSharePoster} from "@/components/QuShe-SharerPoster/QS-SharePoster/QS-SharePoster.js"; // import {getSharePoster} from "@/components/QuShe-SharerPoster/QS-SharePoster/QS-SharePoster.js";
import func from "@/utils/func.js"; import func from "@/utils/func.js";
import Address from "@/components/address.vue"; import Address from "@/components/address.vue";
@@ -492,16 +504,16 @@ export default {
}, },
components: { components: {
Address, Address,
SharePopup, SharePopup,
MyBtn MyBtn,
}, },
data() { data() {
return { return {
id: 0, id: 0,
shareShow:false, shareShow: false,
addressShow: false, // 收件地址选择 addressShow: false, // 收件地址选择
shareOpen:false, shareOpen: false,
tuiList:['破损','污渍','划痕','标签','其他'], tuiList: ["破损", "污渍", "划痕", "标签", "其他"],
swiperList: [], swiperList: [],
currentNum: 0, currentNum: 0,
specificationShow: false, specificationShow: false,
@@ -518,22 +530,25 @@ export default {
selectAddress: {}, // 选择的地址 selectAddress: {}, // 选择的地址
postage: null, // 邮费 postage: null, // 邮费
adressInfo: "", adressInfo: "",
urlPath:'', urlPath: "",
posterImage:'', posterImage: "",
canvasId: 'default_PosterCanvasId', canvasId: "default_PosterCanvasId",
poster:'', poster: "",
bgObj: { bgObj: {
height: 480, height: 480,
width: 310 width: 310,
}, },
draw:null, draw: null,
tmpImg:'', tmpImg: "",
isShareUrl:false isShareUrl: false,
isSplash: false,
}; };
}, },
onLoad(options) { onLoad(options) {
const id = options.id; const id = options.id;
const source = options.source; const source = options.source;
this.isSplash = options.isSplash;
console.log("isSplash", this.isSplash == "true");
if (id && id !== 0) { if (id && id !== 0) {
this.id = id ? parseInt(id, 10) : 0; this.id = id ? parseInt(id, 10) : 0;
@@ -545,298 +560,305 @@ export default {
} }
} }
// #ifdef H5 // #ifdef H5
let url = window.location.href; let url = window.location.href;
if(url.indexOf(SHARE_URL) != -1){ if (url.indexOf(SHARE_URL) != -1) {
this.isShareUrl = true; this.isShareUrl = true;
} }
console.log('url',url,SHARE_URL) console.log("url", url, SHARE_URL);
// #endif // #endif
qsc = new QSCanvas({ qsc = new QSCanvas(
canvasId: 'myCanvas', {
setCanvasWH: bg => { canvasId: "myCanvas",
this.bgObj = bg setCanvasWH: (bg) => {
} this.bgObj = bg;
}, this); },
},
this
);
}, },
onHide(){ onHide() {
timer && clearTimeout(timer); timer && clearTimeout(timer);
timer = null; timer = null;
}, },
onUnload(){ onUnload() {
timer && clearTimeout(timer); timer && clearTimeout(timer);
timer = null; timer = null;
}, },
methods: { methods: {
assembleAddress, assembleAddress,
onOpenApp(){ limit999(n) {
//https://download.tbmall.xin/1002/apppacket/20251113/20251113183449483.apk return n > 999 ? '999+' : String(n);
let iphone = this.iosOrAnd(); },
window.location = 'trustbridgeapp://';
timer = setTimeout(()=>{
if(timer != null){
uni.showModal({
title:'未成功唤起APP',
content:'是否前往下载?',
success:(res=>{
if(res.confirm){
window.open('https://app.tbmall.xin')
}
})
})
}
},3000)
}, onOpenApp() {
iosOrAnd() { //https://download.tbmall.xin/1002/apppacket/20251113/20251113183449483.apk
let userAgent = navigator.userAgent || navigator.vendor || window.opera; let iphone = this.iosOrAnd();
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { window.location = "trustbridgeapp://";
return "ios"; timer = setTimeout(() => {
} if (timer != null) {
if (/Android/.test(userAgent)) { uni.showModal({
return "and"; title: "未成功唤起APP",
} content: "是否前往下载?",
return "Other"; success: (res) => {
}, if (res.confirm) {
window.open("https://app.tbmall.xin");
}
},
});
}
}, 3000);
},
iosOrAnd() {
let userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "ios";
}
if (/Android/.test(userAgent)) {
return "and";
}
return "Other";
},
onZiXun() { onZiXun() {
if(this.isShareUrl){ if (this.isShareUrl) {
return; return;
} }
uni.navigateTo({ uni.navigateTo({
url: "/pages/rwa_package/setting/kefu?type=5260", url: "/pages/rwa_package/setting/kefu?type=5260",
}); });
}, },
getValue, getValue,
onShare(index){ onShare(index) {
let tmp = `【信任桥】消费共享数字化权益 ${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=${this.id} ${this.orderInfo.name}`; let tmp = `【信任桥】消费共享数字化权益 ${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=${this.id} ${this.orderInfo.name}`;
if(index == 0){ if (index == 0) {
// WXSceneTimeline // WXSceneTimeline
uni.share({ uni.share({
provider:'weixin', provider: "weixin",
scene:'WXSceneSession', scene: "WXSceneSession",
type:1, type: 1,
summary:tmp, summary: tmp,
});
this.onClose();
} else if (index == 1) {
uni.share({
provider: "weixin",
scene: "WXSceneTimeline",
type: 1,
summary: tmp,
});
} else if (index == 2) {
this.onClose();
} else if (index == 3) {
setTimeout(() => {
this.onDraw();
}, 1000);
this.onClose();
} else if (index == 4) {
return func.myToast("暂未开放");
uni.share({
provider: "qq",
type: 1,
summary: tmp,
});
}
},
async onDraw() {
let _this = this;
try {
let last;
// qsc.setRect({ x: 0, y: 0,r:12, height: 960, width: 620});
}) qsc.setPaintbrush({
this.onClose() strokeStyle: "#EBEBEB",
}else if(index == 1){ font: {
uni.share({ fontSize: 16,
provider:'weixin', },
scene:'WXSceneTimeline', });
type:1, last = await qsc.drawImg({
summary:tmp, val: "https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new/di.png",
x: 0,
y: 0,
height: 480,
width: 310,
});
}) last = await qsc.drawImg({
}else if(index == 2){ val: "https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new/logo.png",
x: 228,
y: 393,
height: 62,
width: 62,
});
this.onClose() // last = await qsc.drawImg({
}else if(index == 3){ // val:'https://niu8.letaocm.top/17557729915067836.jpg',
setTimeout(()=>{ // x: 20,
this.onDraw(); // y: 20,
},1000) // height: 270,
this.onClose() // width: 270,
}else if(index == 4){ // })
return func.myToast('暂未开放');
uni.share({
provider:'qq',
type:1,
summary:tmp,
}) // #ifndef H5
} last = await qsc.drawImg({
}, val: _this.swiperList[0],
async onDraw(){ x: 20,
let _this = this; y: 20,
try { height: 270,
let last width: 270,
// qsc.setRect({ x: 0, y: 0,r:12, height: 960, width: 620}); });
qsc.setPaintbrush({ // #endif
strokeStyle:'#EBEBEB', qsc.setPaintbrush({
font: { strokeStyle: "#EBEBEB",
fontSize: 16 });
} // { x1: obj.x, y1: y, x2: obj.x + tw, y2: y, style, gap, width, color }
}) last = await qsc.drawLine({
last = await qsc.drawImg({ style: "solide",
val: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new/di.png', x1: 210,
x: 0, y1: 313,
y: 0, x2: 210,
height: 480, y2: 342,
width: 310, width: 1,
}) gap: 1,
});
last = await qsc.drawImg({ last = await qsc.drawLine({
val: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new/logo.png', style: "solide",
x: 228, x1: 20,
y: 393, y1: 368,
height: 62, x2: 290,
width: 62, y2: 368,
}) width: 1,
gap: 1,
});
// last = await qsc.drawImg({ // last = await qsc.drawImg({
// val:'https://niu8.letaocm.top/17557729915067836.jpg', // val:'https://hashmall-prod.oss-cn-shenzhen.aliyuncs.com/1002/image/20250818/20250818134614672.jpg',
// x: 20, // x: 20,
// y: 20, // y: 20,
// height: 270, // height: 270,
// width: 270, // width: 270,
// }) // })
// #ifndef H5 last = await qsc.drawText({
last = await qsc.drawImg({ val: this.orderInfo.name,
val:_this.swiperList[0], x: 20,
x: 20, y: 310,
y: 20, maxWidth: 180,
height: 270, line: 2,
width: 270, });
})
// #endif last = await qsc.drawText({
qsc.setPaintbrush({ val: "1、保存图片到相册",
strokeStyle:'#EBEBEB' x: 93,
}) y: 397,
// { x1: obj.x, y1: y, x2: obj.x + tw, y2: y, style, gap, width, color } paintbrushProps: {
last = await qsc.drawLine({ fillStyle: "#7f7f7f",
style:'solide', font: { fontSize: 12, fontWeight: 400 },
x1:210, },
y1:313, });
x2:210,
y2:342,
width:1,
gap:1
})
last = await qsc.drawLine({ last = await qsc.drawText({
style:'solide', val: "2、扫一扫下载信任桥",
x1:20, x: 93,
y1:368, y: 438,
x2:290, paintbrushProps: {
y2:368, fillStyle: "#7f7f7f",
width:1, font: { fontSize: 12, fontWeight: 400 },
gap:1 },
}) });
// last = await qsc.drawImg({ last = await qsc.drawText({
// val:'https://hashmall-prod.oss-cn-shenzhen.aliyuncs.com/1002/image/20250818/20250818134614672.jpg', val: "¥" + this.orderInfo.minPrice,
// x: 20, x: 230,
// y: 20, y: 317,
// height: 270, paintbrushProps: {
// width: 270, fillStyle: "#7A35F6",
// }) font: { fontSize: 20, fontWeight: 700 },
},
});
last = await qsc.drawText({ last = await qsc.drawQrCode({
val: this.orderInfo.name, val: `${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=${this.id}`,
x: 20, x: 20,
y: 310, y: 391,
maxWidth: 180, size: 65,
line: 2 });
})
last = await qsc.drawText({ // await qsc.updateCanvasWH({ width: '300px', height: '960px'})
val: '1、保存图片到相册', await qsc.draw();
x: 93,
y: 397,
paintbrushProps: { fillStyle: '#7f7f7f',font: { fontSize: 12, fontWeight: 400 } } ,
})
last = await qsc.drawText({ setTimeout(() => {
val: '2、扫一扫下载信任桥', uni.canvasToTempFilePath({
x: 93, canvasId: "myCanvas",
y: 438, success: function (res) {
paintbrushProps: { fillStyle: '#7f7f7f',font: { fontSize: 12, fontWeight: 400 } } , const tempFilePath = res.tempFilePath;
}) _this.tmpImg = tempFilePath;
last = await qsc.drawText({ // #ifdef H5
val: '¥' + this.orderInfo.minPrice, uni.downloadFile({
x: 230, url: tempFilePath,
y: 317, success: function () {
paintbrushProps: { fillStyle: '#7A35F6',font: { fontSize: 20, fontWeight: 700 } } , let link = document.createElement("a");
}) link.href = tempFilePath;
link.download = "分享图片";
link.click();
},
fail: function (err) {
uni.showToast({
title: "保存失败",
icon: "none",
duration: 2000,
});
},
});
// #endif
last = await qsc.drawQrCode({ // #ifndef H5
val: `${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=${this.id}`, uni.saveImageToPhotosAlbum({
x: 20, filePath: tempFilePath,
y: 391, success: function () {
size: 65, uni.showToast({
}) title: "保存成功",
icon: "success",
duration: 2000,
});
},
fail: function (err) {
console.error("保存失败:", err);
uni.showModal({
title: "错误",
content: "保存图片到相册失败",
showCancel: false,
});
},
});
// #endif
},
fail: function (error) {
console.error("获取图片失败:", error);
},
});
}, 200);
// await qsc.updateCanvasWH({ width: '300px', height: '960px'}) // let img = await qsc.toImage({x:0,y:0,width:620,height:960,
await qsc.draw(); // destWidth:310 * 4,destHeight:480 * 4,fileType:'png'});
// uni.saveImageToPhotosAlbum({filePath:img});
setTimeout(()=>{ // console.log('img',img)
} catch (e) {
uni.canvasToTempFilePath({ //TODO handle the exception
canvasId: 'myCanvas', console.log("绘制异常", e);
success: function (res) { uni.showModal({
const tempFilePath = res.tempFilePath; content: JSON.stringify(e),
_this.tmpImg = tempFilePath; });
}
// #ifdef H5 },
uni.downloadFile({ onClose() {
url: tempFilePath, this.shareShow = false;
success: function () { setTimeout(() => {
let link = document.createElement('a'); this.shareOpen = false;
link.href = tempFilePath; }, 1000);
link.download = '分享图片'; },
link.click();
},
fail: function (err) {
uni.showToast({
title: '保存失败',
icon: 'none',
duration: 2000
});
}
});
// #endif
// #ifndef H5
uni.saveImageToPhotosAlbum({
filePath: tempFilePath,
success: function () {
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
});
},
fail: function (err) {
console.error('保存失败:', err);
uni.showModal({
title: '错误',
content: '保存图片到相册失败',
showCancel: false
});
}
});
// #endif
},
fail: function (error) {
console.error('获取图片失败:', error);
}
});
},200)
// let img = await qsc.toImage({x:0,y:0,width:620,height:960,
// destWidth:310 * 4,destHeight:480 * 4,fileType:'png'});
// uni.saveImageToPhotosAlbum({filePath:img});
// console.log('img',img)
} catch (e) {
//TODO handle the exception
console.log('绘制异常',e)
uni.showModal({
content: JSON.stringify(e)
})
}
},
onClose(){
this.shareShow = false;
setTimeout(()=>{
this.shareOpen = false;
},1000)
},
onSwiper(index) { onSwiper(index) {
uni.previewImage({ uni.previewImage({
current: index, current: index,
@@ -845,9 +867,9 @@ export default {
}); });
}, },
jumpAddAddress() { jumpAddAddress() {
if(this.isShareUrl){ if (this.isShareUrl) {
return; return;
} }
this.addressShow = true; this.addressShow = true;
}, },
// 地址选中 // 地址选中
@@ -895,14 +917,18 @@ export default {
this.openShow = false; this.openShow = false;
}, },
jumpLeft() { jumpLeft() {
if (this.isSplash == "true") {
uni.switchTab({ url: "/pages/home/home" });
return;
}
uni.navigateBack({ uni.navigateBack({
delta: 1, // 返回的页面数,默认为1,返回到上一级 delta: 1, // 返回的页面数,默认为1,返回到上一级
}); });
}, },
jumpOther(type) { jumpOther(type) {
if(this.isShareUrl){ if (this.isShareUrl) {
return; return;
} }
if (type === "home") { if (type === "home") {
uni.switchTab({ uni.switchTab({
// 首页 // 首页
@@ -992,9 +1018,9 @@ export default {
}); });
}, },
async checkSpecification(val, type) { async checkSpecification(val, type) {
if(this.isShareUrl){ if (this.isShareUrl) {
return; return;
} }
const source = this.source; const source = this.source;
if (type == "n" && this.ji == 1) { if (type == "n" && this.ji == 1) {
type = "buy"; type = "buy";
@@ -1181,11 +1207,10 @@ export default {
}, },
// 跳转到分享页面 // 跳转到分享页面
jumpShare() { jumpShare() {
console.log('jumpShare') console.log("jumpShare");
this.shareOpen = true; this.shareOpen = true;
this.shareShow = true; this.shareShow = true;
},
},
}, },
}; };
</script> </script>
@@ -1290,40 +1315,40 @@ export default {
margin-top: 10rpx; margin-top: 10rpx;
} }
.tui-view{ .tui-view {
width:100%; width: 100%;
height:286rpx; height: 286rpx;
min-height:286rpx; min-height: 286rpx;
background-color: #fff; background-color: #fff;
border-radius: 24rpx; border-radius: 24rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 32rpx; padding: 32rpx;
box-sizing: border-box; box-sizing: border-box;
margin-top:24rpx; margin-top: 24rpx;
.tui-list{ .tui-list {
width:100%; width: 100%;
height:104rpx; height: 104rpx;
min-height:104rpx; min-height: 104rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-top:24rpx; margin-top: 24rpx;
.tui-box{ .tui-box {
width:64rpx; width: 64rpx;
min-height:100%; min-height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
image{ image {
width:64rpx; width: 64rpx;
height:64rpx; height: 64rpx;
} }
} }
} }
} }
.content_concrete { .content_concrete {
padding: 20rpx; padding: 20rpx;
@@ -1694,16 +1719,16 @@ export default {
} }
} }
} }
.hideCanvasView{ .hideCanvasView {
width:100%; width: 100%;
height:100%; height: 100%;
position: fixed; position: fixed;
top:10000; top: 10000;
left:10000; left: 10000;
z-index: 1000000000000; z-index: 1000000000000;
// background-color: rgba(0,0,0,0.2); // background-color: rgba(0,0,0,0.2);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
</style> </style>