洪海涛 8 роки тому
батько
коміт
6a99c707f2

+ 1 - 2
www/vue/.eslintrc.js

@@ -29,7 +29,6 @@ module.exports = {
     // allow async-await
     'generator-star-spacing': 0,
     // allow debugger during development
-    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
-    "space-before-function-paren": [0, "never"]
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
   }
 }

+ 5 - 6
www/vue/src/components/placeOrder.vue

@@ -38,7 +38,7 @@
 			</div>
 			<!--优惠券-->
 			<group>
-				<cell class="address" title="优惠券" :value="couponName" isLink @click="selectCoupon()"></cell>
+				<cell class="address" title="优惠券" :value="couponName" isLink @click.native="selectCoupon()"></cell>
 			</group>
 			<!--备注-->
 			<group>
@@ -93,7 +93,7 @@
         showAlert: false, // 是否显示弹出框
         alertTitle: '', // 弹窗标题
         alertContent: '', // 弹窗内容
-        couponName: '暂无优惠券',  //  优惠券名称
+        couponName: '请选择优惠券',  //  优惠券名称
         couponValue: 0,  //  优惠券名称
         CouponProduct: {},
         agreement: true // 壹管家用户服务协议
@@ -188,9 +188,7 @@
         }
       },
       selectCoupon () {
-        if (this.products) {
-
-        }
+        this.$router.push({path: '/selectCoupon', query: {bookingTime: this.bookingTime, orderPrice: this.orderPrice}})
       },
       change (val) {
         this.$store.state.order.time = val
@@ -322,7 +320,8 @@
       }
     }
   }
-  function payCharge(price, count, couponValue) {
+  // 价格计算
+  function payCharge (price, count, couponValue) {
     let p = ''
     p = price * count - couponValue
     return p

+ 11 - 3
www/vue/src/components/selectCoupon.vue

@@ -51,7 +51,6 @@
     },
     created () {
       this.getUserCoupon()
-//      console.log(this.usedCoupons)
     },
     watch: {
       usedCoupons: function (val, oldVal) {
@@ -61,16 +60,25 @@
     },
     methods: {
       getUserCoupon () {
+        console.log(this.$route.query)
+        /*
+         products: pushData.products, //产品
+         booking_time: pushData.time, //预订时间
+         user_id: user.id, //用户id
+         type: pushData.type, //资源
+         extra:  pushData.extraJson
+        * */
         axios.get('o2o/order/usableCoupon&get_all=1&user_id=' + config.userId).then(res => {
           if (res.data.success) {
-//            console.log(res.data.data)
             this.usedCoupons = res.data.data.used_coupons
+            console.log(this.usedCoupons)
           }
         })
       },
       selectCoupon (coupon) {
         config.orderInfo.coupons = coupon
-        this.$router.go(-1)
+//        this.$router.go(-1)
+        this.$router.push({path: '/placeOrder'})
       },
       flush () {
         this.showScrollBox = false

+ 1 - 0
www/vue/src/main.js

@@ -61,6 +61,7 @@ Vue.component('swiper', require('./components/swiper')) // 轮播图
 Vue.component('navTitle', require('./components/navTitle')) // SAP顶部标题
 Vue.component('order', require('./components/order')) // 我的订单
 Vue.component('myCoupon', require('./components/myCoupon')) // 我的代金券
+Vue.component('selectCoupon', require('./components/selectCoupon')) // 我的代金券
 Vue.component('recharge', require('./components/recharge')) // 充值
 Vue.component('activityText', require('./components/activityText')) // 充值协议
 // 公司形象

+ 2 - 1
www/vue/src/router/index.js

@@ -20,5 +20,6 @@ export default[
   {path: '/about', name: 'about', component: require('../components/about.vue')},
   {path: '/activityText', name: 'activityText', component: require('../components/activityText.vue')},
   {path: '/pay', name: 'pay', component: require('../components/pay.vue')},
-  {path: '/agreement', name: 'agreementpay', component: require('../components/agreement.vue')}
+  {path: '/agreement', name: 'agreementpay', component: require('../components/agreement.vue')},
+  {path: '/selectCoupon', name: 'selectCoupon', component: require('../components/selectCoupon.vue')}
 ]