{{skuItem.errorMessage}}
@@ -131,7 +131,7 @@
总计:
- ¥{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}.{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}
+ ¥{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}.{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}
总计:0.00
@@ -256,17 +256,6 @@ export default {
discountDetails() {
this.discountDetailsFlag = true;
},
-
- /**
- * 格式化金钱 1999 --> [1999,00]
- */
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return val.toFixed(2).split(".");
- },
-
/**
* 左滑打开删除
*/
diff --git a/pages/tabbar/home/index.vue b/pages/tabbar/home/index.vue
index cbeebf5..ea9406e 100644
--- a/pages/tabbar/home/index.vue
+++ b/pages/tabbar/home/index.vue
@@ -15,6 +15,11 @@ export default {
},
};
},
+ onReachBottom(){
+ // 给子级监听触底加载
+ uni.$emit('onReachBottom',true)
+ },
+
onPullDownRefresh() {
this.$refs.tpl.init();
diff --git a/pages/tabbar/home/template/tpl.js b/pages/tabbar/home/template/tpl.js
index c1af693..cdcb2fd 100644
--- a/pages/tabbar/home/template/tpl.js
+++ b/pages/tabbar/home/template/tpl.js
@@ -1,118 +1,208 @@
/** 配置楼层模块的跳转 */
export function modelNavigateTo(item) {
- let val = item.url || item;
- console.log(item);
- // return;
- switch (val.___type || item.type) {
- case "goods":
- uni.navigateTo({
- url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
- });
- break;
- case "category":
- if (val.id) {
+ let val = item.url || item;
+ //链接跳转到专题
+
+ if (val && val.id && val.pageType == "special") {
+ uni.navigateTo({
+ url: `/pages/tabbar/special/special?id=${val.id}`,
+ });
+ }
+ switch (val.___type || val.type) {
+ case "goods":
+ uni.navigateTo({
+ url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
+ });
+ break;
+ case "category":
+ if (val.id) {
+ uni.navigateTo({
+ url: `/pages/navigation/search/searchPage?category=${val.id}`,
+ });
+ } else {
+ uni.navigateTo({
+ url: `/pages/navigation/search/searchPage`,
+ });
+ }
+ break;
+ case "shops":
+ uni.navigateTo({
+ url: `/pages/product/shopPage?id=${val.id}`,
+ });
+ break;
+ // 活动
+ case "marketing":
+ uni.navigateTo({
+ url: "/pages/product/goods?id=" + val.id + "goodsId=" + val.goodsId,
+ });
+ break;
+ case "pages":
+ uni.navigateTo({
+ url: val.___path + "?id=" + val.id + "&title=" + val.title,
+ });
+ break;
+ case "other":
+ switch (val.title || item.title) {
+ case "首页":
+ uni.switchTab({
+ url: `/pages/tabbar/home/index`,
+ });
+ break;
+ case "购物车":
+ uni.switchTab({
+ url: `/pages/tabbar/cart/cartList`,
+ });
+ return;
+ case "个人中心":
+ uni.switchTab({
+ url: `/pages/tabbar/user/my`,
+ });
+ break;
+ case "收藏商品":
+ uni.navigateTo({
+ url: `/pages/mine/myCollect`,
+ });
+ break;
+ case "我的订单":
+ uni.navigateTo({
+ url: `/pages/order/myOrder?status=0`,
+ });
+ break;
+ case "领券中心":
+ uni.navigateTo({
+ url: `/pages/cart/coupon/couponCenter`,
+ });
+ break;
+ case "签到":
+ uni.navigateTo({
+ url: `/pages/mine/signIn`,
+ });
+ break;
+ case "秒杀频道":
+ uni.navigateTo({
+ url: `/pages/promotion/seckill`,
+ });
+ break;
+ case "拼团频道":
+ uni.navigateTo({
+ url: `/pages/promotion/joinGroup`,
+ });
+ break;
+ case "小程序直播":
+ uni.navigateTo({
+ url: `/pages/promotion/lives`,
+ });
+ break;
+ case "砍价":
+ uni.navigateTo({
+ url: `/pages/promotion/bargain/list`,
+ });
+ break;
+ case "积分商城":
+ uni.navigateTo({
+ url: `/pages/promotion/point/pointList`,
+ });
+ break;
+ case "店铺列表":
+ uni.navigateTo({
+ url: `/pages/product/shopList`,
+ });
+ break;
+ default:
+ // #ifdef H5
+ window.location.href = val.url || item.link;
+ // #endif
+ // #ifdef APP-PLUS
+ plus.runtime.openURL(val.url || item.link) //不需要拼接\
+ // #endif
+ break;
+ }
+
+ break;
+ }
+}
+
+
+
+
+import config from "@/config/config";
+
+async function scan() {
+ // #ifdef APP-PLUS
+ let isIos = plus.os.name == "iOS";
+ // 判断是否是Ios
+ if (isIos) {
+ const iosFirstCamera = uni.getStorageSync("iosFirstCamera"); //是不是第一次开启相机
+ if (iosFirstCamera !== "false") {
+ uni.setStorageSync("iosFirstCamera", "false"); //设为false就代表不是第一次开启相机
+ seacnCode();
+ } else {
+ if (permision.judgeIosPermission("camera")) {
+ seacnCode();
+ } else {
+ // 没有权限提醒是否去申请权限
+ tipsGetSettings();
+ }
+ }
+ } else {
+ /**
+ * TODO 安卓 权限已经授权了,调用api总是显示用户已永久拒绝申请。人傻了
+ * TODO 如果xdm有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 提下谢谢
+ */
+ seacnCode();
+ }
+
+ // #endif
+
+ // #ifdef MP-WEIXIN
+ seacnCode();
+ // #endif
+}
+/**
+ * 提示获取权限
+ */
+function tipsGetSettings() {
+ uni.showModal({
+ title: "提示",
+ content: "您已经关闭相机权限,去设置",
+ success: function (res) {
+ if (res.confirm) {
+ if (isIos) {
+ plus.runtime.openURL("app-settings:");
+ } else {
+ permision.gotoAppPermissionSetting();
+ }
+ }
+ },
+ });
+}
+
+function seacnCode() {
+ uni.scanCode({
+ success: function (res) {
+ let path = encodeURIComponent(res.result);
+
+ // WX_CODE 为小程序码
+ if (res.scanType == "WX_CODE") {
+ console.log(res);
uni.navigateTo({
- url: `/pages/navigation/search/searchPage?category=${val.id}`,
+ url: `/${res.path}`,
});
} else {
- uni.navigateTo({
- url: `/pages/navigation/search/searchPage`,
+ config.scanAuthNavigation.forEach((src) => {
+ if (res.result.indexOf(src) != -1) {
+ uni.navigateTo({
+ url: `/${res.result.substring(src.length)}`,
+ });
+ } else {
+ setTimeout(() => {
+ uni.navigateTo({
+ url: "/pages/tabbar/home/web-view?src=" + path,
+ });
+ }, 100);
+ }
});
}
- break;
- case "shops":
- uni.navigateTo({
- url: `/pages/product/shopPage?id=${val.id}`,
- });
- break;
- // 活动
- case "marketing":
- uni.navigateTo({
- url: "/pages/product/goods?id=" + val.id + "goodsId=" + val.goodsId,
- });
- break;
- case "pages":
- uni.navigateTo({
- url: val.___path + "?id=" + val.id + "&title=" + val.title,
- });
- break;
- case "other":
- switch (val.title || item.title) {
- case "首页":
- uni.switchTab({
- url: `/pages/tabbar/home/index`,
- });
- break;
- case "购物车":
- uni.switchTab({
- url: `/pages/tabbar/cart/cartList`,
- });
- return;
- case "个人中心":
- uni.switchTab({
- url: `/pages/tabbar/user/my`,
- });
- break;
- case "收藏商品":
- uni.navigateTo({
- url: `/pages/mine/myCollect`,
- });
- break;
- case "我的订单":
- uni.navigateTo({
- url: `/pages/order/myOrder?status=0`,
- });
- break;
- case "领券中心":
- uni.navigateTo({
- url: `/pages/cart/coupon/couponCenter`,
- });
- break;
- case "签到":
- uni.navigateTo({
- url: `/pages/mine/signIn`,
- });
- break;
- case "秒杀频道":
- uni.navigateTo({
- url: `/pages/promotion/seckill`,
- });
- break;
- case "拼团频道":
- uni.navigateTo({
- url: `/pages/promotion/joinGroup`,
- });
- break;
- case "小程序直播":
- uni.navigateTo({
- url: `/pages/promotion/lives`,
- });
- break;
- case "砍价":
- uni.navigateTo({
- url: `/pages/promotion/bargain/list`,
- });
- break;
- case "积分商城":
- uni.navigateTo({
- url: `/pages/promotion/point/pointList`,
- });
- break;
- case "店铺列表":
- uni.navigateTo({
- url: `/pages/product/shopList`,
- });
- break;
- default:
- // #ifdef H5
- window.location.href = val.url || item.link;
- // #endif
- // #ifdef APP-PLUS
- plus.runtime.openURL(val.url || item.link) //不需要拼接\
- // #endif
- break;
- }
-
- break;
- }
-}
+ },
+ });
+ }
\ No newline at end of file
diff --git a/pages/tabbar/home/template/tpl_flex_one.vue b/pages/tabbar/home/template/tpl_flex_one.vue
index 7945a4e..67c08cf 100644
--- a/pages/tabbar/home/template/tpl_flex_one.vue
+++ b/pages/tabbar/home/template/tpl_flex_one.vue
@@ -1,8 +1,8 @@
@@ -17,7 +17,7 @@ export default {
},
data() {
return {
- modelNavigateTo,
+ modelNavigateTo
};
},
props: ["res"],
diff --git a/pages/tabbar/home/template/tpl_goods.vue b/pages/tabbar/home/template/tpl_goods.vue
index 5bcc728..9075aa0 100644
--- a/pages/tabbar/home/template/tpl_goods.vue
+++ b/pages/tabbar/home/template/tpl_goods.vue
@@ -1,21 +1,38 @@
-
-
+
{{ title.title }}
{{ title.desc }}
-
+
-
+
@@ -24,9 +41,42 @@
{{ item.title }}
-
¥{{ formatPrice(item.price )[0] }} .{{
- formatPrice(item.price )[1]
- }}
+
+ ¥{{ $options.filters.goodsFormatPrice(item.price)[0] }} .{{ $options.filters.goodsFormatPrice(item.price)[1] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.goodsName }}
+
+
+
+ ¥{{ $options.filters.goodsFormatPrice(item.price)[0] }} .{{ $options.filters.goodsFormatPrice(item.price)[1] }}
+
@@ -34,6 +84,7 @@
+
diff --git a/pages/tabbar/home/views.vue b/pages/tabbar/home/views.vue
index 414a9ec..e5b93b4 100644
--- a/pages/tabbar/home/views.vue
+++ b/pages/tabbar/home/views.vue
@@ -42,7 +42,7 @@
-
+
@@ -85,6 +85,7 @@ export default {
config,
pageData: "", //楼层页面数据
isIos: "",
+ enableLoad:false, //触底加载 针对于商品模块
};
},
components: {
@@ -124,8 +125,12 @@ export default {
this.pageData = "";
getFloorData().then((res) => {
if (res.data.success) {
- this.pageData = JSON.parse(res.data.result.pageData);
- console.log(this.pageData);
+ const result = JSON.parse(res.data.result.pageData)
+ this.pageData = result;
+ if(result.list.length){
+ // 如果最后一个装修模块是商品模块的话 默认启用自动加载
+ result.list[result.list.length-1] ? result.list[result.list.length-1].model == 'goods' ? this.enableLoad = true : '' : ''
+ }
}
});
},
diff --git a/pages/tabbar/special/special.vue b/pages/tabbar/special/special.vue
new file mode 100644
index 0000000..ea7b5e2
--- /dev/null
+++ b/pages/tabbar/special/special.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
new file mode 100644
index 0000000..0695933
--- /dev/null
+++ b/project.config.json
@@ -0,0 +1,28 @@
+{
+ "appid": "wx98ebde1da5b340d4",
+ "compileType": "miniprogram",
+ "libVersion": "2.27.0",
+ "packOptions": {
+ "ignore": [],
+ "include": []
+ },
+ "setting": {
+ "coverView": true,
+ "es6": true,
+ "postcss": true,
+ "minified": true,
+ "enhance": true,
+ "showShadowRootInWxmlPanel": true,
+ "packNpmRelationList": [],
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ }
+ },
+ "condition": {},
+ "editorSetting": {
+ "tabIndent": "insertSpaces",
+ "tabSize": 2
+ }
+}
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
new file mode 100644
index 0000000..1fa0e89
--- /dev/null
+++ b/project.private.config.json
@@ -0,0 +1,7 @@
+{
+ "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+ "projectname": "lilishop-uniapp",
+ "setting": {
+ "compileHotReLoad": true
+ }
+}
\ No newline at end of file
diff --git a/static/img/title.png b/static/img/title.png
new file mode 100644
index 0000000..504e268
Binary files /dev/null and b/static/img/title.png differ
diff --git a/uni.scss b/uni.scss
index c8a7b34..422266e 100644
--- a/uni.scss
+++ b/uni.scss
@@ -149,9 +149,9 @@ $font-weight: 400;
}
.flex-a-c{
align-items: center;
-}
-.flex-j-sb{
- justify-content: space-between;
+}
+.flex-j-sb{
+ justify-content: space-between;
}
.relative {
position: relative;
@@ -171,7 +171,7 @@ $font-weight: 400;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
-}
+}
.wes-3 {
/* 适用于webkit内核和移动端 */
diff --git a/utils/filters.js b/utils/filters.js
index 9635a05..0fbb778 100644
--- a/utils/filters.js
+++ b/utils/filters.js
@@ -1,6 +1,6 @@
import Foundation from "./Foundation.js";
import storage from "@/utils/storage.js";
-import { getUserInfo } from '@/api/members';
+import { getUserInfo } from "@/api/members";
import Vue from "vue";
/**
* 金钱单位置换 2999 --> 2,999.00
@@ -21,6 +21,20 @@ export function unitPrice(val, unit, location) {
return (unit || "") + price;
}
+/**
+ * 格式化价格 1999 --> [1999,00]
+ * @param {*} val
+ * @returns
+ */
+export function goodsFormatPrice(val) {
+ if (typeof val == "undefined") {
+ return val;
+ }
+ let valNum = new Number(val);
+ return valNum.toFixed(2).split(".");
+}
+
+
/**
* 脱敏姓名
*/
@@ -107,38 +121,36 @@ export function isLogin(val) {
}
}
-
-export function tipsToLogin(){
-if(!isLogin('auth')){
- uni.showModal({
- title: "提示",
- content: "当前用户未登录是否登录?",
- confirmText: "确定",
- cancelText: "取消",
- confirmColor:Vue.prototype.$mainColor,
- success: res => {
- if (res.confirm) {
- navigateToLogin()
- } else if (res.cancel) {
- uni.navigateBack()
- }
- },
- })
- return
- }
+export function tipsToLogin() {
+ if (!isLogin("auth")) {
+ uni.showModal({
+ title: "提示",
+ content: "当前用户未登录是否登录?",
+ confirmText: "确定",
+ cancelText: "取消",
+ confirmColor: Vue.prototype.$mainColor,
+ success: (res) => {
+ if (res.confirm) {
+ navigateToLogin();
+ } else if (res.cancel) {
+ uni.navigateBack();
+ }
+ },
+ });
+ return false;
+ }
+ return true;
}
-
-
/**
* 获取用户信息并重新添加到缓存里面
*/
-export async function userInfo(){
- let res = await getUserInfo();
- if(res.data.success){
- storage.setUserInfo(res.data.result);
- return res.data.result
- }
+export async function userInfo() {
+ let res = await getUserInfo();
+ if (res.data.success) {
+ storage.setUserInfo(res.data.result);
+ return res.data.result;
+ }
}
/**
@@ -149,7 +161,7 @@ export async function userInfo(){
export function forceLogin() {
let userInfo = storage.getUserInfo();
- if (!userInfo || !userInfo.id) {
+ if (!userInfo || !userInfo.id) {
// #ifdef MP-WEIXIN
uni.navigateTo({