Просмотр исходного кода

Merge remote-tracking branch 'origin/developer' into developerB

# Conflicts:
#	pages/goods/product.vue
合并解决冲突
zhengjinyi 3 лет назад
Родитель
Сommit
29d7884f72

+ 19 - 19
App.vue

@@ -3,7 +3,7 @@
 	 * vuex管理登陆状态,具体可以参考官方登陆模板示例
 	 */
 	import Vue from 'vue'
-	import { mapState,mapMutations} from 'vuex';
+	import { mapState,mapMutations} from 'vuex'
 	import authorize from '@/common/config/authorize.js'
 	export default {
 		onLaunch: function() {
@@ -32,20 +32,20 @@
 			// }
 			uni.getSystemInfo({
 				success: function(e) {
-					let modelmes = e.model;
-					console.log(e);
-					if (modelmes.search('iPhone 11') || modelmes.search('iPhone 11 Pro Max') ||modelmes.search('iPhone X') != -1) { //XS,XR,XS MAX均可以适配
+					let modelmes = e.model
+					console.log(e)
+					if (modelmes.search('iPhone 11') !== -1 || modelmes.search('iPhone 11 Pro Max') !== -1 ||modelmes.search('iPhone X') != -1) { //XS,XR,XS MAX均可以适配
 						self.$store.dispatch('setVariableFun',true)
 					}else{
 						self.$store.dispatch('setVariableFun',false)
 					}
 					// #ifndef MP
-					Vue.prototype.StatusBar = e.statusBarHeight;
+					Vue.prototype.StatusBar = e.statusBarHeight
 					if (e.platform == 'android') {
-						Vue.prototype.CustomBar = e.statusBarHeight + 50;
+						Vue.prototype.CustomBar = e.statusBarHeight + 50
 						Vue.prototype.platformClass = true
 					} else {
-						Vue.prototype.CustomBar = e.statusBarHeight + 45;
+						Vue.prototype.CustomBar = e.statusBarHeight + 45
 						Vue.prototype.platformClass = false
 					};
 					// #endif
@@ -59,22 +59,22 @@
 						Vue.prototype.platformClass = 'center'
 						self.$store.dispatch('setIsIphoneFun',true)
 					}
-					Vue.prototype.StatusBar = e.statusBarHeight;
+					Vue.prototype.StatusBar = e.statusBarHeight
 					Vue.prototype.fontSizeSetting = e.fontSizeSetting
 					Vue.prototype.screenWidth = e.screenWidth
-					let capsule = wx.getMenuButtonBoundingClientRect();
+					let capsule = wx.getMenuButtonBoundingClientRect()
 					Vue.prototype.capsule = capsule
 					if (capsule) {
-						Vue.prototype.Custom = capsule;
+						Vue.prototype.Custom = capsule
 						// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
-						Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
+						Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight
 					} else {
-						Vue.prototype.CustomBar = e.statusBarHeight + 50;
+						Vue.prototype.CustomBar = e.statusBarHeight + 50
 					}
 					// #endif		
 					// #ifdef MP-ALIPAY
-					Vue.prototype.StatusBar = e.statusBarHeight;
-					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
+					Vue.prototype.StatusBar = e.statusBarHeight
+					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight
 					// #endif
 				}
 			})
@@ -86,8 +86,8 @@
 		methods:{
 			...mapMutations(['login','logout','isWxAuthorize']),
 			async getWxAuthorize(){
-				const wechatCode = await authorize.getCode('weixin');// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
-				const getUserInfo = await authorize.getUserInfo('weixin');
+				const wechatCode = await authorize.getCode('weixin')// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
+				const getUserInfo = await authorize.getUserInfo('weixin')
 				this.UserService.UserLoginAuthApplets({ 
 					code:wechatCode,
 					encryptedData:getUserInfo.encryptedData,
@@ -95,7 +95,7 @@
 				})
 				.then(response =>{
 					this.$store.commit('updateStatus',response.data)
-					this.login(response.data);
+					this.login(response.data)
 					uni.setStorageSync('token',response.data.token)
 					uni.setStorageSync('unionId',response.data.unionId)
 				})
@@ -115,13 +115,13 @@
 				})
 			},		
 			refresh(){
-				let TIME = (20*60)*1000;
+				let TIME = (20*60)*1000
 				setInterval(()=>{
 					this.getWxAuthorize()
 				},TIME)
 			},
 			diffTime(t){
-				let date = Date.now();
+				let date = Date.now()
 				return (date -t) < 2*60*1000 ? false : true
 			}
 		},

+ 345 - 328
common/config/caimeiApi.js

@@ -5,229 +5,229 @@
  */
 import requestUrl from '@/services/ajax.env.js'
 const caimeiApi = {
-	/**
+    /**
 	 * @封装公共get数据请求方法无加载动画
 	 * @方法参数:请求地址,请求后台需要的参数字段,回调函数
 	 * @自定义请求头信息
 	 */
-	get:function(url,data,callback){
+    get:function(url,data,callback){
 		 uni.request({
-			url: requestUrl + url,
-			data:data,
-			header: {
-				'Accept': 'application/json',
-				'Content-Type': 'application/x-www-form-urlencoded', 
-				'X-Token': uni.getStorageSync('token') ? uni.getStorageSync('token') : 'token',
-				'cookie': uni.getStorageSync('sessionid')
-			},
-			method: 'GET',
-			success: (response) => {
-				if(response.statusCode !== 200){
-					uni.showToast({icon: 'none',title:'服务器连接错误',duration: 2000})
-					callback(response.statusCode)
-				}else{
-					callback(response.data)
-				}
-			},
-			fail: (error) => {
-				if (error) {
-					uni.showToast({icon: 'none',title: '网络错误,请稍后重试',duration: 2000})
-				}
-			}
+            url: requestUrl + url,
+            data:data,
+            header: {
+                'Accept': 'application/json',
+                'Content-Type': 'application/x-www-form-urlencoded', 
+                'X-Token': uni.getStorageSync('token') ? uni.getStorageSync('token') : 'token',
+                'cookie': uni.getStorageSync('sessionid')
+            },
+            method: 'GET',
+            success: (response) => {
+                if(response.statusCode !== 200){
+                    uni.showToast({icon: 'none',title:'服务器连接错误',duration: 2000})
+                    callback(response.statusCode)
+                }else{
+                    callback(response.data)
+                }
+            },
+            fail: (error) => {
+                if (error) {
+                    uni.showToast({icon: 'none',title: '网络错误,请稍后重试',duration: 2000})
+                }
+            }
 		 })
-	},
-	/**
+    },
+    /**
 	 * @封装公共get数据请求方法有加载动画
 	 * @方法参数:请求地址,请求后台需要的参数字段,回调函数
 	 * @自定义请求头信息
 	 */
-	lodingGet:function(url,data,callback){
+    lodingGet:function(url,data,callback){
 		 uni.showLoading({mask: true,title:'加载中~',})
 		 uni.request({
-			url: requestUrl + url,
-			data:data,
-			header: {
-				'Accept': 'application/json',
-				'Content-Type': 'application/x-www-form-urlencoded', 
-				'X-Token': uni.getStorageSync('token') ? uni.getStorageSync('token') : 'token',
-				'cookie': uni.getStorageSync('sessionid')
-			},
-			method: 'GET',
-			success: (response) => {
-				if(response.statusCode !== 200){
-					uni.showToast({icon: 'none',title: '服务器连接错误',duration: 2000})
-					callback(response.statusCode)
-				}else{
-					callback(response.data)
-				}
-			},
-			fail: (error) => {
-				if (error) {
-					uni.showToast({icon: 'none',title: '网络错误,请稍后重试',duration: 2000})
-				}
-			},
-			complete: () => {
-				setTimeout(function () {
-					uni.hideLoading()
-				}, 250)
-			}
+            url: requestUrl + url,
+            data:data,
+            header: {
+                'Accept': 'application/json',
+                'Content-Type': 'application/x-www-form-urlencoded', 
+                'X-Token': uni.getStorageSync('token') ? uni.getStorageSync('token') : 'token',
+                'cookie': uni.getStorageSync('sessionid')
+            },
+            method: 'GET',
+            success: (response) => {
+                if(response.statusCode !== 200){
+                    uni.showToast({icon: 'none',title: '服务器连接错误',duration: 2000})
+                    callback(response.statusCode)
+                }else{
+                    callback(response.data)
+                }
+            },
+            fail: (error) => {
+                if (error) {
+                    uni.showToast({icon: 'none',title: '网络错误,请稍后重试',duration: 2000})
+                }
+            },
+            complete: () => {
+                setTimeout(function () {
+                    uni.hideLoading()
+                }, 250)
+            }
 		 })
-	},
-	/**
+    },
+    /**
 	 * @封装公共post数据请求方法
 	 * @方法参数:请求地址,请求后台需要的参数字段,回调函数
 	 */
-	post:function(url,data,loadingStatus,callback){
-		if(loadingStatus){uni.showLoading({mask: true,title:'加载中~'})}
-		uni.request({
-			url: requestUrl+url,
-			data:data,
-			header: {
-				'Accept': 'application/json',
-				'Content-Type': 'application/x-www-form-urlencoded',
-				'X-Token': uni.getStorageSync('token') ? uni.getStorageSync('token') : 'token',
-				'cookie': uni.getStorageSync('sessionid')
-			},
-			method: 'POST',
-			success: (response) => {
-				if(loadingStatus){uni.hideLoading()}
-				const result = response.data
-				callback(result)
-			},
-			fail: (error) => {
-				uni.hideLoading()
-				if (error) {
-					uni.showToast({icon: 'none',title: '网络错误,请稍后重试',duration: 2000})
-				}
-			}
-		})
-	},
-	getComStorage:function(key){// 获取本地Storage
-		return new Promise(function(resolve,reject) {
-			uni.getStorage({
-				key: key,
-				success: function (res){
-					resolve(res.data)
-				},
-				fail: function(res){
-					reject(false)
-				}
-			})
-		})
-	},
-	setStorage:function(key,data){// 存储本地Storage
-		return new Promise(function(resolve,reject) {
-			uni.setStorage({
-				key: key,
-				data:data,
-				success: function (res){
-				}
-			})
-		})
-	},
-	getStorage:function(){// 获取本地userInfo
-		return new Promise(function(resolve,reject) {
-			uni.getStorage({
-				key: 'userInfo',
-				success: function (res){
-					resolve(res.data)
-				},
-				fail: function(res){
-					reject(false)
-				}
-			})
-		})
-	},
-	getStorageAddressKey:function(){// 获取本地地址信息
-		return new Promise(function(resolve,reject) {
-			uni.getStorage({
-				key: 'address_key',
-				success: function (res){
-					resolve(res.data)
-				}
-			})
-		})
-	},
-	loginStatus:function(){
-	// 获取用户是否登陆 1:已登陆,否则未登陆
-		return new Promise(function(resolve,reject) {
-			uni.getStorage({
-				key: 'userInfo',
-				success: function (res){
-					if(res.data.code == '1'){
-						resolve(true)
-					} else {
-						resolve(false)
-					}
-				}
-			})
-		})
-	},
-	navToListPage:function({type,value,id,lType} = {}){	
-	// 跳转到列表页
-		if(lType=='4'){
-			const pages = getCurrentPages()
-			const prevPage = pages[pages.length-2]
-			prevPage.refresh = true
-			prevPage.listData = {
-				type: type,
-				from: value,
-				id: id
-			}
-			uni.navigateBack({
-				delta: 1
-			})
-		}else{
-			uni.navigateTo({
-				url:`/pages/goods/goods?type=${type}&from=${value}&id=${id}`
-			})
-		}
-	},
-	navigateToGoods:function({type,value,id,lType} = {}){
-	// 跳转到列表页
-		if(lType=='4'){
-			const pages = getCurrentPages()
-			const prevPage = pages[pages.length-2]
-			prevPage.refresh = true
-			prevPage.listData = {
-				type: type,
-				from: value,
-				id: id
-			}
-			uni.navigateBack({
-				delta: 1
-			})
-		}else{
-			uni.navigateTo({
-				url:`/pages/goods/goods-classify?type=${type}&from=${value}&id=${id}`
-			})
-		}
-	},
-	FlooryNavigateTo:function(pros){
-		if(pros.listType == 1){
-			if(pros.product.productCategory == '1'){
-				uni.navigateTo({
+    post:function(url,data,loadingStatus,callback){
+        if(loadingStatus){uni.showLoading({mask: true,title:'加载中~'})}
+        uni.request({
+            url: requestUrl+url,
+            data:data,
+            header: {
+                'Accept': 'application/json',
+                'Content-Type': 'application/x-www-form-urlencoded',
+                'X-Token': uni.getStorageSync('token') ? uni.getStorageSync('token') : 'token',
+                'cookie': uni.getStorageSync('sessionid')
+            },
+            method: 'POST',
+            success: (response) => {
+                if(loadingStatus){uni.hideLoading()}
+                const result = response.data
+                callback(result)
+            },
+            fail: (error) => {
+                uni.hideLoading()
+                if (error) {
+                    uni.showToast({icon: 'none',title: '网络错误,请稍后重试',duration: 2000})
+                }
+            }
+        })
+    },
+    getComStorage:function(key){// 获取本地Storage
+        return new Promise(function(resolve,reject) {
+            uni.getStorage({
+                key: key,
+                success: function (res){
+                    resolve(res.data)
+                },
+                fail: function(res){
+                    reject(false)
+                }
+            })
+        })
+    },
+    setStorage:function(key,data){// 存储本地Storage
+        return new Promise(function(resolve,reject) {
+            uni.setStorage({
+                key: key,
+                data:data,
+                success: function (res){
+                }
+            })
+        })
+    },
+    getStorage:function(){// 获取本地userInfo
+        return new Promise(function(resolve,reject) {
+            uni.getStorage({
+                key: 'userInfo',
+                success: function (res){
+                    resolve(res.data)
+                },
+                fail: function(res){
+                    reject(false)
+                }
+            })
+        })
+    },
+    getStorageAddressKey:function(){// 获取本地地址信息
+        return new Promise(function(resolve,reject) {
+            uni.getStorage({
+                key: 'address_key',
+                success: function (res){
+                    resolve(res.data)
+                }
+            })
+        })
+    },
+    loginStatus:function(){
+        // 获取用户是否登陆 1:已登陆,否则未登陆
+        return new Promise(function(resolve,reject) {
+            uni.getStorage({
+                key: 'userInfo',
+                success: function (res){
+                    if(res.data.code == '1'){
+                        resolve(true)
+                    } else {
+                        resolve(false)
+                    }
+                }
+            })
+        })
+    },
+    navToListPage:function({type,value,id,lType} = {}){	
+        // 跳转到列表页
+        if(lType=='4'){
+            const pages = getCurrentPages()
+            const prevPage = pages[pages.length-2]
+            prevPage.refresh = true
+            prevPage.listData = {
+                type: type,
+                from: value,
+                id: id
+            }
+            uni.navigateBack({
+                delta: 1
+            })
+        }else{
+            uni.navigateTo({
+                url:`/pages/goods/goods?type=${type}&from=${value}&id=${id}`
+            })
+        }
+    },
+    navigateToGoods:function({type,value,id,lType} = {}){
+        // 跳转到列表页
+        if(lType=='4'){
+            const pages = getCurrentPages()
+            const prevPage = pages[pages.length-2]
+            prevPage.refresh = true
+            prevPage.listData = {
+                type: type,
+                from: value,
+                id: id
+            }
+            uni.navigateBack({
+                delta: 1
+            })
+        }else{
+            uni.navigateTo({
+                url:`/pages/goods/goods-classify?type=${type}&from=${value}&id=${id}`
+            })
+        }
+    },
+    FlooryNavigateTo:function(pros){
+        if(pros.listType == 1){
+            if(pros.product.productCategory == '1'){
+                uni.navigateTo({
 				  	url:`/pages/goods/product?id=${pros.product.productId}`
-				})
-			}else{
-				uni.navigateTo({
+                })
+            }else{
+                uni.navigateTo({
 				  	url:`/pages/second/product/product-details?id=${pros.product.productId}`
-				})
-			}
-		}else{
-			/**
+                })
+            }
+        }else{
+            /**
 			 * 页面跳转类型
 			 * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
 			 * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
 			 * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
 			 **/
-			if(pros.linkType){
-				console.log(pros.linkType)
-				const typeMap = {
+            if(pros.linkType){
+                console.log(pros.linkType)
+                const typeMap = {
 				 	1:`/pages/goods/goods-instrument?linkId=${pros.linkParam.id}`,
 				 	2:`/pages/goods/instrument-details?id=${pros.linkParam.id}`,
 				 	3:`/pages/h5/article/page-image?image=${pros.adsImage}&title=专题直播`,
-					4:`/pages/h5/activity/activity?title=${pros.crmTitle}&link=${pros.crmLink}`,
+                    4:`/pages/h5/activity/activity?title=${pros.crmTitle}&link=${pros.crmLink}`,
 				 	5:`/pages/goods/product?id=${pros.linkParam.id}`,
 				 	// 7:`/pages/supplier/user/my-shop?shopId=${pros.linkParam.id}`,
 				 	8:'/pages/h5/activity/activity-list',
@@ -238,128 +238,130 @@ const caimeiApi = {
 				 	13:`/pages/h5/article/path?link=${pros.link}`,
 				 	14:`/pages/h5/article/path?link=${pros.link}`,
 				 	15:`/pages/h5/article/path?link=${pros.link}`,
-					// '-1':`/pages/h5/article/path?link=${pros.link}`,
+                    // '-1':`/pages/h5/article/path?link=${pros.link}`,
 				 	17:'/pages/login/register-select',
 				 	18:`/pages/h5/article/path?link=${pros.link}`,
 				 	19:`/pages/search/search-supplier?keyWord=${pros.linkParam.keyword}`,
-					21:'/pages/h5/activity/meobohui',
-					24:'/pages/user/coupon/coupon',
-					23:`/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`
-				}
-				const url = typeMap[pros.linkType]
-				uni.navigateTo({
+                    21:'/pages/h5/activity/meobohui',
+                    23:`/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`,
+                    24:'/pages/user/coupon/coupon',
+                    25:'/pages/goods/goods-doc-list' //美业资料
+                }
+                const url = typeMap[pros.linkType]
+                uni.navigateTo({
 				  	url:url
-				})
-			}
-		}
-	},
-	BannerNavigateTo:function(linkType,linkId,linkHref,keyword){//楼层跳转判断
-		if(linkType){
-			const typeMap = {
-				1:`/pages/goods/goods-instrument?linkId=${linkId}`,
-				2:`/pages/goods/instrument-details?id=${linkId}`,
-				4:`/pages/h5/activity/activity?id=${linkId}`,
-				5:`/pages/goods/product?id=${linkId}`, 
-				// 7:`/pages/supplier/user/my-shop?shopId=${linkId}`,
-				8:'/pages/h5/activity/activity-list',
-				9:'/pages/second/form/introduce',
-				10:'/pages/second/product/product-list',
-				11:'/pages/second/form/form',
-				12:`/pages/search/search?keyWord=${keyword}`,
-				13:`/pages/h5/article/path?link=${linkHref}`,
-				14:`/pages/h5/article/path?link=${linkHref}`,
-				15:`/pages/h5/article/path?link=${linkHref}`,
-				17:'/pages/login/register-select',
-				18:`/pages/h5/article/path?link=${linkHref}`,
-				19:`/pages/search/search-supplier?keyWord=${keyword}`,
-				21:'/pages/h5/activity/meobohui',
-				// '-1':`/pages/h5/article/path?link=${pros.link}`
-				24:'/pages/user/coupon/coupon'
-			}
-			const url = typeMap[linkType]
-			uni.navigateTo({
+                })
+            }
+        }
+    },
+    BannerNavigateTo:function(linkType,linkId,linkHref,keyword){//楼层跳转判断
+        if(linkType){
+            const typeMap = {
+                1:`/pages/goods/goods-instrument?linkId=${linkId}`,
+                2:`/pages/goods/instrument-details?id=${linkId}`,
+                4:`/pages/h5/activity/activity?id=${linkId}`,
+                5:`/pages/goods/product?id=${linkId}`, 
+                // 7:`/pages/supplier/user/my-shop?shopId=${linkId}`,
+                8:'/pages/h5/activity/activity-list',
+                9:'/pages/second/form/introduce',
+                10:'/pages/second/product/product-list',
+                11:'/pages/second/form/form',
+                12:`/pages/search/search?keyWord=${keyword}`,
+                13:`/pages/h5/article/path?link=${linkHref}`,
+                14:`/pages/h5/article/path?link=${linkHref}`,
+                15:`/pages/h5/article/path?link=${linkHref}`,
+                17:'/pages/login/register-select',
+                18:`/pages/h5/article/path?link=${linkHref}`,
+                19:`/pages/search/search-supplier?keyWord=${keyword}`,
+                21:'/pages/h5/activity/meobohui',
+                // '-1':`/pages/h5/article/path?link=${pros.link}`
+                24:'/pages/user/coupon/coupon',
+                25:'/pages/goods/goods-doc-list'  //美业资料
+            }
+            const url = typeMap[linkType]
+            uni.navigateTo({
 			 	url:url
-			})
-		}
-	},
-	navigateTo:function(url){
-		//路由跳转:页面之间路由跳转
-		uni.navigateTo({
-			url:url
-		})
-	},
-	redirectTo:function(url){
-	//路由跳转:关闭当前页跳转到新页面	
-		uni.redirectTo({
-			url:url
-		})
-	},
-	switchTabTo:function(url){
-	//路由跳转:底部 tab页
-		uni.switchTab({
-			url:url
-		})
-	},
-	isNumber:function(value){//验证是否为数字
+            })
+        }
+    },
+    navigateTo:function(url){
+        //路由跳转:页面之间路由跳转
+        uni.navigateTo({
+            url:url
+        })
+    },
+    redirectTo:function(url){
+        //路由跳转:关闭当前页跳转到新页面	
+        uni.redirectTo({
+            url:url
+        })
+    },
+    switchTabTo:function(url){
+        //路由跳转:底部 tab页
+        uni.switchTab({
+            url:url
+        })
+    },
+    isNumber:function(value){//验证是否为数字
 	    var patrn = /^(-)?\d+(\.\d+)?$/
 	    if (patrn.exec(value) == null || value == '') {
 	         return false
 	    } else {
 	         return true  
-		}	 
-	},
-	getWindowHeight:function(){
-		// 获取窗口高度
-		const {windowHeight, pixelRatio} = wx.getSystemInfoSync()
-		return windowHeight
-	},
-	adaptRichTextImg:function(res){
-		/**
+        }	 
+    },
+    getWindowHeight:function(){
+        // 获取窗口高度
+        const {windowHeight, pixelRatio} = wx.getSystemInfoSync()
+        return windowHeight
+    },
+    adaptRichTextImg:function(res){
+        /**
 		 *@富文本实现图片自适应
 		 *@style再添加自适应样式
 		 */ 
-		const html = res.replace(/<img[^>]*>/gi,function(match,capture){			
-			let match1 = match.replace(/<img*/gi, '<img style="width:100% !important;height:auto !important;float:left !important;"'),
-				results = match1.replace(/style=/gi, 'style="width:100%;height:auto;float:left;"')
-			return results
-		})
-		return html	
-	},
-	FormatMoney:function(num){
-		// 金额千分位
-		return num.toString().replace(/\d+/, function (n) { // 先提取整数部分
-			return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) { // 对整数部分添加分隔符
-				return $1 + ','
-			})
-		})
-	},
-	formatDate:function(){
-		//获取当前时间
-		let date = new Date()
-		let y = date.getFullYear()
-		let MM = date.getMonth() + 1
-		MM = MM < 10 ? ('0' + MM) : MM
-		let d = date.getDate()
-		d = d < 10 ? ('0' + d) : d
-		let h = date.getHours()
-		h = h < 10 ? ('0' + h) : h
-		let m = date.getMinutes()
-		m = m < 10 ? ('0' + m) : m
-		let s = date.getSeconds()
-		s = s < 10 ? ('0' + s) : s
+        const html = res.replace(/<img[^>]*>/gi,function(match,capture){			
+            let match1 = match.replace(/<img*/gi, '<img style="width:100% !important;height:auto !important;float:left !important;"'),
+                results = match1.replace(/style=/gi, 'style="width:100%;height:auto;float:left;"')
+            return results
+        })
+        return html	
+    },
+    FormatMoney:function(num){
+        // 金额千分位
+        return num.toString().replace(/\d+/, function (n) { // 先提取整数部分
+            return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) { // 对整数部分添加分隔符
+                return $1 + ','
+            })
+        })
+    },
+    formatDate:function(){
+        //获取当前时间
+        let date = new Date()
+        let y = date.getFullYear()
+        let MM = date.getMonth() + 1
+        MM = MM < 10 ? ('0' + MM) : MM
+        let d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        let h = date.getHours()
+        h = h < 10 ? ('0' + h) : h
+        let m = date.getMinutes()
+        m = m < 10 ? ('0' + m) : m
+        let s = date.getSeconds()
+        s = s < 10 ? ('0' + s) : s
 	    return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s
-	},
-	regexSets:function() {
-		let sets = {
-			'companyName': /^[\u4e00-\u9fa5\(\)()\s\da-zA-Z&]{2,50}$/gi,
-			'phoneAndTelephone': /^([1]\d{10}|([\((]?0[0-9]{2,3}[)\)]?[-]?)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?)$/,
-			'bankNum': /^([1-9]{1})(\d{18})$/,
-			'invalidChar': /^[\s\u4e00-\u9fa5a-z0-9_-]{0,}$/
-		}
-		return sets
-	},
-	timestampToTime:function(timestamp) {
-		// 时间戳转日期
+    },
+    regexSets:function() {
+        let sets = {
+            'companyName': /^[\u4e00-\u9fa5\(\)()\s\da-zA-Z&]{2,50}$/gi,
+            'phoneAndTelephone': /^([1]\d{10}|([\((]?0[0-9]{2,3}[)\)]?[-]?)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?)$/,
+            'bankNum': /^([1-9]{1})(\d{18})$/,
+            'invalidChar': /^[\s\u4e00-\u9fa5a-z0-9_-]{0,}$/
+        }
+        return sets
+    },
+    timestampToTime:function(timestamp) {
+        // 时间戳转日期
 	   let date = new Date(timestamp * 1000)//时间戳为10位需*1000,时间戳为13位的话不需乘1000
 	   let Y = date.getFullYear() + '-'
 	   let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'
@@ -368,33 +370,48 @@ const caimeiApi = {
 	   let m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':'
 	   let s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds())
 	   return `${Y}${M}${D}${h}${m}${s}`
-	}
+    },
+    easyFormatData(timestamp){
+        //时间转换
+        let a = new Date(timestamp).getTime()
+        const date = new Date(a)
+        const Y = date.getFullYear() + '-'
+        const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+        const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + '  '
+        const h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':'
+        const m = (date.getMinutes() <10 ? '0'+date.getMinutes() : date.getMinutes()) 
+        // const s = date.getSeconds(); // 秒
+        const dateString = Y + M + D + h + m
+        // console.log('dateString', dateString); // > dateString 2021-07-06 14:23
+        return dateString
+    }
 }
 
 /**
  *@导出
  */ 
 module.exports = {
-	get: caimeiApi.get,
-	post: caimeiApi.post,
-	lodingGet: caimeiApi.lodingGet,
-	isNumber: caimeiApi.isNumber,
-	FormatMoney: caimeiApi.FormatMoney,
-	navigateTo: caimeiApi.navigateTo,
-	redirectTo: caimeiApi.redirectTo,
-	switchTabTo: caimeiApi.switchTabTo,
-	formatDate: caimeiApi.formatDate,
-	loginStatus: caimeiApi.loginStatus,
-	setStorage: caimeiApi.setStorage,
-	getStorage: caimeiApi.getStorage,
-	getComStorage: caimeiApi.getComStorage,
-	navToListPage: caimeiApi.navToListPage,
-	navigateToGoods: caimeiApi.navigateToGoods,
-	getWindowHeight: caimeiApi.getWindowHeight,
-	adaptRichTextImg: caimeiApi.adaptRichTextImg,
-	getStorageAddressKey: caimeiApi.getStorageAddressKey,
-	regexSets: caimeiApi.regexSets,
-	timestampToTime: caimeiApi.timestampToTime,
-	BannerNavigateTo:caimeiApi.BannerNavigateTo,
-	FlooryNavigateTo:caimeiApi.FlooryNavigateTo 
+    get: caimeiApi.get,
+    post: caimeiApi.post,
+    lodingGet: caimeiApi.lodingGet,
+    isNumber: caimeiApi.isNumber,
+    FormatMoney: caimeiApi.FormatMoney,
+    navigateTo: caimeiApi.navigateTo,
+    redirectTo: caimeiApi.redirectTo,
+    switchTabTo: caimeiApi.switchTabTo,
+    formatDate: caimeiApi.formatDate,
+    loginStatus: caimeiApi.loginStatus,
+    setStorage: caimeiApi.setStorage,
+    getStorage: caimeiApi.getStorage,
+    getComStorage: caimeiApi.getComStorage,
+    navToListPage: caimeiApi.navToListPage,
+    navigateToGoods: caimeiApi.navigateToGoods,
+    getWindowHeight: caimeiApi.getWindowHeight,
+    adaptRichTextImg: caimeiApi.adaptRichTextImg,
+    getStorageAddressKey: caimeiApi.getStorageAddressKey,
+    regexSets: caimeiApi.regexSets,
+    timestampToTime: caimeiApi.timestampToTime,
+    BannerNavigateTo:caimeiApi.BannerNavigateTo,
+    FlooryNavigateTo:caimeiApi.FlooryNavigateTo,
+    easyFormatData:caimeiApi.easyFormatData
 }

+ 14 - 4
components/cm-module/activityContact/index.vue

@@ -11,9 +11,9 @@
             <view class="cm-icon cm-bround cm-mobile" @click="handelShowMobile">
                 <view class="cm-dialog" v-show="mobileVisiable">
                     <view class="cm-dialog-content content1">
-                        <view class="cm-item"> <text>展会咨询电话:15338897365</text> </view>
+                        <view class="cm-item" @click="phoneCall('15338897365')"> <text>展会咨询电话:15338897365</text> </view>
                         <view class="cm-line line1"></view>
-                        <view class="cm-item"> <text>客服咨询电话:15338851365</text> </view>
+                        <view class="cm-item" @click="phoneCall('15338851365')"> <text>客服咨询电话:15338851365</text> </view>
                     </view>
                 </view>
             </view>
@@ -22,6 +22,7 @@
                     <view class="cm-dialog-content content2">
                         <view class="cm-item">
                             <image
+                                show-menu-by-longpress
                                 src="https://static.caimei365.com/app/img/icon2/cm_wechat_02.png"
                                 mode="widthFix"
                             ></image>
@@ -30,6 +31,7 @@
                         <view class="cm-line line2"></view>
                         <view class="cm-item">
                             <image
+                                show-menu-by-longpress
                                 src="https://static.caimei365.com/app/img/icon2/cm_wechat_01.png"
                                 mode="widthFix"
                             ></image>
@@ -89,8 +91,15 @@ export default {
             this.pageInfo.redPacketEndTime
         )
         console.log(this.pageInfo)
-    },
+    }, 
     methods: {
+        // 拨打电话
+        phoneCall(number){
+            console.log(number)
+            uni.makePhoneCall({
+                phoneNumber: number //仅为示例
+            })
+        },
         // 是否展开
         handleToggleAcitve(active) {
             this.isActive = active
@@ -217,6 +226,7 @@ export default {
     padding: 20rpx;
     background: rgb(255, 92, 0);
     border-radius: 16rpx;
+    z-index: 99999;
     &::after {
         position: absolute;
         top: 20rpx;
@@ -279,7 +289,7 @@ export default {
     justify-content: center;
     align-items: center;
     position: fixed;
-    z-index: 999;
+    // z-index: 999;
     top: 0;
     left: 0;
     width: 100vw;

+ 11 - 10
components/cm-module/homeIndex/navbars.vue

@@ -13,7 +13,7 @@
 
 <script>
 	export default{
-		name:"navbars",
+		name:'navbars',
 		props:{
 			list:{
 				type:Array
@@ -43,22 +43,23 @@
 				 * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
 				 * 23、新活动专题页面
 				 **/
-				console.log(pros);
+				console.log(pros)
 				if(pros.linkType){
 					 const typeMap = {
 						1:`/pages/goods/goods-instrument?linkId=${pros.linkParam.id}&title=${pros.name}`,
-						3:`/pages/h5/article/path-live`,
-						4:`/pages/h5/other/brands`,
-						10:`/pages/second/product/product-list`,
-						14:`/pages/h5/other/brand`,
-						15:`/pages/h5/other/repair`,
+						3:'/pages/h5/article/path-live',
+						4:'/pages/h5/other/brands',
+						10:'/pages/second/product/product-list',
+						14:'/pages/h5/other/brand',
+						15:'/pages/h5/other/repair',
 						18:`/pages/h5/article/path?link=${pros.link}`,
 						20:`/pages/goods/good-floor?linkId=${pros.linkParam.id}&title=${pros.name}`,
-						21:`/pages/h5/activity/meobohui`,
+						21:'/pages/h5/activity/meobohui',
 						22:`/pages/goods/good-floor-temp?linkId=${pros.linkParam.id}&title=${pros.name}`,
-						23:`/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`  //活动专题页面
+						23:`/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`,  //活动专题页面
+                        25:'/pages/goods/goods-doc-list' //美业资料
 					 }
-					const url = typeMap[pros.linkType];
+					const url = typeMap[pros.linkType]
 					this.$api.navigateTo(url)
 				}
 			}

+ 629 - 0
components/cm-module/productDetails/cm-product-doc.vue

@@ -0,0 +1,629 @@
+<template>
+    <view
+        class="product-doc "
+        :class="{ hasBottom: TipStatus }"
+        :style="{ paddingBottom: isIphoneX && TipStatus ? '60rpx' : 0 }"
+    >
+        <view class="category">
+            <view class="category-title">图片资料</view>
+            <view class="content">
+                <view class="cm-none" v-if="imageArchiveList.length === 0">暂无相关资料</view>
+                <template v-else>
+                    <view class="section" v-for="(item, index) in imageArchiveList" :key="index">
+                        <view class="cm-title">{{ item.title }}</view>
+                        <view class="cm-time">{{ $api.easyFormatData(item.addTime) }}</view>
+                        <view class="cm-img-list cm-list">
+                            <template v-if="item.imageList">
+                                <image
+                                    :src="image.url"
+                                    @click="previewImage(i, item.imageList)"
+                                    mode="aspectFill"
+                                    v-for="(image, i) in imageFormat(item.imageList)"
+                                    :key="i"
+                                    :style="image.style"
+                                ></image>
+                            </template>
+                            <template v-else>
+                                <image
+                                    :src="defaultImage"
+                                    mode="aspectFill"
+                                    v-for="i in item.imageNum"
+                                    :key="i"
+                                    @click="checkPermission"
+                                ></image>
+                            </template>
+                        </view>
+                    </view>
+                </template>
+            </view>
+        </view>
+        <view class="category">
+            <view class="category-title">视频资料</view>
+            <view class="content">
+                <view class="cm-none" v-if="videoArchiveList.length === 0">暂无相关资料</view>
+                <template v-else>
+                    <view class="section" v-for="(item, index) in videoArchiveList" :key="index">
+                        <view class="cm-title">{{ item.title }}</view>
+                        <view class="cm-time">{{ $api.easyFormatData(item.addTime) }}</view>
+                        <view class="cm-video-list">
+                            <video
+                                class="cm-video"
+                                :id="'myVideo' + index"
+                                :src="item.fileUrl"
+                                :style="videoStyle['myVideo' + index]"
+                                controls
+                                show-fullscreen-btn
+                                show-mute-btn
+                                play-btn-position="center"
+                                @play="handlePlayer('myVideo' + index)"
+                                v-if="item.fileUrl"
+                                @loadedmetadata="loadedmetadata"
+                            ></video>
+                            <view class="cm-video-section" v-else>
+                                <image class="cm-video-cover" :src="videoCover"></image>
+                                <text class="cm-player-btn" @click="checkPermission()"></text>
+                            </view>
+                        </view>
+                    </view>
+                </template>
+            </view>
+        </view>
+        <view class="category cm-file">
+            <view class="category-title">文件资料</view>
+            <view class="content">
+                <view class="cm-none" v-if="fileArchiveList.length === 0">暂无相关资料</view>
+                <template v-else>
+                    <view class="section" v-for="(item, index) in fileArchiveList" :key="index">
+                        <image
+                            src="https://static.caimei365.com/app/img/icon2/PDF-app.png"
+                            v-if="/\.pdf/.test(item.fileName)"
+                        ></image>
+                        <image
+                            src="https://static.caimei365.com/app/img/icon2/DOC-app.png"
+                            v-else-if="/\.doc/.test(item.fileName)"
+                        ></image>
+                        <image src="https://static.caimei365.com/app/img/icon2/PPT-app.png" v-else></image>
+                        <view class="cm-desc">
+                            <view class="cm-title">{{ item.title }}</view>
+                            <view class="cm-bottom">
+                                <view class="cm-time">{{ $api.easyFormatData(item.addTime) }}</view>
+                                <view class="cm-preview" @click="previewFile(item)">预览文件</view>
+                            </view>
+                        </view>
+                    </view>
+                </template>
+            </view>
+        </view>
+        <view
+            class="cm-login"
+            :class="{ maxBottom: !bottom && isIphoneX }"
+            :style="{ bottom: bottom }"
+            v-if="TipStatus"
+        >
+            <text>{{ TipStatus.text }}</text>
+            <view class="cm-btn" @click="nextAction(TipStatus.redirect)">{{ TipStatus.btn }}</view>
+        </view>
+
+        <tui-modal
+            :show="showModal"
+            :content="TipStatus.text"
+            shape="circle"
+            :button="modalButton"
+            fadeIn
+            @click="handleModalClick"
+        ></tui-modal>
+    </view>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+
+export default {
+    props: {
+        product: {
+            type: Object,
+            default: () => {}
+        },
+        archiveId: {
+            type: Number,
+            default: 0
+        },
+        bottom: {
+            type: String,
+            default: ''
+        }
+    },
+    data() {
+        return {
+            userId: -1,
+            prevVideoId: '',
+            currentVideoId: '',
+            videoContexts: [],
+            modalButton: [
+                {
+                    text: '取消',
+                    type: 'gray',
+                    plain: true //是否空心
+                },
+                {
+                    text: '确认',
+                    customStyle: {
+                        color: '#fff',
+                        bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
+                    },
+                    plain: false
+                }
+            ],
+            showModal: false,
+            //用户信息相关
+            permission: 5, //用户权限  0可查看,1未登录,2需升级会员机构,3需升级医美会员机构,4需要抵扣采美豆,5无权限查看
+            imageArchiveList: [], // 图片资料列表
+            videoArchiveList: [], // 视频资料列表
+            fileArchiveList: [], // 文件资料列表
+            defaultImage: 'https://static.caimei365.com/app/img/icon2/PC-default.png', // 默认图片
+            videoCover: 'https://static.caimei365.com/app/img/icon2/video-cover.png', //默认视频封面
+            videoStyle: {}
+        }
+    },
+    computed: {
+        ...mapState(['isIphoneX']),
+        //资料查看状态提示
+        TipStatus() {
+            // 资料权限
+            const statusText = [
+                false, // 正常访问
+                { text: '请登录后查看!', btn: '去登录', redirect: '/pages/login/login' },
+                { text: '请升级成为会员机构后方可查看!', btn: '去升级', redirect: '/pages/login/apply' },
+                { text: '请升级成为医美会员机构后方可查看!', btn: '去升级', redirect: '/pages/login/apply' },
+                { text: '需抵扣100采美豆方可查看!', btn: '去查看', redirect: 10 },
+                { text: '无权限查看!', btn: '确认' }
+            ]
+            // 0可查看,1未登录,2需升级会员机构,3需升级医美会员机构,4需要抵扣采美豆,5无权限查看
+            return statusText[this.permission]
+        }
+    },
+    watch: {
+        TipStatus(val) {
+            this.$emit('tipStatus', this.TipStatus)
+        }
+    },
+    created() {
+        this.userId = uni.getStorageSync('userInfo').userId || -1
+        this.getDetail()
+    },
+    methods: {
+        // 获取商品资料详情
+        getDetail() {
+            this.BeautyArchive.GetProdcutArchiveDetails({
+                userId: this.userId,
+                archiveId: this.archiveId
+            }).then(res => {
+                this.imageArchiveList = res.data.imageArchiveList
+                this.videoArchiveList = res.data.videoArchiveList
+                this.fileArchiveList = res.data.fileArchiveList
+                this.permission = res.data.permission
+            })
+        },
+        //采美豆抵扣
+        searchArchiveByBean() {
+            this.BeautyArchive.SearchArchiveByBeans({
+                userId: this.userId,
+                archiveId: this.archiveId
+            })
+                .then(res => {
+                    uni.showToast({
+                        duration: 1500,
+                        title: res.msg
+                    })
+                    setTimeout(() => {
+                        //刷新资料列表
+                        this.getDetail()
+                    }, 1500)
+                })
+                .catch(err => {
+                    uni.showToast({
+                        icon: 'none',
+                        duration: 1500,
+                        title: err.msg
+                    })
+                })
+        },
+        // 获取视频源信息
+        loadedmetadata(e) {
+            // 获取视频长宽
+            const w = e.detail.width //视频真实宽度
+            const h = e.detail.height //视频真实高度
+            let rw = 0 //视频展示宽度
+            let rh = 0 //视频展示宽度
+            // 视频宽大于等于高时
+            if (w >= h) {
+                rw = 702
+                rh = (rh * h) / w
+            } else {
+                rw = 400
+                rh = (rw * h) / w
+            }
+            // 使用set向videoStyle添加样式信息
+            this.$set(this.videoStyle, e.currentTarget.id, `width:${rw}rpx;height:${rh}rpx;`)
+        },
+        // 视频播放
+        handlePlayer(id) {
+            if (this.checkPermission()) {
+                this.handleStop(id)
+                return
+            }
+            // 如果点击同一个播放器,就
+            if (this.prevVideoId === id) return
+            // this.handleFullScreen(id) // 点击播放时全屏
+            // 暂停上一个播放器
+            this.handelPause(this.prevVideoId)
+            // 保存当前播放器id
+            this.prevVideoId = id
+        },
+        // 开始播放
+        handelPlay(id) {
+            if (!id) return
+            const vContext = uni.createVideoContext(id, this)
+            vContext.play()
+        },
+        // 暂停播放
+        handelPause(id) {
+            if (!id) return
+            const vContext = uni.createVideoContext(id, this)
+            vContext.pause()
+        },
+        // 停止视频
+        handleStop(id) {
+            if (!id) return
+            const vContext = uni.createVideoContext(id, this)
+            vContext.stop()
+        },
+        // 进入全屏
+        handleFullScreen(id) {
+            if (!id) return
+            const vContext = uni.createVideoContext(id, this)
+            vContext.requestFullScreen()
+        },
+        // 预览图片
+        previewImage(index, previewImageList) {
+            if (this.checkPermission()) return
+            const that = this
+            uni.previewImage({
+                current: index,
+                indicator: 'number',
+                urls: previewImageList,
+                loop: true,
+                success() {
+                    that.$emit('previewImage', true)
+                }
+            })
+        },
+        //用户权限校验拦截
+        checkPermission() {
+            //permission:查看权限:0可查看,1未登录,2需升级会员机构,3需升级医美会员机构,4需要抵扣采美豆,5无权限查看
+            const _self = this
+            // 如果 TipStatus 返回false 就放行
+            if (!_self.TipStatus) return 0
+            this.modalButton[1].text = this.TipStatus.btn
+            this.showModal = true
+            return -1
+        },
+        // modal 按钮点击
+        handleModalClick(e) {
+            // 点击确认按钮
+            if (e.index === 1) {
+                this.showModal = false
+                this.nextAction(this.TipStatus.redirect) //执行下一步
+            } else {
+                this.showModal = false
+            }
+        },
+        //图片列表处理
+        imageFormat(list) {
+            const imageList = []
+            if (list.length > 2) {
+                list.forEach((item, index) => {
+                    imageList.push({ url: item, style: '' })
+                })
+            }
+            if (list.length === 1) {
+                try {
+                    const strArr = list[0]
+                        .split('?')[1]
+                        .replace(/\&|\=/g, '-')
+                        .split('-')
+                    const w = strArr[1] // 图片长
+                    const h = strArr[3] // 图片高
+                    let style = ''
+                    if (w > h) {
+                        style = `width:600rpx;height:${(600 / w) * h}rpx`
+                    } else {
+                        style = `height:600rpx;width:${(600 * w) / h}rpx`
+                    }
+                    imageList.push({ url: list[0], style: style })
+                } catch (e) {
+                    console.error(
+                        '图片链接格式不正确,返回未处理图片,请设置正确的链接:http://image/text.png?width=xx&height=xx'
+                    )
+                    imageList.push({ url: list[0], style: '' })
+                }
+            }
+            if (list.length === 2) {
+                const style = 'width:300rpx;height:300rpx;'
+                imageList.push({ url: list[0], style })
+                imageList.push({ url: list[1], style })
+            }
+            return imageList
+        },
+        // 点击按钮后要做的事
+        nextAction(redirect) {
+            const _self = this
+            if (typeof redirect == 'string') {
+                // 跳转链接
+                this.$api.navigateTo(redirect)
+            }
+            if (redirect === 10) {
+                this.searchArchiveByBean()
+            }
+        },
+        // 文件预览
+        previewFile(file) {
+            if (this.checkPermission()) return
+            // 获取文件后缀
+            // const index = file.fileName.lastIndexOf('.')
+            // const suffix = file.fileName.substring(index)
+            this.openDocument(file)
+            // if (suffix === '.doc' || suffix === '.ppt' || suffix === '.pptx' || suffix === '.docx') {
+            //     //先将链接缓存
+            //     uni.setStorageSync('openLink', file.htmlUrl)
+            //     this.openDocument(file.fileUrl)
+            //     // this.$api.navigateTo('/pages/h5/article/path?key=openLink&type=1')
+            // } else if (suffix === '.pdf') {
+            //     //先将链接缓存
+            //     uni.setStorageSync('openLink', file.fileUrl)
+            //     this.$api.navigateTo('/pages/h5/article/path?key=openLink&type=2')
+            // } else {
+            //     // 不支持的文件
+            //     return uni.showModal({
+            //         content: `${suffix}类型文件暂不支持预览`,
+            //         cancelColor: '#666',
+            //         confirmColor: '#E15616'
+            //     })
+            // }
+        },
+        // 打开文档
+        openDocument(file) {
+            uni.showLoading({
+                title:'加载中'
+            })
+            // 获取文件后缀
+            const index = file.fileName.lastIndexOf('.')
+            const suffix = file.fileName.substring(index + 1)
+            // 下载文件
+            uni.downloadFile({
+                url: file.fileUrl,
+                success(res) {
+                    const filePath = res.tempFilePath
+                    console.log(filePath) 
+                    // 打开文件
+                    uni.openDocument({
+                        filePath: filePath,
+                        fileType: suffix,
+                        success(res) {
+                            uni.showToast({
+                                icon:'success',
+                                title:'打开成功',
+                                duration: 1200
+                            })
+                            uni.hideLoading()
+                        },
+                        fail(err) {
+                            if(err.errMsg.indexOf('fail filetype not supported')){
+                                uni.showModal({
+                                    content: '不支持的文件预览',
+                                    cancelColor: '#666',
+                                    confirmColor: '#E15616'
+                                })
+                            }
+                            uni.hideLoading()
+                        }
+                    })
+                },
+                fail(err){
+                    uni.showToast({
+                        title: JSON.stringify(err),
+                        icon:'none',
+                        duration: 5000
+                    })
+                    uni.hideLoading()
+                },
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.product-doc {
+    background: #f7f7f7;
+}
+.hasBottom {
+    padding-bottom: 90rpx;
+}
+.cm-login {
+    position: fixed;
+    left: 24rpx;
+    bottom: 115rpx; // 包含商品导航
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 0 32rpx;
+    width: 702rpx;
+    height: 90rpx;
+    background: #ffe6dc;
+    border-radius: 16px;
+    box-sizing: border-box;
+    z-index: 9;
+    &.maxBottom {
+        bottom: 175rpx;
+    }
+    text {
+        font-size: 26rpx;
+        color: #e15616;
+    }
+    .cm-btn {
+        width: 136rpx;
+        height: 48rpx;
+        background: #e15616;
+        border-radius: 28px;
+        font-size: 26rpx;
+        text-align: center;
+        line-height: 48rpx;
+        color: #ffffff;
+    }
+}
+.category {
+    padding: 0 24rpx;
+    margin-bottom: 20rpx;
+    background: #fff;
+    .cm-video-section {
+        position: relative;
+        width: 702rpx;
+        height: 402rpx;
+        .cm-video-cover {
+            width: 702rpx;
+            height: 402rpx;
+        }
+        .cm-player-btn {
+            position: absolute;
+            left: 50%;
+            top: 50%;
+            transform: translate(-50%, -50%);
+            z-index: 5;
+            width: 56rpx;
+            height: 56rpx;
+            background: url(https://static.caimei365.com/app/img/icon2/H5-plalyer.png) center no-repeat;
+            background-size: 56rpx 56rpx;
+        }
+    }
+    .category-title {
+        padding-top: 24rpx;
+        padding-bottom: 8rpx;
+        font-size: 28rpx;
+        font-weight: 500;
+        color: #333333;
+        border-bottom: 1px solid #f0f0f0;
+    }
+    .cm-none {
+        height: 37rpx;
+        margin: 24rpx 0 0 0;
+        padding-bottom: 48rpx;
+        font-size: 26rpx;
+        font-weight: 400;
+        line-height: 37rpx;
+        color: #333333;
+    }
+    &.cm-file {
+        .section {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            image {
+                width: 88rpx;
+                height: 88rpx;
+            }
+            .cm-title {
+                height: 74rpx;
+            }
+            .cm-desc {
+                width: 582rpx;
+            }
+            .cm-bottom {
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+                padding: 16rpx 0 0;
+                .cm-preview {
+                    font-size: 26rpx;
+                    font-weight: 400;
+                    color: #e15616;
+                }
+                .cm-time {
+                    padding: 0;
+                }
+            }
+        }
+    }
+    .section {
+        padding-bottom: 24rpx;
+        border-bottom: 1px solid #f0f0f0;
+        &:last-child {
+            border-bottom: 0;
+        }
+        .cm-title {
+            display: -webkit-box;
+            max-height: 74rpx;
+            margin-top: 24rpx;
+            font-size: 26rpx;
+            font-weight: 400;
+            line-height: 1.5;
+            color: #333333;
+            -webkit-box-orient: vertical;
+            -webkit-line-clamp: 2;
+            overflow: hidden;
+            word-break: break-all;
+            text-align: justify;
+        }
+        .cm-time {
+            padding: 8rpx 0;
+            font-size: 22rpx;
+            font-weight: 400;
+            color: #b2b2b2;
+        }
+        .cm-img-list {
+            display: flex;
+            justify-content: flex-start;
+            flex-wrap: wrap;
+            &.cm-list {
+                image {
+                    width: 162rpx;
+                    height: 162rpx;
+                    margin: 18rpx 18rpx 0 0;
+                    box-sizing: border-box;
+                    border-radius: 6rpx;
+                    border: 1px solid #e1e1e1;
+                    &:nth-child(4n) {
+                        margin-right: 0;
+                    }
+                }
+            }
+            &.cm-one {
+                max-width: 400rpx;
+                max-height: 400rpx;
+                image {
+                    box-sizing: border-box;
+                    border-radius: 6rpx;
+                    border: 1px solid #e1e1e1;
+                }
+            }
+        }
+        .cm-video-list {
+            margin-top: 18rpx;
+            // // width: 702rpx;
+            // // height: 420rpx;
+            // width: 544rpx;
+            // height: 960rpx;
+            // .cm-video {
+            //     width: 100% !important;
+            //     max-width: 100%;
+            //     min-width: 100%;
+            //     display: flex;
+            //     // max-height: 420rpx;
+            //     // width: 100%;
+            //     height: 100%;
+            //     background: #000;
+            // }
+        }
+    }
+}
+</style>

+ 22 - 20
components/thorui/tui-modal/tui-modal.vue

@@ -6,10 +6,12 @@
 				<view class="tui-modal-content" :class="[title?'':'tui-mtop']" :style="{color:color,fontSize:size+'rpx'}">{{content}}</view>
 				<view class="tui-modalBtn-box" :class="[button.length!=2?'tui-flex-column':'']">
 					<block v-for="(item,index) in button" :key="index">
-						<button class="tui-modal-btn" :class="['tui-'+(item.type || 'primary')+(item.plain?'-outline':''),button.length!=2?'tui-btn-width':'',button.length>2?'tui-mbtm':'',shape=='circle'?'tui-circle-btn':'']"
-						 :hover-class="'tui-'+(item.plain?'outline':(item.type || 'primary'))+'-hover'" :data-index="index" @tap="handleClick">{{item.text || "确定"}}</button>
+                        <!-- :style="{background: item.customStyle.bgColor ? item.customStyle.bgColor : '',color: item.customStyle.color ? item.customStyle.color : ''}" -->
+						<button class="tui-modal-btn" :class="[(!item.customStyle && ('tui-'+(item.type || 'primary')+(item.plain?'-outline':''))),button.length!=2?'tui-btn-width':'',button.length>2?'tui-mbtm':'',shape=='circle'?'tui-circle-btn':'']"
+                         :style="{background: item.customStyle.bgColor ? item.customStyle.bgColor : '',color: item.customStyle.color ? item.customStyle.color : '',fontSize: item.customStyle.fontSize ? item.customStyle.fontSize : ''}"
+						 :hover-class="!item.customStyle && ('tui-'+(item.plain?'outline':(item.type || 'primary'))+'-hover')"  :data-index="index" @tap="handleClick">{{item.text || "确定"}}</button>
 					</block>
-				</view>
+				</view> 
 			</view>
 			<view v-else>
 				<slot></slot>
@@ -22,7 +24,7 @@
 
 <script>
 	export default {
-		name: "tuiModal",
+		name: 'tuiModal',
 		props: {
 			//是否显示
 			show: {
@@ -31,30 +33,30 @@
 			},
 			width: {
 				type: String,
-				default: "84%"
+				default: '84%'
 			},
 			padding: {
 				type: String,
-				default: "40rpx 64rpx"
+				default: '40rpx 64rpx'
 			},
 			radius: {
 				type: String,
-				default: "24rpx"
+				default: '24rpx'
 			},
 			//标题
 			title: {
 				type: String,
-				default: ""
+				default: ''
 			},
 			//内容
 			content: {
 				type: String,
-				default: ""
+				default: ''
 			},
 			//内容字体颜色
 			color: {
 				type: String,
-				default: "#999"
+				default: '#999'
 			},
 			//内容字体大小 rpx
 			size: {
@@ -70,12 +72,12 @@
 				type: Array,
 				default: function() {
 					return [{
-						text: "取消",
-						type: "danger",
+						text: '取消',
+						type: 'danger',
 						plain: true //是否空心
 					}, {
-						text: "确定",
-						type: "danger",
+						text: '确定',
+						type: 'danger',
 						plain: false
 					}]
 				}
@@ -99,19 +101,19 @@
 		data() {
 			return {
 
-			};
+			}
 		},
 		methods: {
 			handleClick(e) {
-				if (!this.show) return;
-				const dataset = e.currentTarget.dataset;
+				if (!this.show) return
+				const dataset = e.currentTarget.dataset
 				this.$emit('click', {
 					index: Number(dataset.index)
-				});
+				})
 			},
 			handleClickCancel() {
-				if (!this.maskClosable) return;
-				this.$emit('cancel');
+				if (!this.maskClosable) return
+				this.$emit('cancel')
 			}
 		}
 	}

+ 17 - 18
main.js

@@ -10,33 +10,33 @@ import { umtrackWxKey } from '@/utils/config.js'
 import uma from 'umtrack-wx'
 
 // 公共组件
-import { msg, modal,prePage } from'./utils/util'
+import { msg, modal, prePage, boundingClientRect } from './utils/util'
 import cuCustom from './components/cm-custom/cu-custom.vue'
 import auCustom from './components/cm-custom/au-custom.vue'
 import cmCustom from './components/cm-custom/cm-custom.vue'
 import scrollTop from '@/components/cm-module/scrollTop/scrollTop.vue'
-import CityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'//全局注册地址组件
+import CityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue' //全局注册地址组件
 
-Vue.component('cu-custom',cuCustom)
-Vue.component('au-custom',auCustom)
-Vue.component('cm-custom',cmCustom)
-Vue.component('scroll-top',scrollTop)
-Vue.component('city-Picker',CityPicker)
+Vue.component('cu-custom', cuCustom)
+Vue.component('au-custom', auCustom)
+Vue.component('cm-custom', cmCustom)
+Vue.component('scroll-top', scrollTop)
+Vue.component('city-Picker', CityPicker)
 
-Vue.prototype.$getStorage = function(key){
+Vue.prototype.$getStorage = function(key) {
     var userParam = uni.getStorageSync(key)
-    if (userParam != null && userParam != '' && userParam!= undefined) {
+    if (userParam != null && userParam != '' && userParam != undefined) {
         return userParam
-    }else{
+    } else {
         return null
-    } 
+    }
 }
 
 /**
  * 友盟+小程序统计
  */
-if(process.env.NODE_ENV != 'development'){
-// #ifdef MP-WEIXIN
+if (process.env.NODE_ENV != 'development') {
+    // #ifdef MP-WEIXIN
     uma.init({
         appKey: umtrackWxKey, //由友盟分配的APP_KEY
         // 使用Openid进行统计,此项为false时将使用友盟+uuid进行用户统计。
@@ -48,26 +48,25 @@ if(process.env.NODE_ENV != 'development'){
         debug: true, //是否打开调试模式
         uploadUserInfo: false // 自动上传用户信息,设为false取消上传,默认为false
     })
-    uma.install = function (Vue) {
+    uma.install = function(Vue) {
         Vue.prototype.$uma = uma
     }
     Vue.use(uma)
-// #endif
+    // #endif
 }
 
 // Vue实例化
 Vue.config.productionTip = false
 Vue.prototype.$fire = new Vue()
 Vue.prototype.$store = store
-Vue.prototype.$util = {msg,prePage,modal}
+Vue.prototype.$util = { msg, prePage, modal, boundingClientRect }
 Vue.prototype.$api = Api
 Vue.prototype.$reg = Regs
 Vue.prototype.$Static = 'https://static.caimei365.com/app/img/'
 
-
 App.mpType = 'app'
 
 const app = new Vue({
     ...App
 })
-app.$mount()
+app.$mount()

+ 14 - 0
pages.json

@@ -142,6 +142,20 @@
                         "enablePullDownRefresh": true,
                         "navigationStyle": "custom"
                     }
+                },
+                {
+                    "path": "goods-doc-list",
+                    "style": {
+                        "navigationBarTitleText": "美业资料",
+                        "enablePullDownRefresh": false
+                    }
+                },
+                {
+                    "path": "goods-doc-detail",
+                    "style": {
+                        "navigationBarTitleText": "美业资料详情",
+                        "enablePullDownRefresh": false
+                    }
                 }
             ]
         },

+ 105 - 0
pages/goods/goods-doc-detail.vue

@@ -0,0 +1,105 @@
+<!-- 自定义页面 -->
+<template>
+    <view class="goods-doc-detail" :style="{ paddingBottom: tipStatus ? '80rpx' : '0' }">
+        <view class="cm-header">
+            <image
+                class="cm-cover"
+                :src="productImage ? productImage : 'https://static.caimei365.com/app/img/icon2/placeholder.png'"
+            ></image>
+            <view class="cm-title"> {{ productName }} </view>
+            <view class="cm-params"><text>供应商:</text>{{ shopName || '暂无' }}</view>
+            <view class="cm-params"><text>商品属性:</text>{{ productType === 1 ? '商品' : '仪器' }}</view>
+        </view>
+        <cm-product-doc
+            v-if="archiveId !== 0"
+            :archiveId="archiveId"
+            :bottom="isIphoneX ? '60rpx' : '10rpx'"
+            @tipStatus="getTipStatus"
+        ></cm-product-doc>
+    </view>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+import cmProductDoc from '@/components/cm-module/productDetails/cm-product-doc.vue'
+export default {
+    components: {
+        cmProductDoc
+    },
+    computed: {
+        ...mapState(['isIphoneX'])
+    },
+    onLoad(e) {
+        this.userId = uni.getStorageSync('userInfo').userId || -1
+        this.archiveId = e.id || 0
+        this.getDetail()
+    },
+    data() {
+        return {
+            userId: -1,
+            archiveId: 0,
+            archiveProductInfo: {},
+            productImage: '',
+            productName: '',
+            productType: 0,
+            shopName: '',
+            tipStatus: ''
+        }
+    },
+    methods: {
+        // 获取商品资料详情
+        getDetail() {
+            console.log(this.userId)
+            this.BeautyArchive.GetProdcutArchiveDetails({
+                userId: this.userId,
+                archiveId: this.archiveId
+            }).then(res => {
+                console.log(res)
+                if (res.code) return
+                this.productImage = res.data.productImage
+                this.productName = res.data.productName
+                this.productType = res.data.productType
+                this.shopName = res.data.shopName
+            })
+        },
+        // 获取权限tip
+        getTipStatus(status) {
+            this.tipStatus = status
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.goods-doc-detail {
+    background: #f7f7f7;
+}
+.cm-header {
+    background: #fff;
+    margin-bottom: 16rpx;
+    overflow: hidden;
+    .cm-cover {
+        width: 750rpx;
+        height: 750rpx;
+    }
+    .cm-title,
+    .cm-params {
+        padding: 0 24rpx;
+    }
+    .cm-title {
+        margin: 32rpx 0;
+        font-size: 34rpx;
+        line-height: 1.6;
+        color: #333333;
+    }
+    .cm-params {
+        margin: 16rpx 0;
+        font-size: 24rpx;
+        line-height: 1.6;
+        color: #333333;
+        text {
+            font-size: #999999;
+        }
+    }
+}
+</style>

+ 300 - 0
pages/goods/goods-doc-list.vue

@@ -0,0 +1,300 @@
+<template>
+    <view class="goods-doc-list" :class="{ hasBottom: isIphoneX }">
+        <view class="search">
+            <view class="search-control">
+                <text class="iconfont icon-iconfonticonfontsousuo1"></text>
+                <input
+                    placeholder-class="search-placeholder"
+                    placeholder="请输入商品名称/供应商名称"
+                    class="search-input"
+                    type="search"
+                    v-model="listQuery.keyword"
+                    @click="isFoucs = true"
+                    @blur="handleBlur"
+                    @input="handleInput"
+                />
+            </view>
+        </view>
+        <!-- tabs -->
+        <tui-sticky :scrollTop="scrollTop" @sticky="handleSticky" v-if="!isSearch">
+            <template v-slot:header>
+                <view :class="{ hasBorder: isSitcky }">
+                    <tui-tabs
+                        :tabs="tabs"
+                        :currentTab="currentTab"
+                        sliderBgColor="#E15616"
+                        selectedColor="#E15616"
+                        itemWidth="50%"
+                        @change="tabChange"
+                    ></tui-tabs>
+                </view>
+            </template>
+        </tui-sticky>
+        <!-- list -->
+        <view class="doc-list" :style="{ paddingTop: isSitcky ? '80rpx' : '' }">
+            <view class="section" v-for="(item, index) in showList" :key="index" @click="handleRoute(item)">
+                <image class="cover" :src="item.productImage ? item.productImage : 'https://static.caimei365.com/app/img/icon2/placeholder.png'"></image>
+                <view class="content">
+                    <view class="title" v-if="!isSearch">{{ item.productName }}</view>
+                    <view class="title" v-else v-html="item.productName"></view>
+                    <view class="params"><text>供应商:</text>{{ item.shopName || '暂无' }}</view>
+                    <view class="params"><text>商品属性:</text>{{ item.productType === 1 ? '产品' : '仪器' }}</view>
+                </view>
+            </view>
+            <view class="cm-emtpy" v-if="isEmpty">
+                <image src="https://static.caimei365.com/app/img/icon2/PC-empty.png"></image> <text>暂无资料~</text>
+            </view>
+        </view>
+        <!-- loading more -->
+        <view v-if="showList.length > 6">
+            <tui-loadmore :text="loadingText" :index="1" :visible="isLoading"></tui-loadmore>
+            <tui-nomore :text="loadingText" :visible="!isLoading"></tui-nomore>
+        </view>
+        <!-- back top -->
+        <!-- <tui-scroll-top :scrollTop="scrollTop"></tui-scroll-top> -->
+    </view>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+export default {
+    data() {
+        return {
+            isLoading: false,
+            hasMore: false,
+            scrollTop: 0,
+            isSitcky: false,
+            listQuery: {
+                keyword: '', //查询关键词
+                productType: 0, //商品类型 0 全部 1 产品 2 仪器
+                pageNum: 1,
+                pageSize: 10
+            },
+            isFoucs: false,
+            tabs: [{ id: 0, name: '全部' }, { id: 1, name: '产品' }, { id: 2, name: '仪器' }],
+            currentTab: 0,
+            searchList: [],
+            list: [],
+            isEmpty: false
+        }
+    },
+    computed: {
+        ...mapState(['isIphoneX']),
+        loadingText() {
+            if (!this.hasMore) return '没有更多了'
+            if (this.hasMore && !this.isLoading) return '上拉加载更多'
+            return '加载中'
+        },
+        isSearch() {
+            return this.listQuery.keyword.trim() !== '' || this.isFoucs
+        },
+        showList() {
+            if (this.isSearch) return this.searchList
+            return this.list
+        }
+    },
+    watch: {
+        isSearch(val) {
+            if (!val) this.searchList = [] //退出搜索,清空搜索列表
+        }
+    },
+    onLoad() {
+        this.getList()
+    },
+    methods: {
+        // 获取商品列表
+        getList() {
+            this.isLoading = true
+            this.BeautyArchive.GetArchiveProduct(this.listQuery).then(res => {
+                console.log(res)
+                if (res.code) return
+                if (this.isSearch) {
+                    this.formatTitle(res.data.results) // 如果是搜索,需要高亮关键词
+                    this.searchList = [...this.searchList, ...res.data.results]
+                    this.isEmpty = this.searchList.length === 0
+                } else {
+                    this.list = [...this.list, ...res.data.results]
+                    this.isEmpty = this.list.length === 0
+                }
+                this.hasMore = res.data.hasNextPage
+                this.isLoading = false
+            })
+        },
+        // 高亮文字
+        formatTitle(list) {
+            list.forEach((item, index) => {
+                //正则表达式
+                const reg = new RegExp(this.listQuery.keyword, 'g')
+                item.productName = item.productName.replace(reg, $1 => {
+                    return `<span style="color: #E15616;">${$1}</span>`
+                })
+            })
+        },
+        // tab切换
+        tabChange(e) {
+            this.currentTab = e.index
+            this.listQuery.productType = this.currentTab
+            // 清空列表 重置页码为1
+            this.list = []
+            this.listQuery.pageNum = 1
+            this.getList()
+        },
+        // 吸顶
+        handleSticky(e) {
+            this.isSitcky = e.isFixed
+        },
+        // 搜索框输入
+        handleInput(e) {
+            if (e.detail.value.trim() === '') return
+            this.searchList = []
+            // 从第一页开始 , 搜索全部
+            this.listQuery.pageNum = 1
+            this.listQuery.productType = 0
+            let timer = null
+            clearTimeout(timer)
+            timer = setTimeout(() => {
+                this.getList()
+            }, 500)
+        },
+        // 搜索框失去焦点
+        handleBlur() {
+            this.isFoucs = false
+            this.listQuery.productType = this.currentTab
+        },
+        // 路由跳转
+        handleRoute(item) {
+            if (item.redirectType === 1) {
+                this.$api.navigateTo(`/pages/goods/product?id=${item.productId}&open=caimei`)
+            } else {
+                this.$api.navigateTo(`/pages/goods/goods-doc-detail?id=${item.archiveId}`)
+            }
+        }
+    },
+    onPageScroll(e) {
+        this.scrollTop = e.scrollTop
+    },
+    onReachBottom() {
+        if (!this.hasMore) return
+        let timer = null
+        clearTimeout(timer)
+        this.listQuery.pageNum++
+        this.isLoading = true
+        timer = setTimeout(() => {
+            this.getList()
+        }, 400)
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+page {
+    height: initial;
+}
+.hasBorder {
+    border-bottom: 1px solid #eee;
+}
+.hasBottom {
+    padding-bottom: 60rpx;
+}
+.doc-list {
+    padding: 0 24rpx;
+    .section {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: 32rpx 0;
+        border-bottom: 1rpx solid #f0f0f0;
+        &:last-child {
+            border-bottom: 0;
+            padding-bottom: 0;
+        }
+    }
+    .cover {
+        width: 180rpx;
+        height: 180rpx;
+        border-radius: 8rpx;
+    }
+    .content {
+        width: 494rpx;
+        margin-left: 24rpx;
+        .title {
+            height: 74rpx;
+            margin-bottom: 34rpx;
+            font-size: 26rpx;
+            line-height: 37rpx;
+            color: #333333;
+            word-break: break-all;
+            overflow: hidden; /*超出隐藏*/
+            text-overflow: ellipsis; /*文本溢出时显示省略标记*/
+            display: -webkit-box; /*设置弹性盒模型*/
+            -webkit-line-clamp: 2; /*文本占的行数,如果要设置2行加...则设置为2*/
+            -webkit-box-orient: vertical;
+            text {
+                color: #e15616;
+            }
+        }
+        .params {
+            margin-top: 8rpx;
+            font-size: 22rpx;
+            color: #333333;
+            text {
+                color: #999999;
+            }
+        }
+    }
+}
+
+.search-placeholder {
+    color: #b2b2b2;
+    font-size: 28rpx;
+}
+
+.search {
+    display: flex;
+    justify-content: center;
+    width: 750rpx;
+    padding: 24rpx 0 0;
+    background: #fff;
+    .search-control {
+        display: flex;
+        align-items: center;
+        justify-content: flex-start;
+        width: 702rpx;
+        border-radius: 40rpx;
+        background: #f7f7f7;
+        overflow: hidden;
+        .search-input {
+            flex: 1;
+            border: 0;
+            height: 66rpx;
+            font-size: 28rpx;
+            color: #333333;
+        }
+        .iconfont {
+            font-size: 36rpx;
+            margin: 0 20rpx;
+            color: #b2b2b2;
+        }
+    }
+}
+.cm-emtpy {
+    width: 100%;
+    padding-top: 40vw;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    flex-direction: column;
+    image {
+        display: block;
+        width: 260rpx;
+        height: 260rpx;
+    }
+    text {
+        display: block;
+        margin-top: 10rpx;
+        font-size: 26rpx;
+        font-weight: 400;
+        color: #999999;
+    }
+}
+</style>

+ 540 - 384
pages/goods/product.vue

@@ -1,382 +1,537 @@
 <template>
-	<view class="product" :style="{paddingBottom: userIdentity==1 && userIdentity == 3 ? '0rpx' :'188rpx',paddingTop:CustomBar+'px'}">
-		<custom-p   v-if="isHeaderPoduct"
-					:systeminfo='systeminfo' 
-					:navbar-data='nvabarData' 
-					:headerBtnPosi ="headerBtnPosi" 
-					:headerColor="headerColor" 
-					:type="isShareType"
-					:page='backPage'>
-		</custom-p>
-		<view class="product-topnav" v-if='isNavbarFiexd' :class="navbarFiexd" :style="{top:CustomBar +'px'}">
-			<view class="search-input">
-				<view class="gosearch-btn" :class="navbarFiexd" @click="this.$api.navigateTo(clickPath)">
-					<view class="search-icon">
-						<text class="iconfont icon-iconfonticonfontsousuo1"></text>
-					</view>
-					<view class="search-text">搜索商品/项目仪器</view>
-				</view>
-			</view>
-			<view class="navbar">
-				<view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 0 }" @click="tabClick(0)">
-					<text>详情</text>
-					<text class="line"></text>
-				</view>
-				<view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 1 }" @click="tabClick(1)">
-					<text>服务项目</text>
-					<text class="line"></text>
-				</view>	
-				<view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 2 }" @click="tabClick(2)">
-					<text>推荐</text>
-					<text class="line"></text>
-				</view>	
-			</view>	
-		</view>
-		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
-		<template v-else >
-			<view class="cart-content empty" v-if="isInvalid">
-				<view  class="empty-container">
-					<image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
-					<text class="error-text">商品已失效,去商城逛逛别的吧~</text>
-					<view class="login-btn"  @click="goIndex">去商城</view>
-				</view>
-			</view>
-			<view class="container-product tui-skeleton" v-else>
-				<view class="container-product-main">
-					<view class="product-top">
-						<view class="banner-section">
-							<uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode" >
-								<swiper class="banner tui-banner tui-skeleton-rect"  @change="swiperChange" :duration='800' :autoplay="false" :circular="true" >
-									<swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item"> 
-										<image :src="item" @click="previewImg(index)" class="product-img" />
-										<view class="cm-product-cover" v-if="product.appletsActType === 1">云上美博会</view>
-									</swiper-item>
-								</swiper>
-								<view class="swiper__dots-box">
-									<tui-tag padding="12rpx 24rpx" 
-											 type="translucent" 
-											 shape="circleLeft" 
-											 size="32rpx" 
-											 :scaleMultiple="0.82" originRight>
-										{{ current + 1 }}/{{ productImage.length }}
-									</tui-tag>
-								</view>
-							</uni-swiper-dot>
-						</view>
-						<view class="product-wrap clearfix">
-							<view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
-								<view class="wrap-top-price">
-									<cm-price v-if="isRequest"
-											  :product="product"
-											  :userIdentity="userIdentity"
-											  :shopID= "shopID"
-											  :promotions="product.promotions"
-											  :ladderPriceList="ladderPriceList"/>
-								</view>
-								<view class="p-title tui-skeleton-fillet">
-									<view class="mclap-tag" v-if="product.beautyActFlag == '1'">美博会</view>
-									<view class="p-title-name" :class="product.beautyActFlag == '1' ? 'indent' : ''"> 
-										{{product.name == undefined ? '' : product.name}} 
-									</view>
-									<button open-type="share" class="p-title-share tui-share-position" @tap="onShare">
-										<view class=""><text class="iconfont icon-fenxiang1"></text></view>
-										<view class="">分享</view>
-									</button>
-								</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="product-seve" v-if="hasLogin">
-									<text class="label">采美承诺:</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 class="productRemarks"  v-if="product.productRemarks!=''&&product.productRemarks!=null">
-									备注:{{product.productRemarks}}
-								</view>
-							</view>
-						</view>			
-					</view>
-					<view class="product-item-none" v-if="goodsData.isNoneDisabled">
-						<image class="none-image" :src="productNoneImage" mode=""></image>
-						<view class="none-text">此商品已{{goodsData.disabledText}},请浏览以下推荐商品~</view>
-					</view>
-					<!-- 参数 -->
-					<view class="product-parameter" @click="showPopup(0)" v-if="!goodsData.isNoneDisabled">
-						<text class="title">参数:</text>
-						<text class="name">品牌  起订量  分类...</text>
-						<text class="iconfont icon-xiayibu"></text>
-					</view>
-					<!-- 优惠券 -->
-					<view class="product-parameter coupon" v-if="isShowButton && productCoupon.length>0" @click="showPopup(2)">
-						<text class="title">优惠券:</text>
-						<view class="coupon">
-							<text class="tags"  v-for="(coupon, index) in productCoupon.slice(0,3)" :key="index"> 
-								满{{ coupon.touchPrice }}减{{ coupon.couponAmount }} 
-							</text>
-						</view>
-						<text class="iconfont icon-xiayibu"></text>
-					</view>
-					<!-- 仪器培训方案 -->
-					<view class="product-parameter" @click="showPopup(1)" v-if='product.commodityType == 2 && product.trainingMethod'>
-						<text class="title">培训方案:</text>
-						<text class="name">{{ product.trainingMethod == 1 ? '线上培训' : '线下培训' }}</text>
-						<text class="iconfont icon-xiayibu"></text>
-					</view>
-					<!-- 供应商 -->
-					<view class="product-supplier" v-if="isNoneSupplier" @click="goSupplier">
-						<view class="logo"><img :src="shop.logo ? shop.logo :'https://static.caimei365.com/app/img/icon/icon-shoplogo.png'" alt=""></view>
-						<view class="main">
-							<view class="name">{{shop.name}}</view>
-							<view class="massgs">
-								<view class="label">满意度:</view>
-								<view class="p-stars">
-									<uni-stars :stars="6" :iconClass="iconClass" :iconColor="iconColor" :fontSize="36" :widthInfo="176"></uni-stars>
-								</view>
-								<view class="acount">
-									<text>{{ shop.normalNum }}</text>件商品
-								</view>
-							</view>
-						</view>
-						<view class="right"><text class="iconfont icon-xiayibu"></text></view>
-					</view>
-				</view>
-				<view class="product-details product-details0">
-					<!-- 商品详情 -->
-					<view class="title">
-						<view class="title-tab">商品详情</view>
-					</view>
-					<view class="content tui-banner product-rich-text tui-skeleton-rect">
-						<parser :html="html" :img-mode="widthFix" v-if="!goodsData.isNoneDisabled && product.productDetail.detailInfo"></parser>
-						<view class="product-rich-text-none" v-else>暂无商品信息</view>
-					</view>
-				</view>	
-				<view class="product-details service product-details1">
-					<!-- 服务项目 -->
-					<view class="title">
-						<view class="title-tab">服务项目</view>
-					</view>
-					<view class="content service" v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
-						<cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
-					</view>
-					<view class="content-none"  v-else>
-						<text>暂无服务项目</text>
-					</view>
-				</view>	
-				<view class="product-details recommend product-details2">
-					<!-- 相关推荐 -->
-					<view class="title">
-						<view class="title-tab">相关推荐</view>
-					</view>
-					<view class="content hot">
-						<recommend :query-productid="product.productId" :query-type="product.recommendType" v-if="isRequest"></recommend>
-					</view>
-				</view>	
-				<!-- 商品参数 -->
-				<tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
-					<view class="tui-popup-box clearfix">
-						<view class="title">商品参数</view>
-						<div class="tui-popup-main">
-							<scroll-view class="tui-popup-scroll"  scroll-y="true">
-								<view class="content-tr">
-									<view class="content-td">起订量</view>
-									<view class="content-th">{{product.minBuyNumber}}</view>
-								</view>
-								<view class="content-tr">
-									<view class="content-td">品牌</view>
-									<view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
-								</view>
-								<view class="content-tr">
-									<view class="content-td">分类</view>
-									<view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
-								</view>
-								<view class="content-tr">
-									<view class="content-td">包装规格</view> 
-									<view class="content-th">{{product.unit}}</view>
-								</view>
-								<view class="content-tr">
-									<view class="content-td">商品编码</view>
-									<view class="content-th">{{product.productCode}}</view>
-								</view>
-								<view class="content-tr">
-									<view class="content-td">库存</view>
-									<view class="content-th">{{product.stock}}</view>
-								</view>
-								<view class="content-tr" v-if="product.parametersList.length>0" v-for="(item, index) in product.parametersList" :key="index">
-									<view class="content-td">{{item.paramsName}}</view>
-									<view class="content-th">{{item.paramsContent}}</view>
-								</view>
-							</scroll-view>
-						</div>
-						<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
-							<view class="tui-flex-1">
-								<view class="tui-button" @click="hidePopup(0)">收起</view>
-							</view>
-						</view>
-					</view>	
-				</tui-bottom-popup>	
-				<!-- 优惠券 -->
-				<tui-bottom-popup :radius="true" :show="popupShow2" @close="hidePopup(2)">
-					<view class="tui-popup-box clearfix">
-						<view class="title">优惠券</view>
-						<view class="tui-popup-close" @click="hidePopup(2)">
-							<text class="iconfont icon-iconfontguanbi"></text>
-						</view>
-						<view class="tui-popup-tabs">
-							<coupon-tabs  :tabs="navbar"
-										  :currentTab="currentTab > 2 ? 0 : currentTab" 
-										  @change="couponChange" 
-										  :itemWidth="(100/navbar.length)+'%'"
-										  selectedColor="#e15616" 
-										  sliderBgColor="#e15616">
-							</coupon-tabs>
-						</view>
-						<div class="tui-popup-main coupon">
-							<scroll-view class="tui-popup-scroll"  scroll-y="true">
-								<view class="coupon-empty" v-if="isCouponEmpty">
-									<image class="empty-container-image" :src="StaticUrl+'/icon/icon-coupon-empty@2x.png'"></image>
-									<text class="error-text">暂无可领的优惠券~</text>
-								</view>
-								<template v-else>
-									<view 	v-for="(coupon,index) in productCouponList"
-											:key="index" 
-											:id="coupon.couponId" 
-											class="coupon-list" 
-									>
-										<view class="list-cell-le">
-											<view class="coupon-maxMoney"><text class="small">¥</text>{{ coupon.couponAmount }}</view>
-											<view class="coupon-minMoney">满{{ coupon.touchPrice }}可用</view>
-										</view>
-										<view class="list-cell-ri">
-											<view class="list-cell-top">
-												<view class="list-cell-type">
-													<view class="list-cell-tags">
-														<text class="tags">{{ coupon.couponType | TypeFormat }}</text>
-													</view>
-													<view class="list-cell-texts">
-														<text v-if="coupon.couponType == 0">
-															{{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
-														</text>
-														<text v-if="coupon.couponType == 1">
-															{{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
-														</text>
-														<text v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</text>
-														<text v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</text>
-													</view>
-												</view>
-												<view class="list-cell-btn">
-													<view class="icon-used">
-														<view class="icon-used-btn receive" v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</view>
-														<view class="icon-used-btn make" v-if="currentTab == 1">已领取</view>
-													</view>
-												</view>
-											</view>
-											<view class="list-cell-time">{{ coupon.startDate }} - {{ coupon.endDate }}</view>
-										</view>
-									</view>
-								</template>
-							</scroll-view>
-						</div>
-					</view>	
-				</tui-bottom-popup>	
-				<!-- 培训方案 -->
-				<tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
-					<view class="tui-popup-box clearfix">
-						<view class="title">培训方案</view>
-						<div class="tui-popup-main">
-							<scroll-view class="tui-popup-scroll train"  scroll-y="true">
-								<view class="content-tr">
-									<view class="content-td">培训方式:</view>
-									<view class="content-th">{{ product.trainingMethod == 1 ? '线上培训' : '线下培训' }}</view>
-								</view>
-								<view class="content-tr">
-									<view class="content-td">培训费用:</view>
-									<view class="content-th">{{ product.trainingType == 1 ? '¥'+product.trainingFee : '售价已包含' }}</view>
-								</view>
-							</scroll-view>
-						</div>
-						<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
-							<view class="tui-flex-1">
-								<view class="tui-button" @click="hidePopup(1)">收起</view>
-							</view>
-						</view>
-					</view>	
-				</tui-bottom-popup>	
-				<!-- 底部按钮 -->
-				<view class="menu" v-if="isShowButton">
-					<view class="bottom-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
-						<view class="bottom-le">
-							<view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">
-								<image src="../../static/icon-home-active@3x.png"></image>
-								<text>首页</text>
-							</view>
-							<view class="item-bt" @click="handleCollection">
-								<image :src="collectionType ? StaticUrl+'icon/icon-collection@2x.png' : StaticUrl+'icon/icon-collection-none@2x.png'"></image>
-								<text>{{ collectionType ? '已收藏' : '收藏' }}</text>
-							</view>
-							<view class="item-bt" @click="buyProductCart()">
-								<image src="https://static.caimei365.com/app/img/icon/icon-cart-active@3x.png"></image>
-								<text>购物车</text>
-								<text  	v-if="hasLogin && bottomCartNumber>0"
-										class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
-										:class="[bottomCartNumber < 10 ? 'goleft':'']">
-										{{ bottomCartNumber >= 100 ? '99+': bottomCartNumber}}
-								</text>
-								<view class="animation-num"  :class="isAnimation ? 'animation' : 'restion'">+1</view>
-							</view>
-						</view>
-						<view class="bottom-ri">
-							<button  
-									:disabled="goodsData.disabled" 
-									class="btn btn-cart" 
-									:class="[goodsData.disabled ? 'disabled':'']"
-									@tap.stop="btnGetConfirm('add')">加入购物车</button>
-							<button  
-									:disabled="goodsData.disabled" 
-									class="btn btn-bay" 
-									:class="[goodsData.disabled ? 'disabled':'']"
-									@tap.stop="btnGetConfirm('buy')">立即购买</button>
-						</view>
-					</view>	
-				</view>
-				<!--底部选择模态层弹窗组件 -->	
-				<view class="popup spec" :class="specClass"  @touchmove.stop.prevent="discard" @tap="hideSpec">
-					<!-- 遮罩层 -->
-					<view class="mask"></view>
-					<view class="layer" @tap.stop="discard" :style="{paddingBottom :isIphoneX ? '68rpx' : '36rpx',bottom:isIphoneX ?'-352rpx' : '-296rpx'}">
-						<view class="content">
-							<view class="layer-smimg">
-								<image :src="product.mainImage" mode=""></image>
-							</view>
-							<view class="layer-nunbox">
-								<view class="layer-nunbox-t" v-if="product.step === 2">
-									<view class="text">*该商品只能以起订量的整数倍购买</view>
-								</view>
-								<view class="layer-nunbox-t">
-									<view class="layer-nunbox-text">数量:</view>
-									<view class="number-box">
-										<view  class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
-										<input class="btn-input" type="number" v-model="number" maxlength='4'  @blur="changeNumber($event)">
-										<view  class="iconfont icon-jiahao"  :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
-									</view>
-								</view>
-								<view class="layer-nunbox-b">
-									<view class="text">单价:
-										<text class="p sm">¥</text>
-										<text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
-									</view>
-								</view>
-							</view>
-						</view>
-						<view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
-					</view>
-				</view>
-				<!-- 侧边 -->
-				<scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
-			</view>
-		</template>
-	</view>
+    <view
+        class="product "
+        :style="{
+            paddingBottom: userIdentity == 1 && userIdentity == 3 ? '0rpx' : '188rpx',
+            paddingTop: CustomBar + 'px'
+        }"
+    >
+        <custom-p
+            v-if="isHeaderPoduct"
+            :systeminfo="systeminfo"
+            :navbar-data="nvabarData"
+            :headerBtnPosi="headerBtnPosi"
+            :headerColor="headerColor"
+            :type="isShareType"
+            :page="backPage"
+        >
+        </custom-p>
+        <view
+            class="product-topnav"
+            id="topBar"
+            v-show="isNavbarFiexd"
+            :class="navbarFiexd"
+            :style="{ top: CustomBar + 'px' }"
+        >
+            <view class="search-input">
+                <view class="gosearch-btn" :class="navbarFiexd" @click="this.$api.navigateTo(clickPath)">
+                    <view class="search-icon"> <text class="iconfont icon-iconfonticonfontsousuo1"></text> </view>
+                    <view class="search-text">搜索商品/项目仪器</view>
+                </view>
+            </view>
+            <view class="navbar">
+                <view
+                    class="nav-item tui-skeleton-fillet"
+                    :class="{ current: tabCurrentIndex === 0 }"
+                    @click="tabClick(0)"
+                >
+                    <text>详情</text> <text class="line"></text>
+                </view>
+                <view
+                    class="nav-item tui-skeleton-fillet"
+                    :class="{ current: tabCurrentIndex === 1 }"
+                    @click="tabClick(1)"
+                >
+                    <text>服务项目</text> <text class="line"></text>
+                </view>
+                <view
+                    class="nav-item tui-skeleton-fillet"
+                    :class="{ current: tabCurrentIndex === 2 }"
+                    @click="tabClick(2)"
+                >
+                    <text>推荐</text> <text class="line"></text>
+                </view>
+                <view
+                    class="nav-item tui-skeleton-fillet"
+                    :class="{ current: tabCurrentIndex === 3 }"
+                    @click="tabClick(3)"
+                    v-if="product.archiveId !== 0"
+                >
+                    <text>相关资料</text> <text class="line"></text>
+                </view>
+            </view>
+        </view>
+        <tui-skeleton
+            v-if="skeletonShow"
+            backgroundColor="#fafafa"
+            borderRadius="10rpx"
+            :isLoading="true"
+            :loadingType="5"
+        ></tui-skeleton>
+        <template v-else>
+            <view class="cart-content empty" v-if="isInvalid">
+                <view class="empty-container">
+                    <image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
+                    <text class="error-text">商品已失效,去商城逛逛别的吧~</text>
+                    <view class="login-btn" @click="goIndex">去商城</view>
+                </view>
+            </view>
+            <view class="container-product tui-skeleton" v-else>
+                <view class="container-product-main">
+                    <view class="product-top">
+                        <view class="banner-section">
+                            <uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode">
+                                <swiper
+                                    class="banner tui-banner tui-skeleton-rect"
+                                    @change="swiperChange"
+                                    :duration="800"
+                                    :autoplay="false"
+                                    :circular="true"
+                                >
+                                    <swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item">
+                                        <image :src="item" @click="previewImg(index)" class="product-img" />
+                                        <view class="cm-product-cover" v-if="product.appletsActType === 1"
+                                            >云上美博会</view
+                                        >
+                                    </swiper-item>
+                                </swiper>
+                                <view class="swiper__dots-box">
+                                    <tui-tag
+                                        padding="12rpx 24rpx"
+                                        type="translucent"
+                                        shape="circleLeft"
+                                        size="32rpx"
+                                        :scaleMultiple="0.82"
+                                        originRight
+                                    >
+                                        {{ current + 1 }}/{{ productImage.length }}
+                                    </tui-tag>
+                                </view>
+                            </uni-swiper-dot>
+                        </view>
+                        <view class="product-wrap clearfix">
+                            <view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
+                                <view class="wrap-top-price">
+                                    <cm-price
+                                        v-if="isRequest"
+                                        :product="product"
+                                        :userIdentity="userIdentity"
+                                        :shopID="shopID"
+                                        :promotions="product.promotions"
+                                        :ladderPriceList="ladderPriceList"
+                                    />
+                                </view>
+                                <view class="p-title tui-skeleton-fillet">
+                                    <view class="mclap-tag" v-if="product.beautyActFlag == '1'">美博会</view>
+                                    <view class="p-title-name" :class="product.beautyActFlag == '1' ? 'indent' : ''">
+                                        {{ product.name == undefined ? '' : product.name }}
+                                    </view>
+                                    <button open-type="share" class="p-title-share tui-share-position" @tap="onShare">
+                                        <view class=""><text class="iconfont icon-fenxiang1"></text></view>
+                                        <view class="">分享</view>
+                                    </button>
+                                </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="product-seve" v-if="hasLogin">
+                                    <text class="label">采美承诺:</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
+                                    class="productRemarks"
+                                    v-if="product.productRemarks != '' && product.productRemarks != null"
+                                >
+                                    备注:{{ product.productRemarks }}
+                                </view>
+                            </view>
+                        </view>
+                    </view>
+                    <view class="product-item-none" v-if="goodsData.isNoneDisabled">
+                        <image class="none-image" :src="productNoneImage" mode=""></image>
+                        <view class="none-text">此商品已{{ goodsData.disabledText }},请浏览以下推荐商品~</view>
+                    </view>
+                    <!-- 参数 -->
+                    <view class="product-parameter" @click="showPopup(0)" v-if="!goodsData.isNoneDisabled">
+                        <text class="title">参数:</text> <text class="name">品牌 起订量 分类...</text>
+                        <text class="iconfont icon-xiayibu"></text>
+                    </view>
+                    <!-- 优惠券 -->
+                    <view
+                        class="product-parameter coupon"
+                        v-if="isShowButton && productCoupon.length > 0"
+                        @click="showPopup(2)"
+                    >
+                        <text class="title">优惠券:</text>
+                        <view class="coupon">
+                            <text class="tags" v-for="(coupon, index) in productCoupon.slice(0, 3)" :key="index">
+                                满{{ coupon.touchPrice }}减{{ coupon.couponAmount }}
+                            </text>
+                        </view>
+                        <text class="iconfont icon-xiayibu"></text>
+                    </view>
+                    <!-- 仪器培训方案 -->
+                    <view
+                        class="product-parameter"
+                        @click="showPopup(1)"
+                        v-if="product.commodityType == 2 && product.trainingMethod"
+                    >
+                        <text class="title">培训方案:</text>
+                        <text class="name">{{ product.trainingMethod == 1 ? '线上培训' : '线下培训' }}</text>
+                        <text class="iconfont icon-xiayibu"></text>
+                    </view>
+                    <!-- 供应商 -->
+                    <view class="product-supplier" v-if="isNoneSupplier" @click="goSupplier">
+                        <view class="logo">
+                            <img :src="shop.logo? shop.logo: 'https://static.caimei365.com/app/img/icon/icon-shoplogo.png'"alt=""/></view>
+                        <view class="main">
+                            <view class="name">{{ shop.name }}</view>
+                            <view class="massgs">
+                                <view class="label">满意度:</view>
+                                <view class="p-stars">
+                                    <uni-stars
+                                        :stars="6"
+                                        :iconClass="iconClass"
+                                        :iconColor="iconColor"
+                                        :fontSize="36"
+                                        :widthInfo="176"
+                                    ></uni-stars>
+                                </view>
+                                <view class="acount">
+                                    <text>{{ shop.normalNum }}</text
+                                    >件商品
+                                </view>
+                            </view>
+                        </view>
+                        <view class="right"><text class="iconfont icon-xiayibu"></text></view>
+                    </view>
+                </view>
+                <!-- 商品详情 -->
+                <view v-show="tabCurrentIndex !== 3">
+                    <view class="product-details product-details0">
+                        <view class="title"> <view class="title-tab">商品详情</view> </view>
+                        <view class="content tui-banner product-rich-text tui-skeleton-rect">
+                            <parser
+                                :html="html"
+                                :img-mode="widthFix"
+                                v-if="!goodsData.isNoneDisabled && product.productDetail.detailInfo"
+                            ></parser>
+                            <view class="product-rich-text-none" v-else>暂无商品信息</view>
+                        </view>
+                    </view>
+                    <!-- 服务项目 -->
+                    <view class="product-details service product-details1">
+                        <view class="title"> <view class="title-tab">服务项目</view> </view>
+                        <view
+                            class="content service"
+                            v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo"
+                        >
+                            <cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
+                        </view>
+                        <view class="content-none" v-else> <text>暂无服务项目</text> </view>
+                    </view>
+                    <!-- 相关推荐 -->
+                    <view class="product-details recommend product-details2">
+                        <view class="title"> <view class="title-tab">相关推荐</view> </view>
+                        <view class="content hot">
+                            <recommend
+                                :query-productid="product.productId"
+                                :query-type="product.recommendType"
+                                v-if="isRequest"
+                            ></recommend>
+                        </view>
+                    </view>
+                </view>
+                <!-- 相关资料 -->
+                <view class="product-details recommend product-details3" v-show="tabCurrentIndex === 3">
+                    <cm-product-doc @previewImage="changePreViewImageStatus" :archiveId="product.archiveId" :userId='userId'></cm-product-doc>
+                </view>
+                <!-- 商品参数 -->
+                <tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
+                    <view class="tui-popup-box clearfix">
+                        <view class="title">商品参数</view>
+                        <div class="tui-popup-main">
+                            <scroll-view class="tui-popup-scroll" scroll-y="true">
+                                <view class="content-tr">
+                                    <view class="content-td">起订量</view>
+                                    <view class="content-th">{{ product.minBuyNumber }}</view>
+                                </view>
+                                <view class="content-tr">
+                                    <view class="content-td">品牌</view>
+                                    <view class="content-th">{{
+                                        product.brandName == null ? '其他' : product.brandName
+                                    }}</view>
+                                </view>
+                                <view class="content-tr">
+                                    <view class="content-td">分类</view>
+                                    <view class="content-th">{{
+                                        product.typeName == null ? '暂无' : product.typeName
+                                    }}</view>
+                                </view>
+                                <view class="content-tr">
+                                    <view class="content-td">包装规格</view>
+                                    <view class="content-th">{{ product.unit }}</view>
+                                </view>
+                                <view class="content-tr">
+                                    <view class="content-td">商品编码</view>
+                                    <view class="content-th">{{ product.productCode }}</view>
+                                </view>
+                                <view class="content-tr">
+                                    <view class="content-td">库存</view>
+                                    <view class="content-th">{{ product.stock }}</view>
+                                </view>
+                                <view
+                                    class="content-tr"
+                                    v-if="product.parametersList.length > 0"
+                                    v-for="(item, index) in product.parametersList"
+                                    :key="index"
+                                >
+                                    <view class="content-td">{{ item.paramsName }}</view>
+                                    <view class="content-th">{{ item.paramsContent }}</view>
+                                </view>
+                            </scroll-view>
+                        </div>
+                        <view
+                            class="tui-right-flex tui-popup-btn"
+                            :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }"
+                        >
+                            <view class="tui-flex-1"> <view class="tui-button" @click="hidePopup(0)">收起</view> </view>
+                        </view>
+                    </view>
+                </tui-bottom-popup>
+                <!-- 优惠券 -->
+                <tui-bottom-popup :radius="true" :show="popupShow2" @close="hidePopup(2)">
+                    <view class="tui-popup-box clearfix">
+                        <view class="title">优惠券</view>
+                        <view class="tui-popup-close" @click="hidePopup(2)">
+                            <text class="iconfont icon-iconfontguanbi"></text>
+                        </view>
+                        <view class="tui-popup-tabs">
+                            <coupon-tabs
+                                :tabs="navbar"
+                                :currentTab="currentTab > 2 ? 0 : currentTab"
+                                @change="couponChange"
+                                :itemWidth="100 / navbar.length + '%'"
+                                selectedColor="#e15616"
+                                sliderBgColor="#e15616"
+                            >
+                            </coupon-tabs>
+                        </view>
+                        <div class="tui-popup-main coupon">
+                            <scroll-view class="tui-popup-scroll" scroll-y="true">
+                                <view class="coupon-empty" v-if="isCouponEmpty">
+                                    <image
+                                        class="empty-container-image"
+                                        :src="StaticUrl + '/icon/icon-coupon-empty@2x.png'"
+                                    ></image>
+                                    <text class="error-text">暂无可领的优惠券~</text>
+                                </view>
+                                <template v-else>
+                                    <view
+                                        v-for="(coupon, index) in productCouponList"
+                                        :key="index"
+                                        :id="coupon.couponId"
+                                        class="coupon-list"
+                                    >
+                                        <view class="list-cell-le">
+                                            <view class="coupon-maxMoney"
+                                                ><text class="small">¥</text>{{ coupon.couponAmount }}</view
+                                            >
+                                            <view class="coupon-minMoney">满{{ coupon.touchPrice }}可用</view>
+                                        </view>
+                                        <view class="list-cell-ri">
+                                            <view class="list-cell-top">
+                                                <view class="list-cell-type">
+                                                    <view class="list-cell-tags">
+                                                        <text class="tags">{{ coupon.couponType | TypeFormat }}</text>
+                                                    </view>
+                                                    <view class="list-cell-texts">
+                                                        <text v-if="coupon.couponType == 0">
+                                                            {{
+                                                                coupon.productType && coupon.productType == 1
+                                                                    ? '全商城商品通用'
+                                                                    : '仅可购买指定商品'
+                                                            }}
+                                                        </text>
+                                                        <text v-if="coupon.couponType == 1">
+                                                            {{
+                                                                coupon.categoryType == 1
+                                                                    ? '仅限购买产品类商品'
+                                                                    : '仅限购买仪器类商品'
+                                                            }}
+                                                        </text>
+                                                        <text v-if="coupon.couponType == 3"
+                                                            >仅限购买店铺【{{ coupon.shopName }}】的商品</text
+                                                        >
+                                                        <text v-if="coupon.couponType == 4 || coupon.couponType == 2"
+                                                            >全商城商品通用</text
+                                                        >
+                                                    </view>
+                                                </view>
+                                                <view class="list-cell-btn">
+                                                    <view class="icon-used">
+                                                        <view
+                                                            class="icon-used-btn receive"
+                                                            v-if="currentTab == 0"
+                                                            @click="receiveCoupon(coupon)"
+                                                            >领取</view
+                                                        >
+                                                        <view class="icon-used-btn make" v-if="currentTab == 1"
+                                                            >已领取</view
+                                                        >
+                                                    </view>
+                                                </view>
+                                            </view>
+                                            <view class="list-cell-time"
+                                                >{{ coupon.startDate }} - {{ coupon.endDate }}</view
+                                            >
+                                        </view>
+                                    </view>
+                                </template>
+                            </scroll-view>
+                        </div>
+                    </view>
+                </tui-bottom-popup>
+                <!-- 培训方案 -->
+                <tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
+                    <view class="tui-popup-box clearfix">
+                        <view class="title">培训方案</view>
+                        <div class="tui-popup-main">
+                            <scroll-view class="tui-popup-scroll train" scroll-y="true">
+                                <view class="content-tr">
+                                    <view class="content-td">培训方式:</view>
+                                    <view class="content-th">{{
+                                        product.trainingMethod == 1 ? '线上培训' : '线下培训'
+                                    }}</view>
+                                </view>
+                                <view class="content-tr">
+                                    <view class="content-td">培训费用:</view>
+                                    <view class="content-th">{{
+                                        product.trainingType == 1 ? '¥' + product.trainingFee : '售价已包含'
+                                    }}</view>
+                                </view>
+                            </scroll-view>
+                        </div>
+                        <view
+                            class="tui-right-flex tui-popup-btn"
+                            :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }"
+                        >
+                            <view class="tui-flex-1"> <view class="tui-button" @click="hidePopup(1)">收起</view> </view>
+                        </view>
+                    </view>
+                </tui-bottom-popup>
+                <!-- 底部按钮 -->
+                <view class="menu" v-if="isShowButton">
+                    <view class="bottom-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
+                        <view class="bottom-le">
+                            <view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">
+                                <image src="../../static/icon-home-active@3x.png"></image> <text>首页</text>
+                            </view>
+                            <button class="item-bt" open-type="contact" @click="handleContact">
+                                <image src="../../static/severs@3x.png"></image> <text>客服</text>
+                            </button>
+                            <view class="item-bt" @click="buyProductCart()">
+                                <image src="https://static.caimei365.com/app/img/icon/icon-cart-active@3x.png"></image>
+                                <text>购物车</text>
+                                <text
+                                    v-if="hasLogin && bottomCartNumber > 0"
+                                    class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
+                                    :class="[bottomCartNumber < 10 ? 'goleft' : '']"
+                                >
+                                    {{ bottomCartNumber >= 100 ? '99+' : bottomCartNumber }}
+                                </text>
+                                <view class="animation-num" :class="isAnimation ? 'animation' : 'restion'">+1</view>
+                            </view>
+                        </view>
+                        <view class="bottom-ri">
+                            <button
+                                :disabled="goodsData.disabled"
+                                class="btn btn-cart"
+                                :class="[goodsData.disabled ? 'disabled' : '']"
+                                @tap.stop="btnGetConfirm('add')"
+                            >
+                                加入购物车
+                            </button>
+                            <button
+                                :disabled="goodsData.disabled"
+                                class="btn btn-bay"
+                                :class="[goodsData.disabled ? 'disabled' : '']"
+                                @tap.stop="btnGetConfirm('buy')"
+                            >
+                                立即购买
+                            </button>
+                        </view>
+                    </view>
+                </view>
+                <!--底部选择模态层弹窗组件 -->
+                <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
+                    <!-- 遮罩层 -->
+                    <view class="mask"></view>
+                    <view
+                        class="layer"
+                        @tap.stop="discard"
+                        :style="{
+                            paddingBottom: isIphoneX ? '68rpx' : '36rpx',
+                            bottom: isIphoneX ? '-352rpx' : '-296rpx'
+                        }"
+                    >
+                        <view class="content">
+                            <view class="layer-smimg"> <image :src="product.mainImage" mode=""></image> </view>
+                            <view class="layer-nunbox">
+                                <view class="layer-nunbox-t" v-if="product.step === 2">
+                                    <view class="text">*该商品只能以起订量的整数倍购买</view>
+                                </view>
+                                <view class="layer-nunbox-t">
+                                    <view class="layer-nunbox-text">数量:</view>
+                                    <view class="number-box">
+                                        <view
+                                            class="iconfont icon-jianhao"
+                                            :class="[isQuantity == true ? 'disabled' : '']"
+                                            @click="changeCountSub()"
+                                        ></view>
+                                        <input
+                                            class="btn-input"
+                                            type="number"
+                                            v-model="number"
+                                            maxlength="4"
+                                            @blur="changeNumber($event)"
+                                        />
+                                        <view
+                                            class="iconfont icon-jiahao"
+                                            :class="[isStock == true ? 'disabled' : '']"
+                                            @click="changeCountAdd()"
+                                        ></view>
+                                    </view>
+                                </view>
+                                <view class="layer-nunbox-b">
+                                    <view class="text"
+                                        >单价: <text class="p sm">¥</text>
+                                        <text class="p bg">{{ buyRetailPrice.toFixed(2) }}</text>
+                                    </view>
+                                </view>
+                            </view>
+                        </view>
+                        <view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
+                    </view>
+                </view>
+                <!-- 侧边 -->
+                <scroll-top :isScrollTop="isScrollTop" :bottom="200" v-show="tabCurrentIndex !== 3"></scroll-top>
+            </view>
+        </template>
+    </view>
 </template>
 
 <script>
@@ -409,7 +564,6 @@
 		data(){
 			return{			
 				StaticUrl:this.$Static, //静态图片路径
-				collectionType:false,
 				clickPath:'/pages/search/search',
 				html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
 				productNoneImage:'https://static.caimei365.com/app/img/icon/icon-pnone.png',
@@ -698,6 +852,10 @@
 				  }).exec()
 				}).exec()
 			},
+			handleContact(e){//跳转小程序客服
+				console.log(e.detail.path)
+				console.log(e.detail.query)
+			},
 			buyProductCart(){//底部购物车按钮点击
 				if(this.hasLogin){
 					// 友盟埋点商品详情购物车入口点击事件
@@ -707,6 +865,7 @@
 							Um_Key_SourcePage: '商品详情购物车入口',
 						})
 					}		
+					// this.$api.navigateTo('/pages/goods/cart')
 					this.$api.navigateTo('/pages/goods/cart-index')
 				}else{
 					this.$api.navigateTo('/pages/login/login?type=1')
@@ -879,10 +1038,7 @@
 				  imageUrl:`${this.productImage[0]}`
 				}
 			},
-			handleCollection(){// 收藏
-				this.collectionType = !this.collectionType
-			},
-			showPopup(index){// 弹窗显示
+			showPopup(index){
 				switch(index){
 					case 0:
 						this.popupShow0 = true
@@ -900,7 +1056,7 @@
 						break;
 				}
 			},
-			hidePopup(index){// 弹窗隐藏
+			hidePopup(index){
 				switch(index){
 					case 0:
 						this.popupShow0 = false

+ 23 - 2
pages/h5/article/path.vue

@@ -16,16 +16,37 @@
 	            },
 				productID:'',
 				activityPath:'',
-				
 	        }
 	    },
 		onLoad(option) {
-			this.activityPath = option.link
+            // 普通传参
+            if(option.link) {
+                this.activityPath = option.link
+                return
+            }
+            this.initPath(option)
 		},
 		methods:{
 			navToDetailPage() {//跳转商品详情页
 				this.$api.navigateTo(`/pages/goods/product?id=${this.productID}`)
 			},
+            initPath(option){
+                if(!option.key || !option.type) return
+                const link = uni.getStorageSync(option.key)
+                const type = parseInt(option.type)
+                uni.removeStorageSync(option.key) // 清除链接缓存
+                //是word 或 ppt链接
+                if(type === 1){
+                    this.activityPath = link
+                    return
+                }
+                //是pdf链接
+                let URL_CONFIG = ''
+                if(process.env.NODE_ENV === 'development'){
+                    URL_CONFIG = 'https://www-b.caimei365.com'
+                }
+                this.activityPath = `${URL_CONFIG}/document/pdfdetails.html?type=1&src=${link}`
+            }
 		}
 	}
 </script>

+ 25 - 24
pages/user/account/account-bean.vue

@@ -60,10 +60,10 @@
 	</view>
 </template>
 <script>
-	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
-	import tuiNomore from "@/components/tui-components/nomore/nomore"
+	import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
+	import tuiNomore from '@/components/tui-components/nomore/nomore'
 	import uniCalendar from '@/components/uni-calendar/uni-calendar.vue'
-	var date = new Date();
+	var date = new Date()
 	export default{
 		components: {
 			uniCalendar,
@@ -138,14 +138,15 @@
 						9:'抵用退回',
 						10:'抵用运费',
 						11:'退款回收',
-						12:'登录奖励'
-					};
+						12:'登录奖励',
+                        13:'查看商品资料'
+					}
 				Object.keys(stateTextObject).forEach(function(key){
 					if(key == state){
 						stateText = stateTextObject[key]
 					}
-				});
-				return stateText;
+				})
+				return stateText
 },
 		},
 		methods: {
@@ -160,10 +161,10 @@
 					let data = response.data
 					let list = data.pageInfo.list
 					this.userBeans = data.userBeans
-					this.hasNextPage =  data.pageInfo.hasNextPage;
+					this.hasNextPage =  data.pageInfo.hasNextPage
 					if(list && list.length > 0){
-						this.isEmpty = false;
-						this.beansList = [...list];
+						this.isEmpty = false
+						this.beansList = [...list]
 					}else{
 						this.isEmpty = true
 					}
@@ -188,10 +189,10 @@
 					let data = response.data
 					let list = data.pageInfo.list
 					this.userBeans = data.userBeans
-					this.hasNextPage =  data.pageInfo.hasNextPage;
+					this.hasNextPage =  data.pageInfo.hasNextPage
 					this.beansList = this.beansList.concat(list)
-					this.pullFlag = false;// 防上拉暴滑
-					setTimeout(()=>{this.pullFlag = true;},500)
+					this.pullFlag = false// 防上拉暴滑
+					setTimeout(()=>{this.pullFlag = true},500)
 					if(this.hasNextPage){
 						this.pullUpOn = false
 						this.nomoreText = '上拉显示更多'
@@ -205,17 +206,17 @@
 				})
 			},
 			tabClick(index){//tab点击
-				this.tabCurrentIndex = index;
-				this.listQuery.type = index;
+				this.tabCurrentIndex = index
+				this.listQuery.type = index
 				this.listQuery.pageNum = 1
 				this.beansList = []
 				this.pullUpOn = true //隐藏
-				this.GetAccountInitData();
+				this.GetAccountInitData()
 			},			
 			monthSwitch(e) {
-				this.listQuery.year = e.year;
-				this.listQuery.month = e.month;
-				this.GetAccountInitData();
+				this.listQuery.year = e.year
+				this.listQuery.month = e.month
+				this.GetAccountInitData()
 			},
 			cheakType(type){
 				let typeTextHtml,
@@ -229,18 +230,18 @@
 						7:'余额订单充值',
 						8:'订金订单退款',
 						9:'余额订单退款'
-					};
+					}
 				Object.keys(typeObject).forEach(function(key){
 					if(key == type){
 						typeTextHtml = typeObject[key]
 					}
-				});	
-				return typeTextHtml;
+				})	
+				return typeTextHtml
 			},
 			hanldNavigateBack(){
 				uni.navigateBack({
 					delta: 1
-				});
+				})
 			},
 		},
 		onReachBottom() {
@@ -251,7 +252,7 @@
 			}	
 		},
 		onPullDownRefresh() {//下拉刷新
-			this.listQuery.pageNum = 1;
+			this.listQuery.pageNum = 1
 			this.GetAccountInitData()
 			uni.stopPullDownRefresh()
 		},

