Kaynağa Gözat

加价活动首页修改

ylong 7 ay önce
ebeveyn
işleme
df3cb5eae5

+ 1 - 1
.env.dev.js

@@ -1,5 +1,5 @@
 export default {
     "NODE_ENV": 'development',
-    "apiUrl":"https://bpi.shuhi.com",
+    "apiUrl":"https://bk.shuhi.com",
     "apiUrlPrefix":"/api",
 };

+ 115 - 14
pages/home/components/BookItem.vue

@@ -8,22 +8,25 @@
                 </view>
             </view>
             <view class="book-detail">
-                <view class="top-info">
-                    <view class="book-title">{{ book.bookName }}</view>
-
-                    <view class="book-tags">
-                        <text class="tzs tag-text" v-if="book.suit == 1">套装书</text>
-                        <text class="kmdb tag-text" v-if="book.maxNum > 1">可卖多本</text>
+                <view class="book-title">
+                    <view class="book-name">{{ book.bookName }}</view>
+                    <view class="book-price-labels">
+                        <view class="book-upsell has-upsell" v-if="book.currUpsellMoney > 0">已涨价{{ book.currUpsellMoney }}元</view>
+                        <view class="book-upsell enable-upsell" v-if="!book.currUpsellMoney && book.upsellMoney">
+                            可涨价{{ book.upsellMoney }}元
+                            <image src="/static/img/activity/up.png" mode="aspectFill" style="width: 16rpx; height: 16rpx;margin-left: 6rpx;" />
+                        </view>
                     </view>
                 </view>
 
-                <view class="flex flex-j-b flex-a-c">
-                    <view class="book-price"
-                        >回收价
-                        <text style="font-weight: 600; color: #ff0000; margin-left: 8rpx">
-                            ¥{{ recycleMoney }}</text
-                        ></view
-                    >
+                <view class="flex flex-j-b flex-a-c mb-10">
+                    <view class="top-info">
+                        <view class="book-tags">
+                            <text class="tzs tag-text" v-if="book.suit == 1">套装书</text>
+                            <text class="kmdb tag-text" v-if="book.maxNum > 1">可卖多本</text>
+                        </view>
+                    </view>
+
                     <u-number-box
                         class="number-box"
                         bg-color="#38c148"
@@ -37,6 +40,29 @@
                         :disabled="book.status != 1"
                     ></u-number-box>
                 </view>
+
+                <view class="flex flex-a-c" style="align-items: center;">
+                    <view class="book-price"
+                        >回收价
+                        <text style="font-weight: 600; color: #db0702; margin-left: 8rpx">
+                            ¥{{ recycleMoney }}</text
+                        ></view
+                    >
+                    <view class="price-action" style="margin-left: 20rpx;">
+                        <button class="up-price-btn" @tap="handleUpsell" v-if="book.canInvite === 1">去加价</button>
+                        <view class="countdown-wrap" v-if="book.restTime > 0">
+                            <text>加价剩余</text>
+                            <u-count-down
+                                :timestamp="book.restTime"
+                                format="HH:mm:ss"
+                                autoStart
+                                color="#db0702"
+                                separator-color="#db0702"
+                                @finish="onCountdownFinish"
+                            ></u-count-down>
+                        </view>
+                    </view>
+                </view>
             </view>
             <view class="delete-btn" @tap="onDelete">
                 <u-icon name="close" size="26" color="#999"></u-icon>
@@ -103,6 +129,12 @@ export default {
                     }
                 });
         },
+        handleUpsell() {
+            this.$emit("upsell", this.book);
+        },
+        onCountdownFinish() {
+            this.$emit("countdown-finish", this.book);
+        }
     },
 };
 </script>
