chenrong 1 gadu atpakaļ
vecāks
revīzija
4935871598

+ 9 - 0
api/drawCard.js

@@ -61,3 +61,12 @@ export function submittResultApi(data) {
     data: data
   })
 }
+
+// 计算订单价格
+export function orderPriceApi(data) {
+  return request({
+    url: '/wx/bkm/order/orderPrice',
+    method: 'post',
+    data: data
+  })
+}

+ 7 - 1
api/message.js

@@ -9,4 +9,10 @@ export function messageListApi(data) {
     data: data
   })
 }
-
+export function messageReadApi(data) {
+  return request({
+    url: '/wx/bkm/message/user/read',
+    method: 'post',
+    data: data
+  })
+}

+ 8 - 1
api/user.js

@@ -27,4 +27,11 @@ export function logOffApi(data) {
     data: data
   })
 }
-
+// 绑定手机号
+export function bindPhoneApi(data) {
+  return request({
+    url: '/wx/account/bindPhone',
+    method: 'post',
+    data: data
+  })
+}

+ 33 - 0
component/noData.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="nodata">
+		<image class="img" src="https://mall.rongtongh.cn/storage/img/noData.png" mode="widthFix"></image>
+		<view class="text">
+			啊哦,没有任何内容
+		</view>
+	</view>
+</template>
+
+<script>
+</script>
+
+<style scoped lang="scss">
+	.nodata {
+		width: 100%;
+		position: absolute;
+		top: 50%;
+		transform: translateY(-50%);
+		
+		.img {
+			width: 80vw;
+			margin: 0 auto;
+		}
+		.text {
+			color: #999999;
+			font-size: 16px;
+			text-align: center;
+			position: absolute;
+			top: 75%;
+			width: 100%;
+		}
+	}
+</style>

+ 2 - 1
component/paymentPopup.vue

@@ -127,7 +127,8 @@
 	} from "@/api/coupon.js"
 	import {
 		drawCardSubmitApi,
-		submittResultApi
+		submittResultApi,
+		orderPriceApi
 	} from "@/api/drawCard.js"
 
 	import Mloading from "@/component/Mloading.vue"

+ 2 - 2
pages/drawCard_first/drawCard_first.vue

@@ -18,10 +18,10 @@
 						<image class="photo" :style="'left:' + index * 11 + 'px'" src="https://mall.rongtongh.cn/storage/img/Frame1.png"
 							v-for="(item, index) in userList" mode="widthFix"></image>
 					</view>
-					<view class="hot">
+					<!-- <view class="hot">
 						<image src="https://mall.rongtongh.cn/storage/img/first/hot.png" mode="widthFix"></image>
 						{{ detail.hotNum }}
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</view>

+ 2 - 2
pages/drawCard_last/drawCard_last.vue

@@ -18,10 +18,10 @@
 						<image class="photo" :style="'left:' + index * 11 + 'px'" src="https://mall.rongtongh.cn/storage/img/Frame1.png"
 							v-for="(item, index) in userList" mode="widthFix"></image>
 					</view>
-					<view class="hot">
+					<!-- <view class="hot">
 						<image src="https://mall.rongtongh.cn/storage/img/first/hot.png" mode="widthFix"></image>
 						{{ detail.hotNum }}
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</view>

+ 30 - 12
pages/login/login.vue

@@ -1,12 +1,15 @@
 <template>
 	<view class="loginPage">
-		<image class="bk" src="https://mall.rongtongh.cn/storage/img/ka.jpeg" mode=""></image>
+		<image class="bk" src="https://mall.rongtongh.cn/storage/img/loginBk.png" mode="widthFix"></image>
 		<view class="box">
+			<button @click="wxLogin" class="button" type="default">微信授权登录</button>
+			<view class="textButton" @click="noLogin">
+				暂不登录
+			</view>
 			<view class="tip">
-				<radio :checked="checkbox1" @click="checkbox1 = !checkbox1" />
-				<view class="text">我已阅读并同意<span class="textColor1">《用户协议》</span>及 <span class="textColor1">《隐私政策》</span></view>
+				<radio :checked="checkbox1" @click="checkbox1 = !checkbox1" style="transform:scale(0.6)" color="#333333" />
+				<view class="text">我已阅读并同意<span class="textColor2">《用户协议》</span>及 <span class="textColor2">《隐私政策》</span></view>
 			</view>