+ 64 - 64
services/ajax.service.js

@@ -6,69 +6,69 @@ import corServiceUrl from './config.env'
 import { msg } from '@/utils/util'
 
 class AjaxService {
-	constructor() {
-		this.name = 'AjaxService'
-	}
-	getBaseUrl (url = '') {
-		return url.indexOf('://') > -1 ? url : url
-	}
-	getHeaders({ header = {} }) {
-		const REV_TOKEN_ENV = uni.getStorageSync('token') ? uni.getStorageSync('token') : 'X-token';
-		const REV_COOKIE_ENV = uni.getStorageSync('sessionid') ? uni.getStorageSync('sessionid') : 'sessionid';
-		header['Accept'] = 'application/json'
-		header['Content-Type'] = 'application/x-www-form-urlencoded'
-		header['X-Token'] = REV_TOKEN_ENV
-		header['cookie'] = REV_COOKIE_ENV
-		return header
-	}
-	request(options = {}) {
-		let header = this.getHeaders(options)
-		let url = this.getBaseUrl(options.url)
-		if (options.header) {
-			header = Object.assign(header, options.header)
-		}
-		if(options.isHost){
-			url = corServiceUrl + url
-		}else{
-			url = spiServiceUrl + url
-		}
-		let { isLoading = true } = options
-		if (isLoading) {
-			wx.showLoading({ title: '加载中' })
-		}
-		const requestPromise = new Promise((resolve, reject) => {
-			uni.request({
-				url: url,
-				method: options.method || 'POST',
-				data: options.data || {},
-				header,
-				success: res => {
-					if (isLoading) wx.hideLoading();
-					if(options.isStatus){
-						resolve(res.data)
-					}else{
-						if (res.data.code === 0) {
-							resolve(res.data)
-						} else {
-							reject(res.data)
-						}
-					}
-				},
-				fail: error => {
-					reject(error)
-					wx.hideLoading()
-				}
-			})
-		})
-		return requestPromise
-	}
-	get(options) {
-		options.method = 'GET'
-		return this.request(options)
-	}
-	post(options) {
-		options.method = 'POST'
-		return this.request(options)
-	}
+    constructor() {
+        this.name = 'AjaxService'
+    }
+    getBaseUrl (url = '') {
+        return url.indexOf('://') > -1 ? url : url
+    }
+    getHeaders({ header = {} }) {
+        const REV_TOKEN_ENV = uni.getStorageSync('token') ? uni.getStorageSync('token') : 'X-token'
+        const REV_COOKIE_ENV = uni.getStorageSync('sessionid') ? uni.getStorageSync('sessionid') : 'sessionid'
+        header['Accept'] = 'application/json'
+        header['Content-Type'] = 'application/x-www-form-urlencoded'
+        header['X-Token'] = REV_TOKEN_ENV
+        header['cookie'] = REV_COOKIE_ENV
+        return header
+    }
+    request(options = {}) {
+        let header = this.getHeaders(options)
+        let url = this.getBaseUrl(options.url)
+        if (options.header) {
+            header = Object.assign(header, options.header)
+        }
+        if(options.isHost){
+            url = corServiceUrl + url
+        }else{
+            url = spiServiceUrl + url
+        }
+        let { isLoading = true } = options
+        if (isLoading) {
+            uni.showLoading({ title: '加载中' })
+        }
+        const requestPromise = new Promise((resolve, reject) => {
+            uni.request({
+                url: url,
+                method: options.method || 'POST',
+                data: options.data || {},
+                header,
+                success: res => {
+                    if (isLoading) uni.hideLoading()
+                    if(options.isStatus){
+                        resolve(res.data)
+                    }else{
+                        if (res.data.code === 0) {
+                            resolve(res.data)
+                        } else {
+                            reject(res.data)
+                        }
+                    }
+                },
+                fail: error => {
+                    reject(error)
+                    if (isLoading) uni.hideLoading()
+                }
+            })
+        })
+        return requestPromise
+    }
+    get(options) {
+        options.method = 'GET'
+        return this.request(options)
+    }
+    post(options) {
+        options.method = 'POST'
+        return this.request(options)
+    }
 }
 export default new AjaxService()

