Browse Source

协销模块

zhengjinyi 5 năm trước cách đây
mục cha
commit
88aacc6eb7

+ 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.24:8008'	 //俊俊联调地址
-    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 }else{
     // 生产环境
     URL_CONFIG = 'https://spi.caimei365.com'

+ 8 - 2
components/module/headerNavbar/header-poduct.vue

@@ -7,6 +7,7 @@
 	  	<view class="navbar-icon" v-if="navbarData.showCapsule ? navbarData.showCapsule : true" 
 			  :style="{top:navbarBtn.top + statusBarHeight+'px;',lineHeight:navbarBtn.height+'px;',left:(navbarBtn.right+5)+'px;',width:navbarBtn.height+'px;',height:navbarBtn.height+'px;'}">
 			  <text v-if='haveBack' @click="_goBack" class="iconfont icon-fanhui"></text>
+			  <text v-else  @click="_goHome" class="iconfont icon-shouye"></text>
 	  	</view>
 	</view>
 </template>
@@ -33,10 +34,14 @@
 			},
 			headerTitle:{
 				type:String
-			}
+			},
+			type:{
+				type:String
+			},
 		},
 		data() {
 			return{
+				headerType:'',
 				haveBack: true, // 是否有返回按钮,true 有 false 没有 若从分享页进入则为 false
 			    statusBarHeight: 0, // 状态栏高度
 			    navbarHeight: 0, // 顶部导航栏高度,
@@ -52,7 +57,8 @@
 			}
 		},
 		created() {
-			// console.log(this.headerBtnPosi);
+			this.headerType = this.type
+			console.log(this.headerType);
 			// console.log(this.headerColor)
 			this.fontSizeSetting = this.systeminfo.fontSizeSetting
 			let statusBarHeight = this.systeminfo.statusBarHeight // 状态栏高度

+ 3 - 0
components/module/orderDetails/orderButton.vue

@@ -6,6 +6,7 @@
 				<view class="tips" v-if="shareCode">分享码:{{shareCode}}</view>
 				分享订单
 			</view>	
+			<view class="btn btn-confirm" v-if="btnState.isConfirmation" @click.stop="btnConfirm('confirmation')">确认订单</view>
 			<view class="btn btn-cancel" v-if="btnState.isCancel" @click.stop="btnConfirm('cancel')">取消订单</view>
 			<view class="btn btn-delete" v-if="btnState.isDelete" @click.stop="btnConfirm('delete')">删除订单</view>
 			<view class="btn btn-query" v-if="btnState.isQuery" @click.stop="btnConfirm('query')">查看物流</view>
@@ -43,6 +44,7 @@
 					{label:'isDelete',val:[6],status: true},
 					{label:'isCancel',val:[111],status: true},
 					{label:'isConfirm',val:[33],status: true},
+					{label:'isConfirmation',val:[0],status: true},
 				]
 			}
 		},
@@ -81,6 +83,7 @@
 						isDelete: false,
 						isCancel: false,
 						isConfirm: false,
+						isConfirmation:false,
 					}
 				return 	btnState
 			},

+ 3 - 2
components/module/orderDetails/orderListButton.vue

@@ -3,7 +3,7 @@
 		<!-- 底部按钮 -->
 		<view class="button-content">
 			<view class="btn btn-share"  @click.stop="onShareCode(orderID)">分享订单</view>	
-			<view class="btn btn-confirm" v-if="btnState.isConfirmation" @click.stop="btnConfirm('confirm',orderID)">确认订单</view>
+			<view class="btn btn-confirm" v-if="btnState.isConfirmation" @click.stop="btnConfirm('confirmation',orderID)">确认订单</view>
 			<view class="btn btn-cancel" v-if="btnState.isCancel" @click.stop="btnConfirm('cancel',orderID)">取消订单</view>
 			<view class="btn btn-delete" v-if="btnState.isDelete" @click.stop="btnConfirm('delete',orderID)">删除订单</view>
 			<view class="btn btn-query" v-if="btnState.isQuery" @click.stop="btnConfirm('query',orderID)">查看物流</view>
@@ -78,7 +78,8 @@
 						isDelete: false,
 						isCancel: false,
 						isConfirm: false,
-						isShare: true
+						isShare: true,
+						isConfirmation:false,
 					}
 				return 	btnState
 			},

+ 1 - 0
market/pages/order/order-details.vue

@@ -140,6 +140,7 @@
 						break
 					case 'confirm':
 						this.handOrderConfirm()
