|
@@ -386,7 +386,8 @@ var _default =
|
|
|
user = that.user;
|
|
|
info = that.info;
|
|
|
specsInfo = that.specsInfo;if (!(
|
|
|
- user && user._id)) {_context3.next = 12;break;}
|
|
|
+ user && user._id)) {_context3.next = 16;break;}if (!(
|
|
|
+ user.role == 'jdry' || user.role == 'sqry')) {_context3.next = 13;break;}
|
|
|
|
|
|
obj = {
|
|
|
user: user._id,
|
|
@@ -395,9 +396,9 @@ var _default =
|
|
|
goods: info._id,
|
|
|
num: that.buy_num,
|
|
|
money: specsInfo.money,
|
|
|
- total_money: that.$multiply(specsInfo.money, that.buy_num) };_context3.next = 8;return (
|
|
|
+ total_money: that.$multiply(specsInfo.money, that.buy_num) };_context3.next = 9;return (
|
|
|
|
|
|
- that.$api("/Cart", 'POST', obj));case 8:res = _context3.sent;
|
|
|
+ that.$api("/Cart", 'POST', obj));case 9:res = _context3.sent;
|
|
|
if (res.errcode == '0') {
|
|
|
uni.showToast({
|
|
|
title: "\u52A0\u5165\u8D2D\u7269\u8F66\u6210\u529F",
|
|
@@ -409,10 +410,16 @@ var _default =
|
|
|
title: res.errmsg,
|
|
|
icon: 'none' });
|
|
|
|
|
|
- }_context3.next = 13;break;case 12:
|
|
|
+ }_context3.next = 14;break;case 13:
|
|
|
+
|
|
|
+ uni.showToast({
|
|
|
+ title: '角色不匹配 无法加入购物车',
|
|
|
+ icon: 'none' });case 14:_context3.next = 17;break;case 16:
|
|
|
+
|
|
|
+
|
|
|
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/login/index" });case 13:case "end":return _context3.stop();}}}, _callee3);}))();
|
|
|
+ url: "/pages/login/index" });case 17:case "end":return _context3.stop();}}}, _callee3);}))();
|
|
|
|
|
|
|
|
|
},
|