1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <template>
- <view class="activity">
- <image :src="banner" mode="widthFix" @click="previewImg()"></image>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- webviewStyles: {
- progress: {
- color: '#FF3333'
- }
- },
- banner:'',
- productImage:[],
- }
- },
- onLoad(option) {
- this.banner = option.image
- this.productImage.push(option.image)
- uni.setNavigationBarTitle({title:option.title});
- },
- methods:{
- navToDetailPage() {//跳转商品详情页
- this.$api.navigateTo(`/pages/goods/product?id=${this.productID}`)
- },
- previewImg (index) {//顶部商品图片预览
- let previewUrls = this.productImage
- uni.previewImage({
- current: 0, //图片索引
- urls: previewUrls, //必须是http图片,本地图片无效
- longPressActions:''
- })
- }
- }
- }
- </script>
-
- <style lang="scss">
- .activity{
- width: 100%;
- height: auto;
- image{
- width: 100%;
- height: auto;
- }
- }
- </style>
|