Browse Source

商品详情修改

zhengjinyi 5 years ago
parent
commit
fba1991d39

+ 2 - 2
common/config/config.js

@@ -1,9 +1,9 @@
 let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-	URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
+	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.26:8008'	 //超超联调地址
-    // URL_CONFIG = 'https://spi-b.caimei365.com'//采美测试地址
+    URL_CONFIG = 'https://spi-b.caimei365.com'//采美测试地址
 }else{
     // 生产环境
     URL_CONFIG = 'https://spi.caimei365.com'

+ 79 - 0
components/cm-module/productDetails/cm-attributes.vue

@@ -0,0 +1,79 @@
+<template name="cm-attributes">
+	<!-- 商品详情价格判断 -->
+	<view class="cm-attributes">
+		<view class="wrap-active" v-if="product.actStatus == 1">
+			<text>活动时间:</text>
+			<text>{{ product.beginTime }} ~ {{ product.endTime }}</text>
+		</view>
+		<view class="wrap-label" v-if="product.tagsList.length>0">
+			<view class="label-a tui-skeleton-fillet" v-for="(label,index) in  product.tagsList" :key="index">{{label}}</view>
+		</view>
+		<view class="wrap-label"  v-if="goodsData.isNoneDisabled">
+			<view class="isLower">此商品已{{goodsData.disabledText}},请浏览以下推荐商品~</view>
+		</view>
+		<view class="wrap-info">
+			<view class="info-viewT" :class="goodsData.isNoneDisabled ? 'none' : ''">
+				<view class="info-viewL tui-skeleton-fillet">品牌:<text>{{product.brandName == null? '其他' : product.brandName}}</text></view>
+				<view class="info-viewR tui-skeleton-fillet">包装规格:<text>{{product.unit}}</text></view>														
+			</view>
+		</view>
+		<view class="wrap-seve" :class="goodsData.isNoneDisabled ? 'none' : ''">
+			<text class="tui-skeleton-rect">服务:</text>
+			<text class="iconfont icon-dui tui-skeleton-rect"><text class="text">无忧退货</text></text>
+			<text class="iconfont icon-dui tui-skeleton-rect"><text class="text">快速退款</text></text>
+			<text class="iconfont icon-dui tui-skeleton-rect"><text class="text">正品保证</text></text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default{
+		name:'cm-attributes',
+		props:{
+			product:{
+				type:Object,
+				default: {}
+			},
+			goodsData:{
+				type:Object,
+				default: {}
+			},
+		},
+		data() {
+			return{
+				
+			}
+		},
+		created() {
+			
+		},
+		methods:{
+		},
+		
+	}
+</script>
+
+<style lang="scss">	
+
+</style>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 184 - 0
components/cm-module/productDetails/cm-price.vue

@@ -0,0 +1,184 @@
+<template name="cm-price">
+	<!-- 商品详情价格判断 -->
+	<view class="wrap-main">
+		<view class="" v-if="userIdentity == 1">
+			<view class="wrap-main-price">
+				<view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
+					<view class="p-active" v-if="product.actStatus == 1">
+						<image class="icon-active" src="../../static/temp/icon-active.png" mode="" ></image>
+					</view>
+					<view class="p-price tui-skeleton-fillet">
+						<text class="txt sm">¥</text>
+						<text class="txt big">{{retailPrice}}</text>
+						<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
+					</view>
+					<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
+				</view>
+				<view class="wrap-ladder" v-else>
+					<view class="ladder-text">
+						<text class="ladder-h1">说明:</text>
+						<text class="ladder-p">本商品有以下优惠购物方案</text>
+					</view>
+					<view class="ladder-main tui-skeleton-fillet">
+						<view class="ladder-left">
+							<view class="ladder-b">起订量:</view>
+							<view class="ladder-b">价格:</view>
+						</view>
+						<view class="ladder-right">
+							<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
+								<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
+								<view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>	
+		</view>
+		<view class="" v-if="userIdentity == 4">
+			<view class="wrap-main-pricenone" v-if="product.price1TextFlag == 1">
+				<text>未公开价格</text>
+			</view>
+			<view class="wrap-main-pricenone" v-if="product.price1TextFlag == 2">
+				<text>未公开价格</text>
+			</view>
+			<view class="wrap-main-none" v-if="product.price1TextFlag == 2" @click.stop="goUpgradeApply">
+				<text>上传营业执照升级为会员机构即可查看价格 >></text>
+			</view>
+			<view class="wrap-main-price" v-else>
+				<view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
+					<view class="p-active" v-if="product.actStatus == 1">
+						<image class="icon-active" src="../../static/temp/icon-active.png" mode="" ></image>
+					</view>
+					<view class="p-price tui-skeleton-fillet">
+						<text class="txt sm">¥</text>
+						<text class="txt big">{{retailPrice}}</text>
+						<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
+					</view>
+					<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
+				</view>
+				<view class="wrap-ladder" v-else>
+					<view class="ladder-text">
+						<text class="ladder-h1">说明:</text>
+						<text class="ladder-p">本商品有以下优惠购物方案</text>
+					</view>
+					<view class="ladder-main tui-skeleton-fillet">
+						<view class="ladder-left">
+							<view class="ladder-b">起订量:</view>
+							<view class="ladder-b">价格:</view>
+						</view>
+						<view class="ladder-right">
+							<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
+								<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
+								<view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>					
+		</view>
+		<view class="" v-if="userIdentity == 2">
+			<view class="wrap-main-pricenone" v-if="product.price1TextFlag == 1">
+				<text>未公开价格</text>
+			</view>
+			<view class="wrap-main-price" v-else>
+				<view class="p-main" v-if="product.ladderPriceFlag == '0' || product.actStatus == 1">
+					<view class="p-active" v-if="product.actStatus == 1">
+						<image class="icon-active" src="../../static/temp/icon-active.png" mode="" ></image>
+					</view>
+					<view class="p-price tui-skeleton-fillet">
+						<text class="txt sm">¥</text>
+						<text class="txt big">{{retailPrice}}</text>
+						<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
+					</view>
+					<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
+				</view>
+				<view class="wrap-ladder" v-else>
+					<view class="ladder-text">
+						<text class="ladder-h1">说明:</text>
+						<text class="ladder-p">本商品有以下优惠购物方案</text>
+					</view>
+					<view class="ladder-main tui-skeleton-fillet">
+						<view class="ladder-left">
+							<view class="ladder-b">起订量:</view>
+							<view class="ladder-b">价格:</view>
+						</view>
+						<view class="ladder-right">
+							<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
+								<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
+								<view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>	
+		</view>
+	</view>
+</template>
+
+<script>
+	export default{
+		name:'cm-price',
+		props:{
+			product:{
+				type:Object,
+				default: {}
+			},
+			userIdentity: {
+				type: Number,
+				default: 2
+			},
+			ladderPriceList:{
+				type: Array,
+				default:[]
+			},
+			retailPrice:{
+				type:String,
+				default:0.00
+			},
+			smallMoney:{
+				type:String,
+				default:0.00
+			},
+			minBuyNumber:{
+				type: Number,
+				default: 1
+			}
+		},
+		data() {
+			return{
+				
+			}
+		},
+		created() {
+			
+		},
+		methods:{
+		},
+		
+	}
+</script>
+
+<style lang="scss">	
+
+</style>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 0 - 6
pages.json

@@ -168,12 +168,6 @@
 				"navigationBarTitleText": "注册",
 				"navigationStyle":"custom"
 			}
-		},{
-			"path": "pages/login/registers",
-			"style": {
-				"navigationBarTitleText": "注册",
-				"navigationStyle":"custom"
-			}
 		},{
 			"path": "pages/login/apply",
 			"style": {

+ 21 - 141
pages/goods/product.vue

@@ -40,142 +40,19 @@
 							<view v-if="!hasLogin" class="p-login tui-skeleton-fillet">
 								<text @click.stop="navToLogin">登录查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
 							</view>
-							<view class="wrap-main" v-else>
-								<view class="" v-if="userIdentity == 1">
-									<view class="wrap-main-price">
-										<view class="p-main" v-if="ladderPriceFlag == '0' || product.actStatus == 1">
-											<view class="p-active" v-if="product.actStatus == 1">
-												<image class="icon-active" src="../../static/temp/icon-active.png" mode="" ></image>
-											</view>
-											<view class="p-price tui-skeleton-fillet">
-												<text class="txt sm">¥</text>
-												<text class="txt big">{{retailPrice}}</text>
-												<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
-											</view>
-											<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
-										</view>
-										<view class="wrap-ladder" v-else>
-											<view class="ladder-text">
-												<text class="ladder-h1">说明:</text>
-												<text class="ladder-p">本商品有以下优惠购物方案</text>
-											</view>
-											<view class="ladder-main tui-skeleton-fillet">
-												<view class="ladder-left">
-													<view class="ladder-b">起订量:</view>
-													<view class="ladder-b">价格:</view>
-												</view>
-												<view class="ladder-right">
-													<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
-														<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
-														<view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
-													</view>
-												</view>
-											</view>
-										</view>
-									</view>	
-								</view>
-								<view class="" v-if="userIdentity == 4">
-									<view class="wrap-main-pricenone" v-if="product.price1TextFlag == 1">
-										<text>未公开价格</text>
-									</view>
-									<view class="wrap-main-pricenone" v-if="product.price1TextFlag == 2">
-										<text>未公开价格</text>
-									</view>
-									<view class="wrap-main-none" v-if="product.price1TextFlag == 2" @click.stop="goUpgradeApply">
-										<text>上传营业执照升级为会员机构即可查看价格 >></text>
-									</view>
-									<view class="wrap-main-price" v-else>
-										<view class="p-main" v-if="ladderPriceFlag == '0' || product.actStatus == 1">
-											<view class="p-active" v-if="product.actStatus == 1">
-												<image class="icon-active" src="../../static/temp/icon-active.png" mode="" ></image>
-											</view>
-											<view class="p-price tui-skeleton-fillet">
-												<text class="txt sm">¥</text>
-												<text class="txt big">{{retailPrice}}</text>
-												<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
-											</view>
-											<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
-										</view>
-										<view class="wrap-ladder" v-else>
-											<view class="ladder-text">
-												<text class="ladder-h1">说明:</text>
-												<text class="ladder-p">本商品有以下优惠购物方案</text>
-											</view>
-											<view class="ladder-main tui-skeleton-fillet">
-												<view class="ladder-left">
-													<view class="ladder-b">起订量:</view>
-													<view class="ladder-b">价格:</view>
-												</view>
-												<view class="ladder-right">
-													<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
-														<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
-														<view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
-													</view>
-												</view>
-											</view>
-										</view>
-									</view>					
-								</view>
-								<view class="" v-if="userIdentity == 2">
-									<view class="wrap-main-pricenone" v-if="product.price1TextFlag == 1">
-										<text>未公开价格</text>
-									</view>
-									<view class="wrap-main-price" v-else>
-										<view class="p-main" v-if="ladderPriceFlag == '0' || product.actStatus == 1">
-											<view class="p-active" v-if="product.actStatus == 1">
-												<image class="icon-active" src="../../static/temp/icon-active.png" mode="" ></image>
-											</view>
-											<view class="p-price tui-skeleton-fillet">
-												<text class="txt sm">¥</text>
-												<text class="txt big">{{retailPrice}}</text>
-												<text class="txt big">{{smallMoney== '0'?'.00':smallMoney}}</text>
-											</view>
-											<view class="p-minBuy">起订量:<text class="min-text">{{minBuyNumber}}</text></view>
-										</view>
-										<view class="wrap-ladder" v-else>
-											<view class="ladder-text">
-												<text class="ladder-h1">说明:</text>
-												<text class="ladder-p">本商品有以下优惠购物方案</text>
-											</view>
-											<view class="ladder-main tui-skeleton-fillet">
-												<view class="ladder-left">
-													<view class="ladder-b">起订量:</view>
-													<view class="ladder-b">价格:</view>
-												</view>
-												<view class="ladder-right">
-													<view class="ladder-li" v-for="(ladder,index) in  ladderPriceList" :key="index">
-														<view class="ladder-a">{{ladder.buyNumRangeShow}}</view>
-														<view class="ladder-a">¥{{ladder.buyPrice.toFixed(2)}}</view>
-													</view>
-												</view>
-											</view>
-										</view>
-									</view>	
-								</view>
+							<view class="cm-price" v-else>
+								<cm-price v-if="isRequest"
+										  :product="product"
+										  :userIdentity="userIdentity"
+										  :ladderPriceList="ladderPriceList"
+										  :retailPrice="retailPrice"
+										  :smallMoney="smallMoney"
+										  :minBuyNumber="minBuyNumber"/>
 							</view>
 						</view>
 					</view>
-					<view class="wrap-active" v-if="product.actStatus == 1">
-						<text>活动时间:</text>
-						<text>{{ product.beginTime }} ~ {{ product.endTime }}</text>
-					</view>
-					<view class="wrap-label" v-if="product.tagsList.length>0">
-						<view class="label-a tui-skeleton-fillet" v-for="(label,index) in  product.tagsList" :key="index">{{label}}</view>
-					</view>
-					<view class="wrap-label"  v-if="goodsData.isNoneDisabled">
-						<view class="isLower">此商品已{{disabledText}},请浏览以下推荐商品~</view>
-					</view>
-					<view class="wrap-info">
-						<view class="info-viewT" :class="goodsData.isNoneDisabled ? 'none' : ''">
-							<view class="info-viewL tui-skeleton-fillet">品牌:<text>{{product.brandName == null? '其他' : product.brandName}}</text></view>
-							<view class="info-viewR tui-skeleton-fillet">包装规格:<text>{{product.unit}}</text></view>														
-						</view>
-					</view>
-					<view class="wrap-seve" :class="goodsData.isNoneDisabled ? 'none' : ''">
-						<text class="tui-skeleton-rect">服务:</text>
-						<text class="iconfont icon-dui tui-skeleton-rect"><text class="text">无忧退货</text></text>
-						<text class="iconfont icon-dui tui-skeleton-rect"><text class="text">快速退款</text></text>
-						<text class="iconfont icon-dui tui-skeleton-rect"><text class="text">正品保证</text></text>
+					<view class="attributes">
+						<cm-attributes v-if="isRequest":product="product" :goodsData="goodsData" />
 					</view>
 				</view>			
 			</view>
@@ -286,6 +163,8 @@
 <script>
 	import { mapState,mapMutations } from 'vuex'
 	import headerPoduct from '@/components/cm-module/headerNavbar/header-poduct' 		 //自定义导航
+	import cmPrice from "@/components/cm-module/productDetails/cm-price.vue" //价格显示
+	import cmAttributes from "@/components/cm-module/productDetails/cm-attributes.vue" //规格信息
 	import authorize from '@/common/config/authorize.js'
 	import uniStars from '@/components/uni-stars/uni-stars.vue'
 	import parser from "@/components/jyf-Parser/index" //富文本处理
@@ -296,7 +175,6 @@
 	import wxLogin from "@/common/config/wxLogin.js"
 	import { queryProductDetils } from "@/api/product.js" 
 	import { shoppingAddCart } from "@/api/cart.js" 
-
 	var isPreviewImg;
 	export default{
 		components:{
@@ -305,7 +183,9 @@
 			tuiSkeleton,
 			supplierDetails,
 			recommend,
-			evaluate
+			evaluate,
+			cmPrice,
+			cmAttributes
 		},
 		data(){
 			return{			
@@ -315,6 +195,7 @@
 				mode:'round',
 				specClass: '',//规格弹窗css类,控制开关动画
 				isBtnType:'',
+				isRequest:false,
 				current:0,
 				isShareType:'',
 				isHeaderPoduct:false,
@@ -329,7 +210,6 @@
 				isStock:false,
 				disabled:false,
 				isNoneDisabled:false,
-				disabledText:'',
 				tabCurrentIndex:0,
 				userID:'',
 				productID:0,
@@ -411,12 +291,12 @@
 						this.isNoneDisabled = true
 						this.tabCurrentIndex = 2;// 页面显示是默认选中第一
 						this.isRecommend = true
-						this.disabledText = '下架'
+						this.goodsData.disabledText = '下架'
 					}else{
 						this.disabled = false
 						this.isNoneDisabled = false
 						this.tabCurrentIndex = 0;// 页面显示是默认选中第三
-						this.disabledText = ''
+						this.goodsData.disabledText = ''
 					}
 					if(this.userIdentity == 4){
 						if(this.product.price1TextFlag == "2"){
@@ -429,14 +309,14 @@
 						this.disabled = true
 					}
 					this.goodsData.disabled = this.disabled
-					console.log(this.goodsData.disabled)
 					this.goodsData.isNoneDisabled = this.isNoneDisabled
 					if(this.product.validFlag =='3'){
-						this.disabledText = '下架'
+						this.goodsData.disabledText = '下架'
 					}
 					if(this.stock == 0){
-						this.disabledText = '售罄'
+						this.goodsData.disabledText = '售罄'
 					}
+					this.isRequest = true
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})

+ 24 - 24
pages/login/register.vue

@@ -60,7 +60,7 @@
 					<input class="row-input" type="password" name="input" v-model="passwordCheck" placeholder="请确认密码" maxlength="16"/>
 				</view>
 			</view>
-			<view class="register-fiexd clearfix">
+			<view class="register-main clearfix">
 				<view class="register-agree">
 					<view class="agree-text"  @tap.stop="agreeCheck()">
 						<button class="checkbox iconfont" :class="[isCheck?'icon-gouxuan':'icon-weigouxuan']"></button> 
@@ -659,6 +659,29 @@
 		.register-main{
 			width: 100%;
 			height: auto;
+			.register-agree{
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				margin: 60rpx 0 40rpx 0;
+				.agree-text{
+					.checkbox{
+						float: left;
+						margin: 4rpx 6rpx 0 0;
+						color: #999999;
+						font-size: $font-size-32;
+						&.icon-gouxuan{
+							color: $color-system;
+						}
+					}
+					font-size: 20rpx;
+					line-height: 44rpx;
+					color: #999999;
+					text{
+						color:#0091FF;
+					}
+				}
+			}
 			.register-logo{
 				width: 100%;
 				display: flex;
@@ -1071,29 +1094,6 @@
 				left: 0;
 				z-index: 999;
 				background: #FFFFFF;
-				.register-agree{
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-					margin: 32rpx 0;
-					.agree-text{
-						.checkbox{
-							float: left;
-							margin: 4rpx 6rpx 0 0;
-							color: #999999;
-							font-size: $font-size-32;
-							&.icon-gouxuan{
-								color: $color-system;
-							}
-						}
-						font-size: 20rpx;
-						line-height: 44rpx;
-						color: #999999;
-						text{
-							color:#0091FF;
-						}
-					}
-				}
 			}
 			.register-btn{
 				width: 702rpx;