Prechádzať zdrojové kódy

活动商品图和分享调整

vaecebyZ 1 rok pred
rodič
commit
0f0a972bd1

+ 52 - 27
detail/goodsDetail/index.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="goodsDetail">
     <view class="good-img-box">
-      <image class="good-img" :src="info.goodsPath" ></image>
+      <image class="good-img" :src="info.goodsPath"></image>
     </view>
     <view class="goods-info">
       <view class="price-box">
@@ -28,13 +28,8 @@
           {{ item.specName }}
         </view>
         <view class="type-list">
-          <view
-            class="type-item"
-            :class="[active == d ? 'active' : '']"
-            v-for="(i, d) in item.specValues"
-            @click="handleSpec(item, i, d)"
-            :key="i.specId"
-          >
+          <view class="type-item" :class="[active == d ? 'active' : '']" v-for="(i, d) in item.specValues"
+            @click="handleSpec(item, i, d)" :key="i.specId">
             {{ i.specValue }}
           </view>
         </view>
@@ -59,18 +54,10 @@
 		</view> -->
 
     <view class="tab-group">
-      <view
-        class="tab"
-        :class="[tab == 1 ? 'active' : '']"
-        @click="handleTab(1)"
-      >
+      <view class="tab" :class="[tab == 1 ? 'active' : '']" @click="handleTab(1)">
         商品详情
       </view>
-      <view
-        class="tab"
-        :class="[tab == 2 ? 'active' : '']"
-        @click="handleTab(2)"
-      >
+      <view class="tab" :class="[tab == 2 ? 'active' : '']" @click="handleTab(2)">
         购买须知
       </view>
     </view>
@@ -106,11 +93,7 @@
 					</view>
 				</view> -->
 
-        <view
-          class="buy-btn"
-          :class="[info.realStockNum ? '' : 'none']"
-          @click="handleBuy"
-        >
+        <view class="buy-btn" :class="[info.realStockNum ? '' : 'none']" @click="handleBuy">
           <view class="label">
             {{ info.realStockNum ? "购买" : "售罄" }}
           </view>
@@ -136,6 +119,13 @@ export default {
       shopInfo: {},
     };
   },
