This commit is contained in:
2025-03-12 10:55:40 +08:00
parent ef66c81ca7
commit b8a44a2716
14 changed files with 5483 additions and 4698 deletions

View File

@@ -1,220 +1,236 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view class="about">
<view class="content">
<view class="qrcode">
<image src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/app_download.png" @longtap="save"></image>
<text class="tip">扫码体验uni-app</text>
</view>
<view class="desc">
<text class="code">uni-app</text>
是一个使用 <text class="code">Vue.js</text> 开发跨平台应用的前端框架
</view>
<view class="source">
<view class="title">本示例源码获取方式</view>
<view class="source-list">
<view class="source-cell">
<text space="nbsp">1. </text>
<text>下载 HBuilderX新建 uni-app 项目时选择 <text class="code">Hello uni-app</text> 模板</text>
</view>
<view class="source-cell">
<text space="nbsp">2. </text>
<u-link class="link" :href="'https://github.com/dcloudio/hello-uniapp'" :text="'https://github.com/dcloudio/hello-uniapp'"></u-link>
</view>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<button type="primary" @click="share">分享</button>
<!-- #endif -->
</view>
<!-- #ifdef APP-PLUS -->
<view class="version">
当前版本{{version}}
</view>
<!-- #endif -->
</view>
<view class="about">
<view class="content">
<view class="qrcode">
<image
src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/app_download.png"
@longtap="save"
></image>
<text class="tip">扫码体验uni-app</text>
</view>
<view class="desc">
<text class="code">uni-app</text>
是一个使用 <text class="code">Vue.js</text> 开发跨平台应用的前端框架
</view>
<view class="source">
<view class="title">本示例源码获取方式</view>
<view class="source-list">
<view class="source-cell">
<text space="nbsp">1. </text>
<text
>下载 HBuilderX新建 uni-app 项目时选择
<text class="code">Hello uni-app</text> 模板</text
>
</view>
<view class="source-cell">
<text space="nbsp">2. </text>
<u-link
class="link"
:href="'https://github.com/dcloudio/hello-uniapp'"
:text="'https://github.com/dcloudio/hello-uniapp'"
></u-link>
</view>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<button type="primary" @click="share">分享</button>
<!-- #endif -->
</view>
<!-- #ifdef APP-PLUS -->
<view class="version"> 当前版本{{ version }} </view>
<!-- #endif -->
</view>
</template>
<script>
export default {
data() {
return {
providerList: [],
version: ''
}
},
onLoad() {
// #ifdef APP-PLUS
this.version = plus.runtime.version;
uni.getProvider({
service: 'share',
success: (result) => {
const data = [];
for (let i = 0; i < result.provider.length; i++) {
switch (result.provider[i]) {
case 'weixin':
data.push({
name: '分享到微信好友',
id: 'weixin'
});
data.push({
name: '分享到微信朋友圈',
id: 'weixin',
type: 'WXSceneTimeline'
});
break;
case 'qq':
data.push({
name: '分享到QQ',
id: 'qq'
});
break;
default:
break;
}
}
this.providerList = data;
},
fail: (error) => {
console.log('获取分享通道失败' + JSON.stringify(error));
}
});
// #endif
},
methods: {
// #ifdef APP-PLUS
save() {
uni.showActionSheet({
itemList: ['保存图片到相册'],
success: () => {
plus.gallery.save('https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/app_download.png', function() {
uni.showToast({
title: '保存成功',
icon: 'none'
});
}, function() {
uni.showToast({
title: '保存失败,请重试!',
icon: 'none'
});
});
}
});
},
share(e) {
if (this.providerList.length === 0) {
uni.showModal({
title: '当前环境无分享渠道!',
showCancel: false
});
return;
}
let itemList = this.providerList.map(function(value) {
return value.name;
})
uni.showActionSheet({
itemList: itemList,
success: (res) => {
let provider = this.providerList[res.tapIndex].id;
uni.share({
provider: provider,
scene: this.providerList[res.tapIndex].type && this.providerList[res.tapIndex].type === 'WXSceneTimeline' ?
'WXSceneTimeline' : "WXSceneSession",
type: (provider === "qq") ? 1 : 0,
title: '欢迎体验uni-app',
summary: 'uni-app 是一个使用 Vue.js 开发跨平台应用的前端框架',
imageUrl: 'https://web-assets.dcloud.net.cn/unidoc/zh/8.jpg',
href: "https://m3w.cn/uniapp",
success: (res) => {
console.log("success:" + JSON.stringify(res));
},
fail: (e) => {
uni.showModal({
content: e.errMsg,
showCancel: false
})
}
});
}
})
}
// #endif
}
}
export default {
data() {
return {
providerList: [],
version: "",
};
},
onLoad() {
// #ifdef APP-PLUS
this.version = plus.runtime.version;
uni.getProvider({
service: "share",
success: (result) => {
const data = [];
for (let i = 0; i < result.provider.length; i++) {
switch (result.provider[i]) {
case "weixin":
data.push({
name: "分享到微信好友",
id: "weixin",
});
data.push({
name: "分享到微信朋友圈",
id: "weixin",
type: "WXSceneTimeline",
});
break;
case "qq":
data.push({
name: "分享到QQ",
id: "qq",
});
break;
default:
break;
}
}
this.providerList = data;
},
fail: (error) => {
console.log("获取分享通道失败" + JSON.stringify(error));
},
});
// #endif
},
methods: {
// #ifdef APP-PLUS
save() {
uni.showActionSheet({
itemList: ["保存图片到相册"],
success: () => {
plus.gallery.save(
"https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/app_download.png",
function () {
uni.showToast({
title: "保存成功",
icon: "none",
});
},
function () {
uni.showToast({
title: "保存失败,请重试!",
icon: "none",
});
}
);
},
});
},
share(e) {
if (this.providerList.length === 0) {
uni.showModal({
title: "当前环境无分享渠道!",
showCancel: false,
});
return;
}
let itemList = this.providerList.map(function (value) {
return value.name;
});
uni.showActionSheet({
itemList: itemList,
success: (res) => {
let provider = this.providerList[res.tapIndex].id;
uni.share({
provider: provider,
scene:
this.providerList[res.tapIndex].type &&
this.providerList[res.tapIndex].type === "WXSceneTimeline"
? "WXSceneTimeline"
: "WXSceneSession",
type: provider === "qq" ? 1 : 0,
title: "欢迎体验uni-app",
summary: "uni-app 是一个使用 Vue.js 开发跨平台应用的前端框架",
imageUrl: "https://web-assets.dcloud.net.cn/unidoc/zh/8.jpg",
href: "https://m3w.cn/uniapp",
success: (res) => {
console.log("success:" + JSON.stringify(res));
},
fail: (e) => {
uni.showModal({
content: e.errMsg,
showCancel: false,
});
},
});
},
});
},
// #endif
},
};
</script>
<style>
page,
view {
display: flex;
}
page,
view {
display: flex;
}
page {
min-height: 100%;
background-color: #FFFFFF;
}
page {
min-height: 100%;
background-color: #ffffff;
}
image {
width: 360rpx;
height: 360rpx;
}
image {
width: 360rpx;
height: 360rpx;
}
.about {
flex-direction: column;
flex: 1;
}
.about {
flex-direction: column;
flex: 1;
}
.content {
flex: 1;
padding: 30rpx;
flex-direction: column;
justify-content: center;
}
.content {
flex: 1;
padding: 30rpx;
flex-direction: column;
justify-content: center;
}
.qrcode {
display: flex;
align-items: center;
flex-direction: column;
}
.qrcode {
display: flex;
align-items: center;
flex-direction: column;
}
.qrcode .tip {
margin-top: 20rpx;
}
.qrcode .tip {
margin-top: 20rpx;
}
.desc {
margin-top: 30rpx;
display: block;
}
.desc {
margin-top: 30rpx;
display: block;
}
.code {
color: #e96900;
background-color: #f8f8f8;
}
.code {
color: #e96900;
background-color: #f8f8f8;
}
button {
width: 100%;
margin-top: 40rpx;
}
button {
width: 100%;
margin-top: 40rpx;
}
.version {
height: 80rpx;
line-height: 80rpx;
justify-content: center;
color: #ccc;
}
.version {
height: 80rpx;
line-height: 80rpx;
justify-content: center;
color: #ccc;
}
.source {
margin-top: 30rpx;
flex-direction: column;
}
.source {
margin-top: 30rpx;
flex-direction: column;
}
.source-list {
flex-direction: column;
}
.source-list {
flex-direction: column;
}
.link {
color: #007AFF;
}
.link {
color: #007aff;
}
</style>

View File

