|
|
|
|
@ -29,13 +29,16 @@
|
|
|
|
|
<view class="infoCol">
|
|
|
|
|
<view class="date">
|
|
|
|
|
<image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>
|
|
|
|
|
{{$u.timeFormat(new Date(item.created_at.replace(/-/g,'/')), 'yyyy年mm月dd日')}}
|
|
|
|
|
{{item.created_at?$u.timeFormat(new Date(item.created_at.replace(/-/g,'/')), 'yyyy年mm月dd日'):''}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="price"><text>¥</text>{{item.total}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!--<view class="infoCol"><view class="address"><image mode="heightFix" src="../../static/icon_dizhi.png"></image>苏州·园区星海街188号苏州万怡大酒店南栋大酒店南栋</view></view>-->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<text class="subBtn cancel"
|
|
|
|
|
v-if="item.state!='unpaid'&&item.bookable_type=='product'&&item.items.state=='pending'"
|
|
|
|
|
@click.stop="tocancelApply(item.items.id)">退单</text>
|
|
|
|
|
<text @click.stop="goDetail(item.id)">详情</text>
|
|
|
|
|
<text @click.stop="goProDetail(item.bookable_id)">查看</text>
|
|
|
|
|
<text v-if="item.state=='unpaid'" class="pay" @click.stop="goPay(item.id)"> 支付 </text>
|
|
|
|
|
@ -74,7 +77,22 @@
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn"><text>投诉</text></view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 授权 -->
|
|
|
|
|
<u-popup v-model="showUser" mode="center" closeable="true">
|
|
|
|
|
<view class="userBox" style="padding: 20rpx;">
|
|
|
|
|
<view class="userInfoContent" style="padding: 80rpx;font-size: 28rpx;">
|
|
|
|
|
<text class="">您还未登陆,或登陆已过期,请重新登陆</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="userBoxBottom" style='display: flex;'>
|
|
|
|
|
<button class="userBoxBottomCol" @click="touserInfoClose"
|
|
|
|
|
style="border-radius:0;flex:1;margin:10rpx">暂不登陆</button>
|
|
|
|
|
<button class="userBoxBottomCol btnuserBoxBottomCol" @click="getUserProfile"
|
|
|
|
|
style="border-radius:0;flex:1;margin:10rpx">微信一键登录</button>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -114,11 +132,18 @@
|
|
|
|
|
showStatus:true
|
|
|
|
|
}],
|
|
|
|
|
user_info: {},
|
|
|
|
|
openid: ""
|
|
|
|
|
openid: "",
|
|
|
|
|
showUser:false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
const userInfo = uni.getStorageSync('userInfo')
|
|
|
|
|
const userInfo = uni.getStorageSync('userInfo')
|
|
|
|
|
console.log("userInfo",weixin.isNull(userInfo.access_token))
|
|
|
|
|
|
|
|
|
|
if(weixin.isNull(userInfo.access_token)){
|
|
|
|
|
this.showUser = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.info.phone = userInfo.user_info.phone
|
|
|
|
|
this.token = userInfo.access_token;
|
|
|
|
|
var that = this;
|
|
|
|
|
@ -127,16 +152,95 @@
|
|
|
|
|
weixin.getOpenidInfo(info => {
|
|
|
|
|
that.user_info = info.user_info
|
|
|
|
|
}, false)
|
|
|
|
|
this.openid = that.user_info.openid;
|
|
|
|
|
this.openid = that.user_info.openid;
|
|
|
|
|
this.list = []
|
|
|
|
|
this.getOrderList(1)
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
this.list = []
|
|
|
|
|
this.getOrderList(1)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
this.getOrderList(this.page + 1)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
tocancelApply(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: "请输入退单理由",
|
|
|
|
|
editable:true,
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
console.log(res)
|
|
|
|
|
weixin.request({
|
|
|
|
|
api: '/api/member/order-item-cancel',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: {
|
|
|
|
|
id: id,
|
|
|
|
|
remark:res.content
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
if (res.status == 1) {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: "已申请退款,请等待平台确认",
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
this.list = []
|
|
|
|
|
that.getOrderList(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
utilFail: res => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res,
|
|
|
|
|
duration:1500
|
|
|
|
|
})
|
|
|
|
|
console.log(res);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
console.log('用户点击取消');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
touserInfoClose(){
|
|
|
|
|
this.showUser = false
|
|
|
|
|
},
|
|
|
|
|
getUserProfile() {
|
|
|
|
|
let that = this
|
|
|
|
|
weixin.getUserProfile((res) => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
weixin.request({
|
|
|
|
|
api: '/api/member/update-wechat-info',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: {
|
|
|
|
|
nickname: res.nickName,
|
|
|
|
|
avatar: res.avatarUrl
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(r) {
|
|
|
|
|
console.log(r)
|
|
|
|
|
if (r.status == 1) {
|
|
|
|
|
weixin.getOpenidInfo(openidInfo => {
|
|
|
|
|
uni.removeStorageSync("userInfo")
|
|
|
|
|
uni.setStorageSync("userInfo", openidInfo)
|
|
|
|
|
}, true)
|
|
|
|
|
that.showUser = false
|
|
|
|
|
that.getOrderList(1)
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: r.data.msg,
|
|
|
|
|
duration: 2000,
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
timeFormat(time,format){
|
|
|
|
|
//this.util.
|
|
|
|
|
},
|
|
|
|
|
@ -257,7 +361,22 @@
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.userBoxBottom {
|
|
|
|
|
.userBoxBottomCol {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btnuserBoxBottomCol {
|
|
|
|
|
background: linear-gradient(90deg, #FF7E95 0%, #FF447B 100%);
|
|
|
|
|
border-radius: 36rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 72rpx;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.content {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|