浏览代码

Merge branch 'dev' of http://113.31.163.91:7777/quanshu/mp-ui-user into dev

DELL 3 年之前
父节点
当前提交
79c6c95df3
共有 4 个文件被更改,包括 126 次插入70 次删除
  1. 79 62
      pages/index/index.vue
  2. 29 0
      pages/order/detail.vue
  3. 1 2
      pages/share/index.vue
  4. 17 6
      pages/user/index.vue

+ 79 - 62
pages/index/index.vue

@@ -22,15 +22,18 @@
 				</view>
 			</view>
 			<view class="box-ticket">
-				<swiper class="image-container" circular :vertical="true" :current="currentIndex" :autoplay="false" @change="swiperChange">
+				<swiper class="image-container" circular :vertical="true" :current="currentIndex" :autoplay="false"
+					@change="swiperChange">
 					<swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="item.picUrl">
 						<view class="flex image-wrap">
 							<image class="img" @click="clickImg(item)" :src="item.picUrl" lazy-load mode=""></image>
 						</view>
 					</swiper-item>
 				</swiper>
-				
-				<swiper class="prize-container" previous-margin="270rpx" next-margin="270rpx" circular :duration="15000" :interval="1500" easing-function="easeOutCubic" :current="currentPrizeIndex" :disable-touch="true" :autoplay="true">
+
+				<swiper class="prize-container" previous-margin="270rpx" next-margin="270rpx" circular :duration="15000"
+					:interval="1500" easing-function="easeOutCubic" :current="currentPrizeIndex" :disable-touch="true"
+					:autoplay="true">
 					<swiper-item class="swiper-item" v-for="(item, index) in prizeList" :key="index">
 						<view class="flex image-wrap">
 							<image class="img" :src="item.picUrl" lazy-load mode="aspectFill"></image>
@@ -86,6 +89,14 @@
 				prizeList: []
 			};
 		},
+		onLoad(opthios) {
+			if (opthios.scene) {
+				let sceneStr = decodeURIComponent(opthios.scene)
+				this.sceneArr = sceneStr.split('&')
+				uni.setStorageSync('shareUid', this.sceneArr[0])
+				uni.setStorageSync('shareType', this.sceneArr[1])
+			}
+		},
 		onShow(opthios) {
 			this.loginState = uni.getStorageSync('token') ? true : false
 			this.getList()
@@ -96,48 +107,48 @@
 				this.currentIndex = e.detail.current
 				this.getPrize(this.imgList[this.currentIndex].boxId)
 			},
