Leo пре 3 година
родитељ
комит
43cc7038c1

+ 29 - 18
src/components/list-item/list-item.vue

@@ -22,29 +22,21 @@
         <view class="skeleton"></view>
         <view class="skeleton"></view>
       </view>
-      <!-- <view v-if="item" class="list-sub">
+      <view v-if="btn && item" class="list-sub">
         <view class="list-sub-main">
-          <text class="list-label">&yen;</text>
-          <text class="list-price">{{ item.price }}</text>
-          <text
-            v-if="
-              Number(item.source_price) &&
-              Number(item.price) < Number(item.source_price)
-            "
-            class="list-source"
-            >&yen;{{ item.source_price }}</text
-          >
+          <text class="list-price">{{ item.score }}</text>
+          <text class="list-label">积分</text>
         </view>
-        <view
-          v-if="item.curr_batch && item.total_batch && item.total_batch > 1"
-          class="list-num"
-          >{{ item.curr_batch }}/{{ item.total_batch }}箱</view
+        <view class="list-num"
+          ><button class="btn" v-if="btn" @click.stop="handleBtnClick">
+            兑换
+          </button></view
         >
       </view>
-      <view v-else class="list-sub">
+      <view v-else-if="btn" class="list-sub">
         <view class="skeleton"></view>
       </view>
-      <view
+      <!-- <view
         v-if="item.tag1 || item.tag2 || (item.tags && item.tags.length > 0)"
         class="list-tags"
       >
@@ -66,6 +58,10 @@ export default {
       type: Object,
       default: () => null,
     },
+    btn: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {};
@@ -73,6 +69,10 @@ export default {
 
   methods: {
     handleClick() {
+      if (this.btn) return;
+      this.$emit("click", this.item);
+    },
+    handleBtnClick() {
       this.$emit("click", this.item);
     },
   },
@@ -148,7 +148,7 @@ export default {
   }
   .list-sub {
     margin-top: 30rpx;
-    height: 30rpx;
+    // height: 30rpx;
     overflow: visible;
     display: flex;
     justify-content: space-between;
@@ -232,5 +232,16 @@ export default {
   //     width: 100rpx;
   //   }
   // }
+  .btn {
+    display: block;
+    margin: 0 auto;
+    border-radius: 100px;
+    font-size: 24rpx;
+    background-color: #08c2c3;
+    white-space: nowrap;
+    &::after {
+      display: none;
+    }
+  }
 }
 </style>

+ 1 - 1
src/lib/utils/request.js

@@ -19,7 +19,7 @@ function getCommonHeader() {
   if (info.session) {
     header.session = info.session;
   }
-  // header.session = "375ac5dd70ebc9af27864ecfc91e9181";
+  header.session = "375ac5dd70ebc9af27864ecfc91e9181";
   return header;
 }
 // todo 这里的问题,先注释掉

+ 2 - 2
src/pages/detail/detail.vue

@@ -312,7 +312,7 @@ export default {
       title: this.info?.name || "来抽赏啦,抽中SP赏可好运加倍!",
       imageUrl:
         this.info?.img ||
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png", //图片路径
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg", //图片路径
       path: "/pages/detail/detail?id=" + this.id,
     };
   },
@@ -321,7 +321,7 @@ export default {
       title: this.info?.name || "来抽赏啦,抽中SP赏可好运加倍!",
       imageUrl:
         this.info?.img ||
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png", //图片路径
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg", //图片路径
       path: "/pages/detail/detail?id=" + this.id,
     };
   },

+ 8 - 8
src/pages/index/index.vue

@@ -77,7 +77,7 @@
 </template>
 <script>
 import { homeModules } from "@/lib/api/home";
