|
|
|
|
@ -1,33 +1,33 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="changecontainer">
|
|
|
|
|
<view class="cardcontent">
|
|
|
|
|
<view class="myswiper">
|
|
|
|
|
<swiper class="swiper" circular :indicator-dots="true" :indicator-color="indicatorColor"
|
|
|
|
|
:indicator-active-color="indicatorActiveColor" :autoplay="autoplay" :interval="interval"
|
|
|
|
|
:duration="duration" :current="currentSwiperIndex" @change="onSwiperChange">
|
|
|
|
|
<swiper-item v-for="item in banner3">
|
|
|
|
|
<view class="swiper-item">
|
|
|
|
|
<image :src="item.image" mode="widthFix"></image>
|
|
|
|
|
</view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
|
|
|
|
|
<view class="myswiper">
|
|
|
|
|
<swiper class="swiper" circular :indicator-dots="true" :indicator-color="indicatorColor"
|
|
|
|
|
:indicator-active-color="indicatorActiveColor" :autoplay="autoplay" :interval="interval"
|
|
|
|
|
:duration="duration" :current="currentSwiperIndex" @change="onSwiperChange">
|
|
|
|
|
<swiper-item v-for="item in banner3">
|
|
|
|
|
<view class="swiper-item">
|
|
|
|
|
<image :src="item.image" mode="widthFix"></image>
|
|
|
|
|
</view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
|
|
|
|
|
</swiper>
|
|
|
|
|
<view class="cardtitle">卡片信息</view>
|
|
|
|
|
<view class="cardtitle">卡券信息</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cardinfobox">
|
|
|
|
|
<view class="cardlist">
|
|
|
|
|
<view class="cardinfolist">
|
|
|
|
|
<view class="listitem">
|
|
|
|
|
<view>卡片名称</view>
|
|
|
|
|
<text>红金款999型蟹卡</text>
|
|
|
|
|
<view>卡券名称</view>
|
|
|
|
|
<text>{{cardinfo.card?cardinfo.card.sku.name:""}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="listitem">
|
|
|
|
|
<view>卡片有效期</view>
|
|
|
|
|
<text>卡片至2025年10月31日有效</text>
|
|
|
|
|
<view>卡券编号</view>
|
|
|
|
|
<text>{{cardinfo.card_number}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cardbtn" @click="saveImg">点击保存图片</view>
|
|
|
|
|
<view class="cardbtn" @click="toHome">返回首页</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -41,54 +41,69 @@
|
|
|
|
|
components: {},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
autoplay: true,
|
|
|
|
|
interval: 3000,
|
|
|
|
|
duration: 500,
|
|
|
|
|
indicatorColor: 'rgba(204,204,203,.5)',
|
|
|
|
|
indicatorActiveColor: '#b98b44',
|
|
|
|
|
currentSwiperIndex: 0,
|
|
|
|
|
banner3:[]
|
|
|
|
|
autoplay: true,
|
|
|
|
|
interval: 3000,
|
|
|
|
|
duration: 500,
|
|
|
|
|
indicatorColor: 'rgba(204,204,203,.5)',
|
|
|
|
|
indicatorActiveColor: '#b98b44',
|
|
|
|
|
currentSwiperIndex: 0,
|
|
|
|
|
banner3: [],
|
|
|
|
|
cardinfo: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.banner3 = uni.getStorageSync("banner3") ? uni.getStorageSync("banner3") : []
|
|
|
|
|
|
|
|
|
|
this.banner3 = uni.getStorageSync("banner3") ? uni.getStorageSync("banner3") : []
|
|
|
|
|
if (uni.getStorageSync("vuex_card_state")) {
|
|
|
|
|
this.cardinfo = uni.getStorageSync("vuex_card_state")
|
|
|
|
|
uni.removeStorageSync("vuex_card_state")
|
|
|
|
|
} else {
|
|
|
|
|
toast("未查询到卡券信息")
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/card/index'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
saveImg() {
|
|
|
|
|
let _this = this
|
|
|
|
|
let fileName = new Date().valueOf()
|
|
|
|
|
let filePath = wx.env.USER_DATA_PATH + '/' + fileName + '.jpg'
|
|
|
|
|
uni.authorize({
|
|
|
|
|
scope: 'scope.writePhotosAlbum',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
uni.downloadFile({
|
|
|
|
|
url: '../../static/cardimg1.jpg',
|
|
|
|
|
filePath: filePath,
|
|
|
|
|
success(res) {
|
|
|
|
|
console.log(res)
|
|
|
|
|
uni.saveImageToPhotosAlbum({
|
|
|
|
|
filePath: filePath,
|
|
|
|
|
success: function() {
|
|
|
|
|
toast('保存成功')
|
|
|
|
|
},
|
|
|
|
|
fail(res) {
|
|
|
|
|
console.log("fail-saveImageToPhotosAlbum", res)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
fail(res) {
|
|
|
|
|
console.log("fail-downloadFile", res)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
fail(res) {
|
|
|
|
|
console.log("user", res)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
toHome(){
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url:"/pages/home/home"
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
saveImg() {
|
|
|
|
|
|
|
|
|
|
// let _this = this
|
|
|
|
|
// let fileName = new Date().valueOf()
|
|
|
|
|
// let filePath = wx.env.USER_DATA_PATH + '/' + fileName + '.jpg'
|
|
|
|
|
// uni.authorize({
|
|
|
|
|
// scope: 'scope.writePhotosAlbum',
|
|
|
|
|
// success: (res) => {
|
|
|
|
|
// uni.downloadFile({
|
|
|
|
|
// url: '../../static/cardimg1.jpg',
|
|
|
|
|
// filePath: filePath,
|
|
|
|
|
// success(res) {
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// uni.saveImageToPhotosAlbum({
|
|
|
|
|
// filePath: filePath,
|
|
|
|
|
// success: function() {
|
|
|
|
|
// toast('保存成功')
|
|
|
|
|
// },
|
|
|
|
|
// fail(res) {
|
|
|
|
|
// console.log("fail-saveImageToPhotosAlbum", res)
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// fail(res) {
|
|
|
|
|
// console.log("fail-downloadFile", res)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
// fail(res) {
|
|
|
|
|
// console.log("user", res)
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|