提交
This commit is contained in:
@@ -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,9 +41,7 @@
|
|||||||
<!-- #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>
|
||||||
@@ -42,33 +51,33 @@
|
|||||||
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,16 +149,16 @@
|
|||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: e.errMsg,
|
content: e.errMsg,
|
||||||
showCancel: false
|
showCancel: false,
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
// #endif
|
// #endif
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@@ -153,7 +169,7 @@
|
|||||||
|
|
||||||
page {
|
page {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
background-color: #FFFFFF;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
@@ -215,6 +231,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: #007AFF;
|
color: #007aff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -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,7 +8,6 @@
|
|||||||
<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> -->
|
||||||
@@ -16,16 +16,15 @@
|
|||||||
|
|
||||||
<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()
|
||||||
// }
|
// }
|
||||||
@@ -56,18 +55,17 @@
|
|||||||
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 {
|
||||||
|
}
|
||||||
.bg {}
|
|
||||||
|
|
||||||
// .passbtn {
|
// .passbtn {
|
||||||
// width: 130rpx;
|
// width: 130rpx;
|
||||||
|
|||||||
@@ -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) {
|
||||||
@@ -68,9 +64,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 方剂详情
|
// 方剂详情
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -131,10 +132,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { mapState, mapMutations } from "vuex";
|
||||||
mapState,
|
|
||||||
mapMutations
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -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,7 +8,6 @@
|
|||||||
<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> -->
|
||||||
@@ -16,16 +16,15 @@
|
|||||||
|
|
||||||
<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()
|
||||||
// }
|
// }
|
||||||
@@ -56,18 +55,17 @@
|
|||||||
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 {
|
||||||
|
}
|
||||||
.bg {}
|
|
||||||
|
|
||||||
// .passbtn {
|
// .passbtn {
|
||||||
// width: 130rpx;
|
// width: 130rpx;
|
||||||
|
|||||||
@@ -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
|
||||||
|
:indicator-dots="true"
|
||||||
|
:autoplay="true"
|
||||||
|
:interval="3000"
|
||||||
|
:duration="1000"
|
||||||
|
>
|
||||||
<swiper-item v-for="(item, index) in swiperlist" :key="index">
|
<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,8 +63,12 @@
|
|||||||
</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>
|
||||||
@@ -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
|
|
||||||
} from 'vuex';
|
|
||||||
export default {
|
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,31 +207,30 @@
|
|||||||
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>
|
||||||
@@ -225,7 +244,6 @@
|
|||||||
padding: 10rpx;
|
padding: 10rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin: 10rpx 0;
|
margin: 10rpx 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.swiper_box {
|
.swiper_box {
|
||||||
@@ -264,10 +282,7 @@
|
|||||||
font-size: 25rpx;
|
font-size: 25rpx;
|
||||||
margin-top: 4rpx;
|
margin-top: 4rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.head_line {
|
.head_line {
|
||||||
@@ -354,7 +369,6 @@
|
|||||||
.yuan {
|
.yuan {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
color: #c1c1c1;
|
color: #c1c1c1;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -362,7 +376,6 @@
|
|||||||
.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;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,54 +7,74 @@
|
|||||||
<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
|
|
||||||
} from 'vuex';
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -61,7 +82,7 @@
|
|||||||
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,113 +195,116 @@
|
|||||||
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;
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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,66 +32,114 @@
|
|||||||
<!-- 二级分类、商品 -->
|
<!-- 二级分类、商品 -->
|
||||||
<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
|
|
||||||
} from 'vuex';
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
playData: {},
|
playData: {},
|
||||||
highlight: '', // 高亮下标
|
highlight: "", // 高亮下标
|
||||||
current: 0,
|
current: 0,
|
||||||
twocurrent: 0,
|
twocurrent: 0,
|
||||||
oneLevel: [],
|
oneLevel: [],
|
||||||
@@ -87,15 +147,15 @@
|
|||||||
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,109 +240,117 @@
|
|||||||
// 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>
|
||||||
@@ -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;
|
||||||
@@ -337,7 +403,8 @@
|
|||||||
.oneBox {
|
.oneBox {
|
||||||
margin: 10rpx auto;
|
margin: 10rpx auto;
|
||||||
|
|
||||||
.oneLevel {}
|
.oneLevel {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.twoBox {
|
.twoBox {
|
||||||
@@ -350,8 +417,6 @@
|
|||||||
// width: 100%;
|
// width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.towLevel {
|
.towLevel {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -8,68 +9,137 @@
|
|||||||
<z-nav-bar title="商品详情" bgColor="red"></z-nav-bar>
|
<z-nav-bar title="商品详情" bgColor="red"></z-nav-bar>
|
||||||
</view>
|
</view>
|
||||||
<view class="swiperBox">
|
<view class="swiperBox">
|
||||||
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"
|
<swiper
|
||||||
style="width: 100%;height: 100%;">
|
:indicator-dots="true"
|
||||||
<swiper-item v-for="(item,index) in swiperlist" :key="index" style="width: 100%;height: 100%;">
|
:autoplay="true"
|
||||||
<image :src="item" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
|
:interval="3000"
|
||||||
|
:duration="1000"
|
||||||
|
style="width: 100%; height: 100%"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
v-for="(item, index) in swiperlist"
|
||||||
|
:key="index"
|
||||||
|
style="width: 100%; height: 100%"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="item"
|
||||||
|
mode="scaleToFill"
|
||||||
|
style="width: 100%; height: 100%"
|
||||||
|
></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
<view class="commodityContent">
|
<view class="commodityContent">
|
||||||
<view class="commodityPrice">
|
<view class="commodityPrice">
|
||||||
<span>¥</span><em>{{ productInfo.price }}</em>
|
<span>¥</span><em>{{ productInfo.price }}</em>
|
||||||
<span class="oldPrice " v-if="productInfo.activityPrice">原价¥{{productInfo.activityPrice}}</span>
|
<span class="oldPrice" v-if="productInfo.activityPrice"
|
||||||
|
>原价¥{{ productInfo.activityPrice }}</span
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="commodityyName">
|
<view class="commodityyName">
|
||||||
{{ productInfo.productName }}
|
{{ productInfo.productName }}
|
||||||
<span v-if="productInfo.productStock==0" style="color: #aaa;font-size:26rpx;">(无货)</span>
|
<span
|
||||||
<view><text class="SoldNumber">已售<span>{{productInfo.sumSales}}</span>件</text></view>
|
v-if="productInfo.productStock == 0"
|
||||||
|
style="color: #aaa; font-size: 26rpx"
|
||||||
|
>(无货)</span
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
><text class="SoldNumber"
|
||||||
|
>已售<span>{{ productInfo.sumSales }}</span
|
||||||
|
>件</text
|
||||||
|
></view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="contentButton">
|
<view class="contentButton">
|
||||||
<u-tabs :scrollable="false" :list="contentButtonList" @click="contentButtonClick"></u-tabs>
|
<u-tabs
|
||||||
|
:scrollable="false"
|
||||||
|
:list="contentButtonList"
|
||||||
|
@click="contentButtonClick"
|
||||||
|
></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<!-- 详情 + 评价1 -->
|
<!-- 详情 + 评价1 -->
|
||||||
<view v-if="contentShow == 0">
|
<view v-if="contentShow == 0">
|
||||||
<view class="tingshuList" v-if="listenList.length > 0">
|
<view class="tingshuList" v-if="listenList.length > 0">
|
||||||
<h4>赠送听书权益</h4>
|
<h4>赠送听书权益</h4>
|
||||||
<view class="item flexbox" v-for="item in listenList" :key="item.id" style="vertical-align: middle;">
|
<view
|
||||||
<text style="margin-top: 10rpx; padding-right: 10rpx;">{{item.name}}</text>
|
class="item flexbox"
|
||||||
<u-icon v-if="item.canListen == 'true'" name="volume" color="#71d5a1" size="24" @click="goToListen(item.id)"></u-icon>
|
v-for="item in listenList"
|
||||||
<u-icon v-else name="volume" color="#71d5a1" size="24" @click="goToListenNone(item.id)"></u-icon>
|
:key="item.id"
|
||||||
|
style="vertical-align: middle"
|
||||||
|
>
|
||||||
|
<text style="margin-top: 10rpx; padding-right: 10rpx">{{
|
||||||
|
item.name
|
||||||
|
}}</text>
|
||||||
|
<u-icon
|
||||||
|
v-if="item.canListen == 'true'"
|
||||||
|
name="volume"
|
||||||
|
color="#71d5a1"
|
||||||
|
size="24"
|
||||||
|
@click="goToListen(item.id)"
|
||||||
|
></u-icon>
|
||||||
|
<u-icon
|
||||||
|
v-else
|
||||||
|
name="volume"
|
||||||
|
color="#71d5a1"
|
||||||
|
size="24"
|
||||||
|
@click="goToListenNone(item.id)"
|
||||||
|
></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bookInfo">
|
<view class="bookInfo">
|
||||||
<u-row customStyle="margin-bottom: 10px">
|
<u-row customStyle="margin-bottom: 10px">
|
||||||
<u-col ><span>书名:{{productInfo.productName}}</span></u-col>
|
<u-col
|
||||||
|
><span>书名:{{ productInfo.productName }}</span></u-col
|
||||||
|
>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row customStyle="margin-bottom: 10px">
|
<u-row customStyle="margin-bottom: 10px">
|
||||||
<u-col v-if="productInfo.author"><span>作者:{{productInfo.author}}</span></u-col>
|
<u-col v-if="productInfo.author"
|
||||||
|
><span>作者:{{ productInfo.author }}</span></u-col
|
||||||
|
>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row>
|
<u-row>
|
||||||
|
<u-col span="6" v-if="productInfo.publisher"
|
||||||
<u-col span="6" v-if="productInfo.publisher"><span>出版社:{{productInfo.publisher}}</span></u-col>
|
><span>出版社:{{ productInfo.publisher }}</span></u-col
|
||||||
<u-col span="6" v-if="productInfo.pubDate"><span>出版时间:{{ productInfo.pubDate | formatDate }}</span></u-col>
|
>
|
||||||
|
<u-col span="6" v-if="productInfo.pubDate"
|
||||||
|
><span
|
||||||
|
>出版时间:{{ productInfo.pubDate | formatDate }}</span
|
||||||
|
></u-col
|
||||||
|
>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col span="6" v-if="productInfo.format"><span>开本:{{productInfo.format}}</span></u-col>
|
<u-col span="6" v-if="productInfo.format"
|
||||||
<u-col span="6" v-if="productInfo.pageNum"><span>页数:{{productInfo.pageNum}}</span></u-col>
|
><span>开本:{{ productInfo.format }}</span></u-col
|
||||||
|
>
|
||||||
|
<u-col span="6" v-if="productInfo.pageNum"
|
||||||
|
><span>页数:{{ productInfo.pageNum }}</span></u-col
|
||||||
|
>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col span="6" v-if="productInfo.quality"><span>内文用纸材质:{{productInfo.quality}}</span></u-col>
|
<u-col span="6" v-if="productInfo.quality"
|
||||||
|
><span>内文用纸材质:{{ productInfo.quality }}</span></u-col
|
||||||
|
>
|
||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="commodityIntroduce" v-html="productInfo.productDetails"> -->
|
<!-- <view class="commodityIntroduce" v-html="productInfo.productDetails"> -->
|
||||||
<view class="commodityIntroduce">
|
<view class="commodityIntroduce">
|
||||||
<view v-if="productInfo.productDetails">
|
<view v-if="productInfo.productDetails">
|
||||||
<rich-text v-if="productInfo.productDetails" class="xiangqing" :nodes="productInfo.productDetails|formatRichText"></rich-text>
|
<rich-text
|
||||||
|
v-if="productInfo.productDetails"
|
||||||
|
class="xiangqing"
|
||||||
|
:nodes="productInfo.productDetails | formatRichText"
|
||||||
|
></rich-text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<!-- 商品评价 -->
|
<!-- 商品评价 -->
|
||||||
<view class="" v-if="commentsList && commentsList.length > 0">
|
<view class="" v-if="commentsList && commentsList.length > 0">
|
||||||
<view class="pingjiaBox" v-for="(item, index) in commentsList" :key="index">
|
<view
|
||||||
|
class="pingjiaBox"
|
||||||
|
v-for="(item, index) in commentsList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="flexbox">
|
<view class="flexbox">
|
||||||
<view class="touxiang">
|
<view class="touxiang">
|
||||||
<image :src="item.avatar" mode="aspectFit"></image>
|
<image :src="item.avatar" mode="aspectFit"></image>
|
||||||
@@ -77,26 +147,60 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<view class="mb30">
|
<view class="mb30">
|
||||||
<span :class="['star',item.starlevel >= 1 ? 'starLight':'starGray']"></span>
|
<span
|
||||||
<span :class="['star',item.starlevel >= 2 ? 'starLight':'starGray']"></span>
|
:class="[
|
||||||
<span :class="['star',item.starlevel >= 3 ? 'starLight':'starGray']"></span>
|
'star',
|
||||||
<span :class="['star',item.starlevel >= 4 ? 'starLight':'starGray']"></span>
|
item.starlevel >= 1 ? 'starLight' : 'starGray',
|
||||||
<span :class="['star',item.starlevel >= 5 ? 'starLight':'starGray']"></span>
|
]"
|
||||||
|
></span>
|
||||||
|
<span
|
||||||
|
:class="[
|
||||||
|
'star',
|
||||||
|
item.starlevel >= 2 ? 'starLight' : 'starGray',
|
||||||
|
]"
|
||||||
|
></span>
|
||||||
|
<span
|
||||||
|
:class="[
|
||||||
|
'star',
|
||||||
|
item.starlevel >= 3 ? 'starLight' : 'starGray',
|
||||||
|
]"
|
||||||
|
></span>
|
||||||
|
<span
|
||||||
|
:class="[
|
||||||
|
'star',
|
||||||
|
item.starlevel >= 4 ? 'starLight' : 'starGray',
|
||||||
|
]"
|
||||||
|
></span>
|
||||||
|
<span
|
||||||
|
:class="[
|
||||||
|
'star',
|
||||||
|
item.starlevel >= 5 ? 'starLight' : 'starGray',
|
||||||
|
]"
|
||||||
|
></span>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<div class="pjimgs flexbox">
|
<div class="pjimgs flexbox">
|
||||||
<view class="item" v-for="(item1, index) in item.images">
|
<view class="item" v-for="(item1, index) in item.images">
|
||||||
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1" mode="aspectFill" style="width:100%; height: 50px;"></image>
|
<image
|
||||||
|
v-if="item1.length > 10"
|
||||||
|
@click="previewImage(item1)"
|
||||||
|
:src="item1"
|
||||||
|
mode="aspectFill"
|
||||||
|
style="width: 100%; height: 50px"
|
||||||
|
></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<view class="content" v-html="item.phtml"></view>
|
<view class="content" v-html="item.phtml"></view>
|
||||||
<text class="time">{{ item.createdate }}</text>
|
<text class="time">{{ item.createdate }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 显示追平 -->
|
<!-- 显示追平 -->
|
||||||
<view class="zhuiping item" v-if="item.zphtml != ''" style="padding-left: 50px;">
|
<view
|
||||||
<h5 style="color: #dbdbdb; margin:10px;">追评内容:</h5>
|
class="zhuiping item"
|
||||||
|
v-if="item.zphtml != ''"
|
||||||
|
style="padding-left: 50px"
|
||||||
|
>
|
||||||
|
<h5 style="color: #dbdbdb; margin: 10px">追评内容:</h5>
|
||||||
<view class="flexbox">
|
<view class="flexbox">
|
||||||
<view class="contentBox">
|
<view class="contentBox">
|
||||||
<view class="content" v-html="item.zphtml"></view>
|
<view class="content" v-html="item.zphtml"></view>
|
||||||
@@ -110,48 +214,56 @@
|
|||||||
<text>暂无评价~</text>
|
<text>暂无评价~</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 120rpx;"></view>
|
<view style="height: 120rpx"></view>
|
||||||
</view>
|
</view>
|
||||||
<uni-goods-nav class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
|
<uni-goods-nav
|
||||||
@buttonClick="buttonClick" />
|
class="goods_nav"
|
||||||
|
:fill="true"
|
||||||
|
:options="options"
|
||||||
|
:buttonGroup="buttonGroup"
|
||||||
|
@click="onClick"
|
||||||
|
@buttonClick="buttonClick"
|
||||||
|
/>
|
||||||
<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 emojiList1 from '../../bkhumor-emojiplus/emoji/biaoqin.js'
|
import emojiList1 from "../../bkhumor-emojiplus/emoji/biaoqin.js";
|
||||||
import $http from '@/config/requestConfig.js';
|
import $http from "@/config/requestConfig.js";
|
||||||
import {
|
import { mapState } from "vuex";
|
||||||
mapState
|
import loginVue from "../user/login.vue";
|
||||||
} from 'vuex';
|
|
||||||
import loginVue from '../user/login.vue';
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
playData: {},
|
playData: {},
|
||||||
contentShow: 0,
|
contentShow: 0,
|
||||||
options: [{
|
options: [
|
||||||
icon: 'cart',
|
|
||||||
text: '购物车'
|
|
||||||
}],
|
|
||||||
buttonGroup: [{
|
|
||||||
text: '加入购物车',
|
|
||||||
backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
|
|
||||||
color: '#fff'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
text: '立即购买',
|
icon: "cart",
|
||||||
backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)',
|
text: "购物车",
|
||||||
color: '#fff'
|
},
|
||||||
}
|
|
||||||
],
|
],
|
||||||
contentButtonList: [{
|
buttonGroup: [
|
||||||
name: '商品详情'
|
{
|
||||||
|
text: "加入购物车",
|
||||||
|
backgroundColor: "linear-gradient(90deg, #FFCD1E, #FF8A18)",
|
||||||
|
color: "#fff",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '商品评价'
|
text: "立即购买",
|
||||||
}
|
backgroundColor: "linear-gradient(90deg, #FE6035, #EF1224)",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contentButtonList: [
|
||||||
|
{
|
||||||
|
name: "商品详情",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "商品评价",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
// 轮播图数据
|
// 轮播图数据
|
||||||
swiperlist: [],
|
swiperlist: [],
|
||||||
@@ -161,33 +273,33 @@
|
|||||||
cartList: [], // 购物车列表
|
cartList: [], // 购物车列表
|
||||||
commentsList: [], // 评论列表
|
commentsList: [], // 评论列表
|
||||||
productId: null, // 商品评论
|
productId: null, // 商品评论
|
||||||
listenList:[] // 关联得听书
|
listenList: [], // 关联得听书
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.productId = e.id
|
this.productId = e.id;
|
||||||
this.getProDetail(e)
|
this.getProDetail(e);
|
||||||
this.getComments()
|
this.getComments();
|
||||||
// console.log(emojiList1,'emojiList1')
|
// console.log(emojiList1,'emojiList1')
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo']),
|
...mapState(["userInfo"]),
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
musicPlay
|
musicPlay,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goToListen(id) {
|
goToListen(id) {
|
||||||
// 跳转到听书
|
// 跳转到听书
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "../listen/listen?bookid="+ id
|
url: "../listen/listen?bookid=" + id,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 放大图片
|
// 放大图片
|
||||||
previewImage(url) {
|
previewImage(url) {
|
||||||
console.log(url)
|
console.log(url);
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: [url]
|
urls: [url],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取html格式的评论1
|
// 获取html格式的评论1
|
||||||
@@ -197,205 +309,218 @@
|
|||||||
// 这里处理 链接 换行符
|
// 这里处理 链接 换行符
|
||||||
let replacedStr = comment.replace(/\[([^(\]|\[)]*)\]/g, (item, index) => {
|
let replacedStr = comment.replace(/\[([^(\]|\[)]*)\]/g, (item, index) => {
|
||||||
// console.log(item, index)
|
// console.log(item, index)
|
||||||
var indexss = emojiList1.findIndex(item1 => item1.alt === item)
|
var indexss = emojiList1.findIndex((item1) => item1.alt === item);
|
||||||
// console.log(indexss, 'indexss')
|
// console.log(indexss, 'indexss')
|
||||||
return '<img src="https://www.nuttyreading.com/emojis/emojis/qq/' + emojiList1[indexss].url + '" width="18rpx">';
|
return (
|
||||||
|
'<img src="https://www.nuttyreading.com/emojis/emojis/qq/' +
|
||||||
|
emojiList1[indexss].url +
|
||||||
|
'" width="18rpx">'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
// console.log(replacedStr,'replacedStr')
|
// console.log(replacedStr,'replacedStr')
|
||||||
return replacedStr.replace(/(\r\n)|(\n)/g, '<br>');
|
return replacedStr.replace(/(\r\n)|(\n)/g, "<br>");
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 获取评价
|
// 获取评价
|
||||||
getComments() {
|
getComments() {
|
||||||
$http.request({
|
$http
|
||||||
|
.request({
|
||||||
url: "buy/record/All",
|
url: "buy/record/All",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档1
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档1
|
||||||
data: {
|
data: {
|
||||||
'bookid': this.productId
|
bookid: this.productId,
|
||||||
},
|
},
|
||||||
header: { //默认 无 说明:请求头
|
header: {
|
||||||
'Content-Type': 'application/json'
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res.list, 'res.list')
|
console.log(res.list, "res.list");
|
||||||
this.commentsList = res.list.map(item => {
|
this.commentsList = res.list.map((item) => {
|
||||||
var imgList = []
|
var imgList = [];
|
||||||
if (item.images !== null) {
|
if (item.images !== null) {
|
||||||
imgList = item.images.split(',')
|
imgList = item.images.split(",");
|
||||||
item.images = imgList
|
item.images = imgList;
|
||||||
return item
|
return item;
|
||||||
} else {
|
} else {
|
||||||
return item
|
return item;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
// 评论格式化
|
// 评论格式化
|
||||||
var newarr = []
|
var newarr = [];
|
||||||
this.commentsList.forEach((item1) => {
|
this.commentsList.forEach((item1) => {
|
||||||
var pjstr = ''
|
var pjstr = "";
|
||||||
var zpstr = ''
|
var zpstr = "";
|
||||||
pjstr = this.getHtmlComment(item1.content)
|
pjstr = this.getHtmlComment(item1.content);
|
||||||
item1.followUpcontent == '' ? zpstr = '' : zpstr = this.getHtmlComment(item1.followUpcontent)
|
item1.followUpcontent == ""
|
||||||
|
? (zpstr = "")
|
||||||
|
: (zpstr = this.getHtmlComment(item1.followUpcontent));
|
||||||
//console.log(pjstr,'99999999999----------')
|
//console.log(pjstr,'99999999999----------')
|
||||||
item1.phtml = pjstr
|
item1.phtml = pjstr;
|
||||||
item1.zphtml = zpstr
|
item1.zphtml = zpstr;
|
||||||
newarr.push(item1)
|
newarr.push(item1);
|
||||||
|
});
|
||||||
})
|
this.commentsList = newarr;
|
||||||
this.commentsList = newarr
|
|
||||||
// console.log(this.commentsList,'评价+++++')
|
// console.log(this.commentsList,'评价+++++')
|
||||||
// this.commentsList = res.list
|
// this.commentsList = res.list
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
getProDetail(e) {
|
getProDetail(e) {
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中'
|
title: "加载中",
|
||||||
});
|
});
|
||||||
console.log(e.id,'e.id')
|
console.log(e.id, "e.id");
|
||||||
this.$http
|
this.$http.post("/book/shopproduct/info/" + e.id).then((res) => {
|
||||||
.post('/book/shopproduct/info/' + e.id)
|
console.log("shopproduct", res);
|
||||||
.then(res => {
|
this.productInfo = res.shopProduct;
|
||||||
console.log('shopproduct',res)
|
this.listenList = res.shopProduct.bookidsimages;
|
||||||
this.productInfo = res.shopProduct
|
if (
|
||||||
this.listenList = res.shopProduct.bookidsimages
|
this.productInfo.productImageList == null ||
|
||||||
if (this.productInfo.productImageList == null || this.productInfo.productImageList == '') {
|
this.productInfo.productImageList == ""
|
||||||
this.swiperlist.push(this.productInfo.productImages)
|
) {
|
||||||
|
this.swiperlist.push(this.productInfo.productImages);
|
||||||
} else {
|
} else {
|
||||||
let imgList = this.productInfo.productImageList.split(",")
|
let imgList = this.productInfo.productImageList.split(",");
|
||||||
// if(this.productInfo.productDetails != null){
|
// if(this.productInfo.productDetails != null){
|
||||||
// let info = this.formatRichText(this.productInfo.productDetails)
|
// let info = this.formatRichText(this.productInfo.productDetails)
|
||||||
// }
|
// }
|
||||||
// this.productInfo.productDetails = info
|
// this.productInfo.productDetails = info
|
||||||
for (var i = 0; i < imgList.length; i++) {
|
for (var i = 0; i < imgList.length; i++) {
|
||||||
this.swiperlist.push(imgList[i])
|
this.swiperlist.push(imgList[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
contentButtonClick(e) {
|
contentButtonClick(e) {
|
||||||
this.contentShow = e.index
|
this.contentShow = e.index;
|
||||||
},
|
},
|
||||||
// 点击购物车
|
// 点击购物车
|
||||||
onClick(e) {
|
onClick(e) {
|
||||||
console.log(e.content.text)
|
console.log(e.content.text);
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '../peanut/shopping'
|
url: "../peanut/shopping",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 点击按钮组间
|
// 点击按钮组间
|
||||||
buttonClick(e) {
|
buttonClick(e) {
|
||||||
console.log(e)
|
console.log(e);
|
||||||
if (e.index == 0) {
|
if (e.index == 0) {
|
||||||
// 点击的是加入购物车
|
// 点击的是加入购物车
|
||||||
this.addCart()
|
this.addCart();
|
||||||
} else {
|
} else {
|
||||||
// 点击的是立即购买
|
// 点击的是立即购买
|
||||||
this.goPurse()
|
this.goPurse();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goToListenNone() {
|
goToListenNone() {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'该书暂未生成音频内容,敬请期待!',
|
title: "该书暂未生成音频内容,敬请期待!",
|
||||||
icon:'none'
|
icon: "none",
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 加入购物车
|
// 加入购物车
|
||||||
addCart() {
|
addCart() {
|
||||||
if (this.productInfo.productStock == 0) {
|
if (this.productInfo.productStock == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '商品库存不足',
|
title: "商品库存不足",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
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;
|
||||||
this.isAdd()
|
this.isAdd();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
isAdd() {
|
isAdd() {
|
||||||
// 统计商品信息
|
// 统计商品信息
|
||||||
let data = {
|
let data = {
|
||||||
"userId": this.userInfo.id,
|
userId: this.userInfo.id,
|
||||||
"productId": this.productInfo.productId,
|
productId: this.productInfo.productId,
|
||||||
"productAmount": this.productAmount,
|
productAmount: this.productAmount,
|
||||||
"price": this.productInfo.price
|
price: this.productInfo.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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -403,41 +528,56 @@
|
|||||||
goPurse() {
|
goPurse() {
|
||||||
if (this.productInfo.productStock == 0) {
|
if (this.productInfo.productStock == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '商品库存不足',
|
title: "商品库存不足",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../bookShop/settlement?type=2&list=' + this.productInfo.productId
|
url:
|
||||||
|
"../bookShop/settlement?type=2&list=" + this.productInfo.productId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
formatRichText (html) { //控制小程序中图片大小
|
formatRichText(html) {
|
||||||
|
//控制小程序中图片大小
|
||||||
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
|
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
|
||||||
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
|
match = match
|
||||||
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
|
.replace(/style="[^"]+"/gi, "")
|
||||||
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
|
.replace(/style='[^']+'/gi, "");
|
||||||
|
match = match
|
||||||
|
.replace(/width="[^"]+"/gi, "")
|
||||||
|
.replace(/width='[^']+'/gi, "");
|
||||||
|
match = match
|
||||||
|
.replace(/height="[^"]+"/gi, "")
|
||||||
|
.replace(/height='[^']+'/gi, "");
|
||||||
return match;
|
return match;
|
||||||
});
|
});
|
||||||
newContent = newContent.replace(/style="[^"]+"/gi,function(match,capture){
|
newContent = newContent.replace(
|
||||||
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
|
/style="[^"]+"/gi,
|
||||||
|
function (match, capture) {
|
||||||
|
match = match
|
||||||
|
.replace(/width:[^;]+;/gi, "max-width:100%;")
|
||||||
|
.replace(/width:[^;]+;/gi, "max-width:100%;");
|
||||||
return match;
|
return match;
|
||||||
});
|
}
|
||||||
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
|
);
|
||||||
newContent = newContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
|
newContent = newContent.replace(/<br[^>]*\/>/gi, "");
|
||||||
|
newContent = newContent.replace(
|
||||||
|
/\<img/gi,
|
||||||
|
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"'
|
||||||
|
);
|
||||||
return newContent;
|
return newContent;
|
||||||
},
|
},
|
||||||
// 去购物车
|
// 去购物车
|
||||||
goCard() {
|
goCard() {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '../peanut/shopping'
|
url: "../peanut/shopping",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
filters: {/**
|
filters: {
|
||||||
|
/**
|
||||||
* 处理富文本里的图片宽度自适应
|
* 处理富文本里的图片宽度自适应
|
||||||
* 1.去掉img标签里的style、width、height属性
|
* 1.去掉img标签里的style、width、height属性
|
||||||
* 2.img标签添加style属性:max-width:100%;height:auto
|
* 2.img标签添加style属性:max-width:100%;height:auto
|
||||||
@@ -446,70 +586,158 @@ formatRichText (html) { //控制小程序中图片大小
|
|||||||
* @param html
|
* @param html
|
||||||
* @returns {void|string|*}
|
* @returns {void|string|*}
|
||||||
*/
|
*/
|
||||||
formatRichText (html) { //控制小程序中图片大小
|
formatRichText(html) {
|
||||||
|
//控制小程序中图片大小
|
||||||
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
|
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
|
||||||
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
|
match = match
|
||||||
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
|
.replace(/style="[^"]+"/gi, "")
|
||||||
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
|
.replace(/style='[^']+'/gi, "");
|
||||||
|
match = match
|
||||||
|
.replace(/width="[^"]+"/gi, "")
|
||||||
|
.replace(/width='[^']+'/gi, "");
|
||||||
|
match = match
|
||||||
|
.replace(/height="[^"]+"/gi, "")
|
||||||
|
.replace(/height='[^']+'/gi, "");
|
||||||
return match;
|
return match;
|
||||||
});
|
});
|
||||||
newContent = newContent.replace(/style="[^"]+"/gi,function(match,capture){
|
newContent = newContent.replace(
|
||||||
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
|
/style="[^"]+"/gi,
|
||||||
|
function (match, capture) {
|
||||||
|
match = match
|
||||||
|
.replace(/width:[^;]+;/gi, "max-width:100%;")
|
||||||
|
.replace(/width:[^;]+;/gi, "max-width:100%;");
|
||||||
return match;
|
return match;
|
||||||
});
|
}
|
||||||
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
|
);
|
||||||
newContent = newContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
|
newContent = newContent.replace(/<br[^>]*\/>/gi, "");
|
||||||
|
newContent = newContent.replace(
|
||||||
|
/\<img/gi,
|
||||||
|
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"'
|
||||||
|
);
|
||||||
return newContent;
|
return newContent;
|
||||||
},
|
},
|
||||||
// 时间格式化
|
// 时间格式化
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
console.log(date)
|
console.log(date);
|
||||||
let newDate = new Date(date);
|
let newDate = new Date(date);
|
||||||
let year = newDate.getFullYear();
|
let year = newDate.getFullYear();
|
||||||
let month = newDate.getMonth().toString().padStart(2, 0);
|
let month = newDate.getMonth().toString().padStart(2, 0);
|
||||||
let day = newDate.getDay().toString().padStart(2, 0);
|
let day = newDate.getDay().toString().padStart(2, 0);
|
||||||
return year + '-' + month + '-' + day;
|
return year + "-" + month + "-" + day;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.tingshuList{margin-top: 20rpx; background-color: #fff; padding: 20rpx;
|
.tingshuList {
|
||||||
border-radius: 20rpx; margin-bottom: 20rpx; padding-top: 40rpx;
|
margin-top: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding-top: 40rpx;
|
||||||
background-image: linear-gradient(0deg, #f7fffc 0%, #def0ea 100%);
|
background-image: linear-gradient(0deg, #f7fffc 0%, #def0ea 100%);
|
||||||
.item{margin-bottom: 20rpx; vertical-align: middle; }
|
.item {
|
||||||
h4{color: #5fb386; font-size: 40rpx; margin-bottom: 20rpx;}
|
margin-bottom: 20rpx;
|
||||||
text{color: #444; font-size: 32rpx; padding-left: 20rpx;}
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.pjimgs{ margin: 10px 0;flex-wrap: wrap; display: flex; justify-content: space-between;
|
h4 {
|
||||||
.item{width: 23%; margin-right: 10px;
|
color: #5fb386;
|
||||||
image{ }
|
font-size: 40rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
text {
|
||||||
|
color: #444;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pjimgs {
|
||||||
|
margin: 10px 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
.item {
|
||||||
|
width: 23%;
|
||||||
|
margin-right: 10px;
|
||||||
|
image {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.star {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
.starGray {
|
||||||
|
background: url(../../static/icon/star_greey.png) no-repeat;
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
.starLight {
|
||||||
|
background: url(../../static/icon/star_light.png) no-repeat;
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
.quesheng {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 100rpx;
|
||||||
|
color: #8b8a91;
|
||||||
|
}
|
||||||
|
.pingjiaBox {
|
||||||
|
color: #555;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.contentBox {
|
||||||
|
width: calc(100% - 50px);
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
.content {
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
float: right;
|
||||||
}
|
}
|
||||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
|
||||||
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }
|
|
||||||
.starLight{ background : url(../../static/icon/star_light.png) no-repeat; background-size: contain;}
|
|
||||||
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91;}
|
|
||||||
.pingjiaBox{color: #555; margin-bottom: 20rpx;}
|
|
||||||
.flexbox{display: flex;}
|
|
||||||
.contentBox{width: calc(100% - 50px);box-sizing: border-box; padding-left: 20rpx;
|
|
||||||
.content{font-size: 28rpx; line-height: 40rpx;}
|
|
||||||
.time{font-size: 24rpx; color: #999; margin-top: 6rpx; float: right;}
|
|
||||||
}
|
}
|
||||||
.nowrap {
|
.nowrap {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.touxiang{width:50px; overflow: hidden; text-align: center;
|
.touxiang {
|
||||||
image{width:50px !important; padding: 3px; height: 50px !important; border: 1px solid #eee; border-radius: 64px; overflow: hidden;;}
|
width: 50px;
|
||||||
.username{font-size: 24rpx; color: #999; margin-top: 6rpx; }
|
overflow: hidden;
|
||||||
|
text-align: center;
|
||||||
|
image {
|
||||||
|
width: 50px !important;
|
||||||
|
padding: 3px;
|
||||||
|
height: 50px !important;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.username {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.xiangqing {
|
.xiangqing {
|
||||||
overflow: hidden; overflow-x: hidden;
|
overflow: hidden;
|
||||||
img{display: block; max-width: 100%;}
|
overflow-x: hidden;
|
||||||
p{max-width: 100%;}
|
img {
|
||||||
|
display: block;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.goods_nav {
|
.goods_nav {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -530,7 +758,7 @@ formatRichText (html) { //控制小程序中图片大小
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #555;
|
color: #555;
|
||||||
border-radius: 20rpx 20rpx 0 0
|
border-radius: 20rpx 20rpx 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
@@ -551,7 +779,6 @@ formatRichText (html) { //控制小程序中图片大小
|
|||||||
}
|
}
|
||||||
|
|
||||||
.commodityContent {
|
.commodityContent {
|
||||||
|
|
||||||
margin: 30rpx 20rpx 10rpx 20rpx;
|
margin: 30rpx 20rpx 10rpx 20rpx;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
@@ -625,7 +852,6 @@ formatRichText (html) { //控制小程序中图片大小
|
|||||||
}
|
}
|
||||||
|
|
||||||
.goBuy {
|
.goBuy {
|
||||||
|
|
||||||
background-color: #cf3906;
|
background-color: #cf3906;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||||
@@ -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 {
|
||||||
|
|||||||
@@ -1,8 +1,20 @@
|
|||||||
<template><page-meta :page-font-size="$baseFontSize() + 'px'" :root-font-size="$baseFontSize() + 'px'"></page-meta>
|
<template>
|
||||||
<view class="container commonPageBox commonDetailPage" style="background-color: #f2f2f2">
|
<page-meta
|
||||||
|
:page-font-size="$baseFontSize() + 'px'"
|
||||||
|
:root-font-size="$baseFontSize() + 'px'"
|
||||||
|
></page-meta>
|
||||||
|
<view
|
||||||
|
class="container commonPageBox commonDetailPage"
|
||||||
|
style="background-color: #f2f2f2"
|
||||||
|
>
|
||||||
<!-- 公共组件-每个页面必须引入 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
<public-module></public-module>
|
<public-module></public-module>
|
||||||
<z-nav-bar title="我的订单" bgColor="#3AB3AE" fontColor="#fff" :backState="2000">
|
<z-nav-bar
|
||||||
|
title="我的订单"
|
||||||
|
bgColor="#3AB3AE"
|
||||||
|
fontColor="#fff"
|
||||||
|
:backState="2000"
|
||||||
|
>
|
||||||
<!-- <template slot="left">
|
<!-- <template slot="left">
|
||||||
<u-icon
|
<u-icon
|
||||||
@click="goHome"
|
@click="goHome"
|
||||||
@@ -18,24 +30,45 @@
|
|||||||
<!-- <z-nav-bar backState="2000" title="我的订单"></z-nav-bar> -->
|
<!-- <z-nav-bar backState="2000" title="我的订单"></z-nav-bar> -->
|
||||||
|
|
||||||
<view class="cateList flexbox">
|
<view class="cateList flexbox">
|
||||||
<common-sticky itemStyle="width:20%; height: 68rpx;font-size:24rpx;" :list="ordersTabs" label="name"
|
<common-sticky
|
||||||
:currentCateIndex="currentCateIndex" @handleselectCate="ordersTabCLi"></common-sticky>
|
itemStyle="width:20%; height: 68rpx;font-size:24rpx;"
|
||||||
|
:list="ordersTabs"
|
||||||
|
label="name"
|
||||||
|
:currentCateIndex="currentCateIndex"
|
||||||
|
@handleselectCate="ordersTabCLi"
|
||||||
|
></common-sticky>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 站位 -->
|
<!-- 站位 -->
|
||||||
|
|
||||||
<!-- <view v-if="ordersListTab == 1"> -->
|
<!-- <view v-if="ordersListTab == 1"> -->
|
||||||
<view class="order_box" :style="`height: calc(100% - ${(80 + statusBarHeight) * 2}rpx);`"
|
<view
|
||||||
style="background-color: #f2f2f2">
|
class="order_box"
|
||||||
<common-list imgUrl="url" indexKey="orderSn" noDataIcon="data" :isScroll="true" :axiosStatus="axiosStatus"
|
:style="`height: calc(100% - ${(80 + statusBarHeight) * 2}rpx);`"
|
||||||
:isLoadingHide="isLoadingHide" :isNoIcon="true" :isCondition="true" :dataList="newList"
|
style="background-color: #f2f2f2"
|
||||||
@hancleClick="toDetail" @lower="onReachBottom1" :pagination="pagination" label="title">
|
>
|
||||||
|
<common-list
|
||||||
|
imgUrl="url"
|
||||||
|
indexKey="orderSn"
|
||||||
|
noDataIcon="data"
|
||||||
|
:isScroll="true"
|
||||||
|
:axiosStatus="axiosStatus"
|
||||||
|
:isLoadingHide="isLoadingHide"
|
||||||
|
:isNoIcon="true"
|
||||||
|
:isCondition="true"
|
||||||
|
:dataList="newList"
|
||||||
|
@hancleClick="toDetail"
|
||||||
|
@lower="onReachBottom1"
|
||||||
|
:pagination="pagination"
|
||||||
|
label="title"
|
||||||
|
>
|
||||||
<view slot="labelSlot" slot-scope="slotProps">
|
<view slot="labelSlot" slot-scope="slotProps">
|
||||||
<view class="orderInfo color_shandow">
|
<view class="orderInfo color_shandow">
|
||||||
<view class="mainContent">
|
<view class="mainContent">
|
||||||
<view class="btns" style="margin-top: 0rpx">
|
<view class="btns" style="margin-top: 0rpx">
|
||||||
<view class="flexbox opbtns" style="letter-spacing: 1rpx">
|
<view class="flexbox opbtns" style="letter-spacing: 1rpx">
|
||||||
<view style="
|
<view
|
||||||
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -44,92 +77,172 @@
|
|||||||
color: #9b9b9b;
|
color: #9b9b9b;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
">{{ slotProps.row.orderSn }}
|
"
|
||||||
|
>{{ slotProps.row.orderSn }}
|
||||||
|
|
||||||
<u-tag @click="handleCopy(slotProps.row.orderSn, '订单编号')" borderColor="#3ab3ae"
|
<u-tag
|
||||||
color="#3ab3ae" text="复制" plain style="float: right" size="mini"
|
@click="handleCopy(slotProps.row.orderSn, '订单编号')"
|
||||||
type="success"></u-tag>
|
borderColor="#3ab3ae"
|
||||||
|
color="#3ab3ae"
|
||||||
|
text="复制"
|
||||||
|
plain
|
||||||
|
style="float: right"
|
||||||
|
size="mini"
|
||||||
|
type="success"
|
||||||
|
></u-tag>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="item_top" style="margin-top: 10rpx; margin-bottom: 0">
|
<view
|
||||||
|
class="item_top"
|
||||||
|
style="margin-top: 10rpx; margin-bottom: 0"
|
||||||
|
>
|
||||||
<view class="source_app"></view>
|
<view class="source_app"></view>
|
||||||
<view style="text-align: left">
|
<view style="text-align: left">
|
||||||
<text class="orderstatus" v-show="slotProps.row.orderStatus == 0">未付款</text>
|
<text
|
||||||
<text class="orderstatus" v-show="slotProps.row.orderStatus == 1">待发货</text>
|
class="orderstatus"
|
||||||
<text class="orderstatus" v-show="slotProps.row.orderStatus == 2">已发货</text>
|
v-show="slotProps.row.orderStatus == 0"
|
||||||
<text class="orderstatus" v-show="slotProps.row.orderStatus == 3">交易成功</text>
|
>未付款</text
|
||||||
<text class="orderstatus" v-show="slotProps.row.orderStatus == 4">交易失败</text>
|
>
|
||||||
<text class="orderstatus" v-show="slotProps.row.orderStatus == 5">已过期</text>
|
<text
|
||||||
|
class="orderstatus"
|
||||||
|
v-show="slotProps.row.orderStatus == 1"
|
||||||
|
>待发货</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="orderstatus"
|
||||||
|
v-show="slotProps.row.orderStatus == 2"
|
||||||
|
>已发货</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="orderstatus"
|
||||||
|
v-show="slotProps.row.orderStatus == 3"
|
||||||
|
>交易成功</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="orderstatus"
|
||||||
|
v-show="slotProps.row.orderStatus == 4"
|
||||||
|
>交易失败</text
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="orderstatus"
|
||||||
|
v-show="slotProps.row.orderStatus == 5"
|
||||||
|
>已过期</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="slotProps.row.orderType == 'vip'" class="bookinfolist">
|
<view
|
||||||
<image class="feng fengPoint" src="/static/icon/vip.png" mode="aspectFill"></image>
|
v-if="slotProps.row.orderType == 'vip'"
|
||||||
|
class="bookinfolist"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
class="feng fengPoint"
|
||||||
|
src="/static/icon/vip.png"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
<!-- <view class="description" v-html="item.content">
|
<!-- <view class="description" v-html="item.content">
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="btns flexbox">
|
<view class="btns flexbox">
|
||||||
<view class="booknameleft">
|
<view class="booknameleft">
|
||||||
{{ slotProps.row.vipBuyConfigEntity?slotProps.row.vipBuyConfigEntity.title:'' }}
|
{{
|
||||||
|
slotProps.row.vipBuyConfigEntity
|
||||||
|
? slotProps.row.vipBuyConfigEntity.title
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="
|
<view
|
||||||
|
style="
|
||||||
line-height: 58rpx;
|
line-height: 58rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
">
|
"
|
||||||
|
>
|
||||||
<text style="font-size: 20rpx"></text>
|
<text style="font-size: 20rpx"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns flexbox"
|
<view
|
||||||
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx">
|
class="btns flexbox"
|
||||||
|
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx"
|
||||||
|
>
|
||||||
下单时间:{{ slotProps.row.createTime }}
|
下单时间:{{ slotProps.row.createTime }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="slotProps.row.orderType == 'point'" class="bookinfolist">
|
<view
|
||||||
<image class="feng fengPoint" src="/static/icon/pay_3.png" mode="aspectFill">
|
v-if="slotProps.row.orderType == 'point'"
|
||||||
|
class="bookinfolist"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
class="feng fengPoint"
|
||||||
|
src="/static/icon/pay_3.png"
|
||||||
|
mode="aspectFill"
|
||||||
|
>
|
||||||
</image>
|
</image>
|
||||||
<!-- <view class="description" v-html="item.content">
|
<!-- <view class="description" v-html="item.content">
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="btns flexbox">
|
<view class="btns flexbox">
|
||||||
<view class="booknameleft"> 充值 {{
|
<view class="booknameleft">
|
||||||
slotProps.row.bookBuyConfigEntity? slotProps.row.bookBuyConfigEntity.money:""
|
充值
|
||||||
}}天医币</view>
|
{{
|
||||||
|
slotProps.row.bookBuyConfigEntity
|
||||||
|
? slotProps.row.bookBuyConfigEntity.money
|
||||||
|
: ""
|
||||||
|
}}天医币</view
|
||||||
|
>
|
||||||
|
|
||||||
<view style="
|
<view
|
||||||
|
style="
|
||||||
line-height: 58rpx;
|
line-height: 58rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
">
|
"
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns flexbox"
|
<view
|
||||||
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx">
|
class="btns flexbox"
|
||||||
|
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx"
|
||||||
|
>
|
||||||
下单时间:{{ slotProps.row.createTime }}
|
下单时间:{{ slotProps.row.createTime }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="slotProps.row.orderType == 'order'">
|
<view v-if="slotProps.row.orderType == 'order'">
|
||||||
<view v-for="(item2, index2) in slotProps.row.productList"
|
<view
|
||||||
:key="slotProps.row.orderId" class="bookinfolist">
|
v-for="(item2, index2) in slotProps.row.productList"
|
||||||
|
:key="slotProps.row.orderId"
|
||||||
|
class="bookinfolist"
|
||||||
|
>
|
||||||
<view v-if="item2.product">
|
<view v-if="item2.product">
|
||||||
<view class="feng" v-if="item2.product && item2.product.productImages">
|
<view
|
||||||
<image :key="Date.now()" style="width: 100%; height: 100%"
|
class="feng"
|
||||||
mode="aspectFit" :src="item2.product.productImages"></image>
|
v-if="item2.product && item2.product.productImages"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:key="Date.now()"
|
||||||
|
style="width: 100%; height: 100%"
|
||||||
|
mode="aspectFit"
|
||||||
|
:src="item2.product.productImages"
|
||||||
|
></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-else class="feng" style="
|
<view
|
||||||
|
v-else
|
||||||
|
class="feng"
|
||||||
|
style="
|
||||||
color: #c0c4cc;
|
color: #c0c4cc;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
line-height: 140rpx;
|
line-height: 140rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
">暂无封面图</view>
|
"
|
||||||
|
>暂无封面图</view
|
||||||
|
>
|
||||||
<!-- <view class="description" v-html="item.content">
|
<!-- <view class="description" v-html="item.content">
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="btns flexbox">
|
<view class="btns flexbox">
|
||||||
@@ -139,21 +252,24 @@
|
|||||||
: ""
|
: ""
|
||||||
}}</view>
|
}}</view>
|
||||||
|
|
||||||
<view style="
|
<view
|
||||||
|
style="
|
||||||
line-height: 58rpx;
|
line-height: 58rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
">
|
"
|
||||||
|
>
|
||||||
<text style="font-size: 20rpx">¥</text>
|
<text style="font-size: 20rpx">¥</text>
|
||||||
{{
|
{{ item2.product.price ? item2.product.price : "" }}
|
||||||
item2.product.price ? item2.product.price : ""
|
|
||||||
}}
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns flexbox" style="margin-top: 10rpx">
|
<view class="btns flexbox" style="margin-top: 10rpx">
|
||||||
<view class="left" style="color: #c0c4cc"></view>
|
<view class="left" style="color: #c0c4cc"></view>
|
||||||
<view class="right flexbox opbtns" style="color: #c0c4cc">
|
<view
|
||||||
|
class="right flexbox opbtns"
|
||||||
|
style="color: #c0c4cc"
|
||||||
|
>
|
||||||
×{{ item2.quantity ? item2.quantity : "" }}
|
×{{ item2.quantity ? item2.quantity : "" }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -161,8 +277,13 @@
|
|||||||
<view v-else>
|
<view v-else>
|
||||||
<view class="feng"></view>
|
<view class="feng"></view>
|
||||||
<view class="btns flexbox">
|
<view class="btns flexbox">
|
||||||
<view class="booknameleft" style="color: #181818">未知商品</view>
|
<view class="booknameleft" style="color: #181818"
|
||||||
<view style="" class="right flexbox opbtns product_quantity">
|
>未知商品</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
style=""
|
||||||
|
class="right flexbox opbtns product_quantity"
|
||||||
|
>
|
||||||
×{{ item2.quantity ? item2.quantity : "" }}
|
×{{ item2.quantity ? item2.quantity : "" }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -171,28 +292,39 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="margin-top: 10rpx; overflow: hidden">
|
<view style="margin-top: 10rpx; overflow: hidden">
|
||||||
<view class="btns flexbox" style="float: right; width: auto !important">
|
<view
|
||||||
<view class="right flexbox opbtns" style="
|
class="btns flexbox"
|
||||||
|
style="float: right; width: auto !important"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="right flexbox opbtns"
|
||||||
|
style="
|
||||||
width: auto;
|
width: auto;
|
||||||
line-height: 44rpx;
|
line-height: 44rpx;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
">
|
"
|
||||||
<view style="
|
>
|
||||||
|
<view
|
||||||
|
style="
|
||||||
line-height: 46rpx;
|
line-height: 46rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
">实付款</view>
|
"
|
||||||
<view style="
|
>实付款</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
style="
|
||||||
/* margin-top: 8rpx; */
|
/* margin-top: 8rpx; */
|
||||||
line-height: 46rpx;
|
line-height: 46rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
">
|
"
|
||||||
|
>
|
||||||
<text style="font-size: 20rpx">¥</text>
|
<text style="font-size: 20rpx">¥</text>
|
||||||
{{
|
{{
|
||||||
slotProps.row.realMoney ||
|
slotProps.row.realMoney ||
|
||||||
@@ -203,62 +335,104 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns flexbox" style="
|
<view
|
||||||
|
class="btns flexbox"
|
||||||
|
style="
|
||||||
margin-top: 0rpx;
|
margin-top: 0rpx;
|
||||||
float: right;
|
float: right;
|
||||||
width: auto;
|
width: auto;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
" v-if="
|
"
|
||||||
|
v-if="
|
||||||
(slotProps.row.addressId == 0 ||
|
(slotProps.row.addressId == 0 ||
|
||||||
slotProps.row.addressId == null) &&
|
slotProps.row.addressId == null) &&
|
||||||
slotProps.row.orderType == 'order' &&
|
slotProps.row.orderType == 'order' &&
|
||||||
slotProps.row.jfDeduction > 0
|
slotProps.row.jfDeduction > 0
|
||||||
">
|
"
|
||||||
<view class="right flexbox opbtns" style="
|
>
|
||||||
|
<view
|
||||||
|
class="right flexbox opbtns"
|
||||||
|
style="
|
||||||
line-height: 44rpx;
|
line-height: 44rpx;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
"><text style="color: #9b9b9b">( </text>
|
"
|
||||||
<view style="
|
><text style="color: #9b9b9b">( </text>
|
||||||
|
<view
|
||||||
|
style="
|
||||||
line-height: 46rpx;
|
line-height: 46rpx;
|
||||||
color: #9b9b9b;
|
color: #9b9b9b;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
">积分抵扣</view>
|
"
|
||||||
<view style="
|
>积分抵扣</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
style="
|
||||||
/* margin-top: 8rpx; */
|
/* margin-top: 8rpx; */
|
||||||
line-height: 46rpx;
|
line-height: 46rpx;
|
||||||
color: #9b9b9b;
|
color: #9b9b9b;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
">
|
"
|
||||||
|
>
|
||||||
<text style="font-size: 20rpx">¥</text>
|
<text style="font-size: 20rpx">¥</text>
|
||||||
{{ slotProps.row.jfDeduction }}
|
{{ slotProps.row.jfDeduction }}
|
||||||
</view>
|
</view> </view
|
||||||
</view><text style="color: #9b9b9b">)</text>
|
><text style="color: #9b9b9b">)</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="operation_box boxShadow" v-if="slotProps.row.isShowMore == true">
|
<view
|
||||||
<view v-if="slotProps.row.orderStatus == 0"
|
class="operation_box boxShadow"
|
||||||
@click.native.stop="canceOrder(slotProps.row)">取消订单</view>
|
v-if="slotProps.row.isShowMore == true"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="slotProps.row.orderStatus == 0"
|
||||||
|
@click.native.stop="canceOrder(slotProps.row)"
|
||||||
|
>取消订单</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns flexbox" style="margin-top: 10rpx">
|
<view class="btns flexbox" style="margin-top: 10rpx">
|
||||||
<view class="left" style="color: #c0c4cc" @click.native.stop="
|
<view
|
||||||
|
class="left"
|
||||||
|
style="color: #c0c4cc"
|
||||||
|
@click.native.stop="
|
||||||
openMore(slotProps.row, slotProps.rowIndex)
|
openMore(slotProps.row, slotProps.rowIndex)
|
||||||
">更多</view>
|
"
|
||||||
|
>更多</view
|
||||||
|
>
|
||||||
<view class="right flexbox opbtns">
|
<view class="right flexbox opbtns">
|
||||||
<view class="orderstatusbtn orderstatusbtn_success"
|
<view
|
||||||
|
class="orderstatusbtn orderstatusbtn_success"
|
||||||
v-if="slotProps.row.orderStatus == 0"
|
v-if="slotProps.row.orderStatus == 0"
|
||||||
@click.native.stop="goPay(slotProps.row)">继续付款</view>
|
@click.native.stop="goPay(slotProps.row)"
|
||||||
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 1">催发货</view>
|
>继续付款</view
|
||||||
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 2"
|
>
|
||||||
@click.native.stop="seeExpressDetail(slotProps.row)">查看物流</view>
|
<view
|
||||||
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 2"
|
class="orderstatusbtn"
|
||||||
@click.native.stop="OverOrder(slotProps.row)">确认收货</view>
|
v-if="slotProps.row.orderStatus == 1"
|
||||||
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 3">申请售后</view>
|
>催发货</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="orderstatusbtn"
|
||||||
|
v-if="slotProps.row.orderStatus == 2"
|
||||||
|
@click.native.stop="seeExpressDetail(slotProps.row)"
|
||||||
|
>查看物流</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="orderstatusbtn"
|
||||||
|
v-if="slotProps.row.orderStatus == 2"
|
||||||
|
@click.native.stop="OverOrder(slotProps.row)"
|
||||||
|
>确认收货</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="orderstatusbtn"
|
||||||
|
v-if="slotProps.row.orderStatus == 3"
|
||||||
|
>申请售后</view
|
||||||
|
>
|
||||||
<!-- <view
|
<!-- <view
|
||||||
class="orderstatusbtn"
|
class="orderstatusbtn"
|
||||||
v-if="item.orderStatus == 3 && userRecordid == null"
|
v-if="item.orderStatus == 3 && userRecordid == null"
|
||||||
@@ -269,8 +443,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="border-bottom: 2rpx solid #e9e9e9; height: 50rpx"
|
<view
|
||||||
v-if="slotProps.rowIndex < slotProps.row.length - 1"></view>
|
style="border-bottom: 2rpx solid #e9e9e9; height: 50rpx"
|
||||||
|
v-if="slotProps.rowIndex < slotProps.row.length - 1"
|
||||||
|
></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="btns" style="margin-top: 10rpx">
|
<!-- <view class="btns" style="margin-top: 10rpx">
|
||||||
<view class="flexbox opbtns" style="">
|
<view class="flexbox opbtns" style="">
|
||||||
@@ -335,49 +511,100 @@
|
|||||||
</uni-forms>
|
</uni-forms>
|
||||||
<!-- <u-button type="success" @click="submitPJ">提交评价</u-button> -->
|
<!-- <u-button type="success" @click="submitPJ">提交评价</u-button> -->
|
||||||
<!-- 提交 -->
|
<!-- 提交 -->
|
||||||
<view class="padding-bottom-sm flex padding-lr-sm" style="border-bottom: 1px solid #eeeeee">
|
<view
|
||||||
|
class="padding-bottom-sm flex padding-lr-sm"
|
||||||
|
style="border-bottom: 1px solid #eeeeee"
|
||||||
|
>
|
||||||
<view class="mb30" v-if="pjType != 'zhuiping'">
|
<view class="mb30" v-if="pjType != 'zhuiping'">
|
||||||
<view :class="['star', Pform.star >= 1 ? 'starLight' : 'starGray']" @click="getStar(1)">
|
<view
|
||||||
|
:class="['star', Pform.star >= 1 ? 'starLight' : 'starGray']"
|
||||||
|
@click="getStar(1)"
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view :class="['star', Pform.star >= 2 ? 'starLight' : 'starGray']" @click="getStar(2)">
|
<view
|
||||||
|
:class="['star', Pform.star >= 2 ? 'starLight' : 'starGray']"
|
||||||
|
@click="getStar(2)"
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view :class="['star', Pform.star >= 3 ? 'starLight' : 'starGray']" @click="getStar(3)">
|
<view
|
||||||
|
:class="['star', Pform.star >= 3 ? 'starLight' : 'starGray']"
|
||||||
|
@click="getStar(3)"
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view :class="['star', Pform.star >= 4 ? 'starLight' : 'starGray']" @click="getStar(4)">
|
<view
|
||||||
|
:class="['star', Pform.star >= 4 ? 'starLight' : 'starGray']"
|
||||||
|
@click="getStar(4)"
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view :class="['star', Pform.star >= 5 ? 'starLight' : 'starGray']" @click="getStar(5)">
|
<view
|
||||||
|
:class="['star', Pform.star >= 5 ? 'starLight' : 'starGray']"
|
||||||
|
@click="getStar(5)"
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mb30" v-if="pjType != 'zhuiping'">
|
<view class="mb30" v-if="pjType != 'zhuiping'">
|
||||||
<!-- <uni-file-picker :auto-upload="false" ref="files" @delete="deleteImg" limit="5" @success="upSuccess" @select="select" v-model="Pform.img" fileMediatype="image" :image-styles="imageStyles"/> -->
|
<!-- <uni-file-picker :auto-upload="false" ref="files" @delete="deleteImg" limit="5" @success="upSuccess" @select="select" v-model="Pform.img" fileMediatype="image" :image-styles="imageStyles"/> -->
|
||||||
<u-upload :fileList="Pform.img" @afterRead="afterRead" @delete="deletePic" multiple
|
<u-upload
|
||||||
:maxCount="4" width="80" height="80" :previewFullImage="true">
|
:fileList="Pform.img"
|
||||||
|
@afterRead="afterRead"
|
||||||
|
@delete="deletePic"
|
||||||
|
multiple
|
||||||
|
:maxCount="4"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
:previewFullImage="true"
|
||||||
|
>
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-sub flexbox">
|
<view class="flex-sub flexbox">
|
||||||
<i @click="showEmj()" :class="emojiIcon"></i>
|
<i @click="showEmj()" :class="emojiIcon"></i>
|
||||||
<!-- <input type="text" @focus="InputFocus" @blur="InputBlur" v-model="message" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></input> -->
|
<!-- <input type="text" @focus="InputFocus" @blur="InputBlur" v-model="message" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></input> -->
|
||||||
<textarea class="textarea" v-model="Pform.comment" @focus="InputFocus" @blur="InputBlur"
|
<textarea
|
||||||
@input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;"
|
class="textarea"
|
||||||
placeholder="请输入您要发送的内容"></textarea>
|
v-model="Pform.comment"
|
||||||
|
@focus="InputFocus"
|
||||||
|
@blur="InputBlur"
|
||||||
|
@input="textareaBInput"
|
||||||
|
placeholder-style="font-size:24rpx;color:#aaaaaa;"
|
||||||
|
placeholder="请输入您要发送的内容"
|
||||||
|
></textarea>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<!-- <button class="cu-btn bg-gradual-blue shadow-blur">发送</button> -->
|
<!-- <button class="cu-btn bg-gradual-blue shadow-blur">发送</button> -->
|
||||||
<u-button type="success" @click="submitPJ" v-if="pjType != 'zhuiping'">提交评价</u-button>
|
<u-button
|
||||||
<u-button type="success" @click="zhuiping" v-else>提交追评</u-button>
|
type="success"
|
||||||
|
@click="submitPJ"
|
||||||
|
v-if="pjType != 'zhuiping'"
|
||||||
|
>提交评价</u-button
|
||||||
|
>
|
||||||
|
<u-button type="success" @click="zhuiping" v-else
|
||||||
|
>提交追评</u-button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="position: relative">
|
<view style="position: relative">
|
||||||
<emotion @emotion="handleEmj" :height="220" v-if="isShowEmj" :windowWidth="windowWidth">
|
<emotion
|
||||||
|
@emotion="handleEmj"
|
||||||
|
:height="220"
|
||||||
|
v-if="isShowEmj"
|
||||||
|
:windowWidth="windowWidth"
|
||||||
|
>
|
||||||
</emotion>
|
</emotion>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<z-navigation></z-navigation>
|
<z-navigation></z-navigation>
|
||||||
<u-action-sheet :closeOnClickAction="true" :closeOnClickOverlay="true" :actions="moreList" :show="isShowMore"
|
<u-action-sheet
|
||||||
cancelText="关闭" @close="isShowMore = false" @select="selectClick"></u-action-sheet>
|
:closeOnClickAction="true"
|
||||||
|
:closeOnClickOverlay="true"
|
||||||
|
:actions="moreList"
|
||||||
|
:show="isShowMore"
|
||||||
|
cancelText="关闭"
|
||||||
|
@close="isShowMore = false"
|
||||||
|
@select="selectClick"
|
||||||
|
></u-action-sheet>
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -386,16 +613,9 @@
|
|||||||
import $http from "@/config/requestConfig.js";
|
import $http from "@/config/requestConfig.js";
|
||||||
import emotion from "@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue";
|
import emotion from "@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue";
|
||||||
import musicPlay from "@/components/music.vue";
|
import musicPlay from "@/components/music.vue";
|
||||||
import {
|
import { setPay, setPayAssign, setWXPay } from "@/config/utils";
|
||||||
setPay,
|
|
||||||
setPayAssign,
|
|
||||||
setWXPay
|
|
||||||
} from "@/config/utils";
|
|
||||||
// import { data } from 'jquery';
|
// import { data } from 'jquery';
|
||||||
import {
|
import { mapState, mapMutations } from "vuex";
|
||||||
mapState,
|
|
||||||
mapMutations
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -404,10 +624,12 @@
|
|||||||
come: "1",
|
come: "1",
|
||||||
isShowTab: false,
|
isShowTab: false,
|
||||||
isLoadingHide: false,
|
isLoadingHide: false,
|
||||||
moreList: [{
|
moreList: [
|
||||||
|
{
|
||||||
name: "取消订单",
|
name: "取消订单",
|
||||||
key: "false",
|
key: "false",
|
||||||
}, ],
|
},
|
||||||
|
],
|
||||||
currentCateIndex: 0,
|
currentCateIndex: 0,
|
||||||
pagination: {
|
pagination: {
|
||||||
// 请求参数
|
// 请求参数
|
||||||
@@ -432,7 +654,8 @@
|
|||||||
status: 3,
|
status: 3,
|
||||||
shupingList: [],
|
shupingList: [],
|
||||||
bfaid: null,
|
bfaid: null,
|
||||||
ordersTabs: [{
|
ordersTabs: [
|
||||||
|
{
|
||||||
name: "全部",
|
name: "全部",
|
||||||
value: -1,
|
value: -1,
|
||||||
badge: {},
|
badge: {},
|
||||||
@@ -481,14 +704,14 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
uni.getStorageSync("orderStatus", 0)
|
uni.getStorageSync("orderStatus", 0);
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
console.log("下拉刷新了");
|
console.log("下拉刷新了");
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
|
|
||||||
this.newestpage = 1;
|
this.newestpage = 1;
|
||||||
this.pagination.page = 1
|
this.pagination.page = 1;
|
||||||
// this.hotestpage = 1
|
// this.hotestpage = 1
|
||||||
// this.booksetpage = 1
|
// this.booksetpage = 1
|
||||||
this.newList = [];
|
this.newList = [];
|
||||||
@@ -499,7 +722,7 @@
|
|||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.newestpage++;
|
this.newestpage++;
|
||||||
this.pagination.page++
|
this.pagination.page++;
|
||||||
// this.hotestpage++
|
// this.hotestpage++
|
||||||
// this.booksetpage++
|
// this.booksetpage++
|
||||||
this.getBookList(this.ordersListTab, false);
|
this.getBookList(this.ordersListTab, false);
|
||||||
@@ -522,8 +745,8 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
console.log('onshow at line onShow:', '先走onshow')
|
console.log("onshow at line onShow:", "先走onshow");
|
||||||
uni.setStorageSync("orderStatus", 0)
|
uni.setStorageSync("orderStatus", 0);
|
||||||
var status = uni.getStorageSync("orderStatus");
|
var status = uni.getStorageSync("orderStatus");
|
||||||
this.newList = [];
|
this.newList = [];
|
||||||
this.pagination = {
|
this.pagination = {
|
||||||
@@ -536,7 +759,6 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|
||||||
// console.log('onshow at line created:', '先走onshow')
|
// console.log('onshow at line created:', '先走onshow')
|
||||||
// var status = uni.getStorageSync("orderStatus");
|
// var status = uni.getStorageSync("orderStatus");
|
||||||
// this.newList = [];
|
// this.newList = [];
|
||||||
@@ -607,7 +829,7 @@
|
|||||||
},
|
},
|
||||||
// 切换tab状态
|
// 切换tab状态
|
||||||
ordersTabCLi(data, index) {
|
ordersTabCLi(data, index) {
|
||||||
this.axiosStatus = 0
|
this.axiosStatus = 0;
|
||||||
this.currentCateIndex = index;
|
this.currentCateIndex = index;
|
||||||
this.pagination = {
|
this.pagination = {
|
||||||
page: 1, //页码
|
page: 1, //页码
|
||||||
@@ -634,7 +856,8 @@
|
|||||||
// url:'../bookShop/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
// url:'../bookShop/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
||||||
// })
|
// })
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/bookShop/orderLCont?orderId=" +
|
url:
|
||||||
|
"/pages/bookShop/orderLCont?orderId=" +
|
||||||
val.orderId +
|
val.orderId +
|
||||||
"&orderType=" +
|
"&orderType=" +
|
||||||
val.orderStatus +
|
val.orderStatus +
|
||||||
@@ -701,7 +924,7 @@
|
|||||||
// page: this.newestpage,
|
// page: this.newestpage,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('1111111111111传参数', params)
|
console.log("1111111111111传参数", params);
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: "common/buyOrder/commonBuyOrderList",
|
url: "common/buyOrder/commonBuyOrderList",
|
||||||
@@ -733,14 +956,15 @@
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.axiosStatus = 1
|
this.axiosStatus = 1;
|
||||||
},
|
},
|
||||||
// 支付
|
// 支付
|
||||||
goPay(payItem) {
|
goPay(payItem) {
|
||||||
console.log(payItem, "订单数据");
|
console.log(payItem, "订单数据");
|
||||||
if (payItem.paymentMethod == 2) {
|
if (payItem.paymentMethod == 2) {
|
||||||
console.log("阿里支付");
|
console.log("阿里支付");
|
||||||
setPay({
|
setPay(
|
||||||
|
{
|
||||||
typePay: "alipay",
|
typePay: "alipay",
|
||||||
subject: "order",
|
subject: "order",
|
||||||
totalAmount: payItem.realMoney,
|
totalAmount: payItem.realMoney,
|
||||||
@@ -810,7 +1034,8 @@
|
|||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
content: "很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
|
content:
|
||||||
|
"很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.iphonepay(payItem);
|
this.iphonepay(payItem);
|
||||||
@@ -841,7 +1066,7 @@
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
this.newestpage = 1;
|
this.newestpage = 1;
|
||||||
this.pagination.page = 1
|
this.pagination.page = 1;
|
||||||
this.newList = [];
|
this.newList = [];
|
||||||
this.getBookList(this.ordersListTab, false);
|
this.getBookList(this.ordersListTab, false);
|
||||||
}
|
}
|
||||||
@@ -891,7 +1116,8 @@
|
|||||||
// }else if(this.sheetList.length == 1){
|
// }else if(this.sheetList.length == 1){
|
||||||
// 直接展示详情
|
// 直接展示详情
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "./deliverDetail?orderSn=" +
|
url:
|
||||||
|
"./deliverDetail?orderSn=" +
|
||||||
item.orderSn +
|
item.orderSn +
|
||||||
"&expressOrderSn=" +
|
"&expressOrderSn=" +
|
||||||
item.expressList[0].expressOrderSn,
|
item.expressList[0].expressOrderSn,
|
||||||
@@ -929,12 +1155,13 @@
|
|||||||
duration: 1000,
|
duration: 1000,
|
||||||
});
|
});
|
||||||
this.newestpage = 1;
|
this.newestpage = 1;
|
||||||
this.pagination.page = 1
|
this.pagination.page = 1;
|
||||||
this.newList = [];
|
this.newList = [];
|
||||||
this.getBookList(this.ordersListTab, false);
|
this.getBookList(this.ordersListTab, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (res.cancel) {}
|
} else if (res.cancel) {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -1066,7 +1293,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.emoji.push({
|
this.emoji.push({
|
||||||
tag: i.emotion,
|
tag: i.emotion,
|
||||||
name: i.emotioni
|
name: i.emotioni,
|
||||||
});
|
});
|
||||||
// console.log(this.emoji,'this.emoji')
|
// console.log(this.emoji,'this.emoji')
|
||||||
this.Pform.comment += i.emotioni;
|
this.Pform.comment += i.emotioni;
|
||||||
|
|||||||
@@ -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", //订单类型
|
||||||
|
|||||||
Reference in New Issue
Block a user