Commit 4fe88f23 authored by 王海's avatar 王海

Merge remote-tracking branch 'origin/master'

parents 6f502ee4 a6323d0f
......@@ -10,6 +10,7 @@
<w>huanggai</w>
<w>huangxin</w>
<w>inputer</w>
<w>kongming</w>
<w>kongrun</w>
<w>likui</w>
<w>liubei</w>
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xingdata.zzdpos">
package="com.xingdata.zzdpos">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<application
android:name=".App"
......@@ -19,57 +19,56 @@
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:label="@string/main_title"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustUnspecified|stateHidden">
</activity>
android:windowSoftInputMode="adjustUnspecified|stateHidden"></activity>
<activity
android:name=".ui.splash.SplashActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.login.LoginActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.exception.ErrorDialogActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/Theme.AppCompat.Light.Dialog"/>
android:theme="@style/Theme.AppCompat.Light.Dialog" />
<activity
android:name=".ui.exception.ServerErrActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/Theme.AppCompat.Light.Dialog"/>
android:theme="@style/Theme.AppCompat.Light.Dialog" />
<activity
android:name=".ui.payment.PaymentActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.marketing.integral.IntegralActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.marketing.ticket.ReturnTicketActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:label="@string/title_activity_ticket"
android:theme="@style/AppTheme"/>
android:theme="@style/AppTheme" />
<activity
android:name=".ui.settle.SettleActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden"/>
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.announcement.AnnouncementActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity android:name=".ui.help.HelpActivity" />
<activity android:name=".ui.feedback.FeedBackActivity"></activity>
</application>
</manifest>
\ No newline at end of file
......@@ -194,7 +194,7 @@ interface ApiService {
Observable<HttpMessage<String>> addOrderMis(@Body Saleorder.Param saleorderParam);
@POST(C.URL.SALEORDER.addOrderPayMis)
Observable<HttpMessage<String>> addOrderPayMis(@Body Saleorder.Pay saleorderPay);
Observable<HttpMessage<Saleorder>> addOrderPayMis(@Body Saleorder.Pay saleorderPay);
@POST(C.URL.USER.query)
Observable<HttpMessage<Pager<Vip>>> queryDetailByWD(@Query("wd") String keyword, @Query
......
......@@ -10,6 +10,7 @@ import android.view.KeyEvent;
import android.view.View;
import com.hwangjr.rxbus.RxBus;
import com.xingdata.zzdpos.util.InstanceUtil;
import java.lang.reflect.ParameterizedType;
import java.util.ArrayList;
......@@ -17,7 +18,6 @@ import java.util.List;
import me.yokeyword.fragmentation.ISupportFragment;
import me.yokeyword.fragmentation.SupportActivity;
import com.xingdata.zzdpos.util.InstanceUtil;
/**
* BaseActivity,供新创建的Activity继承
......@@ -57,11 +57,9 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
protected void initPresenter() {
if (this instanceof BaseView &&
this.getClass().getGenericSuperclass() instanceof ParameterizedType &&
((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments().length > 0) {
Class mPresenterClass = (Class) ((ParameterizedType) (this.getClass()
.getGenericSuperclass())).getActualTypeArguments()[0];
if (this instanceof BaseView && this.getClass().getGenericSuperclass() instanceof ParameterizedType
&& ((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments().length > 0) {
Class mPresenterClass = (Class) ((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments()[0];
mPresenter = InstanceUtil.getInstance(mPresenterClass);
mPresenter.setIntent(getIntent()).setView(this).build();
}
......
......@@ -35,7 +35,6 @@ public abstract class BasePresenter<V> {
protected Realm getRealm() {
if (mRealm == null) {
mRealm = Realm.getInstance(App.instance.mRealmConfig);
// mRealm.setAutoRefresh(false);
}
return mRealm;
}
......
package com.xingdata.zzdpos.db;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.base.BaseModel;
import com.xingdata.zzdpos.model.HandoverInfo;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
import io.realm.Realm;
import io.realm.RealmModel;
import io.realm.RealmObject;
import io.realm.RealmQuery;
import io.realm.RealmResults;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.base.BaseModel;
import io.realm.Sort;
public class DBFactory {
public static class Main {
/**
* 查询交班记录
*/
public static HandoverInfo queryHandoverInfo(Long operId, String date) {
return DB.getInstance().get(MainPresenter.class).where(HandoverInfo.class)
.equalTo("operId", operId)
.equalTo("date", date)
.findFirst();
}
/**
* 更改交班记录
*/
public static void updateHandoverInfo(HandoverInfo handoverInfo) {
DB.getInstance().get(MainPresenter.class).executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
realm.copyToRealmOrUpdate(handoverInfo);
}
});
}
}
public static class Settle {
/**
* 查询支付渠道
*
* @return 支付渠道
*/
public static Observable<List<Pay>> queryPays() {
RealmQuery<Pay> query = DB.getInstance().get(SettlePresenter.class).where(Pay.class);
query.equalTo("payDispFlag", 1);
return Observable.just(query.findAll())
.flatMap(pays -> Observable.just(getList(pays)));
}
/**
* 查询营销活动
*
* @return 营销活动
*/
public static Observable<List<Ms>> queryMss() {
RealmQuery<Ms> query = DB.getInstance().get(SettlePresenter.class).where(Ms.class);
query.equalTo("msStatus", 0);
return Observable.just(query.findAllSorted("msTouchTag2", Sort.DESCENDING))
.flatMap(ms -> Observable.just(getList(ms)));
}
}
public static <E extends RealmModel> List<E> getLimitList(RealmResults<E> data, int offset, int limit) {
......
......@@ -2,7 +2,6 @@ package com.xingdata.zzdpos.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseBean;
import com.xingdata.zzdpos.base.BaseModel;
......@@ -40,64 +39,32 @@ public class Pay extends RealmObject implements BaseModel, BaseBean {
public void init() {
switch (getPayType()) {
case C.PAY_CHANNEL.CASH:
iconId = new int[]{R.mipmap.pay_xianjin_no, R.mipmap.pay_xianjin};
// iconId = new int[]{R.mipmap.pay_xianjin_no, R.mipmap.pay_xianjin};
isSelected = true;
break;
case C.PAY_CHANNEL.ALI:
iconId = new int[]{R.mipmap.pay_zhifubao_no, R.mipmap.pay_zhifubao};
// iconId = new int[]{R.mipmap.pay_zhifubao_no, R.mipmap.pay_zhifubao};
break;
case C.PAY_CHANNEL.WECHAT:
iconId = new int[]{R.mipmap.pay_weixin_no, R.mipmap.pay_weixin};
// iconId = new int[]{R.mipmap.pay_weixin_no, R.mipmap.pay_weixin};
break;
case C.PAY_CHANNEL.BANK:
iconId = new int[]{R.mipmap.pay_yinlian_no, R.mipmap.pay_yinlian};
// iconId = new int[]{R.mipmap.pay_yinlian_no, R.mipmap.pay_yinlian};
break;
case C.PAY_CHANNEL.CARD:
iconId = new int[]{R.mipmap.pay_chuzhi_no, R.mipmap.pay_chuzhi};
// iconId = new int[]{R.mipmap.pay_chuzhi_no, R.mipmap.pay_chuzhi};
isNeedVip = true;
break;
case C.PAY_CHANNEL.TALLY:
iconId = new int[]{R.mipmap.pay_shezhang_no, R.mipmap.pay_shezhang};
// iconId = new int[]{R.mipmap.pay_shezhang_no, R.mipmap.pay_shezhang};
isNeedVip = true;
break;
default:
iconId = new int[]{R.mipmap.pay_xianjin_no, R.mipmap.pay_xianjin};
// iconId = new int[]{R.mipmap.pay_xianjin_no, R.mipmap.pay_xianjin};
break;
}
}
// public BasePayFragment createView(Vip vip, Saleorder saleorder) {
// BasePayFragment basePayFragment = null;
// switch (payType) {
// case C.PAY_CHANNEL.CASH:
// basePayFragment = new CashPayFragment();
// break;
// case C.PAY_CHANNEL.ALI:
// basePayFragment = new AliPayFragment();
// break;
// case C.PAY_CHANNEL.WECHAT:
// basePayFragment = new WechatPayFragment();
// break;
// case C.PAY_CHANNEL.BANK:
// basePayFragment = new BankPayFragment();
// break;
// case C.PAY_CHANNEL.CARD:
// basePayFragment = new CardPayFragment();
// break;
// case C.PAY_CHANNEL.TALLY:
// basePayFragment = new TallyPayFragment();
// break;
// default:
// basePayFragment = new CashPayFragment();
// break;
// }
// basePayFragment.mVip = vip;
// basePayFragment.mSaleorder = saleorder;
// basePayFragment.mPayType = payType;
//
// return basePayFragment;
// }
@PrimaryKey
private Long id;
......
......@@ -255,6 +255,12 @@ public class Saleorder implements BaseModel, BaseBean, BaseOrderPrint {
private long msDisAmt;
/**
* 支付方式
*/
@JSONField(serialize = false)
private int payType;
/**
* 设置订单的商品详情
*
......@@ -983,7 +989,6 @@ public class Saleorder implements BaseModel, BaseBean, BaseOrderPrint {
}
@Override
public String getPayChange() {
return null;
......@@ -996,7 +1001,7 @@ public class Saleorder implements BaseModel, BaseBean, BaseOrderPrint {
@Override
public String getGoodsAmtSum() {
return ConvertUtil.fenToYuan(orderAuthAmt,true);
return ConvertUtil.fenToYuan(orderAuthAmt, true);
}
@Override
......@@ -1011,8 +1016,8 @@ public class Saleorder implements BaseModel, BaseBean, BaseOrderPrint {
@Override
public List<BaseGoodPrint> getGoodList() {
List<BaseGoodPrint> baseGoodPrints=new ArrayList<>();
for (Saledetail saledetail:saledetailList){
List<BaseGoodPrint> baseGoodPrints = new ArrayList<>();
for (Saledetail saledetail : saledetailList) {
baseGoodPrints.add(saledetail);
}
return baseGoodPrints;
......@@ -1063,6 +1068,15 @@ public class Saleorder implements BaseModel, BaseBean, BaseOrderPrint {
return shopNameabcn;
}
public int getPayType() {
return payType;
}
public void setPayType(int payType) {
this.payType = payType;
}
/**
* 优惠项目实体类
*/
......
package com.xingdata.zzdpos.ui.announcement;
import android.view.View;
import com.blankj.utilcode.util.ActivityUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityAnnouncementBinding;
import com.xingdata.zzdpos.model.Notice;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.announcement.fragment.AnnouncementFragment;
import com.xingdata.zzdpos.util.OnClickListener;
public class AnnouncementActivity extends BaseActivity<AnnouncementPresenter, ActivityAnnouncementBinding> implements AnnouncementContract.View {
......@@ -22,6 +26,13 @@ public class AnnouncementActivity extends BaseActivity<AnnouncementPresenter, Ac
@Override
public void initView() {
mViewBinding.icTitle.tvTitle.setText("公告");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
finish();
}
});
loadRootFragment(R.id.fragment_container, mAnnouncementFragment, false, false);
}
......
package com.xingdata.zzdpos.ui.feedback;
import android.databinding.DataBindingUtil;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.databinding.ActivityFeedBackBinding;
import com.xingdata.zzdpos.model.Feed;
import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.util.OnClickListener;
public class FeedBackActivity extends AppCompatActivity {
private ActivityFeedBackBinding mFeedBackBinding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View root = LayoutInflater.from(this).inflate(R.layout.activity_feed_back, null);
setContentView(root);
mFeedBackBinding = DataBindingUtil.bind(root);
mFeedBackBinding.icTitle.tvTitle.setText(R.string.feedBack_hint);
mFeedBackBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
finish();
}
});
mFeedBackBinding.setTextSize("0");
mFeedBackBinding.editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
mFeedBackBinding.setTextSize(mFeedBackBinding.editText.getText().toString().length() + "");
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
}
});
mFeedBackBinding.btnSubmit.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
if (mFeedBackBinding.editText.getText().length() < 10) {
ToastUtils.showShort("请详细描述下您遇到的问题");
} else {
Feed feed = new Feed();
feed.setFeedText(mFeedBackBinding.editText.getText().toString() + "联系方式:" + mFeedBackBinding.editContactWay.getText().toString());
feed.setOpMapId(LoginPresenter.loginReturnBean.getOpMapId());
feed.setOperMobile(LoginPresenter.loginReturnBean.getOperMobile());
feed.setFeedFlag("0");
feed.setOpNameabcn(LoginPresenter.loginReturnBean.getOperName());
clickFeedOk(feed);
}
}
});
}
public void clickFeedOk(Feed feed) {
ApiFactory.Feed.addFeed(feed)
.subscribe(object -> {
finish();
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
protected void onPause() {
KeyboardUtils.hideSoftInput(this);
super.onPause();
}
}
package com.xingdata.zzdpos.ui.help;
import android.databinding.DataBindingUtil;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ActivityHelpBinding;
import com.xingdata.zzdpos.util.OnClickListener;
public class HelpActivity extends AppCompatActivity {
private ActivityHelpBinding mHelpBinding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View root = LayoutInflater.from(this).inflate(R.layout.activity_help, null);
setContentView(root);
mHelpBinding = DataBindingUtil.bind(root);
mHelpBinding.icTitle.tvTitle.setText(R.string.help_hint);
mHelpBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
finish();
}
});
}
}
......@@ -13,6 +13,7 @@ import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityMainBinding;
import com.xingdata.zzdpos.databinding.ItemMenuBottomBinding;
import com.xingdata.zzdpos.ui.main.adapter.FragmentViewAdapter;
import com.xingdata.zzdpos.ui.main.dialog.HandoverDialog;
import com.xingdata.zzdpos.ui.main.fragment.CasherFragment;
import com.xingdata.zzdpos.ui.main.fragment.MyselfFragment;
import com.xingdata.zzdpos.ui.main.fragment.ServiceFragment;
......@@ -29,12 +30,13 @@ import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBinding> {
public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBinding> implements MainContract.View {
private int[] titleInts = {R.string.menu_cashier, R.string.menu_service, R.string.menu_myself};
private int[] iconList = {R.mipmap.icon_menu_cashier_1, R.mipmap.icon_menu_service_0, R.mipmap.icon_menu_myself_0};
private FragmentPagerAdapter mFragmentPagerAdapter;
// private List<View> views=new ArrayList<>();
private List<ItemMenuBottomBinding> itemMenuBottomBindings = new ArrayList<>();
private HandoverDialog mHandoverDialog = new HandoverDialog();
@Override
public int getLayoutId() {
......@@ -43,7 +45,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override
public void initView() {
mPresenter.initHandoverInfo();
List<Fragment> fragments = new ArrayList<>();
fragments.add(new CasherFragment());
fragments.add(new ServiceFragment());
......@@ -52,7 +54,6 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
mFragmentPagerAdapter = new FragmentViewAdapter(fragments, getSupportFragmentManager());
mViewBinding.fragmentContainer.setAdapter(mFragmentPagerAdapter);
mViewBinding.tabLayout.setupWithViewPager(mViewBinding.fragmentContainer);
initMenuBottomView();
......@@ -70,12 +71,13 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
}
}).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<View>() {
int i = 0;
@Override
public void accept(View view) throws Exception {
ItemMenuBottomBinding itemMenuBottomBinding = DataBindingUtil.bind(view);
itemMenuBottomBinding.text.setText(titleInts[i]);
if (i==0){
if (i == 0) {
itemMenuBottomBinding.text.setTextColor(getResources().getColor(R.color.red_guanyu));
}
itemMenuBottomBinding.img.setImageResource(iconList[i]);
......@@ -132,4 +134,8 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
}
@Override
public void showHandoverDialog() {
mHandoverDialog.show(this);
}
}
......@@ -17,10 +17,10 @@ interface MainContract {
// */
// void showChangePasswordDialog();
//
// /**
// * 显示交班报表页面
// */
// void showHandoverDialog();
/**
* 显示交班报表页面
*/
void showHandoverDialog();
//
// /**
// * 显示反馈页面
......@@ -507,15 +507,15 @@ interface MainContract {
// */
// public abstract void sync(SplashPresenter.SynchronousTask synchronousTask);
//
// /**
// * 初始化交班记录
// */
// public abstract void initHandoverInfo();
//
// /**
// * 交班确认
// */
// public abstract void clickHandoverOk();
/**
* 初始化交班记录
*/
public abstract void initHandoverInfo();
/**
* 交班确认
*/
public abstract void clickHandoverOk();
//
// /**
// * 点击换购确定按钮
......
......@@ -12,6 +12,9 @@ import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.HandoverInfo;
import com.xingdata.zzdpos.ui.login.LoginPresenter;
import java.text.SimpleDateFormat;
......@@ -24,11 +27,8 @@ import io.reactivex.ObservableSource;
import io.reactivex.functions.Function;
public class MainPresenter extends MainContract.Presenter {
@Override
public void onAttached() {
}
// public static HandoverInfo handoverInfo;
public static HandoverInfo handoverInfo;
//
// /**
// * 当前的使用的支付方式
......@@ -94,10 +94,10 @@ public class MainPresenter extends MainContract.Presenter {
// private ScannerUtil mScannerUtil;
//
//
// @Override
// public void onAttached() {
// this.initRealm();
//
@Override
public void onAttached() {
this.initRealm();
// mVip = Vip.createDefault();
// mCartProducts = new ArrayList<>();
// mOrderInfo = new Saleorder();
......@@ -114,8 +114,8 @@ public class MainPresenter extends MainContract.Presenter {
// this.getPayChannels();
// //获取营销活动信息
// this.getMsList();
// }
//
}
// @Override
// public void clickLock() {
// mView.goLockActivity();
......@@ -869,28 +869,28 @@ public class MainPresenter extends MainContract.Presenter {
// }
//
//
// @Override
// public void initHandoverInfo() {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd", Locale.getDefault());
// String time = TimeUtils.millis2String(System.currentTimeMillis(), simpleDateFormat);
// handoverInfo = DBFactory.Main.queryHandoverInfo(LoginPresenter.loginReturnBean.getOperId
// (), time);
// if (handoverInfo == null) {
// handoverInfo = new HandoverInfo();
// handoverInfo.setId(Long.valueOf(LoginPresenter.loginReturnBean.getOperId() + time));
// handoverInfo.setDate(time);
// handoverInfo.setOperId(LoginPresenter.loginReturnBean.getOperId());
// handoverInfo.setAlipay(0L);
// handoverInfo.setPos(0L);
// handoverInfo.setCash(0L);
// handoverInfo.setFinallyAmt(0L);
// handoverInfo.setSumOrder(0L);
// handoverInfo.setVip(0L);
// handoverInfo.setWechat(0L);
// DBFactory.Main.updateHandoverInfo(handoverInfo);
// }
// }
//
@Override
public void initHandoverInfo() {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd", Locale.getDefault());
String time = TimeUtils.millis2String(System.currentTimeMillis(), simpleDateFormat);
handoverInfo = DBFactory.Main.queryHandoverInfo(LoginPresenter.loginReturnBean.getOperId
(), time);
if (handoverInfo == null) {
handoverInfo = new HandoverInfo();
handoverInfo.setId(Long.valueOf(LoginPresenter.loginReturnBean.getOperId() + time));
handoverInfo.setDate(time);
handoverInfo.setOperId(LoginPresenter.loginReturnBean.getOperId());
handoverInfo.setAlipay(0L);
handoverInfo.setPos(0L);
handoverInfo.setCash(0L);
handoverInfo.setFinallyAmt(0L);
handoverInfo.setSumOrder(0L);
handoverInfo.setVip(0L);
handoverInfo.setWechat(0L);
DBFactory.Main.updateHandoverInfo(handoverInfo);
}
}
// /**
// * 更新交班信息
// */
......@@ -929,14 +929,14 @@ public class MainPresenter extends MainContract.Presenter {
// getRealm().copyToRealmOrUpdate(handoverInfo);
// getRealm().commitTransaction();
// }
//
//
// @Override
// public void clickHandoverOk() {
@Override
public void clickHandoverOk() {
// logout();
// mView.handoverOk();
// }
//
}
// @Override
// public void clickFeedOk(Feed feed) {
// ApiFactory.Feed.addFeed(feed)
......
package com.xingdata.zzdpos.ui.main.dialog;
import android.view.View;
import com.blankj.utilcode.util.TimeUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogHandoverBinding;
import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
/**
* 交班页面
*/
public class HandoverDialog extends BaseDialog<MainPresenter, DialogHandoverBinding> {
@Override
public int getLayoutId() {
return R.layout.dialog_handover;
}
@Override
public int getTitle() {
return R.string.handover_title;
}
@Override
public void onConfirmClick(View view) {
super.onConfirmClick(view);
mPresenter.clickHandoverOk();
}
@Override
public void initView() {
if (MainPresenter.handoverInfo == null) {
mPresenter.initHandoverInfo();
}
mViewBinding.setOperName(LoginPresenter.loginReturnBean.getOperName());
mViewBinding.setDate(TimeUtils.getNowString());
mViewBinding.setAlipay(ConvertUtil.fenToYuan(MainPresenter.handoverInfo.getAlipay(), true));
mViewBinding.setWechat(ConvertUtil.fenToYuan(MainPresenter.handoverInfo.getWechat(), true));
mViewBinding.setCash(ConvertUtil.fenToYuan(MainPresenter.handoverInfo.getCash(), true));
mViewBinding.setVipPay(ConvertUtil.fenToYuan(MainPresenter.handoverInfo.getVip(), true));
mViewBinding.setBank(ConvertUtil.fenToYuan(MainPresenter.handoverInfo.getPos(), true));
mViewBinding.handoverTvSumamt.setText(ConvertUtil.fenToYuan(MainPresenter.handoverInfo.getFinallyAmt(), true));
mViewBinding.setOrderNum(String.valueOf(MainPresenter.handoverInfo.getSumOrder()));
}
}
package com.xingdata.zzdpos.ui.main.fragment;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.blankj.utilcode.util.ActivityUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
......@@ -17,14 +14,19 @@ import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentCasherBinding;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MenuRecyclerAdapter;
import com.xingdata.zzdpos.ui.payment.PaymentActivity;
import com.xingdata.zzdpos.ui.splash.SplashActivity;
import com.xingdata.zzdpos.util.MyMenuItemDecoration;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
public class CasherFragment extends BaseFragment<MainPresenter,FragmentCasherBinding> {
public class CasherFragment extends BaseFragment<MainPresenter, FragmentCasherBinding> {
private MenuRecyclerAdapter mMenuRecyclerAdapter;
private List<Integer> integers;
@Override
public int getLayoutId() {
return R.layout.fragment_casher;
......@@ -43,15 +45,15 @@ public class CasherFragment extends BaseFragment<MainPresenter,FragmentCasherBin
integers.add(106);
mMenuRecyclerAdapter = new MenuRecyclerAdapter(getActivity(), integers);
mMenuRecyclerAdapter.bindToRecyclerView(mViewBinding.fragmentCasherRecycler);
// mViewBinding.fragmentCasherRecycler.addItemDecoration(new MyItemDecoration(getActivity(), 2, R.color.black_zhangfei));
mViewBinding.fragmentCasherRecycler.addItemDecoration(new MyMenuItemDecoration(getActivity(), 5, getResources().getColor(R.color.golden_yuji)));
mMenuRecyclerAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch ((int)adapter.getData().get(position)) {
switch ((int) adapter.getData().get(position)) {
case C.MENU.MENU_VIP://会员
break;
case C.MENU.MENU_RECHARGE://充值
case C.MENU.MENU_RECHARGE://充值
break;
case C.MENU.MENU_MS://营销
......@@ -70,5 +72,18 @@ public class CasherFragment extends BaseFragment<MainPresenter,FragmentCasherBin
}
}
});
mViewBinding.tvPayment.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ActivityUtils.startActivity(getActivity(), PaymentActivity.class);
}
});
mViewBinding.tvSplash.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ActivityUtils.startActivity(getActivity(), SplashActivity.class);
}
});
}
}
......@@ -12,6 +12,8 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentMyselfBinding;
import com.xingdata.zzdpos.ui.announcement.AnnouncementActivity;
import com.xingdata.zzdpos.ui.feedback.FeedBackActivity;
import com.xingdata.zzdpos.ui.help.HelpActivity;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MySelfRecyclerAdapter;
......@@ -50,14 +52,14 @@ public class MyselfFragment extends BaseFragment<MainPresenter, FragmentMyselfBi
ActivityUtils.startActivity(getActivity(), AnnouncementActivity.class);
break;
case C.MENU.MENU_FEED://反馈
ActivityUtils.startActivity(getActivity(), FeedBackActivity.class);
break;
case C.MENU.MENU_UPDATE://升级
break;
case C.MENU.MENU_HELP://帮助
ActivityUtils.startActivity(getActivity(), HelpActivity.class);
break;
case C.MENU.MENU_EXIT://退出
......
package com.xingdata.zzdpos.ui.payment;
import com.blankj.utilcode.util.EncryptUtils;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.util.SystemUtil;
public class PaymentPresenter extends PaymentContract.Presenter {
@Override
public void onAttached() {
ApiFactory.Test.signBefore("13111111111", EncryptUtils.encryptMD5ToString("000000".getBytes()),
"1", SystemUtil.getDeviceSN()).subscribe(loginReturnBean -> {
}, throwable -> {
});
}
@Override
......
......@@ -63,7 +63,6 @@ public class CalculatorView<P extends BasePresenter> extends BaseFragment<P, Vie
String str = ((TextView) view).getText().toString();
String[] mExps = mExp.split("[+\\-×÷]");
if (mLast.matches("[+\\-×÷]")) mValue = "";
else if (mExps.length > 1) mValue = mExps[mExps.length - 1];
else mValue = mExp.replaceAll("[+\\-×÷]", "");
......
package com.xingdata.zzdpos.ui.settle;
import com.blankj.utilcode.util.ActivityUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivitySettleBinding;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.settle.fragment.CashPayFragment;
import com.xingdata.zzdpos.ui.settle.fragment.PayResultFragment;
import com.xingdata.zzdpos.ui.settle.fragment.SettleFragment;
import java.util.List;
......@@ -14,6 +21,11 @@ import java.util.List;
public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettleBinding> implements SettleContract.View {
private SettleFragment mSettleFragment = new SettleFragment();
private CashPayFragment mCashPayFragment = new CashPayFragment();
private PayResultFragment mPayResultFragment = new PayResultFragment();
private LoadingDialog mLoadingDialog = new LoadingDialog();
@Override
public int getLayoutId() {
......@@ -26,11 +38,12 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
}
@Override
public void initSettleFragment(int settleMode) {
public void setSettleFragmentBySettleMode(int settleMode) {
}
@Override
public void showSettleFragment() {
this.popTo(mSettleFragment.getClass(), false);
}
@Override
......@@ -67,8 +80,50 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
mSettleFragment.loadPays(pays);
}
@Override
public void loadSaleorder(Saleorder saleorder) {
mSettleFragment.loadSaleorder(saleorder);
mCashPayFragment.loadSaleorder(saleorder);
}
@Override
public void showPayFragment(int payChannel) {
switch (payChannel) {
case C.PAY_CHANNEL.CASH:
this.start(mCashPayFragment);
break;
}
}
@Override
public void changeLockState(boolean isLock) {
}
@Override
public void showLoadingDialog() {
mLoadingDialog.show(this);
}
@Override
public void dismissLoadingDialog() {
mLoadingDialog.dismiss();
}
@Override
public void showPaySuccFragment(Saleorder saleorder) {
this.start(mPayResultFragment.setResult(true).setSaleorder(saleorder));
}
@Override
public void showPayFailFragment(Throwable throwable, Saleorder saleorder) {
this.start(mPayResultFragment.setResult(false).setSaleorder(saleorder));
}
@Override
public void backToMainActivity() {
ActivityUtils.startActivity(this, MainActivity.class);
}
}
......@@ -3,21 +3,22 @@ package com.xingdata.zzdpos.ui.settle;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import java.util.List;
public interface SettleContract {
interface SettleContract {
interface View extends BaseView {
/**
* 初始化结算页面
* 设置初始化结算页面
*
* @param settleMode 结算模式
*/
void initSettleFragment(int settleMode);
void setSettleFragmentBySettleMode(int settleMode);
/**
* 显示结算Fragment
......@@ -62,7 +63,6 @@ public interface SettleContract {
*/
void loadTicket(Ticket ticket);
/***
* 加载支付方式列表
*
......@@ -70,16 +70,67 @@ public interface SettleContract {
*/
void loadPays(List<Pay> pays);
/**
* 加载订单信息
*
* @param saleorder 订单信息
*/
void loadSaleorder(Saleorder saleorder);
/**
* 显示支付页面
*
* @param payChannel 支付渠道
*/
void showPayFragment(int payChannel);
/**
* 改变锁定状态
*
* @param isLock 是否锁定
*/
void changeLockState(boolean isLock);
/**
* 显示读取对话框
*/
void showLoadingDialog();
/**
* 隐藏读取对话框
*/
void dismissLoadingDialog();
/**
* 显示支付成功界面
*
* @param saleorder 订单信息
*/
void showPaySuccFragment(Saleorder saleorder);
/**
* 显示支付失败界面
*
* @param throwable 错误信息
* @param saleorder 订单信息
*/
void showPayFailFragment(Throwable throwable, Saleorder saleorder);
/**
* 返回主页面
*/
void backToMainActivity();
}
abstract class Presenter extends BasePresenter<View> {
/**
* 结算页面 - 初始化结算页面
*/
public abstract void initSettle();
/**
* 结算页面 - 点击会员View
*/
......@@ -170,6 +221,16 @@ public interface SettleContract {
*/
public abstract void payInTally();
/**
* 支付结果页面 - 完成订单
*/
public abstract void clickComplete();
/**
* 支付结果页面 - 重试
*/
public abstract void clickRetry();
}
}
package com.xingdata.zzdpos.ui.settle;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Ms;
......@@ -10,49 +10,95 @@ import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
public class SettlePresenter extends SettleContract.Presenter {
/**
* 结算模式
*/
private int mSettleMode;
/**
* 当前会员
*/
private Vip mVip;
/**
* 当前的营销活动列表
*/
private List<Ms> mMsList;
private List<Ms> mMss;
/**
* 当前设备的支付渠道信息
*/
private List<Pay> mPayChannels;
private List<Pay> mPays;
/**
* 当前购物车的商品明细
*/
private List<Saledetail> mCartProducts;
private List<Saledetail> mSaledetails;
/**
* 当前订单信息
*/
private Saleorder mOrderInfo;
private Saleorder mSaleorder;
@Override
public void onAttached() {
int settleMode = getIntent().getIntExtra(C.EXTRA_KEY.SETTLE_MODE, -1);
switch (settleMode) {
this.initRealm();
mSaleorder = new Saleorder();
mSaledetails = new ArrayList<>();
mVip = Vip.createDefault();
mSettleMode = getIntent().getIntExtra(C.EXTRA_KEY.SETTLE_MODE, -1);
switch (mSettleMode) {
case C.SETTLE_MODE.PAYMENT:
LogUtils.e("创建收款订单,订单金额" + ConvertUtil.fenToYuan(getIntent().getLongExtra(C.EXTRA_KEY.SETTLE_EXTRA, 0), true));
this.getPaymentIntent();
break;
case C.SETTLE_MODE.STORE:
this.getStoreIntent();
break;
}
}
/**
* 获取收款信息
*/
private void getPaymentIntent() {
Long payAmt = getIntent().getLongExtra(C.EXTRA_KEY.SETTLE_EXTRA, 0);
mSaledetails.add(0, Saledetail.create("收款", payAmt, mVip));
mSaleorder.setSaledetails(mSaledetails).settle();
}
/**
* 获取开单信息
*/
private void getStoreIntent() {
}
@Override
public void initSettle() {
ApiFactory.Pay.query().subscribe(
pays -> mView.loadPays(pays),
throwable -> {
}
);
mView.loadSaleorder(mSaleorder);
mView.setSettleFragmentBySettleMode(mSettleMode);
}
@Override
public void clickVipView() {
mView.showVipFragment();
// mView.showVipFragment();
mView.loadVip(Vip.createDefault());
}
@Override
......@@ -81,9 +127,7 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override
public void searchTicket(Long vipId) {
ApiFactory.Ticket.query(vipId).subscribe(
tickets -> {
mView.loadTickets(tickets);
},
tickets -> mView.loadTickets(tickets),
throwable -> {
});
}
......@@ -99,36 +143,102 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override
public void clickPayChannelView(int payChannel) {
mSaleorder.setPayType(payChannel);
mView.showPayFragment(payChannel);
}
@Override
public void payInCash(Long inputAmt, Long changeAmt) {
subscribePay(commitOrder()
.flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.CASH)))
);
}
@Override
public void payInAli(String payCode) {
}
@Override
public void payInWechat(String payCode) {
}
@Override
public void payInBank() {
}
@Override
public void payInCard(Long cardNo, String password) {
}
@Override
public void payInTally() {
}
@Override
public void clickComplete() {
mView.backToMainActivity();
}
@Override
public void clickRetry() {
mView.showSettleFragment();
}
/**
* 订阅支付
*
* @param observable 数据源
*/
private void subscribePay(Observable<Saleorder> observable) {
mView.showLoadingDialog();
observable.doFinally(() -> mView.dismissLoadingDialog()).subscribe(
this::paySucc,
this::payFail
);
}
/**
* 提交订单
*/
private Observable<String> commitOrder() {
if (StringUtils.isEmpty(mSaleorder.getOrderNo())) {
return ApiFactory.Saleorder.addOrderMis(createSaleorderParam())
.doAfterNext(s -> {
mSaleorder.setOrderNo(s);
mView.changeLockState(true);
});
} else {
return Observable.just(mSaleorder.getOrderNo());
}
}
/**
* 获取参数形式的订单信息
*
* @return 参数形式的订单信息
*/
private Saleorder.Param createSaleorderParam() {
Saleorder.Param saleorderParam = mSaleorder.setVip(mVip).param();
for (int i = 0; i < mSaledetails.size(); i++) {
saleorderParam.saleOrderParamDetailList.add(mSaledetails.get(i).param());
}
return saleorderParam;
}
/**
* 支付成功
*/
private void paySucc(Saleorder saleorder) {
mView.showPaySuccFragment(saleorder);
}
/**
* 支付失败
*/
private void payFail(Throwable throwable) {
mView.showPayFailFragment(throwable, mSaleorder);
}
}
package com.xingdata.zzdpos.ui.settle.adapter;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
......@@ -17,19 +18,41 @@ public class PayAdapter extends BaseAdapter<Pay, ItemPayBinding> {
@Override
protected void convert(ItemPayBinding mViewBinding, Pay item) {
int resLogo, resBackground;
switch (item.getPayType()) {
case C.PAY_CHANNEL.CASH:
resLogo = R.mipmap.pay_cash;
resBackground = R.color.red_diaochan;
break;
case C.PAY_CHANNEL.WECHAT:
resLogo = R.mipmap.pay_wechat;
resBackground = R.color.green_kongrun;
break;
case C.PAY_CHANNEL.ALI:
resLogo = R.mipmap.pay_alipay;
resBackground = R.color.blue_yuefei;
break;
case C.PAY_CHANNEL.BANK:
resLogo = R.mipmap.pay_card;
resBackground = R.color.cyan_liubei;
break;
case C.PAY_CHANNEL.CARD:
resLogo = R.mipmap.pay_membershipcard;
resBackground = R.color.yellow_huangxin;
break;
case C.PAY_CHANNEL.TALLY:
resLogo = R.mipmap.pay_credit;
resBackground = R.color.purple_yanqing;
break;
default:
resLogo = R.mipmap.pay_cash;
resBackground = R.color.red_diaochan;
break;
}
mViewBinding.ivLogo.setImageResource(resLogo);
GenericDraweeHierarchy hierarchy = mViewBinding.ivBackground.getHierarchy();
hierarchy.setBackgroundImage(mContext.getResources().getDrawable(resBackground));
mViewBinding.ivBackground.setHierarchy(hierarchy);
}
}
......@@ -3,10 +3,17 @@ package com.xingdata.zzdpos.ui.settle.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentPayCashBinding;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.settle.view.InputerView;
import com.xingdata.zzdpos.util.ConvertUtil;
public class CashPayFragment extends BaseFragment<SettlePresenter, FragmentPayCashBinding> {
private InputerView<SettlePresenter> mInputerView = new InputerView<>();
private Long mOrderAmt;
@Override
public int getLayoutId() {
return R.layout.fragment_pay_cash;
......@@ -14,6 +21,47 @@ public class CashPayFragment extends BaseFragment<SettlePresenter, FragmentPayCa
@Override
public void initView() {
this.loadRootFragment(R.id.f_inputer, mInputerView);
mInputerView.setOnResultChangeListener(this::setOrderInfo);
mInputerView.setOnSettleClickListener(this::clickSettle);
mViewBinding.tvOrderAmt.setText(ConvertUtil.fenToYuan(mOrderAmt));
mViewBinding.tvPayAmt.setText(ConvertUtil.fenToYuan(mOrderAmt));
mViewBinding.tvChange.setText("---");
}
/**
* 加载订单信息
*
* @param saleorder 订单信息
*/
public void loadSaleorder(Saleorder saleorder) {
this.mOrderAmt = saleorder.getOrderPayAmt();
}
/**
* 界面设置
*
* @param payAmt 实付价格
*/
private void setOrderInfo(Long payAmt) {
mViewBinding.tvPayAmt.setText(ConvertUtil.fenToYuan(payAmt));
if (payAmt - mOrderAmt > 0) {
mViewBinding.tvChange.setText(ConvertUtil.fenToYuan(payAmt - mOrderAmt));
} else {
mViewBinding.tvChange.setText("---");
}
}
/**
* 点击结算
*
* @param payAmt 实付价格
*/
private void clickSettle(Long payAmt) {
if (payAmt - mOrderAmt >= 0) {
mPresenter.payInCash(payAmt, payAmt - mOrderAmt);
}
}
}
package com.xingdata.zzdpos.ui.settle.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentPayResultBinding;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
public class PayResultFragment extends BaseFragment<SettlePresenter, FragmentPayResultBinding> {
private boolean mResult;
private Saleorder mSaleorder;
@Override
public int getLayoutId() {
return R.layout.fragment_pay_result;
}
@Override
public void initView() {
mViewBinding.setPayResult(mResult);
mViewBinding.tvCount.setText(mSaleorder.getGoodsCnt());
mViewBinding.tvOrderAmt.setText(mSaleorder.getPayAmt());
mViewBinding.tvType.setText(mSaleorder.getPayChannel());
mViewBinding.tvTime.setText(mSaleorder.getOrderTime());
mViewBinding.ivResult.setImageResource(mResult ? R.mipmap.ic_succeed : R.mipmap.ic_fail);
mViewBinding.btnConfirm.setOnClickListener(view -> {
if (mResult) mPresenter.clickComplete();
else mPresenter.clickRetry();
});
}
/**
* 设置订单信息
*
* @param saleorder 订单信息
* @return this
*/
public PayResultFragment setSaleorder(Saleorder saleorder) {
this.mSaleorder = saleorder;
return this;
}
/**
* 设置结果
*
* @param isSucc 是否成功
* @return this
*/
public PayResultFragment setResult(boolean isSucc) {
this.mResult = isSucc;
return this;
}
}
......@@ -7,9 +7,11 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSettleBinding;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.settle.adapter.PayAdapter;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
import java.util.List;
......@@ -27,15 +29,18 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
public void initView() {
mViewBinding.setDefualtVip(true);
mViewBinding.tvSettle.setOnClickListener(view -> {
BottomSheetBehavior.from(mViewBinding.llSheet).setState(BottomSheetBehavior.STATE_EXPANDED);
});
mPresenter = new SettlePresenter();
// pay adapter
mPayAdapter = new PayAdapter();
mViewBinding.rlPay.setAdapter(mPayAdapter);
mViewBinding.rlPay.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL));
mViewBinding.rlPay.addItemDecoration(new RecyclerViewUtil.GridSpacingItemDecoration(3, 20, true));
mPayAdapter.setOnItemClickListener((adapter, view, position) -> mPresenter.clickPayChannelView(mPayAdapter.getData().get(position).getPayType()));
// other listener
mViewBinding.clVip.setOnClickListener(view -> mPresenter.clickVipView());
mViewBinding.tvSettle.setOnClickListener(view -> BottomSheetBehavior.from(mViewBinding.llSheet).setState(BottomSheetBehavior.STATE_EXPANDED));
mPresenter.initSettle();
}
/**
......@@ -57,6 +62,15 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
// }
}
/**
* 加载订单信息
*
* @param saleorder 订单信息
*/
public void loadSaleorder(Saleorder saleorder) {
mViewBinding.tvPayAmt.setText(ConvertUtil.fenToYuan(saleorder.getOrderPayAmt()));
}
/**
* 加载支付方式
*/
......
......@@ -10,13 +10,17 @@ import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.databinding.ViewInputerBinding;
import com.xingdata.zzdpos.util.ConvertUtil;
public class InpterView<P extends BasePresenter> extends BaseFragment<P, ViewInputerBinding> {
public class InputerView<P extends BasePresenter> extends BaseFragment<P, ViewInputerBinding> {
private String mValue;
private OnResultChangeListener mOnResultChangeListener;
private onSettleClickListener mOnSettleClickListener;
public InputerView() {
mValue = "";
}
public interface OnResultChangeListener {
void onResultChange(Long result);
}
......@@ -45,6 +49,14 @@ public class InpterView<P extends BasePresenter> extends BaseFragment<P, ViewInp
break;
default:
if (view instanceof TextView) {
String str = ((TextView) view).getText().toString();
//限制位数
if (str.matches("[0-9]+") && mValue.split("[.]").length > 1 && mValue.split("[.]")[1].length() == 2)
return;
//限制小数点
if ((mValue.length() == 0 || mValue.contains(".")) && str.matches("[.]"))
return;
mValue += str;
}
break;
}
......@@ -86,7 +98,7 @@ public class InpterView<P extends BasePresenter> extends BaseFragment<P, ViewInp
public void setOnResultChangeListener(OnResultChangeListener onResultChangeListener) {
this.mOnResultChangeListener = onResultChangeListener;
mOnResultChangeListener.onResultChange(ConvertUtil.yuanToFen(mValue));
this.clear();
}
public void setOnSettleClickListener(onSettleClickListener onSettleClickListener) {
......
package com.xingdata.zzdpos.ui.store;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
interface StoreContract {
interface View extends BaseView {
}
abstract class Presenter extends BasePresenter<View> {
}
}
......@@ -12,16 +12,16 @@ import android.view.View;
* Created by Administrator on 2017/12/21.
*/
class MyItemDecoration extends RecyclerView.ItemDecoration {
public class MyMenuItemDecoration extends RecyclerView.ItemDecoration {
private Drawable mDividerDarwable;
private int mDividerHight = 1;
private Paint mColorPaint;
private int size=2;
private int size = 2;
public final int[] ATRRS = new int[]{android.R.attr.listDivider};
public MyItemDecoration(Context context) {
public MyMenuItemDecoration(Context context) {
final TypedArray ta = context.obtainStyledAttributes(ATRRS);
this.mDividerDarwable = ta.getDrawable(0);
ta.recycle();
......@@ -31,7 +31,7 @@ class MyItemDecoration extends RecyclerView.ItemDecoration {
int dividerHight 分割线的线宽
int dividerColor 分割线的颜色
*/
public MyItemDecoration(Context context, int dividerHight, int dividerColor) {
public MyMenuItemDecoration(Context context, int dividerHight, int dividerColor) {
this(context);
mDividerHight = dividerHight;
mColorPaint = new Paint();
......@@ -42,18 +42,19 @@ class MyItemDecoration extends RecyclerView.ItemDecoration {
int dividerHight 分割线的线宽
int dividerColor 分割线的颜色
*/
public MyItemDecoration(Context context, int dividerHight, int dividerColor, int size) {
public MyMenuItemDecoration(Context context, int dividerHight, int dividerColor, int size) {
this(context);
mDividerHight = dividerHight;
mColorPaint = new Paint();
mColorPaint.setColor(dividerColor);
this.size=size;
this.size = size;
}
/*
int dividerHight 分割线的线宽
Drawable dividerDrawable 图片分割线
*/
public MyItemDecoration(Context context, int dividerHight, Drawable dividerDrawable) {
public MyMenuItemDecoration(Context context, int dividerHight, Drawable dividerDrawable) {
this(context);
mDividerHight = dividerHight;
mDividerDarwable = dividerDrawable;
......@@ -73,8 +74,8 @@ class MyItemDecoration extends RecyclerView.ItemDecoration {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
final int top = child.getTop() - params.topMargin+30;
final int bottom = child.getBottom() + params.bottomMargin-30;
final int top = child.getTop() - params.topMargin + 30;
final int bottom = child.getBottom() + params.bottomMargin - 30;
int left = 0;
int right = 0;
......@@ -108,8 +109,8 @@ class MyItemDecoration extends RecyclerView.ItemDecoration {
final View child = parent.getChildAt(i);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
final int left = child.getLeft() - params.leftMargin - mDividerHight;
final int right = child.getRight() + params.rightMargin;
final int left = child.getLeft() - params.leftMargin - mDividerHight+30;
final int right = child.getRight() + params.rightMargin-30;
int top = 0;
int bottom = 0;
......@@ -127,9 +128,11 @@ class MyItemDecoration extends RecyclerView.ItemDecoration {
// top = child.getBottom() + params.bottomMargin;
// bottom = top + mDividerHight;
// } else {
// if (i!=)
top = child.getBottom() + params.bottomMargin;
bottom = top + mDividerHight;
if (i/size!=(parent.getAdapter().getItemCount()/size-1)){
top = child.getBottom() + params.bottomMargin;
bottom = top + mDividerHight;
}
// }
//画分割线
mDividerDarwable.setBounds(left, top, right, bottom);
......
......@@ -55,7 +55,7 @@ public final class SystemUtil {
}
}
// return deviceSN;
return "92209329";
return "548496";
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/settle_btn_radius" />
<solid android:color="@color/gray_transparent" />
</shape>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<item>
<shape>
<solid android:color="@color/gray_huanggai"/>
<solid android:color="@color/appBack"/>
</shape>
</item>
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="textSize"
type="String"/>
</data>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
tools:context="com.xingdata.zzdpos.ui.feedback.FeedBackActivity">
<include
android:id="@+id/ic_title"
layout="@layout/title" />
<EditText
android:id="@+id/editText"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:gravity="top"
android:hint="@string/feedBack_edit_hint"
android:maxLength="101"
android:minLines="5"
app:layout_constraintTop_toBottomOf="@id/ic_title" />
<EditText
android:id="@+id/edit_contactWay"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:gravity="top"
android:hint="@string/feedBack_contactWay"
android:maxLength="22"
android:minLines="1"
android:singleLine="true"
app:layout_constraintTop_toBottomOf="@id/editText" />
<TextView
android:id="@+id/text_max"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_4"
android:paddingEnd="@dimen/dp_4"
android:text="/100"
app:layout_constraintBottom_toBottomOf="@id/editText"
app:layout_constraintEnd_toEndOf="@id/editText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_4"
android:text="@{textSize}"
android:textColor="@color/red_guanyu"
app:layout_constraintBottom_toBottomOf="@id/text_max"
app:layout_constraintEnd_toStartOf="@id/text_max" />
<Button
android:id="@+id/btn_submit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:background="@drawable/red_border"
android:text="@string/feedBack_submit"
android:textColor="@color/white_caocao"
android:textSize="@dimen/all_text_size"
app:layout_constraintTop_toBottomOf="@id/edit_contactWay" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
tools:context="com.xingdata.zzdpos.ui.help.HelpActivity">
<include
android:id="@+id/ic_title"
layout="@layout/title_appback"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.38" />
<ImageButton
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/black_zhangfei"
android:src="@mipmap/icon_help_logo"
app:layout_constraintBottom_toBottomOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ic_title" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/guideline">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white_caocao"
android:weightSum="2">
<TextView
style="@style/textView_body"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/help_web_hint" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:padding="@dimen/all_padding"
android:text="@string/help_web" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white_caocao"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/textView_body"
android:text="@string/help_phone_hint" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:padding="@dimen/all_padding"
android:text="@string/help_phone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white_caocao"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/textView_body"
android:text="@string/help_code_hint" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:padding="@dimen/all_padding"
android:text="@string/help_web" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white_caocao"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/textView_body"
android:text="@string/help_word_hint" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:padding="@dimen/all_padding"
android:text="@string/help_web" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="date"
type="String" />
<variable
name="operName"
type="String" />
<variable
name="orderNum"
type="String" />
<variable
name="cash"
type="String" />
<variable
name="wechat"
type="String" />
<variable
name="alipay"
type="String" />
<variable
name="bank"
type="String" />
<variable
name="vipPay"
type="String" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true">
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:padding="0dp">
<TextView
android:id="@+id/handover_tv_sumamt"
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥9999"
android:textColor="@color/red900"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/handover_tv_sumamt_hint" />
<TextView
android:id="@+id/handover_tv_sumamt_hint"
style="@style/textView_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="实收金额"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view1"
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L1"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_zhouyu"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/handover_tv_sumamt" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/dp_4"
android:weightSum="2"
app:layout_constraintTop_toBottomOf="@id/view1">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_date" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_oper" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_orderNum" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_cash" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_wechat" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_alipay" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_bank" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/handover_vip" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical">
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{date}"
android:textColor="@color/black_likui" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{operName}"
android:textColor="@color/black_likui" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{orderNum}"
android:textColor="@color/black_likui" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{cash}"
android:textColor="@color/black_likui" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{wechat}"
android:textColor="@color/black_likui" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{alipay}"
android:textColor="@color/black_likui" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{bank}"
android:textColor="@color/black_likui" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@{vipPay}"
android:textColor="@color/black_likui" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -16,6 +16,7 @@
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.38" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="0dp"
......@@ -28,7 +29,9 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_payment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -38,6 +41,7 @@
android:textColor="#FFF" />
<TextView
android:id="@+id/tv_splash"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -49,13 +53,27 @@
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:background="@drawable/shape_transparent_round"
android:paddingBottom="@dimen/dp_4"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/dp_4"
android:text="@string/handover_hint"
android:textColor="@color/white_caocao"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.RecyclerView
android:id="@+id/fragment_casher_recycler"
android:layout_marginTop="@dimen/all_padding"
android:layout_marginBottom="@dimen/all_padding"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/gray_zhouyu"
android:layout_marginBottom="@dimen/all_padding"
android:layout_marginTop="@dimen/all_padding"
android:background="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
</android.support.constraint.ConstraintLayout>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="@dimen/all_margin"
android:layout_marginBottom="@dimen/all_margin_big"
android:layout_weight="4"
app:cardCornerRadius="@dimen/all_shape_radius">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white_caocao"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center"
android:text="@string/settle_order_amt"
android:textColor="@color/black_likui"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" />
<TextView
android:id="@+id/tv_order_amt"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/fragment_settle_bigtextsize"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_spacing">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_pay_amt"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_pay_amt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_sub_title_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_spacing">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_pay_change"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_change"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_sub_title_size" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<FrameLayout
android:id="@+id/f_inputer"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="7" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="payResult"
type="boolean" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:contentDescription="@string/settle_pay_result" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center"
android:text="@{payResult?@string/settle_pay_succ:@string/settle_pay_fail}"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_pay_time"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_caption_size" />
<TextView
android:id="@+id/tv_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_pay_type"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_caption_size" />
<TextView
android:id="@+id/tv_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_pay_count"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_caption_size" />
<TextView
android:id="@+id/tv_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_margin"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_pay_order_amt"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_caption_size" />
<TextView
android:id="@+id/tv_order_amt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<Button
android:id="@+id/btn_confirm"
style="@style/button_positive"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:foreground="?android:attr/selectableItemBackground"
android:text="@{payResult?@string/settle_complete:@string/settle_retry}" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
......@@ -72,6 +73,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_spacing"
android:text="@string/payment_total"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size" />
<TextView
......
......@@ -96,7 +96,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{phone}"
android:textColor="@color/gray_huanggai"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:gravity="center"
android:elevation="0.5dp"
android:background="@color/white_caocao"
android:layout_margin="0.8dp"
android:orientation="vertical">
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"/>
android:layout_margin="0.8dp"
android:background="@color/white_caocao"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="25dp"
android:paddingTop="25dp">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp" />
</LinearLayout>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black_baozheng" />
</LinearLayout>
</layout>
......@@ -4,7 +4,8 @@
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="@dimen/settle_pay_item">
android:layout_height="@dimen/settle_pay_item"
android:foreground="?android:attr/selectableItemBackground">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_background"
......
......@@ -35,7 +35,7 @@
android:text="标题"
android:textColor="@color/white"
android:textSize="@dimen/text_secondary_title"
android:textStyle="bold"/>
/>
</RelativeLayout>
......
......@@ -21,7 +21,7 @@
android:layout_marginBottom="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_line_width"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -39,7 +39,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="@dimen/all_line_width"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -56,7 +56,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="@dimen/all_line_width"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -72,7 +72,7 @@
android:id="@+id/tv_del"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -90,7 +90,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_line_width"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -107,7 +107,7 @@
android:id="@+id/tv_2"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -123,7 +123,7 @@
android:id="@+id/tv_3"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -140,7 +140,7 @@
android:id="@+id/tv_sub"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -157,7 +157,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_line_width"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -174,7 +174,7 @@
android:id="@+id/tv_5"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -190,7 +190,7 @@
android:id="@+id/tv_6"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -206,7 +206,7 @@
android:id="@+id/tv_add"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -224,7 +224,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_line_width"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -241,7 +241,7 @@
android:id="@+id/tv_8"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -257,7 +257,7 @@
android:id="@+id/tv_9"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -278,7 +278,7 @@
android:gravity="center"
android:onClickListener="@{onClick}"
android:text="@string/inputer_settle"
android:textColor="@color/white"
android:textColor="@color/white_caocao"
android:textSize="@dimen/all_sub_title_size"
app:layout_constraintBottom_toBottomOf="@id/tv_0"
app:layout_constraintLeft_toLeftOf="@id/tv_del"
......@@ -290,7 +290,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_line_width"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......@@ -307,7 +307,7 @@
android:id="@+id/tv_point"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClickListener="@{onClick}"
......
......@@ -18,6 +18,8 @@
android:id="@+id/tv_1"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_line_width"
android:background="@color/white"
android:foreground="?android:attr/selectableItemBackground"
......
......@@ -21,6 +21,7 @@
<!-- 全透明 -->
<color name="all_transparent">#00000000</color>
<color name="black_half">#50000000</color>
<color name="gray_transparent">#50aaaaaa</color>
<color name="black">#101010</color>
<color name="black1">#273542</color>
......@@ -124,6 +125,7 @@
<color name="gray_zhouyu">#f1f3f7</color>
<color name="gray_huanggai">#afb9c3</color>
<color name="gray_kongming">#e6e6e6</color>
<color name="white_caocao">#ffffff</color>
......@@ -144,6 +146,8 @@
<color name="yellow_huangxin">#ffc960</color>
<color name="golden_yuji">#f2e7d3</color>
<color name="purple_yanqing">#6590e6</color>
......
......@@ -173,8 +173,6 @@
<string name="settle_channel_tally_arrear_hint">余额:</string>
<string name="settle_pay">支付</string>
<string name="settle_print_receipt">打印小票</string>
<string name="settle_pay_amt">实收:</string>
<string name="settle_pay_change">找零:</string>
<string name="settle_money_unit"></string>
<string name="settle_channel_input_hint">扫描或输入条码数字</string>
<string name="settle_pay_change_text">¥%s</string>
......@@ -502,6 +500,45 @@
<string name="settle_vip_dis_rate_hint">折扣:</string>
<string name="settle_vip_dis_rate"></string>
<string name="settle_btn_expand">收款</string>
<string name="settle_order_amt">应收金额</string>
<string name="settle_pay_amt">实收金额</string>
<string name="settle_pay_change">找零金额</string>
<string name="settle_pay_result">支付结果</string>
<string name="settle_pay_succ">支付成功</string>
<string name="settle_pay_fail">支付失败</string>
<string name="settle_pay_time">交易时间</string>
<string name="settle_pay_type">收款方式</string>
<string name="settle_pay_count">商品总数</string>
<string name="settle_pay_order_amt">合计金额</string>
<string name="settle_retry">重新支付</string>
<string name="settle_complete">完成</string>
<!--帮助POS-->
<string name="help_hint">帮助</string>
<string name="help_phone">400–800–9406</string>
<string name="help_phone_hint">客服专线</string>
<string name="help_web">www.xingdata.com</string>
<string name="help_web_hint">浙星官网</string>
<string name="help_code_hint">版本号</string>
<string name="help_word_hint">指导手册</string>
<!--反馈POS-->
<string name="feedBack_hint">意见反馈</string>
<string name="feedBack_edit_hint">您的反馈是我们前进的方向,请写下您的反馈…</string>
<string name="feedBack_contactWay">手机号/邮箱(方便我们联系您)</string>
<string name="feedBack_submit">提交反馈</string>
<!--交班POS-->
<string name="handover_hint">交班</string>
<string name="handover_finalAmt">实收金额:</string>
<string name="handover_date">交班时间:</string>
<string name="handover_oper">收银员:</string>
<string name="handover_orderNum">总订单:</string>
<string name="handover_cash">现金收款:</string>
<string name="handover_wechat">微信收款:</string>
<string name="handover_alipay">支付宝收款:</string>
<string name="handover_bank">银行卡收款:</string>
<string name="handover_vip">储值卡收款:</string>
<!--<string name="handover_vip">储值卡收款</string>-->
</resources>
......@@ -17,9 +17,9 @@
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="vicescreen_textview_stlye">
......@@ -313,6 +313,7 @@
<item name="android:textSize">@dimen/et_textsize</item>
<item name="android:textColorHint">@color/hint</item>
</style>
<style name="Base.Widget.Design.TabLayout" parent="android:Widget">
<item name="tabBackground">@color/white_caocao</item>
<item name="tabIndicatorColor">#FFF</item>
......@@ -344,4 +345,16 @@
<item name="android:layout_width">0dp</item>
<item name="android:textSize">@dimen/small_text_size</item>
</style>
<style name="textView_body">
<item name="android:padding">@dimen/all_padding</item>
<item name="android:textSize">@dimen/all_text_size</item>
<item name="android:textColor">@color/black_baozheng</item>
</style>
<style name="textView_body_small">
<item name="android:padding">@dimen/dp_4</item>
<item name="android:textSize">@dimen/all_text_size_small</item>
<item name="android:textColor">@color/black_baozheng</item>
</style>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment