Browse Source

扫码付款优化部分

fuwei 6 years ago
parent
commit
dd86e052c4

+ 4 - 3
mall/package.json

@@ -59,10 +59,11 @@
     "cross-env": "^7.0.0",
     "cross-env": "^7.0.0",
     "mini-types": "*",
     "mini-types": "*",
     "miniprogram-api-typings": "^2.8.0-2",
     "miniprogram-api-typings": "^2.8.0-2",
-    "postcss-comment": "^2.0.0",
-    "vue-template-compiler": "^2.6.10",
     "moment": "^2.24.0",
     "moment": "^2.24.0",
-    "qs": "^6.8.0"
+    "postcss-comment": "^2.0.0",
+    "qs": "^6.8.0",
+    "sass-loader": "^8.0.2",
+    "vue-template-compiler": "^2.6.10"
   },
   },
   "browserslist": [
   "browserslist": [
     "Android >= 4",
     "Android >= 4",

+ 9 - 1
mall/src/components/app-area-sel.vue

@@ -8,7 +8,11 @@
 				</div>
 				</div>
 				<!-- 搜索 -->
 				<!-- 搜索 -->
 				<div class="map-search">
 				<div class="map-search">
-					<app-search-module ref="aaaaa" placeholder="请输入你的收货地址" :focus="true" @input="searchFn" />
+					<app-search-module 
+						ref="aaaaa" 
+						placeholder="请输入你的收货地址" 
+						:focus="isFocus" 
+						@input="searchFn" />
 				</div>
 				</div>
 				<!-- 地图 -->
 				<!-- 地图 -->
 				<!-- <div class="map-box">
 				<!-- <div class="map-box">
@@ -57,6 +61,10 @@
 			city: {
 			city: {
 				type: String,
 				type: String,
 				default: ''
 				default: ''
+			},
+			isFocus:{
+				type: Boolean,
+				default: true
 			}
 			}
 		},
 		},
 		data() {
 		data() {

+ 5 - 1
mall/src/components/app-delivery.vue

@@ -183,7 +183,11 @@
       @onConfirm="onCityConfirm"
       @onConfirm="onCityConfirm"
     ></simple-address>
     ></simple-address>
     <!-- 选择地区 -->
     <!-- 选择地区 -->
-    <app-area-sel :show.sync="showRegion" :city="form.receiveCity" @change="changeAreaFn" />
+    <app-area-sel
+      :isFocus="false"
+      :show.sync="showRegion" 
+      :city="form.receiveCity" 
+      @change="changeAreaFn" />
   </div>
   </div>
 </template>
 </template>
 
 

+ 11 - 4
mall/src/pages/order/detail.vue

@@ -86,7 +86,10 @@
 				<div class="module-com coupon-wrap" v-if="!$util.isEmpty(discountArr)">
 				<div class="module-com coupon-wrap" v-if="!$util.isEmpty(discountArr)">
 					<div class="module-tit">优惠信息</div>
 					<div class="module-tit">优惠信息</div>
 					<div class="module-det">
 					<div class="module-det">
-						<app-coupon-sel ref="couponSel" :price="data.prePrice * data.goodsNum" :discountArr="['member', 'coupon']" />
+						<app-coupon-sel 
+							ref="couponSel" 
+							:price="data.prePrice * data.goodsNum" 
+							:discountArr="['member', 'coupon']" />
 					</div>
 					</div>
 				</div>
 				</div>
 			</block>
 			</block>
@@ -160,12 +163,16 @@
 		},
 		},
 		methods: {
 		methods: {
 			init() {
 			init() {
-				this._getDet()
-				getShopUser().then(res => {
-					this.$refs.couponSel._getUserDiscount().then(status => {
+				this._getDet().then(()=>{
+					getShopUser().then(res => {
+					console.log(this.$refs)
+					this.$refs.couponSel._getUserDiscount()
+						.then(status => {
 						this.discountArr = status
 						this.discountArr = status
 					})
 					})
 				})
 				})
+				})
+				
 			},
 			},
 			_getDet() {
 			_getDet() {
 				let form = {}
 				let form = {}

+ 1 - 1
mall/src/pages/pay/components/pay-input.vue

@@ -6,7 +6,7 @@
 				<span class="money-text">¥</span>
 				<span class="money-text">¥</span>
 				<span type="text" class="cashier-text" v-if="val || focus">{{ val }}</span>
 				<span type="text" class="cashier-text" v-if="val || focus">{{ val }}</span>
                 <span class="cashier-text prompt" v-else>请输入金额</span>
                 <span class="cashier-text prompt" v-else>请输入金额</span>
-				<i class="cursor" v-show="focus"></i>
+				<i class="cursor" v-if="focus"></i>
 			</div>
 			</div>
 		</div>
 		</div>
 		<keyboard-module :show="keyShow" @comfirm="hideKeyFn" @clickKey="clickKeyFn" @del="delFn" />
 		<keyboard-module :show="keyShow" @comfirm="hideKeyFn" @clickKey="clickKeyFn" @del="delFn" />

+ 7 - 1
mall/src/pages/pay/index.vue

@@ -23,7 +23,10 @@
         </div>
         </div>
       </div>
       </div>
       <!-- 查看更多 -->
       <!-- 查看更多 -->
-      <div class="view-more" :class="{'open' : tabIndex == 1}" @click="changeDelivery">
+      <div 
+        class="view-more" 
+        :class="{'open' : tabIndex == 1}" 
+        @click="changeDelivery">
         <div class="view-more-text">{{ tabIndex == 0 ? '帮我送' : '收起' }}</div>
         <div class="view-more-text">{{ tabIndex == 0 ? '帮我送' : '收起' }}</div>
         <i class="iconfont iconjiantouxia"></i>
         <i class="iconfont iconjiantouxia"></i>
       </div>
       </div>
@@ -357,6 +360,9 @@ export default {
     },
     },
     changeDelivery() {
     changeDelivery() {
       this.tabIndex = this.tabIndex == 0 ? 1 : 0;
       this.tabIndex = this.tabIndex == 0 ? 1 : 0;
+      if(this.tabIndex === 1) {
+         this.inpFocus = false;
+      }
     }
     }
   }
   }
 };
 };