| <template> |
| <view class="otherPay"> |
| <u-cell-group> |
| <u-cell-item title="指纹" :arrow="false"> |
| <u-icon slot="icon" size="32" name="fingerprint"></u-icon> |
| <u-switch slot="right-icon" v-model="checked" @change="isOtherPay"></u-switch> |
| </u-cell-item> |
| </u-cell-group> |
| </view> |
| </template> |
| |
| <script> |
| export default { |
| data() { |
| return { |
| checked: false |
| } |
| }, |
| onLoad() { |
| let that = this |
| let openFingerPay = wx.getStorageSync("openFingerPay") |
| if (openFingerPay) { |
| that.checked = true |
| } |
| }, |
| methods: { |
| isOtherPay(e) { |
| let that = this |
| if (e) { |
| uni.showModal({ |
| title: "提示", |
| content: "是否开启指纹支付", |
| complete(res) { |
| if (res.confirm) { |
| that.checked = true |
| uni.setStorageSync("openFingerPay", true) |
| } else if (res.cancel) { |
| that.checked = false |
| } |
| } |
| }) |
| } else { |
| uni.showModal({ |
| title: "提示", |
| content: "是否关闭指纹支付", |
| complete(res) { |
| if (res.confirm) { |
| that.checked = false |
| uni.removeStorageSync("openFingerPay") |
| } else if (res.cancel) { |
| that.checked = true |
| } |
| } |
| }) |
| } |
| } |
| } |
| } |
| </script> |
| |
| <style scoped lang="scss"> |
| |
| </style> |