Forráskód Böngészése

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

chenrui 4 éve
szülő
commit
7ff1e9977f

+ 6 - 3
App.vue

@@ -1,7 +1,9 @@
 <script>
-	// const uat_URL = 'https://lese.test.sxzxyj.net/gc-shop/' // 预发布
-	const uat_URL = 'http://192.168.16.104:8302/gc-shop/' // 本地
-	const pro_URL = 'https://lese.sxzxyj.net/gc-shop/'  // 生产
+	const uat_domain = 'https://lese.test.sxzxyj.net' // 预发布
+	// const uat_domain = 'http://192.168.16.104:8302' // 本地
+	const pro_domain = 'https://lese.sxzxyj.net' // 生产
+	const uat_URL = uat_domain+'/gc-shop/' // 预发布
+	const pro_URL = pro_domain+'/gc-shop/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
 	const envText = ['预发布环境','生产环境']
@@ -9,6 +11,7 @@
 	console.log(process.env.NODE_ENV)
 	export default {
 		globalData: {  
+			baseDomain: process.env.NODE_ENV == 'development' ? uat_domain : pro_domain,
 			baseUrl: process.env.NODE_ENV == 'development' ? uat_URL : buildURL,
 			token: '',
 			version: '', // 当前版本号

+ 12 - 27
components/uni-number-box/uni-number-box.vue

@@ -40,10 +40,15 @@
 			};
 		},
 		watch: {
-			value(val) {
-				this.inputValue = +val;
+			value(newVal,oldVal) {
+				console.log(newVal,oldVal,'000')
+				this.inputValue = +newVal;
+				if (+newVal !== +oldVal) {
+					this.$emit("change", newVal);
+				}
 			},
 			inputValue(newVal, oldVal) {
+				console.log(newVal,oldVal,'111')
 				if (+newVal !== +oldVal) {
 					// this.$emit("change", newVal);
 				}
@@ -80,7 +85,6 @@
 
 				this.inputValue = String(value / scale);
 				this.$emit('input',this.inputValue)
-				this.$emit("change", this.inputValue);
 			},
 			_getDecimalScale() {
 				let scale = 1;
@@ -104,8 +108,7 @@
 				}
 				this.inputValue = value;
 				this.$emit('input',this.inputValue)
-				this.$emit("change", this.inputValue);
-			}
+			},
 		}
 	};
 </script>
@@ -122,22 +125,16 @@
 		display: flex;
 		/* #endif */
 		flex-direction: row;
