index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. <template>
  2. <view class="container" :style="{ background: containerBg }" :class="bookList.length ? 'book-list' : 'no-list'">
  3. <u-navbar :is-back="false" :border-bottom="false" :background="{ background: navbarBackground }">
  4. <text class="nav-title">卖书给书嗨</text>
  5. </u-navbar>
  6. <not-scanned v-if="!bookList.length"></not-scanned>
  7. <scan-book-list v-else @updateBooks="updateBooksList" @deleted="handleDeleteBook" :bookList="bookList"
  8. ref="scanBookList" @upsell="handleUpsell" @refresh="getLastOrder"></scan-book-list>
  9. <!-- 底部固定按钮 -->
  10. <view class="bottom-fixed">
  11. <view class="btn-wrap mb-20">
  12. <button class="scan-btn flex-1" @click="handleScan">
  13. <u-icon name="scan" color="#FFFFFF" size="40"></u-icon>
  14. <text>扫码卖书</text>
  15. </button>
  16. <button class="isbn-btn flex-1" @click="goToInputISBN">
  17. <u-icon name="edit-pen" color="#4CD964" size="40"></u-icon>
  18. <text>输入ISBN</text>
  19. </button>
  20. </view>
  21. <view class="flex-a flex-j-b pad-20" style="padding-top: 0" v-if="bookList.length">
  22. <view class="left-info" style="min-width: 194px">
  23. <view class="flex-a common-text">
  24. <text class="color-red">{{ orderInfo.totalNum }}</text>
  25. 件 预估回收价
  26. <text class="color-red">¥{{ orderInfo.totalRecycleMoney || 0 }}</text>
  27. </view>
  28. <text class="common-text tip">
  29. *<text v-if="orderInfo.minOrderNum > 1">旧书满{{ orderInfo.minOrderNum
  30. }}本,{{ orderInfo.recycleOrderAndOr == 2 ? '且' : '或' }}</text>预估价格满{{ orderInfo.minOrderMoney}}元起收
  31. </text>
  32. </view>
  33. <button class="scan-btn next-btn" @click="handleValidate" :disabled="isDisabled">
  34. 下一步
  35. </button>
  36. </view>
  37. <service-info v-if="bookList.length" :serviceList="serviceList"
  38. :firstOrder="orderInfo.firstOrder"></service-info>
  39. </view>
  40. <InputIsbn ref="isbnPopup" @submit="(isbn) => checkBookISBN(isbn, 'input')" />
  41. <!-- 套装书说明弹窗 -->
  42. <CommonDialog ref="setBookDialog" title="套装书说明" :showCancel="false" @confirm="handleSetBookConfirm">
  43. <text>套装书(ISBN码相同的系列书箱)只需扫描其中一册,扫码价即套装价。打包时请把所有单册统在一起或放在一个袋子里寄出。</text>
  44. </CommonDialog>
  45. <!-- 暂不回收弹窗 -->
  46. <CommonDialog ref="notAcceptDialog" title="暂不回收" :showCancel="false">
  47. <text>这本书暂时不回收,请您过段时间再来试试~</text>
  48. </CommonDialog>
  49. <!-- 暂无信息弹窗 -->
  50. <CommonDialog ref="noInfoDialog" title="暂无信息" :showCancel="false">
  51. <text>抱歉,没有该书的信息,书嗨会定期补充图书信息,请您过段时间再来试试~</text>
  52. </CommonDialog>
  53. <!-- 扫累了弹窗 -->
  54. <CommonDialog ref="tiredDialog" title="温馨提示" :showCancel="false">
  55. <text>扫累了,休息休息吧~</text>
  56. </CommonDialog>
  57. <!-- 该书超出最大回收本数 maxAcceptDialog-->
  58. <CommonDialog ref="maxAcceptDialog" title="温馨提示" :showCancel="false">
  59. <text>该书超出最大回收本数</text>
  60. </CommonDialog>
  61. <!-- 单个订单最多40本书 orderMaxNumDialog-->
  62. <CommonDialog ref="orderMaxNumDialog" title="温馨提示" :showCancel="false">
  63. <text>单个订单最多40本书</text>
  64. </CommonDialog>
  65. <!-- 删除活动书籍弹窗 -->
  66. <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
  67. <text>{{
  68. deleteBook.upsellMoney
  69. ? "此书为限时加价收图书,删除后再次添加将失去加价收资格,确定删除吗?"
  70. : "确定删除这本图书吗?"
  71. }}</text>
  72. </common-dialog>
  73. <!-- 此订单还有未加价的图书,提交订单后将失去加价资格,确定提交吗? -->
  74. <common-dialog ref="noUpsellDialog" title="温馨提示" @confirm="onNext">
  75. <text>此订单还有未加价的图书,提交订单后将失去加价资格,确定提交吗?</text>
  76. </common-dialog>
  77. <!-- 温馨提示弹窗 -->
  78. <KindReminder ref="kindReminder" @start="handleStartSelling" />
  79. <!-- 客服按钮 -->
  80. <FloatingDrag :width="126" :height="140" :initial-position="servicePosition"
  81. @position-change="handlePositionChange">
  82. <!-- #ifdef MP-ALIPAY -->
  83. <button class="service-btn" @click="navigateToCustomerService">
  84. <image src="/static/img/kf.png" mode="widthFix" style="width: 126rpx; height: 140rpx"></image>
  85. </button>
  86. <!-- #endif -->
  87. <!-- #ifndef MP-ALIPAY -->
  88. <button class="service-btn" open-type="contact">
  89. <image src="/static/img/kf.png" mode="widthFix" style="width: 126rpx; height: 140rpx"></image>
  90. </button>
  91. <!-- #endif -->
  92. </FloatingDrag>
  93. <ConfirmBooks ref="confirmBooks" @incomplete="handleIncomplete" />
  94. <!-- 首单免费弹窗 -->
  95. <FirstOrderFreePopup ref="firstOrderFreePopup" />
  96. <!-- 图书加价弹窗 -->
  97. <UpsellBook ref="upsellRef" @scan="handleScanCode" />
  98. <!-- 加价分享弹窗 -->
  99. <UpsellShare ref="shareRef" @viewRules="handleViewSellRules" />
  100. <!-- 加价二维码弹窗 -->
  101. <UpsellQrcode ref="upsellQrcodeRef" />
  102. <!-- 加价规则弹窗 -->
  103. <UpsellRules ref="upsellRulesRef" />
  104. <!-- 减价分享弹窗 -->
  105. <ReduceShare ref="reduceShareRef" @viewRules="handleViewSellRules" />
  106. </view>
  107. </template>
  108. <script>
  109. import notScanned from "./components/notScanned.vue";
  110. import InputIsbn from "./components/InputIsbn.vue";
  111. import ScanBookList from "./components/ScanBookList.vue";
  112. import CommonDialog from "@/components/common-dialog.vue";
  113. import KindReminder from "./components/KindReminder.vue";
  114. import ServiceInfo from "./components/ServiceInfo.vue";
  115. import ConfirmBooks from "./components/ConfirmBooks.vue";
  116. import FirstOrderFreePopup from "./components/FirstOrderFreePopup.vue";
  117. import UpsellBook from "./components/upsell-book.vue";
  118. import UpsellRules from "./components/upsell-rules.vue";
  119. import UpsellShare from "./components/upsell-share.vue";
  120. import UpsellQrcode from "./components/upsell-qrcode.vue";
  121. import ReduceShare from "./components/reduce-share.vue";
  122. import FloatingDrag from "@/components/floating-drag.vue";
  123. import { eventBus } from "@/utils/event-bus";
  124. const app = getApp();
  125. export default {
  126. components: {
  127. notScanned,
  128. InputIsbn,
  129. ScanBookList,
  130. CommonDialog,
  131. KindReminder,
  132. ServiceInfo,
  133. ConfirmBooks,
  134. FirstOrderFreePopup,
  135. UpsellBook,
  136. UpsellRules,
  137. UpsellShare,
  138. UpsellQrcode,
  139. ReduceShare,
  140. FloatingDrag,
  141. },
  142. data() {
  143. return {
  144. orderInfo: {},
  145. collapseState: {
  146. step1: false,
  147. step3: false,
  148. },
  149. scrollTop: 0,
  150. bookList: [],
  151. serviceList: [],
  152. currentBook: {},
  153. // 客服按钮位置
  154. servicePosition: {
  155. left: "auto",
  156. right: 0,
  157. bottom: "20%",
  158. },
  159. shareData: {},
  160. deleteBook: {},
  161. };
  162. },
  163. computed: {
  164. navbarBackground() {
  165. if (this.scrollTop > 0) {
  166. return "linear-gradient(180deg, #4CD964 0%, #5ff178 100%)";
  167. }
  168. return "transparent";
  169. },
  170. containerBg() {
  171. return this.bookList.length > 0
  172. ? "linear-gradient(180deg, #4CD964 0%, #F8F8F8 25%)"
  173. : "linear-gradient(180deg, #4CD964 0%, #ffffff 25%)";
  174. },
  175. containerPb() {
  176. return this.bookList.length > 0 ? "300rpx" : "110rpx";
  177. },
  178. totalBooks() {
  179. return this.bookList.reduce((sum, book) => sum + (book.num || 1), 0);
  180. },
  181. totalPrice() {
  182. return this.bookList
  183. .reduce(
  184. (sum, book) =>
  185. sum + book.recyclePrice * (book.num || 1) + book.currUpsellMoney ||
  186. 0,
  187. 0
  188. )
  189. .toFixed(2);
  190. },
  191. isDisabled() {
  192. //minOrderNum或minOrderMoney可能没有值,
  193. let { minOrderNum, minOrderMoney } = this.orderInfo
  194. if (!minOrderMoney && !minOrderNum) return false
  195. //minOrderMoney没有值,minOrderNum有值
  196. if (minOrderNum && !minOrderMoney) return minOrderNum > this.totalBooks
  197. if (minOrderNum && !minOrderMoney) return minOrderMoney > this.totalPrice
  198. if (minOrderNum && minOrderMoney) return minOrderNum > this.totalBooks && minOrderMoney > this.totalPrice
  199. },
  200. },
  201. onPageScroll(e) {
  202. this.$nextTick(() => {
  203. this.scrollTop = e.scrollTop;
  204. });
  205. },
  206. // 分享配置
  207. onShareAppMessage(res) {
  208. if (res.from === "button" && res.target && res.target.dataset && res.target.dataset.shareType === "upsell") {
  209. let upsellCode = uni.getStorageSync("upsellCodeShare");
  210. console.log(upsellCode, "分享");
  211. // 调用分享接口
  212. uni.$u.http.get("/token/order/goToShare?upsellCode=" + upsellCode);
  213. return {
  214. title: "书嗨",
  215. path: "/pages/home/index?upsellCode=" + upsellCode,
  216. imageUrl: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/share.jpg",
  217. desc: "书嗨,专注于书籍交易的平台,提供新书和二手书的买卖服务",
  218. };
  219. } else if (res.from === "button" && res.target && res.target.dataset && res.target.dataset.shareType === "reduce") {
  220. let reduceCode = uni.getStorageSync("reduceCodeShare");
  221. if (uni.$u && uni.$u.api && uni.$u.api.goToReduceShareAjax) {
  222. uni.$u.api.goToReduceShareAjax({ reduceCode: reduceCode });
  223. } else {
  224. uni.$u && uni.$u.http && uni.$u.http.get('/token/shop/order/goToShare', { reduceCode: reduceCode });
  225. }
  226. return {
  227. title: "快来帮我减钱买书吧!",
  228. path: "/pages/home/index?reduceCode=" + reduceCode,
  229. imageUrl: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/share.jpg",
  230. desc: "书嗨,专注于书籍交易的平台,提供新书和二手书的买卖服务",
  231. };
  232. } else {
  233. return {
  234. title: "书嗨",
  235. page: "/pages/home/index",
  236. };
  237. }
  238. },
  239. // 分享到朋友圈
  240. onShareTimeline(res) {
  241. if (res.from === "button" && res.target && res.target.dataset && res.target.dataset.shareType === "upsell") {
  242. let upsellCode = uni.getStorageSync("upsellCodeShare");
  243. // 调用分享接口
  244. uni.$u.http.get("/token/order/goToShare?upsellCode=" + upsellCode);
  245. return {
  246. title: "书嗨",
  247. path: "/pages/home/index?upsellCode=" + upsellCode,
  248. imageUrl: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/share.jpg",
  249. desc: "书嗨,专注于书籍交易的平台,提供新书和二手书的买卖服务",
  250. };
  251. } else if (res.from === "button" && res.target && res.target.dataset && res.target.dataset.shareType === "reduce") {
  252. let reduceCode = uni.getStorageSync("reduceCodeShare");
  253. if (uni.$u && uni.$u.api && uni.$u.api.goToReduceShareAjax) {
  254. uni.$u.api.goToReduceShareAjax({ reduceCode: reduceCode });
  255. } else {
  256. uni.$u && uni.$u.http && uni.$u.http.get('/token/shop/order/goToShare', { reduceCode: reduceCode });
  257. }
  258. return {
  259. title: "快来帮我减钱买书吧!",
  260. path: "/pages/home/index?reduceCode=" + reduceCode,
  261. imageUrl: "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/share.jpg",
  262. desc: "书嗨,专注于书籍交易的平台,提供新书和二手书的买卖服务",
  263. };
  264. } else {
  265. return {
  266. title: "书嗨",
  267. page: "/pages/home/index",
  268. };
  269. }
  270. },
  271. onReady() {
  272. // 获取屏幕宽度和高度
  273. uni.getSystemInfo({
  274. success: (res) => {
  275. this.screenWidth = res.windowWidth;
  276. this.screenHeight = res.windowHeight;
  277. },
  278. });
  279. },
  280. onShow() {
  281. this.$updateCartBadge();
  282. if (!app.globalData.isColdLaunch) {
  283. let token = uni.getStorageSync("token");
  284. if (token) {
  285. this.getLastOrder();
  286. }
  287. return
  288. }
  289. eventBus.on("loginSuccess", (data) => {
  290. console.log(data, "登录成功loginSuccess");
  291. this.loginSuccess(data);
  292. app.globalData.isColdLaunch = false;
  293. });;
  294. },
  295. //针对多次扫码的热启动场景,需要判断是否是冷启动
  296. onLoad(options) {
  297. console.log(options, app.globalData.isColdLaunch, "onLoad");
  298. if (app.globalData.isColdLaunch) return
  299. if (options.scene) {
  300. let params = {};
  301. // 对 scene 进行解码
  302. const decodeScene = decodeURIComponent(options.scene);
  303. // 拆分参数
  304. const paramPairs = decodeScene.split('&');
  305. paramPairs.forEach((pair) => {
  306. const [key, value] = pair.split('=');
  307. params[key] = value;
  308. });
  309. if (params.upsellCode) {
  310. this.$refs.shareRef?.open(params.upsellCode);
  311. this.getLastOrder();
  312. }
  313. if (params.reduceCode) {
  314. this.$refs.reduceShareRef?.open(params.reduceCode);
  315. }
  316. } else if (options.upsellCode) {
  317. this.$refs.shareRef?.open(options.upsellCode);
  318. } else if (options.reduceCode) {
  319. this.$refs.reduceShareRef?.open(options.reduceCode);
  320. } else {
  321. this.getLastOrder();
  322. }
  323. },
  324. // #ifdef MP-ALIPAY
  325. onPullDownRefresh() {
  326. this.getLastOrder()
  327. },
  328. // #endif
  329. //卸载loginSuccess事件
  330. onUnload() {
  331. uni.removeStorageSync("upsellCode");
  332. uni.removeStorageSync("reduceCode");
  333. eventBus.off("loginSuccess");
  334. },
  335. methods: {
  336. // 登录成功之后
  337. loginSuccess(data) {
  338. let upsellCode = uni.getStorageSync("upsellCode");
  339. if (upsellCode) {
  340. console.log(upsellCode, "登录成功之后助力的 code值:", upsellCode);
  341. this.$refs.shareRef?.open(upsellCode);
  342. }
  343. // 仿照加价助力:优先读取缓存,兼容扫码冷启动参数丢失场景
  344. let reduceCode = uni.getStorageSync("reduceCode") || data?.params?.reduceCode;
  345. if (reduceCode) {
  346. console.log(reduceCode, "登录成功之后助力的 code值:", reduceCode);
  347. this.$refs.reduceShareRef?.open(reduceCode);
  348. }
  349. this.getLastOrder();
  350. },
  351. //删除书籍
  352. handleDeleteBook(book) {
  353. this.deleteBook = book;
  354. this.$refs.deleteDialog.openPopup(book);
  355. },
  356. //支付宝小程序的客服
  357. navigateToCustomerService() {
  358. uni.navigateTo({
  359. url: "/pages-mine/pages/customer-service",
  360. });
  361. },
  362. confirmDelete() {
  363. uni.$u.http
  364. .post("/token/order/removeBook", {
  365. orderId: this.deleteBook.orderId,
  366. isbn: this.deleteBook.isbn,
  367. })
  368. .then((res) => {
  369. if (res.code == 200) {
  370. this.$u.toast("删除成功");
  371. this.getLastOrder();
  372. }
  373. });
  374. },
  375. //扫码助力
  376. handleScanCode(data = {}) {
  377. this.$refs.upsellQrcodeRef.open(data);
  378. },
  379. //查看活动规则
  380. handleViewSellRules() {
  381. this.$refs.upsellRulesRef.open();
  382. },
  383. handleStart() {
  384. this.showPopup = true;
  385. },
  386. //套装书确认
  387. handleSetBookConfirm() {
  388. this.$refs.confirmBooks.openPopup(this.currentBook);
  389. },
  390. //书册补全
  391. handleIncomplete() {
  392. this.$refs.scanBookList.handleDeleteBook(this.currentBook);
  393. },
  394. handleValidate() {
  395. if (this.bookList.some((v) => v.canInvite == 1)) {
  396. this.$refs.noUpsellDialog.openPopup();
  397. } else {
  398. this.onNext();
  399. }
  400. },
  401. //提交
  402. onNext() {
  403. let orderId = this.orderInfo.orderId;
  404. //预提交
  405. uni.$u.http
  406. .get("/token/order/preSubmit?orderId=" + orderId)
  407. .then((res) => {
  408. if (res.code == 200) {
  409. if (res.data.code == 1 || res.data.code == 2) {
  410. uni.navigateTo({
  411. url: "/pages-home/pages/book-order",
  412. });
  413. uni.setStorageSync("orderId", orderId);
  414. } else {
  415. uni.showToast({
  416. icon: "none",
  417. title: res.msg,
  418. });
  419. }
  420. } else {
  421. uni.showToast({
  422. icon: "none",
  423. title: res.msg,
  424. });
  425. }
  426. });
  427. },
  428. // 加价
  429. handleUpsell(book) {
  430. this.$refs.upsellRef.open(book);
  431. },
  432. updateBooksList(data, book) {
  433. this.bookList = data;
  434. // book.upsellMoney && this.getLastOrder();
  435. this.getLastOrder();
  436. },
  437. toggleCollapse(step) {
  438. this.$set(this.collapseState, step, !this.collapseState[step]);
  439. },
  440. handleScan() {
  441. uni.scanCode({
  442. scanType: ["barCode"],
  443. success: (res) => {
  444. this.checkBookISBN(res.result, "scan");
  445. },
  446. fail: () => {
  447. uni.showToast({
  448. title: "扫码失败",
  449. icon: "none",
  450. });
  451. },
  452. });
  453. },
  454. checkBookISBN(isbn, type) {
  455. let url =
  456. type == "input"
  457. ? `/token/order/inputIsbn?isbn=${isbn}`
  458. : `/token/order/scanIsbn?isbn=${isbn}`;
  459. uni.$u.http.get(url).then((res) => {
  460. if (res.code == 200) {
  461. let code = res.data.code;
  462. if (code == 1) {
  463. res.data.num = 1;
  464. res.data.status = 1;
  465. res.data.recyclePrice = res.data.recycleMoney;
  466. this.currentBook = res.data;
  467. this.bookList.unshift(res.data);
  468. if (res.data.suit == 1) {
  469. this.$refs.setBookDialog.openPopup();
  470. }
  471. if (res.data.canInvite == 1) {
  472. this.$refs.upsellRef.open(res.data);
  473. }
  474. } else if (code == 2) {
  475. let item = this.bookList.find((v) => v.isbn === isbn);
  476. item.num = item.num + 1;
  477. if (res.data.canInvite == 1) {
  478. this.$refs.upsellRef.open(res.data);
  479. }
  480. } else {
  481. this.handleBookCode(res.data.code);
  482. }
  483. this.getLastOrder();
  484. } else {
  485. uni.showToast({
  486. title: res.msg,
  487. icon: "none",
  488. });
  489. }
  490. });
  491. },
  492. //处理扫码之后不同的状态 0-扫码频繁 1-成功 2-本单已有该书,数量+1 3-没有该书 4-本书暂不回收 5-超过每单最大可卖数量 6-单个订单最多40本书
  493. handleBookCode(code) {
  494. if (code == 1) {
  495. this.bookList.push();
  496. }
  497. let tempKeys = [
  498. "tiredDialog",
  499. "",
  500. "",
  501. "noInfoDialog",
  502. "notAcceptDialog",
  503. "maxAcceptDialog",
  504. "orderMaxNumDialog",
  505. ];
  506. let key = tempKeys[code];
  507. if (key) {
  508. this.$refs[key].openPopup();
  509. }
  510. },
  511. //获取当前用户未提交订单 /api/token/order/lastOrder
  512. getLastOrder() {
  513. uni.$u.http.get("/token/order/lastOrder").then((res) => {
  514. if (res.code == 200) {
  515. this.orderInfo = res.data;
  516. if (res.data.showDialog == 1) {
  517. this.$refs.firstOrderFreePopup.openPopup();
  518. } else if (res.data.showDialog == 2) {
  519. this.$refs.kindReminder.openPopup();
  520. }
  521. this.bookList = res.data?.orderDetailList
  522. ? res.data.orderDetailList.map((v) => {
  523. v.orderId = res.data.orderId;
  524. return v;
  525. })
  526. : [];
  527. this.serviceList = res.data.serviceList || [];
  528. } else {
  529. uni.showToast({
  530. title: res.msg,
  531. icon: "none",
  532. });
  533. }
  534. }).finally(() => {
  535. // #ifdef MP-ALIPAY
  536. my.stopPullDownRefresh()
  537. // #endif
  538. })
  539. },
  540. goToScannedBooks() {
  541. uni.navigateTo({
  542. url: "/pages-home/pages/scaned-book",
  543. });
  544. },
  545. goToInputISBN() {
  546. this.$refs.isbnPopup.openPopup();
  547. },
  548. handleStartSelling() {
  549. // 标记已显示过温馨提示
  550. uni.setStorageSync("kindReminderShown", true);
  551. },
  552. // 处理位置变更
  553. handlePositionChange(position) {
  554. this.servicePosition = position;
  555. },
  556. },
  557. };
  558. </script>
  559. <style lang="scss" scoped>
  560. .service-btn {
  561. height: max-content;
  562. background-color: transparent;
  563. padding: 0;
  564. }
  565. .container {
  566. height: 100%;
  567. position: relative;
  568. overflow: auto;
  569. z-index: 1;
  570. /* #ifdef MP-WEIXIN */
  571. min-height: 100vh;
  572. /* #endif */
  573. /* #ifndef MP-WEIXIN */
  574. min-height: calc(100vh - 120rpx);
  575. /* #endif */
  576. &.book-list {
  577. padding-bottom: 300rpx;
  578. }
  579. padding-bottom: 130rpx;
  580. .nav-title {
  581. font-family: PingFang SC;
  582. font-weight: bold;
  583. font-size: 34rpx;
  584. color: #ffffff;
  585. padding-left: 40rpx;
  586. /* #ifdef MP-ALIPAY */
  587. padding-left: 70rpx;
  588. /* #endif */
  589. }
  590. }
  591. .common-text {
  592. font-family: PingFang SC;
  593. font-weight: 500;
  594. font-size: 28rpx;
  595. color: #999999;
  596. &.tip {
  597. color: #ff8a4b;
  598. font-size: 26rpx;
  599. }
  600. }
  601. .color-red {
  602. color: #ff0000;
  603. margin: 0 10rpx;
  604. }
  605. .color-green {
  606. color: #276f1e;
  607. }
  608. .bottom-fixed {
  609. position: fixed;
  610. left: 0;
  611. right: 0;
  612. bottom: 0;
  613. z-index: 9;
  614. background-color: #ffffff;
  615. /* #ifdef H5 */
  616. padding-bottom: 120rpx;
  617. /* #endif */
  618. .btn-wrap {
  619. display: flex;
  620. gap: 20rpx;
  621. padding: 20rpx;
  622. padding-bottom: 0;
  623. button {
  624. flex: 1;
  625. height: 88rpx;
  626. border-radius: 10rpx;
  627. display: flex;
  628. align-items: center;
  629. justify-content: center;
  630. gap: 10rpx;
  631. border: none;
  632. text {
  633. font-size: 32rpx;
  634. }
  635. &::after {
  636. border: none;
  637. }
  638. }
  639. .isbn-btn {
  640. background-color: #ffffff;
  641. color: #4cd964;
  642. border: 3rpx solid #4cd964;
  643. }
  644. }
  645. .scan-btn {
  646. background-color: #4cd964;
  647. color: #ffffff;
  648. }
  649. .next-btn {
  650. margin: 0;
  651. margin-left: 40rpx;
  652. &[aria-disabled="true"] {
  653. background-color: #cccccc;
  654. color: #ffffff;
  655. opacity: 0.7;
  656. cursor: not-allowed;
  657. }
  658. }
  659. }
  660. </style>