|
|
import wx from '../../../utils/wx';
|
|
|
import {
|
|
|
tapToLogin
|
|
|
} from '../../../common/login';
|
|
|
import formatImage from '../../../utils/formatImage';
|
|
|
import listModel from '../../../models/product/list';
|
|
|
import detailModel from '../../../models/product/detail';
|
|
|
import config from '../../../common/config';
|
|
|
import Yas from '../../../common/yas';
|
|
|
import {
|
|
|
getGoodInfo,
|
|
|
getGoodSize
|
|
|
} from '../../../utils/productDetail';
|
|
|
|
|
|
import Picker from './picker/picker';
|
|
|
import {
|
|
|
Actionsheet
|
|
|
} from '../../../vendors/zanui/index';
|
|
|
|
|
|
let app = getApp();
|
|
|
let router = global.router;
|
|
|
let {
|
|
|
windowHeight
|
|
|
} = app.getSystemInfo();
|
|
|
|
|
|
let yas;
|
|
|
|
|
|
Page(Object.assign({
|
|
|
data: {
|
|
|
shopId: 0,
|
|
|
productSkn: 0,
|
|
|
productName: '',
|
|
|
marketPrice: '',
|
|
|
salesPrice: '',
|
|
|
productImages: [],
|
|
|
storage_sum: 0,
|
|
|
buyImmediate: false,
|
|
|
loadingForPayment: false,
|
|
|
selectedSKU: 0,
|
|
|
colorSelected: false,
|
|
|
productSupportServiceList: [],
|
|
|
productDesc: [],
|
|
|
productPhrare: [],
|
|
|
productSizeTitle: [],
|
|
|
productSizeContent: [],
|
|
|
productMeasurementImage: [],
|
|
|
productWashTipsBoList: [],
|
|
|
productMaterialList: [],
|
|
|
productIntroImageList: [],
|
|
|
|
|
|
pickerData: {
|
|
|
view: {
|
|
|
isShow: false,
|
|
|
isSoldOutSoon: false,
|
|
|
goodsList: [],
|
|
|
sizeList: [],
|
|
|
image: '',
|
|
|
goodPrice: '',
|
|
|
price: '',
|
|
|
buyNumber: 1,
|
|
|
minusButtonEnable: false,
|
|
|
plusButtonEnable: true,
|
|
|
buyButtonEnable: true,
|
|
|
buy_limit_number: 0,
|
|
|
bundle_count: 0
|
|
|
},
|
|
|
sourceType: 'goodsDetail'
|
|
|
},
|
|
|
|
|
|
showSnapshootShare: false,
|
|
|
snapshootShareData: {},
|
|
|
|
|
|
actionSheet: {
|
|
|
componentId: 'shareActionSheet',
|
|
|
show: false,
|
|
|
closeOnClickOverlay: true,
|
|
|
cancelText: '取消',
|
|
|
actions: [{
|
|
|
name: '分享给朋友',
|
|
|
className: 'action-class',
|
|
|
loading: false,
|
|
|
openType: 'share'
|
|
|
}]
|
|
|
},
|
|
|
|
|
|
shopRecList: [],
|
|
|
preferList: [],
|
|
|
|
|
|
showMenu: false,
|
|
|
showBackTop: false,
|
|
|
showBottomTipView: false,
|
|
|
|
|
|
productOnlyProvideByYohoAPP: false,
|
|
|
productOnlyProvideByYohoStore: false,
|
|
|
productNotForSale: false,
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
let productSkn = options.productSkn ? options.productSkn : '';
|
|
|
|
|
|
if (!productSkn) {
|
|
|
productSkn = options.product_skn ? options.product_skn : '';
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
productSkn
|
|
|
});
|
|
|
this.productInfo();
|
|
|
|
|
|
setTimeout(() => {
|
|
|
this.supportService();
|
|
|
this.productIntro();
|
|
|
this.preferList();
|
|
|
}, 500);
|
|
|
|
|
|
yas = new Yas(app);
|
|
|
yas.pageOpenReport();
|
|
|
},
|
|
|
onPageScroll: function({
|
|
|
scrollTop
|
|
|
}) {
|
|
|
const showMenu = scrollTop > 50;
|
|
|
const show = scrollTop > windowHeight * 2;
|
|
|
|
|
|
if (show !== this.data.showBackTop) {
|
|
|
this.setData({
|
|
|
showBackTop: show
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (showMenu !== this.data.showMenu) {
|
|
|
this.setData({
|
|
|
showMenu: showMenu
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
backTop: function() {
|
|
|
wx.pageScrollTo({
|
|
|
scrollTop: 0
|
|
|
});
|
|
|
},
|
|
|
onShareAppMessage: function(res) {
|
|
|
let params = {
|
|
|
FROM: res.from,
|
|
|
SHARE_RESUIL: 0,
|
|
|
TITLE: this.data.productName,
|
|
|
DESC: '我在红人小店发现一个不错的商品赶快来看看吧!',
|
|
|
PATH: `/pages/product/detail/detail?productSkn=${this.data.productSkn}`,
|
|
|
};
|
|
|
|
|
|
// 用户点击右上角分享
|
|
|
return {
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: params.PATH, // 分享路径
|
|
|
success: function() {
|
|
|
params.SHARE_RESUIL = 1;
|
|
|
yas.report('YB_SHARE_RESULT_L', params);
|
|
|
},
|
|
|
fail: function() {
|
|
|
params.SHARE_RESUIL = 2;
|
|
|
yas.report('YB_SHARE_RESULT_L', params);
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
share: function() {
|
|
|
this.setData({
|
|
|
'actionSheet.show': true
|
|
|
});
|
|
|
},
|
|
|
handleZanActionsheetCancel() {
|
|
|
this.setData({
|
|
|
'actionSheet.show': false
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 当行动按钮中有一个被点击时触发
|
|
|
// index 代表被点击按钮在传入参数 actions 中的位置
|
|
|
handleZanActionsheetClick({
|
|
|
index
|
|
|
}) {
|
|
|
this.setData({
|
|
|
'actionSheet.show': false
|
|
|
});
|
|
|
|
|
|
if (index === 1) {
|
|
|
this.setData({
|
|
|
showSnapshootShare: true
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
hideSnap: function() {
|
|
|
this.setData({
|
|
|
showSnapshootShare: false
|
|
|
});
|
|
|
},
|
|
|
shopRecList: function(shopId) {
|
|
|
listModel.productList({
|
|
|
page: 1,
|
|
|
limit: 20,
|
|
|
shop_id: shopId
|
|
|
}).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
const keyAdapter = {
|
|
|
skn: 'product_skn',
|
|
|
salesPrice: 'sales_price',
|
|
|
marketPrice: 'market_price',
|
|
|
productName: 'product_name',
|
|
|
defaultImages: 'default_images'
|
|
|
};
|
|
|
let list = [];
|
|
|
|
|
|
(res.data.product_list || []).forEach(product => {
|
|
|
let item = {};
|
|
|
|
|
|
Object.keys(keyAdapter).forEach(key => {
|
|
|
item[key] = product[keyAdapter[key]];
|
|
|
});
|
|
|
list.push(item);
|
|
|
});
|
|
|
this.setData({
|
|
|
shopRecList: list
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
preferList: function() {
|
|
|
listModel.productList({
|
|
|
page: 1,
|
|
|
limit: 20
|
|
|
}).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
const keyAdapter = {
|
|
|
skn: 'product_skn',
|
|
|
salesPrice: 'sales_price',
|
|
|
marketPrice: 'market_price',
|
|
|
productName: 'product_name',
|
|
|
defaultImages: 'default_images'
|
|
|
};
|
|
|
let list = [];
|
|
|
|
|
|
(res.data.product_list || []).forEach(product => {
|
|
|
let item = {};
|
|
|
|
|
|
Object.keys(keyAdapter).forEach(key => {
|
|
|
item[key] = product[keyAdapter[key]];
|
|
|
});
|
|
|
list.push(item);
|
|
|
});
|
|
|
this.setData({
|
|
|
preferList: list
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
productInfo: function() {
|
|
|
detailModel.productInfo(this.data.productSkn)
|
|
|
.then(res => {
|
|
|
if (res.code === 200) {
|
|
|
let ImgUrls = [];
|
|
|
let color_length = 0;
|
|
|
|
|
|
if (res.data.goods_list) {
|
|
|
color_length = res.data.goods_list.length;
|
|
|
}
|
|
|
res.data.goods_list.map((item, index) => {
|
|
|
let images = item.images_list;
|
|
|
|
|
|
ImgUrls = [...ImgUrls, ...images];
|
|
|
if (index === 0 && color_length === 1) {
|
|
|
item.selected = true;
|
|
|
this.data.colorSelected = true;
|
|
|
this.data.selectedProductId = item.goods_id;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
let isSoldOutSoon = false;
|
|
|
let tags = res.data.tags;
|
|
|
|
|
|
if (tags) {
|
|
|
isSoldOutSoon = tags.includes('is_soon_sold_out');
|
|
|
}
|
|
|
|
|
|
// pickerData
|
|
|
let pickData = this.data.pickerData;
|
|
|
|
|
|
pickData.view.goodsList = res.data.goods_list;
|
|
|
pickData.view.isSoldOutSoon = isSoldOutSoon;
|
|
|
|
|
|
// 默认显示第一种颜色的尺码
|
|
|
pickData.view.sizeList = res.data.goods_list.length ? res.data.goods_list[0].size_list : [];
|
|
|
|
|
|
let plusButtonEnable = false;
|
|
|
let minusButtonEnable = false;
|
|
|
|
|
|
// 根据库存设置该尺码是否可以选择
|
|
|
let size_length = 0;
|
|
|
|
|
|
if (pickData.view.sizeList) {
|
|
|
size_length = pickData.view.sizeList.length;
|
|
|
}
|
|
|
|
|
|
pickData.view.sizeList && pickData.view.sizeList.map((item, index) => {
|
|
|
item.enable = item.storage_number > 0;
|
|
|
if (index === 0 && size_length === 1 && this.data.colorSelected) {
|
|
|
// 当颜色被选中 并且只有一个size 时 才会自动 做选中尺码操作
|
|
|
pickData.view.buyButtonEnable = item.enable;
|
|
|
if (item.enable) {
|
|
|
item.selected = true;
|
|
|
plusButtonEnable = item.storage_number > 1;
|
|
|
this.setData({
|
|
|
selectedSKU: item.product_sku,
|
|
|
storageNumber: item.storage_number
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
pickData.view.plusButtonEnable = plusButtonEnable;
|
|
|
pickData.view.minusButtonEnable = minusButtonEnable;
|
|
|
pickData.view.image = formatImage.image(ImgUrls.length > 0 ? ImgUrls[0].image_url : '', 168, 232);
|
|
|
pickData.view.price = res.data.format_market_price;
|
|
|
pickData.view.goodPrice = res.data.format_sales_price;
|
|
|
|
|
|
let default_image = formatImage.image(ImgUrls.length > 0 ? ImgUrls[0].image_url : '', 750, 1000);
|
|
|
let product_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?param=' + res.data.product_skn; // eslint-disable-line
|
|
|
|
|
|
let snapData = {
|
|
|
product_name: res.data.product_name,
|
|
|
product_price: '¥' + res.data.sales_price,
|
|
|
default_image,
|
|
|
product_qrCode,
|
|
|
product_skn: this.data.productSkn
|
|
|
};
|
|
|
|
|
|
this.setData({
|
|
|
productName: res.data.product_name,
|
|
|
marketPrice: res.data.format_market_price,
|
|
|
salesPrice: res.data.format_sales_price,
|
|
|
productImages: ImgUrls,
|
|
|
pickerData: pickData,
|
|
|
storage_sum: res.data.storage_sum,
|
|
|
snapshootShareData: snapData,
|
|
|
shopId: res.data.shop_id,
|
|
|
|
|
|
// 暂时没用
|
|
|
// brand_id: res.data.brand_id,
|
|
|
// isLimitBuy:res.data.isLimitBuy,
|
|
|
// is_deposit_advance:res.data.is_deposit_advance,
|
|
|
// is_secKill:res.data.is_secKill,
|
|
|
// is_advance:res.data.is_advance,
|
|
|
// sales_phrase: res.data.sales_phrase,
|
|
|
// expect_arrival_time: res.data.expect_arrival_time || '',
|
|
|
// isInstalment:res.data.isInstalment,
|
|
|
// product_id: res.data.product_id,
|
|
|
// vipPrice : res.data.vip || '',
|
|
|
// is_supplyed: res.data.is_supplyed,
|
|
|
// bundle_type: res.data.bundle_type,
|
|
|
// store_show_status: res.data.store_show_status,
|
|
|
// attribute: res.data.attribute,
|
|
|
productOnlyProvideByYohoAPP: res.data.is_secKill === 'Y' || res.data.is_advance === 'Y' || res.data.attribute === 3 || res.data.attribute === 4 || res.data.isLimitBuy || res.data.is_deposit_advance === 'Y', // eslint-disable-line
|
|
|
productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4, // eslint-disable-line
|
|
|
productNotForSale: res.data.attribute === 2,
|
|
|
showBottomTipView: true
|
|
|
});
|
|
|
|
|
|
this.shopRecList(res.data.shop_id);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
supportService: function() {
|
|
|
let params = {
|
|
|
product_skn: this.data.productSkn,
|
|
|
coupon_limit_status: 0
|
|
|
};
|
|
|
|
|
|
detailModel.supportService(params)
|
|
|
.then(res => {
|
|
|
this.setData({
|
|
|
productSupportServiceList: res.data
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
productIntro: function() {
|
|
|
let params = {
|
|
|
productskn: this.data.productSkn
|
|
|
};
|
|
|
|
|
|
detailModel.productIntro(params)
|
|
|
.then(data => {
|
|
|
let infoList = data.productDescBo;
|
|
|
let productPhrare = data.productDescBo.phrase;
|
|
|
let size = data.sizeInfoBo;
|
|
|
|
|
|
size = getGoodSize(size);
|
|
|
infoList = getGoodInfo(infoList);
|
|
|
|
|
|
this.setData({
|
|
|
productDesc: infoList,
|
|
|
productPhrare,
|
|
|
productSizeTitle: size.titleList,
|
|
|
productSizeContent: size.sizeList,
|
|
|
productMeasurementImage: data.sizeImage,
|
|
|
productWashTipsBoList: data.washTipsBoList,
|
|
|
productMaterialList: data.productMaterialList,
|
|
|
productIntroImageList: data.productIntroBo.imageList
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
buyImmediate: function() {
|
|
|
if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) { // eslint-disable-line
|
|
|
return wx.showToast({
|
|
|
title: '该商品暂时不支持当前小程序购买,请到Yoho!Buy有货查看',
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (this.data.storage_sum === 0) {
|
|
|
return;
|
|
|
}
|
|
|
this.setData({
|
|
|
buyImmediate: true
|
|
|
});
|
|
|
|
|
|
if (app.getUid()) {
|
|
|
Picker.pickerShow(this);
|
|
|
} else {
|
|
|
tapToLogin();
|
|
|
}
|
|
|
},
|
|
|
hidePicker: function(e) {
|
|
|
if (e.target.id === 'picker-bg') {
|
|
|
Picker.pickerHide(this);
|
|
|
}
|
|
|
},
|
|
|
chooseColor: function(event) {
|
|
|
let pickData = this.data.pickerData;
|
|
|
|
|
|
// 先遍历将所有颜色、尺码置为未选中状态
|
|
|
pickData.view.goodsList && pickData.view.goodsList.map(item => {
|
|
|
item.selected = false;
|
|
|
item.size_list.map(subItem => {
|
|
|
subItem.selected = false;
|
|
|
subItem.enable = subItem.storage_number > 0;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 将当前颜色置为选中状态
|
|
|
let tempItem = event.target.dataset.key;
|
|
|
|
|
|
// 遍历颜色尺码,根据库存切换显示状态
|
|
|
tempItem && tempItem.size_list && tempItem.size_list.map(item => {
|
|
|
item.enable = item.storage_number > 0;
|
|
|
});
|
|
|
tempItem.selected = true;
|
|
|
this.data.selectedProductId = tempItem.goods_id;
|
|
|
|
|
|
// 设置标志位,表示已经选择颜色
|
|
|
let colorSelected = true;
|
|
|
|
|
|
// 重置库存、当前选中sku的值
|
|
|
pickData.storageNumber = 0;
|
|
|
pickData.selectedSKU = 0;
|
|
|
this.data.selectedSKU = 0;
|
|
|
|
|
|
pickData.view.goodsList[Number(event.target.id)] = tempItem;
|
|
|
pickData.view.sizeList = tempItem.size_list;
|
|
|
|
|
|
pickData.view.minusButtonEnable = false;
|
|
|
|
|
|
// 将购买数量设为初始状态
|
|
|
pickData.view.buyNumber = 1;
|
|
|
|
|
|
this.setData({
|
|
|
colorSelected,
|
|
|
pickerData: pickData
|
|
|
});
|
|
|
},
|
|
|
chooseSize: function(event) {
|
|
|
let pickData = this.data.pickerData;
|
|
|
|
|
|
// 现遍历将所有尺码置为未选中状态
|
|
|
pickData.view.sizeList && pickData.view.sizeList.map(item => {
|
|
|
item.selected = false;
|
|
|
});
|
|
|
|
|
|
// 将当前尺码置为选中状态
|
|
|
let tempItem = event.currentTarget.dataset.key;
|
|
|
|
|
|
tempItem.selected = true;
|
|
|
pickData.view.sizeList[parseInt(event.currentTarget.id)] = tempItem;
|
|
|
|
|
|
// 设置数量加减按钮启用状态
|
|
|
pickData.view.plusButtonEnable = (!pickData.view.buy_limit_number || pickData.view.buy_limit_number > 1) && tempItem.storage_number > 1; // eslint-disable-line
|
|
|
|
|
|
pickData.view.minusButtonEnable = false;
|
|
|
pickData.view.buyButtonEnable = true;
|
|
|
|
|
|
if (pickData.view.bundle_count === 0) {
|
|
|
pickData.view.buyNumber = 1;
|
|
|
}
|
|
|
|
|
|
if (tempItem.storage_number <= 0) {
|
|
|
wx.showToast({
|
|
|
title: '该尺码已经售罄',
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
});
|
|
|
|
|
|
pickData.view.buyButtonEnable = false;
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
pickerData: pickData,
|
|
|
selectedSKU: tempItem.storage_number > 0 ? tempItem.product_sku : 0,
|
|
|
storageNumber: tempItem.storage_number
|
|
|
});
|
|
|
},
|
|
|
bindMinus: function() {
|
|
|
let pickerData = this.data.pickerData;
|
|
|
let buyNumber = parseInt(pickerData.view.buyNumber);
|
|
|
|
|
|
if (pickerData.view.bundle_count > 0) {
|
|
|
if (buyNumber > pickerData.view.bundle_count) {
|
|
|
pickerData.view.minusButtonEnable = true;
|
|
|
} else {
|
|
|
this.minReachedLimitAction(pickerData.view.bundle_count);
|
|
|
pickerData.view.minusButtonEnable = false;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (buyNumber > 1) {
|
|
|
buyNumber = buyNumber - 1;
|
|
|
}
|
|
|
pickerData.view.buyNumber = buyNumber;
|
|
|
|
|
|
if (buyNumber === 1) {
|
|
|
pickerData.view.minusButtonEnable = false;
|
|
|
} else {
|
|
|
pickerData.view.minusButtonEnable = true;
|
|
|
}
|
|
|
|
|
|
if (pickerData.view.buy_limit_number !== 0 && buyNumber < pickerData.view.buy_limit_number) {
|
|
|
pickerData.view.plusButtonEnable = true;
|
|
|
}
|
|
|
|
|
|
if (buyNumber < this.data.storageNumber) {
|
|
|
pickerData.view.plusButtonEnable = true;
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
pickerData
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 增加购买数量
|
|
|
bindPlus: function() {
|
|
|
if (!this.data.colorSelected) {
|
|
|
return wx.showToast({
|
|
|
title: '请选择颜色',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (!this.data.selectedSKU) {
|
|
|
return wx.showToast({
|
|
|
title: '请选择尺码',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
}
|
|
|
|
|
|
let pickerData = this.data.pickerData;
|
|
|
let buyNumber = pickerData.view.buyNumber;
|
|
|
|
|
|
if (pickerData.view.buy_limit_number !== 0 && buyNumber >= pickerData.view.buy_limit_number) {
|
|
|
return this.plusReachedLimitAction(pickerData.view.buy_limit_number);
|
|
|
}
|
|
|
|
|
|
if (buyNumber >= this.data.storageNumber) {
|
|
|
return this.plusReachedMaxAction();
|
|
|
}
|
|
|
|
|
|
if (pickerData.view.buy_limit_number !== 0 && buyNumber < pickerData.view.buy_limit_number) {
|
|
|
pickerData.view.plusButtonEnable = true;
|
|
|
}
|
|
|
|
|
|
if (buyNumber < this.data.storageNumber) {
|
|
|
pickerData.view.plusButtonEnable = true;
|
|
|
buyNumber = parseInt(buyNumber) + 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
if (buyNumber >= this.data.storageNumber) {
|
|
|
pickerData.view.plusButtonEnable = false;
|
|
|
}
|
|
|
|
|
|
if (buyNumber > 1) {
|
|
|
pickerData.view.minusButtonEnable = true;
|
|
|
}
|
|
|
|
|
|
pickerData.view.buyNumber = buyNumber;
|
|
|
this.setData({
|
|
|
pickerData
|
|
|
});
|
|
|
},
|
|
|
|
|
|
plusReachedMaxAction: function() {
|
|
|
return wx.showToast({
|
|
|
title: '对不起,没有更多库存了',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
},
|
|
|
|
|
|
plusReachedLimitAction: function(n) {
|
|
|
return wx.showToast({
|
|
|
title: '限购' + n + '件',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
minReachedLimitAction: function(n) {
|
|
|
return wx.showToast({
|
|
|
title: n + '件起售',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
},
|
|
|
goPayment: function(e) {
|
|
|
if (!this.data.colorSelected) {
|
|
|
return wx.showToast({
|
|
|
title: '请选择颜色',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (!this.data.selectedSKU) {
|
|
|
return wx.showToast({
|
|
|
title: '请选择尺码',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
}
|
|
|
|
|
|
this._dataReport();
|
|
|
if (this.data.buyImmediate) {
|
|
|
this.payNow(e);
|
|
|
}
|
|
|
},
|
|
|
payNow: function() {
|
|
|
router.go('cartEnsure', {
|
|
|
productSku: this.data.selectedSKU,
|
|
|
buyNumber: this.data.pickerData.view.buyNumber
|
|
|
});
|
|
|
},
|
|
|
_dataReport: function() {
|
|
|
yas.report('YB_GDS_DT_BILL', {
|
|
|
PRD_SKN: this.data.productSkn,
|
|
|
RPD_SKU: this.data.selectedSKU,
|
|
|
PRD_ID: this.data.selectedProductId
|
|
|
});
|
|
|
}
|
|
|
}, Actionsheet)); |
|
|
\ No newline at end of file |
...
|
...
|
|