Browse Source

修改了婚庆服务页面

v1
longjieli 6 months ago
parent
commit
8d81fc7d7a
10 changed files with 214 additions and 240 deletions
  1. +7
    -1
      api/api.js
  2. +3
    -3
      api/http.js
  3. +61
    -66
      components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
  4. +47
    -0
      components/configPopup/configPopup.vue
  5. +0
    -100
      components/showLogin/showLogin.vue
  6. +2
    -1
      pages.json
  7. +39
    -46
      pages/center/center.vue
  8. +23
    -11
      pages/login/login.vue
  9. +13
    -11
      pages/payment/payment.vue
  10. +19
    -1
      store/store.js

+ 7
- 1
api/api.js View File

@ -6,7 +6,7 @@ const config = {
// 修改个人信息接口
infoUpdateInfo: { url: '/cheer/info/updateInfo', method: 'POST', auth: true },
// 登录接口
loginLogin: { url: '/cheer/login/login', method: 'GET', },
loginLogin: { url: '/cheer/login/login', method: 'GET' },
// 获取个人信息接口
infoGetInfo: { url: '/cheer/info/getInfo', method: 'GET', auth: true },
//下单
@ -15,6 +15,12 @@ const config = {
getConfig: { url: '/cheer/info/getConfig', method: 'GET'},
//获取充值套餐
getRechargePage: { url: '/cheer/info/getRechargePage', method: 'GET'},
//获取加油流水订单
getOrderWaterPage: { url: '/cheer/info/getOrderWaterPage', method: 'GET'},
//获取隐私政策
getPrivacyPolicy: { url: '/cheer/login/getPrivacyPolicy', method: 'GET'},
//获取用户协议
getUserAgreement: { url: '/cheer/login/getUserAgreement', method: 'GET'},
}


+ 3
- 3
api/http.js View File

@ -28,9 +28,9 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
res.data.message == '操作失败,token非法无效!'){
uni.removeStorageSync('token')
console.error('登录过期');
// uni.navigateTo({
// url: '/pages/auth/login'
// })
uni.navigateTo({
url: '/pages/login/login'
})
}
if(res.statusCode == 200 && res.data.code != 200){


+ 61
- 66
components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue View File

@ -1,38 +1,50 @@
<template>
<uni-popup ref="privacyPopup" type="center" :is-mask-click="true">
<uv-popup ref="popup" z-index="99999" :closeOnClickOverlay="false" :customStyle="{ backgroundColor: 'transparent' }">
<view class="privacyPopup">
<view class="title">
<view class="title_circle"></view>
<view>惠享服务圈</view>
<view>协议与隐私政策</view>
</view>
<view class="content_pri">
<text>在你使用惠享服务圈服务之前请仔细阅读</text>
<text style="color: #1793ee;" @click="goToPrivacy">惠享服务圈小程序隐私保护指引</text>
<text>如你同意惠享服务圈小程序隐私保护指引请点击同意开始使用惠享服务圈</text>
<view class="text">
欢迎来到xx加油!我们根据最新的法律法规监管政策要求更新了用户协议隐私政策,请您认真阅读
</view>
</view>
<view class="config">
<uv-checkbox-group v-model="checkboxValue" shape="circle">
<view class="content">
<view style="display: flex;">
<uv-checkbox size="30rpx" :name="1"></uv-checkbox>
同意<text>xx加油隐私政策</text>
</view>
<view class="">
以及<text>用户协议</text>
</view>
</view>
</uv-checkbox-group>
</view>
<view class="pri_btn">
<button class="confuse_btn" @click="confusePrivacy">拒绝</button>
<!-- <button class="confuse_btn" @click="confusePrivacy">拒绝</button> -->
<button class="confirm_btn" id="agree-btn" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
</view>
</view>
</uni-popup>
</uv-popup>
</template>
<script setup>
<script>
export default {
name: 'PrivacyAgreementPoup',
data() {
return {
resolvePrivacyAuthorization: {},
checkboxValue : false
}
},
methods: {
//
init(resolve) {
this.$refs.privacyPopup.open()
this.$refs.popup.open('center')
this.resolvePrivacyAuthorization = resolve
},
@ -53,12 +65,12 @@
//
confusePrivacy() {
this.$refs.privacyPopup.close()
this.$refs.popup.close()
this.resolvePrivacyAuthorization({
event: 'disagree'
})
},
//
handleAgreePrivacyAuthorization() {
// id
@ -66,72 +78,55 @@
buttonId: 'agree-btn',
event: 'agree'
})
this.$refs.privacyPopup.close()
this.$refs.popup.close()
}
}
}
</script>
<style lang="scss" scoped>
// *{
// box-sizing: border-box;
// }
.privacyPopup {
width: 520rpx;
/* height: 500rpx; */
background-color: #fff;
border-radius: 50rpx;
padding: 20rpx 40rpx;
}
width: 90%;
margin: 0rpx auto;
background: white;
border-radius: 20rpx;
box-sizing: border-box;
padding: 40rpx 30rpx;
.title {
display: flex;
align-items: center;
justify-content: start;
margin: 20rpx 0;
font-size: 38rpx;
font-weight: 600;
}
.title {
text-align: center;
font-size: 36rpx;
}
.title .title_circle {
width: 60rpx;
height: 60rpx;
background-color: #efefef;
border-radius: 50%;
margin-right: 20rpx;
}
.content_pri {
padding: 30rpx 0rpx;
font-size: 28rpx;
}
.content_pri {
width: 480rpx;
margin: 0 auto;
font-size: 34rpx;
line-height: 1.5;
}
.config {
font-size: 28rpx;
text-align: center;
line-height: 40rpx;
margin-bottom: 30rpx;
.pri_btn {
width: 100%;
height: 158rpx;
display: flex;
align-items: center;
justify-content: space-evenly;
}
text {
color: #00aaff;
}
.content{
display: flex;
}
}
.pri_btn .confuse_btn,
.pri_btn .confirm_btn {
width: 200rpx;
height: 90rpx;
border-radius: 20rpx;
font-size: 34rpx;
}
.pri_btn {
.pri_btn .confuse_btn {
background-color: #eee;
color: #52bf6b;
}
button {
background: #00aaff;
outline: none;
color: white;
font-size: 30rpx;
}
.pri_btn .confirm_btn {
background-color: #52bf6b;
color: #fff;
}
}
</style>

