Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp
commit
0feaf55381
2
App.vue
2
App.vue
|
@ -88,7 +88,9 @@
|
|||
|
||||
onShow() {
|
||||
// #ifndef H5
|
||||
if(this.config.enableGetClipboard){
|
||||
this.getClipboard();
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
17
api/home.js
17
api/home.js
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告图
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物流消息列表
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -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>
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
|
@ -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/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
||||
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地址
|
||||
imWebSrc: "https://im.pickmall.cn", //IM地址
|
||||
enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||
/**
|
||||
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||
*/
|
||||
mainColor: "#ff3c2a", // 主题色
|
||||
lightColor: "#ff6b35", // 高亮主题色
|
||||
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
||||
};
|
||||
|
|
15
main.js
15
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";
|
||||
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";
|
||||
|
|
12
pages.json
12
pages.json
|
@ -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": "专题"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
});
|
||||
}
|
||||
else{
|
||||
uni.redirectTo({
|
||||
uni.navigateTo({
|
||||
url: "/pages/order/myOrder?status=0",
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
@click="doSearch(keyword)">
|
||||
<span>{{ keyword }} </span>
|
||||
</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]);
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -12,143 +12,68 @@
|
|||
<!-- 手机号 -->
|
||||
<div v-show="!enableUserPwdBox">
|
||||
<div v-show="current == 0">
|
||||
<u-input
|
||||
:custom-style="inputStyle"
|
||||
:placeholder-style="placeholderStyle"
|
||||
placeholder="请输入手机号 (11位)"
|
||||
class="mobile"
|
||||
focus
|
||||
v-model="mobile"
|
||||
type="number"
|
||||
maxlength="11"
|
||||
/>
|
||||
<div
|
||||
:class="!enableFetchCode ? 'disable' : 'fetch'"
|
||||
@click="fetchCode"
|
||||
class="btn"
|
||||
>
|
||||
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入手机号 (11位)"
|
||||
class="mobile" focus v-model="mobile" type="number" maxlength="11" />
|
||||
<div :class="!enableFetchCode ? 'disable' : 'fetch'" @click="fetchCode" class="btn">
|
||||
获取验证码
|
||||
</div>
|
||||
</div>
|
||||
<!-- 输入验证码 -->
|
||||
<div v-show="current == 1" class="box-code">
|
||||
<verifyCode
|
||||
type="bottom"
|
||||
@confirm="submit"
|
||||
boxActiveColor="#D8D8D8"
|
||||
v-model="code"
|
||||
isFocus
|
||||
boxNormalColor="#D8D8D8"
|
||||
cursorColor="#D8D8D8"
|
||||
/>
|
||||
<verifyCode type="bottom" @confirm="submit" boxActiveColor="#D8D8D8" v-model="code" isFocus
|
||||
boxNormalColor="#D8D8D8" cursorColor="#D8D8D8" />
|
||||
|
||||
<div class="fetch-btn">
|
||||
<u-verification-code
|
||||
change-text="验证码已发送(x)"
|
||||
end-text="重新获取验证码"
|
||||
unique-key="page-login"
|
||||
:seconds="seconds"
|
||||
@end="end"
|
||||
@start="start"
|
||||
ref="uCode"
|
||||
@change="codeChange"
|
||||
></u-verification-code>
|
||||
<u-verification-code change-text="验证码已发送(x)" end-text="重新获取验证码" unique-key="page-login"
|
||||
:seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange">
|
||||
</u-verification-code>
|
||||
<span @tap="fetchCode" :style="{ color: codeColor }">
|
||||
{{ tips }}</span
|
||||
>
|
||||
{{ tips }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 帐号密码登录 -->
|
||||
<div v-show="enableUserPwdBox">
|
||||
<u-input
|
||||
:custom-style="inputStyle"
|
||||
:placeholder-style="placeholderStyle"
|
||||
placeholder="请输入用户名"
|
||||
class="mobile"
|
||||
focus
|
||||
v-model="userData.username"
|
||||
/>
|
||||
<u-input
|
||||
:custom-style="inputStyle"
|
||||
:placeholder-style="placeholderStyle"
|
||||
placeholder="请输入密码"
|
||||
class="mobile"
|
||||
focus
|
||||
v-model="userData.password"
|
||||
type="password"
|
||||
/>
|
||||
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入用户名"
|
||||
class="mobile" focus v-model="userData.username" />
|
||||
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入密码"
|
||||
class="mobile" focus v-model="userData.password" type="password" />
|
||||
|
||||
<div
|
||||
:class="!enableUserBtnColor ? 'disable' : 'fetch'"
|
||||
@click="passwordLogin"
|
||||
class="btn"
|
||||
>
|
||||
<div :class="!enableUserBtnColor ? 'disable' : 'fetch'" @click="passwordLogin" class="btn">
|
||||
帐号密码登录
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex" v-show="current != 1">
|
||||
<u-checkbox-group :icon-size="24" width="45rpx">
|
||||
<u-checkbox
|
||||
shape="circle"
|
||||
v-model="enablePrivacy"
|
||||
active-color="#FF5E00"
|
||||
></u-checkbox>
|
||||
<u-checkbox shape="circle" v-model="enablePrivacy" active-color="#FF5E00"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<div class="tips">
|
||||
未注册的手机号验证后将自动创建用户账号,登录即代表您已同意<span
|
||||
@click="navigateToPrivacy('privacy')"
|
||||
>《隐私协议》</span>
|
||||
未注册的手机号验证后将自动创建用户账号,登录即代表您已同意<span @click="navigateToPrivacy('privacy')">《隐私协议》</span>
|
||||
<span @click="navigateToPrivacys('user')">
|
||||
《用户协议》
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="current != 1"
|
||||
class="user-password-tips"
|
||||
@click="enableUserPwdBox = !enableUserPwdBox"
|
||||
>
|
||||
<div v-if="current != 1" class="user-password-tips" @click="enableUserPwdBox = !enableUserPwdBox">
|
||||
{{ !enableUserPwdBox ? "帐号密码" : "手机号" }}登录
|
||||
</div>
|
||||
|
||||
<!-- 循环出当前可使用的第三方登录模式 -->
|
||||
<div class="flex login-list">
|
||||
<div
|
||||
v-if="item.code"
|
||||
:style="{ background: item.color }"
|
||||
class="login-item"
|
||||
v-for="(item, index) in loginList"
|
||||
:key="index"
|
||||
>
|
||||
<u-icon
|
||||
v-if="item.title != 'APPLE'"
|
||||
color="#fff"
|
||||
size="42"
|
||||
:name="item.icon"
|
||||
@click="navigateLogin(item)"
|
||||
>
|
||||
<div v-if="item.code" :style="{ background: item.color }" class="login-item"
|
||||
v-for="(item, index) in loginList" :key="index">
|
||||
<u-icon v-if="item.title != 'APPLE'" color="#fff" size="42" :name="item.icon"
|
||||
@click="navigateLogin(item)">
|
||||
</u-icon>
|
||||
<u-image
|
||||
v-else
|
||||
src="/static/appleidButton@2x.png"
|
||||
:lazy-load="false"
|
||||
@click="navigateLogin(item)"
|
||||
width="80"
|
||||
height="80"
|
||||
/>
|
||||
<u-image v-else src="/static/appleidButton@2x.png" :lazy-load="false" @click="navigateLogin(item)"
|
||||
width="80" height="80" />
|
||||
</div>
|
||||
</div>
|
||||
<myVerification
|
||||
v-if="codeFlag"
|
||||
@send="verification"
|
||||
class="verification"
|
||||
ref="verification"
|
||||
business="LOGIN"
|
||||
/>
|
||||
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification"
|
||||
business="LOGIN" />
|
||||
</div>
|
||||
<view v-else>
|
||||
<wechatH5Login />
|
||||
|
@ -157,21 +82,40 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { openIdLogin, loginCallback } from "@/api/connect.js";
|
||||
import {
|
||||
openIdLogin,
|
||||
loginCallback
|
||||
} from "@/api/connect.js";
|
||||
import api from "@/config/api.js";
|
||||
import { sendMobile, smsLogin, userLogin } from "@/api/login";
|
||||
import {
|
||||
sendMobile,
|
||||
smsLogin,
|
||||
userLogin
|
||||
} from "@/api/login";
|
||||
import myVerification from "@/components/verification/verification.vue"; //验证码模块
|
||||
import uuid from "@/utils/uuid.modified.js"; // uuid
|
||||
import verifyCode from "@/components/verify-code/verify-code";
|
||||
import { getUserInfo } from "@/api/members";
|
||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||
import {
|
||||
getUserInfo
|
||||
} from "@/api/members";
|
||||
import {
|
||||
whetherNavigate
|
||||
} from "@/utils/Foundation"; //登录跳转
|
||||
import storage from "@/utils/storage.js"; //缓存
|
||||
import wechatH5Login from "./wechatH5Login.vue";
|
||||
import { webConnect } from "@/api/connect.js";
|
||||
import { md5 } from "@/utils/md5.js";
|
||||
import {
|
||||
webConnect
|
||||
} from "@/api/connect.js";
|
||||
import {
|
||||
md5
|
||||
} from "@/utils/md5.js";
|
||||
|
||||
export default {
|
||||
components: { myVerification, verifyCode, wechatH5Login },
|
||||
components: {
|
||||
myVerification,
|
||||
verifyCode,
|
||||
wechatH5Login
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
@ -185,8 +129,7 @@ export default {
|
|||
codeColor: "#999", //按钮验证码颜色
|
||||
lightColor: this.$lightColor,
|
||||
seconds: 60, //默认验证码等待时间
|
||||
loginTitleWay: [
|
||||
{
|
||||
loginTitleWay: [{
|
||||
title: "欢迎登录",
|
||||
desc: "登录后更精彩,美好生活即将开始",
|
||||
},
|
||||
|
@ -422,11 +365,11 @@ export default {
|
|||
storage.setUserInfo(user.data.result);
|
||||
storage.setHasLogin(true);
|
||||
});
|
||||
getCurrentPages().length > 1
|
||||
? uni.navigateBack({
|
||||
getCurrentPages().length > 1 ?
|
||||
uni.navigateBack({
|
||||
delta: getCurrentPages().length - 2,
|
||||
})
|
||||
: uni.switchTab({
|
||||
}) :
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
});
|
||||
}
|
||||
|
@ -536,7 +479,9 @@ export default {
|
|||
*/
|
||||
storage.setUserInfo(user.data.result);
|
||||
storage.setHasLogin(true);
|
||||
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
});
|
||||
/**
|
||||
* 计算出当前router路径
|
||||
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
|
||||
|
@ -591,7 +536,10 @@ export default {
|
|||
/**
|
||||
* 执行登录
|
||||
*/
|
||||
smsLogin({ mobile: this.mobile, code: this.code }, this.clientType).then(
|
||||
smsLogin({
|
||||
mobile: this.mobile,
|
||||
code: this.code
|
||||
}, this.clientType).then(
|
||||
(res) => {
|
||||
this.getUserInfoMethods(res);
|
||||
}
|
||||
|
@ -773,6 +721,7 @@ page {
|
|||
.wrapper {
|
||||
padding: 0 80rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
padding-top: calc(104rpx);
|
||||
font-style: normal;
|
||||
|
@ -781,9 +730,11 @@ page {
|
|||
font-size: 56rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.box-code {
|
||||
margin-top: 78rpx;
|
||||
}
|
||||
|
||||
.desc,
|
||||
.desc-light {
|
||||
font-size: 32rpx;
|
||||
|
@ -791,25 +742,32 @@ page {
|
|||
color: #333333;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.desc-light {
|
||||
color: #999999;
|
||||
|
||||
>span {
|
||||
color: #333;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile {
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.disable {
|
||||
background: linear-gradient(90deg, #ffdcba 2.21%, #ffcfb2 99.86%);
|
||||
}
|
||||
|
||||
.fetch {
|
||||
background: linear-gradient(57.72deg, #ff8a19 18.14%, #ff5e00 98.44%);
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 100px;
|
||||
width: 590rpx;
|
||||
|
@ -820,15 +778,18 @@ page {
|
|||
text-align: center;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
margin-top: 32rpx;
|
||||
width: 546rpx;
|
||||
|
||||
>span {
|
||||
color: $light-color;
|
||||
}
|
||||
}
|
||||
|
||||
.fetch-btn {
|
||||
width: 370rpx;
|
||||
height: 80rpx;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -527,7 +527,7 @@ export default {
|
|||
color: #999;
|
||||
}
|
||||
|
||||
.contant {
|
||||
.content {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
|
|
@ -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(".");
|
||||
},
|
||||
|
||||
/**
|
||||
* 左滑打开删除
|
||||
*/
|
||||
|
|
|
@ -15,6 +15,11 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
onReachBottom(){
|
||||
// 给子级监听触底加载
|
||||
uni.$emit('onReachBottom',true)
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
this.$refs.tpl.init();
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
/** 配置楼层模块的跳转 */
|
||||
export function modelNavigateTo(item) {
|
||||
let val = item.url || item;
|
||||
console.log(item);
|
||||
// return;
|
||||
switch (val.___type || item.type) {
|
||||
//链接跳转到专题
|
||||
|
||||
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,
|
||||
|
@ -116,3 +121,88 @@ export function modelNavigateTo(item) {
|
|||
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: `/${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);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
|
@ -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"],
|
||||
|
|
|
@ -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() {},
|
||||
methods: {
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
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])
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
|
||||
})
|
||||
},
|
||||
destroyed(){
|
||||
uni.$off('onReachBottom')
|
||||
},
|
||||
methods: {
|
||||
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;
|
||||
|
@ -178,5 +260,4 @@ $w_94: 94%;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
|
@ -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 : '' : ''
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -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>
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"projectname": "lilishop-uniapp",
|
||||
"setting": {
|
||||
"compileHotReLoad": true
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
|
@ -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,29 +121,27 @@ export function isLogin(val) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
export function tipsToLogin() {
|
||||
if(!isLogin('auth')){
|
||||
if (!isLogin("auth")) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "当前用户未登录是否登录?",
|
||||
confirmText: "确定",
|
||||
cancelText: "取消",
|
||||
confirmColor: Vue.prototype.$mainColor,
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
navigateToLogin()
|
||||
navigateToLogin();
|
||||
} else if (res.cancel) {
|
||||
uni.navigateBack()
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
})
|
||||
return
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户信息并重新添加到缓存里面
|
||||
*/
|
||||
|
@ -137,7 +149,7 @@ export async function userInfo(){
|
|||
let res = await getUserInfo();
|
||||
if (res.data.success) {
|
||||
storage.setUserInfo(res.data.result);
|
||||
return res.data.result
|
||||
return res.data.result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue