Parcourir la source

零售 解决
如果 take = 2 优惠券不可用

使用优惠券后 前面页面关掉

选择优惠券之后会抖动一下

采购下单时时左下角瞬间值会变掉

优惠金额 采购详情页 如果优惠金额 > 0 时,此栏显示出来,并且使用负数表示 如 -10

采购页 需要下拉刷新,以后做的页面都需要下拉刷新,后面不会再重复讲

采购下单页,因为供货商的地址太长,白色区域不够

SHOP_ADMIN_STROAGE_SHOW 用法

wangn il y a 5 ans
Parent
commit
28a63dd924

+ 8 - 5
hdApp/src/admin/billing/affirmGhs.vue

@@ -99,9 +99,10 @@
 			margin-bottom: 20px;
 			border-radius: 10px;
 			overflow: hidden;
+      padding-top: 20rpx;
 			.ghs-msg{
-				padding: 0 20rpx;
-					height: 60rpx;
+				padding: 0 20rpx 20rpx;
+					// height: 60rpx;
 				font-size: 28rpx;
 				&.active{
 					color: #868686;
@@ -238,7 +239,7 @@
 						<!-- <appSendTime :placeholder="'默认30分钟后配送'" @alterTime="purchaseFreight(ghsMsg)" :sendDate.sync="form.sendDate" :sendTime.sync="sendTime" ></appSendTime> -->
             <appTimer :placeholder="'默认30分钟后配送'" @confirm="onConfirm" :sendTime="sendTime"></appTimer>
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1">
-						<view class="tui-title ">运费</view>
+						<view class="tui-title ">运费{{form.sendType}}</view>
 						<input type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder" disabled>
 					</tui-list-cell>
           <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="toCoupon">
@@ -478,11 +479,13 @@ export default {
 				content: '确认提交?',
 				success: function (res) {
 					if (res.confirm) {
-            uni.removeStorageSync('selectCouponInfo')
 						createOrder(parameter).then(res => {
-							self.resetSelectInfoByType(self.pageType);
 							const {data: { orderSn,actPrice }} = res;
 							self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&actPrice=${actPrice}`, type: 2})
+              setTimeout(() => {
+                uni.removeStorageSync('selectCouponInfo')
+                self.resetSelectInfoByType(self.pageType);
+              }, 600)
 						});
 					}
 				}

+ 1 - 1
hdApp/src/admin/coupon/couponList.vue

@@ -125,7 +125,7 @@ export default {
 		},
 		// 去使用
 		goUserFn() {
-			this.$util.pageTo('/pagesPurchase/order')
+			this.$util.pageTo({url: '/pagesPurchase/order', type: 2})
 		}
 	}
 }

+ 52 - 47
hdApp/src/admin/coupon/selectCouponList.vue

@@ -1,46 +1,45 @@
 <template>
-  <div class="coupon-sel">
-    <block>
-        <div class="coupon-wrap">
-          <div
-            class="coupon-list"
-            v-for="(item, index) in usableList"
-            :key="index"
-            @click="couponChange(item, index + 1)"
-          >
-            <div class="list-img">
-              <template v-if="couponSelInx && couponSelInx == (index + 1)">
-                <img :src="`${constant.imgUrl}/retail/coupon/is-check.png`" alt mode="widthFix" />
-              </template>
-              <template v-else>
-                <img :src="`${constant.imgUrl}/retail/coupon/no-check.png`" alt mode="widthFix" />
-              </template>
+  <scroll-view class="coupon-sel" scroll-y>
+    <div class="coupon-wrap">
+      <div
+        class="coupon-list"
+        v-for="(item, index) in usableList"
+        :key="index"
+        @click="couponChange(item, index + 1)"
+      >
+        <!-- <div class="list-img">
+          <template v-if="couponSelInx && couponSelInx == (index + 1)">
+            <img :src="`${constant.imgUrl}/retail/coupon/is-check.png`" alt mode="widthFix" class="bg_img" />
+          </template>
+          <template v-else>
+            <img :src="`${constant.imgUrl}/retail/coupon/no-check.png`" alt mode="widthFix" class="bg_img" />
+          </template>
+        </div> -->
+        <div class="list-det">
+          <img :src="couponSelInx && couponSelInx == (index + 1) ? `${constant.imgUrl}/retail/coupon/is-check.png` : `${constant.imgUrl}/retail/coupon/no-check.png`" alt mode="widthFix" class="bg_img" />
+          <div class="list-det-left">
+            <div class="price-wrap">
+              <span>¥</span>
+              <span class="price">{{ item.amount }}</span>
             </div>
-            <div class="list-det">
-              <div class="list-det-left">
-                <div class="price-wrap">
-                  <span>¥</span>
-                  <span class="price">{{ item.amount }}</span>
-                </div>
-                <div class="full-reduc app-size-28">满{{ item.miniCost }}可使用</div>
-              </div>
-              <div class="list-det-right">
-                <div class="coupon-message">
-                  <div class="app-color-2">优惠券</div>
-                  <div>适用:全品类</div>
-                  <div>有效至:{{ item.endTime.substr(0, 10) }}</div>
-                </div>
-              </div>
+            <div class="full-reduc app-size-28">满{{ item.miniCost }}可使用</div>
+          </div>
+          <div class="list-det-right">
+            <div class="coupon-message">
+              <div class="app-color-2">优惠券</div>
+              <div>适用:全品类</div>
+              <div>有效至:{{ item.endTime.substr(0, 10) }}</div>
             </div>
           </div>
-          <selectCouponItem v-for="(item, index) in unusableList" :key="index" :item="item"></selectCouponItem>
         </div>
-      <view class="footer_bar">
-        <text>已优惠¥{{couponSum}}</text>
-        <button class="admin-button-com middle blue" @click="ConfirmReachFn">确认</button>
-      </view>
-    </block>
-  </div>
+      </div>
+      <selectCouponItem v-for="(item, index) in unusableList" :key="index" :item="item"></selectCouponItem>
+    </div>
+  <view class="footer_bar">
+    <text>已优惠¥{{couponSum}}</text>
+    <button class="admin-button-com middle blue" @click="ConfirmReachFn">确认</button>
+  </view>
+  </scroll-view>
 </template>
 
 <script>
@@ -65,10 +64,10 @@ export default {
   computed: {
     ...mapGetters({ shopUser: "getShopUser" }),
     usableList() {
-      return this.list.filter(item => {return Number(item.miniCost) <= Number(this.option.price)})
+      return this.list.filter(item => {return Number(item.miniCost) <= Number(this.option.price) && item.take != 2})
     },
     unusableList() {
-      return this.list.filter(item => {return Number(item.miniCost) > Number(this.option.price)})
+      return this.list.filter(item => {return Number(item.miniCost) > Number(this.option.price) || item.take == 2})
     }
   },
   mounted() {},
@@ -142,15 +141,19 @@ export default {
 .coupon-wrap {
   margin: 0 20upx;
   padding-top: 20px;
-  .coupon-list {
-    position: relative;
-    margin-bottom: 6px;
     .list-det {
       width: 100%;
       @include disFlex(center, space-between);
-      position: absolute;
-      top: 0;
-      left: 0;
+      position: relative;
+      margin-bottom: 30upx;
+      &>.bg_img{
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 94upx;
+        z-index: -1;
+      }
       .list-det-left {
         padding: 20px 0 20px 36px;
         width: 210px;
@@ -178,7 +181,6 @@ export default {
         }
       }
     }
-  }
 }
 .footer_bar{
     width: 100%;
@@ -199,6 +201,9 @@ export default {
       width: 120upx;
     }
 }
+.bg_img{
+  height: 94upx;
+}
 // 修改uni-app组件
 /deep/.uni-radio-input-checked {
   background-color: $mainColor !important;

+ 17 - 3
hdApp/src/pagesPurchase/purDetails.vue

@@ -126,6 +126,14 @@
             <div class="tui-title">运费</div>
             <div class="detail-price_box">¥{{ detailInfo.sendCost }}</div>
           </tui-list-cell>
+          <tui-list-cell
+            class="line-cell"
+            :hover="false"
+            v-if="Number(detailInfo.discountAmount) > 0"
+          >
+            <div class="tui-title">优惠金额</div>
+            <div class="detail-price_box">-¥{{ detailInfo.discountAmount }}</div>
+          </tui-list-cell>
           <tui-list-cell
             class="line-cell"
             :hover="false"
@@ -189,6 +197,11 @@ export default {
   onShow () {
 
   },
+  onPullDownRefresh() {
+			this.initData().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		},
   methods: {
     copy (val) {
       const self = this;
@@ -208,9 +221,10 @@ export default {
       this.initData()
     },
     async initData () {
-      const { data } = await purchaseDetail({ id: this.option.id });
-      console.log('data==>', data)
-      this.detailInfo = data;
+      return purchaseDetail({ id: this.option.id }).then(res => {
+        this.detailInfo = res.data;
+      })
+      
     },
     // 修改花材
     editFlr () {