+  onShareTimeline() {
+    return {
+      title: this.info.goodsName,
+      query: `id=${this.info.goodsId}`,
+      imageUrl: this.info.goodsPath,
+    };
+  },
   onShareAppMessage() {
     return {
       title: this.info.goodsName,
@@ -145,8 +135,8 @@ export default {
   },
   methods: {
     filterMsg(val) {
-      if(!isNaN(val)){
-        val=val + "天";
+      if (!isNaN(val)) {
+        val = val + "天";
       }
       return val.replace(/\n/g, "<br>");
     },
@@ -184,7 +174,7 @@ export default {
         });
       }
     },
-    handleSpec(item,i,d){
+    handleSpec(item, i, d) {
       this.active = d
     },
     detail(goodsId) {
@@ -242,37 +232,45 @@ export default {
   background: #f9f9f9;
   padding-bottom: 200rpx;
   min-height: 100vh;
+
   .good-img-box {
     width: 100vw;
     height: 100vw;
-    .good-img{
+
+    .good-img {
       width: 100%;
       height: 100%;
     }
   }
+
   .goods-info {
     padding: 24rpx;
     margin-bottom: 20rpx;
     background: #fff;
+
     .price-box {
       display: flex;
       justify-content: space-between;
       align-items: center;
+
       .left {
         display: flex;
         align-items: flex-end;
+
         .unit {
           font-size: 20rpx;
           line-height: 20rpx;
           color: #ff4d3a;
           font-weight: bold;
         }
+
         .price {
           font-size: 32rpx;
           line-height: 20rpx;
           color: #ff4d3a;
           font-weight: bold;
         }
+
         .old-price {
           font-size: 20rpx;
           color: #aaaaaa;
@@ -280,17 +278,20 @@ export default {
           margin-left: 12rpx;
         }
       }
+
       .right {
         font-size: 24rpx;
         color: #aaaaaa;
       }
     }
+
     .goods-name {
       font-size: 32rpx;
       color: #222222;
       font-weight: bold;
       margin-top: 20rpx;
     }
+
     .desc {
       font-size: 24rpx;
       color: #aaaaaa;
@@ -300,18 +301,22 @@ export default {
       margin-top: 12rpx;
     }
   }
+
   .type-box {
     padding: 24rpx;
     background: #fff;
     margin-bottom: 20rpx;
+
     .type-title {
       font-size: 28rpx;
       color: #222222;
     }
+
     .type-list {
       display: flex;
       flex-wrap: wrap;
       justify-content: space-between;
+
       .type-item {
         width: 316rpx;
         height: 52rpx;
@@ -324,6 +329,7 @@ export default {
         color: #aaaaaa;
         margin-top: 28rpx;
       }
+
       .type-item.active {
         background: #ee4320;
         color: #ffffff;
@@ -338,22 +344,26 @@ export default {
     align-items: center;
     justify-content: space-between;
     margin-bottom: 20rpx;
+
     .info {
       .shop-name {
         font-size: 28rpx;
         color: #222222;
       }
+
       .address {
         font-size: 24rpx;
         color: #aaaaaa;
         margin-top: 16rpx;
       }
     }
+
     .num {
       display: flex;
       align-items: center;
       font-size: 24rpx;
       color: #aaaaaa;
+
       .icon {
         width: 48rpx;
         height: 48rpx;
@@ -365,6 +375,7 @@ export default {
   .tab-group {
     display: flex;
     background: #fff;
+
     .tab {
       flex: 1;
       padding: 24rpx 0;
@@ -372,6 +383,7 @@ export default {
       font-size: 28rpx;
       color: #222222;
     }
+
     .tab.active {
       font-weight: 600;
     }
@@ -381,6 +393,7 @@ export default {
     .goods-desc {
       color: #222222;
       font-size: 24rpx;
+
       .img_class {
         max-width: 100% !important;
       }
@@ -389,14 +402,17 @@ export default {
 
   .list {
     background: #fff;
+
     .item {
       padding: 24rpx;
       border-top: 1rpx solid #f0f0f0;
+
       .label {
         font-weight: 600;
         font-size: 28rpx;
         color: #222222;
       }
+
       .value {
         font-size: 24rpx;
         color: #aaaaaa;
@@ -416,15 +432,18 @@ export default {
     display: flex;
     justify-content: space-between;
     box-sizing: border-box;
+
     .head {
       width: 80rpx;
       height: 80rpx;
       background: #aaa;
       border-radius: 50%;
     }
+
     .btn-box {
       display: flex;
       text-align: center;
+
       .group-btn {
         width: 280rpx;
         height: 80rpx;
@@ -433,19 +452,23 @@ export default {
         display: flex;
         flex-direction: column;
         justify-content: space-around;
+
         .label {
           font-weight: 600;
           font-size: 28rpx;
           color: #ffffff;
         }
+
         .price {
           font-size: 24rpx;
           color: #ffffff;
         }
       }
+
       .buy-btn.none {
         filter: grayscale(1);
       }
+
       .buy-btn {
         // width: 280rpx;
 
@@ -456,11 +479,13 @@ export default {
         border-radius: 40rpx;
         background: $uni-color-primary;
         color: #fff;
+
         .label {
           font-weight: 600;
           font-size: 28rpx;
           color: #ffffff;
         }
+
         .price {
           font-size: 24rpx;
           color: #ffffff;

+ 1 - 1
my/order/index.vue

@@ -31,7 +31,7 @@
 				</view>
 				<view class="order-box">
 					<zs-img radius="full"
-						:src="item.goodsModelList[0].goodsInfo.goodsPath || item.goodsModelList[0].goodsInfo.activityCover"
+						:src="item.goodsModelList[0].goodsInfo.goodsPath || item.goodsModelList[0].goodsInfo.activityMain"
 						width="164rpx" height="164rpx"></zs-img>
 					<view class="info">
 						<view class="title">

+ 12 - 7
signUp/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="signUp">
-		<image class="good-img" :src="info.activityCover" mode="aspectFit"></image>
+		<image class="good-img" :src="info.activityMain" mode="aspectFit"></image>
 		<view class="goods-info">
 			<view class="goods-name">
 				{{ info.activityName }}
@@ -49,7 +49,7 @@
 			活动详情
 		</view>
 		<view class="desc-box">
-			<rich-text @click="goImgDetials" class="goods-desc" :nodes="info.activityDetail"></rich-text>
+			<rich-text @longpress="goImgDetials" class="goods-desc" :nodes="info.activityDetail"></rich-text>
 		</view>
 
 
@@ -70,10 +70,18 @@ export default {
 			isEnd: false
 		}
 	},
-	onshareAppMessage() {
+	onShareTimeline() {
 		return {
 			title: this.info.activityName,
-			path: `/signUp/index?scene=${this.id}`
+			query: `scene=${this.id}`,
+			imageUrl: this.info.activityMain
+		}
+	},
+	onShareAppMessage() {
+		return {
+			title: this.info.activityName,
+			path: `/signUp/index?scene=${this.id}`,
+			desc: '贵大印象文创'
 		}
 	},
 	methods: {
@@ -109,7 +117,6 @@ export default {
 						} = data;
 						// tapIndex 第几个按钮
 						// index 第几张图片
-						//#ifdef APP-PLUS
 						if (tapIndex == 0) {
 							// 保存到相册
 							plus.gallery.save(imgArr[index], () => {
@@ -154,7 +161,6 @@ export default {
 								}
 							})
 						}
-						//#endif
 					}
 				}
 			})
@@ -214,7 +220,6 @@ export default {
 		this.id = decodeURIComponent(options.scene)
 		this.getActivityDetail(this.id)
 	}
-
 }
 </script>
 

+ 1 - 1
signUp/refund.vue

@@ -11,7 +11,7 @@
 
 		<view class="content info">
 			<view class="order-info">
-				<image class="icon" :src="info.goodsList[0].goodsInfo.activityCover" mode=""></image>
+				<image class="icon" :src="info.goodsList[0].goodsInfo.activityMain" mode=""></image>
 				<view class="shop-info">
 					<view class="title">
 						{{info.goodsList[0].goodsInfo.activityName}}

+ 1 - 1
signUp/refundDetail.vue

@@ -25,7 +25,7 @@
 			
 			<view class="content info">
 				<view class="order-info">
-					<image class="icon" :src="info.goodsList[0].goodsInfo.activityCover" mode=""></image>
+					<image class="icon" :src="info.goodsList[0].goodsInfo.activityMain" mode=""></image>
 					<view class="shop-info">
 						<view class="title">
 							{{info.goodsList[0].goodsInfo.activityName}}