+ 39 - 0
services/beautyArchive.service.js

@@ -0,0 +1,39 @@
+/**
+ * 这是商品资料库相关的业务逻辑的服务
+ */
+export default class BeautyArchiveService {
+    constructor(AjaxService) {
+        Object.assign(this, { AjaxService })
+        this.name = 'BeautyArchiveService'
+    }
+
+    /* 获取资料库商品列表 */
+    GetArchiveProduct(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/product/archive',
+            data,
+            isLoading: true,
+            isHost: true
+        })
+    }
+
+    /* 获取商品资料列表 */
+    GetProdcutArchiveDetails(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/product/archive/detail',
+            data,
+            isLoading: true,
+            isHost: true
+        })
+    }
+
+    /* 采美豆抵扣 */
+    SearchArchiveByBeans(data = {}) {
+        return this.AjaxService.post({
+            url: '/user/club/archive/deduction',
+            data,
+            isLoading: true,
+            isHost:true
+        })
+    }
+}

+ 4 - 1
services/index.js

@@ -15,6 +15,7 @@ import SecondService from './second.service'
 import PublicService from './public.service.js'
 import OtherService from './other.service.js'
 import UploadService from './upload.service.js'
+import BeautyArchive from './beautyArchive.service.js'
 
 let commonService = new CommonService(ajaxService)
 let locateService = new LocateService(ajaxService)
