Browse Source

[优化] 申请退款新增已输入字数显示

[新增] 用户登录页面
test
邓平艺 5 years ago
parent
commit
60792fd456
  1. 6
      pages.json
  2. 176
      pages/login/index.vue
  3. 7
      pages/order/apply_refund.vue

6
pages.json

@ -142,6 +142,12 @@
"style": {
"navigationBarTitleText": "海南旅游"
}
},
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录"
}
}
],
"globalStyle": {

176
pages/login/index.vue

@ -0,0 +1,176 @@
<template>
<view>
<view class="lf-row-center lf-flex-column box">
<!-- <image class="img" :src="userInfo.avatar" v-if="userInfo.avatar"></image> -->
<!-- <image class="img" src="../../static/logo.png" v-else></image> -->
<image class="img" src="../../static/logo.png" ></image>
<view class="lf-m-t-30 lf-font-32" v-if="type == 'phone'">{{ userInfo.nickname || '游客用户' }}</view>
<block v-if="type == 'userinfo'">
<button class="btn" @click="getUserProfile">
<text class="lf-iconfont lf-icon-weixin lf-font-60 lf-text-vertical"></text>
<text class="lf-m-l-20">微信快捷登录</text>
</button>
<!-- <view class="lf-m-t-40 lf-font-28" @click="$toBack()">暂不绑定继续操作</view> -->
<view class="mask" v-if="!checked" @click="$msg('您未同意协议条款')"></view>
</block>
<block v-else-if="type == 'phone'">
<button class="btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<text class="lf-iconfont lf-icon-weixin lf-font-60 lf-text-vertical"></text>
<text class="lf-m-l-20">绑定手机号</text>
</button>
<!-- <view class="lf-m-t-40 lf-font-28" @click="$url('/pages/login/accountLogin')">使用手机号登录</view> -->
<view class="mask" v-if="!checked" @click="$msg('您未同意协议条款')"></view>
</block>
</view>
<!-- 服务条款 -->
<view class="fixed-bottom lf-flex" v-show="agreement.title">
<checkbox-group @change="checkboxChange" style="display: inline-block;">
<checkbox class="lf-text-vertical" :checked="checked"></checkbox>
</checkbox-group>
<view class="lf-m-l-10 lf-font-24 lf-color-gray" style="display: inline-block;">
<text>请认真阅读并同意</text>
<text @click="enterAgree" class="text-orange">{{ agreement.title }}</text>
<text>在小程序下单购买即表示您已默认同意</text>
<text @click="enterAgree" class="text-orange">{{ agreement.title }}</text>
<text>的所有条款</text>
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return {
checked: false, //
isLogin: false, //
userInfo: {},
type: 'userinfo', // phone | userinfo
agreement: {} //
}
},
onLoad(options){
this.type = options.type || this.type;
this.getAgree();
getApp().globalData.wxlogin().then(res => {
this.userInfo = res;
});
},
methods: {
//
getAgree(){
this.$http(this.API.API_WXLOGIN_VIEW).then(res => {
this.agreement = res.data?.agreement;
})
},
//
enterAgree(){
this.$url('/pages/agreement/agreement?id='+ this.agreement.article_id);
},
//
checkboxChange(event){
this.checked = event.detail.value.length > 0;
},
//
getPhoneNumber(event){
console.log(event);
if(event.detail.errMsg == 'getPhoneNumber:ok'){
let encryptedData = event.detail.encryptedData;
let iv = event.detail.iv;
// let userInfo = uni.getStorageSync('userinfo') || {};
this.$http(this.API.API_WECHAT_SETPHONE, {
encryptedData,
iv,
// token: userInfo.token //
}).then(res => {
console.log("更新手机号", res);
this.$msg('更新成功', {icon: 'success'});
uni.setStorageSync('userinfo', res.data);
setTimeout(() => {
this.$toBack();
}, 1000);
})
}
},
//
getUserProfile(){
uni.getUserProfile({
desc: '您的信息将用于时空网显示',
lang: 'zh_CN',
complete: result => {
console.log(result)
if(result.errMsg == 'getUserProfile:ok'){
let encryptedData = result.encryptedData;
let iv = result.iv;
let signature = result.signature;
// let userInfo = uni.getStorageSync('userinfo') || {};
this.$http(this.API.API_WECHAT_SETPROFILE, {
encryptedData,
iv,
// token: userInfo.token //
}).then(res => {
console.log("更新用户信息", res);
this.$msg('更新成功', {icon: 'success'});
uni.setStorageSync('userinfo', res.data);
setTimeout(() => {
this.$toBack();
}, 1000);
})
}
}
});
}
}
}
</script>
<style>
page{
overflow: hidden;
}
</style>
<style lang="scss" scoped="scoped">
.box{
padding: 60rpx 32rpx;
width: 750rpx;
height: auto;
box-sizing: border-box;
position: relative;
.img{
width: 180rpx;
height: 180rpx;
border-radius: 50%;
}
.btn{
background-color: #09BB07;
color: #FFFFFF;
width: 100%;
height: 88rpx;
border-radius: 42rpx;
font-size: 32rpx;
line-height: 88rpx;
margin-top: 80rpx;
}
}
.fixed-bottom{
position: fixed;
bottom: 60rpx;
left: 0;
padding: 0 32rpx;
.highlight{
color: #1e90ff;
}
}
.mask{
position: absolute;
bottom: 46rpx;
left: 0;
width: 100%;
height: 190rpx;
}
.display-inline-block{
display: inline-block;
}
</style>

7
pages/order/apply_refund.vue

@ -43,7 +43,7 @@
<!-- <input type="text" value="" placeholder="请输入退款说明" class="lf-m-t-30 lf-border-bottom" /> -->
<view class="cu-self menu" style="margin-top: 30rpx; position: relative;">
<textarea :cursor-spacing="120" maxlength="300" :adjust-position="true" type="text" v-model="applyInfo" class="text-left lf-font-32 area-self" placeholder="请输入退款说明" />
<view class="font-change">{{ applyInfo.length }}/300</view>
<view class="font-change">{{ dynamicLength() }}/300</view>
</view>
</view>
</view>
@ -82,6 +82,9 @@
}
},
methods: {
dynamicLength(){
return parseInt(this.applyInfo.length);
},
checkImgInfo(tempFilePath, suc){
uni.getImageInfo({
src: tempFilePath,
@ -247,7 +250,7 @@
width: 100%;
padding: 30rpx;
padding-bottom: 36rpx;
color: #999999;
color: #333;
border: 1px solid #D0D0D0;
border-radius: 10rpx;
}

Loading…
Cancel
Save