完善定位功能
This commit is contained in:
201
bundle/pages/coupon/coupon.vue
Normal file
201
bundle/pages/coupon/coupon.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<view class="coupon">
|
||||
<view>
|
||||
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color="themeColor" height="96"></u-tabs>
|
||||
</view>
|
||||
|
||||
<view class="u-relative" v-if="current === 0">
|
||||
<view class="package u-text-center u-p-t-22 u-p-b-28">
|
||||
<view class="bold-500">超级省钱券包</view>
|
||||
<view>超值权益一单回本</view>
|
||||
</view>
|
||||
|
||||
<view class="list u-absolute left-0 right-0">
|
||||
<view class="block br20">
|
||||
<view class="row-between">
|
||||
<view>
|
||||
<view class="row">
|
||||
<u-image :src="cloudPath + 'img/icon_package1.png'" width="34" height="28"></u-image>
|
||||
<view class="text-333 u-m-l-10 nr">券包</view>
|
||||
</view>
|
||||
<view class="text-755023 xs u-m-t-10">
|
||||
<text>2元最低可抵111元/共<text class="primary">1</text>张券</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-relative">
|
||||
<u-image :src="cloudPath + 'img/icon_package2.png'" width="220" height="60"></u-image>
|
||||
<view class="text-755023 u-absolute price xs">¥2.00</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coupon-bg u-m-t-32">
|
||||
<view class="xxs u-text-center u-p-t-4 text-845F2E">满减券x1</view>
|
||||
<view class="bold-600 u-text-center u-p-t-26">
|
||||
<price-format color="#FF0000" :price="121.99" :subscriptSize="32" :firstSize="52" :secondSize="52"></price-format>
|
||||
</view>
|
||||
<view class="text-D8A658 u-text-center u-p-t-32">满11元可用</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="coupon-list u-m-t-12" v-if="current === 1">
|
||||
<view class="coupon-list-bg row-between">
|
||||
<view class="row-start row-column u-row-center u-text-center">
|
||||
<view>
|
||||
<price-format :color="themeColor" :price="121" :subscriptSize="40" :firstSize="72" :secondSize="72"></price-format>
|
||||
</view>
|
||||
<view class="full">满20元可用</view>
|
||||
</view>
|
||||
<view class="flex1 u-m-l-80 row-between">
|
||||
<view>
|
||||
<view class="coupon-text bold-600">优惠券</view>
|
||||
<view class="xs u-m-t-20 date">有效期3天</view>
|
||||
</view>
|
||||
<view>
|
||||
<u-button @click="mpLogin" hover-class="none" :customStyle="{width: '160rpx', height: '56rpx', backgroundColor: themeColor, color: '#fff', border: 'none', borderRadius: '100rpx', fontSize: '24rpx'}" :hair-line="false">立即兑换</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="coupon-list-bg row-between">
|
||||
<view class="row-start row-column u-row-center u-text-center">
|
||||
<view>
|
||||
<price-format :color="themeColor" :price="121" :subscriptSize="40" :firstSize="72" :secondSize="72"></price-format>
|
||||
</view>
|
||||
<view class="full">满20元可用</view>
|
||||
</view>
|
||||
<view class="flex1 u-m-l-80 row-between">
|
||||
<view>
|
||||
<view class="coupon-text bold-600">优惠券</view>
|
||||
<view class="xs u-m-t-20 date">有效期3天</view>
|
||||
</view>
|
||||
<view>
|
||||
<u-button @click="mpLogin" hover-class="none" :customStyle="{width: '160rpx', height: '56rpx', backgroundColor: themeColor, color: '#fff', border: 'none', borderRadius: '100rpx', fontSize: '24rpx'}" :hair-line="false">立即兑换</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="coupon-list-bg row-between">
|
||||
<view class="row-start row-column u-row-center u-text-center">
|
||||
<view>
|
||||
<price-format :color="themeColor" :price="121" :subscriptSize="40" :firstSize="72" :secondSize="72"></price-format>
|
||||
</view>
|
||||
<view class="full">满20元可用</view>
|
||||
</view>
|
||||
<view class="flex1 u-m-l-80 row-between">
|
||||
<view>
|
||||
<view class="coupon-text bold-600">优惠券</view>
|
||||
<view class="xs u-m-t-20 date">有效期3天</view>
|
||||
</view>
|
||||
<view>
|
||||
<u-button @click="mpLogin" hover-class="none" :customStyle="{width: '160rpx', height: '56rpx', backgroundColor: themeColor, color: '#fff', border: 'none', borderRadius: '100rpx', fontSize: '24rpx'}" :hair-line="false">立即兑换</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
name: '购买'
|
||||
},
|
||||
{
|
||||
name: '兑换'
|
||||
}
|
||||
],
|
||||
current: 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change(index) {
|
||||
this.current = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.text-755023 {color: #755023;}
|
||||
.text-845F2E {color: #845F2E;}
|
||||
.text-D8A658 {color: #D8A658;}
|
||||
|
||||
.coupon {
|
||||
.package {
|
||||
background-color: #2D2622;
|
||||
height: 180rpx;
|
||||
|
||||
& > view:first-child {
|
||||
font-size: 64rpx;
|
||||
background: linear-gradient(90deg, #FDE0B4 0%, #FFC07F 100%);
|
||||
letter-spacing: 1px;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
& > view:last-child {
|
||||
font-size: 30rpx;
|
||||
background: linear-gradient(270deg, #FDE0B4 0%, #FFC07F 100%);
|
||||
letter-spacing: 1px;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
background-color: #F6F6F6;
|
||||
border-top-left-radius: 24rpx;
|
||||
border-top-right-radius: 24rpx;
|
||||
top: 160rpx;
|
||||
padding: 30rpx 24rpx;
|
||||
|
||||
.block {
|
||||
height: 386rpx;
|
||||
background: #FBE9CC;
|
||||
border: 2rpx solid #E0B66C;
|
||||
padding: 24rpx 36rpx 24rpx;
|
||||
|
||||
.price {
|
||||
left: 22rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.coupon-bg {
|
||||
width: 207rpx;
|
||||
height: 196rpx;
|
||||
background: url(#{$cloudPath}img/icon_package3.png) no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-list {
|
||||
.coupon-list-bg {
|
||||
height: 176rpx;
|
||||
background: url(#{$cloudPath}img/icon_coupon2.png) no-repeat;
|
||||
background-size: cover;
|
||||
margin: 0 32rpx 32rpx;
|
||||
padding: 0 32rpx;
|
||||
|
||||
.full {
|
||||
font-size: 20rpx;
|
||||
color: rgba(0, 0, 0, .4);
|
||||
}
|
||||
|
||||
.coupon-text {
|
||||
color: #1D2129;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.date {
|
||||
color: rgba(0, 0, 0, .4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
52
bundle/pages/points/points_shop.vue
Normal file
52
bundle/pages/points/points_shop.vue
Normal file
@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<view class="points-shop u-relative">
|
||||
<view>
|
||||
<u-swiper height="500" :list="list" border-radius="0"></u-swiper>
|
||||
</view>
|
||||
|
||||
<view class="u-m-24">
|
||||
<view class="bg-white br24 set-menu">
|
||||
<view class="nr">煎饼果子套餐</view>
|
||||
<view class="primary u-m-t-8">100.00积分+39.90元</view>
|
||||
<view class="text-999 row-between u-m-t-8">
|
||||
<view>销量:973</view>
|
||||
<view>库存:973</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bg-white fixed left-0 right-0 bottom-0 u-m-b-16 excharge">
|
||||
<u-button @click="mpLogin" hover-class="none" :customStyle="{height: '80rpx', backgroundColor: themeColor, color: '#fff', border: 'none', borderRadius: '116rpx'}" :hair-line="false">立即兑换</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
image: "http://jianbing-media.stnav.com/frontend/img/banner.png",
|
||||
title: "昨夜星辰昨夜风,画楼西畔桂堂东",
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.points-shop {
|
||||
.set-menu {
|
||||
height: 177rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
|
||||
.excharge {
|
||||
padding: 16rpx 48rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
54
bundle/pages/setting/setting.vue
Normal file
54
bundle/pages/setting/setting.vue
Normal file
@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-cell-group :border="false">
|
||||
<u-cell-item title="退出登录" :border-bottom="false" @click="logout" hover-class="none"></u-cell-item>
|
||||
</u-cell-group>
|
||||
|
||||
<u-modal v-model="showLogout" :content="content" :show-cancel-button="true" @confirm="confirmLogout"></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {userLogout} from '@/api/user'
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showLogout: false,
|
||||
content: '确定退出登录'
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
logout() {
|
||||
this.showLogout = true
|
||||
},
|
||||
|
||||
confirmLogout() {
|
||||
console.log(this.token)
|
||||
// 退出登录
|
||||
userLogout({
|
||||
token: this.token
|
||||
}).then((res) => {
|
||||
if (res.code == 1) {
|
||||
this.$store.commit('LOGOUT')
|
||||
this.$toast({
|
||||
title: '退出成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user