版本恢复

This commit is contained in:
@fawn-nine
2023-09-19 09:43:11 +08:00
parent 8ebf79f301
commit 30e174b237
3 changed files with 301 additions and 333 deletions

View File

@@ -18,23 +18,8 @@
<view v-else class="dakaBtn" style="border-color: #fff;"> <view v-else class="dakaBtn" style="border-color: #fff;">
<text style=" color:#a3a3a3;">今天已签到</text> <text style=" color:#a3a3a3;">今天已签到</text>
</view> </view>
</view> </view>
</view>
</view>
<!-- <scroll-view class="scroll-view_H flexbox" scroll-x="true" @scroll="scroll" :scroll-left="scrollLeft">
<view class="" style="padding: 0 6rpx; display: inline-block; width: 20%; box-sizing: border-box; " v-for="(item,index) in 365">
<view
:class="['item', signList.indexOf(index+1) != -1 ? 'havSign' : '',
currentDay == index+1 && signList.indexOf(index+1) == -1 ? 'current' : '',
linshiDay == index+1 ? 'linshiDay':'']" @click="getInfo(index+1)">
<span class="day"><em>{{index+1}}</em> </span>
<u-icon v-if="signList.indexOf(index+1) != -1" name="checkbox-mark" color="#fff" size="28" style="margin: 0 auto; width: 28px; text-align: center;"></u-icon>
<span v-if="signList.indexOf(index+1) == -1 && currentDay > index+1" class="buka">未签</span>
<span v-if="currentDay < index+1" class="weidaka">未开始</span>
<span v-if="currentDay == index+1 && signList.indexOf(index+1) == -1" class="daka" @click="kuickSign()">签到</span>
</view>
</view>
</scroll-view> -->
<swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" <swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
:duration="duration"> :duration="duration">
<swiper-item v-for="(item,index) in dayList" :key="index" class="flexbox swiperPage"> <swiper-item v-for="(item,index) in dayList" :key="index" class="flexbox swiperPage">

View File

@@ -18,8 +18,9 @@
</p> --> </p> -->
</view> </view>
<view class="tags"> <view class="tags">
<uni-tag @click="gotoListen()" class="tag" v-if="bookMessage.canListen" :inverted="true" text="听书" type="primary"></uni-tag>
<uni-tag class="tag" @click="toMore()" :inverted="true" text="书评" type="success"></uni-tag> <uni-tag class="tag" @click="toMore()" :inverted="true" text="书评" type="success"></uni-tag>
<uni-tag @click="gotoListen()" class="tag" v-if="bookMessage.canListen" :inverted="true" text="听书" type="primary"></uni-tag>
<!-- 1:打卡2不打卡 --> <!-- 1:打卡2不打卡 -->
<uni-tag @click="gotoclock()" v-if="bookMessage.clockIn == 1" class="tag" :inverted="true" text="签到" type="warning"></uni-tag> <uni-tag @click="gotoclock()" v-if="bookMessage.clockIn == 1" class="tag" :inverted="true" text="签到" type="warning"></uni-tag>
</view> </view>

View File