+						break
 				}
 			},
 			handOrderConfirm(){//确认订单

+ 25 - 9
pages/goods/product.vue

@@ -1,6 +1,13 @@
 <template>
 	<view class="product">
-		<header-back  :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :headerColor="headerColor" :page='backPage'></header-back>
+		<header-poduct  v-if="isHeaderPoduct"
+						:systeminfo='systeminfo' 
+						:navbar-data='nvabarData' 
+						:headerBtnPosi ="headerBtnPosi" 
+						:headerColor="headerColor" 
+						:type="isShareType"
+						:page='backPage'>
+		</header-poduct>
 		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="9"></tui-skeleton>
 		<view class="container-product tui-skeleton">
 			<view class="product-top">
@@ -140,7 +147,7 @@
 						<view class="item-bt" @click="buyProductCart()">
 							<image src="../../static/icon-cart-active@3x.png"></image>
 							<text>购物车</text>
-							<text  	v-if="goodsData.cartCount > 0"
+							<text  	v-if="hasLogin"
 									class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
 									:class="[goodsData.cartCount < 10 ? 'goleft':'']">
 									{{ goodsData.cartCount >= 100 ? '99+': goodsData.cartCount}}
@@ -197,7 +204,7 @@
 
 <script>
 	import { mapState,mapMutations } from 'vuex'
-	import headerBack from '@/components/module/headerNavbar/header-poduct' 		 //自定义导航
+	import headerPoduct from '@/components/module/headerNavbar/header-poduct' 		 //自定义导航
 	import uniStars from '@/components/uni-stars/uni-stars.vue'
 	import parser from "@/components/jyf-Parser/index" //富文本处理
 	import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
@@ -210,7 +217,7 @@
 	var isPreviewImg;
 	export default{
 		components:{
-			headerBack,
+			headerPoduct,
 			parser,
 			tuiSkeleton,
 			supplierDetails,
@@ -226,7 +233,8 @@
 				specClass: '',//规格弹窗css类,控制开关动画
 				isBtnType:'',
 				current:0,
-				telPhone:'',
+				isShareType:'',
+				isHeaderPoduct:false,
 				navbarFiexd:'none',
 				ladderPriceFlag:'',
 				ladderPriceList:'',
@@ -267,8 +275,10 @@
 			}
 		},
 		onLoad(option) {
-			let self = this;
 			this.productID = option.id;//获取商品ID
+			this.isShareType = option.type
+			this.isHeaderPoduct = true
+			console.log(this.isShareType)
 			if(option.page == 2){
 				this.backPage = option.page
 			}
@@ -292,7 +302,10 @@
 					this.product.imageList.forEach(item =>{
 						this.productImage.push(item.image);
 					})
-					this.goodsData.cartCount = this.product.productCount
+					//购物车数量
+					if(this.product.productCount>0){
+						this.goodsData.cartCount = this.product.productCount
+					}
 					//处理阶梯价格
 					if(this.product.ladderPriceList!=null){
 						this.ladderPriceList = this.product.ladderPriceList;
@@ -479,6 +492,9 @@
 				})
 				return systeminfo
 			},
+			getOptionFn(e){
+				this.isShareType = e.type
+			},
 			discard(){
 				//丢弃
 			}
@@ -511,14 +527,14 @@
 		    }
 			return {
 			  title: `${this.product.name}`,
-			  path: `pages/goods/product?id=${this.productID}`,
+			  path: `pages/goods/product?type=share&id=${this.productID}`,
 			  imageUrl:`${this.productImage[0]}`
 			}
 		},
 		onShow() {
 			this.$api.getStorage().then((resolve) => {
 				this.userID = resolve.userID ? resolve.userID : '';	
-				this.userIdentity = resolve.userIdentity
+				this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 3
 				console.log(this.userIdentity)
 				if (isPreviewImg) {
 					isPreviewImg = false;

+ 16 - 0
pages/user/order/order-details.vue

@@ -142,6 +142,10 @@
 						break
 					case 'confirm':
 						this.handOrderConfirm()
+						break
+					case 'confirm':
+						this.handOrderConfirmation()
+						break
 				}
 			},
 			handOrderConfirm(){//确认收货
@@ -154,6 +158,18 @@
 					})
 				})
 			},
+			handOrderConfirmation (){//确认订单
+				this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
+					affirmOrder({orderID:this.orderID}).then(response =>{
+						this.$util.msg(response.msg,2000,true,'success');
+						setTimeout(() => {
+							this.getOrderDatainit(this.currentTab)
+						},2000)
+					}).catch(response =>{
+						this.$util.msg(response.msg,2000)
+					})
+				})
+			},
 			handOrderDetele(){//删除订单
 				this.$util.modal('提示','确认删除该订单吗?','确定','取消',true,() =>{
 					deleteOrder({orderID:this.orderID}).then(response =>{

+ 15 - 0
pages/user/order/order-list.vue

@@ -306,6 +306,9 @@
 					case 'confirm':
 						this.handOrderConfirm(data.orderId);
 						break
+					case 'confirmation':
+						this.handOrderConfirmation(data.orderId);
+						break
 				}
 			},
 			handOrderConfirm (id){//确认收货
@@ -320,6 +323,18 @@
 					})
 				})
 			},
+			handOrderConfirmation (id){//确认订单
+				this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
+					affirmOrder({orderID:id}).then(response =>{
+						this.$util.msg(response.msg,2000,true,'success');
+						setTimeout(() => {
+							this.getOrderDatainit(this.currentTab)
+						},2000)
+					}).catch(response =>{
+						this.$util.msg(response.msg,2000)
+					})
+				})
+			},
 			handOrderDetele(id){//删除订单
 				this.$util.modal('提示','确认删除该订单吗?','确定','取消',true,() =>{
 					deleteOrder({orderID:id}).then(response =>{