瀏覽代碼

刮刮卡

贺智强 4 年之前
父節點
當前提交
00ff0bbad7
共有 3 個文件被更改,包括 50 次插入22 次删除
  1. 45 17
      plugins/scratch/index/index.vue
  2. 4 4
      plugins/scratch/prize/prize.vue
  3. 1 1
      plugins/scratch/rule/rule.vue

+ 45 - 17
plugins/scratch/index/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -6,7 +6,10 @@
                 <view class="scratch-head">
                     <view class="s-h" @click="rules">规则</view>
                     <view class="s-h" @click="share">分享</view>
-                    <app-share-qr-code-poster v-model="shareShow" :url="poster" title="生成海报"></app-share-qr-code-poster>
+                    <app-share-qr-code-poster @share="hShareAppMessage"
+                                              v-model="shareShow"
+                                              :url="poster" title="生成海报"
+                    ></app-share-qr-code-poster>
                 </view>
                 <view class="scratch-oppty">
                     <view>您还有
@@ -34,13 +37,15 @@
                                     @touchend="touchEnd"
                                     disable-scroll></canvas>
                             <view v-if="is_name" class="award-name">
-                                <text>{{list.name}}</text>
+                                <text>{{list ? list.name : ''}}</text>
                                 <app-button v-if="oppty > 0" @click="onStart" background="#f05525" height="80"
                                             width="400"
+                                            border-color="#f05525"
                                             color="#FFFFFF" font-size="32" round>再刮一次
                                 </app-button>
                                 <app-button v-if="oppty == 0" @click="onStart" background="#cdcdcd" height="80"
                                             width="400"
+                                            border-color="#cdcdcd"
                                             color="#FFFFFF" font-size="32" round>再刮一次
                                 </app-button>
                             </view>
@@ -49,12 +54,12 @@
                 </view>
                 <view class="dir-left-nowrap main-center cross-center end">
                     <view @click="home" class="dir-left-nowrap cross-center box-grow-0 left">
-                        <icon class="end-icon home"></icon>
+                        <icon class="end-icon home" type></icon>
                         <view>回到首页</view>
                     </view>
                     <view @click="prize" class="dir-left-nowrap cross-center box-grow-0">
                         <view>我的中奖记录</view>
-                        <icon class="end-icon price"></icon>
+                        <icon class="end-icon price" type></icon>
                     </view>
                 </view>
                 <view class="prize">
@@ -79,14 +84,15 @@
                     <view class="act-modal-bg"></view>
                     <view class="act-modal-pic cross-center main-center">
                         <view class="success main-center">
-                            <icon class="image-bg" :style="{'background-image': `url(${appImg.scratch_win})`}">></icon>
+                            <icon class="image-bg" :style="{'background-image': `url(${appImg.scratch_win})`}" type></icon>
                             <view class="dir-top-nowrap name main-center">
                                 <view>恭喜获得</view>
                                 <text class="main-center">{{list.name}}</text>
                             </view>
                         </view>
                         <view class="act-modal-end dir-top-nowrap cross-center main-center">
-                            <app-button @click="onStart" height="72" width="320" color="#FFFFFF" background="#f05525"
+                            <app-button @click="onStart" height="72" width="320" color="#FFFFFF"  background="#f05525"
+                                        border-color="#f05525"
                                         round>再刮一次
                             </app-button>
                             <view class="act-zh">奖品已放入您的账号</view>
@@ -123,7 +129,7 @@ export default {
             lastX,
             lastY,
             logs: [],
-                setting: null,
+                setting: {},
                 list: null,
                 oppty: 0,
                 msg: '', //错误信息
@@ -147,20 +153,26 @@ export default {
                 }
             }
         },
-        onUnload: function () {
+        onUnload () {
             clearInterval(this.interval);
         },
-        onHide: function () {
+        onHide () {
             clearInterval(this.interval);
         },
-        onShareAppMessage: function () {
-            return this.$shareAppMessage({
+        // #ifdef MP-WEIXIN
+        onLoad(options) { this.$commonLoad.onload(options);
+            wx.showShareMenu({
+                withShareTicket: true,
+                menus: ['shareAppMessage', 'shareTimeline']
+            })
+        },
+        onShareTimeline() {
+            return this.$shareTimeline({
                 title: this.$children[0].navigationBarTitle,
-                path: '/plugins/scratch/index/index',
-                params: {}
+                query: {}
             });
         },
-
+        // #endif
         onShow() {
             const self = this;
             self.$showLoading({title: '加载中'});
@@ -184,7 +196,23 @@ export default {
             }, 10000)
         },
 
+        // #ifdef MP
+        onShareAppMessage() {
+            return this.$shareAppMessage({
+                title: this.$children[0].navigationBarTitle,
+                path: '/plugins/scratch/index/index',
+                params: {}
+            });
+        },
+        // #endif
         methods: {
+            hShareAppMessage(s = false){
+                return this.$shareAppMessage({
+                    title: this.$children[0].navigationBarTitle,
+                    path: '/plugins/scratch/index/index',
+                    params: {}
+                }, s);
+            },
             register() {
                 if (this.msg) {
                     uni.showToast({icon: `none`, title: this.msg});
@@ -343,7 +371,7 @@ export default {
 <style scoped lang="scss">
     .app-layout /deep/ .app-layout {
         background: #5e00b8;
-        min-height: calc(100vh - var(--window-top));
+        min-height: 100vh;
     }
     .scratch-canvas {
         width: #{600rpx};
@@ -360,7 +388,7 @@ export default {
             position: absolute;
             left: 0;
             top: 0;
-            height: calc(100vh - var(--window-top));
+            height: 100vh;
             width: #{100%};
             display: block;
             background-repeat: no-repeat;
@@ -614,7 +642,7 @@ export default {
             left: 0;
 
             .image-bg {
-                height: #{731rpx};
+                height: #{733rpx};
                 width: 100%;
                 background-repeat: no-repeat;
                 background-size: 100% 100%;

+ 4 - 4
plugins/scratch/prize/prize.vue

xqd xqd
@@ -8,9 +8,9 @@
                     <view class="time" v-text="v.created_at"></view>
                 </view>
                 <view class="box-grow-0">
-                    <app-button @click="submit(v)" v-if="v.status == 1 && v.type == 4" background="#FFFFFF" height="56" width="164" color="#FF4544" font-size="28" round>立即兑换</app-button>
-                    <app-button v-if="v.status == 2 && v.type == 4" background="#CDCDCD" height="56" width="164" color="#FFFFFF" font-size="28" disabled round>已兑换</app-button>
-                    <app-button v-if="v.status == 2 && v.type != 4" background="#CDCDCD" height="56" width="164" color="#FFFFFF" font-size="28" disabled round>已发放</app-button>
+                    <app-button @click="submit(v)" v-if="v.status == 1 && v.type == 4" background="#FFFFFF" height="56" width="170" color="#FF4544" font-size="27" round>立即兑换</app-button>
+                    <app-button v-if="v.status == 2 && v.type == 4" background="#CDCDCD" height="56" width="170" color="#FFFFFF" font-size="27" disabled round>已兑换</app-button>
+                    <app-button v-if="v.status == 2 && v.type != 4" background="#CDCDCD" height="56" width="170" color="#FFFFFF" font-size="27" disabled round>已发放</app-button>
                 </view>
             </view>
         </block>
@@ -23,7 +23,7 @@
         components: {},
         data() {
             return {
-                list: null,
+                list: [],
                 page: 1,
                 args: false,
                 load: false,

+ 1 - 1
plugins/scratch/rule/rule.vue

xqd
@@ -17,7 +17,7 @@
                 rules: '',
             }
         },
-        onLoad: function (options) {
+        onLoad(options) { this.$commonLoad.onload(options);
             const self = this;
             self.$request({
                 url: self.$api.scratch.setting,