Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp

master
paulGao 2022-11-04 17:56:57 +08:00
commit 0feaf55381
41 changed files with 2087 additions and 1380 deletions

View File

@ -88,7 +88,9 @@
onShow() {
// #ifndef H5
this.getClipboard();
if(this.config.enableGetClipboard){
this.getClipboard();
}
// #endif
// #ifdef APP-PLUS

View File

@ -28,3 +28,16 @@ export function getArticleDetail(type) {
});
}
/**
* 获取文章详情
* @param type
*/
export function getArticleDetailByType(type) {
return http.request({
url: `/other/article/type/${type}`,
method: Method.GET,
});
}

View File

@ -1,6 +1,21 @@
import { http, Method } from "@/utils/request.js";
export function toSpecial(data) {
return http.request({
url: `/other/pageData/getSpecial`,
method: Method.GET,
data
});
}
/**
* 专题内容
*/
export function getSpecial(id) {
return http.request({
url: `/other/pageData/get/${id}`,
method: Method.GET,
});
}
/**
* 获取广告图

View File

@ -48,6 +48,24 @@ export function messageMarkAsRead(ids) {
});
}
//读取站内消息
export function editMessages(message_id,params){
return http.request({
url:`/message/member/${message_id}`,
method:Method.PUT,
needToken:true,
params
})
}
//获取站内消息
export function messages(params) {
return http.request({
url: "/message/member",
method: Method.GET,
needToken: true,
params,
});
}
/**
* 获取物流消息列表

View File

@ -13,7 +13,7 @@ import {http, Method} from '@/utils/request.js';
*/
export function getStoreList(params) {
return http.request({
url: '/store',
url: '/store/store',
method: Method.GET,
params,
});

View File

@ -16,9 +16,9 @@
<span v-if="goodsDetail.promotionPrice && !pointDetail">
<span class="goods-price-promotionShow goods-price-bigshow">{{
formatPrice(goodsDetail.promotionPrice)[0]
$options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0]
}}</span>
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
.{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
</span>
<span v-if="pointDetail.points">
<span class="goods-price-promotionShow goods-price-bigshow">{{
@ -29,23 +29,23 @@
<div class="promotion-box">
<span class="goods-price-bigshow">{{
formatPrice(goodsDetail.price)[0]
$options.filters.goodsFormatPrice(goodsDetail.price)[0]
}}</span>
.{{ formatPrice(goodsDetail.price)[1] }}
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
</div>
</view>
<!-- 正常商品的价格 -->
<view v-else>
<!-- 批发价格 -->
<div class='price-row flex' v-if="wholesaleList.length">
<div class='price-row flex' v-if="goodsDetail.salesModel === 'WHOLESALE'">
<div class='goods-price' v-for="(item,index) in wholesaleList" :key="index">
<span>
<span class="goods-price-bigshow">{{
formatPrice(item.price)[0]
$options.filters.goodsFormatPrice(item.price)[0]
}}</span>
.{{ formatPrice(item.price)[1] }}
.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</span>
<span class='wholesale-item'>
{{item.num}}{{goodsDetail.goodsUnit}}
@ -56,9 +56,9 @@
<span>
<span class="goods-price-bigshow">{{
formatPrice(goodsDetail.price)[0]
$options.filters.goodsFormatPrice(goodsDetail.price)[0]
}}</span>
.{{ formatPrice(goodsDetail.price)[1] }}
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
</span>
</div>
</view>
@ -102,7 +102,7 @@
<view class="goods-skus-number flex flex-a-c flex-j-sb">
<view class="view-class-title">数量</view>
<u-input class="view-class-input" v-model="num" type="number" />
<u-input class="view-class-input" input-align="right" v-model="num" type="number" />
</view>
</scroll-view>
<!-- 按钮 -->
@ -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);
},

View File

@ -0,0 +1,277 @@
<template>
<div>
<!-- 一行两列商品展示 -->
<view class="goods-list" v-if="type == 'twoColumns'">
<view v-for="(item, index) in res" :key="index" class="goods-item">
<view class="image-wrapper" @click="navigateToDetailPage(item)">
<u-image
:src="item.thumbnail"
width="100%"
height="330rpx"
mode="aspectFit"
>
<u-loading slot="loading"></u-loading>
</u-image>
</view>
<view class="goods-detail">
<div
class="title clamp"
v-html="lightSearchStr(keyword, item.goodsName)"
@click="navigateToDetailPage(item)"
></div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price != undefined">
¥<span
>{{
$options.filters.goodsFormatPrice(item.price)[0]
}} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</view>
<div class="count-config" @click="navigateToDetailPage(item)">
<span>已售 {{ item.buyCount || "0" }}</span>
<span>{{ item.commentNum || "0" }}条评论</span>
</div>
<div
class="store-seller-name"
v-if="storeName"
@click="navigateToStoreDetailPage(item)"
>
<div class="text-hidden">
<u-tag
style="margin-right: 10rpx"
size="mini"
mode="dark"
v-if="item.selfOperated"
text="自营"
type="error"
/>
<span>{{ item.storeName || "暂无" }}</span>
</div>
<span>
<u-icon name="arrow-right"></u-icon>
</span>
</div>
</view>
</view>
</view>
<!-- 一行一列商品展示 -->
<div v-if="type == 'oneColumns'">
<div v-for="(item, index) in res" :key="index" class="goods-row">
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image
width="230rpx"
border-radius="16"
height="230rpx"
mode="aspectFit"
:src="item.goodsImage || item.thumbnail"
>
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3" @click="navigateToDetailPage(item)">
{{ item.goodsName }}
</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price != undefined">
¥<span
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.salesModel == 'WHOLESALE'">
<span></span>
</div>
<div
v-for="(promotionItem, promotionIndex) in getPromotion(item)"
:key="promotionIndex"
>
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"
>满减</span
>
<span v-if="promotionItem.indexOf('SECKILL') != -1"></span>
</div>
</div>
<div
style="overflow: hidden"
@click="navigateToDetailPage(item)"
class="count-config"
>
<span style="float: left; font-size: 22rpx"
>已售 {{ item.buyCount || "0" }}</span
>
<span style="float: right; font-size: 22rpx"
>{{ item.commentNum || "0" }}条评论</span
>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import commonTpl from "@/components/m-goods-list/common";
export default {
data() {
return {
lightColor: this.$mainColor,
};
},
mixins: [commonTpl],
props: {
//
type:{
type:String,
default:"oneColumns"
},
//
res: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
//
navigateToDetailPage(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
});
},
},
};
</script>
<style lang="scss" scoped>
.goods-list {
display: flex;
flex-wrap: wrap;
margin: 10rpx 20rpx 284rpx;
width: 100%;
> .goods-item {
background-color: #ffffff;
display: flex;
border-radius: 16rpx;
flex-direction: column;
width: calc(50% - 30rpx);
margin-bottom: 20rpx;
padding-bottom: 20rpx;
&:nth-child(2n + 1) {
margin-right: 20rpx;
}
.image-wrapper {
width: 100%;
height: 330rpx;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
padding: 0;
}
}
.count-config,
.store-seller-name {
font-size: $font-sm;
}
.text-hidden {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.goods-row {
background: #fff;
padding: 16rpx;
> .goods-col {
display: flex;
> .goods-img {
overflow: hidden;
flex: 4;
}
> .goods-detail {
flex: 7;
}
}
}
.goods-detail {
margin: 0 20rpx;
> .title {
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
height: 86rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.promotion {
margin-top: 4rpx;
display: flex;
div {
span {
font-size: 24rpx;
color: $light-color;
margin-right: 10rpx;
padding: 0 4rpx;
border-radius: 2rpx;
}
}
}
.store-seller-name {
color: #666;
overflow: hidden;
display: flex;
justify-content: space-between;
}
.count-config {
padding: 5rpx 0;
color: #666;
display: flex;
font-size: 24rpx;
justify-content: space-between;
}
> .price-box {
margin-top: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10rpx;
font-size: 24rpx;
color: $font-color-light;
> .price {
font-size: 26rpx;
line-height: 1;
color: $main-color;
font-weight: bold;
/deep/ span:nth-of-type(1) {
font-size: 38rpx;
}
}
}
}
</style>

View File

@ -36,16 +36,6 @@
}
return str;
},
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
//
getPromotion(item) {
if (item.promotionMap) {

View File

@ -4,7 +4,7 @@
<view class="goods-list" v-if="type == 'twoColumns'">
<view v-for="(item, index) in res" :key="index" class="goods-item">
<view class="image-wrapper" @click="navigateToDetailPage(item)">
<u-image :src="item.content.thumbnail" width="100%" height='330rpx' mode="aspectFill">
<u-image :src="item.content.thumbnail" width="100%" height='330rpx' mode="aspectFit">
<u-loading slot="loading"></u-loading>
</u-image>
</view>
@ -15,8 +15,8 @@
</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.content.price )[1]
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.content.price )[1]
}}
</div>
</view>
@ -52,7 +52,7 @@
<div v-for="(item, index) in res" :key="index" class="goods-row">
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.content.thumbnail">
<u-image width="230rpx" mode="aspectFit" border-radius='16' height="230rpx" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
@ -60,8 +60,8 @@
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.content.price )[1]
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.content.price )[1]
}}
</div>
</view>
@ -177,16 +177,6 @@
}
return str;
},
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return 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;

