卡券查询

main
lion 1 year ago
parent d192cd8edf
commit feba70a787

@ -12,22 +12,22 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="cardtitle">信息</view> <view class="cardtitle">信息</view>
</view> </view>
<view class="cardinfobox"> <view class="cardinfobox">
<view class="cardlist"> <view class="cardlist">
<view class="cardinfolist"> <view class="cardinfolist">
<view class="listitem"> <view class="listitem">
<view>名称</view> <view>名称</view>
<text>红金款999型蟹卡</text> <text>{{cardinfo.card?cardinfo.card.sku.name:""}}</text>
</view> </view>
<view class="listitem"> <view class="listitem">
<view>片有效期</view> <view>券编号</view>
<text>卡片至2025年10月31日有效</text> <text>{{cardinfo.card_number}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="cardbtn" @click="saveImg"></view> <view class="cardbtn" @click="toHome"></view>
</view> </view>
</view> </view>
</view> </view>
@ -47,48 +47,63 @@
indicatorColor: 'rgba(204,204,203,.5)', indicatorColor: 'rgba(204,204,203,.5)',
indicatorActiveColor: '#b98b44', indicatorActiveColor: '#b98b44',
currentSwiperIndex: 0, currentSwiperIndex: 0,
banner3:[] banner3: [],
cardinfo: {}
} }
}, },
onLoad() { 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: { methods: {
toHome(){
saveImg() { uni.switchTab({
let _this = this url:"/pages/home/home"
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)
}
}) })
},
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)
// }
// })
} }
} }

Loading…
Cancel
Save