xiebaomin 2 年之前
父節點
當前提交
6e9385e47b

+ 1 - 1
mixins/jumpMixins.js

@@ -12,7 +12,7 @@ const jumpMixins = {
                 this.$api.navigateTo(`/pages/goods/product?id=${jump.jumpProductId}`)
                 break
 			   case 2://活动列表
-                this.$api.navigateTo(`/pages/goods/good-activity?jumpActiveId=${jump.jumpActiveId}`)
+                this.$api.navigateTo(`/pages/goods/good-activity?jumpActiveId=${jump.jumpActiveId}&organizeId=${jump.organizeId}`)
                 break
 				
 		   }

+ 9 - 3
pages.json

@@ -85,10 +85,16 @@
 				}, {
 					"path": "good-activity",
 					"style": {
-						"navigationBarTitleText": "专题活动",
-						"enablePullDownRefresh": true
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": false
 					}
-				}
+				}, {
+                    "path": "active-product",
+                    "style": {
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": false
+					}
+                }
 			]
 		},
 		{

+ 60 - 0
pages/goods/active-product.vue

@@ -0,0 +1,60 @@
+<template>
+    <view class="">
+        <tui-skeleton
+        	v-if="skeletonShow"
+        	backgroundColor="#fafafa"
+        	borderRadius="10rpx"
+        	:isLoading="true"
+        	:loadingType="5"
+        ></tui-skeleton>
+        <view class="active-product" v-else>
+            <ProGood v-for="item in activeProductList" :key="item" :storeInfo="item" />
+        </view>
+    </view>
+</template>
+
+<script>
+    import ProGood from './components/procurement_good.vue'
+    export default {
+        components: {
+            ProGood,
+        },
+        data() {
+            return {
+                skeletonShow: true,
+                activeProductList: [] // 活动商品列表
+            }
+        },
+        onLoad(options) {
+            this.activeProduct(options)
+        },
+        methods: {
+            // 楼层商品数据
+            async activeProduct(options) {
+                try{
+                    const {data} = await this.SpecialService.activeProduct({imageId: options.activeImageId})
+                    this.activeProductList = data
+                    uni.setNavigationBarTitle({
+                        title: data[0].topic
+                    })
+                    this.skeletonShow = false
+                }catch(error){
+                    console.log(error)
+                }
+            }
+        }
+    }
+</script>
+
+<style lang="scss">
+    page {
+    	background-color: #f7f7f7;
+    }
+    .active-product {
+        background: #f7f7f7;
+        display: flex;
+        flex-wrap: wrap;
+        padding: 24rpx;
+        justify-content: space-between;
+    }
+</style>

+ 16 - 5
pages/goods/components/cm-special.vue

@@ -1,11 +1,11 @@
 <template>
-    <view class="special">
+    <view class="special" @click="activeProduct">
         <view class="img">
-            <image src="" mode="aspectFill" style="width: 100%;height: 100%;"></image>
+            <image :src="activeImage.image" mode="aspectFill" style="width: 100%;height: 100%;"></image>
         </view>
         <view class="special_title">
             <view class="title">
-                买Meso X 美肤导入仪免费送采美超级会...
+                {{activeImage.topic}}
             </view>
             <button class="special_btn">查看详情</button>
         </view>
@@ -14,10 +14,22 @@
 
 <script>
     export default {
+        props: {
+            activeImage: {
+                type: Object,
+                default: () => {}
+            }
+        },
         data() {
             return {}
         },
-        methods: {}
+        methods: {
+            activeProduct() {
+                uni.navigateTo({
+                    url: '/pages/goods/active-product?activeImageId=' + this.activeImage.id
+                })
+            },
+        }
     }
 </script>
 
@@ -33,7 +45,6 @@
     .img {
         width: 100%;
         height: 360rpx;
-        border: 1px dotted;
         box-sizing: border-box;
     }
     .special_title {

+ 44 - 8
pages/goods/components/procurement_good.vue

@@ -1,21 +1,25 @@
 <template>
-    <view class="pro-good">
+    <view class="pro-good" @click.stop="handleJumpLink">
         <view class="img">
-            <image src="" mode="aspectFill" style="width: 100%;height: 100%;"></image>
+            <image :src="storeInfo.mainImage" mode="aspectFill" style="width: 100%;height: 100%;"></image>
         </view>
         <view class="pro-content">
             <view class="pro-title">
-                法国曼丽菲戈动能素抗
-                衰DERMABOOSTER
+                {{storeInfo.name | sliceText(20)}}
             </view>
-            <view class="pro-price">
-                ¥19800.00
+            <view class="pro-price" v-if='hasLogin'>
+                ¥{{storeInfo.price}}
+            </view>
+            <view class="product-price-none" v-else>
+                <uni-grader :grade="Number(storeInfo.priceGrade)"></uni-grader>
             </view>
         </view>
     </view>
 </template>
 
 <script>
+    import { mapState } from 'vuex'
+    import uniGrader from '@/components/uni-grade/uni-grade.vue'
     export default {
         props: {
             storeInfo: {
@@ -23,12 +27,32 @@
                 default: () => {}
             }
         },
+        components: {
+            uniGrader
+        },
+        filters: {
+            // 字符过滤
+            sliceText(text, num) {
+                if (text && text.length > num) {
+                    let value = text.substring(0, num)
+                    return value + '...'
+                }
+                return text
+            }
+        },
+        computed: {
+        	...mapState(['hasLogin'])
+        },
         data() {
             return {
                 
             }
         },
-        methods: {}
+        methods: {
+            handleJumpLink() {
+                this.$api.navigateTo(`/pages/goods/product?id=${this.storeInfo.productId}`)
+            },
+        }
     }
 </script>
 
@@ -44,7 +68,7 @@
     .img {
         width: 339rpx;
         height: 339rpx;
-        border: 1px dotted;
+        // border: 1px dotted;
         box-sizing: border-box;
     }
     .pro-content {
@@ -67,4 +91,16 @@
         color: #F85050;
         font-size: 28rpx;
     }
+    .product-price-none {
+        width: 100%;
+    	color: #f8c499;
+    	float: left;
+    	line-height: 54rpx;
+    	margin-top: 16rpx;
+    	.p-no {
+    		float: left;
+    		font-size: $font-size-24;
+    		color: $text-color;
+    	}
+    }
 </style>

+ 74 - 41
pages/goods/good-activity.vue

@@ -1,58 +1,91 @@
 <template>
-    <view class="common_contant" :style="{padding: isBig ? '' : '24rpx'}">
+    <view
+        class="common_contant"
+        :style="{
+            padding: active.activeType == '2' ? '' : '24rpx',
+            backgroundColor: active.activeType == '1' ? '#F7F7F7' : '#fff'
+        }"
+    >
         <tui-skeleton
-        	v-if="skeletonShow"
-        	backgroundColor="#fafafa"
-        	borderRadius="10rpx"
-        	:isLoading="true"
-        	:loadingType="5"
+           	v-if="skeletonShow"
+            backgroundColor="#fafafa"
+            borderRadius="10rpx"
+            :isLoading="true"
+            :loadingType="5"
         ></tui-skeleton>
-        <view class="" v-else>
-            <view class="img_big" v-if="isBig">
-                <image src="" mode="aspectFill"></image>
+        <view v-else>
+            <view class="img_big" v-if="active.activeType == '2'" @click="activeProducts">
+                <image style="width: 100%;height: 100%;" :src="active.activeImageVos[0]" mode="aspectFill"></image>
             </view>
-            <view class="special_all" v-else>
-                <SpecialItem v-for='item in 3' :key="item"/>
+            <view class="special_all" v-if="active.activeType == '3'">
+                <SpecialItem v-for="(item, index) in active.activeImageVos" :key="index" :activeImage="item" />
+            </view>
+            <view class="product_all" v-if="active.activeType == '1'">
+                <ProGood v-for="item in active.products" :key="item" :storeInfo="item" />
             </view>
         </view>
     </view>
 </template>
 
 <script>
-    import SpecialItem from './components/cm-special.vue'
-    export default {
-        components: {
-            SpecialItem
-        },
-        data() {
-            return {
-                isBig: false,
-                skeletonShow: true,
-                specialList: [], // 活动数据
+import jumpMixins from '@/mixins/jumpMixins.js'
+import SpecialItem from './components/cm-special.vue'
+import ProGood from './components/procurement_good.vue'
+export default {
+    components: {
+        SpecialItem,
+        ProGood
+    },
+    mixins: [jumpMixins],
+    data() {
+        return {
+            skeletonShow: true,
+            active: {} // 活动数据
+        }
+    },
+    mounted() {},
+    onLoad(options) {
+        console.log(options)
+        this.specialInfo(options)
+    },
+    methods: {
+        // 活动数据
+        async specialInfo(options) {
+            try {
+                const { data } = await this.SpecialService.specialInfo({ organizeId: options.organizeId, activeId: options.jumpActiveId })
+                this.active = data.active
+                uni.setNavigationBarTitle({
+                    title: data.active.topic
+                })
+                this.skeletonShow = false
+            } catch (error) {
+                console.log('error', error)
             }
         },
-        mounted() {},
-        onLoad(options) {
-            this.specialInfo(options.jumpActiveId)
+        // 跳转活动商品列表
+        activeProducts() {
+            uni.navigateTo({
+                url: '/pages/goods/active-product?activeImageId=' + this.active.activeImageVos[0].id
+            })
         },
-        methods: {
-            // 网络请求
-			async specialInfo(id){
-				try{
-					const res = await this.SpecialService.specialInfo({organizeId:1,id:id})
-					this.specialList = res.data
-					this.skeletonShow = false
-				}catch(error){
-					console.log('error',error)
-				}
-			}
-        }
     }
+}
 </script>
 
 <style scoped lang="scss">
-    .common_contant {
-        background-color: #FFFFFF;
-        padding: 24rpx;
-    }
-</style>
+.common_contant {
+    height: 100%;
+    box-sizing: border-box;
+}
+.img_big {
+    width: 100vw;
+    height: 100vh;
+}
+.product_all {
+    background: #f7f7f7;
+    display: flex;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    align-items: center;
+}
+</style>

+ 2 - 0
pages/goods/procurement.vue

@@ -83,10 +83,12 @@
 
 <script>
     import proCard from './components/procurement_card.vue'
+    import jumpMixins from '@/mixins/jumpMixins.js'
     export default {
         components: {
             proCard,
         },
+        mixins: [jumpMixins],
         data() {
             return {
                 skeletonShow: true,

+ 0 - 7
pages/tabBar/home/components/banner.vue

@@ -54,13 +54,6 @@ export default {
 			const index = e.detail.current
 			this.current = index
 		},
-		NavToDetailPage(floor) {
-			//跳转
-			// this.$api.FlooryNavigateTo(floor)
-            uni.navigateTo({
-                url: '/pages/goods/commonStoreIndex/index?id='+ floor.id + '&organizeId=' + floor.organizeId
-            })
-		}
 	}
 }
 </script>

+ 11 - 0
services/special.service.js

@@ -18,4 +18,15 @@ export default class SpecialService {
             isLoading: false ,
         })
     }
+    /**
+     * 活动宣传图商品
+     * @param number(imageId) 活动图宣传图id
+     */
+    activeProduct(data = {}) {
+        return this.AjaxService.get({
+            url:'/commodity/MallOrganize/mall/activeProduct', 
+            data, 
+            isLoading: false ,
+        })
+    }
 }