View File

@ -3,7 +3,7 @@
<div v-for="(item, index) in res" :key="index" class="goods-row" @click="navigateToDetailPage(item)">
<div class="flex goods-col">
<div class="goods-img">
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
<u-image width="230rpx" mode="aspectFit" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
@ -13,15 +13,15 @@
<view class="price-box">
<!-- 秒杀 / 拼团 -->
<div class="price" v-if="!type && item.price!=undefined">
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{
formatPrice(item.price )[1]
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.price )[1]
}}
</div>
<!-- 砍价 -->
<div class="price" v-if="type && item.purchasePrice!=undefined">
最低
¥<span>{{ formatPrice(item.purchasePrice )[0] }} </span>.{{
formatPrice(item.purchasePrice )[1]
¥<span>{{ $options.filters.goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.purchasePrice )[1]
}}
</div>
</view>
@ -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;

View File

@ -1,190 +0,0 @@
<template>
<div>
<div v-for="(item, index) in res" :key="index" class="goods-row">
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.goodsImage">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price!=undefined">
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{
formatPrice(item.price )[1]
}}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.salesModel == 'WHOLESALE'">
<span></span>
</div>
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"></span>
<span v-if="promotionItem.indexOf('SECKILL') != -1"></span>
</div>
</div>
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
<span style="float: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span>
<span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import commonTpl from '@/components/m-goods-list/common'
export default {
data() {
return {
lightColor: this.$mainColor
}
},
mixins: [commonTpl],
props: {
//
res: {
type: Array,
default: () => {
return []
}
},
}
}
</script>
<style lang='scss' scoped>
.goods-list {
display: flex;
flex-wrap: wrap;
margin: 10rpx 20rpx 284rpx;
width: 100%;
>.goods-item {
background-color: #ffffff;
display: flex;
border-radius: 16rpx;
flex-direction: column;
width: calc(50% - 30rpx);
margin-bottom: 20rpx;
padding-bottom: 20rpx;
&:nth-child(2n + 1) {
margin-right: 20rpx;
}
.image-wrapper {
width: 100%;
height: 330rpx;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
padding: 0;
}
}
.count-config,
.store-seller-name {
font-size: $font-sm;
}
.text-hidden {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.goods-row {
background: #fff;
padding: 16rpx;
>.goods-col {
display: flex;
>.goods-img {
overflow: hidden;
flex: 4;
}
>.goods-detail {
flex: 7;
}
}
}
.goods-detail {
margin: 0 20rpx;
>.title {
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
height: 84rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.promotion {
margin-top: 4rpx;
display: flex;
div {
span {
font-size: 24rpx;
color: $light-color;
margin-right: 10rpx;
padding: 0 4rpx;
border-radius: 2rpx;
}
}
}
.store-seller-name {
color: #666;
overflow: hidden;
display: flex;
justify-content: space-between;
}
.count-config {
padding: 5rpx 0;
color: #666;
display: flex;
font-size: 24rpx;
justify-content: space-between;
}
>.price-box {
margin-top: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10rpx;
font-size: 24rpx;
color: $font-color-light;
>.price {
font-size: 26rpx;
line-height: 1;
color: $main-color;
font-weight: bold;
/deep/ span:nth-of-type(1) {
font-size: 38rpx;
}
}
}
}
</style>

View File

@ -1,16 +1,24 @@
const name = "lilishop"; //全局商城name
const schemeName = 'lilishop' //唤醒app需要的schemeName
const schemeName = "lilishop"; //唤醒app需要的schemeName
export default {
name: name,
schemeLink: `${schemeName}://`, //唤起app地址
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址下载app的地址
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地址
aMapKey: "1f78544934b66c9fbc0104117f663973", //在高德中申请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地址
enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
/**
* 如需更换主题请修改此处以及uni.scss中的全局颜色
*/
mainColor: "#ff3c2a", // 主题色
lightColor: "#ff6b35", // 高亮主题色
aiderLightColor: "#ff9f28", // 辅助高亮颜色
};

19
main.js
View File

@ -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";

View File

@ -26,6 +26,12 @@
}
}
},
{
"path": "pages/tabbar/home/title",
"style": {
"navigationBarTitleText": "消息"
}
},
{
"path": "pages/tabbar/cart/cartList",
"style": {
@ -79,6 +85,12 @@
"style": {
}
},
{
"path": "pages/tabbar/special/special",
"style": {
"navigationBarTitleText": "专题"
}
}
],

View File

@ -98,18 +98,18 @@
},
onBackPress(e) {
if (e.from == "backbutton") {
if(this.routerVal.recharge_sn){
uni.switchTab({
url: '/pages/tabbar/user/my'
});
}
else{
uni.redirectTo({
url: "/pages/order/myOrder?status=0",
});
}
return true; //
}
if(this.routerVal.recharge_sn){
uni.switchTab({
url: '/pages/tabbar/user/my'
});
}
else{
uni.navigateTo({
url: "/pages/order/myOrder?status=0",
});
}
return true; //
}
},
mounted() {
this.cashierData();

View File

@ -1,6 +1,6 @@
<template>
<view class="wap">
<u-navbar back-text="" title="预存款列表">
<u-navbar title="预存款列表">
</u-navbar>
<view class="wrapper-show-money">
<view class="money-view">
@ -28,7 +28,7 @@
</view>
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
<u-loadmore v-else bg-color='#f8f8f8' :status="status" />
</scroll-view>
</swiper-item>
@ -45,7 +45,7 @@ export default {
data() {
return {
walletNum: 0,
status: "loadmore",
current: 0,
swiperCurrent: 0,
userInfo: "", //
@ -82,27 +82,23 @@ export default {
/**分页获取预存款充值记录 */
getRecharge() {
this.status = "loading";
getUserRecharge(this.params).then((res) => {
if (res.data.success) {
if (res.data.result.records.length != 0) {
this.status = "loadmore";
this.datas.push(...res.data.result.records);
} else {
this.status = "nomore";
}
}
});
},
getWallet() {
this.status = "loading";
getWalletLog(this.params).then((res) => {
if (res.data.success) {
if (res.data.result.records.length != 0) {
this.datas.push(...res.data.result.records);
} else {
this.status = "nomore";
}
}
});

View File

@ -1,18 +1,18 @@
<template>
<div class="wrapper">
<u-parse v-html="res.content"></u-parse>
<u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content" v-if="res"></u-parse>
</div>
</template>
<script>
import { getArticleDetail } from "@/api/article";
import { getArticleDetailByType } from "@/api/article";
export default {
data() {
return {
res: "",
way: {
user: {
title: "用户协议",
title: "服务协议",
type: "USER_AGREEMENT",
},
privacy: {
@ -40,9 +40,10 @@ export default {
methods: {
init(option) {
getArticleDetail(this.way[option.type].type).then((res) => {
getArticleDetailByType(this.way[option.type].type).then((res) => {
if (res.data.success) {
this.res = res.data.result;
console.log(res)
}
});
},

View File

@ -20,10 +20,10 @@
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
<!-- #endif -->
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=LICENSE_INFORMATION')"></u-cell-item>
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')"></u-cell-item>
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=PRIVACY_POLICY')"></u-cell-item>
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=ABOUT')"></u-cell-item>
</u-cell-group>

View File

@ -35,7 +35,8 @@
@click="doSearch(keyword)">
<span>{{ keyword }} </span>
</div>
<div @click="showMore" v-if=" oldKeywordIndex > loadIndex" class="oldKeyItem"></div>
<div @click="showMore" v-if="oldKeywordIndex > loadIndex" class="oldKeyItem"></div>
</div>
</view>
@ -202,7 +203,7 @@ export default {
empty:false,
scrollTop: 0,
loadIndex: 10,
oldKeywordIndex: "",
oldKeywordIndex: 0,
selectedWay: {
brand: [],
categoryId: [],
@ -370,15 +371,6 @@ export default {
return array;
}
},
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
//
showMore() {
this.loadOldKeyword(this.oldKeywordIndex);
@ -579,7 +571,7 @@ export default {
key: "OldKeys",
success: (res) => {
var OldKeys = JSON.parse(res.data);
this.oldKeywordIndex = res.data.length;
this.oldKeywordIndex = OldKeys.length;
for (let i = 0; i < index; i++) {
this.oldKeywordList.push(OldKeys[i]);
}

View File

@ -147,9 +147,9 @@
<p class="goods-prices">
<span></span>
<span class="goods-price">{{
formatPrice(val.goodsSku.price)[0]
$options.filters.goodsFormatPrice(val.purchasePrice)[0]
}}</span>
<span>.{{ formatPrice(val.goodsSku.price)[1] }}</span>
<span>.{{ $options.filters.goodsFormatPrice(val.purchasePrice)[1] }}</span>
</p>
</div>
</div>
@ -315,10 +315,10 @@
<div v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
<span>¥</span>
<span class="price">{{
formatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
$options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
}}</span>
<span
>.{{ formatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
>.{{ $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
</span>
</div>
<span v-else class="number"
@ -421,7 +421,7 @@ export default {
item.route == "pages/tabbar/cart/cartList" ||
item.route.indexOf("pages/product/goods") != -1
) {
uni.redirectTo({
uni.navigateTo({
url: item.route,
});
}
@ -455,13 +455,6 @@ export default {
mounted() {},
methods: {
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
//
async callbackInvoice(val) {
this.invoiceFlag = false;
@ -611,7 +604,7 @@ export default {
});
// 0
if (this.orderMessage.priceDetailDTO.billPrice == 0) {
uni.redirectTo({
uni.navigateTo({
url: "/pages/order/myOrder?status=0",
});
} else {
@ -675,7 +668,7 @@ export default {
});
}
if (res.data.result.skuList.length <= 0) {
uni.redirectTo({
uni.navigateTo({
url: "/pages/order/myOrder?status=0",
});
}

View File

@ -311,7 +311,7 @@ export default {
*/
onBackPress(e) {
if (e.from == "backbutton") {
uni.reLaunch({
uni.switchTab({
url: "/pages/tabbar/user/my",
});
return true; //
@ -331,7 +331,7 @@ export default {
this.initData(0);
}
}
this.loadData(this.status);
// this.loadData(this.status);
},
onLoad(options) {

File diff suppressed because it is too large Load Diff

View File

@ -151,12 +151,12 @@
<span v-else>
<span v-if="wholesaleList.length">
<span>¥</span><span class="price">{{ formatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}</span>.{{ formatPrice(wholesaleList[wholesaleList.length-1].price)[1] }}
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[1] }}
~
<span>¥</span><span class="price">{{ formatPrice(wholesaleList[0].price)[0] }}</span>.{{ formatPrice(wholesaleList[0].price)[1] }}
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }}
</span>
<span v-else>
<span>¥</span><span class="price">{{ formatPrice(goodsDetail.price)[0] }}</span>.{{ formatPrice(goodsDetail.price)[1] }}
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
</span>
</span>
</view>
@ -752,14 +752,6 @@ export default {
// // #endif
},
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
/**选择商品 */
changedGoods(val) {
this.selectedGoods = val;

View File

@ -21,15 +21,15 @@
>
<span class="flex-price">
{{ formatPrice(detail.promotionPrice)[0] }}.{{
formatPrice(detail.promotionPrice)[1]
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.{{
$options.filters.goodsFormatPrice(detail.promotionPrice)[1]
}}</span
>
</span>
<view class="u-group-flex" v-if="detail.price != undefined">
<span class="old-price"
>{{ formatPrice(detail.price)[0] }}.{{
formatPrice(detail.price)[1]
>{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
$options.filters.goodsFormatPrice(detail.price)[1]
}}</span
>
<view class="promotion">限时抢购</view>
@ -42,8 +42,8 @@
<span
class="flex-price"
v-if="promotion.groupbuy_goods_vo.price != undefined"
>{{ 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]
}}</span
>
<!-- <span v-if="promotion.point">+{{promotion.point}}</span> -->
@ -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]
}}</span
>
<view class="promotion">团购活动</view>
@ -68,13 +68,13 @@
v-if="detail.promotionPrice != undefined"
>
<span class="flex-price">
{{ formatPrice(detail.promotionPrice)[0] }}.</span
>{{ formatPrice(detail.promotionPrice)[1] }}
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.</span
>{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[1] }}
</span>
<view class="u-group-flex" v-if="detail.price != undefined">
<span class="old-price"
>{{ formatPrice(detail.price)[0] }}.{{
formatPrice(detail.price)[1]
>{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
$options.filters.goodsFormatPrice(detail.price)[1]
}}</span
>
<view class="promotion">拼团活动</view>
@ -141,13 +141,6 @@ export default {
},
mounted() {},
methods: {
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
getCountDownTime(val) {
let date = new Date(val);
let timeSimple = new Date(date).getTime() / 1000;

View File

@ -32,7 +32,7 @@
{{ item.content.goodsName }}
</view>
<view class="item-price" v-if="item.price != undefined">
<span class="item-price-blod">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }}
<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.content.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.content.price)[1] }}
</view>
</view>
</view>
@ -48,13 +48,6 @@ export default {
props: ["res", "goodsDetail", "storeDetail"],
mounted() {},
methods: {
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
//
clickGoods(val) {
uni.navigateTo({

View File

@ -82,13 +82,7 @@ export default {
this.storeList = [];
this.init();
},
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
async init() {
let res = await getStoreList(this.params);
if (res.data.success) {

View File

@ -527,7 +527,7 @@ export default {
color: #999;
}
.contant {
.content {
margin-top: 20rpx;
display: flex;
flex-wrap: wrap;

View File

@ -79,8 +79,8 @@
<view class="sp-price">
<div class="default-color" :class="{'main-color':Object.keys(skuItem.promotionMap).length ==0 }">
<span>{{ formatPrice(skuItem.goodsSku.price)[0] }}</span>
<span>.{{ formatPrice(skuItem.goodsSku.price)[1] }}</span>
<span>{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[0] }}</span>
<span>.{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[1] }}</span>
</div>
</view>
<view>
@ -108,8 +108,8 @@
<!-- 如果有活动 并且是选中的状态,显示预估到手价格 -->
<div class="priceDetail-flowPrice" :class="{'main-color':skuItem.priceDetailDTO}"
v-if="skuItem.priceDetailDTO && skuItem.invalid == 0 && Object.keys(skuItem.promotionMap).length != 0 && skuItem.checked && skuItem.checked">
预估到手价 <span>{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}</span>
<span>.{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
预估到手价 <span>{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}</span>
<span>.{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
</div>
<div style='margin-left: 20rpx;' v-if="!skuItem.checked && skuItem.errorMessage">
{{skuItem.errorMessage}}
@ -131,7 +131,7 @@
<div class="fullPrice">
<span class="number" v-if="cartDetail && cartDetail.priceDetailDTO">
总计:
<span>¥{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}</span>.<span>{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}</span>
<span>¥{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}</span>.<span>{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}</span>
</span>
<span class="number" v-else>:0.00</span>
</div>
@ -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(".");
},
/**
* 左滑打开删除
*/

View File

@ -15,6 +15,11 @@ export default {
},
};
},
onReachBottom(){
//
uni.$emit('onReachBottom',true)
},
onPullDownRefresh() {
this.$refs.tpl.init();

View File

@ -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;
}
}
},
});
}

View File

@ -1,8 +1,8 @@
<template>
<div class="layout">
<div class="flex-one">
<!-- <u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image> -->
<hotzone :res="res"></hotzone>
<u-image v-if="res.list[0].zoneInfo == ''" @click="modelNavigateTo(res.list[0])" width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image>
<hotzone v-else :res="res"></hotzone>
</div>
</div>
</template>
@ -17,7 +17,7 @@ export default {
},
data() {
return {
modelNavigateTo,
modelNavigateTo
};
},
props: ["res"],

View File

@ -1,21 +1,38 @@
<template>
<div class="layout">
<u-sticky>
<div class="goods-cell-title">
<div class="goods-item-title" :class="{ 'selected-title': selected.index == index }"
@click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index">
<div
class="goods-item-title"
:class="{ 'selected-title': selected.index == index }"
@click="handleClickTitle(title, index)"
v-for="(title, index) in res.list[0].titleWay"
:key="index"
>
<h4 class="h4">{{ title.title }}</h4>
<div>{{ title.desc }}</div>
</div>
</div>
</u-sticky>
<div class="goods-list">
<div v-if="item.___index != undefined ? (selected.index == item.___index) : ( selected.val == item.type)"
@click="handleClick(item)" class="goods-item" v-for="(item, item_index) in res.list[0].listWay"
:key="item_index">
<div
v-if="
item.___index != undefined
? selected.index == item.___index
: selected.val == item.type
"
@click="handleClick(item)"
class="goods-item"
v-for="(item, item_index) in res.list[0].listWay"
:key="item_index"
>
<div class="goods-img">
<u-image :src="item.img" height="350rpx" mode="aspectFit" width="100%">
<u-image
:src="item.img"
height="350rpx"
mode="aspectFit"
width="100%"
>
<u-loading slot="loading"></u-loading>
</u-image>
</div>
@ -24,9 +41,42 @@
{{ item.title }}
</div>
<div class="goods-bottom">
<div class="goods-price"> ¥<span>{{ formatPrice(item.price )[0] }} </span>.{{
formatPrice(item.price )[1]
}}</div>
<div class="goods-price">
¥<span
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</div>
</div>
</div>
<div
v-if="res.list[0].titleWay[selected.index].bindCategory && goodsData.length"
v-for="(item, index) in goodsData"
:key="index"
class="goods-item"
@click="handleClick(item)"
>
<div class="goods-img">
<u-image
:src="item.thumbnail"
height="350rpx"
mode="aspectFit"
width="100%"
>
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-desc">
<div class="goods-title">
{{ item.goodsName }}
</div>
<div class="goods-bottom">
<div class="goods-price">
¥<span
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</div>
</div>
</div>
@ -34,6 +84,7 @@
</div>
</template>
<script>
import { getGoodsList } from "@/api/goods.js";
export default {
title: "商品分类以及商品",
data() {
@ -42,29 +93,44 @@ export default {
index: 0,
val: "",
},
params: {
pageNumber: 1,
pageSize: 100,
categoryId: "",
},
goodsData: [], //
goodsResult:"", //es
};
},
props: ["res"],
props: ["res","enableBottomLoad"],
watch: {
res: {
handler(val) {
// selected
if (val) {
this.selected.val = this.res.list[0].listWay[0].type;
console.log(val)
//
this.selected.val = this.res.list[0].listWay[0] ? this.res.list[0].listWay[0].type: '';
//
this.res.list[0].titleWay[0].bindCategory ? this.initGoods(this.res.list[0].titleWay[0]) : ''
}
},
immediate: true,
},
},
mounted() {},
mounted() {
uni.$on('onReachBottom',()=>{
if(this.enableBottomLoad && this.goodsResult.totalElements >= this.params.pageNumber * this.params.pageSize){
this.params.pageNumber++
this.initGoods(this.res.list[0].titleWay[this.selected.index])
}
})
},
destroyed(){
uni.$off('onReachBottom')
},
methods: {
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
handleClick(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
@ -73,9 +139,25 @@ export default {
closeGoods(val, index) {
this.res.list[0].listWay.splice(index, 1);
},
async initGoods(val) {
if(this.enableBottomLoad) this.params.pageSize = 20
val ? this.params.categoryId = val.bindCategory.id : '';
const res = await getGoodsList(this.params);
if (res.data.success) {
this.goodsResult = res.data.result
const result = res.data.result.content.map(item=>item.content)
this.goodsData.push(...result);
console.log(this.goodsData)
}
},
handleClickTitle(val, index) {
this.selected.index = index;
this.selected.val = val.title;
if (val.bindCategory) {
this.params.pageNumber = 1
this.goodsData = []
this.initGoods(val);
}
},
},
};
@ -158,7 +240,7 @@ $w_94: 94%;
margin: 0 auto;
> .goods-title {
font-size: 24rpx;
height: 70rpx;
height: 67rpx;
display: -webkit-box;
font-weight: 500;
-webkit-box-orient: vertical;
@ -172,11 +254,10 @@ $w_94: 94%;
> .goods-price {
line-height: 2;
color: $main-color;
>span{
> span {
font-size: 42rpx;
}
}
}
}
</style>

View File

@ -4,6 +4,9 @@
<u-icon name="search"></u-icon>
{{ res.list[0].title }}
</div>
<div slot="right" open-type="contact" class="navbar-right message" @click="linkMsgDetail" style="border-style:none;background:rgb(234,234,234);" >
<image style="width:53rpx;height:53rpx;margin-top:6rpx;" src="@/static/img/title.png"></image>
</div>
</div>
</template>
<script>
@ -11,6 +14,11 @@ export default {
title:"搜索栏",
props: ["res"],
methods: {
linkMsgDetail(){
uni.navigateTo({
url:`/pages/tabbar/home/title`
})
},
handleSearch() {
uni.navigateTo({
url: "/pages/navigation/search/searchPage",
@ -34,5 +42,14 @@ export default {
.layout {
background: #fff;
padding: 0 16rpx;
position: relative;
}
.navbar-right{
position: absolute;
top: 0;
// right: 0;
}
.message{
right:40rpx;
}
</style>

185
pages/tabbar/home/title.vue Normal file
View File

@ -0,0 +1,185 @@
<template>
<view>
<view>
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
<u-cell-group v-if="current == 0">
<view v-for="(item,index) in lists" :key="index">
<u-cell-item :arrow="false" v-if="item.status =='UN_READY'" style="position: relative;"
@click="linkMsgDetail(item)">
<template slot="label">
<view style="display: inline-block;
width: 100%;
height: auto;
font-family: Gibson;
font-size: 25rpx;
word-break: break-all;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: pre-wrap;">
<view style="color:black;font-size:30rpx;font-weight:500;">{{item.title}}</view>
<view>{{item.content}}</view>
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
</view>
</template>
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#000000;color:white;">未读</button> -->
</u-cell-item>
</view>
</u-cell-group>
<u-cell-group v-if="current == 1">
<view v-for="(item,index) in lists" :key="index">
<u-cell-item :arrow="false" v-if="item.status == 'ALREADY_READY'" style="position: relative;"
@click="linkMsgDetail(item)">
<template slot="label">
<view style="display: inline-block;
width: 100%;
height: auto;
font-family: Gibson;
font-size: 25rpx;
word-break: break-all;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: pre-wrap;">
<view style="color:black;font-size:30rpx;font-weight:500;">{{item.title}}</view>
<view>{{item.content}}</view>
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
</view>
</template>
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#F3F3FA;color:black;">已读</button> -->
</u-cell-item>
</view>
</u-cell-group>
</view>
</view>
</template>
<script>
import {
messages,
editMessages
} from "@/api/message.js"
export default {
data() {
return {
params: {
pageSize: 20,
pageNumber: 1,
memberId: "",
messageId: "",
status:"UN_READY"
},
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '实在没有了'
},
list: [{
name: "未读"
}, {
name: "已读"
}],
current: 0,
lists: [],
status: "loadmore"
}
},
onShow() {
this.getMessage()
},
onReachBottom() {
this.params.pageNumber++;
this.statuss = "loading";
this.getMessage()
},
methods: {
linkMsgDetail(v) {
if (v.status == 'UN_READY') {
let params = {}
params.messageId = v.memberId
editMessages(v.id, params).then(res => {
if (res.data.success) {
console.log( this.lists)
this.lists.forEach((item,index)=>{
console.log(item)
if(item.id == v.id){
this.lists.splice(index, 1)
}
})
}
})
}
// uni.navigateTo({
// url:`/pages/tabbar/home/messageDetail?data=${encodeURIComponent(JSON.stringify(v))}`
// })
},
/**
* 返回
*/
back() {
if (getCurrentPages().length == 1) {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
} else {
uni.navigateBack();
}
},
change(e) {
console.log(e)
this.current = e;
if (e == 0) {
this.params.status = "UN_READY"
this.params.pageNumber = 1;
} else if (e == 1) {
this.params.status = "ALREADY_READY"
this.params.pageNumber = 1;
}
this.lists = []
this.getMessage()
},
getMessage() {
this.params.memberId = this.$options.filters.isLogin().id;
messages(this.params).then(res => {
console.log(res)
if (res.data.success) {
if (res.data.result.records == '') {
console.log(11111)
this.status = "nomore"
}
res.data.result.records.forEach(item => {
this.lists.push(item)
let obj = {};
this.lists = this.lists.reduce(
(cur, next) => {
//
if (next.id != undefined) {
obj[next.id] ?
"" :
(obj[next.id] = true && cur.push(next));
}
console.log(cur);
return cur;
},
[]
)
})
}
})
}
},
}
</script>
<style>
.foot {
position: fixed;
bottom: 0;
}
</style>

View File

@ -42,7 +42,7 @@
<textPicture v-if="item.type == 'textPicture'" :res="item.options" />
<menuLayout v-if="item.type == 'menu'" :res="item.options" />
<flexOne v-if="item.type == 'flexOne'" :res="item.options" />
<goods v-if="item.type == 'goods'" :res="item.options" />
<goods :enableBottomLoad="enableLoad" v-if="item.type == 'goods'" :res="item.options" />
<group v-if="item.type == 'group'" :res="item.options" />
<notice v-if="item.type == 'notice'" :res="item.options" />
<promotions v-if="item.type == 'promotionDetail'" :res="item.options" />
@ -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 : '' : ''
}
}
});
},

View File

@ -0,0 +1,247 @@
<template>
<div class="wrapper">
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
<div v-for="(item, index) in pageData.list" :key="index">
<!-- 搜索栏如果在楼层装修顶部则会自动浮动否则不浮动 -->
<div class="navbar" v-if="item.type == 'search'">
<search style="width: 100%" :res="item.options" />
<!-- #ifndef H5 -->
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
<div slot="right" class="navbar-right">
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon>
</div>
<!-- #endif -->
</div>
<carousel v-if="item.type == 'carousel'" :res="item.options" />
<titleLayout v-if="item.type == 'title'" :res="item.options" />
<leftOneRightTwo
v-if="item.type == 'leftOneRightTwo'"
:res="item.options"
/>
<leftTwoRightOne
v-if="item.type == 'leftTwoRightOne'"
:res="item.options"
/>
<topOneBottomTwo
v-if="item.type == 'topOneBottomTwo'"
:res="item.options"
/>
<topTwoBottomOne
v-if="item.type == 'topTwoBottomOne'"
:res="item.options"
/>
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
<flexFive v-if="item.type == 'flexFive'" :res="item.options" />
<flexFour v-if="item.type == 'flexFour'" :res="item.options" />
<flexTwo v-if="item.type == 'flexTwo'" :res="item.options" />
<textPicture v-if="item.type == 'textPicture'" :res="item.options" />
<menuLayout v-if="item.type == 'menu'" :res="item.options" />
<flexOne v-if="item.type == 'flexOne'" :res="item.options" />
<goods v-if="item.type == 'goods'" :res="item.options" />
<group v-if="item.type == 'group'" :res="item.options" />
<notice v-if="item.type == 'notice'" :res="item.options" />
<promotions v-if="item.type == 'promotionDetail'" :res="item.options" />
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
</div>
<u-no-network></u-no-network>
</div>
</template>
<script>
//
import tpl_banner from "@/pages/tabbar/home/template/tpl_banner"; //
import tpl_title from "@/pages/tabbar/home/template/tpl_title"; //
import tpl_left_one_right_two from "@/pages/tabbar/home/template/tpl_left_one_right_two"; //
import tpl_left_two_right_one from "@/pages/tabbar/home/template/tpl_left_two_right_one"; //
import tpl_top_one_bottom_two from "@/pages/tabbar/home/template/tpl_top_one_bottom_two"; //
import tpl_top_two_bottom_one from "@/pages/tabbar/home/template/tpl_top_two_bottom_one"; //
import tpl_flex_one from "@/pages/tabbar/home/template/tpl_flex_one"; //
import tpl_flex_two from "@/pages/tabbar/home/template/tpl_flex_two"; //
import tpl_flex_three from "@/pages/tabbar/home/template/tpl_flex_three"; //
import tpl_flex_five from "@/pages/tabbar/home/template/tpl_flex_five"; //
import tpl_flex_four from "@/pages/tabbar/home/template/tpl_flex_four"; //
import tpl_text_picture from "@/pages/tabbar/home/template/tpl_text_picture"; //
import tpl_menu from "@/pages/tabbar/home/template/tpl_menu"; //
import tpl_search from "@/pages/tabbar/home/template/tpl_search"; //
import tpl_group from "@/pages/tabbar/home/template/tpl_group"; //
import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //
//
import { toSpecial, getSpecial } from "@/api/home"; //
import permision from "@/js_sdk/wa-permission/permission.js"; //
import config from "@/config/config";
import tpl_notice from "@/pages/tabbar/home/template/tpl_notice"; //
import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //
export default {
data() {
return {
id: "",
config,
pageData: "", //
bodyParam: "",
isIos: ""
};
},
components: {
carousel: tpl_banner,
titleLayout: tpl_title,
leftOneRightTwo: tpl_left_one_right_two,
leftTwoRightOne: tpl_left_two_right_one,
topOneBottomTwo: tpl_top_one_bottom_two,
topTwoBottomOne: tpl_top_two_bottom_one,
flexThree: tpl_flex_three,
flexFive: tpl_flex_five,
flexFour: tpl_flex_four,
flexTwo: tpl_flex_two,
textPicture: tpl_text_picture,
menuLayout: tpl_menu,
search: tpl_search,
flexOne: tpl_flex_one,
goods: tpl_goods,
group: tpl_group,
notice: tpl_notice,
promotions: tpl_promotions
},
mounted() {
this.init();
// #ifdef MP-WEIXIN
//
uni.showShareMenu({ withShareTicket: true });
// #endif
},
onLoad(val) {
this.id = val.id;
this.bodyParam = val.body;
},
methods: {
/**
* 实例化首页数据楼层
*/
init() {
this.pageData = "";
console.log(this.bodyParam);
if (this.bodyParam) {
toSpecial({body: this.bodyParam}).then(res => {
if (res.data.success) {
this.pageData = JSON.parse(res.data.result.pageData);
}
});
} else {
getSpecial(this.id).then(res => {
if (res.data.success) {
this.pageData = JSON.parse(res.data.result.pageData);
}
});
}
},
/**
* TODO 扫码功能后续还会后续增加
* 应该实现的功能目前计划有
* 扫描商品跳转商品页面
* 扫描活动跳转活动页面
* 扫描二维码登录
* 扫描其他站信息 弹出提示返回首页
*/
seacnCode() {
uni.scanCode({
success: function(res) {
let path = encodeURIComponent(res.result);
// WX_CODE
if (res.scanType == "WX_CODE") {
console.log(res);
uni.navigateTo({
url: `/${res.path}`
});
} else {
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);
}
});
}
}
});
},
/**
* 提示获取权限
*/
tipsGetSettings() {
uni.showModal({
title: "提示",
content: "您已经关闭相机权限,去设置",
success: function(res) {
if (res.confirm) {
if (this.isIos) {
plus.runtime.openURL("app-settings:");
} else {
permision.gotoAppPermissionSetting();
}
}
}
});
},
/**
* 唤醒客户端扫码
* 没权限去申请权限有权限获取扫码功能
*/
async scan() {
// #ifdef APP-PLUS
this.isIos = plus.os.name == "iOS";
// Ios
if (this.isIos) {
const iosFirstCamera = uni.getStorageSync("iosFirstCamera"); //
if (iosFirstCamera !== "false") {
uni.setStorageSync("iosFirstCamera", "false"); //false
this.seacnCode();
} else {
if (permision.judgeIosPermission("camera")) {
this.seacnCode();
} else {
//
this.tipsGetSettings();
}
}
} else {
/**
* TODO 安卓 权限已经授权了调用api总是显示用户已永久拒绝申请人傻了
* TODO 如果xdm有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues
*/
this.seacnCode();
}
// #endif
// #ifdef MP-WEIXIN
this.seacnCode();
// #endif
}
}
};
</script>
<style scoped lang="scss">
.navbar-right {
padding: 0 16rpx 0 0;
}
.navbar {
display: flex;
align-items: center;
}
</style>

28
project.config.json Normal file
View File

@ -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
}
}

View File

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "lilishop-uniapp",
"setting": {
"compileHotReLoad": true
}
}

BIN
static/img/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -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({