Commit 5c0bea3f authored by jyx's avatar jyx

快手小程序

parent 9cf7f819
...@@ -18,10 +18,10 @@ function gotoBookSearchPage(searchType = ENUM_SEARCH_TYPE.WAREHOUSE, keyword) { ...@@ -18,10 +18,10 @@ function gotoBookSearchPage(searchType = ENUM_SEARCH_TYPE.WAREHOUSE, keyword) {
// 文章详情 // 文章详情
function gotoBookContentPage(bookId, shortis) { function gotoBookContentPage(bookId, shortis) {
if (shortis && shortis == 0) { if (shortis && shortis == 0) {
gotoShortBookContentPage(bookId) gotoShortBookContentPage(bookId)
} else { } else {
gotoLongBookContentPage(bookId) gotoLongBookContentPage(bookId)
} }
} }
...@@ -29,7 +29,7 @@ function gotoBookContentPage(bookId, shortis) { ...@@ -29,7 +29,7 @@ function gotoBookContentPage(bookId, shortis) {
function gotoShortBookContentPage(bookId) { function gotoShortBookContentPage(bookId) {
// 短篇小说 // 短篇小说
uni.navigateTo({ uni.navigateTo({
url: `/page-subs/sub_A/book-content/book-content`, url: `/page-subs/sub_A/book-content/book-content?bookId=` + bookId,
success: (res) => { success: (res) => {
res.eventChannel.emit("openBookContentPage", { res.eventChannel.emit("openBookContentPage", {
bookId bookId
...@@ -41,7 +41,7 @@ function gotoShortBookContentPage(bookId) { ...@@ -41,7 +41,7 @@ function gotoShortBookContentPage(bookId) {
// 长篇文章详情 // 长篇文章详情
function gotoLongBookContentPage(bookId) { function gotoLongBookContentPage(bookId) {
uni.navigateTo({ uni.navigateTo({
url: `/page-subs/sub_A/book-long-content/book-long-content`, url: `/page-subs/sub_A/book-long-content/book-long-content?bookId=` + bookId,
success: (res) => { success: (res) => {
res.eventChannel.emit("openBookContentPage", { res.eventChannel.emit("openBookContentPage", {
bookId bookId
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
} from "../utils/util.js"; } from "../utils/util.js";
import { import {
PAKEAGE_NAME, PAKEAGE_NAME,
VERSION_CODE VERSION_CODE
} from "../../utils/utils.js"; } from "../../utils/utils.js";
import { import {
...@@ -114,7 +114,9 @@ function refreshUserInfo() { ...@@ -114,7 +114,9 @@ function refreshUserInfo() {
id: userData.idcode, id: userData.idcode,
memberExpirationDate: userData.expireTime memberExpirationDate: userData.expireTime
}) })
saveNickname(userData.nickname); if (userData.nickname) {
saveNickname(userData.nickname);
}
saveUserInfo(user); // 存储用户数据 saveUserInfo(user); // 存储用户数据
postNotification(KEY_NOTIFICATION_LOGIN_SUCCESS); // 通知登录成功 postNotification(KEY_NOTIFICATION_LOGIN_SUCCESS); // 通知登录成功
} }
...@@ -149,7 +151,7 @@ function postPhone(data, callback) { ...@@ -149,7 +151,7 @@ function postPhone(data, callback) {
function requestToken(data, callback) { function requestToken(data, callback) {
let url = `${config["BASE_URL"]}/user/ttLogin`; let url = `${config["BASE_URL"]}/user/ttLogin`;
let header = { let header = {
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
version: VERSION_CODE, version: VERSION_CODE,
token: `` token: ``
} }
...@@ -183,7 +185,7 @@ function requestUserInfo(callback) { ...@@ -183,7 +185,7 @@ function requestUserInfo(callback) {
Object.assign(header, { Object.assign(header, {
token: readToken(), token: readToken(),
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
version: VERSION_CODE, version: VERSION_CODE,
proChannel: uniChannel proChannel: uniChannel
}) })
......
...@@ -103,8 +103,6 @@ ...@@ -103,8 +103,6 @@
} }
}) })
} else if (this.listType == 2) { } else if (this.listType == 2) {
console.log('DDDDDDDD')
getRecommendV1('newbook', 8, (success, data) => { getRecommendV1('newbook', 8, (success, data) => {
if (success) { if (success) {
this.changeData(data) this.changeData(data)
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
<view class="dialog-container"> <view class="dialog-container">
<view class="dialog-content"> <view class="dialog-content">
<text style="font-size: 42rpx; color: #6C6A6A;"> <text style="font-size: 42rpx; color: #6C6A6A;">
{{vipBean.topTitle}} {{vipBean2.topTitle}}
</text> </text>
<view style="display: flex;flex-direction: row;margin-top: 30rpx;"> <view style="display: flex;flex-direction: row;margin-top: 30rpx;">
<view style="font-size: 42rpx;color: #333232;margin-top: 18rpx;"></view> <view style="font-size: 42rpx;color: #333232;margin-top: 18rpx;"></view>
<view style="font-size: 60rpx;color: #F32E2E;font-weight: 777;">{{vipBean.firstPayPrice}}</view> <view style="font-size: 60rpx;color: #F32E2E;font-weight: 777;">{{vipBean2.firstPayPrice}}</view>
<view style="font-size: 42rpx;color: #333232;margin-top: 18rpx;"></view> <view style="font-size: 42rpx;color: #333232;margin-top: 18rpx;"></view>
</view> </view>
<text style="margin-top: 30rpx; font-size: 38rpx; color: #F32E2E"> <text style="margin-top: 30rpx; font-size: 38rpx; color: #F32E2E">
{{vipBean.remarks}} {{vipBean2.remarks}}
</text> </text>
<image @click="handlePay" <image @click="handlePay"
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
}, },
data() { data() {
return { return {
os: 'android' os: 'android',
vipBean2: {}
}; };
}, },
watch: { watch: {
...@@ -67,6 +68,9 @@ ...@@ -67,6 +68,9 @@
} }
}, },
methods: { methods: {
onLoad(options) {
this.vipBean2 = this.vipBean
},
showdialog() { showdialog() {
this.$refs.vipback.open(); this.$refs.vipback.open();
console.log('vipback-', this.vipBean); console.log('vipback-', this.vipBean);
......
<template> <template>
<view> <c-list ref='list' flag='warehouse' method="POST" :height="height" url='/book/articleList/' :param="requestParam"
<c-list ref='list' flag='warehouse' method="POST" :height="height" url='/book/articleList/' @change='changeData'>
:param="requestParam" @change='changeData'> <book-list-item v-for='(item, index) in dataList' :key='index' :item='item' :showClose='false'
<book-list-item v-for='(item, index) in dataList' :key='index' :item='item' :showClose='false' @tapItem='tapItem($event, index)' @close='tapClose($event, index)'>
@tapItem='tapItem($event, index)' @close='tapClose($event, index)'> </book-list-item>
</book-list-item> </c-list>
</c-list>
</view>
</template> </template>
<script> <script>
...@@ -49,8 +47,7 @@ ...@@ -49,8 +47,7 @@
}, },
watch: {}, watch: {},
methods: { methods: {
initRefresh() { initRefresh() {
console.log('YYYYYYY')
if (isEmpty(this.dataList)) { if (isEmpty(this.dataList)) {
this.refreshList(); this.refreshList();
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<CategoryBar id='category' :range='categorys' :current='currentIndex' @change='changeCategory' <CategoryBar id='category' :range='categorys' :current='currentIndex' @change='changeCategory'
@ready='readyCategory'></CategoryBar> @ready='readyCategory'></CategoryBar>
<view :style="[listStyle]" v-if='showEmpty'> <view :style="[listStyle]" v-if='showEmpty'>
<c-empty emptyTitle="暂无数据"></c-empty> <c-empty emptyTitle="正在加载中~"></c-empty>
</view> </view>
<view :style="[listStyle]" v-else> <view :style="[listStyle]" v-else>
<swiper :style="[listStyle]" :indicator-dots="false" :autoplay="false" :current="currentIndex" <swiper :style="[listStyle]" :indicator-dots="false" :autoplay="false" :current="currentIndex"
...@@ -13,14 +13,12 @@ ...@@ -13,14 +13,12 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<view style="height: 20rpx;"></view>
</scroll-view> </scroll-view>
</template> </template>
<script> <script>
import CategoryBar from "./components/category-bar.vue"; import CategoryBar from "./components/category-bar.vue";
import WarehouseList from "./components/warehouse-list.vue"; import WarehouseList from "./components/warehouse-list.vue";
import CEmpty from "@/components/c-empty/c-empty.vue";
import SystemInfoMixin from "../../common/mixins/system-info-mixin.js"; import SystemInfoMixin from "../../common/mixins/system-info-mixin.js";
import Category from "./models/Category.js"; import Category from "./models/Category.js";
import { import {
...@@ -39,8 +37,7 @@ ...@@ -39,8 +37,7 @@
mixins: [SystemInfoMixin], mixins: [SystemInfoMixin],
components: { components: {
CategoryBar, CategoryBar,
WarehouseList, WarehouseList
CEmpty
}, },
data() { data() {
return { return {
...@@ -49,9 +46,8 @@ ...@@ -49,9 +46,8 @@
currentIndex: 0, currentIndex: 0,
}; };
}, },
onLoad(options) {}, onLoad(options) {
onReady() {
this.getCategoryData()
}, },
computed: { computed: {
showEmpty: function() { showEmpty: function() {
...@@ -59,7 +55,7 @@ ...@@ -59,7 +55,7 @@
}, },
listStyle: function() { listStyle: function() {
return { return {
height: `${this.listHeight}px`, height: `${this.listHeight}px`
} }
}, },
categroyChange: function() { categroyChange: function() {
...@@ -76,36 +72,20 @@ ...@@ -76,36 +72,20 @@
watch: { watch: {
categroyChange: { categroyChange: {
handler: function(n, o) { handler: function(n, o) {
// if (this.$refs[`bookList${n.currentIndex}`]) { setTimeout(() => {
// this.$refs[`bookList${n.currentIndex}`][0].initRefresh(); this.$refs[`bookList${n.currentIndex}`][0].initRefresh();
// } }, 500)
this.$nextTick(() => {
let ref = this.$refs.bookList;
if (ref) {
console.log('TTTTTTT')
ref[n.currentIndex].initRefresh();
}
})
}, },
deep: true deep: true
} }
}, },
methods: { methods: {
show() { show() {
// if (this.$refs[`bookList${this.currentIndex}`][0].isEmpty()) { this.getCategoryData();
// this.$refs[`bookList${this.currentIndex}`][0].initRefresh(); },
// } hide() {
this.$nextTick(() => {
let ref = this.$refs.bookList;
if (ref) {
console.log('TTTTTTT')
ref[n.currentIndex].initRefresh();
}
})
}, },
hide() {},
readyCategory() { readyCategory() {
setTimeout(() => { setTimeout(() => {
this.initHeight() this.initHeight()
...@@ -114,7 +94,7 @@ ...@@ -114,7 +94,7 @@
getCategoryData() { getCategoryData() {
getCategorys((success, data) => { getCategorys((success, data) => {
if (success) { if (success) {
var result = data.records ? data.records.map(item => { let result = data.records ? data.records.map(item => {
return new Category(item) return new Category(item)
}).sort((a, b) => { }).sort((a, b) => {
return a.sort - b.sort return a.sort - b.sort
...@@ -123,23 +103,20 @@ ...@@ -123,23 +103,20 @@
name: "全部", name: "全部",
id: "" id: ""
})) }))
console.log('KKKKKKKKKKKKKKK', result)
this.categorys = result; this.categorys = result;
console.log('KKKKKKKKKKKKKKK', this.categorys)
} }
}) })
}, },
initHeight() { initHeight() {
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
query.select("#navi").boundingClientRect();
query.select("#search").boundingClientRect();
query.select("#category").boundingClientRect(); query.select("#category").boundingClientRect();
query.exec((res) => { query.exec((res) => {
let result = 0; var result = 0;
res.forEach(item => { res.forEach(item => {
if (item) { if (item) {
result = result + item.height; if (item.height) {
result = result + item.height;
}
} }
}) })
this.listHeight = this.windowHeight - result - (this.windowHeight * 0.1); this.listHeight = this.windowHeight - result - (this.windowHeight * 0.1);
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
} }
}, this) }, this)
// this.refreshBookData(this.bookId) this.refreshBookData(this.bookId)
}, },
onShow() { onShow() {
refreshUserInfo(); refreshUserInfo();
......
...@@ -301,8 +301,7 @@ ...@@ -301,8 +301,7 @@
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0;
} }
.row:last-child { .row:last-child {
......
<template> <template>
<view class="detail-buy"> <view class="detail-buy">
<view class="book-card"> <view class="book-card">
<view class="cover-box"> <view class="cover-box">
<image class="cover" :src="detail.avatar" mode="aspectFill"></image> <image class="cover" :src="detail.avatar" mode="aspectFill"></image>
</view> </view>
<view class="info-box"> <view class="info-box">
<view class="row"> <view class="row">
<view class="book-title"> <view class="book-title">
{{detail.title}} {{detail.title}}
</view> </view>
<view class="book-value"> <view class="book-value">
{{bookBeanCount}} {{bookBeanCount}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="desc"> <view class="desc">
{{detail.summary}} {{detail.summary}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="c-flex_row c-align_center"> <view class="c-flex_row c-align_center">
<uni-icons type='icon-author' custom-prefix="readiconfont" size='20' <uni-icons type='icon-author' custom-prefix="readiconfont" size='20'
color='#378eff'></uni-icons> color='#378eff'></uni-icons>
<view class="book-author"> <view class="book-author">
{{detail.author}} {{detail.author}}
</view> </view>
</view> </view>
<view class="buy-button disable-button" v-if='detail.isUnlock'> <view class="buy-button disable-button" v-if='detail.isUnlock'>
已购买 已购买
</view> </view>
<view class="buy-button" @click="tapBuy" v-else> <view class="buy-button" @click="tapBuy" v-else>
购买 购买
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="pack-box"> <view class="pack-box">
<view class="pack-item" :class="[{active: index==selectedIndex}]" v-for='(item, index) in packList' <view class="pack-item" :class="[{active: index==selectedIndex}]" v-for='(item, index) in packList'
:key='index' @click="choosePack(item, index)"> :key='index' @click="choosePack(item, index)">
<template v-if='item.isBeanPack'> <template v-if='item.isBeanPack'>
<view class="name row"> <view class="name row">
{{item.title}} {{item.title}}
</view> </view>
<view class="price row"> <view class="price row">
{{item.price}} {{item.price}}
</view> </view>
<view class="cut-down" v-if='item.giveNumber'> <view class="cut-down" v-if='item.giveNumber'>
赠送 {{item.giveNumber}} 书豆 赠送 {{item.giveNumber}} 书豆
</view> </view>
</template> </template>
<template v-else> <template v-else>
<view class="name row"> <view class="name row">
{{item.title}} {{item.title}}
</view> </view>
<view class="price row"> <view class="price row">
{{item.price}} {{item.price}}
</view> </view>
<view class="origin row" v-if='item.originalPrice'> <view class="origin row" v-if='item.originalPrice'>
原价:{{item.originalPrice}} 原价:{{item.originalPrice}}
</view> </view>
<view class="cut-down" v-if='item.cutDown'> <view class="cut-down" v-if='item.cutDown'>
立省 {{item.cutDown}} 立省 {{item.cutDown}}
</view> </view>
</template> </template>
</view> </view>
</view> </view>
<view class="warn-box"> <view class="warn-box">
<view class="warn-p"> <view class="warn-p">
1.目前充值会员暂不支持退款,一经购买不可退换 1.目前充值会员暂不支持退款,一经购买不可退换
</view> </view>
<view class="warn-p"> <view class="warn-p">
2.未满18岁的未成年人需要在监护人主导,同意下进行相关付费操作 2.未满18岁的未成年人需要在监护人主导,同意下进行相关付费操作
</view> </view>
<view class="warn-p"> <view class="warn-p">
3.充值一般在5分钟内到账,如未到账请提供支付截图在"我的"页面联系客服 3.充值一般在5分钟内到账,如未到账请提供支付截图在"我的"页面联系客服
</view> </view>
<view class="warn-p"> <view class="warn-p">
4.之前充值账户请登录后继续阅读 4.之前充值账户请登录后继续阅读
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import Pack from "../../../../common/models/Pack.js"; import Pack from "../../../../common/models/Pack.js";
import PayInfo from "../../../../common/models/PayInfo.js" import PayInfo from "../../../../common/models/PayInfo.js"
import BookBeanPack from "../../../../common/models/BookBeanPack.js" import BookBeanPack from "../../../../common/models/BookBeanPack.js"
import { import {
getPackData, getPackData,
getOpenId, getOpenId,
getPayInfo, getPayInfo,
getBookBeanPackData, getBookBeanPackData,
ENUM_PAY_TYPE, ENUM_PAY_TYPE,
buyBookWithBookBean buyBookWithBookBean
} from "../../../../common/services/index.js"; } from "../../../../common/services/index.js";
import { import {
showLoginView, showLoginView,
refreshUserInfo refreshUserInfo
} from "../../../../common/services/userServices.js" } from "../../../../common/services/userServices.js"
import { import {
toastHide, toastHide,
toastLoading, toastLoading,
toastMessage toastMessage
} from "../../../../common/utils/toastUtil.js"; } from "../../../../common/utils/toastUtil.js";
export default { export default {
props: { props: {
detail: { detail: {
type: Object, type: Object,
default: function() { default: function() {
return {} return {}
} }
}, },
userInfo: { userInfo: {
type: Object, type: Object,
default: function() { default: function() {
return null return null
} }
} }
}, },
data: function() { data: function() {
return { return {
packList: [], packList: [],
vipPackList: [], vipPackList: [],
beanPackList: [], beanPackList: [],
selectedIndex: 0, selectedIndex: 0,
loading: false, loading: false,
imageError: true imageError: true
} }
}, },
computed: { computed: {
bookBeanCount: function() { bookBeanCount: function() {
return this.detail && this.detail.bookLegumes ? `${this.detail.bookLegumes}书豆` : "免费" return this.detail && this.detail.bookLegumes ? `${this.detail.bookLegumes}书豆` : "免费"
}, },
payButtonTitle: function() { payButtonTitle: function() {
let pack = this.packList[this.selectedIndex]; let pack = this.packList[this.selectedIndex];
return (pack instanceof Pack) ? "购买会员" : "购买书豆并解锁本书" return (pack instanceof Pack) ? "购买会员" : "购买书豆并解锁本书"
}, },
packChange: function() { packChange: function() {
const { const {
vipPackList, vipPackList,
beanPackList beanPackList
} = this; } = this;
return { return {
vipPackList, vipPackList,
beanPackList beanPackList
} }
} }
}, },
watch: { watch: {
packChange: { packChange: {
handler: function(n) { handler: function(n) {
this.packList = this.getPackList(n.vipPackList, n.beanPackList); this.packList = this.getPackList(n.vipPackList, n.beanPackList);
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
this.refreshPackData(); this.refreshPackData();
}, },
methods: { methods: {
refreshPackData() { refreshPackData() {
// getPackData((success, data) => { // getPackData((success, data) => {
// if (success) { // if (success) {
// this.vipPackList = data.map(item => { // this.vipPackList = data.map(item => {
// let result = new Pack(item); // let result = new Pack(item);
// result.isBeanPack = false; // result.isBeanPack = false;
// return result; // return result;
// }) // })
// } // }
// }) // })
getBookBeanPackData((success, data) => { getBookBeanPackData((success, data) => {
if (success) { if (success) {
this.beanPackList = data.map(item => { this.beanPackList = data.map(item => {
let result = new BookBeanPack(item); let result = new BookBeanPack(item);
result.isBeanPack = true; result.isBeanPack = true;
return result; return result;
}) })
} }
}) })
}, },
getPackList(vipPackList, beanPackList) { getPackList(vipPackList, beanPackList) {
let vip = vipPackList || []; let vip = vipPackList || [];
let bean = beanPackList || []; let bean = beanPackList || [];
return [ return [
...vip, ...vip,
...bean ...bean
]; ];
}, },
choosePack(item, index) { choosePack(item, index) {
this.selectedIndex = index; this.selectedIndex = index;
this.tapPay(); this.tapPay();
}, },
tapPay() { tapPay() {
let isIOS = uni.getSystemInfoSync().platform == "ios" && false let isIOS = uni.getSystemInfoSync().platform == "ios" && false
if (isIOS) { if (isIOS) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "由于相关规范,iOS功能暂不可用" content: "由于相关规范,iOS功能暂不可用"
}) })
} else { } else {
if (!this.userInfo) { if (!this.userInfo) {
uni.showModal({ uni.showModal({
title: "登录", title: "登录",
content: "购买前请前往登录系统", content: "购买前请前往登录系统",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
showLoginView() showLoginView()
} }
} }
}) })
return; return;
} }
if (this.loading) return; if (this.loading) return;
let pack = this.packList[this.selectedIndex]; let pack = this.packList[this.selectedIndex];
this.loading = true; this.loading = true;
let sysLoginFn = (successCB) => { let sysLoginFn = (successCB) => {
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
onlyAuthorize: true, onlyAuthorize: true,
success: (res) => { success: (res) => {
if (res) { if (res) {
if (typeof successCB == 'function') successCB(res); if (typeof successCB == 'function') successCB(res);
} else { } else {
this.loading = false; this.loading = false;
} }
}, },
fail: (error) => { fail: (error) => {
this.loading = false; this.loading = false;
} }
}) })
} }
let getOpenIdFn = (code, successCB) => { let getOpenIdFn = (code, successCB) => {
getOpenId(code, (success, data) => { getOpenId(code, (success, data) => {
if (success) { if (success) {
if (typeof successCB == 'function') successCB(data); if (typeof successCB == 'function') successCB(data);
} else { } else {
this.loading = false; this.loading = false;
} }
}) })
} }
let getPayInfoFn = (openId, successCB) => { let getPayInfoFn = (openId, successCB) => {
getPayInfo(pack.id, pack.price, openId, (success, data) => { getPayInfo(pack.id, pack.price, openId, (success, data) => {
if (success) { if (success) {
if (typeof successCB == 'function') successCB(new PayInfo(data)); if (typeof successCB == 'function') successCB(new PayInfo(data));
} else { } else {
this.loading = false; this.loading = false;
} }
}, (pack instanceof Pack) ? ENUM_PAY_TYPE.VIP.value : ENUM_PAY_TYPE.BEAN.value) }, (pack instanceof Pack) ? ENUM_PAY_TYPE.VIP.value : ENUM_PAY_TYPE.BEAN.value)
} }
let payOrderFn = (payInfo, successCB) => { let payOrderFn = (payInfo, successCB) => {
uni.requestPayment({ uni.requestPayment({
timeStamp: payInfo.timeStamp, timeStamp: payInfo.timeStamp,
nonceStr: payInfo.nonceStr, nonceStr: payInfo.nonceStr,
package: payInfo.packageStr, package: payInfo.packageStr,
signType: payInfo.signType, signType: payInfo.signType,
paySign: payInfo.paySign, paySign: payInfo.paySign,
success: (res) => { success: (res) => {
if (typeof successCB == 'function') successCB(res); if (typeof successCB == 'function') successCB(res);
}, },
fail: (error) => { fail: (error) => {
this.loading = false; this.loading = false;
} }
}) })
} }
sysLoginFn((code) => { sysLoginFn((code) => {
getOpenIdFn(code.code, (openId) => { getOpenIdFn(code.code, (openId) => {
getPayInfoFn(openId, (payInfo) => { getPayInfoFn(openId, (payInfo) => {
payOrderFn(payInfo, (data) => { payOrderFn(payInfo, (data) => {
this.loading = false; this.loading = false;
toastMessage('会员购买成功') toastMessage('会员购买成功')
refreshUserInfo(); refreshUserInfo();
}) })
}) })
}) })
}) })
} }
}, },
tapBuy() { tapBuy() {
if (!this.userInfo) { if (!this.userInfo) {
uni.showModal({ uni.showModal({
title: "登录", title: "登录",
content: "购买前请前往登录系统", content: "购买前请前往登录系统",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
showLoginView() showLoginView()
} }
} }
}) })
return; return;
} }
if (this.userInfo.bookLegumes < this.detail.bookLegumes) { if (this.userInfo.bookLegumes < this.detail.bookLegumes) {
uni.showModal({ uni.showModal({
title: "余额不足", title: "余额不足",
content: `当前余额:${this.userInfo.bookLegumes}, 请前往充值`, content: `当前余额:${this.userInfo.bookLegumes}, 请前往充值`,
showCancel: false, showCancel: false,
confirmText: "知道了" confirmText: "知道了"
}) })
return; return;
} }
toastLoading("购买中"); toastLoading("购买中");
buyBookWithBookBean(this.detail.id, (success, data) => { buyBookWithBookBean(this.detail.id, (success, data) => {
toastHide(); toastHide();
if (success) { if (success) {
this.$emit("unlockBook") this.$emit("unlockBook")
} }
}) })
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-buy { .detail-buy {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.book-card { .book-card {
margin: 20rpx; margin: 20rpx;
padding: 20rpx; padding: 20rpx;
background: #fdf6f0; background: #fdf6f0;
border-radius: 20rpx; border-radius: 20rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.cover-box { .cover-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.cover { .cover {
width: 140rpx; width: 140rpx;
height: 180rpx; height: 180rpx;
border-radius: 15rpx; border-radius: 15rpx;
} }
} }
.info-box { .info-box {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
margin-left: 20rpx; margin-left: 20rpx;
.row { .row {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.row:last-child {} .row:last-child {}
.book-title { .book-title {
color: #333; color: #333;
font-size: 36rpx; font-size: 36rpx;
font-weight: 700; font-weight: 700;
} }
.book-value { .book-value {
color: goldenrod; color: goldenrod;
font-size: 40rpx; font-size: 40rpx;
font-weight: 700; font-weight: 700;
} }
.desc { .desc {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
font-size: 24rpx; font-size: 24rpx;
color: #999 color: #999
} }
.book-author { .book-author {
color: #999; color: #999;
font-size: 28rpx; font-size: 28rpx;
} }
.buy-button { .buy-button {
background: #caad9c; background: #caad9c;
color: #333; color: #333;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
width: 180rpx; width: 180rpx;
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
} }
.disable-button { .disable-button {
background: #ededed; background: #ededed;
color: #888; color: #888;
} }
} }
} }
.pack-box { .pack-box {
margin-top: 25rpx; margin-top: 25rpx;
margin-left: 40rpx; margin-left: 40rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
.active { .active {
border: 6rpx solid #fd5350 !important; border: 6rpx solid #fd5350 !important;
} }
.pack-item { .pack-item {
margin-bottom: 25rpx; margin-bottom: 25rpx;
margin-right: 40rpx; margin-right: 40rpx;
width: calc(31% - 40rpx); width: calc(31% - 40rpx);
height: 200rpx; height: 200rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
background: #f5f5f5; background: #f5f5f5;
border: 6rpx solid #f5f5f5; border: 6rpx solid #f5f5f5;
border-radius: 10rpx; border-radius: 10rpx;
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0; }
}
.row:last-child {
.row:last-child { margin-bottom: 8rpx;
margin-bottom: 8rpx; }
}
.name {
.name { font-size: 26rpx;
font-size: 26rpx; font-weight: 700;
font-weight: 700; color: #333;
color: #333; }
}
.price {
.price { font-size: 30rpx;
font-size: 30rpx; color: #fd5350;
color: #fd5350; font-weight: 700;
font-weight: 700; }
}
.origin {
.origin { font-size: 22rpx;
font-size: 22rpx; color: #333;
color: #333; text-decoration: line-through;
text-decoration: line-through; }
}
.cut-down {
.cut-down { position: absolute;
position: absolute; top: 0;
top: 0; right: 0;
right: 0; color: #fff;
color: #fff; background: #ff502f;
background: #ff502f; font-size: 22rpx;
font-size: 22rpx; border-radius: 15rpx;
border-radius: 15rpx; height: 30rpx;
height: 30rpx; line-height: 30rpx;
line-height: 30rpx; padding: 0 10rpx;
padding: 0 10rpx; transform: translate(0, -50%);
transform: translate(0, -50%); }
} }
} }
}
.warn-box {
.warn-box { color: #956244;
color: #956244; font-size: 26rpx;
font-size: 26rpx; display: flex;
display: flex; flex-direction: column;
flex-direction: column; padding: 30rpx;
padding: 30rpx;
.warn-p {
.warn-p { margin-bottom: 15rpx;
margin-bottom: 15rpx; }
}
.warn-p:last-child {
.warn-p:last-child { margin-bottom: 0;
margin-bottom: 0; }
} }
} }
}
</style> </style>
\ No newline at end of file
...@@ -186,8 +186,7 @@ ...@@ -186,8 +186,7 @@
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0;
} }
.row:last-child { .row:last-child {
......
...@@ -267,8 +267,7 @@ ...@@ -267,8 +267,7 @@
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0;
} }
.row:last-child { .row:last-child {
......
...@@ -272,8 +272,7 @@ ...@@ -272,8 +272,7 @@
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0;
} }
.row:last-child { .row:last-child {
......
<template> <template>
<view class="detail-buy"> <view class="detail-buy">
<view class="book-card"> <view class="book-card">
<view class="cover-box"> <view class="cover-box">
<image class="cover" :src="detail.avatar" mode="aspectFill"></image> <image class="cover" :src="detail.avatar" mode="aspectFill"></image>
</view> </view>
<view class="info-box"> <view class="info-box">
<view class="row"> <view class="row">
<view class="book-title"> <view class="book-title">
{{detail.title}} {{detail.title}}
</view> </view>
<view class="book-value"> <view class="book-value">
{{bookBeanCount}} {{bookBeanCount}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="desc"> <view class="desc">
{{detail.summary}} {{detail.summary}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="c-flex_row c-align_center"> <view class="c-flex_row c-align_center">
<uni-icons type='icon-author' custom-prefix="readiconfont" size='20' <uni-icons type='icon-author' custom-prefix="readiconfont" size='20'
color='#378eff'></uni-icons> color='#378eff'></uni-icons>
<view class="book-author"> <view class="book-author">
{{detail.author}} {{detail.author}}
</view> </view>
</view> </view>
<view class="buy-button disable-button" v-if='detail.isUnlock'> <view class="buy-button disable-button" v-if='detail.isUnlock'>
已购买 已购买
</view> </view>
<view class="buy-button" @click="tapBuy" v-else> <view class="buy-button" @click="tapBuy" v-else>
购买 购买
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="pack-box"> <view class="pack-box">
<view class="pack-item" :class="[{active: index==selectedIndex}]" v-for='(item, index) in packList' <view class="pack-item" :class="[{active: index==selectedIndex}]" v-for='(item, index) in packList'
:key='index' @click="choosePack(item, index)"> :key='index' @click="choosePack(item, index)">
<template v-if='item.isBeanPack'> <template v-if='item.isBeanPack'>
<view class="name row"> <view class="name row">
{{item.title}} {{item.title}}
</view> </view>
<view class="price row"> <view class="price row">
{{item.price}} {{item.price}}
</view> </view>
<view class="cut-down" v-if='item.giveNumber'> <view class="cut-down" v-if='item.giveNumber'>
赠送 {{item.giveNumber}} 书豆 赠送 {{item.giveNumber}} 书豆
</view> </view>
</template> </template>
<template v-else> <template v-else>
<view class="name row"> <view class="name row">
{{item.title}} {{item.title}}
</view> </view>
<view class="price row"> <view class="price row">
{{item.price}} {{item.price}}
</view> </view>
<view class="origin row" v-if='item.originalPrice'> <view class="origin row" v-if='item.originalPrice'>
原价:{{item.originalPrice}} 原价:{{item.originalPrice}}
</view> </view>
<view class="cut-down" v-if='item.cutDown'> <view class="cut-down" v-if='item.cutDown'>
立省 {{item.cutDown}} 立省 {{item.cutDown}}
</view> </view>
</template> </template>
</view> </view>
</view> </view>
<view class="warn-box"> <view class="warn-box">
<view class="warn-p"> <view class="warn-p">
1.目前充值会员暂不支持退款,一经购买不可退换 1.目前充值会员暂不支持退款,一经购买不可退换
</view> </view>
<view class="warn-p"> <view class="warn-p">
2.未满18岁的未成年人需要在监护人主导,同意下进行相关付费操作 2.未满18岁的未成年人需要在监护人主导,同意下进行相关付费操作
</view> </view>
<view class="warn-p"> <view class="warn-p">
3.充值一般在5分钟内到账,如未到账请提供支付截图在"我的"页面联系客服 3.充值一般在5分钟内到账,如未到账请提供支付截图在"我的"页面联系客服
</view> </view>
<view class="warn-p"> <view class="warn-p">
4.之前充值账户请登录后继续阅读 4.之前充值账户请登录后继续阅读
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import Pack from "../../../../common/models/Pack.js"; import Pack from "../../../../common/models/Pack.js";
import PayInfo from "../../../../common/models/PayInfo.js" import PayInfo from "../../../../common/models/PayInfo.js"
import BookBeanPack from "../../../../common/models/BookBeanPack.js" import BookBeanPack from "../../../../common/models/BookBeanPack.js"
import { import {
getPackData, getPackData,
getOpenId, getOpenId,
getPayInfo, getPayInfo,
getBookBeanPackData, getBookBeanPackData,
ENUM_PAY_TYPE, ENUM_PAY_TYPE,
buyBookWithBookBean buyBookWithBookBean
} from "../../../../common/services/index.js"; } from "../../../../common/services/index.js";
import { import {
showLoginView, showLoginView,
refreshUserInfo refreshUserInfo
} from "../../../../common/services/userServices.js" } from "../../../../common/services/userServices.js"
import { import {
toastHide, toastHide,
toastLoading, toastLoading,
toastMessage toastMessage
} from "../../../../common/utils/toastUtil.js"; } from "../../../../common/utils/toastUtil.js";
export default { export default {
props: { props: {
detail: { detail: {
type: Object, type: Object,
default: function() { default: function() {
return {} return {}
} }
}, },
userInfo: { userInfo: {
type: Object, type: Object,
default: function() { default: function() {
return null return null
} }
} }
}, },
data: function() { data: function() {
return { return {
packList: [], packList: [],
vipPackList: [], vipPackList: [],
beanPackList: [], beanPackList: [],
selectedIndex: 0, selectedIndex: 0,
loading: false, loading: false,
imageError: true imageError: true
} }
}, },
computed: { computed: {
bookBeanCount: function() { bookBeanCount: function() {
return this.detail && this.detail.bookLegumes ? `${this.detail.bookLegumes}书豆` : "免费" return this.detail && this.detail.bookLegumes ? `${this.detail.bookLegumes}书豆` : "免费"
}, },
payButtonTitle: function() { payButtonTitle: function() {
let pack = this.packList[this.selectedIndex]; let pack = this.packList[this.selectedIndex];
return (pack instanceof Pack) ? "购买会员" : "购买书豆并解锁本书" return (pack instanceof Pack) ? "购买会员" : "购买书豆并解锁本书"
}, },
packChange: function() { packChange: function() {
const { const {
vipPackList, vipPackList,
beanPackList beanPackList
} = this; } = this;
return { return {
vipPackList, vipPackList,
beanPackList beanPackList
} }
} }
}, },
watch: { watch: {
packChange: { packChange: {
handler: function(n) { handler: function(n) {
this.packList = this.getPackList(n.vipPackList, n.beanPackList); this.packList = this.getPackList(n.vipPackList, n.beanPackList);
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
this.refreshPackData(); this.refreshPackData();
}, },
methods: { methods: {
loadImage() { loadImage() {
this.imageError = false this.imageError = false
}, },
errorImage() { errorImage() {
this.imageError = true this.imageError = true
}, },
refreshPackData() { refreshPackData() {
getPackData((success, data) => { getPackData((success, data) => {
if (success) { if (success) {
this.vipPackList = data.map(item => { this.vipPackList = data.map(item => {
let result = new Pack(item); let result = new Pack(item);
result.isBeanPack = false; result.isBeanPack = false;
return result; return result;
}) })
} }
}) })
getBookBeanPackData((success, data) => { getBookBeanPackData((success, data) => {
if (success) { if (success) {
this.beanPackList = data.map(item => { this.beanPackList = data.map(item => {
let result = new BookBeanPack(item); let result = new BookBeanPack(item);
result.isBeanPack = true; result.isBeanPack = true;
return result; return result;
}) })
} }
}) })
}, },
getPackList(vipPackList, beanPackList) { getPackList(vipPackList, beanPackList) {
let vip = vipPackList || []; let vip = vipPackList || [];
let bean = beanPackList || []; let bean = beanPackList || [];
return [ return [
...vip, ...vip,
...bean ...bean
]; ];
}, },
choosePack(item, index) { choosePack(item, index) {
this.selectedIndex = index; this.selectedIndex = index;
this.tapPay(); this.tapPay();
}, },
tapPay() { tapPay() {
let isIOS = uni.getSystemInfoSync().platform == "ios" && false let isIOS = uni.getSystemInfoSync().platform == "ios" && false
if (isIOS) { if (isIOS) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "由于相关规范,iOS功能暂不可用" content: "由于相关规范,iOS功能暂不可用"
}) })
} else { } else {
if (!this.userInfo) { if (!this.userInfo) {
uni.showModal({ uni.showModal({
title: "登录", title: "登录",
content: "购买前请前往登录系统", content: "购买前请前往登录系统",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
showLoginView() showLoginView()
} }
} }
}) })
return; return;
} }
if (this.loading) return; if (this.loading) return;
let pack = this.packList[this.selectedIndex]; let pack = this.packList[this.selectedIndex];
this.loading = true; this.loading = true;
let sysLoginFn = (successCB) => { let sysLoginFn = (successCB) => {
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
onlyAuthorize: true, onlyAuthorize: true,
success: (res) => { success: (res) => {
if (res) { if (res) {
if (typeof successCB == 'function') successCB(res); if (typeof successCB == 'function') successCB(res);
} else { } else {
this.loading = false; this.loading = false;
} }
}, },
fail: (error) => { fail: (error) => {
this.loading = false; this.loading = false;
} }
}) })
} }
let getOpenIdFn = (code, successCB) => { let getOpenIdFn = (code, successCB) => {
getOpenId(code, (success, data) => { getOpenId(code, (success, data) => {
if (success) { if (success) {
if (typeof successCB == 'function') successCB(data); if (typeof successCB == 'function') successCB(data);
} else { } else {
this.loading = false; this.loading = false;
} }
}) })
} }
let getPayInfoFn = (openId, successCB) => { let getPayInfoFn = (openId, successCB) => {
getPayInfo(pack.id, pack.price, openId, (success, data) => { getPayInfo(pack.id, pack.price, openId, (success, data) => {
if (success) { if (success) {
if (typeof successCB == 'function') successCB(new PayInfo(data)); if (typeof successCB == 'function') successCB(new PayInfo(data));
} else { } else {
this.loading = false; this.loading = false;
} }
}, (pack instanceof Pack) ? ENUM_PAY_TYPE.VIP.value : ENUM_PAY_TYPE.BEAN.value) }, (pack instanceof Pack) ? ENUM_PAY_TYPE.VIP.value : ENUM_PAY_TYPE.BEAN.value)
} }
let payOrderFn = (payInfo, successCB) => { let payOrderFn = (payInfo, successCB) => {
uni.requestPayment({ uni.requestPayment({
timeStamp: payInfo.timeStamp, timeStamp: payInfo.timeStamp,
nonceStr: payInfo.nonceStr, nonceStr: payInfo.nonceStr,
package: payInfo.packageStr, package: payInfo.packageStr,
signType: payInfo.signType, signType: payInfo.signType,
paySign: payInfo.paySign, paySign: payInfo.paySign,
success: (res) => { success: (res) => {
if (typeof successCB == 'function') successCB(res); if (typeof successCB == 'function') successCB(res);
}, },
fail: (error) => { fail: (error) => {
this.loading = false; this.loading = false;
} }
}) })
} }
sysLoginFn((code) => { sysLoginFn((code) => {
getOpenIdFn(code.code, (openId) => { getOpenIdFn(code.code, (openId) => {
getPayInfoFn(openId, (payInfo) => { getPayInfoFn(openId, (payInfo) => {
payOrderFn(payInfo, (data) => { payOrderFn(payInfo, (data) => {
this.loading = false; this.loading = false;
toastMessage('会员购买成功') toastMessage('会员购买成功')
refreshUserInfo(); refreshUserInfo();
}) })
}) })
}) })
}) })
} }
}, },
tapBuy() { tapBuy() {
if (!this.userInfo) { if (!this.userInfo) {
uni.showModal({ uni.showModal({
title: "登录", title: "登录",
content: "购买前请前往登录系统", content: "购买前请前往登录系统",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
showLoginView() showLoginView()
} }
} }
}) })
return; return;
} }
if (this.userInfo.bookLegumes < this.detail.bookLegumes) { if (this.userInfo.bookLegumes < this.detail.bookLegumes) {
uni.showModal({ uni.showModal({
title: "余额不足", title: "余额不足",
content: `当前余额:${this.userInfo.bookLegumes}, 请前往充值`, content: `当前余额:${this.userInfo.bookLegumes}, 请前往充值`,
showCancel: false, showCancel: false,
confirmText: "知道了" confirmText: "知道了"
}) })
return; return;
} }
toastLoading("购买中"); toastLoading("购买中");
buyBookWithBookBean(this.detail.id, (success, data) => { buyBookWithBookBean(this.detail.id, (success, data) => {
toastHide(); toastHide();
if (success) { if (success) {
this.$emit("unlockBook") this.$emit("unlockBook")
} }
}) })
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-buy { .detail-buy {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.book-card { .book-card {
margin: 20rpx; margin: 20rpx;
padding: 20rpx; padding: 20rpx;
background: #fdf6f0; background: #fdf6f0;
border-radius: 20rpx; border-radius: 20rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.cover-box { .cover-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.cover { .cover {
width: 140rpx; width: 140rpx;
height: 180rpx; height: 180rpx;
border-radius: 15rpx; border-radius: 15rpx;
} }
} }
.info-box { .info-box {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
margin-left: 20rpx; margin-left: 20rpx;
.row { .row {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.row:last-child {} .row:last-child {}
.book-title { .book-title {
color: #333; color: #333;
font-size: 36rpx; font-size: 36rpx;
font-weight: 700; font-weight: 700;
} }
.book-value { .book-value {
color: goldenrod; color: goldenrod;
font-size: 40rpx; font-size: 40rpx;
font-weight: 700; font-weight: 700;
} }
.desc { .desc {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
font-size: 24rpx; font-size: 24rpx;
color: #999 color: #999
} }
.book-author { .book-author {
color: #999; color: #999;
font-size: 28rpx; font-size: 28rpx;
} }
.buy-button { .buy-button {
background: #caad9c; background: #caad9c;
color: #333; color: #333;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
width: 180rpx; width: 180rpx;
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
} }
.disable-button { .disable-button {
background: #ededed; background: #ededed;
color: #888; color: #888;
} }
} }
} }
.pack-box { .pack-box {
margin-top: 25rpx; margin-top: 25rpx;
margin-left: 40rpx; margin-left: 40rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
.active { .active {
border: 6rpx solid #fd5350 !important; border: 6rpx solid #fd5350 !important;
} }
.pack-item { .pack-item {
margin-bottom: 25rpx; margin-bottom: 25rpx;
margin-right: 40rpx; margin-right: 40rpx;
width: calc(31% - 40rpx); width: calc(31% - 40rpx);
height: 200rpx; height: 200rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
background: #f5f5f5; background: #f5f5f5;
border: 6rpx solid #f5f5f5; border: 6rpx solid #f5f5f5;
border-radius: 10rpx; border-radius: 10rpx;
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0; }
}
.row:last-child {
.row:last-child { margin-bottom: 8rpx;
margin-bottom: 8rpx; }
}
.name {
.name { font-size: 26rpx;
font-size: 26rpx; font-weight: 700;
font-weight: 700; color: #333;
color: #333; }
}
.price {
.price { font-size: 30rpx;
font-size: 30rpx; color: #fd5350;
color: #fd5350; font-weight: 700;
font-weight: 700; }
}
.origin {
.origin { font-size: 22rpx;
font-size: 22rpx; color: #333;
color: #333; text-decoration: line-through;
text-decoration: line-through; }
}
.cut-down {
.cut-down { position: absolute;
position: absolute; top: 0;
top: 0; right: 0;
right: 0; color: #fff;
color: #fff; background: #ff502f;
background: #ff502f; font-size: 22rpx;
font-size: 22rpx; border-radius: 15rpx;
border-radius: 15rpx; height: 30rpx;
height: 30rpx; line-height: 30rpx;
line-height: 30rpx; padding: 0 10rpx;
padding: 0 10rpx; transform: translate(0, -50%);
transform: translate(0, -50%); }
} }
} }
}
.warn-box {
.warn-box { color: #956244;
color: #956244; font-size: 26rpx;
font-size: 26rpx; display: flex;
display: flex; flex-direction: column;
flex-direction: column; padding: 30rpx;
padding: 30rpx;
.warn-p {
.warn-p { margin-bottom: 15rpx;
margin-bottom: 15rpx; }
}
.warn-p:last-child {
.warn-p:last-child { margin-bottom: 0;
margin-bottom: 0; }
} }
} }
}
</style> </style>
\ No newline at end of file
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0; marign-bottom: 0;
} }
......
...@@ -267,8 +267,7 @@ ...@@ -267,8 +267,7 @@
position: relative; position: relative;
.row { .row {
margin: 8rpx 15rpx; margin: 8rpx 15rpx 0 15rpx;
marign-bottom: 0;
} }
.row:last-child { .row:last-child {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<uni-easyinput v-model="searchKeyword" placeholder="请输入书名或者作者名" :focus='focus' confirmType="search" <uni-easyinput v-model="searchKeyword" placeholder="请输入书名或者作者名" :focus='focus' confirmType="search"
trim="all" :inputBorder="true" @clear="clearInput" @change="changeInput" trim="all" :inputBorder="true" @clear="clearInput" @change="changeInput"
@confirm="changeInput"></uni-easyinput> @confirm="changeInput"></uni-easyinput>
</view> </view>
<view class="button-box item" @click="tapSearch"> <view class="button-box item" @click="tapSearch">
<view class="title"> <view class="title">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment