添加代码
This commit is contained in:
+107
-5
@@ -2,10 +2,18 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_product = require("../../api/product.js");
|
||||
const utils_enumUtils = require("../../utils/enumUtils.js");
|
||||
const utils_index = require("../../utils/index.js");
|
||||
const utils_config = require("../../utils/config.js");
|
||||
const _sfc_main = {
|
||||
computed: {
|
||||
PRODUCT_DELIVERY_TIME() {
|
||||
return utils_enumUtils.PRODUCT_DELIVERY_TIME;
|
||||
},
|
||||
CUSTOMER_SERVICE_PHONE_NUMBER() {
|
||||
return utils_config.CUSTOMER_SERVICE_PHONE_NUMBER;
|
||||
},
|
||||
CLOUD_SERVICE_PHONE_NUMBER() {
|
||||
return utils_config.CLOUD_SERVICE_PHONE_NUMBER;
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -23,19 +31,35 @@ const _sfc_main = {
|
||||
// 选择的规格
|
||||
specificationTempl: [],
|
||||
// 规格模版数据
|
||||
selectSpecificationTempl: {}
|
||||
selectSpecificationTempl: {},
|
||||
// 选择规格模版数据
|
||||
serviceShow: false,
|
||||
// 联系客服弹框
|
||||
openShow: false,
|
||||
source: null
|
||||
// 来源:供应链,自营
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
const id = options.id;
|
||||
const source = options.source;
|
||||
if (id && id !== 0) {
|
||||
this.id = id ? parseInt(id, 10) : 0;
|
||||
this.getById();
|
||||
if (source && source === "supply_chain") {
|
||||
this.source = source;
|
||||
this.getSupplyChainById();
|
||||
} else {
|
||||
this.getById();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getValue: utils_enumUtils.getValue,
|
||||
copyMobile(mobile) {
|
||||
utils_index.copyData(mobile);
|
||||
this.serviceShow = false;
|
||||
this.openShow = false;
|
||||
},
|
||||
jumpLeft() {
|
||||
common_vendor.index.navigateBack({
|
||||
delta: 1
|
||||
@@ -77,7 +101,53 @@ const _sfc_main = {
|
||||
this.orderInfo = data;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 来自商城的订单
|
||||
*/
|
||||
getSupplyChainById() {
|
||||
const params = {
|
||||
goods_id: this.id,
|
||||
app_id: "2024111300164927",
|
||||
sign_type: "MD5",
|
||||
sign: "d04be0cedd49608e758458325faecf90"
|
||||
};
|
||||
common_vendor.index.request({
|
||||
url: "https://cyysc.gscm.top/outside/1/atm/goods/detail",
|
||||
method: "get",
|
||||
data: params,
|
||||
header: {},
|
||||
success: (res) => {
|
||||
const data = res.data;
|
||||
if (data && data.result === 1) {
|
||||
const objData = data.data;
|
||||
const content = objData.content.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "'").replace(/'/g, '"').replace(/\n/g, "<br>");
|
||||
const orderInfo = {
|
||||
detailInfo: content,
|
||||
minPrice: objData.min_price,
|
||||
// maxPrice:objData.max_price,
|
||||
adPrice: objData.price,
|
||||
sales: objData.virtual_sales
|
||||
};
|
||||
const domain = "https://cyysc.gscm.top";
|
||||
let currentThumb = objData.thumb;
|
||||
if (objData.thumb.indexOf("https://") === -1 && objData.thumb.indexOf("http://") === -1) {
|
||||
currentThumb = domain + "/static/upload/" + objData.thumb;
|
||||
}
|
||||
this.swiperList = [currentThumb];
|
||||
this.orderInfo = orderInfo;
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
common_vendor.index.__f__("log", "at pages/productInfo/productInfo.vue:379", "error", error);
|
||||
}
|
||||
});
|
||||
},
|
||||
async checkSpecification(val, type) {
|
||||
const source = this.source;
|
||||
if (source && source === "supply_chain") {
|
||||
this.openShow = true;
|
||||
return;
|
||||
}
|
||||
if (val) {
|
||||
await this.querySpecification();
|
||||
const data = this.orderInfo;
|
||||
@@ -213,13 +283,17 @@ if (!Array) {
|
||||
const _easycom_up_swiper2 = common_vendor.resolveComponent("up-swiper");
|
||||
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
|
||||
const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup");
|
||||
(_easycom_up_swiper2 + _easycom_up_image2 + _easycom_up_popup2)();
|
||||
const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
|
||||
const _easycom_up_overlay2 = common_vendor.resolveComponent("up-overlay");
|
||||
(_easycom_up_swiper2 + _easycom_up_image2 + _easycom_up_popup2 + _easycom_up_modal2 + _easycom_up_overlay2)();
|
||||
}
|
||||
const _easycom_up_swiper = () => "../../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
|
||||
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
|
||||
const _easycom_up_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
const _easycom_up_modal = () => "../../uni_modules/uview-plus/components/u-modal/u-modal.js";
|
||||
const _easycom_up_overlay = () => "../../uni_modules/uview-plus/components/u-overlay/u-overlay.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_swiper + _easycom_up_image + _easycom_up_popup)();
|
||||
(_easycom_up_swiper + _easycom_up_image + _easycom_up_popup + _easycom_up_modal + _easycom_up_overlay)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
@@ -289,7 +363,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
A: common_vendor.o(($event) => $options.jumpOther("share")),
|
||||
A: common_vendor.o(($event) => {
|
||||
$data.serviceShow = true;
|
||||
}),
|
||||
B: common_vendor.p({
|
||||
src: "/static/product/kefu.png",
|
||||
width: "20",
|
||||
@@ -364,6 +440,32 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
closeOnClickOverlay: false,
|
||||
closeable: true,
|
||||
mode: "bottom"
|
||||
}),
|
||||
ae: common_vendor.p({
|
||||
src: "/static/common/close.png",
|
||||
width: "20",
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
af: common_vendor.o(($event) => {
|
||||
$data.serviceShow = false;
|
||||
}),
|
||||
ag: common_vendor.t($data.source === "supply_chain" ? "云仓客服" : "平台客服"),
|
||||
ah: common_vendor.t($data.source === "supply_chain" ? $options.CLOUD_SERVICE_PHONE_NUMBER : $options.CUSTOMER_SERVICE_PHONE_NUMBER),
|
||||
ai: common_vendor.o(($event) => $options.copyMobile($data.source === "supply_chain" ? $options.CLOUD_SERVICE_PHONE_NUMBER : $options.CUSTOMER_SERVICE_PHONE_NUMBER)),
|
||||
aj: common_vendor.o(($event) => {
|
||||
$data.serviceShow = false;
|
||||
}),
|
||||
ak: common_vendor.p({
|
||||
show: $data.serviceShow,
|
||||
showConfirmButton: false
|
||||
}),
|
||||
al: common_vendor.t($options.CLOUD_SERVICE_PHONE_NUMBER),
|
||||
am: common_vendor.o(($event) => $options.copyMobile($options.CLOUD_SERVICE_PHONE_NUMBER)),
|
||||
an: common_vendor.o(() => {
|
||||
}),
|
||||
ao: common_vendor.p({
|
||||
show: $data.openShow
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
"usingComponents": {
|
||||
"up-swiper": "../../uni_modules/uview-plus/components/u-swiper/u-swiper",
|
||||
"up-image": "../../uni_modules/uview-plus/components/u-image/u-image",
|
||||
"up-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
"up-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
||||
"up-modal": "../../uni_modules/uview-plus/components/u-modal/u-modal",
|
||||
"up-overlay": "../../uni_modules/uview-plus/components/u-overlay/u-overlay"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user