@@ -185,16 +217,29 @@ export default {
 
             .book-title {
                 max-width: 400rpx;
+                margin-bottom: 10rpx;
+                display: flex;
+                align-items: center;
+            }
+            
+            .book-name {
                 font-size: 28rpx;
                 color: #333;
                 line-height: 1.4;
-                margin-bottom: 20rpx;
                 display: -webkit-box;
                 -webkit-box-orient: vertical;
                 -webkit-line-clamp: 2;
                 overflow: hidden;
                 font-family: Source Han Sans CN;
                 font-weight: bold;
+                word-break: break-all;
+                margin-right: 10rpx;
+            }
+
+            .book-price-labels {
+                display: flex;
+                margin-top: -2rpx;
+                flex-shrink: 0;
             }
 
             .book-price {
@@ -203,6 +248,62 @@ export default {
                 font-size: 24rpx;
                 color: #999999;
             }
+            
+            .price-action {
+                display: flex;
+                align-items: center;
+                
+                .up-price-btn {
+                    background-color: #38c148;
+                    color: #ffffff;
+                    font-size: 24rpx;
+                    height: 48rpx;
+                    line-height: 48rpx;
+                    padding: 0 20rpx;
+                    border-radius: 24rpx;
+                }
+                
+                .countdown-wrap {
+                    display: flex;
+                    align-items: center;
+                    font-size: 22rpx;
+                    color: #db0702;
+                    
+                    text {
+                        margin-right: 10rpx;
+                    }
+                    
+                    :v-deep .u-count-down {
+                        .u-count-down__text {
+                            color: #db0702;
+                            font-size: 20rpx;
+                        }
+                    }
+                }
+            }
+        }
+
+        .book-upsell {
+            font-size: 22rpx;
+            padding: 2rpx 10rpx;
+            border-radius: 4rpx;
+            margin-right: 10rpx;
+            display: inline-flex;
+            align-items: center;
+
+            &.has-upsell {
+                color: #276f1e;
+                background-color: #a8dda2;
+            }
+            
+            &.enable-upsell {
+                color: #ff0e11;
+                background-color: #ffe9eb;
+            }
+
+            .u-image {
+                margin-left: 4rpx;
+            }
         }
 
         .delete-btn {

+ 5 - 1
pages/home/components/ScanBookList.vue

@@ -8,7 +8,7 @@
 		<!-- 书籍列表 -->
 		<view class="book-list">
 			<BookItem v-for="(book,index) in bookList" :key="book.isbn" :book="book" @delete="handleDeleteBook"
-				@quantity-change="handleQuantityChange" />
+				@quantity-change="handleQuantityChange" @upsell="handleUpsell" />
 		</view>
 
 		<view class="link-wrap flex-a">
@@ -46,6 +46,10 @@
 			}
 		},
 		methods: {
+			// 加价
+			handleUpsell(book) {
+				this.$emit('upsell', book)
+			},
 			handleDeleteBook(book) {
 				uni.$u.http.post('/token/order/removeBook', {
 					orderId: book.orderId,

+ 252 - 0
pages/home/components/upsell-book.vue

@@ -0,0 +1,252 @@
+<template>
+  <u-popup v-model="showPopup" mode="center" border-radius="24" width="650rpx" bgColor="transparent">
+    <view class="popup-container">
+      <image src="/static/img/activity/bg2.png" class="bg-img"></image>
+      <view
+        class="content-container"
+        hover-class="none"
+        hover-stop-propagation="false"
+      >
+        <!-- 顶部黄色手掌图标和标题 -->
+        <view class="header">
+          <!-- <image src="/static/img/activity/hand.png" class="hand-icon"></image> -->
+          <view class="title-text">你真的太幸运了</view>
+          <view class="title-text">恭喜你获得限时加价权益</view>
+        </view>
+
+        <!-- 绿色价格信息区域 -->
+        <view class="price-section">
+          <view class="price-row">
+            <text class="price-label">此书预估书款</text>
+            <text class="price-value">¥ {{ bookInfo.recyclePrice }}</text>
+          </view>
+          <view class="price-row">
+            <text class="price-label">助力成功提升至</text>
+            <text class="price-value increased">¥ {{ upselledMoney }}</text>
+            <image
+              class="up-icon"
+              src="/static/img/activity/up2.png"
+              mode="widthFix"
+            ></image>
+          </view>
+          <view class="small-text"
+            >实际金额以最终审核书款为准,活动时间3/25至4/30</view
+          >
+        </view>
+
+        <!-- 分享助力区域 -->
+        <view class="share-section">
+          <view class="share-text">分享一位好友助力</view>
+          <view class="add-button">
+            <image
+              class="hand-icon"
+              src="/static/img/activity/invite.png"
+              mode="widthFix"
+            ></image>
+          </view>
+        </view>
+
+        <!-- 分享按钮 -->
+        <view class="action-buttons">
+          <u-button
+            type="primary"
+            class="share-button"
+            @click="shareAction"
+            open-type="share"
+            >立即分享</u-button
+          >
+          <u-button
+            :custom-style="{
+              marginTop: '20rpx',
+              color: '#09bb07',
+              borderColor: '#09bb07',
+            }"
+            plain
+            class="scan-button"
+            @click="scanAction"
+            >扫码助力</u-button
+          >
+        </view>
+      </view>
+
+      <!-- 关闭按钮 -->
+      <view class="close-button" @click="closePopup">
+        <image src="/static/img/activity/close2.png" mode="widthFix"></image>
+      </view>
+    </view>
+  </u-popup>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      showPopup: false,
+      bookInfo: {},
+    };
+  },
+  computed: {
+    upselledMoney() {
+      return (this.bookInfo.recyclePrice + this.bookInfo.upsellMoney).toFixed(2);
+    },
+  },
+  methods: {
+    open(data) {
+      this.bookInfo = data;
+      this.showPopup = true;
+    },
+    closePopup() {
+      this.showPopup = false;
+    },
+    shareAction() {
+      this.$emit("share");
+    },
+    scanAction() {
+      this.$emit("scan");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.popup-container {
+  position: relative;
+  padding: 30rpx;
+  box-sizing: border-box;
+  padding-bottom: 50rpx;
+  .bg-img {
+    position: absolute;
+    top: -0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 0;
+  }
+
+  .content-container {
+    position: relative;
+    z-index: 1;
+  }
+}
+
+.header {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 20rpx 0 10rpx;
+
+  .title-text {
+    font-size: 38rpx;
+    font-weight: bold;
+    color: #000;
+    margin-bottom: 10rpx;
+  }
+
+  .subtitle-text {
+    font-size: 32rpx;
+    color: #000;
+  }
+
+  .hand-icon {
+    width: 140rpx;
+    height: 140rpx;
+    position: relative;
+    top: -30rpx;
+  }
+}
+
+.price-section {
+  background-color: #09bb07;
+  border-radius: 16rpx;
+  padding: 20rpx 30rpx;
+  margin: 20rpx 0;
+
+  .price-row {
+    display: flex;
+    align-items: center;
+
+    .price-label {
+      color: #ffffff;
+      font-size: 30rpx;
+    }
+
+    .price-value {
+      color: #ffeb3b;
+      font-size: 30rpx;
+      font-weight: bold;
+      margin-left: 10rpx;
+    }
+
+    .increased {
+      font-size: 42rpx;
+    }
+
+    .up-icon {
+      width: 30rpx;
+      height: 30rpx;
+      margin-left: 5rpx;
+    }
+  }
+
+  .small-text {
+    color: #ffffff;
+    font-size: 22rpx;
+    margin-top: 10rpx;
+  }
+}
+
+.share-section {
+  background-color: #e8f8e8;
+  border-radius: 16rpx;
+  padding: 30rpx;
+  margin: 20rpx 0;
+
+  .share-text {
+    color: #09bb07;
+    font-size: 32rpx;
+    text-align: center;
+    margin-bottom: 30rpx;
+  }
+
+  .add-button {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+
+    .hand-icon {
+      width: 100rpx;
+      height: 100rpx;
+    }
+  }
+}
+
+.action-buttons {
+  margin-top: 30rpx;
+
+  .share-button {
+    height: 90rpx;
+    background-color: #09bb07 !important;
+    border-color: #09bb07 !important;
+    margin-bottom: 40rpx;
+    font-size: 32rpx;
+  }
+
+  .scan-button {
+    height: 90rpx;
+    font-size: 32rpx;
+  }
+}
+
+.close-button {
+  position: absolute;
+  bottom: -120rpx;
+  left: 50%;
+  transform: translateX(-50%);
+
+  image {
+    width: 70rpx;
+    height: 70rpx;
+  }
+}
+</style>

+ 111 - 0
pages/home/components/upsell-rules.vue

@@ -0,0 +1,111 @@
+<template>
+  <u-popup v-model="showPopup" mode="center" border-radius="24" width="650rpx">
+    <view class="rules-container">
+      <!-- 标题 -->
+      <view class="title-section">
+        <view class="title-line"></view>
+        <view class="title">活动规则</view>
+        <view class="title-line"></view>
+      </view>
+
+      <!-- 规则内容 -->
+      <view class="rules-content">
+        <view class="rule-item"
+          >1.活动时间:2025年3月25日至2025年4月30日。</view
+        >
+        <view class="rule-item"
+          >2.活动期间,用户扫描到活动书籍后有幸运机会成为助力"发起者",成功邀请1位好友进行助力,发起者参与活动的回收书籍,将根据书籍实际审核书款额外获得金额的助力收益。</view
+        >
+        <view class="rule-item"
+          >3.活动期间,每位用户24小时内有一次机会成为助力者。</view
+        >
+        <view class="rule-item">4.回收助力收益发放时间:</view>
+        <view class="rule-item"
+          >活动时间内,回收订单提交时,如果助力任务已完成则随订单审核完成结算收益,金额转入用户书嗨余额。</view
+        >
+        <view class="rule-item"
+          >活动时间内,回收订单提交时,如果助力任务未完成,则任务失败,不结算收益。</view
+        >
+        <view class="rule-item">活动结束前助力任务未完成,没有收益。</view>
+        <view class="rule-item"
+          >5.卖书的书款和助力收益将一起到账,可以在"我的-订单"中查看明细。</view
+        >
+      </view>
+
+      <!-- 底部按钮 -->
+      <u-button class="return-button" type="primary" @click="closePopup"
+        >返回活动</u-button
+      >
+    </view>
+  </u-popup>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      showPopup: false,
+    };
+  },
+  methods: {
+    open() {
+      this.showPopup = true;
+    },
+    closePopup() {
+      this.showPopup = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.rules-container {
+  background-color: #f1fef1;
+  padding: 30rpx;
+  border-radius: 24rpx;
+  position: relative;
+}
+
+.title-section {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-bottom: 30rpx;
+
+  .title-line {
+    width: 120rpx;
+    height: 2rpx;
+    background-color: #09bb07;
+  }
+
+  .title {
+    font-size: 38rpx;
+    font-weight: bold;
+    color: #09bb07;
+    margin: 0 20rpx;
+  }
+}
+
+.rules-content {
+  padding: 30rpx;
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  margin-bottom: 30rpx;
+
+  .rule-item {
+    font-size: 28rpx;
+    color: #333;
+    line-height: 40rpx;
+    margin-bottom: 10rpx;
+  }
+}
+
+.return-button {
+  height: 90rpx;
+  background-color: #09bb07 !important;
+  border-color: #09bb07 !important;
+  font-size: 32rpx;
+  border-radius: 100rpx;
+  margin-top: 10rpx;
+}
+</style>

+ 143 - 0
pages/home/components/upsell-share.vue

@@ -0,0 +1,143 @@
+<template>
+  <u-popup v-model="showPopup" mode="center" border-radius="24" width="540rpx">
+    <view class="share-container">
+      <!-- 标题 -->
+      <view class="title-text">
+        <view>好友邀您助力</view>
+        <view>提升卖书收入</view>
+      </view>
+      
+      <!-- 活动规则按钮 -->
+      <view class="rules-button-container">
+        <u-button class="rules-button" :custom-style="rulesButtonStyle" @click="viewRules">查看活动规则</u-button>
+      </view>
+      
+      <!-- 用户信息区域 -->
+      <view class="user-info">
+        <view class="avatar-container">
+          <u-avatar :src="avatarUrl" size="140"></u-avatar>
+        </view>
+        <view class="username">{{username}}</view>
+      </view>
+      
+      <!-- 助力按钮 -->
+      <u-button class="help-button" type="primary" :custom-style="helpButtonStyle" @click="handleHelp">点击助力</u-button>
+    </view>
+  </u-popup>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      showPopup: false,
+      avatarUrl: '', // 用户头像URL
+      username: '孙***', // 用户名,带星号
+      // 自定义按钮样式
+      rulesButtonStyle: {
+        backgroundColor: '#4CD964',
+        color: '#FFFFFF',
+        fontSize: '28rpx',
+        width: '280rpx',
+        height: '80rpx',
+        borderRadius: '40rpx'
+      },
+      helpButtonStyle: {
+        backgroundColor: '#4CD964',
+        color: '#FFFFFF',
+        fontSize: '32rpx',
+        width: '100%',
+        height: '100rpx',
+        borderRadius: '50rpx',
+        border: 'none'
+      }
+    };
+  },
+  methods: {
+    open(avatarUrl = '', username = '孙***') {
+      this.avatarUrl = avatarUrl;
+      this.username = username;
+      this.showPopup = true;
+    },
+    close() {
+      this.showPopup = false;
+    },
+    viewRules() {
+      // 打开活动规则弹窗
+      this.$emit('view-rules');
+      this.close();
+    },
+    handleHelp() {
+      // 处理助力逻辑
+      this.$emit('help');
+      this.close();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.share-container {
+  background: linear-gradient(180deg, #e9ffe9 0%, #f7fff7 100%);
+  padding: 40rpx 30rpx;
+  border-radius: 24rpx;
+  text-align: center;
+}
+
+.title-text {
+  font-size: 40rpx;
+  font-weight: bold;
+  color: #000;
+  line-height: 60rpx;
+  margin-bottom: 20rpx;
+}
+
+.rules-button-container {
+  display: flex;
+  justify-content: center;
+  margin: 20rpx 0 40rpx;
+  
+  .rules-button {
+    position: relative;
+    
+    &::before, &::after {
+      content: '';
+      position: absolute;
+      top: 50%;
+      width: 80rpx;
+      height: 2rpx;
+      background-color: #4CD964;
+    }
+    
+    &::before {
+      left: -90rpx;
+    }
+    
+    &::after {
+      right: -90rpx;
+    }
+  }
+}
+
+.user-info {
+  margin-bottom: 40rpx;
+  
+  .avatar-container {
+    margin: 0 auto 20rpx;
+    width: 140rpx;
+    height: 140rpx;
+    border-radius: 50%;
+    overflow: hidden;
+  }
+  
+  .username {
+    font-size: 32rpx;
+    color: #333;
+    margin-top: 10rpx;
+  }
+}
+
+.help-button {
+  margin-top: 20rpx;
+}
+</style>

+ 676 - 565
pages/home/index.vue

@@ -1,572 +1,683 @@
 <template>
-	<view class="container" :style="{ background: containerBg }" :class="bookList.length ? 'book-list' : 'no-list'">
-		<u-navbar :is-back="false" :border-bottom="false" :background="{ background: navbarBackground }">
-			<text class="nav-title">卖书给书嗨</text>
-		</u-navbar>
-
-		<not-scanned v-if="!bookList.length"></not-scanned>
-		<scan-book-list v-else @updateBooks="updateBooksList" @deleted="getLastOrder" :bookList="bookList"
-			ref="scanBookList"></scan-book-list>
-		<!-- 底部固定按钮 -->
-		<view class="bottom-fixed">
-			<view class="btn-wrap mb-20">
-				<button class="scan-btn flex-1" @click="handleScan">
-					<u-icon name="scan" color="#FFFFFF" size="40"></u-icon>
-					<text>扫码卖书</text>
-				</button>
-				<button class="isbn-btn flex-1" @click="goToInputISBN">
-					<u-icon name="edit-pen" color="#4CD964" size="40"></u-icon>
-					<text>输入ISBN</text>
-				</button>
-			</view>
-
-			<view class="flex-a flex-j-b pad-20" style="padding-top: 0" v-if="bookList.length">
-				<view class="left-info" style="min-width: 194px">
-					<view class="flex-a common-text">
-						共<text class="color-red">{{ totalBooks }}</text>件 预估回收价 <text
-							class="color-red">¥{{ totalPrice || 0 }}</text>
-					</view>
-					<text class="common-text tip">*旧书预估价格满 {{ orderInfo.minOrderMoney }} 元起收</text>
-				</view>
-
-				<button class="scan-btn next-btn" @click="onNext" :disabled="isDisabled">下一步</button>
-			</view>
-
-			<service-info v-if="bookList.length" :serviceList="serviceList"
-				:firstOrder="orderInfo.firstOrder"></service-info>
-		</view>
-
-		<InputIsbn ref="isbnPopup" @submit="checkBookISBN" />
-		<!-- 套装书说明弹窗 -->
-		<CommonDialog ref="setBookDialog" title="套装书说明" :showCancel="false" @confirm="handleSetBookConfirm">
-			<text>套装书(ISBN码相同的系列书箱)只需扫描其中一册,扫码价即套装价。打包时请把所有单册统在一起或放在一个袋子里寄出。</text>
-		</CommonDialog>
-
-		<!-- 暂不回收弹窗 -->
-		<CommonDialog ref="notAcceptDialog" title="暂不回收" :showCancel="false">
-			<text>这本书暂时不回收,请您过段时间再来试试~</text>
-		</CommonDialog>
-
-		<!-- 暂无信息弹窗 -->
-		<CommonDialog ref="noInfoDialog" title="暂无信息" :showCancel="false">
-			<text>抱歉,没有该书的信息,书嗨会定期补充图书信息,请您过段时间再来试试~</text>
-		</CommonDialog>
-
-		<!-- 扫累了弹窗 -->
-		<CommonDialog ref="tiredDialog" title="温馨提示" :showCancel="false">
-			<text>扫累了,休息休息吧~</text>
-		</CommonDialog>
-
-		<!-- 该书超出最大回收本数  maxAcceptDialog-->
-		<CommonDialog ref="maxAcceptDialog" title="温馨提示" :showCancel="false">
-			<text>该书超出最大回收本数</text>
-		</CommonDialog>
-
-		<!-- 单个订单最多40本书  orderMaxNumDialog-->
-		<CommonDialog ref="orderMaxNumDialog" title="温馨提示" :showCancel="false">
-			<text>单个订单最多40本书</text>
-		</CommonDialog>
-
-		<!-- 温馨提示弹窗 -->
-		<KindReminder ref="kindReminder" @start="handleStartSelling" @viewRules="handleViewRules" />
-
-		<view class="customer-service"
-			:style="{ left: servicePosition.left + 'px', right: servicePosition.right + 'px', bottom: servicePosition.bottom + 'px' }"
-			@touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd">
-			<button class="service-btn" open-type="contact">
-				<image src="/static/img/kf.png" mode="widthFix" style="width: 126rpx; height: 140rpx"></image>
-			</button>
-		</view>
-
-		<ConfirmBooks ref="confirmBooks" @incomplete="handleIncomplete" />
-		<!-- 首单免费弹窗 -->
-		<FirstOrderFreePopup ref="firstOrderFreePopup" />
-	</view>
+  <view
+    class="container"
+    :style="{ background: containerBg }"
+    :class="bookList.length ? 'book-list' : 'no-list'"
+  >
+    <u-navbar
+      :is-back="false"
+      :border-bottom="false"
+      :background="{ background: navbarBackground }"
+    >
+      <text class="nav-title">卖书给书嗨</text>
+    </u-navbar>
+
+    <not-scanned v-if="!bookList.length"></not-scanned>
+    <scan-book-list
+      v-else
+      @updateBooks="updateBooksList"
+      @deleted="getLastOrder"
+      :bookList="bookList"
+      ref="scanBookList"
+      @upsell="handleUpsell"
+    ></scan-book-list>
+    <!-- 底部固定按钮 -->
+    <view class="bottom-fixed">
+      <view class="btn-wrap mb-20">
+        <button class="scan-btn flex-1" @click="handleScan">
+          <u-icon name="scan" color="#FFFFFF" size="40"></u-icon>
+          <text>扫码卖书</text>
+        </button>
+        <button class="isbn-btn flex-1" @click="goToInputISBN">
+          <u-icon name="edit-pen" color="#4CD964" size="40"></u-icon>
+          <text>输入ISBN</text>
+        </button>
+      </view>
+
+      <view
+        class="flex-a flex-j-b pad-20"
+        style="padding-top: 0"
+        v-if="bookList.length"
+      >
+        <view class="left-info" style="min-width: 194px">
+          <view class="flex-a common-text">
+            共<text class="color-red">{{ totalBooks }}</text
+            >件 预估回收价 <text class="color-red">¥{{ totalPrice || 0 }}</text>
+          </view>
+          <text class="common-text tip"
+            >*旧书预估价格满 {{ orderInfo.minOrderMoney }} 元起收</text
+          >
+        </view>
+
+        <button
+          class="scan-btn next-btn"
+          @click="onNext"
+          :disabled="isDisabled"
+        >
+          下一步
+        </button>
+      </view>
+
+      <service-info
+        v-if="bookList.length"
+        :serviceList="serviceList"
+        :firstOrder="orderInfo.firstOrder"
+      ></service-info>
+    </view>
+
+    <InputIsbn ref="isbnPopup" @submit="checkBookISBN" />
+    <!-- 套装书说明弹窗 -->
+    <CommonDialog
+      ref="setBookDialog"
+      title="套装书说明"
+      :showCancel="false"
+      @confirm="handleSetBookConfirm"
+    >
+      <text
+        >套装书(ISBN码相同的系列书箱)只需扫描其中一册,扫码价即套装价。打包时请把所有单册统在一起或放在一个袋子里寄出。</text
+      >
+    </CommonDialog>
+
+    <!-- 暂不回收弹窗 -->
+    <CommonDialog ref="notAcceptDialog" title="暂不回收" :showCancel="false">
+      <text>这本书暂时不回收,请您过段时间再来试试~</text>
+    </CommonDialog>
+
+    <!-- 暂无信息弹窗 -->
+    <CommonDialog ref="noInfoDialog" title="暂无信息" :showCancel="false">
+      <text
+        >抱歉,没有该书的信息,书嗨会定期补充图书信息,请您过段时间再来试试~</text
+      >
+    </CommonDialog>
+
+    <!-- 扫累了弹窗 -->
+    <CommonDialog ref="tiredDialog" title="温馨提示" :showCancel="false">
+      <text>扫累了,休息休息吧~</text>
+    </CommonDialog>
+
+    <!-- 该书超出最大回收本数  maxAcceptDialog-->
+    <CommonDialog ref="maxAcceptDialog" title="温馨提示" :showCancel="false">
+      <text>该书超出最大回收本数</text>
+    </CommonDialog>
+
+    <!-- 单个订单最多40本书  orderMaxNumDialog-->
+    <CommonDialog ref="orderMaxNumDialog" title="温馨提示" :showCancel="false">
+      <text>单个订单最多40本书</text>
+    </CommonDialog>
+
+    <!-- 温馨提示弹窗 -->
+    <KindReminder
+      ref="kindReminder"
+      @start="handleStartSelling"
+      @viewRules="handleViewRules"
+    />
+
+    <view
+      class="customer-service"
+      :style="{
+        left: servicePosition.left + 'px',
+        right: servicePosition.right + 'px',
+        bottom: servicePosition.bottom + 'px',
+      }"
+      @touchstart="touchStart"
+      @touchmove="touchMove"
+      @touchend="touchEnd"
+    >
+      <button class="service-btn" open-type="contact">
+        <image
+          src="/static/img/kf.png"
+          mode="widthFix"
+          style="width: 126rpx; height: 140rpx"
+        ></image>
+      </button>
+    </view>
+
+    <ConfirmBooks ref="confirmBooks" @incomplete="handleIncomplete" />
+    <!-- 首单免费弹窗 -->
+    <FirstOrderFreePopup ref="firstOrderFreePopup" />
+
+    <!-- 图书加价弹窗 -->
+    <UpsellBook ref="upsellRef" />
+    <!-- 加价规则弹窗 -->
+    <UpsellRules ref="upsellRulesRef" />
+    <!-- 加价分享弹窗 -->
+    <UpsellShare ref="shareRef" @viewRules="handleViewSellRules" />
+  </view>
 </template>
 
 <script>
-	import notScanned from "./components/notScanned.vue";
-	import InputIsbn from "./components/InputIsbn.vue";
-	import ScanBookList from "./components/ScanBookList.vue";
-	import CommonDialog from "@/components/common-dialog.vue";
-	import KindReminder from "./components/KindReminder.vue";
-	import ServiceInfo from "./components/ServiceInfo.vue";
-	import ConfirmBooks from "./components/ConfirmBooks.vue";
-	import FirstOrderFreePopup from "./components/FirstOrderFreePopup.vue";
-	export default {
-		components: {
-			notScanned,
-			InputIsbn,
-			ScanBookList,
-			CommonDialog,
-			KindReminder,
-			ServiceInfo,
-			ConfirmBooks,
-			FirstOrderFreePopup,
-		},
-		data() {
-			return {
-				orderInfo: {},
-				collapseState: {
-					step1: false,
-					step3: false,
-				},
-				scrollTop: 0,
-				bookList: [],
-				serviceList: [],
-				currentBook: {},
-				// 客服按钮位置
-				servicePosition: {
-					left: 'auto',
-					right: 0,
-					bottom: '20%'
-				},
-				// 触摸开始位置
-				startX: 0,
-				startY: 0,
-				// 屏幕宽度和高度
-				screenWidth: 0,
-				screenHeight: 0,
-				// 初始位置记录,用于计算拖动
-				initialLeft: 0,
-				initialBottom: 0,
-				// 是否正在更新位置,用于防止频繁更新
-				isUpdatingPosition: false,
-			};
-		},
-		computed: {
-			navbarBackground() {
-				if (this.scrollTop > 0) {
-					return "linear-gradient(180deg, #4CD964 0%, #5ff178 100%)";
-				}
-				return "transparent";
-			},
-			containerBg() {
-				return this.bookList.length > 0 ?
-					"linear-gradient(180deg, #4CD964 0%, #F8F8F8 25%)" :
-					"linear-gradient(180deg, #4CD964 0%, #ffffff 25%)";
-			},
-			containerPb() {
-				return this.bookList.length > 0 ? "300rpx" : "110rpx";
-			},
-			totalBooks() {
-				return this.bookList.reduce((sum, book) => sum + (book.num || 1), 0);
-			},
-			totalPrice() {
-				return this.bookList.reduce((sum, book) => sum + book.recyclePrice * (book.num || 1), 0).toFixed(2);
-			},
-			isDisabled() {
-				return this.totalPrice < this.orderInfo.minOrderMoney;
-			},
-		},
-		onPageScroll(e) {
-			this.$nextTick(() => {
-				this.scrollTop = e.scrollTop;
-			});
-		},
-		onReady() {
-			// 获取屏幕宽度和高度
-			uni.getSystemInfo({
-				success: (res) => {
-					this.screenWidth = res.windowWidth;
-					this.screenHeight = res.windowHeight;
-				}
-			});
-		},
-		methods: {
-			slientLogin() {
-				let inviteCode = wx.getStorageSync('inviteCode') || ''
-				let token = wx.getStorageSync('token')
-				if (token) return;
-				uni.login({
-					success(res) {
-						uni.$u.http
-							.post("/user/wxLogin", {
-								code: res.code,
-								inviteCode,
-							})
-							.then((response) => {
-								if (response.code == 200) {
-									uni.setStorageSync("token", response.data.token);
-								}
-							});
-					},
-					fail: (err) => {
-						console.log(err, "wx.login登录失败");
-					},
-				});
-			},
-			// 触摸开始
-			touchStart(e) {
-				const touch = e.touches[0];
-				this.startX = touch.clientX;
-				this.startY = touch.clientY;
-
-				// 记录初始位置,用于计算移动距离
-				if (this.servicePosition.right !== 'auto') {
-					// 如果是靠右定位,记录当前位置但不立即改变显示位置
-					// 只在内部计算中使用,避免视觉上的位置跳动
-					this.initialLeft = this.screenWidth - 126;
-				} else {
-					this.initialLeft = parseFloat(this.servicePosition.left);
-				}
-
-				// 如果bottom是百分比,转换为具体像素值,但不改变显示位置
-				if (typeof this.servicePosition.bottom === 'string' && this.servicePosition.bottom.includes('%')) {
-					const percentage = parseFloat(this.servicePosition.bottom) / 100;
-					this.initialBottom = this.screenHeight * percentage;
-				} else {
-					this.initialBottom = parseFloat(this.servicePosition.bottom);
-				}
-			},
-
-			// 触摸移动
-			touchMove(e) {
-				// 阻止默认行为,防止页面滚动
-				e.preventDefault && e.preventDefault();
-				e.stopPropagation && e.stopPropagation();
-
-				const touch = e.touches[0];
-
-				// 计算移动距离
-				const deltaX = touch.clientX - this.startX;
-				const deltaY = touch.clientY - this.startY;
-
-				// 使用初始位置计算新位置,避免累积误差
-				let newLeft = this.initialLeft + deltaX;
-				let newBottom = this.initialBottom - deltaY; // 注意:y轴方向是相反的
-
-				// 确保按钮不超出屏幕边界
-				if (newLeft < 0) {
-					newLeft = 0;
-				} else if (newLeft > this.screenWidth - 126) {
-					newLeft = this.screenWidth - 126;
-				}
-
-				// 确保按钮不超出屏幕垂直边界
-				if (newBottom < 20) {
-					newBottom = 20;
-				} else if (newBottom > this.screenHeight - 160) {
-					newBottom = this.screenHeight - 160;
-				}
-
-				// 使用节流方式更新位置,避免过于频繁的更新
-				if (!this.isUpdatingPosition) {
-					this.isUpdatingPosition = true;
-
-					// 更新位置 - 第一次移动时才真正改变right为auto
-					this.servicePosition = {
-						left: newLeft,
-						right: 'auto',
-						bottom: newBottom
-					};
-
-					// 使用setTimeout代替requestAnimationFrame,在微信小程序中更兼容
-					setTimeout(() => {
-						this.isUpdatingPosition = false;
-					}, 16); // 约等于60fps的刷新率
-				}
-
-				// 不更新起始点,保持相对于初始触摸点的位移计算
-				// 这样可以避免累积误差,使拖动更精确
-			},
-
-			// 触摸结束,实现吸附效果
-			touchEnd() {
-				// 确保不再有待处理的更新
-				this.isUpdatingPosition = false;
-
-				const buttonCenter = this.servicePosition.left + 63; // 按钮中心位置
-				const halfScreen = this.screenWidth / 2;
-
-				// 判断是吸附到左边还是右边
-				if (buttonCenter < halfScreen) {
-					// 吸附到左边
-					this.servicePosition = {
-						left: 0,
-						right: 'auto',
-						bottom: this.servicePosition.bottom
-					};
-				} else {
-					// 吸附到右边
-					this.servicePosition = {
-						left: 'auto',
-						right: 0,
-						bottom: this.servicePosition.bottom
-					};
-				}
-			},
-
-			handleStart() {
-				this.showPopup = true;
-			},
-			//套装书确认
-			handleSetBookConfirm() {
-				this.$refs.confirmBooks.openPopup(this.currentBook);
-			},
-			//书册补全
-			handleIncomplete() {
-				this.$refs.scanBookList.handleDeleteBook(this.currentBook);
-			},
-
-			//提交
-			onNext() {
-				let orderId = this.orderInfo.orderId;
-				//预提交
-				uni.$u.http.get("/token/order/preSubmit?orderId=" + orderId).then((res) => {
-					if (res.code == 200) {
-						if (res.data.code == 1 || res.data.code == 2) {
-							uni.navigateTo({
-								url: "/pages-home/pages/book-order",
-							});
-							uni.setStorageSync("orderId", orderId);
-						} else {
-							uni.showToast({
-								icon: "none",
-								title: res.msg,
-							});
-						}
-					} else {
-						uni.showToast({
-							icon: "none",
-							title: res.msg,
-						});
-					}
-				});
-			},
-
-			updateBooksList(data) {
-				this.bookList = data;
-			},
-
-			toggleCollapse(step) {
-				this.$set(this.collapseState, step, !this.collapseState[step]);
-			},
-			handleScan() {
-				uni.scanCode({
-					scanType: ["barCode"],
-					success: (res) => {
-						this.checkBookISBN(res.result);
-					},
-					fail: () => {
-						uni.showToast({
-							title: "扫码失败",
-							icon: "none",
-						});
-					},
-				});
-			},
-			checkBookISBN(isbn) {
-				uni.$u.http.get("/token/order/scanIsbn?isbn=" + isbn).then((res) => {
-					if (res.code == 200) {
-						let code = res.data.code;
-						if (code == 1) {
-							res.data.num = 1;
-							res.data.status = 1;
-							res.data.recyclePrice = res.data.recycleMoney;
-							this.currentBook = res.data;
-							this.bookList.push(res.data);
-							if (res.data.suit == 1) {
-								this.$refs.setBookDialog.openPopup();
-							}
-						} else if (code == 2) {
-							let item = this.bookList.find((v) => v.isbn === isbn);
-							item.num = item.num + 1;
-						} else {
-							this.handleBookCode(res.data.code);
-						}
-					} else {
-						uni.showToast({
-							title: res.msg,
-							icon: "none",
-						});
-					}
-				});
-			},
-			//处理扫码之后不同的状态 0-扫码频繁 1-成功 2-本单已有该书,数量+1  3-没有该书 4-本书暂不回收 5-超过每单最大可卖数量  6-单个订单最多40本书
-			handleBookCode(code) {
-				if (code == 1) {
-					this.bookList.push();
-				}
-				let tempKeys = [
-					"tiredDialog",
-					"",
-					"",
-					"noInfoDialog",
-					"notAcceptDialog",
-					"maxAcceptDialog",
-					"orderMaxNumDialog",
-				];
-				let key = tempKeys[code];
-				if (key) {
-					this.$refs[key].openPopup();
-				}
-			},
-			//获取当前用户未提交订单 /api/token/order/lastOrder
-			getLastOrder() {
-				uni.$u.http.get("/token/order/lastOrder").then((res) => {
-					if (res.code == 200) {
-						this.orderInfo = res.data;
-						if (res.data.showDialog == 1) {
-							this.$refs.firstOrderFreePopup.openPopup();
-						} else if (res.data.showDialog == 2) {
-							this.$refs.kindReminder.openPopup();
-						}
-
-						this.bookList = res.data?.orderDetailList ?
-							res.data.orderDetailList.map((v) => {
-								v.orderId = res.data.orderId;
-								return v;
-							}) : [];
-						this.serviceList = res.data.serviceList || [];
-					}
-				});
-			},
-
-			goToScannedBooks() {
-				uni.navigateTo({
-					url: "/pages-home/pages/scaned-book",
-				});
-			},
-			goToInputISBN() {
-				this.$refs.isbnPopup.openPopup();
-			},
-			handleStartSelling() {
-				// 标记已显示过温馨提示
-				uni.setStorageSync("kindReminderShown", true);
-			},
-		},
-
-		onShow() {
-			// 获取上一个订单
-			setTimeout(() => {
-				this.getLastOrder();
-				setTimeout(() => {
-					this.slientLogin()
-				}, 10)
-			}, 300);
-		},
-	};
+import notScanned from "./components/notScanned.vue";
+import InputIsbn from "./components/InputIsbn.vue";
+import ScanBookList from "./components/ScanBookList.vue";
+import CommonDialog from "@/components/common-dialog.vue";
+import KindReminder from "./components/KindReminder.vue";
+import ServiceInfo from "./components/ServiceInfo.vue";
+import ConfirmBooks from "./components/ConfirmBooks.vue";
+import FirstOrderFreePopup from "./components/FirstOrderFreePopup.vue";
+import UpsellBook from "./components/upsell-book.vue";
+import UpsellRules from "./components/upsell-rules.vue";
+import UpsellShare from "./components/upsell-share.vue";
+export default {
+  components: {
+    notScanned,
+    InputIsbn,
+    ScanBookList,
+    CommonDialog,
+    KindReminder,
+    ServiceInfo,
+    ConfirmBooks,
+    FirstOrderFreePopup,
+    UpsellBook,
+    UpsellRules,
+    UpsellShare,
+  },
+  data() {
+    return {
+      orderInfo: {},
+      collapseState: {
+        step1: false,
+        step3: false,
+      },
+      scrollTop: 0,
+      bookList: [],
+      serviceList: [],
+      currentBook: {},
+      // 客服按钮位置
+      servicePosition: {
+        left: "auto",
+        right: 0,
+        bottom: "20%",
+      },
+      // 触摸开始位置
+      startX: 0,
+      startY: 0,
+      // 屏幕宽度和高度
+      screenWidth: 0,
+      screenHeight: 0,
+      // 初始位置记录,用于计算拖动
+      initialLeft: 0,
+      initialBottom: 0,
+      // 是否正在更新位置,用于防止频繁更新
+      isUpdatingPosition: false,
+    };
+  },
+  computed: {
+    navbarBackground() {
+      if (this.scrollTop > 0) {
+        return "linear-gradient(180deg, #4CD964 0%, #5ff178 100%)";
+      }
+      return "transparent";
+    },
+    containerBg() {
+      return this.bookList.length > 0
+        ? "linear-gradient(180deg, #4CD964 0%, #F8F8F8 25%)"
+        : "linear-gradient(180deg, #4CD964 0%, #ffffff 25%)";
+    },
+    containerPb() {
+      return this.bookList.length > 0 ? "300rpx" : "110rpx";
+    },
+    totalBooks() {
+      return this.bookList.reduce((sum, book) => sum + (book.num || 1), 0);
+    },
+    totalPrice() {
+      return this.bookList
+        .reduce((sum, book) => sum + book.recyclePrice * (book.num || 1), 0)
+        .toFixed(2);
+    },
+    isDisabled() {
+      return this.totalPrice < this.orderInfo.minOrderMoney;
+    },
+  },
+  onPageScroll(e) {
+    this.$nextTick(() => {
+      this.scrollTop = e.scrollTop;
+    });
+  },
+  // 分享配置
+  onShareAppMessage() {
+    let userInfo = uni.getStorageSync("userInfo");
+    let userId = userInfo.userId;
+    return {
+      title: "书嗨",
+      path: "/pages/home/index?inviteCode=" + userId,
+      imageUrl: "/static/img/activity/share.jpg",
+    };
+  },
+
+  // 分享到朋友圈
+  onShareTimeline() {
+    let userInfo = uni.getStorageSync("userInfo");
+    let userId = userInfo.userId;
+    return {
+      title: "书嗨",
+      path: "/pages/home/index?inviteCode=" + userId,
+      imageUrl: "/static/img/activity/share.jpg",
+    };
+  },
+  onReady() {
+    // 获取屏幕宽度和高度
+    uni.getSystemInfo({
+      success: (res) => {
+        this.screenWidth = res.windowWidth;
+        this.screenHeight = res.windowHeight;
+      },
+    });
+
+    this.$refs.shareRef.open();
+  },
+  methods: {
+    slientLogin() {
+      let inviteCode = wx.getStorageSync("inviteCode") || "";
+      let token = wx.getStorageSync("token");
+      if (token) return;
+      uni.login({
+        success(res) {
+          uni.$u.http
+            .post("/user/wxLogin", {
+              code: res.code,
+              inviteCode,
+            })
+            .then((response) => {
+              if (response.code == 200) {
+                uni.setStorageSync("token", response.data.token);
+              }
+            });
+        },
+        fail: (err) => {
+          console.log(err, "wx.login登录失败");
+        },
+      });
+    },
+
+    //查看活动规则
+    handleViewSellRules() {
+      this.$refs.upsellRulesRef.open();
+    },
+
+    // 触摸开始
+    touchStart(e) {
+      const touch = e.touches[0];
+      this.startX = touch.clientX;
+      this.startY = touch.clientY;
+
+      // 记录初始位置,用于计算移动距离
+      if (this.servicePosition.right !== "auto") {
+        // 如果是靠右定位,记录当前位置但不立即改变显示位置
+        // 只在内部计算中使用,避免视觉上的位置跳动
+        this.initialLeft = this.screenWidth - 126;
+      } else {
+        this.initialLeft = parseFloat(this.servicePosition.left);
+      }
+
+      // 如果bottom是百分比,转换为具体像素值,但不改变显示位置
+      if (
+        typeof this.servicePosition.bottom === "string" &&
+        this.servicePosition.bottom.includes("%")
+      ) {
+        const percentage = parseFloat(this.servicePosition.bottom) / 100;
+        this.initialBottom = this.screenHeight * percentage;
+      } else {
+        this.initialBottom = parseFloat(this.servicePosition.bottom);
+      }
+    },
+
+    // 触摸移动
+    touchMove(e) {
+      // 阻止默认行为,防止页面滚动
+      e.preventDefault && e.preventDefault();
+      e.stopPropagation && e.stopPropagation();
+
+      const touch = e.touches[0];
+
+      // 计算移动距离
+      const deltaX = touch.clientX - this.startX;
+      const deltaY = touch.clientY - this.startY;
+
+      // 使用初始位置计算新位置,避免累积误差
+      let newLeft = this.initialLeft + deltaX;
+      let newBottom = this.initialBottom - deltaY; // 注意:y轴方向是相反的
+
+      // 确保按钮不超出屏幕边界
+      if (newLeft < 0) {
+        newLeft = 0;
+      } else if (newLeft > this.screenWidth - 126) {
+        newLeft = this.screenWidth - 126;
+      }
+
+      // 确保按钮不超出屏幕垂直边界
+      if (newBottom < 20) {
+        newBottom = 20;
+      } else if (newBottom > this.screenHeight - 160) {
+        newBottom = this.screenHeight - 160;
+      }
+
+      // 使用节流方式更新位置,避免过于频繁的更新
+      if (!this.isUpdatingPosition) {
+        this.isUpdatingPosition = true;
+
+        // 更新位置 - 第一次移动时才真正改变right为auto
+        this.servicePosition = {
+          left: newLeft,
+          right: "auto",
+          bottom: newBottom,
+        };
+
+        // 使用setTimeout代替requestAnimationFrame,在微信小程序中更兼容
+        setTimeout(() => {
+          this.isUpdatingPosition = false;
+        }, 16); // 约等于60fps的刷新率
+      }
+
+      // 不更新起始点,保持相对于初始触摸点的位移计算
+      // 这样可以避免累积误差,使拖动更精确
+    },
+
+    // 触摸结束,实现吸附效果
+    touchEnd() {
+      // 确保不再有待处理的更新
+      this.isUpdatingPosition = false;
+
+      const buttonCenter = this.servicePosition.left + 63; // 按钮中心位置
+      const halfScreen = this.screenWidth / 2;
+
+      // 判断是吸附到左边还是右边
+      if (buttonCenter < halfScreen) {
+        // 吸附到左边
+        this.servicePosition = {
+          left: 0,
+          right: "auto",
+          bottom: this.servicePosition.bottom,
+        };
+      } else {
+        // 吸附到右边
+        this.servicePosition = {
+          left: "auto",
+          right: 0,
+          bottom: this.servicePosition.bottom,
+        };
+      }
+    },
+
+    handleStart() {
+      this.showPopup = true;
+    },
+    //套装书确认
+    handleSetBookConfirm() {
+      this.$refs.confirmBooks.openPopup(this.currentBook);
+    },
+    //书册补全
+    handleIncomplete() {
+      this.$refs.scanBookList.handleDeleteBook(this.currentBook);
+    },
+
+    //提交
+    onNext() {
+      let orderId = this.orderInfo.orderId;
+      //预提交
+      uni.$u.http
+        .get("/token/order/preSubmit?orderId=" + orderId)
+        .then((res) => {
+          if (res.code == 200) {
+            if (res.data.code == 1 || res.data.code == 2) {
+              uni.navigateTo({
+                url: "/pages-home/pages/book-order",
+              });
+              uni.setStorageSync("orderId", orderId);
+            } else {
+              uni.showToast({
+                icon: "none",
+                title: res.msg,
+              });
+            }
+          } else {
+            uni.showToast({
+              icon: "none",
+              title: res.msg,
+            });
+          }
+        });
+    },
+    // 加价
+    handleUpsell(book) {
+      this.$refs.upsellRef.open(book);
+    },
+
+    updateBooksList(data) {
+      this.bookList = data;
+    },
+
+    toggleCollapse(step) {
+      this.$set(this.collapseState, step, !this.collapseState[step]);
+    },
+    handleScan() {
+      uni.scanCode({
+        scanType: ["barCode"],
+        success: (res) => {
+          this.checkBookISBN(res.result);
+        },
+        fail: () => {
+          uni.showToast({
+            title: "扫码失败",
+            icon: "none",
+          });
+        },
+      });
+    },
+    checkBookISBN(isbn) {
+      uni.$u.http.get("/token/order/scanIsbn?isbn=" + isbn).then((res) => {
+        if (res.code == 200) {
+          let code = res.data.code;
+          if (code == 1) {
+            res.data.num = 1;
+            res.data.status = 1;
+            res.data.recyclePrice = res.data.recycleMoney;
+            this.currentBook = res.data;
+            this.bookList.unshift(res.data);
+            if (res.data.suit == 1) {
+              this.$refs.setBookDialog.openPopup();
+            }
+            if (res.data.canInvite == 1) {
+              this.$refs.upsellRef.open(res.data);
+            }
+          } else if (code == 2) {
+            let item = this.bookList.find((v) => v.isbn === isbn);
+            item.num = item.num + 1;
+          } else {
+            this.handleBookCode(res.data.code);
+          }
+        } else {
+          uni.showToast({
+            title: res.msg,
+            icon: "none",
+          });
+        }
+      });
+    },
+    //处理扫码之后不同的状态 0-扫码频繁 1-成功 2-本单已有该书,数量+1  3-没有该书 4-本书暂不回收 5-超过每单最大可卖数量  6-单个订单最多40本书
+    handleBookCode(code) {
+      if (code == 1) {
+        this.bookList.push();
+      }
+      let tempKeys = [
+        "tiredDialog",
+        "",
+        "",
+        "noInfoDialog",
+        "notAcceptDialog",
+        "maxAcceptDialog",
+        "orderMaxNumDialog",
+      ];
+      let key = tempKeys[code];
+      if (key) {
+        this.$refs[key].openPopup();
+      }
+    },
+    //获取当前用户未提交订单 /api/token/order/lastOrder
+    getLastOrder() {
+      uni.$u.http.get("/token/order/lastOrder").then((res) => {
+        if (res.code == 200) {
+          this.orderInfo = res.data;
+          if (res.data.showDialog == 1) {
+            this.$refs.firstOrderFreePopup.openPopup();
+          } else if (res.data.showDialog == 2) {
+            this.$refs.kindReminder.openPopup();
+          }
+
+          this.bookList = res.data?.orderDetailList
+            ? res.data.orderDetailList.map((v) => {
+                v.orderId = res.data.orderId;
+                return v;
+              })
+            : [];
+          this.serviceList = res.data.serviceList || [];
+        }
+      });
+    },
+
+    goToScannedBooks() {
+      uni.navigateTo({
+        url: "/pages-home/pages/scaned-book",
+      });
+    },
+    goToInputISBN() {
+      this.$refs.isbnPopup.openPopup();
+    },
+    handleStartSelling() {
+      // 标记已显示过温馨提示
+      uni.setStorageSync("kindReminderShown", true);
+    },
+  },
+
+  onShow() {
+    // 获取上一个订单
+    setTimeout(() => {
+      this.getLastOrder();
+      setTimeout(() => {
+        this.slientLogin();
+      }, 10);
+    }, 300);
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.customer-service {
-		position: fixed;
-		width: 126rpx;
-		height: 140rpx;
-		bottom: 20%;
-		z-index: 999;
-		transition: all 0.3s ease;
-
-		/* 添加过渡效果使吸附更平滑 */
-		button {
-			height: max-content;
-			background-color: transparent;
-			padding: 0;
-		}
-	}
-
-	.container {
-		height: 100%;
-		position: relative;
-		overflow: auto;
-		z-index: 1;
-		/* #ifdef MP-WEIXIN */
-		min-height: 100vh;
-		/* #endif */
-		/* #ifndef MP-WEIXIN */
-		min-height: calc(100vh - 120rpx);
-
-		/* #endif */
-		&.book-list {
-			padding-bottom: 300rpx;
-		}
-
-		padding-bottom: 130rpx;
-
-		.nav-title {
-			font-family: PingFang SC;
-			font-weight: bold;
-			font-size: 34rpx;
-			color: #ffffff;
-			padding-left: 40rpx;
-		}
-	}
-
-	.common-text {
-		font-family: PingFang SC;
-		font-weight: 500;
-		font-size: 28rpx;
-		color: #999999;
-
-		&.tip {
-			color: #ff8a4b;
-		}
-	}
-
-	.color-red {
-		color: #ff0000;
-		margin: 0 10rpx;
-	}
-
-	.bottom-fixed {
-		position: fixed;
-		left: 0;
-		right: 0;
-		bottom: 0;
-		z-index: 9;
-		background-color: #ffffff;
-		/* #ifdef H5 */
-		padding-bottom: 120rpx;
-		/* #endif */
-
-		.btn-wrap {
-			display: flex;
-			gap: 20rpx;
-			padding: 20rpx;
-			padding-bottom: 0;
-
-			button {
-				flex: 1;
-				height: 88rpx;
-				border-radius: 10rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				gap: 10rpx;
-				border: none;
-
-				text {
-					font-size: 32rpx;
-				}
-
-				&::after {
-					border: none;
-				}
-			}
-
-			.isbn-btn {
-				background-color: #ffffff;
-				color: #4cd964;
-				border: 3rpx solid #4cd964;
-			}
-		}
-
-		.scan-btn {
-			background-color: #4cd964;
-			color: #ffffff;
-		}
-
-		.next-btn {
-			margin: 0;
-			margin-left: 20rpx;
-
-			&[aria-disabled="true"] {
-				background-color: #cccccc;
-				color: #ffffff;
-				opacity: 0.7;
-				cursor: not-allowed;
-			}
-		}
-	}
-</style>
+.customer-service {
+  position: fixed;
+  width: 126rpx;
+  height: 140rpx;
+  bottom: 20%;
+  z-index: 999;
+  transition: all 0.3s ease;
+
+  /* 添加过渡效果使吸附更平滑 */
+  button {
+    height: max-content;
+    background-color: transparent;
+    padding: 0;
+  }
+}
+
+.container {
+  height: 100%;
+  position: relative;
+  overflow: auto;
+  z-index: 1;
+  /* #ifdef MP-WEIXIN */
+  min-height: 100vh;
+  /* #endif */
+  /* #ifndef MP-WEIXIN */
+  min-height: calc(100vh - 120rpx);
+
+  /* #endif */
+  &.book-list {
+    padding-bottom: 300rpx;
+  }
+
+  padding-bottom: 130rpx;
+
+  .nav-title {
+    font-family: PingFang SC;
+    font-weight: bold;
+    font-size: 34rpx;
+    color: #ffffff;
+    padding-left: 40rpx;
+  }
+}
+
+.common-text {
+  font-family: PingFang SC;
+  font-weight: 500;
+  font-size: 28rpx;
+  color: #999999;
+
+  &.tip {
+    color: #ff8a4b;
+  }
+}
+
+.color-red {
+  color: #ff0000;
+  margin: 0 10rpx;
+}
+
+.bottom-fixed {
+  position: fixed;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 9;
+  background-color: #ffffff;
+  /* #ifdef H5 */
+  padding-bottom: 120rpx;
+  /* #endif */
+
+  .btn-wrap {
+    display: flex;
+    gap: 20rpx;
+    padding: 20rpx;
+    padding-bottom: 0;
+
+    button {
+      flex: 1;
+      height: 88rpx;
+      border-radius: 10rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      gap: 10rpx;
+      border: none;
+
+      text {
+        font-size: 32rpx;
+      }
+
+      &::after {
+        border: none;
+      }
+    }
+
+    .isbn-btn {
+      background-color: #ffffff;
+      color: #4cd964;
+      border: 3rpx solid #4cd964;
+    }
+  }
+
+  .scan-btn {
+    background-color: #4cd964;
+    color: #ffffff;
+  }
+
+  .next-btn {
+    margin: 0;
+    margin-left: 20rpx;
+
+    &[aria-disabled="true"] {
+      background-color: #cccccc;
+      color: #ffffff;
+      opacity: 0.7;
+      cursor: not-allowed;
+    }
+  }
+}
+</style>

+ 227 - 0
pages/mine/components/upsell-book.vue

@@ -0,0 +1,227 @@
+<template>
+  <u-popup v-model="showPopup" mode="center" border-radius="24" width="650rpx" :mask-close-able="false">
+    <view class="popup-container">
+      <!-- 背景图片 -->
+      <image class="bg-image" src="/static/img/activity/bg.png" mode="aspectFill"></image>
+      
+      <!-- 内容区域 -->
+      <view class="content">
+        <!-- 顶部黄色手掌图标和标题 -->
+        <view class="header">
+          <image class="hand-icon" src="/static/img/activity/invite.png" mode="widthFix"></image>
+          <view class="title-text">你真的太幸运了</view>
+          <view class="subtitle-text">恭喜你获得限时加价权益</view>
+        </view>
+        
+        <!-- 绿色价格信息区域 -->
+        <view class="price-section">
+          <view class="price-row">
+            <text class="price-label">此书预估书款</text>
+            <text class="price-value">¥ 5.6</text>
+          </view>
+          <view class="price-row">
+            <text class="price-label">助力成功提升至</text>
+            <text class="price-value increased">¥ 6.5</text>
+            <image class="up-icon" src="/static/img/activity/up.png" mode="widthFix"></image>
+          </view>
+          <view class="small-text">实际金额以最终审核书款为准,活动时间3/25至4/30</view>
+        </view>
+        
+        <!-- 分享助力区域 -->
+        <view class="share-section">
+          <view class="share-text">分享一位好友助力</view>
+          <view class="add-button">
+            <u-icon name="plus" color="#09BB07" size="46"></u-icon>
+            <text class="waiting-text">待邀请</text>
+          </view>
+        </view>
+        
+        <!-- 分享按钮 -->
+        <view class="action-buttons">
+          <u-button type="primary" class="share-button" @click="shareAction">立即分享</u-button>
+          <u-button type="info" plain class="scan-button" @click="scanAction">扫码助力</u-button>
+        </view>
+      </view>
+      
+      <!-- 关闭按钮 -->
+      <view class="close-button" @click="closePopup">
+        <image src="/static/img/activity/close.png" mode="widthFix"></image>
+      </view>
+    </view>
+  </u-popup>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      showPopup: false
+    }
+  },
+  methods: {
+    open() {
+      this.showPopup = true
+    },
+    closePopup() {
+      this.showPopup = false
+    },
+    shareAction() {
+      this.$emit('share')
+    },
+    scanAction() {
+      this.$emit('scan')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.popup-container {
+  position: relative;
+  width: 100%;
+  box-sizing: border-box;
+  border-radius: 24rpx;
+  overflow: hidden;
+}
+
+.bg-image {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 0;
+  opacity: 0.2; // 降低背景图片透明度,避免遮挡文字
+}
+
+.content {
+  position: relative;
+  z-index: 1;
+  padding: 30rpx 20rpx 40rpx;
+}
+
+.header {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 20rpx 0 30rpx;
+  
+  .hand-icon {
+    width: 120rpx;
+    margin-bottom: 20rpx;
+  }
+  
+  .title-text {
+    font-size: 38rpx;
+    font-weight: bold;
+    color: #000;
+    margin-bottom: 10rpx;
+  }
+  
+  .subtitle-text {
+    font-size: 32rpx;
+    color: #000;
+  }
+}
+
+.price-section {
+  background-color: rgba(9, 187, 7, 0.9); // 增加透明度,确保背景不会过于刺眼
+  border-radius: 16rpx;
+  padding: 30rpx 40rpx;
+  margin: 20rpx 0;
+  
+  .price-row {
+    display: flex;
+    align-items: center;
+    margin-bottom: 15rpx;
+    
+    .price-label {
+      color: #FFFFFF;
+      font-size: 30rpx;
+    }
+    
+    .price-value {
+      color: #FFEB3B;
+      font-size: 30rpx;
+      font-weight: bold;
+      margin-left: auto;
+    }
+    
+    .increased {
+      font-size: 42rpx;
+    }
+    
+    .up-icon {
+      width: 30rpx;
+      height: 30rpx;
+      margin-left: 5rpx;
+    }
+  }
+  
+  .small-text {
+    color: #FFFFFF;
+    font-size: 22rpx;
+    margin-top: 10rpx;
+  }
+}
+
+.share-section {
+  background-color: rgba(232, 248, 232, 0.9); // 增加透明度
+  border-radius: 16rpx;
+  padding: 30rpx;
+  margin: 20rpx 0;
+  
+  .share-text {
+    color: #09BB07;
+    font-size: 32rpx;
+    text-align: center;
+    margin-bottom: 30rpx;
+    font-weight: 500; // 加粗文字,提高可读性
+  }
+  
+  .add-button {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    
+    .waiting-text {
+      color: #09BB07;
+      font-size: 26rpx;
+      margin-top: 10rpx;
+    }
+  }
+}
+
+.action-buttons {
+  margin-top: 30rpx;
+  
+  .share-button {
+    height: 90rpx;
+    background-color: #09BB07 !important;
+    border-color: #09BB07 !important;
+    margin-bottom: 20rpx;
+    font-size: 32rpx;
+  }
+  
+  .scan-button {
+    height: 90rpx;
+    color: #09BB07 !important;
+    border-color: #09BB07 !important;
+    font-size: 32rpx;
+  }
+}
+
+.close-button {
+  position: absolute;
+  bottom: -120rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  z-index: 2;
+  
+  image {
+    width: 70rpx;
+    height: 70rpx;
+  }
+}
+</style> 

BIN
static/img/activity/bg.png


BIN
static/img/activity/bg2.png


BIN
static/img/activity/close2.png


BIN
static/img/activity/hand.png


BIN
static/img/activity/invite.png


BIN
static/img/activity/share.jpg


BIN
static/img/activity/up.png


BIN
static/img/activity/up2.png


BIN
static/img/activity/up3.png


BIN
static/img/activity/卖书APP.png