index.vue 26 KB

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