Преглед на файлове

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

chenrui преди 4 години
родител
ревизия
9d82119a92

+ 3 - 3
components/jyf-parser/libs/trees.vue

@@ -2,7 +2,7 @@
 	<view :class="'interlayer '+(c||'')" :style="s">
 		<block v-for="(n, i) in nodes" v-bind:key="i">
 			<!--图片-->
-			<view v-if="n.name=='img'" :class="'_img '+n.attrs.class" :style="n.attrs.style" :data-attrs="n.attrs" @tap.stop="imgtap">
+			<view v-if="n.name=='img'" :class="'_img '+n.attrs.class" :style="n.attrs.style" :data-attrs="n.attrs" @click.stop="imgtap">
 				<rich-text v-if="ctrl[i]!=0" :nodes="[{attrs:{src:loading&&(ctrl[i]||0)<2?loading:(lazyLoad&&!ctrl[i]?placeholder:(ctrl[i]==3?errorImg:n.attrs.src||'')),alt:n.attrs.alt||'',width:n.attrs.width||'',style:'-webkit-touch-callout:none;max-width:100%;display:block'+(n.attrs.height?';height:'+n.attrs.height:'')},name:'img'}]" />
 				<image class="_image" :src="lazyLoad&&!ctrl[i]?placeholder:n.attrs.src" :lazy-load="lazyLoad"
 				 :show-menu-by-longpress="!n.attrs.ignore" :data-i="i" :data-index="n.attrs.i" data-source="img" @load="loadImg"
@@ -15,7 +15,7 @@
 			<!--#endif-->
 			<!--视频-->
 			<view v-else-if="((n.lazyLoad&&!n.attrs.autoplay)||(n.name=='video'&&!loadVideo))&&ctrl[i]==undefined" :id="n.attrs.id"
-			 :class="'_video '+(n.attrs.class||'')" :style="n.attrs.style" :data-i="i" @tap.stop="_loadVideo" />
+			 :class="'_video '+(n.attrs.class||'')" :style="n.attrs.style" :data-i="i" @click.stop="_loadVideo" />
 			<video v-else-if="n.name=='video'" :id="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style" :autoplay="n.attrs.autoplay||ctrl[i]==0"
 			 :controls="n.attrs.controls" :loop="n.attrs.loop" :muted="n.attrs.muted" :poster="n.attrs.poster" :src="n.attrs.source[ctrl[i]||0]"
 			 :unit-id="n.attrs['unit-id']" :data-id="n.attrs.id" :data-i="i" data-source="video" @error="error" @play="play" />
@@ -26,7 +26,7 @@
 			 @play.native="play" />
 			<!--链接-->
 			<view v-else-if="n.name=='a'" :id="n.attrs.id" :class="'_a '+(n.attrs.class||'')" hover-class="_hover" :style="n.attrs.style"
-			 :data-attrs="n.attrs" @tap.stop="linkpress">
+			 :data-attrs="n.attrs" @click.stop="linkpress">
 				<trees class="_span" c="_span" :nodes="n.children" />
 			</view>
 			<!--广告-->

+ 4 - 2
components/uni-cart-fix/uni-cart-fix.vue

