This commit is contained in:
魏啾
2024-04-15 18:00:57 +08:00
parent f79cc209fb
commit b15cf00d76
3 changed files with 161 additions and 33 deletions

View File

@@ -1,6 +1,7 @@
<template>
<view class="towcontent flex-between">
<view class="towcontent_item flex-colum" v-for="(item,index) in district" :key="index">
<view class="towcontent_item flex-colum" v-for="(item,index) in district" :key="index"
@click="clickdistrict(item,index)">
<image :src="item.coverImg" mode="aspectFill"></image>
<text>{{item.name}}</text>
</view>
@@ -28,6 +29,53 @@
default: ''
},
},
methods: {
clickdistrict(item) {
uni.pro.navigateTo('index/coupons/index');
switch (item.jumpType) {
case 'absolute':
uni.pro.navigateTo('webview/webview', {
url: item.absUrl
});
break;
case 'relative':
uni.pro.navigateTo(item.absUrl);
break;
case 'scan':
if (!uni.utils.pluschooseImage()) {
return false
}
// #ifdef H5
if (this.wxSdk) {
wx.scanQRCode({
needResult: 1, // 默认为0扫描结果由微信处理1则直接返回扫描结果
scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
success: res => {
// 当needResult 为 1 时,扫码返回的结果
console.log(res.resultStr,res)
}
});
} else {
uni.showModal({
title: '注意',
content: '微信sdk初始化失败请重新加载',
success: res => {
window.location.reload();
}
});
}
// #endif
// #ifdef APP || MP-WEIXIN
uni.scanCode({
success: res => {
console.log(res.result,res)
}
});
// #endif
break;
}
}
}
};
</script>

View File

@@ -0,0 +1,46 @@
<template>
<view class="container">
<view class="containertop">
<view class="containertopbox">
<view class="containertopboxone flex-start">
<view>可使用红包</view>
<view>200</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
}
};
</script>
<style scoped lang="scss">
.container {
.containertop {
padding: 48rpx 32rpx;
.containertopbox {
.containertopboxone{
view{
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
text{
margin-left: 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
}
}
}
}
</style>