詹子聪 пре 5 година
родитељ
комит
137a53c78f

+ 5 - 0
app/src/main/java/com/itant/shibei/ui/home/goods/GoodsBean.java

@@ -24,6 +24,10 @@ public class GoodsBean implements Serializable {
      * 封面图片地址
      */
     public String coverImageUrl;
+    /**
+     * 体验视频地址
+     */
+    public String videoUrl;
     /**
      * 标题
      */
@@ -108,6 +112,7 @@ public class GoodsBean implements Serializable {
 
     public void updateData(GoodsBean goodsBean) {
         this.coverImageUrl = goodsBean.coverImageUrl;
+        this.videoUrl = goodsBean.videoUrl;
         this.title = goodsBean.title;
         this.description = goodsBean.description;
         this.reason = goodsBean.reason;

+ 5 - 0
app/src/main/java/com/itant/shibei/ui/mine/goods/AddGoodsActivity.java

@@ -31,6 +31,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
 
     private TextInputEditText et_goods_title;
     private TextInputEditText et_cover_url;
+    private TextInputEditText et_video_url;
     private TextInputEditText et_desc;
     private TextInputEditText et_reason;
     private TextInputEditText et_old_price;
@@ -80,6 +81,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
     public void initViews(Bundle savedInstanceState) {
         et_goods_title = findViewById(R.id.et_goods_title);
         et_cover_url = findViewById(R.id.et_cover_url);
+        et_video_url = findViewById(R.id.et_video_url);
         et_desc = findViewById(R.id.et_desc);
         et_reason = findViewById(R.id.et_reason);
         et_old_price = findViewById(R.id.et_old_price);
@@ -109,6 +111,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
     private void initGoods() {
         et_goods_title.setText(mGoodsBean.title);
         et_cover_url.setText(mGoodsBean.coverImageUrl);
+        et_video_url.setText(mGoodsBean.videoUrl);
         et_desc.setText(mGoodsBean.description);
         et_reason.setText(mGoodsBean.reason);
         et_old_price.setText(String.valueOf(mGoodsBean.oldPrice));
@@ -130,6 +133,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
             case R.id.btn_add_goods:
                 String title = et_goods_title.getEditableText().toString();
                 String coverUrl = et_cover_url.getEditableText().toString();
+                String videoUrl = et_video_url.getEditableText().toString();
                 String description = et_desc.getEditableText().toString();
                 String reason = et_reason.getEditableText().toString();
                 long oldPrice = Long.parseLong(et_old_price.getEditableText().toString());
@@ -150,6 +154,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
                 }
                 mGoodsBean.title = title;
                 mGoodsBean.coverImageUrl = coverUrl;
+                mGoodsBean.videoUrl = videoUrl;
                 mGoodsBean.description = description;
                 mGoodsBean.reason = reason;
                 mGoodsBean.oldPrice = oldPrice;

+ 23 - 0
app/src/main/res/layout/activity_goods_add.xml

@@ -69,6 +69,29 @@
                     android:textSize="@dimen/text_normal_s" />
             </com.google.android.material.textfield.TextInputLayout>
 
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="体验视频URL"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_video_url"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
             <com.google.android.material.textfield.TextInputLayout
                 style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                 android:layout_width="match_parent"