fix: UI优化

pull/2/head
TianYu 2023-05-19 11:25:26 +08:00
parent 12228e7d09
commit 381632dc9d
22 changed files with 1165 additions and 865 deletions

View File

@ -4,7 +4,8 @@
} from "./libs/login"; } from "./libs/login";
import { import {
refreshToken, refreshToken,
getWeChatOpenId getWeChatOpenId,
fetchTenantInfo
} from "@/api/api"; } from "@/api/api";
import { import {
HTTP_REQUEST_URL HTTP_REQUEST_URL
@ -13,7 +14,8 @@
import Routine from './libs/routine.js'; import Routine from './libs/routine.js';
import Apps from './libs/apps.js'; import Apps from './libs/apps.js';
import { import {
mapActions mapActions,
mapGetters
} from 'vuex' } from 'vuex'
export default { export default {
@ -159,12 +161,15 @@
} }
// #endif // #endif
}, },
computed: mapGetters(['tenantId']),
async mounted() { async mounted() {
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) { if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
await this.$store.dispatch('USERINFO'); await this.$store.dispatch('USERINFO');
} }
if (!this.$Cache.get('TENANT_ID') || this.$route.query.tenantId) { if (!this.$Cache.get('TENANT_ID') || this.$route.query.tenantId) {
this.getTenantId() this.getTenantId()
} else {
this.getTenantInfo()
} }
if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) { if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) {
this.getWxChatCode() this.getWxChatCode()
@ -176,11 +181,18 @@
}, 60000) }, 60000)
}, },
methods: { methods: {
//
getTenantInfo() {
fetchTenantInfo(this.tenantId).then(res => {
this.$store.commit("SET_TENANT_INFO", res.data);
})
},
// ID // ID
getTenantId() { getTenantId() {
const tenantId = this.$route.query.tenantId const tenantId = this.$route.query.tenantId
if (tenantId) { if (tenantId) {
this.$store.commit("SET_TENANTID", tenantId); this.$store.commit("SET_TENANTID", tenantId);
this.getTenantInfo()
} else { } else {
this.$util.Tips({ this.$util.Tips({
title: '请扫码物业公司二维码访问' title: '请扫码物业公司二维码访问'

View File

@ -8,29 +8,38 @@ import request from "@/utils/request.js";
* 获取主页数据 无需授权 * 获取主页数据 无需授权
* *
*/ */
export function getIndexData() export function getIndexData() {
{ return request.get("index", {}, {
return request.get("index",{},{ noAuth : true}); noAuth: true
});
} }
/** /**
* 获取登录授权login * 获取登录授权login
* *
*/ */
export function getLogo() export function getLogo() {
{ return request.get('wechat/getLogo', {}, {
return request.get('wechat/getLogo', {}, { noAuth : true}); noAuth: true
});
} }
export function refreshToken(token) export function refreshToken(token) {
{ return request.post('member/auth/refresh-token?refreshToken=' + token, {}, {
return request.post('member/auth/refresh-token?refreshToken=' + token, {}, { noAuth : true}); noAuth: true
});
} }
// 获取微信OpenId // 获取微信OpenId
export function getWeChatOpenId(code) export function getWeChatOpenId(code) {
{ return request.get('api/order/member/getOpenId?code=' + code, {}, {
return request.get('api/order/member/getOpenId?code=' + code, {}, { noAuth : true}); noAuth: true
});
}
// 获取租户信息
export function fetchTenantInfo(id) {
return request.get('tenant/get?id=' + id, {});
} }
/** /**
@ -38,7 +47,9 @@ export function getWeChatOpenId(code)
* @param string formId * @param string formId
*/ */
export function setFormId(formId) { export function setFormId(formId) {
return request.post("wechat/set_form_id", { formId: formId}); return request.post("wechat/set_form_id", {
formId: formId
});
} }
/** /**
@ -47,14 +58,18 @@ export function setFormId(formId) {
* *
*/ */
export function setCouponReceive(couponId) { export function setCouponReceive(couponId) {
return request.post('coupon/receive', { couponId: couponId}); return request.post('coupon/receive', {
couponId: couponId
});
} }
/** /**
* 优惠券列表 * 优惠券列表
* @param object data * @param object data
*/ */
export function getCoupons(data) { export function getCoupons(data) {
return request.get('coupons',data,{noAuth:true}) return request.get('coupons', data, {
noAuth: true
})
} }
/** /**
@ -70,7 +85,9 @@ export function getUserCoupons(data){
* *
*/ */
export function getArticleCategoryList() { export function getArticleCategoryList() {
return request.get('article/category/list',{},{noAuth:true}) return request.get('article/category/list', {}, {
noAuth: true
})
} }
/** /**
@ -79,7 +96,9 @@ export function getArticleCategoryList(){
* *
*/ */
export function getArticleList(cid, data) { export function getArticleList(cid, data) {
return request.get('article/list/' + cid, data,{noAuth:true}) return request.get('article/list/' + cid, data, {
noAuth: true
})
} }
/** /**
@ -87,7 +106,9 @@ export function getArticleList(cid,data){
* *
*/ */
export function getArticleHotList() { export function getArticleHotList() {
return request.get('article/hot/list',{},{noAuth:true}); return request.get('article/hot/list', {}, {
noAuth: true
});
} }
/** /**
@ -95,7 +116,9 @@ export function getArticleHotList(){
* *
*/ */
export function getArticleBannerList() { export function getArticleBannerList() {
return request.get('article/banner/list',{},{noAuth:true}) return request.get('article/banner/list', {}, {
noAuth: true
})
} }
/** /**
@ -104,7 +127,9 @@ export function getArticleBannerList(){
* *
*/ */
export function getArticleDetails(id) { export function getArticleDetails(id) {
return request.get('article/info',id,{noAuth:true}); return request.get('article/info', id, {
noAuth: true
});
} }
/** /**
@ -112,7 +137,9 @@ export function getArticleDetails(id){
* @param object data * @param object data
*/ */
export function loginMobile(data) { export function loginMobile(data) {
return request.post('login/mobile',data,{noAuth:true}) return request.post('login/mobile', data, {
noAuth: true
})
} }
/** /**
@ -120,7 +147,9 @@ export function loginMobile(data){
* @param object phone * @param object phone
*/ */
export function verifyCode() { export function verifyCode() {
return request.get('verify_code', {},{noAuth:true}) return request.get('verify_code', {}, {
noAuth: true
})
} }
/** /**
@ -128,7 +157,11 @@ export function verifyCode(){
* @param object phone * @param object phone
*/ */
export function registerVerify(phone) { export function registerVerify(phone) {
return request.post('sendCode', { phone: phone },{noAuth:true},1) return request.post('sendCode', {
phone: phone
}, {
noAuth: true
}, 1)
} }
/** /**
@ -137,7 +170,9 @@ export function registerVerify(phone){
* *
*/ */
export function phoneRegister(data) { export function phoneRegister(data) {
return request.post('register',data,{noAuth:true}); return request.post('register', data, {
noAuth: true
});
} }
/** /**
@ -146,7 +181,9 @@ export function phoneRegister(data){
* *
*/ */
export function phoneRegisterReset(data) { export function phoneRegisterReset(data) {
return request.post('register/reset',data,{noAuth:true}) return request.post('register/reset', data, {
noAuth: true
})
} }
/** /**
@ -155,7 +192,9 @@ export function phoneRegisterReset(data){
* *
*/ */
export function phoneLogin(data) { export function phoneLogin(data) {
return request.post('login',data,{noAuth:true}) return request.post('login', data, {
noAuth: true
})
} }
/** /**
@ -164,7 +203,9 @@ export function phoneLogin(data){
*/ */
// #ifdef MP // #ifdef MP
export function switchH5Login() { export function switchH5Login() {
return request.post('switch_h5', { 'from':'routine'}); return request.post('switch_h5', {
'from': 'routine'
});
} }
// #endif // #endif
@ -173,7 +214,9 @@ export function switchH5Login(){
* */ * */
// #ifdef H5 // #ifdef H5
export function switchH5Login() { export function switchH5Login() {
return request.post("switch_h5", { 'from': "wechat" }); return request.post("switch_h5", {
'from': "wechat"
});
} }
// #endif // #endif
@ -204,36 +247,47 @@ export function logout(){
/** /**
* 获取订阅消息id * 获取订阅消息id
*/ */
export function getTemlIds(data) export function getTemlIds(data) {
{ return request.get('wechat/program/my/temp/list', data, {
return request.get('wechat/program/my/temp/list', data , { noAuth:true}); noAuth: true
});
} }
/** /**
* 首页拼团数据 * 首页拼团数据
*/ */
export function pink() export function pink() {
{ return request.get('pink', {}, {
return request.get('pink', {}, { noAuth:true}); noAuth: true
});
} }
/** /**
* 获取城市信息 * 获取城市信息
*/ */
export function getCity() { export function getCity() {
return request.get('area/tree', { }, { noAuth: true }); return request.get('area/tree', {}, {
noAuth: true
});
} }
/** /**
* 获取小程序直播列表 * 获取小程序直播列表
*/ */
export function getLiveList(page, limit) { export function getLiveList(page, limit) {
return request.get('wechat/live', { page, limit}, { noAuth: true }); return request.get('wechat/live', {
page,
limit
}, {
noAuth: true
});
} }
/** /**
* 获取小程序二维码 * 获取小程序二维码
*/ */
export function getQrcode(data) { export function getQrcode(data) {
return request.post('qrcode/get',data,{ noAuth: true }); return request.post('qrcode/get', data, {
noAuth: true
});
} }

View File

@ -88,8 +88,9 @@
}, },
function(res) { function(res) {
if (res.err_msg == "get_brand_wcpay_request:ok") { if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使, uni.switchTab({
//res.err_msgok url: '/pages/member_application/index'
})
} }
}) })
} }
@ -110,7 +111,8 @@
title: '请选择要支付的订单' title: '请选择要支付的订单'
}); });
uni.showLoading({ uni.showLoading({
title: '支付中' title: '支付中',
mask: true
}); });
if(paytype === 'WXPAY' && !that.openId) { if(paytype === 'WXPAY' && !that.openId) {
return that.$util.Tips({ return that.$util.Tips({

View File

@ -10,6 +10,8 @@ module.exports = {
OPEN_ID: 'OPEN_ID', OPEN_ID: 'OPEN_ID',
//用户信息 //用户信息
USER_INFO: 'USER_INFO', USER_INFO: 'USER_INFO',
//租户信息
TENANT_INFO: 'TENANT_INFO',
//token 过期时间 //token 过期时间
EXPIRES_TIME: 'EXPIRES_TIME', EXPIRES_TIME: 'EXPIRES_TIME',
//微信授权 //微信授权

View File

@ -443,6 +443,13 @@
"navigationBarTitleText": "注册", "navigationBarTitleText": "注册",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "register/success",
"style": {
"navigationBarTitleText": "注册成功",
"navigationStyle": "custom"
}
} }
] ]
}, },
@ -562,37 +569,31 @@
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "static/images/1-001.png", "iconPath": "static/images/tabbar/nav_icon_shop.png",
"selectedIconPath": "static/images/1-002.png", "selectedIconPath": "static/images/1-002.png",
"text": "首页" "text": "商城"
}, },
{ {
"pagePath": "pages/goods_cate/goods_cate", "pagePath": "pages/goods_cate/goods_cate",
"iconPath": "static/images/2-001.png", "iconPath": "static/images/tabbar/nav_icon_sort.png",
"selectedIconPath": "static/images/2-002.png", "selectedIconPath": "static/images/2-002.png",
"text": "分类" "text": "分类"
}, },
{ {
"pagePath": "pages/member_record/index", "pagePath": "pages/member_application/index",
"iconPath": "static/images/2-001.png", "iconPath": "static/images/2-001.png",
"selectedIconPath": "static/images/2-002.png", "selectedIconPath": "static/images/tabbar/nav_icon_member_active.png",
"text": "会员申请" "text": "会员申请"
}, },
// {
// "pagePath": "pages/member_application/index",
// "iconPath": "static/images/2-001.png",
// "selectedIconPath": "static/images/2-002.png",
// "text": "会员申请"
// },
{ {
"pagePath": "pages/order_addcart/order_addcart", "pagePath": "pages/order_addcart/order_addcart",
"iconPath": "static/images/3-001.png", "iconPath": "static/images/tabbar/nav_icon_cart.png",
"selectedIconPath": "static/images/3-002.png", "selectedIconPath": "static/images/3-002.png",
"text": "购物车" "text": "购物车"
}, },
{ {
"pagePath": "pages/user/index", "pagePath": "pages/user/index",
"iconPath": "static/images/4-001.png", "iconPath": "static/images/tabbar/nav_icon_my.png",
"selectedIconPath": "static/images/4-002.png", "selectedIconPath": "static/images/4-002.png",
"text": "我的" "text": "我的"
} }

