소스 검색

commit -m 9月大版本

zhengjinyi 3 년 전
부모
커밋
a59c51fe03
8개의 변경된 파일1043개의 추가작업 그리고 105개의 파일을 삭제
  1. 196 0
      components/uni-keyinput/uni-keyinput.vue
  2. 7 0
      pages.json
  3. 10 10
      pages/goods/product.vue
  4. 2 5
      pages/login/login.vue
  5. 42 22
      pages/login/logincode.vue
  6. 90 67
      pages/tabBar/user/user.vue
  7. 695 0
      pages/user/collection/collection.vue
  8. 1 1
      services/ajax.service.js

+ 196 - 0
components/uni-keyinput/uni-keyinput.vue

@@ -0,0 +1,196 @@
+<template>
+	<view class="vcode-input-body">
+		<text
+			class="vcode-input-item"
+			:class="{
+				'vcode-input-line': isBorderLine,
+				'vcode-input-border': !isBorderLine,
+				'on': textLength === index && focus
+			}"
+			v-for="(v, index) in sum"
+			:key="index"
+			@tap.stop="setFocus"
+			:style="{
+				borderColor:
+					text.length === index && focus
+						? borderActiveColor
+						: text.length > index
+						? borderValueColor
+						: borderColor,
+				color: text.length > index ? borderValueColor : borderColor
+			}"
+		>
+			{{ text[index] ? text[index] : '' }}
+		</text>
+		<view class="hidden-input">
+			<input
+				id="vcodeInput"
+				ref="vcodeInput"
+				type="number"
+				:show-confirm-bar="false"
+				auto-blur
+				:focus="focus"
+				:maxlength="sum"
+				v-model="value"
+				@blur="setBlur"
+				:password="isPassword"
+				placeholder="验证码"
+			/>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'VcodeInput',
+	props: {
+		sum: {
+			type: Number,
+			default: 6
+		},
+		isBorderLine: {
+			type: Boolean,
+			default: false
+		},
+		borderColor: {
+			type: String,
+			default: '#e8e8e8'
+		},
+		borderValueColor: {
+			type: String,
+			default: '#424456'
+		},
+		borderActiveColor: {
+			type: String,
+			default: '#FF6B00'
+		},
+		isAutoComplete: {
+			type: Boolean,
+			default: true
+		},
+		isPassword: {
+			type: Boolean,
+			default: false
+		}
+	},
+	data() {
+		return {
+			focus: false,
+			text: [],
+			value: ''
+		}
+	},
+	watch: {
+		value(value, oldVal) {
+			this.$emit('vcodeChange', value)
+			if (this.isAutoComplete) {
+				if (value.length >= this.sum) {
+					this.focus = false
+					this.$emit('vcodeInput', value)
+				}
+			} else {
+				this.$emit('vcodeInput', value)
+			}
+			if (this.isPassword) {
+				let val = ''
+				for (let i = 0; i < value.length; i++) {
+					val += '●'
+				}
+				this.text = val
+			} else {
+				this.text = value.split('')
+			}
+		}
+	},
+	computed:{
+		textLength(){
+			return this.text.length
+		}
+	},
+	mounted() {
+		this.$nextTick(() => {
+			this.initInput()
+		})
+	},
+	methods: {
+		initInput() {
+			this.focus = true
+			// #ifdef H5
+			this.$refs.vcodeInput.$refs.input.setAttribute('type', 'number')
+			this.$refs.vcodeInput.$refs.input.setAttribute('pattern', '[0-9]*')
+			// #endif
+		},
+		setBlur() {
+			this.$nextTick(() => {
+				this.focus = false
+			})
+		},
+		setFocus() {
+			this.focus = !this.focus
+		},
+		clearValue() {
+			this.value = ''
+		}
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+@keyframes cursorflash {
+	0%{
+		opacity: .2;
+	}
+	50%{
+		opacity: .8;
+	}
+	100%{
+		opacity:.2;
+	}
+}
+.vcode-input-body {
+	margin-left: -36rpx;
+	margin-right: -36rpx;
+	position: relative;
+	overflow: hidden;
+	/* #ifndef APP-NVUE */
+	display: flex;
+	/* #endif */
+	flex-direction: row;
+	justify-content: center;
+	align-items: center;
+}
+.vcode-input-item {
+	width: 76rpx;
+	height: 76rpx;
+	margin-left: 12rpx;
+	margin-right: 12rpx;
+	line-height: 76rpx;
+	text-align: center;
+	font-weight: 500;
+	color: #E15616 !important;
+	border-radius: 8rpx;
+}
+.vcode-input-item.on::after {
+	content: '|';
+	animation: cursorflash 2s infinite ease-in-out;
+}
+.vcode-input-border {
+	border-style: solid;
+	border-width: 2rpx; 
+	border-color: $uni-border-color;
+	border-radius: 8rpx;
+}
+.vcode-input-line {
+	border-bottom-style: solid;
+	border-bottom-width: 2rpx;
+	border-color: $uni-border-color;
+}
+.hidden-input {
+	width: 0px;
+	height: 0px;
+	position: absolute;
+	left: -1px;
+	top: -1px;
+	overflow: hidden;
+}
+</style>

+ 7 - 0
pages.json

@@ -387,6 +387,13 @@
 						"navigationBarTitleText": "活动商品",
 						"enablePullDownRefresh" : true
 					}
+				},
+				{
+					"path": "collection/collection",
+					"style": {
+						"navigationBarTitleText": "收藏商品",
+						"enablePullDownRefresh" : true
+					}
 				}
 			]	
 		},

+ 10 - 10
pages/goods/product.vue

@@ -311,10 +311,10 @@
 								<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="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>
@@ -409,6 +409,7 @@
 		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',
@@ -697,10 +698,6 @@
 				  }).exec()
 				}).exec()
 			},
-			handleContact(e){//跳转小程序客服
-				console.log(e.detail.path)
-				console.log(e.detail.query)
-			},
 			buyProductCart(){//底部购物车按钮点击
 				if(this.hasLogin){
 					// 友盟埋点商品详情购物车入口点击事件
@@ -883,7 +880,10 @@
 				  imageUrl:`${this.productImage[0]}`
 				}
 			},
-			showPopup(index){
+			handleCollection(){// 收藏
+				this.collectionType = !this.collectionType
+			},
+			showPopup(index){// 弹窗显示
 				switch(index){
 					case 0:
 						this.popupShow0 = true
@@ -901,7 +901,7 @@
 						break;
 				}
 			},
-			hidePopup(index){
+			hidePopup(index){// 弹窗隐藏
 				switch(index){
 					case 0:
 						this.popupShow0 = false

+ 2 - 5
pages/login/login.vue

@@ -23,8 +23,7 @@
 			</view>
 		</view>
 		<view class="login-btn"  @click="confirmLogin">登录</view>
-		<view class="login-btn-last" @click.stop="this.$api.navigateTo(`/pages/login/logincode?data=${getOption}`)">邀请码登录</view>
-		<view class="login-tel">客服热线:0755-22907771</view>
+		<view class="login-btn-last" @click.stop="this.$api.navigateTo(`/pages/login/logincode?data=${getOption}`)">邀请码登录></view>
 	</view>
 </template>
 
@@ -198,14 +197,12 @@
 		.login-btn-last{
 			width: 600rpx;
 			height: 86rpx;
-			border-radius: 44rpx;
 			font-size: $font-size-28;
 			line-height: 88rpx;
 			color: $color-system;
 			margin: 0 auto;
 			text-align: center;
-			border: 1px solid $color-system;
-			margin-top: 20rpx;
+			margin-top: 100rpx;
 		}
 		.login-tel{
 			width: 702rpx;

+ 42 - 22
pages/login/logincode.vue

@@ -5,16 +5,17 @@
 			<image class="logo" src="https://static.caimei365.com/app/img/icon/logo@2x.png" mode=""></image>
 		</view>
 		<view class="login-input">
-			<input type="number" 
-				   v-model="params.invitationCode"  
-				   maxlength="6" 
-				   class="input" 
-				   placeholder="请输入邀请码"
-			/>
+			<keyInput
+				borderValueColor="#E1E1E1"
+				borderActiveColor="#E1E1E1"
+				ref="vcodeInputRef"
+				@vcodeInput="keyInput"
+				@vcodeChange="keyInputChangeHandle"
+				sum="6"
+			>
+			</keyInput>
 		</view>
-		<view class="login-row" @click.stop="navigatorRegirst('/pages/login/register-select')"><text>免费注册</text></view>
-		<view class="login-btn"  @click.stop="goLogin">邀请码登录</view>
-		<view class="login-btn-last" @click.stop="this.$api.navigateTo('/pages/login/login')">账号登录</view>
+		<button class="login-btn"  @click.stop="goLogin" :class="isDisabled ? 'disabled' : ''" :disabled="isDisabled">邀请码登录</button>
 		<view class="login-tips">
 			邀请码是采美平台为了方便机构内成员互相邀请并快速注册采美账号推出的一项邀请机制。机构成员在任一渠道(包括采美365网站和微信“采美采购商城”小程序)注册了采美账号,该成员可在其个人中心添加其他机构成员,系统自动为每一个成员生成邀请码。其他成员使用邀请码可直接登录“采美采购商城”小程序。
 		</view>
@@ -25,7 +26,12 @@
 	import authorize from '@/common/config/authorize.js'
 	import wxLogin from "@/common/config/wxLogin.js"
 	import {mapState,mapMutations } from 'vuex';
+	import keyInput from '@/components/uni-keyinput/uni-keyinput'
+	
 	export default{
+		components: { 
+			keyInput 
+		},
 		data() {
 			return{
 				params:{
@@ -40,7 +46,10 @@
 
 		},
 		computed: {
-			...mapState(['isWxAuthorize','isLoginType','isLoginProductId','isLoginOrderId'])
+			...mapState(['isWxAuthorize','isLoginType','isLoginProductId','isLoginOrderId']),
+			isDisabled() {// 邀请码长度是否符合要求
+				return this.params.invitationCode.trim().length < 6
+			},
 		},
 		methods:{
 			...mapMutations(['login','wxLogin']),
@@ -110,6 +119,24 @@
 					this.isUserInfo = false
 				})
 			},
+			keyInput(val) {// 输入框输入介绍
+				// this.params.invitationCode = val
+				console.log(val)
+			},
+			keyInputChangeHandle(val) {// 输入框输入事件
+				this.params.invitationCode = val
+				// console.log(val)
+			},
+			setFocus() {// 控制组件获取焦点
+				this.$refs.VcodeInput.setFocus()
+			},
+			
+			setBlur() {// 控制组件失去焦点
+				this.$refs.VcodeInput.setBlur()
+			},
+			clearValue() {// 清除已输入
+				this.$refs.VcodeInput.clearValue()
+			},
 			InitAuthorize(){ //是否已授权 0:为取消授权 1:为已授权 2:为未操作
 				wxLogin.wxLoginQuick()
 			}
@@ -151,20 +178,10 @@
 			width: 600rpx;
 			height: 88rpx;
 			padding: 24rpx 0;
-			margin: 0 auto;
+			margin: 30rpx auto;
 			margin-bottom: 30rpx;
 			background: #FFFFFF;
 			position: relative;
-			box-sizing: border-box;
-			border-bottom: 1px solid #E1E1E1;
-			.input{
-				width: 100%;
-				height: 100%;
-				background: #FFFFFF;
-				font-size: $font-size-28;
-				line-height: 88rpx;
-				color: #333333;
-			}
 		}
 		.login-row{
 			padding: 0 75rpx;
@@ -183,7 +200,10 @@
 			color: #FFFFFF;
 			margin: 0 auto;
 			text-align: center;
-			background: $btn-confirm;
+			background:$btn-confirm;
+			&.disabled{
+				background: #E1E1E1;
+			}
 		}
 		.login-btn-last{
 			width: 600rpx;

+ 90 - 67
pages/tabBar/user/user.vue

@@ -2,12 +2,15 @@
 	<view class="container user clearfix">
 		<cm-custom :navbar-data='nvabarData' v-if="isCmcustom"></cm-custom>
 		<view class="user-section">
-			<view class="header" :style="{height:(CustomBar+90)-StatusBar+'px',paddingTop:CustomBar+'px',background:'url('+ bgImgUrl +')',backgroundSize:'cover'}">
+			<view class="header" 
+				  :style="{height:(CustomBar+90)-StatusBar+'px',paddingTop:CustomBar+'px',background:'url('+ bgImgUrl +')',backgroundSize:'cover'}">
 				<view class="header-main" v-if="hasLogin">
-					<view class="header-icon"><image :src="headpic == null? 'https://static.caimei365.com/app/img/icon/icon-club@3x.png' : headpic" mode=""></image></view>
+					<view class="header-icon">
+						<image :src="headpic ? headpic : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png' " mode=""></image>
+					</view>
 					<view class="header-text">
-						<view class="user-item amount">
-							<text class="u-h1">{{name}}</text>
+						<view class="user-item"><text class="u-h1">{{name}}</text></view>
+						<view class="user-item">
 							<text class="u-viptips" v-if="userIdentity == 2">{{userType}}</text>
 							<text class="u-tips" v-if="userIdentity == 4">{{userType}}</text>
 						</view>
@@ -19,15 +22,12 @@
 					</view>
 					<view class="header-text">
 						<view class="user-item">
-							<text class="u-h1" @click="navigator('/pages/login/login')">账号登录</text><text class="u-h1 line">|</text>
-							<text class="u-h1" @click="navigatorRegirst('/pages/login/register-select')">立即注册</text>
+							<text class="u-h1" @click="navigator('/pages/login/login')">账号登录/注册</text>
 						</view>
 						<view class="user-item">
 							<text class="u-p" @click="navigator('/pages/login/login')">登录商城了解更多产品信息吧!</text>
 						</view>
-						<view class="user-item" @click="navigatorNex('/pages/login/logincode')">
-							<view class="u-btn"><text>邀请码登录</text><text class="iconfont icon-xiangyouhuabeifen"></text></view>
-						</view>
+						<view class="user-code" @click="navigatorNex('/pages/login/logincode')">邀请码登录></view>
 					</view>
 				</view>
 				<!-- 我的资产 -->
@@ -67,7 +67,10 @@
 							<text class="iconfont icon-xiayibu"></text>
 						</view>
 						<view class="order-section">
-							<view class="order-item" @click="navigator('/pages/user/order/order-list?state=1')" hover-class="common-hover"  :hover-stay-time="50">
+							<view class="order-item" 
+								  @click="navigator('/pages/user/order/order-list?state=1')" 
+								  hover-class="common-hover"  
+								  :hover-stay-time="50">
 								<view class="order-icon">
 									<image src="https://static.caimei365.com/app/img/icon/order5@3x.png" mode=""></image>
 									<text 	v-if="confirmedCount>0 && hasLogin" 
@@ -78,7 +81,10 @@
 								</view>
 								<text class="order-t">待确认</text>
 							</view>
-							<view class="order-item" @click="navigator('/pages/user/order/order-list?state=2')"  hover-class="common-hover" :hover-stay-time="50">
+							<view class="order-item" 
+								  @click="navigator('/pages/user/order/order-list?state=2')"  
+								  hover-class="common-hover" 
+								  :hover-stay-time="50">
 								<view class="order-icon">
 									<image src="https://static.caimei365.com/app/img/icon/order1@3x.png" mode=""></image>
 									<text  v-if="paymentCount >0 && hasLogin" 
@@ -89,7 +95,10 @@
 								</view>
 								<text class="order-t">待付款</text>
 							</view>
-							<view class="order-item" @click="navigator('/pages/user/order/order-list?state=3')" hover-class="common-hover"  :hover-stay-time="50">
+							<view class="order-item" 
+								  @click="navigator('/pages/user/order/order-list?state=3')" 
+								  hover-class="common-hover"  
+								  :hover-stay-time="50">
 								<view class="order-icon">
 									<image src="https://static.caimei365.com/app/img/icon/order2@3x.png" mode=""></image>
 									<text   v-if="waitShipmentsCount >0 && hasLogin" 
@@ -100,7 +109,10 @@
 								</view>
 								<text class="order-t">待发货</text>
 							</view>
-							<view class="order-item" @click="navigator('/pages/user/order/order-list?state=4')" hover-class="common-hover"  :hover-stay-time="50">
+							<view class="order-item" 
+								  @click="navigator('/pages/user/order/order-list?state=4')" 
+								  hover-class="common-hover"  
+								  :hover-stay-time="50">
 								<view class="order-icon">
 									<image src="https://static.caimei365.com/app/img/icon/order3@3x.png" mode=""></image>
 									<text 	v-if="shipmentsCount>0 && hasLogin" 
@@ -111,7 +123,10 @@
 								</view>
 								<text class="order-t">已发货</text>
 							</view>
-							<view class="order-item" @click="navigator('/pages/user/order/order-list?state=5')" hover-class="common-hover"  :hover-stay-time="50">
+							<view class="order-item" 
+								  @click="navigator('/pages/user/order/order-list?state=5')" 
+								  hover-class="common-hover"  
+								  :hover-stay-time="50">
 								<view class="order-icon">
 									<image src="https://static.caimei365.com/app/img/icon/order4@3x.png" mode=""></image>
 									<text 	v-if="salesReturnCount >0 && hasLogin"
@@ -127,11 +142,12 @@
 				</view>
 				<!-- 底部跳转 -->
 				<view class="header-main-listcell">
-				<!--<view class="list-cell-avtiv" @click="navigator('/pages/user/coupon/coupon')">
-						<image src="http://static.caimei365.com/app/meibohui/app/activity-in.png" mode=""></image>
-					</view> -->
 					<view class="list-cell-item" v-show="hasLogin">
-						<view class="list-cell" v-show="userIdentity == 4" @click="navigatorClubUpgrade(`/pages/login/apply?clubStatus=${clubStatus}`)" hover-class="cell-hover" :hover-stay-time="50">
+						<view class="list-cell" 
+							  v-show="userIdentity == 4" 
+							  @click="navigatorClubUpgrade(`/pages/login/apply?clubStatus=${clubStatus}`)" 
+							  hover-class="cell-hover" 
+							  :hover-stay-time="50">
 							<view class="cell-icon">
 								<image class="cell-icon-image" src="https://static.caimei365.com/app/img/icon/icon_club_8@2x.png" mode=""></image>
 							</view>
@@ -144,16 +160,34 @@
 								<text class="iconfont icon-xiayibu"></text>
 							</text>
 						</view>
-						<view class="list-cell" @click="navigator('/pages/user/regularPurchase/regularPurchase')" hover-class="cell-hover" :hover-stay-time="50">
+						<view class="list-cell" 
+							  @click="navigator('/pages/user/regularPurchase/regularPurchase')" 
+							  hover-class="cell-hover" 
+							  :hover-stay-time="50">
 							<view class="cell-icon">
 								<image class="cell-icon-image" src="https://static.caimei365.com/app/img/icon/icon_club_9@2x.png" mode=""></image>
 							</view>
 							<text class="cell-tit">再次购买</text>
 							<text class="cell-more iconfont icon-xiayibu"></text>
 						</view>
+						<view class="list-cell" 
+							  @click="navigator('/pages/user/collection/collection')" 
+							  hover-class="cell-hover" 
+							  :hover-stay-time="50">
+							<view class="cell-icon">
+								<image class="cell-icon-image" src="https://static.caimei365.com/app/img/icon/icon_club_13@2x.png" mode=""></image>
+							</view>
+							<text class="cell-tit">收藏商品</text>
+							<text class="cell-more iconfont icon-xiayibu"></text>
+						</view>
 					</view>
 					<view class="list-cell-item">
-						<view class="list-cell"  v-for="(item, index) in firstList" :key="index" @click="navigator(item.path)" hover-class="cell-hover" :hover-stay-time="50">
+						<view class="list-cell"  
+							  v-for="(item, index) in firstList" 
+							  :key="index" 
+							  @click="navigator(item.path)" 
+							  hover-class="cell-hover" 
+							  :hover-stay-time="50">
 							<view class="cell-icon">
 								<image class="cell-icon-image" :src="item.icon" mode=""></image>
 							</view>
@@ -172,14 +206,20 @@
 							<text class="cell-tit cont">联系我们</text>
 							<text class="cell-more cont" @click="toPhone">{{contactNumber}}</text>
 						</view>
-						<view class="list-cell" @click="this.$api.navigateTo('/pages/user/about/about')" hover-class="cell-hover" :hover-stay-time="50">
+						<view class="list-cell" 
+							  @click="this.$api.navigateTo('/pages/user/about/about')" 
+							  hover-class="cell-hover" 
+							  :hover-stay-time="50">
 							<view class="cell-icon">
 								<image class="cell-icon-image" src="https://static.caimei365.com/app/img/icon/icon_club_6@2x.png" mode=""></image>
 							</view>
 							<text class="cell-tit">关于我们</text>
 							<text class="cell-more iconfont icon-xiayibu"></text>
 						</view>
-						<view class="list-cell last" @click="this.$api.navigateTo('/pages/h5/article/page?linkType=99')" hover-class="cell-hover" :hover-stay-time="50">
+						<view class="list-cell last" 
+							  @click="this.$api.navigateTo('/pages/h5/article/page?linkType=99')" 
+							  hover-class="cell-hover" 
+							  :hover-stay-time="50">
 							<view class="cell-icon">
 								<image class="cell-icon-image" src="https://static.caimei365.com/app/img/icon/icon_club_7@2x.png" mode=""></image>
 							</view>
@@ -209,16 +249,16 @@
 		},
 		data() {
 			return{	
-				nvabarData: {			// 顶部自定义导航
-					showCapsule: 1, 	// 是否显示左上角图标  1表示显示  0表示不显示,
+				nvabarData: {				// 顶部自定义导航
+					showCapsule: 1, 		// 是否显示左上角图标  1表示显示  0表示不显示,
 					showSearch: 0,
-					title: '我的', 		// 导航栏中间的标题
+					title: '个人中心', 		// 导航栏中间的标题
 					haveBack:false,
 					textLeft:this.$store.state.isIphone,
-					textColor:'#FFFFFF',
+					textColor:'#333333',
 					bgColor:''
 				},
-				CustomBar:this.CustomBar,// 顶部导航栏高度
+				CustomBar:this.CustomBar,	// 顶部导航栏高度
 				StatusBar: this.StatusBar,
 				userId:0,
 				beanNumber:50,
@@ -408,8 +448,8 @@
 		onPageScroll(e){//实时获取到滚动的值
 			if(e.scrollTop>20){
 				this.isCmcustom = true
-				this.nvabarData.bgColor = '#E37A4B'
-				this.nvabarData.textColor = '#FFFFFF'
+				this.nvabarData.bgColor = '#FFFFFF'
+				this.nvabarData.textColor = '#333333'
 			}else{
 				this.isCmcustom = false
 				this.nvabarData.bgColor = ''
@@ -467,15 +507,11 @@
 			display: flex;
 			flex-direction: column;
 			box-sizing: border-box;
-			padding-left: 20rpx;
+			padding: 10rpx 0 0 20rpx;
 			.user-item{
 				flex: 1;
 				height: 64rpx;
 				line-height: 64rpx;
-				&.amount{
-					height: 135rpx;
-					line-height: 135rpx;
-				}
 				.u-tips{
 					display: inline-block;
 					float: left;
@@ -488,8 +524,6 @@
 					font-size: $font-size-20;
 					text-align: center;
 					color: #FFFFFF;
-					margin-left: 10rpx;
-					margin-top: 50rpx;
 				}
 				.u-viptips{
 					display: inline-block;
@@ -503,13 +537,11 @@
 					font-size: $font-size-20;
 					text-align: center;
 					color: #FFE600;
-					margin-left: 10rpx;
-					margin-top: 50rpx;
 				}
 				.u-h1{
-					width: 300rpx;
+					width: 400rpx;
 					float: left;
-					font-size: $font-size-34;
+					font-size: $font-size-30;
 					color: #FFFFFF;
 					text-align: left;
 					-o-text-overflow: ellipsis;
@@ -548,6 +580,23 @@
 			flex: 8;
 			display: flex;
 			flex-direction: column;
+			position: relative;
+			box-sizing: border-box;
+			padding: 20rpx 0;
+			.user-code{
+				width: 193rpx;
+				height: 56rpx;
+				background: rgba(255,255,255,.2);
+				color: #FFFFFF;
+				line-height: 56rpx;
+				font-size: $font-size-26;
+				padding: 0 20rpx 0 23rpx;
+				box-sizing: border-box;
+				border-radius: 28rpx 0 0 28rpx;
+				position: absolute;
+				right: -24rpx;
+				top: 46rpx;
+			}
 			.user-item{
 				flex: 1;
 				height: 50rpx;
@@ -557,7 +606,7 @@
 				}
 				.u-h1{
 					float: left;
-					font-size: $font-size-34;
+					font-size: $font-size-28;
 					color: #FFFFFF;
 					text-align: left;
 					-o-text-overflow: ellipsis;
@@ -574,22 +623,6 @@
 					color: #EFEFEF;
 					text-align: left;
 				}
-				.u-btn{
-					width: 160rpx;
-					height: 40rpx;
-					background: rgba(255,255,255,.8);
-					border-radius: 8rpx;
-					line-height: 40rpx;
-					text-align: center;
-					font-size: $font-size-24;
-					color: $color-system;
-					display: block;
-					margin-top: 5rpx;
-					padding-left: 6rpx;
-					.icon-xiangyouhuabeifen{
-						font-size: $font-size-24;
-					}
-				}
 			}
 		}
 		.header-icon{
@@ -785,16 +818,6 @@
 		padding: 0 24rpx;
 		margin-bottom: 60rpx;
 	}	
-	.list-cell-avtiv{
-		width: 702rpx;
-		height: 240rpx;
-		margin-bottom: 24rpx;
-		image{
-			width: 100%;
-			height: 100%;
-			display: block;
-		}
-	}
 	.list-cell-item{
 		width: 654rpx;
 		height: auto;

+ 695 - 0
pages/user/collection/collection.vue

@@ -0,0 +1,695 @@
+<template>
+	<view class="container product clearfix">
+		<view class="superv-header" v-if="!isEmpty">
+			<view class="superv-header-click">
+				<view class="oltext">共<text class="red">3</text>件商品</view>
+				<view class="ortext" @click="supervClickFn" v-if="!isSuperv">编辑</view>
+				<view class="ortext" @click="closeSupervFn" v-else>完成</view>
+			</view>
+		</view>
+		<view class="product-content">
+			<view  :class="{'tui-order-list':scrollTop >= 0}" class="clearfix">
+				<!-- 空白页 -->
+				<view class="empty-container" v-if="isEmpty">
+					<image class="empty-container-image" :src="StaticUrl+'/icon/icon-collection-empty@2x.png'"></image>
+					<text class="error-text">暂无收藏商品~</text>
+				</view>
+				<!-- 列表 -->
+				<view class="tui-cart-cell  tui-mtop" v-for="(item,index) in dataList" :key="index">
+					<view class="tui-goods-item">
+						<view class="tui-goods-checkBox" v-if="isSuperv">
+							<view class="checkbox iconfont" 
+								  :class="[item.isChecked ?'icon-yixuanze':'icon-weixuanze']" 
+								  @click="checkedSoperv(item)">
+							</view>
+						</view>
+						<view class="tui-goods-image">
+							<image :src="item.image" class="tui-goods-img"/>
+						</view>
+						<view class="tui-goods-info" :style="{width:isSuperv ? '360rpx' : '420rpx'}"> 
+							<view class="tui-goods-title">{{ item.name }}</view>
+							<view class="tui-price-box">
+								<view class="tui-goods-price">¥{{item.price | NumFormat}}</view>
+							</view>
+							<view class="tui-goods-pip">市场价:¥{{item.normalPrice | NumFormat}}</view>
+							<view class="tui-goods-pip">分类:{{ item.typeName ? item.typeName : '无' }}</view>
+						</view>
+						<view class="tui-goods-status">
+							<view class="status-text" :style="{ color: verifyColorFilter(item.validFlag)}">
+								{{ item.validFlag | verifyStatusFilter }}
+							</view>
+						</view>
+					</view>
+				</view>
+				<!--加载loadding-->
+				<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+				<tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
+				<!--加载loadding-->
+			</view>
+		</view>
+		<!-- 批量操作 -->
+		<tui-bottom-popup :radius="false" :mask="false" :show="isSuperv">
+			<view class="tui-popup-box clearfix">
+				<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
+					<view class="tui-flex-1">
+						<view class="superv-header-checked">
+							<view class="oltext" @click="isCheckedAll">
+								<view class="checkbox iconfont" :class="[isAllChecked ? 'icon-yixuanze':'icon-weixuanze']"></view>
+								<view class="text">全选</view>
+							</view>
+						</view>
+						<view class="tui-button" :class="isProductChecked ? 'active' : ''" @click="handleAllUnder()">取消收藏</view>
+					</view>
+				</view>
+			</view>	
+		</tui-bottom-popup>	
+		<!-- 弹窗提示 -->
+		<tui-modal  :show="modal"
+					@click="handleClick" 
+					@cancel="hideMobel" 
+					:content="contentModalText" 
+					color="#333" 
+					:size="32" 
+					shape="circle" 
+					:maskClosable="false">
+		</tui-modal>
+		<!-- 可拖动悬浮按钮 -->
+		<cm-drag :cartNum="cartQuantity" 
+				 :isDock="true"
+				 :existTabBar="true" 
+				 @btnClick="btnClick" 
+				 @btnTouchstart="btnTouchstart" 
+				 @btnTouchend="btnTouchend">
+		</cm-drag>		
+	</view>
+</template>
+<script>
+	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
+	import tuiNomore from "@/components/tui-components/nomore/nomore"
+	import cmDrag from '@/components/cm-custom/cm-drag.vue'
+	
+	import { mapState,mapMutations } from 'vuex'
+	const defaultListQuery = {
+			userId:0,
+			pageNum:1,
+			pageSize:10
+	 };
+	export default{
+		components: {
+			tuiLoadmore,
+			tuiNomore,
+			cmDrag
+		},
+		data() {
+			return{	
+				StaticUrl:this.$Static,
+				cartQuantity:0,
+				isSuperv:false,
+				isProductChecked:false,
+				listQuery:Object.assign({}, defaultListQuery),
+				dataList: [],
+				scrollTop: 0,
+				isEmpty: true,
+				isAllChecked:false,
+				loadding: false,
+				pullUpOn: true,
+				pullFlag: true,
+				hasNextPage: false,
+				navbarHeight:'',
+				nomoreText: '上拉显示更多',
+				contentModalText:'',//操作文字提示语句
+				modal:false,
+			}
+		},
+		onLoad(option){
+			this.initGetStotage()
+			// this.GetProductListInfo()
+		},
+		filters: {
+			NumFormat:function(text) {//处理金额
+				return Number(text).toFixed(2);
+			}
+		},
+		computed: {
+			...mapState(['hasLogin','userInfo'])
+		},
+		methods:{
+			...mapMutations(['login','logout']),
+			async initGetStotage(){
+				const userInfo = await this.$api.getStorage()
+				this.listQuery.userId =  userInfo.userId ?  userInfo.userId : 0
+			},
+			GetProductListInfo(){
+				this.coupinList = []
+				this.listQuery.pageNum = 1
+				this.ProductService.QueryCouponCenter(this.listQuery).then(response =>{
+					let data = response.data
+					if(data.list&&data.list.length > 0){
+						this.isEmpty = false
+						this.hasNextPage = data.hasNextPage
+						this.coupinList = data.list
+						this.pullFlag = false;
+						setTimeout(()=>{this.pullFlag = true;},500)
+						if(this.hasNextPage){
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						}else{
+							if(this.coupinList.length < 8){
+								this.pullUpOn = true
+							}else{
+								this.pullUpOn = false
+								this.loadding = false
+								this.nomoreText = '已至底部'
+							}
+						}
+					}else{
+						this.isEmpty = true
+					}
+					this.isRequest = true;
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			}, 
+			GetOnReachBottomData(index){//上拉加载
+				this.listQuery.pageNum+=1
+				this.ProductService.QueryCouponCenter(this.listQuery).then(response =>{
+					let data = response.data
+					if(data.list&&data.list.length > 0){
+						this.hasNextPage = data.hasNextPage
+						this.coupinList = this.coupinList.concat(data.list) 
+						this.pullFlag = false;// 防上拉暴滑
+						setTimeout(()=>{this.pullFlag = true;},500)
+						if(this.hasNextPage){
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						}else{
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				})
+				.catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},	
+			handlerButton(e,item){//监听侧滑按钮点击事件
+				if(item.validFlag === 0 || item.validFlag === 3 || item.validFlag === 8 || item.validFlag === 9){
+					if(e.index == 0){
+						return
+					}
+				}else if(item.validFlag === 1 || item.validFlag === 10){
+					if(e.index == 0){
+						this.$api.navigateTo(`/pages/goods/product?id=${item.productId}`)
+					}
+				}else if(item.validFlag === 2){
+					switch(e.index){
+						case 0:
+							this.$api.navigateTo(`/pages/goods/product?id=${item.productId}`)
+							break;
+						case 1:
+							if(item.featuredFlag === 1){
+								this.handleDeleteShopRemb(item)
+							}else{
+								this.handleAddShopRemb(item)
+							}
+							break;
+						case 2:
+							this.handleUnder(item)
+					}
+				}
+			},
+			handleAddShopRemb(item){//添加主页推荐
+				let num = 4- this.featuredNum;
+				this.OperationType = 'add'
+				this.handlerProduct = item
+				this.modal = true;
+				this.contentModalText = `总共能添加4个主推商品,您还能添加${num}个确定将该商品添加为主推商品吗?`;
+			},
+			handleDeleteShopRemb(item){//删除主页推荐
+				this.OperationType = 'delete'
+				this.handlerProduct = item
+				this.modal = true;
+				this.contentModalText = '是否把该商品从主推商品中删除?';
+			},
+			handleUnder(item){//下架操作
+				this.OperationType = 'under'
+				this.handlerProduct = item
+				this.modal = true;
+				this.contentModalText = '确定下架该商品吗?';
+			},
+			handleAllUnder(){//批量下架操作
+				let checkedArray = [];
+				let isValidFlag = false;
+				this.productIds = '';
+				if(this.isProductChecked){
+					this.dataList.forEach(el => {
+						if(el.isChecked) { 
+							checkedArray.push(el)						
+						}
+					})
+					checkedArray.forEach(el =>{
+						if(el.validFlag == 2){
+							this.productIds += el.productId+','
+						}
+						if(el.validFlag != 2){
+							isValidFlag = true; 
+						}	
+					})
+					if(isValidFlag){
+						this.$util.modal('','部分选中的商品暂未上架,不能进行下架操作','确定','',false,() =>{})
+						return;
+					}
+					this.OperationType = 'allunder'
+					this.modal = true;
+					this.contentModalText = '确定下架选中的商品吗?';												
+				}
+			},
+			handleClick(e) {//弹窗提示用户操作
+				if(e.index == 1){
+					switch(this.OperationType){
+						case 'delete'://删除主页推荐
+							this.SupplierDeleteSwitchFeatured(this.handlerProduct)
+							break;
+						case 'add'://添加主页推荐
+							this.SupplierAddSwitchFeatured(this.handlerProduct)
+							break;
+						case 'under'://下架商品
+							this.SupplierSoldOutProduct(this.handlerProduct)
+							break;
+						case 'allunder'://批量下架
+							this.SupplierAllSoldOutProduct(this.productIds)
+							break;
+					}
+				}
+				this.modal = false;
+			},
+			SupplierDeleteSwitchFeatured(item){//操作删除主页推荐
+				this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productId,featuredFlag:0}).then(response =>{
+					this.$util.msg('删除成功',2000,true,'success');
+					setTimeout(() => {
+						this.GetProductListInfo()
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			SupplierAddSwitchFeatured(item){//操作添加主页推荐
+				this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productId,featuredFlag:1}).then(response =>{
+					this.$util.msg('添加成功',2000,true,'success');
+					setTimeout(() => {
+						this.GetProductListInfo()
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			SupplierSoldOutProduct(item){//操作下架商品
+				this.ShopService.SupplierSoldOutProduct({productIds:item.productId}).then(response =>{
+					this.$util.msg('下架成功',2000,true,'success');
+					setTimeout(() => {
+						this.GetProductListInfo()
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			SupplierAllSoldOutProduct(ids){//操作批量下架商品
+				this.ShopService.SupplierSoldOutProduct({productIds:ids}).then(response =>{
+					this.$util.msg('下架成功',2000,true,'success');
+					this.productIds = '';
+					setTimeout(() => {
+						this.GetProductListInfo()
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			hideMobel(){
+				this.modal = false;
+			},
+			updateCheckAllBtn() {//勾选单个判断全选
+				let goodsCheckedLength = 0
+				this.dataList.forEach(item => {
+					if(item.isChecked) { goodsCheckedLength++; }
+				})
+				this.isAllChecked = goodsCheckedLength === this.dataList.length;
+				if(goodsCheckedLength>0){
+					this.isProductChecked = true
+				}else{
+					this.isProductChecked = false
+				}
+			},
+			updateBothCheckBtn() {//全选勾选判断
+				this.dataList.forEach((item)=>{
+					item.isChecked = this.isAllChecked				
+				})
+			},
+			isCheckedAll(){//全选
+				this.isAllChecked = !this.isAllChecked
+				if(this.isAllChecked){
+					this.isProductChecked = true
+				}else{
+					this.isProductChecked = false
+				}
+				this.updateBothCheckBtn()
+			},
+			checkedSoperv(item){//选择
+				item.isChecked = !item.isChecked
+				console.log(item)
+				this.updateCheckAllBtn()
+			},
+			supervClickFn(){//管理全选
+				this.isSuperv = true
+			},
+			closeSupervFn(){
+				this.isSuperv = false
+			},
+			btnClick() {
+				this.$emit('goCartPage')
+			},
+			btnTouchstart() {
+				// console.log('btnTouchstart');
+			},
+			btnTouchend() {
+				// console.log('btnTouchend');
+			}
+		},
+		onPageScroll(e){//实时获取到滚动的值
+			
+		},
+		onReachBottom() {
+			if(this.hasNextPage){
+				this.loadding = true
+				this.pullUpOn = true
+				this.GetOnReachBottomData()
+			}	
+		},
+		onPullDownRefresh() {
+			setTimeout(() => {
+				this.listQuery.pageNum = 1
+				uni.stopPullDownRefresh()
+			}, 200)
+		},
+		onShow(){
+			
+		}	
+	}
+</script>
+
+<style lang="scss">
+	@import "@/uni.scss";
+	page{
+		background:#FFF;
+	}
+	.empty-container{
+		z-index: 9999;
+	}
+	.superv-header{
+		width: 100%;
+		height: 80rpx;
+		background-color: #F7F7F7;
+		line-height: 80rpx;
+		position: fixed;
+		top: 0;
+		left: 0;
+		box-sizing: border-box;
+		padding: 0 24rpx;
+		z-index: 999;
+		.superv-header-click{
+			width: 100%;
+			height: 80rpx;
+			font-size: $font-size-30;
+			.oltext{
+				float: left;
+				color: #666666;
+				.red{
+					color: $color-system;
+				}
+			}
+			.ortext{
+				float: right;
+				color: #333333;
+				text-align: right;
+			}
+		}
+	}
+	.tui-header {
+		width: 100%;
+		font-size: 16px;
+		font-weight: 500;
+		height: 32px;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+		padding: 0 40rpx;
+	}
+	.header-sit{
+		width:100%;
+		box-sizing: border-box;
+		height: 80rpx;
+		line-height: 80rpx;
+		box-sizing: border-box;
+		padding:0 40rpx;
+		text-align: left;
+		font-size: $font-size-40;
+		color: #FFFFFF;
+		font-weight: 600;
+		font-family: '正楷';
+		margin-top: 30rpx;
+		.iconfont{
+			font-size: 42rpx;
+			margin-left: 30rpx;
+		}
+	}
+	.mine{
+		width: 100%;
+		height: 100%;
+		position:relative;
+	}
+	.product-content{
+		width: 100%;
+		height: auto;
+		position: relative;
+		padding:0;
+		padding-top: 80rpx;
+		box-sizing: border-box;
+		.empty-container-image {
+			width: 260rpx;
+			height: 260rpx;
+			margin-top: -300rpx;
+		}
+	}	
+	.tui-goods-item {
+		display: flex;
+		padding: 30rpx 20rpx;
+		box-sizing: border-box;
+		border-bottom: 1px solid #EBEBEB;
+		position: relative;
+	}
+	.tui-goods-checkBox{
+		display: flex;
+		align-items: center;
+		margin: 0 15rpx;
+		.checkbox{
+			display: flex;
+			margin: 0;
+			padding: 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			box-sizing: border-box;
+			text-align: center;
+			text-decoration: none;
+			border-radius: 0;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			background-color:#FFFFFF;
+			font-size: 36rpx;
+			color:$color-system;
+		}
+		.text{
+			font-size: $font-size-24;
+			margin-left: 10rpx;
+		}
+	}
+	.tui-goods-image{
+		width: 180rpx;
+		height: 180rpx !important;
+		border-radius: 12rpx;
+		.tui-goods-img {
+			width: 180rpx;
+			height: 180rpx !important;
+			border-radius: 12rpx;
+			flex-shrink: 0;
+			display: block;
+		}
+	}
+	.tui-goods-info {
+		padding-left: 20rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: flex-start;
+		justify-content: space-between;
+		box-sizing: border-box;
+		overflow: hidden;
+		position: relative;
+	}
+	.tui-goods-status{
+		width: 160rpx;
+		position: absolute;
+		right: 0;
+		.status-text{
+			font-size: $font-size-24;
+			line-height: 44rpx;
+			text-align: center;
+			color: #666666;
+		}
+	}
+	.tui-goods-title {
+		white-space: normal;
+		word-break: break-all;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		display: -webkit-box;
+		-webkit-box-orient: vertical;
+		-webkit-line-clamp: 2;
+		font-size: 26rpx;
+		color: #333;
+		line-height: 44rpx;
+	}
+	.tui-goods-pip{
+		white-space: normal;
+		word-break: break-all;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		display: -webkit-box;
+		-webkit-box-orient: vertical;
+		-webkit-line-clamp: 2;
+		font-size: 24rpx;
+		color: #999;
+		line-height: 44rpx;
+	}
+	.tui-goods-ediet{
+		width: 60rpx;
+		height: 60rpx;
+		background: linear-gradient(90deg,rgba(122,165,250,1) 0%,rgba(87,110,250,1) 100%);
+		border-radius: 50%;
+		line-height: 60rpx;
+		text-align: center;
+		position: absolute;
+		right: 0;
+		top: 50%;
+		.icon-bianji1 {
+			flex-shrink: 0;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			color: #FFFFFF;
+			font-size: 24rpx;
+		}	
+	}
+	.tui-goods-model {
+		max-width: 100%;
+		color: #FFFFFF;
+		background: #4688fa;
+		border-radius: 40rpx;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 0 20rpx;
+		box-sizing: border-box;
+		margin-top: 10rpx;
+	}
+	
+	.tui-model-text {
+		max-width: 100%;
+		transform: scale(0.9);
+		transform-origin: 0 center;
+		font-size: 24rpx;
+		line-height: 40rpx;
+		white-space: nowrap;
+		overflow: hidden;
+		text-overflow: ellipsis;
+	}
+	
+	.tui-price-box {
+		width: 100%;
+		display: flex;
+		align-items: flex-end;
+		justify-content: space-between;
+	}
+	
+	.tui-goods-price {
+		font-size: $font-size-28;
+		font-weight: 500;
+		color: #FF201F;
+	}
+	.tui-popup-box {
+		position: relative;
+		box-sizing: border-box;
+		min-height: 200rpx;
+		padding:6rpx 24rpx;
+	}
+	.tui-popup-btn {
+		width: 100%;
+		height: auto;
+		float: left;
+		box-sizing: border-box;
+		margin-top: 30rpx;
+		.superv-header-checked{
+			float: left;
+			font-size: $font-size-30;
+			.oltext{
+				width: 120rpx;
+				float: left;
+				color: #666666;
+				display: flex;
+				margin-left: 10rpx;
+				.checkbox{
+					display: flex;
+					margin: 0;
+					padding: 0;
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					box-sizing: border-box;
+					text-align: center;
+					text-decoration: none;
+					border-radius: 0;
+					-webkit-tap-highlight-color: transparent;
+					overflow: hidden;
+					font-size: 34rpx;
+					color:$color-system;
+					line-height: 80rpx;
+				}
+				.text{
+					float: left;
+					line-height: 80rpx;
+					margin-left: 15rpx;
+				}
+			}
+			.ortext{
+				width: 120rpx;
+				float: right;
+				color: $color-system;
+				text-align: right;
+			}
+		}
+		.tui-button{
+			width: 210rpx;
+			height: 88rpx;
+			float: right;
+			background: #e1e1e1;
+			line-height: 88rpx;
+			text-align: center;
+			color: #FFFFFF;
+			font-size: $font-size-28;
+			border-radius: 44rpx;
+			&.active{
+				background: $btn-confirm;
+			}
+		}
+	}
+</style>

+ 1 - 1
services/ajax.service.js

@@ -17,7 +17,7 @@ class AjaxService {
 		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['X-Token'] = REV_TOKEN_ENV
 		header['cookie'] = REV_COOKIE_ENV
 		return header
 	}