temp commit

master
学习很差啦 2022-09-14 10:43:40 +08:00
parent 5afc5477a9
commit 8c8522c68e
10 changed files with 677 additions and 523 deletions

View File

@ -0,0 +1,79 @@
<template>
</template>
<script>
export default {
methods: {
//
lightSearchStr(keyword, str) {
if (!keyword) {
return str
} else {
let unicodes = '';
for (let i of Array.from(keyword)) {
unicodes += this.unicode(i) + "|"
}
const rule = '(' + unicodes + ')'
const reg = new RegExp(rule, 'gi');
return str ? str.replace(reg, matchValue =>
`<span style="color:${this.lightColor}">${matchValue}</span>`
) : ''
}
},
// unicode
unicode(str) {
var value = '';
for (var i = 0; i < str.length; i++) {
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
}
return value;
},
left_zero_4(str) {
if (str != null && str != '' && str != 'undefined') {
if (str.length == 2) {
return '00' + str;
}
}
return str;
},
// 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
//
getPromotion(item) {
if (item.promotionMap) {
let array = [];
Object.keys(item.promotionMap).forEach((child) => {
if (!array.includes(child.split("-")[0])) {
array.push(child.split("-")[0]);
}
});
return array;
}
},
//
navigateToDetailPage(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
});
},
//
navigateToStoreDetailPage(item) {
uni.navigateTo({
url: `/pages/product/shopPage?id=${item.content.storeId}`,
});
},
},
}
</script>
<style lang='scss' scoped>
</style>

View File

@ -101,12 +101,15 @@
</template> </template>
<script> <script>
import commonTpl from '@/components/m-goods-list/common'
export default { export default {
data() { data() {
return { return {
lightColor: this.$mainColor lightColor: this.$mainColor
} }
}, },
mixins: [commonTpl],
props: { props: {
// //
res: { res: {
@ -198,13 +201,13 @@
}, },
// //
navigateToDetailPage(item) { navigateToDetailPage(item) {
this.$navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`, url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
}); });
}, },
// //
navigateToStoreDetailPage(item) { navigateToStoreDetailPage(item) {
this.$navigateTo({ uni.navigateTo({
url: `/pages/product/shopPage?id=${item.content.storeId}`, url: `/pages/product/shopPage?id=${item.content.storeId}`,
}); });
}, },

View File

@ -0,0 +1,190 @@
<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

@ -4,8 +4,12 @@
*/ */
// 开发环境 // 开发环境
const dev = { const dev = {
common: "https://common-api.pickmall.cn", // common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn", // buyer: "https://buyer-api.pickmall.cn",
common: "http://192.168.0.106:8890",
buyer: "http://192.168.0.106:8888",
}; };

View File

@ -2,8 +2,8 @@
"name" : "lili商城", "name" : "lili商城",
"appid" : "__UNI__EC9FD60", "appid" : "__UNI__EC9FD60",
"description" : "", "description" : "",
"versionName" : "4.2.6", "versionName" : "4.2.5",
"versionCode" : 4000260, "versionCode" : 4000250,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"compatible" : { "compatible" : {

View File

@ -88,10 +88,10 @@ page {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.wrapper { .wrapper {
background: url("https://lilishop-oss.oss-cn-beijing.aliyuncs.com/aac88f4e8eff452a8010af42c4560b04.png"); background: url("https://lili-system.oss-cn-beijing.aliyuncs.com/kanjia.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
height: 700rpx; height: 600rpx;
width: 100%; width: 100%;
} }
@ -99,7 +99,7 @@ page {
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
position: relative; position: relative;
top: 750rpx; top: 650rpx;
width: 94%; width: 94%;
margin: 0 auto; margin: 0 auto;
> .bargain { > .bargain {

View File

@ -6,8 +6,8 @@
<scroll-view scroll-x> <scroll-view scroll-x>
<view class="index-navs"> <view class="index-navs">
<view class="index-nav-v"> <view class="index-nav-v">
<view class="index-nav" :class="{ 'index-nav-active': nav == index }" @click="clickNavigateTime(index)" <view class="index-nav" :class="{ 'index-nav-active': nav == index }"
v-for="(item, index) in timeLine" :key="index"> @click="clickNavigateTime(index)" v-for="(item, index) in timeLine" :key="index">
{{ item.timeLine }}:00 {{ item.timeLine }}:00
<view class="index-nav-desc">{{ index === 0 && item.distanceStartTime === 0 ? '抢购中' : '即将开始' }} <view class="index-nav-desc">{{ index === 0 && item.distanceStartTime === 0 ? '抢购中' : '即将开始' }}
</view> </view>
@ -20,30 +20,8 @@
</view> </view>
</scroll-view> </scroll-view>
<view class="sale-items" v-if="goodsList.length > 0"> <view class="sale-items" v-if="goodsList.length > 0">
<view class="sale-item" v-for="(item,index) in goodsList" :key="index"> <goodsTemplate :res="goodsList" />
<view class="sale-item-img">
<image :src="item.goodsImage" mode="aspectFill"></image>
</view>
<view class="sale-item-content">
<view class="sale-item-title">
{{ item.goodsName }}
<view class="sale-item-title-desc"></view>
</view>
<view class="sale-item-price">
<text class="sale-item-price-now">¥{{ item.price | unitPrice}}</text>
<text class="sale-item-price-origin"> ¥{{ item.originalPrice | unitPrice }}</text>
</view>
<view class="sale-item-surplus">
仅剩{{ item.quantity - item.salesNum }}
<view class="sale-item-surplus-text"
:style="{ width: (item.quantity / (item.quantity - item.salesNum)) * 100 + '%' }">
</view>
</view>
<view class="sale-item-btn" @click="navigateToGoodsDetail(item)">
{{ timeLine[nav].distanceStartTime === 0 ? (item.salesNum === item.quantity ? '已售空' : '购买') : '即将开始' }}
</view>
</view>
</view>
</view> </view>
<view v-else> <view v-else>
<view class="nodata"> <view class="nodata">
@ -56,9 +34,16 @@
</template> </template>
<script> <script>
import { getSeckillTimeLine, getSeckillTimeGoods } from "@/api/promotions.js"; import {
getSeckillTimeLine,
getSeckillTimeGoods
} from "@/api/promotions.js";
import Foundation from "@/utils/Foundation.js"; import Foundation from "@/utils/Foundation.js";
import goodsTemplate from '@/components/m-goods-list/seckill.vue'
export default { export default {
components: {
goodsTemplate
},
data() { data() {
return { return {
nav: 0, // nav: 0, //
@ -151,7 +136,7 @@ export default {
) { ) {
return; return;
} else { } else {
this.$navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`, url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`,
}); });
} }
@ -208,114 +193,6 @@ export default {
.sale-items { .sale-items {
padding-top: 20rpx; padding-top: 20rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
flex-direction: column;
}
.sale-item {
width: 710rpx;
height: 226rpx;
padding-left: 20rpx;
margin-bottom: 10rpx;
border-radius: 12rpx;
background-color: #fff;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
}
.sale-item-img {
margin-right: 20rpx;
image {
width: 186rpx;
height: 186rpx;
border-radius: 8rpx;
}
}
.sale-item-content {
line-height: 2em;
}
.sale-item-title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: 28rpx;
color: #333;
}
.sale-item-title-desc {
font-size: 22rpx;
color: #999;
}
.sale-item-price {
font-size: 22rpx;
color: 999;
}
.sale-item-price-now {
font-size: 40rpx;
color: #ff5a10;
margin: 0 10rpx;
}
.sale-item-price-origin {
font-size: 20rpx;
color: #999;
-webkit-text-decoration-line: line-through;
text-decoration-line: line-through;
text-decoration: line-through;
}
.sale-item-surplus {
border: 2rpx solid rgb(34, 178, 140);
border-radius: 12px;
width: 166rpx;
color: rgb(31, 177, 138);
font-size: 20rpx;
position: relative;
text-align: center;
z-index: 2;
height: 32rpx;
line-height: 28rpx;
overflow: hidden;
}
.sale-item-surplus-text {
width: 166rpx;
background: rgb(234, 247, 245);
position: absolute;
top: 0;
left: 0;
z-index: -1;
height: 100%;
}
.sale-item-btn {
position: absolute;
right: 20rpx;
bottom: 20rpx;
padding: 0 20rpx;
height: 60rpx;
background-color: #1abc9c;
border-radius: 10rpx;
font-size: 25rpx;
color: #fff;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
} }
.trailer { .trailer {

View File

@ -854,6 +854,7 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
export default function (isPrompt = false) { export default function (isPrompt = false) {
getCurrentNo((version) => { getCurrentNo((version) => {
getServerNo((res) => { getServerNo((res) => {
if (res.versionCode.replace(/\./g, "") <= version.version.replace(/\./g, "")) { if (res.versionCode.replace(/\./g, "") <= version.version.replace(/\./g, "")) {
return false; return false;
} }

BIN
static/buy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -109,63 +109,63 @@ text {
} }
// flex // flex
@for $i from 0 through 12 { // @for $i from 0 through 12 {
.u-flex-#{$i} { // .u-flex-#{$i} {
flex: $i; // flex: $i;
} // }
} // }
// (px)20px // // (px)20px
@for $i from 9 to 20 { // @for $i from 9 to 20 {
.u-font-#{$i} { // .u-font-#{$i} {
font-size: $i + px; // font-size: $i + px;
} // }
} // }
// (rpx)20rpx // // (rpx)20rpx
@for $i from 20 through 40 { // @for $i from 20 through 40 {
.u-font-#{$i} { // .u-font-#{$i} {
font-size: $i + rpx; // font-size: $i + rpx;
} // }
} // }
// 1-80 // // 1-80
@for $i from 0 through 80 { // @for $i from 0 through 80 {
// 5 // // 5
@if $i % 2 == 0 or $i % 5 == 0 { // @if $i % 2 == 0 or $i % 5 == 0 {
// u-margin-30u-m-30 // // u-margin-30u-m-30
.u-margin-#{$i}, .u-m-#{$i} { // .u-margin-#{$i}, .u-m-#{$i} {
margin: $i + rpx!important; // margin: $i + rpx!important;
} // }
// u-padding-30u-p-30 // // u-padding-30u-p-30
.u-padding-#{$i}, .u-p-#{$i} { // .u-padding-#{$i}, .u-p-#{$i} {
padding: $i + rpx!important; // padding: $i + rpx!important;
} // }
@each $short, $long in l left, t top, r right, b bottom { // @each $short, $long in l left, t top, r right, b bottom {
// u-m-l-30 // // u-m-l-30
// // //
.u-m-#{$short}-#{$i} { // .u-m-#{$short}-#{$i} {
margin-#{$long}: $i + rpx!important; // margin-#{$long}: $i + rpx!important;
} // }
// // //
.u-p-#{$short}-#{$i} { // .u-p-#{$short}-#{$i} {
padding-#{$long}: $i + rpx!important; // padding-#{$long}: $i + rpx!important;
} // }
// u-margin-left-30 // // u-margin-left-30
// // //
.u-margin-#{$long}-#{$i} { // .u-margin-#{$long}-#{$i} {
margin-#{$long}: $i + rpx!important; // margin-#{$long}: $i + rpx!important;
} // }
// // //
.u-padding-#{$long}-#{$i} { // .u-padding-#{$long}-#{$i} {
padding-#{$long}: $i + rpx!important; // padding-#{$long}: $i + rpx!important;
} // }
} // }
} // }
} // }