View File

@ -6,8 +6,7 @@
<view class="head pad30"> <view class="head pad30">
<view class="user-card"> <view class="user-card">
<view class="user-info"> <view class="user-info">
<image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar && uid" <image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar && uid" @click="goEdit()"></image>
@click="goEdit()"></image>
<image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()"></image> <image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()"></image>
<view class="info"> <view class="info">
<view class="name" v-if="!uid" @tap="openAuto"> <view class="name" v-if="!uid" @tap="openAuto">
@ -23,8 +22,8 @@
</view> </view>
<view class="num" v-if="userInfo.mobile && uid" @click="goEdit()"> <view class="num" v-if="userInfo.mobile && uid" @click="goEdit()">
<view class="num-txt">{{userInfo.mobile}}</view> <view class="num-txt">{{userInfo.mobile}}</view>
<view class="icon"> <view class="icon-setting">
<image src="/static/images/edit.png" mode=""></image> <u-icon name="setting" color="#000" size="36"></u-icon>
</view> </view>
</view> </view>
<view class="phone" v-if="!userInfo.mobile && isLogin" @tap="bindPhone"></view> <view class="phone" v-if="!userInfo.mobile && isLogin" @tap="bindPhone"></view>
@ -36,10 +35,10 @@
class="num">{{userInfo.nowMoney && uid ?Number(userInfo.nowMoney).toFixed(2):0}}</text> class="num">{{userInfo.nowMoney && uid ?Number(userInfo.nowMoney).toFixed(2):0}}</text>
<view class="txt">余额</view> <view class="txt">余额</view>
</view> --> </view> -->
<view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')"> <!-- <view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')">
<text class="num">{{userInfo.integral && uid ? userInfo.integral: 0}}</text> <text class="num">{{userInfo.integral && uid ? userInfo.integral: 0}}</text>
<view class="txt">积分</view> <view class="txt">积分</view>
</view> </view> -->
<!-- <view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')"> <!-- <view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
<text class="num">{{userInfo.couponCount && uid ? userInfo.couponCount : 0}}</text> <text class="num">{{userInfo.couponCount && uid ? userInfo.couponCount : 0}}</text>
<view class="txt">优惠券</view> <view class="txt">优惠券</view>
@ -53,10 +52,9 @@
</view> </view>
<view class="order-wrapper"> <view class="order-wrapper">
<view class="order-hd flex"> <view class="order-hd flex">
<view class="left">订单中心</view> <view class="left">我的商品订单</view>
<navigator class="right flex" hover-class="none" url="/pages/users/order_list/index" <navigator class="right flex" hover-class="none" url="/pages/users/order_list/index" open-type="navigate">
open-type="navigate"> 全部订单
查看全部
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</navigator> </navigator>
</view> </view>
@ -88,36 +86,23 @@
<!-- 会员菜单 --> <!-- 会员菜单 -->
<view class="user-menus" style="margin-top: 20rpx;"> <view class="user-menus" style="margin-top: 20rpx;">
<view class="menu-title">我的服务</view> <!-- <view class="menu-title">我的服务</view> -->
<view class="list-box"> <u-cell-group>
<block v-for="(item,index) in MyMenus" :key="index"> <u-cell title="收货地址" isLink @click="jumpPage('/pages/users/user_address_list/index')">
<!-- <navigator class="item" :url="item.url" hover-class="none" <u-icon slot="icon" size="32" name="map"></u-icon>
v-if="!(item.url =='/pages/service/index' || (item.url =='/pages/users/user_spread_user/index' && !userInfo.isPromoter))"> </u-cell>
<image :src="item.pic"></image> <u-cell title="分销中心" v-if="userInfo.userType === 'PROMOTER'" isLink
<text>{{item.name}}</text> @click="jumpPage('/pages/users/user_spread_user/index')">
</navigator> --> <u-icon slot="icon" size="32" name="map"></u-icon>
<navigator class="item" :url="item.url" hover-class="none" </u-cell>
v-if="!(item.url =='/pages/users/user_spread_user/index' && userInfo.userType !== 'PROMOTER')" <u-cell title="热线电话" value="023-12948338" :value="tenantInfo.serviceMobile" isLink>
> <u-icon slot="icon" size="32" name="phone"></u-icon>
<image :src="item.pic"></image> </u-cell>
<text>{{item.name}}</text> <u-cell title="在线客服" value="8:30-17:30" :value="tenantInfo.serviceTime" isLink @click="kefuClick">
</navigator> <u-icon slot="icon" size="32" name="kefu-ermai"></u-icon>
</block> </u-cell>
<!-- #ifndef MP --> </u-cell-group>
<view class="item" @click="kefuClick">
<image :src="servicePic"></image>
<text>联系客服</text>
</view> </view>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="item" open-type='contact' hover-class='none'>
<image :src="servicePic"></image>
<text>联系客服</text>
</button>
<!-- #endif -->
</view>
</view>
<image src="/static/images/support.png" alt="" class='support'>
<view class="uni-p-b-98"></view> <view class="uni-p-b-98"></view>
</view> </view>
@ -131,12 +116,24 @@
<script> <script>
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import Cache from '@/utils/cache'; import Cache from '@/utils/cache';
import {BACK_URL} from '@/config/cache'; import {
import {getMenuList} from '@/api/user.js'; BACK_URL
import {orderData} from '@/api/order.js'; } from '@/config/cache';
import {toLogin} from '@/libs/login.js'; import {
import {getCity} from '@/api/api.js'; getMenuList
import {mapGetters} from "vuex"; } from '@/api/user.js';
import {
orderData
} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
getCity
} from '@/api/api.js';
import {
mapGetters
} from "vuex";
// #ifdef H5 // #ifdef H5
import Auth from '@/libs/wechat'; import Auth from '@/libs/wechat';
// #endif // #endif
@ -150,7 +147,7 @@
authorize authorize
// #endif // #endif
}, },
computed: mapGetters(['isLogin', 'chatUrl', 'userInfo', 'uid']), computed: mapGetters(['isLogin', 'chatUrl', 'userInfo', 'uid', 'tenantInfo']),
data() { data() {
return { return {
orderMenu: [{ orderMenu: [{
@ -173,7 +170,7 @@
}, },
{ {
img: '/static/images/order4.png', img: '/static/images/order4.png',
title: '待评价', title: '已完成',
url: '/pages/users/order_list/index?status=3', url: '/pages/users/order_list/index?status=3',
num: 0 num: 0
}, },
@ -193,8 +190,7 @@
isAuto: false, // isAuto: false, //
isShowAuth: false, // isShowAuth: false, //
orderStatusNum: {}, orderStatusNum: {},
MyMenus: [ MyMenus: [{
{
pic: '/static/images/address.png', pic: '/static/images/address.png',
url: '/pages/users/user_address_list/index', url: '/pages/users/user_address_list/index',
name: '收货地址' name: '收货地址'
@ -250,17 +246,18 @@
} }
}, },
methods: { methods: {
// 访
// setVisit(){
// setVisit({
// url:'/pages/user/index'
// }).then(res=>{})
// },
navito(e) { navito(e) {
window.location.href = 'https://' + e; window.location.href = 'https://' + e;
}, },
jumpPage(url) {
uni.navigateTo({
url: url
})
},
kefuClick() { kefuClick() {
location.href = this.chatUrl; if (tenantInfo.wxKfUrl) {
location.href = tenantInfo.wxKfUrl
}
}, },
getOrderData() { getOrderData() {
let that = this; let that = this;
@ -370,12 +367,15 @@
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 420rpx; height: 616rpx;
background-image: url('~@/static/images/user_bg.png'); background: linear-gradient(0deg, #F94B78 0%, #FFD35C 100%);
background-repeat: no-repeat; opacity: 0.18;
background-size: 100% 100%; z-index: 0
} }
.contenBox { .contenBox {
position: relative;
z-index: 9;
padding: 0 30rpx; padding: 0 30rpx;
} }
@ -408,7 +408,7 @@
} }
.head { .head {
background: linear-gradient(360deg, rgba(255, 121, 49, 0) 0%, rgba(248, 74, 29, 0.82) 39%, #E93323 100%); // background: linear-gradient(360deg, rgba(255, 121, 49, 0) 0%, rgba(248, 74, 29, 0.82) 39%, #E93323 100%);
// padding: 0 30rpx; // padding: 0 30rpx;
.user-card { .user-card {
@ -416,6 +416,7 @@
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
padding: 35rpx 0 30rpx 0; padding: 35rpx 0 30rpx 0;
.user-info { .user-info {
z-index: 20; z-index: 20;
position: relative; position: relative;
@ -425,6 +426,7 @@
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
border-radius: 50%; border-radius: 50%;
border: 2px solid #fff;
} }
.info { .info {
@ -438,8 +440,8 @@
.name { .name {
display: flex; display: flex;
align-items: center; align-items: center;
color: #fff; color: #000;
font-size: 31rpx; font-size: 35rpx;
.vip { .vip {
display: flex; display: flex;
@ -461,7 +463,13 @@
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 26rpx; font-size: 26rpx;
color: rgba(255, 255, 255, 0.6); color: #000;
.icon-setting {
position: absolute;
top: 44rpx;
right: 28rpx;
}
image { image {
width: 22rpx; width: 22rpx;

View File

@ -8,20 +8,24 @@
<div class="list"> <div class="list">
<form @submit.prevent="submit"> <form @submit.prevent="submit">
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle" v-if="current === 0">
<image src="/static/images/phone_1.png" style="width: 37rpx; height: 42rpx;"></image> <image src="/static/images/user_1.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" class="texts" placeholder="输入您手机号码" v-model="mobile" required /> <input type="text" class="texts" placeholder="请输入您的账号" v-model="mobile" required />
</div>
<div class="acea-row row-middle" v-else>
<image src="/static/images/phone_2.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" class="texts" placeholder="请输入您的手机号" v-model="mobile" required />
</div> </div>
</div> </div>
<div class="item" v-if="current === 0"> <div class="item" v-if="current === 0">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image> <image src="/static/images/code_3.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="password" class="texts" placeholder="填写登录密码" v-model="password" required /> <input type="password" class="texts" placeholder="填写登录密码" v-model="password" required />
</div> </div>
</div> </div>
<div class="item" v-else> <div class="item" v-else>
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image> <image src="/static/images/code_4.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" placeholder="请输入您的验证码" class="texts" v-model="captcha" /> <input type="text" placeholder="请输入您的验证码" class="texts" v-model="captcha" />
</div> </div>
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code"> <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
@ -369,6 +373,8 @@
.login-wrapper { .login-wrapper {
padding: 30rpx 52rpx; padding: 30rpx 52rpx;
background: url('@/static/images/bg-linear.png') center 0 no-repeat;
background-size:100% 672rpx;
.logo-wrap { .logo-wrap {
margin: 285rpx 0 85rpx 0; margin: 285rpx 0 85rpx 0;
@ -465,7 +471,7 @@
justify-content: center; justify-content: center;
width: 100%; width: 100%;
height: 87rpx; height: 87rpx;
margin-top: 237rpx; margin-top: 137rpx;
color: #FFFFFF; color: #FFFFFF;
font-size: 32rpx; font-size: 32rpx;
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%); background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);

View File

@ -1,37 +1,42 @@
<template> <template>
<div class="login-wrapper"> <div class="login-wrapper">
<div class="shading"> <div class="logo-wrap">
<!-- <image :src="logoUrl"/> --> <img src="/static/images/logo.png" style="width:127rpx;height:45rpx;"></image>
<image :src="logoUrl" />
<!-- <image src="/static/images/logo2.png" v-if="!logoUrl" /> -->
</div> </div>
<view class="title">注册账号</view>
<div class="whiteBg"> <div class="whiteBg">
<div class="list"> <div class="list">
<form @submit.prevent="submit"> <form @submit.prevent="submit">
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image> <image src="/static/images/user_1.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" class="texts" placeholder="请输入姓名" v-model="registerForm.realName" required /> <input type="text" class="texts" placeholder="请输入姓名" v-model="registerForm.realName" required />
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 28rpx; height: 32rpx;"></image> <image src="/static/images/phone_2.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" class="texts" placeholder="请输入手机号" v-model="registerForm.mobile" required /> <input type="text" class="texts" placeholder="请输入手机号" v-model="registerForm.mobile" required />
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image> <image src="/static/images/code_3.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="registerForm.code" /> <input type="text" placeholder="填写验证码" class="texts" v-model="registerForm.code" />
</div>
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code"> <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }} {{ text }}
</button> </button>
</div> </div>
</div>
</form> </form>
</div> </div>
<button class="logon" @click="onRegister" :disabled="loading" :loading="loading">注册</button> <button class="logon" @click="onRegister" :disabled="loading" :loading="loading">注册</button>
<div class="protocol-wrap">
<u-checkbox-group v-model="checked">
<u-checkbox size="30" shape="circle" activeColor="#F35981" name="同意"></u-checkbox>
</u-checkbox-group>
<view class="text">我已阅读并同意 <span class="link">创盈商城用户协议</span></view>
</div>
</div> </div>
<div class="bottom"></div> <div class="bottom"></div>
</div> </div>
@ -51,6 +56,7 @@
return { return {
logoUrl: '', logoUrl: '',
loading: false, loading: false,
checked: [],
registerForm: { registerForm: {
realName: '', realName: '',
mobile: '', mobile: '',
@ -67,7 +73,7 @@
const res = await register(this.registerForm) const res = await register(this.registerForm)
this.$util.Tips({ this.$util.Tips({
title: res.code === 0 ? '注册成功' : res.msg title: res.code === 0 ? '注册成功' : res.msg
}, '/pages/users/login/index') }, '/pages/users/register/success')
} catch (err) { } catch (err) {
//TODO handle the exception //TODO handle the exception
this.$util.Tips({ this.$util.Tips({
@ -84,6 +90,9 @@
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.registerForm.mobile)) return this.$util.Tips({ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.registerForm.mobile)) return this.$util.Tips({
title: '请输入正确的手机号码' title: '请输入正确的手机号码'
}); });
if(that.checked.length === 0) return that.$util.Tips({
title: '请勾选同意用户协议'
});
await registerVerify(this.registerForm.mobile, 4) await registerVerify(this.registerForm.mobile, 4)
.then(res => { .then(res => {
this.$util.Tips({ this.$util.Tips({
@ -191,7 +200,19 @@
} }
.login-wrapper { .login-wrapper {
padding: 30rpx; padding: 30rpx 52rpx;
background: url('@/static/images/bg-linear.png') center 0 no-repeat;
background-size:100% 672rpx;
.logo-wrap {
margin: 285rpx 0 85rpx 0;
}
.title {
font-size: 40rpx;
font-weight: 400;
color: #000;
}
.shading { .shading {
display: flex; display: flex;
@ -215,25 +236,45 @@
} }
.whiteBg { .whiteBg {
margin-top: 100rpx; margin-top: 46rpx;
.list { .list {
border-radius: 16rpx;
overflow: hidden; overflow: hidden;
.item { .item {
border-bottom: 1px solid #F0F0F0; margin-bottom: 38rpx;
background: #fff; height: 98rpx;
display: flex;
&:last-child {
margin-bottom: 0;
}
.code {
width: 197rpx;
text-align: center;
line-height: 96rpx;
background: #FFF3F6;
border: 1px solid #F54275;
border-radius: 15rpx;
font-size: 28rpx;
color: #F03A76;
margin-left: 19rpx;
}
.row-middle { .row-middle {
position: relative; position: relative;
padding: 16rpx 45rpx; padding: 28rpx;
background: #fff;
border: 1px solid #BFBFBF;
border-radius: 15rpx;
flex: 1;
.texts { .texts {
flex: 1; flex: 1;
font-size: 28rpx; font-size: 28rpx;
height: 80rpx; height: 42rpx;
line-height: 80rpx; line-height: 42rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -249,14 +290,6 @@
align-items: center; align-items: center;
} }
.code {
position: absolute;
right: 30rpx;
top: 50%;
color: $theme-color;
font-size: 26rpx;
transform: translateY(-50%);
}
} }
} }
} }
@ -266,18 +299,36 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
height: 86rpx; height: 87rpx;
margin-top: 80rpx; margin-top: 99rpx;
background-color: $theme-color;
border-radius: 120rpx;
color: #FFFFFF; color: #FFFFFF;
font-size: 32rpx;
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);
border-radius: 44rpx;
font-size: 30rpx; font-size: 30rpx;
} }
.tips { .tips {
margin: 30rpx; margin: 125rpx 20rpx 0 20rpx;
text-align: center; font-size: 24rpx;
color: #999; color: #000;
display: flex;
justify-content: space-between;
}
.protocol-wrap {
margin: 131rpx 0 80rpx 0;
display: flex;
justify-content: center;
.text {
font-size: 24rpx;
color: #000;
.link {
color: #F35981;
}
}
} }
} }
} }

View File

@ -0,0 +1,56 @@
<template>
<view class="register-success-wrap">
<image src="@/static/images/logo.png" class="icon"></image>
<view class="text">恭喜您注册成功</view>
<u-button class="logon" @click="onBackLogin"></u-button>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
onBackLogin() {
uni.navigateTo({
url: '/pages/users/login/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.register-success-wrap {
padding: 0 50rpx;
text-align: center;
.icon {
margin: 428rpx auto 56rpx;
width: 98rpx;
height: 98rpx;
}
.text {
text-align: center;
font-size: 40rpx;
color: #000000;
}
.logon {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 87rpx;
margin-top: 237rpx;
color: #FFFFFF;
font-size: 32rpx;
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);
border-radius: 44rpx;
}
}
</style>

View File

@ -1,33 +1,30 @@
<template> <template>
<div class="register absolute"> <div class="login-wrapper">
<div class="shading"> <div class="logo-wrap">
<div class="pictrue acea-row row-center-wrapper"> <img src="/static/images/logo.png" style="width:127rpx;height:45rpx;"></image>
<image src="../../../static/images/logo2.png" />
</div>
</div> </div>
<view class="title">找回密码</view>
<div class="whiteBg"> <div class="whiteBg">
<div class="title">找回密码</div>
<div class="list"> <div class="list">
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image> <image src="/static/images/phone_1.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" placeholder="输入手机号码" v-model="account" /> <input type="text" class="texts" placeholder="输入手机号码" v-model="account" />
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image> <image src="/static/images/code_2.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" /> <input type="text" class="texts" placeholder="填写验证码" v-model="captcha" />
</div>
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code"> <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }} {{ text }}
</button> </button>
</div> </div>
</div>
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image> <image src="/static/images/code_2.png" style="width: 40rpx; height: 40rpx;"></image>
<input type="password" placeholder="填写您的新密码" v-model="password" /> <input type="password" class="texts" placeholder="填写您的新密码" v-model="password" />
</div> </div>
</div> </div>
<div class="item" v-if="isShowCode"> <div class="item" v-if="isShowCode">
@ -38,8 +35,8 @@
</div> </div>
</div> </div>
<div class="logon" @click="registerReset"></div> <div class="logon" @click="registerReset"></div>
<div class="tip"> <div class="tips">
<span class="font-color-red" @click="back"></span> <span @click="back"></span>
</div> </div>
</div> </div>
<div class="bottom"></div> <div class="bottom"></div>
@ -137,9 +134,113 @@
} }
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.code img { .code img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.acea-row.row-middle {
input {
margin-left: 20rpx;
display: block;
}
}
.login-wrapper {
padding: 30rpx 52rpx;
background: url('@/static/images/bg-linear.png') center 0 no-repeat;
background-size: 100% 672rpx;
.logo-wrap {
margin: 285rpx 0 85rpx 0;
}
.title {
font-size: 40rpx;
font-weight: 400;
color: #000;
}
.whiteBg {
margin-top: 46rpx;
.list {
overflow: hidden;
.item {
margin-bottom: 38rpx;
height: 98rpx;
display: flex;
&:last-child {
margin-bottom: 0;
}
.code {
width: 197rpx;
text-align: center;
line-height: 96rpx;
background: #FFF3F6;
border: 1px solid #F54275;
border-radius: 15rpx;
font-size: 28rpx;
color: #F03A76;
margin-left: 19rpx;
}
.row-middle {
position: relative;
padding: 28rpx;
background: #fff;
border: 1px solid #BFBFBF;
border-radius: 15rpx;
flex: 1;
.texts {
flex: 1;
font-size: 28rpx;
height: 42rpx;
line-height: 42rpx;
display: flex;
justify-content: center;
align-items: center;
}
input {
flex: 1;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
}
.logon {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 87rpx;
margin-top: 80rpx;
color: #FFFFFF;
font-size: 32rpx;
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);
border-radius: 44rpx;
}
.tips {
margin-top: 50rpx;
font-size: 24rpx;
color: #000;
display: flex;
justify-content: center;
}
}
}
</style> </style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -3,6 +3,7 @@ export default {
isLogin: state => !!state.app.token, isLogin: state => !!state.app.token,
backgroundColor: state => state.app.backgroundColor, backgroundColor: state => state.app.backgroundColor,
userInfo: state => state.app.userInfo || {}, userInfo: state => state.app.userInfo || {},
tenantInfo: state => state.app.tenantInfo || {},
uid: state => state.app.uid, uid: state => state.app.uid,
tenantId: state => state.app.tenantId, tenantId: state => state.app.tenantId,
openId: state => state.app.openId, openId: state => state.app.openId,

View File

@ -11,7 +11,8 @@ import {
} from '../../config/cache'; } from '../../config/cache';
import Cache from '../../utils/cache'; import Cache from '../../utils/cache';
import { import {
USER_INFO USER_INFO,
TENANT_INFO
} from '../../config/cache'; } from '../../config/cache';
const state = { const state = {
@ -19,6 +20,7 @@ const state = {
refreshToken: Cache.get(REFRESH_TOKEN) || '', refreshToken: Cache.get(REFRESH_TOKEN) || '',
backgroundColor: "#fff", backgroundColor: "#fff",
userInfo: Cache.get(USER_INFO)?JSON.parse(Cache.get(USER_INFO)):null, userInfo: Cache.get(USER_INFO)?JSON.parse(Cache.get(USER_INFO)):null,
tenantInfo: Cache.get(TENANT_INFO)?JSON.parse(Cache.get(TENANT_INFO)):null,
uid: Cache.get(UID) || null, uid: Cache.get(UID) || null,
tenantId: Cache.get(TENANT_ID) || '', tenantId: Cache.get(TENANT_ID) || '',
spreadId: '', spreadId: '',
@ -36,6 +38,10 @@ const mutations = {
Cache.set(LOGIN_STATUS, opt.token); Cache.set(LOGIN_STATUS, opt.token);
Cache.set(REFRESH_TOKEN, opt.refreshToken); Cache.set(REFRESH_TOKEN, opt.refreshToken);
}, },
SET_TENANT_INFO(state,val){
state.tenantInfo = val
Cache.set(TENANT_INFO, val);
},
SETUID(state,val){ SETUID(state,val){
state.uid = val; state.uid = val;
Cache.set(UID, val); Cache.set(UID, val);