Commit 00220656 by xnn

修复已知问题

parent b662311f
......@@ -76,7 +76,8 @@
nowStatus: "-1",
totalPage: 0,
current: 1,
total: 0
total: 0,
btnFlag: false
}
},
onLoad(option) {
......@@ -92,6 +93,13 @@
})
},
payMthods(order_id) {
if (this.btnFlag) {
return
}
this.btnFlag = true
setTimeout(() => {
this.btnFlag = false
}, 2000)
this.$utils.payOrder(order_id)
},
pageType() {
......@@ -123,6 +131,13 @@
}
},
del_order(id) {
if (this.btnFlag) {
return
}
this.btnFlag = true
setTimeout(() => {
this.btnFlag = false
}, 2000)
this.$request('/cance-order', 'POST', {
order_id: id
}).then(res => {
......
......@@ -98,6 +98,7 @@
order_amount: null,
},
id: '',
btnFlag: false,
navBarHeight: getApp().globalData.navBarHeight,
}
},
......@@ -114,6 +115,13 @@
})
},
payMthods(order_id) {
if (this.btnFlag) {
return
}
this.btnFlag = true
setTimeout(() => {
this.btnFlag = false
}, 2000)
this.$utils.payOrder(order_id)
},
gotoHere(address, lat, lng) {
......@@ -144,6 +152,13 @@
})
},
del_order() {
if (this.btnFlag) {
return
}
this.btnFlag = true
setTimeout(() => {
this.btnFlag = false
}, 2000)
this.$request('/cance-order', 'POST', {
order_id: this.id
}).then(res => {
......
......@@ -17,12 +17,14 @@
style="font-size: 42rpx;">{{goods_detail.goods_price || ''}}</span>
<span style="margin-right: 15rpx;"></span>
<span v-if="goods_tags.field12 != undefined">
<span v-if="priceFlag && goods_tags.field12 != undefined">
{{goods_tags.field12.substring(0, 3)}}</span>
<span class="productPriceIcon"
v-if="goods_detail.market_price != undefined && goods_detail.market_price != ''">¥</span>
<span style="text-decoration: line-through;">{{goods_detail.market_price || ''}}</span>
<span v-if="goods_detail.market_price != undefined && goods_detail.market_price != ''"></span>
v-if="priceFlag && goods_detail.market_price != undefined && goods_detail.market_price != ''">¥</span>
<span v-if="priceFlag"
style="text-decoration: line-through;">{{goods_detail.market_price || ''}}</span>
<span
v-if="priceFlag && goods_detail.market_price != undefined && goods_detail.market_price != ''"></span>
</view>
<view>
<span v-if="goods_tags.field14 != undefined"
......@@ -225,7 +227,8 @@
attrArry: [], //规格数组
flag: true,
priceFlag: false,
buycode: ''
buycode: '',
btnFlag: false
}
},
onLoad(option) {
......@@ -257,7 +260,9 @@
let _this = this
await _this.$request('/user-info', 'GET', {}).then(res => {
console.log(res.data.buycode);
_this.buycode = res.data.buycode
if (_this.priceFlag) {
_this.buycode = res.data.buycode
}
_this.getGoodsDetail();
}).catch(err => {
uni.showToast({
......@@ -370,6 +375,9 @@
},
//添加购物车
add_shopping_cart() {
if (this.btnFlag) {
return
}
let _this = this;
if (this.goods_detail.skuOne.stock == 0) {
_this.$refs.uToast.show({
......@@ -390,11 +398,13 @@
}
}
_this.attr_name = this.attrArry.length > 1 ? this.attrArry.join(',') : this.attrArry[0];
this.btnFlag = true
_this.$request('/add-shopping-cart', 'POST', {
goods_id: _this.goods_id,
num: _this.goodsNum,
attr_name: _this.attr_name,
}).then(res => {
this.btnFlag = false
console.log("添加购物车成功")
_this.$refs.uToast.show({
type: 'success',
......@@ -402,12 +412,10 @@
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/jump.png'
})
}).catch(err => {
this.btnFlag = false
_uni.showToast({
icon: 'error',
title: '' + err.message
})
})
},
......
......@@ -131,7 +131,8 @@
islogin: 0,
is_examine: null,
priceFlag: false,
buycode: ''
buycode: '',
userInfo: ''
}
},
onLoad(option) {
......@@ -184,7 +185,9 @@
let _this = this
await _this.$request('/user-info', 'GET', {}).then(res => {
console.log(res.data.buycode);
_this.buycode = res.data.buycode
if (_this.priceFlag) {
_this.buycode = res.data.buycode
}
_this.$request(url, 'GET', {
buycode: _this.buycode
}).then(res => {
......
......@@ -61,10 +61,15 @@
pageList: [],
pageNum: 1,
pageSize: 10,
priceFlag: false
priceFlag: false,
userInfo: {}
}
},
onShow() {
this.pageList = []
if (uni.getStorageSync('userInfo')) {
this.userInfo = uni.getStorageSync('userInfo')
}
if (uni.getStorageSync('codeTime')) {
console.log(uni.getStorageSync('codeTime'))
let beforTime = uni.getStorageSync('codeTime')
......@@ -85,11 +90,13 @@
},
//获取推荐商品列表
getProductList(e) {
let url = uni.getStorageSync('token') ? "/goods-list-auth" : '/goods-list';
this.$request(url, 'GET', {
let param = {
page: this.pageNum,
limit: this.pageSize
}).then(res => {
page_size: this.pageSize,
buycode: this.priceFlag ? this.userInfo.buycode : ''
}
let url = uni.getStorageSync('token') ? "/goods-list-auth" : '/goods-list';
this.$request(url, 'GET', param).then(res => {
console.log(res.data)
this.pageList = [...this.pageList, ...res.data.list];
}).catch(err => {
......
......@@ -258,7 +258,8 @@ var _default = {
nowStatus: "-1",
totalPage: 0,
current: 1,
total: 0
total: 0,
btnFlag: false
};
},
onLoad: function onLoad(option) {
......@@ -274,6 +275,14 @@ var _default = {
});
},
payMthods: function payMthods(order_id) {
var _this = this;
if (this.btnFlag) {
return;
}
this.btnFlag = true;
setTimeout(function () {
_this.btnFlag = false;
}, 2000);
this.$utils.payOrder(order_id);
},
pageType: function pageType() {
......@@ -305,18 +314,25 @@ var _default = {
}
},
del_order: function del_order(id) {
var _this = this;
var _this2 = this;
if (this.btnFlag) {
return;
}
this.btnFlag = true;
setTimeout(function () {
_this2.btnFlag = false;
}, 2000);
this.$request('/cance-order', 'POST', {
order_id: id
}).then(function (res) {
console.log(res.data);
_this.$refs.uToast.show({
_this2.$refs.uToast.show({
type: 'success',
message: "订单取消成功!",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/jump.png',
complete: function complete() {}
});
_this.pageType();
_this2.pageType();
}).catch(function (err) {
uni.showToast({
icon: 'error',
......@@ -333,15 +349,15 @@ var _default = {
},
//获取我的订单
getOrderList: function getOrderList() {
var _this2 = this;
var _this3 = this;
this.$request('/order-list', 'GET', {
order_status: this.nowStatus,
page: this.pageNum
}).then(function (res) {
console.log(res.data);
_this2.pageList = [].concat((0, _toConsumableArray2.default)(_this2.pageList), (0, _toConsumableArray2.default)(res.data.list));
_this2.total = res.data.total;
_this2.totalPage = res.data.total_page;
_this3.pageList = [].concat((0, _toConsumableArray2.default)(_this3.pageList), (0, _toConsumableArray2.default)(res.data.list));
_this3.total = res.data.total;
_this3.totalPage = res.data.total_page;
}).catch(function (err) {
// uni.showToast({
// icon: 'error',
......
......@@ -285,6 +285,7 @@ var _default = {
order_amount: null
},
id: '',
btnFlag: false,
navBarHeight: getApp().globalData.navBarHeight
};
},
......@@ -301,6 +302,14 @@ var _default = {
});
},
payMthods: function payMthods(order_id) {
var _this = this;
if (this.btnFlag) {
return;
}
this.btnFlag = true;
setTimeout(function () {
_this.btnFlag = false;
}, 2000);
this.$utils.payOrder(order_id);
},
gotoHere: function gotoHere(address, lat, lng) {
......@@ -323,12 +332,12 @@ var _default = {
},
//获取订单详情
getOrder: function getOrder() {
var _this = this;
var _this2 = this;
this.$request('/order-info', 'GET', {
order_id: this.id
}).then(function (res) {
console.log(res.data);
_this.orderInfo = res.data;
_this2.orderInfo = res.data;
}).catch(function (err) {
uni.showToast({
icon: 'error',
......@@ -337,12 +346,19 @@ var _default = {
});
},
del_order: function del_order() {
var _this2 = this;
var _this3 = this;
if (this.btnFlag) {
return;
}
this.btnFlag = true;
setTimeout(function () {
_this3.btnFlag = false;
}, 2000);
this.$request('/cance-order', 'POST', {
order_id: this.id
}).then(function (res) {
console.log(res.data);
_this2.$refs.uToast.show({
_this3.$refs.uToast.show({
type: 'success',
message: "订单取消成功!",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/jump.png',
......
......@@ -152,7 +152,7 @@ var render = function () {
? _vm._f("''")(_vm.goods_tags.field11)
: null
var g1 =
_vm.goods_tags.field12 != undefined
_vm.priceFlag && _vm.goods_tags.field12 != undefined
? _vm.goods_tags.field12.substring(0, 3)
: null
var g2 =
......@@ -421,6 +421,8 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
//
//
//
//
//
var _default = {
data: function data() {
return {
......@@ -445,7 +447,8 @@ var _default = {
//规格数组
flag: true,
priceFlag: false,
buycode: ''
buycode: '',
btnFlag: false
};
},
onLoad: function onLoad(option) {
......@@ -483,7 +486,9 @@ var _default = {
_context.next = 3;
return _this.$request('/user-info', 'GET', {}).then(function (res) {
console.log(res.data.buycode);
_this.buycode = res.data.buycode;
if (_this.priceFlag) {
_this.buycode = res.data.buycode;
}
_this.getGoodsDetail();
}).catch(function (err) {
uni.showToast({
......@@ -597,6 +602,10 @@ var _default = {
},
//添加购物车
add_shopping_cart: function add_shopping_cart() {
var _this6 = this;
if (this.btnFlag) {
return;
}
var _this = this;
if (this.goods_detail.skuOne.stock == 0) {
_this.$refs.uToast.show({
......@@ -617,11 +626,13 @@ var _default = {
}
}
_this.attr_name = this.attrArry.length > 1 ? this.attrArry.join(',') : this.attrArry[0];
this.btnFlag = true;
_this.$request('/add-shopping-cart', 'POST', {
goods_id: _this.goods_id,
num: _this.goodsNum,
attr_name: _this.attr_name
}).then(function (res) {
_this6.btnFlag = false;
console.log("添加购物车成功");
_this.$refs.uToast.show({
type: 'success',
......@@ -629,6 +640,7 @@ var _default = {
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/jump.png'
});
}).catch(function (err) {
_this6.btnFlag = false;
_uni.showToast({
icon: 'error',
title: '' + err.message
......@@ -637,12 +649,12 @@ var _default = {
},
//是否收藏
getGoods_collect: function getGoods_collect() {
var _this6 = this;
var _this7 = this;
this.$request('/is-collect', 'GET', {
goods_id: this.goods_id
}).then(function (res) {
console.log(res.data);
_this6.isCollect = res.data.is_collect;
_this7.isCollect = res.data.is_collect;
}).catch(function (err) {
uni.showToast({
icon: 'error',
......@@ -652,11 +664,11 @@ var _default = {
},
//加入取消收藏
goods_collect: function goods_collect() {
var _this7 = this;
var _this8 = this;
this.$request('/goods-collect', 'GET', {
goods_id: this.goods_id
}).then(function (res) {
_this7.getGoods_collect();
_this8.getGoods_collect();
}).catch(function (err) {
uni.showToast({
icon: 'error',
......
......@@ -362,7 +362,8 @@ var _default = {
islogin: 0,
is_examine: null,
priceFlag: false,
buycode: ''
buycode: '',
userInfo: ''
};
},
onLoad: function onLoad(option) {
......@@ -423,7 +424,9 @@ var _default = {
_context.next = 3;
return _this.$request('/user-info', 'GET', {}).then(function (res) {
console.log(res.data.buycode);
_this.buycode = res.data.buycode;
if (_this.priceFlag) {
_this.buycode = res.data.buycode;
}
_this.$request(url, 'GET', {
buycode: _this.buycode
}).then(function (res) {
......
......@@ -276,10 +276,15 @@ var _default = {
pageList: [],
pageNum: 1,
pageSize: 10,
priceFlag: false
priceFlag: false,
userInfo: {}
};
},
onShow: function onShow() {
this.pageList = [];
if (uni.getStorageSync('userInfo')) {
this.userInfo = uni.getStorageSync('userInfo');
}
if (uni.getStorageSync('codeTime')) {
console.log(uni.getStorageSync('codeTime'));
var beforTime = uni.getStorageSync('codeTime');
......@@ -301,11 +306,13 @@ var _default = {
//获取推荐商品列表
getProductList: function getProductList(e) {
var _this = this;
var url = uni.getStorageSync('token') ? "/goods-list-auth" : '/goods-list';
this.$request(url, 'GET', {
var param = {
page: this.pageNum,
limit: this.pageSize
}).then(function (res) {
page_size: this.pageSize,
buycode: this.priceFlag ? this.userInfo.buycode : ''
};
var url = uni.getStorageSync('token') ? "/goods-list-auth" : '/goods-list';
this.$request(url, 'GET', param).then(function (res) {
console.log(res.data);
_this.pageList = [].concat((0, _toConsumableArray2.default)(_this.pageList), (0, _toConsumableArray2.default)(res.data.list));
}).catch(function (err) {
......
Markdown is supported
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