Browse Source

订单消息推送,评论,注销功能

master
chenkainan 11 months ago
parent
commit
3046acdaef
  1. 12
      pages.json
  2. 14
      pages/index/index.vue
  3. 7
      subPackages/food/foodOrder.vue
  4. 5
      subPackages/hotelHomestay/order.vue
  5. 24
      subPackages/leyou/index.vue
  6. 5
      subPackages/line/orders.vue
  7. 54
      subPackages/order/detail.vue
  8. 13
      subPackages/order/trades.vue
  9. 7
      subPackages/techan/order.vue
  10. 2
      subPackages/user/getCoupon.vue
  11. 154
      subPackages/user/logout.vue
  12. 11
      subPackages/user/profile.vue

12
pages.json

@ -114,7 +114,7 @@
{
"path": "eventCalendar/eventCalendar",
"style": {
"navigationBarTitleText": "岁时雅集"
"navigationBarTitleText": "近期活动"
// "navigationStyle": "custom"
}
},
@ -328,13 +328,13 @@
{
"path": "leyou/index",
"style": {
"navigationBarTitleText": "乐游同里"
"navigationBarTitleText": "景点展览"
}
},
{
"path": "leyou/detail",
"style": {
"navigationBarTitleText": "乐游同里详情",
"navigationBarTitleText": "景点展览详情",
"navigationStyle": "custom"
}
},
@ -363,6 +363,12 @@
"style": {
"navigationBarTitleText": "用户评价"
}
},
{
"path": "user/logout",
"style": {
"navigationBarTitleText": "注销账号"
}
}
]
}],

14
pages/index/index.vue

@ -58,7 +58,7 @@
<view v-if="scenicList && scenicList.length > 0">
<view class="title-box flex-between">
景点展览
<view @click="gotoPath('/subPackages/ticketBooking/ticketBooking')">更多<image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcon.png" mode=""></image></view>
<view @click="gotoPath('/subPackages/leyou/index')">更多<image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcon.png" mode=""></image></view>
</view>
<view class="scenic-box">
<view v-for="(item,index) in scenicList" :key="index" @click="gotoScenic(item)">
@ -138,27 +138,27 @@
navList: [
{
img: 'syyj',
text: '岁月雅集',
text: '近期活动',
path: '/subPackages/eventCalendar/eventCalendar'
},
{
img: 'sxly',
text: '膳香留韵',
text: '美食推荐',
path: '/subPackages/food/foodList'
},
{
img: 'xjsg',
text: '栖居水阁',
text: '酒店民宿',
path: '/subPackages/hotelHomestay/hotelHomestay'
},
{
img: 'fyty',
text: '风雅体验',
text: '特色体验',
path: '/subPackages/line/lineList'
},
{
img: 'ssfw',
text: '水市风物',
text: '水乡特产',
path: '/subPackages/techan/techanList'
},
{
@ -173,7 +173,7 @@
},
{
img: 'lfys',
text: '里坊轶事',
text: '找车位',
// path: '/subPackages/webPage/webPage?url='+ encodeURIComponent('https://yandumap.sz-trip.com/')
}
],

7
subPackages/food/foodOrder.vue

@ -153,10 +153,13 @@
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
success: () => {
this.getSubscribeMessage()
},
fail() {
uni.navigateTo({
url: '/subPackages/order/trades'
});
})
}
});
}

5
subPackages/hotelHomestay/order.vue

@ -350,7 +350,10 @@
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
success: () => {
this.getSubscribeMessage()
},
fail() {
uni.navigateTo({
url: '/subPackages/order/trades'
})

24
subPackages/leyou/index.vue

@ -21,6 +21,10 @@
</view>
</swiper-item>
</swiper>
<view class="current-box">
<view :class="['current-item', {'current-items': current == index}]" v-for="(item,index) in list" :key="index"></view>
</view>
</view>
</template>
@ -150,4 +154,24 @@
}
}
}
.current-box {
position: absolute;
bottom: 70rpx;
left: 0;
display: flex;
width: 750rpx;
justify-content: center;
.current-item {
width: 13rpx;
height: 13rpx;
background: rgba(36, 139, 170, .3);
border-radius: 7rpx;
margin-right: 6rpx;
}
.current-items {
background: #248BAA;
}
}
</style>

5
subPackages/line/orders.vue

@ -266,7 +266,10 @@
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
success: () => {
this.getSubscribeMessage()
},
fail() {
uni.navigateTo({
url: '/subPackages/order/trades'
})

54
subPackages/order/detail.vue

@ -29,7 +29,7 @@
<image :src="item.qrcodeimg" style="width: 300rpx;height: 300rpx;" mode="aspectFill"></image>
<canvas :id="'qrcodeT'+index" :canvas-id="'qrcodeT'+index"
style="width:150px;height:150px;z-index: -20;bottom: -500px;position: absolute;"></canvas>
<view class="qrcode-subtitle">核销码:{{item.child_id}}</view>
<view class="qrcode-subtitle">核销码:{{item.third_order_id ? item.third_order_id : item.child_id}}</view>
<view class="complete-text flex-center"
v-if="['WAIT_REFUND','REFUND_SUCCESS','WAIT_COMMENT','COMPLETE'].includes(item.status)">
@ -141,7 +141,7 @@
<!-- 产品详情 -->
<view class="pgoods-detail">
商家名称
<view class="pgoods-product" v-for="(item,index) in info.order_child" :key="index">
<view class="pgoods-product" v-for="(item,index) in info.order_child" :key="index" :style="{paddingBottom: item.status == 'WAIT_COMMENT' ? '107rpx' : ''}">
<image :src="showImg(item.specifications_image)" mode="aspectFill" class="product-img"></image>
<view class="product-content flex-column">
<view class="product-title">{{item.goods_title}}</view>
@ -150,6 +150,7 @@
<span>x{{item.num}}</span>
</view>
</view>
<view class="evaluate-btn flex-center" v-if="item.status == 'WAIT_COMMENT'" @click="goComment(index)">去评价</view>
</view>
<!-- 商品价格 -->
@ -383,7 +384,8 @@
关闭订单
</view>
<view class="btn" v-if="info.status == 'WAIT_COMMENT'" @click="goComment">
<view class="btn" v-if="(info.status == 'WAIT_COMMENT' && info.order_child[0].goods_genre != 'pgoods') ||
(info.status == 'WAIT_COMMENT' && info.order_child[0].goods_genre == 'pgoods' && info.order_child[0].contact_id && info.order_child[0].extract_id)" @click="goComment(0)">
立即评价
</view>
@ -467,14 +469,14 @@
},
methods: {
//
goComment() {
let order_id = ''
for(let item of this.info.order_child) {
if (item.status == 'WAIT_COMMENT') {
order_id = item.order_id
break;
}
}
goComment(index) {
let order_id = this.info.order_child[index].order_id
// for(let item of this.info.order_child) {
// if (item.status == 'WAIT_COMMENT') {
// order_id = item.order_id
// break;
// }
// }
uni.navigateTo({
url: '/subPackages/order/writeComment?order_id=' + order_id
})
@ -523,7 +525,11 @@
.includes(this.info.status)) {
this.isQrcode = true
for (let i = 0; i < this.info.order_child.length; i++) {
if(this.info.order_child[i].third_order_id) {
this.getCodeImg(this.info.order_child[i].third_order_id, i);
}else {
this.getCodeImg(this.info.order_child[i].child_id, i);
}
//
if (this.info.order_child[i].status == 'SUCCESS') this.remainNum += 1
@ -685,12 +691,23 @@
signType: res.data.signType,
timeStamp: res.data.timeStamp,
success: () => {
const templateIds = [
// 退
'hRZoiEES2BWtKb6Xgsnn8khLQH9un5j_11qu0bwlhfE',
//
'YyTCUIYBnrj9CyKks8cOjNX_Rk8a4yVdswMP-zXVbhc'
]
uni.requestSubscribeMessage({
tmplIds: templateIds,
complete (res) {
that.getDetail();
uni.$emit("updateDataByConnect", {
msgType: 'updateOrderTrades',
data: {}
})
}
})
}
});
}
});
@ -1018,6 +1035,7 @@
margin-top: 24rpx;
padding-bottom: 33rpx;
border-bottom: 1rpx solid #D8D8D8;
position: relative;
.product-img {
width: 140rpx;
@ -1055,6 +1073,20 @@
}
}
}
.evaluate-btn {
width: 147rpx;
height: 53rpx;
border-radius: 27rpx;
border: 1rpx solid #999999;
font-weight: 500;
font-size: 27rpx;
color: #000000;
margin-left: auto;
position: absolute;
right: 0;
bottom: 26rpx;
}
}
}

13
subPackages/order/trades.vue

@ -167,11 +167,22 @@
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
success: () => {
const templateIds = [
// 退
'hRZoiEES2BWtKb6Xgsnn8khLQH9un5j_11qu0bwlhfE',
//
'YyTCUIYBnrj9CyKks8cOjNX_Rk8a4yVdswMP-zXVbhc'
]
uni.requestSubscribeMessage({
tmplIds: templateIds,
complete (res) {
that.list = [];
that.finished = false;
that.getList()
}
})
}
});
}
});

7
subPackages/techan/order.vue

@ -576,10 +576,13 @@ export default {
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
success: () => {
this.getSubscribeMessage()
},
fail() {
uni.navigateTo({
url: '/subPackages/order/trades'
});
})
}
});
}

2
subPackages/user/getCoupon.vue

@ -38,7 +38,7 @@
}
},
onReady() {
this.getHeadImg('line').then(res => {this.headImg = res})
this.getHeadImg('coupon').then(res => {this.headImg = res})
},
onShow() {
this.getList()

154
subPackages/user/logout.vue

@ -0,0 +1,154 @@
<template>
<view class="bg">
<image src="https://static.ticket.sz-trip.com/tongli/images/user/logout.png" class="logoutImg"></image>
<view class="title">用户注销协议</view>
<view class="text" v-html="formateRichText(content)"></view>
<footer>
<view>
<!-- <view class="dui-box" :style="{backgroundImage: isTrue ? 'url(https://static.ticket.sz-trip.com/tongli/images/user/duis.png)' : '',
border: isTrue ? '' : '1rpx solid #515150'}"
@click="isTrue = !isTrue"></view>
您已经同意用户注销协议 -->
</view>
<view class="flex-between">
<view class="btn flex-center" @click="goBack">取消</view>
<view class="btn flex-center" v-if="time != 0">查看协议({{time}}s)</view>
<view class="btn btns flex-center" v-else @click="confirmLogout">确认注销</view>
</view>
</footer>
</view>
</template>
<script>
export default {
data() {
return {
content: '',
isTrue: false,
time: 8
}
},
onShow() {
this.Post({
id: 10274
},'/api/article/getArticleById').then(res => {
if(res.code == 1) {
this.content = res.data.content
var countdown = setInterval(() => {
this.time --
if(this.time == 0) {
clearInterval(countdown)
}
},1000)
}
})
},
methods: {
confirmLogout() {
uni.showModal({
title: '提示',
content: '确认注销账号?',
success: successRes => {
if (successRes.confirm) {
this.Post({
protocol: 1
},'/api/user/user_logout').then(res => {
if(res.code == 1) {
uni.showToast({
title: '注销成功',
icon: 'none'
})
this.$store.commit('changeUserInfo', {})
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
})
},1000)
}
})
}
}
});
}
}
}
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
background-color: #fff;
padding: 88rpx 0 250rpx;
}
.logoutImg {
display: block;
width: 120rpx;
height: 120rpx;
margin: 0 auto;
}
.title {
font-weight: bold;
font-size: 40rpx;
color: #000000;
margin: 60rpx auto 50rpx;
text-align: center;
}
.text {
padding: 0 40rpx;
}
footer {
position: absolute;
bottom: 0;
left: 0;
padding: 0 68rpx;
width: 100%;
.dui-box {
width: 40rpx;
height: 40rpx;
margin-right: 19rpx;
background-size: 100% 100%;
border-radius: 50%;
}
&>view:first-child {
display: flex;
align-items: center;
font-weight: 500;
font-size: 24rpx;
color: #000000;
}
&>view:last-child {
margin: 53rpx 0 67rpx;
.btn {
width: 267rpx;
height: 80rpx;
background: #BFBFBF;
border-radius: 40rpx;
font-weight: 500;
font-size: 36rpx;
color: #FFFFFF;
}
&>view:nth-child(1) {
border: 3rpx solid #C3282E;
font-weight: 500;
color: #C3282E;
background: #fff;
}
.btns {
background: #C3282E;
color: #FFFFFF;
}
}
}
</style>

11
subPackages/user/profile.vue

@ -26,6 +26,10 @@
<view class="uni-input">{{birthday}}</view>
</picker>
</view>
<navigator url="/subPackages/user/logout" tag="view" class="userinfo-item">
<span>注销账号</span>
<i>注销后账号无法恢复请谨慎操作</i>
</navigator>
<view class="btn-tao" @click="submit">保存</view>
</view>
@ -307,6 +311,13 @@
font-weight: 500;
font-size: 31rpx;
flex-shrink: 0;
color: #000;
}
.userinfo-item i {
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.userinfo-item {

Loading…
Cancel
Save