添加用户协议

This commit is contained in:
zhangmanman
2021-09-28 10:52:36 +08:00
9 changed files with 287 additions and 125 deletions

View File

@@ -26,7 +26,17 @@ const getSms = (data) =>{
}) })
} }
// 用户隐私协议 articles/agreement/secret 用户服务协议 articles/agreement/service
const secretService = (name) =>{
return request({
url: "articles/agreement/"+name
})
}
export { export {
smsAuth, smsAuth,
getSms getSms,
secretService
} }

View File

@@ -68,5 +68,10 @@
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : false
}, },
"vueVersion" : "2" "vueVersion" : "2",
"h5" : {
"router" : {
"mode" : "history"
}
}
} }

View File

@@ -134,6 +134,18 @@
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录"
} }
}, {
"path": "pages/login/guide",
"name": "loginGuide",
"style": {
"navigationBarTitleText": "引导页"
}
}, {
"path": "pages/login/agreement",
"name": "agreement",
"style": {
"navigationBarTitleText": "用户隐藏协议"
}
}, { }, {
"path": "pages/certification/personal", "path": "pages/certification/personal",
"name": "Personal", "name": "Personal",

View File

@@ -1,5 +1,5 @@
<template> <template>
<view class="basics-content"> <view>
<view class="coupons-preview"> <view class="coupons-preview">
<view class="item cover"> <view class="item cover">
<view v-if="types[typeIndex].id == 2"> <view v-if="types[typeIndex].id == 2">
@@ -79,7 +79,7 @@
<label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label> <label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label>
<block v-if="timeIndex === 0"> <block v-if="timeIndex === 0">
<view class="input-text" @click="showDatePicker = true">{{datePickerValue.length == 0 ? '选择优惠券有效期区间': datePickerValue[0] + ' ' + datePickerValue[1]}}<uni-icons class="picker-icon" type="arrowdown" size="14" /></view> <view class="input-text" @click="showDatePicker = true">{{datePickerValue.length == 0 ? '选择优惠券有效期区间': datePickerValue[0] + ' ' + datePickerValue[1]}}<uni-icons class="picker-icon" type="arrowdown" size="14" /></view>
<tn-date-picker :show="showDatePicker" :monthNum="12" color="#e93340" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/> <tn-date-picker :show="showDatePicker" :monthNum="12" color="#8b64fd" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/>
</block> </block>
<block v-if="timeIndex === 1"> <block v-if="timeIndex === 1">
<view class="input-number"> <view class="input-number">
@@ -89,7 +89,7 @@
</view> </view>
<view class="inputs"> <view class="inputs">
<label class="input-label">关联商品</label> <label class="input-label">关联商品</label>
<view class="input-text" @click="onSelectGoods" v-if="coupongoods"> <view class="input-text" @click="onSelectGoods">
<block v-if="coupongoods.length > 0">已关联{{coupongoods.length}}件商品</block> <block v-if="coupongoods.length > 0">已关联{{coupongoods.length}}件商品</block>
<block v-else>选择关联商品</block> <block v-else>选择关联商品</block>
<uni-icons class="picker-icon" type="arrowdown" size="14" /> <uni-icons class="picker-icon" type="arrowdown" size="14" />
@@ -100,8 +100,8 @@
<label>使用规则</label> <label>使用规则</label>
<textarea :maxlength="-1" v-model="description" placeholder="输入使用规则说明" /> <textarea :maxlength="-1" v-model="description" placeholder="输入使用规则说明" />
</view> </view>
<view class="basisc-btn"> <view class="add-btn ios-bottom">
<button type="default" class="btn" @click="updComponent">发布优惠券</button> <button type="default" @click="updComponent">发布优惠券</button>
</view> </view>
</view> </view>
</template> </template>
@@ -116,6 +116,7 @@
}, },
data() { data() {
return { return {
loding : true,
typeIndex : 0, typeIndex : 0,
types : [ types : [
{ id: 1, text: '服务券' }, { id: 1, text: '服务券' },
@@ -190,7 +191,7 @@
}, },
// 选择关联商品 // 选择关联商品
onSelectGoods(){ onSelectGoods(){
this.$Router.push({name: 'selectGoods', params: {type: this.types[this.typeIndex].id}}) this.$Router.push({name: 'couponsSelectGoods', params: {type: this.types[this.typeIndex].id}})
}, },
// 发布优惠券 // 发布优惠券
updComponent(){ updComponent(){
@@ -235,35 +236,6 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.basics-content{
padding-bottom: ($padding*3) + 90;
}
// 按钮组
.basisc-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
.btn {
background: $mian-color;
color: white;
border-radius: 0;
font-size: $title-size-lg;
line-height: 88rpx;
height: 88rpx;
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
}
.add-btn{ .add-btn{
padding: $padding; padding: $padding;
button{ button{

59
pages/login/agreement.vue Normal file
View File

@@ -0,0 +1,59 @@
<template>
<view>
<view class="clauseCont">
<rich-text :nodes="clauseData"></rich-text>
</view>
</view>
</template>
<script>
import {
secretService
} from '@/apis/interfaces/auth'
export default {
data() {
return {
clauseData: [] //服务条款
};
},
onLoad(e) {
if(e.name === 'service'){
uni.setNavigationBarTitle({
title:'用户服务协议'
})
}else{
uni.setNavigationBarTitle({
title:'用户隐私协议'
})
}
// 获取服务条款
this.clauseInfo(e.name)
},
methods: {
// 服务条款
clauseInfo(name) {
secretService(name).then(res => {
this.clauseData = res.content.replace(/\<img/gi,
'<img style="max-width:100%; height:auto; vertical-align: top;"')
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
}
}
</script>
<style lang="scss">
page {
background-color: $uni-bg-color;
}
.clauseCont {
padding: $padding + 10 $padding * 2;
width: 100%;
box-sizing: border-box;
}
</style>

120
pages/login/guide.vue Normal file
View File

@@ -0,0 +1,120 @@
<template>
<view class="content">
<view class="login-top">
<view class="top-logo-content">
<image class="top-logo" fit="contain" src="/static/imgs/top_logo.png" />
链商星球(中国)
</view>
<image class="top-bg" fit="contain" mode="widthFix" src="/static/imgs/top_bg.png" />
</view>
<button class="btn" type="default" @click="login">登录/注册</button>
<view class="bottom">
<view>企业链</view>
<view class="bottom-2">从星煌开始</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
login(){
uni.navigateTo({
url:'/pages/login/login'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
width: 100vw;
padding: $padding * 3;
box-sizing: border-box;
background: white;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.login-top {
height: 46vh;
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: center;
box-sizing: border-box;
position: relative;
padding-bottom: 160rpx;
.top-bg {
position: absolute;
bottom: 30rpx;
z-index: 2;
width: 740rpx;
margin-left: 40rpx;
}
.top-logo-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #7f56a4;
font-size: $title-size +2;
.top-logo {
margin-bottom: 20rpx;
width: 200rpx;
height: 200rpx;
}
}
}
.btn {
background-image: linear-gradient(to bottom,#bf52eb,#8f32dd);
color: white;
border-radius: 0;
margin-top: $margin;
font-size: $title-size + 6;
line-height: 90rpx;
height: 90rpx;
// font-weight: bold;
width: 500rpx;
border-radius: 10rpx;
margin: 50rpx 0;
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
.bottom{
height: 30vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #542083;
font-size: 54rpx;
.bottom-2{
font-size: 38rpx;
margin-top: 20rpx;
}
}
}
</style>

View File

@@ -26,8 +26,13 @@
</view> </view>
</view> </view>
<!-- 用户登录注册协议 --> <!-- 用户登录注册协议 -->
<<<<<<< HEAD
<view class="agreement">未注册的手机号验证后将自动创建账号登录即表示同意接收<view @click="$Router.push({name: 'vipAgree', params: {type : 'loginPrivacy'}})">用户隐私协议</view><view @click="$Router.push({name: 'vipAgree', params: {type : 'loginService'}})">用户服务协议 <view class="agreement">未注册的手机号验证后将自动创建账号登录即表示同意接收<view @click="$Router.push({name: 'vipAgree', params: {type : 'loginPrivacy'}})">用户隐私协议</view><view @click="$Router.push({name: 'vipAgree', params: {type : 'loginService'}})">用户服务协议
</view> </view>
=======
<view class="agreement">未注册的手机号验证后将自动创建账号登录即表示同意接收<navigator url="/pages/login/agreement?name=secret">用户隐私协议</navigator><navigator url="/pages/login/agreement?name=service">用户服务协议
</navigator>
>>>>>>> 1e1409f14e485939bb0a6d80e65119d65d4e6a1c
</view> </view>
</view> </view>
</template> </template>
@@ -210,7 +215,7 @@
} }
.btn { .btn {
background: $mian-color; background-image: linear-gradient(to bottom,#bf52eb,#8f32dd);
color: white; color: white;
border-radius: 0; border-radius: 0;
margin-top: $margin; margin-top: $margin;
@@ -224,7 +229,7 @@
} }
&[disabled] { &[disabled] {
background: rgba($color: $mian-color, $alpha: .6); background: rgba($color: #8f32dd, $alpha: .6);
} }
} }

View File

@@ -12,17 +12,24 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
token : uni.getStorageSync('token') || '' token : uni.getStorageSync('token') || '',
coupongoods : []
}, },
getters: { getters: {
getToken: state => { getToken: state => {
return state.token return state.token
},
getCoupongoods: state => {
return state.coupongoods
} }
}, },
mutations: { mutations: {
setToken(state, tokenString) { setToken(state, tokenString) {
state.token = tokenString state.token = tokenString
uni.setStorageSync('token', tokenString) uni.setStorageSync('token', tokenString)
},
setCoupongoods(state, value) {
state.coupongoods = value
} }
} }
}) })

View File

@@ -141,12 +141,12 @@
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$box-height: 35px; $box-height: 50rpx;
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
$box-line-height: 35px; $box-line-height: 50rpx;
/* #endif */ /* #endif */
$box-line-height: 26px; $box-line-height: 50rpx;
$box-width: 35px; $box-width: 50rpx;
.uni-numbox { .uni-numbox {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
@@ -154,8 +154,9 @@
/* #endif */ /* #endif */
flex-direction: row; flex-direction: row;
height: $box-height; height: $box-height;
line-height: $box-height; line-height: $box-height - 7rpx;
width: 120px; align-items: center;
// width: 120px;
} }
.uni-cursor-point { .uni-cursor-point {
@@ -170,51 +171,22 @@
height: $box-height; height: $box-height;
text-align: center; text-align: center;
font-size: $uni-font-size-lg; font-size: $uni-font-size-lg;
border-width: 1rpx;
border-style: solid;
border-color: $uni-border-color;
border-left-width: 0;
border-right-width: 0;
} }
.uni-numbox__minus { .uni-numbox__minus {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
width: $box-width; width: $box-width;
height: $box-height; height: $box-height;
// line-height: $box-line-height; background: $border-color-lg;
// text-align: center; border-radius: 50%;
font-size: 20px; text-align: center;
color: $uni-text-color;
background-color: $uni-bg-color-grey;
border-width: 1rpx;
border-style: solid;
border-color: $uni-border-color;
border-top-left-radius: $uni-border-radius-base;
border-bottom-left-radius: $uni-border-radius-base;
border-right-width: 0;
} }
.uni-numbox__plus { .uni-numbox__plus {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
width: $box-width; width: $box-width;
height: $box-height; height: $box-height;
border-width: 1rpx; background: $border-color-lg;
border-style: solid; border-radius: 50%;
border-color: $uni-border-color; text-align: center;
border-top-right-radius: $uni-border-radius-base;
border-bottom-right-radius: $uni-border-radius-base;
background-color: $uni-bg-color-grey;
border-left-width: 0;
} }
.uni-numbox--text { .uni-numbox--text {