diff --git a/packages/card/detail.vue b/packages/card/detail.vue index 4951663..50d381c 100644 --- a/packages/card/detail.vue +++ b/packages/card/detail.vue @@ -24,7 +24,12 @@ 卡券编号 {{cardinfo.card_number}} - + + + 卡券状态 + {{status_label}} + + 返回首页 @@ -48,13 +53,33 @@ indicatorActiveColor: '#b98b44', currentSwiperIndex: 0, banner3: [], - cardinfo: {} + cardinfo: {}, + status_label:'' } }, onLoad() { this.banner3 = uni.getStorageSync("banner3") ? uni.getStorageSync("banner3") : [] if (uni.getStorageSync("vuex_card_state")) { - this.cardinfo = uni.getStorageSync("vuex_card_state") + this.cardinfo = uni.getStorageSync("vuex_card_state") + switch (this.cardinfo.card.status){ + case -1: + this.status_label = '已销卡' + break; + case 0: + this.status_label = '末出库' + break; + case 1: + this.status_label = '待激活' + break; + case 2: + this.status_label = '待使用' + break; + case 3: + this.status_label = '已使用' + break; + default: + break; + } uni.removeStorageSync("vuex_card_state") } else { toast("未查询到卡券信息") @@ -70,42 +95,6 @@ url:"/pages/home/home" }) }, - saveImg() { - - // let _this = this - // let fileName = new Date().valueOf() - // let filePath = wx.env.USER_DATA_PATH + '/' + fileName + '.jpg' - // uni.authorize({ - // scope: 'scope.writePhotosAlbum', - // success: (res) => { - // uni.downloadFile({ - // url: '../../static/cardimg1.jpg', - // filePath: filePath, - // success(res) { - // console.log(res) - // uni.saveImageToPhotosAlbum({ - // filePath: filePath, - // success: function() { - // toast('保存成功') - // }, - // fail(res) { - // console.log("fail-saveImageToPhotosAlbum", res) - // } - // }); - // }, - // fail(res) { - // console.log("fail-downloadFile", res) - // } - // }) - - // }, - // fail(res) { - // console.log("user", res) - - // } - // }) - - } } } diff --git a/packages/card/index.vue b/packages/card/index.vue index dd82564..f85e432 100644 --- a/packages/card/index.vue +++ b/packages/card/index.vue @@ -85,31 +85,38 @@ return } this.$u.api.getDates(this.form).then(res => { - switch (res.card.status){ - case -1: - toast('已销卡') - break; - case 0: - toast('末出库') - break; - case 1: - toast('待激活') - break; - case 2: - uni.setStorageSync('vuex_card_state', { - card_number: this.form.card_number, - card: res.card - }) - uni.navigateTo({ - url: '/packages/card/detail' - }) - break; - case 3: - toast('已使用') - break; - default: - break; - } + uni.setStorageSync('vuex_card_state', { + card_number: this.form.card_number, + card: res.card + }) + uni.navigateTo({ + url: '/packages/card/detail' + }) + // switch (res.card.status){ + // case -1: + // toast('已销卡') + // break; + // case 0: + // toast('末出库') + // break; + // case 1: + // toast('待激活') + // break; + // case 2: + // uni.setStorageSync('vuex_card_state', { + // card_number: this.form.card_number, + // card: res.card + // }) + // uni.navigateTo({ + // url: '/packages/card/detail' + // }) + // break; + // case 3: + // toast('已使用') + // break; + // default: + // break; + // } }).then(res => { // console.log("ressssss",res) // toast(res) diff --git a/packages/order/order.vue b/packages/order/order.vue index 79f4f9e..90b8562 100644 --- a/packages/order/order.vue +++ b/packages/order/order.vue @@ -63,6 +63,12 @@ + + + 获取微信地址 + + + @@ -120,7 +126,7 @@ - 我同意我已阅读并知晓({{isAgreeTime}}) @@ -210,7 +216,7 @@ import { toast, isMobile, - isNull, + isNull, parseAddress } from '@/common/util.js' import solarLunar from '@/node_modules/solarlunar'; @@ -373,12 +379,49 @@ methods: { async getAddress() { const res = await this.$u.api.getUserAddress() - this.listAddress = res.address - console.log("this.type",this.type) + this.listAddress = res.address + console.log("this.type", this.type) if (!(this.type == 'edit')) { this.showAddress = this.listAddress.length > 0 ? true : false - } - console.log("this.type",this.type,this.showAddress) + } + console.log("this.type", this.type, this.showAddress) + }, + getWxAddress(e) { + let _this = this + uni.authorize({ + scope: 'scope.address', + success: (res) => { + console.log("authorize", res) + uni.chooseAddress({ + success(res) { + console.log(res) + _this.form.contact = res.userName + _this.form.mobile = res.telNumber + _this.form.area = res.provinceName + res.cityName + res.countyName + _this.form.address = res.detailInfo + _this.$u.api.matchRegion({ + province: res.provinceName, + city: res.cityName, + district: res.countyName + }).then(res1 => { + _this.form.province_id = res1.province_id ? res1 + .province_id.id : '' + _this.form.city_id = res1.city_id ? res1.city_id.id : '' + _this.form.district_id = res1.district_id ? res1 + .district_id.id : '' + }) + console.log("_this", _this.form) + }, + fail(res) { + console.log(res) + } + }) + }, + fail(res) { + console.log("authorize-fail", res) + } + }) + }, // async getExpress() { // const res = await this.$u.api.getExpress() @@ -406,25 +449,25 @@ await this.$u.api.getDates({ card_number: this.form.card_number }).then(res => { - let data = res.card - if(data.open_dates && data.open_dates.length===0){ - toast("当前无可提货时间") - return + let data = res.card + if (data.open_dates && data.open_dates.length === 0) { + toast("当前无可提货时间") + return } if (data.open_dates) { for (var k in data.open_dates) { - if (data.open_dates[k]['quantity'] - data.open_dates[k]['booked'] > 0) { - if(this.isAfterTwoDays(k)){ - let _k = this.momentDay(k) - this.listDates.push({ - canUse: data.open_dates[k], - ..._k - }) + if (data.open_dates[k]['quantity'] - data.open_dates[k]['booked'] > 0) { + if (this.isAfterTwoDays(k)) { + let _k = this.momentDay(k) + this.listDates.push({ + canUse: data.open_dates[k], + ..._k + }) } } } - }else{ - toast("当前无可提货时间") + } else { + toast("当前无可提货时间") } }).then(res => { @@ -480,8 +523,8 @@ }, changeArea(e) { // return - if (e) { - console.log("e",e) + if (e) { + console.log("e", e) let data = e.data let _this = this _this.form.area = '' @@ -510,29 +553,31 @@ success(res) { console.log("res", res) // _this.form.area = res.address - _this.form.address = res.name - // 根据地址匹配 省市区 - let pca = parseAddress(res.address) - if(pca.length>0){ - _this.form.area = pca.join('') - _this.$u.api.matchRegion({ - province: pca[0], - city: pca[1], - district: pca[2] - }).then(res => { - _this.form.province_id = res.province_id ? res.province_id.id : '' - _this.form.city_id = res.city_id ? res.city_id.id : '' - _this.form.district_id = res.district_id ? res.district_id.id : '' - }) - }else{ - uni.showToast({ - title:'未获取到地址,重新获取', - icon:'none' - }) - } - - - + _this.form.address = res.name + // 根据地址匹配 省市区 + let pca = parseAddress(res.address) + if (pca.length > 0) { + _this.form.area = pca.join('') + _this.$u.api.matchRegion({ + province: pca[0], + city: pca[1], + district: pca[2] + }).then(res => { + _this.form.province_id = res.province_id ? res + .province_id.id : '' + _this.form.city_id = res.city_id ? res.city_id.id : '' + _this.form.district_id = res.district_id ? res + .district_id.id : '' + }) + } else { + uni.showToast({ + title: '未获取到地址,重新获取', + icon: 'none' + }) + } + + + }, fail(res) { console.log("fail", res) @@ -861,6 +906,17 @@ } .orderForm { + &-wx { + color: #000; + font-size: 28rpx; + display: flex; + align-items: center; + + >view { + margin: 0 20rpx; + } + } + &-wrap { padding: 40rpx 24rpx; border-radius: 10rpx; diff --git a/packages/product/public.vue b/packages/product/public.vue index 53f03f8..d8f6cd0 100644 --- a/packages/product/public.vue +++ b/packages/product/public.vue @@ -23,12 +23,12 @@ 客服能做什么? - - 物流查询 + + 提货答疑 - - 积分兑换 + + 物流追踪 @@ -49,8 +49,13 @@ }, onLoad(){ const banner4 = uni.getStorageSync('banner4')?uni.getStorageSync('banner4'):[] - if(banner4.length>0){ - this.img = banner4[0].image + if (banner4.length > 0) { + banner4.map(item=>{ + if(item.type==='kf'){ + this.img = item.image + } + }) + } }, diff --git a/pages/home/home.vue b/pages/home/home.vue index f66077d..d4504c1 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -177,7 +177,8 @@ if(res.banner4.length>0){ res.banner4.map(item=>{ _arr1.push({ - image:item.upfile_url + image:item.upfile_url, + type:item.url }) }) uni.setStorageSync('banner4',_arr1) diff --git a/pages/talk/talk.vue b/pages/talk/talk.vue index 5e896d4..c7087d3 100644 --- a/pages/talk/talk.vue +++ b/pages/talk/talk.vue @@ -49,8 +49,13 @@ }, onLoad() { const banner4 = uni.getStorageSync('banner4') ? uni.getStorageSync('banner4') : [] - if (banner4.length > 0) { - this.img = banner4[0].image + if (banner4.length > 0) { + banner4.map(item=>{ + if(item.type==='gzh'){ + this.img = item.image + } + }) + } },