@@ -1,90 +1,88 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view class=" commonPage commonPageBox bg" @click="navigateTo">
<view class="">{{ content }}</view>
<public-module></public-module>
<!-- <z-nav-bar title="设置" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar> -->
<view class="commonPage commonPageBox bg" @click="navigateTo">
<view class="">{{ content }}</view>
<public-module></public-module>
<!-- <z-nav-bar title="设置" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar> -->
<view class="contentBox commonPageContentBox"></view>
<!-- 右上角跳过按钮 -->
<!-- <view class="passbtn" @click.stop="launchApp">跳过</view> -->
</view>
<view class="contentBox commonPageContentBox"></view>
<!-- 右上角跳过按钮 -->
<!-- <view class="passbtn" @click.stop="launchApp">跳过</view> -->
</view>
</template>
<script>
export default {
data() {
return {
content: '',
totalTime: 10,
clock: null
};
},
onLoad() {
this.getData()
},
onHide() {
clearInterval(this.clock);
},
methods: {
navigateTo() {
// clearInterval(this.clock);
},
getData() {
this.clock = setInterval(() => {
this.totalTime--;
this.content = this.totalTime + 's后跳转';
// if (this.totalTime == 0) {
// this.launchApp()
// }
}, 1000);
console.log(this.clock);
},
launchApp() {
//跳过引导页,储存本地值,下次进入直接跳过
// clearInterval(this.clock);
// this.$mRouter.push('/pages/index/index')
uni.switchTab({
url: "/pages/homePage/index/index",
success: function() {
let page = getCurrentPages()[0];
console.log(page);
page.$vm.requestAll();
},
});
}
}
}
export default {
data() {
return {
content: "",
totalTime: 10,
clock: null,
};
},
onLoad() {
this.getData();
},
onHide() {
clearInterval(this.clock);
},
methods: {
navigateTo() {
// clearInterval(this.clock);
},
getData() {
this.clock = setInterval(() => {
this.totalTime--;
this.content = this.totalTime + "s后跳转";
// if (this.totalTime == 0) {
// this.launchApp()
// }
}, 1000);
console.log(this.clock);
},
launchApp() {
//跳过引导页,储存本地值,下次进入直接跳过
// clearInterval(this.clock);
// this.$mRouter.push('/pages/index/index')
uni.switchTab({
url: "/pages/homePage/index/index",
success: function () {
let page = getCurrentPages()[0];
console.log(page);
page.$vm.requestAll();
},
});
},
},
};
</script>
<style scoped lang="scss">
@import "@/static/customicons.css";
@import "@/style/common.scss";
@import "@/static/customicons.css";
@import "@/style/common.scss";
.bg {
}
.bg {}
// .passbtn {
// width: 130rpx;
// height: 60rpx;
// line-height: 60rpx;
// position: fixed;
// z-index: 999;
// bottom: 50rpx;
// right: 50rpx;
// color: #838892;
// text-align: center;
// border-width: 1rpx;
// border-color: rgba(0, 0, 0, 0.5);
// border-style: solid;
// border-radius: 30rpx;
// font-size: 28rpx;
// padding-left: 25rpx;
// padding-right: 25rpx;
// }
</style>
// .passbtn {
// width: 130rpx;
// height: 60rpx;
// line-height: 60rpx;
// position: fixed;
// z-index: 999;
// bottom: 50rpx;
// right: 50rpx;
// color: #838892;
// text-align: center;
// border-width: 1rpx;
// border-color: rgba(0, 0, 0, 0.5);
// border-style: solid;
// border-radius: 30rpx;
// font-size: 28rpx;
// padding-left: 25rpx;
// padding-right: 25rpx;
// }
</style>

View File