-import { getTaskInfo } from "@/lib/api/task";
+import { getSingInfo } from "@/lib/api/task";
 import listItem from "@/components/list-item/list-item.vue";
 
 export default {
@@ -115,21 +115,21 @@ export default {
     } else {
       this.userInfo = {};
     }
-    // this.getTaskInfo();
+    this.getSingInfo();
   },
   onShareAppMessage() {
     return {
-      title: "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: "云果国潮会员中心",
       imageUrl:
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/index/index",
     };
   },
   onShareTimeline() {
     return {
-      title: "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: "云果国潮会员中心",
       imageUrl:
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/index/index",
     };
   },
@@ -195,12 +195,12 @@ export default {
       }
     },
 
-    async getTaskInfo() {
+    async getSingInfo() {
       if (!this.userInfo.session) {
         this.showTask = true;
         return Promise.reject();
       }
-      const data = await getTaskInfo(this.userInfo.session);
+      const data = await getSingInfo(this.userInfo.session);
       this.showTask = !data.is_current_signin;
     },
 

+ 4 - 8
src/pages/reward/detail.vue

@@ -515,23 +515,19 @@ export default {
   },
   onShareAppMessage() {
     return {
-      title:
-        this.info?.name ||
-        "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: this.info?.name || "云果国潮会员中心",
       imageUrl:
         this.info?.img ||
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/reward/detail?id=" + this.id,
     };
   },
   onShareTimeline() {
     return {
-      title:
-        this.info?.name ||
-        "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: this.info?.name || "云果国潮会员中心",
       imageUrl:
         this.info?.img ||
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/reward/detail?id=" + this.id,
     };
   },

+ 4 - 4
src/pages/reward/index.vue

@@ -148,17 +148,17 @@ export default {
   },
   onShareAppMessage() {
     return {
-      title: "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: "云果国潮会员中心",
       imageUrl:
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/reward/index",
     };
   },
   onShareTimeline() {
     return {
-      title: "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: "云果国潮会员中心",
       imageUrl:
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/reward/index",
     };
   },

+ 14 - 447
src/pages/shop/index.scss

@@ -1,451 +1,18 @@
-.BanContain {
-  position: fixed;
-  width: 100%;
-  top: 0;
-  z-index: 10;
-  background: #fff;
-
-  .status_bar {
-    height: var(--status-bar-height);
-    width: 100%;
-  }
-
-  .navBar {
-    display: flex;
-    align-items: center;
-    padding: 0 24rpx;
-    .logo {
-      display: block;
-      width: 148rpx;
-      height: 40rpx;
-    }
-
-    .bans {
-      margin-left: 12rpx;
-    }
-  }
-}
-
-.icon-list {
-  display: flex;
-  text-align: center;
-  padding: 23rpx 0;
-  margin-bottom: 86rpx-48rpx-25rpx;
-  flex-wrap: wrap;
-  .icon-item {
-    width: 25%;
-    font-size: 24rpx;
-    color: #555555;
-    line-height: 28rpx;
-    margin: 25rpx 0;
-    position: relative;
-    .icon {
-      display: block;
-      width: 100rpx;
-      height: 100rpx;
-      margin: 0 auto 12rpx;
-    }
-    .my-tip {
-      position: absolute;
-      box-sizing: border-box;
-      width: 22rpx;
-      height: 22rpx;
-      border-radius: 22rpx;
-      background: #eb5757;
-      border: 2rpx solid #ffffff;
-      top: -4rpx;
-      left: 50%;
-      margin-left: 14rpx;
-    }
-  }
+page {
+  background-color: #f5f5f5;
 }
-.title {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  height: 48rpx;
-  font-size: 34rpx;
-  font-weight: 600;
-  color: #222222;
-  padding: 0 42rpx;
-  margin-top: 30rpx;
+.shop {
+  padding-top: 50rpx;
 }
-.home-index2 {
-  // background: #f5f5f5;
+.fixtitle {
+  position: fixed;
+  width: 100%;
+  padding: 0 40rpx;
   background: #fff;
-  // background-size: 100% auto;
-  overflow: hidden;
-  .swiper {
-    width: 100%;
-    height: 276rpx;
-  }
-  .swiper-item {
-    width: 100%;
-    display: block;
-    height: 276rpx;
-  }
-  .banner {
-    padding: 0 24rpx;
-    margin: 24rpx 0;
-    display: flex;
-    &.banner-swiper {
-      height: 164rpx;
-    }
-    .banner-item {
-      width: 100%;
-      height: 160rpx;
-      margin: 0 7rpx;
-      &:first-child {
-        margin-left: 0;
-      }
-      &:last-child {
-        margin-right: 0;
-      }
-    }
-  }
-
-  .flash-sale {
-    width: 750rpx;
-    height: 572rpx;
-    padding: 52rpx 0 0;
-    background: url("https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/d73e5555842c968cf39a6bea9442e4fd.png")
-      no-repeat center top;
-    background-size: 100% 100%;
-    overflow: hidden;
-    margin-top: -24rpx;
-    .cd-title {
-      height: 32rpx;
-      padding-left: 158rpx;
-      overflow: hidden;
-      display: flex;
-      align-items: flex-start;
-      .cd-block {
-        min-width: 22rpx;
-        height: 28rpx;
-        font-size: 20rpx;
-        color: #292d3b;
-        width: 32rpx;
-        height: 32rpx;
-        background: #4efbff;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-      }
-      .cd-item {
-        min-width: 14rpx;
-        height: 32rpx;
-        font-size: 20rpx;
-        color: #08c2c3;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        &.day {
-          margin: 0 6rpx;
-        }
-      }
-    }
-    .sale-list {
-      width: 670rpx;
-      height: 394rpx;
-      overflow-x: auto;
-      white-space: nowrap;
-      margin: 32rpx auto 14rpx;
-      .sale-item {
-        display: inline-block;
-        vertical-align: top;
-        width: 256rpx;
-        height: 376rpx;
-        overflow: hidden;
-        margin-right: 16rpx;
-        &:last-child {
-          margin-right: 0;
-        }
-      }
-      .sale-pic,
-      .sale-img {
-        position: relative;
-        width: 256rpx;
-        height: 256rpx;
-        display: block;
-      }
-      .sale-text {
-        position: absolute;
-        left: 0;
-        bottom: 0;
-        width: 100%;
-        font-size: 22rpx;
-        font-weight: 500;
-        color: #ffffff;
-        height: 36rpx;
-        background: linear-gradient(
-          95deg,
-          #fc5e94 0%,
-          rgba(252, 94, 148, 0.47) 100%
-        );
-        line-height: 36rpx;
-        text-align: center;
-      }
-
-      .sale-title {
-        font-size: 24rpx;
-        font-weight: 500;
-        color: #292d3b;
-        line-height: 34rpx;
-        height: 68rpx;
-        display: block;
-        white-space: normal;
-        margin: 8rpx 0;
-      }
-      .sale-sub {
-        color: #08c2c3;
-        line-height: 34rpx;
-        display: block;
-        font-family: unidreamledregular, Helvetica Neue, Helvetica, Arial,
-          Hiragino Sans GB, Hiragino Sans GB W3, Microsoft YaHei UI,
-          Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;
-        .sale-label {
-          font-size: 24rpx;
-          margin-right: 5rpx;
-          font-weight: bolder;
-        }
-        .sale-price {
-          font-size: 32rpx;
-        }
-        .sale-origin {
-          font-size: 20rpx;
-          font-weight: 400;
-          color: #a6a7ac;
-          text-decoration: line-through;
-          margin-left: 10rpx;
-        }
-      }
-    }
-    .fill-title {
-      margin-top: 46rpx;
-    }
-  }
-  .fill-title-wrap {
-    height: 88rpx;
-  }
-  .fill-title {
-    box-sizing: border-box;
-    width: 100%;
-    display: flex;
-    justify-content: space-between;
-    font-size: 28rpx;
-    font-weight: 500;
-    color: #555;
-    height: 88rpx;
-    padding: 0;
-    line-height: 88rpx;
-    .icon-sort {
-      width: 28rpx;
-      height: 28rpx;
-      margin-left: 2rpx;
-    }
-    .fill-item {
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      position: relative;
-      width: 0;
-      flex: 1;
-      &.white {
-        color: #222;
-        font-weight: bold;
-        &::after {
-          width: 32rpx;
-          height: 6rpx;
-          background: #08c2c3;
-          position: absolute;
-          content: "";
-          left: 50%;
-          bottom: 0;
-          margin-left: -16rpx;
-        }
-      }
-    }
-  }
-  .home-titlebar {
-    background-color: #fff;
-  }
-  .home-titlebar-fix {
-    position: fixed;
-    left: 0;
-    top: 0;
-    z-index: 9;
-  }
-  .footer {
-    width: 100%;
-    margin-top: 24rpx;
-    margin-bottom: 22rpx;
-
-    .info {
-      height: 40rpx;
-      font-size: 28rpx;
-      font-weight: 500;
-      color: #999999;
-      line-height: 40rpx;
-      text-align: center;
-    }
-
-    .contact {
-      margin-top: 8rpx;
-      height: 40rpx;
-      font-size: 28rpx;
-      font-weight: 500;
-      color: #999999;
-      line-height: 40rpx;
-      text-align: center;
-    }
-  }
-  .popup_coupon {
-    color: #fff;
-    font-weight: 500;
-    text-align: center;
-    position: relative;
-    .title {
-      display: block;
-      height: 50rpx;
-      font-size: 36rpx;
-      line-height: 50rpx;
-    }
-    .desc {
-      display: block;
-      height: 40rpx;
-      font-size: 28rpx;
-      line-height: 40rpx;
-    }
-    .gifts {
-      width: 708rpx;
-      height: 686rpx;
-      display: block;
-      margin: -16rpx auto -80rpx;
-      animation: zoomIn 0.3s both;
-    }
-    .coupon-button {
-      display: inline-block;
-      height: 80rpx;
-      font-size: 32rpx;
-      line-height: 80rpx;
-      padding: 0 46rpx;
-      background: #08c2c3;
-      border-radius: 0;
-    }
-  }
-  .popup_coupon_res {
-    box-sizing: border-box;
-    width: 840rpx;
-    height: 852rpx;
-    position: relative;
-    padding-top: 44rpx;
-    background: url(https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/b52109ed4dfc4551ad0254a99ddd0e34.png)
-      no-repeat center;
-    background-size: contain;
-
-    .title {
-      display: block;
-      position: relative;
-      text-align: center;
-      height: 50rpx;
-      font-size: 36rpx;
-      font-weight: 500;
-      color: #292d3b;
-      line-height: 50rpx;
-      margin: 0 0 24rpx;
-    }
-    .coupon-list {
-      position: relative;
-      width: 476rpx;
-      margin: 0 auto;
-      display: flex;
-      flex-wrap: wrap;
-      margin-bottom: 16rpx;
-      justify-content: space-between;
-      max-height: 380rpx;
-      overflow: auto;
-      .coupon-item {
-        width: 230rpx;
-        height: 116rpx;
-        background: url(@/assets/home/gifts-item.png) no-repeat;
-        background-size: contain;
-        display: flex;
-        color: #fff;
-        align-items: center;
-        margin-bottom: 16rpx;
-        .text {
-          flex: 1;
-          text-align: center;
-          .big {
-            font-size: 80rpx;
-            font-weight: bold;
-            line-height: 98rpx;
-          }
-          .small {
-            font-size: 36rpx;
-            font-weight: 600;
-            line-height: 50rpx;
-          }
-        }
-        .label {
-          width: 62rpx;
-          height: 94rpx;
-          border-left: 1px dashed #717181;
-          position: relative;
-          overflow: hidden;
-          .label-text {
-            white-space: nowrap;
-            font-size: 28rpx;
-            font-weight: 600;
-            color: #ffffff;
-            position: absolute;
-            left: 50%;
-            top: 50%;
-            transform: translate(-50%, -50%) rotate(90deg);
-          }
-        }
-      }
-    }
-    .coupon-button {
-      width: 378rpx;
-      height: 128rpx;
-      font-size: 36rpx;
-      font-weight: 600;
-      color: #ffffff;
-      line-height: 128rpx;
-      text-align: center;
-      background: url(@/assets/home/gifts-btn.png) no-repeat center transparent;
-      background-size: contain;
-      border: 0 none;
-      padding: 0;
-      position: absolute;
-      bottom: 28rpx;
-      left: 50%;
-      margin-left: -189rpx;
-      &::after {
-        display: none;
-      }
-    }
-  }
-  .fixed-btns {
-    position: fixed;
-    right: 14rpx;
-    bottom: 154rpx;
-    z-index: 999;
-    .fixed-btn {
-      display: block;
-      width: 112rpx;
-      height: 112rpx;
-      margin-bottom: 18rpx;
-    }
-  }
-}
-
-@keyframes zoomIn {
-  from {
-    transform: scale(0);
-  }
-  to {
-    transform: scale(1);
-  }
+  line-height: 2.5;
+  top: 0;
+  z-index: 100;
+  box-sizing: border-box;
+  left: 0;
+  font-size: 28rpx;
 }

+ 61 - 85
src/pages/shop/index.vue

@@ -1,41 +1,22 @@
 <template>
-  <view class="home-index2">
-    <view
-      v-if="modules.latest_recommend && modules.latest_recommend.length"
-      class="base-list"
-    >
+  <view class="shop">
+    <view class="fixtitle">当前积分:{{ userInfo.source || 0 }}</view>
+    <view v-if="modules && modules.length" class="base-list">
       <list-item
-        v-for="item in modules.latest_recommend"
-        :key="item.module_id"
+        v-for="item in modules"
+        :key="item.id"
         :item="item"
+        :btn="true"
         class="base-list-item"
         @click="handleDetail(item)"
-      >
-      </list-item>
-    </view>
-    <view class="fixed-btns">
-      <!-- <image
-        class="fixed-btn"
-        :src="require('@/assets/icon/icon-btn-service.png')"
-        @click="jumpModuleAll('/pages/help/help_contact')"
-      ></image>
-      <image
-        class="fixed-btn"
-        :src="require('@/assets/icon/icon-btn-message.png')"
-        @click="jumpModuleAll('/pages/my/messages')"
-      ></image>
-       -->
-      <image
-        v-if="showTask"
-        class="fixed-btn"
-        :src="require('@/assets/icon/icon-btn-sign.png')"
-        @click="jumpModuleAll('/pages/task/index')"
-      ></image>
+      />
     </view>
   </view>
 </template>
 <script>
-import { getScoreList } from "@/lib/api/shop";
+import login from "@/lib/utils/login";
+import { getUserInfo } from "@/lib/api/user";
+import { getScoreList, exchangeScore } from "@/lib/api/shop";
 import listItem from "@/components/list-item/list-item.vue";
 
 export default {
@@ -45,11 +26,8 @@ export default {
   },
   data() {
     return {
-      statusBarHeight: 0, // 自定义导航
-      titleBarHeight: 44, // 自定义导航
-      BarHeight: 0, // 自定义导航
       userInfo: {},
-      modules: {},
+      modules: [],
       tabStyle: "",
       showTask: false,
     };
@@ -70,24 +48,24 @@ export default {
     const uinfoStr = uni.getStorageSync("userinfo");
     if (uinfoStr) {
       this.userInfo = JSON.parse(uinfoStr);
+      this.getUserInfo();
     } else {
       this.userInfo = {};
     }
-    // this.getTaskInfo();
   },
   onShareAppMessage() {
     return {
-      title: "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: "云果国潮会员中心",
       imageUrl:
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/index/index",
     };
   },
   onShareTimeline() {
     return {
-      title: "各种爆款手办/盲盒,还能0元抽热款~快来试试你的欧气!",
+      title: "云果国潮会员中心",
       imageUrl:
-        "https://chujianchaowan.oss-cn-beijing.aliyuncs.com/images/45bfb688e6e9dba557f64fd052e850cc.png",
+        "https://yggc.oss-cn-beijing.aliyuncs.com/images/81d939394aea637ac0f6a3026d1a38e6.jpg",
       path: "/pages/index/index",
     };
   },
@@ -95,41 +73,13 @@ export default {
     await this.loadModules().catch((e) => console.log(e));
     uni.stopPullDownRefresh();
   },
-  mounted() {
-    const systemInfo = uni.getSystemInfoSync();
-    this.statusBarHeight = systemInfo.statusBarHeight;
-
-    // #ifdef MP
-    this.statusBarHeight = systemInfo.statusBarHeight;
-    // this.titleBarHeight = systemInfo.statusBarHeight;
-    // #endif
-
-    // #ifdef MP-WEIXIN
-    this.statusBarHeight = systemInfo.statusBarHeight;
-    const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
-    this.titleBarHeight =
-      (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 +
-      menuButtonInfo.height;
-    // #endif
-
-    // #ifdef MP-ALIPAY
-    this.statusBarHeight = systemInfo.statusBarHeight;
-    this.titleBarHeight =
-      systemInfo.statusBarHeight + systemInfo.titleBarHeight;
-    // #endif
-
-    // #ifdef APP-PLUS
-    this.statusBarHeight = systemInfo.statusBarHeight;
-    // this.titleBarHeight = 44;
-    // #endif
-
-    // #ifdef H5
-    this.statusBarHeight = 0;
-    // this.titleBarHeight = systemInfo.statusBarHeight;
-    // #endif
-    this.BarHeight = this.statusBarHeight + this.titleBarHeight;
-  },
+  // mounted() {},
   methods: {
+    async getUserInfo() {
+      const res = await getUserInfo();
+      this.userInfo = { ...this.userInfo, ...res.data };
+      uni.setStorageSync("userinfo", JSON.stringify(this.userInfo));
+    },
     async loadModules() {
       try {
         const data = await getScoreList();
@@ -153,25 +103,51 @@ export default {
       }
     },
 
-    jumpModuleAll(url) {
-      if (!url) return;
+    login() {
+      return new Promise((resolve, reject) => {
+        login.wxLogin((userInfo) => {
+          if (userInfo.session) {
+            this.userInfo = userInfo;
+            this.getUserInfo().then(resolve);
+          } else reject();
+        });
+      });
+    },
+
+    async handleDetail(item) {
+      if (!this.userInfo || !this.userInfo.session) await this.login();
 
-      if (/^https?:\/\//i.test(url)) {
-        uni.navigateTo({
-          url: `../webview/webview?url=${encodeURIComponent(url)}`,
+      if (item.score > Number(this.userInfo.score)) {
+        uni.showToast({
+          icon: "none",
+          text: "积分不足",
         });
         return;
       }
-      uni.navigateTo({
-        url: url,
+
+      await new Promise((resolve, reject) => {
+        uni.showModal({
+          title: "提示",
+          content: "是否兑换当前商品?",
+          success: function (res) {
+            if (res.confirm) {
+              resolve();
+            } else if (res.cancel) {
+              reject();
+            }
+          },
+        });
       });
-    },
 
-    handleDetail(item) {
-      if (item.play_type === 1) {
-        this.jumpModuleAll(`../detail/detail?id=${item.id}`);
-      } else {
-        this.jumpModuleAll(`../reward/detail?id=${item.id}`);
+      const res = await exchangeScore({
+        sku_id: item.id,
+      });
+
+      if (res.errno === 10000) {
+        uni.showToast({
+          icon: "none",
+          text: "兑换成功",
+        });
       }
     },
   },