فهرست منبع

Merge branch 'develop/3.1.0' into test

DESKTOP-SVI9JE1\muzen 2 سال پیش
والد
کامیت
b55052fb95
1فایلهای تغییر یافته به همراه18 افزوده شده و 19 حذف شده
  1. 18 19
      src/pages/activity/index.vue

+ 18 - 19
src/pages/activity/index.vue

@@ -1,16 +1,16 @@
 <template>
-  <view class='app-container' :style="{'height': pic ? '' : '100%'}">
-    <img :src="pic" />
+  <view class='app-container' :style="{ 'height': pic ? '' : '100%' }">
+    <img v-if="pic" :src="pic" />
     <button class="submit" type="submit" circle @click="getSubmit">立即兑换</button>
 
     <!-- 弹窗 -->
     <uni-popup ref="popup" type="center" :is-mask-click="false">
       <view class="popup">
-        <h3>{{ isShow ? '兑换成功' : '抱歉' }}</h3>
+        <h3>兑换成功</h3>
         <view class="center">{{ content }}</view>
         <view class="submit-btn">
           <button type="submit" circle @click="getClose">确定</button>
-          <span>{{ isShow ? '该套餐内容仅可在WIFI/移动数据模式下收听' : '' }}</span>
+          <span>该套餐内容仅可在WIFI/移动数据模式下收听</span>
         </view>
       </view>
     </uni-popup>
@@ -58,21 +58,20 @@ export default {
 
     // 立即领取
     getSubmit() {
-      this.$refs.popup.open()
-      if (this.form.type == 2 || this.form.type == 4) {
-        submit(this.form).then(res => {
-          if (res.data.code === 0) {
-            this.content = res.data.data
-            this.isShow = true
-          } else {
-            this.content = res.data.message
-            this.isShow = false
-          }
-        })
-      } else {
-        this.content = '请在WIFI/4G模式下连接设备'
-        this.isShow = false
-      }
+      submit(this.form).then(res => {
+        if (res.data.code === 0) {
+          this.$refs.popup.open()
+          this.content = res.data.data
+          this.isShow = true
+        } else {
+          uni.showToast({
+            title: res.data.message,
+            icon: 'none',
+            mask: true,
+            duration: 2000
+          })
+        }
+      })
     },
 
     // 关闭弹窗