master
lion 1 year ago
parent 7b3b0c9ade
commit 0bcaafbaf2

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

@ -7,7 +7,9 @@
<view class="orderBox">
<view class="p">
下单日期<text class="font_red">{{$u.timeFormat(new Date(info.created_at.replace(/-/g,'/')), 'yyyy年mm月dd日 hh:MM')}}</text>
下单日期<text class="font_red">
{{item.created_at?$u.timeFormat(new Date(info.created_at.replace(/-/g,'/')), 'yyyy年mm月dd日 hh:MM'):''}}
</text>
</view>
<view class="p">
订单编号<text class="font_red">{{info.serial}}</text>

@ -369,7 +369,7 @@
<view class="codeOuter">
<view class="shareCon" @click="shareClose">
<canvas
style="width:90%;margin-left:5%;position: absolute;"
style="width:90%;margin-left:5%;position: absolute;background-color: transparent;"
:style="{ height:isType3?(shareHeight*scare)*.89 +10 + 'px':(shareHeight*scare)+ 'px', marginTop:(cropperH-(shareHeight*scare))/2+'rpx'}"
canvas-id="firstCanvas" id="firstCanvas"></canvas>
<!-- <image class="shareBg" mode="widthFix" src="../../static/bg_haibao@2x.png"></image> -->
@ -592,7 +592,8 @@
api: "/api/member/active-list",
data: {
page: 1,
page_size: 3
page_size: 3,
review:1
},
utilSuccess: res => {
this.activityList = res.data
@ -830,7 +831,8 @@
let active_name2 = this.info.active_name.length>17?this.info.active_name.substring(17,this.info.active_name.length-1):''
ctx.fillText("" + active_name1, 40, (h + 50) * 0.5 + 50);
ctx.fillText("" + active_name2, 40, (h + 50) * 0.5 + 70);
ctx.fillText("活动时间:" + this.info.apply_start, 40, (h + 50) * 0.5 + 120);
ctx.fillText("活动时间:" + this.info.start_date+ ' ' +
this.info.start_time, 40, (h + 50) * 0.5 + 120);
ctx.fillText("活动地点:" + address1, 40, (h + 50) * 0.5 + 140);
ctx.fillText("" + address2, 40, (h + 50) * 0.5 + 160);
let user_info = uni.getStorageSync("user_info_yunyuhui");

Loading…
Cancel
Save