-			<button @click="wxLogin" class="m_button" type="default">微信授权登录</button>
 		</view>
 		
 	</view>
@@ -23,6 +26,12 @@
 			}
 		},
 		methods: {
+			noLogin() {
+				console.log('sssssssss')
+				wx.switchTab({
+					url: '/pages/index/index'
+				})
+			},
 			wxLogin: function(e) {
 				if (!this.checkbox1) {
 					wx.showToast({
@@ -88,6 +97,7 @@
 
 <style scoped lang="scss">
 	.loginPage {
+		background: #E6F2FF;
 		height: 100vh;
 		overflow: hidden;
 		// background: url(https://mall.rongtongh.cn/storage/img/ka.jpeg) no-repeat;
@@ -98,13 +108,13 @@
 		}
 		.box {
 			position: absolute;
-			bottom: 0;
+			bottom: 20%;
 			display: flex;
 			align-items: center;
 			justify-content: center;
 			flex-direction: column;
 			width: 100%;;
-			background-color: rgba(255, 255, 255, 0.7);
+			// background-color: rgba(255, 255, 255, 0.7);
 			padding: 30px 10px;
 			.tip {
 				display: flex;
@@ -120,12 +130,20 @@
 					width: 12px;
 				}
 			}
-			.m_button {
-				height: 40px;
-				width: 50vw;
-				border-radius: 20px;
-				line-height: 40px;
-				font-size: 16px;
+			.button {
+				height: 48px;
+				width: calc(100% - 60px);
+				border-radius: 24px;
+				line-height: 48px;
+				font-size: 14px;
+				background: #FEA200;
+				color: #fff;
+				margin-bottom: 20px;
+			}
+			.textButton {
+				font-size: 14px;
+				color: #666;
+				margin-bottom: 75px;
 			}
 		}
 	}

+ 73 - 9
pages/message/message.vue

@@ -1,19 +1,39 @@
 <template>
 	<view class="container">
-		<view v-for="(item, index) in 10">
-			站内信
+		<view class="massage" v-for="(item, index) in list">
+			<view class="time">
+				{{item.createTime}}
+			</view>
+			<uni-badge class="uni-badge-left-margin" :is-dot="true" :text="item.status == 0" absolute="rightTop" size="small" :offset="[5, 5]">
+				<view class="info" @click="clickMassage(item)">
+					<view class="title">
+						{{item.title}}
+					</view>
+					<view class="text">
+						{{item.content}}
+					</view>
+				</view>
+			</uni-badge>
 		</view>
-		<uni-load-more :status="loadMore" @clickLoadMore="load" :contentText="contentText"></uni-load-more>
+		<uni-load-more v-if="list.length > 0" :status="loadMore" @clickLoadMore="load" :contentText="contentText"></uni-load-more>
+		<noData v-else />
 	</view>
 </template>
 
 <script>
+	import noData from "@/component/noData.vue"
 	import {
-		messageListApi
+		messageListApi,
+		messageReadApi
 	} from "@/api/message.js"
 	export default {
+		components: {
+			noData
+		},
 		data() {
 			return {
+				value: 1,
+				// more/loading/noMore
 				loadMore: 'more',
 				contentText: {
 					contentdown: '点击加载更多',
@@ -21,7 +41,6 @@
 				params: {
 					limit: 10,
 					page: 1,
-					status: 0,
 				},
 				list: []
 			}
@@ -31,14 +50,35 @@
 		},
 		methods: {
 			load() {
-				console.log('触发load')
-				this.params.page += 1
-				this.getList()
+				if (this.loadMore = "more") {
+					this.params.page += 1
+					this.getList()
+				}
 			},
 			getList() {
+				this.loadMore = "loading"
 				messageListApi(this.params).then(res => {
-					this.list.push(res.data.list)
+					this.list.push(...res.data.list)
+					// 判断是否还有更多数据
+					let listNum = this.params.limit * this.params.page
+					let total = res.data.total
+					if (total > listNum) {
+						this.loadMore = "more"
+					} else {
+						this.loadMore = "noMore"
+					}
+				})
+			},
+			clickMassage(value) {
+				// 设置成已读
+				let params = [value.id]
+				value.status = 1
+				messageReadApi(params).then(res => {
+					// this.list = []
+					// this.getList()
 				})
+				// 判断点击消息类型进行后续业务
+				
 			}
 		}
 	}
@@ -47,5 +87,29 @@
 <style scoped lang="scss">
 	.container {
 		height: 100vh;
+		
+		.massage {
+			margin: 5px 10px;
+			.time {
+				font-size: 12px;
+				padding: 6px 0;
+				text-align: center;
+			}
+			.info {
+				background: #fff;
+				border-radius: 5px;
+				padding: 10px;
+				
+				.title {
+					font-size: 16px;
+					font-weight: 600;
+					padding: 5px 0;
+				}
+				.text {
+					font-size: 12px;
+					color: #9999;
+				}
+			}
+		}
 	}
 </style>

+ 27 - 2
pages/mine/mine.vue

@@ -3,7 +3,14 @@
 		<view class="user">
 			<view class="userInfo">
 				<image @click="toUserInfo" class="userPhoto" :src="userInfo.avatarUrl"></image>
-				<uni-icons class="message" type="email" size="30" @click="$navigateTo('/pages/message/message')"></uni-icons>
+				<uni-badge class="message" :text="massageNum" absolute="rightTop" size="small" :max-num="99" :offset="[4, 4]">
+					<image 
+						class="icon" 
+						src="https://mall.rongtongh.cn/storage/img/mine/massage.png" 
+						mode="widthFix" 
+						@click="$navigateTo('/pages/message/message')"
+					></image>
+				</uni-badge>
 				<view class="info">
 					<view class="name" v-if="hasLogin">
 						{{userInfo.nickName || ''}}
@@ -73,6 +80,9 @@
 	import {
 		userInfoApi
 	} from "@/api/user.js"
+	import {
+		messageListApi,
+	} from "@/api/message.js"
 	export default {
 		data() {
 			return {
@@ -81,6 +91,7 @@
 				userId: '-',
 				hasLogin: false,
 				userInfoDetail: {},
+				massageNum: 0
 			}
 		},
 		onShow() {
@@ -92,6 +103,7 @@
 				getApp().globalData.hasLogin = true
 				// 获取用户信息详情
 				this.getUserInfo()
+				this.getMassage()
 			} else {
 				this.hasLogin = false
 				getApp().globalData.hasLogin = false
@@ -99,6 +111,16 @@
 			}
 		},
 		methods: {
+			getMassage() {
+				let params = {
+					page: 1,
+					limit: 1,
+					status: 0,
+				}
+				messageListApi(params).then(res => {
+					this.massageNum = res.data.total
+				})
+			},
 			toUserInfo() {
 				this.$navigateTo('/pages/user/user')
 				if (this.isLogin) {
@@ -141,7 +163,10 @@
 			.message {
 				position: absolute;
 				right: 10px;
-				
+				top: 8px;
+				.icon {
+					width: 30px;
+				}
 			}
 			.userPhoto {
 				width: 74px;

+ 140 - 7
pages/user/user.vue

@@ -1,21 +1,102 @@
 <template>
-	<view>
-		<button @click="loginOut">退出登录</button>
-		<button @click="logOff">注销</button>
+	<view class="container">
+		<view class="uesrInfo">
+			<view class="userPhoto">
+				<image class="img" :src="userInfo.avatar"></image>
+				<uni-file-picker
+					ref="picker"
+					class="picker"
+					limit="1"
+					mode="list"
+					file-mediatype="image"
+					@select="select" 
+					@progress="progress" 
+					@success="success" 
+					@fail="fail" 
+				 >
+					<image class="icon" src="https://mall.rongtongh.cn/storage/img/mine/icon1.png" mode="widthFix"></image>
+				</uni-file-picker>
+			</view>
+			<uni-list class="list">
+				<uni-list-item class="listItem" title="用户昵称" :rightText="userInfo.nickname" showArrow clickable @click="onClick" />
+				<uni-list-item class="listItem" title="手机号" :rightText="userInfo.mobile" clickable @click="onClick">
+					<template v-slot:footer>
+						<view class="right">
+							<button class="m_button button" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">
+								<span v-if="userInfo.mobile">更换</span>
+								<span v-else>绑定</span>
+							</button>
+							<span>{{userInfo.mobile}}</span>
+						</view>
+					</template>
+				</uni-list-item>
+			</uni-list>
+		</view>
+		<!-- <uni-popup ref="inputDialog" type="dialog">
+			<uni-popup-dialog 
+				ref="inputClose" 
+				mode="input" 
+				title="修改用户昵称" :
+				value=""
+				placeholder="请输入用户昵称" 
+				@confirm="dialogInputConfirm"
+			>
+			</uni-popup-dialog>
+		</uni-popup> -->
 	</view>
 </template>
 
 <script>
 	import {
-		logOffApi
+		logOffApi,
+		bindPhoneApi,
+		userInfoApi
 	} from "@/api/user.js"
 	export default {
 		data() {
 			return {
-
+				userInfo: {}
 			}
 		},
+		onShow() {
+			this.getUserInfo()
+		},
 		methods: {
+			// 获取上传状态
+			select(e){
+				console.log('选择文件:',e)
+			},
+			// 获取上传进度
+			progress(e){
+				console.log('上传进度:',e)
+			},
+			// 上传成功
+			success(e){
+				console.log(e, '上传成功')
+			},
+			// 上传失败
+			fail(e){
+				console.log('上传失败:',e)
+			},
+			dialogInputConfirm() {
+				
+			},
+			getUserInfo() {
+				userInfoApi().then(res => {
+					this.userInfo = res.data
+					console.log(this.userInfo, '用户信息')
+				})
+			},
+			decryptPhoneNumber(e) {
+				console.log(e, 'eeee')
+				let params = {
+					iv: e.detail.iv,
+					encryptedData: e.detail.encryptedData
+				}
+				bindPhoneApi(params).then(res => {
+					console.log(res, 'rrr')
+				})
+			},
 			loginOut() {
 				wx.removeStorageSync('userInfo')
 				wx.removeStorageSync('userId')
@@ -51,6 +132,58 @@
 	}
 </script>
 
-<style>
-
+<style scoped lang="scss">
+	.uesrInfo {
+		background: #fff;
+		overflow: hidden;
+		padding: 0 15px;
+	}
+	.userPhoto {
+		width: 74px;
+		height: 74px;
+		position: relative;
+		margin: 30px auto 30px auto;
+		position: relative;
+		
+		.img {
+			width: 100%;
+			height: 100%;
+			border-radius: 50%;
+			background: #dedede;
+		}
+		.icon {
+			width: 20px;
+			position: absolute;
+			right: 0;
+			bottom: 0;
+		}
+	}
+	.list {
+		// margin: 0 10px;
+	}
+	.right {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+	.button {
+		display: inline-block;
+		font-size: 11px;
+		font-weight: 500;
+		width: 34px;
+		height: 22px;
+		line-height: 22px;
+		padding: 0;
+		margin-right: 5px;
+	}
+</style>
+<style scoped>
+	.listItem >>> .uni-list-item__extra-text {
+		color: #000;
+		font-size: 14px;
+		font-weight: 600;
+	}
+	.userPhoto >>> .uni-file-picker__lists {
+		display: none !important;
+	}
 </style>

+ 9 - 0
static/style.scss

@@ -35,4 +35,13 @@ image {
 }
 .textColor1 {
 	color: #FFAD3D;
+}
+.textColor2 {
+	color: #0057FF;
+}
+.textColor3 {
+	color: #666666;
+}
+.textColor4 {
+	color: #999999;
 }

+ 4 - 0
unpackage/dist/dev/mp-weixin/pages/mine/mine.wxss

@@ -19,6 +19,10 @@
 .user .userInfo .message.data-v-dcbcfe34 {
   position: absolute;
   right: 10px;
+  top: 8px;
+}
+.user .userInfo .message .icon.data-v-dcbcfe34 {
+  width: 30px;
 }
 .user .userInfo .userPhoto.data-v-dcbcfe34 {
   width: 74px;

+ 3 - 14
unpackage/dist/dev/mp-weixin/project.config.json

@@ -1,8 +1,7 @@
 {
   "description": "项目配置文件。",
   "packOptions": {
-    "ignore": [],
-    "include": []
+    "ignore": []
   },
   "setting": {
     "urlCheck": false,
@@ -10,16 +9,10 @@
     "postcss": false,
     "minified": false,
     "newFeature": true,
-    "bigPackageSizeSupport": true,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
-    },
-    "condition": false
+    "bigPackageSizeSupport": true
   },
   "compileType": "miniprogram",
-  "libVersion": "3.1.3",
+  "libVersion": "",
   "appid": "wx834984c9e6fb827d",
   "projectname": "宝可梦小程序",
   "condition": {
@@ -39,9 +32,5 @@
       "current": -1,
       "list": []
     }
-  },
-  "editorSetting": {
-    "tabIndent": "insertSpaces",
-    "tabSize": 2
   }
 }