瀏覽代碼

Merge branch 'develop' of http://git.chelingzhu.com/chelingzhu-web/zxyj-mini-html into develop

chenrui 4 年之前
父節點
當前提交
4911d8bd2d

+ 5 - 1
components/uni-coods/uni-coods.vue

@@ -33,6 +33,10 @@
 				type: Number,
 				type: Number,
 				default: 250
 				default: 250
 			},
 			},
+			goldLimit: {
+				type: [Number,String],
+				default: 0
+			},
 			list:{
 			list:{
 				type: Array,
 				type: Array,
 				default: function(){
 				default: function(){
@@ -57,7 +61,7 @@
 			// 商品详情
 			// 商品详情
 			toDetail(item){
 			toDetail(item){
 				uni.navigateTo({
 				uni.navigateTo({
-					url:"/pages/goods/goodsDetail?id="+item.id
+					url:"/pages/goods/goodsDetail?id="+item.id + "&goldLimit="+this.goldLimit
 				})
 				})
 			}
 			}
 		},
 		},

+ 21 - 12
pages/checkOut/checkFinish.vue

@@ -1,12 +1,17 @@
 <template>
 <template>
 	<view class="page-cont">
 	<view class="page-cont">
 		<view class="icon-cont">
 		<view class="icon-cont">
-			<u-icon class="icon" name="checkmark" color="#ffffff" size="80"></u-icon>
+			<u-icon class="icon" name="checkmark" color="#fff" size="80"></u-icon>
 			<view>支付成功</view>
 			<view>支付成功</view>
-			<view>150 乐豆</view>
+			<view class="num-cont">
+				<view>
+					{{payNum}}
+				</view>
+				<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
+			</view>
 		</view>
 		</view>
 		<view class="back-btn">
 		<view class="back-btn">
-			<u-button @click="toHome">返回首页</u-button>
+			<u-button :custom-style="btnStyle" @click="toHome">返回首页</u-button>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -15,20 +20,18 @@
 export default {
 export default {
 	data() {
 	data() {
 		return {
 		return {
-			orderId: '' //订单id
+			btnStyle: {
+				backgroundColor: '#07c160',
+				color:'#fff'
+			},
+			payNum: 0 //支付乐豆数
 		}
 		}
 	},
 	},
 	onLoad(option) {
 	onLoad(option) {
 		console.log(option,'option')
 		console.log(option,'option')
-		this.orderId = option.id
+		this.payNum = option.num
 	},
 	},
 	methods: {
 	methods: {
-		// 查看订单详情
-		toOrderDetail() {
-			uni.navigateTo({
-			    url: '/pages/order/orderDetail?id=' + this.orderId
-			})
-		},
 		// 返回首页
 		// 返回首页
 		toHome() {
 		toHome() {
 			uni.reLaunch({
 			uni.reLaunch({
@@ -55,6 +58,12 @@ export default {
 			flex-direction: column;
 			flex-direction: column;
 			align-items: center;
 			align-items: center;
 			justify-content: center;
 			justify-content: center;
+			.num-cont{
+				display: flex;
+				color: red;
+				font-size: 36upx;
+				font-weight: 600;
+			}
 			>view{
 			>view{
 				font-size: 30upx;
 				font-size: 30upx;
 				margin-top: 40upx;
 				margin-top: 40upx;
@@ -63,7 +72,7 @@ export default {
 		.icon{
 		.icon{
 			width: 120upx;
 			width: 120upx;
 			height: 120upx;
 			height: 120upx;
-			background-color: #00aa00;
+			background-color: #07c160;
 			display: flex;
 			display: flex;
 			justify-content: center;
 			justify-content: center;
 			border-radius: 50%;
 			border-radius: 50%;

+ 7 - 2
pages/checkOut/checkOut.vue

@@ -154,8 +154,13 @@
 				sellerReceive(data).then(res => {
 				sellerReceive(data).then(res => {
 					console.log(res)
 					console.log(res)
 					if(res.status == 200){
 					if(res.status == 200){
-						uni.redirectTo({
-							url:"/pages/checkOut/checkFinish"
+						uni.navigateTo({
+							url: '/pages/checkOut/checkFinish?num='+this.number
+						})
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.message
 						})
 						})
 					}
 					}
 				})
 				})

+ 27 - 6
pages/goods/goodsDetail.vue

@@ -22,6 +22,9 @@
 						<u-number-box :max="goodContent.inventoryQty" v-model="nums"></u-number-box>
 						<u-number-box :max="goodContent.inventoryQty" v-model="nums"></u-number-box>
 					</view>
 					</view>
 				</view>
 				</view>
+				<view class="goods-goldLimit">
+					此商品需要满<text>{{goldLimit}}</text>乐豆才可购买
+				</view>
 			</view>
 			</view>
 			<!-- 商品属性 -->
 			<!-- 商品属性 -->
 			<view class="goods-attr">
 			<view class="goods-attr">
@@ -74,12 +77,14 @@
 				imageList:[], // 商品图片
 				imageList:[], // 商品图片
 				nums:1, // 商品数量
 				nums:1, // 商品数量
 				id: '',
 				id: '',
-				goodContent: null
+				goodContent: null,
+				goldLimit: 0
 			};
 			};
 		},
 		},
 		onLoad(opts) {
 		onLoad(opts) {
 			console.log(opts)
 			console.log(opts)
 			this.id = opts.id
 			this.id = opts.id
+			this.goldLimit = opts.goldLimit
 			this.getDetail()
 			this.getDetail()
 		},
 		},
 		methods: {
 		methods: {
@@ -104,10 +109,17 @@
 			// 立即下单
 			// 立即下单
 			toOrder(){
 			toOrder(){
 				// console.log(this.goodContent,this.id,'pppppppp')
 				// console.log(this.goodContent,this.id,'pppppppp')
-				this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
-				uni.redirectTo({
-					url:"/pages/toOrder/index"
-				})
+				if(this.goodContent.sellGold * this.nums >= this.goldLimit){
+					this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
+					uni.redirectTo({
+						url:"/pages/toOrder/index"
+					})
+				}else{
+					uni.showToast({
+						icon:"none",
+						title:"此商品需要满" +this.goldLimit+ "乐豆才可购买"
+					})
+				}
 			}
 			}
 		},
 		},
 	}
 	}
@@ -174,7 +186,7 @@ page{
 			display: flex;
 			display: flex;
 			align-items: center;
 			align-items: center;
 			justify-content: space-between;
 			justify-content: space-between;
-			padding:0 40upx 20upx;
+			padding:0 40upx;
 			>view{
 			>view{
 				&:first-child{
 				&:first-child{
 					font-size: 22upx;
 					font-size: 22upx;
@@ -186,6 +198,15 @@ page{
 				}
 				}
 			}
 			}
 		}
 		}
+		.goods-goldLimit{
+			padding: 10upx 40upx;
+			color: #F0AD4E;
+			font-size: 24rpx;
+			text-align: right;
+			text{
+				color: red;
+			}
+		}
 	}
 	}
 	.goods-attr{
 	.goods-attr{
 		margin: 20upx 0;
 		margin: 20upx 0;

+ 1 - 1
pages/goods/index.vue

@@ -9,7 +9,7 @@
 			<view v-for="(item,index) in goodsList" :key="index" v-if="goodsList.length&&item.list.length">
 			<view v-for="(item,index) in goodsList" :key="index" v-if="goodsList.length&&item.list.length">
 				<u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
 				<u-section :title="item.type.name" font-size="35" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
 				<view class="goods-list">
 				<view class="goods-list">
-					<uni-coods :list="item.list"></uni-coods>
+					<uni-coods :goldLimit="item.type.goldLimit" :list="item.list"></uni-coods>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view v-if="goodsList.length==0">
 			<view v-if="goodsList.length==0">

+ 2 - 2
pages/toOrder/payFinish.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
 	<view class="page-cont">
 	<view class="page-cont">
 		<view class="icon-cont">
 		<view class="icon-cont">
-			<u-icon class="icon" name="checkmark" color="#62c500" size="80"></u-icon>
+			<u-icon class="icon" name="checkmark" color="#fff" size="80"></u-icon>
 			<view>支付成功</view>
 			<view>支付成功</view>
 		</view>
 		</view>
 		<u-button @click="toOrderDetail" type="primary">查看订单详情</u-button>
 		<u-button @click="toOrderDetail" type="primary">查看订单详情</u-button>
@@ -63,7 +63,7 @@ export default {
 		.icon{
 		.icon{
 			width: 120upx;
 			width: 120upx;
 			height: 120upx;
 			height: 120upx;
-			background-color: #d1d1d1;
+			background-color: #07c160;
 			display: flex;
 			display: flex;
 			justify-content: center;
 			justify-content: center;
 			border-radius: 50%;
 			border-radius: 50%;

+ 4 - 1
pages/userCenter/userInfo/changePayPwd.vue

@@ -2,7 +2,7 @@
 	<view class="changePayPwd-container">
 	<view class="changePayPwd-container">
 		<text class="pwd-describe">请输入当前支付密码</text>
 		<text class="pwd-describe">请输入当前支付密码</text>
 		<view class="pwd-item">
 		<view class="pwd-item">
-			<u-input v-model="oldPwd" border type="password" input-align="center" placeholder="请输入支付密码" :maxlength="30" class="inp-pwd" />
+			<input v-model="oldPwd" border type="password" placeholder="请输入支付密码" :maxlength="30" class="inp-pwd" />
 		</view>
 		</view>
 		<view class="btn-con">
 		<view class="btn-con">
 			<u-button class="handle-btn" type="info" size="medium" @click="cancel">取消</u-button>
 			<u-button class="handle-btn" type="info" size="medium" @click="cancel">取消</u-button>
@@ -76,6 +76,9 @@
 		}
 		}
 		.pwd-item{
 		.pwd-item{
 			.inp-pwd{
 			.inp-pwd{
+				padding: 10upx 0;
+				border: 1px solid #cacaca;
+				text-align: center;
 			}
 			}
 		}
 		}
 		.btn-con{
 		.btn-con{

+ 12 - 24
pages/userCenter/userInfo/paymentPwd.vue

@@ -4,10 +4,6 @@
 		<view class="sms-item" @tap="showKeyboard=!showKeyboard">
 		<view class="sms-item" @tap="showKeyboard=!showKeyboard">
 			<u-message-input mode="bottomLine" :maxlength="6" v-model="value" :dot-fill="true" :disabled-keyboard="true"></u-message-input>
 			<u-message-input mode="bottomLine" :maxlength="6" v-model="value" :dot-fill="true" :disabled-keyboard="true"></u-message-input>
 		</view>
 		</view>
-		<!-- <view class="btn-con">
-			<u-button class="handle-btn" type="info" size="medium" @click="cancel">取消</u-button>
-			<u-button class="handle-btn" type="primary" size="medium" @click="submit">确定</u-button>
-		</view> -->
 		<!-- 数字键盘 -->
 		<!-- 数字键盘 -->
 		<u-keyboard ref="uKeyboard" :dot-enabled="false" :mask="false" :tooltip="false" v-model="showKeyboard" @change="valChange" @backspace="backspace"></u-keyboard>
 		<u-keyboard ref="uKeyboard" :dot-enabled="false" :mask="false" :tooltip="false" v-model="showKeyboard" @change="valChange" @backspace="backspace"></u-keyboard>
 	</view>
 	</view>
@@ -48,13 +44,21 @@
 			// 监听输入框输入长度
 			// 监听输入框输入长度
 			 value: {
 			 value: {
 				handler(newVal) {
 				handler(newVal) {
-					console.log(newVal.length,'NNNNNNNNNNNN')
 					if(newVal.length==6) {
 					if(newVal.length==6) {
 						if(this.nowSetp == 1){
 						if(this.nowSetp == 1){
 							this.oPwd = this.value
 							this.oPwd = this.value
-							this.value = ''
-							this.nowSetp++
-							this.showKeyboard = true
+							if(this.oldPwd && this.oPwd === this.oldPwd) {
+								uni.showToast({
+									title: '新密码与原密码相同,请重新输入!',
+									icon: 'none'
+								})
+								this.value = ''
+								return false
+							} else {
+								this.value = ''
+								this.nowSetp++
+								this.showKeyboard = true
+							}
 						}else if(this.nowSetp == 2){
 						}else if(this.nowSetp == 2){
 							this.tPwd = this.value
 							this.tPwd = this.value
 							this.showKeyboard = false
 							this.showKeyboard = false
@@ -78,22 +82,6 @@
 				// 删除value的最后一个字符
 				// 删除value的最后一个字符
 				if(this.value.length) this.value = this.value.substr(0, this.value.length - 1)
 				if(this.value.length) this.value = this.value.substr(0, this.value.length - 1)
 			},
 			},
-			//  确定
-			submit(){
-				if(!this.value || this.value.length < 6){
-					uni.showToast({ title: '请输入6位数字支付密码', icon: 'none' })
-				}else{
-					if(this.nowSetp == 1){
-						this.oPwd = this.value
-						this.value = ''
-						this.nowSetp++
-						this.showKeyboard = true
-					}else if(this.nowSetp == 2){
-						this.tPwd = this.value
-						this.checkPwd()
-					}
-				}
-			},
 			//  密码校验
 			//  密码校验
 			checkPwd(){
 			checkPwd(){
 				if(this.oPwd == this.tPwd){
 				if(this.oPwd == this.tPwd){

+ 0 - 15
pages/userCenter/userInfo/smsVerification.vue

@@ -10,10 +10,6 @@
 				<text :class="['getcode-btn', isDisable ? 'grey-btn' : '']" @click="isDisable ? null : pageInit()">{{nowVal}}</text>
 				<text :class="['getcode-btn', isDisable ? 'grey-btn' : '']" @click="isDisable ? null : pageInit()">{{nowVal}}</text>
 			</view>
 			</view>
 		</view>
 		</view>
-		<!-- <view class="btn-con">
-			<u-button class="handle-btn" type="info" size="medium" @click="cancel">取消</u-button>
-			<u-button class="handle-btn" type="primary" size="medium" @click="submit">确定</u-button>
-		</view> -->
 		<!-- 数字键盘 -->
 		<!-- 数字键盘 -->
 		<u-keyboard ref="uKeyboard" :dot-enabled="false" :mask="false" :tooltip="false" v-model="showKeyboard" @change="valChange" @backspace="backspace"></u-keyboard>
 		<u-keyboard ref="uKeyboard" :dot-enabled="false" :mask="false" :tooltip="false" v-model="showKeyboard" @change="valChange" @backspace="backspace"></u-keyboard>
 		<!-- 图文验证码 -->
 		<!-- 图文验证码 -->
@@ -166,17 +162,6 @@
 				  }, 1000)
 				  }, 1000)
 				}
 				}
 			},
 			},
-			//  确定
-			submit(){
-				if(!this.value || this.value.length < 6){
-					uni.showToast({ title: '请输入6位数字验证码', icon: 'none' })
-				}else{
-					//  校验输入短信验证码是否正确
-					uni.redirectTo({
-						url: '/pages/userCenter/userInfo/paymentPwd'
-					})
-				}
-			},
 			//  取消
 			//  取消
 			cancel(){
 			cancel(){
 				uni.navigateBack({
 				uni.navigateBack({