diff --git a/public/appmini/old/wechat/app.js b/public/appmini/old/wechat/app.js
index db3443d15f9cf74e06f21d4f8505dda73137b07c..7bdfea8e546f39a9933c675fdea36b45f621c7f1 100755
--- a/public/appmini/old/wechat/app.js
+++ b/public/appmini/old/wechat/app.js
@@ -181,23 +181,6 @@ App({
);
},
- /**
- * 获取平台用户信息
- * object 回调操作对象
- * method 回调操作对象的函数
- * return 有用户数据直接返回, 则回调调用者
- */
- get_user_info(object, method) {
- var user = this.get_user_cache_info();
- if (user == false) {
- // 唤醒用户授权
- this.user_auth_code(object, method);
-
- return false;
- }
- return user;
- },
-
/**
* 从缓存获取用户信息
*/
@@ -209,50 +192,13 @@ App({
return user;
},
- /**
- * 用户授权
- * object 回调操作对象
- * method 回调操作对象的函数
- */
- user_auth_code(object, method) {
- // 加载loding
- wx.showLoading({ title: '授权中...' });
- var $this = this;
-
- // 请求授权接口
- wx.getSetting({
- success(res) {
- if (!res.authSetting['scope.userInfo']) {
- wx.navigateTo({
- url: "/pages/login/login"
- });
- // wx.authorize({
- // scope: 'scope.userInfo',
- // success() {
- // $this.user_auth_login(object, method);
- // },
- // fail: (e) => {
- // wx.hideLoading();
- // $this.showToast('授权失败');
- // }
- // });
- } else {
- $this.user_auth_login(object, method);
- }
- },
- fail: (e) => {
- wx.hideLoading();
- $this.showToast('授权校验失败');
- }
- });
- },
-
/**
* 用户登录
* object 回调操作对象
* method 回调操作对象的函数
*/
user_auth_login(object, method) {
+ wx.showLoading({ title: "授权中..." });
var $this = this;
wx.checkSession({
success: function () {
diff --git a/public/appmini/old/wechat/app.wxss b/public/appmini/old/wechat/app.wxss
index 69bb3c3023b1bf0d5055ae440b4b8f8702496e53..2f98590156d1fa78aa6c3ab0990272e46e4aa260 100755
--- a/public/appmini/old/wechat/app.wxss
+++ b/public/appmini/old/wechat/app.wxss
@@ -120,20 +120,20 @@ textarea {
.my-btn-default{
font-size: 38rpx;
- color: #fff;
- border: none;
- background-color:#d2364c;
+ color: #fff !important;
+ border: none !important;
+ background-color:#d2364c !important;
border-radius: 2px;
}
.my-btn-default.btn-disabled{
- background-color: #a6a6a6;
- color: #fff;
+ background-color: #a6a6a6 !important;
+ color: #fff !important;
}
.my-btn-gray{
font-size: 30rpx;
- color: #fff;
- border: none;
- background-color:#a6a6a6;
+ color: #fff !important;
+ border: none !important;
+ background-color:#a6a6a6 !important;
border-radius: 2px;
}
@@ -240,7 +240,7 @@ textarea {
background-color: #ed6977 !important;
}
.bg-warning {
- background-color: #F37B1D !important;
+ background-color: #F37B1D !important;
}
.bg-active-main {
background-color: #d2364c !important;
diff --git a/public/appmini/old/wechat/pages/buy/buy.wxml b/public/appmini/old/wechat/pages/buy/buy.wxml
index 64dec6fcaf55ec282d78041a0ede70bd6a9abd89..86ba920c7d03c2dd16b416afbd79e48cd4d299c5 100755
--- a/public/appmini/old/wechat/pages/buy/buy.wxml
+++ b/public/appmini/old/wechat/pages/buy/buy.wxml
@@ -42,7 +42,7 @@
-
+
diff --git a/public/appmini/old/wechat/pages/cart/cart.js b/public/appmini/old/wechat/pages/cart/cart.js
index 46cf71fc94c9ec22c11a421c8cc299be2770558f..9831fd43be60d1b287df255298d12773cd2326e5 100755
--- a/public/appmini/old/wechat/pages/cart/cart.js
+++ b/public/appmini/old/wechat/pages/cart/cart.js
@@ -17,26 +17,24 @@ Page({
},
init(e) {
- var user = app.get_user_info(this, "init");
- if (user != false) {
- // 用户未绑定用户则转到登录页面
- if ((user.mobile || null) == null) {
- wx.showModal({
- title: '温馨提示',
- content: '绑定手机号码',
- confirmText: '确认',
- cancelText: '暂不',
- success: (result) => {
- if (result.confirm) {
- wx.navigateTo({
- url: "/pages/login/login?event_callback=init"
- });
- }
- },
- });
- } else {
- this.get_data();
- }
+ var user = app.get_user_cache_info(this, "init");
+ // 用户未绑定用户则转到登录页面
+ if (user == false || ((user.mobile || null) == null)) {
+ wx.showModal({
+ title: '温馨提示',
+ content: '绑定手机号码',
+ confirmText: '确认',
+ cancelText: '暂不',
+ success: (result) => {
+ if (result.confirm) {
+ wx.navigateTo({
+ url: "/pages/login/login?event_callback=init"
+ });
+ }
+ },
+ });
+ } else {
+ this.get_data();
}
},
@@ -75,10 +73,7 @@ Page({
data_bottom_line_status: false,
data_list_loding_msg: res.data.msg,
});
- wx.showToast({
- type: "fail",
- content: res.data.msg
- });
+ app.showToast(res.data.msg);
}
},
fail: () => {
@@ -89,10 +84,7 @@ Page({
data_list_loding_msg: '服务器请求出错',
});
- wx.showToast({
- type: "fail",
- content: "服务器请求出错"
- });
+ app.showToast("服务器请求出错");
}
});
},
@@ -132,18 +124,18 @@ Page({
if (buy_number < buy_min_number) {
buy_number = buy_min_number;
if (buy_min_number > 1) {
- wx.showToast({ content: '起购' + buy_min_number + inventory_unit });
+ app.showToast('起购' + buy_min_number + inventory_unit );
return false;
}
}
if (buy_max_number > 0 && buy_number > buy_max_number) {
buy_number = buy_max_number;
- wx.showToast({ content: '限购' + buy_max_number + inventory_unit });
+ app.showToast('限购' + buy_max_number + inventory_unit );
return false;
}
if (buy_number > inventory) {
buy_number = inventory;
- wx.showToast({ content: '库存数量' + inventory + inventory_unit });
+ app.showToast( '库存数量' + inventory + inventory_unit );
return false;
}
@@ -167,17 +159,11 @@ Page({
// 选择处理
this.selected_calculate();
} else {
- wx.showToast({
- type: "fail",
- content: res.data.msg
- });
+ app.showToast(res.data.msg);
}
},
fail: () => {
- wx.showToast({
- type: "fail",
- content: "服务器请求出错"
- });
+ app.showToast("服务器请求出错");
}
});
},
@@ -225,17 +211,11 @@ Page({
if (res.data.code == 0) {
this.cart_delete(id, type);
} else {
- wx.showToast({
- type: 'fail',
- content: res.data.msg
- });
+ app.showToast(res.data.msg);
}
},
fail: () => {
- wx.showToast({
- type: 'fail',
- content: '服务器请求出错'
- });
+ app.showToast("服务器请求出错");
}
});
},
@@ -257,22 +237,13 @@ Page({
data_list_loding_status: temp_data_list.length == 0 ? 0 : this.data.data_list_loding_status,
});
- wx.showToast({
- type: 'success',
- content: (type == 'delete') ? '删除成功' : '收藏成功'
- });
+ app.showToast(((type == 'delete') ? '删除成功' : '收藏成功'), 'success');
} else {
- wx.showToast({
- type: 'fail',
- content: (type == 'delete') ? '删除失败' : '收藏失败'
- });
+ app.showToast((type == 'delete') ? '删除失败' : '收藏失败');
}
},
fail: () => {
- wx.showToast({
- type: 'fail',
- content: '服务器请求出错'
- });
+ app.showToast("服务器请求出错");
}
});
},
@@ -342,10 +313,7 @@ Page({
}
if (selected_count <= 0) {
- wx.showToast({
- type: "fail",
- content: '请选择商品'
- });
+ app.showToast("请选择商品");
return false
}
diff --git a/public/appmini/old/wechat/pages/cart/cart.wxml b/public/appmini/old/wechat/pages/cart/cart.wxml
index 41072614ae9f8905e70162f6467d1c7a79c13bc2..e301288476634f82d3af89b0d7658a4a0f527274 100755
--- a/public/appmini/old/wechat/pages/cart/cart.wxml
+++ b/public/appmini/old/wechat/pages/cart/cart.wxml
@@ -23,7 +23,7 @@
-
-
+
+
diff --git a/public/appmini/old/wechat/pages/goods-detail/goods-detail.wxml b/public/appmini/old/wechat/pages/goods-detail/goods-detail.wxml
index 1d56656fc199413a1afacb07bcb59097d2f60482..797b9311e6bcf339ed3674eb3d4438b4e9b1c9aa 100755
--- a/public/appmini/old/wechat/pages/goods-detail/goods-detail.wxml
+++ b/public/appmini/old/wechat/pages/goods-detail/goods-detail.wxml
@@ -121,7 +121,7 @@
购买数量
-
-
+
+
diff --git a/public/appmini/old/wechat/pages/login/login.js b/public/appmini/old/wechat/pages/login/login.js
index 56eab627e07478591b644235c96fc7ec3de3decb..a4e2dadb33d31e2f5e142917a1cb9b990db9dbcf 100755
--- a/public/appmini/old/wechat/pages/login/login.js
+++ b/public/appmini/old/wechat/pages/login/login.js
@@ -30,9 +30,38 @@ Page({
* 登录授权事件
*/
get_user_info_event(e) {
- console.log(e, e.detail.userInfo);
- //app.user_auth_login();
- wx.navigateBack();
+ this.user_auth_code();
+ },
+
+ /**
+ * 用户授权
+ * object 回调操作对象
+ * method 回调操作对象的函数
+ */
+ user_auth_code(object, method) {
+ // 请求授权接口
+ var $this = this;
+ wx.getSetting({
+ success(res) {
+ if (!res.authSetting['scope.userInfo']) {
+ $this.setData({ user: null});
+ } else {
+ app.user_auth_login($this, 'user_auth_back_event');
+ }
+ },
+ fail: (e) => {
+ app.showToast("授权校验失败");
+ }
+ });
+ },
+
+ /**
+ * 授权返回事件
+ */
+ user_auth_back_event() {
+ this.setData({
+ user: app.get_user_cache_info() || null
+ });
},
/**
@@ -83,20 +112,14 @@ Page({
} else {
this.setData({verify_submit_text: '获取验证码', verify_loading: false, verify_disabled: false});
- wx.showToast({
- type: 'fail',
- content: res.data.msg
- });
+ app.showToast(res.data.msg);
}
},
fail: () => {
wx.hideLoading();
this.setData({verify_submit_text: '获取验证码', verify_loading: false, verify_disabled: false});
- wx.showToast({
- type: 'fail',
- content: '服务器请求出错'
- });
+ app.showToast("服务器请求出错");
}
});
}
@@ -111,16 +134,16 @@ Page({
var validation = [
{fields: 'mobile', msg: '请填写手机号码'},
{fields: 'verify', msg: '请填写验证码'},
- {fields: 'alipay_openid', msg: '授权id不能为空'}
+ {fields: 'weixin_openid', msg: '授权id不能为空'}
];
- e.detail.value['alipay_openid'] = this.data.user.alipay_openid;
+ e.detail.value['weixin_openid'] = this.data.user.weixin_openid;
e.detail.value['nickname'] = this.data.user.nickname;
e.detail.value['avatar'] = this.data.user.avatar;
e.detail.value['province'] = this.data.user.province;
e.detail.value['city'] = this.data.user.city;
e.detail.value['gender'] = this.data.user.gender;
e.detail.value['referrer'] = this.data.user.referrer;
- e.detail.value['app_type'] = 'alipay';
+ e.detail.value['app_type'] = 'weixin';
if(app.fields_check(e.detail.value, validation))
{
wx.showLoading({content: '处理中...'});
@@ -139,10 +162,7 @@ Page({
if(res.data.code == 0 && (res.data.data || null) != null)
{
clearInterval(this.data.temp_clear_time);
- wx.showToast({
- type: 'success',
- content: res.data.msg
- });
+ app.showToast(res.data.msg, 'success');
wx.setStorage({
key: app.data.cache_user_info_key,
@@ -162,20 +182,14 @@ Page({
} else {
this.setData({form_submit_loading: false});
- wx.showToast({
- type: 'fail',
- content: res.data.msg
- });
+ app.showToast(res.data.msg);
}
},
fail: () => {
wx.hideLoading();
this.setData({form_submit_loading: false});
- wx.showToast({
- type: 'fail',
- content: '服务器请求出错'
- });
+ app.showToast("服务器请求出错");
}
});
}
diff --git a/public/appmini/old/wechat/pages/login/login.wxml b/public/appmini/old/wechat/pages/login/login.wxml
index 3737c480ec35ad21fd681f62c8e7696dfa65a80d..0562f949fac496659a382bc75f12b9a61cc6df78 100755
--- a/public/appmini/old/wechat/pages/login/login.wxml
+++ b/public/appmini/old/wechat/pages/login/login.wxml
@@ -1,9 +1,9 @@
diff --git a/public/appmini/old/wechat/pages/login/login.wxss b/public/appmini/old/wechat/pages/login/login.wxss
index 48bd97576effd2bfa29513b2b46302345a2e391a..dfdeb0a24ecfeff6baafaacb63b79eef2d9ec2dc 100755
--- a/public/appmini/old/wechat/pages/login/login.wxss
+++ b/public/appmini/old/wechat/pages/login/login.wxss
@@ -23,6 +23,7 @@ page{
.content .code{
margin: 20rpx 0;
border-bottom: solid 1px #eee;
+ position: relative;
}
.content .code .verify{
width: 63%;
@@ -34,6 +35,9 @@ page{
height: 35px;
line-height: 35px;
border-radius: 10rpx;
+ position: absolute;
+ top: 0;
+ right: 0;
}
.content .code .verify-sub.sub-disabled{
border: solid 1px #eee;