bayi 9 ay önce
ebeveyn
işleme
1d3ab33f8d

+ 11 - 161
components/donutBuy/index.js

@@ -1,173 +1,23 @@
-import {
-    androidbuyVip,
-    aliPay,
-    buyVip,
-} from '~/api/user'
-import {
-    userEvent
-} from '~/api/global'
-let app = getApp()
 Component({
+
     /**
      * 组件的属性列表
      */
     properties: {
 
     },
+
+    /**
+     * 组件的初始数据
+     */
     data: {
-        state: false,
-        product: {},
-        type: "wxpay",
-        items: [{
-                value: 'wxpay',
-                name: '微信',
-                checked: true
-            },
-            {
-                value: 'alipay',
-                name: '支付宝',
-                checked: false
-            },
-        ]
+
     },
+
+    /**
+     * 组件的方法列表
+     */
     methods: {
-        open(product) {
-            if (!product) {
-                return
-            }
-            this.setData({
-                product
-            })
-            // #if MP
-            this.toBuy()
-            // #elif ANDROID
-            if (this.getTabBar()) {
-                this.getTabBar().setData({
-                    mask: true
-                })
-            }
-            this.setData({
-                state: true,
-            })
-            // #endif
-        },
-        radioChange(e) {
-            const items = this.data.items
-            for (let i = 0, len = items.length; i < len; ++i) {
-                items[i].checked = items[i].value === e.detail.value
-            }
-            this.setData({
-                items,
-                type: e.detail.value
-            })
-        },
-        closeTranscript() {
-            if (this.getTabBar()) {
-                this.getTabBar().setData({
-                    mask: true
-                })
-            }
-            this.setData({
-                state: false
-            })
-        },
-        async toBuy() {
-            // #if MP
-            wx.showLoading({
-                title: '提交中',
-                mask: true
-            })
-            let res = await buyVip({
-                productId: this.data.product.id
-            }).finally(() => {
-                wx.hideLoading()
-            })
-            userEvent({
-                action: 'ANDROID_PAY_ACTIVITY',
-            })
-            let {
-                timeStamp,
-                nonceStr,
-                signType,
-                paySign
-            } = res
-            // package保留字
-            wx.requestPayment({
-                timeStamp,
-                nonceStr,
-                package: res.package,
-                signType,
-                paySign,
-                success: async (res) => {
-                    userEvent({
-                        action: 'ANDROID_PAY_SUCCESS',
-                    })
-                    setTimeout(() => {
-                        this.triggerEvent('reload')
-                        this.closeTranscript()
-                    }, 1500)
-                },
-                fail(res) {
-                    wx.showToast({
-                        title: "支付失败",
-                        icon: "none",
-                        duration: 3000
-                    })
-                }
-            })
-            // #elif ANDROID
-            if (this.data.type == 'wxPay') {
-                let res = await androidbuyVip({
-                    productId: this.data.product.id
-                }).finally(() => {
-                    wx.hideLoading()
-                })
-                wx.miniapp.requestPayment({
-                    timeStamp: res.timestamp,
-                    mchId: res.partnerid,
-                    prepayId: res.prepayid,
-                    package: res.package,
-                    nonceStr: res.noncestr,
-                    sign: res.sign,
-                    success: async (res) => {
-                        userEvent({
-                            action: 'ANDROID_PAY_SUCCESS',
-                        })
-                        setTimeout(() => {
-                            this.triggerEvent('reload')
-                            this.closeTranscript()
-                        }, 1500)
-                    },
-                    fail(res) {
-                        wx.showToast({
-                            title: "支付失败",
-                            icon: "none",
-                            duration: 3000
-                        })
-                    },
-                    complete: (res) => {
-                        console.error('wx.miniapp.requestPayment complete:', res)
-                    }
-                })
-            } else {
-                let res = await aliPay({
-                    productId: this.data.product.id
-                }).finally(() => {
-                    wx.hideLoading()
-                })
-                app.globalData.plugin.aliPay({
-                    orderInfo: res
-                }, (res) => {
-                    userEvent({
-                        action: 'ANDROID_PAY_SUCCESS',
-                    })
-                    setTimeout(() => {
-                        this.triggerEvent('reload')
-                        this.closeTranscript()
-                    }, 1500)
-                })
-            }
-            // #endif
-        },
+
     }
 })

+ 1 - 3
components/donutBuy/index.json

@@ -1,6 +1,4 @@
 {
     "component": true,
-    "usingComponents": {
-    },
-    "styleIsolation": "apply-shared"
+    "usingComponents": {}
 }

+ 4 - 106
components/donutBuy/index.less

@@ -1,110 +1,8 @@
-.gradeContainer {
-    width: 100%;
-    height: 100%;
-    background: rgba(0, 0, 0, .7);
-    display: flex;
-    justify-content: center;
-    align-items: center;
+.donutBuy {
     position: fixed;
     top: 0;
     left: 0;
-    z-index: 9999;
-    color: #000000;
-
-    .popBox {
-        position: relative;
-        width: 680rpx;
-        height: 678rpx;
-        box-sizing: border-box;
-        padding: 40rpx 46rpx 0rpx;
-        border-radius: 40rpx;
-        background-color: #F7F7F7;
-        overflow: hidden;
-
-        .title {
-            position: relative;
-            text-align: center;
-            font-size: 36rpx;
-            font-weight: 400;
-            color: #000000;
-
-            .close {
-                position: absolute;
-                padding: 20rpx;
-                width: 26rpx;
-                height: 26rpx;
-                right: 0rpx;
-                top: -30rpx;
-            }
-        }
-
-        .group {
-            margin-top: 20rpx;
-
-            .weui-cell {
-                padding: 60rpx 0 40rpx;
-                display: flex;
-                align-items: center;
-                justify-content: space-between;
-
-                .pay-row {
-                    display: flex;
-                    align-items: center;
-
-                    .wxpay {
-                        width: 62rpx;
-                        height: 52rpx;
-                    }
-
-                    .alipay {
-                        height: 62rpx;
-                        width: 62rpx;
-                    }
-
-                    .name {
-                        margin-left: 34rpx;
-                        font-size: 36rpx;
-                    }
-                }
-            }
-
-            .weui-cell:first-child {
-                border-bottom: 2rpx solid white;
-            }
-        }
-
-        .paymentBox {
-            position: absolute;
-            left: 0;
-            bottom: 0;
-            padding: 60rpx 40rpx;
-            box-sizing: border-box;
-            width: 100%;
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            background-color: white;
-
-            .payment {
-                display: flex;
-                align-items: center;
-                font-size: 36rpx;
-
-                .num {
-                    font-size: 36rpx;
-                    color: #FF6300;
-                }
-            }
-
-            .pay {
-                padding: 12rpx 52rpx;
-                background: #ff9108;
-                color: white;
-                font-weight: 500;
-                font-size: 40rpx;
-                border-radius: 45rpx;
-            }
-        }
-    }
-
+    width: 100%;
+    height: 100vh;
+    background: rgba(0, 0, 0, 0.7);
 }

+ 2 - 20
components/donutBuy/index.wxml

@@ -1,21 +1,3 @@
-<view class="gradeContainer" catchtouchmove='true' wx:if="{{state}}">
-    <view class="popBox zoomIn">
-        <view class="title">选择支付方式
-            <image src="/static/bclose.png" class="close" bindtap="closeTranscript" />
-        </view>
-        <radio-group catch:change="radioChange" class="group">
-            <label class="weui-cell" wx:for="{{items}}" wx:key="value">
-                <view class="pay-row">
-                    <image src="/static/{{item.value}}.png" class="{{item.value}}" />
-                    <view class="name">{{item.name}}支付</view>
-                </view>
-                <radio value="{{item.value}}" checked="{{item.checked}}" color='#FFAC00' />
-            </label>
-        </radio-group>
-        <view class="paymentBox">
-            <view class="payment">应付款:<view class="num">¥{{product.price/100}}</view>
-            </view>
-            <view class="pay" bindtap="toBuy">立即支付</view>
-        </view>
-    </view>
+<view class="donutBuy">
+    232323
 </view>

+ 3 - 90
components/donutBuy/index.wxss

@@ -1,95 +1,8 @@
-.gradeContainer {
-  width: 100%;
-  height: 100%;
-  background: rgba(0, 0, 0, 0.7);
-  display: flex;
-  justify-content: center;
-  align-items: center;
+.donutBuy {
   position: fixed;
   top: 0;
   left: 0;
-  z-index: 9999;
-  color: #000000;
-}
-.gradeContainer .popBox {
-  position: relative;
-  width: 680rpx;
-  height: 678rpx;
-  box-sizing: border-box;
-  padding: 40rpx 46rpx 0rpx;
-  border-radius: 40rpx;
-  background-color: #F7F7F7;
-  overflow: hidden;
-}
-.gradeContainer .popBox .title {
-  position: relative;
-  text-align: center;
-  font-size: 36rpx;
-  font-weight: 400;
-  color: #000000;
-}
-.gradeContainer .popBox .title .close {
-  position: absolute;
-  padding: 20rpx;
-  width: 26rpx;
-  height: 26rpx;
-  right: 0rpx;
-  top: -30rpx;
-}
-.gradeContainer .popBox .group {
-  margin-top: 20rpx;
-}
-.gradeContainer .popBox .group .weui-cell {
-  padding: 60rpx 0 40rpx;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-.gradeContainer .popBox .group .weui-cell .pay-row {
-  display: flex;
-  align-items: center;
-}
-.gradeContainer .popBox .group .weui-cell .pay-row .wxpay {
-  width: 62rpx;
-  height: 52rpx;
-}
-.gradeContainer .popBox .group .weui-cell .pay-row .alipay {
-  height: 62rpx;
-  width: 62rpx;
-}
-.gradeContainer .popBox .group .weui-cell .pay-row .name {
-  margin-left: 34rpx;
-  font-size: 36rpx;
-}
-.gradeContainer .popBox .group .weui-cell:first-child {
-  border-bottom: 2rpx solid white;
-}
-.gradeContainer .popBox .paymentBox {
-  position: absolute;
-  left: 0;
-  bottom: 0;
-  padding: 60rpx 40rpx;
-  box-sizing: border-box;
   width: 100%;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  background-color: white;
-}
-.gradeContainer .popBox .paymentBox .payment {
-  display: flex;
-  align-items: center;
-  font-size: 36rpx;
-}
-.gradeContainer .popBox .paymentBox .payment .num {
-  font-size: 36rpx;
-  color: #FF6300;
-}
-.gradeContainer .popBox .paymentBox .pay {
-  padding: 12rpx 52rpx;
-  background: #ff9108;
-  color: white;
-  font-weight: 500;
-  font-size: 40rpx;
-  border-radius: 45rpx;
+  height: 100vh;
+  background: rgba(0, 0, 0, 0.7);
 }