chenrui il y a 4 ans
Parent
commit
9df140c0ca

+ 5 - 5
src/components/OrderCard.vue

@@ -10,16 +10,16 @@
     </div>
     <div class="content">
       <div class="product-img" @click="toDetail()">
-        <img class="img" :src="options.bundle.icon2" alt="">
+        <img class="img" :src="options.bundle ? options.bundle.icon2 : '/static/img/ic_shop_title_06.png'" alt="">
       </div>
       <div class="product-info">
         <div @click="toDetail()">
           <div class="title">{{options.bundleName}}</div>
-          <div class="desc">{{options.bundle.tag}}</div>
+          <div class="desc">{{options.bundle ? options.bundle.tag : ''}}</div>
         </div>
         <div>
           <div class="price">
-            ¥{{options.totalAmount}}
+              ¥{{options.totalAmount}}
           </div>
           <div class="btn-control" v-if="options.orderFlag === 'UNPA'">
             <van-button class="btn" size="small" @click="cancelHandler()">取消订单</van-button>
@@ -187,10 +187,10 @@ export default {
   .content {
     display: flex;
     width: 100%;
-    height: 250rpx;
+    height: 230rpx;
 
     .product-img {
-      width: 35%;
+      width: 30%;
       border-radius : 0.5em;
       overflow: hidden;
       border: 1px solid #f8f8f8;

+ 2 - 2
src/pages/index/index.vue

@@ -176,10 +176,10 @@ export default {
         menus: ['shareAppMessage', 'shareTimeline']
     });
   },
-  onShareAppMessage(res) {
+  onShareAppMessage(res) {  //  用户点击右上角转发
     console.log(res)
   },
-  onShareTimeline(res) {
+  onShareTimeline(res) {  //  用户点击右上角转发到朋友圈
     console.log(res)
   }
 };

+ 4 - 0
src/pages/login/index.vue

@@ -97,6 +97,10 @@ export default {
     if (path) {
       this.path = decodeURIComponent(path);
     }
+  },
+  onUnload() {
+    //  避免从登录页返回到个人中心页(能跳转登录页则是未登录的,不应看到个人中心信息)
+    this.gotoHome()
   }
 };
 </script>

+ 35 - 14
src/pages/orderDetail/index.vue

@@ -7,18 +7,21 @@
       </div>
       <div class="content">
         <div class="product-img" @click="toDetail">
-          <img class="img" :src="bundle.icon2" alt="">
+          <img v-if="bundle.icon2" class="img" :src="bundle.icon2" alt="">
+          <div v-else class="center-con">
+            <img class="img" src="/static/img/ic_shop_title_06.png" alt="">
+          </div>
         </div>
         <div class="product-info">
           <div @click="toDetail">
-            <div class="title">{{bundle.name}}</div>
-            <div class="desc">{{bundle.tag}}</div>
+            <div class="title">{{detailData ? detailData.bundleName : ''}}</div>
+            <div class="desc">{{bundle.tag ? bundle.tag : ''}}</div>
           </div>
-          <div>
+          <!-- <div>
             <div class="price">
-              ¥{{bundle.price}}
+              ¥{{bundle.price ? bundle.price : 0}}
             </div>
-          </div>
+          </div> -->
         </div>
       </div>
       <div class="package-info" v-if="orderBundle.orderFlag === 'PAED'">
@@ -26,7 +29,7 @@
           <!-- <form @submit="formSubmit" class="formId"  report-submit="true">
             <button form-type="submit"></button>
           </form> -->
-          <van-cell :title="item.itemName" :label="expiryDate?'过期时间:'+expiryDate:''" v-for="item in customerBundleItemList" :key="item.id" :id='item.id' is-link @click="subscribeMessage">
+          <van-cell :title="item.itemName" :label="item.expiryDate?'过期时间:'+item.expiryDate:''" v-for="item in customerBundleItemList" :key="item.id" :id='item.id' is-link @click="subscribeMessage">
             <div class="package-qr">
               <span>剩余{{item.remainTimes}}次</span>
               <van-icon class="icon-qr" size="1.5em" name="qr" color="#ff5500" />
@@ -89,18 +92,22 @@ import { subscribePayMessage, subscribeHxMessage } from '@/utils/index.js';
 export default {
   components: {},
   name: 'package',
-
   data() {
     return {
       payLoading: false,
       finished: false,
       showQRcodePopup: false,
-      bundle: {},
+      bundle: {
+        icon2: null,
+        name: '',
+        tag: null,
+        price: 0
+      },
       coupon: undefined,
       orderBundle: {},
       customerBundleItemList: [],
       formId:null,
-      expiryDate: null
+      detailData: null
     };
   },
   computed: {
@@ -193,11 +200,11 @@ export default {
       const _this = this;
       orderDetail({ id: id}).then(res => {
         if (res.status === '200') {
-          _this.bundle = res.data.bundle;
+          _this.detailData = res.data || null
+          _this.bundle = res.data.bundle || {icon2: null, name: '', tag: null, price: 0};
           _this.coupon = res.data.coupon;
           _this.orderBundle = res.data.orderBundle;
           _this.customerBundleItemList = res.data.customerBundleItemList;
-          _this.expiryDate = res.data.expiryDate ? res.data.expiryDate.substr(0,10) : null
         } else {
           wx.showToast({
             title: res.message,
@@ -262,7 +269,6 @@ export default {
 	  })
     }
   },
-
   onShow() {
     wx.showLoading({
       mask: true,
@@ -275,10 +281,16 @@ export default {
     wx.hideLoading();
     this.finished = false;
     this.showQRcodePopup = false;
-    this.bundle = {};
+    this.bundle = {
+      icon2: null,
+      name: '',
+      tag: null,
+      price: 0
+    };
     this.coupon = undefined;
     this.orderBundle = {};
     this.customerBundleItemList = [];
+    this.detailData = null
   }
 };
 </script>
@@ -334,6 +346,15 @@ export default {
         width: 100%;
         height: 100%;
       }
+      .center-con{
+        text-align: center;
+        height: 100%;
+        img{
+          display: inline-block;
+          width: 204rpx;
+          height: 100%;
+        }
+      }
     }
 
     .product-info {

BIN
static/img/ic_shop_title_06.png


BIN
static/img/noData.jpg