| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658 |
- <template>
- <div class="bookItem">
- <Header
- :headerBg="headerBg"
- :headerBorder="headerBorder"
- :userBg="userBg"
- :LoginNavIndex="1"
- ref="header"
- />
- <div class="navBar" v-if="info">
- <div class="navBar-left">
- <a class="goback" @click="$router.go(-1)"
- ><i class="el-icon-arrow-left"></i>主页</a
- >
- <div class="border"></div>
- <p>
- {{
- bookType === "jingdu"
- ? "二十一世纪英文报·精读课堂"
- : bookType === "huakan"
- ? "二十一世纪英文报·少儿画刊"
- : "二十一世纪英文报"
- }}
- </p>
- </div>
- </div>
- <div class="main-top" v-if="info">
- <div class="main-top-inner">
- <el-carousel
- class="swiper-container"
- trigger="click"
- arrow="never"
- height="414px"
- >
- <!-- <el-carousel-item v-for="(item1, index) in data.imgList" :key="index"> -->
- <el-image
- class="image"
- :src="
- bookType === 'jingdu'
- ? require('../../assets/cover-order-jingdu.png')
- : bookType === 'huakan'
- ? require('../../assets/cover-order-huakan.png')
- : require('../../assets/cover-order-' + studyType + '.png')
- "
- :fit="'contain'"
- >
- </el-image>
- <!-- </el-carousel-item> -->
- </el-carousel>
- <div class="book-info-right" v-loading="loading">
- <h1 class="title">
- {{
- bookType === "jingdu"
- ? "Teens 精读课堂(" + studyTypeName + ")"
- : bookType === "huakan"
- ? "二十一世纪英文报·少儿画刊"
- : "《二十一世纪学生英文报》"
- }}
- </h1>
- <!-- <b class="org">{{data.org}}</b><span class="date">2023.07.01-2023.07.21</span> -->
- <div class="sales-box">
- <div class="sales-left">
- <span>订阅价格</span>
- <span class="OPPOSans"
- >¥{{ info.price_reservation | cutMoneyFiter }}</span
- >
- <!-- <span class="old-price" v-if="info.price_discount&&info.price_discount!==info.price">¥{{info.price|cutMoneyFiter}}</span> -->
- <b>元 / 期</b>
- </div>
- <span class="sales-right" v-if="sales >= 1000"
- >累计订阅 {{ salesCn }}</span
- >
- </div>
- <!-- <div class="label-box">
- <label v-for="(itemL,indexL) in info.label_name_list" :key="indexL" :style="{background:tagBg[indexL%3],color:tagColor[indexL%3]}">
- {{ '# ' + itemL }}
- </label>
- </div> -->
- <!-- <div class="book-describe">
- <h2 class="title">{{data.describe.title}}</h2>
- <span class="author">{{'BY '+data.describe.author}}</span>
- <p class="describe">{{data.describe.describe}}</p>
- </div> -->
- <div class="info-box">
- <div class="info-item">
- <label>适合年龄</label>
- <span>{{
- info.issue_info
- ? info.issue_info.age_desc
- : info.iread_info.age_desc
- }}</span>
- </div>
- <div class="info-item">
- <label>期刊页数</label>
- <span>{{
- info.issue_info
- ? info.issue_info.page_count_desc
- : info.iread_info.article_count_desc
- }}</span>
- <el-tooltip placement="right" v-if="bookType === 'baozhi'">
- <div slot="content">双刊、特辑、寒暑假合刊除外</div>
- <el-button class="tooltip-btn"
- ><svg-icon icon-class="icon-mark"></svg-icon
- ></el-button>
- </el-tooltip>
- </div>
- <div class="info-item">
- <label>出版周期</label>
- <span>{{
- info.issue_info
- ? info.issue_info.period_desc
- : info.iread_info.period_desc
- }}</span>
- </div>
- <div class="info-item">
- <label>期刊定价</label>
- <span v-if="bookType === 'baozhi' || bookType === 'huakan'"
- >{{ info.issue_info.price }}元/期</span
- >
- <span v-else-if="bookType === 'jingdu'"
- >{{ info.iread_info.price }}元/年</span
- >
- <el-tooltip placement="right" v-if="bookType === 'baozhi'">
- <div slot="content">双刊、特辑、寒暑假合刊除外</div>
- <el-button class="tooltip-btn"
- ><svg-icon icon-class="icon-mark"></svg-icon
- ></el-button>
- </el-tooltip>
- </div>
- <div class="info-item" style="width: 100%">
- <label>主办单位</label>
- <span>{{
- info.issue_info
- ? info.issue_info.organizer
- : info.iread_info.organizer
- }}</span>
- </div>
- </div>
- <div class="info-box order-box">
- <div
- class="info-item order-item"
- style="margin-bottom: 16px"
- v-if="bookType !== 'huakan'"
- >
- <label>订阅学段</label>
- <div class="order-content">
- <ul>
- <li
- v-for="item in bookType === 'baozhi'
- ? $studyType
- : studyTypeList"
- :key="item.study_phase"
- :class="[studyType === item.study_phase ? 'active' : '']"
- @click="changeStudy(item)"
- >
- {{ item.study_phase_name }}
- </li>
- </ul>
- </div>
- </div>
- <div
- class="info-item order-item"
- style="margin-bottom: 16px"
- v-if="bookType === 'baozhi' || bookType === 'huakan'"
- >
- <label>订阅期数</label>
- <div class="order-content">
- <ul>
- <li
- v-for="item in orderList"
- :key="item.value"
- :class="[
- orderTotalNumber === item.value ? 'active' : '',
- totalLength < item.value && item.value !== 10000
- ? 'disabled'
- : '',
- ]"
- @click="
- changeOrderNumber(
- item,
- (totalLength < item.value && item.value !== 10000) ||
- item.value === -2
- )
- "
- >
- {{ item.label }}
- </li>
- <el-tooltip placement="right" style="height: 32px">
- <div slot="content" v-html="rules"></div>
- <el-button class="tooltip-btn"
- ><svg-icon icon-class="icon-mark"></svg-icon
- ></el-button>
- </el-tooltip>
- </ul>
- <div
- v-if="
- orderTotalNumber === 10000 &&
- info.issue_no_school_year_list.length > 0
- "
- class="custom-box"
- >
- <div class="custom-box-top">
- <h5>
- {{
- info.issue_no_school_year_list[customPage].year_begin +
- "-" +
- info.issue_no_school_year_list[customPage].year_end +
- " 学年"
- }}
- </h5>
- <div class="btn-box">
- <a @click="changeCustomPage('-')"
- ><i class="el-icon-arrow-left"></i
- ></a>
- <a @click="changeCustomPage('+')"
- ><i class="el-icon-arrow-right"></i
- ></a>
- </div>
- </div>
- <ul class="custom-box-bottom">
- <li
- v-for="(itemc, indexc) in info.issue_no_school_year_list[
- customPage
- ].issue_no_list"
- :key="indexc"
- :style="{
- width: itemc.width ? itemc.width * 52 + 'px' : '',
- borderRight: itemc.farRight ? 'none !important' : '',
- borderBottom: itemc.farBottom ? 'none !important' : '',
- }"
- :class="[
- customOrderNumberList.indexOf(itemc.issue_no) > -1
- ? 'active'
- : '',
- ]"
- @click="changeCustomOrder(itemc)"
- >
- <el-tooltip placement="bottom">
- <div slot="content">
- 第 {{ itemc.issue_no }} 期<br />
- 出版日期:{{ itemc.shelve_date }}
- </div>
- <el-button class="custom-btn">{{
- itemc.issue_no
- }}</el-button>
- </el-tooltip>
- </li>
- </ul>
- </div>
- <template v-if="orderTotalNumber !== -1">
- <template v-if="orderTotalNumber === -2">
- <el-input-number
- v-model="customizeNum"
- :min="1"
- :max="totalLength"
- label="请输入期数"
- @change="getInfo"
- ></el-input-number>
- </template>
- <template v-else>
- <b v-if="orderTotalNumber !== 10000"
- >{{ info.issue_no_begin }} - {{ info.issue_no_end }}</b
- >
- <b v-else>已选 {{ customOrderNumberList.length }} 期</b>
- <el-tooltip placement="bottom" style="height: 32px">
- <div slot="content">
- <el-table
- class="order-table"
- :data="orderTable"
- max-height="200px"
- style="width: 317px"
- >
- <el-table-column label="#" type="index" width="40">
- </el-table-column>
- <el-table-column
- property="issue_no"
- label="期"
- width="112"
- >
- </el-table-column>
- <el-table-column
- property="shelve_date"
- label="发行日期"
- width="100"
- >
- </el-table-column>
- <el-table-column
- property="price"
- label="价格"
- width="75"
- >
- <template slot-scope="scope">
- {{ scope.row.price | cutMoneyFiter }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-button class="tooltip-btn"
- ><svg-icon icon-class="icon-mark"></svg-icon
- ></el-button>
- </el-tooltip>
- </template>
- </template>
- </div>
- </div>
- <div class="info-item order-item" v-if="bookType === 'jingdu'">
- <label>有效期</label>
- <div class="order-content">
- <b>365天</b>
- <el-tooltip placement="right">
- <div slot="content">{{ validityStr }}</div>
- <el-button class="tooltip-btn"
- ><svg-icon icon-class="icon-mark"></svg-icon
- ></el-button>
- </el-tooltip>
- </div>
- </div>
- <div
- class="info-item order-item"
- v-if="settlement || info.settlement_price"
- >
- <label>结算价格</label>
- <div class="order-content">
- <span class="OPPOSans"
- >¥{{
- settlement
- ? settlement.price_settlement
- : info.settlement_price.price_settlement | cutMoneyFiter
- }}</span
- >
- <span
- class="old-price"
- v-if="
- (settlement &&
- settlement.price &&
- settlement.price_settlement !== settlement.price) ||
- (info.settlement_price &&
- info.settlement_price.price !==
- info.settlement_price.price_settlement)
- "
- >¥{{
- settlement
- ? settlement.price
- : info.settlement_price.price | cutMoneyFiter
- }}</span
- >
- </div>
- </div>
- <!-- <div class="info-item order-item" v-if="bookType === 'huakan'">
- <label>结算价格</label>
- <div class="order-content">
- <span class="OPPOSans">¥28.80</span>
- <span class="old-price">¥30.20</span>
- </div>
- </div> -->
- </div>
- <div class="btn-box">
- <el-button
- class="el-button"
- @click="handleChangeWay('wei')"
- :loading="createOrderLoading"
- >立即购买</el-button
- >
- <!-- <el-button class="upgrade" @click="handleChangeWay('dui')">使用兑换码</el-button> -->
- </div>
- </div>
- </div>
- </div>
- <el-dialog
- :visible.sync="paymentShow"
- :show-close="false"
- :close-on-click-modal="false"
- width="712px"
- class="bookItem-dialog"
- v-if="paymentShow"
- >
- <Payment
- :data="info"
- :payWay="payWay"
- @handleClose="handleClose"
- @handleSuccess="handleSuccess"
- :orderId="orderId"
- :qr_code_url="qr_code_url"
- :order_amount="order_amount"
- />
- </el-dialog>
- </div>
- </template>
- <script>
- //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》from ‘《组件路径》';
- import Header from "../../components/Header.vue";
- import { cutMoneyFiter } from "@/utils/defined";
- import { getLogin } from "@/api/ajax";
- import { mapState } from "vuex";
- import Payment from "../bookShelf/components/Payment.vue";
- import { getToken } from "@/utils/auth";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: { Header, Payment },
- props: [],
- filters: {
- cutMoneyFiter,
- },
- data() {
- //这里存放数据
- return {
- config: this.$route.query.headerConfig
- ? decodeURIComponent(this.$route.query.headerConfig)
- : "",
- LoginNavIndex: 0,
- userBg: "rgba(0, 0, 0, 0.24)",
- headerBorder: "#5C5C5C",
- headerBg: "#00ADEF",
- previousPage: "商城",
- data: {
- navTitle: "第 815 期 Celebrating new King",
- title: "第 815 期 Celebrating new King",
- org: "二十一世纪英文报",
- tagList: ["中英双语", "经典读物", "初中必读"],
- imgList: [
- require("../../assets/img1.png"),
- require("../../assets/bookcard-image.png"),
- ],
- describe: {
- title: "Bring books up to date",
- author: "TEENS",
- describe:
- "Should childrenn read the original or adapted version? 英国童书再版遭大量删改引争议 词数 372 测试见IV版 建议阅读时间 5分钟 Puffin ...",
- },
- price: "3.9",
- oldPrice: "5.99",
- isBuy: this.$route.query.isBuy ? this.$route.query.isBuy : false,
- },
- tagBg: ["#C9EBFF", "#FFFAC9", "#D7C9FF"], // 标签背景色
- tagColor: ["#006DAA", "#AA8500", "#7849C4"], // 标签字体颜色
- paymentShow: false, // 支付弹窗
- payWay: this.$route.query.paywei ? this.$route.query.paywei : "dui",
- bookType: this.$route.query.type ? this.$route.query.type : "baozhi", // 书籍类型
- bannerFlag: true, // 是否展示广告
- id: this.$route.query.id ? this.$route.query.id : "",
- info: null, // 信息
- courseList: [],
- sales: null,
- salesCn: "",
- isBuy: "false",
- studyType: this.$route.query.studyType
- ? this.$route.query.studyType
- : this.$route.query.type && this.$route.query.type === "huakan"
- ? 1
- : 11,
- studyTypeName: this.$route.query.studyTypeName
- ? decodeURIComponent(this.$route.query.studyTypeName)
- : "小学版",
- orderTotalNumber: 5,
- orderList: [
- {
- label: "5 期",
- value: 5,
- },
- {
- label: "10 期",
- value: 10,
- },
- {
- label: "20 期",
- value: 20,
- },
- {
- label: "40 期",
- value: 40,
- },
- {
- label: "自定义期数",
- value: -2,
- },
- {
- label: "年订阅(当月起订)",
- value: -1,
- },
- {
- label: "已发行期数自选预定",
- value: 10000,
- },
- ],
- orderTable: [
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- {
- name: "915 期(合刊)",
- date: "2023-06-26",
- price: 12,
- },
- ],
- customizeNum: 1, // 自定义期数
- customPage: 0,
- custonList: [
- {
- title: "2019-2020 学年",
- total: 14,
- list: [
- {
- label: "759",
- value: "759",
- width: 1,
- number: 1, // 算完下一个去复制上一个是不是末位 如果下一个加起来的number/10有余数那就是下一行了
- },
- {
- label: "758",
- value: "758",
- width: 1,
- number: 2,
- },
- {
- label: "757",
- value: "757",
- width: 1,
- number: 3,
- },
- {
- label: "756",
- value: "756",
- width: 1,
- number: 4,
- },
- {
- label: "755",
- value: "755",
- width: 1,
- number: 5,
- },
- {
- label: "754",
- value: "754",
- width: 1,
- number: 1,
- },
- {
- label: "753",
- value: "753",
- width: 1,
- number: 1,
- },
- {
- label: "752",
- value: "752",
- width: 1,
- number: 1,
- },
- {
- label: "751",
- value: "751",
- width: 1,
- number: 1,
- },
- {
- label: "751",
- value: "751",
- width: 1,
- number: 1,
- farRight: true,
- },
- {
- label: "共同战“疫”",
- value: "gong",
- width: 2,
- number: 1,
- farBottom: true,
- },
- {
- label: "750",
- value: "750",
- width: 1,
- number: 1,
- farBottom: true,
- },
- {
- label: "769",
- value: "769",
- width: 1,
- number: 1,
- farBottom: true,
- },
- ],
- },
- ],
- customOrderNumberList: [],
- validityStr: "", // 有效期
- rules: "", // 折扣规则
- loading: false,
- orderId: "",
- qr_code_url: "",
- order_amount: null,
- userMessage: getToken() ? JSON.parse(getToken()) : null,
- studyTypeList: [
- {
- study_phase: 11,
- study_phase_name: "小学版",
- },
- {
- study_phase: 21,
- study_phase_name: "初一版",
- },
- {
- study_phase: 22,
- study_phase_name: "初二版",
- },
- {
- study_phase: 23,
- study_phase_name: "初三版",
- },
- ],
- settlement: null, // 结算价格
- createOrderLoading: false,
- valid_period_id: null,
- totalLength: 0,
- };
- },
- //计算属性 类似于data概念
- computed: {
- ...mapState(["$studyType"]),
- },
- //监控data中数据变化
- watch: {},
- //方法集合
- methods: {
- // 分享
- handleShare() {},
- // 收藏
- handlelike() {},
- handleChangeWay(type) {
- if (!this.userMessage) {
- this.$refs.header.handleLogin(
- "/subscribe?name=" +
- this.$route.query.name +
- "&type=" +
- this.$route.query.type +
- "&paywei=" +
- type,
- "url"
- );
- return false;
- }
- this.payWay = type;
- this.handleOrder();
- },
- // 关闭弹窗
- handleClose() {
- this.paymentShow = false;
- },
- handleSuccess() {
- this.paymentShow = false;
- },
- // 详情
- getInfo(flag) {
- this.loading = true;
- if (flag) {
- }
- if (this.bookType === "baozhi") {
- if (this.orderTotalNumber !== -1) {
- let MethodName =
- "/ShopServer/Client/ReservationQuery/GetReservationInfo_Issue";
- let data = {
- goods_type: 2,
- study_phase: this.studyType,
- period_count:
- this.orderTotalNumber !== 10000
- ? this.orderTotalNumber === -2
- ? this.customizeNum
- : this.orderTotalNumber
- : this.customOrderNumberList.length,
- is_custom_select_issue_no:
- this.orderTotalNumber !== 10000 ? "false" : "true",
- };
- getLogin(MethodName, data)
- .then((res) => {
- this.loading = false;
- if (res.status === 1) {
- this.info = res;
- res.issue_no_school_year_list =
- res.issue_no_school_year_list.reverse();
- this.orderTable = res.issue_no_list;
- res.issue_no_school_year_list.forEach((item) => {
- item.issue_no_list.forEach((items, indexs) => {
- const regex = /[\u4e00-\u9fa5]/g;
- if (regex.test(items.issue_no)) {
- items.width = Math.ceil(items.issue_no.length / 3);
- items.number = item.issue_no_list[indexs - 1]
- ? item.issue_no_list[indexs - 1].number +
- Math.ceil(items.issue_no.length / 3)
- : Math.ceil(items.issue_no.length / 3);
- } else {
- items.width = 1;
- items.number = item.issue_no_list[indexs - 1]
- ? item.issue_no_list[indexs - 1].number + 1
- : 1;
- }
- });
- });
- }
- })
- .catch(() => {
- this.loading = false;
- });
- }
- if (
- this.totalLength >=
- (this.orderTotalNumber !== 10000
- ? this.orderTotalNumber === -2
- ? this.customizeNum
- : this.orderTotalNumber
- : this.customOrderNumberList.length)
- ) {
- this.handleOrderPrice();
- } else {
- this.settlement = null;
- }
- } else if (this.bookType === "huakan") {
- this.loading = false;
- if (this.orderTotalNumber !== -1) {
- let MethodName =
- "/ShopServer/Client/ReservationQuery/GetReservationInfo_Issue";
- let data = {
- goods_type: 4,
- study_phase: 1,
- period_count:
- this.orderTotalNumber !== 10000
- ? this.orderTotalNumber === -2
- ? this.customizeNum
- : this.orderTotalNumber
- : this.customOrderNumberList.length,
- is_custom_select_issue_no:
- this.orderTotalNumber !== 10000 ? "false" : "true",
- };
- getLogin(MethodName, data)
- .then((res) => {
- this.loading = false;
- if (res.status === 1) {
- this.info = res;
- res.issue_no_school_year_list =
- res.issue_no_school_year_list.reverse();
- this.orderTable = res.issue_no_list;
- res.issue_no_school_year_list.forEach((item) => {
- item.issue_no_list.forEach((items, indexs) => {
- const regex = /[\u4e00-\u9fa5]/g;
- if (regex.test(items.issue_no)) {
- items.width = Math.ceil(items.issue_no.length / 3);
- items.number = item.issue_no_list[indexs - 1]
- ? item.issue_no_list[indexs - 1].number +
- Math.ceil(items.issue_no.length / 3)
- : Math.ceil(items.issue_no.length / 3);
- } else {
- items.width = 1;
- items.number = item.issue_no_list[indexs - 1]
- ? item.issue_no_list[indexs - 1].number + 1
- : 1;
- }
- });
- });
- }
- })
- .catch(() => {
- this.loading = false;
- });
- }
- // this.info = {
- // issue_no_end: "928",
- // issue_no_school_year_list: [],
- // issue_info: {
- // period_desc: "每月出版,2月、 8月休刊",
- // age_desc: "5-8 岁",
- // price: 10,
- // organizer: "中国日报社《二十一世纪学生英文报》",
- // page_count_desc: "24 页",
- // },
- // price_reservation: 10,
- // issue_no_begin: "929",
- // issue_no_list: [
- // {
- // shelve_date: "2024-07-31",
- // issue_no: "929",
- // price: 2.4,
- // },
- // {
- // shelve_date: "2025-07-10",
- // issue_no: "931",
- // price: 2.4,
- // },
- // {
- // shelve_date: "2025-08-07",
- // issue_no: "928",
- // price: 2.4,
- // },
- // ],
- // };
- if (
- this.totalLength >=
- (this.orderTotalNumber !== 10000
- ? this.orderTotalNumber === -2
- ? this.customizeNum
- : this.orderTotalNumber
- : this.customOrderNumberList.length)
- ) {
- this.handleOrderPrice();
- } else {
- this.settlement = null;
- }
- } else {
- let MethodName =
- "/ShopServer/Client/ReservationQuery/GetReservationValidPeriodList_Iread";
- getLogin(MethodName, {})
- .then((res) => {
- this.loading = false;
- if (res.status === 1) {
- this.valid_period_id = res.valid_period_list[0]
- ? res.valid_period_list[0].id
- : "";
- getLogin(
- "/ShopServer/Client/ReservationQuery/GetReservationInfo_Iread",
- {
- study_phase: this.studyType,
- valid_period_id: res.valid_period_list[0]
- ? res.valid_period_list[0].id
- : "",
- }
- )
- .then((ress) => {
- if (ress.status === 1) {
- this.info = ress;
- }
- })
- .catch(() => {});
- }
- })
- .catch(() => {
- this.loading = false;
- });
- }
- },
- // 计算结算价格
- handleOrderPrice(flag) {
- this.loading = true;
- let MethodName =
- "/ShopServer/Client/ReservationQuery/ComputeReservationSettlementPrice_Issue";
- let data = {
- goods_type: this.bookType === "huakan" ? 4 : 2,
- study_phase: this.studyType,
- period_count:
- this.orderTotalNumber !== 10000
- ? this.orderTotalNumber === -2
- ? this.customizeNum
- : this.orderTotalNumber
- : this.customOrderNumberList.length,
- is_custom_select_issue_no:
- this.orderTotalNumber !== 10000 ? "false" : "true",
- issue_no_list: this.customOrderNumberList,
- };
- getLogin(MethodName, data)
- .then((res) => {
- this.loading = false;
- if (res.status === 1) {
- this.settlement = res;
- }
- })
- .catch(() => {
- this.loading = false;
- });
- },
- changeCustomOrder(item) {
- if (this.customOrderNumberList.indexOf(item.issue_no) > -1) {
- this.customOrderNumberList.splice(
- this.customOrderNumberList.indexOf(item.issue_no),
- 1
- );
- this.orderTable.splice(
- this.customOrderNumberList.indexOf(item.issue_no),
- 1
- );
- } else {
- this.customOrderNumberList.push(item.issue_no);
- this.orderTable.push(item);
- }
- this.handleOrderPrice();
- },
- async changeStudy(item) {
- this.studyType = item.study_phase;
- this.studyTypeName = item.study_phase_name;
- this.customOrderNumberList = [];
- await this.handleIssueLength();
- },
- changeOrderNumber(item, flag) {
- if (flag && item.value !== -2) return false;
- this.orderTotalNumber = item.value;
- this.getInfo();
- },
- getDiscountRule() {
- let MethodName =
- "/OrgServer/Client/SysConfigQuery/GetSysConfig_DiscountRule";
- getLogin(MethodName, {}).then((res) => {
- if (res.status === 1) {
- let str = "一次性订阅:<br/>";
- res.rule_list.forEach((item) => {
- str +=
- item.buy_count + " 期 " + item.discount.toFixed(1) + " 折<br/>";
- });
- this.rules = str;
- }
- });
- },
- changeCustomPage(type) {
- if (type === "-") {
- if (this.customPage !== 0) {
- this.customPage--;
- } else {
- this.$message.warning("已经是最新学年");
- }
- } else {
- if (
- this.customPage !==
- this.info.issue_no_school_year_list.length - 1
- ) {
- this.customPage++;
- } else {
- this.$message.warning("后面没有数据啦");
- }
- }
- },
- // 生成订单
- handleOrder() {
- this.createOrderLoading = true;
- let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
- let data = {
- is_reservation: "true",
- sale_model: this.bookType === "jingdu" ? 1 : 0,
- goods_type:
- this.bookType === "jingdu" ? 3 : this.bookType === "huakan" ? 4 : 2,
- goods_study_phase: this.bookType === "huakan" ? 1 : this.studyType,
- period_count:
- this.orderTotalNumber !== 10000
- ? this.orderTotalNumber === -2
- ? this.customizeNum
- : this.orderTotalNumber
- : this.customOrderNumberList.length,
- is_custom_select_issue_no:
- this.orderTotalNumber !== 10000 ? "false" : "true",
- issue_no_list: this.customOrderNumberList,
- pay_type:
- this.payWay === "wei"
- ? 3
- : this.payWay === "zhi"
- ? 4
- : this.payWay === "dui"
- ? 5
- : null,
- valid_period_id: this.valid_period_id,
- };
- getLogin(MethodName, data)
- .then((res) => {
- this.createOrderLoading = false;
- if (res.status === 1) {
- this.order_amount = res.order_amount;
- if (this.order_amount <= 0) {
- } else {
- this.orderId = res.id;
- this.qr_code_url = res.qr_code_url;
- this.paymentShow = true;
- }
- }
- })
- .catch(() => {
- this.createOrderLoading = false;
- });
- // this.paymentShow = true;
- },
- getTotalSales() {
- let MethodName = "/ShopServer/Client/ShopHomeQuery/GetGoodsTotalSales";
- let data = {
- goods_type:
- this.bookType === "jingdu" ? 3 : this.bookType === "huakan" ? 4 : 2,
- };
- getLogin(MethodName, data)
- .then((res) => {
- if (res.status === 1) {
- this.sales = res.sale_count;
- if (this.sales < 1000) {
- this.salesCn = "";
- } else if (1000 <= this.sales && this.sales < 10000) {
- this.salesCn = this.sales.toString().substring(0, 1) + "000+";
- } else if (10000 <= this.sales && this.sales < 100000) {
- this.salesCn = this.sales.toString().substring(0, 1) + "万+";
- } else if (100000 <= this.sales && this.sales < 1000000) {
- this.salesCn = this.sales.toString().substring(0, 1) + "0万+";
- } else if (1000000 <= this.sales && this.sales < 10000000) {
- this.salesCn = this.sales.toString().substring(0, 1) + "00万+";
- } else if (10000000 <= this.sales && this.sales < 100000000) {
- this.salesCn = this.sales.toString().substring(0, 1) + "000万+";
- } else if (100000000 <= this.sales) {
- this.salesCn = this.sales.toString().substring(0, 1) + "亿+";
- }
- }
- })
- .catch(() => {});
- },
- // 获取已发行期数
- handleIssueLength() {
- this.totalLength = 0;
- let MethodName =
- "/ShopServer/Client/ReservationQuery/GetCanReservationPeriodCount_Issue";
- let data = {
- goods_type: this.bookType === "baozhi" ? 2 : 4,
- study_phase: this.bookType === "baozhi" ? this.studyType : 1,
- };
- getLogin(MethodName, data)
- .then((res) => {
- if (res.status === 1) {
- this.totalLength = res.period_count_max;
- this.getInfo();
- }
- })
- .catch(() => {});
- },
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- async created() {
- if (this.config) {
- let arr = this.config.split("&&&");
- this.LoginNavIndex = arr[0] * 1;
- this.userBg = arr[1] ? arr[1] : "rgba(0, 0, 0, 0.24)";
- this.headerBorder = arr[2] ? arr[2] : "#5C5C5C";
- this.headerBg = arr[3] ? arr[3] : "#00ADEF";
- this.previousPage = arr[4] ? arr[4] : "商城";
- }
- if (this.bookType === "baozhi" || this.bookType === "huakan") {
- await this.handleIssueLength();
- } else {
- this.getInfo();
- }
- this.getDiscountRule();
- let date1 =
- new Date().getFullYear() +
- "." +
- (new Date().getMonth() + 1 < 10
- ? "0" + (new Date().getMonth() + 1)
- : new Date().getMonth() + 1) +
- "." +
- new Date().getDate();
- let data2 = new Date(
- new Date(
- new Date().getFullYear() +
- 1 +
- "." +
- (new Date().getMonth() + 1 < 10
- ? "0" + (new Date().getMonth() + 1)
- : new Date().getMonth() + 1) +
- "." +
- new Date().getDate()
- ).getTime() -
- 24 * 60 * 60 * 1000
- );
- data2 =
- data2.getFullYear() +
- "." +
- (data2.getMonth() + 1 < 10
- ? "0" + (data2.getMonth() + 1)
- : data2.getMonth() + 1) +
- "." +
- data2.getDate();
- this.validityStr = date1 + " ~ " + data2;
- if (this.$route.query.paywei) {
- this.handleOrder();
- }
- this.getTotalSales();
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {},
- //生命周期-创建之前
- beforeCreated() {},
- //生命周期-挂载之前
- beforeMount() {},
- //生命周期-更新之前
- beforUpdate() {},
- //生命周期-更新之后
- updated() {},
- //生命周期-销毁之前
- beforeDestory() {},
- //生命周期-销毁完成
- destoryed() {},
- //如果页面有keep-alive缓存功能,这个函数会触发
- activated() {},
- };
- </script>
- <style lang="scss" scoped>
- /* @import url(); 引入css类 */
- .bookItem {
- background: #f7f8fa;
- min-height: calc(100vh - 135px);
- .main-top {
- background: #ffffff;
- padding: 48px 0;
- margin-top: 56px;
- min-height: calc(100vh - 135px);
- &-inner {
- width: 1200px;
- margin: 0 auto;
- display: flex;
- .swiper-container {
- width: 416px;
- height: 440px;
- text-align: center;
- .el-image {
- width: 414px;
- height: 414px;
- border: 1px solid #f3f3f3;
- }
- }
- .book-info-right {
- flex: 1;
- padding-left: 88px;
- .title {
- color: #2f3742;
- font-weight: 500;
- font-size: 32px;
- line-height: 44px;
- margin: 0 0 16px 0;
- }
- .org,
- .date {
- font-weight: 500;
- font-size: 14px;
- line-height: 22px;
- color: rgba(0, 0, 0, 0.4);
- }
- .date {
- margin-left: 32px;
- line-height: 24px;
- }
- .label-box {
- display: flex;
- flex-flow: wrap;
- margin: 16px 0;
- label {
- margin: 0 8px 8px 0;
- border-radius: 20px;
- padding: 4px 12px;
- font-weight: 400;
- font-size: 14px;
- line-height: 22px;
- }
- }
- .book-describe {
- border-top: 1px solid #e5e6eb;
- border-bottom: 1px solid #e5e6eb;
- padding: 16px 0;
- .title {
- font-weight: 500;
- font-size: 16px;
- line-height: 24px;
- color: #000000;
- margin-bottom: 8px;
- }
- .author {
- font-weight: 400;
- font-size: 12px;
- line-height: 20px;
- color: #000000;
- margin-bottom: 8px;
- display: block;
- }
- .describe {
- font-weight: 400;
- font-size: 14px;
- line-height: 22px;
- color: #000000;
- margin: 0;
- }
- }
- .price-box {
- padding: 20px 0 16px 0;
- display: flex;
- align-items: flex-end;
- .price {
- font-weight: 500;
- font-size: 32px;
- line-height: 40px;
- color: #ea5939;
- }
- .oldPrice {
- padding: 0 0 2px 7px;
- font-weight: 500;
- font-size: 14px;
- line-height: 22px;
- color: rgba(0, 0, 0, 0.4);
- text-decoration-line: line-through;
- }
- }
- .info-box {
- display: flex;
- flex-flow: wrap;
- border-bottom: 1px solid #ebebeb;
- width: 680px;
- margin-top: 48px;
- .info-item {
- width: 50%;
- margin-bottom: 15px;
- font-size: 14px;
- line-height: 22px;
- display: flex;
- }
- label {
- color: #c2c2c2;
- font-weight: 400;
- margin-right: 16px;
- width: 58px;
- flex-shrink: 0;
- display: block;
- text-align: justify;
- text-justify: distribute-all-lines;
- text-align-last: justify;
- -moz-text-align-last: justify;
- -webkit-text-align-last: justify;
- }
- }
- .order-box {
- margin-bottom: 24px;
- padding: 24px 0 0;
- margin-top: 0;
- .order-item {
- margin-bottom: 24px;
- width: 100%;
- label {
- line-height: 32px;
- }
- .order-content {
- line-height: 32px;
- ul {
- margin: 0;
- padding: 0;
- list-style: none;
- display: flex;
- flex-flow: wrap;
- li {
- cursor: pointer;
- border-radius: 2px;
- background: #f2f3f5;
- margin-right: 8px;
- margin-bottom: 8px;
- padding: 4px 15px;
- color: #000;
- font-size: 14px;
- font-weight: 500;
- line-height: 22px;
- border: 1px solid #f2f3f5;
- &.active {
- color: #ea5939;
- background: #ffffff;
- border-color: #ea5939;
- }
- &.disabled {
- cursor: not-allowed;
- background: #f2f3f5;
- color: #bababa;
- border-color: #f2f3f5;
- }
- }
- }
- .el-table {
- background: #303133;
- }
- }
- .OPPOSans {
- margin: 0 8px 0 0;
- color: #ea5939;
- font-size: 20px;
- font-weight: 500;
- line-height: 28px;
- }
- .old-price {
- color: rgba(0, 0, 0, 1);
- font-size: 12px;
- font-weight: 500;
- line-height: 22px;
- text-decoration: line-through;
- }
- }
- }
- .btn-box {
- display: flex;
- .el-button {
- width: 112px;
- height: 40px;
- background: #ea5939;
- box-shadow: 0px 8px 16px rgba(234, 89, 57, 0.24);
- border-radius: 4px;
- font-weight: 500;
- font-size: 16px;
- color: #ffffff;
- border: none;
- }
- .svg-icon {
- margin-left: 7px;
- }
- .continue {
- width: 112px;
- height: 40px;
- background: #175dff;
- border-radius: 4px;
- font-weight: 500;
- font-size: 16px;
- line-height: 40px;
- color: rgba(255, 255, 255, 1);
- display: block;
- text-align: center;
- box-shadow: 0px 8px 16px rgba(23, 93, 255, 0.24);
- }
- .upgrade {
- margin-left: 16px;
- display: block;
- padding: 0px 24px;
- height: 40px;
- background: #e9e9e9;
- box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.06);
- border-radius: 4px;
- color: #595959;
- font-weight: 500;
- font-size: 16px;
- line-height: 40px;
- text-align: center;
- width: 130px;
- }
- }
- }
- }
- }
- .main-center {
- width: 1200px;
- margin: 0 auto;
- padding: 40px 0;
- .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
- border-color: #e7e7e7;
- }
- }
- .main-bottom {
- width: 1200px;
- margin: 0 auto;
- padding-bottom: 40px;
- &-top {
- display: flex;
- justify-content: space-between;
- p {
- margin: 0;
- font-weight: 500;
- font-size: 24px;
- line-height: 32px;
- color: #1f2c5c;
- font-family: initial;
- }
- .right {
- color: rgba(0, 0, 0, 0.88);
- font-weight: 400;
- font-size: 16px;
- line-height: 24px;
- cursor: pointer;
- a {
- margin-right: 8px;
- }
- }
- }
- }
- .list {
- margin-top: 24px;
- display: flex;
- flex-wrap: wrap;
- > div {
- width: 200px;
- border-radius: 8px;
- overflow: hidden;
- background: #ffffff;
- margin-bottom: 24px;
- }
- }
- }
- .banner-box-close {
- margin-top: 40px;
- }
- .sales-box {
- display: flex;
- width: 680px;
- padding: 16px;
- border-radius: 4px;
- background: #f5f5f5;
- justify-content: space-between;
- align-items: flex-end;
- color: #adadad;
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- .OPPOSans {
- margin: 0 8px 0 16px;
- color: #ea5939;
- font-size: 32px;
- font-weight: 500;
- line-height: 40px;
- }
- .old-price {
- color: rgba(0, 0, 0, 0.4);
- font-size: 14px;
- font-weight: 500;
- line-height: 22px;
- text-decoration: line-through;
- }
- b {
- color: rgba(0, 0, 0, 0.4);
- font-size: 14px;
- font-weight: 700;
- line-height: 22px;
- }
- }
- .custom-box {
- width: 522px;
- border: 1px solid #e5e6eb;
- background: #fff;
- margin: 4px 0 8px 0;
- &-top {
- padding: 8px 16px;
- display: flex;
- // justify-content: space-between;
- align-items: center;
- h5 {
- margin: 0;
- color: #ea5939;
- font-size: 12px;
- font-weight: 600;
- line-height: 20px;
- }
- .btn-box {
- a {
- margin-left: 6px;
- border-radius: 2px;
- background: #00adef;
- width: 24px;
- height: 24px;
- display: block;
- text-align: center;
- line-height: 24px;
- font-size: 20px;
- color: #fff;
- }
- }
- }
- &-bottom {
- border-top: 1px solid #e5e6eb;
- li {
- padding: 8px !important;
- margin: 0 !important;
- background: #ffffff !important;
- border: none !important;
- min-width: 52px;
- height: 36px;
- text-align: center;
- border-right: 1px solid #e5e6eb !important;
- border-bottom: 1px solid #e5e6eb !important;
- border-radius: 0 !important;
- display: flex;
- .custom-btn {
- border: none;
- width: 100%;
- background: initial;
- padding: 0;
- line-height: 20px;
- height: 20px;
- color: #000;
- }
- &.active {
- border-right: 1px solid #f5f5f5 !important;
- border-bottom: 1px solid #f5f5f5 !important;
- background: #ea5939 !important;
- &:hover {
- .custom-btn {
- color: #fff !important;
- }
- }
- .custom-btn {
- color: #fff !important;
- }
- }
- &:hover {
- .custom-btn {
- color: #000 !important;
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- .bookItem {
- .el-carousel__button {
- width: 8px;
- height: 8px;
- background: #d9d9d9;
- opacity: 1;
- border-radius: 4px;
- }
- .el-carousel__indicator.is-active {
- .el-carousel__button {
- background: #5e5e5e;
- }
- }
- .el-tabs__header {
- margin: 0;
- }
- .el-tab-pane {
- background: #f8f8f8;
- border: 1px solid #e7e7e7;
- border-top: none;
- padding: 24px;
- }
- .el-tabs__item {
- width: 160px;
- height: 38px;
- text-align: center;
- font-weight: 500;
- font-size: 14px;
- line-height: 38px;
- color: #1f2c5c;
- &:hover {
- background: #e7e7e7;
- }
- &.is-active {
- // background: #3459D2;
- // color: #EEF3FF;
- border-bottom: none;
- background: #e7e7e7;
- }
- }
- }
- .bookitem-dropdown.el-dropdown-menu {
- padding: 4px;
- .el-dropdown-menu__item {
- font-weight: 500;
- font-size: 16px;
- line-height: 40px;
- color: #000000;
- }
- .el-dropdown-menu__item:focus,
- .el-dropdown-menu__item:not(.is-disabled):hover {
- background: #fdecee;
- border-radius: 4px;
- color: #ea5939;
- }
- }
- .bookItem-dialog {
- .el-dialog__header,
- .el-dialog__body {
- padding: 0;
- }
- .el-dialog {
- border: 1px solid #ebebeb;
- box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05),
- 0px 16px 24px 2px rgba(0, 0, 0, 0.04),
- 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
- border-radius: 8px;
- overflow: hidden;
- }
- }
- .tooltip-btn {
- border: none;
- padding: 0;
- margin-left: 6px;
- color: #bebebe;
- &:focus,
- &:hover {
- color: #bebebe;
- background: none;
- }
- }
- .order-table.el-table {
- font-size: 12px;
- color: #fff;
- line-height: 20px;
- }
- .order-table.el-table th.el-table__cell {
- background: #3e424b !important;
- padding: 2px 5px;
- }
- .order-table.el-table .el-table__cell {
- padding: 2px 5px;
- }
- .order-table.el-table thead {
- font-size: 12px;
- color: #fff;
- line-height: 20px;
- }
- .order-table.el-table td.el-table__cell,
- .order-table.el-table th.el-table__cell.is-leaf {
- border-bottom-color: #3e424b;
- }
- .order-table.el-table tr,
- .order-table.el-table--enable-row-hover
- .el-table__body
- tr:hover
- > td.el-table__cell {
- background: #1d2129;
- }
- .order-table.el-table .cell {
- padding: 0 5px !important;
- }
- .order-table.el-table::before {
- height: 0;
- }
- .order-table.el-table--scrollable-y .el-table__body-wrapper::-webkit-scrollbar {
- display: none;
- }
- </style>
|