Commit 286c0ae7 authored by Junling Bu's avatar Junling Bu
Browse files

chore[renard-wx]: 基于微信开发者工具的格式化代码

parent 20b97ec8
.my-info{ .my-info {
width:100%; width: 100%;
text-align:center; text-align: center;
border-bottom:20rpx solid #f5f5f5; border-bottom: 20rpx solid #f5f5f5;
padding-bottom:30rpx; padding-bottom: 30rpx;
} }
.my-info .avatar{
width:176rpx; .my-info .avatar {
height:176rpx; width: 176rpx;
border-radius:50%; height: 176rpx;
} border-radius: 50%;
.my-info .my-info-name{ }
color:#293539;
font-size:76rrpx; .my-info .my-info-name {
margin-top:10rpx; color: #293539;
font-size: 76rrpx;
margin-top: 10rpx;
position: relative; position: relative;
} }
.my-info .my-info-name text{
width:10rpx; .my-info .my-info-name text {
height:10rpx; width: 10rpx;
position:absolute; height: 10rpx;
border:4rpx solid #a78845; position: absolute;
border-radius:50%; border: 4rpx solid #a78845;
margin-left:10rpx; border-radius: 50%;
} margin-left: 10rpx;
.my-info-order{ }
width:95%;
text-align:center; .my-info-order {
margin:0 auto; width: 95%;
margin-top:60rpx; text-align: center;
} margin: 0 auto;
.my-info-order .list-icon{ margin-top: 60rpx;
}
.my-info-order .list-icon {
display: inline-block; display: inline-block;
width: 25%; width: 25%;
position: relative; position: relative;
} }
.my-info-order .list-icon .red-dot{
width:18rpx; .my-info-order .list-icon .red-dot {
height:18rpx; width: 18rpx;
border-radius:50%; height: 18rpx;
position:absolute; border-radius: 50%;
right:30rpx; position: absolute;
right: 30rpx;
background-color: #ff3f3e; background-color: #ff3f3e;
} }
.my-info-order .list-icon text{
display:block; .my-info-order .list-icon text {
font-size:22rpx; display: block;
color:#293539; font-size: 22rpx;
} color: #293539;
.my-info-order .list-icon image{ }
width:56rpx;
height:56rpx; .my-info-order .list-icon image {
} width: 56rpx;
.my-item-list .my-item{ height: 56rpx;
width:100%; }
height:120rpx;
border-bottom:2rpx dashed #f5f5f5; .my-item-list .my-item {
line-height:120rpx; width: 100%;
font-size:32rpx; height: 120rpx;
color:#293539; border-bottom: 2rpx dashed #f5f5f5;
position:relative; line-height: 120rpx;
font-weight:300; font-size: 32rpx;
} color: #293539;
.my-item-list .my-item text{ position: relative;
width:10rpx; font-weight: 300;
height:10rpx; }
position:absolute;
border:2rpx solid #a78845; .my-item-list .my-item text {
border-radius:50%; width: 10rpx;
left:30rpx; height: 10rpx;
bottom:50rpx; position: absolute;
} border: 2rpx solid #a78845;
.my-item-list .my-item navigator{ border-radius: 50%;
display:inline-block; left: 30rpx;
margin-left:70rpx; bottom: 50rpx;
width:90%; }
}
.my-item-list .my-item .about{ .my-item-list .my-item navigator {
display:inline-block; display: inline-block;
margin-left:70rpx; margin-left: 70rpx;
width:90%; width: 90%;
} }
.my-item-list .my-item image{
width:40rpx; .my-item-list .my-item .about {
height:40rpx; display: inline-block;
float:right; margin-left: 70rpx;
margin-top:40rpx; width: 90%;
margin-right:30rpx; }
position:absolute;
right:0; .my-item-list .my-item image {
} width: 40rpx;
.show-pop{ height: 40rpx;
float: right;
margin-top: 40rpx;
margin-right: 30rpx;
position: absolute;
right: 0;
}
.show-pop {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
background-color: rgba(255,255,255,.8); background-color: rgba(255, 255, 255, 0.8);
} }
.show-pop .show-pop-box{
width:55%; .show-pop .show-pop-box {
margin:0 auto; width: 55%;
margin-top:30%; margin: 0 auto;
background-color:#fff; margin-top: 30%;
border-radius:10rpx; background-color: #fff;
text-align:center; border-radius: 10rpx;
position:relative; text-align: center;
padding-bottom:40rpx; position: relative;
padding-top:60rpx; padding-bottom: 40rpx;
padding-left:30rpx; padding-top: 60rpx;
padding-right:30rpx; padding-left: 30rpx;
padding-right: 30rpx;
box-shadow: 0rpx 4rpx 30rpx #eee; box-shadow: 0rpx 4rpx 30rpx #eee;
} }
.show-pop-box .close{
width:70rpx; .show-pop-box .close {
height:70rpx; width: 70rpx;
height: 70rpx;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
} }
.show-pop .show-pop-box .show-pop-title{
color:#a78845; .show-pop .show-pop-box .show-pop-title {
font-size:36rpx; color: #a78845;
font-weight:300; font-size: 36rpx;
font-weight: 300;
position: relative; position: relative;
} }
.show-pop .show-pop-box .show-pop-title .r{
width:10rpx; .show-pop .show-pop-box .show-pop-title .r {
height:10rpx; width: 10rpx;
position:absolute; height: 10rpx;
border:1px solid #a78845; position: absolute;
border-radius:50%; border: 1px solid #a78845;
margin-left:20rpx; border-radius: 50%;
margin-top:20rpx; margin-left: 20rpx;
} margin-top: 20rpx;
.show-pop .show-pop-box .show-pop-title .l{ }
width:10rpx;
height:10rpx; .show-pop .show-pop-box .show-pop-title .l {
position:absolute; width: 10rpx;
border:2rpx solid #a78845; height: 10rpx;
border-radius:50%; position: absolute;
margin-left:-30rpx; border: 2rpx solid #a78845;
margin-top:20rpx; border-radius: 50%;
} margin-left: -30rpx;
.show-pop .show-pop-box .show-pop-text{ margin-top: 20rpx;
margin-top:20rpx; }
color:#293539;
font-size:30rpx; .show-pop .show-pop-box .show-pop-text {
line-height:56rpx; margin-top: 20rpx;
font-weight:300; color: #293539;
font-size: 30rpx;
line-height: 56rpx;
font-weight: 300;
} }
...@@ -48,18 +48,6 @@ ...@@ -48,18 +48,6 @@
"pathName": "pages/topicDetail/topicDetail", "pathName": "pages/topicDetail/topicDetail",
"query": "id=314" "query": "id=314"
}, },
{
"id": -1,
"name": "专题评论列表",
"pathName": "pages/topicComment/topicComment",
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "专题评论添加",
"pathName": "pages/topicCommentPost/topicCommentPost",
"query": "valueId=314&type=1"
},
{ {
"id": -1, "id": -1,
"name": "品牌", "name": "品牌",
...@@ -174,12 +162,6 @@ ...@@ -174,12 +162,6 @@
"pathName": "pages/ucenter/collect/collect", "pathName": "pages/ucenter/collect/collect",
"query": "" "query": ""
}, },
{
"id": -1,
"name": "我的足迹",
"pathName": "pages/ucenter/footprint/footprint",
"query": ""
},
{ {
"id": -1, "id": -1,
"name": "我的地址", "name": "我的地址",
...@@ -197,18 +179,6 @@ ...@@ -197,18 +179,6 @@
"name": "登录", "name": "登录",
"pathName": "pages/auth/login/login", "pathName": "pages/auth/login/login",
"query": "" "query": ""
},
{
"id": -1,
"name": "注册",
"pathName": "pages/auth/register/register",
"query": ""
},
{
"id": -1,
"name": "找回密码",
"pathName": "pages/auth/reset/reset",
"query": ""
} }
] ]
} }
......
...@@ -9,12 +9,12 @@ const api = require('../config/api.js'); ...@@ -9,12 +9,12 @@ const api = require('../config/api.js');
* Promise封装wx.checkSession * Promise封装wx.checkSession
*/ */
function checkSession() { function checkSession() {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
wx.checkSession({ wx.checkSession({
success: function () { success: function() {
resolve(true); resolve(true);
}, },
fail: function () { fail: function() {
reject(false); reject(false);
} }
}) })
...@@ -25,16 +25,16 @@ function checkSession() { ...@@ -25,16 +25,16 @@ function checkSession() {
* Promise封装wx.login * Promise封装wx.login
*/ */
function login() { function login() {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
wx.login({ wx.login({
success: function (res) { success: function(res) {
if (res.code) { if (res.code) {
resolve(res); resolve(res);
} else { } else {
reject(res); reject(res);
} }
}, },
fail: function (err) { fail: function(err) {
reject(err); reject(err);
} }
}); });
...@@ -46,10 +46,13 @@ function login() { ...@@ -46,10 +46,13 @@ function login() {
*/ */
function loginByWeixin(userInfo) { function loginByWeixin(userInfo) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
return login().then((res) => { return login().then((res) => {
//登录远程服务器 //登录远程服务器
util.request(api.AuthLoginByWeixin, { code: res.code, userInfo: userInfo }, 'POST').then(res => { util.request(api.AuthLoginByWeixin, {
code: res.code,
userInfo: userInfo
}, 'POST').then(res => {
if (res.errno === 0) { if (res.errno === 0) {
//存储用户信息 //存储用户信息
wx.setStorageSync('userInfo', res.data.userInfo); wx.setStorageSync('userInfo', res.data.userInfo);
...@@ -72,7 +75,7 @@ function loginByWeixin(userInfo) { ...@@ -72,7 +75,7 @@ function loginByWeixin(userInfo) {
* 判断用户是否登录 * 判断用户是否登录
*/ */
function checkLogin() { function checkLogin() {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
if (wx.getStorageSync('userInfo') && wx.getStorageSync('token')) { if (wx.getStorageSync('userInfo') && wx.getStorageSync('token')) {
checkSession().then(() => { checkSession().then(() => {
resolve(true); resolve(true);
......
...@@ -23,7 +23,7 @@ function formatNumber(n) { ...@@ -23,7 +23,7 @@ function formatNumber(n) {
* 封装微信的的request * 封装微信的的request
*/ */
function request(url, data = {}, method = "GET") { function request(url, data = {}, method = "GET") {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
wx.request({ wx.request({
url: url, url: url,
data: data, data: data,
...@@ -32,7 +32,7 @@ function request(url, data = {}, method = "GET") { ...@@ -32,7 +32,7 @@ function request(url, data = {}, method = "GET") {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'X-Litemall-Token': wx.getStorageSync('token') 'X-Litemall-Token': wx.getStorageSync('token')
}, },
success: function (res) { success: function(res) {
if (res.statusCode == 200) { if (res.statusCode == 200) {
...@@ -56,7 +56,7 @@ function request(url, data = {}, method = "GET") { ...@@ -56,7 +56,7 @@ function request(url, data = {}, method = "GET") {
} }
}, },
fail: function (err) { fail: function(err) {
reject(err) reject(err)
} }
}) })
...@@ -91,5 +91,3 @@ module.exports = { ...@@ -91,5 +91,3 @@ module.exports = {
redirect, redirect,
showErrorToast showErrorToast
}; };
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment