Commit 00220656 by xnn

修复已知问题

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