-		height: $box-height;
-		line-height: $box-height;
 		width: 120px;
 	}
 
 	.uni-numbox__value {
 		background-color: $uni-bg-color;
 		width: 40px;
-		height: 32px;
+		height: $box-height;
+		line-height: $box-height;
 		text-align: center;
 		font-size: $uni-font-size-lg;
-		border-width: 1rpx;
-		border-style: solid;
-		border-color: $uni-border-color;
-		border-left-width: 0;
-		border-right-width: 0;
 	}
 
 	.uni-numbox__minus {
@@ -149,17 +146,10 @@
 		justify-content: center;
 		width: $box-width;
 		height: $box-height;
-		// line-height: $box-line-height;
-		// text-align: center;
+		line-height: $box-height;
 		font-size: 20px;
 		color: $uni-text-color;
 		background-color: $uni-bg-color-grey;
-		border-width: 1rpx;
-		border-style: solid;
-		border-color: $uni-border-color;
-		border-top-left-radius: $uni-border-radius-base;
-		border-bottom-left-radius: $uni-border-radius-base;
-		border-right-width: 0;
 	}
 
 	.uni-numbox__plus {
@@ -171,13 +161,8 @@
 		justify-content: center;
 		width: $box-width;
 		height: $box-height;
-		border-width: 1rpx;
-		border-style: solid;
-		border-color: $uni-border-color;
-		border-top-right-radius: $uni-border-radius-base;
-		border-bottom-right-radius: $uni-border-radius-base;
+		line-height: $box-height;
 		background-color: $uni-bg-color-grey;
-		border-left-width: 0;
 	}
 
 	.uni-numbox--text {

+ 5 - 2
pages/cart/cart.vue

@@ -44,7 +44,10 @@
 						</view>
 						<view class="goods-info">
 							<view class="goods-imgs">
-								<view v-if="good.goods.inventoryQty==0" class="goods-staus">已售罄</view>
+								<view v-if="good.goods.inventoryQty==0||good.goods.state == 0" class="goods-staus">
+									<text v-if="good.goods.inventoryQty==0">已售罄</text>
+									<text v-if="good.goods.state == 0">已下架</text>
+								</view>
 								<u-image border-radius="12" width="158rpx" height="140rpx" :src="good.goods.homeImage"></u-image>
 							</view>
 							<view class="goods-text">
@@ -55,7 +58,7 @@
 										<u-image mode="scaleToFill" width="30rpx" height="30rpx" src="/static/ledou.png"></u-image>
 									</view>
 									<view v-if="good.goods.inventoryQty>0">
-										<!-- <u-number-box @change="goodsNumsChange(good)" :min="1" v-model="good.buyQty"></u-number-box> -->
+										<!-- <u-number-box @change="goodsNumsChange(good,cindex)" :index="index+'-'+cindex" :min="1" v-model="good.buyQty"></u-number-box> -->
 										<uni-number-box @change="goodsNumsChange(good,cindex)" v-model="good.buyQty" :min="1"></uni-number-box>
 									</view>
 								</view>

+ 1 - 1
pages/goods/goodsDetail.vue

@@ -44,7 +44,7 @@
 			</view>
 		</view>
 		<!-- 底部浮动按钮 -->
-		<view class="bottom-btns" v-if="goodContent">
+		<view class="bottom-btns" v-if="goodContent&&goodContent.inventoryQty > 0&&goodContent.state==1">
 			<view><u-button :custom-style="addCartButton" type="warning" @click="addCart">加入购物车</u-button></view>
 			<view><u-button :custom-style="toOrderButton" type="error" @click="toOrder()">立即下单</u-button></view>
 		</view>

+ 31 - 25
pages/toOrder/editAddress.vue

@@ -38,31 +38,6 @@
 				receiveAreas: '', //地址编码
 				areaName: '', //地址
 				rules: {
-					receiverName: [
-						{ 
-							required: true, 
-							message: '请输入姓名', 
-							// 可以单个或者同时写两个触发验证方式 
-							trigger: ['change','blur'],
-						}
-					],
-					receiverPhone: [
-						{ 
-							required: true, 
-							message: '请输入电话', 
-							// 可以单个或者同时写两个触发验证方式 
-							trigger: ['change','blur'],
-						}
-					],
-					receiveAreasName: [
-						{
-							required: true, 
-							message: '请选择省市区', 
-							trigger: ['change','blur']
-						}
-					],
-					receiveAddress: [
-					]
 				}
 			};
 		},
@@ -81,11 +56,42 @@
 				})
 			}
 		},
+		onUnload() {
+			this.$u.vuex("vuex_OrderAddress",{})
+		},
 		methods: {
 			submit() {
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
 						console.log('验证通过');
+						if (this.form.receiverName ==='') {
+							uni.showToast({
+								title: '请输入姓名',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.receiverPhone ==='') {
+							uni.showToast({
+								title: '请输入电话',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.receiveAreasName ==='') {
+							uni.showToast({
+								title: '请选择省市区',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.receiveAddress ==='') {
+							uni.showToast({
+								title: '请输入详细地址',
+								icon: 'none'
+							})
+							return false
+						}
 						let params = {
 							receiverName: this.form.receiverName,
 							receiverPhone: this.form.receiverPhone,

+ 11 - 2
pages/userCenter/fenlei.vue

@@ -1,9 +1,18 @@
 <template>
-	<view class="zn-container">
-	</view>
+	<web-view :src="baseUrl"></web-view>
 </template>
 
 <script>
+	export default{
+		data() {
+			return {
+				baseUrl: ''
+			}
+		},
+		onLoad() {
+			this.baseUrl = getApp().globalData.baseDomain + '/fenlei/index'
+		}
+	}
 </script>
 
 <style lang="less">

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

@@ -44,7 +44,7 @@
 				 findAddressBycustomerNo({}).then(res => {
 					 console.log(res)
 					 if (res.status == 200&&res.data.length) {
-						 this.address = res.data[0].receiveAddress
+						 this.address = res.data[0].receiveAreasName
 						 this.userInfo = res.data[0]
 					 } else {
 						 this.address = ''