12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <template>
- <view class="unbind-wechat-container">
- <view class="header">解绑微信</view>
- <view class="desc">当前绑定微信:{{ wechatName }}</view>
- <button class="submit-btn" type="warn" @click="submit">确认解绑</button>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- wechatName: ''
- }
- },
- onLoad() {
- // 假设已存储微信名
- this.wechatName = uni.getStorageSync('wechatName') || '未绑定'
- },
- methods: {
- submit() {
- uni.showModal({
- title: '确认解绑',
- content: '解绑后将无法使用微信快捷登录,是否继续?',
- success: (res) => {
- if (res.confirm) {
- uni.request({
- url: 'http://localhost:9527/api/unbindWechat',
- method: 'POST',
- data: { uid: uni.getStorageSync('uid') },
- success: (res) => {
- if (res.statusCode === 200 && res.data.code === 200) {
- uni.showToast({ title: '解绑成功', icon: 'success' })
- setTimeout(() => uni.navigateBack(), 1000)
- } else {
- uni.showToast({ title: res.data.message || '解绑失败', icon: 'none' })
- }
- }
- })
- }
- }
- })
- }
- }
- }
- </script>
- <style scoped>
- .unbind-wechat-container {
- min-height: 100vh;
- background: #f7f8fa;
- padding: 40rpx 0;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .header {
- text-align: center;
- font-size: 36rpx;
- font-weight: bold;
- margin-bottom: 40rpx;
- background: #fff;
- padding: 32rpx 0;
- width: 100%;
- }
- .desc {
- font-size: 28rpx;
- color: #333;
- margin: 60rpx 0 40rpx 0;
- text-align: center;
- padding: 0 32rpx;
- }
- .submit-btn {
- width: 80%;
- background: #e74c3c;
- color: #fff;
- border-radius: 12rpx;
- font-size: 32rpx;
- margin-top: 16rpx;
- height: 80rpx;
- }
- </style>
|