Exemple #1
0
Mock.mock(/\/renew-mbrcard\/init-data\/\d+$/, ({url}) => {
  const mbrCardId = pathToRegexp('/renew-mbrcard/init-data/:mbrCardId').exec(url)[1]
  const isValueCard = Random.boolean()
  return {
    mbrCard: {
      mbrCardId,
      cardName: Random.cword(5, 10),
      cardDiscount: Random.natural(1, 10),
      cardTypeId: Random.pick('1001', '1002', '1003', '1004'),
      cardTypeName: Random.pick('次卡', '年卡', '私教卡', '储值卡'),
      cardPrice: Random.float(100, 1000, 0, 2),
      isValueCard,
      cardTimes: Random.pick(Random.natural(10, 100), Random.natural(1, 100)),
      cardLimit: isValueCard ? '' : Random.pick('', '无限次', '5次/月', '10次/周'),
      cardStyle: Random.integer(-1, 5),
      availTimes: Random.natural(1, 100),
      cardNo: randomId(),
      cardExpiredRange: Random.boolean() ? [Random.date(), Random.date()] : undefined,
      state: true
    },
    extendEndDate: Random.pick('无限期', Random.date()),
    cashVoucher: {
      voucherInstId: randomId(),
      voucherValue: Random.float(0, 500, 0, 2)
    }
  }
})
Exemple #2
0
mock(/\/cash-coupon\/query-can-use-coupons/, () => randomArr(10, 1).map(() => mock({
  voucherId: randomId(),
  voucherInstId: randomId(),
  voucherName: '@ctitle',
  voucherValue: '@float(0.01, 1000, 0, 2)',
  voucherExpiredType: true,
  voucherExpiredRange: ['@date', '@date'],
  miniConsume: '@float(0.01, 1000, 0, 2)'
})))
Exemple #3
0
 'uselessMbrCards': randomArr(0).map((index) => {
   return {
     'mbrCardId': randomId(),
     'cardNo': Random.integer(9),
     'isValueCard': Random.natural(0, 1),
     'memberId': '',
     'cardTypeId': '1004',
     'cardId': randomId(),
     'effective': '2017-01-06 00:00:00.0',
     'expired': '2017.02.06',
     'expiredValue': 1,
     'expiredUnit': 'Y',
     'times': 100,
     'price': 0,
     'state': '1',
     'remark': '',
     'orgCardId': '',
     'forbidden': '',
     'transfered': '',
     'visible': '',
     'availTimes': Random.natural(2, 10),
     'memberName': '',
     'cardName': Random.cword(2, 7),
     'payState': '',
     'realFee': '',
     'orgFee': '',
     'startTime': '2017.01.06',
     'endTime': Random.date('yyyy.MM.dd'),
     'orderId': '',
     'cardState': '',
     'channel': '',
     'goodsId': '',
     'activityId': '',
     'couponId': '',
     'usable': 1,
     'limitTimes': 0,
     'activationWay': '',
     'isLast': 0,
     'discount': 8.8,
     'deductTimes': 2,
     'selected': false,
     'yearUnit': false,
     'enoughAvailTimes': true,
     'enoughTimes': true,
     'personalCard': false,
     'inactiveState': false,
     'activeState': true,
     'yearCard': false,
     'meterCard': true,
     'monthUnit': true,
     'infiniteUnit': false,
     'isApply': Random.boolean(),
     'hasSurplus': Random.boolean(),
     'isApplyPeriod ': Random.boolean()
   }
 }
Exemple #4
0
 'usefulMbrExpVoucher': randomArr(10, 20).map(() => {
   return {
     'expvoucherInstId': randomId(),
     'expvoucherId': randomId(),
     'availableTimes': '100',
     'vestigialTimes': Random.natural(1, 3),
     'endTime': Random.date('yyyy.MM.dd'),
     'expvoucherName': Random.cword(2, 10)
   }
 }),
Exemple #5
0
 'uselessMbrExpVoucher': randomArr(1, 4).map(() => {
   return {
     'expvoucherInstId': randomId(),
     'expvoucherId': randomId(),
     'availableTimes': '100',
     'vestigialTimes': Random.natural(1, 3),
     'endTime': Random.date('yyyy.MM.dd'),
     'expvoucherName': Random.cword(2, 10),
     'isApply': Random.boolean(),
     'hasSurplus': Random.boolean()
   }
 }),
Exemple #6
0
 courseReviews: randomArr(8).map(() => {
   return mock({
     reviewId: randomId(),
     userId: randomId(),
     userName: '@cname',
     userGender: '@boolean',
     userPortrait: randomImg(60, 60),
     courseRate: '@float(0,4,0,2)',
     reviewContent: '@cparagraph(2, 5)',
     reviewTime: Random.date('yyyy-MM-dd'),
     reviewImgs: [randomImg(60, 60)],
     reviewReply: '@cparagraph(2, 5)',
     reviewVisible: '@boolean'
   })
 })
Exemple #7
0
mock(/get-reviews/, () => randomArr(10, 1).map(() => mock({
  reviewId: randomId(),
  userId: Random.boolean() ? randomId() : '',
  userName: '@cname',
  userGender: '@boolean',
  userPortrait: randomImg(),
  courseRate: Random.boolean() ? '@float(0,4,0,2)' : 0,
  coachRate: '@float(0,4,0,2)',
  reviewContent: '@cparagraph',
  reviewTime: '@date',
  reviewImgs: randomArr(6).map(randomImg),
  reviewReply: Random.boolean() ? Random.cparagraph() : '',
  reviewVisible: '@boolean',
  courseId: randomId(),
  courseName: '@ctitle',
  courseTypeName: '@ctitle',
  courseImg: randomImg(),
  coachId: randomId(),
  coachName: '@cname',
  scheduleTime: '@datetime'
})))
Exemple #8
0
mock(/\/merchant-coach\/get-coach\/\d+$/, ({url}) => {
  const coachId = pathToRegexp('/merchant-coach/get-coach/:coachId').exec(url)[1]
  return mock({
    coachId,
    coachName: '@cname',
    coachGender: '@boolean',
    coachPortrait: randomImg(60, 60),
    coachRate: '',
    userId: randomId(),
    coachMobile: randomMobile(),
    mobileVisible: '@boolean',
    coachPrize: '@cparagraph(0, 3)',
    teachingExp: '@cparagraph(0, 3)',
    coachProfile: '@cparagraph(0, 3)',
    coachSpeciality: '@cparagraph(0, 3)',
    activeCourseTypes: ['高级私教课', '私教课', '普通私教课', '中级私教课', '至尊私教课'].map((val) => {
      return val
    }),
    restTimes: randomArr(3).map(() => mock({
      restId: randomId(),
      restRange: ['@datetime', '@datetime']
    })),
    coachReviews: randomArr(3).map(() => {
      return mock({
        reviewId: randomId(),
        userId: randomId(),
        userName: '@cname',
        userGender: '@boolean',
        userPortrait: randomImg(60, 60),
        coachRate: '@float(0,4,0,2)',
        reviewContent: '@cparagraph(0, 3)',
        reviewTime: Random.date('yyyy-MM-dd'),
        reviewImgs: [randomImg(60, 60)],
        reviewReply: '@cparagraph(0, 3)',
        reviewVisible: '@boolean'
      })
    })
  })
})
Exemple #9
0
mock(/\/(cash-coupon\/detail)|(experience\/inst-detail)\/\d+/, ({url}) => {
  // 1 活动, 2 赠送
  const sourceType = Random.pick(1, 2)

  return mock({
    userName: '@cname',
    userMobile: randomMobile(),
    voucherInstId: randomId(),
    voucherName: '@ctitle',
    voucherValue: '@float(0, 100, 0, 2)',
    voucherTimes: '@natural(0, 100, 0, 2)',
    availableTimes: '@natural(0, 100, 0, 2)',
    miniConsume: url.indexOf('cash') + 1 ? '@float(0, 100, 0, 2)' : 0,
    receivedTime: '@datetime',
    usedTime: '@datetime',
    sourceContent: sourceType - 1 ? '@cname' : '@ctitle',
    sourceType,
    sourceActivityRange: sourceType - 1 ? null : ['@date', '@date'],
    voucherExpiredRange: ['@date', '@date'],
    applicableCourses: randomArr(5).map(() => Random.cword(5, 8)),
    purchasedContent: '@ctitle'
  })
})
Exemple #10
0
 restTimes: randomArr(3).map(() => mock({
   restId: randomId(),
   restRange: ['@datetime', '@datetime']
 })),
Exemple #11
0
       self.regions = this.result
       closeModal()
     }
   }, [10, 330400, '嘉善县'])
 },
 timePickerModal() {
   timePicker({
     pickerTabs: true,
     confirm(start, end) {
       log(start, end)
     }
   })
 },
 usersModal() {
   const user = {
     userId: randomId(),
     userPortrait: '', // 头像
     userName: '我的名字',
     userMobile: 18888888888,
     hasCashVoucher: true, // 是否有现金券标识
     isVisitor: true, // 是否是访客标识
     userGender: true // user性别
   }
   this.$modal.open({
     component: import('components/HiSelector/UserSelector'),
     options: {
       show: true,
       backdrop: true,
       full: true
     },
     props: {
Exemple #12
0
Mock.mock(/\/subscribe\/subscribe-init$/, () => {
  return {
    'schedule': {
      'scheduleId': randomId(),
      'scheduleName': Random.cword(2, 7),
      'courseTypeId': '2001',
      'merchantId': '',
      'courseId': randomId(),
      'coachId': randomId(),
      'coachName': Random.cword(2, 7),
      'roomId': '',
      'roomName': '',
      'remark': '',
      'day': 3,
      'startTime': '2017-01-11 10:00:00',
      'endTime': '2017-01-11 11:00:00',
      'expectNum': 22,
      'realNum': 1,
      'offNum': 1,
      'createTime': 1483514267000,
      'updateTime': 1483770035000,
      'reservedNum': 0,
      'useTicket': false,
      'state': '1',
      'picUrl': 'people?w=20',
      'subscribeId': '',
      'hiDate': '',
      'userId': randomId(),
      'duration': 60,
      'memberName': Random.cword(2, 7),
      'sex': 'F',
      'userIds': '',
      'restId': '',
      'coachUrl': '12345678910/staff/199421714576527360.jpg',
      'courseTypeName': '',
      'subscribeType': '1',
      'scheduleDuration': '01.11 10:00-11:00',
      'canNotCancel': false,
      'noCancelHour': 0,
      'supplement': false,
      'subscribeNum': 0,
      'openSchedule': true,
      'privateSchedule': false,
      'enoughPeople': false,
      'outTime': false,
      'appointment': false,
      'arrangement': true,
      'expSchedule': false,
      'date': {
        'hourOfDay': 0,
        'minuteOfHour': 0,
        'secondOfMinute': 0,
        'millisOfSecond': 0,
        'weekyear': 2017,
        'yearOfEra': 2017,
        'yearOfCentury': 17,
        'centuryOfEra': 20,
        'millisOfDay': 0,
        'secondOfDay': 0,
        'minuteOfDay': 0,
        'monthOfYear': 1,
        'weekOfWeekyear': 2,
        'dayOfMonth': 11,
        'dayOfWeek': 3,
        'era': 1,
        'dayOfYear': 11,
        'year': 2017,
        'chronology': {
          'zone': {
            'uncachedZone': {
              'cachable': true,
              'fixed': false,
              'id': 'Asia/Shanghai'
            },
            'fixed': false,
            'id': 'Asia/Shanghai'
          }
        },
        'zone': {
          'uncachedZone': {
            'cachable': true,
            'fixed': false,
            'id': 'Asia/Shanghai'
          },
          'fixed': false,
          'id': 'Asia/Shanghai'
        },
        'millis': 1484064000000,
        'afterNow': true,
        'beforeNow': false,
        'equalNow': false
      }
    },
    'usefulMbrExpVoucher': randomArr(10, 20).map(() => {
      return {
        'expvoucherInstId': randomId(),
        'expvoucherId': randomId(),
        'availableTimes': '100',
        'vestigialTimes': Random.natural(1, 3),
        'endTime': Random.date('yyyy.MM.dd'),
        'expvoucherName': Random.cword(2, 10)
      }
    }),
    'uselessMbrExpVoucher': randomArr(1, 4).map(() => {
      return {
        'expvoucherInstId': randomId(),
        'expvoucherId': randomId(),
        'availableTimes': '100',
        'vestigialTimes': Random.natural(1, 3),
        'endTime': Random.date('yyyy.MM.dd'),
        'expvoucherName': Random.cword(2, 10),
        'isApply': Random.boolean(),
        'hasSurplus': Random.boolean()
      }
    }),
    'usefulMbrCards': randomArr(10, 20).map(() => {
      return {
        'mbrCardId': randomId(),
        'cardNo': Random.integer(9),
        'memberId': '',
        'isValueCard': Random.natural(0, 1),
        'cardTypeId': Random.natural(1001, 1004) + '',
        'cardId': randomId(),
        'effective': '2017-01-06 00:00:00.0',
        'expired': '2017.02.06',
        'expiredValue': 1,
        'expiredUnit': 'Y',
        'times': 100,
        'price': 0,
        'yearCardTag': Random.boolean(),
        'state': Random.boolean(),
        'remark': '',
        'orgCardId': '',
        'forbidden': '',
        'transfered': '',
        'visible': '',
        'availTimes': -2,
        'memberName': '',
        'cardName': Random.cword(2, 7),
        'payState': '',
        'realFee': '',
        'orgFee': '',
        'startTime': '2017.01.06',
        'endTime': Random.date('yyyy.MM.dd'),
        'orderId': '',
        'cardState': '',
        'channel': '',
        'goodsId': '',
        'activityId': '',
        'couponId': '',
        'usable': 1,
        'limitTimes': 0,
        'activationWay': '',
        'isLast': 0,
        'discount': 10,
        'deductTimes': 2,
        'selected': false,
        'yearUnit': false,
        'enoughAvailTimes': true,
        'enoughTimes': true,
        'personalCard': false,
        'inactiveState': false,
        'activeState': true,
        'yearCard': false,
        'meterCard': true,
        'monthUnit': true,
        'infiniteUnit': false
      }
    }
    ),
    'uselessMbrCards': randomArr(0).map((index) => {
      return {
        'mbrCardId': randomId(),
        'cardNo': Random.integer(9),
        'isValueCard': Random.natural(0, 1),
        'memberId': '',
        'cardTypeId': '1004',
        'cardId': randomId(),
        'effective': '2017-01-06 00:00:00.0',
        'expired': '2017.02.06',
        'expiredValue': 1,
        'expiredUnit': 'Y',
        'times': 100,
        'price': 0,
        'state': '1',
        'remark': '',
        'orgCardId': '',
        'forbidden': '',
        'transfered': '',
        'visible': '',
        'availTimes': Random.natural(2, 10),
        'memberName': '',
        'cardName': Random.cword(2, 7),
        'payState': '',
        'realFee': '',
        'orgFee': '',
        'startTime': '2017.01.06',
        'endTime': Random.date('yyyy.MM.dd'),
        'orderId': '',
        'cardState': '',
        'channel': '',
        'goodsId': '',
        'activityId': '',
        'couponId': '',
        'usable': 1,
        'limitTimes': 0,
        'activationWay': '',
        'isLast': 0,
        'discount': 8.8,
        'deductTimes': 2,
        'selected': false,
        'yearUnit': false,
        'enoughAvailTimes': true,
        'enoughTimes': true,
        'personalCard': false,
        'inactiveState': false,
        'activeState': true,
        'yearCard': false,
        'meterCard': true,
        'monthUnit': true,
        'infiniteUnit': false,
        'isApply': Random.boolean(),
        'hasSurplus': Random.boolean(),
        'isApplyPeriod ': Random.boolean()
      }
    }
    ),
    'subscribeData': {
      'subscribeId': '',
      'scheduleId': '200545973274015744',
      'scheduleName': '添加bug',
      'coachId': '199422177211197440',
      'startTime': '2017-01-11 10:00:00',
      'endTime': '2017-01-11 11:00:00',
      'userId': '12313123',
      'supplement': true,
      'memberSubscribe': false,
      'maxSubTimes': 10,
      'sumSubscribeNum': 0,
      'subscribeNum': 1,
      'operatorId': '',
      'sourceType': '3',
      'register': '',
      'cardPay': {
        'subscribeId': '',
        'payId': '',
        'payType': 'K',
        'times': 0,
        'discount': 0
      },
      'ticketPay': {
        'subscribeId': '',
        'payId': '',
        'payType': 'Q',
        'times': 0,
        'discount': 0
      },
      'ignoreUnCancelSchedule': false,
      'ignoreMbrCost': false,
      'ignoreMbrRemain': false,
      'ignoreScheduleRemain': false,
      'ignoreSubscribe': false
    }
  }
})
Exemple #13
0
mock(/\/isst\/fetch-treas-list$/, () => randomArr(5, 1).map(() => mock({
  propId: randomId(),
  propName: '@ctitle',
  propImg: randomImg(),
  propRented: '@boolean'
})))
Exemple #14
0
Mock.mock(/\/renew-mbrcard\/optimal-coupon/, () => {
  return {
    voucherInstId: randomId(),
    voucherValue: Random.float(0, 500, 0, 2)
  }
})