Browse Source

修改提示报错信息

ylong 7 months ago
parent
commit
59b3890d46

+ 10 - 7
App.vue

@@ -63,25 +63,28 @@
 			if (params.inviteCode) {
 				uni.setStorageSync('inviteCode', params.inviteCode)
 				console.log('解析出的 inviteCode 参数:', params.inviteCode);
-				this.slientLogin(params.inviteCode);
+				this.slientLogin(params.inviteCode,'inviteCode');
 			}
 			// 用于书籍加价的邀请码,关联订单 id 和 isbn
 			if(params.upsellCode){
 				uni.setStorageSync('upsellCode', params.upsellCode)
 				that.globalData.upsellCode = params.upsellCode
 				console.log('解析出的 upsellCode 参数:', params.upsellCode);
-				this.slientLogin();
+				this.slientLogin(params.upsellCode,'upsellCode');
 			}
 		},
 		methods: {
-			slientLogin(inviteCode) {
+			slientLogin(code,type) {
 				uni.login({
 					success(res) {
+						let data = {
+							code: res.code,
+							[type]: code,
+						}
+						console.log(data, "登录参数");
+
 						uni.$u.http
-							.post("/user/wxLogin", {
-								code: res.code,
-								inviteCode,
-							})
+							.post("/user/wxLogin", data)
 							.then((response) => {
 								if (response.code == 200) {
 									uni.setStorageSync("token", response.data.token);

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

@@ -16,6 +16,10 @@
                         <view class="has-upsell" v-if="book.upsellExpectMoney">
                             已加价 {{ book.upsellExpectMoney }} 元
                         </view>
+
+                        <view class="has-upsell" v-if="book.currUpsellMoney">
+                            已加价 {{ book.currUpsellMoney }} 元
+                        </view>
                     </view>
                 </view>
                 <view v-if="isReturn" class="book-price">退回信息</view>

+ 0 - 6
pages.json

@@ -24,12 +24,6 @@
             "style": {
                 "navigationBarTitleText": "活动"
             }
-        },
-        {
-            "path": "pages/login/index",
-            "style": {
-                "navigationBarTitleText": "登录"
-            }
         }
     ],
     "subPackages": [

+ 292 - 274
pages/home/components/BookItem.vue

@@ -1,318 +1,336 @@
 <template>
-    <view class="book-item" :class="{ disabled: book.status != 1 }">
-        <view class="book-info">
-            <view class="book-image-container">
-                <u-image width="160rpx" height="160rpx" :src="book.cover" mode="aspectFill" />
-                <view class="no-recycle" v-if="book.status != 1">
-                    <text>已收满</text>
-                </view>
+  <view class="book-item" :class="{ disabled: book.status != 1 }">
+    <view class="book-info">
+      <view class="book-image-container">
+        <u-image
+          width="140rpx"
+          height="140rpx"
+          :src="book.cover"
+          mode="aspectFill"
+        />
+        <view class="no-recycle" v-if="book.status != 1">
+          <text>已收满</text>
+        </view>
+      </view>
+      <view class="book-detail">
+        <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 class="book-detail">
-                <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>
+        </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>
+        <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"
-                        color="#ffffff"
-                        v-model="book.num"
-                        :min="1"
-                        :max="book.maxNum || 40"
-                        @blur="onQuantityChange"
-                        @minus="addReduceNum(-1)"
-                        @plus="addReduceNum(1)"
-                        :disabled="book.status != 1"
-                    ></u-number-box>
-                </view>
+          <u-number-box
+            class="number-box"
+            bg-color="#38c148"
+            color="#ffffff"
+            v-model="book.num"
+            :min="1"
+            :max="book.maxNum || 40"
+            @blur="onQuantityChange"
+            @minus="addReduceNum(-1)"
+            @plus="addReduceNum(1)"
+            :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"
-                                font-size="24rpx"
-                                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>
+        <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: 10rpx">
+            <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"
+                font-size="20rpx"
+                separator-color="#db0702"
+                @finish="onCountdownFinish"
+              ></u-count-down>
             </view>
+          </view>
         </view>
-
-        <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
-            <text>确定删除这本图书吗?</text>
-        </common-dialog>
+      </view>
+      <view class="delete-btn" @tap="onDelete">
+        <u-icon name="close" size="26" color="#999"></u-icon>
+      </view>
     </view>
+
+    <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
+      <text>确定删除这本图书吗?</text>
+    </common-dialog>
+  </view>
 </template>
 
 <script>
 import commonDialog from "@/components/common-dialog.vue";
 export default {
-    components: {
-        commonDialog,
+  components: {
+    commonDialog,
+  },
+  props: {
+    book: {
+      type: Object,
+      required: true,
     },
-    props: {
-        book: {
-            type: Object,
-            required: true,
-        },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    recycleMoney() {
+      return (this.book.recyclePrice * (this.book.num || 1)).toFixed(2);
     },
-    data() {
-        return {};
+  },
+  methods: {
+    onDelete() {
+      this.$refs.deleteDialog.openPopup();
     },
-    computed: {
-        recycleMoney() {
-            return (this.book.recyclePrice * (this.book.num || 1)).toFixed(2);
-        },
+    confirmDelete() {
+      this.$emit("delete", this.book);
     },
-    methods: {
-        onDelete() {
-            this.$refs.deleteDialog.openPopup();
-        },
-        confirmDelete() {
-            this.$emit("delete", this.book);
-        },
-        // /api/token/order/addReduceNum
-        addReduceNum(changeNum) {
-            uni.$u.http
-                .post("/token/order/addReduceNum", {
-                    orderId: this.book.orderId,
-                    isbn: this.book.isbn,
-                    changeNum,
-                })
-                .then((res) => {
-                    if (res.data == 1) {
-                        this.$emit("quantity-change", this.book);
-                    }
-                });
-        },
-        onQuantityChange(data) {
-            uni.$u.http
-                .post("/token/order/changeNum", {
-                    orderId: this.book.orderId,
-                    isbn: this.book.isbn,
-                    afterNum: data.value,
-                })
-                .then((res) => {
-                    if (res.data == 1) {
-                        this.$emit("quantity-change", this.book);
-                    }
-                });
-        },
-        handleUpsell() {
-            this.$emit("upsell", this.book);
-        },
-        onCountdownFinish() {
-            this.$emit("countdown-finish", this.book);
-        }
+    // /api/token/order/addReduceNum
+    addReduceNum(changeNum) {
+      uni.$u.http
+        .post("/token/order/addReduceNum", {
+          orderId: this.book.orderId,
+          isbn: this.book.isbn,
+          changeNum,
+        })
+        .then((res) => {
+          if (res.data == 1) {
+            this.$emit("quantity-change", this.book);
+          }
+        });
+    },
+    onQuantityChange(data) {
+      uni.$u.http
+        .post("/token/order/changeNum", {
+          orderId: this.book.orderId,
+          isbn: this.book.isbn,
+          afterNum: data.value,
+        })
+        .then((res) => {
+          if (res.data == 1) {
+            this.$emit("quantity-change", this.book);
+          }
+        });
+    },
+    handleUpsell() {
+      this.$emit("upsell", this.book);
+    },
+    onCountdownFinish() {
+      this.$emit("countdown-finish", this.book);
     },
+  },
 };
 </script>
 
 <style lang="scss" scoped>
 .book-item {
-    background: #ffffff;
-    padding: 20rpx;
-    margin-top: 20rpx;
-    border-radius: 10rpx;
-    &.disabled {
-        background: #f9ccc9;
+  background: #ffffff;
+  padding: 20rpx;
+  margin-top: 20rpx;
+  border-radius: 10rpx;
+  &.disabled {
+    background: #f9ccc9;
+  }
+
+  .book-info {
+    display: flex;
+    align-items: center;
+    position: relative;
+
+    .book-image-container {
+      position: relative;
+
+      .no-recycle {
+        position: absolute;
+        bottom: 0;
+        left: 50%;
+        transform: translateX(-50%);
+        background-color: #ff5252;
+        color: #ffffff;
+        padding: 4rpx 10rpx;
+        border-radius: 4rpx 4rpx 0 0;
+        font-size: 24rpx;
+        text-align: center;
+        width: 100%;
+      }
     }
 
-    .book-info {
-        display: flex;
-        align-items: center;
-        position: relative;
+    .book-cover {
+      width: 140rpx;
+      height: 196rpx;
+      border-radius: 8rpx;
+    }
 
-        .book-image-container {
-            position: relative;
-            
-            .no-recycle {
-                position: absolute;
-                bottom: 0;
-                left: 50%;
-                transform: translateX(-50%);
-                background-color: #ff5252;
-                color: #ffffff;
-                padding: 4rpx 10rpx;
-                border-radius: 4rpx 4rpx 0 0;
-                font-size: 24rpx;
-                text-align: center;
-                width: 100%;
-            }
-        }
+    .tag-text {
+      font-family: Source Han Sans CN;
+      font-weight: 400;
+      font-size: 24rpx;
+      color: #ffffff;
+    }
 
-        .book-cover {
-            width: 140rpx;
-            height: 196rpx;
-            border-radius: 8rpx;
-        }
+    .tzs {
+      width: 91rpx;
+      height: 30rpx;
+      background: linear-gradient(263deg, #98e05f, #0de3ac);
+      border-radius: 2rpx;
+      padding: 4rpx 10rpx;
+      margin-right: 10rpx;
+    }
 
-        .tag-text {
-            font-family: Source Han Sans CN;
-            font-weight: 400;
-            font-size: 24rpx;
-            color: #ffffff;
-        }
+    .kmdb {
+      width: 117rpx;
+      height: 30rpx;
+      background: linear-gradient(263deg, #f7cb6b, #fba980);
+      border-radius: 2rpx;
+      padding: 4rpx 10rpx;
+      margin-right: 10rpx;
+    }
 
-        .tzs {
-            width: 91rpx;
-            height: 30rpx;
-            background: linear-gradient(263deg, #98e05f, #0de3ac);
-            border-radius: 2rpx;
-            padding: 4rpx 10rpx;
-            margin-right: 10rpx;
-        }
+    .book-detail {
+      flex: 1;
+      margin-left: 20rpx;
+      display: flex;
+      flex-direction: column;
+      justify-content: space-between;
 
-        .kmdb {
-            width: 117rpx;
-            height: 30rpx;
-            background: linear-gradient(263deg, #f7cb6b, #fba980);
-            border-radius: 2rpx;
-            padding: 4rpx 10rpx;
-            margin-right: 10rpx;
-        }
+      :v-deep .u-number-input {
+        background: #f9f9f9 !important;
+        border-radius: 6rpx;
+      }
 
-        .book-detail {
-            flex: 1;
-            margin-left: 20rpx;
-            display: flex;
-            flex-direction: column;
-            justify-content: space-between;
+      .book-title {
+        width: calc(100% - 60rpx);
+        margin-bottom: 10rpx;
+        display: flex;
+        align-items: center;
+      }
 
-            :v-deep .u-number-input {
-                background: #f9f9f9 !important;
-                border-radius: 6rpx;
-            }
+      .book-name {
+        font-size: 28rpx;
+        color: #333;
+        line-height: 1.4;
+        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-title {
-                max-width: 400rpx;
-                margin-bottom: 10rpx;
-                display: flex;
-                align-items: center;
-            }
-            
-            .book-name {
-                font-size: 28rpx;
-                color: #333;
-                line-height: 1.4;
-                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 {
+        font-family: Source Han Sans CN;
+        font-weight: 400;
+        font-size: 24rpx;
+        color: #999999;
+      }
 
-            .book-price-labels {
-                display: flex;
-                margin-top: -2rpx;
-                flex-shrink: 0;
-            }
+      .price-action {
+        display: flex;
+        align-items: center;
 
-            .book-price {
-                font-family: Source Han Sans CN;
-                font-weight: 400;
-                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: 24rpx !important;
-                    color: #db0702;
-                    
-                    text {
-                        margin-right: 10rpx;
-                    }
-                    
-                    :v-deep .u-count-down {
-                        .u-count-down__text {
-                            color: #db0702;
-                            font-size: 20rpx;
-                        }
-                    }
-                }
-            }
+        .up-price-btn {
+          background-color: #38c148;
+          color: #ffffff;
+          font-size: 24rpx;
+          height: 48rpx;
+          line-height: 48rpx;
+          padding: 0 14rpx;
+          border-radius: 24rpx;
         }
 
-        .book-upsell {
-            font-size: 22rpx;
-            padding: 2rpx 10rpx;
-            border-radius: 4rpx;
+        .countdown-wrap {
+          display: flex;
+          align-items: center;
+          font-size: 24rpx !important;
+          color: #db0702;
+          margin-left: 10rpx;
+          text {
             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;
-            }
+          :v-deep .u-count-down {
+            color: #db0702;
+            font-size: 20rpx !important;
+          }
         }
+      }
+    }
 
-        .delete-btn {
-            position: absolute;
-            right: 0;
-            top: -10rpx;
-            padding: 10rpx;
-        }
+    .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 {
+      position: absolute;
+      right: 0;
+      top: -10rpx;
+      padding: 10rpx;
     }
+  }
 }
 </style>

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

@@ -114,6 +114,8 @@ export default {
             }
             this.inviteUsers = inviteUsers;
             uni.setStorageSync("upsellCodeShare", res.data.upsellCode);
+          }else {
+            uni.$u.toast(res.msg);
           }
         });
     },

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

@@ -107,6 +107,7 @@ export default {
   width: 400rpx;
   background: #38c249;
   margin: 30rpx auto;
+  border-radius: 24rpx;
   .qrcode-img {
     width: 300rpx;
     height: 300rpx;

+ 1 - 1
pages/home/components/upsell-rules.vue

@@ -11,7 +11,7 @@
       <!-- 规则内容 -->
       <view class="rules-content">
         <view class="rule-item"
-          >1.活动时间:2025年3月25日至2025年4月30日。</view
+          >1.活动时间:2025年4月05日至2025年5月30日。</view
         >
         <view class="rule-item"
           >2.活动期间,用户扫描到活动书籍后有幸运机会成为助力"发起者",成功邀请1位好友进行助力,发起者参与活动的回收书籍,将根据书籍实际审核书款额外获得金额的助力收益。</view

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

@@ -90,6 +90,8 @@ export default {
             this.avatarUrl = res.data.imgPath;
             this.username = res.data.nickName;
             this.inviteDone = res.data.inviteDone;
+          }else {
+            uni.$u.toast(res.msg);
           }
         });
     },
@@ -113,6 +115,8 @@ export default {
             this.close();
             this.inviteDone = 0;
             uni.$u.toast("助力成功");
+          } else {
+            uni.$u.toast(res.msg);
           }
         });
     },