ylong hai 9 meses
pai
achega
6ca8c7baa0

+ 7 - 1
pages-home/components/BookItem.vue

@@ -16,7 +16,13 @@
                             <text class="tzs tag-text" v-if="book.suit == 1">套装书</text>
                             <text class="kmdb tag-text" v-if="book.maxNum > 1">可卖多本</text>
                         </view>
-                        <text class="has-upsell" v-if="book.currUpsellMoney">已加价 {{ book.currUpsellMoney }} 元</text>
+                        <text class="has-upsell" v-if="book.currUpsellMoney">已加价 {{ book.currUpsellMoney }} 元
+                            <image
+                                src="/static/img/activity/up3.png"
+                                mode="aspectFill"
+                                style="width: 22rpx; height: 16rpx; margin-left: 6rpx"
+                            />
+                        </text>
                     </view>
                     
                 </view>

+ 10 - 0
pages-mine/components/detail-book-item.vue

@@ -15,10 +15,20 @@
 
                         <view class="has-upsell" v-if="book.upsellExpectMoney">
                             已加价 {{ book.upsellExpectMoney }} 元
+                            <image
+                                src="/static/img/activity/up3.png"
+                                mode="aspectFill"
+                                style="width: 22rpx; height: 16rpx; margin-left: 6rpx"
+                            />
                         </view>
 
                         <view class="has-upsell" v-if="book.currUpsellMoney">
                             已加价 {{ book.currUpsellMoney }} 元
+                            <image
+                                src="/static/img/activity/up3.png"
+                                mode="aspectFill"
+                                style="width: 22rpx; height: 16rpx; margin-left: 6rpx"
+                            />
                         </view>
                     </view>
                 </view>

+ 5 - 0
pages-mine/pages/order-detail.vue

@@ -21,6 +21,11 @@
                     <text class="common-text-2 font-26">书籍数量:</text>
                     <text class="common-text font-26">{{ orderInfo.totalNum }}</text>
                 </view>
+                
+                <view class="flex-a flex-j-b" v-if="orderInfo.upsellExpectMoney">
+                    <text class="common-text-2 font-26">已加价金额:</text>
+                    <text class="common-text-2 font-26">¥{{ orderInfo.upsellExpectMoney }}</text>
+                </view>
                 <view class="flex-a flex-j-b">
                     <view class="common-text-2 font-26">
                         预估书款:

+ 28 - 17
pages/home/components/BookItem.vue

@@ -16,12 +16,19 @@
         <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 has-upsell"
+              v-if="book.currUpsellMoney > 0 && book.canInvite !== 1"
+              >已涨价{{ book.currUpsellMoney }}元
+              <image
+                src="/static/img/activity/up3.png"
+                mode="aspectFill"
+                style="width: 22rpx; height: 16rpx; margin-left: 6rpx"
+              />
+            </view>
             <view
               class="book-upsell enable-upsell"
-              v-if="!book.currUpsellMoney && book.upsellMoney"
+              v-if="book.canInvite === 1 && book.upsellMoney"
             >
               可涨价{{ book.upsellMoney }}元
               <image
@@ -71,14 +78,15 @@
               去加价
             </button>
             <view class="countdown-wrap" v-if="book.restTime > 0">
-              <text>加价剩余</text>
+              <text>加价即将结束</text>
               <u-count-down
                 :timestamp="book.restTime"
                 format="HH:mm:ss"
                 autoStart
                 color="#db0702"
-                font-size="20rpx"
+                font-size="24"
                 separator-color="#db0702"
+                separator-size="24"
                 @finish="onCountdownFinish"
               ></u-count-down>
             </view>
@@ -91,7 +99,7 @@
     </view>
 
     <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
-      <text>确定删除这本图书吗?</text>
+      <text>{{ book.upsellMoney ? "此书为限时加价收图书,删除后再次添加将失去加价收资格,确定删除吗?" : "确定删除这本图书吗?" }}</text>
     </common-dialog>
   </view>
 </template>
