|
@@ -331,14 +331,14 @@
|
|
id: orderId.value
|
|
id: orderId.value
|
|
}).then(res3 => {
|
|
}).then(res3 => {
|
|
console.log('res3', res3);
|
|
console.log('res3', res3);
|
|
- if (res3.code == 0&&res3.data.success) {
|
|
|
|
|
|
+ if (res3.code == 0 && res3.data.success) {
|
|
genggaiVip(res3.data)
|
|
genggaiVip(res3.data)
|
|
} else {
|
|
} else {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
orderCheck({
|
|
orderCheck({
|
|
id: orderId.value
|
|
id: orderId.value
|
|
}).then(res4 => {
|
|
}).then(res4 => {
|
|
- if (res4.code == 0&&res4.data.success) {
|
|
|
|
|
|
+ if (res4.code == 0 && res4.data.success) {
|
|
genggaiVip(res4.data)
|
|
genggaiVip(res4.data)
|
|
} else {
|
|
} else {
|
|
toast(
|
|
toast(
|
|
@@ -483,7 +483,7 @@
|
|
id: orderId.value
|
|
id: orderId.value
|
|
}).then(res3 => {
|
|
}).then(res3 => {
|
|
console.log('res3', res3);
|
|
console.log('res3', res3);
|
|
- if (res3.code == 0&&res3.data.success) {
|
|
|
|
|
|
+ if (res3.code == 0 && res3.data.success) {
|
|
|
|
|
|
genggaiVip(res3.data)
|
|
genggaiVip(res3.data)
|
|
} else {
|
|
} else {
|
|
@@ -491,7 +491,7 @@
|
|
orderCheck({
|
|
orderCheck({
|
|
id: orderId.value
|
|
id: orderId.value
|
|
}).then(res4 => {
|
|
}).then(res4 => {
|
|
- if (res4.code == 0&&res4.data.success) {
|
|
|
|
|
|
+ if (res4.code == 0 && res4.data.success) {
|
|
genggaiVip(res4.data)
|
|
genggaiVip(res4.data)
|
|
} else {
|
|
} else {
|
|
toast(
|
|
toast(
|
|
@@ -551,7 +551,7 @@
|
|
orderCheck({
|
|
orderCheck({
|
|
id: orderId.value
|
|
id: orderId.value
|
|
}).then(res3 => {
|
|
}).then(res3 => {
|
|
- if (res3.code == 0&&res3.data.success) {
|
|
|
|
|
|
+ if (res3.code == 0 && res3.data.success) {
|
|
genggaiVip(res3.data)
|
|
genggaiVip(res3.data)
|
|
} else {
|
|
} else {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -559,7 +559,7 @@
|
|
id: orderId.value
|
|
id: orderId.value
|
|
}).then(res4 => {
|
|
}).then(res4 => {
|
|
if (res4.code ==
|
|
if (res4.code ==
|
|
- 0&&res4.data.success) {
|
|
|
|
|
|
+ 0 && res4.data.success) {
|
|
genggaiVip(res4.data)
|
|
genggaiVip(res4.data)
|
|
} else {
|
|
} else {
|
|
toast(
|
|
toast(
|
|
@@ -708,20 +708,51 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- function addProduct(item) {
|
|
|
|
|
|
|
|
|
|
+ function addProduct(item) {
|
|
if (!cacheManager.get('auth')) {
|
|
if (!cacheManager.get('auth')) {
|
|
youkeDialogRef.value.handleShow();
|
|
youkeDialogRef.value.handleShow();
|
|
- return false
|
|
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (item.yigou == 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const currentSelected = productData.selectedIds;
|
|
|
|
+ const isAlreadySelected = currentSelected.includes(item.id);
|
|
|
|
+ if (currentPlatform.value == 'ios') {
|
|
|
|
+ if (isAlreadySelected) {
|
|
|
|
+ productData.selectedIds = currentSelected.filter(id => id !== item.id);
|
|
|
|
+ } else {
|
|
|
|
+ if (currentSelected.length >= 1) {
|
|
|
|
+ toast("只允许单个购买!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ productData.selectedIds = [item.id];
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ const temp = [...currentSelected];
|
|
|
|
+ const index = temp.indexOf(item.id);
|
|
|
|
+ index > -1 ? temp.splice(index, 1) : temp.push(item.id);
|
|
|
|
+ productData.selectedIds = temp;
|
|
}
|
|
}
|
|
- console.log('item', item);
|
|
|
|
|
|
|
|
- const temp = [...productData.selectedIds]
|
|
|
|
- const index = temp.indexOf(item.id)
|
|
|
|
- index > -1 ? temp.splice(index, 1) : temp.push(item.id)
|
|
|
|
- productData.selectedIds = temp
|
|
|
|
- console.log('productData.selectedIds', productData.selectedIds);
|
|
|
|
}
|
|
}
|
|
|
|
+ // function addProduct(item) {
|
|
|
|
+
|
|
|
|
+ // if (!cacheManager.get('auth')) {
|
|
|
|
+ // youkeDialogRef.value.handleShow();
|
|
|
|
+ // return false
|
|
|
|
+ // }
|
|
|
|
+ // if (item.yigou == 1) {
|
|
|
|
+ // return false
|
|
|
|
+ // }
|
|
|
|
+ // const temp = [...productData.selectedIds]
|
|
|
|
+ // const index = temp.indexOf(item.id)
|
|
|
|
+ // index > -1 ? temp.splice(index, 1) : temp.push(item.id)
|
|
|
|
+ // productData.selectedIds = temp
|
|
|
|
+ // console.log('productData.selectedIds', productData.selectedIds.length);
|
|
|
|
+ // }
|
|
|
|
|
|
function isItemSelected(id) {
|
|
function isItemSelected(id) {
|
|
return productData.cardId ?
|
|
return productData.cardId ?
|
|
@@ -752,7 +783,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
-
|
|
|
|
|
|
+ isIOSorAndroid()
|
|
if (!cacheManager.get('auth')) {
|
|
if (!cacheManager.get('auth')) {
|
|
// 游客
|
|
// 游客
|
|
levelId.value = options.levelId
|
|
levelId.value = options.levelId
|
|
@@ -769,7 +800,7 @@
|
|
} else {
|
|
} else {
|
|
productData.current = Number(cacheManager.get('auth').subjectId) - 1
|
|
productData.current = Number(cacheManager.get('auth').subjectId) - 1
|
|
}
|
|
}
|
|
- //isIOSorAndroid()
|
|
|
|
|
|
+
|
|
getMore();
|
|
getMore();
|
|
}
|
|
}
|
|
|
|
|