初始项目

This commit is contained in:
liupopo
2023-02-11 12:55:02 +08:00
parent 1748bda84a
commit 0b89e36064
3363 changed files with 506201 additions and 1 deletions

View File

@@ -0,0 +1,333 @@
<template>
<view class="content">
<view class="list-wraper logo-wraper" @click="uplodingImg(1)">
<view class="tit">
<text>点击上传商家logo</text>
</view>
<view class="input-logo" >
<image v-if="!logImg" src="http://mp.emshop.eonfox.com/zrhzstatic/muying/shop.png" mode=""></image>
<image v-else :src="logImg" mode=""></image>
</view>
</view>
<view class="list-wraper">
<view class="tit">
<text>商家名称</text>
</view>
<view class="input-all">
<input class="inpt" type="text" value="" v-model="infor.name" placeholder="请输入商家名称" />
</view>
</view>
<view class="list-wraper">
<view class="tit">
<text>商家QQ</text>
</view>
<view class="input-all">
<input class="inpt" type="text" value="" v-model="infor.contactQq" placeholder="请输入商家QQ" />
</view>
</view>
<view class="list-wraper">
<view class="tit">
<text>商家手机号</text>
</view>
<view class="input-all">
<input class="inpt" type="number" maxlength="11" v-model="infor.supportPhone" value="" placeholder="请输入手机号" />
</view>
</view>
<view class="list-wraper">
<view class="tit">
<text>商家类别</text>
</view>
<view class="input-all">
<radio-group>
<label class="radio" v-for="(item,index) in shopsType" :key='index'><radio value="r1" class="radio" @click="gain(item.type_id)"/>{{item.name}}</label>
</radio-group>
</view>
</view>
<view class="tips" @click="goPage">
<view class="tips_left">
<text>{{addressName}}</text>
</view>
<view class="tips_right">
<image src="../../static/right-arrow.png" ></image>
</view>
</view>
<view class="h-20upx"></view>
<view class="list-wraper ind-wraper">
<view class="tit">
<text>商家介绍</text>
</view>
<view class="input-lg">
<textarea class="lg-text" value="" v-model="infor.description" placeholder="请输入..." />
</view>
</view>
<view class="list-wraper logo-wraper" @click="uplodingImg(2)">
<view class="tit">
<text>点击上传营业执照</text>
</view>
<view class="input-Image">
<image v-if="!BusinessImg" src="http://mp.emshop.eonfox.com/zrhzstatic/muying/yingyezhizhao.png" mode=""></image>
<image v-else :src="BusinessImg" mode=""></image>
</view>
</view>
<view class="btn-box">
<button class="btn" @click="commit()">提交申请</button>
</view>
</view>
</template>
<script>
import lotusAddress from "@/components/Winglau14-lotusAddress/Winglau14-lotusAddress.vue"
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
// #ifdef H5
let jweixin = require('jweixin-module');
// #endif
export default {
components: {
mallplusCopyright
},
data() {
return {
cityPickerValueDefault: [0, 0, 1],
themeColor: '#007AFF',
pickerText: '选择省/市/区',
addressName:'请选择商家地址',
logImg:'',
infor:{},
BusinessImg:'' ,// 营业执照
BusinessImgId:'',
logImgID:'',
shopsType:[
{
id: 1,
name: "服装",
},
{
id: 2,
name: "化妆品",
},
{
id: 3,
name: "家装",
},
{
id: 4,
name: "水果",
},
]
}
},
components: {
},
onLoad(){
},
methods: {
goPage(){
var _this = this
uni.chooseLocation({
success: function (res) {
console.log('res',res)
console.log('位置名称:' + res.name);
_this.addressName=res.address +res.name
_this.infor.addressDetail = res.address +res.name
_this.infor.addressLat=res.latitude
_this.infor.addressLng=res.longitude
console.log('经度:' + res.longitude);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
}
});
},
gain(id){
this.infor.type_id=id
console.log('类别id',this.infor.type_id)
},
// 上传图片
uplodingImg (name) {
this.$otherApi.uploadFiles(res => {
if (res.code == 200) {
console.log(res.data)
if(name==1){
this.logImg = res.data
this.infor.logo=res.data
}else{
this.BusinessImg = res.data
this.infor.supportName=res.data
}
} else {
this.$common.errorToShow(res.msg)
}
})
},
async commit(){
var _this=this
let form = Object.assign({},_this.infor)
let data = await Api.apiCall('post', Api.member.applyStore, form);
console.log(data)
if (data) {
this.$api.msg(`商户入驻成功`);
setTimeout(() => {
let url = '../../pagesC/store/storeResult?id='+data.id;
uni.navigateTo({
url
});
}, 800);
} else {
this.$api.msg(`商户入驻失败`);
}
},
openLocation(){
// #ifdef H5
jweixin.getLocation({
type: 'wgs84',
success: res => {
const latitude = res.latitude;
const longitude = res.longitude;
jweixin.openLocation({
latitude: latitude, // 纬度浮点数范围为90 ~ -90
longitude: longitude, // 经度浮点数范围为180 ~ -180。
name: '位置名', // 位置名
scale: 16, // 地图缩放级别,整形值,范围从1~28。默认为最大
infoUrl:"http://www.baidu.com"
})
},
fail: () => {},
complete: () => {}
});
// #endif
}
}
}
</script>
<style>
page{
background: #F5F5F5;
width: 100%;
height: 100%;
}
.h-20upx{
height: 20upx;
display: flex;
}
.tips{
display: flex;
/* width: calc(100% - 60upx); */
padding: 20upx;
background-color: #FFFFFF;
}
.tips_left{
width: 94%;
font-size: 28upx;
color: #de7d67;
}
.tips_right{
width: 5%;
}
.tips_right image{
width:40upx;
height: 40upx;
}
.btn{
background-color: rgba( 242 155 135);
color: #FFFFFF;
}
.input-logo{
width: 120upx;
height: 120upx;
line-height: 120upx;
text-align: center;
font-size: 27upx;
color: #444444;
}
.input-logo image{
width: 120upx;
height: 120upx;
}
.input-Image{
width: 420upx;
height: 320upx;
line-height: 320upx;
text-align: center;
font-size: 27upx;
border: 1upx #CCCCCC solid;
color: #444444;
}
.input-Image image{
width: 420upx;
height: 320upx;
}
.radio{
font-size: 28upx;
transform:scale(0.7)
}
</style>
<style scoped lang="stylus" ref="stylesheet/stylus">
.content
width 100%
display flex
flex-direction column
color #333333
.list-wraper
position relative
display flex
align-items center
// width calc(100% - 60upx)
padding 20upx
background #FFFFFF
.tit
flex 1.5
text
font-size 28upx
.input-all
flex 4
.inpt
// background red
padding-top 6upx
font-size 28upx
.logo-wraper
.input-all
text-align right
image
width 100upx
height 100upx
.list-wraper::after
position absolute
content ""
width calc(100% - 60upx)
height 2upx
left 30upx
bottom 0
background #CCCCCC
.ind-wraper
flex-direction column
justify-content left
.tit
width 100%
.input-lg
width 100%
padding 20upx 10upx
// background red
.lg-text
font-size 24upx
color #777777
.btn-box
width 690upx;
padding 40upx 30upx
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,365 @@
<template>
<view class="content" style="padding-top: 0upx;">
<!-- #ifdef MP-WEIXIN -->
<view class="subscription-notice" v-if="suTip">
<view>
<image class="icon" src="/static/image/subscription-tip.png" mode=""></image>
<text>订阅消息及时获取订单最新动态</text>
</view>
<view>
<text class="subscription-notice-btn red-price" @click="toSubscription()">消息订阅</text>
<text class="subscription-notice-btn-close" @click="toClose()">×</text>
</view>
</view>
<!-- #endif -->
<jshop :jdata="pageData"></jshop>
<!-- #ifdef H5 || APP-PLUS-NVUE || APP-PLUS -->
<view class="service" @click="showChat()"><image class="icon" src="/static/image/seller-content.png" mode=""></image></view>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<button class="service" hover-class="none" open-type="contact" bindcontact="showChat" :session-from="kefupara">
<image class="icon" src="/static/image/seller-content.png" mode=""></image>
</button>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<contact-button class="service icon" icon="/static/image/seller-content.png" size="80rpx*80rpx" tnt-inst-id="WKPKUZXG" scene="SCE00040186" hover-class="none" />
<!-- #endif -->
<!-- #ifdef MP-TOUTIAO -->
<!-- 头条客服 -->
<!-- #endif -->
<red-bag v-if="redBagShow" @click="handleGet"></red-bag>
</view>
</template>
<script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
import jshop from '@/components/jshop/jshop.vue';
import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
import redBag from '@/components/red-bag/index';
import { goods } from '@/config/mixins.js';
import { goBack } from '@/config/mixins.js';
export default {
mixins: [goods],
components: {
mallplusCopyright,
jshop,
uniCountdown,
redBag
},
data() {
return {
topmenu:{},
imageUrl: '/static/image/share_image.png', //店铺分享图片
pageData: [],
pageTitle: [],
pageCode: 'mobile_home', //页面布局编码
pintuan: [], //拼团列表,
redBagShow: false, //红包
config: '', //配置信息
userInfo: {}, // 用户信息
kefupara: '', //客服传递资料
id:0,
copy: false,
suTipStatus: false,
shareUrl: '/pages/share/jump'
};
},
updated() {
this.copy = true;
},
computed: {
appTitle() {
return this.pageTitle.pageName;
},
// 获取店铺联系人手机号
shopMobile() {
return this.$store.state.config.shop_mobile || 0;
},
suTip() {
return this.suTipStatus;
}
},
onLoad(e) {
this.id=e.id;
this.initData();
if (this.pageTitle.pageName) {
uni.setNavigationBarTitle({
title: this.pageTitle.pageName
});
}
},
onShow() {
// #ifdef MP-WEIXIN
this.userIsSubscription();
// #endif
},
methods: {
//领取红包
handleGet() {},
destroyed() {
window.removeEventListener('scroll', this.handleScroll);
},
goSearch() {
uni.navigateTo({
url: './search'
});
},
// 首页初始化获取数据
async initData() {
let params={type:2,storeId:this.id};
let res = await Api.apiCall('get',Api.index.diyDetail,params);
console.log(res)
let items = JSON.parse(res.datas)
console.log(items.currentTemplate)
items.currentTemplate.forEach((item)=> {
if (item.id == 'topmenu') {
this.topmenu = item;
if (item.data[0] == undefined) {
var linkurl = '';
} else {
var linkurl = item.data[0].linkurl;
core.get('diypage/getInfo', {
dataurl: linkurl
}, function(ret) {
//console.log(ret);
item.data[0].data = ret.goods.list;
});
}
}
if (item.id == 'seckillgroup') {
var data = {};
data.status = item.data.status;
data.endtime = item.data.endtime;
data.starttime = item.data.starttime;
$this.initSeckill(data);
}
});
this.pageData = items.currentTemplate;
this.pageTitle =items.basicOption;
setTimeout(() => {
this.showLoad = false;
}, 600);
//获取首页配置
var _this = this;
if (this.$db.get('userToken')) {
this.$api.userInfo({}, res => {
if (res.status) {
_this.userInfo = res.data;
// #ifdef MP-WEIXIN
//微信小程序打开客服时,传递用户信息
var kefupara = {};
kefupara.nickName = res.data.nickname;
kefupara.tel = res.data.mobile;
_this.kefupara = JSON.stringify(kefupara);
// #endif
}
});
}
// #ifdef MP-WEIXIN
this.userIsSubscription();
// #endif
// this.getShareUrl();
},
//在线客服,只有手机号的,请自己替换为手机号
showChat() {
// #ifdef H5
let _this = this;
window._AIHECONG('ini', {
entId: this.config.ent_id,
button: false,
appearance: {
panelMobile: {
tone: '#FF7159',
sideMargin: 30,
ratio: 'part',
headHeight: 50
}
}
});
//传递客户信息
window._AIHECONG('customer', {
head: _this.userInfo.avatar,
名称: _this.userInfo.nickname,
手机: _this.userInfo.mobile
});
window._AIHECONG('showChat');
// #endif
// 客服页面
// #ifdef APP-PLUS || APP-PLUS-NVUE
this.$common.navigateTo('../customer_service/index');
// #endif
// 头条系客服
// #ifdef MP-TOUTIAO
if (this.shopMobile != 0) {
let _this = this;
tt.makePhoneCall({
phoneNumber: this.shopMobile.toString(),
success(res) {},
fail(res) {}
});
} else {
_this.$common.errorToShow('暂无设置客服电话');
}
// #endif
},
//前往订阅
toSubscription() {
this.$common.navigateTo('/pages/member/setting/subscription/index');
},
//查询用户订阅
userIsSubscription() {
let userToken = this.$db.get('userToken');
if (userToken && userToken != '') {
this.$api.subscriptionIsTip(res => {
if (res.status) {
if (res.data) {
this.suTipStatus = true;
} else {
this.suTipStatus = false;
}
} else {
this.suTipStatus = true;
}
});
} else {
this.suTipStatus = true;
}
},
//关闭订阅
toClose() {
let userToken = this.$db.get('userToken');
if (userToken && userToken != '') {
this.$api.subscriptionCloseTip(res => {
this.suTipStatus = false;
});
} else {
this.suTipStatus = false;
}
},
//获取分享URL
getShareUrl() {
let data = {
client: 2,
url: "/pages/share/jump",
type: 1,
page: 1,
};
let userToken = this.$db.get('userToken');
if (userToken && userToken != '') {
data['token'] = userToken;
}
this.$api.share(data, res => {
this.shareUrl = res.data
});
}
},
onPullDownRefresh() {
this.initData();
uni.stopPullDownRefresh();
},
//分享
onShareAppMessage() {
return {
title: this.$store.state.config.share_title,
// #ifdef MP-ALIPAY
desc: this.$store.state.config.share_desc,
// #endif
imageUrl: this.$store.state.config.share_image,
path: this.shareUrl
};
},
// #ifdef MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
onPageScroll() {
var _this = this;
const query = uni.createSelectorQuery();
query
.select('.content >>> .search')
.boundingClientRect(function(res) {
if (res) {
if (res.top < 0) {
_this.$store.commit('searchFixed', true);
} else {
_this.$store.commit('searchFixed', false);
}
}
})
.exec();
}
//#endif
};
</script>
<style>
.cell-item {
border: none;
}
.cell-ft-text {
font-size: 22upx;
color: #999;
}
.service {
width: 80rpx;
height: 80rpx;
background-color: #fff;
border-radius: 50%;
position: fixed;
right: 30rpx;
bottom: 120rpx;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0 0 10rpx #ccc;
padding: 0;
z-index: 996;
}
.service .icon {
width: 60rpx;
height: 60rpx;
}
.subscription-notice {
background-color: #ffffff;
box-shadow: 0 2rpx 18rpx #eeeeee;
position: relative;
z-index: 99;
height: 66rpx;
line-height: 66rpx;
padding: 0 20rpx;
font-size: 28rpx;
color: #333333;
display: flex;
justify-content: space-between;
align-items: center;
}
.subscription-notice > view {
display: flex;
align-items: center;
}
.subscription-notice .icon {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.subscription-notice-btn {
color: #4285f4;
}
.subscription-notice-btn-close {
color: #888888;
padding-left: 10px;
font-size: 30rpx;
}
</style>

View File

@@ -0,0 +1,279 @@
<template>
<view class="content">
<view class="goods-list">
<view v-for="(item, index) in storeList" :key="index" class="goods-item" @click="navToDetailPage(item)">
<view class="image-wrapper"><image :src="item.logo" mode="aspectFill"></image></view>
<text class="title clamp">{{ item.name }}</text>
</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: {
mallplusCopyright,
uniLoadMore
},
data() {
return {
cateMaskState: 0, //分类面板展开状态
headerPosition: 'fixed',
headerTop: '0px',
keyword: '',
loadingType: 'more', //加载更多状态
filterIndex: 0,
cateId: 0, //已选三级分类id
pageNum: 1,
cid: null,
priceOrder: 0, //1 价格从低到高 2价格从高到低
cateList: [],
storeList: []
};
},
async onLoad(options) {
// #ifdef H5
this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
// #endif
let params = {};
let list = await Api.apiCall('get', Api.member.storeList, params);
console.log(list);
this.storeList = list;
},
onPageScroll(e) {
//兼容iOS端下拉时顶部漂移
if (e.scrollTop >= 0) {
this.headerPosition = 'fixed';
} else {
this.headerPosition = 'absolute';
}
},
methods: {
//显示分类面板
toggleCateMask(type) {
let timer = type === 'show' ? 10 : 300;
let state = type === 'show' ? 1 : 0;
this.cateMaskState = 2;
setTimeout(() => {
this.cateMaskState = state;
}, timer);
},
//分类点击
changeCate(item) {
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: `../../pagesC/store/store?id=${id}`
});
},
stopPrevent() {}
}
};
</script>
<style lang="scss">
page,
.content {
background: $page-color-base;
}
.content {
padding-top: 96upx;
}
.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;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 30upx;
color: $font-color-dark;
position: relative;
&.current {
color: $base-color;
&:after {
content: '';
position: absolute;
left: 50%;
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: 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%);
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: 0 30upx;
background: #fff;
.goods-item {
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;
}
}
}
</style>

