暂存code
This commit is contained in:
+248
-122
@@ -1,69 +1,20 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_product = require("../../api/product.js");
|
||||
const api_common = require("../../api/common.js");
|
||||
const utils_enumUtils = require("../../utils/enumUtils.js");
|
||||
const choiceness = () => "../../components/choiceness/choiceness.js";
|
||||
const CustomTabBar = () => "../../components/custom-tab-bar.js";
|
||||
const _sfc_main = {
|
||||
components: { choiceness },
|
||||
components: { choiceness, CustomTabBar },
|
||||
data() {
|
||||
return {
|
||||
swiperList: [
|
||||
"/static/home/banner02.png",
|
||||
"/static/home/banner01.png"
|
||||
"/static/home/banner01.png",
|
||||
"/static/home/banner04.png"
|
||||
],
|
||||
currentNum: 0,
|
||||
sortList: [
|
||||
{
|
||||
id: 1,
|
||||
name: "家居百货",
|
||||
url: "/static/home/sort/1.png"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "水果生鲜",
|
||||
url: "/static/home/sort/2.png"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "爆款新品",
|
||||
url: "/static/home/sort/3.png"
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "服装服饰",
|
||||
url: "/static/home/sort/4.png"
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: "箱包皮具",
|
||||
url: "/static/home/sort/5.png"
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: "手机数码",
|
||||
url: "/static/home/sort/6.png"
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
name: "营养保健",
|
||||
url: "/static/home/sort/7.png"
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
name: "个护家清",
|
||||
url: "/static/home/sort/8.png"
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
name: "厨房生活",
|
||||
url: "/static/home/sort/9.png"
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
name: "全部",
|
||||
url: "/static/home/sort/10.png"
|
||||
}
|
||||
],
|
||||
sortList: [],
|
||||
languageShow: false,
|
||||
// 语言选项
|
||||
languageList: [
|
||||
@@ -108,17 +59,99 @@ const _sfc_main = {
|
||||
}
|
||||
],
|
||||
// 热门
|
||||
productLoading: false
|
||||
productLoading: false,
|
||||
openShow: false,
|
||||
platformType: null,
|
||||
// 当前设备信息
|
||||
bannerShow: false,
|
||||
// 是否需要強制更新app
|
||||
type: "",
|
||||
// 设备类型 android:2, ios:1
|
||||
updateApkObj: {},
|
||||
// 后台数据
|
||||
bannerPercentageShow: false,
|
||||
// 是否显示进度条
|
||||
bannerPercentage: 0
|
||||
// 进度条
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
onShow() {
|
||||
common_vendor.index.getStorageSync("platform");
|
||||
common_vendor.index.getStorageSync("versionUpdateTime");
|
||||
this.getSortList();
|
||||
this.querySearchList(utils_enumUtils.SEARCH_TYPE.SOMETHING);
|
||||
this.querySearchList(utils_enumUtils.SEARCH_TYPE.EXPLOSIVE);
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
checkUpdate() {
|
||||
common_vendor.index.getStorageSync("version");
|
||||
common_vendor.index.getStorageSync("versionCode");
|
||||
},
|
||||
// 安装
|
||||
goUpdate(updateApkObj, platformType) {
|
||||
const self = this;
|
||||
if (platformType == "ANDROID") {
|
||||
var dtask = plus.downloader.createDownload(updateApkObj.downloadUrl, {}, function(d, status) {
|
||||
common_vendor.index.__f__("log", "at pages/home/home.vue:317", "d, status", d, status);
|
||||
if (status == 200) {
|
||||
plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename), { force: true }, function(resp) {
|
||||
common_vendor.index.setStorageSync("versionUpdateTime", common_vendor.dayjs().valueOf());
|
||||
plus.runtime.restart();
|
||||
}, function(error) {
|
||||
common_vendor.index.__f__("log", "at pages/home/home.vue:325", "error", error);
|
||||
common_vendor.index.showToast({
|
||||
title: error.message,
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
});
|
||||
} else {
|
||||
self.bannerPercentageShow = false;
|
||||
common_vendor.index.showToast({
|
||||
title: "更新失败",
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
}
|
||||
});
|
||||
try {
|
||||
dtask.start();
|
||||
let prg = 0;
|
||||
this.bannerPercentageShow = true;
|
||||
dtask.addEventListener("statechanged", function(task, status) {
|
||||
switch (task.state) {
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
prg = parseInt(parseFloat(task.downloadedSize) / parseFloat(task.totalSize) * 100);
|
||||
self.bannerPercentage = prg;
|
||||
break;
|
||||
case 4:
|
||||
plus.nativeUI.closeWaiting();
|
||||
self.bannerShow = false;
|
||||
break;
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("log", "at pages/home/home.vue:363", "更新失败-03err", err);
|
||||
plus.nativeUI.closeWaiting();
|
||||
common_vendor.index.showToast({
|
||||
title: "更新失败-03",
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
}
|
||||
} else if (platformType == "IOS") {
|
||||
plus.runtime.openURL(updateApkObj.downloadUrl);
|
||||
}
|
||||
},
|
||||
jumpTurntable() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/turntable/turntable"
|
||||
url: "/pages/turntable/turntable?backPath=home"
|
||||
});
|
||||
},
|
||||
jumpPrdference() {
|
||||
@@ -155,6 +188,29 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
this.productLoading = false;
|
||||
},
|
||||
/**
|
||||
* 查询分类列表
|
||||
*/
|
||||
async getSortList() {
|
||||
const resp = await api_common.getCascadeCategory({ parentId: 0 });
|
||||
if (resp && resp.bizcode === 100) {
|
||||
this.sortList = resp.data.slice(0, 10);
|
||||
}
|
||||
},
|
||||
// 跳转到分类栏目
|
||||
jumpSort(item) {
|
||||
common_vendor.index.setStorageSync("sortId", item.id);
|
||||
common_vendor.index.switchTab({
|
||||
// 首页
|
||||
url: "/pages/sort/sort"
|
||||
});
|
||||
},
|
||||
// 跳转到商品详情
|
||||
jumpInfo(item) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/productInfo/productInfo?id=" + item.id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -163,60 +219,72 @@ if (!Array) {
|
||||
const _easycom_up_swiper2 = common_vendor.resolveComponent("up-swiper");
|
||||
const _easycom_up_loading_icon2 = common_vendor.resolveComponent("up-loading-icon");
|
||||
const _easycom_choiceness2 = common_vendor.resolveComponent("choiceness");
|
||||
const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
|
||||
const _component_CustomTabBar = common_vendor.resolveComponent("CustomTabBar");
|
||||
const _easycom_up_action_sheet2 = common_vendor.resolveComponent("up-action-sheet");
|
||||
(_easycom_up_image2 + _easycom_up_swiper2 + _easycom_up_loading_icon2 + _easycom_choiceness2 + _easycom_up_action_sheet2)();
|
||||
const _easycom_up_line_progress2 = common_vendor.resolveComponent("up-line-progress");
|
||||
const _easycom_up_overlay2 = common_vendor.resolveComponent("up-overlay");
|
||||
(_easycom_up_image2 + _easycom_up_swiper2 + _easycom_up_loading_icon2 + _easycom_choiceness2 + _easycom_up_modal2 + _component_CustomTabBar + _easycom_up_action_sheet2 + _easycom_up_line_progress2 + _easycom_up_overlay2)();
|
||||
}
|
||||
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
|
||||
const _easycom_up_swiper = () => "../../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
|
||||
const _easycom_up_loading_icon = () => "../../uni_modules/uview-plus/components/u-loading-icon/u-loading-icon.js";
|
||||
const _easycom_choiceness = () => "../../components/choiceness/choiceness.js";
|
||||
const _easycom_up_modal = () => "../../uni_modules/uview-plus/components/u-modal/u-modal.js";
|
||||
const _easycom_up_action_sheet = () => "../../uni_modules/uview-plus/components/u-action-sheet/u-action-sheet.js";
|
||||
const _easycom_up_line_progress = () => "../../uni_modules/uview-plus/components/u-line-progress/u-line-progress.js";
|
||||
const _easycom_up_overlay = () => "../../uni_modules/uview-plus/components/u-overlay/u-overlay.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_image + _easycom_up_swiper + _easycom_up_loading_icon + _easycom_choiceness + _easycom_up_action_sheet)();
|
||||
(_easycom_up_image + _easycom_up_swiper + _easycom_up_loading_icon + _easycom_choiceness + _easycom_up_modal + _easycom_up_action_sheet + _easycom_up_line_progress + _easycom_up_overlay)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.o(_ctx.jumpMine),
|
||||
b: common_vendor.p({
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
src: "/static/home/logo.png",
|
||||
width: "104",
|
||||
height: "30",
|
||||
width: "114",
|
||||
height: "42",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
c: common_vendor.p({
|
||||
b: common_vendor.p({
|
||||
src: "/static/home/search.png",
|
||||
width: "18",
|
||||
height: "18",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
d: common_vendor.o((...args) => $options.jumpSearch && $options.jumpSearch(...args)),
|
||||
e: common_vendor.p({
|
||||
src: "/static/common/down.png",
|
||||
width: "10",
|
||||
height: "10",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
f: common_vendor.o(($event) => $data.languageShow = true),
|
||||
g: common_vendor.t($data.currentNum + 1),
|
||||
h: common_vendor.t($data.swiperList.length),
|
||||
i: common_vendor.p({
|
||||
c: common_vendor.o((...args) => $options.jumpSearch && $options.jumpSearch(...args)),
|
||||
d: common_vendor.t($data.currentNum + 1),
|
||||
e: common_vendor.t($data.swiperList.length),
|
||||
f: common_vendor.o((e) => $data.currentNum = e.current),
|
||||
g: common_vendor.p({
|
||||
list: $data.swiperList,
|
||||
height: "140",
|
||||
radius: "10"
|
||||
height: "120",
|
||||
radius: "10",
|
||||
bgColor: "#ffffff00"
|
||||
}),
|
||||
j: common_vendor.f($data.sortList, (item, k0, i0) => {
|
||||
h: $data.sortList && $data.sortList.length !== 0
|
||||
}, $data.sortList && $data.sortList.length !== 0 ? {
|
||||
i: common_vendor.f($data.sortList, (item, k0, i0) => {
|
||||
return {
|
||||
a: "07e72d3c-4-" + i0,
|
||||
a: "07e72d3c-3-" + i0,
|
||||
b: common_vendor.p({
|
||||
src: item.url,
|
||||
src: item.icon,
|
||||
width: "40",
|
||||
height: "32",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
c: common_vendor.t(item.name),
|
||||
d: item.id
|
||||
d: item.id,
|
||||
e: common_vendor.o(($event) => $options.jumpSort(item), item.id)
|
||||
};
|
||||
}),
|
||||
})
|
||||
} : {
|
||||
j: common_vendor.p({
|
||||
src: "/static/common/not_order.png",
|
||||
width: "80",
|
||||
height: "80",
|
||||
bgColor: "#f1f6ff00"
|
||||
})
|
||||
}, {
|
||||
k: common_vendor.o($options.jumpTurntable),
|
||||
l: common_vendor.p({
|
||||
src: "/static/home/turntable.png",
|
||||
@@ -224,45 +292,27 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
height: "134",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
m: common_vendor.p({
|
||||
src: "/static/common/right_y_st2.png",
|
||||
width: "12",
|
||||
height: "12",
|
||||
m: $data.faddishProduct && $data.faddishProduct.length !== 0
|
||||
}, $data.faddishProduct && $data.faddishProduct.length !== 0 ? {
|
||||
n: common_vendor.p({
|
||||
src: "/static/home/youxuan.png",
|
||||
width: "10",
|
||||
height: "10",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
n: common_vendor.o((...args) => $options.jumpPrdference && $options.jumpPrdference(...args)),
|
||||
o: common_vendor.p({
|
||||
show: $data.productLoading
|
||||
}),
|
||||
p: common_vendor.f($data.yxProduct, (item, k0, i0) => {
|
||||
return {
|
||||
a: "07e72d3c-8-" + i0,
|
||||
b: common_vendor.p({
|
||||
src: item.url,
|
||||
width: "100%",
|
||||
height: "100",
|
||||
bgColor: "#f1f6ff00",
|
||||
shape: "square",
|
||||
radius: "16"
|
||||
}),
|
||||
c: common_vendor.t(item.title),
|
||||
d: common_vendor.t(item.price),
|
||||
e: item.id
|
||||
};
|
||||
}),
|
||||
q: common_vendor.p({
|
||||
src: "/static/common/right_y_st2.png",
|
||||
width: "12",
|
||||
height: "12",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
r: common_vendor.o((...args) => $options.jumpWelcome && $options.jumpWelcome(...args)),
|
||||
s: common_vendor.p({
|
||||
p: common_vendor.o((...args) => $options.jumpWelcome && $options.jumpWelcome(...args)),
|
||||
q: common_vendor.p({
|
||||
show: $data.productLoading
|
||||
}),
|
||||
t: common_vendor.f($data.faddishProduct, (item, k0, i0) => {
|
||||
r: common_vendor.f($data.faddishProduct, (item, k0, i0) => {
|
||||
return {
|
||||
a: "07e72d3c-11-" + i0,
|
||||
a: "07e72d3c-9-" + i0,
|
||||
b: common_vendor.p({
|
||||
src: item.url,
|
||||
width: "100%",
|
||||
@@ -272,23 +322,99 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
radius: "16"
|
||||
}),
|
||||
c: common_vendor.t(item.title),
|
||||
d: common_vendor.t(item.price),
|
||||
e: item.id
|
||||
d: common_vendor.t(item.adPrice),
|
||||
e: item.id,
|
||||
f: common_vendor.o(($event) => $options.jumpInfo(item), item.id)
|
||||
};
|
||||
}),
|
||||
v: common_vendor.p({
|
||||
src: "/static/common/right.png",
|
||||
width: "16",
|
||||
height: "16",
|
||||
})
|
||||
} : {}, {
|
||||
s: $data.yxProduct && $data.yxProduct.length !== 0
|
||||
}, $data.yxProduct && $data.yxProduct.length !== 0 ? {
|
||||
t: common_vendor.p({
|
||||
src: "/static/common/right_y_st2.png",
|
||||
width: "12",
|
||||
height: "12",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
w: common_vendor.o(($event) => $data.languageShow = false),
|
||||
x: common_vendor.p({
|
||||
v: common_vendor.o((...args) => $options.jumpPrdference && $options.jumpPrdference(...args)),
|
||||
w: common_vendor.p({
|
||||
show: $data.productLoading
|
||||
}),
|
||||
x: common_vendor.f($data.yxProduct, (item, k0, i0) => {
|
||||
return {
|
||||
a: "07e72d3c-12-" + i0,
|
||||
b: common_vendor.p({
|
||||
src: item.url,
|
||||
width: "100%",
|
||||
height: "100",
|
||||
bgColor: "#f1f6ff00",
|
||||
shape: "square",
|
||||
radius: "16"
|
||||
}),
|
||||
c: common_vendor.t(item.title),
|
||||
d: common_vendor.t(item.adPrice),
|
||||
e: item.id,
|
||||
f: common_vendor.o(($event) => $options.jumpInfo(item), item.id)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
y: common_vendor.p({
|
||||
src: "/static/common/right_b.png",
|
||||
width: "10",
|
||||
height: "10",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
z: common_vendor.o(($event) => {
|
||||
$data.openShow = true;
|
||||
}),
|
||||
A: common_vendor.p({
|
||||
src: "/static/common/close.png",
|
||||
width: "20",
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
B: common_vendor.o(($event) => {
|
||||
$data.openShow = false;
|
||||
}),
|
||||
C: common_vendor.o(($event) => {
|
||||
$data.openShow = false;
|
||||
}),
|
||||
D: common_vendor.p({
|
||||
show: $data.openShow,
|
||||
showConfirmButton: false
|
||||
}),
|
||||
E: common_vendor.p({
|
||||
tabIndex: 0
|
||||
}),
|
||||
F: common_vendor.o(($event) => $data.languageShow = false),
|
||||
G: common_vendor.p({
|
||||
actions: $data.languageList,
|
||||
show: $data.languageShow,
|
||||
cancelText: "取消"
|
||||
}),
|
||||
H: common_vendor.t($data.updateApkObj.versionCode || 100),
|
||||
I: common_vendor.t($data.updateApkObj.content),
|
||||
J: !$data.bannerPercentageShow
|
||||
}, !$data.bannerPercentageShow ? common_vendor.e({
|
||||
K: common_vendor.o(($event) => $options.goUpdate($data.updateApkObj, $data.platformType)),
|
||||
L: !$data.updateApkObj.isForce
|
||||
}, !$data.updateApkObj.isForce ? {
|
||||
M: common_vendor.o(($event) => {
|
||||
$data.bannerShow = false;
|
||||
})
|
||||
};
|
||||
} : {}) : {
|
||||
N: common_vendor.p({
|
||||
percentage: $data.bannerPercentage,
|
||||
activeColor: "#FF7C41"
|
||||
}),
|
||||
O: common_vendor.t($data.bannerPercentage)
|
||||
}, {
|
||||
P: common_vendor.o(() => {
|
||||
}),
|
||||
Q: common_vendor.p({
|
||||
show: $data.bannerShow
|
||||
})
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-07e72d3c"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
|
||||
+5
-1
@@ -2,9 +2,13 @@
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"choiceness": "../../components/choiceness/choiceness",
|
||||
"custom-tab-bar": "../../components/custom-tab-bar",
|
||||
"up-image": "../../uni_modules/uview-plus/components/u-image/u-image",
|
||||
"up-swiper": "../../uni_modules/uview-plus/components/u-swiper/u-swiper",
|
||||
"up-loading-icon": "../../uni_modules/uview-plus/components/u-loading-icon/u-loading-icon",
|
||||
"up-action-sheet": "../../uni_modules/uview-plus/components/u-action-sheet/u-action-sheet"
|
||||
"up-modal": "../../uni_modules/uview-plus/components/u-modal/u-modal",
|
||||
"up-action-sheet": "../../uni_modules/uview-plus/components/u-action-sheet/u-action-sheet",
|
||||
"up-line-progress": "../../uni_modules/uview-plus/components/u-line-progress/u-line-progress",
|
||||
"up-overlay": "../../uni_modules/uview-plus/components/u-overlay/u-overlay"
|
||||
}
|
||||
}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+29
-28
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user