diff --git a/components/date-picker/date-picker.vue b/components/date-picker/date-picker.vue new file mode 100644 index 0000000..084f024 --- /dev/null +++ b/components/date-picker/date-picker.vue @@ -0,0 +1,164 @@ + + + + + \ No newline at end of file diff --git a/packages/order/order.vue b/packages/order/order.vue index ed6a79a..bf5617a 100644 --- a/packages/order/order.vue +++ b/packages/order/order.vue @@ -2,73 +2,101 @@ - - - 您提货的商品是 + + {{cardInfo.sku?cardInfo.sku.name:''}} - - {{cardInfo.sku?cardInfo.sku.name:''}}{{cardInfo.sku?cardInfo.sku.specs:''}} - - + - 卡劵状态 - - - - 卡劵状态 - + + {{cardInfo.sku?cardInfo.sku.specs:''}} + + + 今日剩余可提货量 + 99 + + + 卡券状态 + + + - - 今日剩余可提货量 - 99 + + + 提货时间 + + + 顺丰快递 + 9月28日 [周三] 09:00-15:00 + + + + + + + - - + + + + + + + + + + + + + + + + + 定位 + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + - 确认提货 + 点击提货 - + + - @@ -135,10 +163,12 @@ isNull } from '@/common/util.js' import solarLunar from '@/node_modules/solarlunar'; - import auiPicker from '@/components/aui-picker.vue'; + import auiPicker from '@/components/aui-picker.vue'; + import datePicker from '@/components/date-picker/date-picker.vue' export default { components: { - auiPicker + auiPicker, + datePicker }, data() { return { @@ -159,10 +189,18 @@ contact: '', mobile: '', mobile2: '', + checked: false, myself: 1, buy_name: '', buy_mobile: '' - }, + }, + listExpress:[{ + id:0, + value:'顺丰快递' + },{ + id:1, + value:'中通快递' + }], listDates: [], showCalendar: false, date: '', @@ -213,7 +251,7 @@ } }, onReady() { - this.$refs.uForm.setRules(this.rules); + // this.$refs.uForm.setRules(this.rules); }, onLoad(option) { @@ -221,7 +259,7 @@ this.cardInfo = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card : {} this.form.card_number = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").card_number : '' this.form.password = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").password : '' - uni.removeStorageSync("vuex_card") + // uni.removeStorageSync("vuex_card") this.getAddress() this.getDates() this.getArea() @@ -256,25 +294,43 @@ } }) } - }, + }, + async getDates() { await this.$u.api.getDates({ card_number: this.form.card_number, - password: this.form.password + password: this.form.password, }).then(res => { console.log("dare", res) let data = res.card if (data.open_dates) { - for (var k in data.open_dates) { - this.listDates.push({ - label: k, - value: k - }) + for (var k in data.open_dates) { + let _k = this.momentDay(k) + this.listDates.push(_k) } - } + } + console.log("this.listDates",this.listDates) }).then(res => { }) + }, + momentDay(date) { + if (date) { + const weeks = ["周日", '周一', '周二', '周三', '周四', '周五', '周六', ] + let dateArr = date.split("-") + let ymd = this.$moment(date).format("M月DD日") + let week = weeks[this.$moment(date).day()] + const solar2lunarData = solarLunar.solar2lunar(dateArr[0], dateArr[1], dateArr[2]); + return { + ymd:ymd, + week:week, + lunarData:`农历${solar2lunarData.monthCn}${solar2lunarData.dayCn}`, + } + } + + }, + openDatePicker(){ + this.$refs.datePickers.show = true }, changeDate(e) { console.log(e) @@ -354,22 +410,6 @@ } }) }, - momentDay(date) { - console.log(date) - if(date){ - const weeks = ["周日",'周一','周二','周三','周四','周五','周六',] - let dateArr = date.split("-") - let ymd = this.$moment(date).format("YYYY年MM月DD日") - let week = weeks[this.$moment(date).day()] - console.log(this.$moment(date).format("YYYY年MM月DD日")) - // return - const solar2lunarData = solarLunar.solar2lunar(dateArr[0], dateArr[1], dateArr[2]); - console.log(`农历${solar2lunarData.monthCn}${solar2lunarData.dayCn}`); - // return this.date + " " + LL - return `${ymd} ${week} 农历${solar2lunarData.monthCn}${solar2lunarData.dayCn}` - } - - }, submit() { if ((!isNull(this.form.mobile2) && this.form.mobile2.length > 0) || (!isNull(this.form.buy_mobile) && this .form.buy_mobile.length > 0)) { @@ -419,8 +459,9 @@