功能完善

This commit is contained in:
lzh
2023-02-12 19:08:38 +08:00
parent 9a3693f2c8
commit c6c6e72936
51 changed files with 5015 additions and 3847 deletions

View File

@@ -1,10 +1,10 @@
import store from '../store/index';
export default {
// qq 237524947 wx15d4269d3210863d
//BASEURI: 'http://localhost:8083/api/',
BASEURI: 'http://127.0.0.1:8083/api/',
ADMINURI: 'http://127.0.0.1:8085/',
ESURI: 'http://127.0.0.1:8081/',
BASEURI: 'http://mall.yyundong.com/portalapi/api/',
// BASEURI: 'http://www.yyundong.com:8083/api/',
ADMINURI: 'http://mall.yyundong.com/adminapi/',
ESURI: 'http://www.yyundong.com:8081/',
h5Appid: 'wxb4660f37187c0b8e', // h5微信登录的appId 暂时测试用
source: 1, //1 weixinApplet 2 h5Source 3 pcSource 4 android 5ios
es: {
@@ -52,8 +52,8 @@ export default {
shopDetail: 'single/store/shopDetail', // 门店详情
storeClassList: 'single/store/storeClass/list', // 商户内部分类
storeCommentList: 'single/store/storeComment/list', // 商户评论
noticeList: 'single/home/notice/list',
noticeDetail: 'single/home/notice/detail',
noticeList: 'single/home/notice/list',
noticeDetail: 'single/home/notice/detail',
},
member: {
applyMember: 'single/user/applyMember', // 会员升级等级
@@ -74,9 +74,9 @@ export default {
storeDetail1: 'single/store/detail1', // 商户详情 带用户
store: 'single/store/home', // 商户主页
storeList: 'single/store/store/list', // 商户列表
memberTagList: 'single/user/memberTag/list', // 商户列表
addStoreComment: 'single/store/addStoreComment', // 商户addStoreComment
memberBlanceLogList: 'single/user/memberBlanceLog/list',
memberTagList: 'single/user/memberTag/list', // 商户列表
addStoreComment: 'single/store/addStoreComment', // 商户addStoreComment
memberBlanceLogList: 'single/user/memberBlanceLog/list',
},
build: {
getBuildNoticeByPage: 'single/build/getBuildNoticeByPage', // 所有社区和房间
@@ -93,7 +93,7 @@ export default {
},
goods: {
tagGoodsList: 'single/pms/tag/goods', // 查询标签商品
tagGoodsList: 'single/pms/tag/goods', // 查询标签商品
goodsPromoto: 'single/sms/detail', // 单个商品的优惠详情
secskillDetail: 'single/pms/secskill/detail', // 查询秒杀商品详情信息
groupGoodsDetail: 'single/pms/goodsGroup/detail', // 查询拼团商品详情信息
@@ -258,6 +258,7 @@ export default {
let token = uni.getStorageSync('token') || '';
let fullurl = this.BASEURI + endpoint;
console.log("fullurl",fullurl);
var contentType = 'application/x-www-form-urlencoded';
data.authorization = token;
@@ -272,11 +273,6 @@ export default {
// 'authorization1': Authorization || ''
},
});
console.log('fullurl,',fullurl)
console.log('data,',data)
console.log('token,',token)
console.log('error,',error)
console.log('res,',res)
if (load) {
uni.hideLoading();
}
@@ -311,9 +307,10 @@ export default {
console.log(fullurl);
console.log(res.data.data);
if (res.data.code == 200) {
console.log("===>>>");
return res.data.data;
} else {
console.log(">>>>>=");
if (res.data) {
if (!res.data.msg) {
res.data.msg = res.data.data;

View File

@@ -1,93 +1,190 @@
<template>
<view class="coupon-item">
<view class="coupon-item">
<view class="coupon-money">
<view class="nick" ></view>
<view class="nick">{{item.name}}</view>
<view class="layof" :style="{color:theme}">{{item.amount}}</view>
<view class="end_time">{{item.endTime | formatCreateTime}}前使用</view>
<view >
<view class="demand">{{ item.minPoint }} {{ item.amount }}</view>
<view>
<view class="demand">{{ item.minPoint }} {{ item.amount }}</view>
</view>
</view>
<view class="get-btn" v-if="!types" :style="{color:color, borderColor:color, background:solid}" @click="acceptCoupon(item)" >立即领取</view>
<navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}" :url='item.url' @click="acceptCoupon(item)">立即使用</navigator>
</view>
<view class="get-btn" v-if="!types" :style="{color:color, borderColor:color, background:solid}"
@click="acceptCoupon(item)">立即领取</view>
<navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
:url='item.url' @click="useCoupon(item)">立即使用</navigator>
</view>
</template>
<script>
import Api from '@/common/api';
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import { formatDate } from '@/common/date';
import Api from '@/common/api';
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import {
formatDate
} from '@/common/date';
export default {
components:{
export default {
components: {
},
data() {
return {
},
data() {
return {
types: false
}
},
props: {
item: {
type: Object
},
theme: {
type: String,
default: '#ff9000'
},
solid: {
type: String,
default: '#ffffff'
},
color: {
type: String,
default: '#ff9000'
},
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
},
methods: {
async acceptCoupon(item) {
this.types =!this.types
uni.showLoading({
title: '请稍后'
});
let params = {
couponId: item.id
};
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
console.log(data);
if (data) {
this.$api.msg(data);
}
uni.hideLoading();
},
async useCoupon(item){
uni.showLoading({
title: '请稍后'
});
}
}
},
props:{
item:{
type: Object
},
types:{
type: String,
default: ''
},
theme:{
type: String,
default: '#ff9000'
},
solid:{
type: String,
default: '#ffffff'
},
color:{
type: String,
default: '#ff9000'
},
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
},
methods: {
async acceptCoupon(item){
uni.showLoading({
title: '请稍后'
});
let params = { couponId: item.id };
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
console.log(data);
if (data) {
this.$api.msg(data);
}
uni.hideLoading();
},
}
}
</script>
<style lang='scss'>
.coupon-item {
width:100%; height:auto; display:table; border-radius:10upx; padding:0 20upx; margin-top:22upx; border:1px solid #eeeeee; position:relative;
.coupon-money {
width:465upx; height:auto; display:table; float:left; padding:26upx 0; border-style:none dotted none none; border-color:#eeeeee;
.coupon-item {
width: 100%;
height: auto;
display: table;
border-radius: 10upx;
padding: 0 20upx;
margin-top: 22upx;
border: 1px solid #eeeeee;
position: relative;
.nick { width:100%; height:50upx; line-height:30upx; font-size:$font-sm; color:$font-color-999; }
.tit { width:100%; height:50upx; line-height:50upx; font-size:$font-sm; color:$font-color-999; }
.demand { width:100%; height:30upx; line-height:30upx; font-size:$font-sm; color:$font-color-999; }
.coupon-money {
width: 465upx;
height: auto;
display: table;
float: left;
padding: 26upx 0;
border-style: none dotted none none;
border-color: #eeeeee;
.layof { width:100%; height:48upx; line-height:30upx; font-size:44upx; color:#ff9000; font-weight:bold; }
.end_time { width:100%; height:30upx; line-height:30upx; font-size:$font-sm; color:$font-color-999; }
.nick {
width: 100%;
height: 50upx;
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
}
.tit {
width: 100%;
height: 50upx;
line-height: 50upx;
font-size: $font-sm;
color: $font-color-999;
}
.demand {
width: 100%;
height: 30upx;
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
}
.layof {
width: 100%;
height: 48upx;
line-height: 30upx;
font-size: 44upx;
color: #ff9000;
font-weight: bold;
}
.end_time {
width: 100%;
height: 30upx;
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
}
}
.get-btn {
width: 146upx;
height: 52upx;
line-height: 50upx;
position: absolute;
top: 50%;
right: 26upx;
margin-top: -26upx;
text-align: center;
border-radius: 60upx;
color: #ff9000;
border: 1px solid #ff9000;
font-size: $font-sm;
float: right;
}
}
.coupon-item:after {
width: 40upx;
height: 20upx;
position: absolute;
left: 460upx;
top: -1px;
border-radius: 0 0 40upx 40upx;
content: "";
display: block;
background: $bgcolor_white;
border: 1px solid #eeeeee;
border-top: 0px;
}
.coupon-item:before {
width: 40upx;
height: 20upx;
position: absolute;
left: 460upx;
bottom: -1px;
border-radius: 40upx 40upx 0 0;
content: "";
display: block;
background: $bgcolor_white;
border: 1px solid #eeeeee;
border-bottom: 0px;
}
.get-btn { width:146upx; height:52upx; line-height:50upx; position:absolute; top:50%; right:26upx; margin-top:-26upx; text-align:center; border-radius:60upx; color:#ff9000; border:1px solid #ff9000; font-size:$font-sm; float:right; }
}
.coupon-item:after { width:40upx; height:20upx; position:absolute; left:460upx; top:-1px; border-radius:0 0 40upx 40upx; content:""; display:block; background:$bgcolor_white; border:1px solid #eeeeee; border-top:0px; }
.coupon-item:before { width:40upx; height:20upx; position:absolute; left:460upx; bottom:-1px; border-radius:40upx 40upx 0 0; content:""; display:block; background:$bgcolor_white; border:1px solid #eeeeee; border-bottom:0px; }
</style>

View File

@@ -0,0 +1,71 @@
<template>
<view class="icons" @click.stop="likeTab">
<uni-icons size="20" color="#f07373" :type="like?'heart-filled':'heart'" ></uni-icons>
</view>
</template>
<script>
export default {
props:{
item:{
type:Object,
default(){
return {}
}
},
types:{
type:String,
default:''
}
},
watch:{
item(newVal){
this.like = this.item.is_like
}
},
created() {
this.like = this.item.is_like
},
data() {
return {
like:false
};
},
methods:{
likeTab(){
this.like = !this.like;
this.updateLikes();
},
updateLikes(){
uni.showLoading();
this.$api.update_likes({
user_id:'5f3d11c03d11c60001141e5f',
article_id:this.item._id
}).then(res=>{
uni.hideLoading();
console.log(res);
uni.showToast({
title:this.like?"收藏成功":"取消收藏",
icon:'none'
})
uni.$emit('update_article',this.types)
}).catch(()=>{
uni.hideLoading();
})
}
}
}
</script>
<style lang="scss">
.icons {
position: absolute;
right: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
width: 20px;
height: 20px;
}
</style>

View File

@@ -21,6 +21,10 @@ export default {
<style>
.cpr{
width: 100%;
position: absolute;
bottom: 0;
justify-self: center;
text-align: center;
font-size: 24upx;
margin: 20upx 0;

View File

@@ -5,13 +5,13 @@ if (process.env.NODE_ENV === 'development') {
// baseUrl = "http://localhost:7001/";
// socketUrl = "ws://localhost:8001/";
// baseUrl = "http://26077a35f5.wicp.vip:43609/";
baseUrl = "http://192.168.3.108:8083/";
socketUrl = "ws://192.168.3.108:8083/";
baseUrl = "http://www.yyundong.com:8083/";
socketUrl = "ws://8192.168.43.195:8083/";
} else if (process.env.NODE_ENV === 'production') {
// 生产环境
baseUrl = "http://192.168.3.108:8083/";
baseUrl = "http://www.yyundong.com:8083/";
// baseUrl = "http://192.168.43.195:8083/";
socketUrl = "ws://192.168.3.108:8083/";
socketUrl = "ws://192.168.43.195:8083/";
}
const courtConfig = {
//微信公众号APPID

View File

@@ -1,6 +1,6 @@
{
"name" : "宇运动商城",
"appid" : "__UNI__0802E33",
"name" : "汇融云链",
"appid" : "__UNI__FB2C9C4",
"description" : "",
"versionName" : "4.0.0.0",
"versionCode" : 4000,
@@ -55,7 +55,9 @@
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
]
},
"ios" : {},
"ios" : {
"dSYMs" : false
},
"sdkConfigs" : {
"oauth" : {
"weixin" : {

View File

@@ -2,10 +2,11 @@
"pages": [{
"path": "pages/index/index",
"style": {
// #ifdef MP
"navigationBarTitleText": "mallcloud商城",
"navigationStyle": "custom",
"enablePullDownRefresh": true,
// #ifdef MP
"navigationBarTitleText": "汇融云链",
"navigationStyle": "custom",
// #endif
"app-plus": {
"titleNView": {
@@ -13,7 +14,7 @@
"searchInput": {
"backgroundColor": "rgba(231, 231, 231,.7)",
"borderRadius": "16px",
"placeholder": "请输入地址 如:大钟寺",
"placeholder": "请输入要查询的信息",
"disabled": true,
"placeholderColor": "#606266"
},
@@ -59,7 +60,17 @@
}
}
}
}, {
}, {
"path": "pages/index/lease",
"style": {
"navigationBarTitleText": "农机租赁"
// "app-plus": {
// "titleNView": {
// "type": "transparent"
// }
// }
}
}, {
"path": "pages/order/orderDetail",
"style": {
"navigationBarTitleText": "详情展示",
@@ -80,7 +91,7 @@
}
}
},
{
{
"path": "pages/set/set",
"style": {
"navigationBarTitleText": "设置"
@@ -96,13 +107,13 @@
"path": "pages/index/nearbyBusiness",
"style": {
"navigationBarTitleText": "附近商家"
// #ifdef MP-WEIXIN
,
// #ifdef MP-WEIXIN
,
"navigationStyle": "custom"
// #endif
}
},
{
{
"path": "pages/cart/cart",
"style": {
"navigationBarTitleText": "购物车"
@@ -178,12 +189,12 @@
"style": {
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": true,
"onReachBottomDistance":126 ,//距离底部多远时触发 单位px
"onReachBottomDistance": 126, //距离底部多远时触发 单位px
"app-plus": {
"bounce": "none"
}
}
},{
}, {
"path": "pages/order/createOrder",
"style": {
"navigationBarTitleText": "创建订单"
@@ -209,7 +220,7 @@
"style": {
"navigationBarTitleText": "支付成功"
}
}, {
}, {
"path": "pages/category/category",
"style": {
"navigationBarTitleText": "分类",
@@ -231,7 +242,7 @@
"bounce": "none"
}
}
},
},
{
"path": "pages/order/payment/index",
"style": {
@@ -249,7 +260,7 @@
"style": {
"navigationBarTitleText": "支付结果"
}
}, {
}, {
"path": "pages/integral/home/home",
"style": {
"navigationBarTitleText": "我的积分"
@@ -266,11 +277,9 @@
}
}
],
"subPackages": [
{
"subPackages": [{
"root": "pagesC",
"pages": [
{
"pages": [{
"path": "store/list",
"style": {
"enablePullDownRefresh": true,
@@ -291,7 +300,7 @@
"navigationBarTitleText": "商户入驻"
}
}, {
}, {
"path": "store/businessDetails",
"style": {
"navigationBarTitleText": "店铺详情展示",
@@ -345,12 +354,13 @@
{
"path": "seller/index",
"style": {
"navigationBarTitleText": "卖家中心",
"app-plus": {
"titleNView": {
"type": "transparent"
}
}
"navigationBarTitleText": "卖家中心"
// "navigationStyle": "custom"
// "app-plus": {
// "titleNView": {
// "type": "transparent"
// }
// }
}
},
{
@@ -449,8 +459,7 @@
},
{
"root": "pagesA",
"pages": [
{
"pages": [{
"path": "product/categoryAttr",
"style": {
"navigationBarTitleText": "类型商品",
@@ -475,12 +484,12 @@
{
"path": "product/tag",
"style": {
"navigationBarTitleText": "精选标签",
"app-plus": {
"titleNView": {
"type": "transparent"
}
}
"navigationBarTitleText": "精选标签"
// "app-plus": {
// "titleNView": {
// "type": "transparent"
// }
// }
}
},
{
@@ -570,12 +579,12 @@
"enablePullDownRefresh": true,
"navigationBarTitleText": "商品列表"
}
},
},
{
"path" : "build/repairOrder/repairOrder",
"style" : {
"path": "build/repairOrder/repairOrder",
"style": {
"navigationBarTitleText": "维修录单"
}
},
@@ -597,7 +606,7 @@
}, {
"path": "build/communityList",
"style": {
"navigationBarTitleText": "社区列表"
"navigationBarTitleText": "农村社区列表"
}
},
{
@@ -663,15 +672,15 @@
"path": "user/inviteList",
"style": {
"navigationBarTitleText": "邀请好友"
}
}, {
"path": "user/inviteMoney",
"style": {
"navigationBarTitleText": "邀请好友佣金"
}
},{
}, {
"path": "user/balance",
"style": {
"navigationBarTitleText": "我的钱包"
@@ -724,13 +733,13 @@
"bounce": "none"
}
}
},{
}, {
"path": "user/profile",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "个人信息"
}
},{
}, {
"path": "user/applyMember",
"style": {
"navigationBarTitleText": "升级会员",
@@ -740,12 +749,12 @@
}
}
}
},{
}, {
"path": "notice/notice",
"style": {
"navigationBarTitleText": "通知"
}
},{
}, {
"path": "notice/subjectList",
"style": {
"navigationBarTitleText": "秒杀列表",
@@ -802,12 +811,12 @@
"selectedIconPath": "static/tab-cate-current.png",
"text": "分类"
},
{
"pagePath": "pages/index/nearbyBusiness",
"iconPath": "static/fujin.png",
"selectedIconPath": "static/fujin_.png",
"text": "附近商家"
},
{
"pagePath": "pages/index/nearbyBusiness",
"iconPath": "static/fujin.png",
"selectedIconPath": "static/fujin_.png",
"text": "附近商家"
},
{
"pagePath": "pages/cart/cart",
"iconPath": "static/tab-cart.png",

View File

@@ -8,7 +8,8 @@
<image src="/static/emptyCart.jpg" mode="aspectFit"></image>
<view v-if="hasLogin" class="empty-tips">
空空如也
<navigator class="navigator" v-if="hasLogin" url="../index/index" open-type="switchTab">随便逛逛></navigator>
<navigator class="navigator" v-if="hasLogin" url="../index/index" open-type="switchTab">随便逛逛>
</navigator>
</view>
<view v-else class="empty-tips">
空空如也
@@ -21,21 +22,18 @@
<block v-for="(item, index) in cartList" :key="item.id">
<view class="cart-item" :class="{ 'b-b': index !== cartList.length - 1 }">
<view class="image-wrapper">
<image
:src="item.productPic"
class="loaded"
mode="aspectFill"
lazy-load
@load="onImageLoad('cartList', index)"
@error="onImageError('cartList', index)"
></image>
<view class="yticon icon-xuanzhong2 checkbox" :class="{ checked: item.checked === '1' || item.checked }" @click="check('item', index)"></view>
<image :src="item.productPic" class="loaded" mode="aspectFill" lazy-load
@load="onImageLoad('cartList', index)" @error="onImageError('cartList', index)"></image>
<view class="yticon icon-xuanzhong2 checkbox"
:class="{ checked: item.checked === '1' || item.checked }"
@click="check('item', index)"></view>
</view>
<view class="item-right">
<text class="clamp title">{{ item.productName }}</text>
<text class="attr">{{ item.productAttr }}</text>
<text class="price">¥{{ item.price }}</text>
<uni-number-box class="step" :min="1" :value="item.quantity" :isMin="item.quantity === 1" :index="index" @eventChange="numberChange"></uni-number-box>
<uni-number-box class="step" :min="1" :value="item.quantity" :isMin="item.quantity === 1"
:index="index" @eventChange="numberChange"></uni-number-box>
</view>
<text class="del-btn yticon icon-fork" @click="deleteCartItem(index)"></text>
</view>
@@ -45,7 +43,8 @@
<!-- 底部菜单栏 -->
<view class="action-section">
<view class="checkbox">
<image :src="allChecked ? '/static/selected.png' : '/static/select.png'" mode="aspectFit" @click="check('all')"></image>
<image :src="allChecked ? '/static/selected.png' : '/static/select.png'" mode="aspectFit"
@click="check('all')"></image>
<view class="clear-btn" :class="{ show: allChecked }" @click="clearCart">清空</view>
</view>
<view class="total-box">
@@ -60,360 +59,391 @@
</view>
</view>
<mallplusCopyright></mallplusCopyright>
</view>
</template>
<script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
import { mapState } from 'vuex';
import uniNumberBox from '@/components/uni-number-box.vue';
import navBar from '@/components/zhouWei-navBar';
export default {
components: {
uniNumberBox,
navBar,
mallplusCopyright
},
data() {
return {
total: 0, //总价格
allChecked: false, //全选状态 true|false
empty: false, //空白页现实 true|false
promoteAmount: 0,
cartList: [],
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
import {
mapState
} from 'vuex';
import uniNumberBox from '@/components/uni-number-box.vue';
import navBar from '@/components/zhouWei-navBar';
export default {
components: {
uniNumberBox,
navBar,
mallplusCopyright
},
data() {
return {
total: 0, //总价格
allChecked: false, //全选状态 true|false
empty: false, //空白页现实 true|false
promoteAmount: 0,
cartList: [],
statusBarHeight: ''
};
},
statusBarHeight: ''
};
},
async onShow() {
if (this.hasLogin) {
this.loadData();
}
},
async onLoad() {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
},
watch: {
//显示空白页
cartList(e) {
let empty = e.length === 0 ? true : false;
if (this.empty !== empty) {
this.empty = empty;
async onShow() {
if (this.hasLogin) {
this.loadData();
}
}
},
computed: {
...mapState(['hasLogin', 'userInfo'])
},
methods: {
//请求数据
async loadData() {
let params = {};
let list = await Api.apiCall('get', Api.order.cartList, params);
// let list = await this.$api.json('cartList');
let cartList = list.cartItemList.map(item => {
item.checked = '1';
return item;
});
this.cartList = cartList;
this.promoteAmount = list.promoteAmount;
this.calcTotal(); //计算总价
},
//监听image加载完成
onImageLoad(key, index) {
this.$set(this[key][index], 'loaded', 'loaded');
async onLoad() {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
},
//监听image加载失败
onImageError(key, index) {
this[key][index].image = '/static/errorImage.jpg';
watch: {
//显示空白页
cartList(e) {
let empty = e.length === 0 ? true : false;
if (this.empty !== empty) {
this.empty = empty;
}
}
},
navToLogin() {
uni.navigateTo({
url: '/pages/public/login'
});
computed: {
...mapState(['hasLogin', 'userInfo'])
},
//选中状态处理
check(type, index) {
if (type === 'item') {
this.cartList[index].checked = !this.cartList[index].checked;
} else {
const checked = !this.allChecked;
const list = this.cartList;
list.forEach(item => {
item.checked = checked;
methods: {
//请求数据
async loadData() {
let params = {};
let list = await Api.apiCall('get', Api.order.cartList, params);
// let list = await this.$api.json('cartList');
let cartList = list.cartItemList.map(item => {
item.checked = '1';
return item;
});
this.cartList = cartList;
this.promoteAmount = list.promoteAmount;
this.calcTotal(); //计算总价
},
//监听image加载完成
onImageLoad(key, index) {
this.$set(this[key][index], 'loaded', 'loaded');
},
//监听image加载失败
onImageError(key, index) {
this[key][index].image = '/static/errorImage.jpg';
},
navToLogin() {
uni.navigateTo({
url: '/pages/public/login'
});
},
//选中状态处理
check(type, index) {
if (type === 'item') {
this.cartList[index].checked = !this.cartList[index].checked;
} else {
const checked = !this.allChecked;
const list = this.cartList;
list.forEach(item => {
item.checked = checked;
});
this.allChecked = checked;
}
this.calcTotal(type);
},
//数量
numberChange(data) {
this.cartList[data.index].quantity = data.number;
let params = {
id: this.cartList[data.index].id,
quantity: data.number
};
data = Api.apiCall('get', Api.order.updateQuantity, params);
this.calcTotal();
},
//删除
deleteCartItem(index) {
var that = this;
uni.showModal({
title: '提示',
content: '确定将此商品移出购物车吗',
success: res => {
if (res.confirm) {
let list = that.cartList;
let row = list[index];
let id = row.id;
let params = {
cart_id_list: id
};
Api.apiCall('post', Api.order.deleteCart, params);
that.cartList.splice(index, 1);
that.calcTotal();
uni.hideLoading();
}
},
});
},
//清空
clearCart() {
var that = this;
uni.showModal({
title: '提示',
content: '确定将购物车清空吗',
success: res => {
if (res.confirm) {
let params = {};
Api.apiCall('post', Api.order.clearCart, params);
this.cartList = [];
}
}
});
},
//计算总价
calcTotal() {
let list = this.cartList;
if (list.length === 0) {
this.empty = true;
return;
}
let total = 0;
let checked = true;
list.forEach(item => {
if (item.checked === true || item.checked === '1') {
total += item.price * item.quantity;
} else if (checked === true) {
checked = false;
}
});
total = total - this.promoteAmount;
this.allChecked = checked;
}
this.calcTotal(type);
},
//数量
numberChange(data) {
this.cartList[data.index].quantity = data.number;
let params = { id: this.cartList[data.index].id, quantity: data.number };
data = Api.apiCall('get', Api.order.updateQuantity, params);
this.calcTotal();
},
//删除
deleteCartItem(index) {
var that = this;
uni.showModal({
title: '提示',
content: '确定将此商品移出购物车吗',
success: res => {
if(res.confirm){
let list = that.cartList;
let row = list[index];
let id = row.id;
let params = { cart_id_list: id };
Api.apiCall('post', Api.order.deleteCart, params);
that.cartList.splice(index, 1);
that.calcTotal();
uni.hideLoading();
this.total = Number(total.toFixed(2));
},
//创建订单
createOrder() {
let list = this.cartList;
var ids = '';
list.forEach(item => {
if (item.checked === true || item.checked === '1') {
ids = item.id + ',' + ids;
}
},
});
},
//清空
clearCart() {
var that = this;
uni.showModal({
title: '提示',
content: '确定将购物车清空吗',
success: res => {
if(res.confirm){
let params = {};
Api.apiCall('post', Api.order.clearCart, params);
this.cartList = [];
}
}
});
},
//计算总价
calcTotal() {
let list = this.cartList;
if (list.length === 0) {
this.empty = true;
return;
});
let cartIds = ids.substr(0, ids.length - 1);
let dataJson = {};
dataJson.type = 2;
dataJson.cartIds = cartIds;
let url = '/pages/order/createStoreOrder?dataJson=' + JSON.stringify(dataJson)
uni.navigateTo({
url: url
});
}
let total = 0;
let checked = true;
list.forEach(item => {
if (item.checked === true || item.checked === '1') {
total += item.price * item.quantity;
} else if (checked === true) {
checked = false;
}
});
total = total - this.promoteAmount;
this.allChecked = checked;
this.total = Number(total.toFixed(2));
},
//创建订单
createOrder() {
let list = this.cartList;
var ids = '';
list.forEach(item => {
if (item.checked === true || item.checked === '1') {
ids = item.id + ',' + ids;
}
});
let cartIds = ids.substr(0, ids.length - 1);
let dataJson ={};
dataJson.type=2;
dataJson.cartIds=cartIds;
let url='/pages/order/createStoreOrder?dataJson=' + JSON.stringify(dataJson)
uni.navigateTo({
url: url
});
}
}
};
};
</script>
<style lang="scss">
.container {
padding-bottom: 134upx;
/* 空白页 */
.empty {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100vh;
padding-bottom: 100upx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
background: #fff;
image {
width: 240upx;
height: 160upx;
margin-bottom: 30upx;
}
.empty-tips {
.container {
padding-bottom: 134upx;
/* 空白页 */
.empty {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100vh;
padding-bottom: 100upx;
display: flex;
font-size: $font-sm + 2upx;
color: $font-color-disabled;
.navigator {
color: $uni-color-primary;
margin-left: 16upx;
justify-content: center;
flex-direction: column;
align-items: center;
background: #fff;
image {
width: 240upx;
height: 160upx;
margin-bottom: 30upx;
}
.empty-tips {
display: flex;
font-size: $font-sm + 2upx;
color: $font-color-disabled;
.navigator {
color: $uni-color-primary;
margin-left: 16upx;
}
}
}
}
}
/* 购物车列表项 */
.cart-item {
display: flex;
position: relative;
padding: 30upx 40upx;
.image-wrapper {
width: 230upx;
height: 230upx;
flex-shrink: 0;
position: relative;
image {
border-radius: 8upx;
}
}
.checkbox {
position: absolute;
left: -16upx;
top: -16upx;
z-index: 8;
font-size: 44upx;
line-height: 1;
padding: 4upx;
color: $font-color-disabled;
background: #fff;
border-radius: 50px;
}
.item-right {
/* 购物车列表项 */
.cart-item {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
position: relative;
padding-left: 30upx;
.title,
.price {
font-size: $font-base + 2upx;
color: $font-color-dark;
height: 40upx;
line-height: 40upx;
}
.attr {
font-size: $font-sm + 2upx;
color: $font-color-light;
height: 50upx;
line-height: 50upx;
}
.price {
height: 50upx;
line-height: 50upx;
}
}
.del-btn {
padding: 4upx 10upx;
font-size: 34upx;
height: 50upx;
color: $font-color-light;
}
}
/* 底部栏 */
.action-section {
/* #ifdef H5 */
margin-bottom: 100upx;
/* #endif */
position: fixed;
left: 30upx;
bottom: 30upx;
z-index: 95;
display: flex;
align-items: center;
width: 690upx;
height: 100upx;
padding: 0 30upx;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 0 20upx 0 rgba(0, 0, 0, 0.5);
border-radius: 16upx;
.checkbox {
height: 52upx;
position: relative;
image {
width: 52upx;
height: 100%;
padding: 30upx 40upx;
.image-wrapper {
width: 230upx;
height: 230upx;
flex-shrink: 0;
position: relative;
z-index: 5;
image {
border-radius: 8upx;
}
}
}
.clear-btn {
position: absolute;
left: 26upx;
top: 0;
z-index: 4;
width: 0;
height: 52upx;
line-height: 52upx;
padding-left: 38upx;
font-size: $font-base;
color: #fff;
background: $font-color-disabled;
border-radius: 0 50px 50px 0;
opacity: 0;
transition: 0.2s;
&.show {
opacity: 1;
width: 120upx;
.checkbox {
position: absolute;
left: -16upx;
top: -16upx;
z-index: 8;
font-size: 44upx;
line-height: 1;
padding: 4upx;
color: $font-color-disabled;
background: #fff;
border-radius: 50px;
}
}
.total-box {
flex: 1;
display: flex;
flex-direction: column;
text-align: right;
padding-right: 40upx;
.price {
font-size: $font-lg;
color: $font-color-dark;
.item-right {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
position: relative;
padding-left: 30upx;
.title,
.price {
font-size: $font-base + 2upx;
color: $font-color-dark;
height: 40upx;
line-height: 40upx;
}
.attr {
font-size: $font-sm + 2upx;
color: $font-color-light;
height: 50upx;
line-height: 50upx;
}
.price {
height: 50upx;
line-height: 50upx;
}
}
.coupon {
font-size: $font-sm;
.del-btn {
padding: 4upx 10upx;
font-size: 34upx;
height: 50upx;
color: $font-color-light;
text {
}
}
/* 底部栏 */
.action-section {
/* #ifdef H5 */
margin-bottom: 100upx;
/* #endif */
position: fixed;
left: 30upx;
bottom: 30upx;
z-index: 95;
display: flex;
align-items: center;
width: 690upx;
height: 100upx;
padding: 0 30upx;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 0 20upx 0 rgba(0, 0, 0, 0.5);
border-radius: 16upx;
.checkbox {
height: 52upx;
position: relative;
image {
width: 52upx;
height: 100%;
position: relative;
z-index: 5;
}
}
.clear-btn {
position: absolute;
left: 26upx;
top: 0;
z-index: 4;
width: 0;
height: 52upx;
line-height: 52upx;
padding-left: 38upx;
font-size: $font-base;
color: #fff;
background: $font-color-disabled;
border-radius: 0 50px 50px 0;
opacity: 0;
transition: 0.2s;
&.show {
opacity: 1;
width: 120upx;
}
}
.total-box {
flex: 1;
display: flex;
flex-direction: column;
text-align: right;
padding-right: 40upx;
.price {
font-size: $font-lg;
color: $font-color-dark;
}
.coupon {
font-size: $font-sm;
color: $font-color-light;
text {
color: $font-color-dark;
}
}
}
.confirm-btn {
padding: 0 38upx;
margin: 0;
border-radius: 100px;
height: 76upx;
line-height: 76upx;
font-size: $font-base + 2upx;
background: $uni-color-primary;
box-shadow: 1px 2px 5px rgba(217, 60, 93, 0.72);
}
}
.confirm-btn {
padding: 0 38upx;
margin: 0;
border-radius: 100px;
height: 76upx;
line-height: 76upx;
font-size: $font-base + 2upx;
background: $uni-color-primary;
box-shadow: 1px 2px 5px rgba(217, 60, 93, 0.72);
/* 复选框选中状态 */
.action-section .checkbox.checked,
.cart-item .checkbox.checked {
color: $uni-color-primary;
}
.getPosition {
height: 100upx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32upx;
background-color: #fff;
}
}
/* 复选框选中状态 */
.action-section .checkbox.checked,
.cart-item .checkbox.checked {
color: $uni-color-primary;
}
.getPosition {
height: 100upx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32upx;
background-color: #fff;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,269 @@
<template>
<view class="home">
<view class="home-list">
<view v-for="(item,index) in tableList" :key="item._id" :item="item">
<view @click="open">
<!-- 基础卡片 -->
<view v-if="item.mode==='base'" class="listcard">
<view class="listcard-image">
<image :src="item.cover[0]" mode="aspectFill"></image>
</view>
<view class="listcard-content">
<view class="listcard-content_title">
<text>{{item.title}}</text>
<likes :types="types" :item="item"></likes>
</view>
<view class="listcard-content_des">
<view class="listcard-content_des-label">
<view class="listcard-content_des-label-item">{{item.classify}}</view>
</view>
<view class="listcard-content_des-browe">{{item.browse_count}}浏览</view>
</view>
</view>
</view>
<!-- 多图模式 -->
<view v-if="item.mode==='column'" class="listcard mode-column">
<view class="listcard-content">
<view class="listcard-content_title">
<text>{{item.title}}</text>
<likes :types="types" :item="item"></likes>
</view>
<view class="listcard-image">
<view v-if="index<3" v-for="(item,index) in item.cover" :key="index"
class="listcard-image_item">
<image :src="item" mode="aspectFill"></image>
</view>
</view>
<view class="listcard-content_des">
<view class="listcard-content_des-label">
<view class="listcard-content_des-label-item">{{item.classify}}</view>
</view>
<view class="listcard-content_des-browe">{{item.browse_count}}浏览</view>
</view>
</view>
</view>
<!-- 大图模式 -->
<view v-if="item.mode==='image'" class="listcard mode-image">
<view class="listcard-image">
<image :src="item.cover[0]" mode="aspectFill"></image>
</view>
<view class="listcard-content">
<view class="listcard-content_title">
<text>{{item.title}}</text>
<likes :types="types" :item="item"></likes>
</view>
<view class="listcard-content_des">
<view class="listcard-content_des-label">
<view class="listcard-content_des-label-item">{{item.classify}}</view>
</view>
<view class="listcard-content_des-browe">{{item.browse_count}}浏览</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
types:"",
tableList: [{
_id: 1,
title: "到速度奥昂是大宋到速度奥昂是大宋到速度奥昂是大宋",
mode: 'base',
cover: [
"https://ts1.cn.mm.bing.net/th/id/R-C.df4462fabf18edd07195679a5f8a37e5?rik=FnNvr9jWWjHCVQ&riu=http%3a%2f%2fseopic.699pic.com%2fphoto%2f50059%2f8720.jpg_wh1200.jpg&ehk=ofb4q76uCls2S07aIlc8%2bab3H5zwrmj%2bhqiZ%2fyw3Ghw%3d&risl=&pid=ImgRaw&r=0"
],
classify: 111,
browse_count: 111
},
{
_id: 2,
title: "啊实打实大苏打实打实打算大苏打",
mode: 'column',
cover: [
"https://pic3.zhimg.com/v2-58d652598269710fa67ec8d1c88d8f03_r.jpg?source=1940ef5c",
"https://pic3.zhimg.com/v2-58d652598269710fa67ec8d1c88d8f03_r.jpg?source=1940ef5c",
"https://pic3.zhimg.com/v2-c6ae9c3aff36b9b221258f6a90577902_r.jpg",
"https://pic3.zhimg.com/v2-c6ae9c3aff36b9b221258f6a90577902_r.jpg"
],
classify: 222,
browse_count: 222
},
{
_id: 3,
title: "都是否定的撒撒大撒反对的飒飒的撒范德萨",
mode: 'image',
cover: [
"https://ts1.cn.mm.bing.net/th?id=OIP-C.kJE5c2uL7he1BwdQb3-APAHaNK&w=187&h=333&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2"
],
classify: 333,
browse_count: 333
},
],
};
},
methods: {
open() {
}
}
};
</script>
<style lang="scss">
page {
height: 100%;
display: flex;
}
.home {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
.home-list {
flex: 1;
box-sizing: border-box;
}
}
.listcard {
display: flex;
padding: 15px;
margin: 20px;
border-radius: 5px;
box-shadow: 0 0 5px 1px rgba($color:#000000, $alpha:0.1);
box-sizing: border-box;
.listcard-image {
flex-shrink: 0;
width: 80px;
height: 80px;
border-radius: 8px;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.listcard-content {
display: flex;
flex-direction: column;
padding-left: 10px;
width: 100%;
justify-content: space-between;
.listcard-content_title {
padding-right: 30px;
font-size: 14px;
color: #333;
font-weight: 400;
line-height: 1.2;
position: relative;
text {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.listcard-content_des {
display: flex;
justify-content: space-between;
font-size: 12px;
.listcard-content_des-label {
display: flex;
.listcard-content_des-label-item {
padding: 0 5px;
margin-right: 5px;
border-radius: 15px;
color: #f00;
border: 1px #f00 solid;
}
}
.listcard-content_des-browe {
color: #999;
line-height: 1.5;
}
}
}
&.mode-column {
.list-content {
width: 100%;
padding-left: 0;
}
.listcard-image {
display: flex;
margin-top: 10px;
width: 100%;
height: 80px;
.listcard-image_item {
margin-left: 10px;
width: 100%;
border-radius: 5px;
overflow: hidden;
&:first-child {
margin-left: 0;
}
image {
width: 100%;
height: 100%;
}
}
}
.listcard-content_des {
margin-top: 10px;
}
}
&.mode-image {
flex-direction: column;
.listcard-image {
width: 100%;
height: 100px;
}
.listcard-content {
padding-left: 0;
margin-top: 10px;
.listcard-content_des {
display: flex;
align-items: center;
margin-top: 10px;
}
}
}
}
</style>

View File

@@ -32,7 +32,7 @@
<text class="yticon icon-iLinkapp-"></text>
{{ userDetailInfo.memberLevelName || '开通会员' }}
</view>
<text class="e-m">Mallplus</text>
<text class="e-m">汇融云链</text>
<text class="e-b">升级会员享受更多折扣 一测就上线</text>
</view>
</view>
@@ -144,7 +144,6 @@
<neil-modal :show="inputShow" @close="cancel" title="编辑" @cancel="cancel" @confirm="confirm">
<input v-model="inputContent" style="margin:20upx" placeholder="请输入..." />
</neil-modal>
<mallplusCopyright></mallplusCopyright>
</view>
</template>
<script>

View File

@@ -121,7 +121,7 @@
<view class="coupon-item" v-if="couponList.length > 0" v-for="(item, index) in couponList" :key="index">
<view class="con" @click="selectCoupon(item)">
<view class="left">
<text class="title">{{ item.name }}</text>
<text class="title">{{ item.coupon.name }}</text>
<text class="time">有效期至{{item.coupon.endTime | formatCreateTime}}</text>
</view>
<view class="right">
@@ -270,7 +270,7 @@ import Api from '@/common/api';
if (this.addressData) {
this.addressId = this.addressData.id;
}
console.log("优惠券",data.couponHistoryDetailList);
this.couponList = data.couponHistoryDetailList;
this.memberReceiveAddressList = data.memberReceiveAddressListaddress;
@@ -696,8 +696,6 @@ import Api from '@/common/api';
.mask-content {
width: 100%;
min-height: 30vh;
max-height: 70vh;
background: #f3f3f3;
transform: translateY(100%);
transition: 0.3s;

View File

@@ -36,7 +36,7 @@
<!-- #endif -->
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@
还没有账号?
<text @click="toRegist">马上注册</text>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -33,7 +33,7 @@
已经有账号?
<text @click="toRegist">马上登录</text>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -31,7 +31,7 @@
<text class="cell-more yticon icon-you"></text>
</view>
<view class="list-cell log-out-btn" @click="toLogout"><text class="cell-tit">退出登录</text></view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

File diff suppressed because it is too large Load Diff

View File

@@ -3,454 +3,512 @@
<view class="navbar" :style="{ position: headerPosition, top: headerTop }">
<view class="nav-item" :class="{ current: filterIndex === 0 }" @click="tabClick(0)">综合排序</view>
<view class="nav-item" :class="{ current: filterIndex === 2 }" @click="tabClick(2)">
<!-- <view class="nav-item" :class="{ current: filterIndex === 2 }" @click="tabClick(2)">
<text>楼房</text>
<view class="p-box">
<text :class="{ active: priceOrder === 1 && filterIndex === 2 }" class="yticon icon-shang"></text>
<text :class="{ active: priceOrder === 2 && filterIndex === 2 }" class="yticon icon-shang xia"></text>
</view>
</view>
</view> -->
<text class="cate-item yticon icon-fenlei1" @click="toggleCateMask('show')"></text>
</view>
<!-- 列表显示 -->
<view class="goods-list-vertical" >
<view v-for="(item, index) in goodsList" :key="index" class="goods-item-vertical" @click="navToDetailPage(item)">
<view class="image-wrapper-vertical"><image :src="item.pic" mode="aspectFill"></image></view>
<view class="goods-list-vertical">
<view v-for="(item, index) in goodsList" :key="index" class="goods-item-vertical"
@click="navToDetailPage(item)">
<view class="image-wrapper-vertical">
<image :src="item.pic" mode="aspectFill"></image>
</view>
<view class="goods-list-right">
<view class="goods-right-top">
<text class="">{{ item.name }}</text>
<text class="text1">{{ item.name }}</text>
<text class="text2">地址:卡就哦啊四到哦啊四到哦啊四到哦啊四到哦啊四到哦啊四到哦啊四到哦啊四到四的</text>
<text class="text2">电话:13623307393</text>
</view>
<view class="goods-right-bottom">
<!-- <view class="goods-right-bottom">
<text class="price">均价:{{ item.price }}</text>
<text class="sale" v-if="geohash">距离: {{item.distance.toFixed(4)}}</text>
</view>
</view> -->
</view>
</view>
</view>
<uni-load-more :status="loadingType"></uni-load-more>
</view>
</template>
<script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
export default {
components: {
uniLoadMore
},
data() {
return {
cateMaskState: 0, //分类面板展开状态
headerPosition: 'fixed',
headerTop: '0px',
keyword: '',
loadingType: 'more', //加载更多状态
filterIndex: 0,
cateId: 0, //已选三级分类id
pageNum: 1,
cid: null,
geohash:'',
priceOrder: 0, //1 价格从低到高 2价格从高到低
cateList: [],
goodsList: []
};
},
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
export default {
components: {
uniLoadMore
},
data() {
return {
cateMaskState: 0, //分类面板展开状态
headerPosition: 'fixed',
headerTop: '0px',
keyword: '',
loadingType: 'more', //加载更多状态
filterIndex: 0,
cateId: 0, //已选三级分类id
pageNum: 1,
cid: null,
geohash: '',
priceOrder: 0, //1 价格从低到高 2价格从高到低
cateList: [],
goodsList: []
};
},
onLoad(options) {
// #ifdef H5
this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
// #endif
this.keyword = options.keyword;
this.cateId = options.sid;
//this.loadCateList(options.fid, options.sid);
if(options.geohash){
this.geohash=options.geohash;
this.nearCommunity(options.geohash);
}else{
console.log(options.geohash)
this.loadData();
}
},
onPageScroll(e) {
//兼容iOS端下拉时顶部漂移
if (e.scrollTop >= 0) {
this.headerPosition = 'fixed';
} else {
this.headerPosition = 'absolute';
}
},
//下拉刷新
onPullDownRefresh() {
this.pageNum = this.pageNum + 1;
this.loadData('refresh');
},
//加载更多
onReachBottom() {
this.pageNum = this.pageNum + 1;
this.loadData();
},
methods: {
async nearCommunity(geohash) {
let params = params = { geohash: geohash, pageSize: 10,distance:240 };
let data = await Api.apiCall('get', Api.build.nearCommunityList, params);
if (data) {
this.goodsList = data || [];
onLoad(options) {
// #ifdef H5
this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
// #endif
this.keyword = options.keyword;
this.cateId = options.sid;
//this.loadCateList(options.fid, options.sid);
if (options.geohash) {
this.geohash = options.geohash;
this.nearCommunity(options.geohash);
} else {
console.log(options.geohash)
this.loadData();
}
},
onPageScroll(e) {
//兼容iOS端下拉时顶部漂移
if (e.scrollTop >= 0) {
this.headerPosition = 'fixed';
} else {
this.headerPosition = 'absolute';
}
},
//加载商品 ,带下拉刷新和上滑加载
async loadData(type = 'add', loading) {
//没有更多直接返回
if (type === 'add') {
if (this.loadingType === 'nomore') {
//下拉刷新
onPullDownRefresh() {
this.pageNum = this.pageNum + 1;
this.loadData('refresh');
},
//加载更多
onReachBottom() {
this.pageNum = this.pageNum + 1;
this.loadData();
},
methods: {
async nearCommunity(geohash) {
let params = params = {
geohash: geohash,
pageSize: 10,
distance: 240
};
let data = await Api.apiCall('get', Api.build.nearCommunityList, params);
if (data) {
this.goodsList = data || [];
}
},
//加载商品 ,带下拉刷新和上滑加载
async loadData(type = 'add', loading) {
//没有更多直接返回
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
let params;
if (this.keyword) {
params = {
pageNum: this.pageNum,
keyword: this.keyword
};
} else {
params = {
pageNum: this.pageNum
};
}
let list = await Api.apiCall('get', Api.build.communityList, params);
let goodsList = list.records;
// let goodsList = await this.$api.json('goodsList');
if (type === 'refresh') {
this.goodsList = [];
}
//筛选,测试数据直接前端筛选了
if (this.filterIndex === 1) {
goodsList.sort((a, b) => b.sales - a.sales);
}
if (this.filterIndex === 2) {
goodsList.sort((a, b) => {
if (this.priceOrder == 1) {
return a.counts - b.counts;
}
return b.counts - a.counts;
});
}
this.goodsList = this.goodsList.concat(goodsList);
//判断是否还有下一页有是more 没有是nomore(测试数据判断大于20就没有了)
this.loadingType = this.goodsList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
} else {
uni.stopPullDownRefresh();
}
}
},
//筛选点击
tabClick(index) {
this.pageNum = 1;
if (this.filterIndex === index && index !== 2) {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
let params;
if (this.keyword) {
params = { pageNum: this.pageNum, keyword: this.keyword };
} else {
params = { pageNum: this.pageNum };
}
let list = await Api.apiCall('get', Api.build.communityList, params);
let goodsList = list.records;
// let goodsList = await this.$api.json('goodsList');
if (type === 'refresh') {
this.goodsList = [];
}
//筛选,测试数据直接前端筛选了
if (this.filterIndex === 1) {
goodsList.sort((a, b) => b.sales - a.sales);
}
if (this.filterIndex === 2) {
goodsList.sort((a, b) => {
if (this.priceOrder == 1) {
return a.counts - b.counts;
}
return b.counts - a.counts;
});
}
this.goodsList = this.goodsList.concat(goodsList);
//判断是否还有下一页有是more 没有是nomore(测试数据判断大于20就没有了)
this.loadingType = this.goodsList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
this.filterIndex = index;
if (index === 2) {
this.priceOrder = this.priceOrder === 1 ? 2 : 1;
} else {
uni.stopPullDownRefresh();
this.priceOrder = 0;
}
}
},
//筛选点击
tabClick(index) {
this.pageNum = 1;
if (this.filterIndex === index && index !== 2) {
return;
}
this.filterIndex = index;
if (index === 2) {
this.priceOrder = this.priceOrder === 1 ? 2 : 1;
} else {
this.priceOrder = 0;
}
uni.pageScrollTo({
duration: 300,
scrollTop: 0
});
this.loadData('refresh', 1);
uni.pageScrollTo({
duration: 300,
scrollTop: 0
});
this.loadData('refresh', 1);
},
//显示分类面板
toggleCateMask(type) {
let timer = type === 'show' ? 10 : 300;
let state = type === 'show' ? 1 : 0;
this.cateMaskState = 2;
setTimeout(() => {
this.cateMaskState = state;
}, timer);
},
//分类点击
changeCate(item) {
console.log(item.id);
this.pageNum = 1;
this.cateId = item.id;
this.toggleCateMask();
uni.pageScrollTo({
duration: 300,
scrollTop: 0
});
this.loadData('refresh', 1);
},
//显示分类面板
toggleCateMask(type) {
console.log("type", type);
let timer = type === 'show' ? 10 : 300;
let state = type === 'show' ? 1 : 0;
this.cateMaskState = 2;
setTimeout(() => {
this.cateMaskState = state;
}, timer);
},
//分类点击
changeCate(item) {
console.log(item.id);
this.pageNum = 1;
this.cateId = item.id;
this.toggleCateMask();
uni.pageScrollTo({
duration: 300,
scrollTop: 0
});
this.loadData('refresh', 1);
},
//详情
navToDetailPage(item) {
//测试数据没有写id用title代替
let id = item.id;
uni.navigateTo({
url: `../../pagesA/build/community?communityId=${id}`
});
},
stopPrevent() {}
}
};
},
//详情
navToDetailPage(item) {
//测试数据没有写id用title代替
let id = item.id;
let name = item.name;
uni.navigateTo({
url: `../../pagesA/build/community?communityId=${id}&name=${name}`
});
},
stopPrevent() {}
}
};
</script>
<style lang="scss">
page,
.content {
background: $page-color-base;
}
.content {
padding-top: 96upx;
}
page,
.content {
background: $page-color-base;
}
.navbar {
position: fixed;
left: 0;
top: var(--window-top);
display: flex;
width: 100%;
height: 80upx;
background: #fff;
box-shadow: 0 2upx 10upx rgba(0, 0, 0, 0.06);
z-index: 10;
.nav-item {
flex: 1;
.content {
padding-top: 96upx;
}
.navbar {
position: fixed;
left: 0;
top: var(--window-top);
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 30upx;
color: $font-color-dark;
position: relative;
&.current {
color: $base-color;
width: 100%;
height: 70upx;
background: #fff;
box-shadow: 0 2upx 10upx rgba(0, 0, 0, 0.06);
z-index: 10;
padding-left: 20px;
.nav-item {
flex: 1;
display: flex;
align-items: center;
height: 100%;
font-size: 30upx;
color: $font-color-dark;
position: relative;
&.current {
color: $base-color;
&:after {
content: '';
position: absolute;
left: 9%;
bottom: 0;
transform: translateX(-50%);
width: 120upx;
height: 0;
border-bottom: 4upx solid $base-color;
}
}
}
.p-box {
display: flex;
flex-direction: column;
.yticon {
display: flex;
align-items: center;
justify-content: center;
width: 30upx;
height: 14upx;
line-height: 1;
margin-left: 4upx;
font-size: 26upx;
color: #888;
&.active {
color: $base-color;
}
}
.xia {
transform: scaleY(-1);
}
}
.cate-item {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 80upx;
position: relative;
font-size: 44upx;
&:after {
content: '';
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 120upx;
height: 0;
border-bottom: 4upx solid $base-color;
left: 0;
top: 50%;
transform: translateY(-50%);
border-left: 1px solid #ddd;
width: 0;
height: 36upx;
}
}
}
.p-box {
display: flex;
flex-direction: column;
.yticon {
display: flex;
align-items: center;
justify-content: center;
width: 30upx;
height: 14upx;
line-height: 1;
margin-left: 4upx;
font-size: 26upx;
color: #888;
&.active {
color: $base-color;
}
}
.xia {
transform: scaleY(-1);
}
}
.cate-item {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 80upx;
position: relative;
font-size: 44upx;
&:after {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
border-left: 1px solid #ddd;
width: 0;
height: 36upx;
}
}
}
/* 分类 */
.cate-mask {
position: fixed;
left: 0;
top: var(--window-top);
bottom: 0;
width: 100%;
background: rgba(0, 0, 0, 0);
z-index: 95;
transition: 0.3s;
.cate-content {
width: 630upx;
height: 100%;
background: #fff;
float: right;
transform: translateX(100%);
/* 分类 */
.cate-mask {
position: fixed;
left: 0;
top: var(--window-top);
bottom: 0;
width: 100%;
background: rgba(0, 0, 0, 0);
z-index: 95;
transition: 0.3s;
}
&.none {
display: none;
}
&.show {
background: rgba(0, 0, 0, 0.4);
.cate-content {
transform: translateX(0);
width: 630upx;
height: 100%;
background: #fff;
float: right;
transform: translateX(100%);
transition: 0.3s;
}
&.none {
display: none;
}
&.show {
background: rgba(0, 0, 0, 0.4);
.cate-content {
transform: translateX(0);
}
}
}
}
.cate-list {
display: flex;
flex-direction: column;
height: 100%;
.cate-item {
display: flex;
align-items: center;
height: 90upx;
padding-left: 30upx;
font-size: 28upx;
color: #555;
position: relative;
}
.two {
height: 64upx;
color: #303133;
font-size: 30upx;
background: #f8f8f8;
}
.active {
color: $base-color;
}
}
/* 商品列表 */
.goods-list {
display: flex;
flex-wrap: wrap;
padding: 20upx 20upx 0 20upx;
background: #fff;
.goods-item {
.cate-list {
display: flex;
flex-direction: column;
width: 48%;
padding-bottom: 40upx;
&:nth-child(2n + 1) {
margin-right: 4%;
}
}
.image-wrapper {
width: 100%;
height: 330upx;
border-radius: 3px;
overflow: hidden;
image {
width: 100%;
height: 100%;
opacity: 1;
}
}
.title {
font-size: $font-lg;
color: $font-color-dark;
line-height: 80upx;
}
.price-box {
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10upx;
font-size: 24upx;
color: $font-color-light;
}
.price {
font-size: $font-lg;
color: $uni-color-primary;
line-height: 1;
&:before {
content: '';
font-size: 26upx;
}
}
}
.goods-list-vertical {
display: flex;
flex-wrap: wrap;
padding: 0upx 20upx;
background: #fff;
.goods-item-vertical {
display: flex;
flex-direction: row;
height: 280upx;
align-items: center;
justify-content: center;
border-bottom: 1upx solid #eeeeee;
.image-wrapper-vertical {
width: 240upx;
height: 240upx;
height: 100%;
.cate-item {
display: flex;
align-items: center;
justify-content: center;
margin-right: 10upx;
image {
width: 240upx;
height: 240upx;
height: 90upx;
padding-left: 30upx;
font-size: 28upx;
color: #555;
position: relative;
}
.two {
height: 64upx;
color: #303133;
font-size: 30upx;
background: #f8f8f8;
}
.active {
color: $base-color;
}
}
/* 商品列表 */
.goods-list {
display: flex;
flex-wrap: wrap;
padding: 20upx 20upx 0 20upx;
background: #fff;
.goods-item {
display: flex;
flex-direction: column;
width: 48%;
padding-bottom: 40upx;
&:nth-child(2n + 1) {
margin-right: 4%;
}
}
.goods-list-right {
width: 470upx;
.goods-right-top {
height: 200upx;
text {
font-size: 32upx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.image-wrapper {
width: 100%;
height: 330upx;
border-radius: 3px;
overflow: hidden;
image {
width: 100%;
height: 100%;
opacity: 1;
}
.goods-right-bottom {
}
.title {
font-size: $font-lg;
color: $font-color-dark;
line-height: 80upx;
}
.price-box {
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10upx;
font-size: 24upx;
color: $font-color-light;
}
.price {
font-size: $font-lg;
color: $uni-color-primary;
line-height: 1;
&:before {
content: '';
font-size: 26upx;
}
}
}
.goods-list-vertical {
display: flex;
flex-wrap: wrap;
padding: 0upx 20upx;
background: #fff;
.goods-item-vertical {
display: flex;
flex-direction: row;
height: 200upx;
.image-wrapper-vertical {
width: 200upx;
display: flex;
align-items: center;
justify-content: space-between;
.price {
font-size: $font-lg;
color: $uni-color-primary;
line-height: 1;
&:before {
content: '';
font-size: 26upx;
justify-content: center;
margin-right: 10upx;
image {
width: 150upx;
height: 150upx;
}
}
.goods-list-right {
display: flex;
flex-direction: column;
width: 470upx;
.goods-right-top {
.text1 {
margin-top: 10px;
font-size: 32upx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.text2{
margin-top: 10px;
color: #555;
font-size: 30upx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
.sale {
color: $font-color-light;
font-size: 28upx;
.goods-right-bottom {
display: flex;
align-items: center;
justify-content: space-between;
.price {
font-size: $font-lg;
color: $uni-color-primary;
line-height: 1;
&:before {
content: '';
font-size: 26upx;
}
}
.sale {
color: $font-color-light;
font-size: 28upx;
}
}
}
}
}
}
</style>

View File

@@ -23,11 +23,19 @@ export default {
return {
pageNum: 1,
goodsList: []
goodsList: [
{
id:"25",
createTime :"2020-02-02",
title:"测试标签",
pic:"https://pic3.zhimg.com/v2-c6ae9c3aff36b9b221258f6a90577902_r.jpg",
content:"爱上科技大厦送i的阿松i到速度奥昂是大宋i的"
}
]
};
},
onLoad() {
this.loadData();
// this.loadData();
},
onPageScroll(e) {
//兼容iOS端下拉时顶部漂移

View File

@@ -36,7 +36,7 @@
</scroll-view>
</view>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -23,7 +23,7 @@
</view>
</view>
<uni-load-more :status="loadingType"></uni-load-more>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -36,7 +36,7 @@
</scroll-view>
</view>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -63,7 +63,7 @@
</scroll-view>
</view>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -36,7 +36,7 @@
</scroll-view>
</view>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -500,6 +500,7 @@ export default {
uni.navigateTo({
url
});
return;
}
let userInfo = uni.getStorageSync('userInfo');
if (userInfo && userInfo.storeId && userInfo.storeId == this.goods.storeId) {

View File

@@ -61,7 +61,7 @@
</scroll-view>
</view>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
还没有账号?
<text @click="toRegist">马上注册</text>
</view>
<mallplusCopyright></mallplusCopyright>
<!-- <mallplusCopyright></mallplusCopyright> -->
</view>
</template>

View File

@@ -7,7 +7,7 @@
</view>
<view class="row b-b">
<text class="tit">手机号</text>
<input class="input" type="number" v-model="addressData.phoneNumber" placeholder="收货人手机号码" placeholder-class="placeholder" />
<input class="input" type="number" maxlength="11" v-model="addressData.phoneNumber" placeholder="收货人手机号码" placeholder-class="placeholder" />
</view>
<view class="row b-b">

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB