zhengjinyi %!s(int64=2) %!d(string=hai) anos
pai
achega
222ee1dc62

+ 17 - 20
pages/goods/good-floor.vue

@@ -63,41 +63,38 @@
 				wxLogin.wxLoginAuthorize()
 			}
 			this.pageId = option.linkId
-			this.$api.getComStorage('userInfo').then((resolve) =>{
-				this.userId = resolve.userId ? resolve.userId : 0;
-				this.shopId = resolve.shopId ? resolve.shopId : 0;
-				this.userIdentity = resolve.userIdentity
-				this.GetInstrumentPageData();
-			}).catch(error =>{
-				this.GetInstrumentPageData();
-			})
-			setTimeout(()=>{
-				this.skeletonShow = false
-			},2000)
+			this.GetInstrumentPageDataa(this.pageId)
 		},
 		methods:{
-			GetInstrumentPageData(){//获取楼层数据
-				this.CommonService.GetInstrumentPageData({pageId:this.pageId,userId:this.userId,source:2}).then(response =>{
+			async GetInstrumentPageDataa(pageId){//获取楼层数据
+				const userInfo = await this.$api.getStorage()
+				this.userId = userInfo.userId ? userInfo.userId : 0
+				this.shopId = userInfo.shopId ? userInfo.shopId : 0
+				this.userIdentity = userInfo.userIdentity
+				this.CommonService.GetInstrumentPageData({pageId:pageId,userId:this.userId,source:2}).then(response =>{
 					let data = response.data
-					this.typeSort = data.typeSort
-					this.pageList = data.floorList
 					uni.setStorageSync('pageLabel',`${data.contentLabel}`)
-					this.GetHomeInit()
+					this.GetHomeInit(data.typeSort,data.floorList)
+					
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			GetHomeInit(){//金刚区分类
-				this.CommonService.GetFirstClassly({typeSort:this.typeSort,source:'crm'}).then(response =>{
+			GetHomeInit(typeSort,floorList){//金刚区分类
+				this.CommonService.GetFirstClassly({typeSort:typeSort,source:'crm'}).then(response =>{
 					this.navBarsList = response.data
-					this.isRequest =true
+					this.pageList = floorList
+					setTimeout(()=>{
+						this.skeletonShow = false
+						this.isRequest =true
+					},200)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
 			},
 			setHeaderBtnPosi(){
 				// 获得胶囊按钮位置信息
-				let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
+				let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
 				return headerBtnPosi
 			},
 			setSysteminfo(){

+ 2 - 1
pages/login/information.vue

@@ -620,7 +620,8 @@ export default {
 					mainProduct: this.mainProduct,
 					fax: this.clubFax,
 					contractPhone: this.clubTelePhone,
-					profile: this.profile
+					profile: this.profile,
+					serviceProviderId:0
 				}
 			}
 			this.UserService.OrganizationUpdate(params)

+ 1 - 1
pages/search/search-order.vue

@@ -511,7 +511,7 @@ export default {
 		handCenceConfirm(orderId) {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: orderId })
+				this.OrderService.CancelOrder({ orderId: orderId , userIdentity : 0})
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						setTimeout(() => {

+ 12 - 4
pages/seller/login/apply.vue

@@ -379,6 +379,7 @@ export default {
 			isPreviewImage: false, //预览图片开关
 			userId: '', //用户ID
 			clubId: '', //会所ID
+			serviceProviderId:0, //协销Id
 			clubContact: '', //联系人姓名
 			mobile: '', //联系人手机号
 			contractEmail: '', //邮箱
@@ -428,9 +429,15 @@ export default {
 	},
 	onLoad(option) {
 		this.userId = option.userID
-		this.organizationInfo()
+		this.initGetStotage(option.userID)
 	},
 	methods: {
+		async initGetStotage(userId) {
+			// 初始化
+			const userInfo = await this.$api.getStorage()
+			this.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
+			this.organizationInfo(userId)
+		},
 		hanldNavigateBack() {
 			this.$util.modal('', '资料尚未提交审核,确定放弃升级吗?', '确定', '取消', true, () => {
 				uni.navigateBack({
@@ -438,8 +445,8 @@ export default {
 				})
 			})
 		},
-		organizationInfo() {
-			this.UserService.OrganizationUpdateModifyInfo({ userId: this.userId })
+		organizationInfo(userId) {
+			this.UserService.OrganizationUpdateModifyInfo({ userId: userId })
 				.then(response => {
 					let organizationClub = response.data.club
 					let organizationUser = response.data.user
@@ -565,7 +572,8 @@ export default {
 					linkMan: this.clubContact,
 					fax: this.clubFax,
 					contractPhone: this.clubTelePhone,
-					profile: this.companyPprofile
+					profile: this.companyPprofile,
+					serviceProviderId:this.serviceProviderId
 				}
 				this.UserService.OrganizationUpdate(params)
 					.then(response => {

+ 11 - 3
pages/seller/login/information.vue

@@ -299,6 +299,7 @@
 				userId:'',				//机构的userId
 				clubId:'',				//会所ID
 				mobile:'',				//联系人手机号
+				serviceProviderId:0,	//协销Id
 				userIdentity:'',		//机构用户类型
 				contractEmail:'',				//邮箱
 				clubName:'',	 		//机构名称
@@ -354,9 +355,15 @@
 		onLoad(option) {
 			console.log(option)
 			this.userId = option.userID
-			this.organizationInfo()
+			this.initGetStotage(option.userID)
 		},
 		methods:{
+			async initGetStotage(userId) {
+				// 初始化
+				const userInfo = await this.$api.getStorage()
+				this.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
+				this.organizationInfo(userId)
+			},
 			hanldNavigateBack(){
 				this.$util.modal('','确定放弃本次修改吗?','确定','取消',true,() =>{
 					uni.navigateBack({
@@ -364,8 +371,8 @@
 					})
 				})
 			},
-			organizationInfo(){
-				this.UserService.OrganizationUpdateModifyInfo({userId:this.userId}).then(response =>{
+			organizationInfo(userId){
+				this.UserService.OrganizationUpdateModifyInfo({userId:userId}).then(response =>{
 					let organizationClub = response.data.club
 					let organizationUser = response.data.user
 					this.clubId = organizationUser.clubId
@@ -473,6 +480,7 @@
 						fax:this.clubFax,
 						contractPhone:this.clubTelePhone,
 						profile : this.companyPprofile,
+						serviceProviderId:this.serviceProviderId
 					}
 				this.UserService.OrganizationUpdate(params).then(response =>{
 					this.$util.msg('修改成功',2000,true,'success')

+ 48 - 10
pages/seller/order/create-order.vue

@@ -191,6 +191,7 @@
 				],
 				contentModalText: '', //操作文字提示语句
 				modal: false,
+				showModalstauts:1,
 				isIphoneX:this.$store.state.isIphoneX,
 				cartParam: {// 购物车立即结算确认订单参数
 					skuIds:0,		// 商品Id(逗号隔开)
@@ -501,17 +502,9 @@
 				this.modal = true
 				this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
 			},
-			handleClick(e){
-				//确认提交
-				if (e.index == 1) {
-					this.SellerCreateOrderSubmit()
-				}
-				this.modal = false
-			},
 			SellerCreateOrderSubmit(){
 				//提交订单
 				if(this.isSubLoading){ return }
-				
 				this.confirmParam.orderInfo = this.goodsData.map(el => {
 					let productInfo = []
 					el.cartList.forEach(pros => {
@@ -524,15 +517,49 @@
 					})
 					return {splitCode:el.splitCode,shopId:el.shopId,note:el.note?el.note:'',productInfo:productInfo}
 				})
+				console.log('confirmParam1',this.confirmParam)
 				this.confirmParam.payInfo.postage = parseInt(this.handleFreightData.postage).toFixed(2)
 				this.confirmParam.payInfo.postageFlag = parseInt(this.handleFreightData.postageFlag)
 				this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
 				this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
 				this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
 				this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
-				console.log(this.confirmParam)
+				console.log('confirmParam',this.confirmParam)
 				this.isSubLoading = true	
-				this.SellerService.SellerCreateOrderSubmit(this.confirmParam).then(response =>{
+				this.hanldeOrderVerify(this.confirmParam)
+			},
+			hanldeOrderVerify(params){// 校验购买资质的验证
+				console.log('params',params)
+				this.OrderService.createdOrderCerify(params).then(response =>{
+					if(response.data.code === -1){
+						this.modal = true
+						this.showModalstauts = 2
+						this.isSubLoading = false
+						this.contentModalText = '订单内存在械字号三类商品,需要拥有医疗执业许可证的医美机构才能购买。建议升级医美机构后再下单,否则会导致订单退款或影响发货。'  //操作文字提示语句
+						this.modalButton=[
+							{
+								text: '取消',
+								type: 'gray',
+								plain: true //是否空心
+							},
+							{
+								text: '继续提交',
+								customStyle: {
+									color: '#fff',
+									bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
+								},
+								plain: false
+							}
+						]
+					}else{
+						this.hanldeOrderSubmit(params)
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			hanldeOrderSubmit(params){// 提交订单
+				this.SellerService.SellerCreateOrderSubmit(params).then(response =>{
 					const data = response.data
 					if(data.code === 1){
 						this.$util.msg('支付成功',2000,true,'success')
@@ -600,6 +627,17 @@
 					this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
 				}
 			},
+			handleClick(e){
+				//确认提交
+				if (e.index == 1) {
+					if(this.showModalstauts == 2){
+						this.hanldeOrderSubmit(this.confirmParam)
+					}else{
+						this.SellerCreateOrderSubmit()
+					}
+				}
+				this.modal = false
+			},
 			handleSecondFlag(){// 二手订单勾选返佣
 				this.rebatecheck = !this.rebatecheck
 				if(this.rebatecheck){

+ 1 - 1
pages/seller/order/order-club-details.vue

@@ -431,7 +431,7 @@ export default {
 		handCenceConfirm() {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: this.orderId })
+				this.OrderService.CancelOrder({ orderId: this.orderId ,userIdentity : 1})
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						this.initOrderDetaileData()

+ 1 - 1
pages/seller/order/order-details.vue

@@ -433,7 +433,7 @@ export default {
 		handCenceConfirm() {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: this.orderId })
+				this.OrderService.CancelOrder({ orderId: this.orderId ,userIdentity : 1})
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						this.initOrderDetaileData()

+ 1 - 1
pages/seller/order/order-historylist.vue

@@ -619,7 +619,7 @@ export default {
 		handCenceConfirm(orderId) {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: orderId })
+				this.OrderService.CancelOrder({ orderId: orderId , userIdentity : 1})
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						setTimeout(() => {

+ 2 - 1
pages/seller/order/order-list.vue

@@ -402,6 +402,7 @@ export default {
 	methods: {
 		async initGetStotage() {
 			const userInfo = await this.$api.getStorage()
+			this.userId = userInfo.userId ? userInfo.userId : 0
 			this.manager = userInfo.manager ? userInfo.manager : 0
 			this.getOrderDatainit(this.currentTab)
 		},
@@ -672,7 +673,7 @@ export default {
 		handCenceConfirm(orderId) {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: orderId })
+				this.OrderService.CancelOrder({ orderId: orderId ,userIdentity : 1 })
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						setTimeout(() => {

+ 1 - 1
pages/seller/order/search-order.vue

@@ -574,7 +574,7 @@ export default {
 		handCenceConfirm(orderId) {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: orderId })
+				this.OrderService.CancelOrder({ orderId: orderId , userIdentity : 1})
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						setTimeout(() => {

+ 44 - 3
pages/user/order/create-order.vue

@@ -623,7 +623,38 @@
 				this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
 				console.log(this.confirmParam)
 				this.isSubLoading = true	 
-				this.OrderService.CreatedOrderSubmit(this.confirmParam).then(response =>{
+				this.hanldeOrderVerify(this.confirmParam)
+			},
+			hanldeOrderVerify(params){// 校验购买资质的验证
+				this.OrderService.createdOrderCerify(params).then(response =>{
+					if(response.data.code === -1){
+						this.showModal = true
+						this.contentModalText = '订单内存在械字号三类商品,需要拥有医疗执业许可证的医美机构才能购买。建议升级医美机构后再下单,否则会导致订单退款或影响发货。'  //操作文字提示语句
+						this.showModalstauts = 2
+						this.modalButton=[
+							{
+								text: '继续提交',
+								type: 'gray',
+								plain: true //是否空心
+							},
+							{
+								text: '去升级',
+								customStyle: {
+									color: '#fff',
+									bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
+								},
+								plain: false
+							}
+						]
+					}else{
+						this.hanldeOrderSubmit(params)
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			hanldeOrderSubmit(params){// 提交订单
+				this.OrderService.CreatedOrderSubmit(params).then(response =>{
 					let data = response.data
 					// 友盟埋点收集机构自主提交订单
 					if(process.env.NODE_ENV != 'development'){
@@ -711,10 +742,17 @@
 				}
 			},
 			handleClick(e){// 采购量过小提示弹窗
-				if (e.index == 1) {
-					if( this.showModalstauts == 1){
+				if (e.index === 1) {
+					if( this.showModalstauts === 1){
 						this.showModal = false
 						this.handleClickOrderSubmitMit()
+					}else if(this.showModalstauts === 2){
+						this.showModal = false
+						this.isSubLoading = false
+						this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
+						this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
+						this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
+						this.$api.navigateTo('/pages/login/apply')
 					}else{
 						this.showModal = false
 						this.handleClickHeHeMiniApplet()
@@ -723,6 +761,9 @@
 					if( this.showModalstauts == 1 ){
 						this.showModal = false
 						this.handleClickHeHeMiniApplet()
+					}else if(this.showModalstauts === 2){
+						this.showModal = false
+						this.hanldeOrderSubmit(this.confirmParam)
 					}else{
 						this.showModal = false
 					}

+ 1 - 1
pages/user/order/order-details.vue

@@ -458,7 +458,7 @@ export default {
 		handCenceConfirm() {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: this.orderId })
+				this.OrderService.CancelOrder({ orderId: this.orderId , userIdentity : 0})
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						setTimeout(() => {

+ 1 - 1
pages/user/order/order-list.vue

@@ -645,7 +645,7 @@ export default {
 		handCenceConfirm(orderId) {
 			//取消订单
 			this.$util.modal('提示', '确认取消该订单吗?', '确定', '取消', true, () => {
-				this.OrderService.CancelOrder({ orderId: orderId })
+				this.OrderService.CancelOrder({ orderId: orderId , userIdentity : 0})
 					.then(response => {
 						this.$util.msg(response.msg, 2000, true, 'success')
 						setTimeout(() => {

+ 9 - 0
services/order.service.js

@@ -226,6 +226,15 @@ export default class OrderService {
               
         })
     }
+    /* 提交订单 购买资质的验证 */
+    createdOrderCerify (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/submit/verify', 
+            data, 
+            isLoading: false ,
+              
+        })
+    }
     /* 提交订单 orderId 订单ID */
     CreatedOrderSubmit (data = {}) {
         return this.AjaxService.post({