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

View File

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

View File

@@ -1,4 +1,5 @@
<template><page-meta <template>
<page-meta
:page-font-size="$baseFontSize() + 'px'" :page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'" :root-font-size="$baseFontSize() + 'px'"
></page-meta> ></page-meta>
@@ -21,19 +22,16 @@
<view class="fullscreen-webview"> <view class="fullscreen-webview">
<web-view :src="urlPath"> </web-view> <web-view :src="urlPath"> </web-view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default {
export default {
data() { data() {
return { return {
playData: {}, playData: {},
urlPath: '', urlPath: "",
title: '', title: "",
id: null, id: null,
indicatorDots: true, indicatorDots: true,
autoplay: true, autoplay: true,
@@ -43,16 +41,14 @@
}, },
onLoad(options) { onLoad(options) {
if (options.type == 1) { if (options.type == 1) {
this.urlPath = 'https://zmzm.taihumed.com/agreement.html' this.urlPath = "https://zmzm.taihumed.com/agreement.html";
this.title = '用户协议' this.title = "用户协议";
} else if (options.type == 2) { } else if (options.type == 2) {
this.urlPath = 'https://zmzm.taihumed.com/privacy.html' this.urlPath = "https://zmzm.taihumed.com/privacy.html";
this.title = '隐私策略' this.title = "隐私策略";
} }
}, },
onShow() { onShow() {},
},
methods: { methods: {
// 放大图片 // 放大图片
previewImage(url) { previewImage(url) {
@@ -61,32 +57,30 @@
urls: [url], urls: [url],
longPressActions: { longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"], itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function(res) { success: function (res) {
// console.log(res,'+++++') // console.log(res,'+++++')
}, },
}, },
}); });
}, },
// 方剂详情 // 方剂详情
}, },
};
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.contentBox { .contentBox {
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.contentBoxwebwiew { .contentBoxwebwiew {
height: 100%; height: 100%;
// .webwiew{ // .webwiew{
// height: 100%; // height: 100%;
// } // }
} }
.fullscreen-webview { .fullscreen-webview {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: fixed; position: fixed;
@@ -94,30 +88,30 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.mb-10 { .mb-10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
.content { .content {
font-size: 28rpx; font-size: 28rpx;
} }
.swiper-item { .swiper-item {
image { image {
margin: 0 auto; margin: 0 auto;
height: 250rpx; height: 250rpx;
} }
} }
.uni-margin-wrap { .uni-margin-wrap {
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding-top: 20rpx; padding-top: 20rpx;
background-color: #fff; background-color: #fff;
} }
.container { .container {
padding: 10rpx; padding: 10rpx;
// background-color: #fff; // background-color: #fff;
@@ -133,13 +127,13 @@
font-size: 32rpx; font-size: 32rpx;
font-weight: 700 !important; font-weight: 700 !important;
} }
} }
.flexbox { .flexbox {
display: flex; display: flex;
} }
/deep/ .uni-section-header__decoration.line { /deep/ .uni-section-header__decoration.line {
background-color: #18bc37; background-color: #18bc37;
} }
</style> </style>

View File

@@ -1,7 +1,8 @@
<template><page-meta <template>
<page-meta
:page-font-size="$baseFontSize() + 'px'" :page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'" :root-font-size="$baseFontSize() + 'px'"
></page-meta> ></page-meta>
<view v-if="show"> <view v-if="show">
<swiper <swiper
class="guide_pages_swiper" class="guide_pages_swiper"
@@ -131,14 +132,11 @@
</template> </template>
<script> <script>
import { import { mapState, mapMutations } from "vuex";
mapState,
mapMutations
} from "vuex";
export default { export default {
data() { data() {
return { return {
title:"融儒、医、美、文为一体", title: "融儒、医、美、文为一体",
// title:"融儒、释、道、医、美、文为一体", // title:"融儒、释、道、医、美、文为一体",
screenHeight: 667, screenHeight: 667,
show: false, show: false,
@@ -149,7 +147,6 @@ export default {
onReady() { onReady() {
// this.show = false; // this.show = false;
if (uni.getStorageSync("guidePages") != 2) { if (uni.getStorageSync("guidePages") != 2) {
let systemInfo = uni.getSystemInfoSync(); let systemInfo = uni.getSystemInfoSync();
this.screenHeight = systemInfo.screenHeight; this.screenHeight = systemInfo.screenHeight;
@@ -157,7 +154,6 @@ export default {
// this.protocolShow = true; // this.protocolShow = true;
} }
// else { // else {
// uni.switchTab({ // uni.switchTab({
// // url: "/pages/advertisement/index/index", // // url: "/pages/advertisement/index/index",
@@ -172,7 +168,7 @@ export default {
}, },
methods: { methods: {
openDetail(type) { openDetail(type) {
console.log('type at line 152:', type) console.log("type at line 152:", type);
uni.navigateTo({ uni.navigateTo({
url: "/pages/advertisement/index/detail?type=" + type, url: "/pages/advertisement/index/detail?type=" + type,
}); });
@@ -180,7 +176,7 @@ export default {
quit() { quit() {
if (uni.getSystemInfoSync().platform === "ios") { if (uni.getSystemInfoSync().platform === "ios") {
plus.runtime.launchApplication({ plus.runtime.launchApplication({
action: "QUIT" action: "QUIT",
}); });
} else { } else {
plus.runtime.quit(); plus.runtime.quit();
@@ -210,7 +206,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/style/mixin.scss'; @import "@/style/mixin.scss";
.guide_pages_swiper { .guide_pages_swiper {
position: fixed; position: fixed;
top: 0; top: 0;

View File

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

View File

@@ -1,4 +1,5 @@
<template><page-meta <template>
<page-meta
:page-font-size="$baseFontSize() + 'px'" :page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'" :root-font-size="$baseFontSize() + 'px'"
></page-meta> ></page-meta>
@@ -15,10 +16,19 @@
<view class="indexBox"> <view class="indexBox">
<!-- 轮播图 --> <!-- 轮播图 -->
<view class="swiper_box"> <view class="swiper_box">
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"> <swiper
<swiper-item v-for="(item,index) in swiperlist" :key="index"> :indicator-dots="true"
:autoplay="true"
:interval="3000"
:duration="1000"
>
<swiper-item v-for="(item, index) in swiperlist" :key="index">
<view class="swiper-item"> <view class="swiper-item">
<image :src="item.image" mode="widthFix " class="swiperImg"></image> <image
:src="item.image"
mode="widthFix "
class="swiperImg"
></image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@@ -29,12 +39,16 @@
<text>商品分类</text> <text>商品分类</text>
</view> </view>
<view class="classfy"> <view class="classfy">
<view v-for="(item,index) in gridArr" :key="index" @click='toClassify(item.catId,index)'> <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> --> <!-- <u-icon v-if="item.icon" :name="item.icon" :size="46"></u-icon> -->
<image :src="item.icon"></image> <image :src="item.icon"></image>
<text class="grid-text">{{item.name}}</text> <text class="grid-text">{{ item.name }}</text>
</view> </view>
<br clear="both"> <br clear="both" />
</view> </view>
<!-- 商品展示 --> <!-- 商品展示 -->
<view class="head_line"> <view class="head_line">
@@ -49,12 +63,16 @@
</view> </view>
<view class="limitedScrollBox"> <view class="limitedScrollBox">
<u-scroll-list indicatorActiveColor="#27b386"> <u-scroll-list indicatorActiveColor="#27b386">
<view class="limitedItem" v-for="(item,index) in seckillList" :key="index" <view
@click="goDetail(item.prodInfo.productId)"> class="limitedItem"
v-for="(item, index) in seckillList"
:key="index"
@click="goDetail(item.prodInfo.productId)"
>
<image :src="item.prodInfo.productImages" mode=""></image> <image :src="item.prodInfo.productImages" mode=""></image>
<text class="biaoti">{{item.prodInfo.productName}}</text> <text class="biaoti">{{ item.prodInfo.productName }}</text>
<text class="xian">{{item.seckillPrice}}</text> <text class="xian">{{ item.seckillPrice }}</text>
<text class="yuan">{{item.prodInfo.price}}</text> <text class="yuan">{{ item.prodInfo.price }}</text>
</view> </view>
</u-scroll-list> </u-scroll-list>
</view> </view>
@@ -66,21 +84,23 @@
<i @click="onShopMore('Hot')">查看更多 ></i> <i @click="onShopMore('Hot')">查看更多 ></i>
</view> </view>
<view class="goods"> <view class="goods">
<view class="goodsItem" v-for="(item,index) in goodsList" :key="item.productId" <view
@click="goDetail(item.productId)"> class="goodsItem"
v-for="(item, index) in goodsList"
:key="item.productId"
@click="goDetail(item.productId)"
>
<image :src="item.productImages" mode="" class="goodsImg"></image> <image :src="item.productImages" mode="" class="goodsImg"></image>
<view class="goodsContent"> <view class="goodsContent">
<view class="goodsName"> <view class="goodsName">
{{item.productName}} {{ item.productName }}
</view> </view>
<view class="goodsPrice"> <view class="goodsPrice"> {{ item.price }} </view>
{{item.price}}
</view> </view>
</view> </view>
<br clear="both" />
</view> </view>
<br clear="both"> <view style="height: 30rpx"></view>
</view>
<view style="height: 30rpx;"></view>
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<music-play :playData="playData"></music-play> <music-play :playData="playData"></music-play>
@@ -89,25 +109,24 @@
</template> </template>
<script> <script>
import musicPlay from '@/components/music.vue' import musicPlay from "@/components/music.vue";
import { import { mapState } from "vuex";
mapState export default {
} from 'vuex';
export default {
data() { data() {
return { return {
playData:{}, playData: {},
keyword: '', // 搜索索引值 keyword: "", // 搜索索引值
// 轮播图数据 // 轮播图数据
swiperlist: [{ swiperlist: [
image: '../../static/icon/home_ban_1.jpg', {
image: "../../static/icon/home_ban_1.jpg",
}, },
{ {
image: '../../static/icon//home_ban_2.jpg', image: "../../static/icon//home_ban_2.jpg",
}, },
{ {
image: '../../static/icon//home_ban_3.jpg', image: "../../static/icon//home_ban_3.jpg",
} },
], ],
totalCount: 4, totalCount: 4,
pageSize: 1, pageSize: 1,
@@ -121,65 +140,66 @@
// 商品列表 // 商品列表
goodsList: [], goodsList: [],
// 分类数据 // 分类数据
gridArr: [{ gridArr: [
{
icon: "list-dot", icon: "list-dot",
name: '更多' name: "更多",
}], },
} ],
};
}, },
computed: { computed: {
...mapState(['userInfo']), ...mapState(["userInfo"]),
}, },
components: { components: {
musicPlay musicPlay,
}, },
onLoad() { onLoad() {
// 获取分类 // 获取分类
this.$http this.$http.post("book/shopcategory/getOneLevel").then((res) => {
.post('book/shopcategory/getOneLevel')
.then(res => {
// 用一个空数组去接分类数据 // 用一个空数组去接分类数据
let arr = [] let arr = [];
if (res.list.length >= 5) { if (res.list.length >= 5) {
for (let i in res.list) { for (let i in res.list) {
if (i < 5) { if (i < 5) {
arr.push({ arr.push({
icon: "../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png", icon:
"../../static/icon/shop_bar_" +
(Number(i) + Number(1)) +
".png",
name: res.list[i].name, name: res.list[i].name,
catId: res.list[i].catId catId: res.list[i].catId,
}) });
} }
} }
arr.push({ arr.push({
icon: "../../static/icon/shop_bar_more.png", icon: "../../static/icon/shop_bar_more.png",
name: '更多' name: "更多",
}) });
this.gridArr = arr this.gridArr = arr;
} }
}) });
// 获取限时秒杀 // 获取限时秒杀
this.$http this.$http.get(`book/shopseckill/getSeckillProd`).then((res) => {
.get(`book/shopseckill/getSeckillProd`) this.seckillList = res.list;
.then(res => { console.log(this.seckillList);
this.seckillList = res.list });
console.log(this.seckillList)
})
// 获取精选商品 // 获取精选商品
this.$http this.$http
.post(`book/shopproduct/appGetList?limit=${this.limit}&page=${this.page}&istop=${this.istop}`) .post(
.then( `book/shopproduct/appGetList?limit=${this.limit}&page=${this.page}&istop=${this.istop}`
res => { )
this.goodsList = res.page.list .then((res) => {
}) this.goodsList = res.page.list;
});
}, },
methods: { methods: {
// 跳转详情页 // 跳转详情页
goDetail(id) { goDetail(id) {
uni.navigateTo({ uni.navigateTo({
url: './commodityDetail?id=' + id url: "./commodityDetail?id=" + id,
}); });
}, },
@@ -187,48 +207,46 @@
toClassify(catId, index) { toClassify(catId, index) {
if (catId) { if (catId) {
uni.navigateTo({ uni.navigateTo({
url: `./classify?type=${index}` url: `./classify?type=${index}`,
}) });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: './classifyAll' url: "./classifyAll",
}) });
} }
}, },
// 跳转搜索页 // 跳转搜索页
goSearch() { goSearch() {
uni.navigateTo({ uni.navigateTo({
url: './commoditySearch' url: "./commoditySearch",
}) });
}, },
// 列表跳页 // 列表跳页
onShopMore(e) { onShopMore(e) {
uni.navigateTo({ uni.navigateTo({
url: './bookShopType?type=' + e url: "./bookShopType?type=" + e,
}); });
}, },
},
} };
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.shopHeader { .shopHeader {
position: relative; position: relative;
top: 0; top: 0;
left: 0; left: 0;
} }
.search { .search {
padding: 10rpx; padding: 10rpx;
background-color: #fff; background-color: #fff;
margin: 10rpx 0; margin: 10rpx 0;
}
} .swiper_box {
.swiper_box {
margin-top: 20rpx; margin-top: 20rpx;
padding: 0 20rpx; padding: 0 20rpx;
@@ -243,9 +261,9 @@
border-radius: 20rpx; border-radius: 20rpx;
} }
} }
} }
.classfy { .classfy {
margin: 0 10rpx; margin: 0 10rpx;
border-radius: 30rpx; border-radius: 30rpx;
@@ -264,13 +282,10 @@
font-size: 25rpx; font-size: 25rpx;
margin-top: 4rpx; margin-top: 4rpx;
} }
} }
}
.head_line {
}
.head_line {
margin: 30rpx 0 30rpx 0; margin: 30rpx 0 30rpx 0;
padding: 10rpx; padding: 10rpx;
@@ -295,9 +310,9 @@
font-size: 24rpx; font-size: 24rpx;
margin: 15rpx 35rpx 0 0; margin: 15rpx 35rpx 0 0;
} }
} }
.limited { .limited {
width: 100%; width: 100%;
height: auto; height: auto;
padding: 20rpx 10rpx 10rpx 10rpx; padding: 20rpx 10rpx 10rpx 10rpx;
@@ -354,15 +369,13 @@
.yuan { .yuan {
text-decoration: line-through; text-decoration: line-through;
color: #c1c1c1; color: #c1c1c1;
}
}
}
} .goods {
}
}
.goods {
width: 100%; width: 100%;
.goodsItem { .goodsItem {
display: inline-block; display: inline-block;
width: 46%; width: 46%;
@@ -379,7 +392,6 @@
} }
.goodsContent { .goodsContent {
.goodsName { .goodsName {
margin-top: 10rpx; margin-top: 10rpx;
font-size: 30rpx; font-size: 30rpx;
@@ -391,7 +403,6 @@
margin: 5rpx 0 0 3rpx; margin: 5rpx 0 0 3rpx;
color: #bf0c0c; color: #bf0c0c;
font-weight: bold; font-weight: bold;
} }
} }
} }
@@ -399,5 +410,5 @@
.goodsItem:nth-child(2n) { .goodsItem:nth-child(2n) {
margin-left: 0; margin-left: 0;
} }
} }
</style> </style>

View File

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

View File

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

View File

@@ -1,65 +1,65 @@
<template><page-meta <template>
<page-meta
:page-font-size="$baseFontSize() + 'px'" :page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'" :root-font-size="$baseFontSize() + 'px'"
></page-meta> ></page-meta>
<view> <view>
<z-nav-bar title="全部分类"></z-nav-bar> <z-nav-bar title="全部分类"></z-nav-bar>
<view class="oneLevel"> <view class="oneLevel">
<view class="oneItem" v-for="(item,index) in oneLevel" @click="getTowLevel(index)"> <view
class="oneItem"
v-for="(item, index) in oneLevel"
@click="getTowLevel(index)"
>
<image :src="item.icon"></image> <image :src="item.icon"></image>
<text>{{item.name}}</text> <text>{{ item.name }}</text>
</view> </view>
</view> </view>
<music-play :playData="playData"></music-play> <music-play :playData="playData"></music-play>
</view> </view>
</template> </template>
<script> <script>
import musicPlay from '@/components/music.vue' import musicPlay from "@/components/music.vue";
export default { export default {
data() { data() {
return { return {
playData:{}, playData: {},
oneLevel: [], oneLevel: [],
} };
}, },
onLoad(e) { onLoad(e) {
this.$http this.$http.post("book/shopcategory/getOneLevel").then((res) => {
.post('book/shopcategory/getOneLevel') let arr = [];
.then(res => {
let arr = []
for (let i in res.list) { for (let i in res.list) {
arr.push({ arr.push({
icon: "../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png", icon:
"../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png",
name: res.list[i].name, name: res.list[i].name,
catId: res.list[i].catId catId: res.list[i].catId,
}) });
} }
this.oneLevel = arr this.oneLevel = arr;
}) });
}, },
components: { components: {
musicPlay musicPlay,
}, },
methods: { methods: {
// 点击分类跳转 // 点击分类跳转
getTowLevel(e) { getTowLevel(e) {
uni.navigateTo({ uni.navigateTo({
url: `./classify?type=${e}` url: `./classify?type=${e}`,
}) });
}, },
},
} };
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.oneLevel { .oneLevel {
margin: 10rpx 0 0 0; margin: 10rpx 0 0 0;
.oneItem { .oneItem {
display: inline-block; display: inline-block;
width: 20%; width: 20%;
@@ -76,6 +76,5 @@
font-size: 30rpx; font-size: 30rpx;
} }
} }
}
}
</style> </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 <template>
<page-meta
:page-font-size="$baseFontSize() + 'px'" :page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'" :root-font-size="$baseFontSize() + 'px'"
></page-meta> ></page-meta>
<view class=""> <view class="">
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
@@ -262,10 +263,15 @@
type="success" type="success"
></u-tag> ></u-tag>
</view> </view>
<view class="orderReal" style=" width: 100%; <view
class="orderReal"
style="
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;"> justify-content: space-between;
"
>
<span style="color: #666; margin-right: 10rpx; float: left" <span style="color: #666; margin-right: 10rpx; float: left"
>创建时间 : >创建时间 :
</span> </span>
@@ -1108,7 +1114,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
@import "@/style/common.scss"; @import "@/style/common.scss";
view,uni-view { view,
uni-view {
font-size: 28rpx; font-size: 28rpx;
} }
.expresslist { .expresslist {

File diff suppressed because it is too large Load Diff

View File

@@ -88,7 +88,17 @@
</image> </image>
<view class="normal_box"> <view class="normal_box">
<view class="normal_box_top" style="justify-content: space-between"> <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>
<view> <view>
@@ -97,16 +107,16 @@
v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null 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 >¥{{ 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 >VIP到手价</text
> >
<text <text
style=" style="
color: #8a8a8a; color: #8a8a8a;
font-size: 10px; font-size: 12px;
margin-left: 4px; margin-left: 4px;
font-weight: bold; font-weight: bold;
text-decoration: line-through; text-decoration: line-through;
@@ -116,16 +126,16 @@
</text> </text>
<text v-else-if="v.activityPrice && v.activityPrice > 0"> <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 >¥{{ 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
> >
<text <text
style=" style="
color: #8a8a8a; color: #8a8a8a;
font-size: 10px; font-size: 12px;
margin-left: 4px; margin-left: 4px;
font-weight: bold; font-weight: bold;
text-decoration: line-through; text-decoration: line-through;
@@ -134,25 +144,9 @@
> >
</text> </text>
<text v-else style="font-size: 12px" <text v-else style="font-size: 14px"
>¥{{ Number(v.price).toFixed(2) }}</text >¥{{ 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> </view>
</view> </view>
@@ -941,7 +935,12 @@ export default {
this.jfNumberShow = this.jfNumber.toFixed(2); 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) { if (this.actualPayment == 0) {
this.isDefaultCurrency = true; this.isDefaultCurrency = true;
@@ -1200,23 +1199,23 @@ export default {
} }
if (that.jfNumber == 0 || that.jfNumber == null) { if (that.jfNumber == 0 || that.jfNumber == null) {
that.jfNumberShow = "0.00"; that.jfNumberShow = "0.00";
that.actualPayment = that.totalPrice; that.actualPayment = that.totalPrice.toFixed(2);
} else { } else {
that.jfNumberShow = that.jfNumber.toFixed(2); 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.actualPayment +
that.freightNum - that.freightNum -
that.districtAmount - that.districtAmount -
that.vipPrice; that.vipPrice).toFixed(2);
} else { } else {
that.actualPayment = that.actualPayment =Number(
that.totalPrice + that.totalPrice +
that.freightNum - that.freightNum -
couponAmount - couponAmount -
that.districtAmount - that.districtAmount -
that.vipPrice; that.vipPrice).toFixed(2);
} }
if (this.actualPayment == 0 && !this.isShowAddress) { if (this.actualPayment == 0 && !this.isShowAddress) {
@@ -1314,12 +1313,13 @@ export default {
couponId: null, //优惠券Id couponId: null, //优惠券Id
// isSend: this.isSend, // isSend: this.isSend,
couponName: "", //优惠券名称 couponName: "", //优惠券名称
districtMoney: 0, //优惠金额 vipDiscountAmount: this.vipPrice, //折扣金额
districtMoney: this.districtAmount, //折扣金额
productList: this.goodsDataList.map((e) => { productList: this.goodsDataList.map((e) => {
return { return {
productId: e.productId, productId: e.productId,
quantity: 1, quantity: this.orderNumber,
}; };
}), //订单列表商品 }), //订单列表商品
orderType: "order", //订单类型 orderType: "order", //订单类型