@@ -1,12 +1,13 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view class="container">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="说明" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar>
<!-- <view
<view class="container">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="说明" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar>
<!-- <view
class="contentBox"
v-if="prescriptDetail.content && prescriptDetail.type == 0"
>
@@ -18,128 +19,121 @@
</view>
</view> -->
<view class="fullscreen-webview">
<web-view :src="urlPath"> </web-view>
</view>
</view>
<view class="fullscreen-webview">
<web-view :src="urlPath"> </web-view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
playData: {},
urlPath: '',
title: '',
id: null,
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 500,
};
},
onLoad(options) {
if (options.type == 1) {
this.urlPath = 'https://zmzm.taihumed.com/agreement.html'
this.title = '用户协议'
} else if (options.type == 2) {
this.urlPath = 'https://zmzm.taihumed.com/privacy.html'
this.title = '隐私策略'
}
},
onShow() {
},
methods: {
// 放大图片
previewImage(url) {
console.log(url);
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function(res) {
// console.log(res,'+++++')
},
},
});
},
// 方剂详情
},
};
export default {
data() {
return {
playData: {},
urlPath: "",
title: "",
id: null,
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 500,
};
},
onLoad(options) {
if (options.type == 1) {
this.urlPath = "https://zmzm.taihumed.com/agreement.html";
this.title = "用户协议";
} else if (options.type == 2) {
this.urlPath = "https://zmzm.taihumed.com/privacy.html";
this.title = "隐私策略";
}
},
onShow() {},
methods: {
// 放大图片
previewImage(url) {
console.log(url);
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function (res) {
// console.log(res,'+++++')
},
},
});
},
// 方剂详情
},
};
</script>
<style lang="scss" scoped>
.contentBox {
padding-bottom: 20rpx;
}
.contentBox {
padding-bottom: 20rpx;
}
.contentBoxwebwiew {
height: 100%;
// .webwiew{
// height: 100%;
// }
}
.contentBoxwebwiew {
height: 100%;
// .webwiew{
// height: 100%;
// }
}
.fullscreen-webview {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.fullscreen-webview {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.mb-10 {
margin-bottom: 10px;
}
.mb-10 {
margin-bottom: 10px;
}
.content {
font-size: 28rpx;
}
.content {
font-size: 28rpx;
}
.swiper-item {
image {
margin: 0 auto;
height: 250rpx;
}
}
.swiper-item {
image {
margin: 0 auto;
height: 250rpx;
}
}
.uni-margin-wrap {
margin-bottom: 20rpx;
padding-top: 20rpx;
background-color: #fff;
}
.uni-margin-wrap {
margin-bottom: 20rpx;
padding-top: 20rpx;
background-color: #fff;
}
.container {
padding: 10rpx;
.container {
padding: 10rpx;
// background-color: #fff;
.item {
// color: #666;
padding: 10rpx 20rpx;
padding-bottom: 20rpx;
line-height: 46rpx;
}
// background-color: #fff;
.item {
// color: #666;
padding: 10rpx 20rpx;
padding-bottom: 20rpx;
line-height: 46rpx;
}
.title-center {
text-align: center;
font-size: 32rpx;
font-weight: 700 !important;
}
}
.title-center {
text-align: center;
font-size: 32rpx;
font-weight: 700 !important;
}
}
.flexbox {
display: flex;
}
.flexbox {
display: flex;
}
/deep/ .uni-section-header__decoration.line {
background-color: #18bc37;
}
</style>
/deep/ .uni-section-header__decoration.line {
background-color: #18bc37;
}
</style>

View File

@@ -1,7 +1,8 @@
<template><page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view v-if="show">
<swiper
class="guide_pages_swiper"
@@ -131,86 +132,81 @@
</template>
<script>
import {
mapState,
mapMutations
} from "vuex";
import { mapState, mapMutations } from "vuex";
export default {
data() {
return {
title:"融儒、医、美、文为一体",
data() {
return {
title: "融儒、医、美、文为一体",
// title:"融儒、释、道、医、美、文为一体",
screenHeight: 667,
show: false,
protocolShow: false,
DisagreeProtocolShow: false,
};
},
onReady() {
// this.show = false;
screenHeight: 667,
show: false,
protocolShow: false,
DisagreeProtocolShow: false,
};
},
onReady() {
// this.show = false;
if (uni.getStorageSync("guidePages") != 2) {
let systemInfo = uni.getSystemInfoSync();
this.screenHeight = systemInfo.screenHeight;
this.show = true;
// this.protocolShow = true;
}
if (uni.getStorageSync("guidePages") != 2) {
let systemInfo = uni.getSystemInfoSync();
this.screenHeight = systemInfo.screenHeight;
this.show = true;
// this.protocolShow = true;
}
// else {
// uni.switchTab({
// // url: "/pages/advertisement/index/index",
// url: "/pages/homePage/index/index",
// success: function() {
// let page = getCurrentPages()[0];
// console.log(page);
// page.$vm.requestAll();
// },
// });
// }
},
methods: {
openDetail(type) {
console.log('type at line 152:', type)
uni.navigateTo({
url: "/pages/advertisement/index/detail?type=" + type,
});
},
quit() {
if (uni.getSystemInfoSync().platform === "ios") {
plus.runtime.launchApplication({
action: "QUIT"
});
} else {
plus.runtime.quit();
}
},
onSee() {
this.protocolShow = true;
this.DisagreeProtocolShow = false;
},
onDisagree() {
this.protocolShow = false;
this.DisagreeProtocolShow = true;
},
close() {
this.protocolShow = false;
},
onClose() {
uni.setStorageSync("guidePages", 2);
this.show = false;
this.protocolShow = false;
uni.redirectTo({
url: "/pages/user/login/login",
});
},
},
// else {
// uni.switchTab({
// // url: "/pages/advertisement/index/index",
// url: "/pages/homePage/index/index",
// success: function() {
// let page = getCurrentPages()[0];
// console.log(page);
// page.$vm.requestAll();
// },
// });
// }
},
methods: {
openDetail(type) {
console.log("type at line 152:", type);
uni.navigateTo({
url: "/pages/advertisement/index/detail?type=" + type,
});
},
quit() {
if (uni.getSystemInfoSync().platform === "ios") {
plus.runtime.launchApplication({
action: "QUIT",
});
} else {
plus.runtime.quit();
}
},
onSee() {
this.protocolShow = true;
this.DisagreeProtocolShow = false;
},
onDisagree() {
this.protocolShow = false;
this.DisagreeProtocolShow = true;
},
close() {
this.protocolShow = false;
},
onClose() {
uni.setStorageSync("guidePages", 2);
this.show = false;
this.protocolShow = false;
uni.redirectTo({
url: "/pages/user/login/login",
});
},
},
};
</script>
<style lang="scss">
@import '@/style/mixin.scss';
@import "@/style/mixin.scss";
.guide_pages_swiper {
position: fixed;
top: 0;

View File

@@ -1,90 +1,88 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view class=" commonPage commonPageBox bg" @click="navigateTo">
<view class="">{{ content }}</view>
<public-module></public-module>
<!-- <z-nav-bar title="设置" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar> -->
<view class="commonPage commonPageBox bg" @click="navigateTo">
<view class="">{{ content }}</view>
<public-module></public-module>
<!-- <z-nav-bar title="设置" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar> -->
<view class="contentBox commonPageContentBox"></view>
<!-- 右上角跳过按钮 -->
<!-- <view class="passbtn" @click.stop="launchApp">跳过</view> -->
</view>
<view class="contentBox commonPageContentBox"></view>
<!-- 右上角跳过按钮 -->
<!-- <view class="passbtn" @click.stop="launchApp">跳过</view> -->
</view>
</template>
<script>
export default {
data() {
return {
content: '',
totalTime: 10,
clock: null
};
},
onLoad() {
this.getData()
},
onHide() {
clearInterval(this.clock);
},
methods: {
navigateTo() {
// clearInterval(this.clock);
},
getData() {
this.clock = setInterval(() => {
this.totalTime--;
this.content = this.totalTime + 's后跳转';
// if (this.totalTime == 0) {
// this.launchApp()
// }
}, 1000);
console.log(this.clock);
},
launchApp() {
//跳过引导页,储存本地值,下次进入直接跳过
// clearInterval(this.clock);
// this.$mRouter.push('/pages/index/index')
uni.switchTab({
url: "/pages/homePage/index/index",
success: function() {
let page = getCurrentPages()[0];
console.log(page);
page.$vm.requestAll();
},
});
}
}
}
export default {
data() {
return {
content: "",
totalTime: 10,
clock: null,
};
},
onLoad() {
this.getData();
},
onHide() {
clearInterval(this.clock);
},
methods: {
navigateTo() {
// clearInterval(this.clock);
},
getData() {
this.clock = setInterval(() => {
this.totalTime--;
this.content = this.totalTime + "s后跳转";
// if (this.totalTime == 0) {
// this.launchApp()
// }
}, 1000);
console.log(this.clock);
},
launchApp() {
//跳过引导页,储存本地值,下次进入直接跳过
// clearInterval(this.clock);
// this.$mRouter.push('/pages/index/index')
uni.switchTab({
url: "/pages/homePage/index/index",
success: function () {
let page = getCurrentPages()[0];
console.log(page);
page.$vm.requestAll();
},
});
},
},
};
</script>
<style scoped lang="scss">
@import "@/static/customicons.css";
@import "@/style/common.scss";
@import "@/static/customicons.css";
@import "@/style/common.scss";
.bg {
}
.bg {}
// .passbtn {
// width: 130rpx;
// height: 60rpx;
// line-height: 60rpx;
// position: fixed;
// z-index: 999;
// bottom: 50rpx;
// right: 50rpx;
// color: #838892;
// text-align: center;
// border-width: 1rpx;
// border-color: rgba(0, 0, 0, 0.5);
// border-style: solid;
// border-radius: 30rpx;
// font-size: 28rpx;
// padding-left: 25rpx;
// padding-right: 25rpx;
// }
</style>
// .passbtn {
// width: 130rpx;
// height: 60rpx;
// line-height: 60rpx;
// position: fixed;
// z-index: 999;
// bottom: 50rpx;
// right: 50rpx;
// color: #838892;
// text-align: center;
// border-width: 1rpx;
// border-color: rgba(0, 0, 0, 0.5);
// border-style: solid;
// border-radius: 30rpx;
// font-size: 28rpx;
// padding-left: 25rpx;
// padding-right: 25rpx;
// }
</style>

View File

@@ -1,403 +1,414 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view class="">
<view class="shopHeader">
<!-- 顶部导航栏 -->
<z-nav-bar title="健康超市"></z-nav-bar>
<!-- 搜索 -->
<!-- <view class="search" @click="goSearch()">
<view class="">
<view class="shopHeader">
<!-- 顶部导航栏 -->
<z-nav-bar title="健康超市"></z-nav-bar>
<!-- 搜索 -->
<!-- <view class="search" @click="goSearch()">
<u-search placeholder="请输入需4545要的商品" v-model="keyword" :show-action="false"></u-search>
</view> -->
</view>
<!-- 主盒子 -->
<view class="indexBox">
<!-- 轮播图 -->
<view class="swiper_box">
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
<swiper-item v-for="(item,index) in swiperlist" :key="index">
<view class="swiper-item">
<image :src="item.image" mode="widthFix " class="swiperImg"></image>
</view>
</swiper-item>
</swiper>
</view>
<!-- 分类 -->
<view class="head_line">
<b></b>
<text>商品分类</text>
</view>
<view class="classfy">
<view v-for="(item,index) in gridArr" :key="index" @click='toClassify(item.catId,index)'>
<!-- <u-icon v-if="item.icon" :name="item.icon" :size="46"></u-icon> -->
<image :src="item.icon"></image>
<text class="grid-text">{{item.name}}</text>
</view>
<br clear="both">
</view>
<!-- 商品展示 -->
<view class="head_line">
<b></b>
<text>限时秒杀</text>
<i @click="onShopMore('Sale')">查看更多 ></i>
</view>
<!-- 限时秒杀 -->
<view class="limited">
<view class="limitedSymbol">
<image src="../../static/icon/shopping_xsh.png"></image>
</view>
<view class="limitedScrollBox">
<u-scroll-list indicatorActiveColor="#27b386">
<view class="limitedItem" v-for="(item,index) in seckillList" :key="index"
@click="goDetail(item.prodInfo.productId)">
<image :src="item.prodInfo.productImages" mode=""></image>
<text class="biaoti">{{item.prodInfo.productName}}</text>
<text class="xian">{{item.seckillPrice}}</text>
<text class="yuan">{{item.prodInfo.price}}</text>
</view>
</u-scroll-list>
</view>
</view>
<!-- 商品展示 -->
<view class="head_line">
<b></b>
<text>精选商品</text>
<i @click="onShopMore('Hot')">查看更多 ></i>
</view>
<view class="goods">
<view class="goodsItem" v-for="(item,index) in goodsList" :key="item.productId"
@click="goDetail(item.productId)">
<image :src="item.productImages" mode="" class="goodsImg"></image>
<view class="goodsContent">
<view class="goodsName">
{{item.productName}}
</view>
<view class="goodsPrice">
{{item.price}}
</view>
</view>
</view>
<br clear="both">
</view>
<view style="height: 30rpx;"></view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<music-play :playData="playData"></music-play>
</view>
</view>
</view>
<!-- 主盒子 -->
<view class="indexBox">
<!-- 轮播图 -->
<view class="swiper_box">
<swiper
:indicator-dots="true"
:autoplay="true"
:interval="3000"
:duration="1000"
>
<swiper-item v-for="(item, index) in swiperlist" :key="index">
<view class="swiper-item">
<image
:src="item.image"
mode="widthFix "
class="swiperImg"
></image>
</view>
</swiper-item>
</swiper>
</view>
<!-- 分类 -->
<view class="head_line">
<b></b>
<text>商品分类</text>
</view>
<view class="classfy">
<view
v-for="(item, index) in gridArr"
:key="index"
@click="toClassify(item.catId, index)"
>
<!-- <u-icon v-if="item.icon" :name="item.icon" :size="46"></u-icon> -->
<image :src="item.icon"></image>
<text class="grid-text">{{ item.name }}</text>
</view>
<br clear="both" />
</view>
<!-- 商品展示 -->
<view class="head_line">
<b></b>
<text>限时秒杀</text>
<i @click="onShopMore('Sale')">查看更多 ></i>
</view>
<!-- 限时秒杀 -->
<view class="limited">
<view class="limitedSymbol">
<image src="../../static/icon/shopping_xsh.png"></image>
</view>
<view class="limitedScrollBox">
<u-scroll-list indicatorActiveColor="#27b386">
<view
class="limitedItem"
v-for="(item, index) in seckillList"
:key="index"
@click="goDetail(item.prodInfo.productId)"
>
<image :src="item.prodInfo.productImages" mode=""></image>
<text class="biaoti">{{ item.prodInfo.productName }}</text>
<text class="xian">{{ item.seckillPrice }}</text>
<text class="yuan">{{ item.prodInfo.price }}</text>
</view>
</u-scroll-list>
</view>
</view>
<!-- 商品展示 -->
<view class="head_line">
<b></b>
<text>精选商品</text>
<i @click="onShopMore('Hot')">查看更多 ></i>
</view>
<view class="goods">
<view
class="goodsItem"
v-for="(item, index) in goodsList"
:key="item.productId"
@click="goDetail(item.productId)"
>
<image :src="item.productImages" mode="" class="goodsImg"></image>
<view class="goodsContent">
<view class="goodsName">
{{ item.productName }}
</view>
<view class="goodsPrice"> {{ item.price }} </view>
</view>
</view>
<br clear="both" />
</view>
<view style="height: 30rpx"></view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<music-play :playData="playData"></music-play>
</view>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import {
mapState
} from 'vuex';
export default {
data() {
return {
playData:{},
keyword: '', // 搜索索引值
// 轮播图数据
swiperlist: [{
image: '../../static/icon/home_ban_1.jpg',
},
{
image: '../../static/icon//home_ban_2.jpg',
},
{
image: '../../static/icon//home_ban_3.jpg',
}
],
totalCount: 4,
pageSize: 1,
totalPage: 4,
currPage: 1,
limit: 4,
page: 1,
istop: 1, // 是否是精选商品
// 秒杀列表
seckillList: [],
// 商品列表
goodsList: [],
// 分类数据
gridArr: [{
icon: "list-dot",
name: '更多'
}],
}
},
computed: {
...mapState(['userInfo']),
},
components: {
musicPlay
},
onLoad() {
// 获取分类
this.$http
.post('book/shopcategory/getOneLevel')
.then(res => {
// 用一个空数组去接分类数据
let arr = []
if (res.list.length >= 5) {
for (let i in res.list) {
if (i < 5) {
arr.push({
icon: "../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png",
name: res.list[i].name,
catId: res.list[i].catId
})
}
}
arr.push({
icon: "../../static/icon/shop_bar_more.png",
name: '更多'
})
this.gridArr = arr
}
})
import musicPlay from "@/components/music.vue";
import { mapState } from "vuex";
export default {
data() {
return {
playData: {},
keyword: "", // 搜索索引值
// 轮播图数据
swiperlist: [
{
image: "../../static/icon/home_ban_1.jpg",
},
{
image: "../../static/icon//home_ban_2.jpg",
},
{
image: "../../static/icon//home_ban_3.jpg",
},
],
totalCount: 4,
pageSize: 1,
totalPage: 4,
currPage: 1,
limit: 4,
page: 1,
istop: 1, // 是否是精选商品
// 秒杀列表
seckillList: [],
// 商品列表
goodsList: [],
// 分类数据
gridArr: [
{
icon: "list-dot",
name: "更多",
},
],
};
},
computed: {
...mapState(["userInfo"]),
},
components: {
musicPlay,
},
onLoad() {
// 获取分类
this.$http.post("book/shopcategory/getOneLevel").then((res) => {
// 用一个空数组去接分类数据
let arr = [];
if (res.list.length >= 5) {
for (let i in res.list) {
if (i < 5) {
arr.push({
icon:
"../../static/icon/shop_bar_" +
(Number(i) + Number(1)) +
".png",
name: res.list[i].name,
catId: res.list[i].catId,
});
}
}
arr.push({
icon: "../../static/icon/shop_bar_more.png",
name: "更多",
});
this.gridArr = arr;
}
});
// 获取限时秒杀
this.$http
.get(`book/shopseckill/getSeckillProd`)
.then(res => {
this.seckillList = res.list
console.log(this.seckillList)
})
// 获取限时秒杀
this.$http.get(`book/shopseckill/getSeckillProd`).then((res) => {
this.seckillList = res.list;
console.log(this.seckillList);
});
// 获取精选商品
this.$http
.post(`book/shopproduct/appGetList?limit=${this.limit}&page=${this.page}&istop=${this.istop}`)
.then(
res => {
this.goodsList = res.page.list
})
// 获取精选商品
this.$http
.post(
`book/shopproduct/appGetList?limit=${this.limit}&page=${this.page}&istop=${this.istop}`
)
.then((res) => {
this.goodsList = res.page.list;
});
},
methods: {
// 跳转详情页
goDetail(id) {
uni.navigateTo({
url: "./commodityDetail?id=" + id,
});
},
},
methods: {
// 跳转详情页
goDetail(id) {
uni.navigateTo({
url: './commodityDetail?id=' + id
});
},
// 跳转分类页
toClassify(catId, index) {
if (catId) {
uni.navigateTo({
url: `./classify?type=${index}`
})
} else {
uni.navigateTo({
url: './classifyAll'
})
}
},
// 跳转搜索页
goSearch() {
uni.navigateTo({
url: './commoditySearch'
})
},
// 跳转分类页
toClassify(catId, index) {
if (catId) {
uni.navigateTo({
url: `./classify?type=${index}`,
});
} else {
uni.navigateTo({
url: "./classifyAll",
});
}
},
// 列表跳
onShopMore(e) {
uni.navigateTo({
url: './bookShopType?type=' + e
});
},
// 跳转搜索
goSearch() {
uni.navigateTo({
url: "./commoditySearch",
});
},
}
}
// 列表跳页
onShopMore(e) {
uni.navigateTo({
url: "./bookShopType?type=" + e,
});
},
},
};
</script>
<style lang="scss" scoped>
.shopHeader {
position: relative;
top: 0;
left: 0;
}
.shopHeader {
position: relative;
top: 0;
left: 0;
}
.search {
padding: 10rpx;
background-color: #fff;
margin: 10rpx 0;
.search {
padding: 10rpx;
background-color: #fff;
margin: 10rpx 0;
}
}
.swiper_box {
margin-top: 20rpx;
padding: 0 20rpx;
.swiper_box {
margin-top: 20rpx;
padding: 0 20rpx;
.swiper-item {
width: 100%;
height: 100%;
border-radius: 20rpx;
.swiper-item {
width: 100%;
height: 100%;
border-radius: 20rpx;
.swiperImg {
width: 100%;
height: 100%;
border-radius: 20rpx;
}
}
}
.swiperImg {
width: 100%;
height: 100%;
border-radius: 20rpx;
}
}
}
.classfy {
margin: 0 10rpx;
border-radius: 30rpx;
.classfy {
margin: 0 10rpx;
border-radius: 30rpx;
view {
float: left;
width: 16.6%;
text-align: center;
view {
float: left;
width: 16.6%;
text-align: center;
image {
width: 100rpx;
height: 100rpx;
margin: 0 auto;
}
image {
width: 100rpx;
height: 100rpx;
margin: 0 auto;
}
.grid-text {
font-size: 25rpx;
margin-top: 4rpx;
}
}
}
.grid-text {
font-size: 25rpx;
margin-top: 4rpx;
}
.head_line {
margin: 30rpx 0 30rpx 0;
padding: 10rpx;
}
b {
display: inline-block;
width: 12rpx;
height: 40rpx;
background-color: #54a966;
vertical-align: bottom;
margin: 0 20rpx 0 0;
}
text {
font-size: 32rpx;
font-weight: bold;
}
}
i {
float: right;
font-style: normal;
color: #8b8a91;
font-size: 24rpx;
margin: 15rpx 35rpx 0 0;
}
}
.head_line {
margin: 30rpx 0 30rpx 0;
padding: 10rpx;
.limited {
width: 100%;
height: auto;
padding: 20rpx 10rpx 10rpx 10rpx;
display: flex;
align-items: center;
background-color: #fff;
margin-top: 10rpx;
b {
display: inline-block;
width: 12rpx;
height: 40rpx;
background-color: #54a966;
vertical-align: bottom;
margin: 0 20rpx 0 0;
}
.limitedSymbol {
width: 22%;
height: 300rpx;
border-right: 1px solid #eee;
vertical-align: middle;
text {
font-size: 32rpx;
font-weight: bold;
}
image {
width: 120rpx;
height: 120rpx;
margin: 45px auto 0 auto;
}
}
i {
float: right;
font-style: normal;
color: #8b8a91;
font-size: 24rpx;
margin: 15rpx 35rpx 0 0;
}
}
.limitedScrollBox {
width: 76%;
padding: 0 10rpx;
}
.limited {
width: 100%;
height: auto;
padding: 20rpx 10rpx 10rpx 10rpx;
display: flex;
align-items: center;
background-color: #fff;
margin-top: 10rpx;
.limitedItem {
width: 200rpx;
text-align: center;
.limitedSymbol {
width: 22%;
height: 300rpx;
border-right: 1px solid #eee;
vertical-align: middle;
image {
width: 150upx;
height: 200upx;
margin: 15rpx auto 20rpx auto;
}
image {
width: 120rpx;
height: 120rpx;
margin: 45px auto 0 auto;
}
}
text {
font-size: 20rpx;
display: block;
}
.limitedScrollBox {
width: 76%;
padding: 0 10rpx;
}
.biaoti {
font-size: 30rpx;
margin: 10rpx 0 10rpx 0;
font-weight: bold;
}
.limitedItem {
width: 200rpx;
text-align: center;
.xian {
font-size: 32rpx;
color: #bf0c0c;
font-weight: bold;
}
image {
width: 150upx;
height: 200upx;
margin: 15rpx auto 20rpx auto;
}
.yuan {
text-decoration: line-through;
color: #c1c1c1;
}
}
}
text {
font-size: 20rpx;
display: block;
}
.goods {
width: 100%;
.biaoti {
font-size: 30rpx;
margin: 10rpx 0 10rpx 0;
font-weight: bold;
}
.goodsItem {
display: inline-block;
width: 46%;
border-radius: 20rpx;
padding: 25rpx 25rpx 20rpx 25rpx;
margin: 0 20rpx 20rpx 20rpx;
background-color: #fff;
border: 1px solid #eee;
.xian {
font-size: 32rpx;
color: #bf0c0c;
font-weight: bold;
}
.goodsImg {
width: 98%;
height: 380rpx;
border-radius: 10rpx;
}
.yuan {
text-decoration: line-through;
color: #c1c1c1;
.goodsContent {
.goodsName {
margin-top: 10rpx;
font-size: 30rpx;
font-weight: bold;
}
}
}
}
.goodsPrice {
font-size: 30rpx;
margin: 5rpx 0 0 3rpx;
color: #bf0c0c;
font-weight: bold;
}
}
}
.goods {
width: 100%;
.goodsItem {
display: inline-block;
width: 46%;
border-radius: 20rpx;
padding: 25rpx 25rpx 20rpx 25rpx;
margin: 0 20rpx 20rpx 20rpx;
background-color: #fff;
border: 1px solid #eee;
.goodsImg {
width: 98%;
height: 380rpx;
border-radius: 10rpx;
}
.goodsContent {
.goodsName {
margin-top: 10rpx;
font-size: 30rpx;
font-weight: bold;
}
.goodsPrice {
font-size: 30rpx;
margin: 5rpx 0 0 3rpx;
color: #bf0c0c;
font-weight: bold;
}
}
}
.goodsItem:nth-child(2n) {
margin-left: 0;
}
}
.goodsItem:nth-child(2n) {
margin-left: 0;
}
}
</style>

View File

@@ -1,333 +1,359 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view>
<z-nav-bar :title="title"></z-nav-bar>
<view>
<z-nav-bar :title="title"></z-nav-bar>
<view class="shop_list">
<view class="sl_tioa" v-for="(item,index) in shopList" @click="onShopJump(item)">
<image :src="item.productImages"></image>
<view class="sl_cont">
<view class="sl_tit">
<text class="bok_name">
{{item.productName}}
<span v-if="item.productStock==0" style="color: #aaa;font-size:26rpx;">无货</span>
</text>
</view>
<view class="sl_ric">
{{item.price}}
</view>
<view class="sl_del" v-if="shopScreen.type == 'Sale'">
{{item.oldprice}}
</view>
<view class="sl_gou" v-if="item.productStock>0" @click.stop="addShopCar(item)">
<u-icon name="shopping-cart" :size="26" color="#eba00b"></u-icon>
</view>
</view>
<br clear="both">
</view>
<view style="height: 1px;"></view>
</view>
<view class="shop_list">
<view
class="sl_tioa"
v-for="(item, index) in shopList"
@click="onShopJump(item)"
>
<image :src="item.productImages"></image>
<view class="sl_cont">
<view class="sl_tit">
<text class="bok_name">
{{ item.productName }}
<span
v-if="item.productStock == 0"
style="color: #aaa; font-size: 26rpx"
>无货</span
>
</text>
</view>
<view class="sl_ric"> {{ item.price }} </view>
<view class="sl_del" v-if="shopScreen.type == 'Sale'">
{{ item.oldprice }}
</view>
<view
class="sl_gou"
v-if="item.productStock > 0"
@click.stop="addShopCar(item)"
>
<u-icon name="shopping-cart" :size="26" color="#eba00b"></u-icon>
</view>
</view>
<br clear="both" />
</view>
<view style="height: 1px"></view>
</view>
<view>
<view v-if="status == 0" style="text-align: center">
<u-loading-icon style="display: inline-block"></u-loading-icon>
<font
style="
vertical-align: super;
margin-left: 10px;
font-size: 26rpx;
color: #909399;
"
>努力加载中</font
>
</view>
<view v-if="status == 1">
<u-divider text="全部加载完成"></u-divider>
</view>
</view>
<view>
<view v-if="status==0" style="text-align: center;">
<u-loading-icon style="display: inline-block;"></u-loading-icon>
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
</view>
<view v-if="status==1">
<u-divider text="全部加载完成"></u-divider>
</view>
</view>
<view style="padding-bottom: 20rpx;">
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
</view>
<music-play :playData="playData"></music-play>
</view>
<view style="padding-bottom: 20rpx">
<u-back-top
:scroll-top="scrollTop"
bottom="60"
:customStyle="bgiStyle"
:iconStyle="iconStyle"
></u-back-top>
</view>
<music-play :playData="playData"></music-play>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
import {
mapState
} from 'vuex';
export default {
data() {
return {
playData:{},
scrollTop: 0,
status: 3,
shopScreen: {
type: '',
page: 1, //当前页码数
limit: 5, //单页数据数量
},
productInfo: {},
totalPage: 0,
totalCount: 0,
shopList: [],
bgiStyle: {
background: '#2ab58833'
},
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#54a966',
},
urList: '',
title: '',
}
},
import musicPlay from "@/components/music.vue";
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
data() {
return {
playData: {},
scrollTop: 0,
status: 3,
shopScreen: {
type: "",
page: 1, //当前页码数
limit: 5, //单页数据数量
},
productInfo: {},
totalPage: 0,
totalCount: 0,
shopList: [],
bgiStyle: {
background: "#2ab58833",
},
iconStyle: {
fontSize: "40rpx",
fontWeight: "bold",
color: "#54a966",
},
urList: "",
title: "",
};
},
// 返回顶部
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
// 返回顶部
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
// 下拉刷新
onReachBottom() {
this.status = 0
if (this.shopScreen.page < this.totalPage) {
this.shopScreen.page = this.shopScreen.page + 1
setTimeout(() => {
if (this.shopScreen.type == 'Hot') {
this.$http
.post(this.urList + '?page=' + this.shopScreen.page + '&limit=' + this.shopScreen
.limit)
.then(res => {
this.totalPage = res.page.totalPage
this.totalCount = res.page.totalCount
for (let i in res.page.list) {
this.shopList.push(res.page.list[i])
}
});
}
}, 1000)
} else {
this.status = 1
}
},
// 下拉刷新
onReachBottom() {
this.status = 0;
if (this.shopScreen.page < this.totalPage) {
this.shopScreen.page = this.shopScreen.page + 1;
setTimeout(() => {
if (this.shopScreen.type == "Hot") {
this.$http
.post(
this.urList +
"?page=" +
this.shopScreen.page +
"&limit=" +
this.shopScreen.limit
)
.then((res) => {
this.totalPage = res.page.totalPage;
this.totalCount = res.page.totalCount;
for (let i in res.page.list) {
this.shopList.push(res.page.list[i]);
}
});
}
}, 1000);
} else {
this.status = 1;
}
},
//第一次加载
onLoad(e) {
this.shopScreen.type = e.type
if (this.shopScreen.type == 'Sale') {
this.urList = 'book/shopseckill/getSeckillProd'
this.title = '限时秒杀'
} else if (this.shopScreen.type == 'Hot') {
this.urList = 'book/shopproduct/appGetList'
this.title = '精选商品'
}
//第一次加载
onLoad(e) {
this.shopScreen.type = e.type;
if (this.shopScreen.type == "Sale") {
this.urList = "book/shopseckill/getSeckillProd";
this.title = "限时秒杀";
} else if (this.shopScreen.type == "Hot") {
this.urList = "book/shopproduct/appGetList";
this.title = "精选商品";
}
this.getData();
},
//页面显示
onShow() {
// this.getData();
},
// 下拉刷新
onPullDownRefresh() {
this.getData()
uni.stopPullDownRefresh()
},
computed: {
...mapState(['userInfo']),
},
components: {
musicPlay
},
//方法
methods: {
// 获取列表数据
getData() {
console.log(this.urList)
this.shopList = []
if (this.shopScreen.type == 'Hot') {
this.$http
.post(this.urList + '?page=' + this.shopScreen.page + '&limit=' + this.shopScreen.limit)
.then(res => {
this.shopList = res.page.list
this.totalPage = res.page.totalPage
this.status = 3
});
} else if (this.shopScreen.type == 'Sale') {
this.$http
.get(this.urList)
.then(res => {
let arr = []
for (let i in res.list) {
arr.push({
productImages: res.list[i].prodInfo.productImages,
productName: res.list[i].prodInfo.productName,
price: res.list[i].seckillPrice,
oldprice: res.list[i].prodInfo.price,
productId: res.list[i].prodInfo.productId,
})
}
this.shopList = arr
this.status = 3
});
}
this.getData();
},
//页面显示
onShow() {
// this.getData();
},
// 下拉刷新
onPullDownRefresh() {
this.getData();
uni.stopPullDownRefresh();
},
computed: {
...mapState(["userInfo"]),
},
components: {
musicPlay,
},
//方法
methods: {
// 获取列表数据
getData() {
console.log(this.urList);
this.shopList = [];
if (this.shopScreen.type == "Hot") {
this.$http
.post(
this.urList +
"?page=" +
this.shopScreen.page +
"&limit=" +
this.shopScreen.limit
)
.then((res) => {
this.shopList = res.page.list;
this.totalPage = res.page.totalPage;
this.status = 3;
});
} else if (this.shopScreen.type == "Sale") {
this.$http.get(this.urList).then((res) => {
let arr = [];
for (let i in res.list) {
arr.push({
productImages: res.list[i].prodInfo.productImages,
productName: res.list[i].prodInfo.productName,
price: res.list[i].seckillPrice,
oldprice: res.list[i].prodInfo.price,
productId: res.list[i].prodInfo.productId,
});
}
this.shopList = arr;
this.status = 3;
});
}
},
},
// 加入购物车
addShopCar(e) {
this.$http
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
.then((res) => {
this.cartList = res.cartList;
// 统计商品信息
let data = {
userId: this.userInfo.id,
productId: e.productId,
productAmount: 1,
price: e.price,
};
console.log(e);
// 判断列表是否为空
if (this.cartList.length > 0) {
let flag = "";
let shagnpin = {};
// 循环购物车列表
flag = this.cartList.some((item, index) => {
if (item.productId == data.productId) {
shagnpin = item;
shagnpin.productAmount = item.productAmount + 1;
return true;
}
});
if (flag) {
// 已在购物车中添加
$http
.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: "加入购物车成功",
duration: 1000,
});
}
});
} else {
// 加入购物车
$http
.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: "加入购物车成功",
duration: 1000,
});
}
});
}
} else {
// 购物车列表为空时直接加入购物车
$http
.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: "加入购物车成功",
duration: 1000,
});
}
});
}
});
},
// 加入购物车
addShopCar(e) {
this.$http
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
.then(res => {
this.cartList = res.cartList
// 统计商品信息
let data = {
"userId": this.userInfo.id,
"productId": e.productId,
"productAmount": 1,
"price": e.price
}
console.log(e)
// 判断列表是否为空
if (this.cartList.length > 0) {
let flag = ''
let shagnpin = {}
// 循环购物车列表
flag = this.cartList.some((item, index) => {
if (item.productId == data.productId) {
shagnpin = item
shagnpin.productAmount = item.productAmount + 1
return true
}
})
if (flag) {
// 已在购物车中添加
$http.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
} else {
// 加入购物车
$http.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
}
} else {
// 购物车列表为空时直接加入购物车
$http.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
}
})
},
// 商品内容跳转
onShopJump(e) {
uni.navigateTo({
url: './commodityDetail?id=' + e.productId
});
}
},
};
// 商品内容跳转
onShopJump(e) {
uni.navigateTo({
url: "./commodityDetail?id=" + e.productId,
});
},
},
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
@import "@/style/mixin.scss";
.shop_list {
margin: 30rpx;
.sl_tioa {
box-shadow: 0 0px 10px 1px #d3d1d133;
background-color: #fff;
padding: 25rpx;
margin: 0 0 20rpx 0;
border-radius: 15rpx;
position: relative;
image {
width: 160upx;
height: 240upx;
float: left;
margin-right: 20rpx;
}
.shop_list {
margin: 30rpx;
.sl_cont {
float: left;
.sl_tioa {
box-shadow: 0 0px 10px 1px #d3d1d133;
background-color: #fff;
padding: 25rpx;
margin: 0 0 20rpx 0;
border-radius: 15rpx;
position: relative;
.sl_tit {
max-width: 420rpx;
font-size: 30rpx;
}
image {
width: 160upx;
height: 240upx;
float: left;
margin-right: 20rpx;
}
.sl_ric {
color: #bf0c0c;
font-weight: bold;
margin-top: 50rpx;
}
.sl_cont {
float: left;
.sl_del {
text-decoration: line-through;
color: #c1c1c1;
font-size: 30rpx;
margin-left: 10rpx;
}
.sl_tit {
max-width: 420rpx;
font-size: 30rpx;
}
.sl_ric {
color: #bf0c0c;
font-weight: bold;
margin-top: 50rpx;
}
.sl_del {
text-decoration: line-through;
color: #c1c1c1;
font-size: 30rpx;
margin-left: 10rpx;
}
.sl_gou {
background-color: #fbf6ec;
border-radius: 50rpx;
padding: 5rpx;
position: absolute;
right: 50rpx;
bottom: 40rpx;
}
}
}
}
.sl_gou {
background-color: #fbf6ec;
border-radius: 50rpx;
padding: 5rpx;
position: absolute;
right: 50rpx;
bottom: 40rpx;
}
}
}
}
</style>

View File

@@ -1,458 +1,523 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view class="">
<z-nav-bar title="健康超市"></z-nav-bar>
<!-- 一级分类 -->
<view class="oneBox">
<view class="oneLevel">
<u-tabs :scrollable="false" :current="current" lineWidth="42" :inactiveStyle="{fontSize:'32rpx'}"
:list="oneLevel" @click="getTowLevel" lineColor="#54a966"
:activeStyle="{color: '#303133',fontWeight: 'bold', transform: 'scale(1.01)'}"></u-tabs>
</view>
</view>
<!-- <view class="search_box" @click="onPageJump('../peanut/searchFor')">
<view class="">
<z-nav-bar title="健康超市"></z-nav-bar>
<!-- 一级分类 -->
<view class="oneBox">
<view class="oneLevel">
<u-tabs
:scrollable="false"
:current="current"
lineWidth="42"
:inactiveStyle="{ fontSize: '32rpx' }"
:list="oneLevel"
@click="getTowLevel"
lineColor="#54a966"
:activeStyle="{
color: '#303133',
fontWeight: 'bold',
transform: 'scale(1.01)',
}"
></u-tabs>
</view>
</view>
<!-- <view class="search_box" @click="onPageJump('../peanut/searchFor')">
<text class="icon_search"></text>
<text class="prompt">搜索...</text>
</view> -->
<!-- 二级分类商品 -->
<view class="twoBox" style="">
<!-- <u-sticky> -->
<u-tabs v-if="utabs" :list="towLevel" :current = "0" :inactiveStyle="{fontSize:'28rpx'}" lineWidth="40" @click="getCategoryList"
:activeStyle="{transform: 'scale(1.01)'}"></u-tabs>
<!-- </u-sticky> -->
</view>
<view class="classfyBody">
<!-- 二级分类商品 -->
<view class="towLevel" v-if="towLevel.length > 0">
<view class="towLevelContent" v-if="commodityList && commodityList.length > 0">
<view class="commodityItem" v-for="(item,index) in commodityList" :key="index"
@click.stop="toDetail(item.productId)">
<view class="box">
<image :src="item.productImages" mode=""></image>
<view class="commodityContent">
<view class="commodityTitle">
{{item.productName}}
<span v-if="item.productStock==0" style="color: #aaa;font-size:26rpx;">暂无库存</span>
</view>
<view class="commodityPrice">
<text class="price" v-if="item.price">
<b style="font-size: 40rpx;">{{item.price}}</b>
<span class="priceTag" v-if="item.activityPrice">原价{{item.activityPrice}}</span>
</text>
<text class="SoldNumber" v-if="item.sumSales">已售<span>{{item.sumSales}}</span></text>
<!-- <text class="icon" @click.stop="addShopCar(item)" v-if="item.productStock">
<!-- 二级分类商品 -->
<view class="twoBox" style="">
<!-- <u-sticky> -->
<u-tabs
v-if="utabs"
:list="towLevel"
:current="0"
:inactiveStyle="{ fontSize: '28rpx' }"
lineWidth="40"
@click="getCategoryList"
:activeStyle="{ transform: 'scale(1.01)' }"
></u-tabs>
<!-- </u-sticky> -->
</view>
<view class="classfyBody">
<!-- 二级分类商品 -->
<view class="towLevel" v-if="towLevel.length > 0">
<view
class="towLevelContent"
v-if="commodityList && commodityList.length > 0"
>
<view
class="commodityItem"
v-for="(item, index) in commodityList"
:key="index"
@click.stop="toDetail(item.productId)"
>
<view class="box">
<image :src="item.productImages" mode=""></image>
<view class="commodityContent">
<view class="commodityTitle">
{{ item.productName }}
<span
v-if="item.productStock == 0"
style="color: #aaa; font-size: 26rpx"
>暂无库存</span
>
</view>
<view class="commodityPrice">
<text class="price" v-if="item.price"
>
<b style="font-size: 40rpx">{{ item.price }}</b>
<span class="priceTag" v-if="item.activityPrice"
>原价{{ item.activityPrice }}</span
>
</text>
<text class="SoldNumber" v-if="item.sumSales"
>已售<span>{{ item.sumSales }}</span
></text
>
<!-- <text class="icon" @click.stop="addShopCar(item)" v-if="item.productStock">
<u-icon name="shopping-cart" :size="26" color="#eba00b"></u-icon>
</text> -->
<view class="publierInfo" v-if="item.author && item.publisher">
<span class="c999 f24">{{item.author}}</span><span class="c999 f24">/ {{item.publisher}}</span>
</view>
</view>
</view>
</view>
</view>
</view>
<view v-else style="text-align: center;font-size: 30rpx;color: #888;margin: 20rpx 0 0 0;flex: 1;">
暂无商品
</view>
</view>
<view v-else style="text-align: center;font-size:30rpx;color: #888;margin: 50rpx 0 0 0;">
暂无分类
</view>
</view>
<view>
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
</view>
<music-play :playData="playData"></music-play>
</view>
<view
class="publierInfo"
v-if="item.author && item.publisher"
>
<span class="c999 f24">{{ item.author }}</span
><span class="c999 f24">/ {{ item.publisher }}</span>
</view>
</view>
</view>
</view>
</view>
</view>
<view
v-else
style="
text-align: center;
font-size: 30rpx;
color: #888;
margin: 20rpx 0 0 0;
flex: 1;
"
>
暂无商品
</view>
</view>
<view
v-else
style="
text-align: center;
font-size: 30rpx;
color: #888;
margin: 50rpx 0 0 0;
"
>
暂无分类
</view>
</view>
<view>
<u-back-top
:scroll-top="scrollTop"
bottom="60"
:customStyle="bgiStyle"
:iconStyle="iconStyle"
></u-back-top>
</view>
<music-play :playData="playData"></music-play>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
import {
mapState
} from 'vuex';
export default {
data() {
return {
playData:{},
highlight: '', // 高亮下标
current: 0,
twocurrent:0,
oneLevel: [],
towLevel: [],
commodityList: [] ,// 商品列表
utabs:false,
bgiStyle: {
background: '#2ab58833'
},
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#54a966',
},
scrollTop: 0,
}
},
// contentButtonClick(e) {
// console.log(e)
// },
// onLoad(e) {
// //获取一级分类
// this.$http
// .post('book/shopcategory/getOneLevel')
// .then(res => {
// this.oneLevel = res.list
// this.current = e.type
// this.getTowLevel(this.oneLevel[e.type])
// })
// },
//页面显示
onShow() {
this.getOneLevel()
},
computed: {
...mapState(['userInfo']),
},
mounted () {
setTimeout(() => { // 解决vant-tab组件官方问题底部条位置错误
this.utabs = true
}, 200)
},
components: {
musicPlay
},
methods: {
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
// 跳转
onPageJump(url) {
uni.navigateTo({
url: url
});
},
// 获取一级分类
getOneLevel() {
this.$http
.post('book/shopcategory/getOneLevel')
.then(res => {
//console.log(res,'一级分类')
this.oneLevel = res.list
// this.current = e.type
this.getTowLevel(this.oneLevel[0])
})
},
// 点击一级分类
getTowLevel(e) {
this.utabs = false
// this.twocurrent = 0;
uni.showLoading()
this.$http
.post(`book/shopcategory/getTwoLevel?catId=${e.catId}`)
.then(res => {
//console.log(res,'二级分类')
this.towLevel = res.list
if (this.towLevel == '') {
this.commodityList = []
} else {
let newo = {
catId:0,
name:'全部',
parentCid:e.catId
}
this.towLevel.splice(0,0,newo)
// this.getCategoryList(res.list[0])
// console.log(this.towLevel, 'towLevel')
this.getCategoryList(res.list[0])
}
uni.hideLoading()
this.utabs = true
uni.stopPullDownRefresh();
})
},
import musicPlay from "@/components/music.vue";
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
data() {
return {
playData: {},
highlight: "", // 高亮下标
current: 0,
twocurrent: 0,
oneLevel: [],
towLevel: [],
commodityList: [], // 商品列表
utabs: false,
bgiStyle: {
background: "#2ab58833",
},
iconStyle: {
fontSize: "40rpx",
fontWeight: "bold",
color: "#54a966",
},
scrollTop: 0,
};
},
// contentButtonClick(e) {
// console.log(e)
// },
// onLoad(e) {
// //获取一级分类
// this.$http
// .post('book/shopcategory/getOneLevel')
// .then(res => {
// this.oneLevel = res.list
// this.current = e.type
// this.getTowLevel(this.oneLevel[e.type])
// })
// },
//页面显示
onShow() {
this.getOneLevel();
},
computed: {
...mapState(["userInfo"]),
},
mounted() {
setTimeout(() => {
// 解决vant-tab组件官方问题底部条位置错误
this.utabs = true;
}, 200);
},
components: {
musicPlay,
},
methods: {
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
// 跳转
onPageJump(url) {
uni.navigateTo({
url: url,
});
},
// 获取一级分类
getOneLevel() {
this.$http.post("book/shopcategory/getOneLevel").then((res) => {
//console.log(res,'一级分类')
this.oneLevel = res.list;
// this.current = e.type
this.getTowLevel(this.oneLevel[0]);
});
},
// 点击一级分类
getTowLevel(e) {
this.utabs = false;
// this.twocurrent = 0;
uni.showLoading();
this.$http
.post(`book/shopcategory/getTwoLevel?catId=${e.catId}`)
.then((res) => {
//console.log(res,'二级分类')
this.towLevel = res.list;
if (this.towLevel == "") {
this.commodityList = [];
} else {
let newo = {
catId: 0,
name: "全部",
parentCid: e.catId,
};
this.towLevel.splice(0, 0, newo);
// this.getCategoryList(res.list[0])
// console.log(this.towLevel, 'towLevel')
this.getCategoryList(res.list[0]);
}
uni.hideLoading();
this.utabs = true;
uni.stopPullDownRefresh();
});
},
// 点击二级分类
getCategoryList(e) {
// console.log(e)
// return false
// this.highlight = index
this.$http
.post('book/shopproduct/appGetCategoryList', {
'catId': e.catId
})
.then(res => {
// console.log(res,'二级分类')
this.commodityList = res.list
})
},
// 加入购物车
addShopCar(e) {
this.$http
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
.then(res => {
// 获得用户的购物车列表信息
this.cartList = res.cartList
// 统计商品信息
let data = {
"userId": this.userInfo.id,
"productId": e.productId,
"productAmount": 1,
"price": e.price
}
// 判断列表是否为空
if (this.cartList.length > 0) {
let flag = ''
let shagnpin = {}
// 循环购物车列表
flag = this.cartList.some((item, index) => {
if (item.productId == data.productId) {
shagnpin = item
shagnpin.productAmount = item.productAmount + 1
return true
}
})
if (flag) {
// 已在购物车中添加
$http.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
}
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
} else {
// 加入购物车
$http.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
}
} else {
// 购物车列表为空时直接加入购物车
$http.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
}
})
},
// 商品内容跳转
toDetail(id) {
uni.navigateTo({
url: `./commodityDetail?id=${id}`
})
}
},
onPullDownRefresh(){
// console.log('refresh');
this.commodityList = []
this.getOneLevel()
}
}
// 点击二级分类
getCategoryList(e) {
// console.log(e)
// return false
// this.highlight = index
this.$http
.post("book/shopproduct/appGetCategoryList", {
catId: e.catId,
})
.then((res) => {
// console.log(res,'二级分类')
this.commodityList = res.list;
});
},
// 加入购物车
addShopCar(e) {
this.$http
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
.then((res) => {
// 获得用户的购物车列表信息
this.cartList = res.cartList;
// 统计商品信息
let data = {
userId: this.userInfo.id,
productId: e.productId,
productAmount: 1,
price: e.price,
};
// 判断列表是否为空
if (this.cartList.length > 0) {
let flag = "";
let shagnpin = {};
// 循环购物车列表
flag = this.cartList.some((item, index) => {
if (item.productId == data.productId) {
shagnpin = item;
shagnpin.productAmount = item.productAmount + 1;
return true;
}
});
if (flag) {
// 已在购物车中添加
$http
.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: "加入购物车成功",
duration: 1000,
});
}
});
} else {
// 加入购物车
$http
.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: "加入购物车成功",
duration: 1000,
});
}
});
}
} else {
// 购物车列表为空时直接加入购物车
$http
.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: "加入购物车成功",
duration: 1000,
});
}
});
}
});
},
// 商品内容跳转
toDetail(id) {
uni.navigateTo({
url: `./commodityDetail?id=${id}`,
});
},
},
onPullDownRefresh() {
// console.log('refresh');
this.commodityList = [];
this.getOneLevel();
},
};
</script>
<style lang="scss" scoped>
.publierInfo {
display: inline-block;
background-color: #f1f1f1;
flex-direction: row;
border-radius: 10px;
vertical-align: middle;
padding: 0 12rpx;
line-height: 32rpx;
}
.publierInfo {
display: inline-block;
background-color: #f1f1f1;
flex-direction: row;
border-radius: 10px;
vertical-align: middle;
padding: 0 12rpx;
line-height: 32rpx;
}
.c999 {
color: #999;
}
.c999 {
color: #999;
}
.f24 {
font-size: 24rpx;
}
.f24 {
font-size: 24rpx;
}
.search_box {
width: 90%;
height: 64upx;
background-color: #fff;
border-radius: 32upx;
display: flex;
align-items: center;
padding: 0upx 40upx;
position: relative;
margin: 30rpx 0 15rpx -46%;
left: 50%;
box-shadow: 0 0px 10px 1px #54a96633;
.search_box {
width: 90%;
height: 64upx;
background-color: #fff;
border-radius: 32upx;
display: flex;
align-items: center;
padding: 0upx 40upx;
position: relative;
margin: 30rpx 0 15rpx -46%;
left: 50%;
box-shadow: 0 0px 10px 1px #54a96633;
.prompt {
color: #cccccc;
.prompt {
color: #cccccc;
}
}
.icon_search {
background-image: url("@/static/icon/map_ic_search.png");
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
width: 29upx;
height: 28upx;
margin-right: 20upx;
}
}
.icon_search {
background-image: url('@/static/icon/map_ic_search.png');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
width: 29upx;
height: 28upx;
margin-right: 20upx;
}
}
.oneBox {
margin: 10rpx auto;
.oneBox {
margin: 10rpx auto;
.oneLevel {
}
}
.oneLevel {}
}
.twoBox {
width: 95%;
margin: 0 auto;
}
.twoBox {
width: 95%;
margin: 0 auto;
}
.classfyBody {
margin: 5rpx auto;
// width: 100%;
height: 100%;
.classfyBody {
margin: 5rpx auto;
// width: 100%;
height: 100%;
.towLevel {
width: 100%;
height: 100%;
display: flex;
.towLevelTitle {
width: 28%;
height: auto;
text-align: center;
.titleItem {
font-size: 35rpx;
padding: 20rpx 10rpx;
}
.towLevel {
width: 100%;
height: 100%;
display: flex;
.active {
background-color: #fff;
border-left: solid 10rpx #eba00b;
font-weight: bold;
}
}
.towLevelTitle {
width: 28%;
height: auto;
text-align: center;
.towLevelContent {
display: flex;
flex-wrap: wrap;
padding: 10rpx 20rpx;
width: 100%;
align-items: stretch;
// align-content:center;
align-content: start;
.commodityItem {
width: 50%;
// background-color: #fff;
padding: 10rpx;
.titleItem {
font-size: 35rpx;
padding: 20rpx 10rpx;
}
.box {
background-color: #fff;
padding: 10rpx;
border-radius: 20rpx !important;
overflow: hidden;
box-shadow: 0 0px 10px 1px #54a96633;
}
.active {
background-color: #fff;
border-left: solid 10rpx #eba00b;
font-weight: bold;
}
}
.commodityTitle {
font-size: 32rpx;
margin: 20rpx 0 10rpx 0;
}
.towLevelContent {
display: flex;
flex-wrap: wrap;
padding: 10rpx 20rpx;
width: 100%;
align-items: stretch;
// align-content:center;
align-content:start;
.commodityItem {
width: 50%;
// background-color: #fff;
padding: 10rpx;
image {
width: 100%;
border-radius: 10rpx;
height: 300rpx;
margin-right: 20rpx;
}
.box {
background-color: #fff;
padding: 10rpx;
border-radius: 20rpx !important;
overflow: hidden;
box-shadow: 0 0px 10px 1px #54a96633;
}
.commodityContent {
flex: 1;
font-size: 16px;
.commodityTitle {
font-size: 32rpx;
margin: 20rpx 0 10rpx 0;
}
display: flex;
flex-direction: column;
justify-content: space-between;
image {
width: 100%;
border-radius: 10rpx;
height: 300rpx;
margin-right: 20rpx;
}
.commodityPrice {
width: 100%;
position: relative;
margin: 0 0 3rpx 0;
.commodityContent {
flex: 1;
font-size: 16px;
.price {
vertical-align: middle;
color: #ffa200;
display: flex;
flex-direction: column;
justify-content: space-between;
.priceTag {
flex-direction: row;
color: #999;
display: inline-block;
zoom: 0.8;
margin-left: 6rpx;
margin-bottom: 6px;
}
}
.commodityPrice {
width: 100%;
position: relative;
margin: 0 0 3rpx 0;
.SoldNumber {
font-size: 24rpx;
color: #999;
float: right;
margin-top: 16rpx;
}
.price {
vertical-align: middle;
color: #ffa200;
.priceTag {
flex-direction: row;
color: #999;
display: inline-block;
zoom: .8;
margin-left: 6rpx;
margin-bottom: 6px;
}
}
.SoldNumber {
font-size: 24rpx;
color: #999;
float: right;
margin-top: 16rpx;
}
.icon {
background-color: #fbf6ec;
border-radius: 50rpx;
padding: 5rpx;
position: absolute;
right: 0;
bottom: -20rpx;
}
}
}
}
}
}
}
.icon {
background-color: #fbf6ec;
border-radius: 50rpx;
padding: 5rpx;
position: absolute;
right: 0;
bottom: -20rpx;
}
}
}
}
}
}
}
</style>

View File

@@ -1,81 +1,80 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view>
<z-nav-bar title="全部分类"></z-nav-bar>
<view class="oneLevel">
<view class="oneItem" v-for="(item,index) in oneLevel" @click="getTowLevel(index)">
<image :src="item.icon"></image>
<text>{{item.name}}</text>
</view>
</view>
<music-play :playData="playData"></music-play>
</view>
<view>
<z-nav-bar title="全部分类"></z-nav-bar>
<view class="oneLevel">
<view
class="oneItem"
v-for="(item, index) in oneLevel"
@click="getTowLevel(index)"
>
<image :src="item.icon"></image>
<text>{{ item.name }}</text>
</view>
</view>
<music-play :playData="playData"></music-play>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
export default {
data() {
return {
playData:{},
oneLevel: [],
}
},
onLoad(e) {
this.$http
.post('book/shopcategory/getOneLevel')
.then(res => {
let arr = []
for (let i in res.list) {
arr.push({
icon: "../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png",
name: res.list[i].name,
catId: res.list[i].catId
})
}
this.oneLevel = arr
})
},
components: {
musicPlay
},
methods: {
// 点击分类跳转
getTowLevel(e) {
uni.navigateTo({
url: `./classify?type=${e}`
})
},
}
}
import musicPlay from "@/components/music.vue";
export default {
data() {
return {
playData: {},
oneLevel: [],
};
},
onLoad(e) {
this.$http.post("book/shopcategory/getOneLevel").then((res) => {
let arr = [];
for (let i in res.list) {
arr.push({
icon:
"../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png",
name: res.list[i].name,
catId: res.list[i].catId,
});
}
this.oneLevel = arr;
});
},
components: {
musicPlay,
},
methods: {
// 点击分类跳转
getTowLevel(e) {
uni.navigateTo({
url: `./classify?type=${e}`,
});
},
},
};
</script>
<style lang="scss" scoped>
.oneLevel {
.oneLevel {
margin: 10rpx 0 0 0;
margin: 10rpx 0 0 0;
.oneItem {
display: inline-block;
width: 20%;
text-align: center;
margin: 30rpx 0 0 0;
image {
width: 100rpx;
height: 100rpx;
margin: 0 auto;
}
.oneItem {
display: inline-block;
width: 20%;
text-align: center;
margin: 30rpx 0 0 0;
image {
width: 100rpx;
height: 100rpx;
margin: 0 auto;
}
text {
font-size: 30rpx;
}
}
}
text {
font-size: 30rpx;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
<template><page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
<view class="">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
@@ -262,10 +263,15 @@
type="success"
></u-tag>
</view>
<view class="orderReal" style=" width: 100%;
display: flex;
align-items: center;
justify-content: space-between;">
<view
class="orderReal"
style="
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
"
>
<span style="color: #666; margin-right: 10rpx; float: left"
>创建时间 :
</span>
@@ -1108,7 +1114,8 @@ export default {
<style lang="scss" scoped>
@import "@/style/mixin.scss";
@import "@/style/common.scss";
view,uni-view {
view,
uni-view {
font-size: 28rpx;
}
.expresslist {

File diff suppressed because it is too large Load Diff

View File

@@ -88,7 +88,17 @@
</image>
<view class="normal_box">
<view class="normal_box_top" style="justify-content: space-between">
<view class="curriulum_title">{{ v.productName }} </view>
<view
class="curriulum_title"
style="width: calc(100% - 160rpx); font-size: 14px"
>{{ v.productName }}
</view>
<u-number-box
:min="1"
:input-width="30"
v-model="orderNumber"
button-size="20"
></u-number-box>
</view>
<view>
@@ -97,16 +107,16 @@
v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null
"
>
<text style="color: #e97512; font-size: 12px; font-weight: bold"
<text style="color: #e97512; font-size: 14px; font-weight: bold"
>¥{{ v.vipPrice.toFixed(2) }}</text
>
<text style="color: #fa2d12; font-size: 10px; margin-left: 4px"
<text style="color: #fa2d12; font-size: 12px; margin-left: 4px"
>VIP到手价</text
>
<text
style="
color: #8a8a8a;
font-size: 10px;
font-size: 12px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
@@ -116,16 +126,16 @@
</text>
<text v-else-if="v.activityPrice && v.activityPrice > 0">
<text style="color: #e97512; font-size: 12px; font-weight: bold"
<text style="color: #e97512; font-size: 14px; font-weight: bold"
>¥{{ v.activityPrice.toFixed(2) }}</text
>
<text style="color: #613804; font-size: 10px; margin-left: 4px"
<text style="color: #613804; font-size: 12px; margin-left: 4px"
>活动价</text
>
<text
style="
color: #8a8a8a;
font-size: 10px;
font-size: 12px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
@@ -134,25 +144,9 @@
>
</text>
<text v-else style="font-size: 12px"
<text v-else style="font-size: 14px"
>¥{{ Number(v.price).toFixed(2) }}</text
>
<!-- <u-number-box v-model="orderNumber" style="float: right">
<view slot="minus" class="minus">
<u-icon name="minus" size="12"></u-icon>
</view>
<text
slot="input"
style="width: auto; text-align: center; border: none"
class="input"
>{{ orderNumber }}</text
>
<view slot="plus" class="plus">
<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
</view>
</u-number-box> -->
<u-number-box :min="1" v-model="orderNumber" ></u-number-box>
</view>
</view>
</view>
@@ -941,7 +935,12 @@ export default {
this.jfNumberShow = this.jfNumber.toFixed(2);
}
this.actualPayment = this.totalPrice - this.jfNumber -this.districtAmount -this.vipPrice + this.freightNum;
this.actualPayment =Number(
this.totalPrice -
this.jfNumber -
this.districtAmount -
this.vipPrice +
this.freightNum).toFixed(2);
if (this.actualPayment == 0) {
this.isDefaultCurrency = true;
@@ -1200,23 +1199,23 @@ export default {
}
if (that.jfNumber == 0 || that.jfNumber == null) {
that.jfNumberShow = "0.00";
that.actualPayment = that.totalPrice;
that.actualPayment = that.totalPrice.toFixed(2);
} else {
that.jfNumberShow = that.jfNumber.toFixed(2);
that.actualPayment = that.totalPrice - that.jfNumber;
that.actualPayment = Number(that.totalPrice - that.jfNumber).toFixed(2);
}
that.actualPayment =
that.actualPayment =Number(
that.actualPayment +
that.freightNum -
that.districtAmount -
that.vipPrice;
that.vipPrice).toFixed(2);
} else {
that.actualPayment =
that.actualPayment =Number(
that.totalPrice +
that.freightNum -
couponAmount -
that.districtAmount -
that.vipPrice;
that.vipPrice).toFixed(2);
}
if (this.actualPayment == 0 && !this.isShowAddress) {
@@ -1314,12 +1313,13 @@ export default {
couponId: null, //优惠券Id
// isSend: this.isSend,
couponName: "", //优惠券名称
districtMoney: 0, //优惠金额
vipDiscountAmount: this.vipPrice, //折扣金额
districtMoney: this.districtAmount, //折扣金额
productList: this.goodsDataList.map((e) => {
return {
productId: e.productId,
quantity: 1,
quantity: this.orderNumber,
};
}), //订单列表商品
orderType: "order", //订单类型