+ 47
- 0
components/configPopup/configPopup.vue View File

@ -0,0 +1,47 @@
<template>
<view class="configPopup">
<uv-popup ref="popup" :round="30" :customStyle="{height: '50vh'}">
<view class="content">
<uv-parse :content="content"></uv-parse>
</view>
</uv-popup>
</view>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'configPoup',
data() {
return {
content : ''
}
},
onShow(){
console.log(this.getConfig);
},
methods: {
//
open(key){
console.log(key);
this.content = this.getConfig[key]
this.$refs.popup.open('bottom');
}
},
computed : {
...mapGetters(['getConfig'])
}
}
</script>
<style lang="scss" scoped>
.configPopup {
.content{
padding: 30rpx 20rpx;
}
}
</style>

+ 0
- 100
components/showLogin/showLogin.vue View File

@ -1,100 +0,0 @@
<template>
<uv-popup ref="popup"
:safeAreaInsetBottom="false"
type="bottom" round="30rpx">
<view class="toast">
<view class="title">
提示
</view>
<view class="content">
本小程序需要登录之后才可以正常使用
</view>
<view class="btns">
<view class="btn c" @click="login">
登录
</view>
</view>
</view>
</uv-popup>
</template>
<script setup>
export default {
name: 'ShowLogin',
data() {
return {
}
},
methods: {
checkLogin() {
if (!uni.getStorageSync('token')) {
this.$refs.popup.open('center');
return true
}
},
cancel() {
this.$refs.popup.close('center')
},
login(){
this.$store.commit('login')
this.$refs.popup.close('center')
}
}
}
</script>
<style lang="scss" scoped>
.toast {
width: 500rpx;
background: white;
.title {
min-height: 70rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
}
.content {
font-size: 28rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.btns{
display: flex;
padding: 30rpx;
.btn{
flex: 1;
background: #00aaff;
border-radius: 20rpx;
color: #fff;
padding: 20rpx 0;
text-align: center;
}
}
.btnstwo {
display: flex;
.btn {
flex: 1;
// background: $uni-linear-gradient-btn-color;
// color: #fff;
padding: 20rpx 0;
text-align: center;
}
.c {
background: #fff;
border-top: 1px solid #999;
color: #333;
}
}
}
</style>

+ 2
- 1
pages.json View File

@ -8,7 +8,8 @@
{
"path": "pages/center/center",
"style": {
"navigationBarTitleText": "个人中心"
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false
}
},
{


+ 39
- 46
pages/center/center.vue View File

@ -5,77 +5,86 @@
<view class="topBox">
<view class="users">
<view class="u-top" v-if="userInfo.appletOpenid">
<image
:src="userInfo.headImage"
mode=""></image>
<view class="tit"
>
<image class="img" :src="userInfo.headImage" mode="widthFix"></image>
<view class="tit">
{{ userInfo.nickName }}
</view>
</view>
<view class="u-top" v-else>
<image
<image class="img"
src="https://img2.baidu.com/it/u=2953585264,744730101&fm=253&fmt=auto&app=138&f=JPEG?w=360&h=360"
mode=""></image>
<view class="tit"
>
mode="widthFix"></image>
<view class="tit">
登录 / 注册
</view>
</view>
</view>
</view>
<view class="listBox">
<view class="lists">
<uni-section title="我的订单" type="line" titleFontSize="34rpx" style="border-radius: 10rpx;"></uni-section>
<uni-section title="我的订单" type="line" titleFontSize="34rpx"
style="border-radius: 10rpx;"></uni-section>
<view class="order-list">
<view v-for="(item,index) in 10" :key="index" class="order-item">
<view v-for="(item,index) in orderList" :key="item.id" class="order-item">
<view class="order-item-top">
<view class="order-id">420000243620240</view>
<view class="time">2024-12-12 12:12</view>
<view class="order-id">{{ item.id }}</view>
<view class="time">{{ item.createTime }}</view>
</view>
<div class="order-item-main">
<div class="title">付款金额</div>
<view class="money-detail">
<view class="unie"></view>
<view class="number">666</view>
<view class="number">{{ item.price }}</view>
</view>
</div>
</view>
</view>
<view v-if="false" class="no-data">
<image src="@/static/empty/noData.png" mode=""></image>
</view>
</view>
</view>
<showLogin ref="login"></showLogin>
</view>
</view>
</template>
<script>
import showLogin from '../../components/showLogin/showLogin.vue'
import { mapState } from 'vuex'
import {
mapState
} from 'vuex'
export default {
name : 'Center',
components : { showLogin },
computed : {
name: 'Center',
computed: {
...mapState(['userInfo']),
},
data() {
return {}
return {
queryParams: {
pageNo: 1,
pageSize: 10
},
orderList: []
}
},
onShow(){
if (!this.$refs.login.checkLogin()) {
onShow() {
if (uni.getStorageSync('token')) {
this.$store.commit('getUserInfo')
}
this.getOrderList()
},
//
onReachBottom() {
this.queryParams.pageSize += 10
this.getOrderList()
},
methods: {
//
getOrderList() {
this.$api('getOrderWaterPage', this.queryParams, res => {
this.orderList = res.result.records
})
},
}
}
</script>
@ -135,7 +144,7 @@
align-items: center;
}
.users .u-top image {
.users .u-top .img {
width: 130rpx;
height: 130rpx;
border-radius: 50%;
@ -224,26 +233,10 @@
align-items: center;
}
.o-item {
width: 25%;
text-align: center;
}
.o-item image {
width: 65rpx;
height: 55rpx;
}
.o-item .tit {
font-size: 28rpx;
margin-top: 10rpx;
}
.listBox {
margin: -10rpx auto 0;
padding: 20rpx;
box-sizing: border-box;
border-radius: 12rpx;
border-radius: 20rpx;
}
</style>

+ 23
- 11
pages/login/login.vue View File

@ -1,23 +1,23 @@
<template>
<view class="login">
<view class="logo">
<image src="/static/image/login/logo.png" mode=""></image>
<!-- <image src="/static/image/login/logo.png" mode=""></image> -->
</view>
<view class="title">
欢迎登录真视界
欢迎使用xx加油
</view>
<view class="btn mt">
<view class="icon">
<image src="/static/image/login/wx.png" mode=""></image>
<!-- <image src="/static/image/login/wx.png" mode=""></image> -->
</view>
<view class=""
@click="wxLogin">
微信授权手机号登录
微信授权登录
</view>
</view>
<view class="btn b2">
<!-- <view class="btn b2">
使用短信验证登录
</view>
</view> -->
@ -33,29 +33,40 @@
size="30rpx"
:name="1"
></uv-checkbox>
阅读并同意我们的<text>服务协议与隐私条款</text>
阅读并同意我们的<text @click="openConfigDetail('privacyAgreement')">服务协议与隐私条款</text>
</view>
<view class="">
以及<text>个人信息保护指引</text>
以及<text @click="openConfigDetail('userAgreement')">个人信息保护指引</text>
</view>
</view>
</uv-checkbox-group>
</view>
<configPopup ref="popup"></configPopup>
</view>
</template>
<script>
import configPopup from '../../components/config/configPopup.vue';
export default {
name : 'Login',
data() {
return {
checkboxValue : []
}
},
methods: {
wxLogin(){
this.$store.commit('login')
},
//
openConfigDetail(key){
this.$refs.popup.open(key)
}
}
}
</script>
@ -92,18 +103,19 @@
display: block;
height: 8rpx;
width: 210rpx;
background: linear-gradient(to right,#3c69f1, #fff);
background: linear-gradient(to right,#00aaff, #fff);
}
}
.btn{
width: 80%;
height: 100rpx;
background-color: #3c69f1;
background-color: #00aaff;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0;
border-radius: 20rpx;
.icon{
margin-right: 10rpx;
image{
@ -127,7 +139,7 @@
text-align: center;
line-height: 40rpx;
text{
color: #3c69f1;
color: #00aaff;
}
}
}


+ 13
- 11
pages/payment/payment.vue View File

@ -45,20 +45,16 @@
<uni-fab ref="fab" :content="content" :horizontal="horizontal" :vertical="vertical" :direction="direction"
@trigger="clickMenu" />
<showLogin ref="login"></showLogin>
</view>
</template>
<script setup>
import PrivacyAgreementPoup from "../../components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue";
import showLogin from "../../components/showLogin/showLogin.vue";
import PrivacyAgreementPoup from "@/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue";
import { mapState } from 'vuex'
export default {
name: 'Payment',
component: {
PrivacyAgreementPoup,
showLogin
components: {
PrivacyAgreementPoup
},
computed : {
...mapState(['configList']),
@ -88,10 +84,9 @@
wx.onNeedPrivacyAuthorization(resolve => {
console.log('onNeedPrivacyAuthorization');
this.resolvePrivacyAuthorization = resolve
this.$refs.showPrivacy.value.init(resolve)
this.$refs.showPrivacy.init(resolve)
})
}
this.getRechargePage()
},
methods: {
@ -117,8 +112,10 @@
},
submit() {
if (this.$refs.login.checkLogin()) {
return
if (!uni.getStorageSync('token')) {
return uni.navigateTo({
url: '/pages/login/login'
})
}
this.$api('createOrderPay', this.form, res => {
if(res.code == 200){
@ -143,6 +140,11 @@
// })
// }
// });
uni.showToast({
icon : 'none',
title: '支付成功'
});
}
})
},


+ 19
- 1
store/store.js View File

@ -11,7 +11,11 @@ const store = new Vuex.Store({
configList: {}, //配置对象
userInfo : {},
},
getters: {},
getters: {
getConfig(state){
return state.configList
}
},
mutations: {
// 初始化配置
initConfig(state) {
@ -25,10 +29,19 @@ const store = new Vuex.Store({
}
})
})
let apiConfig = [ 'getPrivacyPolicy' , 'getUserAgreement' ] //需要访问不同接口才能得到的配置数据
let key = ['privacyAgreement','userAgreement']
apiConfig.forEach((item,index) => {
api(item,res => {
state.configList[key[index]] = res.result
})
})
},
login(state) {
uni.login({
success(res) {
console.log(res);
if (res.errMsg != "login:ok") {
return
}
@ -46,7 +59,12 @@ const store = new Vuex.Store({
uni.navigateTo({
url: '/pages/login/wxUserInfo'
})
}else{
uni.switchTab({
url: '/pages/payment/payment'
})
}
})
},
fail(err) {


Loading…
Cancel
Save