Commit 956dd105 by wangjian

1

parent 8ce583e6
import store from '../store/index.js'; import store from '../store/index.js';
import router from '../router/router.js'
// 测试环境 // 测试环境
const base_url = 'https://sandbox-api-welfare.wasair.com/api.v1/lite' const base_url = 'https://sandbox-api-welfare.wasair.com/api.v1/lite'
...@@ -16,6 +17,11 @@ export function post (url, params) { ...@@ -16,6 +17,11 @@ export function post (url, params) {
header: headerCom(params), header: headerCom(params),
data: newParams, data: newParams,
success(res) { success(res) {
if (res.code == 301) {
tokenSave('')
router.push('Login')
return
}
if(res.code == 302) { if(res.code == 302) {
tokenSave(res.data.token) tokenSave(res.data.token)
post(url, params) post(url, params)
...@@ -53,6 +59,11 @@ export function get (url, params) { ...@@ -53,6 +59,11 @@ export function get (url, params) {
header: headerCom(params), header: headerCom(params),
data: newParams, data: newParams,
success(res) { success(res) {
if (res.code == 301) {
tokenSave('')
router.push('Login')
return
}
if(res.code == 302) { if(res.code == 302) {
tokenSave(res.data.token) tokenSave(res.data.token)
post(url, params) post(url, params)
......
<template>
<view class="container">
<view class="content">
<image class="close" src="../../static/close-gray.png" mode="" @click="close()"></image>
<view class="title">选择卡券状态</view>
<view class="select">
<view class="item" @click="selectType = 10">
<image class="img" v-if="selectType === 10" src="../../static/select-h.png" mode=""></image>
<image class="img" v-else src="../../static/select-n.png" mode=""></image>
<view class="text">待使用</view>
</view>
<view class="item" @click="selectType = 20">
<image class="img" v-if="selectType === 20" src="../../static/select-h.png" mode=""></image>
<image class="img" v-else src="../../static/select-n.png" mode=""></image>
<view class="text">已使用</view>
</view>
</view>
<view @click="$emit('change', selectType)" class="buy-bottom" :style="{'background-color':'#FF0520'}">确定</view>
</view>
</view>
</template>
<script>
export default {
name:"AlertSelectStatus",
data() {
return {
selectType: this.useState || 10
};
},
props: {
useState: {
type: Number
},
closeName: {
type: String
}
},
methods: {
close() {
this.$parent[this.closeName] = false
}
}
}
</script>
<style lang="scss" scoped>
.container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: 0.7);
z-index: 99999;
.content {
margin: 50% 55rpx;
border-radius: 16rpx;
background-color: #FFFFFF;
padding: 48rpx 40rpx;
// width: 640rpx;
position: relative;
.close {
position: absolute;
top: 24rpx;
right: 24rpx;
height: 36rpx;
width: 36rpx;
}
.title {
font-size: 32rpx;
font-weight: bolder;
color: #333333;
line-height: 44rpx;
text-align: center;
}
.select {
display: flex;
padding: 48rpx 96rpx 0;
justify-content: space-between;
align-items: center;
.item {
display: flex;
align-items: center;
.img {
width: 32rpx;
height: 32rpx;
}
.text {
margin-left: 16rpx;
font-size: 32rpx;
color: #333333;
}
}
}
.buy-bottom {
margin-top: 70rpx;
border-radius: 40rpx;
height: 80rpx;
width: 560rpx;
background-color: rgba($color: #FF0520, $alpha: 0.5);
line-height: 82rpx;
text-align: center;
color: #FFFFFF;
font-size: 32rpx;
z-index: 99999;
margin-bottom: 32rpx;
}
}
}
</style>
\ No newline at end of file
<template>
<view>
</view>
</template>
<script>
export default {
name:"AlertUnlock",
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>
\ No newline at end of file
...@@ -116,7 +116,17 @@ ...@@ -116,7 +116,17 @@
"navigationStyle":"custom" "navigationStyle":"custom"
} }
} }
] ,{
"path" : "coupon/coupon",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle":"custom"
}
}
]
}], }],
"preloadRule":{ "preloadRule":{
"pagesA/login/login": { "pagesA/login/login": {
......
<template> <template>
<view class="container"> <view class="container">
<view class="empty" v-if="orderLists.length<=0 && loadingType != 'loading'"> <view class="empty" v-if="orderLists.length<=0 && loadingType != 'loading'">
<image class="empty-img" src="../../static/order/empty-order.png" mode=""></image> <!-- <image class="empty-img" src="../../static/order/empty-order.png" mode=""></image> -->
<view class="empty-text">暂无订单</view> <view class="empty-text">暂无订单</view>
</view> </view>
<view class="order-list"> <view class="order-list">
...@@ -54,19 +54,17 @@ ...@@ -54,19 +54,17 @@
}; };
}, },
onLoad() { onLoad() {
console.log(this.page);
this.getList()
}, },
onReachBottom () { onReachBottom () {
this.getList() this.getList()
}, },
onTabItemTap () { onTabItemTap () {
if (!this.$store.state.isLogin) { if (this.$store.state.isLogin) {
this.$router.push('login') this.$router.push('Login')
} }
this.orderLists = [] this.orderLists = []
this.page = 1 this.page = 1
this.loadingType = 'loading' this.loadingType = 'more'
this.getList() this.getList()
}, },
methods: { methods: {
...@@ -93,11 +91,19 @@ ...@@ -93,11 +91,19 @@
}, },
goDetails(item) { goDetails(item) {
this.$router.push('OrderDetail',{'orderId':item.orderSn}) this.$router.push('OrderDetail',{'orderId':item.orderSn})
},
goCoupon(item) {
this.$router.push('Coupon', {'orderId':item.orderSn})
} }
} }
} }
</script> </script>
<style>
page{
background-color: #F5F5F5;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
background-color: #F5F5F5; background-color: #F5F5F5;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</view> </view>
</view> </view>
<view class="coupon-btn" :style="{'height':safeAreaBottom+120+'rpx'}"> <view class="coupon-btn" :style="{'height':safeAreaBottom+120+'rpx'}">
<view class="btn" @click="goCoupon()"> <view class="btn" :style="{'background-color':orderData.state===200?'#FF0520':''}" @click="goCoupon()">
查看卡券 查看卡券
</view> </view>
</view> </view>
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
if (this.orderData.state === 100) { if (this.orderData.state === 100) {
this.toast('卡券生成中,请稍候…') this.toast('卡券生成中,请稍候…')
} else if (this.orderData.state === 200) { } else if (this.orderData.state === 200) {
this.$router.push('Coupon', {'orderId':this.orderData.orderSn})
} else { } else {
this.toast('兑换失败,无法查看') this.toast('兑换失败,无法查看')
} }
......
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
this.$net.post('/payment', {'orderId':this.orderId,'payPasswd':e}).then(res=>{ this.$net.post('/payment', {'orderId':this.orderId,'payPasswd':e}).then(res=>{
if (res.code === 200) { if (res.code === 200) {
this.showPwdAlert = false this.showPwdAlert = false
this.$router.push('OrderDetail',{'orderId':res.data.orderId})
} else { } else {
this.toast(res.message) this.toast(res.message)
} }
......
...@@ -13,7 +13,8 @@ const routers = { ...@@ -13,7 +13,8 @@ const routers = {
'Setting': '/pagesA/setting/setting', 'Setting': '/pagesA/setting/setting',
'VertifyPhone': '/pagesA/VertifyPhone/VertifyPhone', 'VertifyPhone': '/pagesA/VertifyPhone/VertifyPhone',
'SetPwd': '/pagesA/SetPwd/SetPwd', 'SetPwd': '/pagesA/SetPwd/SetPwd',
'OrderDetail': '/pagesA/orderDetail/orderDetail' 'OrderDetail': '/pagesA/orderDetail/orderDetail',
'Coupon': '/pagesA/coupon/coupon'
} }
export function push(routerName, params, events) { export function push(routerName, params, events) {
......
static/order-success.png

2.01 KB | W: | H:

static/order-success.png

1.23 KB | W: | H:

static/order-success.png
static/order-success.png
static/order-success.png
static/order-success.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment