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

View File

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

View File

@@ -1,4 +1,5 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
@@ -7,7 +8,6 @@
<public-module></public-module>
<!-- <z-nav-bar title="设置" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar> -->
<view class="contentBox commonPageContentBox"></view>
<!-- 右上角跳过按钮 -->
<!-- <view class="passbtn" @click.stop="launchApp">跳过</view> -->
@@ -16,16 +16,15 @@
<script>
export default {
data() {
return {
content: '',
content: "",
totalTime: 10,
clock: null
clock: null,
};
},
onLoad() {
this.getData()
this.getData();
},
onHide() {
clearInterval(this.clock);
@@ -37,7 +36,7 @@
getData() {
this.clock = setInterval(() => {
this.totalTime--;
this.content = this.totalTime + 's后跳转';
this.content = this.totalTime + "s后跳转";
// if (this.totalTime == 0) {
// this.launchApp()
// }
@@ -56,18 +55,17 @@
page.$vm.requestAll();
},
});
}
}
}
},
},
};
</script>
<style scoped lang="scss">
@import "@/static/customicons.css";
@import "@/style/common.scss";
.bg {}
.bg {
}
// .passbtn {
// width: 130rpx;

View File

@@ -1,4 +1,5 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
@@ -21,19 +22,16 @@
<view class="fullscreen-webview">
<web-view :src="urlPath"> </web-view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
playData: {},
urlPath: '',
title: '',
urlPath: "",
title: "",
id: null,
indicatorDots: true,
autoplay: true,
@@ -43,16 +41,14 @@
},
onLoad(options) {
if (options.type == 1) {
this.urlPath = 'https://zmzm.taihumed.com/agreement.html'
this.title = '用户协议'
this.urlPath = "https://zmzm.taihumed.com/agreement.html";
this.title = "用户协议";
} else if (options.type == 2) {
this.urlPath = 'https://zmzm.taihumed.com/privacy.html'
this.title = '隐私策略'
this.urlPath = "https://zmzm.taihumed.com/privacy.html";
this.title = "隐私策略";
}
},
onShow() {
},
onShow() {},
methods: {
// 放大图片
previewImage(url) {
@@ -68,9 +64,7 @@
});
},
// 方剂详情
},
};
</script>

View File

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

View File

@@ -1,4 +1,5 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
@@ -7,7 +8,6 @@
<public-module></public-module>
<!-- <z-nav-bar title="设置" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar> -->
<view class="contentBox commonPageContentBox"></view>
<!-- 右上角跳过按钮 -->
<!-- <view class="passbtn" @click.stop="launchApp">跳过</view> -->
@@ -16,16 +16,15 @@
<script>
export default {
data() {
return {
content: '',
content: "",
totalTime: 10,
clock: null
clock: null,
};
},
onLoad() {
this.getData()
this.getData();
},
onHide() {
clearInterval(this.clock);
@@ -37,7 +36,7 @@
getData() {
this.clock = setInterval(() => {
this.totalTime--;
this.content = this.totalTime + 's后跳转';
this.content = this.totalTime + "s后跳转";
// if (this.totalTime == 0) {
// this.launchApp()
// }
@@ -56,18 +55,17 @@
page.$vm.requestAll();
},
});
}
}
}
},
},
};
</script>
<style scoped lang="scss">
@import "@/static/customicons.css";
@import "@/style/common.scss";
.bg {}
.bg {
}
// .passbtn {
// width: 130rpx;

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
<template><page-meta
<template>
<page-meta
:page-font-size="$baseFontSize() + 'px'"
:root-font-size="$baseFontSize() + 'px'"
></page-meta>
@@ -8,68 +9,137 @@
<z-nav-bar title="商品详情" bgColor="red"></z-nav-bar>
</view>
<view class="swiperBox">
<swiper :indicator-dots="true" :autoplay="true" :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
:indicator-dots="true"
:autoplay="true"
: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>
</view>
<view class="commodityContent">
<view class="commodityPrice">
<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 class="commodityyName">
{{ productInfo.productName }}
<span v-if="productInfo.productStock==0" style="color: #aaa;font-size:26rpx;">无货</span>
<view><text class="SoldNumber">已售<span>{{productInfo.sumSales}}</span></text></view>
<span
v-if="productInfo.productStock == 0"
style="color: #aaa; font-size: 26rpx"
>无货</span
>
<view
><text class="SoldNumber"
>已售<span>{{ productInfo.sumSales }}</span
></text
></view
>
</view>
<view class="contentButton">
<u-tabs :scrollable="false" :list="contentButtonList" @click="contentButtonClick"></u-tabs>
<u-tabs
:scrollable="false"
:list="contentButtonList"
@click="contentButtonClick"
></u-tabs>
</view>
<!-- 详情 + 评价1 -->
<view v-if="contentShow == 0">
<view class="tingshuList" v-if="listenList.length > 0">
<h4>赠送听书权益</h4>
<view class="item flexbox" v-for="item in listenList" :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
class="item flexbox"
v-for="item in listenList"
: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 class="bookInfo">
<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 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-col span="6" v-if="productInfo.publisher"><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.publisher"
><span>出版社{{ productInfo.publisher }}</span></u-col
>
<u-col span="6" v-if="productInfo.pubDate"
><span
>出版时间{{ productInfo.pubDate | formatDate }}</span
></u-col
>
</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.pageNum"><span>页数{{productInfo.pageNum}}</span></u-col>
<u-col span="6" v-if="productInfo.format"
><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-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>
</view>
<!-- <view class="commodityIntroduce" v-html="productInfo.productDetails"> -->
<view class="commodityIntroduce">
<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 v-else>
<!-- 商品评价 -->
<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="touxiang">
<image :src="item.avatar" mode="aspectFit"></image>
@@ -77,26 +147,60 @@
</view>
<view class="contentBox">
<view class="mb30">
<span :class="['star',item.starlevel >= 1 ? 'starLight':'starGray']"></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>
<span
:class="[
'star',
item.starlevel >= 1 ? 'starLight' : 'starGray',
]"
></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>
<div class="pjimgs flexbox">
<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>
</div>
<view class="content" v-html="item.phtml"></view>
<text class="time">{{ item.createdate }}</text>
</view>
</view>
<!-- 显示追平 -->
<view class="zhuiping item" v-if="item.zphtml != ''" style="padding-left: 50px;">
<h5 style="color: #dbdbdb; margin:10px;">追评内容</h5>
<view
class="zhuiping item"
v-if="item.zphtml != ''"
style="padding-left: 50px"
>
<h5 style="color: #dbdbdb; margin: 10px">追评内容</h5>
<view class="flexbox">
<view class="contentBox">
<view class="content" v-html="item.zphtml"></view>
@@ -110,48 +214,56 @@
<text>暂无评价~</text>
</view>
</view>
<view style="height: 120rpx;"></view>
<view style="height: 120rpx"></view>
</view>
<uni-goods-nav class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
@buttonClick="buttonClick" />
<uni-goods-nav
class="goods_nav"
:fill="true"
:options="options"
:buttonGroup="buttonGroup"
@click="onClick"
@buttonClick="buttonClick"
/>
<music-play :playData="playData"></music-play>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import emojiList1 from '../../bkhumor-emojiplus/emoji/biaoqin.js'
import $http from '@/config/requestConfig.js';
import {
mapState
} from 'vuex';
import loginVue from '../user/login.vue';
import musicPlay from "@/components/music.vue";
import emojiList1 from "../../bkhumor-emojiplus/emoji/biaoqin.js";
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
import loginVue from "../user/login.vue";
export default {
data() {
return {
playData: {},
contentShow: 0,
options: [{
icon: 'cart',
text: '购物车'
}],
buttonGroup: [{
text: '加入购物车',
backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)',
color: '#fff'
},
options: [
{
text: '立即购买',
backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)',
color: '#fff'
}
icon: "cart",
text: "购物车",
},
],
contentButtonList: [{
name: '商品详情'
buttonGroup: [
{
text: "加入购物车",
backgroundColor: "linear-gradient(90deg, #FFCD1E, #FF8A18)",
color: "#fff",
},
{
name: '商品评价'
}
text: "立即购买",
backgroundColor: "linear-gradient(90deg, #FE6035, #EF1224)",
color: "#fff",
},
],
contentButtonList: [
{
name: "商品详情",
},
{
name: "商品评价",
},
],
// 轮播图数据
swiperlist: [],
@@ -161,33 +273,33 @@
cartList: [], // 购物车列表
commentsList: [], // 评论列表
productId: null, // 商品评论
listenList:[] // 关联得听书
}
listenList: [], // 关联得听书
};
},
onLoad(e) {
this.productId = e.id
this.getProDetail(e)
this.getComments()
this.productId = e.id;
this.getProDetail(e);
this.getComments();
// console.log(emojiList1,'emojiList1')
},
computed: {
...mapState(['userInfo']),
...mapState(["userInfo"]),
},
components: {
musicPlay
musicPlay,
},
methods: {
goToListen(id) {
// 跳转到听书
uni.navigateTo({
url: "../listen/listen?bookid="+ id
url: "../listen/listen?bookid=" + id,
});
},
// 放大图片
previewImage(url) {
console.log(url)
console.log(url);
uni.previewImage({
urls: [url]
urls: [url],
});
},
// 获取html格式的评论1
@@ -197,205 +309,218 @@
// 这里处理 链接 换行符
let replacedStr = comment.replace(/\[([^(\]|\[)]*)\]/g, (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')
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')
return replacedStr.replace(/(\r\n)|(\n)/g, '<br>');
return replacedStr.replace(/(\r\n)|(\n)/g, "<br>");
},
// 获取评价
getComments() {
$http.request({
$http
.request({
url: "buy/record/All",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档1
data: {
'bookid': this.productId
bookid: this.productId,
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(res => {
.then((res) => {
if (res.code == 0) {
console.log(res.list, 'res.list')
this.commentsList = res.list.map(item => {
var imgList = []
console.log(res.list, "res.list");
this.commentsList = res.list.map((item) => {
var imgList = [];
if (item.images !== null) {
imgList = item.images.split(',')
item.images = imgList
return item
imgList = item.images.split(",");
item.images = imgList;
return item;
} else {
return item
return item;
}
})
});
// 评论格式化
var newarr = []
var newarr = [];
this.commentsList.forEach((item1) => {
var pjstr = ''
var zpstr = ''
pjstr = this.getHtmlComment(item1.content)
item1.followUpcontent == '' ? zpstr = '' : zpstr = this.getHtmlComment(item1.followUpcontent)
var pjstr = "";
var zpstr = "";
pjstr = this.getHtmlComment(item1.content);
item1.followUpcontent == ""
? (zpstr = "")
: (zpstr = this.getHtmlComment(item1.followUpcontent));
//console.log(pjstr,'99999999999----------')
item1.phtml = pjstr
item1.zphtml = zpstr
newarr.push(item1)
})
this.commentsList = newarr
item1.phtml = pjstr;
item1.zphtml = zpstr;
newarr.push(item1);
});
this.commentsList = newarr;
// console.log(this.commentsList,'评价+++++')
// this.commentsList = res.list
}
})
});
},
getProDetail(e) {
// 获取商品详情
uni.showLoading({
title: '加载中'
title: "加载中",
});
console.log(e.id,'e.id')
this.$http
.post('/book/shopproduct/info/' + e.id)
.then(res => {
console.log('shopproduct',res)
this.productInfo = res.shopProduct
this.listenList = res.shopProduct.bookidsimages
if (this.productInfo.productImageList == null || this.productInfo.productImageList == '') {
this.swiperlist.push(this.productInfo.productImages)
console.log(e.id, "e.id");
this.$http.post("/book/shopproduct/info/" + e.id).then((res) => {
console.log("shopproduct", res);
this.productInfo = res.shopProduct;
this.listenList = res.shopProduct.bookidsimages;
if (
this.productInfo.productImageList == null ||
this.productInfo.productImageList == ""
) {
this.swiperlist.push(this.productInfo.productImages);
} else {
let imgList = this.productInfo.productImageList.split(",")
let imgList = this.productInfo.productImageList.split(",");
// if(this.productInfo.productDetails != null){
// let info = this.formatRichText(this.productInfo.productDetails)
// }
// this.productInfo.productDetails = info
for (var i = 0; i < imgList.length; i++) {
this.swiperlist.push(imgList[i])
this.swiperlist.push(imgList[i]);
}
}
uni.hideLoading();
})
});
},
contentButtonClick(e) {
this.contentShow = e.index
this.contentShow = e.index;
},
// 点击购物车
onClick(e) {
console.log(e.content.text)
console.log(e.content.text);
uni.switchTab({
url: '../peanut/shopping'
url: "../peanut/shopping",
});
},
// 点击按钮组间
buttonClick(e) {
console.log(e)
console.log(e);
if (e.index == 0) {
// 点击的是加入购物车
this.addCart()
this.addCart();
} else {
// 点击的是立即购买
this.goPurse()
this.goPurse();
}
},
goToListenNone() {
uni.showToast({
title:'该书暂未生成音频内容,敬请期待!',
icon:'none'
})
title: "该书暂未生成音频内容,敬请期待!",
icon: "none",
});
},
// 加入购物车
addCart() {
if (this.productInfo.productStock == 0) {
uni.showToast({
title: '商品库存不足',
title: "商品库存不足",
icon: "none",
duration: 1000,
});
} else {
this.$http
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
.then(res => {
this.cartList = res.cartList
this.isAdd()
})
.then((res) => {
this.cartList = res.cartList;
this.isAdd();
});
}
},
isAdd() {
// 统计商品信息
let data = {
"userId": this.userInfo.id,
"productId": this.productInfo.productId,
"productAmount": this.productAmount,
"price": this.productInfo.price
}
userId: this.userInfo.id,
productId: this.productInfo.productId,
productAmount: this.productAmount,
price: this.productInfo.price,
};
// 判断列表是否为空
if (this.cartList.length > 0) {
let flag = ''
let shagnpin = {}
let flag = "";
let shagnpin = {};
// 循环购物车列表
flag = this.cartList.some((item, index) => {
if (item.productId == data.productId) {
shagnpin = item
shagnpin.productAmount = item.productAmount + 1
return true
shagnpin = item;
shagnpin.productAmount = item.productAmount + 1;
return true;
}
})
});
if (flag) {
// 已在购物车中添加
$http.request({
$http
.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
}).then(res => {
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
title: "加入购物车成功",
duration: 1000,
});
}
})
});
} else {
// 加入购物车
$http.request({
$http
.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
}).then(res => {
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
title: "加入购物车成功",
duration: 1000,
});
}
})
});
}
} else {
// 购物车列表为空时直接加入购物车
$http.request({
$http
.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
}).then(res => {
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
title: "加入购物车成功",
duration: 1000,
});
}
})
});
}
},
@@ -403,41 +528,56 @@
goPurse() {
if (this.productInfo.productStock == 0) {
uni.showToast({
title: '商品库存不足',
title: "商品库存不足",
icon: "none",
duration: 1000,
});
} else {
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) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
match = match
.replace(/style="[^"]+"/gi, "")
.replace(/style='[^']+'/gi, "");
match = match
.replace(/width="[^"]+"/gi, "")
.replace(/width='[^']+'/gi, "");
match = match
.replace(/height="[^"]+"/gi, "")
.replace(/height='[^']+'/gi, "");
return match;
});
newContent = newContent.replace(/style="[^"]+"/gi,function(match,capture){
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
newContent = newContent.replace(
/style="[^"]+"/gi,
function (match, capture) {
match = match
.replace(/width:[^;]+;/gi, "max-width:100%;")
.replace(/width:[^;]+;/gi, "max-width:100%;");
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;
},
// 去购物车
goCard() {
uni.switchTab({
url: '../peanut/shopping'
url: "../peanut/shopping",
});
},
},
filters: {/**
filters: {
/**
* 处理富文本里的图片宽度自适应
* 1.去掉img标签里的style、width、height属性
* 2.img标签添加style属性max-width:100%;height:auto
@@ -446,70 +586,158 @@ formatRichText (html) { //控制小程序中图片大小
* @param html
* @returns {void|string|*}
*/
formatRichText (html) { //控制小程序中图片大小
formatRichText(html) {
//控制小程序中图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
match = match
.replace(/style="[^"]+"/gi, "")
.replace(/style='[^']+'/gi, "");
match = match
.replace(/width="[^"]+"/gi, "")
.replace(/width='[^']+'/gi, "");
match = match
.replace(/height="[^"]+"/gi, "")
.replace(/height='[^']+'/gi, "");
return match;
});
newContent = newContent.replace(/style="[^"]+"/gi,function(match,capture){
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
newContent = newContent.replace(
/style="[^"]+"/gi,
function (match, capture) {
match = match
.replace(/width:[^;]+;/gi, "max-width:100%;")
.replace(/width:[^;]+;/gi, "max-width:100%;");
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;
},
// 时间格式化
formatDate(date) {
console.log(date)
console.log(date);
let newDate = new Date(date);
let year = newDate.getFullYear();
let month = newDate.getMonth().toString().padStart(2, 0);
let day = newDate.getDay().toString().padStart(2, 0);
return year + '-' + month + '-' + day;
}
}
}
return year + "-" + month + "-" + day;
},
},
};
</script>
<style lang="scss" scoped>
.tingshuList{margin-top: 20rpx; background-color: #fff; padding: 20rpx;
border-radius: 20rpx; margin-bottom: 20rpx; padding-top: 40rpx;
.tingshuList {
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%);
.item{margin-bottom: 20rpx; vertical-align: middle; }
h4{color: #5fb386; font-size: 40rpx; margin-bottom: 20rpx;}
text{color: #444; font-size: 32rpx; padding-left: 20rpx;}
.item {
margin-bottom: 20rpx;
vertical-align: middle;
}
.pjimgs{ margin: 10px 0;flex-wrap: wrap; display: flex; justify-content: space-between;
.item{width: 23%; margin-right: 10px;
image{ }
h4 {
color: #5fb386;
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 {
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
}
.touxiang{width:50px; 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; }
.touxiang {
width: 50px;
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 {
overflow: hidden; overflow-x: hidden;
img{display: block; max-width: 100%;}
p{max-width: 100%;}
overflow: hidden;
overflow-x: hidden;
img {
display: block;
max-width: 100%;
}
p {
max-width: 100%;
}
}
.goods_nav {
z-index: 1;
@@ -530,7 +758,7 @@ formatRichText (html) { //控制小程序中图片大小
background-color: #fff;
font-size: 26rpx;
color: #555;
border-radius: 20rpx 20rpx 0 0
border-radius: 20rpx 20rpx 0 0;
}
.header {
@@ -551,7 +779,6 @@ formatRichText (html) { //控制小程序中图片大小
}
.commodityContent {
margin: 30rpx 20rpx 10rpx 20rpx;
height: auto;
@@ -625,7 +852,6 @@ formatRichText (html) { //控制小程序中图片大小
}
.goBuy {
background-color: #cf3906;
}
}

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1,8 +1,20 @@
<template><page-meta :page-font-size="$baseFontSize() + 'px'" :root-font-size="$baseFontSize() + 'px'"></page-meta>
<view class="container commonPageBox commonDetailPage" style="background-color: #f2f2f2">
<template>
<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>
<z-nav-bar title="我的订单" bgColor="#3AB3AE" fontColor="#fff" :backState="2000">
<z-nav-bar
title="我的订单"
bgColor="#3AB3AE"
fontColor="#fff"
:backState="2000"
>
<!-- <template slot="left">
<u-icon
@click="goHome"
@@ -18,24 +30,45 @@
<!-- <z-nav-bar backState="2000" title="我的订单"></z-nav-bar> -->
<view class="cateList flexbox">
<common-sticky itemStyle="width:20%; height: 68rpx;font-size:24rpx;" :list="ordersTabs" label="name"
:currentCateIndex="currentCateIndex" @handleselectCate="ordersTabCLi"></common-sticky>
<common-sticky
itemStyle="width:20%; height: 68rpx;font-size:24rpx;"
:list="ordersTabs"
label="name"
:currentCateIndex="currentCateIndex"
@handleselectCate="ordersTabCLi"
></common-sticky>
</view>
<!-- 站位 -->
<!-- <view v-if="ordersListTab == 1"> -->
<view class="order_box" :style="`height: calc(100% - ${(80 + statusBarHeight) * 2}rpx);`"
style="background-color: #f2f2f2">
<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
class="order_box"
:style="`height: calc(100% - ${(80 + statusBarHeight) * 2}rpx);`"
style="background-color: #f2f2f2"
>
<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 class="orderInfo color_shandow">
<view class="mainContent">
<view class="btns" style="margin-top: 0rpx">
<view class="flexbox opbtns" style="letter-spacing: 1rpx">
<view style="
<view
style="
width: 100%;
display: flex;
align-items: center;
@@ -44,92 +77,172 @@
color: #9b9b9b;
font-size: 26rpx;
font-weight: 400;
">{{ slotProps.row.orderSn }}
"
>{{ slotProps.row.orderSn }}
<u-tag @click="handleCopy(slotProps.row.orderSn, '订单编号')" borderColor="#3ab3ae"
color="#3ab3ae" text="复制" plain style="float: right" size="mini"
type="success"></u-tag>
<u-tag
@click="handleCopy(slotProps.row.orderSn, '订单编号')"
borderColor="#3ab3ae"
color="#3ab3ae"
text="复制"
plain
style="float: right"
size="mini"
type="success"
></u-tag>
</view>
</view>
</view>
<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 style="text-align: left">
<text class="orderstatus" v-show="slotProps.row.orderStatus == 0">未付款</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>
<text
class="orderstatus"
v-show="slotProps.row.orderStatus == 0"
>未付款</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 v-if="slotProps.row.orderType == 'vip'" class="bookinfolist">
<image class="feng fengPoint" src="/static/icon/vip.png" mode="aspectFill"></image>
<view
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> -->
<view class="btns flexbox">
<view class="booknameleft">
{{ slotProps.row.vipBuyConfigEntity?slotProps.row.vipBuyConfigEntity.title:'' }}
{{
slotProps.row.vipBuyConfigEntity
? slotProps.row.vipBuyConfigEntity.title
: ""
}}
</view>
<view style="
<view
style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
">
"
>
<text style="font-size: 20rpx"></text>
</view>
</view>
<view class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx">
<view
class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx"
>
下单时间{{ slotProps.row.createTime }}
</view>
</view>
<view v-if="slotProps.row.orderType == 'point'" class="bookinfolist">
<image class="feng fengPoint" src="/static/icon/pay_3.png" mode="aspectFill">
<view
v-if="slotProps.row.orderType == 'point'"
class="bookinfolist"
>
<image
class="feng fengPoint"
src="/static/icon/pay_3.png"
mode="aspectFill"
>
</image>
<!-- <view class="description" v-html="item.content">
</view> -->
<view class="btns flexbox">
<view class="booknameleft"> 充值 {{
slotProps.row.bookBuyConfigEntity? slotProps.row.bookBuyConfigEntity.money:""
}}天医币</view>
<view class="booknameleft">
充值
{{
slotProps.row.bookBuyConfigEntity
? slotProps.row.bookBuyConfigEntity.money
: ""
}}天医币</view
>
<view style="
<view
style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
">
"
>
</view>
</view>
<view class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx">
<view
class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx"
>
下单时间{{ slotProps.row.createTime }}
</view>
</view>
<view v-if="slotProps.row.orderType == 'order'">
<view v-for="(item2, index2) in slotProps.row.productList"
:key="slotProps.row.orderId" class="bookinfolist">
<view
v-for="(item2, index2) in slotProps.row.productList"
:key="slotProps.row.orderId"
class="bookinfolist"
>
<view v-if="item2.product">
<view class="feng" v-if="item2.product && item2.product.productImages">
<image :key="Date.now()" style="width: 100%; height: 100%"
mode="aspectFit" :src="item2.product.productImages"></image>
<view
class="feng"
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 v-else class="feng" style="
<view
v-else
class="feng"
style="
color: #c0c4cc;
font-size: 22rpx;
line-height: 140rpx;
text-align: center;
">暂无封面图</view>
"
>暂无封面图</view
>
<!-- <view class="description" v-html="item.content">
</view> -->
<view class="btns flexbox">
@@ -139,21 +252,24 @@
: ""
}}</view>
<view style="
<view
style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
">
"
>
<text style="font-size: 20rpx"></text>
{{
item2.product.price ? item2.product.price : ""
}}
{{ item2.product.price ? item2.product.price : "" }}
</view>
</view>
<view class="btns flexbox" style="margin-top: 10rpx">
<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 : "" }}
</view>
</view>
@@ -161,8 +277,13 @@
<view v-else>
<view class="feng"></view>
<view class="btns flexbox">
<view class="booknameleft" style="color: #181818">未知商品</view>
<view style="" class="right flexbox opbtns product_quantity">
<view class="booknameleft" style="color: #181818"
>未知商品</view
>
<view
style=""
class="right flexbox opbtns product_quantity"
>
×{{ item2.quantity ? item2.quantity : "" }}
</view>
</view>
@@ -171,28 +292,39 @@
</view>
<view style="margin-top: 10rpx; overflow: hidden">
<view class="btns flexbox" style="float: right; width: auto !important">
<view class="right flexbox opbtns" style="
<view
class="btns flexbox"
style="float: right; width: auto !important"
>
<view
class="right flexbox opbtns"
style="
width: auto;
line-height: 44rpx;
letter-spacing: 1rpx;
display: flex;
align-items: center;
">
<view style="
"
>
<view
style="
line-height: 46rpx;
color: #000;
font-size: 28rpx;
font-weight: 500;
margin-right: 10rpx;
">实付款</view>
<view style="
"
>实付款</view
>
<view
style="
/* margin-top: 8rpx; */
line-height: 46rpx;
color: #333;
font-size: 30rpx;
font-weight: 700;
">
"
>
<text style="font-size: 20rpx"></text>
{{
slotProps.row.realMoney ||
@@ -203,62 +335,104 @@
</view>
</view>
</view>
<view class="btns flexbox" style="
<view
class="btns flexbox"
style="
margin-top: 0rpx;
float: right;
width: auto;
margin-left: 20rpx;
" v-if="
"
v-if="
(slotProps.row.addressId == 0 ||
slotProps.row.addressId == null) &&
slotProps.row.orderType == 'order' &&
slotProps.row.jfDeduction > 0
">
<view class="right flexbox opbtns" style="
"
>
<view
class="right flexbox opbtns"
style="
line-height: 44rpx;
letter-spacing: 1rpx;
display: flex;
align-items: center;
"><text style="color: #9b9b9b"> </text>
<view style="
"
><text style="color: #9b9b9b"> </text>
<view
style="
line-height: 46rpx;
color: #9b9b9b;
font-size: 24rpx;
font-weight: 500;
margin-right: 10rpx;
">积分抵扣</view>
<view style="
"
>积分抵扣</view
>
<view
style="
/* margin-top: 8rpx; */
line-height: 46rpx;
color: #9b9b9b;
font-size: 26rpx;
font-weight: 700;
">
"
>
<text style="font-size: 20rpx">¥</text>
{{ slotProps.row.jfDeduction }}
</view>
</view><text style="color: #9b9b9b"></text>
</view> </view
><text style="color: #9b9b9b"></text>
</view>
</view>
<view class="operation_box boxShadow" v-if="slotProps.row.isShowMore == true">
<view v-if="slotProps.row.orderStatus == 0"
@click.native.stop="canceOrder(slotProps.row)">取消订单</view>
<view
class="operation_box boxShadow"
v-if="slotProps.row.isShowMore == true"
>
<view
v-if="slotProps.row.orderStatus == 0"
@click.native.stop="canceOrder(slotProps.row)"
>取消订单</view
>
</view>
<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)
">更多</view>
"
>更多</view
>
<view class="right flexbox opbtns">
<view class="orderstatusbtn orderstatusbtn_success"
<view
class="orderstatusbtn orderstatusbtn_success"
v-if="slotProps.row.orderStatus == 0"
@click.native.stop="goPay(slotProps.row)">继续付款</view>
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 1">催发货</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>
@click.native.stop="goPay(slotProps.row)"
>继续付款</view
>
<view
class="orderstatusbtn"
v-if="slotProps.row.orderStatus == 1"
>催发货</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
class="orderstatusbtn"
v-if="item.orderStatus == 3 && userRecordid == null"
@@ -269,8 +443,10 @@
</view>
</view>
<view style="border-bottom: 2rpx solid #e9e9e9; height: 50rpx"
v-if="slotProps.rowIndex < slotProps.row.length - 1"></view>
<view
style="border-bottom: 2rpx solid #e9e9e9; height: 50rpx"
v-if="slotProps.rowIndex < slotProps.row.length - 1"
></view>
</view>
<!-- <view class="btns" style="margin-top: 10rpx">
<view class="flexbox opbtns" style="">
@@ -335,49 +511,100 @@
</uni-forms>
<!-- <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="['star', Pform.star >= 1 ? 'starLight' : 'starGray']" @click="getStar(1)">
<view
:class="['star', Pform.star >= 1 ? 'starLight' : 'starGray']"
@click="getStar(1)"
>
</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 :class="['star', Pform.star >= 3 ? 'starLight' : 'starGray']" @click="getStar(3)">
<view
:class="['star', Pform.star >= 3 ? 'starLight' : 'starGray']"
@click="getStar(3)"
>
</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 :class="['star', Pform.star >= 5 ? 'starLight' : 'starGray']" @click="getStar(5)">
<view
:class="['star', Pform.star >= 5 ? 'starLight' : 'starGray']"
@click="getStar(5)"
>
</view>
</view>
<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"/> -->
<u-upload :fileList="Pform.img" @afterRead="afterRead" @delete="deletePic" multiple
:maxCount="4" width="80" height="80" :previewFullImage="true">
<u-upload
:fileList="Pform.img"
@afterRead="afterRead"
@delete="deletePic"
multiple
:maxCount="4"
width="80"
height="80"
:previewFullImage="true"
>
</u-upload>
</view>
<view class="flex-sub flexbox">
<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> -->
<textarea class="textarea" v-model="Pform.comment" @focus="InputFocus" @blur="InputBlur"
@input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;"
placeholder="请输入您要发送的内容"></textarea>
<textarea
class="textarea"
v-model="Pform.comment"
@focus="InputFocus"
@blur="InputBlur"
@input="textareaBInput"
placeholder-style="font-size:24rpx;color:#aaaaaa;"
placeholder="请输入您要发送的内容"
></textarea>
</view>
<view class="">
<!-- <button class="cu-btn bg-gradual-blue shadow-blur">发送</button> -->
<u-button type="success" @click="submitPJ" v-if="pjType != 'zhuiping'">提交评价</u-button>
<u-button type="success" @click="zhuiping" v-else>提交追评</u-button>
<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 style="position: relative">
<emotion @emotion="handleEmj" :height="220" v-if="isShowEmj" :windowWidth="windowWidth">
<emotion
@emotion="handleEmj"
:height="220"
v-if="isShowEmj"
:windowWidth="windowWidth"
>
</emotion>
</view>
</view>
</view>
</u-popup>
<z-navigation></z-navigation>
<u-action-sheet :closeOnClickAction="true" :closeOnClickOverlay="true" :actions="moreList" :show="isShowMore"
cancelText="关闭" @close="isShowMore = false" @select="selectClick"></u-action-sheet>
<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>
</view>
</template>
@@ -386,16 +613,9 @@
import $http from "@/config/requestConfig.js";
import emotion from "@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue";
import musicPlay from "@/components/music.vue";
import {
setPay,
setPayAssign,
setWXPay
} from "@/config/utils";
import { setPay, setPayAssign, setWXPay } from "@/config/utils";
// import { data } from 'jquery';
import {
mapState,
mapMutations
} from "vuex";
import { mapState, mapMutations } from "vuex";
export default {
data() {
return {
@@ -404,10 +624,12 @@
come: "1",
isShowTab: false,
isLoadingHide: false,
moreList: [{
moreList: [
{
name: "取消订单",
key: "false",
}, ],
},
],
currentCateIndex: 0,
pagination: {
// 请求参数
@@ -432,7 +654,8 @@
status: 3,
shupingList: [],
bfaid: null,
ordersTabs: [{
ordersTabs: [
{
name: "全部",
value: -1,
badge: {},
@@ -481,14 +704,14 @@
};
},
onUnload() {
uni.getStorageSync("orderStatus", 0)
uni.getStorageSync("orderStatus", 0);
},
onPullDownRefresh() {
console.log("下拉刷新了");
uni.stopPullDownRefresh();
this.newestpage = 1;
this.pagination.page = 1
this.pagination.page = 1;
// this.hotestpage = 1
// this.booksetpage = 1
this.newList = [];
@@ -499,7 +722,7 @@
},
onReachBottom() {
this.newestpage++;
this.pagination.page++
this.pagination.page++;
// this.hotestpage++
// this.booksetpage++
this.getBookList(this.ordersListTab, false);
@@ -522,8 +745,8 @@
},
onShow() {
console.log('onshow at line onShow:', '先走onshow')
uni.setStorageSync("orderStatus", 0)
console.log("onshow at line onShow:", "先走onshow");
uni.setStorageSync("orderStatus", 0);
var status = uni.getStorageSync("orderStatus");
this.newList = [];
this.pagination = {
@@ -536,7 +759,6 @@
});
},
async created() {
// console.log('onshow at line created:', '先走onshow')
// var status = uni.getStorageSync("orderStatus");
// this.newList = [];
@@ -607,7 +829,7 @@
},
// 切换tab状态
ordersTabCLi(data, index) {
this.axiosStatus = 0
this.axiosStatus = 0;
this.currentCateIndex = index;
this.pagination = {
page: 1, //页码
@@ -634,7 +856,8 @@
// url:'../bookShop/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
// })
uni.navigateTo({
url: "/pages/bookShop/orderLCont?orderId=" +
url:
"/pages/bookShop/orderLCont?orderId=" +
val.orderId +
"&orderType=" +
val.orderStatus +
@@ -701,7 +924,7 @@
// page: this.newestpage,
};
console.log('1111111111111传参数', params)
console.log("1111111111111传参数", params);
this.$http
.request({
url: "common/buyOrder/commonBuyOrderList",
@@ -733,14 +956,15 @@
console.log(e);
});
this.axiosStatus = 1
this.axiosStatus = 1;
},
// 支付
goPay(payItem) {
console.log(payItem, "订单数据");
if (payItem.paymentMethod == 2) {
console.log("阿里支付");
setPay({
setPay(
{
typePay: "alipay",
subject: "order",
totalAmount: payItem.realMoney,
@@ -810,7 +1034,8 @@
uni.showModal({
title: "提示",
showCancel: false,
content: "很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
content:
"很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
});
} else {
this.iphonepay(payItem);
@@ -841,7 +1066,7 @@
// });
this.newestpage = 1;
this.pagination.page = 1
this.pagination.page = 1;
this.newList = [];
this.getBookList(this.ordersListTab, false);
}
@@ -891,7 +1116,8 @@
// }else if(this.sheetList.length == 1){
// 直接展示详情
uni.navigateTo({
url: "./deliverDetail?orderSn=" +
url:
"./deliverDetail?orderSn=" +
item.orderSn +
"&expressOrderSn=" +
item.expressList[0].expressOrderSn,
@@ -929,12 +1155,13 @@
duration: 1000,
});
this.newestpage = 1;
this.pagination.page = 1
this.pagination.page = 1;
this.newList = [];
this.getBookList(this.ordersListTab, false);
}
});
} else if (res.cancel) {}
} else if (res.cancel) {
}
},
});
},
@@ -1066,7 +1293,7 @@
} else {
this.emoji.push({
tag: i.emotion,
name: i.emotioni
name: i.emotioni,
});
// console.log(this.emoji,'this.emoji')
this.Pform.comment += i.emotioni;

View File

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