小程序产品页面优化,及添加忽略文件
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import Toast from 'tdesign-miniprogram/toast/index';
|
||||
import { fetchGood } from '../../../services/good/fetchGood';
|
||||
import { fetchActivityList } from '../../../services/activity/fetchActivityList';
|
||||
import {
|
||||
@@ -49,21 +48,7 @@ Page({
|
||||
],
|
||||
storeLogo: `${imgPrefix}common/store-logo.png`,
|
||||
storeName: '云mall标准版旗舰店',
|
||||
jumpArray: [
|
||||
{
|
||||
title: '首页',
|
||||
url: '/pages/home/home',
|
||||
iconName: 'home',
|
||||
},
|
||||
{
|
||||
title: '购物车',
|
||||
url: '/pages/cart/index',
|
||||
iconName: 'cart',
|
||||
showCartNum: true,
|
||||
},
|
||||
],
|
||||
isStock: true,
|
||||
cartNum: 0,
|
||||
soldout: false,
|
||||
buttonType: 1,
|
||||
buyNum: 1,
|
||||
@@ -74,7 +59,7 @@ Page({
|
||||
isSpuSelectPopupShow: false,
|
||||
isAllSelectedSku: false,
|
||||
buyType: 0,
|
||||
outOperateStatus: false, // 是否外层加入购物车
|
||||
outOperateStatus: false, // 是否由底部购买栏唤起弹窗
|
||||
operateType: 0,
|
||||
selectSkuSellsPrice: 0,
|
||||
maxLinePrice: 0,
|
||||
@@ -104,21 +89,16 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 点击"已选"行:仅选择规格
|
||||
onSelectSkuTap() {
|
||||
this.showSkuSelectPopup(0);
|
||||
},
|
||||
|
||||
// 点击底部"立即购买"
|
||||
buyItNow() {
|
||||
this.showSkuSelectPopup(1);
|
||||
},
|
||||
|
||||
toAddCart() {
|
||||
this.showSkuSelectPopup(2);
|
||||
},
|
||||
|
||||
toNav(e) {
|
||||
const { url } = e.detail;
|
||||
wx.switchTab({
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
|
||||
showCurImg(e) {
|
||||
const { index } = e.detail;
|
||||
const { images } = this.data.details;
|
||||
@@ -226,29 +206,8 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
addCart() {
|
||||
const { isAllSelectedSku } = this.data;
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: isAllSelectedSku ? '点击加入购物车' : '请选择规格',
|
||||
icon: '',
|
||||
duration: 1000,
|
||||
});
|
||||
},
|
||||
|
||||
gotoBuy(type) {
|
||||
const { isAllSelectedSku, buyNum } = this.data;
|
||||
if (!isAllSelectedSku) {
|
||||
// Toast({
|
||||
// context: this,
|
||||
// selector: '#t-toast',
|
||||
// message: '请选择规格',
|
||||
// icon: '',
|
||||
// duration: 1000,
|
||||
// });
|
||||
// return;
|
||||
}
|
||||
gotoBuy() {
|
||||
const { buyNum } = this.data;
|
||||
this.handlePopupHide();
|
||||
const query = {
|
||||
quantity: buyNum,
|
||||
@@ -278,13 +237,7 @@ Page({
|
||||
},
|
||||
|
||||
specsConfirm() {
|
||||
const { buyType } = this.data;
|
||||
if (buyType === 1) {
|
||||
this.gotoBuy();
|
||||
} else {
|
||||
this.addCart();
|
||||
}
|
||||
// this.handlePopupHide();
|
||||
this.gotoBuy();
|
||||
},
|
||||
|
||||
changeNum(e) {
|
||||
|
||||
Reference in New Issue
Block a user