@@ -30,6 +31,7 @@ let secondService = new SecondService(ajaxService)
 let publicService = new PublicService(ajaxService)
 let otherService = new OtherService(ajaxService)
 let uploadService = new UploadService(ajaxService)
+let beautyArchive = new BeautyArchive(ajaxService)
 
 Vue.prototype.AjaxService = ajaxService
 Vue.prototype.CommonService = commonService
@@ -45,4 +47,5 @@ Vue.prototype.OrderService = orderService
 Vue.prototype.SecondService = secondService
 Vue.prototype.PublicService = publicService
 Vue.prototype.OtherService = otherService
-Vue.prototype.UploadService = uploadService
+Vue.prototype.UploadService = uploadService
+Vue.prototype.BeautyArchive = beautyArchive

+ 62 - 40
utils/util.js

@@ -1,44 +1,66 @@
 /* 常用工具函数 */
-export const msg = (title, duration=1500, mask=true, icon='none')=>{
-	//统一提示方便全局修改
-	if(Boolean(title) === false){return;}
-	uni.showToast({
-		title,
-		duration,
-		mask,
-		icon
-	});
+export const msg = (title, duration = 1500, mask = true, icon = 'none') => {
+    //统一提示方便全局修改
+    if (Boolean(title) === false) { return }
+    uni.showToast({
+        title,
+        duration,
+        mask,
+        icon
+    })
 }
-export const modal = (title,content,confirmText,cancelText,showCancel=false,callBack) =>{
-	uni.showModal({
-		title,
-		content,
-		confirmText,
-		cancelText,
-		confirmColor:'#E15616',
-		showCancel,
-		success: function (res) {
-			if (res.confirm) {
-				callBack()
-			}
-		}
-	});
-}	
-export const json = type=>{
-	//模拟异步请求数据
-	return new Promise(resolve=>{
-		setTimeout(()=>{
-			// console.log(resolve+'======='+type);
-			resolve(Json[type]);
-		}, 500)
-	})
+export const modal = (title, content, confirmText, cancelText, showCancel = false, callBack) => {
+    uni.showModal({
+        title,
+        content,
+        confirmText,
+        cancelText,
+        confirmColor: '#E15616',
+        showCancel,
+        success: function(res) {
+            if (res.confirm) {
+                callBack()
+            }
+        }
+    })
+}
+export const json = type => {
+    //模拟异步请求数据
+    return new Promise(resolve => {
+        setTimeout(() => {
+            // console.log(resolve+'======='+type);
+            resolve(Json[type])
+        }, 500)
+    })
+}
+
+export const prePage = () => {
+    let pages = getCurrentPages()
+    let prePage = pages[pages.length - 2]
+    // #ifdef H5
+    return prePage
+    // #endif
+    return prePage.$vm
 }
 
-export const prePage = ()=>{
-	let pages = getCurrentPages();
-	let prePage = pages[pages.length - 2];
-	// #ifdef H5
-	return prePage;
-	// #endif
-	return prePage.$vm;
-}
+// 获取节点元素信息
+export const boundingClientRect = (component, selector, flag = false) => {
+    return new Promise((resolve, reject) => {
+        const query = uni.createSelectorQuery().in(component)
+        if (!flag) {
+            query
+                .select(selector)
+                .boundingClientRect(data => {
+                    resolve(data)
+                })
+                .exec()
+        } else {
+            query
+                .selectAll(selector)
+                .boundingClientRect(data => {
+                    resolve(data)
+                })
+                .exec()
+        }
+    })
+}