diff --git a/App.vue b/App.vue
index 4304ad7..f8f76ae 100644
--- a/App.vue
+++ b/App.vue
@@ -88,7 +88,9 @@
onShow() {
// #ifndef H5
- this.getClipboard();
+ if(this.config.enableGetClipboard){
+ this.getClipboard();
+ }
// #endif
// #ifdef APP-PLUS
diff --git a/components/m-buy/goods.vue b/components/m-buy/goods.vue
index a6cef91..6a80af3 100644
--- a/components/m-buy/goods.vue
+++ b/components/m-buy/goods.vue
@@ -16,9 +16,9 @@
¥
{{
- formatPrice(goodsDetail.promotionPrice)[0]
+ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0]
}}
- .{{ formatPrice(goodsDetail.promotionPrice)[1] }}
+ .{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
{{
@@ -29,9 +29,9 @@
¥
{{
- formatPrice(goodsDetail.price)[0]
+ $options.filters.goodsFormatPrice(goodsDetail.price)[0]
}}
- .{{ formatPrice(goodsDetail.price)[1] }}
+ .{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
@@ -43,9 +43,9 @@
¥
{{
- formatPrice(item.price)[0]
+ $options.filters.goodsFormatPrice(item.price)[0]
}}
- .{{ formatPrice(item.price)[1] }}
+ .{{ $options.filters.goodsFormatPrice(item.price)[1] }}
{{item.num}}{{goodsDetail.goodsUnit}}
@@ -56,9 +56,9 @@
¥
{{
- formatPrice(goodsDetail.price)[0]
+ $options.filters.goodsFormatPrice(goodsDetail.price)[0]
}}
- .{{ formatPrice(goodsDetail.price)[1] }}
+ .{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
@@ -204,14 +204,6 @@
},
methods: {
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return val.toFixed(2).split(".");
- },
-
closeMask() {
this.$emit("closeBuy", false);
},
diff --git a/components/m-goods-list/base-list.vue b/components/m-goods-list/base-list.vue
index df3b036..a64c302 100644
--- a/components/m-goods-list/base-list.vue
+++ b/components/m-goods-list/base-list.vue
@@ -11,8 +11,8 @@
{{ item.goodsName }}
- ¥{{ formatPrice(item.price )[0] }} .{{
- formatPrice(item.price )[1]
+ ¥{{ $options.filters.goodsFormatPrice(item.price )[0] }} .{{
+ $options.filters.goodsFormatPrice(item.price )[1]
}}
@@ -135,7 +135,7 @@
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
- height: 84rpx;
+ height: 86rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
diff --git a/components/m-goods-list/common.vue b/components/m-goods-list/common.vue
index dd46e5d..4896ace 100644
--- a/components/m-goods-list/common.vue
+++ b/components/m-goods-list/common.vue
@@ -36,17 +36,6 @@
}
return str;
},
-
-
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
-
- return parseInt(val).toFixed(2).split(".");
- },
-
// 数据去重一下 只显示一次 减免 劵 什么的
getPromotion(item) {
if (item.promotionMap) {
diff --git a/components/m-goods-list/list.vue b/components/m-goods-list/list.vue
index 636decc..db5494c 100644
--- a/components/m-goods-list/list.vue
+++ b/components/m-goods-list/list.vue
@@ -15,8 +15,8 @@
- ¥{{ formatPrice(item.content.price )[0] }} .{{
- formatPrice(item.content.price )[1]
+ ¥{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} .{{
+ $options.filters.goodsFormatPrice(item.content.price )[1]
}}
@@ -60,8 +60,8 @@
{{ item.content.goodsName }}
- ¥{{ formatPrice(item.content.price )[0] }} .{{
- formatPrice(item.content.price )[1]
+ ¥{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} .{{
+ $options.filters.goodsFormatPrice(item.content.price )[1]
}}
@@ -177,16 +177,6 @@
}
return str;
},
-
-
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
-
// 数据去重一下 只显示一次 减免 劵 什么的
getPromotion(item) {
if (item.promotionMap) {
@@ -284,7 +274,7 @@
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
- height: 84rpx;
+ height: 86rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
diff --git a/components/m-goods-list/promotion.vue b/components/m-goods-list/promotion.vue
index 1f24739..44338a0 100644
--- a/components/m-goods-list/promotion.vue
+++ b/components/m-goods-list/promotion.vue
@@ -13,15 +13,15 @@
- ¥{{ formatPrice(item.price )[0] }} .{{
- formatPrice(item.price )[1]
+ ¥{{ $options.filters.goodsFormatPrice(item.price )[0] }} .{{
+ $options.filters.goodsFormatPrice(item.price )[1]
}}
最低:
- ¥{{ formatPrice(item.purchasePrice )[0] }} .{{
- formatPrice(item.purchasePrice )[1]
+ ¥{{ $options.filters.goodsFormatPrice(item.purchasePrice )[0] }} .{{
+ $options.filters.goodsFormatPrice(item.purchasePrice )[1]
}}
@@ -107,7 +107,7 @@
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
- height: 84rpx;
+ height: 86rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
diff --git a/config/config.js b/config/config.js
index 9624a59..a709b19 100644
--- a/config/config.js
+++ b/config/config.js
@@ -1,5 +1,5 @@
const name = "lilishop"; //全局商城name
-const schemeName = 'lilishop' //唤醒app需要的schemeName
+const schemeName = "lilishop"; //唤醒app需要的schemeName
export default {
name: name,
schemeLink: `${schemeName}://`, //唤起app地址
@@ -7,10 +7,18 @@ export default {
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请Web服务key
- scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
- iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
- logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
- customerServiceMobile:"13161366885", //客服电话
- customerServiceEmail:"lili@lili.com", //客服邮箱
- imWebSrc:"https://im.pickmall.cn" //IM地址
-};
+ scanAuthNavigation: ["https://m-b2b2c.pickmall.cn/"], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
+ iosAppId: "id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
+ logo: "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
+ customerServiceMobile: "13161366885", //客服电话
+ customerServiceEmail: "lili@lili.com", //客服邮箱
+ imWebSrc: "https://im.pickmall.cn", //IM地址
+ enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
+ enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
+ /**
+ * 如需更换主题请修改此处以及uni.scss中的全局颜色
+ */
+ mainColor: "#ff3c2a", // 主题色
+ lightColor: "#ff6b35", // 高亮主题色
+ aiderLightColor: "#ff9f28", // 辅助高亮颜色
+};
diff --git a/main.js b/main.js
index 9b47071..03cf4ef 100644
--- a/main.js
+++ b/main.js
@@ -3,17 +3,18 @@ import App from "./App";
import * as filters from "./utils/filters.js"; // global filter
import uView from "uview-ui";
import store from "./store";
-
-
+import config from '@/config/config';
+import airBtn from "@/components/m-airbtn/index.vue";
/**
* 仅在h5中显示唤醒app功能
* 在h5页面手动挂载
*
*/
// #ifdef H5
-import airBtn from "@/components/m-airbtn/index.vue";
-let btn = Vue.component("airBtn", airBtn); //全局注册
-document.body.appendChild(new btn().$mount().$el);
+if(config.enableMiniBarStartUpApp){
+ let btn = Vue.component("airBtn", airBtn); //全局注册
+ document.body.appendChild(new btn().$mount().$el);
+}
// #endif
// 引入uView对小程序分享的mixin封装
@@ -30,8 +31,6 @@ Object.keys(filters).forEach((key) => {
// 引入Vuex
Vue.prototype.$store = store;
-
-
Vue.use(uView);
Vue.config.productionTip = false;
@@ -43,11 +42,11 @@ Vue.config.productionTip = false;
* 如需更换主题请修改此处以及uni.scss中的全局颜色
*/
// 主题色
-Vue.prototype.$mainColor = "#ff3c2a";
+Vue.prototype.$mainColor = config.mainColor;
// 高亮主题色
-Vue.prototype.$lightColor = "#ff6b35";
+Vue.prototype.$lightColor = config.lightColor;
// 辅助高亮颜色
-Vue.prototype.$aiderLightColor = "#ff9f28";
+Vue.prototype.$aiderLightColor = config.aiderLightColor;
App.mpType = "app";
diff --git a/pages/navigation/search/searchPage.vue b/pages/navigation/search/searchPage.vue
index 0de7f91..449312a 100644
--- a/pages/navigation/search/searchPage.vue
+++ b/pages/navigation/search/searchPage.vue
@@ -370,15 +370,6 @@ export default {
return array;
}
},
-
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
-
// 展示更多数据
showMore() {
this.loadOldKeyword(this.oldKeywordIndex);
diff --git a/pages/order/fillorder.vue b/pages/order/fillorder.vue
index 238bb51..1c8f0fe 100644
--- a/pages/order/fillorder.vue
+++ b/pages/order/fillorder.vue
@@ -147,9 +147,9 @@
¥
{{
- formatPrice(val.goodsSku.price)[0]
+ $options.filters.goodsFormatPrice(val.goodsSku.price)[0]
}}
- .{{ formatPrice(val.goodsSku.price)[1] }}
+ .{{ $options.filters.goodsFormatPrice(val.goodsSku.price)[1] }}
@@ -315,10 +315,10 @@
¥
{{
- formatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
+ $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
}}
.{{ formatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
+ >.{{ $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
[1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
//发票回调 选择发票之后刷新购物车
async callbackInvoice(val) {
this.invoiceFlag = false;
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index 1f59271..3647eb3 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -151,12 +151,12 @@
- ¥{{ formatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}.{{ formatPrice(wholesaleList[wholesaleList.length-1].price)[1] }}
+ ¥{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}.{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[1] }}
~
- ¥{{ formatPrice(wholesaleList[0].price)[0] }}.{{ formatPrice(wholesaleList[0].price)[1] }}
+ ¥{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] }}.{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }}
- ¥{{ formatPrice(goodsDetail.price)[0] }}.{{ formatPrice(goodsDetail.price)[1] }}
+ ¥{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
@@ -752,14 +752,6 @@ export default {
// // #endif
},
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
-
/**选择商品 */
changedGoods(val) {
this.selectedGoods = val;
diff --git a/pages/product/product/promotion/-promotion-assemble-promotions.vue b/pages/product/product/promotion/-promotion-assemble-promotions.vue
index b007f31..8dd01bb 100644
--- a/pages/product/product/promotion/-promotion-assemble-promotions.vue
+++ b/pages/product/product/promotion/-promotion-assemble-promotions.vue
@@ -21,15 +21,15 @@
>
¥
- {{ formatPrice(detail.promotionPrice)[0] }}.{{
- formatPrice(detail.promotionPrice)[1]
+ {{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.{{
+ $options.filters.goodsFormatPrice(detail.promotionPrice)[1]
}}
¥{{ formatPrice(detail.price)[0] }}.{{
- formatPrice(detail.price)[1]
+ >¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
+ $options.filters.goodsFormatPrice(detail.price)[1]
}}
限时抢购
@@ -42,8 +42,8 @@
¥{{ formatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{
- formatPrice(promotion.groupbuy_goods_vo.price)[1]
+ >¥{{ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{
+ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[1]
}}
@@ -53,9 +53,9 @@
class="old-price"
v-if="promotion.groupbuy_goods_vo.original_price != undefined"
>¥{{
- formatPrice(promotion.groupbuy_goods_vo.original_price)[0]
+ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[0]
}}.{{
- formatPrice(promotion.groupbuy_goods_vo.original_price)[1]
+ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[1]
}}
团购活动
@@ -68,13 +68,13 @@
v-if="detail.promotionPrice != undefined"
>
¥
- {{ formatPrice(detail.promotionPrice)[0] }}.{{ formatPrice(detail.promotionPrice)[1] }}
+ {{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[1] }}
¥{{ formatPrice(detail.price)[0] }}.{{
- formatPrice(detail.price)[1]
+ >¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
+ $options.filters.goodsFormatPrice(detail.price)[1]
}}
拼团活动
@@ -141,13 +141,6 @@ export default {
},
mounted() {},
methods: {
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
getCountDownTime(val) {
let date = new Date(val);
let timeSimple = new Date(date).getTime() / 1000;
diff --git a/pages/product/product/shop/-shop.vue b/pages/product/product/shop/-shop.vue
index 521952c..cf4ab41 100644
--- a/pages/product/product/shop/-shop.vue
+++ b/pages/product/product/shop/-shop.vue
@@ -32,7 +32,7 @@
{{ item.content.goodsName }}
- ¥{{ formatPrice(item.content.price)[0] }}.{{ formatPrice(item.content.price)[1] }}
+ ¥{{ $options.filters.goodsFormatPrice(item.content.price)[0] }}.{{ $options.filters.goodsFormatPrice(item.content.price)[1] }}
@@ -48,13 +48,6 @@ export default {
props: ["res", "goodsDetail", "storeDetail"],
mounted() {},
methods: {
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
// 点击商品
clickGoods(val) {
uni.navigateTo({
diff --git a/pages/product/shopList.vue b/pages/product/shopList.vue
index 873205d..79e81ca 100644
--- a/pages/product/shopList.vue
+++ b/pages/product/shopList.vue
@@ -82,13 +82,7 @@ export default {
this.storeList = [];
this.init();
},
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
+
async init() {
let res = await getStoreList(this.params);
if (res.data.success) {
diff --git a/pages/product/shopPage.vue b/pages/product/shopPage.vue
index cbceb11..aed083b 100644
--- a/pages/product/shopPage.vue
+++ b/pages/product/shopPage.vue
@@ -58,7 +58,7 @@
-
+
@@ -382,11 +382,11 @@ export default {
color: #999;
}
-.contant {
+.content {
margin-top: 20rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
+ // display: flex;
+ // flex-wrap: wrap;
+ // justify-content: space-between;
> .empty {
width: 100%;
display: flex;
diff --git a/pages/tabbar/cart/cartList.vue b/pages/tabbar/cart/cartList.vue
index 3bdd5ef..8f12b77 100644
--- a/pages/tabbar/cart/cartList.vue
+++ b/pages/tabbar/cart/cartList.vue
@@ -79,8 +79,8 @@
- ¥{{ formatPrice(skuItem.goodsSku.price)[0] }}
- .{{ formatPrice(skuItem.goodsSku.price)[1] }}
+ ¥{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[0] }}
+ .{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[1] }}
@@ -108,8 +108,8 @@
- 预估到手价 ¥{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}
- .{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[1] }}
+ 预估到手价 ¥{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}
+ .{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[1] }}
{{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 parseInt(val).toFixed(2).split(".");
- },
-
/**
* 左滑打开删除
*/
diff --git a/pages/tabbar/home/template/tpl_goods.vue b/pages/tabbar/home/template/tpl_goods.vue
index 8d85f30..98f6b15 100644
--- a/pages/tabbar/home/template/tpl_goods.vue
+++ b/pages/tabbar/home/template/tpl_goods.vue
@@ -24,8 +24,8 @@
{{ item.title }}
-
¥
{{ formatPrice(item.price )[0] }} .{{
- formatPrice(item.price )[1]
+
¥{{ $options.filters.goodsFormatPrice(item.price )[0] }} .{{
+ $options.filters.goodsFormatPrice(item.price)[1]
}}
@@ -58,13 +58,6 @@ export default {
},
mounted() {},
methods: {
- // 格式化金钱 1999 --> [1999,00]
- formatPrice(val) {
- if (typeof val == "undefined") {
- return val;
- }
- return parseInt(val).toFixed(2).split(".");
- },
handleClick(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
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 adec726..0fbb778 100644
--- a/utils/filters.js
+++ b/utils/filters.js
@@ -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(".");
+}
+
+
/**
* 脱敏姓名
*/