|
|
@@ -5,7 +5,9 @@
|
|
|
<view class="title">
|
|
|
梅山古镇
|
|
|
</view>
|
|
|
- <view><image class="logo-img" src="/static/images/common/logo.png" mode="aspectFit" /></view>
|
|
|
+ <view>
|
|
|
+ <image class="logo-img" src="/static/images/common/logo.png" mode="aspectFit" />
|
|
|
+ </view>
|
|
|
<view class="head">
|
|
|
<u-swiper :list="list1"></u-swiper>
|
|
|
</view>
|
|
|
@@ -42,7 +44,8 @@
|
|
|
<image class="card-img" :src="item.front" mode="scaleToFill"></image>
|
|
|
</view>
|
|
|
<view class="card-back">
|
|
|
- <image class="card-img" :src="item.prizeType == 2 && item.img ? item.img : item.back"
|
|
|
+ <image class="card-img"
|
|
|
+ :src="item.prizeType == 2 && item.img ? item.img : item.back"
|
|
|
mode="scaleToFill"></image>
|
|
|
<view class="card-back-text">
|
|
|
<view v-show="item.prizeType == 0" class="card-text">很遗憾</view>
|
|
|
@@ -50,8 +53,10 @@
|
|
|
</view>
|
|
|
<view v-show="item.prizeType == 0" class="card-text">下次继续</view>
|
|
|
|
|
|
- <view v-show="item.prizeType == 2 && !item.img " class="card-text">恭喜您中奖了</view>
|
|
|
- <view v-show="item.prizeType == 2 && !item.img" class="card-text">{{item.prizeName}}</view>
|
|
|
+ <view v-show="item.prizeType == 2 && !item.img " class="card-text">恭喜您中奖了
|
|
|
+ </view>
|
|
|
+ <view v-show="item.prizeType == 2 && !item.img" class="card-text">
|
|
|
+ {{item.prizeName}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -60,76 +65,80 @@
|
|
|
</template>
|
|
|
|
|
|
</view>
|
|
|
- <u-popup :show="showWin" :round="10" mode="center" @close="close" @open="open" closeable="true">
|
|
|
- <view class="popup-flex">
|
|
|
- <view class="popup-content-scroll">
|
|
|
- <!-- 这里放原来的内容部分(除返回按钮) -->
|
|
|
- <view class="popup-view">
|
|
|
- <image src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/win.png"
|
|
|
- class="winImgClss"></image>
|
|
|
- </view>
|
|
|
- <view class="popup-content">
|
|
|
- <u-row customStyle="margin-bottom: 5px">
|
|
|
- <u-col span="6">
|
|
|
- <image :src="prizeJson.img" class="prize"></image>
|
|
|
- </u-col>
|
|
|
- <u-col span="6">
|
|
|
- <view>{{prizeJson.prize_name}}</view>
|
|
|
- </u-col>
|
|
|
- </u-row>
|
|
|
- <view class="popup-text">
|
|
|
- 请留下联系方式,稍后工作人员会联系您!
|
|
|
- </view>
|
|
|
- <u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
|
|
|
- <u-form-item label="姓名" prop="userInfo.name" ref="item1">
|
|
|
- <u--input v-model="model1.userInfo.name" border="none"></u--input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="电话" prop="userInfo.tel" ref="item1">
|
|
|
- <u--input v-model="model1.userInfo.tel" border="none"></u--input>
|
|
|
- </u-form-item>
|
|
|
- </u--form>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="popup-footer">
|
|
|
- <view class="save-button" @click="addWinDetail()">领取</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </u-popup>
|
|
|
-
|
|
|
- <u-popup :show="showUnWin" :round="10" mode="center" @close="close" @open="open" closeable="true">
|
|
|
- <view class="popup-flex">
|
|
|
- <view class="popup-content-scroll">
|
|
|
- <!-- 这里放原来的内容部分(除返回按钮) -->
|
|
|
- <view class="popup-view">
|
|
|
- <image src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/unWin.png"
|
|
|
- class="winImgClss"></image>
|
|
|
- </view>
|
|
|
- <view class="popup-content">
|
|
|
- <view class="">
|
|
|
- <image class="productImg" mode="widthFix"
|
|
|
- src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/product.png ">
|
|
|
- </image>
|
|
|
- </view>
|
|
|
- <view class="">
|
|
|
- {{ randomText }}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="popup-footer">
|
|
|
- <view class="save-button unWin" @click="close()">我知道了</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </u-popup>
|
|
|
-
|
|
|
- </view>
|
|
|
+ <u-popup :show="showWin" :round="10" mode="center" @close="close" @open="open" closeable="true">
|
|
|
+ <view class="popup-flex">
|
|
|
+ <view class="popup-content-scroll">
|
|
|
+ <!-- 这里放原来的内容部分(除返回按钮) -->
|
|
|
+ <view class="popup-view">
|
|
|
+ <image
|
|
|
+ src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/win.png"
|
|
|
+ class="winImgClss"></image>
|
|
|
+ </view>
|
|
|
+ <view class="popup-content">
|
|
|
+ <u-row customStyle="margin-bottom: 5px">
|
|
|
+ <u-col span="6">
|
|
|
+ <image :src="prizeJson.img" class="prize"></image>
|
|
|
+ </u-col>
|
|
|
+ <u-col span="6">
|
|
|
+ <view>{{prizeJson.prize_name}}</view>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
+ <view class="popup-text">
|
|
|
+ 请留下联系方式,稍后工作人员会联系您!
|
|
|
+ </view>
|
|
|
+ <u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
|
|
|
+ <u-form-item label="姓名" prop="userInfo.name" ref="item1">
|
|
|
+ <u--input v-model="model1.userInfo.name" border="none"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="电话" prop="userInfo.tel" ref="item1">
|
|
|
+ <u--input v-model="model1.userInfo.tel" border="none"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ </u--form>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="popup-footer">
|
|
|
+ <view class="save-button" @click="addWinDetail()">领取</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
+ <u-popup :show="showUnWin" :round="10" mode="center" @close="close" @open="open" closeable="true">
|
|
|
+ <view class="popup-flex">
|
|
|
+ <view class="popup-content-scroll">
|
|
|
+ <!-- 这里放原来的内容部分(除返回按钮) -->
|
|
|
+ <view class="popup-view">
|
|
|
+ <image
|
|
|
+ src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/unWin.png"
|
|
|
+ class="winImgClss"></image>
|
|
|
+ </view>
|
|
|
+ <view class="popup-content">
|
|
|
+ <view class="">
|
|
|
+ <image class="productImg" mode="widthFix"
|
|
|
+ src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/product.png ">
|
|
|
+ </image>
|
|
|
+ </view>
|
|
|
+ <view class="">
|
|
|
+ {{ randomText }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="popup-footer">
|
|
|
+ <view class="save-button unWin" @click="close()">我知道了</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
- <CustomTabbar />
|
|
|
+ <CustomTabbar />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
+ import {
|
|
|
+ randomTexts
|
|
|
+ } from '../../../utils/randomTexts.js';
|
|
|
import CustomTabbar from '@/components/tabbar.vue';
|
|
|
import {
|
|
|
addWinDetail,
|
|
|
@@ -251,12 +260,12 @@ import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
saveData: {},
|
|
|
scanCode: '',
|
|
|
saveStatus: true,
|
|
|
- fankaStatu:false,
|
|
|
- randomText: ""
|
|
|
+ fankaStatu: false,
|
|
|
+ randomText: ""
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.setRandomText();
|
|
|
+ this.setRandomText();
|
|
|
let scanDetail = uni.getStorageSync('scanDetail');
|
|
|
this.scanCode = uni.getStorageSync('scanCode');
|
|
|
this.model1.userInfo.qrcodeId = this.scanCode;
|
|
|
@@ -276,16 +285,17 @@ import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- setRandomText() {
|
|
|
- const randomIndex = Math.floor(Math.random() * randomTexts.length);
|
|
|
- this.randomText = randomTexts[randomIndex];
|
|
|
- },
|
|
|
+ setRandomText() {
|
|
|
+ const randomIndex = Math.floor(Math.random() * randomTexts.length);
|
|
|
+ this.randomText = randomTexts[randomIndex];
|
|
|
+ },
|
|
|
initCardData(clickJson) {
|
|
|
let list = JSON.parse(clickJson);
|
|
|
for (let i = 0; i < this.cards.length; i++) {
|
|
|
if (i == list.index) {
|
|
|
this.cards[i].checkStauts = true
|
|
|
}
|
|
|
+
|
|
|
this.cards[i].img = list['card' + i].img;
|
|
|
this.cards[i].flipped = true;
|
|
|
this.cards[i].prizeType = list['card' + i].prize_type == undefined ? list['card' + i].prizeType : list[
|
|
|
@@ -332,7 +342,7 @@ import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
this.showWin = false
|
|
|
},
|
|
|
flipCard(idx) {
|
|
|
- if(this.fankaStatu){
|
|
|
+ if (this.fankaStatu) {
|
|
|
return;
|
|
|
}
|
|
|
if (this.cards[idx].flipped) {
|
|
|
@@ -386,16 +396,19 @@ import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
that.saveData.index = idx;
|
|
|
|
|
|
for (let i = 0; i < that.totalDetail.length; i++) {
|
|
|
- that.saveData['card' + i] = that.totalDetail[i];
|
|
|
-
|
|
|
- that.cards[i].prizeType = that.totalDetail[i].prize_type == undefined ?
|
|
|
- that.totalDetail[i].prizeType :
|
|
|
- that.totalDetail[i].prize_type;
|
|
|
- that.cards[i].img = that.totalDetail[i].img;
|
|
|
- that.cards[i].money = that.totalDetail[i].money;
|
|
|
- that.cards[i].prizeName = that.totalDetail[i].prizeName == undefined ?
|
|
|
- that.totalDetail[i].prize_name :
|
|
|
- that.totalDetail[i].prizeName;
|
|
|
+ if (that.cards[i]) {
|
|
|
+ that.saveData['card' + i] = that.totalDetail[i];
|
|
|
+
|
|
|
+ that.cards[i].prizeType = that.totalDetail[i].prize_type == undefined ?
|
|
|
+ that.totalDetail[i].prizeType :
|
|
|
+ that.totalDetail[i].prize_type;
|
|
|
+ that.cards[i].img = that.totalDetail[i].img;
|
|
|
+ that.cards[i].money = that.totalDetail[i].money;
|
|
|
+ that.cards[i].prizeName = that.totalDetail[i].prizeName == undefined ?
|
|
|
+ that.totalDetail[i].prize_name :
|
|
|
+ that.totalDetail[i].prizeName;
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
that.saveAllCardData();
|
|
|
@@ -425,10 +438,11 @@ import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/bgi-two.png");
|
|
|
}
|
|
|
|
|
|
- .title{
|
|
|
- height: 4vh;
|
|
|
- line-height: 5vh;
|
|
|
- }
|
|
|
+ .title {
|
|
|
+ height: 4vh;
|
|
|
+ line-height: 5vh;
|
|
|
+ }
|
|
|
+
|
|
|
.head {
|
|
|
background-image:
|
|
|
url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/zhanshi.png");
|
|
|
@@ -697,7 +711,7 @@ import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
|
|
|
.card-text {
|
|
|
font-size: 26rpx;
|
|
|
- padding: 0rpx 10rpx;
|
|
|
+ padding: 0rpx 10rpx;
|
|
|
}
|
|
|
|
|
|
.select-tag {
|
|
|
@@ -715,14 +729,15 @@ import { randomTexts } from '../../../utils/randomTexts.js';
|
|
|
line-height: 15px;
|
|
|
z-index: 5;
|
|
|
}
|
|
|
- .logo-img {
|
|
|
- background-size: cover;
|
|
|
- /* 确保背景图片自适应填充整个容器 */
|
|
|
- background-position: center;
|
|
|
- /* 背景图片居中显示 */
|
|
|
- background-repeat: no-repeat;
|
|
|
- /* 防止背景图重复 */
|
|
|
- height: 42rpx;
|
|
|
- width: 180rpx
|
|
|
- }
|
|
|
+
|
|
|
+ .logo-img {
|
|
|
+ background-size: cover;
|
|
|
+ /* 确保背景图片自适应填充整个容器 */
|
|
|
+ background-position: center;
|
|
|
+ /* 背景图片居中显示 */
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ /* 防止背景图重复 */
|
|
|
+ height: 42rpx;
|
|
|
+ width: 180rpx
|
|
|
+ }
|
|
|
</style>
|