Browse Source

分类指南

lilei 4 years ago
parent
commit
fb99e9b889
4 changed files with 30 additions and 33 deletions
  1. 6 3
      App.vue
  2. 12 27
      components/uni-number-box/uni-number-box.vue
  3. 1 1
      pages/cart/cart.vue
  4. 11 2
      pages/userCenter/fenlei.vue

+ 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 {

+ 1 - 1
pages/cart/cart.vue

@@ -58,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>

+ 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">