@@ -18,8 +18,10 @@
 			},
 			methods: {
 				toCart() {
-					uni.navigateTo({
-						url:"/pages/cart/cart"
+					this.$bindClick(function(){
+						uni.navigateTo({
+							url:"/pages/cart/cart"
+						})
 					})
 				}
 			},

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

@@ -12,7 +12,7 @@
 				:error-img="errorImg">
 				</u-lazy-load>
 			</view>
-			<view class="name ellipsis-two"  @click="toDetail(item)">{{item.name}}</view>
+			<view class="name ellipsis-two" @click="toDetail(item)">{{item.name}}</view>
 			<view class="price">
 				<view>
 					<text>{{item.sellGold}}</text>
@@ -50,13 +50,15 @@
 				errorImg: '/static/imgError.png',
 				timer: null,
 				finger: {x:0,y:0},
-				linePos: null
+				linePos: null,
 			}
 		},
 		methods: {
 			// 加入购物车
 			addCart(item) {
-				uni.$emit("addCart",{goodsNo:item.goodsNo,buyQty:1})
+				this.$bindClick(function(){
+					uni.$emit("addCart",{goodsNo:item.goodsNo,buyQty:1})
+				})
 			},
 			// 商品详情
 			toDetail(item){

+ 10 - 0
main.js

@@ -38,6 +38,16 @@ Vue.prototype.$hasPermissions = function (value) {
  }
  return isExist;
 }
+// 防止重复触发事件
+Vue.prototype.$bindClick = function (fun) {
+	if(!store.state.vuex_isClick){
+		store.state.vuex_isClick = true
+		fun()
+		setTimeout(()=>{
+			store.state.vuex_isClick = false
+		},2000)
+	}
+}
 const app = new Vue({
 	store,
     ...App

+ 5 - 3
pages/cart/cart.vue

@@ -24,7 +24,7 @@
 					</view>
 					<view class="des">
 						<view>商品满<text>{{item.goldLimit}}</text></view>
-						<u-image mode="scaleToFill" width="26rpx" height="26rpx" src="/static/ledou.png"></u-image>
+						<image mode="scaleToFill" style="width: 26rpx;height: 26rpx;" src="/static/ledou.png"></image>
 						<view>才可购买</view>
 					</view>
 				</view>
@@ -45,14 +45,14 @@
 								<view v-if="good.goods.inventoryQty==0||good.goods.state == 0||good.goods.delFlage == 0" class="goods-staus">
 									<text>已失效</text>
 								</view>
-								<u-image border-radius="12" width="158rpx" height="140rpx" :src="good.goods.homeImage+'?x-oss-process=image/resize,m_pad,h_252,w_325,color_ffffff'"></u-image>
+								<u-image border-radius="12" width="158rpx" height="140rpx" :src="good.goods.homeImage+'?x-oss-process=image/resize,m_pad,h_140,w_158,color_ffffff'"></u-image>
 							</view>
 							<view class="goods-text">
 								<view class="good-name">{{good.goods.name}}</view>
 								<view class="goods-price">
 									<view>
 										<text>{{good.goods.sellGold}}</text>
-										<u-image mode="scaleToFill" width="30rpx" height="30rpx" src="/static/ledou.png"></u-image>
+										<image mode="scaleToFill" style="width: 30rpx;height: 30rpx;"src="/static/ledou.png"></image>
 									</view>
 									<view v-if="good.goods.inventoryQty>0&&good.goods.state==1">
 										<uni-numbers-box @change="goodsNumsChange()" :index="cindex+'-'+index" :value="good.buyQty" :min="1"></uni-numbers-box>
@@ -414,6 +414,8 @@ page{
 				flex-grow: 1;
 				.goods-imgs{
 					position: relative;
+					border:1px solid #eee;
+					border-radius: 10rpx;
 					.goods-staus{
 						width: 100%;
 						height: 100%;

+ 68 - 31
pages/checkOut/checkOut.vue

@@ -1,33 +1,36 @@
 <template>
 	<view class="page-content">
-		<u-gap height="10" bg-color="#f8f8f8"></u-gap>
-		<u-field
-			class="field-item"
-			:value="store.name"
-			disabled
-			input-align="right"
-			label="收取门店"
-		>
-		</u-field>
-		<u-field
-			v-model="remarks"
-			label="备注"
-			input-align="right"
-			auto-height
-			:maxlength="10"
-			placeholder="请填写备注(最多10个字符)"
-			type="textarea"
-		>
-		</u-field>
-		<view class="num-cont">
-			<text class="u-required">支付数量</text>
-			<view class="num-input">
-				<u-input v-model="number" type="number" placeholder="请输入数量" />
-				<text>个乐豆</text>
+		<view class="content">
+			<u-field
+				class="field-item"
+				:value="store.name"
+				disabled
+				input-align="right"
+				label="收取门店"
+			>
+			</u-field>
+			<u-field
+				v-model="remarks"
+				label="备注"
+				input-align="right"
+				auto-height
+				:maxlength="10"
+				placeholder="请填写备注(最多10个字符)"
+			>
+			</u-field>
+			<view class="num-cont">
+				<text class="u-required">支付数量</text>
+				<view class="num-input">
+					<u-input v-model="number" input-align="right" type="number" placeholder="请输入数量" />
+					<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
+				</view>
 			</view>
 		</view>
-		<u-gap height="50" bg-color="#f8f8f8"></u-gap>
 		<view class="pay-btn">
+			<view class="total">
+				<text>{{number||0}}</text>
+				<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
+			</view>
 			<u-button  @click="handlePay" type="error" >确认支付</u-button>
 		</view>
 		 <!-- 确认支付弹窗 -->
@@ -42,7 +45,8 @@
 					<view class="num-text">
 						<text>支付数量:</text>
 						<view>
-							<text class="num-big">{{number}}</text>乐豆
+							<text class="num-big">{{number}}</text>
+							<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
 						</view>
 					</view>
 					<view>
@@ -52,7 +56,6 @@
 				</view>
 				<view class="footer">
 					<input v-model="password" 
-					style="text-align: center;" 
 					type="password" 
 					placeholder="请输入支付密码" 
 					:maxlength="30"
@@ -89,10 +92,13 @@
 				number: '',  // 支付数量
 				showPayModal: false, // 支付弹窗
 				password: '', // 支付密码
-				partnerNo: '' // 销售商编号
+				partnerNo: '', // 销售商编号
+				currentGold: 0 //用户当前拥有乐豆数
 			}
 		},
 		onLoad(opts) {
+			this.currentGold = this.$store.state.vuex_userData.currentGold
+			console.log(this.currentGold,'currentGold')
 			console.log(opts)
 			this.partnerNo = opts.scene
 			// 查询销售商信息
@@ -117,6 +123,13 @@
 						icon: 'none'
 					})
 				} else {
+					if (this.number>this.currentGold) {
+						uni.showToast({
+							title: '您当前余额不足!',
+							icon: 'none'
+						})
+						return false
+					}
 					existPayPwd().then(res => {
 						console.log(res,'rrrrrr')
 						if(res.status == 200) {
@@ -176,22 +189,37 @@
 	.page-content{
 		width: 100%;
 		height: 100%;
-		background-color: #fff;
+		padding: 20upx;
+		background-color: #f8f8f8;
+		.content{
+			background-color: #fff;
+		}
 		.num-cont{
 			width: 100%;
-			padding: 30upx;
+			padding: 16upx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
 			.num-input{
 				display: flex;
 				align-items: center;
 				justify-content: center;
 				>u-input {
 					width: 300upx;
-					border-bottom: 1px solid #f8f8f8;
 				}
 			}
 		}
 		.pay-btn{
 			padding: 0 30upx;
+			.total {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				font-size: 48upx;
+				font-weight: 600;
+				color: red;
+				padding: 60upx 0;
+			}
 		}
 	}
 	.slot-content{
@@ -218,16 +246,25 @@
 					font-size: 36upx;
 					color: red;
 					padding-left: 30upx;
+					font-weight: 600;
 				}
 			}
 			.num-text{
 				align-items: center;
+				>view {
+					display: flex;
+					align-items: center;
+				}
 			}
 			
 		}
 		.footer{
 			width: 80%;
 			border-bottom: 1px solid #b1b1b1;
+			>input {
+				text-align: center;
+				padding: 10upx 0;
+			}
 		}
 		.fot-btn{
 			margin-top: 30upx;

+ 4 - 1
pages/goods/goodsDetail.vue

@@ -103,8 +103,11 @@
 			},
 			// 加入购物车
 			addCart(){
+				let _this = this
 				let item = this.goodContent
-				uni.$emit("addCart",{goodsNo:item.goodsNo,buyQty:this.nums})
+				this.$bindClick(function(){
+					uni.$emit("addCart",{goodsNo:item.goodsNo,buyQty:_this.nums})
+				})
 			},
 			// 立即下单
 			toOrder(){

+ 15 - 46
pages/userCenter/fenlei.vue

@@ -1,5 +1,19 @@
 <template>
-	<web-view :src="baseUrl"></web-view>
+	<view class="zn-container">
+		<u-image width="750rpx" height="2722rpx" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/9a11b2813f3548a19b77d97c1cb0ae8c.jpg"></u-image>
+		<u-image width="750rpx" height="1117rpx" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/8c40db43da34483ba1493daa584e2ff3.jpg"></u-image>
+		<u-image width="750rpx" height="2423" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/da88fdfe54384906a4ba0491dcbfb376.jpg"></u-image>
+		<u-image width="750rpx" height="4259" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/77e0d574d1ef496ba1e5cc72acf927f7.jpg"></u-image>
+		<u-image width="750rpx" height="2824" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/8964ef3f71534ef0b8f9568dedd5ce14.jpg"></u-image>
+		<u-image width="750rpx" height="2526" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/1be83306886a47ebaf2d1bd2ac23ea59.jpg"></u-image>
+		<u-image width="750rpx" height="4336" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/dc07c79759374f45a2b7e180ea837d20.jpg"></u-image>
+		<u-image width="750rpx" height="3591" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/bdd2c38634ad434c8e776870328fe1e1.jpg"></u-image>
+		<u-image width="750rpx" height="4698" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/099d4966e7d8437b84f464e60bc2f375.jpg"></u-image>
+		<u-image width="750rpx" height="2211" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/6327e833ff514966b4a365b9fb40ffb5.jpg"></u-image>
+		<u-image width="750rpx" height="1116" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/1cc4cc47dfdb4d40ac78b997c49f8912.jpg"></u-image>
+		<u-image width="750rpx" height="2841" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/4f896f1078af4f998679bf08a06e5df3.jpg"></u-image>
+		<u-image width="750rpx" height="1884" src="https://chelingzhu.oss-cn-beijing.aliyuncs.com/dev/2020/11/10/58c40a9d9101419fafc4d6a347622ea7.jpg"></u-image>
+	</view>
 </template>
 
 <script>
@@ -10,7 +24,6 @@
 			}
 		},
 		onLoad() {
-			this.baseUrl = getApp().globalData.baseDomain + '/fenlei/index'
 		}
 	}
 </script>
@@ -19,48 +32,4 @@
 	.zn-container{
 		width: 100%;
 	}
-	// page{
-	// 	background: #FFFFFF;
-	// }
-	// .container{
-	// 	font-size: 32rpx;
-	// 	padding:0 50rpx;
-	// 	text-align: center;
-	// 	color:#666;
-	// 	.logoContent{
-	// 		.logoBorder{
-	// 			width:200rpx;
-	// 			height:200rpx;
-	// 			border:2px solid #eee;
-	// 			border-radius: 20rpx;
-	// 			margin:50rpx 0 15rpx 0;
-	// 			display: inline-block;
-	// 			position: relative;
-	// 			.logoImg{
-	// 				width:135rpx;
-	// 				height:180rpx;
-	// 				position: absolute;
-	// 				top:0;
-	// 				left:0;
-	// 				right:0;
-	// 				bottom:0;
-	// 				margin:auto;
-	// 			}
-	// 		}
-	// 	}
-	// 	.textContent{
-	// 		text-align: left;
-	// 		margin-top: 30rpx;
-	// 		font-size: 32rpx;
-	// 		.tetxTitle{
-	// 			margin-bottom: 10rpx;
-	// 			font-size: 32rpx;
-	// 		}
-	// 		> view{
-	// 			padding: 16upx 0;
-	// 			line-height: 50upx;
-	// 			text-indent: 60rpx;
-	// 		}
-	// 	}
-	// }
 </style>

+ 1 - 1
pages/userCenter/userInfo/paymentPwd.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="paymentPwd-container">
 		<text class="pwd-describe">{{nowSetp == 1 ? '请设置6位数字支付密码' : nowSetp == 2 ? '请再次输入密码' : ''}}</text>
-		<view class="sms-item" @tap="showKeyboard=!showKeyboard">
+		<view class="sms-item" @click="showKeyboard=!showKeyboard">
 			<u-message-input mode="bottomLine" :maxlength="6" v-model="value" :dot-fill="true" :disabled-keyboard="true"></u-message-input>
 		</view>
 		<!-- 数字键盘 -->

+ 1 - 1
pages/userCenter/userInfo/smsVerification.vue

@@ -3,7 +3,7 @@
 		<view v-if="sendCode" class="">
 			<view class="sms-title">输入短信验证码</view>
 			<text class="sms-describe">验证码已发送至{{userPhone}},请在下方输入框内输入6位数字验证码</text>
-			<view class="sms-item" @tap="showKeyboard=!showKeyboard">
+			<view class="sms-item" @click="showKeyboard=!showKeyboard">
 				<u-message-input mode="bottomLine" :maxlength="6" v-model="value" :disabled-keyboard="true"></u-message-input>
 			</view>
 			<view class="sendcode-con">

+ 2 - 1
store/index.js

@@ -117,7 +117,8 @@ const store = new Vuex.Store({
 		vuex_kfMobile: '4008826012',
 		// 垃圾箱类型
 		vuex_rubbishType: [],
-		vuex_noLogin: false
+		vuex_noLogin: false,
+		vuex_isClick: false
 	},
 	mutations: {
 		$uStore(state, payload) {