lion 2 years ago
parent 26f995d399
commit 5b47bf2da7

@ -162,6 +162,16 @@ const toMapAPP = (lat,lng,name) => {
}
})
}
// 检查是否空对象
const isEmptyObject = (obj) => {
// 检查传入参数是否为一个对象
if (typeof obj !== 'object' || obj === null) {
throw new Error('Input must be an object');
}
// 使用Object.keys()方法获取对象的属性键数组并检查其长度是否为0
return Object.keys(obj).length === 0;
}
export {
@ -174,5 +184,6 @@ export {
isMobile,
getDistance,
toMapAPP,
shareInfo
shareInfo,
isEmptyObject
}

@ -4,43 +4,49 @@
<view class="date">
<view class="date-title">
<view>配送</view>
<view>
<view @click="closePop">
<u-icon name="close-circle-fill" color="#f0efed" size="32"></u-icon>
</view>
</view>
<view class="date-express">
<view v-for="(item,index) in express">
<view @click="chooseExpress(index)" :class="{'date-express-item':true,'date-express-item_active':expressIndex==index}" v-if="item.value">{{item.value}}</view>
</view>
</view>
<view class="date-stitle">送货时间</view>
<view class="date-list">
<view class="date-list-left">
<view v-for="(item,index) in data">
<view @click="chooseDate(index,item)"
:class="{'date-list-item':true,'date-list-item_active':dateIndex==index}"
v-if="item">
{{item.ymd}}[{{item.week}}]
</view>
</view>
</view>
<view class="date-list-right">
<view class="lunarData">
{{dateObj.lunarData?dateObj.lunarData:''}}
</view>
<view class="hh">
<view class="" v-for="(item,index) in hhList">
{{item}}
</view>
</view>
</view>
<view class="date-express">
<view v-for="(item,index) in express">
<view @click="chooseExpress(index,item)"
:class="{'date-express-item':true,'date-express-item_active':expressIndex==index}"
v-if="item.value">{{item.value}}</view>
</view>
</view>
<view class="date-stitle">送货时间</view>
<view class="date-list">
<view class="date-list-left">
<view v-for="(item,index) in data">
<view @click="chooseDate(index,item)"
:class="{'date-list-item':true,'date-list-item_active':dateIndex==index}" v-if="item">
{{item.ymd}}[{{item.week}}]
</view>
</view>
</view>
<view class="date-list-right">
<view class="lunarData">
{{dateObj.lunarData?dateObj.lunarData:''}}
</view>
<view class="hh">
<view @click="chooseHh(index,item)" :class="{'hh-item':true,'hh-item_active':hhIndex==index}"
v-for="(item,index) in hhList">
{{item}}
</view>
</view>
</view>
</view>
<view class="date-btn">
<view @click="confirmPop"></view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
<script>
import {isEmptyObject,isNull,toast} from"@/common/util.js"
export default {
props: {
//
@ -61,35 +67,71 @@
},
data() {
return {
show: true,
expressIndex:-1,
dateIndex:-1,
dateObj:{},
hhList:['09:00-15:00','15:00-21:00']
show: false,
expressIndex: -1,
expressObj:{},
dateIndex: -1,
dateObj: {},
hhList: ['09:00-15:00', '15:00-21:00'],
hhIndex: -1,
}
},
methods:{
chooseExpress(index){
this.expressIndex = index
},
methods: {
chooseExpress(index,item) {
this.expressObj = item
this.expressIndex = index
},
chooseDate(index, item) {
this.dateIndex = index
this.dateObj = item
},
chooseHh(index,item) {
this.hhTime = item
this.hhIndex = index
},
closePop(){
this.show = false
},
chooseDate(index,item){
this.dateIndex = index
this.dateObj = item
confirmPop(){
if(isEmptyObject(this.dateObj)){
toast('请选择日期')
return
}
if(isEmptyObject(this.expressObj)){
toast('请选择快递')
return
}
if(isNull(this.hhTime)){
toast('请选择时间')
return
}
// AB
for (const key in this.expressObj) {
if (this.expressObj.hasOwnProperty(key)) {
this.dateObj[`express${key}`] = this.expressObj[key];
}
}
this.dateObj.hhtime = this.hhTime
this.$emit('refresh',this.dateObj)
this.show = false
console.log("this.dateObj",this.dateObj)
}
},
}
}
</script>
<style lang="scss" scoped>
.u-drawer-content-visible{
border-radius: 30rpx 30rpx 0 0;
<style lang="scss" scoped>
.u-drawer-content-visible {
border-radius: 30rpx 30rpx 0 0;
}
.date {
padding: 35rpx 0;
padding-right: 35rpx;
padding-bottom: 0;
&-title {
font-size: 32rpx;
color: #000;
@ -97,68 +139,123 @@
justify-content: space-between;
align-items: center;
padding-left: 35rpx;
}
&-express{
padding-left: 35rpx;
display: flex;
align-items: center;
margin-top:35rpx;
margin-bottom:15rpx;
&-item{
font-size: 24rpx;
color:#000;
background-color: #f0efed;
height:57rpx;
line-height: 55rpx;
text-align: center;
min-width: 180rpx;
border:1px solid transparent;
border-radius: 30rpx;
margin-right:20rpx;
margin-bottom:20rpx;
}
&-item_active{
color:#ba8b45;
background-color: #fef8ee;
border:1px solid #ba8b45;
}
}
&-stitle{
font-size: 24rpx;
color:#000;
padding-left:35rpx;
margin-bottom:35rpx;
}
&-list{
display: flex;
height:510rpx;
&-left{
width:235rpx;
height:510rpx;
overflow-y: scroll;
font-size: 0;
}
&-item{
font-size: 24rpx;
color:#787877;
background-color: #f0efed;
width:235rpx;
height:72rpx;
text-align: center;
line-height: 72rpx;
}
&-item_active{
background-color: #fff;
color:#000;
}
&-right{
width:calc(100% - 235rpx);
padding-top:15rpx;
padding-left:75rpx;
}
}
&-express {
padding-left: 35rpx;
display: flex;
align-items: center;
margin-top: 35rpx;
margin-bottom: 15rpx;
&-item {
font-size: 24rpx;
color: #000;
background-color: #f0efed;
height: 57rpx;
line-height: 55rpx;
text-align: center;
min-width: 180rpx;
border: 1px solid transparent;
border-radius: 30rpx;
margin-right: 20rpx;
margin-bottom: 20rpx;
}
&-item_active {
color: #ba8b45;
background-color: #fef8ee;
border: 1px solid #ba8b45;
}
}
&-stitle {
font-size: 24rpx;
color: #000;
padding-left: 35rpx;
margin-bottom: 35rpx;
}
&-list {
display: flex;
height: 510rpx;
&-left {
width: 235rpx;
height: 510rpx;
overflow-y: scroll;
font-size: 0;
}
&-item {
font-size: 24rpx;
color: #787877;
background-color: #f0efed;
width: 235rpx;
height: 72rpx;
text-align: center;
line-height: 72rpx;
}
&-item_active {
background-color: #fff;
color: #000;
}
&-right {
width: calc(100% - 235rpx);
padding-top: 15rpx;
padding-left: 75rpx;
font-size: 24rpx;
color: #000;
.lunarData {
height: 60rpx;
line-height: 60rpx;
}
.hh {
&-item {
border: 1px solid #f4f4f4;
border-radius: 10rpx;
height: 80rpx;
line-height: 80rpx;
width: 80%;
padding-left: 45rpx;
margin-bottom: 20rpx;
background-color: #fff;
}
&-item_active {
border: 1px solid #d1b384;
color: #ba8b45;
background-color: #fef8ee;
box-shadow: 0px 0px 8rpx #d1b384;
}
}
}
}
&-btn {
width: calc(100% + 35rpx);
text-align: center;
display: flex;
justify-content: center;
padding: 30rpx 0;
>view {
color: #f0efed;
font-size: 30rpx;
text-align: center;
width: 70%;
height: 75rpx;
line-height: 75rpx;
background-color: #ba8b45;
border-radius: 36rpx;
}
}
}
</style>

@ -2,7 +2,7 @@
<view class="cotainer">
<view class="orderForm">
<view class="orderForm-wx" @click="getAddress"></view>
<u-form :model="form" ref="uForm">
<u-form :model="form" ref="uForm" :error-type="['toast']">
<u-form-item label="联系人" label-width="150" required prop="contact" label-position="left">
<u-input v-model="form.contact" placeholder="请填写联系人" />
</u-form-item>
@ -18,10 +18,14 @@
</u-form-item>
<u-form-item label="详细地址" required prop="address" label-position="top">
<u-input v-model="form.address" placeholder="请填写详细地址" type="textarea" />
</u-form-item>
<u-form-item label="默认地址" label-width="150" :border-bottom="false" prop="defalut" label-position="left">
<u-switch slot="right" v-model="form.defalut" active-color="#ba8b45" inactive-color="#adadac"
size="40"></u-switch>
</u-form-item>
</u-form>
<view class="orderForm-btn">
<u-button type="primary" @click="submit"></u-button>
<view class="orderForm-btn">
<view @click="submit"></view>
</view>
</view>
<!-- <u-picker mode="region" v-model="showArea" @confirm="changeArea"></u-picker> -->
@ -47,7 +51,8 @@
area: '',
address: '',
contact: '',
mobile: ''
mobile: '',
defalut:false
},
listArea:[],
showArea: false,
@ -181,9 +186,17 @@
this.$refs.uForm.validate(valid => {
if (valid) {
if(this.form.defalut){
this.form.defalut = 1
}
this.$u.api.saveUserAddress(this.form).then(res=>{
toast('提交成功')
uni.navigateBack(-1)
toast('提交成功',1000,function(){
setTimeout(function(){
uni.navigateBack(-1)
},500)
})
})
} else {
console.log('验证失败');
@ -200,7 +213,7 @@
padding: 40rpx;
.orderForm {
&-wx{
color:#2979ff;
color:#ba8b45;
margin-bottom:20rpx;
font-size: 32rpx;
}
@ -225,7 +238,17 @@
}
&-btn {
margin: 40rpx;
margin: 40rpx;
>view{
background-color: #ba8b45;
color: #fff;
border-radius: 40rpx;
width: 100%;
margin: 0 auto;
height: 75rpx;
text-align: center;
line-height: 75rpx;
}
}
}
}

@ -20,7 +20,7 @@
</view>
</u-swipe-action>
<view class="list-add" @click="toAdd">
<u-icon name="plus-circle" color="#007aff"></u-icon>
<u-icon name="plus-circle" color="#ba8b45"></u-icon>
新增地址
</view>
</view>
@ -146,7 +146,7 @@
}
}
&-add{
color:#2979ff;
color:#ba8b45;
margin: 20rpx 0;
font-size: 32rpx;
u-icon{

@ -5,8 +5,8 @@
<view class="imgbox">
<image src="../../static/confirmimg.jpg" mode="widthFix"></image>
</view>
<view class="pictitle">蟹太太大闸蟹红金款999型</view>
<text>公4.0两母3.0 4 8只装</text>
<view class="pictitle">{{details.sku?details.sku.name:''}}</view>
<text>{{details.sku?details.sku.specs:''}}</text>
</view>
</view>
<view class="confirmlist index0">
@ -16,13 +16,13 @@
<view class="confirmright">
<text class="confirmmarker">收货日期</text>
<view class="flex-li confirmdate">
<text>2024年9月28日</text>
<text class="smallfont">农历八月十三</text>
<text>{{details.send_date?$moment(details.send_date).format("YYYY年M月DD日"):''}}</text>
<text class="smallfont">{{details.lunarData?details.lunarData:""}}</text>
</view>
<view class="flex-li confirmdate">
<text>0900-1500</text>
<text class="smallfont">[周三]</text>
</view>
<text>{{details.hh?details.hh:''}}</text>
<text class="smallfont">{{details.week?'['+details.week+']':''}}</text>
</view>
</view>
</view>
<view class="confirmlist index1">
@ -32,7 +32,7 @@
<view class="confirmright">
<text class="confirmmarker">收货地址</text>
<view class="flex-li confirmaddress">
<text>浙江省杭州市滨江区银泰海威国际xxxx</text>
<text>{{details.area?details.area:''}}{{details.address?details.address:''}}</text>
</view>
</view>
</view>
@ -43,15 +43,11 @@
<view class="confirmright">
<text class="confirmmarker">收货人</text>
<view class="flex-li confirmcontact">
<text>王冰冰</text>
<text>15326589454</text>
<text>{{details.contact?details.contact:''}}</text>
<text>{{details.mobile?details.mobile:''}}</text>
</view>
</view>
</view>
<view class="confirmbtn">
<text class="edit">返回修改</text>
<text class="confirmtab">确认提货</text>
</view>
</view>
</template>
@ -60,11 +56,13 @@
data() {
return {
details:{}
}
},
onLoad() {
onLoad(option) {
this.details = uni.getStorageSync('order_detail')?uni.getStorageSync('order_detail'):''
uni.removeStorageSync('order_detail')
console.log(this.details)
},
methods: {

@ -5,88 +5,32 @@
</view>
<view class="orderlist">
<!-- 1条数据开始 -->
<view class="orderitem" @click="toDetail">
<view class="orderitem" v-for="(item,index) in orderList">
<view class="ordertop">
<text>运单号1SFSF1454237639361</text>
<text>已发货</text>
<text>运单号{{item.express_number?item.express_number:'-'}}</text>
<text>{{item.status==0?'待发货':'已发货'}}</text>
</view>
<view class="orderinfo">
<view class="orderbrief">
<view class="orderbrief" @click="toDetail(item)">
<view class="orderimg">
<image src="../../static/orderimg1.jpg" mode="widthFix"></image>
</view>
<view class="orderright">
<view class="ordertitle">蟹太太大闸蟹红金款999型</view>
<view class="ordersmalltext">公4.0两母3.0 4 8只装</view>
<view class="ordertitle">{{item.sku?item.sku.name:''}}</view>
<view class="ordersmalltext">{{item.sku?item.sku.specs:''}}</view>
</view>
</view>
<view class="ordertime">
<view class="ordertime" @click="toDetail(item)">
<text>预计送达时间</text>
<view>9月28日<text class="orderweek">[周三]</text>09:00-15:00</view>
<view>{{item.send_date?$moment(item.send_date).format("M月DD日"):''}}<text class="orderweek">{{item.week?'['+item.week+']':''}}</text>{{item.hh?item.hh:''}}</view>
</view>
<view class="ordertab">
<text class="deleteorder">删除订单</text>
<!-- <text class="deleteorder">删除订单</text> -->
<text class="orderinform">通知收件人</text>
</view>
</view>
</view>
<!-- 1条数据结束 -->
<!-- 2条数据开始 -->
<view class="orderitem">
<view class="ordertop">
<text>商品兑换成功</text>
<text>待发货</text>
</view>
<view class="orderinfo">
<view class="orderbrief">
<view class="orderimg">
<image src="../../static/orderimg1.jpg" mode="widthFix"></image>
</view>
<view class="orderright">
<view class="ordertitle">蟹太太大闸蟹红金款999型</view>
<view class="ordersmalltext">公4.0两母3.0 4 8只装</view>
</view>
</view>
<view class="ordertime">
<text>预计送达时间</text>
<view>9月28日<text class="orderweek">[周三]</text>09:00-15:00</view>
</view>
<view class="ordertab">
<text class="addremark">添加备注</text>
<text class="deleteorder">删除订单</text>
<text class="orderinform">通知收件人</text>
</view>
</view>
</view>
<!-- 2条数据结束 -->
<!-- 3条数据开始 -->
<view class="orderitem">
<view class="ordertop">
<text>商品兑换成功</text>
<text>待发货</text>
</view>
<view class="orderinfo">
<view class="orderbrief">
<view class="orderimg">
<image src="../../static/orderimg1.jpg" mode="widthFix"></image>
</view>
<view class="orderright">
<view class="ordertitle">蟹太太大闸蟹红金款999型</view>
<view class="ordersmalltext">公4.0两母3.0 4 8只装</view>
</view>
</view>
<view class="ordertime">
<text>预计送达时间</text>
<view>9月28日<text class="orderweek">[周三]</text>09:00-15:00</view>
</view>
<view class="ordertab">
<text class="addremark">添加备注</text>
<text class="deleteorder">删除订单</text>
<text class="orderinform">通知收件人</text>
</view>
</view>
</view>
<!-- 3条数据结束 -->
</view>
</view>
</template>
@ -97,30 +41,42 @@
data() {
return {
list: [{
name: '全部'
name: '全部',
status:'',
}, {
name: '待发货'
name: '待发货',
status:0
}, {
name: '待收货',
},{
name: '已完成',
}],
current: 0
name: '已发货',
status:1
}],
status:'',
current: 0,
orderList:[]
}
},
onLoad() {
this.getOrderList()
},
methods: {
change(index) {
this.current = index;
this.current = index;
this.status = this.list[index].status
this.getOrderList()
},
toDetail(){
console.log("123")
toDetail(item){
uni.setStorageSync('order_detail', item)
uni.navigateTo({
url:'/packages/myorder/infoconfirm'
})
}
},
async getOrderList(){
const res = await this.$u.api.getUserOrder({
status:this.status
})
this.orderList = res
// this.listArea = res.regions
},
}
}

@ -1,72 +1,77 @@
<template>
<page-meta :page-style="'overflow:'+(showinfo?'hidden':'visible')"></page-meta>
<view class="cotainer">
<view class="orderInfo">
<view class="orderInfo-title">
<view>{{cardInfo.sku?cardInfo.sku.name:''}}</view>
</view>
<view class="orderInfo-info">
<image :src="require('@/static/share.jpg')"></image>
<view>
<view>
{{cardInfo.sku?cardInfo.sku.specs:''}}
</view>
<view>
<view>今日剩余可提货量</view>
<view>99</view>
</view>
<view>
<view>卡券状态</view>
<view class="status" v-html="cardInfo.status_label"></view>
<date-picker ref="datePickers" @refresh="backDate" :data="listDates" :express="listExpress"></date-picker>
<view class="orderForm">
<u-form :model="form" label-width="180" ref="uForm" :error-type="['toast']">
<view class="orderInfo">
<view class="orderInfo-title">
<view>{{cardInfo.sku?cardInfo.sku.name:''}}</view>
</view>
<view class="orderInfo-info">
<image :src="require('@/static/share.jpg')"></image>
<view>
<view>
{{cardInfo.sku?cardInfo.sku.specs:''}}
</view>
<view>
<view>今日剩余可提货量</view>
<view>99</view>
</view>
<view>
<view>卡券状态</view>
<view class="status" v-html="cardInfo.status_label"></view>
</view>
</view>
</view>
<view class="orderInfo-status">
<view>提货时间</view>
<view @click="openDatePicker">
<view class="">
<view>顺丰快递</view>
<view>9月28日 [周三] 09:00-15:00</view>
</view>
</view>
<view>
<u-icon name="arrow-down-fill" color="#ccc" size='28'></u-icon>
<view class="orderInfo-status">
<u-form-item label="提货时间" :border-bottom="false" style="width:100%" prop="send_date"
label-position="left">
<!-- <view></view> -->
<view class="hh" @click="openDatePicker">
<view class="" v-if="form.send_date">
<view>{{form.express}}</view>
<view>{{form.ymd}} <text style="color:#b62828;margin:0 10rpx">[{{form.week}}]</text>
{{form.hh}}
</view>
</view>
<view v-else>
<view>选择提货时间</view>
</view>
<view>
<u-icon name="arrow-down-fill" color="#ccc" size='28'></u-icon>
</view>
</view>
</u-form-item>
</view>
</view>
</view>
</view>
<date-picker ref="datePickers" :data="listDates" :express="listExpress"></date-picker>
<view class="orderForm">
<u-form :model="form" ref="uForm" :error-type="['border-bottom']">
<!-- <u-form-item label="预约提货时间" required prop="send_date" label-position="top">
<u-input v-model="form.send_date" placeholder="请选择预约提货时间" @click="showCalendar = true"
type="hidden" />
</u-form-item> -->
<view class="orderForm-wrap">
<u-form-item label="收货人" label-width="180" prop="contact" label-position="left">
<u-form-item label="收货人" prop="contact" label-position="left">
<u-input v-model="form.contact" placeholder="请填写收货人姓名" />
</u-form-item>
<u-form-item label="手机号码" label-width="180" prop="mobile" label-position="left">
<u-form-item label="手机号码" prop="mobile" label-position="left">
<u-input v-model="form.mobile" placeholder="请填写手机号码" />
</u-form-item>
<u-form-item label="备用号码" label-width="180" prop="mobile2" label-position="left">
<u-form-item label="备用号码" prop="mobile2" label-position="left">
<u-input v-model="form.mobile2" placeholder="请填写备用号码" />
</u-form-item>
<u-form-item label="所在地区" prop="area" label-width="180" label-position="left">
<u-form-item label="所在地区" prop="area" label-position="left">
<u-input v-model="form.area" placeholder="请选择所在地区" @click="openArea" />
<view slot="right" class="arearight" @click="changeLocation">
<u-icon name="map"></u-icon>
定位
</view>
</u-form-item>
<u-form-item label="详细地址" label-width="180" prop="address" label-position="left">
<u-form-item label="详细地址" prop="address" label-position="left">
<u-input v-model="form.address" placeholder="请填写详细地址" />
</u-form-item>
<u-form-item label="设置默认地址" :border-bottom="false" label-width="180" prop="checked"
label-position="left">
<u-switch slot="right" v-model="form.checked" active-color="#ba8b45" inactive-color="#adadac"
<u-form-item label="设置默认地址" :border-bottom="false" prop="defalut" label-position="left">
<u-switch slot="right" v-model="form.defalut" active-color="#ba8b45" inactive-color="#adadac"
size="40"></u-switch>
</u-form-item>
</view>
@ -75,14 +80,13 @@
<u-button @click="changeLocation" size="mini">获取位置</u-button>
</view> -->
<view class="orderForm-wrap">
<u-form-item label="是否本人收货" label-width="180" prop="myself" label-position="left">
<u-form-item label="是否本人收货" prop="myself" label-position="left">
<u-input v-model="myself" placeholder="选填" @click="showIsMySelf = true" type="select" />
</u-form-item>
<u-form-item label="购买人姓名" label-width="180" prop="buy_name" label-position="left">
<u-form-item label="购买人姓名" prop="buy_name" label-position="left">
<u-input v-model="form.buy_name" placeholder="选填" />
</u-form-item>
<u-form-item label="购买人电话" :border-bottom="false" label-width="180" prop="buy_mobile"
label-position="left">
<u-form-item label="购买人电话" :border-bottom="false" prop="buy_mobile" label-position="left">
<u-input v-model="form.buy_mobile" placeholder="选填" />
</u-form-item>
</view>
@ -91,66 +95,84 @@
<view class="orderForm-btn">
<view @click="submit"></view>
</view>
</view>
<!-- <u-calendar max-date="2050-12-31" v-model="showCalendar" @change="changeDate" :mode="'date'"></u-calendar> -->
<!-- <u-picker mode="region" v-model="showArea" @confirm="changeArea"></u-picker> -->
</view>
<aui-picker ref="pickers" :title="'地区选择'" :data="listArea" @callback="changeArea"></aui-picker>
<u-select @confirm="changeDate" v-model="showCalendar" :list="listDates"></u-select>
<u-select @confirm="changeIsMySelf" v-model="showIsMySelf" :list="listIsMySelf"></u-select>
<!-- 确认信息 -->
<view class="showinfo" v-if="showinfo">
<view class="content">
<view class="showinfo-info">
<view>您提货的商品是</view>
<u-image :src="require('@/static/share.jpg')" width="450" height="450"></u-image>
<view>{{cardInfo.sku?cardInfo.sku.name:''}}{{cardInfo.sku?cardInfo.sku.specs:''}}</view>
<view class="ordercontainer" v-if="showinfo">
<view class="confirmbox">
<view class="confirmpicinfo">
<view class="imgbox">
<image src="../../static/confirmimg.jpg" mode="widthFix"></image>
</view>
<view class="pictitle">{{cardInfo.sku?cardInfo.sku.name:''}}</view>
<text>{{cardInfo.sku?cardInfo.sku.specs:''}}</text>
</view>
<view class="showinfo-wrap">
<view>发货时间</view>
<view style="text-align: center;">{{momentDay(date)}}</view>
</view>
<view class="confirmlist index0">
<view class="iconimg">
<image src="../../static/icon1.png" mode="widthFix"></image>
</view>
<view class="showinfo-wrap">
<view>收货信息</view>
<view>
<view>
<text>收货人</text>
<text>{{form.contact}}</text>
</view>
<view>
<text>收货人电话</text>
<text>{{form.mobile}}</text>
</view>
<view>
<text>收货地址</text>
<text>{{form.area}}{{form.address}}</text>
</view>
<view class="confirmright">
<text class="confirmmarker">收货日期</text>
<view class="flex-li confirmdate">
<text>{{form.ymd}}</text>
<text class="smallfont">{{form.lunarData}}</text>
</view>
<view class="flex-li confirmdate">
<text>{{form.hh}}</text>
<text class="smallfont">[{{form.week}}]</text>
</view>
</view>
</view>
<view class="confirmlist index1">
<view class="iconimg">
<image src="../../static/icon2.png" mode="widthFix"></image>
</view>
<view class="confirmright">
<text class="confirmmarker">收货地址</text>
<view class="flex-li confirmaddress">
<text>{{form.area}}{{form.address}}</text>
</view>
</view>
<view class="showinfo-btn">
<u-button @click="showinfo = false">返回修改</u-button>
<u-button type="primary" @click="submit"></u-button>
</view>
<view class="confirmlist index2">
<view class="iconimg">
<image src="../../static/icon3.png" mode="widthFix"></image>
</view>
<view class="confirmright">
<text class="confirmmarker">收货人</text>
<view class="flex-li confirmcontact">
<text>{{form.contact}}</text>
<text>{{form.mobile}}</text>
</view>
</view>
</view>
<view class="confirmbtn">
<text class="edit" @click="backShow"></text>
<text class="confirmtab" @click="submit"></text>
</view>
</view>
<!-- 选择地址 -->
<view class="addressinfo" v-if="showAddress">
<view class="content">
<view class="content-close" @click="showAddress=false">
<u-icon name="close-circle" color="#000" size="50"></u-icon>
</view>
<view class="content-wrap">
<u-radio-group v-model="addressInfo" @change="changeAddress">
<u-radio v-for="(item, index) in listAddress" :key="index" :name="item.id">
<view class="content-contact">{{item.contact}} {{item.mobile}}</view>
<view class="content-address">{{item.area}}{{item.address}}</view>
</u-radio>
</u-radio-group>
<u-popup v-model="showAddress" mode="bottom">
<view class="content">
<view class="content-title">
选择地址
</view>
<view class="content-wrap">
<u-radio-group v-model="addressInfo" @change="changeAddress">
<u-radio v-for="(item, index) in listAddress" :key="index" :name="item.id">
<view class="content-contact">{{item.contact}} {{item.mobile}}</view>
<view class="content-address">{{item.area}}{{item.address}}</view>
</u-radio>
</u-radio-group>
</view>
</view>
</view>
</u-popup>
</view>
</view>
@ -163,11 +185,11 @@
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() {
@ -180,7 +202,14 @@
form: {
card_number: '',
password: '',
send_date: '',
ymd: '',
lunarData: '',
express: '',
hh: '',
week: '',
area: '',
address: '',
province_id: '',
@ -189,20 +218,19 @@
contact: '',
mobile: '',
mobile2: '',
checked: false,
defalut: false,
myself: 1,
buy_name: '',
buy_mobile: ''
},
listExpress:[{
id:0,
value:'顺丰快递'
},{
id:1,
value:'中通快递'
},
listExpress: [{
id: 0,
value: '顺丰快递'
}, {
id: 1,
value: '中通快递'
}],
listDates: [],
showCalendar: false,
date: '',
listArea: [],
showArea: false,
@ -218,7 +246,7 @@
rules: {
send_date: [{
required: true,
message: '请选择预约提货时间',
message: '请选择提货时间',
trigger: ['change', 'blur'],
}],
area: [{
@ -251,7 +279,7 @@
}
},
onReady() {
// this.$refs.uForm.setRules(this.rules);
this.$refs.uForm.setRules(this.rules);
},
onLoad(option) {
@ -294,53 +322,55 @@
}
})
}
},
},
async getDates() {
await this.$u.api.getDates({
card_number: this.form.card_number,
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) {
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)
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 {
date: date,
ymd: ymd,
week: week,
lunarData: `农历${solar2lunarData.monthCn}${solar2lunarData.dayCn}`,
}
}
},
backDate(e) {
console.log("e123", e)
if (e) {
// this.form.send_date = e.result
// this.date = e
this.date = e[0].label
this.form.send_date = e[0].value
this.form.send_date = e.date
this.form.ymd = e.ymd
this.form.express = e.expressvalue
this.form.hh = e.hhtime
this.form.week = e.week
this.form.lunarData = e.lunarData
}
},
openDatePicker() {
this.$refs.datePickers.show = true
},
async getArea() {
const res = await this.$u.api.getRegion()
this.listArea = res.regions
@ -410,7 +440,49 @@
}
})
},
backShow() {
let that = this
uni.setNavigationBarTitle({
title: '信息确认',
success: function() {
console.log('标题设置成功');
that.showinfo = false
},
fail: function(err) {
console.error('标题设置失败', err);
}
});
},
saveDefalutAddress() {
if (this.form.defalut) {
this.$u.api.saveUserAddress({
id: this.form.address_id ? this.form.address_id : '',
area: this.form.area,
address: this.form.address,
contact: this.form.contact,
mobile: this.form.mobile,
province_id: this.form.province_id,
city_id: this.form.city_id,
district_id: this.form.district_id,
defalut: 1
}).then(res => {
uni.redirectTo({
url: '/packages/myorder/myorder'
})
}).then(res => {
uni.redirectTo({
url: '/packages/myorder/myorder'
})
})
} else {
uni.redirectTo({
url: '/packages/myorder/myorder'
})
}
},
submit() {
let that = this
if ((!isNull(this.form.mobile2) && this.form.mobile2.length > 0) || (!isNull(this.form.buy_mobile) && this
.form.buy_mobile.length > 0)) {
if (!isMobile(this.form.mobile2)) {
@ -423,23 +495,30 @@
}
}
this.$refs.uForm.validate(valid => {
console.log('验证通过');
// console.log('');
if (valid) {
if (!this.showinfo) {
this.showinfo = true
console.log("this.showinfo", this.showinfo)
uni.setNavigationBarTitle({
title: '信息确认',
success: function() {
console.log('标题设置成功');
that.showinfo = true
},
fail: function(err) {
console.error('标题设置失败', err);
}
});
} else {
console.log('submit');
this.form.show = 0
this.$u.api.addUserOrder(this.form).then(res => {
console.log("res", res)
uni.removeStorageSync('vuex_card')
toast(res.msg)
setTimeout(function() {
uni.redirectTo({
url: '/packages/myorder/myorder'
})
}, 2000)
toast(res.msg, 1000, function() {
setTimeout(function() {
that.saveDefalutAddress()
}, 500)
})
}).then(res => {
console.log('res1', res)
@ -449,6 +528,7 @@
} else {
console.log('验证失败');
// toast('')
}
});
}
@ -462,6 +542,7 @@
padding: 29rpx 54rpx;
background-color: #f0efed;
padding-bottom: 200rpx;
.addressinfo {
position: fixed;
top: 0;
@ -475,8 +556,9 @@
justify-content: center;
.content {
width: 80%;
height: 600rpx;
width: 100%;
height: 800rpx;
// overflow: scroll;
position: relative;
&-wrap {
@ -485,18 +567,21 @@
border-radius: 20rpx;
overflow: scroll;
width: 100%;
height: 100%;
padding: 40rpx;
height: 650rpx;
padding: 40rpx;
padding-top:0;
}
&-close {
position: absolute;
top: -20rpx;
right: -20rpx;
&-title {
text-align: center;
padding: 30rpx;
font-size: 32rpx;
}
.u-radio {
align-items: baseline;
margin-bottom: 20rpx;
}
&-contact {}
@ -509,78 +594,6 @@
}
}
.showinfo {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, .5);
z-index: 9999999;
display: flex;
align-items: center;
justify-content: center;
.content {
width: 100vw;
height: 100vh;
padding: 40rpx;
box-sizing: border-box;
background: #fff;
// border-radius: 16rpx;
overflow: scroll;
}
&-info {
display: flex;
flex-wrap: wrap;
justify-content: center;
>view {
margin: 20rpx;
font-size: 36rpx;
&:last-child {
width: 350rpx;
color: #ccc;
font-size: 28rpx;
text-align: center;
}
}
}
&-wrap {
>view {
&:first-child {
text-align: center;
margin: 20rpx;
}
&:last-child {
border: 1px solid #333;
padding: 20rpx;
border-radius: 15rpx;
font-weight: bold;
>view {
margin-bottom: 10rpx;
}
}
}
}
&-btn {
display: flex;
align-items: center;
justify-content: center;
margin: 30rpx;
u-button {
margin: 0 20rpx;
}
}
}
.orderInfo {
padding: 40rpx 24rpx;
@ -639,16 +652,26 @@
flex-wrap: wrap;
justify-content: space-between;
>view {
.u-form-item {
padding: 0;
.u-form-item__body {
align-items: baseline;
}
}
.hh {
&:last-child {
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
>view {
&:first-child {
view {
margin-bottom: 15rpx;
height: 50rpx;
line-height: 50rpx;
&:last-child {
margin-bottom: 0rpx
@ -724,5 +747,147 @@
}
}
}
.ordercontainer {
background: #f0efed;
width: 100%;
height: 100vh;
padding: 42rpx 50rpx 300rpx;
overflow-y: scroll;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 9999999;
}
.confirmbox {
width: 100%;
padding-top: 22rpx;
padding-bottom: 35rpx;
background: url(../../static/confirmbg1.jpg) no-repeat center top;
background-size: cover;
border-radius: 10rpx;
box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, .47);
}
.confirmpicinfo {
text-align: center;
font-size: 24rpx;
color: #d5c7b5;
line-height: 42rpx;
}
.imgbox {
width: 307rpx;
margin: 0 auto;
border-radius: 10rpx;
border: 1px solid #ba8b45;
overflow: hidden;
margin-bottom: 14rpx;
}
.imgbox image {
width: 100%;
height: auto;
vertical-align: middle;
}
.confirmpicinfo .pictitle {
color: #ba8b45;
}
.confirmlist {
margin-top: 30rpx;
border-radius: 10rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: space-between;
background-repeat: no-repeat;
background-position: center top;
background-size: cover;
box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, .47);
padding: 10rpx 10rpx 10rpx 20rpx;
}
.confirmlist.index0 {
background-image: url(../../static/confirmbg2.jpg);
}
.confirmlist.index1 {
background-image: url(../../static/confirmbg3.jpg);
}
.confirmlist.index2 {
background-image: url(../../static/confirmbg4.jpg);
}
.confirmlist image {
width: 62rpx;
height: auto;
}
.confirmlist .confirmright {
width: 550rpx;
background: #fff;
border-radius: 10rpx;
padding: 45rpx 20rpx 25rpx;
}
.confirmmarker {
display: block;
font-size: 24rpx;
color: #000;
font-weight: bold;
margin-bottom: 8rpx;
}
.flex-li {
display: flex;
justify-content: space-between;
color: #000;
font-size: 30rpx;
line-height: 60rpx;
}
.confirmdate text.smallfont {
font-size: 24rpx;
}
.confirmbtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
// height: 115rpx;
display: flex;
padding: 40rpx 0rpx;
justify-content: space-between;
background: #fff;
align-items: center;
}
.confirmbtn text {
display: inline-block;
width: 284rpx;
line-height: 74rpx;
height: 74rpx;
text-align: center;
border-radius: 74rpx;
border: 1rpx solid #d1d1d0;
margin: 0 38rpx;
font-size: 29rpx;
color: #000;
}
.confirmbtn text.confirmtab {
color: #fff;
border: 1rpx solid #ba8b45;
background: #ba8b45;
}
}
</style>

@ -10,24 +10,40 @@
</view>
<view class="me-list">
<view class="me-list-item" v-for="item in list" @click="toUrl(item)">
<view class="me-list-item-left">
<view class="">
<u-icon :name="item.icon" size="40"></u-icon>
<block v-if="item.id==='feedback'">
<button hover-class="none" open-type="feedback">
<view class="me-list-item-left">
<view class="">
<u-icon :name="item.icon" size="40"></u-icon>
</view>
<view>{{item.title}}</view>
</view>
<view class="">
<u-icon name="arrow-right" size="40" color="#e0e0e0"></u-icon>
</view>
</button>
</block>
<block v-else>
<view class="me-list-item-left">
<view class="">
<u-icon :name="item.icon" size="40"></u-icon>
</view>
<view>{{item.title}}</view>
</view>
<view>{{item.title}}</view>
</view>
<view class="">
<u-icon name="arrow-right" size="40" color="#e0e0e0"></u-icon>
</view>
<view class="">
<u-icon name="arrow-right" size="40" color="#e0e0e0"></u-icon>
</view>
</block>
</view>
</view>
</view>
<u-popup v-model="showPhone" mode="bottom" :mask-close-able="false">
<view class="login-btn" style="padding:60rpx">
<button class="login-btn-btn" open-type="getPhoneNumber" @getphonenumber="getUserWxPhone"></button>
</view>
</view>
<u-popup v-model="showPhone" mode="bottom" :mask-close-able="false">
<view class="login-btn" style="padding:60rpx">
<button class="login-btn-btn" open-type="getPhoneNumber" @getphonenumber="getUserWxPhone"></button>
</view>
</u-popup>
<!-- 弹出头像 昵称 -->
<!-- 弹出头像 昵称1 -->
<u-popup v-model="showform" mode="bottom" :mask-close-able="maskClose">
<view class="login-form">
<view>
@ -42,21 +58,22 @@
<span>姓名</span>
<view>
<input type="nickname" @blur="blurname" :placeholderStyle="'color:#999;font-size:30rpx'"
v-model="form.nickname" placeholder="请输入姓名" :border="false" shape="circle" clearable></input>
v-model="form.nickname" placeholder="请输入姓名" :border="false" shape="circle"
clearable></input>
</view>
</view>
<view>
<span>电话</span>
<view>
<input :placeholderStyle="'color:#999;font-size:30rpx'" v-model="form.mobile"
placeholder="请输入手机号" :border="false" shape="circle" clearable></input>
</view>
</view>
<view>
<span>电话</span>
<view>
<input :placeholderStyle="'color:#999;font-size:30rpx'"
v-model="form.mobile" placeholder="请输入手机号" :border="false" shape="circle" clearable></input>
</view>
</view>
</view>
<view class="login-btn">
<view class="login-btn-btn" @click="submit"> </view>
</view>
</u-popup>
</u-popup>
<tabbar :currentPage="2"></tabbar>
</view>
</template>
@ -70,47 +87,49 @@
toast,
shareInfo
} from "@/common/util.js"
import tabbar from '@/components/tabbar/tabbar.vue';
export default{
components:{
tabbar
import tabbar from '@/components/tabbar/tabbar.vue';
export default {
components: {
tabbar
},
data() {
return {
navBarTop: 0,
showPhone:false,
navBarTop: 0,
showPhone: false,
info: {},
headReplace: require('@/static/share.jpg'),
showform: false,
maskClose: false,
imgurl: '',
form: {
nickname: '',
mobile:''
nickname: '',
mobile: ''
},
list: [{
title: '我的订单',
icon:'order',
url: '/packages/myorder/myorder',
},{
title: '我的积分',
icon:'coupon',
url: '/packages/my/score',
},
// {
// title: '',
// icon:'search',
// url: '/packages/card/index',
// },
{
title: '我的地址',
icon:'map',
url: '/packages/my/address',
},{
title: '意见反馈',
icon:'info-circle',
url: '/packages/my/feedback',
}]
title: '我的订单',
icon: 'order',
url: '/packages/myorder/myorder',
}, {
title: '我的积分',
icon: 'coupon',
url: '/packages/my/score',
},
// {
// title: '',
// icon:'search',
// url: '/packages/card/index',
// },
{
title: '我的地址',
icon: 'map',
url: '/packages/my/address',
}, {
id: 'feedback',
title: '意见反馈',
icon: 'info-circle',
// url: '/packages/my/feedback',
}
]
}
},
onShareAppMessage() {
@ -122,34 +141,34 @@
onLoad() {
const MenuButton = uni.getMenuButtonBoundingClientRect()
this.navBarTop = MenuButton.top //
},
onShow() {
this.getInitUser()
},
onShow() {
this.getInitUser()
},
methods: {
onChooseAvatar(e) {
console.log("e",e)
onChooseAvatar(e) {
console.log("e", e)
uni.uploadFile({
url: baseUrl + "/api/mobile/user/upload",
filePath: e.detail.avatarUrl,
name: 'file',
header:{
'Authorization' : `Bearer ${this.vuex_token}`
name: 'file',
header: {
'Authorization': `Bearer ${this.vuex_token}`
},
success: (res) => {
uni.showToast({
title: '上传成功',
duration: 1000
})
this.imgurl = JSON.parse(res.data).url
})
this.imgurl = JSON.parse(res.data).url
this.form.headimgurl = this.imgurl
},
fail(res){
uni.showToast({
title: '上传失败',
duration: 1000
})
},
fail(res) {
uni.showToast({
title: '上传失败',
duration: 1000
})
}
})
},
@ -160,30 +179,30 @@
this.form.nickname = e.detail.value
}
},
getUserWxPhone(res) {
if(!res.detail.code){
this.showPhone = false
return
}
this.$u.api.getUserMobile({
code: res.detail.code,
iv:res.detail.iv,
encryptedData:res.detail.encryptedData
}).then(res => {
this.form.mobile = res.mobile
this.showPhone = false
this.showform = true
})
},
getUserWxPhone(res) {
if (!res.detail.code) {
this.showPhone = false
return
}
this.$u.api.getUserMobile({
code: res.detail.code,
iv: res.detail.iv,
encryptedData: res.detail.encryptedData
}).then(res => {
this.form.mobile = res.mobile
this.showPhone = false
this.showform = true
})
},
async getInitUser() {
const res = await this.$u.api.user()
this.$u.vuex('vuex_user', res.user)
this.form = res.user
this.imgurl = res.user.headimgurl ? res.user.headimgurl : ''
this.info = this.$u.deepClone(res.user);
if(isNull(res.user.mobile)){
this.showPhone = true
this.info = this.$u.deepClone(res.user);
if (isNull(res.user.mobile)) {
this.showPhone = true
}
},
submit() {
@ -198,10 +217,10 @@
})
},
toUrl(item) {
if(item.url){
uni.navigateTo({
url:item.url
})
if (item.url) {
uni.navigateTo({
url: item.url
})
}
},
}
@ -265,6 +284,23 @@
color: #666666;
border-bottom: 1px solid #e0e0e0;
button {
padding: 0;
margin: 0;
border: 1px solid transparent;
width: 100%;
background: transparent;
display: flex;
justify-content: space-between;
font-size: 28rpx;
color: #666666;
line-height: 1.5;
}
button::after {
border: none;
}
& image {
vertical-align: middle;
@ -344,7 +380,7 @@
&-btn {
box-shadow: 0.5px 3px 9px 0px rgba(235, 107, 85, 0.3);
background: #2979ff;
background: #ba8b45;
border-radius: 44rpx;
text-align: center;
height: 88rpx;
@ -356,6 +392,4 @@
}
}
}
</style>

@ -10,7 +10,7 @@
</view>
<view class="qrCodebox">
<view class="codeimg">
<image src="../../static/ewmimg.jpg" mode="widthFix"></image>
<image show-menu-by-longpress src="../../static/ewmimg.jpg" mode="widthFix"></image>
</view>
</view>
<view class="textbottom">长按扫码添加企业微信</view>

Loading…
Cancel
Save