View File

@@ -0,0 +1,742 @@
<template>
<view class="container">
<view class="carousel">
<view class="image-wrapper"><image :src="detailData.pic" class="loaded" mode="aspectFill"></image></view>
</view>
<view class="introduce-section">
<text class="title">{{ detailData.name }}</text>
<view class="bot-row">
<text>销量: 6</text>
<text>库存: {{ detailData.stock }}</text>
<text>浏览量: {{ detailData.hit }}</text>
</view>
</view>
<!-- 分享 -->
<view class="share-section" @click="share">
<view class="share-icon">
<text class="yticon icon-xingxing"></text>
</view>
<text class="tit">该商品分享可领49减10红包</text>
<text class="yticon icon-bangzhu1"></text>
<view class="share-btn">
立即分享
<text class="yticon icon-you"></text>
</view>
</view>
<view class="c-list">
<view class="c-row b-b">
<text class="tit">服务</text>
<view class="bz-list con">
<text>7天无理由退换货 ·</text>
<text>假一赔十 ·</text>
</view>
</view>
</view>
<view class="">
<view class="hot-floor" v-if="goodsList.length > 0">
<view v-for="(item, index) in goodsList" :key="index" class="floor-item" @click="navToDetailPage(item)">
<image :src="item.pic" mode="aspectFill"></image>
<text class="title clamp">{{ item.name }}</text>
<text class="price">{{ item.price }}</text>
</view>
</view>
</view>
<!-- 底部操作菜单 -->
<view class="page-bottom">
<navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
<text class="yticon icon-xiatubiao--copy"></text>
<text>首页</text>
</navigator>
<view class="p-b-btn" :class="{ active: favorite }" @click="toFavorite(detailData)">
<text class="yticon icon-shoucang"></text>
<text>收藏</text>
</view>
</view>
<!-- 分享 -->
<share ref="share" :contentHeight="580" :shareList="shareList"></share>
</view>
</template>
<script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
import share from '@/components/share';
import { mapState } from 'vuex';
export default {
components: {
share
},
data() {
return {
specClass: 'none',
specSelected: [],
small: null,
sku: [],
detailData: [],
favorite: true,
shareList: [],
cat_list: [],
desc: `
<div style="width:100%">
<img style="width:100%;display:block;" src="https://gd3.alicdn.com/imgextra/i4/479184430/O1CN01nCpuLc1iaz4bcSN17_!!479184430.jpg_400x400.jpg" />
<img style="width:100%;display:block;" src="https://gd2.alicdn.com/imgextra/i2/479184430/O1CN01gwbN931iaz4TzqzmG_!!479184430.jpg_400x400.jpg" />
<img style="width:100%;display:block;" src="https://gd3.alicdn.com/imgextra/i3/479184430/O1CN018wVjQh1iaz4aupv1A_!!479184430.jpg_400x400.jpg" />
<img style="width:100%;display:block;" src="https://gd4.alicdn.com/imgextra/i4/479184430/O1CN01tWg4Us1iaz4auqelt_!!479184430.jpg_400x400.jpg" />
<img style="width:100%;display:block;" src="https://gd1.alicdn.com/imgextra/i1/479184430/O1CN01Tnm1rU1iaz4aVKcwP_!!479184430.jpg_400x400.jpg" />
</div>
`,
goodsList: []
};
},
async onLoad(ops) {
//接收传值,id里面放的是标题因为测试数据并没写id
let id = ops.id;
if (id) {
this.logining = true;
let params = { id: ops.id };
let data = await Api.apiCall('get', Api.member.schoolDetail, params);
this.logining = false;
if (data) {
let detailData = data;
this.detailData = detailData;
this.goodsList = data.goodsList;
this.loaded = true;
uni.setNavigationBarTitle({
title: detailData.name
});
}
}
this.shareList = await this.$api.json('shareList');
},
computed: {
...mapState(['hasLogin', 'userInfo'])
},
methods: {
//分享
share() {
this.$refs.share.toggleMask();
},
//收藏
toFavorite(item) {
if (!this.hasLogin) {
let url = '/pages/public/login';
uni.navigateTo({
url
});
} else {
this.favorite = !this.favorite;
let params = { objId: item.id, type: 6, name: item.name, meno1: item.pic, meno2: item.price, meno3: item.sale };
Api.apiCall('post', Api.goods.favoriteSave, params);
}
},
//详情页
navToDetailPage(item) {
//测试数据没有写id用title代替
let id = item.id;
uni.navigateTo({
url: `../../pagesA/product/product?id=${id}`
});
},
async jifenPay(item) {
if (!this.hasLogin) {
let url = '/pages/public/login';
uni.navigateTo({
url
});
return false;
}
let id = item.id;
let data;
let params = { goodsId: id };
data = await Api.apiCall('post', Api.order.jifenPay, params);
if (data) {
this.$api.msg(data);
}
},
stopPrevent() {}
}
};
</script>
<style lang="scss">
page {
background: $page-color-base;
padding-bottom: 160upx;
}
.icon-you {
font-size: $font-base + 2upx;
color: #888;
}
.carousel {
height: 722upx;
position: relative;
swiper {
height: 100%;
}
.image-wrapper {
width: 100%;
height: 100%;
}
.swiper-item {
display: flex;
justify-content: center;
align-content: center;
height: 750upx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
/* 分类推荐楼层 */
.hot-floor {
width: 100%;
overflow: hidden;
margin-bottom: 20upx;
.floor-img-box {
width: 100%;
height: 320upx;
position: relative;
&:after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: linear-gradient(rgba(255, 255, 255, 0.06) 30%, #f8f8f8);
}
}
.floor-img {
width: 100%;
height: 100%;
}
.floor-list {
white-space: nowrap;
padding: 20upx;
padding-right: 50upx;
border-radius: 6upx;
margin-top: -140upx;
margin-left: 30upx;
background: #fff;
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
position: relative;
z-index: 1;
}
.scoll-wrapper {
display: flex;
align-items: flex-start;
}
.floor-item {
width: 180upx;
margin-right: 20upx;
font-size: $font-sm + 2upx;
color: $font-color-dark;
line-height: 1.8;
image {
width: 180upx;
height: 180upx;
border-radius: 6upx;
}
.price {
color: $uni-color-primary;
}
}
.more {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
flex-shrink: 0;
width: 180upx;
height: 180upx;
border-radius: 6upx;
background: #f3f3f3;
font-size: $font-base;
color: $font-color-light;
text:first-child {
margin-bottom: 4upx;
}
}
}
/* 标题简介 */
.introduce-section {
background: #fff;
padding: 20upx 30upx;
.title {
font-size: 32upx;
color: $font-color-dark;
height: 50upx;
line-height: 50upx;
}
.price-box {
display: flex;
align-items: baseline;
height: 64upx;
padding: 10upx 0;
font-size: 26upx;
color: $uni-color-primary;
}
.price {
font-size: $font-lg + 2upx;
}
.m-price {
margin: 0 12upx;
color: $font-color-light;
text-decoration: line-through;
}
.coupon-tip {
align-items: center;
padding: 4upx 10upx;
background: $uni-color-primary;
font-size: $font-sm;
color: #fff;
border-radius: 6upx;
line-height: 1;
transform: translateY(-4upx);
}
.bot-row {
display: flex;
align-items: center;
height: 50upx;
font-size: $font-sm;
color: $font-color-light;
text {
flex: 1;
}
}
}
/* 分享 */
.share-section {
display: flex;
align-items: center;
color: $font-color-base;
background: linear-gradient(left, #fdf5f6, #fbebf6);
padding: 12upx 30upx;
.share-icon {
display: flex;
align-items: center;
width: 70upx;
height: 30upx;
line-height: 1;
border: 1px solid $uni-color-primary;
border-radius: 4upx;
position: relative;
overflow: hidden;
font-size: 22upx;
color: $uni-color-primary;
&:after {
content: '';
width: 50upx;
height: 50upx;
border-radius: 50%;
left: -20upx;
top: -12upx;
position: absolute;
background: $uni-color-primary;
}
}
.icon-xingxing {
position: relative;
z-index: 1;
font-size: 24upx;
margin-left: 2upx;
margin-right: 10upx;
color: #fff;
line-height: 1;
}
.tit {
font-size: $font-base;
margin-left: 10upx;
}
.icon-bangzhu1 {
padding: 10upx;
font-size: 30upx;
line-height: 1;
}
.share-btn {
flex: 1;
text-align: right;
font-size: $font-sm;
color: $uni-color-primary;
}
.icon-you {
font-size: $font-sm;
margin-left: 4upx;
color: $uni-color-primary;
}
}
.c-list {
font-size: $font-sm + 2upx;
color: $font-color-base;
background: #fff;
.c-row {
display: flex;
align-items: center;
padding: 20upx 30upx;
position: relative;
}
.tit {
width: 140upx;
}
.con {
flex: 1;
color: $font-color-dark;
.selected-text {
margin-right: 10upx;
}
}
.bz-list {
height: 40upx;
font-size: $font-sm + 2upx;
color: $font-color-dark;
text {
display: inline-block;
margin-right: 30upx;
}
}
.con-list {
flex: 1;
display: flex;
flex-direction: column;
color: $font-color-dark;
line-height: 40upx;
}
.red {
color: $uni-color-primary;
}
}
/* 评价 */
.eva-section {
display: flex;
flex-direction: column;
padding: 20upx 30upx;
background: #fff;
margin-top: 16upx;
.e-header {
display: flex;
align-items: center;
height: 70upx;
font-size: $font-sm + 2upx;
color: $font-color-light;
.tit {
font-size: $font-base + 2upx;
color: $font-color-dark;
margin-right: 4upx;
}
.tip {
flex: 1;
text-align: right;
}
.icon-you {
margin-left: 10upx;
}
}
}
.eva-box {
display: flex;
padding: 20upx 0;
.portrait {
flex-shrink: 0;
width: 80upx;
height: 80upx;
border-radius: 100px;
}
.right {
flex: 1;
display: flex;
flex-direction: column;
font-size: $font-base;
color: $font-color-base;
padding-left: 26upx;
.con {
font-size: $font-base;
color: $font-color-dark;
padding: 20upx 0;
}
.bot {
display: flex;
justify-content: space-between;
font-size: $font-sm;
color: $font-color-light;
}
}
}
/* 详情 */
.detail-desc {
background: #fff;
margin-top: 16upx;
.d-header {
display: flex;
justify-content: center;
align-items: center;
height: 80upx;
font-size: $font-base + 2upx;
color: $font-color-dark;
position: relative;
text {
padding: 0 20upx;
background: #fff;
position: relative;
z-index: 1;
}
&:after {
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%);
width: 300upx;
height: 0;
content: '';
border-bottom: 1px solid #ccc;
}
}
}
/* 规格选择弹窗 */
.attr-content {
padding: 10upx 30upx;
.a-t {
display: flex;
image {
width: 170upx;
height: 170upx;
flex-shrink: 0;
margin-top: -40upx;
border-radius: 8upx;
}
.right {
display: flex;
flex-direction: column;
padding-left: 24upx;
font-size: $font-sm + 2upx;
color: $font-color-base;
line-height: 42upx;
.price {
font-size: $font-lg;
color: $uni-color-primary;
margin-bottom: 10upx;
}
.selected-text {
margin-right: 10upx;
}
}
}
.attr-list {
display: flex;
flex-direction: column;
font-size: $font-base + 2upx;
color: $font-color-base;
padding-top: 30upx;
padding-left: 10upx;
}
.item-list {
padding: 20upx 0 0;
display: flex;
flex-wrap: wrap;
text {
display: flex;
align-items: center;
justify-content: center;
background: #eee;
margin-right: 20upx;
margin-bottom: 20upx;
border-radius: 100upx;
min-width: 60upx;
height: 60upx;
padding: 0 20upx;
font-size: $font-base;
color: $font-color-dark;
}
.selected {
background: #fbebee;
color: $uni-color-primary;
}
}
}
/* 弹出层 */
.popup {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 99;
&.show {
display: block;
.mask {
animation: showPopup 0.2s linear both;
}
.layer {
animation: showLayer 0.2s linear both;
}
}
&.hide {
.mask {
animation: hidePopup 0.2s linear both;
}
.layer {
animation: hideLayer 0.2s linear both;
}
}
&.none {
display: none;
}
.mask {
position: fixed;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
background-color: rgba(0, 0, 0, 0.4);
}
.layer {
position: fixed;
z-index: 99;
bottom: 0;
width: 100%;
min-height: 40vh;
border-radius: 10upx 10upx 0 0;
background-color: #fff;
.btn {
height: 66upx;
line-height: 66upx;
border-radius: 100upx;
background: $uni-color-primary;
font-size: $font-base + 2upx;
color: #fff;
margin: 30upx auto 20upx;
}
}
@keyframes showPopup {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes hidePopup {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes showLayer {
0% {
transform: translateY(120%);
}
100% {
transform: translateY(0%);
}
}
@keyframes hideLayer {
0% {
transform: translateY(0);
}
100% {
transform: translateY(120%);
}
}
}
/* 底部操作菜单 */
.page-bottom {
position: fixed;
left: 30upx;
bottom: 30upx;
z-index: 95;
display: flex;
justify-content: center;
align-items: center;
width: 690upx;
height: 100upx;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 0 20upx 0 rgba(0, 0, 0, 0.5);
border-radius: 16upx;
.p-b-btn {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: $font-sm;
color: $font-color-base;
width: 96upx;
height: 80upx;
.yticon {
font-size: 40upx;
line-height: 48upx;
color: $font-color-light;
}
&.active,
&.active .yticon {
color: $uni-color-primary;
}
.icon-fenxiang2 {
font-size: 42upx;
transform: translateY(-2upx);
}
.icon-shoucang {
font-size: 46upx;
}
}
.action-btn-group {
display: flex;
height: 76upx;
border-radius: 100px;
overflow: hidden;
box-shadow: 0 20upx 40upx -16upx #fa436a;
box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
background: linear-gradient(to right, #ffac30, #fa436a, #f56c6c);
margin-left: 20upx;
position: relative;
&:after {
content: '';
position: absolute;
top: 50%;
right: 50%;
transform: translateY(-50%);
height: 28upx;
width: 0;
border-right: 1px solid rgba(255, 255, 255, 0.5);
}
.action-btn {
display: flex;
align-items: center;
justify-content: center;
width: 180upx;
height: 100%;
font-size: $font-base;
padding: 0;
border-radius: 0;
background: transparent;
}
}
}
</style>

View File

@@ -0,0 +1,386 @@
<template>
<view class="content">
<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)">
<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>
<view class="goods-list">
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)">
<view class="image-wrapper"><image :src="item.pic" mode="aspectFill"></image></view>
<text class="title clamp">{{ item.name }}</text>
</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,
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);
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 loadCateList(fid, sid) {
let params = {};
let list = await Api.apiCall('get', Api.goods.typeGiftList, params);
//let list = await this.$api.json('cateList');
let cateList = list.filter(item => item.pid == null);
cateList.forEach(item => {
let tempList = list.filter(val => val.pid == item.id);
item.child = tempList;
});
this.cateList = cateList;
},
//加载商品 ,带下拉刷新和上滑加载
async loadData(type = 'add', loading) {
//没有更多直接返回
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
let params;
if (this.cateId) {
params = { pageNum: this.pageNum, productCategoryId: this.cateId };
if (this.keyword) {
params = { pageNum: this.pageNum, productCategoryId: this.cateId, keyword: this.keyword };
}
}
if (this.keyword) {
params = { pageNum: this.pageNum, keyword: this.keyword };
} else {
params = { pageNum: this.pageNum };
}
let list = await Api.apiCall('get', Api.member.schoolList, 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.is985 - a.is985);
}
if (this.filterIndex === 2) {
goodsList.sort((a, b) => {
if (this.priceOrder == 1) {
return a.hot - b.hot;
}
return b.price - a.price;
});
}
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.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);
},
//显示分类面板
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);
},
//详情
navToDetailPage(item) {
//测试数据没有写id用title代替
let id = item.id;
uni.navigateTo({
url: `../../pagesC/store/school?id=${id}`
});
},
stopPrevent() {}
}
};
</script>
<style lang="scss">
page,
.content {
background: $page-color-base;
}
.content {
padding-top: 96upx;
}
.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;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 30upx;
color: $font-color-dark;
position: relative;
&.current {
color: $base-color;
&:after {
content: '';
position: absolute;
left: 50%;
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: 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%);
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: 0 30upx;
background: #fff;
.goods-item {
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;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,382 @@
<template>
<view class="content">
<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)">
<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>
<text class="cate-item yticon icon-fenlei1" @click="toggleCateMask('show')"></text>
</view>
<view class="goods-list">
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)">
<view class="image-wrapper"><image :src="item.logo" mode="aspectFill"></image></view>
<text class="title clamp">{{ item.name }}</text>
<view class="price-box">
<text >浏览{{ item.hit }}</text>
<text>收藏 {{item.collect}}</text>
</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: {
mallplusCopyright,
uniLoadMore
},
data() {
return {
cateMaskState: 0, //分类面板展开状态
headerPosition: 'fixed',
headerTop: '0px',
keyword: '',
loadingType: 'more', //加载更多状态
filterIndex: 0,
cateId: 0, //已选三级分类id
pageNum: 1,
cid: null,
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);
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 loadData(type = 'add', loading) {
//没有更多直接返回
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
let params;
if (this.cateId) {
params = { pageNum: this.pageNum, productCategoryId: this.cateId };
if (this.keyword) {
params = { pageNum: this.pageNum, productCategoryId: this.cateId, keyword: this.keyword };
}
}
if (this.keyword) {
params = { pageNum: this.pageNum, keyword: this.keyword };
} else {
params = { pageNum: this.pageNum };
}
let list = await Api.apiCall('get', Api.member.storeList, 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.price - b.price;
}
return b.price - a.price;
});
}
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.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);
},
//显示分类面板
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);
},
//详情
navToDetailPage(item) {
//测试数据没有写id用title代替
let id = item.id;
uni.navigateTo({
url: `../../pagesC/store/store?id=${id}`
});
},
stopPrevent() {}
}
};
</script>
<style lang="scss">
page,
.content {
background: $page-color-base;
}
.content {
padding-top: 96upx;
}
.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;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 30upx;
color: $font-color-dark;
position: relative;
&.current {
color: $base-color;
&:after {
content: '';
position: absolute;
left: 50%;
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: 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%);
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 {
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;
}
}
}
</style>