-			
-			prizeChange(e){
+
+			prizeChange(e) {
 				let ticketNum = this.imgList.length - 1
 				let num = this.prizeList.length - 1
 				let index = this.currentPrizeIndex = e.detail.current
-				
+
 				let acIndex = this.currentIndex
-				if(num == index){
-					acIndex ++
-					if(acIndex < ticketNum){
+				if (num == index) {
+					acIndex++
+					if (acIndex < ticketNum) {
 						this.currentIndex++
-					}else if(acIndex == ticketNum){
+					} else if (acIndex == ticketNum) {
 						this.currentIndex = ticketNum
-					}else{
+					} else {
 						this.currentIndex = 0
 					}
 					this.currentPrizeIndex = 2
 					this.getPrize(this.imgList[this.currentIndex].boxId)
 				}
 			},
-			
+
 			clickImg(item) {
 				console.log(item);
 			},
-			
-			ticketLeft(){
-				if((this.currentIndex >= 0) && (this.currentIndex < (this.imgList.length - 1))){
-					this.currentIndex ++
-				}else if (this.currentIndex == (this.imgList.length - 1)){
+
+			ticketLeft() {
+				if ((this.currentIndex >= 0) && (this.currentIndex < (this.imgList.length - 1))) {
+					this.currentIndex++
+				} else if (this.currentIndex == (this.imgList.length - 1)) {
 					this.currentIndex = 0
 				}
 			},
-			
-			ticketRight(){
-				if(this.currentIndex > 0){
-					this.currentIndex --
-				}else if (this.currentIndex == 0){
+
+			ticketRight() {
+				if (this.currentIndex > 0) {
+					this.currentIndex--
+				} else if (this.currentIndex == 0) {
 					this.currentIndex = this.imgList.length - 1
 				}
 			},
-			
-			
+
+
 			getList() {
 				uni.showLoading({
 					title: '加载中'
@@ -164,10 +175,10 @@
 					uni.hideLoading();
 				})
 			},
-			
-			getPrize(id){
+
+			getPrize(id) {
 				this.prizeList = []
-				
+
 				$http.post('/api/v1/mp/user/mall/ticket/detail', {
 					boxId: id,
 					noToken: true
@@ -241,15 +252,15 @@
 				if (!this.loginState) {
 					uni.navigateTo({
 						url: "/pages/login/index"
-					})	
+					})
 					return
 				}
 				uni.navigateTo({
 					url: '/pages/prize/index'
 				})
 			},
-			
-			toRule(){
+
+			toRule() {
 				uni.navigateTo({
 					url: '/pages/about/rule'
 				})
@@ -273,7 +284,7 @@
 	.image-container {
 		width: 750rpx;
 		height: 40vh;
-		
+
 		.swiper-item {
 			position: relative;
 			width: 61vw;
@@ -282,46 +293,46 @@
 			justify-content: center;
 			align-items: center;
 		}
-		
-		.image-wrap{
+
+		.image-wrap {
 			position: relative;
 			width: 61vw;
 			height: 40vh;
-			
-			.img{
+
+			.img {
 				width: 61vw;
 				height: 40vh;
 			}
 		}
 	}
-	
-	.prize-container{
+
+	.prize-container {
 		width: 750rpx;
-		height:  13vh;
+		height: 13vh;
 		margin-top: 2vh;
-		
+
 		.swiper-item {
 			width: 100rpx;
-			height:  13vh;
+			height: 13vh;
 			display: flex;
 			justify-content: flex-start;
 			align-items: center;
-			
-			.image-wrap{
+
+			.image-wrap {
 				width: 160rpx;
 				height: 13vh;
 				border-radius: 20rpx;
 				background: linear-gradient(0deg, #BBBBBB, #FFFFFF);
-				
-				.img{
+
+				.img {
 					width: 100%;
 					height: 76%;
 				}
 			}
 		}
-		
+
 	}
-	
+
 	.box {
 		width: 100%;
 		height: calc(100vh - 50px);
@@ -341,11 +352,11 @@
 					&-cir {
 						width: 72rpx;
 						height: 72rpx;
-						background-color: #FFC320 ;
+						background-color: #FFC320;
 						border-radius: 50%;
 						margin-bottom: 14rpx;
-						
-						image{
+
+						image {
 							width: 40rpx;
 							height: 36rpx;
 						}
@@ -364,8 +375,8 @@
 				flex-direction: column;
 				align-items: flex-end;
 				justify-content: flex-end;
-				
-				&-txt{
+
+				&-txt {
 					font-size: 24rpx;
 					width: 152rpx;
 					height: 48rpx;
@@ -373,7 +384,8 @@
 					border-radius: 24rpx 0 0 24rpx;
 					margin-top: 40rpx;
 				}
-				&-txt:last-child{
+
+				&-txt:last-child {
 					background-color: #FFFFCC;
 				}
 			}
@@ -382,8 +394,8 @@
 		&-ticket {
 			position: relative;
 			margin: 40rpx 0 0;
-			
-			.index-left{
+
+			.index-left {
 				position: absolute;
 				width: 100rpx;
 				height: 100rpx;
@@ -391,7 +403,8 @@
 				left: 10rpx;
 				z-index: 20;
 			}
-			.index-right{
+
+			.index-right {
 				position: absolute;
 				width: 100rpx;
 				height: 100rpx;
@@ -399,8 +412,8 @@
 				right: 10rpx;
 				z-index: 20;
 			}
-			
-			.box-img{
+
+			.box-img {
 				position: absolute;
 				top: 0;
 				z-index: 10;
@@ -409,22 +422,26 @@
 			}
 		}
 
-		&-ticket-btn{
+		&-ticket-btn {
 			margin-top: 30rpx;
-			&-content{
+
+			&-content {
 				position: relative;
 				width: 420rpx;
 				height: 142rpx;
-				image{
+
+				image {
 					width: 420rpx;
 					height: 142rpx;
 				}
-				.title{
+
+				.title {
 					position: absolute;
 					top: 0;
 					width: 100%;
 					height: 142rpx;
-					text{
+
+					text {
 						font-size: 56rpx;
 						font-weight: bold;
 						color: #C44906;

+ 29 - 0
pages/order/detail.vue

@@ -53,6 +53,7 @@
 					</view>
 					<view class="detail-info-content-desc">
 						<view>订单编号:</view>
+						<view class="copy" @click="copyOrderId" v-if="status.value == 2 || status.value == 4">复制</view>
 						<view>{{ info.orderId }}</view>
 					</view>
 					<view class="detail-info-content-desc">
@@ -71,6 +72,7 @@
 					</view>
 					<view class="detail-info-content-desc">
 						<view>物流单号:</view>
+						<view class="copy" @click="copyDeliveryFlowId(item.deliveryFlowId)">复制</view>
 						<view>{{ item.deliveryFlowId || '-' }}</view>
 					</view>
 					<view class="detail-info-content-desc">
@@ -108,6 +110,7 @@
 					</view>
 					<view class="detail-info-content-desc">
 						<view>物流单号:</view>
+						<view class="copy" @click="copyDeliveryFlowId(item.deliveryFlowId)">复制</view>
 						<view>{{ item.deliveryFlowId || '-' }}</view>
 					</view>
 					<view class="detail-info-content-desc">
@@ -240,6 +243,18 @@
 					uni.hideLoading();
 				})
 			},
+			
+			copyOrderId() {
+				uni.setClipboardData({
+					data: this.info.orderId,
+				});
+			},
+			
+			copyDeliveryFlowId(id) {
+				uni.setClipboardData({
+					data: id,
+				});
+			},
 		}
 	}
 </script>
@@ -340,6 +355,7 @@
 				}
 
 				&-desc {
+					position: relative;
 					display: flex;
 					line-height: 40rpx;
 					margin-top: 20rpx;
@@ -352,6 +368,19 @@
 					view:last-child {
 						width: calc(100% - 150rpx)
 					}
+					
+					.copy {
+						position: absolute;
+						right: 0;
+						top: -6rpx;
+						width: 136rpx;
+						height: 52rpx;
+						line-height: 52rpx;
+						text-align: center;
+						color: rgba(149, 149, 149, 100);
+						border: 1px solid rgba(187, 187, 187, 100);
+						border-radius: 10rpx;
+					}
 				}
 
 				&-desc:last-child {

+ 1 - 2
pages/share/index.vue

@@ -43,7 +43,7 @@
 				posterData: {
 					poster: {
 						//根据屏幕大小自动生成图片背景大小
-						url: "https://mp-public-test-1307117429.cos.ap-shanghai.myqcloud.com/mp.png", //图片地址
+						url: "https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/mp.png", //图片地址
 						r: 15, //圆角半径
 						w: 340, //图片宽度
 						h: 447, //图片高度
@@ -99,7 +99,6 @@
 				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
 					uni.hideLoading();
 					if (res.code == 0) {
-						console.log(res);
 						this.userInfo = res.data
 						this.avatar = this.posterData.mainImg.url = env.filePublic + res.data.avatar
 						this.posterData.title.text = res.data.nickName

+ 17 - 6
pages/user/index.vue

@@ -46,7 +46,7 @@
 			<u-cell-group :border="false">
 				<u-cell icon="order" title="提货订单" :isLink="true" @click="toOrder"></u-cell>
 				<u-cell icon="map" title="我的地址" :isLink="true" @click="toAddress"></u-cell>
-				<!-- <u-cell icon="kefu-ermai" title="联系客服" :isLink="true"></u-cell> -->
+				<u-cell icon="kefu-ermai" title="联系我们" :isLink="true" @click="contactService"></u-cell>
 				<u-cell icon="info-circle" title="关于我们" :border="false" :isLink="true" :url="'/pages/about/index'">
 				</u-cell>
 			</u-cell-group>
@@ -56,7 +56,6 @@
 		</view>
 
 		<custom-tab-bar :activeValue="'user'" />
-
 	</view>
 </template>
 
@@ -106,7 +105,7 @@
 					uni.hideLoading();
 				})
 			},
-			
+
 			getBaseInfo() {
 				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
 					if (res.code == 0) {
@@ -114,7 +113,7 @@
 						this.avatar = env.filePublic + res.data.avatar
 					}
 				}).catch(() => {
-					
+
 				})
 			},
 
@@ -171,6 +170,18 @@
 					}
 				})
 			},
+
+			// 联系客服
+			contactService() {
+				// #ifdef MP-WEIXIN
+				wx.openCustomerServiceChat({
+					extInfo: {
+						url: 'https://work.weixin.qq.com/kfid/kfc36c0d90028adbd24'
+					},
+					corpId: 'ww02da63d80c66284b',
+				})
+				// #endif
+			},
 		},
 	}
 </script>
@@ -214,8 +225,8 @@
 				border-radius: 50%;
 				overflow: hidden;
 			}
-			
-			.no-ava{
+
+			.no-ava {
 				width: 106rpx;
 				height: 106rpx;
 				border-radius: 50%;