From 3cbd9dc493e8663d9ec1a2816e664f7c9289b8a3 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期四, 21 九月 2023 14:05:16 +0800
Subject: [PATCH] no message

---
 h5/apph5/components/items/LineItem.vue |   96 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 64 insertions(+), 32 deletions(-)

diff --git a/h5/apph5/components/items/LineItem.vue b/h5/apph5/components/items/LineItem.vue
index ac425ca..79d9d73 100644
--- a/h5/apph5/components/items/LineItem.vue
+++ b/h5/apph5/components/items/LineItem.vue
@@ -34,33 +34,44 @@
 			items: Object,
 			isrecord: {
 				type: Boolean,
-				default: false
+				default: false,
+				text: ''
 			},
 		},
 		created() {},
 		methods: {
-			oncopy(txt) {
-				let copyObj = {
-					data: txt,
-					success: function() {
+
+			copyText() {
+				// #ifdef H5
+				this.$copyText(this.text).then(
+					res => {
 						uni.showToast({
 							title: '浼樻儬閾炬帴宸插鍒讹紝鐜板湪鎵撳紑鎵嬫満娣樺疂锛岄鍙栦紭鎯犲埜鍚',
 							icon: 'none',
 							duration: 2500
-						});
-					},
-					fail: function(e) {
-						console.log(e);
+						})
 					}
-				};
-				uni.setClipboardData(copyObj);
+				)
+				// #endif
+				// #ifndef H5
+				uni.setClipboardData({
+					data: this.text,
+					success: () => {
+						uni.showToast({
+							title: '浼樻儬閾炬帴宸插鍒讹紝鐜板湪鎵撳紑鎵嬫満娣樺疂锛岄鍙栦紭鎯犲埜鍚',
+							icon: 'none',
+							duration: 2500
+						})
+					}
+				})
+				// #endif
 			},
 			getShareLink(items) {
-				if(this.isrecord)
-				{//璁板綍鐐瑰嚮
-					this.recordClick(items.goodsId,items.sourceType,items.dtitle,items.actualPrice);
+				
+				if (this.isrecord) { //璁板綍鐐瑰嚮
+					this.recordClick(items.goodsId, items.sourceType, items.dtitle, items.actualPrice);
 				}
-				var goodsid=items.goodsId;
+				var goodsid = items.goodsId;
 				var that = this;
 				let postdata = {
 					goodsId: goodsid
@@ -76,23 +87,44 @@
 					if (e.code != 0) {
 						return;
 					}
-					this.oncopy(e.data.info.longTpwd);
+					this.text = e.data.info.longTpwd;
+					uni.getSystemInfo({
+						success: function(res) {
+							if (res.osName == 'ios') {
+								uni.showModal({
+									title: '鎻愮ず',
+									content: '浼樻儬淇℃伅澶嶅埗鍚庯紝璇锋墦寮�鎵嬫満娣樺疂棰嗗埜',
+									showCancel: false,
+									confirmText: '澶嶅埗浼樻儬淇℃伅',
+									success: function(res) {
+										if (res.confirm) {
+											that.copyText();
+										}
+									}
+								});
+							}
+							else{
+								that.copyText();
+							}
+						}
+					});
+					
+					//this.oncopy(e.data.info.longTpwd);
 				}).catch(function(err) {
 					console.log(err);
 				})
 			},
-			recordClick(goodsid,plat,title,act_price)
-			{
-				let postdata={
-					goodsid:goodsid,
-					plat:plat,
-					title:title,
-					act_price:act_price
+			recordClick(goodsid, plat, title, act_price) {
+				let postdata = {
+					goodsid: goodsid,
+					plat: plat,
+					title: title,
+					act_price: act_price
 				}
 				this.$http.post('/api/activity/recordItemClick',
 					postdata
 				).then(e => {
-					
+
 				}).catch(function(err) {
 					console.log(err);
 				})
@@ -104,8 +136,8 @@
 <style>
 	.item-price-prc {
 		color: #fe3a3f;
-		font-size: 1.2rem;
-		margin-right: 0.4rem;
+		font-size: 1rem;
+		margin-right: 0.2rem;
 		font-weight: 500;
 	}
 
@@ -128,7 +160,7 @@
 		background: linear-gradient(0deg, #ff753c, #ff4b42);
 		color: #fff;
 		padding: 0.05rem;
-		font-size: 0.9rem;
+		font-size: 0.7rem;
 
 	}
 
@@ -153,7 +185,7 @@
 	}
 
 	.item-txt {
-		width: 71%;
+		width: 70%;
 		display: flex;
 		flex-direction: column;
 		justify-content: space-between;
@@ -165,7 +197,7 @@
 	}
 
 	.item-txt-title {
-		font-size: 0.9rem;
+		font-size: 0.7rem;
 		margin-left: 0.3rem;
 		text-overflow: -o-ellipsis-lastline;
 		overflow: hidden;
@@ -179,7 +211,7 @@
 
 	.item-price {
 		display: flex;
-		font-size: 0.8rem;
+		font-size: 0.5rem;
 		align-items: baseline;
 		color: #8d8484;
 	}
@@ -190,10 +222,10 @@
 	}
 
 	.item-copy {
-		width: 5.92rem;
+		width: 5.22rem;
 		height: 1.66rem;
 		background: linear-gradient(-90deg, #fe3a3f, #faa450);
-		font-size: 0.9rem;
+		font-size: 0.7rem;
 		font-weight: 500;
 		color: #fffefd;
 		line-height: 1.66rem;

--
Gitblit v1.9.3