View File

@@ -0,0 +1,95 @@
<template>
<view class="content">
<text class="success-icon yticon icon-xuanzhong2"></text>
<text class="tit">{{orderInfo.name}}</text>
<view class="result-mid red-price" v-if="orderInfo.status==1">
申请中----
</view>
<view class="result-mid red-price" v-if="orderInfo.status==2">
申请拒绝----
</view>
<view class="btn-group">
<navigator url="/pages/order/order?status=0" open-type="redirect" class="mix-btn">用户中心</navigator>
<navigator url="/pages/index/user" open-type="switchTab" class="mix-btn hollow">返回首页</navigator>
</view>
</view>
</template>
<script>
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api';
export default {
components: {
mallplusCopyright
},
data() {
return {
paymentId: 0,
orderInfo: {}, // 支付单详情
orderId: 0,
status: false
}
},
async onLoad(options) {
console.log(options)
let params = { };
let data = await Api.apiCall('get', Api.member.storeDetail1, params);
console.log(data)
this.orderInfo = data.store;
if (data.member){
uni.setStorageSync('userInfo', data.member);
}
} ,
methods: {
status(time) {
if (time == null || time === '') {
return 'N/A';
}
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss');
}}
};
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.success-icon {
font-size: 160upx;
color: #fa436a;
margin-top: 100upx;
}
.tit {
font-size: 38upx;
color: #303133;
}
.btn-group {
padding-top: 100upx;
}
.mix-btn {
margin-top: 30upx;
display: flex;
align-items: center;
justify-content: center;
width: 600upx;
height: 80upx;
font-size: $font-lg;
color: #fff;
background-color: $base-color;
border-radius: 10upx;
&.hollow {
background: #fff;
color: #303133;
border: 1px solid #ccc;
}
}
</style>