示例#1
0
        public void OnClickCommit()
        {
            if (inputName.text != "" && inputPhone.text != "" && inputAddress.text != "" && inputBeaty.text != "")
            {
                //                if (StoreController.Instance.currentSellNumber == 0)
                //                {
                //                    CommitController.Instance.OidExchangeReq(LoginModel.Instance.Uid, 1, inputName.text, inputPhone.text, inputAddress.text + Carriage.text, inputBeaty.text);
                //                }
                //                else
                if (Provincedropdown.value != 0 && CityDropDown.value != 0 && PinPaiDropDown.value != 0)
                {
                    CommitViewModel cvm = CommitViewModel.Instance;
                    cvm.Address = inputAddress.text;

                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", inputAddress.text, "test1"));

                    cvm.Name         = inputName.text;
                    cvm.Beaty        = inputBeaty.text;
                    cvm.Phone        = inputPhone.text;
                    cvm.SelectPinpai = PinPaiDropDown.value;
                    cvm.Country      = CountryDropDown.captionText.text;
                    cvm.Province     = Provincedropdown.captionText.text;
                    cvm.City         = CityDropDown.captionText.text;
                    cvm.SelectPinpai = cvm.brands[PinPaiDropDown.captionText.text].id;
                    if (CommitViewModel.Instance.Postage > 0)
                    {
                        PayOrderInterfaceMgr.Instance.payfor = PayFor.Exchange;

                        ViewMgr.Instance.Open(ViewNames.PayChooseView);
                    }
                    else
                    {
                        SystemMsgView.SystemFunction(Function.Tip, Info.Null);
                    }
                    //                Debug.LogError(string.Format("<color=#ff0000ff><---{0}-{1}----></color>", "test", "test1"));
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.ChooseFieldNotRight);
                }
            }
            else
            {
                SystemMsgView.SystemFunction(Function.Tip, Info.InputFieldNotNull);
            }
        }
示例#2
0
        private void OnEnsurePayClik()
        {
            //直接登录模式直接调起
            if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Login && !PlayerSave.HasKey("Login"))
            {
                NativeHandle handle = new NativeHandle();
                if (type == payType.alipay)
                {
                    object payData = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.alipay, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                    if (payData != null)
                    {
                        handle.Alipay(payData.ToString());

                        Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", payData.ToString(), "test1"));
                    }
                }
                else if (type == payType.wechat)
                {
                    object o = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.wx, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                    if (o != null)
                    {
                        PayData payData = o as PayData;
                        handle.WechatPay(payData.appid, payData.partnerid, payData.prepayid, payData.noncestr, payData.timestamp, payData.package, payData.sign);
                    }
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.Chooseone);
                }
            }
            else if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Exchange)
            {
                CommitViewModel cvm = CommitViewModel.Instance;
                CommitController.Instance.OidExchangeReq(LoginModel.Instance.Uid, 1, cvm.Name, cvm.Phone, cvm.Province, cvm.City, cvm.Country, cvm.SelectPinpai, cvm.Address, cvm.Beaty, (int)type);
            }
            EnsurePay.onClick.RemoveListener(OnEnsurePayClik);
        }