main
lion 1 year ago
parent 3578d3e426
commit b124bad385

@ -24,7 +24,12 @@
<view class="listitem">
<view>卡券编号</view>
<text>{{cardinfo.card_number}}</text>
</view>
</view>
<view class="listitem">
<view>卡券状态</view>
<text>{{status_label}}</text>
</view>
</view>
</view>
<view class="cardbtn" @click="toHome"></view>
@ -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)
// }
// })
}
}
}
</script>

@ -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)

@ -63,6 +63,12 @@
</view>
</view>
<view class="orderForm-wrap">
<view class="orderForm-wx" @click="getWxAddress">
<u-icon name="weixin-circle-fill" color="#3fc14d" size="40"></u-icon>
<view>获取微信地址</view>
<u-icon name="arrow-right" size="28"></u-icon>
</view>
<u-form-item label="收货人" prop="contact" label-position="left">
<u-input v-model="form.contact" placeholder="请填写收货人姓名" />
</u-form-item>
@ -120,7 +126,7 @@
<view v-html="tips"></view>
</view>
<view class="agreeinfo-btn">
<view @click="closeAgree" :class="isAgree?'canAgree':''">同意<text
<view @click="closeAgree" :class="isAgree?'canAgree':''">已阅读并知晓<text
v-if="isAgreeTime>0">({{isAgreeTime}})</text></view>
</view>
</view>
@ -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;

@ -23,12 +23,12 @@
<text class="whattext">客服能做什么</text>
<view class="exchangelist">
<view class="textitem">
<image src="../../static/icon-exchange1.png" mode="widthFix"></image>
<text>物流查询</text>
<image src="../../static/icon-exchange2.png" mode="widthFix"></image>
<text>提货答疑</text>
</view>
<view class="textitem">
<image src="../../static/icon-exchange2.png" mode="widthFix"></image>
<text>积分兑换</text>
<image src="../../static/icon-exchange1.png" mode="widthFix"></image>
<text>物流追踪</text>
</view>
</view>
</view>
@ -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
}
})
}
},

@ -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)

@ -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
}
})
}
},

Loading…
Cancel
Save