@@ -118,7 +126,9 @@ export default {
   },
   methods: {
     onDelete() {
-      this.$refs.deleteDialog.openPopup();
+      this.$emit("delete", this.book);
+
+    //   this.$refs.deleteDialog.openPopup();
     },
     confirmDelete() {
       this.$emit("delete", this.book);
@@ -134,6 +144,10 @@ export default {
         .then((res) => {
           if (res.data == 1) {
             this.$emit("quantity-change", this.book);
+            let { upsellMoney, canInvite } = this.book;
+            if (upsellMoney && canInvite == 1 && changeNum == 1) {
+              this.handleUpsell();
+            }
           }
         });
     },
@@ -169,7 +183,9 @@ export default {
   &.disabled {
     background: #f9ccc9;
   }
-
+  ::v-deep .u-countdown-colon {
+    font-size: 24rpx !important;
+  }
   .book-info {
     display: flex;
     align-items: center;
@@ -280,7 +296,7 @@ export default {
           font-size: 24rpx;
           height: 48rpx;
           line-height: 48rpx;
-          padding: 0 14rpx;
+          padding: 0 10rpx;
           border-radius: 24rpx;
         }
 
@@ -289,14 +305,9 @@ export default {
           align-items: center;
           font-size: 24rpx !important;
           color: #db0702;
-          margin-left: 10rpx;
+          margin-left: 6rpx;
           text {
-            margin-right: 10rpx;
-          }
-
-          :v-deep .u-count-down {
-            color: #db0702;
-            font-size: 20rpx !important;
+            margin-right: 6rpx;
           }
         }
       }

+ 136 - 106
pages/home/components/ScanBookList.vue

@@ -1,119 +1,149 @@
 <template>
-	<view class="scan-book-list">
-		<!-- 顶部提示 -->
-		<view class="tip-text">
-			套装书(相同ISBN相同的系列书籍)只需扫描其中一本,扫描价即套装价;需用户将整个套装全部寄出,缺册不予回收。
-		</view>
+  <scroll-view
+    scroll-y
+    refresher-enabled
+    :refresher-triggered="isRefreshing"
+    @refresherrefresh="onRefresh"
+    class="book-scroll"
+  >
+    <view class="scan-book-list">
+      <!-- 顶部提示 -->
+      <view class="tip-text">
+        套装书(相同ISBN相同的系列书籍)只需扫描其中一本,扫描价即套装价;需用户将整个套装全部寄出,缺册不予回收。
+      </view>
 
-		<!-- 书籍列表 -->
-		<view class="book-list">
-			<BookItem v-for="(book,index) in bookList" :key="book.isbn" :book="book" @delete="handleDeleteBook"
-				@quantity-change="handleQuantityChange" @upsell="handleUpsell" />
-		</view>
+      <!-- 书籍列表 -->
 
-		<view class="link-wrap flex-a">
-			<text class="link-btn flex-1" @click="goToScannedBooks">扫过的书 ></text>
-			<text class="link-btn flex-1" @click="goToRules">卖书规则 ></text>
-		</view>
-	</view>
+      <view class="book-list">
+        <BookItem
+          v-for="book in bookList"
+          :key="book.isbn"
+          :book="book"
+          @delete="handleDeleteBook"
+          @quantity-change="handleQuantityChange"
+          @upsell="handleUpsell"
+        />
+      </view>
+
+      <view class="link-wrap flex-a">
+        <text class="link-btn flex-1" @click="goToScannedBooks"
+          >扫过的书 ></text
+        >
+        <text class="link-btn flex-1" @click="goToRules">卖书规则 ></text>
+      </view>
+    </view>
+  </scroll-view>
 </template>
 
 <script>
-	import BookItem from './BookItem.vue'
+import BookItem from "./BookItem.vue";
+
+export default {
+  components: {
+    BookItem,
+  },
+  props: {
+    bookList: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      books: [],
+      isRefreshing: false,
+    };
+  },
+  watch: {
+    bookList: {
+      handler(newVal) {
+        this.books = newVal;
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  methods: {
+    // 下拉刷新
+    onRefresh() {
+      this.isRefreshing = true;
+      // 触发父组件的刷新事件
+      this.$emit("refresh");
 
-	export default {
-		components: {
-			BookItem
-		},
-		props: {
-			bookList: {
-				type: Array,
-				default: () => []
-			}
-		},
-		data() {
-			return {
-				books: []
-			}
-		},
-		watch: {
-			bookList: {
-				handler(newVal) {
-					this.books = newVal
-				},
-				deep: true,
-				immediate: true
-			}
-		},
-		methods: {
-			// 加价
-			handleUpsell(book) {
-				this.$emit('upsell', book)
-			},
-			handleDeleteBook(book) {
-				uni.$u.http.post('/token/order/removeBook', {
-					orderId: book.orderId,
-					isbn: book.isbn
-				}).then(res => {
-					if (res.code == 200) {
-						this.$u.toast('删除成功')
-						this.$emit('deleted', this.book)
-					}
-				})
-			},
-			handleQuantityChange(data) {
-				const book = this.books.find(book => book.isbn === data.isbn)
-				if (book) {
-					book.num = data.num
-				}
-				this.$emit('updateBooks', this.books)
-			},
-			onNext() {
-				this.$emit('next')
-			},
-			goToScannedBooks() {
-				uni.navigateTo({
-					url: '/pages-home/pages/scaned-book'
-				})
-			},
-			goToRules() {
-				uni.navigateTo({
-					url: '/pages-mine/pages/rules-for-sellbooks'
-				})
-			},
-		}
-	}
+      // 模拟刷新完成后关闭刷新状态
+      setTimeout(() => {
+        this.isRefreshing = false;
+      }, 600);
+    },
+    // 加价
+    handleUpsell(book) {
+      this.$emit("upsell", book);
+    },
+    handleDeleteBook(book) {
+      this.$emit("deleted", book);
+    },
+    handleQuantityChange(data) {
+      const book = this.books.find((book) => book.isbn === data.isbn);
+      if (book) {
+        book.num = data.num;
+      }
+      this.$emit("updateBooks", this.books, book);
+    },
+    onNext() {
+      this.$emit("next");
+    },
+    goToScannedBooks() {
+      uni.navigateTo({
+        url: "/pages-home/pages/scaned-book",
+      });
+    },
+    goToRules() {
+      uni.navigateTo({
+        url: "/pages-mine/pages/rules-for-sellbooks",
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-	.scan-book-list {
-		padding: 20rpx;
+.scan-book-list {
+  padding: 20rpx;
+  display: flex;
+  flex-direction: column;
+  height: 100%;
+  min-height: calc(100vh - 240px);
+
+  .tip-text {
+    font-family: Source Han Sans CN;
+    font-weight: 400;
+    font-size: 24rpx;
+    color: #ff8a4b;
+    line-height: 36rpx;
+  }
 
-		.tip-text {
-			font-family: Source Han Sans CN;
-			font-weight: 400;
-			font-size: 24rpx;
-			color: #FF8A4B;
-			line-height: 36rpx;
-		}
+  .book-scroll {
+    flex: 1;
+    height: 0;
+  }
 
-		.link-wrap {
-			gap: 20rpx;
-			box-sizing: border-box;
-			margin-top: 20rpx;
+  .link-wrap {
+    gap: 20rpx;
+    box-sizing: border-box;
+    margin-top: 20rpx;
 
-			.link-btn {
-				height: 80rpx;
-				background: #ffffff;
-				border-radius: 10rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				font-family: PingFang SC;
-				font-weight: 500;
-				font-size: 32rpx;
-				color: #666666;
-			}
-		}
-	}
-</style>
+    .link-btn {
+      height: 80rpx;
+      background: #ffffff;
+      border-radius: 10rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-family: PingFang SC;
+      font-weight: 500;
+      font-size: 32rpx;
+      color: #666666;
+    }
+  }
+}
+</style>

+ 17 - 8
pages/home/components/upsell-book.vue

@@ -52,12 +52,14 @@
               <view class="add-text">{{ formatName(item.nickName) }}</view>
             </view>
 
-            <image
-              v-else
-              class="hand-icon"
-              src="/static/img/activity/invite.png"
-              mode="widthFix"
-            ></image>
+            <button v-else open-type="share" class="hand-btn">
+              <image
+              open-type="share"
+                class="hand-icon"
+                src="/static/img/activity/invite.png"
+                mode="widthFix"
+              ></image>
+            </button>
           </block>
         </view>
       </view>
@@ -114,7 +116,7 @@ export default {
             }
             this.inviteUsers = inviteUsers;
             uni.setStorageSync("upsellCodeShare", res.data.upsellCode);
-          }else {
+          } else {
             uni.$u.toast(res.msg);
           }
         });
@@ -148,7 +150,6 @@ export default {
       this.$emit("share", this.bookInfo);
     },
     scanAction() {
-      this.showPopup = false;
       this.$emit("scan", this.bookInfo);
     },
   },
@@ -257,6 +258,14 @@ export default {
       height: 100rpx;
     }
   }
+  .hand-btn{
+    display: inline-block;
+    width: 100rpx !important;
+    height: 110rpx;
+    background: transparent;
+    flex: none;
+    padding: 0;
+  }
 
   .add-item {
     position: relative;

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

@@ -102,7 +102,6 @@ export default {
     viewRules() {
       // 打开活动规则弹窗
       this.$emit("view-rules");
-      this.close();
     },
 
     //调用助力接口 /api/token/order/inviteClickHelp

+ 40 - 3
pages/home/index.vue

@@ -16,10 +16,11 @@
     <scan-book-list
       v-else
       @updateBooks="updateBooksList"
-      @deleted="getLastOrder"
+      @deleted="handleDeleteBook"
       :bookList="bookList"
       ref="scanBookList"
       @upsell="handleUpsell"
+      @refresh="getLastOrder"
     ></scan-book-list>
     <!-- 底部固定按钮 -->
     <view class="bottom-fixed">
@@ -105,6 +106,15 @@
       <text>单个订单最多40本书</text>
     </CommonDialog>
 
+    <!-- 删除活动书籍弹窗 -->
+    <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
+      <text>{{
+        deleteBook.upsellMoney
+          ? "此书为限时加价收图书,删除后再次添加将失去加价收资格,确定删除吗?"
+          : "确定删除这本图书吗?"
+      }}</text>
+    </common-dialog>
+
     <!-- 温馨提示弹窗 -->
     <KindReminder
       ref="kindReminder"
@@ -206,6 +216,7 @@ export default {
       // 是否正在更新位置,用于防止频繁更新
       isUpdatingPosition: false,
       shareData: {},
+      deleteBook: {},
     };
   },
   computed: {
@@ -228,7 +239,12 @@ export default {
     },
     totalPrice() {
       return this.bookList
-        .reduce((sum, book) => sum + book.recyclePrice * (book.num || 1) + book.currUpsellMoney||0, 0)
+        .reduce(
+          (sum, book) =>
+            sum + book.recyclePrice * (book.num || 1) + book.currUpsellMoney ||
+            0,
+          0
+        )
         .toFixed(2);
     },
     isDisabled() {
@@ -280,6 +296,26 @@ export default {
   },
 
   methods: {
+    //删除书籍
+    handleDeleteBook(book) {
+      this.deleteBook = book;
+      this.$refs.deleteDialog.openPopup(book);
+    },
+
+    confirmDelete(book) {
+      uni.$u.http
+        .post("/token/order/removeBook", {
+          orderId: book.orderId,
+          isbn: book.isbn,
+        })
+        .then((res) => {
+          if (res.code == 200) {
+            this.$u.toast("删除成功");
+            this.getLastOrder();
+          }
+        });
+    },
+
     //扫码助力
     handleScanCode(data = {}) {
       this.$refs.upsellQrcodeRef.open(data);
@@ -461,8 +497,9 @@ export default {
       this.$refs.upsellRef.open(book);
     },
 
-    updateBooksList(data) {
+    updateBooksList(data, book) {
       this.bookList = data;
+      book.upsellMoney && this.getLastOrder();
     },
 
     toggleCollapse(step) {

BIN=BIN
static/img/activity/up3.png