index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  1. <template>
  2. <view
  3. class="container"
  4. :style="{ background: containerBg }"
  5. :class="bookList.length ? 'book-list' : 'no-list'"
  6. >
  7. <u-navbar
  8. :is-back="false"
  9. :border-bottom="false"
  10. :background="{ background: navbarBackground }"
  11. >
  12. <text class="nav-title">卖书给书嗨</text>
  13. </u-navbar>
  14. <not-scanned v-if="!bookList.length"></not-scanned>
  15. <scan-book-list
  16. v-else
  17. @updateBooks="updateBooksList"
  18. @deleted="handleDeleteBook"
  19. :bookList="bookList"
  20. ref="scanBookList"
  21. @upsell="handleUpsell"
  22. @refresh="getLastOrder"
  23. ></scan-book-list>
  24. <!-- 底部固定按钮 -->
  25. <view class="bottom-fixed">
  26. <view class="btn-wrap mb-20">
  27. <button class="scan-btn flex-1" @click="handleScan">
  28. <u-icon name="scan" color="#FFFFFF" size="40"></u-icon>
  29. <text>扫码卖书</text>
  30. </button>
  31. <button class="isbn-btn flex-1" @click="goToInputISBN">
  32. <u-icon name="edit-pen" color="#4CD964" size="40"></u-icon>
  33. <text>输入ISBN</text>
  34. </button>
  35. </view>
  36. <view
  37. class="flex-a flex-j-b pad-20"
  38. style="padding-top: 0"
  39. v-if="bookList.length"
  40. >
  41. <view class="left-info" style="min-width: 194px">
  42. <view class="flex-a common-text">
  43. <text class="color-red">{{ orderInfo.totalNum }}</text>
  44. 件 预估回收价
  45. <text class="color-red"
  46. >¥{{ orderInfo.totalRecycleMoney || 0 }}</text
  47. >
  48. </view>
  49. <text class="common-text tip"
  50. >*旧书预估价格满
  51. {{ orderInfo.minOrderMoney }} 元起收</text
  52. >
  53. </view>
  54. <button
  55. class="scan-btn next-btn"
  56. @click="handleValidate"
  57. :disabled="isDisabled"
  58. >
  59. 下一步
  60. </button>
  61. </view>
  62. <service-info
  63. v-if="bookList.length"
  64. :serviceList="serviceList"
  65. :firstOrder="orderInfo.firstOrder"
  66. ></service-info>
  67. </view>
  68. <InputIsbn
  69. ref="isbnPopup"
  70. @submit="(isbn) => checkBookISBN(isbn, 'input')"
  71. />
  72. <!-- 套装书说明弹窗 -->
  73. <CommonDialog
  74. ref="setBookDialog"
  75. title="套装书说明"
  76. :showCancel="false"
  77. @confirm="handleSetBookConfirm"
  78. >
  79. <text
  80. >套装书(ISBN码相同的系列书箱)只需扫描其中一册,扫码价即套装价。打包时请把所有单册统在一起或放在一个袋子里寄出。</text
  81. >
  82. </CommonDialog>
  83. <!-- 暂不回收弹窗 -->
  84. <CommonDialog
  85. ref="notAcceptDialog"
  86. title="暂不回收"
  87. :showCancel="false"
  88. >
  89. <text>这本书暂时不回收,请您过段时间再来试试~</text>
  90. </CommonDialog>
  91. <!-- 暂无信息弹窗 -->
  92. <CommonDialog ref="noInfoDialog" title="暂无信息" :showCancel="false">
  93. <text
  94. >抱歉,没有该书的信息,书嗨会定期补充图书信息,请您过段时间再来试试~</text
  95. >
  96. </CommonDialog>
  97. <!-- 扫累了弹窗 -->
  98. <CommonDialog ref="tiredDialog" title="温馨提示" :showCancel="false">
  99. <text>扫累了,休息休息吧~</text>
  100. </CommonDialog>
  101. <!-- 该书超出最大回收本数 maxAcceptDialog-->
  102. <CommonDialog
  103. ref="maxAcceptDialog"
  104. title="温馨提示"
  105. :showCancel="false"
  106. >
  107. <text>该书超出最大回收本数</text>
  108. </CommonDialog>
  109. <!-- 单个订单最多40本书 orderMaxNumDialog-->
  110. <CommonDialog
  111. ref="orderMaxNumDialog"
  112. title="温馨提示"
  113. :showCancel="false"
  114. >
  115. <text>单个订单最多40本书</text>
  116. </CommonDialog>
  117. <!-- 删除活动书籍弹窗 -->
  118. <common-dialog
  119. ref="deleteDialog"
  120. title="温馨提示"
  121. @confirm="confirmDelete"
  122. >
  123. <text>{{
  124. deleteBook.upsellMoney
  125. ? "此书为限时加价收图书,删除后再次添加将失去加价收资格,确定删除吗?"
  126. : "确定删除这本图书吗?"
  127. }}</text>
  128. </common-dialog>
  129. <!-- 此订单还有未加价的图书,提交订单后将失去加价资格,确定提交吗? -->
  130. <common-dialog ref="noUpsellDialog" title="温馨提示" @confirm="onNext">
  131. <text
  132. >此订单还有未加价的图书,提交订单后将失去加价资格,确定提交吗?</text
  133. >
  134. </common-dialog>
  135. <!-- 温馨提示弹窗 -->
  136. <KindReminder
  137. ref="kindReminder"
  138. @start="handleStartSelling"
  139. @viewRules="handleViewRules"
  140. />
  141. <view
  142. class="customer-service"
  143. :style="{
  144. left: servicePosition.left + 'px',
  145. right: servicePosition.right + 'px',
  146. bottom: servicePosition.bottom + 'px',
  147. }"
  148. @touchstart="touchStart"
  149. @touchmove="touchMove"
  150. @touchend="touchEnd"
  151. >
  152. <button class="service-btn" open-type="contact">
  153. <image
  154. src="/static/img/kf.png"
  155. mode="widthFix"
  156. style="width: 126rpx; height: 140rpx"
  157. ></image>
  158. </button>
  159. </view>
  160. <ConfirmBooks ref="confirmBooks" @incomplete="handleIncomplete" />
  161. <!-- 首单免费弹窗 -->
  162. <FirstOrderFreePopup ref="firstOrderFreePopup" />
  163. <!-- 图书加价弹窗 -->
  164. <UpsellBook ref="upsellRef" @scan="handleScanCode" />
  165. <!-- 加价分享弹窗 -->
  166. <UpsellShare ref="shareRef" @viewRules="handleViewSellRules" />
  167. <!-- 加价二维码弹窗 -->
  168. <UpsellQrcode ref="upsellQrcodeRef" />
  169. <!-- 加价规则弹窗 -->
  170. <UpsellRules ref="upsellRulesRef" />
  171. </view>
  172. </template>
  173. <script>
  174. import notScanned from "./components/notScanned.vue";
  175. import InputIsbn from "./components/InputIsbn.vue";
  176. import ScanBookList from "./components/ScanBookList.vue";
  177. import CommonDialog from "@/components/common-dialog.vue";
  178. import KindReminder from "./components/KindReminder.vue";
  179. import ServiceInfo from "./components/ServiceInfo.vue";
  180. import ConfirmBooks from "./components/ConfirmBooks.vue";
  181. import FirstOrderFreePopup from "./components/FirstOrderFreePopup.vue";
  182. import UpsellBook from "./components/upsell-book.vue";
  183. import UpsellRules from "./components/upsell-rules.vue";
  184. import UpsellShare from "./components/upsell-share.vue";
  185. import UpsellQrcode from "./components/upsell-qrcode.vue";
  186. import { silentLogin } from "@/api/auth";
  187. const app = getApp();
  188. export default {
  189. components: {
  190. notScanned,
  191. InputIsbn,
  192. ScanBookList,
  193. CommonDialog,
  194. KindReminder,
  195. ServiceInfo,
  196. ConfirmBooks,
  197. FirstOrderFreePopup,
  198. UpsellBook,
  199. UpsellRules,
  200. UpsellShare,
  201. UpsellQrcode,
  202. },
  203. data() {
  204. return {
  205. orderInfo: {},
  206. collapseState: {
  207. step1: false,
  208. step3: false,
  209. },
  210. scrollTop: 0,
  211. bookList: [],
  212. serviceList: [],
  213. currentBook: {},
  214. // 客服按钮位置
  215. servicePosition: {
  216. left: "auto",
  217. right: 0,
  218. bottom: "20%",
  219. },
  220. // 触摸开始位置
  221. startX: 0,
  222. startY: 0,
  223. // 屏幕宽度和高度
  224. screenWidth: 0,
  225. screenHeight: 0,
  226. // 初始位置记录,用于计算拖动
  227. initialLeft: 0,
  228. initialBottom: 0,
  229. // 是否正在更新位置,用于防止频繁更新
  230. isUpdatingPosition: false,
  231. shareData: {},
  232. deleteBook: {},
  233. };
  234. },
  235. computed: {
  236. navbarBackground() {
  237. if (this.scrollTop > 0) {
  238. return "linear-gradient(180deg, #4CD964 0%, #5ff178 100%)";
  239. }
  240. return "transparent";
  241. },
  242. containerBg() {
  243. return this.bookList.length > 0
  244. ? "linear-gradient(180deg, #4CD964 0%, #F8F8F8 25%)"
  245. : "linear-gradient(180deg, #4CD964 0%, #ffffff 25%)";
  246. },
  247. containerPb() {
  248. return this.bookList.length > 0 ? "300rpx" : "110rpx";
  249. },
  250. totalBooks() {
  251. return this.bookList.reduce(
  252. (sum, book) => sum + (book.num || 1),
  253. 0
  254. );
  255. },
  256. totalPrice() {
  257. return this.bookList
  258. .reduce(
  259. (sum, book) =>
  260. sum +
  261. book.recyclePrice * (book.num || 1) +
  262. book.currUpsellMoney || 0,
  263. 0
  264. )
  265. .toFixed(2);
  266. },
  267. isDisabled() {
  268. return this.totalPrice < this.orderInfo.minOrderMoney;
  269. },
  270. },
  271. onPageScroll(e) {
  272. this.$nextTick(() => {
  273. this.scrollTop = e.scrollTop;
  274. });
  275. },
  276. // 分享配置
  277. onShareAppMessage(res) {
  278. if (res.from === "button") {
  279. let upsellCode = uni.getStorageSync("upsellCodeShare");
  280. console.log(upsellCode, "分享");
  281. // 调用分享接口
  282. uni.$u.http.get("/token/order/goToShare?upsellCode=" + upsellCode);
  283. return {
  284. title: "书嗨",
  285. path: "/pages/home/index?upsellCode=" + upsellCode,
  286. imageUrl:
  287. "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/share.jpg",
  288. };
  289. } else {
  290. return {
  291. title: "书嗨",
  292. page: "/pages/home/index",
  293. };
  294. }
  295. },
  296. // 分享到朋友圈
  297. onShareTimeline(res) {
  298. if (res.from === "button") {
  299. let upsellCode = uni.getStorageSync("upsellCodeShare");
  300. // 调用分享接口
  301. uni.$u.http.get("/token/order/goToShare?upsellCode=" + upsellCode);
  302. return {
  303. title: "书嗨",
  304. path: "/pages/home/index?upsellCode=" + upsellCode,
  305. imageUrl:
  306. "https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/share.jpg",
  307. };
  308. } else {
  309. return {
  310. title: "书嗨",
  311. page: "/pages/home/index",
  312. };
  313. }
  314. },
  315. onReady() {
  316. // 获取屏幕宽度和高度
  317. uni.getSystemInfo({
  318. success: (res) => {
  319. this.screenWidth = res.windowWidth;
  320. this.screenHeight = res.windowHeight;
  321. },
  322. });
  323. setTimeout(() => {
  324. let loginSuccess = uni.getStorageSync("loginSuccess");
  325. let upsellCode = app.globalData.upsellCode;
  326. if (loginSuccess && upsellCode) {
  327. console.log(loginSuccess, "登录成功loginSuccess");
  328. this.$refs.shareRef?.open(upsellCode);
  329. uni.removeStorageSync("loginSuccess");
  330. this.getLastOrder();
  331. }
  332. }, 1000);
  333. },
  334. methods: {
  335. //删除书籍
  336. handleDeleteBook(book) {
  337. this.deleteBook = book;
  338. this.$refs.deleteDialog.openPopup(book);
  339. },
  340. confirmDelete() {
  341. uni.$u.http
  342. .post("/token/order/removeBook", {
  343. orderId: this.deleteBook.orderId,
  344. isbn: this.deleteBook.isbn,
  345. })
  346. .then((res) => {
  347. if (res.code == 200) {
  348. this.$u.toast("删除成功");
  349. this.getLastOrder();
  350. }
  351. });
  352. },
  353. //扫码助力
  354. handleScanCode(data = {}) {
  355. this.$refs.upsellQrcodeRef.open(data);
  356. },
  357. slientLogin() {
  358. let inviteCode = uni.getStorageSync("inviteCode") || "";
  359. let token = uni.getStorageSync("token");
  360. if (token) return;
  361. uni.login({
  362. success(res) {
  363. uni.$u.http
  364. .post("/user/wxLogin", {
  365. code: res.code,
  366. inviteCode,
  367. })
  368. .then((response) => {
  369. if (response.code == 200) {
  370. uni.setStorageSync(
  371. "token",
  372. response.data.token
  373. );
  374. }
  375. });
  376. },
  377. fail: (err) => {
  378. console.log(err, "wx.login登录失败");
  379. },
  380. });
  381. },
  382. //查看活动规则
  383. handleViewSellRules() {
  384. this.$refs.upsellRulesRef.open();
  385. },
  386. // 触摸开始
  387. touchStart(e) {
  388. const touch = e.touches[0];
  389. this.startX = touch.clientX;
  390. this.startY = touch.clientY;
  391. // 记录初始位置,用于计算移动距离
  392. if (this.servicePosition.right !== "auto") {
  393. // 如果是靠右定位,记录当前位置但不立即改变显示位置
  394. // 只在内部计算中使用,避免视觉上的位置跳动
  395. this.initialLeft = this.screenWidth - 126;
  396. } else {
  397. this.initialLeft = parseFloat(this.servicePosition.left);
  398. }
  399. // 如果bottom是百分比,转换为具体像素值,但不改变显示位置
  400. if (
  401. typeof this.servicePosition.bottom === "string" &&
  402. this.servicePosition.bottom.includes("%")
  403. ) {
  404. const percentage =
  405. parseFloat(this.servicePosition.bottom) / 100;
  406. this.initialBottom = this.screenHeight * percentage;
  407. } else {
  408. this.initialBottom = parseFloat(this.servicePosition.bottom);
  409. }
  410. },
  411. // 触摸移动
  412. touchMove(e) {
  413. // 阻止默认行为,防止页面滚动
  414. e.preventDefault && e.preventDefault();
  415. e.stopPropagation && e.stopPropagation();
  416. const touch = e.touches[0];
  417. // 计算移动距离
  418. const deltaX = touch.clientX - this.startX;
  419. const deltaY = touch.clientY - this.startY;
  420. // 使用初始位置计算新位置,避免累积误差
  421. let newLeft = this.initialLeft + deltaX;
  422. let newBottom = this.initialBottom - deltaY; // 注意:y轴方向是相反的
  423. // 确保按钮不超出屏幕边界
  424. if (newLeft < 0) {
  425. newLeft = 0;
  426. } else if (newLeft > this.screenWidth - 126) {
  427. newLeft = this.screenWidth - 126;
  428. }
  429. // 确保按钮不超出屏幕垂直边界
  430. if (newBottom < 20) {
  431. newBottom = 20;
  432. } else if (newBottom > this.screenHeight - 160) {
  433. newBottom = this.screenHeight - 160;
  434. }
  435. // 使用节流方式更新位置,避免过于频繁的更新
  436. if (!this.isUpdatingPosition) {
  437. this.isUpdatingPosition = true;
  438. // 更新位置 - 第一次移动时才真正改变right为auto
  439. this.servicePosition = {
  440. left: newLeft,
  441. right: "auto",
  442. bottom: newBottom,
  443. };
  444. // 使用setTimeout代替requestAnimationFrame,在微信小程序中更兼容
  445. setTimeout(() => {
  446. this.isUpdatingPosition = false;
  447. }, 16); // 约等于60fps的刷新率
  448. }
  449. // 不更新起始点,保持相对于初始触摸点的位移计算
  450. // 这样可以避免累积误差,使拖动更精确
  451. },
  452. // 触摸结束,实现吸附效果
  453. touchEnd() {
  454. // 确保不再有待处理的更新
  455. this.isUpdatingPosition = false;
  456. const buttonCenter = this.servicePosition.left + 63; // 按钮中心位置
  457. const halfScreen = this.screenWidth / 2;
  458. // 判断是吸附到左边还是右边
  459. if (buttonCenter < halfScreen) {
  460. // 吸附到左边
  461. this.servicePosition = {
  462. left: 0,
  463. right: "auto",
  464. bottom: this.servicePosition.bottom,
  465. };
  466. } else {
  467. // 吸附到右边
  468. this.servicePosition = {
  469. left: "auto",
  470. right: 0,
  471. bottom: this.servicePosition.bottom,
  472. };
  473. }
  474. },
  475. handleStart() {
  476. this.showPopup = true;
  477. },
  478. //套装书确认
  479. handleSetBookConfirm() {
  480. this.$refs.confirmBooks.openPopup(this.currentBook);
  481. },
  482. //书册补全
  483. handleIncomplete() {
  484. this.$refs.scanBookList.handleDeleteBook(this.currentBook);
  485. },
  486. handleValidate() {
  487. if (this.bookList.some((v) => v.canInvite == 1)) {
  488. this.$refs.noUpsellDialog.openPopup();
  489. } else {
  490. this.onNext();
  491. }
  492. },
  493. //提交
  494. onNext() {
  495. let orderId = this.orderInfo.orderId;
  496. //预提交
  497. uni.$u.http
  498. .get("/token/order/preSubmit?orderId=" + orderId)
  499. .then((res) => {
  500. if (res.code == 200) {
  501. if (res.data.code == 1 || res.data.code == 2) {
  502. uni.navigateTo({
  503. url: "/pages-home/pages/book-order",
  504. });
  505. uni.setStorageSync("orderId", orderId);
  506. } else {
  507. uni.showToast({
  508. icon: "none",
  509. title: res.msg,
  510. });
  511. }
  512. } else {
  513. uni.showToast({
  514. icon: "none",
  515. title: res.msg,
  516. });
  517. }
  518. });
  519. },
  520. // 加价
  521. handleUpsell(book) {
  522. this.$refs.upsellRef.open(book);
  523. },
  524. updateBooksList(data, book) {
  525. this.bookList = data;
  526. // book.upsellMoney && this.getLastOrder();
  527. this.getLastOrder();
  528. },
  529. toggleCollapse(step) {
  530. this.$set(this.collapseState, step, !this.collapseState[step]);
  531. },
  532. handleScan() {
  533. uni.scanCode({
  534. scanType: ["barCode"],
  535. success: (res) => {
  536. this.checkBookISBN(res.result, "scan");
  537. },
  538. fail: () => {
  539. uni.showToast({
  540. title: "扫码失败",
  541. icon: "none",
  542. });
  543. },
  544. });
  545. },
  546. checkBookISBN(isbn, type) {
  547. let url =
  548. type == "input"
  549. ? `/token/order/inputIsbn?isbn=${isbn}`
  550. : `/token/order/scanIsbn?isbn=${isbn}`;
  551. uni.$u.http.get(url).then((res) => {
  552. if (res.code == 200) {
  553. let code = res.data.code;
  554. if (code == 1) {
  555. res.data.num = 1;
  556. res.data.status = 1;
  557. res.data.recyclePrice = res.data.recycleMoney;
  558. this.currentBook = res.data;
  559. this.bookList.unshift(res.data);
  560. if (res.data.suit == 1) {
  561. this.$refs.setBookDialog.openPopup();
  562. }
  563. if (res.data.canInvite == 1) {
  564. this.$refs.upsellRef.open(res.data);
  565. }
  566. } else if (code == 2) {
  567. let item = this.bookList.find((v) => v.isbn === isbn);
  568. item.num = item.num + 1;
  569. if (res.data.canInvite == 1) {
  570. this.$refs.upsellRef.open(res.data);
  571. }
  572. } else {
  573. this.handleBookCode(res.data.code);
  574. }
  575. } else {
  576. uni.showToast({
  577. title: res.msg,
  578. icon: "none",
  579. });
  580. }
  581. });
  582. },
  583. //处理扫码之后不同的状态 0-扫码频繁 1-成功 2-本单已有该书,数量+1 3-没有该书 4-本书暂不回收 5-超过每单最大可卖数量 6-单个订单最多40本书
  584. handleBookCode(code) {
  585. if (code == 1) {
  586. this.bookList.push();
  587. }
  588. let tempKeys = [
  589. "tiredDialog",
  590. "",
  591. "",
  592. "noInfoDialog",
  593. "notAcceptDialog",
  594. "maxAcceptDialog",
  595. "orderMaxNumDialog",
  596. ];
  597. let key = tempKeys[code];
  598. if (key) {
  599. this.$refs[key].openPopup();
  600. }
  601. },
  602. //获取当前用户未提交订单 /api/token/order/lastOrder
  603. getLastOrder() {
  604. uni.$u.http.get("/token/order/lastOrder").then((res) => {
  605. if (res.code == 200) {
  606. this.orderInfo = res.data;
  607. if (res.data.showDialog == 1) {
  608. this.$refs.firstOrderFreePopup.openPopup();
  609. } else if (res.data.showDialog == 2) {
  610. this.$refs.kindReminder.openPopup();
  611. }
  612. this.bookList = res.data?.orderDetailList
  613. ? res.data.orderDetailList.map((v) => {
  614. v.orderId = res.data.orderId;
  615. return v;
  616. })
  617. : [];
  618. this.serviceList = res.data.serviceList || [];
  619. }
  620. });
  621. },
  622. goToScannedBooks() {
  623. uni.navigateTo({
  624. url: "/pages-home/pages/scaned-book",
  625. });
  626. },
  627. goToInputISBN() {
  628. this.$refs.isbnPopup.openPopup();
  629. },
  630. handleStartSelling() {
  631. // 标记已显示过温馨提示
  632. uni.setStorageSync("kindReminderShown", true);
  633. },
  634. },
  635. onShow() {
  636. // 获取上一个订单
  637. setTimeout(() => {
  638. let token = uni.getStorageSync("token");
  639. token && this.getLastOrder();
  640. }, 300);
  641. },
  642. };
  643. </script>
  644. <style lang="scss" scoped>
  645. .customer-service {
  646. position: fixed;
  647. width: 126rpx;
  648. height: 140rpx;
  649. bottom: 20%;
  650. z-index: 999;
  651. transition: all 0.3s ease;
  652. /* 添加过渡效果使吸附更平滑 */
  653. button {
  654. height: max-content;
  655. background-color: transparent;
  656. padding: 0;
  657. }
  658. }
  659. .container {
  660. height: 100%;
  661. position: relative;
  662. overflow: auto;
  663. z-index: 1;
  664. /* #ifdef MP-WEIXIN */
  665. min-height: 100vh;
  666. /* #endif */
  667. /* #ifndef MP-WEIXIN */
  668. min-height: calc(100vh - 120rpx);
  669. /* #endif */
  670. &.book-list {
  671. padding-bottom: 300rpx;
  672. }
  673. padding-bottom: 130rpx;
  674. .nav-title {
  675. font-family: PingFang SC;
  676. font-weight: bold;
  677. font-size: 34rpx;
  678. color: #ffffff;
  679. padding-left: 40rpx;
  680. }
  681. }
  682. .common-text {
  683. font-family: PingFang SC;
  684. font-weight: 500;
  685. font-size: 28rpx;
  686. color: #999999;
  687. &.tip {
  688. color: #ff8a4b;
  689. }
  690. }
  691. .color-red {
  692. color: #ff0000;
  693. margin: 0 10rpx;
  694. }
  695. .color-green {
  696. color: #276f1e;
  697. }
  698. .bottom-fixed {
  699. position: fixed;
  700. left: 0;
  701. right: 0;
  702. bottom: 0;
  703. z-index: 9;
  704. background-color: #ffffff;
  705. /* #ifdef H5 */
  706. padding-bottom: 120rpx;
  707. /* #endif */
  708. .btn-wrap {
  709. display: flex;
  710. gap: 20rpx;
  711. padding: 20rpx;
  712. padding-bottom: 0;
  713. button {
  714. flex: 1;
  715. height: 88rpx;
  716. border-radius: 10rpx;
  717. display: flex;
  718. align-items: center;
  719. justify-content: center;
  720. gap: 10rpx;
  721. border: none;
  722. text {
  723. font-size: 32rpx;
  724. }
  725. &::after {
  726. border: none;
  727. }
  728. }
  729. .isbn-btn {
  730. background-color: #ffffff;
  731. color: #4cd964;
  732. border: 3rpx solid #4cd964;
  733. }
  734. }
  735. .scan-btn {
  736. background-color: #4cd964;
  737. color: #ffffff;
  738. }
  739. .next-btn {
  740. margin: 0;
  741. margin-left: 20rpx;
  742. &[aria-disabled="true"] {
  743. background-color: #cccccc;
  744. color: #ffffff;
  745. opacity: 0.7;
  746. cursor: not-allowed;
  747. }
  748. }
  749. }
  750. </style>