@@ -5,43 +5,43 @@
<view class="flexbox" style=" justify-content: space-between; "> <view class="flexbox" style=" justify-content: space-between; ">
<view class="icon_hua"> <view class="icon_hua">
<image src="../../static/icon/home_icon_3.png" mode="aspectFit" class="icon_hua_1"></image> <image src="../../static/icon/home_icon_3.png" mode="aspectFit" class="icon_hua_1"></image>
</view> </view>
<view class="search_box flexbox" @click="onPageJump('./searchFor')"> <view class="search_box flexbox" @click="onPageJump('./searchFor')">
<view class="search"> <view class="search">
<text class="icon_search"></text> <text class="icon_search"></text>
<text class="prompt">请输入想要搜索的书名</text> <text class="prompt">请输入想要搜索的书名</text>
</view> </view>
</view> </view>
<view class="searBtn flexbox"> <view class="searBtn flexbox">
<text>搜索</text> <text>搜索</text>
</view> </view>
</view> </view>
<!-- <view class="home_lunbo"> <!-- <view class="home_lunbo">
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper> <u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
</view> --> </view> -->
</view> </view>
<!-- <view class="home_nar" v-if="showEbook"> --> <!-- <view class="home_nar" v-if="showEbook"> -->
<view class="home_nar"> <view class="home_nar">
<view class="hn_cl_tit shuguan" @click="onPageJump('../clock/index')"> <view class="hn_cl_tit shuguan" @click="onPageJump('../clock/index')">
<image src="../../static/icon/home1.png" mode="aspectFit"></image> <image src="../../static/icon/home1.png" mode="aspectFit"></image>
<text>读书打卡</text> <text>读书打卡</text>
</view> </view>
<view class="hn_cl_tit dianzishu" @click="onPageJump('../listen/home')"> <view class="hn_cl_tit dianzishu" @click="onPageJump('../listen/home')">
<image src="../../static/icon/home2.png" mode="aspectFit"></image> <image src="../../static/icon/home2.png" mode="aspectFit"></image>
<text>听书</text> <text>听书</text>
</view> </view>
<!-- <view class="hn_cl_tit" @click="onPageJump('../bookShop/bookShopIndex')"> --> <!-- <view class="hn_cl_tit" @click="onPageJump('../bookShop/bookShopIndex')"> -->
<view class="hn_cl_tit shuping" @click="onPageJump('../bookscomments/comments')"> <view class="hn_cl_tit shuping" @click="onPageJump('../bookscomments/comments')">
<image src="../../static/icon/home3.png" mode="aspectFit"></image> <image src="../../static/icon/home3.png" mode="aspectFit"></image>
<text>书评</text> <text>书评</text>
</view> </view>
<view class="hn_cl_tit chaoshi" @click="onPageJump('../bookShop/classify')"> <view class="hn_cl_tit chaoshi" @click="onPageJump('../bookShop/classify')">
<image src="../../static/icon/home4.png" mode="aspectFit"></image> <image src="../../static/icon/home4.png" mode="aspectFit"></image>
<text>图书馆</text> <text>图书馆</text>
</view> </view>
</view> </view>
<!-- <view class="home_lunbo"> <!-- <view class="home_lunbo">
@@ -73,7 +73,7 @@
<image src="../../static/icon/midBtn_06.png" mode="aspectFit"></image> <image src="../../static/icon/midBtn_06.png" mode="aspectFit"></image>
</view> </view>
</view> </view>
<view class="head_line" v-if="seckillList!=null"> <view class="head_line" v-if="seckillList!=null">
<b></b> <b></b>
<text>商品秒杀</text> <text>商品秒杀</text>
@@ -81,7 +81,7 @@
</view> </view>
<!-- 限时秒杀 --> <!-- 限时秒杀 -->
<view class="limited" v-if="seckillList!=null"> <view class="limited" v-if="seckillList!=null">
<view class="limitedSymbol"> <view class="limitedSymbol">
<image src="../../static/icon/shopping_xsh.png"></image> <image src="../../static/icon/shopping_xsh.png"></image>
</view> </view>
@@ -98,124 +98,44 @@
</view> </view>
</view> </view>
<view class="head_line" > <view class="head_line">
<b></b> <b></b>
<text>新书上市</text> <text>新书上市</text>
<!-- <i @click="onBookMore('New')">查看更多 ></i> --> <!-- <i @click="onBookMore('New')">查看更多 ></i> -->
</view> </view>
<view class="newBook"> <view class="newBook">
<scroll-view class="scroll-view_H " scroll-x="true" scroll-left="10"> <scroll-view class="scroll-view_H " scroll-x="true" scroll-left="10">
<view :class="['item']" v-for="(item,index) in newBookList" :key="index"> <view :class="['item']" v-for="(item,index) in newBookList" :key="index">
<view class="videoBox" @click="goDetail(item.productId)"> <view class="videoBox" @click="goDetail(item.productId)">
<image v-if="item.productImages != ''" :src="item.productImages" mode="scaleToFill"></image> <image v-if="item.productImages != ''" :src="item.productImages" mode="scaleToFill"></image>
<image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill"></image> <image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill"></image>
</view>
<text class="bookName">{{item.productName}}</text>
</view> </view>
<text class="bookName">{{item.productName}}</text>
</view>
</scroll-view> </scroll-view>
</view> </view>
<!-- end -->
<view class="home_xinshu" v-if="showEbook">
<view v-for="(item, index) in xinsList" @click="onBookJump(item)" v-if="index<3" class="hx_list">
<image :src="item.image"></image>
<view class="hx_title">{{item.bookName}}</view>
<view class="hx_author">{{item.authorName}} []</view>
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
<br clear='both'>
<view v-for="(item, index) in xinsList" @click="onBookJump(item)" v-if="index>2&&index<6" class="hx_list">
<image :src="item.image"></image>
<view class="hx_title">{{item.bookName}}</view>
<view class="hx_author">{{item.authorName}} []</view>
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
<br clear='both'>
</view>
<!--按类型 类型推荐 -->
<view class="tuijianView">
</view>
<!-- end -->
<view class="head_line" v-if="showEbook">
<b></b>
<text>限时特价</text>
<i @click="onBookMore('Sale')">查看更多 ></i>
</view>
<view class="home_limit" v-if="showEbook">
<u-scroll-list indicatorActiveColor="#27b386">
<view v-for="(item, index) in limiTist" :key="index" @click="onBookJump(item)" class="lt_list">
<image :src="item.image"></image>
<view class="lt_title">{{item.bookName}}</view>
<view class="lt_author">{{item.authorName}} []</view>
<view class="lt_yuan">{{item.price}}疯币</view>
<view class="lt_xian">{{item.salePrice}}疯币</view>
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
</u-scroll-list>
</view>
<view class="head_line" v-if="showEbook">
<b></b>
<text>精选书单</text>
<i @click="onBookMore('Best')">查看更多 ></i>
</view>
<view class="home_jingxu" v-if="showEbook">
<view class="hj_hot" v-for="(item,index) in jingList" @click="onBookJump(item)">
<view>
<text class="bok_name">{{item.bookName}}</text>
<text style="margin-left: 50rpx;" v-if="item.authorName!=''">{{item.authorName}}</text>
</view>
<view v-if="item.publisherName!=''">
<text>出版社{{item.publisherName}}</text>
</view>
<view>
<text>{{item.introduce | ellipsis}}</text>
</view>
<image :src="item.image"></image>
<!-- <b v-if="item.isVip==0">免费</b> -->
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
</view>
<view class="head_line" style="margin-bottom: 10px;"> <view class="head_line" style="margin-bottom: 10px;">
<b></b> <b></b>
<text>精选图书</text> <text>精选商品</text>
<!-- <i @click="onShopMore('Hot')">查看更多 ></i> --> <!-- <i @click="onShopMore('Hot')">查看更多 ></i> -->
<!-- <i @click="onPageJump('../bookShop/classify')">查看更多 ></i> --> <i @click="onPageJump('../bookShop/classify')">查看更多 ></i>
</view> </view>
<!-- 商品展示 --> <!-- 商品展示 -->
<view class="goods"> <view class="goods">
<view class="goodsItem flexbox" v-for="(item,index) in goodsList" :key="item.productId" <view class="goodsItem" v-for="(item,index) in goodsList" :key="item.productId"
> @click="goDetail(item.productId)">
<view class="imgs" @click="onBookJump(item)"> <image :src="item.productImages" mode="" class="goodsImg"></image>
<image v-if="item.images != ''" :src="item.images" mode="" class="goodsImg"></image>
<image v-else src="../../static/icon/home_bg.jpg" class="goodsImg"></image>
</view>
<view class="goodsContent"> <view class="goodsContent">
<view class="goodsName"> <view class="goodsName">
<span>{{item.name}}</span> {{item.productName}}
</view> </view>
<view class="tags"> <view class="goodsPrice">
<uni-tag v-if="item.canListen" style="margin-right: 10rpx;" @click="gotoListen(item)" class="tag" :inverted="true" text="听书" type="primary"></uni-tag> <span class="price">{{item.price}}</span>
<uni-tag style="margin-right: 10rpx;" class="tag" @click="gotopingshu(item)" :inverted="true" text="书评" type="success"></uni-tag> <span class="Salesnum">已售{{item.sumSales}} </span>
<!-- 1:打卡2不打卡 -->
<uni-tag v-if="item.clockIn == 1" style="margin-right: 10rpx;" @click="gotoclock(item)" class="tag" :inverted="true" text="签到" type="warning"></uni-tag>
</view>
<view class="flexbox" style="margin-top: 20rpx; color: #5f5f5f;">
<view class="">
<span v-if="item.authorName">{{item.authorName}} &nbsp; &nbsp;</span>
<span v-if="item.publisherName">&nbsp; &nbsp;/&nbsp; {{item.publisherName}} &nbsp;</span>
</view>
</view> </view>
</view> </view>
</view> </view>
@@ -235,7 +155,7 @@
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<z-navigation></z-navigation> <z-navigation></z-navigation>
<music-play :playList="myList"></music-play> <music-play :playList="myList"></music-play>
</view> </view>
</template> </template>
@@ -245,25 +165,26 @@
import repciptData from '@/static/json/repcipt.json' import repciptData from '@/static/json/repcipt.json'
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
import { import {
mapState,mapMutations mapState,
mapMutations
} from 'vuex'; } from 'vuex';
export default { export default {
data() { data() {
return { return {
myList:[], myList: [],
showEbook:false, // 显示电子书相关 showEbook: false, // 显示电子书相关
transaction: { // 成功回调 transaction: { // 成功回调
}, },
status:3, status: 3,
jPage:1, jPage: 1,
jTotal:0, jTotal: 0,
scrollLeft:0, scrollLeft: 0,
maxTimes:1, // 轮询最大次数 maxTimes: 1, // 轮询最大次数
ComplateRequestInterval:null, // 轮询定时器 ComplateRequestInterval: null, // 轮询定时器
checking:false, // 正在检测 checking: false, // 正在检测
ComplateRequestArr:[], ComplateRequestArr: [],
iapChannel:null, iapChannel: null,
scrollTop: 0, scrollTop: 0,
list3: [ list3: [
// '../../static/icon/home_ban_1.jpg', // '../../static/icon/home_ban_1.jpg',
@@ -278,7 +199,7 @@
bgiStyle: { bgiStyle: {
background: '#fff' background: '#fff'
}, },
newBookList:[], newBookList: [],
iconStyle: { iconStyle: {
fontSize: '40rpx', fontSize: '40rpx',
fontWeight: 'bold', fontWeight: 'bold',
@@ -293,16 +214,16 @@
onLoad(e) { onLoad(e) {
// 隐藏原生的tabbar // 隐藏原生的tabbar
uni.hideTabBar(); uni.hideTabBar();
// this.requestIapOrder() // this.requestIapOrder()
}, },
//页面显示 //页面显示
onShow() { onShow() {
// 隐藏原生的tabbar // 隐藏原生的tabbar
uni.hideTabBar(); uni.hideTabBar();
this.goodsList = [] this.goodsList = []
this.getData(); this.getData();
}, },
// 页面加载完毕 // 页面加载完毕
onReady() { onReady() {
@@ -315,22 +236,21 @@
this.goodsList = [] this.goodsList = []
this.getData() this.getData()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
this.requestIapOrder() this.requestIapOrder()
}, },
onHide() { onHide() {
this.jPage = 1 this.jPage = 1
this.goodsList = [] this.goodsList = []
}, },
onReachBottom() { onReachBottom() {
console.log('到底了') console.log('到底了')
// if (this.jPage + 1 <= this.jTotal) {
if(this.jPage+1 <= this.jTotal){ // this.jPage++
this.jPage++ // this.getJBook()
this.getJBook() // } else {
}else{ // this.status = 1
this.status = 1 // }
}
}, },
filters: { filters: {
// 控制字数 // 控制字数
@@ -348,72 +268,72 @@
computed: { computed: {
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
components:{ components: {
musicPlay musicPlay
}, },
//方法 //方法
methods: { methods: {
...mapMutations(['setUserInfo']), ...mapMutations(['setUserInfo']),
gotopingshu(val){ gotopingshu(val) {
uni.navigateTo({ uni.navigateTo({
url: '../comments/comments?bookid='+ val.id, url: '../comments/comments?bookid=' + val.id,
}); });
}, },
// 去打卡 // 去打卡
gotoclock(item){ gotoclock(item) {
this.onPageJump('../clock/clock?bookid='+ item.id ) this.onPageJump('../clock/clock?bookid=' + item.id)
}, },
// 去听书 // 去听书
gotoListen(item){ gotoListen(item) {
uni.navigateTo({ uni.navigateTo({
url: "../listen/listen?bookid="+ item.id url: "../listen/listen?bookid=" + item.id
}); });
}, },
// 新书上市 // 新书上市
getNewBook(){ getNewBook() {
this.$http this.$http
.post('book/shopproduct/getNewBook',{ .post('book/shopproduct/getNewBook', {
'limit': 10, 'limit': 10,
'page':1 'page': 1
}) })
.then(res => { .then(res => {
console.log(res,'xinshu') console.log(res, 'xinshu')
this.newBookList = res.page.list this.newBookList = res.page.list
}); });
}, },
// 检测未完成订单 // 检测未完成订单
requestIapOrder(){ requestIapOrder() {
console.log('检测支付环境...') console.log('检测支付环境...')
plus.payment.getChannels((channels) => { plus.payment.getChannels((channels) => {
console.log(channels, 'channels') console.log(channels, 'channels')
//this.setUserInfo({channelList:channels}); // 将支付通道保存到本地 //this.setUserInfo({channelList:channels}); // 将支付通道保存到本地
for (var i in channels) { for (var i in channels) {
// 判断是否苹果支付1 // 判断是否苹果支付1
if (channels[i].id === 'appleiap') { if (channels[i].id === 'appleiap') {
this.iapChannel = channels[i] this.iapChannel = channels[i]
// console.log(this.userInfo.restoreFlag,'this.userInfo.restoreFlag') // console.log(this.userInfo.restoreFlag,'this.userInfo.restoreFlag')
if(this.userInfo.restoreFlag){ // 如果存在异常回调订单 if (this.userInfo.restoreFlag) { // 如果存在异常回调订单
this.restoreComplateRequest() this.restoreComplateRequest()
} }
} }
} }
}) })
}, },
// 查询未关闭订单 // 查询未关闭订单
restoreComplateRequest(){ restoreComplateRequest() {
let that = this let that = this
console.log('检测未完成订单') console.log('检测未完成订单')
console.log(this.iapChannel,'this.iapChannel') console.log(this.iapChannel, 'this.iapChannel')
this.iapChannel.restoreComplateRequest({ this.iapChannel.restoreComplateRequest({
manualFinishTransaction: true manualFinishTransaction: true
}, function(results) { }, function(results) {
if(!that.checking){ if (!that.checking) {
that.checking = true that.checking = true
// console.log(that.checking) // console.log(that.checking)
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction通用需将返回的支付凭证传给后端进行二次认证 // results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction通用需将返回的支付凭证传给后端进行二次认证
that.ComplateRequestArr = results that.ComplateRequestArr = results
console.log(that.ComplateRequestArr,'未完成订单数组') console.log(that.ComplateRequestArr, '未完成订单数组')
if(results && results.length>0){ if (results && results.length > 0) {
// for(var j = 0; j<results.length; j++){ // for(var j = 0; j<results.length; j++){
// if(results[j].transactionState == '1'){ // if(results[j].transactionState == '1'){
// // 已经支付,但是没有走逻辑的内购订单 // // 已经支付,但是没有走逻辑的内购订单
@@ -422,52 +342,54 @@
// }else{ // }else{
// // 其他状态的内购订单 直接关闭 // // 其他状态的内购订单 直接关闭
// that.finishTransaction(results[j]) // that.finishTransaction(results[j])
// } // }
// } // }
results.map((item,index)=>{ results.map((item, index) => {
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。 // "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
if(item.transactionState == '1'){ if (item.transactionState == '1') {
// 已经支付,但是没有走逻辑的内购订单 // 已经支付,但是没有走逻辑的内购订单
that.iapCheck(item,index) that.iapCheck(item, index)
}else{ } else {
// 其他状态的内购订单 // 其他状态的内购订单
that.finishTransaction(item) that.finishTransaction(item)
} }
}) })
} }
} }
}); });
}, },
// 关闭交易订单 // 关闭交易订单
finishTransaction(trans,index){ finishTransaction(trans, index) {
this.iapChannel.finishTransaction(trans, (success) => { this.iapChannel.finishTransaction(trans, (success) => {
console.log('关闭订单成功',index); console.log('关闭订单成功', index);
if(index == this.ComplateRequestArr.length-1){ // 最后一个支付订单 if (index == this.ComplateRequestArr.length - 1) { // 最后一个支付订单
this.setUserInfo({restoreFlag:false}); this.setUserInfo({
restoreFlag: false
});
// console.log(this.userInfo.restoreFlag,'this.ComplateRequestArr.length+++') // console.log(this.userInfo.restoreFlag,'this.ComplateRequestArr.length+++')
} }
}, (fail) => { }, (fail) => {
console.log('关闭订单失败'); console.log('关闭订单失败');
}); });
}, },
iapCheck(result,index) { iapCheck(result, index) {
const that = this const that = this
console.log('进入后台验证') console.log('进入后台验证')
let data = { let data = {
transactionId: result.transactionIdentifier, // 支付交易id transactionId: result.transactionIdentifier, // 支付交易id
customerOid: that.userInfo.id, customerOid: that.userInfo.id,
productId: result.payment.productid, // 产品id productId: result.payment.productid, // 产品id
orderId: result.payment.username, // 系统订单号 orderId: result.payment.username, // 系统订单号
receiptData: result.transactionReceipt ,// 苹果返回收据 receiptData: result.transactionReceipt, // 苹果返回收据
loadAnimate:'none', // 请求加载动画 loadAnimate: 'none', // 请求加载动画
} }
console.log(data,'data') console.log(data, 'data')
$http.request({ $http.request({
url: "/Ipa/veri", url: "/Ipa/veri",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -476,54 +398,54 @@
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}).then(res => { }).then(res => {
console.log(JSON.stringify(res)) console.log(JSON.stringify(res))
console.log(res.code) console.log(res.code)
if(res.code == 0){ if (res.code == 0) {
// uni.hideLoading() // uni.hideLoading()
console.log('充值订单已处理,请留意账户金额变动....') console.log('充值订单已处理,请留意账户金额变动....')
// 服务器验证票据有效后在客户端关闭订单 // 服务器验证票据有效后在客户端关闭订单
that.finishTransaction(result,index) that.finishTransaction(result, index)
}else if(res.code == 200){ // 重复验证订单 } else if (res.code == 200) { // 重复验证订单
console.log('重复验证....') console.log('重复验证....')
that.finishTransaction(result,index) that.finishTransaction(result, index)
} }
}).catch(e => { }).catch(e => {
console.log('支付验证失败,进入轮询程序...') console.log('支付验证失败,进入轮询程序...')
that.getIapPayResult(result,index) that.getIapPayResult(result, index)
}) })
console.log('--------------') console.log('--------------')
}, },
// 轮询验证支付结果 // 轮询验证支付结果
getIapPayResult(result,index){ getIapPayResult(result, index) {
// let interval = null // let interval = null
this.ComplateRequestInterval = setTimeout(() => { this.ComplateRequestInterval = setTimeout(() => {
if(this.maxTimes <= 3){ if (this.maxTimes <= 3) {
this.iapCheck(result,index) this.iapCheck(result, index)
console.log('执行1', this.maxTimes,this.ComplateRequestInterval) console.log('执行1', this.maxTimes, this.ComplateRequestInterval)
this.maxTimes += 1 this.maxTimes += 1
}else{ } else {
this.maxTimes = 0 this.maxTimes = 0
console.log('停止轮询', this.maxTimes,this.ComplateRequestInterval, this.maxTimes) console.log('停止轮询', this.maxTimes, this.ComplateRequestInterval, this.maxTimes)
this.checking = false this.checking = false
this.saveErrorIapOrder(result,index) this.saveErrorIapOrder(result, index)
clearTimeout(this.ComplateRequestInterval) clearTimeout(this.ComplateRequestInterval)
} }
},10000) }, 10000)
}, },
// 轮询失败接口 // 轮询失败接口
saveErrorIapOrder(result,index){ saveErrorIapOrder(result, index) {
console.log('提交到充值问题单里面...') console.log('提交到充值问题单里面...')
let data = { let data = {
transactionId : result.transactionIdentifier, transactionId: result.transactionIdentifier,
failureflag: 1, failureflag: 1,
orderId:result.payment.username, orderId: result.payment.username,
receiptData:result.transactionReceipt, receiptData: result.transactionReceipt,
productId:result.payment.productid, productId: result.payment.productid,
customerOid:this.userInfo.id customerOid: this.userInfo.id
} }
$http.request({ $http.request({
url: "Ipa/failure", url: "Ipa/failure",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -532,17 +454,17 @@
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}).then(res => { }).then(res => {
console.log(JSON.stringify(res)) console.log(JSON.stringify(res))
if(res.code == 200){ if (res.code == 200) {
console.log('提交成功,关闭订单') console.log('提交成功,关闭订单')
this.finishTransaction(result,index) this.finishTransaction(result, index)
} }
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)
if(e.statusCode == 0){ // 重复提交,直接关闭订单 if (e.statusCode == 0) { // 重复提交,直接关闭订单
this.finishTransaction(result,index) this.finishTransaction(result, index)
} }
}) })
}, },
// 获取列表数据 // 获取列表数据
getData() { getData() {
@@ -564,23 +486,16 @@
// 获取精选图书 // 获取精选图书
this.getJBook() this.getJBook()
this.getNewBook() this.getNewBook()
}, },
// 获取精选图书 // 获取精选图书
getJBook(){ getJBook() {
this.$http this.$http
.post('book/book/listbooks',{ .post('book/shopproduct/appGetList?limit=30&page=1&istop=1')
'limit':6,
'page': this.jPage
})
.then(res => { .then(res => {
console.log(res,'首页商品') console.log(res.page.list, '首页商品')
this.jTotal = res.page.totalPage this.goodsList = res.page.list
this.goodsList = this.goodsList.concat(res.page.list)
console.log(this.goodsList,'this.goodsList')
this.status = 3
uni.stopPullDownRefresh()
}) })
}, },
// 跳转 // 跳转
@@ -614,14 +529,14 @@
uni.navigateTo({ uni.navigateTo({
url: '../eBook/bookContent?Id=' + e.id url: '../eBook/bookContent?Id=' + e.id
}); });
}, },
// 商品详情页 // 商品详情页
goDetail(id) { goDetail(id) {
uni.navigateTo({ uni.navigateTo({
url: '../bookShop/commodityDetail?id=' + id url: '../bookShop/commodityDetail?id=' + id
}); });
}, },
// 列表跳页 // 列表跳页
onShopMore(e) { onShopMore(e) {
uni.navigateTo({ uni.navigateTo({
@@ -644,29 +559,62 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @import '@/style/mixin.scss';
.tags{
uni-tag{margin-right: 10rpx;} .tags {
uni-tag {
margin-right: 10rpx;
}
} }
.newBook{margin-top: 20rpx;}
.scroll-view_H{background-color: #fff;white-space: nowrap; .newBook {
width: 100%; padding:10rpx ; } margin-top: 20rpx;
.scroll-view_H{ }
.item { padding: 10rpx; overflow: hidden; display: inline-block;
width: 180rpx !important; margin-right: 20rpx; border-radius: 10rpx; .scroll-view_H {
.videoBox{ background-color: #fff;
image{display: block; width:150rpx; white-space: nowrap;
height: 170rpx; width: 100%;
padding: 10rpx;
}
.scroll-view_H {
.item {
padding: 10rpx;
overflow: hidden;
display: inline-block;
width: 180rpx !important;
margin-right: 20rpx;
border-radius: 10rpx;
.videoBox {
image {
display: block;
width: 150rpx;
height: 170rpx;
} }
} }
.bookName{display: block; margin-top: 20rpx; color: #666; font-size: 24rpx; white-space: nowrap;
overflow-x: hidden; overflow: hidden; .bookName {
text-overflow: ellipsis;} display: block;
margin-top: 20rpx;
color: #666;
font-size: 24rpx;
white-space: nowrap;
overflow-x: hidden;
overflow: hidden;
text-overflow: ellipsis;
}
} }
// .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;} // .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;}
} }
.flexbox{display: flex;}
.flexbox {
display: flex;
}
.head_line { .head_line {
margin: 50rpx 0 0 0; margin: 30rpx 0 0 0;
b { b {
@@ -699,17 +647,26 @@
background-size: cover; background-size: cover;
padding: 20rpx; padding: 20rpx;
position: relative; position: relative;
// height: 400rpx; margin-bottom: 130rpx;
// height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 { .icon_hua_1 {
// margin: 0 auto; // margin: 0 auto;
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
} }
.icon_hua{width: 150rpx; display: block;}
.search_box { margin-top: 20rpx; align-items: center; .icon_hua {
width: calc(100% - 300rpx); width: 150rpx;
display: block;
.search{height: 80upx; }
.search_box {
margin-top: 20rpx;
align-items: center;
width: calc(100% - 300rpx);
.search {
height: 80upx;
display: flex; display: flex;
width: 100%; width: 100%;
align-items: center; align-items: center;
@@ -718,55 +675,75 @@
border-radius: 20upx; border-radius: 20upx;
box-shadow: 0 0px 10px 1px #54a96633; box-shadow: 0 0px 10px 1px #54a96633;
} }
.prompt { .prompt {
color: #838383; font-size: 24rpx; color: #838383;
font-size: 24rpx;
} }
.icon_search { .icon_search {
background-image: url('@/static/icon/map_ic_search.png'); background-image: url('@/static/icon/map_ic_search.png');
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
width:36upx; width: 36upx;
height: 36upx; height: 36upx;
margin-right: 20upx; margin-right: 20upx;
} }
} }
.searBtn{
width: 80rpx; align-items: center; .searBtn {
font-size: 30rpx; color: #fff; width: 80rpx;
align-items: center;
font-size: 30rpx;
color: #fff;
} }
} }
.home_nar { padding-bottom: 20rpx;
margin: 30rpx 20rpx; justify-content: space-between; .home_nar {
padding-bottom: 20rpx;
margin: 30rpx 20rpx;
justify-content: space-between;
display: flex; display: flex;
color: #333; color: #333; margin-bottom: 0 !important;
// .dianzishu{ margin-right:10rpx; // .dianzishu{ margin-right:10rpx;
// background-color:#f8d6f4 ; border: 2px solid #edcce9; // background-color:#f8d6f4 ; border: 2px solid #edcce9;
// } // }
// .chaoshi{background-color:#fff2d8 ; border: 2px solid #ede6d3; } // .chaoshi{background-color:#fff2d8 ; border: 2px solid #ede6d3; }
// .shuping{ background-color: #d6ffda; border: 2px solid #bae9bf;} // .shuping{ background-color: #d6ffda; border: 2px solid #bae9bf;}
// .shuguan{ background-color:#e3f9f9 ; border: 2px solid #d7eced; } // .shuguan{ background-color:#e3f9f9 ; border: 2px solid #d7eced; }
.hn_cl_tit { padding-bottom: 10rpx; .hn_cl_tit {
padding-bottom: 10rpx;
// width: 23%; // width: 23%;
width: 31%; width: 31%;
text-align: center; text-align: center;
border-radius: 20rpx ; padding-top: 10rpx; border-radius: 20rpx;
padding-top: 10rpx;
// line-height: 110upx; // line-height: 110upx;
//display: flex; //display: flex;
align-content: center; align-content: center;
justify-content: center; justify-content: center;
image {
image {
width: 110upx; width: 110upx;
height:110upx; height: 110upx;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
// margin: 0 20rpx; // margin: 0 20rpx;
} }
text{ display:block; text-align: center; margin-top: 10px; font-size: 36rpx; color: #000; font-weight:blod;}
text {
display: block;
text-align: center;
margin-top: 10px;
font-size: 36rpx;
color: #000;
font-weight: blod;
}
} }
} }
@@ -1028,46 +1005,51 @@
.goods { .goods {
width: 100%; width: 100%;
margin:40rpx 0 50rpx 0; margin: 40rpx 0 50rpx 0;
.goodsItem { .goodsItem {
display: inline-block;
width: 46%;
border-radius: 20rpx; border-radius: 20rpx;
padding: 25rpx 25rpx 20rpx 25rpx; padding: 25rpx 25rpx 20rpx 25rpx;
margin: 0 20rpx 20rpx 20rpx; margin: 0 20rpx 20rpx 20rpx;
background-color: #fff; background-color: #fff;
border: 1px solid #eee; border: 1px solid #eee;
.imgs { .goodsImg {
width: 200rpx; width: 98%;
height: 260rpx; overflow: hidden; height: 380rpx;
border-radius: 10rpx; border-radius: 10rpx;
image{width: 200rpx;
height: 260rpx; overflow: hidden;}
} }
.goodsContent { .goodsContent {
padding-left: 46rpx;
.goodsName { .goodsName {
color: #131313;
margin-top: 10rpx; margin-top: 10rpx;
margin-bottom: 37rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
} }
.goodsPrice { .goodsPrice {
font-size: 30rpx; font-size: 30rpx;
margin: 5rpx 0 0 3rpx; margin: 5rpx 0 0 3rpx;
display: flex; justify-content: space-between; display: flex;
.price{ justify-content: space-between;
.price {
font-weight: bold; font-weight: bold;
color: #bf0c0c; color: #bf0c0c;
} }
.Salesnum{color: #9b9b9b;}
.Salesnum {
color: #9b9b9b;
}
} }
} }
} }
.goodsItem:nth-child(2n) {
margin-left: 0;
}
} }
</style> </style>